var zoomFlag=1;var ZOOM_IN_ON_CLASS="btn_in_on";var ZOOM_IN_OFF_CLASS="btn_in_off";var ZOOM_OUT_ON_CLASS="btn_out_on";var ZOOM_OUT_OFF_CLASS="btn_out_off";var ZOOM_RESET_ON_CLASS="btn_reset_on";var ZOOM_RESET_OFF_CLASS="btn_reset_off";function init_zoom_images(a,b,e,c){if(typeof(c)=="undefined"){c=e;}if(document.getElementById("zoomViewerDiv")===null){if(b=="true"){if(document.getElementById("productImage")){document.getElementById("productImage").style.display="none";}var l=0;for(var f in a){var g=a[f];if(g.numScale>0){var m=new Array(g.numScale);for(var d in g.scaleLevels){m[d]=new MediaServicesZoomScale(g.scaleLevels[d].scaleWidth,g.scaleLevels[d].scaleHeight,g.scaleLevels[d].tileSize);}if(l===0&&g.variant=="MAIN"){DynAPI.addZoomViewer("http://"+g.URL,e,c,g.width,g.height,g.version,g.rmType,m);l=1;}zoomRegisterImage("product_image_"+g.variant,"http://"+g.URL,g.height,g.width,g.version,g.rmType,m);}}if(document.getElementById("zoomControls")){document.getElementById("zoomControls").style.display="block";document.getElementById("zoomControls").style.top=(c-25)+"px";}}}}function browserZoomIn(a){zoomFlag=1;if(a===undefined){DynAPI.view.zoomIn();}else{DynAPI.view.zoomInByLevel(a);}}function browserZoomOut(a){zoomFlag=-1;if(a===undefined){DynAPI.view.zoomOut();}else{DynAPI.view.zoomOutByLevel(a);}}function browserZoomReset(){if(zoomEnabled=="true"){zoomFlag=0;DynAPI.view.reset();if(window.slider!==undefined){if(slider.getValue()!=sliderInitPos){slider.setValue(sliderInitPos);}}document.getElementById("zoomInControl").className=ZOOM_IN_ON_CLASS;document.getElementById("zoomOutControl").className=ZOOM_OUT_OFF_CLASS;if(document.getElementById("zoomResetControl")!==null){document.getElementById("zoomResetControl").className=ZOOM_RESET_OFF_CLASS;}zoomFlag=1;}}var registeredImages=new Object();function registerImage(c,b,a){imageObj=new Image();imageObj.src=b;registeredImages[c]=new Object();registeredImages[c].image=imageObj;registeredImages[c].index=a;}var zoomRegisteredImages=new Object();function zoomRegisterImage(g,e,a,d,b,c,f){zoomRegisteredImages[g]=new Object();zoomRegisteredImages[g].image=e;zoomRegisteredImages[g].height=a;zoomRegisteredImages[g].width=d;zoomRegisteredImages[g].version=b;zoomRegisteredImages[g].type=c;zoomRegisteredImages[g].scaleLevels=f;}function setZoomButtons(d){var c=document.getElementById("zoomInControl");var a=document.getElementById("zoomOutControl");var f=document.getElementById("zoomResetControl");if(c!==null&&a!==null){if(window.sliderZoom!==undefined&&sliderZoom==1){sliderZoom=0;return;}var e=DynAPI.view.getZoomLevel();if(e==-1||d){c.className=ZOOM_IN_ON_CLASS;a.className=ZOOM_OUT_OFF_CLASS;if(f!==null){f.className=ZOOM_RESET_OFF_CLASS;}if(window.topLayerId!==undefined){var b=document.getElementById("DynObject"+topLayerId);if(b!==undefined){b.style.cursor="pointer";}}if(window.slider!==undefined&&!isNaN(slider.getValue())){zoomFlag=1;sliderDragged=0;prevSliderPos=bottomConstraint;slider.setValue(sliderInitPos);sliderDragged=1;}}else{if(e==1){c.className=ZOOM_IN_OFF_CLASS;a.className=ZOOM_OUT_ON_CLASS;if(f!==null){f.className=ZOOM_RESET_ON_CLASS;}if(window.slider!==undefined&&!isNaN(slider.getValue())){zoomFlag=1;sliderDragged=0;prevSliderPos=topConstraint;slider.setValue(topConstraint);sliderDragged=1;}}else{a.className=ZOOM_OUT_ON_CLASS;c.className=ZOOM_IN_ON_CLASS;if(f!==null){f.className=ZOOM_RESET_ON_CLASS;}if(window.topLayerId!==undefined&&window.dragEndCursor!==undefined){var b=document.getElementById("DynObject"+topLayerId);if(b!==undefined){b.style.cursor=dragEndCursor;}}if(window.slider!==undefined&&!isNaN(slider.getValue())){sliderDragged=0;if(zoomFlag==1){prevSliderPos=slider.getValue()-keyIncrement;slider.setValue(prevSliderPos);}else{if(zoomFlag==-1){prevSliderPos=slider.getValue()+keyIncrement;slider.setValue(prevSliderPos);zoomFlag=1;}}sliderDragged=1;}}}}}var selectedImageID="product_image_MAIN";function displayImage(a){if(a==selectedImageID){return;}selectedImageID=a;if(zoomRegisteredImages[a]===undefined){if(document.getElementById("zoomViewerDiv")!==null){browserZoomReset();document.getElementById("zoomViewHolder").style.display="none";}document.getElementById("productImage").style.display="";document.getElementById("productImage").src=largeImages[a.substr(14)];return;}else{document.getElementById("productImage").style.display="none";document.getElementById("zoomViewHolder").style.display="inline";DynAPI.view.setZoomImage(zoomRegisteredImages[a].image,zoomRegisteredImages[a].width,zoomRegisteredImages[a].height,zoomRegisteredImages[a].version,zoomRegisteredImages[a].type,zoomRegisteredImages[a].scaleLevels);document.getElementById("zoomInControl").className=ZOOM_IN_ON_CLASS;document.getElementById("zoomOutControl").className=ZOOM_OUT_OFF_CLASS;document.getElementById("zoomResetControl").className=ZOOM_RESET_OFF_CLASS;return;}}var topLayerId;function Browser(){var a=navigator.appName;if(a.indexOf("Netscape")!=-1){this.b="ns";}else{if((a=="Opera")||(navigator.userAgent.indexOf("Opera")>0)){this.b="opera";}else{if(a=="Microsoft Internet Explorer"){this.b="ie";}}}if(!a){alert("Unidentified browser.\nThis browser is not supported,");}this.version=navigator.appVersion;this.v=parseInt(this.version);this.ns=(this.b=="ns"&&this.v>=4);this.ns4=(this.b=="ns"&&this.v==4);this.ns6=(this.b=="ns"&&this.v==5);this.ie=(this.b=="ie"&&this.v>=4);this.ie4=(this.version.indexOf("MSIE 4")>0);this.ie5=(this.version.indexOf("MSIE 5")>0);this.ie55=(this.version.indexOf("MSIE 5.5")>0);this.ie6=(this.version.indexOf("MSIE 6.0")>0);this.opera=(this.b=="opera");this.dom=(document.createElement&&document.appendChild&&document.getElementsByTagName)?true:false;this.def=(this.ie||this.dom);var c=navigator.userAgent.toLowerCase();if(c.indexOf("win")>-1){this.platform="win32";}else{if(c.indexOf("mac")>-1){this.platform="mac";}else{this.platform="other";}}}is=new Browser();DynObject=function(){this.setID("DynObject"+(DynObject.Count++));this.isChild=false;this.created=false;this.parent=null;this.children=[];this.eventListeners=[];this.hasEventListeners=false;};DynObject.prototype.getClass=function(){return this.constructor;};DynObject.prototype.setID=function(a){if(this.id){delete DynObject.all[this.id];}this.id=a;DynObject.all[this.id]=this;};DynObject.prototype.addChild=function(a){if(a.isChild){a.parent.removeChild(a);}a.isChild=true;a.parent=this;if(this.created){a.create();}this.children[this.children.length]=a;return a;};DynObject.prototype.removeChild=function(d){var a=this.children.length;for(var b=0;b<a&&this.children[b]!=d;b++){}if(b!=a){d.invokeEvent("beforeremove");d.specificRemove();d.created=false;d.invokeEvent("remove");d.isChild=false;d.parent=null;this.children[b]=this.children[a-1];this.children[a-1]=null;this.children.length--;}};DynObject.prototype.deleteFromParent=function(){if(this.parent){this.parent.deleteChild(this);}};DynObject.prototype.removeFromParent=function(){if(this.parent){this.parent.removeChild(this);}};DynObject.prototype.create=function(){this.flagPrecreate();this.specificCreate();this.created=true;var a=this.children.length;for(var b=0;b<a;b++){this.children[b].create();}this.invokeEvent("create");};DynObject.prototype.flagPrecreate=function(){if(this.precreated){return;}var a=this.children.length;for(var b=0;b<a;b++){this.children[b].flagPrecreate();}this.invokeEvent("precreate");this.precreated=true;};DynObject.prototype.del=function(){this.deleteAllChildren();this.invokeEvent("beforeremove");this.specificRemove();this.precreated=this.created=false;this.invokeEvent("remove");this.invokeEvent("delete");};DynObject.prototype.deleteChild=function(d){var a=this.children.length;for(var b=0;b<a&&this.children[b]!=d;b++){}if(b!=a){this.children[b]=this.children[a-1];this.children[a-1]=null;this.children.length--;d.del();d=null;}};DynObject.prototype.deleteAllChildren=function(){var a=this.children.length;for(var b=0;b<a;b++){this.children[b].del();delete this.children[b];}this.children=[];};DynObject.prototype.toString=function(){return"DynObject.all."+this.id;
};DynObject.prototype.getAll=function(){var d=[];var b;var a=this.children.length;for(var e=0;e<a;e++){d[this.children[e].id]=this.children[e];b=this.children[e].getAll();for(var c in b){d[c]=b[c];}}return d;};DynObject.prototype.isParentOf=function(b,a){if(!b){return false;}return(a&&this==b)||this.getAll()[b.id]==b;};DynObject.prototype.isChildOf=function(b,a){if(!b){return false;}return(a&&this==b)||b.getAll()[this.id]==this;};DynObject.prototype.specificCreate=function(){};DynObject.prototype.specificRemove=function(){};DynObject.prototype.invokeEvent=function(){};DynObject.Count=0;DynObject.all=[];Methods={removeFromArray:function(f,b,e){var d=(typeof(b)=="object")?b:f[b];if(e){delete f[d.id];}else{for(var c=0;c<f.length;c++){if(f[c]==d){if(f.splice){f.splice(c,1);}else{for(var a=c;a<f.length-1;a++){f[a]=f[a+1];}f.length-=1;}break;}}}return f;},getContainerLayerOf:function(a){if(!a){return null;}if(is.def&&!is.ie){while(!a.lyrobj&&a.parentNode&&a.parentNode!=a){a=a.parentNode;}}else{if(is.ie){while(!a.lyrobj&&a.parentElement&&a.parentElement!=a){a=a.parentElement;}}}return a.lyrobj;}};DynAPIObject=function(){this.DynObject=DynObject;this.DynObject();this.loaded=false;this.librarypath="";this.packages=[];this.errorHandling=false;this.returnErrors=false;this.onLoadCodes=[];this.onUnLoadCodes=[];this.onResizeCodes=[];};DynAPIObject.prototype=new DynObject();DynAPIObject.prototype.setLibraryPath=function(a){if(a.substring(a.length-1)!="/"){a+="/";}this.librarypath=a;};DynAPIObject.prototype.addPackage=function(a){if(this.packages[a]){return;}this.packages[a]={libs:[]};};DynAPIObject.prototype.addLibrary=function(d,c){var b=d.substring(0,d.indexOf("."));if(!b){alert("DynAPI Error: Incorrect DynAPI.addLibrary usage");return;}var a=d.substring(d.indexOf(".")+1);if(!this.packages[b]){this.addPackage(b);}if(this.packages[b].libs[a]){alert("DynAPI Error: Library "+a+" already exists");return;}this.packages[b].libs[a]=c;};DynAPIObject.prototype.include=function(g,f){g=g.split(".");if(g[g.length-1]=="js"){g.length-=1;}var e=f||this.librarypath||"";if(e.substr(e.length-1)!="/"){e+="/";}var d=g[0];var a=g[1];var c=g[2];if(c=="*"){if(this.packages[d]){group=this.packages[d].libs[a];}if(group){for(var b=0;b<group.length;b++){document.write('<script language="Javascript1.2" src="'+e+d+"/"+a+"/"+group[b]+'.js"><\/script>');}}else{alert("include()\n\nThe following package could not be loaded:\n"+g+"\n\nmake sure you specified the correct path.");}}else{document.write('<script language="Javascript1.2" src="'+e+g.join("/")+'.js"><\/script>');}};DynAPIObject.prototype.errorHandler=function(c,a,b){if(!this.loaded||!this.errorHandling){return false;}if(is.ie){b-=1;alert("DynAPI reported an error\n\nError in project: '"+a+"'.\nLine number: "+b+".\n\nMessage: "+c);}else{if(is.ns){alert("DynAPI reported an error\n\nError in file: '"+a+"'.\nLine number: "+b+".\n\nMessage: "+c);}else{return false;}}return this.returnErrors;};DynAPIObject.prototype.addLoadFunction=function(a){this.onLoadCodes[this.onLoadCodes.length]=a;};DynAPIObject.prototype.addUnLoadFunction=function(a){this.onUnLoadCodes[this.onUnLoadCodes.length]=a;};DynAPIObject.prototype.addResizeFunction=function(a){this.onResizeCodes[this.onResizeCodes.length]=a;};DynAPIObject.prototype.loadHandler=function(){this.create();eval(this.onLoadCodes.join(";"));if(this.onLoad){this.onLoad();}this.loaded=true;};DynAPIObject.prototype.unloadHandler=function(){if(!is.ns4){this.deleteAllChildren();}eval(this.onUnLoadCodes.join(";"));if(this.onUnload){this.onUnload();}};DynAPIObject.prototype.resizeHandler=function(){eval(this.onResizeCodes.join(";"));if(this.onResize){this.onResize();}};DynAPIObject.prototype.addZoomViewer=function(e,f,b,d,a,c,g,l){document.writeln("<div id='zoomViewerDiv' stype='cursor:hand' align=left style='position:relative;width:"+f+"px;height:"+b+"px;'>");document.writeln("<div id='zoomViewerDiv' style='cursor:hand' align=left style='position:absolute;width:"+f+"px;height:"+b+"px;'>");DynAPI.view=new MediaServicesZoomView(e+".",f,b,d,a,c,g,l);DynAPI.document.addChild(DynAPI.view);DynAPI.onLoad=function(){DynAPI.view.initialize();};document.writeln("</div>");document.writeln("</div>");};DynAPI=new DynAPIObject();onload=function(){DynAPI.loadHandler();};onunload=function(){DynAPI.unloadHandler();};onerror=function(c,a,b){DynAPI.errorHandler(c,a,b);};onresize=function(){DynAPI.resizeHandler();};DynDocument=function(a){this.DynObject=DynObject;this.DynObject();this.elm=a;this.doc=a.document;this.frame=a;this.fgColor=this.doc.fgColor||"";this.bgColor=this.doc.bgColor||"";this.elm.lyrobj=this;this.doc.lyrobj=this;};DynDocument.prototype=new DynObject();DynDocument.prototype.isDynDocument=true;DynDocument.prototype.getBgColor=function(){return this.bgColor;};DynDocument.prototype.specificCreate=function(){this.findDimensions();if(is.ie){this.elm.all=this.doc.all;}this.assignChildren();DynAPI.addResizeFunction(this+".resizeHandler()");};DynDocument.prototype._Old_addChild=DynDocument.prototype.addChild;DynDocument.prototype.addChild=function(a){if(!this.created){this.doc.write(a.getOuterHTML());}return this._Old_addChild(a);};DynDocument.prototype.addInflowChild=function(a){if(!this.created){this.doc.write(a.getOuterHTML(true));}return this._Old_addChild(a);};DynDocument.prototype.specificRemove=function(){this.elm=null;this.doc=null;this.frame=null;};DynDocument.prototype.getX=function(){return 0;};DynDocument.prototype.getY=function(){return 0;};DynDocument.prototype.getPageX=function(){return 0;};DynDocument.prototype.getPageY=function(){return 0;};DynDocument.prototype.getWidth=function(){if(!this.w){this.findDimensions();}return this.w;};DynDocument.prototype.getHeight=function(){if(!this.h){this.findDimensions();}return this.h;};DynDocument.prototype.findDimensions=function(){this.w=(is.ns||is.opera)?this.elm.innerWidth:this.doc.body.clientWidth;this.h=(is.ns||is.opera)?this.elm.innerHeight:this.doc.body.clientHeight;if(is.ns&&this.frame.parent.frames.length>1){if(is.ns4){this.w=this.w+4;this.h=this.h+4;}else{this.h=this.h-2;}}};DynDocument.prototype.setBgColor=function(a){if(a==null){a="";}if(is.ns4&&a==""){a="#ffffff";}this.bgColor=a;this.doc.bgColor=a;};DynDocument.prototype.setFgColor=function(a){if(a==null){a="";}if(is.ns4&&a==""){a="#ffffff";}this.fgColor=a;this.doc.fgColor=a;};DynDocument.prototype.load=function(a){this.doc.location=a;};DynDocument.prototype.resizeHandler=function(){var a=this.w;var c=this.h;this.findDimensions();if(is.ns4&&((this.w!=a)||(this.h!=c))){for(var b=0;b<this.children.length;b++){this.children[b].elm=null;this.children[b].specificCreate();}}};if(DynLayer){DynDocument.prototype.assignChildren=DynLayer.prototype.assignChildren;}DynAPI.document=DynAPI.addChild(new DynDocument(self));DynAPI.document.all=DynObject.all;function DynLayer(){this.DynObject=DynObject;this.DynObject();var b=arguments;if(b[0]){this.setID(b[0]);}this.x=b[1]||0;this.y=b[2]||0;this.w=b[3]||null;this.h=b[4]||null;this.bgColor=b[5]||null;this.visible=(b[6]!=false&&b[6]!="hidden");this.z=b[7]||0;this.bgImage=b[8]||null;this.html=b[9]||null;this.elm=null;this.doc=null;this.css=null;}DynLayer.prototype=new DynObject();DynLayer.prototype.isDynLayer=true;DynLayer.prototype.specificCreate=function(){if(!this.parent||this.elm||this.wasBuiltInline){return;}if(is.ns6){var b=(this.parent.isDynLayer)?this.parent.elm:this.parent.doc.body;var e=b.ownerDocument.createRange();e.setStartBefore(b);var d=e.createContextualFragment(this.getOuterHTML());b.appendChild(d);this.elm=b.lastChild;this.css=this.elm.style;this.doc=this.parent.doc;this.css.zIndex=this.z;this.css.cursor="pointer";}else{if(is.ie){var b=(this.parent.isDynLayer)?this.parent.elm:this.parent.doc.body;b.insertAdjacentHTML("beforeEnd",this.getOuterHTML());this.elm=b.children[b.children.length-1];this.css=this.elm.style;this.doc=this.parent.doc;this.css.cursor="hand";}else{if(is.ns4){var a=this.parent.doc.recycled;if(this.created){a=[];}if(a&&a.length>0){this.elm=a[a.length-1];
a.length--;}else{this.elm=new Layer(this.w,this.parent.elm);this.elm.captureEvents(Event.LOAD);this.elm.onload=function(){};}this.css=this.elm;this.doc=this.elm.document;this.doc.lyrobj=this;if(this.w){this.css.clip.width=(is.def&&is.ns)?this.w+"px":this.w;}if(this.h){this.css.clip.height=(is.def&&is.ns)?this.h+"px":this.h;}this.elm.moveTo(this.x,this.y);this.doc.write(this.getInnerHTML());this.doc.close();if(this.bgColor!=null){this.setBgColor(this.bgColor);}if(this.bgImage!=null){this.setBgImage(this.bgImage);}if(this.clip){this.setClip(this.clip);}this.css.cursor="pointer";this.css.zIndex=this.z;this.css.visibility=this.visible?"inherit":"hide";for(var c=0;c<this.doc.images.length;c++){this.doc.images[c].lyrobj=this;}for(c=0;c<this.doc.links.length;c++){this.doc.links[c].lyrobj=this;}}}}this.frame=this.parent.frame;this.elm.lyrobj=this;this.assignChildren();if(this.html!=null){if(this.w==null&&this.getContentWidth()>0){this.setWidth(this.getContentWidth(),false);}if(this.h==null&&this.getContentHeight()>0){this.setHeight(this.getContentHeight(),false);}}};DynLayer.prototype.assignChildren=function(){var a=this.children.length;if(is.def){for(var c=0;c<a;c++){var e=this.children[c];if(is.ie){var d=this.elm.all[e.id];}else{var d=this.doc.getElementById(e.id);}e.elm=d;e.css=e.elm.style;e.doc=this.doc;e.elm.lyrobj=e;e.frame=this.frame;e.assignChildren();if(e.z){e.css.zIndex=e.z;}if(e.w==null&&e.getContentWidth()>0){e.setWidth(e.getContentWidth(),false);}if(e.h==null&&e.getContentHeight()>0){e.setHeight(e.getContentHeight(),false);}}}else{if(is.ns4){for(var c=0;c<a;c++){var e=this.children[c];var d=this.doc.layers[e.id]||this.doc.layers[e.id+"C"].document.layers[e.id];e.elm=d;e.css=d;e.doc=d.document;e.doc.lyrobj=e;e.elm.lyrobj=e;for(var b=0;b<e.doc.images.length;b++){e.doc.images[b].lyrobj=e;}for(b=0;b<e.doc.links.length;b++){e.doc.links[b].lyrobj=e;}e.assignChildren();if(e.z){e.css.zIndex=e.z;}if(e.w==null&&e.getContentWidth()>0){e.setWidth(e.getContentWidth(),false);}if(e.h==null&&e.getContentHeight()>0){e.setHeight(e.getContentHeight(),false);}}}}};if(DynDocument){DynDocument.prototype.assignChildren=DynLayer.prototype.assignChildren;}DynLayer.prototype.specificRemove=function(){if(is.def&&this.elm){this.elm.style.visibility="hidden";this.elm.innerHTML="";this.elm.outerHTML="";}else{if(is.ns4&&this.elm){if(!this.wasBuiltInline){if(!this.parent.doc.recycled){this.parent.doc.recycled=[];}this.parent.doc.recycled[this.parent.doc.recycled.length]=this.elm;}this.wasBuiltInline=false;this.elm.visibility="hide";}}this.frame=null;this.elm=null;this.doc=null;this.css=null;};DynLayer.prototype.getInnerHTML=function(){var c="";if(this.html!=null){c+=this.html;}var a=this.children.length;for(var b=0;b<a;b++){c+=this.children[b].getOuterHTML();}return c;};if(is.def){DynLayer.prototype.getOuterHTML=function(c){var b='<div id="'+this.id+'" style="';if(this.visible==false){b+=" visibility:hidden;";}if(!c&&this.x!=null){b+=" left:"+this.x+"px;";}if(!c&&this.y!=null){b+=" top:"+this.y+"px;";}if(this.w!=null){b+=" width:"+Math.ceil(this.w)+"px;";}if(this.h!=null){b+=" height:"+this.h+"px;";}if(this.clip){b+=" clip:rect("+this.clip[0]+"px "+Math.ceil(this.clip[1])+"px "+this.clip[2]+"px "+this.clip[3]+"px);";}else{if(this.w!=null&&this.h!=null){b+=" clip:rect(0px "+Math.ceil(this.w)+"px "+this.h+"px 0px);";}}if(this.z!=null){b+=" z-index="+this.z+";";}if(this.bgImage!=null){b+=" background-image:url("+this.bgImage+");";}if(this.bgColor!=null){b+=" background-color:"+this.bgColor+";";}if(is.ie55&&this.bgImage==null&&this.html==null){b+=" background-image:url("+DynAPI.librarypath+"dynapi/images/common/transparent.gif);";}if(!c){b+=" position:absolute;";}else{b+=" position:relative;";}b+=' overflow:hidden">';if(this.html!=null){b+=this.html;}for(var a=0;a<this.children.length;a++){b+=this.children[a].getOuterHTML();}b+="</div>";return b;};}else{if(is.ns4){DynLayer.prototype.getOuterHTML=function(c){var b="\n";if(c){this.wasBuiltInline=true;b+='<ilayer id="'+this.id+'C"';if(this.w!=null){b+=" width="+this.w+"px";}if(this.h!=null){b+=" height="+this.h+"px";}b+='">';}b+='<layer id="'+this.id+'"';if(this.visible==false){b+=' visibility="hide"';}if(!c&&this.x!=null){b+=" left="+this.x;}if(!c&&this.y!=null){b+=" top="+this.y;}if(this.w!=null){b+=" width="+this.w+"px";}if(this.h!=null){b+=" height="+this.h+"px";}if(this.clip){b+=' clip="'+this.clip[3]+","+this.clip[0]+","+this.clip[1]+","+this.clip[2]+'"';}else{if(this.w!=null&&this.h!=null){b+=' clip="0,0,'+this.w+","+this.h+'"';}}if(this.z!=null){b+=" zIndex="+this.z;}if(this.bgImage!=null){b+=' background="'+this.bgImage+'"';}if(this.bgColor!=null){b+=' bgcolor="'+this.bgColor+'"';}b+=">";if(this.html!=null){b+=this.html;}for(var a=0;a<this.children.length;a++){b+=this.children[a].getOuterHTML();}b+="</layer>";if(c){b+="</ilayer>\n";}return b;};}}DynLayer.prototype._dynlayer_create=DynLayer.prototype.create;DynLayer.prototype.create=function(){this._dynlayer_create();this.invokeEvent("resize");};if(is.ns){DynLayer.prototype._setX=function(){this.css.left=this.x+"px";};DynLayer.prototype._setY=function(){this.css.top=this.y+"px";};}else{DynLayer.prototype._setX=function(){this.css.pixelLeft=this.x;};DynLayer.prototype._setY=function(){this.css.pixelTop=this.y;};}DynLayer.prototype.moveTo=function(a,b){if(a!=null){this.x=a;}if(b!=null){this.y=b;}if(this.css==null){return;}this._setX();this._setY();this.invokeEvent("move");};DynLayer.prototype.moveBy=function(a,b){this.moveTo(this.x+a,this.y+b);};DynLayer.prototype.setX=function(a){this.moveTo(a,null);};DynLayer.prototype.setY=function(a){this.moveTo(null,a);};DynLayer.prototype.getX=function(){return this.x;};DynLayer.prototype.getY=function(){return this.y;};DynLayer.prototype.getPageX=function(){if(this.css==null){return null;}if(is.ns4){return this.css.pageX;}else{return(this.isChild)?this.parent.getPageX()+this.x:this.x;}};DynLayer.prototype.getPageY=function(){if(this.css==null){return null;}if(is.ns4){return this.css.pageY;}else{return(this.isChild)?this.parent.getPageY()+this.y:this.y;}};DynLayer.prototype.setPageX=function(a){if(this.css==null){return;}if(is.ns4){this.css.pageX=a;}if(is.ie){if(this.isChild){this.setX(a-this.parent.getPageX());}else{this.setX(a);}}this.getX();this.invokeEvent("move");};DynLayer.prototype.setPageY=function(a){if(this.css==null){return;}if(is.ns4){this.css.pageY=a;}if(is.ie){if(this.isChild){this.setY(a-this.parent.getPageY());}else{this.setY(a);}}this.getY();this.invokeEvent("move");};DynLayer.prototype.setVisible=function(a){this.visible=a;if(this.css==null){return;}this.css.visibility=a?"inherit":(is.ns4?"hide":"hidden");};DynLayer.prototype.getVisible=function(){return this.visible;};DynLayer.prototype.setZIndex=function(a){this.z=a;if(this.css==null){return;}this.css.zIndex=a;};DynLayer.prototype.getZIndex=function(){return this.z;};DynLayer.prototype.setBgImage=function(a){this.bgImage=a;if(this.css==null){return;}if(is.ns4){this.elm.background.src=a;if(!a){this.setBgColor(this.getBgColor());}}else{this.css.backgroundImage="url("+a+")";}};DynLayer.prototype.getBgImage=function(){return this.bgImage;};DynLayer.prototype.setBgColor=function(a){if(a==null){if(is.ns4){a=null;}else{a="transparent";}}this.bgColor=a;if(this.css==null){return;}if(is.ns4){this.doc.bgColor=a;}else{this.css.backgroundColor=a;}};DynLayer.prototype.getBgColor=function(){return this.bgColor;};if(is.ns4){DynLayer.prototype._setHTML=function(b){var c=(this.w==null)?"<NOBR>"+this.html+"</NOBR>":this.html;this.doc.open();this.doc.write(c);this.doc.close();for(var a=0;a<this.doc.images.length;a++){this.doc.images[a].lyrobj=this;}for(a=0;a<this.doc.links.length;a++){this.doc.links[a].lyrobj=this;}};}else{if(is.ie){DynLayer.prototype._setHTML=function(c){if(is.platform=="mac"){c+="\n";}this.elm.innerHTML=c;var a=this.elm.all.tags("img");for(var b=0;b<a.length;b++){a[b].lyrobj=this;}};}else{DynLayer.prototype._setHTML=function(a){sTmp=(this.w==null)?"<NOBR>"+this.html+"</NOBR>":this.html;
while(this.elm.hasChildNodes()){this.elm.removeChild(this.elm.firstChild);}var b=this.elm.ownerDocument.createRange();b.selectNodeContents(this.elm);b.collapse(true);var c=b.createContextualFragment(sTmp);this.elm.appendChild(c);};}}DynLayer.prototype.setHTML=function(a,b){this.html=a?a:"";if(this.css==null){return;}if(b!=false){this.invokeEvent("beforeload");}this._setHTML(a);if(b!=false){this.invokeEvent("load");}};DynLayer.prototype.getHTML=function(){return this.html;};DynLayer.prototype.setSize=function(a,b,c){this.w=(a===null)?this.w:a<0?0:a;this.h=(b===null)?this.h:b<0?0:b;if(this.w===null&&this.h===null){return;}if(this.css!=null){if(is.ns4){this.css.clip.width=this.w+"px";this.css.clip.height=this.h+"px";}else{this.css.width=is.ns?this.w+"px":this.w;this.css.height=is.ns?this.h+"px":this.h;this.css.clip="rect(0px "+(this.w||0)+"px "+(this.h||0)+"px 0px)";}}if(c!=false){this.invokeEvent("resize");}};DynLayer.prototype.setNoFlickerSize=function(a,b,c){if(c===undefined){c=true;}if(!is.ie&&DynAPI.document.doc.images[this.id+"Image"]){this.setSize(a,b,false);DynAPI.document.doc.images[this.id+"Image"].width=a;DynAPI.document.doc.images[this.id+"Image"].height=b;}else{this.setSize(a,b,c);}};DynLayer.prototype.setWidth=function(a,b){this.w=(a===null)?this.w:a<0?0:a;if(this.w===null){return;}if(this.css!=null){if(is.ns4){this.css.clip.width=this.w+"px";}else{this.css.width=is.ns?this.w+"px":this.w;this.css.clip="rect(0px "+(this.w||0)+"px "+(this.h||0)+"px 0px)";}}if(b!=false){this.invokeEvent("resize");}};DynLayer.prototype.setHeight=function(a,b){this.h=(a===null)?this.h:a<0?0:a;if(this.h===null){return;}if(this.css!=null){if(is.ns4){this.css.clip.height=this.h+"px";}else{this.css.height=is.ns?this.h+"px":this.h;this.css.clip="rect(0px "+(this.w||0)+"px "+(this.h||0)+"px 0px)";}}if(b!=false){this.invokeEvent("resize");}};DynLayer.prototype.getWidth=function(){return this.w;};DynLayer.prototype.getHeight=function(){return this.h;};DynLayer.prototype.getContentWidth=function(){if(this.elm===null){return 0;}else{if(is.ns4){return this.doc.width;}else{if(is.ie){if(is.platform==="mac"){this.elm.offsetWidth=this.elm.offsetWidth;}return parseInt(this.elm.scrollWidth);}else{var b=this.elm.style.width;this.elm.style.width="auto";var a=this.elm.offsetWidth;this.elm.style.width=b;return a;}}}};DynLayer.prototype.getContentHeight=function(){if(this.elm===null){return 0;}else{if(is.ns4){return this.doc.height;}else{if(is.ie){if(is.platform==="mac"){this.elm.offsetHeight=this.elm.offsetHeight;}return parseInt(this.elm.scrollHeight);}else{var b=this.elm.style.height;this.elm.style.height="auto";var a=this.elm.offsetHeight;this.elm.style.height=b;return a;}}}};DynLayer.prototype.setClip=function(b){var e=this.getClip();for(var a=0;a<b.length;a++){if(b[a]==null){b[a]=e[a];}}this.clip=b;if(this.css==null){return;}var d=this.css.clip;if(is.ns4){d.top=b[0],d.right=b[1],d.bottom=b[2],d.left=b[3];}else{this.css.clip="rect("+b[0]+"px "+b[1]+"px "+b[2]+"px "+b[3]+"px)";}};DynLayer.prototype.getClip=function(){if(this.css==null||!this.css.clip){return[0,0,0,0];}var b=this.css.clip;if(b){if(is.ns4){return[b.top,b.right,b.bottom,b.left];}if(b.indexOf("rect(")>-1){b=b.split("rect(")[1].split(")")[0].split("px");for(var a=0;a<b.length;a++){b[a]=parseInt(b[a]);}return[b[0],b[1],b[2],b[3]];}else{return[0,this.w,this.h,0];}}};DynLayer.prototype.setMouseCursor=function(a){if(this.css==null){return 0;}if(is.ie&&a=="pointer"){this.css.cursor="hand";}else{this.css.cursor=a;}};DynEvent=function(a,c,b){this.type=a;this.src=c;this.target=b;this.bubble=false;};DynEvent.prototype.setBubble=function(a){this.bubble=a;};DynEvent.prototype.getType=function(){return this.type;};DynEvent.prototype.getSource=function(){return this.src;};DynEvent.prototype.getTarget=function(){return this.target;};DynEvent.prototype.preBubbleCode=function(){};EventListener=function(a){this.target=a;};EventListener.prototype.handleEvent=function(b,c,a){if(this["on"+b]){this["on"+b](c,a);}};DynObject.prototype.addEventListener=function(b){this.hasEventListeners=true;for(var a=0;a<this.eventListeners.length;a++){if(this.eventListeners[a]==b){return;}}this.eventListeners[this.eventListeners.length]=b;};DynObject.prototype.removeEventListener=function(a){Methods.removeFromArray(this.eventListeners,a,false);if(this.eventListeners.length==0){this.hasEventListeners=false;}};DynObject.prototype.removeAllEventListeners=function(){if(!this.hasEventListeners){return;}this.eventListeners=[];this.hasEventListeners=false;};DynObject.prototype.invokeEvent=function(c,d,a){if(!d){d=new DynEvent(c,this);}if(this.hasEventListeners){for(var b=0;b<this.eventListeners.length;b++){d.target=this.eventListeners[b].target;this.eventListeners[b].handleEvent(c,d,a);}}if(d.bubble&&this.parent){d.preBubbleCode();d.src=this.parent;this.parent.invokeEvent(c,d,a);}};DynObject.prototype._listeners_del=DynObject.prototype.del;DynObject.prototype.del=function(){this.removeAllEventListeners();this._listeners_del();};DynMouseEvent=function(a){this.DynEvent=DynEvent;this.DynEvent();if(a){for(var b in a){this[b]=a[b];}}};DynMouseEvent.prototype=new DynEvent();DynMouseEvent.prototype.preBubbleCode=function(){this.x+=this.src.x;this.y+=this.src.y;};DynMouseEvent.prototype.getX=function(){return this.x;};DynMouseEvent.prototype.getY=function(){return this.y;};DynMouseEvent.prototype.getPageX=function(){return this.pageX;};DynMouseEvent.prototype.getPageY=function(){return this.pageY;};DynMouseEvent.prototype.cancelBrowserEvent=function(){this.browserReturn=false;var a=DynMouseEvent._e;if(!is.ns4||a.type!="mousedown"){return;}var b=a.src;b.ns4clktimer=true;setTimeout(b+".ns4clktimer=false",300);};DynMouseEvent._e=new DynMouseEvent();DynMouseEvent.forceMouseUp=true;DynMouseEvent.EventMethod=function(g){var n=this.lyrobj;if(is.def){if(is.ie){var g=n.frame.event;}if(g.type!="mousemove"){g.cancelBubble=true;}if(DynAPI.wasDragging&&g.type=="click"){DynAPI.wasDragging=false;return false;}}if(is.def){var a=Methods.getContainerLayerOf(is.ie?g.srcElement:g.target)||n;}else{if(is.ns4){var a=g.target.lyrobj||n;}}if(!a){alert("Error in MouseEvents");return false;}if(is.def){if(g.type=="mouseout"&&a.isParentOf(Methods.getContainerLayerOf(is.ie?g.toElement:g.relatedTarget),true)){return true;}if(g.type=="mouseover"&&a.isParentOf(Methods.getContainerLayerOf(is.ie?g.fromElement:g.relatedTarget),true)){return true;}}var p=DynMouseEvent._e;var l=g.type;p.type=l;p.src=a;p.browserReturn=true;p.bubble=true;if(is.ns4&&l=="mouseover"){p.pageX=p.pageX;p.pageY=p.pageY;p.x=p.pageX-p.src.getPageX();p.y=p.pageY-p.src.getPageY();}else{p.pageX=is.ie?g.x+document.body.scrollLeft:g.pageX;p.pageY=is.ie?g.y+document.body.scrollTop:g.pageY;p.x=is.ie?p.pageX-p.src.getPageX():g.layerX;p.y=is.ie?p.pageY-p.src.getPageY():g.layerY;}var o=is.ie?g.button:g.which;if(is.ie){if(o==2){o=3;}else{if(o==4){o=2;}}}p.button=o;if(p.button==2&&(l=="mousedown"||l=="mouseup"||l=="mouseclick")){l=p.type="md"+l;}if(p.button==3&&(l=="mousedown"||l=="mouseup"||l=="mouseclick")){l=p.type="rt"+l;}if(is.def){p.altKey=(g.altKey||g.altLeft);p.ctrlKey=(g.ctrlKey||g.ctrlLeft);p.shiftKey=(g.shiftKey||g.shiftLeft);}else{if(is.ns4){var c=g.modifiers;p.altKey=(c==1||c==3||c==5||c==7);p.ctrlKey=(c==2||c==3||c==6||c==7);p.shiftKey=(c==4||c==5||c==6||c==7);}}p.orig=g;if(is.def){if(p.type=="mouseover"){var f=Methods.getContainerLayerOf(is.ie?g.fromElement:g.relatedTarget);if(f&&f.isChildOf(a.parent,true)){p.setBubble(false);}}if(p.type=="mouseout"){var d=Methods.getContainerLayerOf(is.ie?g.toElement:g.relatedTarget);if(d&&d.isChildOf(a.parent,true)){p.setBubble(false);}}}else{if(is.ns4&&(g.type=="mouseover"||g.type=="mouseout")){p.setBubble(false);}}if(DynMouseEvent.forceMouseUp&&is.def){if(g.type=="mousedown"){DynMouseEvent.focus=a;}else{if(g.type=="mouseup"&&DynMouseEvent.focus!=null){p.src=a=DynMouseEvent.focus;}}}a.invokeEvent(l,p);if(is.ns4){if(a.ns4clktimer&&l=="mouseup"){p.type=l="click";p.bubble=true;a.invokeEvent(l,p);
}if(is.platform=="other"&&l=="mousedown"){if(a.dbltimer!=null){p.type=l="dblclick";p.bubble=true;a.invokeEvent(l,p);}else{a.dbltimer=setTimeout(a+".dbltimer=null",300);}}if(g&&g.target.handleEvent&&g.target!=this&&(g.target.handleEvent(g)==false)){p.browserReturn=false;}}else{if(g.preventDefault&&!p.browserReturn){g.preventDefault();}if(p.type=="rtmouseup"){document.oncontextmenu=p.browserReturn?null:DynAPI.FalseFunction;}else{if(p.type=="mousedown"){document.onselectstart=p.browserReturn?null:DynAPI.FalseFunction;}}}if(!is.ie||p.browserReturn==false){return p.browserReturn;}};DynAPI.FalseFunction=function(){return false;};DynDocument.prototype.captureMouseEvents=function(){if(is.def&&!is.ie){this.doc.addEventListener("mousemove",DynMouseEvent.EventMethod,false);this.doc.addEventListener("mousedown",DynMouseEvent.EventMethod,false);this.doc.addEventListener("mouseup",DynMouseEvent.EventMethod,false);this.doc.addEventListener("mouseover",DynMouseEvent.EventMethod,false);this.doc.addEventListener("mouseout",DynMouseEvent.EventMethod,false);this.doc.addEventListener("click",DynMouseEvent.EventMethod,false);this.doc.addEventListener("dblclick",DynMouseEvent.EventMethod,false);}else{if(is.ns4){this.doc.captureEvents(Event.MOUSEMOVE|Event.MOUSEOVER|Event.MOUSEOUT|Event.MOUSEDOWN|Event.MOUSEUP|Event.CLICK|Event.DBLCLICK);}this.doc.onmouseover=this.doc.onmouseout=this.doc.onmousemove=this.doc.onmousedown=this.doc.onmouseup=this.doc.onclick=this.doc.ondblclick=DynMouseEvent.EventMethod;}};DynDocument.prototype.releaseMouseEvents=function(){if(is.def&&!is.ie){this.doc.removeEventListener("mousemove",DynMouseEvent.EventMethod,false);this.doc.removeEventListener("mousedown",DynMouseEvent.EventMethod,false);this.doc.removeEventListener("mouseup",DynMouseEvent.EventMethod,false);this.doc.removeEventListener("mouseover",DynMouseEvent.EventMethod,false);this.doc.removeEventListener("mouseout",DynMouseEvent.EventMethod,false);this.doc.removeEventListener("click",DynMouseEvent.EventMethod,false);this.doc.removeEventListener("dblclick",DynMouseEvent.EventMethod,false);}else{if(is.ns4){this.doc.releaseEvents(Event.MOUSEMOVE|Event.MOUSEOVER|Event.MOUSEOUT|Event.MOUSEDOWN|Event.MOUSEUP|Event.CLICK|Event.DBLCLICK);}this.doc.onmouseover=this.doc.onmouseout=this.doc.onmousemove=this.doc.onmousedown=this.doc.onmouseup=this.doc.onclick=this.doc.ondblclick=null;}};DynDocument.prototype._OldM_specificCreate=DynDocument.prototype.specificCreate;DynDocument.prototype.specificCreate=function(){this._OldM_specificCreate();this.captureMouseEvents();};DynDocument.prototype._OldM_specificRemove=DynDocument.prototype.specificRemove;DynDocument.prototype.specificRemove=function(){this.releaseMouseEvents();this._OldM_specificRemove();};function DragEvent(a,b){this.DynEvent=DynEvent;this.DynEvent();this.dragEnabled=true;}DragEvent.prototype=new DynEvent();DragEvent.prototype.getX=function(){return this.x;};DragEvent.prototype.getY=function(){return this.y;};DragEvent.prototype.getPageX=function(){return this.pageX;};DragEvent.prototype.getPageY=function(){return this.pageY;};DragEvent.prototype.cancelDrag=function(){this.dragEnabled=false;};DragEvent.dragPlay=0;DragEvent.dragevent=new DragEvent();DragEvent.lyrListener=new EventListener();DragEvent.lyrListener.onmousedown=function(d){if(is.def&&d.orig){var a=is.ie?d.orig.srcElement.tagName:d.orig.target.tagName;if(a=="INPUT"||a=="TEXTAREA"){return;}}d.cancelBrowserEvent();if(DragEvent.dragevent.src){return;}var b=d.getSource();if(is.ie){b.doc.body.onselectstart=function(){return false;};}if(window.dragStartCursor!=undefined){var c=document.getElementById("DynObject"+topLayerId);if(c!=undefined){c.style.cursor=dragStartCursor;}}var f=DragEvent.dragevent;f.type="dragstart";f.src=b;f.isDragging=false;f.x=d.getPageX()-d.getSource().getPageX();f.y=d.getPageY()-d.getSource().getPageY();f.pageX=d.getPageX();f.pageY=d.getPageY();f.parentPageX=b.parent.getPageX();f.parentPageY=b.parent.getPageY();};DragEvent.docListener=new EventListener();DragEvent.docListener.onmousemove=function(m){var s=DragEvent.dragevent;if(!s){return;}var f=s.src;if(!f){return;}if(f.frame&&f.frame.lyrobj!=m.getSource()){return;}if(!s.isDragging){if(DragEvent.dragPlay==0||(Math.abs(s.pageX-m.getPageX())-DragEvent.dragPlay>0)||(Math.abs(s.pageY-m.getPageY())-DragEvent.dragPlay>0)){s.isDragging=true;s.src.invokeEvent("dragstart",s);m.setBubble(s.bubble);}}if(!s.isDragging){return;}else{if(!s.dragEnabled){f.invokeEvent("mouseup");return;}}s.type="dragmove";s.pageX=m.getPageX();s.pageY=m.getPageY();var p=s.pageX-s.parentPageX-s.x;var n=s.pageY-s.parentPageY-s.y;if(f.dragBoundary){var d=f.dragBoundary;if(d=="parent"){var o=f.parent.getHeight();var a=f.parent.getWidth();var c=0;var u=0;}else{var o=d[2];var a=d[1];var c=d[3];var u=d[0];}var q=f.w;var g=f.h;if(p<c){p=c;}else{if(p+q>a){p=a-q;}}if(n<u){n=u;}else{if(n+g>o){n=o-g;}}}f.moveTo(p,n);f.invokeEvent("dragmove",s);m.cancelBrowserEvent();m.setBubble(s.bubble);};DragEvent.docListener.onmouseup=function(c){var d=DragEvent.dragevent;if(!d){return;}var a=d.src;if(!a){return;}if(window.dragEndCursor!=undefined){var b=document.getElementById("DynObject"+topLayerId);if(b!=undefined){if(DynAPI.view.getZoomLevel()==-1){b.style.cursor="pointer";}else{b.style.cursor=dragEndCursor;}}}if(!d.isDragging){d.type="dragend";d.src=null;c.setBubble(true);return;}if(is.ie){a.doc.body.onselectstart=null;}if(a.doc.forms.length>0){if(is.ie&&is.platform=="mac"){document.body.className=document.body.className;}else{if(is.ns4&&is.platform=="win32"){document.bgColor=document.bgColor;}}}if(is.def){DynAPI.wasDragging=true;}if(a.parent.DragDrop){a.parent.DragDrop(a,c);}d.type="dragend";d.isDragging=false;a.invokeEvent("dragend",d);d.src=null;c.cancelBrowserEvent();c.setBubble(d.bubble);};DragEvent.setDragBoundary=function(d,g,m,c,f){var e=arguments;if(e.length==0){return;}if(e.length==1){d.dragBoundary="parent";}else{if(e.length==5){d.dragBoundary=new Array(g,m,c,f);}}};DragEvent.enableDragEvents=function(a,b){if(!a.isDynLayer){return;}a.addEventListener(DragEvent.lyrListener);var c=b||DynAPI.document;if(a.frame){c=a.frame.lyrobj;}c.addEventListener(DragEvent.docListener);c.dragEnabled=true;};DragEvent.disableDragEvents=function(){for(var b=0;b<arguments.length;b++){var a=arguments[b];a.removeEventListener(DragEvent.lyrListener);}};DynKeyEvent=function(){this.DynEvent=DynEvent;this.DynEvent();};DynKeyEvent.prototype=new DynEvent();DynKeyEvent.prototype.getKey=function(){return this.charKey;};DynKeyEvent.prototype.bubbleEvent=function(){if(!this.bubble||this.src.isDynDocument||this.src.parent==null){return;}this.src=this.src.parent;this.src.invokeEvent(this.type,this);this.bubbleEvent();return;};DynKeyEvent.EventMethod=function(d){var b=this.lyrobj;if(is.def){if(is.ie){var d=b.frame.event;}else{if(d.eventPhase!=3){return false;}}d.cancelBubble=true;}if(is.def){var c=Methods.getContainerLayerOf(is.ie?d.srcElement:d.target)||b;}else{if(is.ns4){var c=d.target.lyrobj||b;}}if(!c){alert("Error in MouseEvents");return true;}var a=DynKeyEvent._e;a.type=d.type;a.src=c;a.browserReturn=true;a.bubble=true;a.which=(is.ns4)?d.which:d.keyCode;var f=String.fromCharCode(a.which).toLowerCase();if(((f>="a")&&(f<="z"))||((f>="0")&&(f<="9"))){a.charKey=f;}else{a.charKey=null;}a.ctrlKey=(is.ns4)?(d.modifiers&Event.CONTROL_MASK):(d.ctrlKey||d.ctrlLeft||d.keyCode==17);a.shiftKey=(is.ns4)?(d.modifiers&Event.SHIFT_MASK):(d.shiftKey||d.shiftLeft||d.keyCode==16);a.orig=d;c.invokeEvent(a.type,a);a.bubbleEvent();return a.browserReturn;};DynKeyEvent._e=new DynKeyEvent();DynDocument.prototype.captureKeyEvents=function(){if(is.def&&!is.ie){this.doc.addEventListener("keydown",DynKeyEvent.EventMethod,false);this.doc.addEventListener("keyup",DynKeyEvent.EventMethod,false);this.doc.addEventListener("keypress",DynKeyEvent.EventMethod,false);}else{if(is.ns4){this.doc.captureEvents(Event.KEYPRESS|Event.KEYDOWN|Event.KEYUP);}this.doc.onkeypress=this.doc.onkeydown=this.doc.onkeyup=DynKeyEvent.EventMethod;
}};DynDocument.prototype.releaseKeyEvents=function(){if(is.def&&!is.ie){this.doc.removeEventListener("keydown",DynKeyEvent.EventMethod,false);this.doc.removeEventListener("keyup",DynKeyEvent.EventMethod,false);this.doc.removeEventListener("keypress",DynKeyEvent.EventMethod,false);}else{if(is.ns4){this.doc.releaseEvents(Event.KEYPRESS|Event.KEYDOWN|Event.KEYUP);}this.doc.onkeypress=this.doc.onkeydown=this.doc.onkeyup=null;}};DynDocument.prototype._OldK_specificCreate=DynDocument.prototype.specificCreate;DynDocument.prototype.specificCreate=function(){this._OldK_specificCreate();this.captureKeyEvents();};DynDocument.prototype._OldK_specificRemove=DynDocument.prototype.specificRemove;DynDocument.prototype.specificRemove=function(){this.releaseKeyEvents();this._OldK_specificCreate();};DynObject.prototype.findLayers=function(){};DynLayer.prototype.updateValues=function(){if(is.def){this.x=this.elm.offsetLeft;this.y=this.elm.offsetTop;this.w=is.ie4?this.css.pixelWidth||this.getContentWidth():this.elm.offsetWidth;this.h=is.ie4?this.css.pixelHeight||this.getContentHeight():this.elm.offsetHeight;this.bgImage=this.css.backgroundImage;this.bgColor=this.css.backgroundColor;this.html=this.innerHTML=this.elm.innerHTML;}else{if(is.ns4){this.x=parseInt(this.css.left);this.y=parseInt(this.css.top);this.w=this.css.clip.width;this.h=this.css.clip.height;this.clip=[this.css.clip.top,this.css.clip.right,this.css.clip.bottom,this.css.clip.left];this.bgColor=this.doc.bgColor!="this.doc.bgColor"?this.doc.bgColor:null;this.bgImage=this.elm.background.src!=""?this.elm.background.src:null;this.html=this.innerHTML=this.elm.innerHTML="";}}this.z=this.css.zIndex;var a=this.css.visibility;this.visible=(a=="inherit"||a=="show"||a=="visible"||a=="");};Methods.isDirectChildOf=function(a,b){if(is.def&&!is.ie){for(var c=a.parentNode;c;c=c.parentNode){if(c.nodeName.toLowerCase()=="div"){return c==b;}}return !b.nodeName;}else{if(is.ie){for(var c=a.parentElement;c;c=c.parentElement){if(c.tagName.toLowerCase()=="div"){return c==b;}}return !b.tagName;}else{if(is.ns4){return(a.parentLayer==b);}}}};DynDocument.prototype._OldI_specificCreate=DynDocument.prototype.specificCreate;DynDocument.prototype.specificCreate=function(){this._OldI_specificCreate();this.findLayers();};DynLayer.prototype.setMaxSize=function(b,c){if(!this.created&&!b){return;}var a=h=0;if(this.created){a=(is.ns?this.doc.width:parseInt(this.elm.scrollWidth));h=(is.ns?this.doc.height:parseInt(this.elm.scrollHeight));}if(typeof(b)=="object"){a=(a>b.w?a:b.w);h=(h>b.h?h:b.h);}else{if(typeof(b)=="boolean"){c=b;}}this.setSize(a,h,c);};DynLayer.prototype.setPadding=function(a){this.pad=a;if(this.created){if(is.ie||is.ns6){this.elm.style.padding=a;}else{if(is.ns4){this.elm.padding=a;}}}};DynLayer.prototype.getPadding=function(){return this.pad;};DynLayer.prototype.getTopZIndex=function(){if(!this.origZIndex||typeof(this.origZIndex)!="number"){this.origZIndex=this.getZIndex();}var d=1,c,b;for(var a in this.parent.children){c=this.parent.children[a];b=c.getZIndex();if(d<=b){d=b+5;}}return d;};function Thread(a){this.DynObject=DynObject;this.DynObject();this.setDynLayer(a);}Thread.prototype=new DynObject;Thread.prototype.active=false;Thread.prototype.interval=50;Thread.prototype.cancelThread=false;Thread.prototype.sleep=function(a){this.interval=Math.abs(parseInt(a));if(this.active){this.stop();setTimeout(this+".start()",this.interval+1);}};Thread.prototype.setFPS=function(a){this.sleep(Math.floor(1000/a));};Thread.prototype.cancel=function(){this.cancelThread=true;this.stop();};Thread.prototype.start=function(){if(!this.active){this.active=true;if(!this.cancelThread){this.timer=setInterval(this+".run()",this.interval);}}};Thread.prototype.run=function(){};Thread.prototype.stop=function(){this.active=false;if(!this.cancelThread&&this.timer){clearInterval(this.timer);delete this.timer;}};Thread.prototype.setDynLayer=function(a){this.dlyr=a;};Thread.prototype.getDynLayer=function(){return this.dlyr;};function DynImage(){this.DynLayer=DynLayer;this.DynLayer();if(typeof(arguments[0])=="string"){this.setImageSrc(arguments[0]);}else{if(typeof(arguments[0])=="object"){this.setImage(arguments[0]);}else{this.img=null;}}if(this.img&&this.img.dynimages){this.img.dynimages[this.img.dynimages.length]=this;this.imgresize=true;}this.addEventListener(DynImage.listener);}DynImage.prototype=new DynLayer;DynImage.listener=new EventListener();DynImage.listener.onprecreate=function(a){var b=a.getSource();if(b.w!=null&&b.h!=null){b.setImage(b.img,true);}};DynImage.listener.onresize=function(a){var b=a.getSource();if(b.created){if(b.img){b.setImage(b.img,true);}}};DynImage.prototype.setAutoResize=function(a){this.autoResize=a;if(this.created){this.setImage(this.img);}};DynImage.prototype.setImage=function(b,d){if(!b){return;}this.img=b;if(this.created&&this.autoResize&&!d){if(this.img.width!=this.w&&this.img.height!=this.h){this.setNoFlickerSize(this.img.width,this.img.height,false);d=true;}}if(!this.created||d){var a=((this.w!=null&&this.h!=null))?" width="+this.w+" height="+this.h:"";var c=mainImageUrlForZoom==b.src?"main":"other";this.setHTML('<img name="'+this.id+'Image" src="'+b.src+'"'+a+" border=0 holder="+c+">");}else{if(this.created){this.doc.images[this.id+"Image"].src=this.img.src;}}};DynImage.prototype.getImage=function(a){return this.img;};DynImage.prototype.setImageSrc=function(a){if(a){this.setImage(DynImage.getImage(a));}};DynImage.prototype.getImageSrc=function(){return this.img?this.img.src:null;};DynImage.loadimages=[];DynImage.getImage=function(e,a,d){for(var c=0;c<DynImage.loadimages.length;c++){if(DynImage.loadimages[c].img.origsrc==e||DynImage.loadimages[c].img.src==e){return DynImage.loadimages[c].img;}}DynImage.loadimages[c]={};if(a&&d){DynImage.loadimages[c].img=new Image(a,d);}else{DynImage.loadimages[c].img=new Image();}DynImage.loadimages[c].img.name=e;var b=new Date();DynImage.loadimages[c].img.src=DynImage.loadimages[c].img.origsrc=e;DynImage.loadimages[c].img.dynimages=[];if(DynAPI.loaded&&!DynImage.timerId){DynImage.loaderStart();}return DynImage.loadimages[c].img;};DynImage.loaderStart=function(){DynImage.timerId=setTimeout("DynImage.loadercheck()",50);if(DynImage.onLoaderStart){DynImage.onLoaderStart();}};DynImage.loadercheck=function(){DynImage.ItemsDone=0;var a=DynImage.loadimages.length;for(var d=0;d<a;d++){if(DynImage.loadimages[d].img.complete){var c=new Date();DynImage.ItemsDone+=1;}}if(DynImage.ItemsDone<a){if(DynImage.onLoading){DynImage.onLoading();}DynImage.timerId=setTimeout("DynImage.loadercheck()",25);}else{for(var d=0;d<DynImage.loadimages.length;d++){if(DynImage.loadimages[d].img.dynimages){var e=DynImage.loadimages[d].img.dynimages.length;for(var b=e-1;b>=0;b--){if(DynImage.loadimages[d].img.dynimages[b].imgresize){DynImage.loadimages[d].img.dynimages[b].setNoFlickerSize(DynImage.loadimages[d].img.width,DynImage.loadimages[d].img.height,false);DynImage.loadimages[d].img.dynimages[b].imgresize=false;DynImage.loadimages[d].img.dynimages[b]=null;}}DynImage.loadimages[d].img.dynimages=null;}}if(DynImage.onLoaderDone){DynImage.onLoaderDone();}DynImage.timerId=null;}};DynAPI.addLoadFunction("DynImage.loaderStart()");DynLayer.prototype.debug=function(){var a="";a+="DynLayer: "+this.id+"\n";a+="-----------------------\n";a+="     Size: "+this.getWidth()+"x"+this.getHeight()+"\n";a+=" Position: "+this.getX()+","+this.getY()+"\n";a+="  BgImage: "+this.getBgImage()+"\n";a+="  BgColor: "+this.getBgColor()+"\n";a+="  Content: "+this.getHTML()+"\n";a+="   zIndex: "+this.getZIndex()+"\n";a+="  Visible: "+this.getVisible()+"\n";a+="----- Number of Children: "+this.children.length+"\n";return a;};DynObject.prototype.tree=function(b){var a="";b=b||".";a+=b+" "+this.getDef()+"\n";for(i in this.children){a+=this.children[i].tree(b+" . .");}return a;};DynAPIObject.prototype.getDef=function(){return"DynAPI";};DynDocument.prototype.getDef=function(){return"DynDocument ( "+this.id+" )";};DynLayer.prototype.getDef=function(){return this.id;
};DynAPI.console={enabled:true,open:function(){if(!DynAPI.console.enabled){return;}DynAPI.console.consolewin=window.open("","DynAPIConsoleWindow","resizable=1,scrollbars=1");DynAPI.console.consolewin.document.open("text/plain");},write:function(a){if(!DynAPI.console.enabled){return;}if(!DynAPI.console.consolewin||DynAPI.console.consolewin.closed){DynAPI.console.open();}if(is.ns6||(is.platform=="mac"&&is.ie)){a=a.toString();a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/\n/g,"<br/>\n");a+="<br/>\n";}DynAPI.console.consolewin.document.writeln(a);if(is.ie){DynAPI.console.consolewin.scrollTo(0,document.body.scrollHeight);}},close:function(){if(DynAPI.console.consolewin){DynAPI.console.consolewin.close();}},enable:function(){DynAPI.console.enabled=true;},disable:function(){DynAPI.console.enabled=false;},clear:function(){DynAPI.console.consolewin.document.open("text/plain");},dumpProperties:function(e,d){DynAPI.console.write("\nObject Properties\n-----------------");var c=[];for(var b in e){var a=c.length;if(typeof e[b]=="function"){if(!d){c[a]=b+" = [method]";}else{continue;}}else{if(typeof e[b]=="object"){c[a]=b+" = "+e[b];}else{c[a]=b+" ("+(typeof e[b])+")"+" = "+e[b];}}}c.sort();DynAPI.console.write(c.join("\n"));}};function MediaServicesZoomScale(b,a,c){this.width=b;this.height=a;this.tilesize=c;}MediaServicesZoomImage.prototype=new DynLayer;MediaServicesZoomImage.prototype.BG_COLOR="#f3f3f3";MediaServicesZoomImage.prototype.ZINDEX=0;MediaServicesZoomImage.prototype.TILE_DIM=256;MediaServicesZoomImage.prototype.BLANK_TILE=DynImage.getImage("http://images.amazon.com/images/G/01/richmedia/images/blank.png");MediaServicesZoomImage.prototype.PARALLEL_DOWNLOAD_SLOTS=1;function MediaServicesZoomImage(n,l,f,c,o,b,g,q){this.DynLayer=DynLayer;this.DynLayer(null,0,0,l,f,this.BG_COLOR);this.version=b;this.urlStem=n;this.viewerType=g;if(this.viewerType=="amztile"){var d=this.urlStem.split("/");this.vip=d[2];imageName=d[d.length-1];var r=imageName.split(".");this.asin=r[0];var a=r[1];var t=a.split("-");this.ou=t[0];this.customerID=t[1];this.variant=r[2];if(!this.variant){this.variant="MAIN";}this.size="RMTILE";this.ext=".jpg";}if(this.viewerType=="amztile"&&q!=undefined){this.maxScaleLevel=q.length-1;this.scaleLevel=0;MediaServicesZoomImage.prototype.TILE_DIM=q[this.maxScaleLevel].tilesize;this.scaleLevels=q;}this.tileWidth=this.TILE_DIM;this.tileHeight=this.TILE_DIM;this.width=l;this.height=f;this.majorWidth=c;this.majorHeight=o;var p=c/l;var s=o/f;var u;if(p>s){this.scale=p;}else{this.scale=s;}this.primeScale=this.scale;this.centerX=this.majorWidth/2;this.centerY=this.majorHeight/2;this.macroLayer=new DynLayer(null,0,0,l,f,this.BG_COLOR);this.layer=new DynLayer(null,0,0,l,f,this.BG_COLOR);if(this.viewerType=="amztile"){this.background=new DynImage(DynImage.getImage(this._getImageUrl(undefined,undefined,this.majorWidth/this.scale)));this.background2=new DynImage(DynImage.getImage(this._getImageUrl(undefined,undefined,this.majorWidth/this.scale)));}else{this.background=new DynImage(DynImage.getImage(this._getImageUrl(undefined,undefined,this.majorWidth/this.scale)));this.background2=new DynImage(DynImage.getImage(this._getImageUrl(undefined,undefined,this.majorWidth/this.scale)));}this.background.setZIndex(this.ZINDEX);this.background2.setZIndex(this.ZINDEX);this.layer.setZIndex(0);this.layer.addChild(this.background);this.layer.addChild(this.background2);this.macroLayer.addChild(this.layer);this.addChild(this.macroLayer);this.resetBackground=1;this._rescale();var m=Math.ceil((this.width/this.tileWidth+1))*Math.ceil(this.height/this.tileHeight+1);this.tilePool=new Array();for(i=0;i<m;i++){var v=new DynLayer(null,0,0,this.tileWidth,this.tileHeight);var e=new DynImage(this.BLANK_TILE);v.image=e;v.image.setAutoResize(true);v.addChild(e);v.setZIndex(this.ZINDEX+2);v.r=v.c=v.scale=-1;this.layer.addChild(v);this.tilePool.push(v);v.setVisible(true);}this.imageCache=new Array();this.imageQueue=new Array();this.activeTiles=new Array();this.setZIndex(this.ZINDEX);this.wasPainting=false;this.thread=new Thread(this);this.thread.run=this._repaintCheck;this.thread.start();}MediaServicesZoomImage.prototype.moveRelative=function(a,b){a+=this.centerX;b+=this.centerY;this.moveAbsolute(a,b);};MediaServicesZoomImage.prototype.moveAbsolute=function(a,b){pt=new Pair(a,b);this._restrictToBoundary(pt);this.centerX=pt.x;this.centerY=pt.y;this.layer.moveTo(-1*(this.centerX-this.wRadius*this.scale)/this.scale,-1*(this.centerY-this.hRadius*this.scale)/this.scale);};function Pair(a,b){this.x=a;this.y=b;}MediaServicesZoomImage.prototype.setScale=function(b,a){if(b<1){b=1;}if(b>this.primeScale){b=this.primeScale;}if(a==undefined||a==0){if(b==this.scale){setZoomButtons();return;}this.scale=b;this.next_scale=b;this._hideTiles();this._rescale();this.moveAbsolute(this.centerX,this.centerY);setZoomButtons();}else{if(b==this.scale){return;}this.scale=b;this.next_scale=b;this._hideTiles();this._rescale();}};MediaServicesZoomImage.prototype.setScaleAndMove=function(c,e,b,a,d){if(c<1){c=1;}if(c>this.primeScale){c=this.primeScale;}if(e<1){e=1;}if(e>this.primeScale){e=this.primeScale;}if(b==undefined||b==0){if(c==this.scale){setZoomButtons();return;}this.scale=c;this.next_scale=c;this._rescale();this.moveAbsolute(this.centerX,this.centerY);setZoomButtons();}else{this.scale=c;this.next_scale=e;this._rescaleAndMove(a,d);}};MediaServicesZoomImage.prototype.repaint=function(){if(this.wasPainting){this.stopRepaint();}else{this.wasPainting=true;}if(this.scale==this.primeScale){this.wasPainting=false;return;}var a=Math.floor((this.centerY-this.hRadius*this.scale)/(this.tileHeight*this.scale));var b=Math.floor((this.centerY+this.hRadius*this.scale)/(this.tileHeight*this.scale));var c=Math.floor((this.centerX-this.wRadius*this.scale)/(this.tileWidth*this.scale));var e=Math.floor((this.centerX+this.wRadius*this.scale)/(this.tileWidth*this.scale));k=0;for(i=c;i<=e;i++){for(j=a;j<=b;j++){var d=this.tilePool[k++];this._populateTile(d,j,i,this.viewerType,this.scaleLevel);this.imageQueue.push(d);}}};MediaServicesZoomImage.prototype._populateTile=function(d,b,f,e,a){d.r=b;d.c=f;d.scale=this.scale;d.image.setImage(this.BLANK_TILE,true);d.moveTo(i*this.tileWidth,j*this.tileHeight);crop_tl=new Pair(i*this.tileWidth*this.scale,j*this.tileHeight*this.scale);crop_dim=new Pair(this.tileWidth*this.scale,this.tileHeight*this.scale);if(crop_tl.x+crop_dim.x>this.majorWidth){crop_dim.x=this.majorWidth-crop_tl.x;}if(crop_tl.y+crop_dim.y>this.majorHeight){crop_dim.y=this.majorHeight-crop_tl.y;}if(e=="amztile"){d.src=this._getAmzTileImageUrl(this.scaleLevel,d.c,d.r);}else{d.src=this._getImageUrl(crop_tl,crop_dim,crop_dim.x/this.scale);}};MediaServicesZoomImage.prototype.stopRepaint=function(){this.imageQueue=new Array();this.activeTiles=new Array();};MediaServicesZoomImage.prototype._repaintCheck=function(){var b=this.dlyr;if(b.wasPainting){var c=b.PARALLEL_DOWNLOAD_SLOTS;for(i=0;i<b.activeTiles.length;){d=b.activeTiles[i];if(d!=null&&!d.img.complete){c--;i++;}else{if(d!=null){d.image.setSize(d.img.width,d.img.height);d.image.setImage(d.img);}b.activeTiles.splice(i,1);}}if(c<1){return;}if(b.imageQueue.length==0){this.wasPainting=false;return;}for(i=0;i<c&&b.imageQueue.length>0;i++){var a=Math.floor(b.imageQueue.length*Math.random());var d=b.imageQueue[a];if(d!=undefined){b.imageQueue.splice(a,1);d.img=DynImage.getImage(d.src);b.activeTiles.push(d);}}}};MediaServicesZoomImage.prototype._hideTiles=function(){for(i=0;i<this.tilePool.length;i++){this.tilePool[i].image.setImage(MediaServicesZoomImage.BLANK_TILE,true);this.tilePool[i].moveTo(-1*this.tileWidth,0);}};MediaServicesZoomImage.prototype._rescale=function(){this._rescaleAndMove();};MediaServicesZoomImage.prototype._rescaleAndMove=function(b,f){if(this.flipBackground==undefined||this.flipBackground==0){this.flipBackground=1;}else{this.flipBackground=0;}if(this.majorWidth/this.scale<this.width){this.macroLayer.moveTo((this.width-this.majorWidth/this.scale)/2,this.macroLayer.y);
}else{this.macroLayer.moveTo(0,this.macroLayer.y);}if(this.majorHeight/this.scale<this.height){this.macroLayer.moveTo(this.macroLayer.x,(this.majorHeight/this.scale-this.height)/-2);}else{this.macroLayer.moveTo(this.macroLayer.x,0);}this.layer.setNoFlickerSize(this.majorWidth/this.scale,this.majorHeight/this.scale);if(this.next_scale==undefined){this.next_scale=this.scale;}var d=this.majorWidth/this.next_scale;var a=this.majorHeight/this.next_scale;if(this.flipBackground){this.background2.setZIndex(this.ZINDEX+1);this.background.setZIndex(this.ZINDEX);this.background.setNoFlickerSize(d,a);}else{this.background.setZIndex(this.ZINDEX+1);this.background2.setZIndex(this.ZINDEX);this.background2.setNoFlickerSize(d,a);}if(this.resetBackground){this.resetBackground=0;this.background.setNoFlickerSize(d,a);this.background2.setNoFlickerSize(d,a);}this.wRadius=this.width/2-this.macroLayer.x;this.hRadius=this.height/2-this.macroLayer.y;this.xBorder=Math.ceil(this.scale*this.wRadius);this.yBorder=Math.ceil(this.scale*this.hRadius);if(b!=undefined&&f!=undefined){pt=new Pair(b,f);this._restrictToBoundary(pt);this.centerX=pt.x;this.centerY=pt.y;var e=-1*(this.centerX-this.wRadius*this.scale)/this.scale;var c=-1*(this.centerY-this.hRadius*this.scale)/this.scale;e=Math.round(e);c=Math.round(c);this.layer.moveTo(e,c);}};MediaServicesZoomImage.prototype._restrictToBoundary=function(a){if(a.x<this.xBorder){a.x=this.xBorder;}if(a.x>=this.majorWidth-this.xBorder){a.x=this.majorWidth-this.xBorder;}if(a.y<this.yBorder){a.y=this.yBorder;}if(a.y>=this.majorHeight-this.yBorder){a.y=this.majorHeight-this.yBorder;}};MediaServicesZoomImage.prototype._getAmzTileImageUrl=function(l,e,g,d){var b="";if(d!=undefined){b+="_SCR("+l+","+e+","+g+","+d+")_";}else{b+="_SCR("+l+","+e+","+g+")_";}var f="=";var a="+";var c="http://"+this.vip+"/R/1/a"+f+this.asin;if(this.customerID){c+=a+"c"+f+this.customerID;}c+=a+"d"+f+b+a+"o"+f+this.ou+a+"s"+f+this.size+a+"va"+f+this.variant+a+"ve"+f+this.version+a+"e"+f+this.ext;return c;};MediaServicesZoomImage.prototype._getImageUrl=function(f,d,a,e){var c="";if(f!=undefined&&d!=undefined){c+="_CR"+Math.round(f.x)+","+Math.round(f.y)+","+Math.round(d.x)+","+Math.round(d.y);}if(a!=undefined){c+="_SX"+Math.ceil(a);}if(e!=undefined){c+="_FMgif_BD"+e;}var b;if(this.asin){b="http://"+this.vip+"/images/P/"+this.asin+"."+this.ou;if(this.customerID){b+="-"+this.customerID;}b+=".";if(!(this.variant==="MAIN"||this.variant==="")){b+=this.variant+".";}}else{b=this.urlStem;}if(c){b+=c;}if(this.asin){b+="_SCLZZZZZZZ_SH35_";}else{b+="_SCRMZZZZZZ_SH35_";}if(this.version){b+="V"+this.version+"_";}b+=".jpg";mainImageUrlForZoom=b;return b;};var mainImageUrlForZoom;MediaServicesZoomMotion.prototype=new Thread;function MediaServicesZoomMotion(b,a){this.Thread=Thread;this.Thread(b);this.target=b;this.interval=a;this.v_x=0;this.v_y=0;this.scrolling=0;}MediaServicesZoomMotion.prototype.setVelocity=function(a,b){if(a!=undefined){this.v_x=a;}if(b!=undefined){this.v_y=b;}};MediaServicesZoomMotion.prototype.scrollTo=function(a,e,d,c,b){if(a==undefined||e==undefined||d==undefined||c==undefined||this.scrolling==1){return;}if(c.viewerType=="amztile"){c.scaleLevel=b;}this.scroll_to_x=a;this.scroll_to_y=e;this.scroll_to_scale=d;this.scroll_image=c;this.scroll_orig_x=c.centerX;this.scroll_orig_y=c.centerY;this.scroll_orig_scale=c.scale;this.scroll_counter=0;if(Math.abs(this.scroll_to_x-this.scroll_orig_x)>1||Math.abs(this.scroll_to_y-this.scroll_orig_y)>1||this.scroll_to_scale!=this.scroll_orig_scale){this.scrolling=1;}};MediaServicesZoomMotion.prototype.run=function(){var g=30;var o=this.dlyr;if(this.scrolling){var b=new DynEvent();var l=this.scroll_orig_x;var e=this.scroll_orig_y;var r=this.scroll_orig_scale;var m=(this.scroll_to_x-l);var f=(this.scroll_to_y-e);var a=(this.scroll_to_scale-r);var p=(this.scroll_to_scale-r);var d=this.scroll_counter/g;var n=(this.scroll_counter+1)/g;m*=d;f*=d;a*=d;if(this.scroll_counter+1<=g){p*=n;}else{p=a;}b.x=l+m;b.y=e+f;b.scale=r+a;b.anim=1;b.next_scale=r+p;if(this.scroll_counter==0){var c=this.scroll_image.majorWidth/b.scale;var q=this.scroll_image.majorHeight/b.scale;this.scroll_image.background.setNoFlickerSize(c,q);this.scroll_image.background2.setNoFlickerSize(c,q);this.scroll_image._hideTiles();}o.invokeEvent("setscaleandmove",b);this.scroll_counter++;if(this.scroll_counter>g){this.scrolling=0;b.x=this.scroll_to_x;b.y=this.scroll_to_y;b.scale=this.scroll_to_scale;b.next_scale=this.scroll_to_scale;b.anim=0;o.invokeEvent("setscaleandmove",b);o.invokeEvent("repaint");}}};MediaServicesZoomView.prototype=new DynLayer;MediaServicesZoomView.prototype.BG_COLOR="#ddd";MediaServicesZoomView.prototype.GUIDE_BUTTONS=false;MediaServicesZoomView.prototype.BUTTONS=true;MediaServicesZoomView.prototype.DRAG=true;function MediaServicesZoomView(g,c,m,l,a,f,d,b){this.DynLayer=DynLayer;this.DynLayer(null,0,0,c,m,this.BG_COLOR);this.width=c;this.height=m;this.setZoomImage(g,l,a,f,d,b);var e=new EventListener(this);e.onmoveabsolute=function(o){var n=o.getTarget();n.image.moveAbsolute(o.x,o.y);};e.onmoverelative=function(o){var n=o.getTarget();n.image.moveRelative(o.x,o.y);};e.onsetscale=function(o){var n=o.getTarget();n.image.setScale(o.scale,o.anim);};e.onsetscaleandmove=function(o){var n=o.getTarget();n.image.setScaleAndMove(o.scale,o.next_scale,o.anim,o.x,o.y);};e.onrepaint=function(o){var n=o.getTarget();n.image.repaint();};e.onstoprepaint=function(o){var n=o.getTarget();n.image.stopRepaint();};e.onsetvelocity=function(o){var n=o.getTarget();n.motion.setVelocity(o.x,o.y);};e.onscrollto=function(o){var n=o.getTarget();n.motion.scrollTo(o.x,o.y,o.scale,o.image,o.scaleLevel);};this.addEventListener(e);this.motion=new MediaServicesZoomMotion(this,20);this.motion.start();}MediaServicesZoomView.prototype.initialize=function(b,a){this.drag=new MediaServicesZoomDrag(this,b,a);this.drag.setZIndex(5);this.addChild(this.drag);if(topLayerId==undefined){topLayerId=this.DynObject.Count-1;}};MediaServicesZoomView.prototype.setZoomImage=function(b,d,f,a,c,e){this.invokeEvent("stoprepaint");this.majorWidth=d;this.majorHeight=f;if(this.motion){this.motion.scrolling=0;}if(this.image){this.removeChild(this.image);this.image=null;}this.image=new MediaServicesZoomImage(b,this.width,this.height,d,f,a,c,e);this.addChild(this.image);this.invokeEvent("repaint");};MediaServicesZoomView.prototype.zoomIn=function(){if(this.image.scale>1){var a=new DynEvent();a.x=this.image.centerX;a.y=this.image.centerY;a.image=this.image;a.scale=this.image.scale/2;if(this.image.viewerType=="amztile"){if(this.image.scaleLevel<this.image.maxScaleLevel){a.scaleLevel=this.image.scaleLevel+1;}else{a.scaleLevel=this.image.scaleLevel;}a.scale=this.image.majorWidth/this.image.scaleLevels[a.scaleLevel].width;}this.invokeEvent("scrollto",a);}};MediaServicesZoomView.prototype.zoomInByLevel=function(b){if(this.image.scale>1){var a=new DynEvent();a.x=this.image.centerX;a.y=this.image.centerY;a.image=this.image;a.scale=this.image.scale/2;if(this.image.viewerType=="amztile"){if(this.image.scaleLevel+b<=this.image.maxScaleLevel){a.scaleLevel=this.image.scaleLevel+b;}else{a.scaleLevel=this.image.scaleLevel;}a.scale=this.image.majorWidth/this.image.scaleLevels[a.scaleLevel].width;}this.invokeEvent("scrollto",a);}};MediaServicesZoomView.prototype.zoomOut=function(){if(this.image.scale<this.image.primeScale){var b=this.image.primeScale;while((b/2)>this.image.scale){b/=2;}var a=new DynEvent();a.x=this.image.centerX;a.y=this.image.centerY;a.scale=b;a.image=this.image;if(this.image.viewerType=="amztile"){if(this.image.scaleLevel>0){a.scaleLevel=this.image.scaleLevel-1;}else{a.scaleLevel=this.image.scaleLevel;}if(a.scaleLevel==0){a.scale=this.image.primeScale;}else{a.scale=this.image.majorWidth/this.image.scaleLevels[a.scaleLevel].width;}}this.invokeEvent("scrollto",a);}};MediaServicesZoomView.prototype.zoomOutByLevel=function(b){if(this.image.scale<this.image.primeScale){var c=this.image.primeScale;while((c/2)>this.image.scale){c/=2;
}var a=new DynEvent();a.x=this.image.centerX;a.y=this.image.centerY;a.scale=c;a.image=this.image;if(this.image.viewerType=="amztile"){if(this.image.scaleLevel-b>=0){a.scaleLevel=this.image.scaleLevel-b;}else{a.scaleLevel=this.image.scaleLevel;}if(a.scaleLevel==0){a.scale=this.image.primeScale;}else{a.scale=this.image.majorWidth/this.image.scaleLevels[a.scaleLevel].width;}}this.invokeEvent("scrollto",a);}};MediaServicesZoomView.prototype.reset=function(){if(this.image.scale!=this.image.primeScale){var a=new DynEvent();a.x=this.image.centerX;a.y=this.image.centerY;a.scale=this.image.primeScale;a.image=this.image;if(this.image.viewerType=="amztile"){a.scaleLevel=0;}this.invokeEvent("scrollto",a);}};MediaServicesZoomView.prototype.getZoomLevel=function(){if(this.image.scale<=1){return 1;}else{if(this.image.scale>1&&this.image.scale<this.image.primeScale){return 0;}else{return -1;}}};MediaServicesZoomView.prototype.hide=function(){this.setVisible(0);this.setNoFlickerSize(0,0);};MediaServicesZoomView.prototype.show=function(){this.setVisible(1);this.setNoFlickerSize(this.width,this.height);};MediaServicesZoomView.prototype._screenToMajor=function(a){a.x=this.image.centerX-this.image.scale*(this.image.wRadius-a.x);a.y=this.image.centerY-this.image.scale*(this.image.hRadius-a.y);};MediaServicesZoomDrag.prototype=new DynImage;MediaServicesZoomDrag.prototype.COVER_IMAGE=DynImage.getImage("http://images.amazon.com/images/G/01/richmedia/images/cover.gif");function MediaServicesZoomDrag(d,c,a){this.DynImage=DynImage;this.DynImage(this.COVER_IMAGE);this.setNoFlickerSize(c,a);var b=new EventListener(d);DragEvent.enableDragEvents(this);b.onclick=function(l){var f=l.getTarget();if(f.motion&&f.motion.scrolling==1){return;}if(this.dragging){return;}var m=new Pair(l.x,l.y);m.x=f.image.centerX-f.image.scale*((f.width/2)-m.x);m.y=f.image.centerY-f.image.scale*((f.height/2)-m.y);var g=new DynEvent();g.x=m.x;g.y=m.y;g.scale=f.image.scale/2;g.image=f.image;if(f.image.viewerType=="amztile"){if(f.image.scaleLevel<f.image.maxScaleLevel){g.scaleLevel=f.image.scaleLevel+1;}else{g.scaleLevel=f.image.scaleLevel;}g.scale=f.image.majorWidth/f.image.scaleLevels[g.scaleLevel].width;}f.invokeEvent("scrollto",g);};b.ondragmove=function(l){var f=l.getTarget();if(f.motion&&f.motion.scrolling==1){return;}if(!this.dragging){return;}var g=new DynEvent();g.x=-1*f.image.scale*(f.drag.x-this.oldX);g.y=-1*f.image.scale*(f.drag.y-this.oldY);f.invokeEvent("moverelative",g);this.oldX=f.drag.x;this.oldY=f.drag.y;};b.ondragstart=function(g){var f=g.getTarget();if(f.motion&&f.motion.scrolling==1){return;}this.dragging=1;f.invokeEvent("stoprepaint");this.oldX=0;this.oldY=0;};b.ondragend=function(g){var f=g.getTarget();this.dragging=0;if(f.motion&&f.motion.scrolling==1){return;}f.invokeEvent("repaint");f.drag.moveTo(0,0);};this.addEventListener(b);}MediaServicesRect.prototype=new DynImage;MediaServicesRect.prototype.COVER_IMAGE=DynImage.getImage("http://images.amazon.com/images/G/01/richmedia/images/cover.gif");function MediaServicesRect(a,f,b,e,c,d){this.setWidth(b);this.setHeight(e);this.setX(a);this.setY(f);this.lyr1=new DynLayer("currentRect1",0,0,b,d,c);this.lyr2=new DynLayer("currentRect2",0,0,d,e,c);this.lyr3=new DynLayer("currentRect3",b-d,0,d,e,c);this.lyr4=new DynLayer("currentRect4",0,e-d,b,d,c);this.addChild(this.lyr1);this.addChild(this.lyr2);this.addChild(this.lyr3);this.addChild(this.lyr4);}MediaServicesRect.prototype.resize=function(a,f,b,e,c,d){this.setWidth(b);this.setHeight(e);this.setX(a);this.setY(f);this.lyr1.setX(0);this.lyr1.setY(0);this.lyr1.setWidth(b);this.lyr1.setHeight(d);this.lyr2.setX(0);this.lyr2.setY(0);this.lyr2.setWidth(d);this.lyr2.setHeight(e);this.lyr3.setX(b-d);this.lyr3.setY(0);this.lyr3.setWidth(d);this.lyr3.setHeight(e);this.lyr4.setX(0);this.lyr4.setY(e-d);this.lyr4.setWidth(b);this.lyr4.setHeight(d);};
