var ZoomLimit=40000,IMGDIR="/images",BROWSER={},USERAGENT=navigator.userAgent.toLowerCase();browserVersion({"ie":"msie","firefox":"","chrome":"","opera":"","safari":"","maxthon":"","mozilla":"","webkit":""});if(BROWSER.safari)BROWSER.firefox=true;BROWSER.opera=BROWSER.opera?opera.version():0;var JSMENU=[];JSMENU["active"]=[];JSMENU["timer"]=[];JSMENU["drag"]=[];JSMENU["layer"]=0;function browserVersion(types){var other=1;for(i in types){var v=types[i]?types[i]:i;if(USERAGENT.indexOf(v)!=-1){var re=new RegExp(v+"(\\/|\\s)([\\d\\.]+)","ig"),matches=re.exec(USERAGENT),ver=matches!=null?matches[2]:0;other=ver!==0?0:other}else ver=0;eval("BROWSER."+i+"= ver")}BROWSER.other=other}function getEvent(){if(document.all)return window.event;func=getEvent.caller;while(func!=null){var $=func.arguments[0];if($)if(($.constructor==Event||$.constructor==MouseEvent)||(typeof($)=="object"&&$.preventDefault&&$.stopPropagation))return $;func=func.caller}return null}function isUndefined($){return typeof $=="undefined"?true:false}function in_array($,_){if(typeof $=="string"||typeof $=="number")for(var A in _)if(_[A]==$)return true;return false}function $($){return!$?null:document.getElementById($)}function thumbImg(C){if(!C)return;C.onload=null;file=C.src;zw=C.offsetWidth;zh=C.offsetHeight;if(zw<2){if(!C.id)C.id="img_"+Math.random();setTimeout("thumbImg($('"+C.id+"'), "+method+")",100);return}zr=zw/zh;var B=isUndefined(B)?"600":B,A=B.split("%");if(A.length>1){fixw=$("wrap").clientWidth-200;if(A[0])fixw=fixw*A[0]/100;else if(A[1])fixw=fixw<A[1]?fixw:A[1]}else fixw=A[0];if(zw>fixw){zw=fixw;zh=zw/zr}if(!C.onclick){C.style.cursor="pointer";C.onclick=function(){zoom(C,C.src)}}C.width=zw;C.height=zh;var _=false;_=C.getAttribute("enter")=="enter";if(_){C.onclick();_attachEvent(document,"keydown",sendSnap)}}var zoomclick=0,zoomsrange=1;function zoom(E,H){H=!H?E.src:H;if(!E.id)E.id="img_"+Math.random();var _=false;_=E.getAttribute("enter")=="enter";var C=E.id+"_zmenu",B=$(C),F=C+"_img",I=C+"_zimg",A=(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-70;if(!B){B=document.createElement("div");B.id=C;var G=fetchOffset(E);B.innerHTML="<div onclick=\"$('append_parent').removeChild($('"+E.id+"_zmenu'))\" style=\"z-index:600;filter:alpha(opacity=50);opacity:0.5;background:#FFF;position:absolute;width:"+E.clientWidth+"px;height:"+E.clientHeight+"px;left:"+G["left"]+"px;top:"+G["top"]+"px\"><table width=\"100%\" height=\"100%\"><tr><td valign=\"middle\" align=\"center\"><img src=\""+IMGDIR+"/loading.gif\" /></td></tr></table></div><div style=\"position:absolute;top:-100000px;display:none\"><img id=\""+F+"\" src=\""+H+"\"></div>";$("append_parent").appendChild(B);$(F).onload=function(){$(F).parentNode.style.display="";var L=$(F).width,K=$(F).height,J=L/K,E=document.body.clientWidth*0.95;E=L>E?E:L;var M=E/J;if(M>A){M=A;E=M*J}M=parseInt(M);E=parseInt(E);if(E*M<=ZoomLimit)zoomsrange=0;else zoomsrange=1;$("append_parent").removeChild(B);B=document.createElement("div");B.id=C;B.style.overflow="visible";B.style.width=(E<300?300:E)+20+"px";B.style.height=M+50+"px";var G="<div class=\"zoominner\"><p><span>";if(_)G+="<a href=\"#\" id=\""+C+"_enter\" class=\"imgenter\" title=\"\u53d1\u9001\u56fe\u7247\"></a>";G+="<a href=\""+H+"\" class=\"imglink\" target=\"_blank\" title=\"\u5728\u65b0\u7a97\u53e3\u6253\u5f00\"></a><a href=\"#\" id=\""+C+"_adjust\" class=\"imgadjust\" title=\"\u5b9e\u9645\u5927\u5c0f\"></a><a href=\"#\" onclick=\"hideMenu();return false\" class=\"imgclose\" title=\"\u5173\u95ed\"></a></span>\u9f20\u6807\u6eda\u8f6e\u7f29\u653e\u56fe\u7247";if(_)G+="&nbsp;\u6572\u56de\u8f66\u53d1\u9001\u622a\u56fe";G+="</p><div align=\"center\" onmousedown=\"zoomclick=1\" onmousemove=\"zoomclick=2\" onmouseup=\"if(zoomclick==1) hideMenu()\"><img id=\""+I+"\" src=\""+H+"\" width=\""+E+"\" height=\""+M+"\" w=\""+L+"\" h=\""+K+"\"></div></div>";B.innerHTML=G;$("append_parent").appendChild(B);$(C+"_adjust").onclick=function($){D($,1)};if(_)$(C+"_enter").onclick=function(){try{hideMenu();getSnapshotParam2()}catch($){}return false};if(BROWSER.ie)B.onmousewheel=D;else B.addEventListener("DOMMouseScroll",D,false);showMenu({"menuid":C,"cover":1,"fade":1,"drag":C,"maxh":A+70})}}else showMenu({"menuid":C,"cover":1,"fade":1,"drag":C,"maxh":B.clientHeight});if(BROWSER.ie)doane(event);var D=function(A,F){var E=$(I).getAttribute("w"),D=$(I).getAttribute("h"),G=E/10,_=D/10;if(!F){if(!A)A=window.event;if(A.altKey||A.shiftKey||A.ctrlKey)return;if(zoomsrange){if(A.wheelDelta<=0||A.detail>0){if($(I).width-G<=200||$(I).height-_<=200){doane(A);return}$(I).width-=G;$(I).height-=_}else{if($(I).width+G>=E){doane(A);return}$(I).width+=G;$(I).height+=_}}else if(A.wheelDelta<=0||A.detail>0){if($(I).width-G<=E){doane(A);return}$(I).width-=G;$(I).height-=_}else{if($(I).width+G>=640||$(I).height+_>=600){doane(A);return}$(I).width+=G;$(I).height+=_}}else{$(I).width=E;$(I).height=D}B.style.width=(parseInt($(I).width<300?300:parseInt($(I).width))+20)+"px";B.style.height=(parseInt($(I).height)+50)+"px";setMenuPosition(C);doane(A)}}function showMenu(H){var D=isUndefined(H["menuid"])?"":H["menuid"],_=$(D);if(!_)return;var F=isUndefined(H["layer"])?1:H["layer"],L=isUndefined(H["maxh"])?600:H["maxh"],C=isUndefined(H["cache"])?0:H["cache"],E=isUndefined(H["drag"])?"":H["drag"],A=E&&$(E)?$(E):_,B=isUndefined(H["fade"])?0:H["fade"],I=isUndefined(H["cover"])?0:H["cover"],N=100;N=I?N+200:N;if(typeof JSMENU["active"][F]=="undefined")JSMENU["active"][F]=[];hideMenu(F);var M=function($,_,A){_=_?_:window.event;if(A==1){if(in_array(BROWSER.ie?_.srcElement.tagName:_.target.tagName,["TEXTAREA","INPUT","BUTTON","SELECT"]))return;JSMENU["drag"]=[_.clientX,_.clientY];JSMENU["drag"][2]=parseInt($.style.left);JSMENU["drag"][3]=parseInt($.style.top);document.onmousemove=function(_){try{M($,_,2)}catch(A){}};document.onmouseup=function(_){try{M($,_,3)}catch(A){}};doane(_)}else if(A==2&&JSMENU["drag"][0]){var B=[_.clientX,_.clientY];$.style.left=(JSMENU["drag"][2]+B[0]-JSMENU["drag"][0])+"px";$.style.top=(JSMENU["drag"][3]+B[1]-JSMENU["drag"][1])+"px";doane(_)}else if(A==3){JSMENU["drag"]=[];document.onmousemove=null;document.onmouseup=null}};if(!_.initialized){_.initialized=true;_.layer=F;_.cover=I;_.style.position="absolute";_.style.zIndex=N+F;_.onclick=function($){if(!$||BROWSER.ie){window.event.cancelBubble=true;return window.event}else{$.stopPropagation();return $}};if(I){var J=document.createElement("div");J.id=D+"_cover";J.style.position="absolute";J.style.zIndex=_.style.zIndex-1;J.style.left=J.style.top="0px";J.style.width="100%";J.style.height=document.documentElement.offsetHeight+"px";J.style.backgroundColor="#000";J.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)";J.style.opacity=0.5;$("append_parent").appendChild(J);_attachEvent(window,"load",function(){J.style.height=document.body.offsetHeight+"px"},document)}}if(E){A.style.cursor="move";A.onmousedown=function(A){try{M(_,A,1)}catch($){}}}_.style.display="";if(I)$(D+"_cover").style.display="";if(B){var G=0,K=function(B){try{var A=null;if(B==100){clearTimeout(A);return}_.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+B+")";_.style.opacity=B/100;B+=10;A=setTimeout(function(){K(B)},50)}catch($){A=null}};K(G);_.fade=true}else _.fade=false;setMenuPosition(D);if(L&&_.scrollHeight>L){_.style.height=L+"px";if(BROWSER.opera)_.style.overflow="auto";else _.style.overflowY="auto"}if(!in_array(D,JSMENU["active"][F]))JSMENU["active"][F].push(D);_.cache=C;if(F>JSMENU["layer"])JSMENU["layer"]=F}function setMenuPosition(C,B){var _=C?$(C):null;if(!_)return;if(isUndefined(B))B=0;var F=0,A=0;F=(document.body.clientWidth-_.clientWidth)/2;A=(document.documentElement.clientHeight-_.clientHeight)/2;var E=Math.max(document.documentElement.scrollTop,document.body.scrollTop),D=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);if(B==0)if(BROWSER.ie&&BROWSER.ie<7){if(B==0){A+=E;F=(document.documentElement.clientWidth-_.clientWidth)/2}}else _.style.position="fixed";if(F)_.style.left=parseInt(F)+"px";if(A)_.style.top=parseInt(A)+"px";if(B==0&&BROWSER.ie&&!document.documentElement.clientHeight){_.style.position="absolute";_.style.top=(document.body.clientHeight-_.clientHeight)/2+"px"}if(_.style.clip&&!BROWSER.opera)_.style.clip="rect(auto, auto, auto, auto)"}function doane($){e=$?$:window.event;if(!e)e=getEvent();if(e&&BROWSER.ie){e.returnValue=false;e.cancelBubble=true}else if(e){e.stopPropagation();e.preventDefault()}}function _attachEvent(B,_,A,$){$=!$?B:$;if(B.addEventListener)B.addEventListener(_,A,false);else if($.attachEvent)B.attachEvent("on"+_,A)}function _detachEvent(B,_,A,$){$=!$?B:$;if(B.removeEventListener)B.removeEventListener(_,A,false);else if($.detachEvent)B.detachEvent("on"+_,A)}function fetchOffset(C,E){var $=0,B=0,E=!E?0:E;if(C.getBoundingClientRect&&!E){var D=C.getBoundingClientRect(),A=Math.max(document.documentElement.scrollTop,document.body.scrollTop),_=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);if(document.documentElement.dir=="rtl")_=_+document.documentElement.clientWidth-document.documentElement.scrollWidth;$=D.left+_-document.documentElement.clientLeft;B=D.top+A-document.documentElement.clientTop}if($<=0||B<=0){$=C.offsetLeft;B=C.offsetTop;while((C=C.offsetParent)!=null){if(E==2&&C.style.position=="absolute")continue;$+=C.offsetLeft;B+=C.offsetTop}}return{"left":$,"top":B}}function hideMenu(D){try{D=isUndefined(D)?"":D;if(D==""){for(var G=1;G<=JSMENU["layer"];G++)hideMenu(G);return}else if(typeof D=="number"){for(var F in JSMENU["active"][D])hideMenu(JSMENU["active"][D][F]);return}else if(typeof D=="string"){var _=$(D);if(!_)return;_.onclick=null;clearTimeout(JSMENU["timer"][D]);var B=function(){if(_.cache){_.style.display="none";if(_.cover)$(D+"_cover").style.display="none"}else{_.parentNode.removeChild(_);if(_.cover)$(D+"_cover").parentNode.removeChild($(D+"_cover"))}var A=[];for(var B in JSMENU["active"][_.layer])if(D!=JSMENU["active"][_.layer][B])A.push(JSMENU["active"][_.layer][B]);JSMENU["active"][_.layer]=A;_detachEvent(document,"keydown",sendSnap)};if(_.fade){var E=100,C=function(D){var $=null;try{if(D==0){clearTimeout($);B();return}_.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+D+")";_.style.opacity=D/100;D-=10;$=setTimeout(function(){C(D)},50)}catch(A){$=null}};C(E)}else B()}}catch(A){}}function sendSnap($){try{if(!$)$=window.event;if($.keyCode==13){hideMenu();getSnapshotParam2()}}catch($){}return false}
