function opLightBox(){var a=this;a.type="custom";a.text="";a.title="";a.conDiv="";a.slideStep=30;a.slidePause=0;a.offset=0;a.offsetY=0;a.offsetX=0;a.process=0;a.interval=0;a.mouseX=0;a.mouseY=0;a.allowDrag=0;a.showBleeds=0;a.previewImgWidth=0;a.previewImgHeight=0;a.shadowType="shadowBox";a.onscrollBuffer="";a.onresizeBuffer="";a.ie=document.all;var g=navigator.appVersion.match(/MSIE (\d+\.\d+)/,"");a.ie7=g!=null&&Number(g[1])>=7&&Number(g[1])<8;a.ie6=g!=null&&Number(g[1])>=6&&Number(g[1])<7;a.lightBoxWindows=
[];a.lightBoxWindowsEl=[];a.handlers={show:[],hide:[],scroll:[]};this.$ID=function(a){return document.getElementById(a)};this.stopEvent=function(a){if(!a)a=window.event;a.cancelBubble=!0;if(a.cancelBubble!=null)a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();if(window.event)a.returnValue=!1;if(a.cancel!=null)a.cancel=!0;return!1};this.getPosition=function(a){for(var c=y=0;a;)c+=a.offsetLeft,y+=a.offsetTop,a=a.offsetParent;return{x:c,y:y}};this.getBox=
function(b,c){a.loading(0,1,"global");switch(b){case "shadowBox":this.box(c);break;case "whiteBox":this.box(c);break;case "modalBox":this.modalBox(c)}};this.getMouseCoor=function(a){var a=a||window.event,c=y=0;document.attachEvent!=null&&(c=a.clientX+document.documentElement.scrollLeft+document.body.scrollLeft,y=a.clientY+document.documentElement.scrollTop+document.body.scrollTop);!document.attachEvent&&document.addEventListener&&(c=a.clientX+window.scrollX,y=a.clientY+window.scrollY);return{x:c,
y:y}};this.addShadow=function(){var b=document.createElement("div");b.setAttribute("id","shadowBox");document.body.appendChild(b);a.$ID("shadowBox").style.height=this.getSize().h+"px"};this.modalBox=function(b,c){a.onresizeBuffer=a.onresizeBuffer==""?window.onresize:a.onresizeBuffer;if(c==1){var d=document.createElement("div");d.setAttribute("id",a.shadowType);document.body.appendChild(d);a.$ID(a.shadowType).style.height=this.getSize().h+"px"}document.body.onselectstart=function(){return!1};a.conDiv=
b;if(a.$ID(b))a.$ID(b).style.display="block";var d=a.$ID(b).offsetWidth,f=a.$ID(b).offsetHeight,j=this.getSize().w,e=this.getSize().bodyH;a.$ID(b).style.left=j/2-d/2+a.offsetX+"px";a.$ID(b).style.top=e/2-f/2+this.getOffset().y+"px";a.offsetY=this.getOffset().y;if(a.$ID(b))window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer();a.winOnScroll()},window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer();a.winOnResize()};a.$ID(b).onmousedown=function(c){document.body.onselectstart=
function(){return!1};if(!c)c=window.event;c.cancelBubble=!0;if(c.cancelBubble!=null)c.cancelBubble=!0;c.stopPropagation&&c.stopPropagation();c.preventDefault&&c.preventDefault();window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer()};a.mouseX=a.getMouseCoor(c).x;a.mouseY=a.getMouseCoor(c).y;var c=a.getPosition(a.$ID(b)).x,d=a.getPosition(a.$ID(b)).y,e=a.mouseX-c,f=a.mouseY-d;document.onmousemove=
function(c){var d=a.getMouseCoor(c).x,c=a.getMouseCoor(c).y;a.$ID(b).style.top=c-f+"px";a.$ID(b).style.left=d-e+"px";document.body.onselectstart=function(){return!1}};document.onmouseup=function(){window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer()};document.onmousemove="";a.$ID(b).onmouseout="";document.body.onselectstart=function(){return!0}};if(a.ie)a.$ID(b).onmouseup=function(){window.onscroll=
function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer()};document.onmousemove="";a.$ID(b).onmouseout="";a.$ID(b).onmousemove="";a.$ID(b).onmouseleave="";document.body.onselectstart=function(){return!0}};a.$ID(b).onmouseleave=function(c){var d=a.getMouseCoor(c).x,c=a.getMouseCoor(c).y;a.$ID(b).style.top=c-f+"px";a.$ID(b).style.left=d-e+"px"}};if(a.$ID(b+"Close"))a.$ID(b+"Close").onclick=function(){a.$ID(a.shadowType)&&
a.$ID(a.shadowType).parentNode.removeChild(a.$ID(a.shadowType));a.$ID("shadowBox")&&a.$ID("shadowBox").parentNode.removeChild(a.$ID("shadowBox"));a.$ID(b).style.display="none";window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer()};a.fixSelectBox(1);a.trigger("hide")}};this.closeBox=function(){if(a.$ID(a.conDiv))a.$ID(a.shadowType)&&a.$ID(a.shadowType).parentNode.removeChild(a.$ID(a.shadowType)),
a.$ID("shadowBox")&&a.$ID("shadowBox").parentNode.removeChild(a.$ID("shadowBox")),a.$ID(a.conDiv).style.display="none",window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()},window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer()};a.fixSelectBox(1);a.trigger("hide")};this.alertFn=function(b){b();a.closeBox()};this.loading=function(b,c,d,f){a.onresizeBuffer=a.onresizeBuffer==""?window.onresize:a.onresizeBuffer;if(typeof f!="undefined")var j=
f;var e=d=="global"?"":"local";if(b==0)a.$ID("whiteBox"+e)&&a.$ID("whiteBox"+e).parentNode.removeChild(a.$ID("whiteBox"+e)),a.$ID("shadowBox"+e)&&a.$ID("shadowBox"+e).parentNode.removeChild(a.$ID("shadowBox"+e)),a.$ID("loadingBox"+e)&&a.$ID("loadingBox"+e).parentNode.removeChild(a.$ID("loadingBox"+e));else{c==1?(b=document.createElement("div"),b.setAttribute("id","shadowBox"+e),document.body.appendChild(b),a.$ID("shadowBox"+e).style.height=this.getSize().h+"px"):(b=document.createElement("div"),b.setAttribute("id",
"whiteBox"+e),document.body.appendChild(b),a.$ID("whiteBox"+e).style.height=this.getSize().h+"px");b=document.createElement("div");b.setAttribute("id","loadingBox"+e);document.body.appendChild(b);a.conDiv="loadingBox"+e;var b=a.$ID("loadingBox"+e).offsetWidth,g=a.$ID("loadingBox"+e).offsetHeight;if(d=="local"&&j){var c=c==1?"shadow":"white",d=a.$ID(j).offsetWidth,k=a.$ID(j).offsetHeight,l=a.getPosition(a.$ID(j)).x,j=a.getPosition(a.$ID(j)).y;a.$ID(c+"Box"+e).style.width=d+"px";a.$ID(c+"Box"+e).style.height=
k+"px";a.$ID(c+"Box"+e).style.left=l+"px";a.$ID(c+"Box"+e).style.top=j+"px";a.$ID("loadingBox"+e).style.left=l+d/2-b/2+"px";a.$ID("loadingBox"+e).style.top=j+k/2-g/2+"px"}else j=this.getSize().w,c=this.getSize().bodyH,a.$ID("loadingBox"+e).style.left=j/2-b/2+"px",a.$ID("loadingBox"+e).style.top=c/2-g/2+this.getOffset().y+"px",a.offsetY=this.getOffset().y;if(a.$ID("loadingBox"))window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer();a.winOnScroll()},window.onresize=function(){if(typeof a.onresizeBuffer==
"function")a.onresizeBuffer();a.winOnResize()};a.$ID(a.shadowType).onclick=function(){if(a.$ID("previewerAdded")){if(a.$ID("previewImg"))a.$ID("previewImg").src="";a.$ID("previewerAdded").innerHTML=""}if(typeof tooltip!="undefined"&&a.$ID(tooltip.toolDiv))a.$ID(tooltip.toolDiv).style.display="none";a.$ID(a.shadowType).parentNode.removeChild(a.$ID(a.shadowType));a.$ID("loadingBox")&&a.$ID("loadingBox").parentNode.removeChild(a.$ID("loadingBox"));if(a.$ID(f))a.$ID(f).style.display="none";window.onscroll=
function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer()};a.trigger("hide")}}};this.getOffset=function(){var a=c=0;if(window.document.documentElement&&window.document.documentElement.scrollTop)var c=window.document.documentElement.scrollTop;else if(window.document.body&&window.document.body.scrollTop)c=window.document.body.scrollTop;return{x:a,y:c}};this.getSize=function(){var a=document.body.offsetHeight,
c=document.body.offsetWidth,d=0;if(typeof window.innerHeight!="undefined")h=a>window.innerHeight?a:window.innerHeight,w=c>window.innerWidth?c:window.innerWidth,d=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)h=a>document.documentElement.clientHeight?a:document.documentElement.clientHeight,w=c>document.documentElement.clientWidth?c:document.documentElement.clientWidth,d=document.documentElement.clientHeight;return{h:h,w:w,bodyH:d}};this.box=function(b){a.onresizeBuffer=
a.onresizeBuffer==""?window.onresize:a.onresizeBuffer;if(a.ie7&&!a.$ID("lightBoxTable"))a.$ID("lightBoxCon").innerHTML='<table id="lightBoxTable"><tr><td>'+a.$ID("lightBoxCon").innerHTML+"</td></tr></table>";a.$ID(a.shadowType)&&a.$ID(a.shadowType).parentNode.removeChild(a.$ID(a.shadowType));a.$ID("loadingBox")&&a.$ID("loadingBox").parentNode.removeChild(a.$ID("loadingBox"));if(!a.$ID(a.shadowType)){a.conDiv=b;var c=document.createElement("div");c.setAttribute("id",a.shadowType);document.body.appendChild(c);
a.$ID(a.shadowType).style.height=this.getSize().h+"px";a.$ID(b).style.display="block";var c=a.$ID(b).offsetWidth,d=a.$ID(b).offsetHeight,f=this.getSize().w,j=this.getSize().bodyH;a.$ID(b).style.left=f/2-c/2+a.offsetX+"px";d>j?a.$ID(b).style.top=this.getOffset().y+40+"px":a.$ID(b).style.top=j/2-d/2+this.getOffset().y+"px";a.offsetY=this.getOffset().y;if(a.$ID(b))window.onscroll=d<j?function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer();a.winOnScroll()}:"",window.onresize=function(){if(typeof a.onresizeBuffer==
"function")a.onresizeBuffer();a.winOnResize()};if(a.$ID(b+"Close"))a.$ID(b+"Close").onclick=function(){a.$ID(a.shadowType).parentNode.removeChild(a.$ID(a.shadowType));if(typeof tooltip!="undefined"&&a.$ID(tooltip.toolDiv))a.$ID(tooltip.toolDiv).style.display="none";if(a.$ID(b))a.$ID(b).style.display="none";a.$ID("loadingBox")&&a.$ID("loadingBox").parentNode.removeChild(a.$ID("loadingBox"));window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer==
"function")a.onresizeBuffer()};a.fixSelectBox(1);a.trigger("hide")};a.$ID(a.shadowType).onclick=function(){if(typeof tooltip!="undefined"&&a.$ID(tooltip.toolDiv))a.$ID(tooltip.toolDiv).style.display="none";a.$ID(a.shadowType).parentNode.removeChild(a.$ID(a.shadowType));a.$ID("loadingBox")&&a.$ID("loadingBox").parentNode.removeChild(a.$ID("loadingBox"));if(a.$ID(b))a.$ID(b).style.display="none";window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer==
"function")a.onresizeBuffer()};a.fixSelectBox(1);a.trigger("hide")}}};this.winOnScroll=function(){a.process=0;a.moveToY(a.offsetY)};this.moveToY=function(b){window.clearInterval(a.interval);var c=a.$ID(a.conDiv).offsetHeight,d=a.getSize().bodyH,f=parseInt(a.getOffset().y);f>=a.offsetY?b<f?(a.process=1,a.$ID(a.conDiv).style.top=d/2-c/2+b+"px",b+=a.slideStep,a.offsetY+a.slideStep<f&&(a.offsetY+=a.slideStep),a.interval=window.setInterval(function(){a.moveToY(b)},a.slidePause)):(a.process=0,a.$ID(a.conDiv).style.top=
d/2-c/2+f+"px",a.offsetY=a.getOffset().y,window.clearInterval(a.interval)):b>f?(a.process=1,a.$ID(a.conDiv).style.top=d/2-c/2+b+"px",b-=a.slideStep,a.offsetY-a.slideStep>f&&(a.offsetY-=a.slideStep),a.interval=window.setInterval(function(){a.moveToY(b)},a.slidePause)):(a.process=0,a.$ID(a.conDiv).style.top=d/2-c/2+f+"px",a.offsetY=a.getOffset().y,window.clearInterval(a.interval));a.trigger("scroll")};this.winOnResize=function(){var b=a.$ID(a.conDiv).offsetWidth,c=a.getSize().w;a.$ID(a.conDiv).style.left=
c/2-b/2+a.offsetX+"px";if(a.$ID(a.shadowType))a.$ID(a.shadowType).style.height=a.getSize().h+"px";a.moveToY(a.offsetY)};this.fixSelectBox=function(b){if(a.ie6){for(var c=document.getElementById("body").getElementsByTagName("SELECT"),d=0;d<c.length;d++)c[d].style.display=b==1?"block":"none";if(a.$ID("enter_keywords"))b==0?a.$ID("enter_keywords").className+=" enterKeywordsShow":a.$ID("enter_keywords").className=a.$ID("enter_keywords").className.replace(" enterKeywordsShow","")}};this.showBox=function(b,
c,d,f,j,e,g){a.offsetX=g?parseInt(g):0;a.$ID("lightBoxCon")||a.createLightBox("lightBox");a.addToWindows(c);a.onresizeBuffer=a.onresizeBuffer==""?window.onresize:a.onresizeBuffer;if(a.ie7&&!a.$ID("lightBoxTable"))a.$ID("lightBox").innerHTML='<table id="lightBoxTable"><tr><td>'+a.$ID("lightBox").innerHTML+"</td></tr></table>";a.fixSelectBox(0);j?a.shadowType=j:j=a.shadowType;if(a.$ID("lightBoxCon")&&a.lightBoxWindows.length>0){a.loading(a.shadowType=="shadowBox"?1:0,1,"global");for(i=0;i<a.lightBoxWindows.length;i++)if(a.$ID(a.lightBoxWindows[i]+
"Added"))a.$ID(a.lightBoxWindows[i]+"Added").style.display="none";if(b=="previewer"&&d){a.$ID("lightBox").style.width="auto";a.$ID("previewerAdded")||(c=document.createElement("div"),c.setAttribute("id","previewerAdded"),a.$ID("lightBoxCon").appendChild(c));a.$ID("previewerAdded").style.display="block";a.$ID("previewerAdded").innerHTML='<br/><div id="bleedContainer"></div><br clear="all" />';var k=new Image;setTimeout(function(){k.src=d},100);k.id="previewImg";k.alt="";k.onload=function(){a.getBox(j,
"lightBox");if(a.showBleeds==1){var b=document.createElement("div");b.className="b0";b.id="b0";var c=document.createElement("div");c.className="b1";c.id="b1";var d=document.createElement("div");d.className="b2";d.id="b2";var e=document.createElement("div");e.className="b3";e.id="b3";var f=document.createElement("div");f.className="bOuter";f.id="bOuter";var g=document.createElement("div");g.className="cutHere";g.id="cutHere";a.$ID("bleedContainer").appendChild(b);a.$ID("bleedContainer").appendChild(c);
a.$ID("bleedContainer").appendChild(d);a.$ID("bleedContainer").appendChild(e);a.$ID("bleedContainer").appendChild(f);a.$ID("bleedContainer").appendChild(g);var b=a.$ID("previewImg").height,c=a.$ID("previewImg").width,f=c/lightbox.previewImgWidth,g=b/lightbox.previewImgHeight,d=g*4-7,e=Math.round(g*4),g=Math.round(g*4),k=Math.round(f*4),f=Math.round(f*4);a.$ID("b0").style.height=e+"px";a.$ID("b1").style.height=g+"px";a.$ID("b2").style.width=k+"px";a.$ID("b2").style.height=b+"px";a.$ID("b3").style.width=
f+"px";a.$ID("b3").style.height=b+"px";a.$ID("bOuter").style.left=k-1+"px";a.$ID("bOuter").style.top=e-1+"px";a.$ID("bOuter").style.width=c-k-f-(document.all?3:2)+"px";a.$ID("bOuter").style.height=b-e-g-(document.all?3:2)+"px";a.$ID("cutHere").style.top=d+"px"}window.onscroll=function(){if(typeof a.onscrollBuffer=="function")a.onscrollBuffer()};window.onresize=function(){if(typeof a.onresizeBuffer=="function")a.onresizeBuffer()}};a.$ID("bleedContainer").appendChild(k)}else{a.$ID(c)&&(b=a.$ID(c),b.id+=
"Added",a.$ID("lightBoxCon").appendChild(b));if(f){if(a.$ID("lightBox"))f=="auto"?a.$ID("lightBox").style.width="auto":a.$ID("lightBox").style.width=f+"px"}else a.$ID("lightBox").style.width="auto";a.$ID(c+"Added").style.display="block";a.getBox(j,"lightBox")}typeof e=="function"&&e();a.trigger("show")}};this.createLightBox=function(a){var c=document.createElement("div");c.innerHTML='<div id="'+a+'" class="'+a+' round shadow"><div id="'+a+'Close" class="icon close">&nbsp;</div><div id="'+a+'Con" class="'+
a+'Con"></div></div>';window.document.body.appendChild(c)};this.addToWindows=function(b){a.lightBoxWindowsEl[b]||(a.lightBoxWindowsEl[b]=1,a.lightBoxWindows[a.lightBoxWindows.length]=b)};this.bind=function(b,c){typeof a.handlers[b]!="undefined"&&typeof c=="function"&&a.handlers[b].push(c)};this.unbind=function(b,c){if(typeof a.handlers[b]!="undefined"&&a.handlers[b].length>0&&typeof c=="function"){var d=a.handlers[b];a.handlers[b]=[];for(var f=0;f<d.length;f++)d[f]!=c&&a.handlers[b].push(d[f])}};
this.trigger=function(b){if(typeof a.handlers[b]!="undefined"&&a.handlers[b].length>0)for(var c=0;c<a.handlers[b].length;c++)a.handlers[b][c].apply(this)}}if(typeof lightbox=="undefined")var lightbox=new opLightBox;

