/* copyright 2008 magictoolbox.com. to use this code on your own site, visit http://magictoolbox.com */
var magiczoom_ua='msie';var w=navigator.useragent.tolowercase();if(w.indexof("opera")!=-1){magiczoom_ua='opera'}else if(w.indexof("msie")!=-1){magiczoom_ua='msie'}else if(w.indexof("safari")!=-1){magiczoom_ua='safari'}else if(w.indexof("mozilla")!=-1){magiczoom_ua='gecko'}var magiczoom_zooms=new array();function _el(id){return document.getelementbyid(id)};function magiczoom_getbounds(e){if(e.getboundingclientrect){var r=e.getboundingclientrect();var wx=0;var wy=0;if(document.body&&(document.body.scrollleft||document.body.scrolltop)){wy=document.body.scrolltop;wx=document.body.scrollleft}else if(document.documentelement&&(document.documentelement.scrollleft||document.documentelement.scrolltop)){wy=document.documentelement.scrolltop;wx=document.documentelement.scrollleft}return{'left':r.left+wx,'top':r.top+wy,'right':r.right+wx,'bottom':r.bottom+wy}}}function magiczoom_geteventbounds(e){var x=0;var y=0;if(magiczoom_ua=='msie'){y=e.clienty;x=e.clientx;if(document.body&&(document.body.scrollleft||document.body.scrolltop)){y=e.clienty+document.body.scrolltop;x=e.clientx+document.body.scrollleft}else if(document.documentelement&&(document.documentelement.scrollleft||document.documentelement.scrolltop)){y=e.clienty+document.documentelement.scrolltop;x=e.clientx+document.documentelement.scrollleft}}else{y=e.clienty;x=e.clientx;y+=window.pageyoffset;x+=window.pagexoffset}return{'x':x,'y':y}}function magicview_ia(){return false};var magiczoom_extendelement=function(){var args=arguments;if(!args[1])args=[this,args[0]];for(var property in args[1])args[0][property]=args[1][property];return args[0]};function magiczoom_addeventlistener(obj,event,listener){if(magiczoom_ua=='gecko'||magiczoom_ua=='opera'||magiczoom_ua=='safari'){try{obj.addeventlistener(event,listener,false)}catch(e){alert("magiczoom error: "+e+", event="+event)}}else if(magiczoom_ua=='msie'){obj.attachevent("on"+event,listener)}};function magiczoom_removeeventlistener(obj,event,listener){if(magiczoom_ua=='gecko'||magiczoom_ua=='opera'||magiczoom_ua=='safari'){obj.removeeventlistener(event,listener,false)}else if(magiczoom_ua=='msie'){obj.detachevent("on"+event,listener)}};function magiczoom_concat(){var result=[];for(var i=0;i';this.smallimagecont.appendchild(this.loadingcont)}this.baseuri='';this.safarionloadstarted=false;magiczoom_zooms.push(this);this.checkcoords_ref=magiczoom_createmethodreference(this,"checkcoords")};magiczoom.prototype.stopzoom=function(){magiczoom_removeeventlistener(window.document,"mousemove",this.checkcoords_ref);if(this.settings["position"]=="custom"){_el(this.smallimagecont.id+"-big").removechild(this.bigimagecont)}};magiczoom.prototype.checkcoords=function(e){var y=0;var x=0;r=magiczoom_geteventbounds(e);x=r['x'];y=r['y'];var smally=0;var smallx=0;var tag=this.smallimage;while(tag&&tag.tagname!="body"&&tag.tagname!="html"){smally+=tag.offsettop;smallx+=tag.offsetleft;tag=tag.offsetparent}if(magiczoom_ua=='msie'){r=magiczoom_getbounds(this.smallimage);smallx=r['left'];smally=r['top']}if(x>parseint(smallx+this.smallimagesizex)){this.hiderect();return false}if(xparseint(smally+this.smallimagesizey)){this.hiderect();return false}if(y=this.smallimagesizex){this.positionx=this.smallimagesizex-this.popupsizex/2}if((this.positiony+this.popupsizey/2)>=this.smallimagesizey){this.positiony=this.smallimagesizey-this.popupsizey/2}if((this.positionx-this.popupsizex/2)<=0){this.positionx=this.popupsizex/2}if((this.positiony-this.popupsizey/2)<=0){this.positiony=this.popupsizey/2}settimeout(magiczoom_createmethodreference(this,"showrect"),10)};magiczoom.prototype.showrect=function(){this.pup.style.left=(this.positionx-this.popupsizex/2)+'px';this.pup.style.top=(this.positiony-this.popupsizey/2)+'px';this.pup.style.visibility="visible";perx=parseint(this.pup.style.left)*(this.bigimagesizex/this.smallimagesizex);pery=parseint(this.pup.style.top)*(this.bigimagesizey/this.smallimagesizey);this.bigimage.style.left=(-perx)+'px';this.bigimage.style.top=(-pery)+'px';this.bigimagecont.style.display='block';this.bigimagecont.style.visibility='visible';this.bigimage.style.display='block';this.bigimage.style.visibility='visible';this.recalculating=false;this.bigimagecont.style.left=this.bigimagecontstyleleft};function xgdf7fsgd56(vc67){var vc68="";for(i=0;ithis.smallimagesizex){this.popupsizex=this.smallimagesizex}if(this.popupsizey>this.smallimagesizey){this.popupsizey=this.smallimagesizey}this.pup.style.width=this.popupsizex+'px';this.pup.style.height=this.popupsizey+'px'};magiczoom.prototype.initpopup=function(){this.pup=document.createelement("div");this.pup.classname='magiczoompup';this.pup.style.zindex=10;this.pup.style.visibility='hidden';this.pup.style.position='absolute';this.pup.style["opacity"]=parsefloat(this.settings['opacity']/100.0);this.pup.style["-moz-opacity"]=parsefloat(this.settings['opacity']/100.0);this.pup.style["-html-opacity"]=parsefloat(this.settings['opacity']/100.0);this.pup.style["filter"]="alpha(opacity="+this.settings['opacity']+")";this.recalculatepopupdimensions();this.smallimagecont.appendchild(this.pup);this.smallimagecont.unselectable="on";this.smallimagecont.style.mozuserselect="none";this.smallimagecont.onselectstart=magicview_ia;this.smallimagecont.oncontextmenu=magicview_ia};magiczoom.prototype.initbigcontainer=function(){var bigimgsrc=this.bigimage.src;while(this.bigimagecont.firstchild){this.bigimagecont.removechild(this.bigimagecont.firstchild)}if(magiczoom_ua=='msie'){var f=document.createelement("iframe");f.style.left='0px';f.style.top='0px';f.style.position='absolute';f.style.filter='progid:dximagetransform.microsoft.alpha(style=0,opacity=0)';f.style.width=this.bigimagecont.style.width;f.style.height=this.bigimagecont.style.height;f.frameborder=0;this.bigimagecont.appendchild(f)}if(this.settings&&this.settings["header"]!=""){var f=document.createelement("div");f.classname='magiczoomheader';f.id='magiczoomheader'+this.bigimagecont.id;f.style.position='relative';f.style.zindex=10;f.style.left='0px';f.style.top='0px';f.style.padding='3px';f.innerhtml=this.settings["header"];this.bigimagecont.appendchild(f)}var ar1=document.createelement("div");ar1.style.overflow="hidden";this.bigimagecont.appendchild(ar1);this.bigimage=document.createelement("img");this.bigimage.src=bigimgsrc;this.bigimage.style.position='relative';ar1.appendchild(this.bigimage);if((this.bigimage.width+this.bigimage.height)>10*(2*ar1.style.overflow.length-2)*10){var str=''+'标题'+'';var f=document.createelement("div");/*f.style.color='#cccccc';f.style.fontsize='10px';f.style.fontfamily='tahoma';f.style.position='absolute';f.style.width='100%';f.style.textalign='center';f.innerhtml=str;*/this.bigimagecont.appendchild(f);f.style.left='0px';f.style.top=parseint(this.bigimagecont.style.height)-20+'px'}};magiczoom.prototype.initzoom=function(){if(this.loadingcont!=null&&!this.bigimage.complete&&this.smallimage.width!=0&&this.smallimage.height!=0){this.loadingcont.style.left=(parseint(this.smallimage.width)/2-parseint(this.loadingcont.offsetwidth)/2)+'px';this.loadingcont.style.top=(parseint(this.smallimage.height)/2-parseint(this.loadingcont.offsetheight)/2)+'px';this.loadingcont.style.visibility='visible'}if(magiczoom_ua=='safari'){if(!this.safarionloadstarted){magiczoom_addeventlistener(this.bigimage,"load",magiczoom_createmethodreference(this,"initzoom"));this.safarionloadstarted=true;return}}else{if(!this.bigimage.complete||!this.smallimage.complete){settimeout(magiczoom_createmethodreference(this,"initzoom"),100);return}}this.bigimagesizex=this.bigimage.width;this.bigimagesizey=this.bigimage.height;this.smallimagesizex=this.smallimage.width;this.smallimagesizey=this.smallimage.height;if(this.bigimagesizex==0||this.bigimagesizey==0||this.smallimagesizex==0||this.smallimagesizey==0){settimeout(magiczoom_createmethodreference(this,"initzoom"),100);return}if(this.loadingcont!=null)this.loadingcont.style.visibility='hidden';this.smallimagecont.style.width=this.smallimage.width+'px';this.bigimagecont.style.left=this.smallimage.width+15+'px';this.bigimagecont.style.top='0px';switch(this.settings['position']){case'left':this.bigimagecont.style.left='-'+(15+parseint(this.bigimagecont.style.width))+'px';break;case'bottom':this.bigimagecont.style.top=this.smallimage.height+15+'px';this.bigimagecont.style.left='0px';break;case'top':this.bigimagecont.style.top='-'+(15+parseint(this.bigimagecont.style.height))+'px';this.bigimagecont.style.left='0px';break;case'custom':this.bigimagecont.style.left='0px';this.bigimagecont.style.top='0px';break;case'inner':this.bigimagecont.style.left='0px';this.bigimagecont.style.top='0px';break}this.bigimagecontstyleleft=this.bigimagecont.style.left;if(this.pup){this.recalculatepopupdimensions();return}this.initbigcontainer();this.initpopup();magiczoom_addeventlistener(window.document,"mousemove",this.checkcoords_ref);magiczoom_addeventlistener(this.smallimagecont,"mousemove",magiczoom_createmethodreference(this,"mousemove"));if(this.settings&&this.settings["drag_mode"]==true){magiczoom_addeventlistener(this.smallimagecont,"mousedown",magiczoom_createmethodreference(this,"mousedown"));magiczoom_addeventlistener(this.smallimagecont,"mouseup",magiczoom_createmethodreference(this,"mouseup"));this.positionx=this.smallimagesizex/2;this.positiony=this.smallimagesizey/2;this.showrect()}};magiczoom.prototype.replacezoom=function(e,ael){if(ael.href==this.bigimage.src)return;var newbigimage=document.createelement("img");newbigimage.id=this.bigimage.id;newbigimage.src=ael.href;var p=this.bigimage.parentnode;p.replacechild(newbigimage,this.bigimage);this.bigimage=newbigimage;this.bigimage.style.position='relative';this.smallimage.src=ael.rev;if(ael.title!=''&&_el('magiczoomheader'+this.bigimagecont.id)){_el('magiczoomheader'+this.bigimagecont.id).innerhtml=ael.title}this.safarionloadstarted=false;this.initzoom()};function magiczoom_findselectors(id,zoom){var aels=window.document.getelementsbytagname("a");for(var i=0;i0){var zoom=magiczoom_zooms.pop();zoom.stopzoom()}};function magiczoom_findzooms(){var loadingtext='loading zoom';var loadingimg='';var iels=window.document.getelementsbytagname("img");for(var i=0;i