var Exf_PicViewer={iscreate:false};Exf_PicViewer.RightMenus=function(a){if(this.config.menus!=null){this.config.menus.show(a)}return false};Exf_PicViewer.GetScroll=function(){var e=(document.getElementById)?true:false;var d=navigator.userAgent.toLowerCase();var c=((d.indexOf("msie")!=-1)&&(d.indexOf("opera")==-1)&&(d.indexOf("omniweb")==-1));var a=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var b=new Object();b.left=c?a.scrollLeft:window.pageXOffset;b.top=c?a.scrollTop:window.pageYOffset;return b};Exf_PicViewer.show=function(a){this.pics=a.pics;this.config=a;if(!this.iscreate){this.iscreate=true;this.picbg=$("<div style='position:absolute;top:0px;left:0px;background-color:#000;filter:alpha(opacity=60);opacity: 0.6;display:none;' oncontextmenu='return Exf_PicViewer.RightMenus(event)'></div>");this.picbody=$("<div style='position:absolute;display:none;background-color:#FFF;padding:5px;' oncontextmenu='return Exf_PicViewer.RightMenus(event);'><div style='text-align:center;line-height:18px;background-color:#777;color:#FFF;margin-bottom:2px'>[<span style='cursor:pointer' onclick='Exf_PicViewer.hide()'>\u5173\u95ed</span>]</div><img /></div>");this.picloading=$("<div style='position:absolute;top:0;left:0;display:none;background-color:#FFF;line-height:40px;width:120px;text-align:center;border:1px solid #000;' oncontextmenu='return false;'>\u56fe\u7247\u52a0\u8f7d\u4e2d...</div>");$(document.body).append(this.picbg);$(document.body).append(this.picbody);$(document.body).append(this.picloading);this.picbg.bind("dblclick",{obj:this},function(d){var c=d.data.obj;c.hide()});this.picbody.bind("dblclick",{obj:this},function(d){var c=d.data.obj;c.hide()})}else{}Exf_PicViewer.IsIE6=$.browser.msie&&$.browser.version=="6.0";if(!Exf_PicViewer.IsIE6){Exf_PicViewer.picbody.css("position","fixed");Exf_PicViewer.picloading.css("position","fixed");Exf_PicViewer.picbg.css("position","fixed")}Exf_PicViewer.RePoint();Exf_PicViewer.imgloaded=false;this.picbg.fadeIn(200);this.m_width=$(window).width();this.m_height=$(window).height();Exf_PicViewer.img=new Image();Exf_PicViewer.img.src=this.pics[0];var b=function(){Exf_PicViewer.picloading.hide();Exf_PicViewer.picbody.show();Exf_PicViewer.ReSize(Exf_PicViewer.img.width,Exf_PicViewer.img.height,Exf_PicViewer.img.src);Exf_PicViewer.imgloaded=true};Exf_PicViewer.picloading.show();Exf_PicViewer.img.onerror=function(){Exf_PicViewer.picloading.text("\u52a0\u8f7d\u56fe\u7247\u5931\u8d25.");setTimeout(Exf_PicViewer.hide,1000)};if(Exf_PicViewer.img.complete){b()}else{Exf_PicViewer.picloading.text("\u6b63\u5728\u52a0\u8f7d\u4e2d.");Exf_PicViewer.img.onload=function(){b()}}$(window).bind("resize",Exf_PicViewer.RePoint)};Exf_PicViewer.ReSize=function(e,f,a){var c=$(window).width();var j=$(window).height();_width=c-50,_height=j-50;var i,d;if(e/f>=_width/_height){if(e>_width){i=_width;d=(f*_width)/e}else{i=e;d=f}}else{if(f>_height){d=_height;i=(e*_height)/f}else{i=e;d=f}}var b=Exf_PicViewer.picbody.children("img");b.attr("src",a);b.attr("title","");b.width(i);b.height(d);if(Exf_PicViewer.IsIE6){var g=Exf_PicViewer.GetScroll();Exf_PicViewer.picbody.css({left:((c/2)-(Exf_PicViewer.picbody.width()/2)-5)+g.left,top:((j/2)-(Exf_PicViewer.picbody.height()/2)-5)+g.top})}else{Exf_PicViewer.picbody.css({left:((c/2)-(Exf_PicViewer.picbody.width()/2)-5),top:((j/2)-(Exf_PicViewer.picbody.height()/2)-5)})}};Exf_PicViewer.RePoint=function(){if(Exf_PicViewer.IsIE6){var b=function(){var d=$(window).width();var f=$(window).height();var e=Exf_PicViewer.GetScroll();Exf_PicViewer.picloading.css({left:d/2-Exf_PicViewer.picloading.width()/2+e.left,top:f/2-Exf_PicViewer.picloading.height()/2+e.top});Exf_PicViewer.picbg.css({width:d+e.left,height:f+e.top});Exf_PicViewer.timer=setTimeout(b,100);if(Exf_PicViewer.imgloaded){Exf_PicViewer.ReSize(Exf_PicViewer.img.width,Exf_PicViewer.img.height,Exf_PicViewer.img.src)}};if(Exf_PicViewer.timer==null){b()}}else{var a=$(window).width();var c=$(window).height();Exf_PicViewer.picbg.css({width:a+30,height:c+30});Exf_PicViewer.picloading.css({left:a/2-Exf_PicViewer.picloading.width()/2,top:c/2-Exf_PicViewer.picloading.height()/2});if(Exf_PicViewer.imgloaded){Exf_PicViewer.ReSize(Exf_PicViewer.img.width,Exf_PicViewer.img.height,Exf_PicViewer.img.src)}}};Exf_PicViewer.hide=function(){$(window).unbind("resize",Exf_PicViewer.RePoint);clearTimeout(Exf_PicViewer.timer);Exf_PicViewer.timer=null;Exf_PicViewer.picbg.hide();Exf_PicViewer.picbody.hide();Exf_PicViewer.picloading.hide()};
