﻿//////////////////////////////////////////////////////////////////加载基础信息
//showInfoFromServer();
//////////////////////////////////////////////////////////////////
function RefreshImgAndVideo()
{
//

 /////////////////////////////////////////////////////////////////////////////图片显示
 //显示图片的原始div
 $(".ShowImgDiv").css("cursor","pointer");//鼠标手型
 $('.ShowImgDiv') .each(function () { //点击触发
 var NowID=$(this).attr("ref");
 //
 $(this).removeClass("ShowImgDiv");//去除本层的类，防止再二次刷新时更新此图片
 //请求基础层
 var html = $.ajax({
  url: '/ShowImg.aspx?AttrID='+NowID,
  async: false
}).responseText; 
  //把基础层加到原始div
 $(this).append(html);
 //基础层的显示区点击事件
 $(this).children(".BigImgFrom").click(
 function(){
     createTopLayer();//打开遮罩基础层
     $(this).parent().children(".BigImgView").load("/ShowImg.aspx?IsBig=1&AttrID="+$(this).attr("ref")).show(); });//加载大图片
     $(this).children(".BigImgView").click(
        function() 
                {//大图片点击事件
                     ClearTopLayer();//大图片点击后关闭遮罩基础层
                     $(this).hide("slow"); //大图片收回
                 });
            });
 ////////////////////////////////////////////////////////////////////////////////////////////////////视频显示
  //显示图片的原始div
 $(".showVideoBase").css("cursor","pointer");//鼠标手型
 $('.showVideoBase') .each(function () { //点击触发
 var NowID=$(this).attr("ref");
 //alert(NowID);
 //
 $(this).removeClass("showVideoBase");//去除本层的类，防止再二次刷新时更新此
 //请求基础层
 var html = $.ajax({
  url: '/ShowVideo.aspx?AttrID='+NowID,
  async: false
}).responseText; 
  //把基础层加到原始div
 $(this).append(html);
 //基础层的显示区点击事件
 $(this).children(".BigViedoFrom").click(
 function(){
     createTopLayer();//打开遮罩基础层
     $(this).parent().children(".ShowVideoDiv").load("/ShowVideo.aspx?IsBig=1&AttrID="+$(this).attr("ref")).show(); });//加载大视频
     $(this).children(".ShowVideoDiv").click(
        function() 
                {//大图片点击事件
                    //alert("BeginClosexxx");
                     ClearTopLayer();//大图片点击后关闭遮罩基础层
                     $(this).html("");
                     $(this).hide("slow"); //大图片收回
                 });
            });

////////////////////////////////////////////////////////////////////////////////////////////////////////
    $('.SmallViewItem').click( function () { 
   createTopLayer();
    $(this).parent().children(".BigViewItem").show("slow");
    var Linkqu=$(this).parent().children('.BigViewItem').children(".BigViewRealConent").attr('ref');
    var NewDivInfo='<iframe src="/ShowMap.aspx'+Linkqu+'" class="BigFrame"  frameborder="0" scrolling="no"></iframe>';
   $(this).parent().children('.BigViewItem').children(".BigViewRealConent").html(NewDivInfo);
    //alert($(this).parent().children('.BigViewItem').children(".BigViewRealConent").attr('ref')) ;
    });
    
    
      $('.BigViewTitle').click( function () {  
    $(this).parent().hide("slow");
    ClearTopLayer();
    });            
            
}
 
RefreshImgAndVideo();
