var dhtmlwindow={imagefiles:["generaljs/min.gif","generaljs/close.gif","generaljs/restore.gif","generaljs/resize.gif"],ajaxbustcache:true,ajaxloadinghtml:"<b>Carregando a Página, Por Favor Aguarde...</b>",minimizeorder:0,zIndexvalue:100,tobjects:[],lastactivet:{},init:function(b){var e=document.createElement("div");e.id=b;e.className="dhtmlwindow";var d="";d='<div class="drag-handle">';d+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimiza" /><img src="'+this.imagefiles[1]+'" title="Fechar" /></div>';d+="</div>";d+='<div class="drag-contentarea"></div>';d+='<div class="drag-statusarea"><div class="drag-resizearea" style="background: transparent url('+this.imagefiles[3]+') top right no-repeat;">&nbsp;</div></div>';d+="</div>";e.innerHTML=d;document.getElementById("dhtmlwindowholder").appendChild(e);var b=document.getElementById(b);var c=b.getElementsByTagName("div");for(var a=0;a<c.length;a++){if(/drag-/.test(c[a].className)){b[c[a].className.replace(/drag-/,"")]=c[a]}}b.handle._parent=b;b.resizearea._parent=b;b.controls._parent=b;b.onclose=function(){return true};b.onmousedown=function(){dhtmlwindow.setfocus(this)};b.handle.onmousedown=dhtmlwindow.setupdrag;b.resizearea.onmousedown=dhtmlwindow.setupdrag;b.controls.onclick=dhtmlwindow.enablecontrols;b.show=function(){dhtmlwindow.show(this)};b.hide=function(){dhtmlwindow.hide(this)};b.close=function(){dhtmlwindow.close(this)};b.setSize=function(f,g){dhtmlwindow.setSize(this,f,g)};b.moveTo=function(f,g){dhtmlwindow.moveTo(this,f,g)};b.isResize=function(f){dhtmlwindow.isResize(this,f)};b.isScrolling=function(f){dhtmlwindow.isScrolling(this,f)};b.load=function(f,g,h){dhtmlwindow.load(this,f,g,h)};this.tobjects[this.tobjects.length]=b;return b},open:function(k,e,j,h,f,i){var g=dhtmlwindow;function b(d){var l=new RegExp(d+"=([^,]+)","i");return(l.test(f))?parseInt(RegExp.$1):0}if(document.getElementById(k)==null){k=this.init(k)}else{k=document.getElementById(k)}this.setfocus(k);k.setSize(b(("width")),(b("height")));var c=b("center")?"middle":b("left");var a=b("center")?"middle":b("top");if(typeof i!="undefined"&&i=="recal"&&this.scroll_top==0){if(window.attachEvent&&!window.opera){this.addEvent(window,function(){setTimeout(function(){k.moveTo(c,a)},400)},"load")}else{this.addEvent(window,function(){k.moveTo(c,a)},"load")}}k.isResize(b("resize"));k.isScrolling(b("scrolling"));k.style.visibility="visible";k.style.display="block";k.contentarea.style.display="block";k.moveTo(c,a);k.load(e,j,h);if(k.state=="minimized"&&k.controls.firstChild.title=="Restore"){k.controls.firstChild.setAttribute("src",dhtmlwindow.imagefiles[0]);k.controls.firstChild.setAttribute("title","Minimiza");k.state="fullview"}return k},setSize:function(b,a,c){b.style.width=Math.max(parseInt(a),150)+"px";b.contentarea.style.height=Math.max(parseInt(c),100)+"px"},moveTo:function(b,a,c){this.getviewpoint();b.style.left=(a=="middle")?this.scroll_left+(this.docwidth-b.offsetWidth)/2+"px":this.scroll_left+parseInt(a)+"px";b.style.top=(c=="middle")?this.scroll_top+(this.docheight-b.offsetHeight)/2+"px":this.scroll_top+parseInt(c)+"px"},isResize:function(a,b){a.statusarea.style.display=(b)?"block":"none";a.resizeBool=(b)?1:0},isScrolling:function(a,b){a.contentarea.style.overflow=(b)?"auto":"hidden"},load:function(c,b,d,e){if(c.isClosed){alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again.");return}var b=b.toLowerCase();if(typeof e!="undefined"){c.handle.firstChild.nodeValue=e}if(b=="inline"){c.contentarea.innerHTML=d}else{if(b=="div"){var a=document.getElementById(d);c.contentarea.innerHTML=(a.defaultHTML||a.innerHTML);if(!a.defaultHTML){a.defaultHTML=a.innerHTML}a.innerHTML="";a.style.display="none"}else{if(b=="iframe"){c.contentarea.style.overflow="hidden";if(!c.contentarea.firstChild||c.contentarea.firstChild.tagName!="IFRAME"){c.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+c.id+'"></iframe>'}window.frames["_iframe-"+c.id].location.replace(d)}else{if(b=="ajax"){this.ajax_connect(d,c)}}}}c.contentarea.datatype=b},setupdrag:function(b){var c=dhtmlwindow;var a=this._parent;c.etarget=this;var b=window.event||b;c.initmousex=b.clientX;c.initmousey=b.clientY;c.initx=parseInt(a.offsetLeft);c.inity=parseInt(a.offsetTop);c.width=parseInt(a.offsetWidth);c.contentheight=parseInt(a.contentarea.offsetHeight);if(a.contentarea.datatype=="iframe"){a.style.backgroundColor="#F8F8F8";a.contentarea.style.visibility="hidden"}document.onmousemove=c.getdistance;document.onmouseup=function(){if(a.contentarea.datatype=="iframe"){a.contentarea.style.backgroundColor="white";a.contentarea.style.visibility="visible"}c.stop()};return false},getdistance:function(b){var c=dhtmlwindow;var a=c.etarget;var b=window.event||b;c.distancex=b.clientX-c.initmousex;c.distancey=b.clientY-c.initmousey;if(a.className=="drag-handle"){c.move(a._parent,b)}else{if(a.className=="drag-resizearea"){c.resize(a._parent,b)}}return false},getviewpoint:function(){var b=document.all&&!window.opera;var a=document.documentElement&&parseInt(document.documentElement.clientWidth)||100000;this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;this.scroll_top=(b)?this.standardbody.scrollTop:window.pageYOffset;this.scroll_left=(b)?this.standardbody.scrollLeft:window.pageXOffset;this.docwidth=(b)?this.standardbody.clientWidth:(/Safari/i.test(navigator.userAgent))?window.innerWidth:Math.min(a,window.innerWidth-16);this.docheight=(b)?this.standardbody.clientHeight:window.innerHeight},rememberattrs:function(a){this.getviewpoint();a.lastx=parseInt((a.style.left||a.offsetLeft))-dhtmlwindow.scroll_left;a.lasty=parseInt((a.style.top||a.offsetTop))-dhtmlwindow.scroll_top;a.lastwidth=parseInt(a.style.width)},move:function(a,b){a.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px";a.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px"},resize:function(a,b){a.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex,150)+"px";a.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey,100)+"px"},enablecontrols:function(b){var c=dhtmlwindow;var a=window.event?window.event.srcElement:b.target;if(/Minimize/i.test(a.getAttribute("title"))){c.minimize(a,this._parent)}else{if(/Restore/i.test(a.getAttribute("title"))){c.restore(a,this._parent)}else{if(/Close/i.test(a.getAttribute("title"))){c.close(this._parent)}}}return false},minimize:function(b,a){dhtmlwindow.rememberattrs(a);b.setAttribute("src",dhtmlwindow.imagefiles[2]);b.setAttribute("title","Restore");a.state="minimized";a.contentarea.style.display="none";a.statusarea.style.display="none";if(typeof a.minimizeorder=="undefined"){dhtmlwindow.minimizeorder++;a.minimizeorder=dhtmlwindow.minimizeorder}a.style.left="10px";a.style.width="200px";var c=a.minimizeorder*10;a.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(a.handle.offsetHeight*a.minimizeorder)-c+"px"},restore:function(b,a){dhtmlwindow.getviewpoint();b.setAttribute("src",dhtmlwindow.imagefiles[0]);b.setAttribute("title","Minimiza");a.state="fullview";a.style.display="block";a.contentarea.style.display="block";if(a.resizeBool){a.statusarea.style.display="block"}a.style.left=parseInt(a.lastx)+dhtmlwindow.scroll_left+"px";a.style.top=parseInt(a.lasty)+dhtmlwindow.scroll_top+"px";a.style.width=parseInt(a.lastwidth)+"px"},close:function(b){try{var a=b.onclose()}catch(c){var a=true}finally{if(typeof a=="undefined"){alert('An error has occured somwhere inside your "onclose" event handler');var a=true}}if(a){if(b.state!="minimized"){dhtmlwindow.rememberattrs(b)}if(window.frames["_iframe-"+b.id]){window.frames["_iframe-"+b.id].location.replace("about:blank")}else{b.contentarea.innerHTML=""}b.style.display="none";b.isClosed=true}return a},setopacity:function(a,b){if(!a){return}if(a.filters&&a.filters[0]){if(typeof a.filters[0].opacity=="number"){a.filters[0].opacity=b*100}else{a.style.filter="alpha(opacity="+b*100+")"}}else{if(typeof a.style.MozOpacity!="undefined"){a.style.MozOpacity=b}else{if(typeof a.style.opacity!="undefined"){a.style.opacity=b}}}},setfocus:function(a){this.zIndexvalue++;a.style.zIndex=this.zIndexvalue;a.isClosed=false;this.setopacity(this.lastactivet.handle,0.5);this.setopacity(a.handle,1);this.lastactivet=a},show:function(a){if(a.isClosed){alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.");return}if(a.lastx){dhtmlwindow.restore(a.controls.firstChild,a)}else{a.style.display="block"}this.setfocus(a);a.state="fullview"},hide:function(a){a.style.display="none"},ajax_connect:function(a,b){var f=false;var d="";if(window.XMLHttpRequest){f=new XMLHttpRequest()}else{if(window.ActiveXObject){try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}}else{return false}}b.contentarea.innerHTML=this.ajaxloadinghtml;f.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(f,b)};if(this.ajaxbustcache){d=(a.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime()}f.open("GET",a+d,true);f.send(null)},ajax_loadpage:function(b,a){if(b.readyState==4&&(b.status==200||window.location.href.indexOf("http")==-1)){a.contentarea.innerHTML=b.responseText}},stop:function(){dhtmlwindow.etarget=null;document.onmousemove=null;document.onmouseup=null},addEvent:function(b,c,a){var a=(window.addEventListener)?a:"on"+a;if(b.addEventListener){b.addEventListener(a,c,false)}else{if(b.attachEvent){b.attachEvent(a,c)}}},cleanup:function(){for(var a=0;a<dhtmlwindow.tobjects.length;a++){dhtmlwindow.tobjects[a].handle._parent=dhtmlwindow.tobjects[a].resizearea._parent=dhtmlwindow.tobjects[a].controls._parent=null}window.onload=null}};document.write('<div id="dhtmlwindowholder"><span style="display:none">.</span></div>');window.onunload=dhtmlwindow.cleanup;if(typeof dhtmlwindow=="undefined"){alert('ERROR: Modal Window script requires all files from "DHTML Window widget" in order to work!')}var dhtmlmodal={veilstack:0,open:function(c,b,e,g,a,h){var f=dhtmlwindow;this.interVeil=document.getElementById("interVeil");this.veilstack++;this.loadveil();if(h=="recal"&&f.scroll_top==0){f.addEvent(window,function(){dhtmlmodal.adjustveil()},"load")}var c=f.open(c,b,e,g,a,h);c.controls.firstChild.style.display="none";c.controls.onclick=function(){dhtmlmodal.close(this._parent,true)};c.show=function(){dhtmlmodal.show(this)};c.hide=function(){dhtmlmodal.close(this)};return c},loadveil:function(){var a=dhtmlwindow;a.getviewpoint();this.docheightcomplete=(a.standardbody.offsetHeight>a.standardbody.scrollHeight)?a.standardbody.offsetHeight:a.standardbody.scrollHeight;this.interVeil.style.width=a.docwidth+"px";this.interVeil.style.height=this.docheightcomplete+"px";this.interVeil.style.left=0;this.interVeil.style.top=0;this.interVeil.style.visibility="visible";this.interVeil.style.display="block"},adjustveil:function(){if(this.interVeil&&this.interVeil.style.display=="block"){this.loadveil()}},closeveil:function(){this.veilstack--;if(this.veilstack==0){this.interVeil.style.display="none"}},close:function(b,a){b.contentDoc=(b.contentarea.datatype=="iframe")?window.frames["_iframe-"+b.id].document:b.contentarea;if(typeof a!="undefined"){b.onclose=function(){return true}}if(dhtmlwindow.close(b)){this.closeveil()}},show:function(a){dhtmlmodal.veilstack++;dhtmlmodal.loadveil();dhtmlwindow.show(a)}};document.write('<div id="interVeil"></div>');dhtmlwindow.addEvent(window,function(){if(typeof dhtmlmodal!="undefined"){dhtmlmodal.adjustveil()}},"resize");var ua="msie";var W=navigator.userAgent.toLowerCase();if(W.indexOf("opera")!=-1){ua="opera"}else{if(W.indexOf("msie")!=-1){ua="msie"}else{if(W.indexOf("mozilla")!=-1){ua="gecko"}}}function _el(a){return document.getElementById(a)}function concat(){var a=[];for(var c=0;c<arguments.length;c++){for(var b=0;b<arguments[c].length;b++){a.push(arguments[c][b])}}return a}function withoutFirst(b){result=[];for(var a=1;a<b.length;a++){result.push(b[a])}return result}function cons(a,b){return concat([a],b)}Function.prototype.bind=function(a){var c=this;var b=withoutFirst(arguments);return function(){c.apply(a,concat(b,arguments))}};Function.prototype.bindEventListener=function(a){var c=this;var b=withoutFirst(arguments);return function(d){c.apply(a,cons(d||window.event,b))}};function luckyView_vis(a){var b=a.currentTarget||a.srcElement;b.style.visibility="visible"}function luckyView_ia(){return false}function luckyView_addEventListener(c,a,b){if(ua=="gecko"||ua=="opera"){c.addEventListener(a,b,false)}else{if(ua=="msie"){c.attachEvent("on"+a,b)}}}function luckyView_removeEventListener(c,a,b){if(ua=="gecko"||ua=="opera"){c.removeEventListener(a,b,false)}else{if(ua=="msie"){c.detachEvent("on"+a,b)}}}function luckyView_createMethodReference(c,a){var b=arguments;return function(){c[a].apply(c,arguments,"sssss")}}function luckyView(d,a,e,c,b){this.sx=0;this.sy=0;this.z=e;this.baseuri=b;this.images=a;this.scaleImagePlus=0;this.scaleImageMinus=0;this.map=0;this.mapCont=_el(c);this.mapImage=0;this.help=0;this.title=d;this.lvisim=luckyView_createMethodReference(this,"visim");this.lunzoom=luckyView_createMethodReference(this,"unzoom");this.lzoom=luckyView_createMethodReference(this,"zoom");this.lmap_move=luckyView_createMethodReference(this,"map_move")}luckyView.prototype.map_mouse_down=function(a){if(ua=="gecko"){a.cancelBubble=true;a.preventDefault();a.stopPropagation()}else{if(ua=="msie"||ua=="opera"){window.event.cancelBubble=true}}this.map.style.cursor="move";luckyView_addEventListener(this.map,"mousemove",this.lmap_move);this.sx=a.clientX;this.sy=a.clientY;this.hideHelpPopup()};luckyView.prototype.stop_map_move=function(){this.map.style.cursor="default";luckyView_removeEventListener(this.map,"mousemove",this.lmap_move)};luckyView.prototype.map_mouse_up=function(a){if(ua=="gecko"){a.cancelBubble=true;a.preventDefault();a.stopPropagation()}else{if(ua=="msie"||ua=="opera"){window.event.cancelBubble=true}}this.stop_map_move()};luckyView.prototype.visim=function(a){var b=a.currentTarget||a.srcElement||a;luckyView_removeEventListener(b,"load",this.lvisim);b.style.left=-(b.width/2-parseInt(this.mapCont.style.width)/2)+"px";b.style.top=-(b.height/2-parseInt(this.mapCont.style.height)/2)+"px";this.map.style.top=0+"px";this.map.style.left=0+"px";b.style.visibility="visible"};luckyView.prototype.map_move=function(a){if(ua=="gecko"){a.cancelBubble=true;a.preventDefault();a.stopPropagation()}else{if(ua=="msie"){window.event.cancelBubble=true}}if(a){this.map_move_to(parseInt(this.map.style.left)+a.clientX-this.sx,parseInt(this.map.style.top)+a.clientY-this.sy);this.sx=a.clientX;this.sy=a.clientY}this.hideHelpPopup()};luckyView.prototype.check_mouse_coords=function(a){if(a.clientX>parseInt(this.mapCont.offsetLeft+parseInt(this.mapCont.style.width))){this.stop_map_move()}if(a.clientX<parseInt(this.mapCont.offsetLeft)){this.stop_map_move()}if(a.clientY>parseInt(this.mapCont.offsetTop+(parseInt(this.mapCont.style.height)-this.map.offsetTop))){this.stop_map_move()}if(a.clientY<parseInt(this.mapCont.offsetTop)){this.stop_map_move()}};luckyView.prototype.zoom=function(){if(this.z>=(this.images.length-1)){return}this.z+=1;this.addImage()};luckyView.prototype.unzoom=function(a){if(this.z<=0){return}this.z-=1;this.addImage()};luckyView.prototype.showCopyrightPopup=function(c,f){if(this.help.style.visibility=="visible"){this.hideHelpPopup();return}var d=c.currentTarget||c.srcElement||c;var b=d.style.height||d.height;var a=d.style.width||d.width;f="<p>Clique e arraste a imagem para mov&ecirc; -la</p>";this.showHelpPopup(c,(parseInt(d.style.left)+a),(parseInt(d.style.top)+b),f)};luckyView.prototype.showHelpPopup=function(b,a,d,c){if(ua=="gecko"){b.cancelBubble=true;b.preventDefault();b.stopPropagation()}else{if(ua=="msie"){window.event.cancelBubble=true}}this.help.style.top=d+"px";this.help.style.left=a+"px";this.help.innerHTML=c;this.help.style.visibility="visible"};luckyView.prototype.hideHelpPopup=function(){this.help.style.visibility="hidden"};luckyView.prototype.addScaleImages=function(){this.scaleImagePlus=document.createElement("IMG");this.scaleImagePlus.style.position="relative";this.scaleImagePlus.style.cursor="pointer";this.scaleImagePlus.style.left="10px";this.scaleImagePlus.style.top="10px";this.scaleImagePlus.style.zIndex=2;this.scaleImagePlus.alt="";this.scaleImagePlus.title="";this.scaleImagePlus.unselectable="on";this.scaleImagePlus.onselectstart=luckyView_ia;this.scaleImagePlus.oncontextmenu=luckyView_ia;this.scaleImagePlus.style.MozUserSelect="none";this.scaleImagePlus.style.border="0";if(ua=="gecko"){this.scaleImagePlus.style.visibility="hidden";luckyView_addEventListener(this.scaleImagePlus,"load",luckyView_vis)}this.scaleImageMinus=document.createElement("IMG");this.scaleImageMinus.style.position="relative";this.scaleImageMinus.style.cursor="pointer";this.scaleImageMinus.style.left="10px";this.scaleImageMinus.style.top="28px";this.scaleImageMinus.style.zIndex=2;this.scaleImageMinus.alt="";this.scaleImageMinus.title="";this.scaleImageMinus.unselectable="on";this.scaleImageMinus.onselectstart=luckyView_ia;this.scaleImageMinus.oncontextmenu=luckyView_ia;this.scaleImageMinus.style.MozUserSelect="none";this.scaleImageMinus.style.border="0px";if(ua=="gecko"){this.scaleImageMinus.style.visibility="hidden";luckyView_addEventListener(this.scaleImageMinus,"load",luckyView_vis)}var a=document.createElement("IMG");a.style.position="relative";a.style.cursor="pointer";a.style.left="10px";a.style.top="10px";a.style.zIndex=2;a.alt="";a.title="";a.unselectable="on";a.onselectstart=luckyView_ia;a.oncontextmenu=luckyView_ia;a.style.MozUserSelect="none";a.style.border="0px";if(ua=="gecko"){a.style.visibility="hidden";luckyView_addEventListener(a,"load",luckyView_vis)}a.onclick=this.showCopyrightPopup.bindEventListener(this);luckyView_addEventListener(this.help,"click",luckyView_createMethodReference(this,"hideHelpPopup"));this.mapCont.appendChild(a);a.src=this.baseuri+"http://www.fixthemad.com/config/imagens_conteudo/padrao/help2.png"};luckyView.prototype.addImage=function(){this.hideHelpPopup();var a=document.createElement("IMG");a.src=this.images[this.z];a.style.position="absolute";a.style.zIndex=0;a.unselectable="on";a.alt=this.title;a.title=this.title;a.onselectstart=luckyView_ia;a.oncontextmenu=luckyView_ia;a.style.MozUserSelect="none";a.style.border="0px solid blue";if(ua=="gecko"){a.style.visibility="hidden";luckyView_addEventListener(a,"load",this.lvisim)}else{if(a.width!=0){this.visim(a)}else{luckyView_addEventListener(a,"load",this.lvisim)}}if(!this.mapImage){this.map.appendChild(a)}else{this.map.replaceChild(a,this.mapImage)}this.mapImage=a};luckyView.prototype.map_move_to=function(a,d){var c=(this.mapImage.width/2-parseInt(this.mapCont.style.width)/2);var b=(this.mapImage.height/2-parseInt(this.mapCont.style.height)/2);if((a-c)<=0&&(c+a)>=0){this.map.style.left=a+"px"}if((d-b)<=0&&(b+d)>=0){this.map.style.top=d+"px"}};luckyView.prototype.initContainer=function(){while(this.mapCont.firstChild){this.mapCont.removeChild(this.mapCont.firstChild)}var a=document.createElement("DIV");a.style.position="relative";a.style.top=(parseInt(this.mapCont.style.height)-15)+"px";a.style.left=((parseInt(this.mapCont.style.width)-218)/2)+"px";a.style.zIndex=200;a.style.fontSize="10px";a.style.color="#555";a.style.fontFamily="Verdana";this.mapCont.appendChild(a);this.help=document.createElement("DIV");this.help.style.position="absolute";this.help.style.zIndex=20;this.help.className="luckyViewHelp";this.mapCont.appendChild(this.help);var b=document.createElement("IMG");b.src=this.baseuri+"http://www.fixthemad.com/config/imagens_conteudo/padrao/progress.gif";b.style.position="absolute";prWidth=parseInt(b.width);if(prWidth==0){prWidth=1}b.style.left=((parseInt(this.mapCont.style.width)-prWidth)/2)+"px";b.style.top=(parseInt(this.mapCont.style.height)-parseInt(b.height))/2+"px";b.style.zIndex=0;b.unselectable="on";b.onselectstart=luckyView_ia;b.oncontextmenu=luckyView_ia;b.style.MozUserSelect="none";b.style.border="0px";this.mapCont.appendChild(b);this.map=document.createElement("DIV");this.map.style.position="absolute";this.mapCont.appendChild(this.map)};luckyView.prototype.initView=function(){this.initContainer();this.addImage();this.addScaleImages();luckyView_addEventListener(this.map,"mousedown",luckyView_createMethodReference(this,"map_mouse_down"));luckyView_addEventListener(this.map,"mouseup",luckyView_createMethodReference(this,"map_mouse_up"));luckyView_addEventListener(window.document,"mousemove",luckyView_createMethodReference(this,"check_mouse_coords"));luckyView_addEventListener(window.document,"mouseup",luckyView_createMethodReference(this,"map_mouse_up"))};var loadingImage="lightbox/loading2.gif";var closeButton="lightbox/close2.gif";function getPageScroll(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}arrayPageScroll=new Array("",a);return arrayPageScroll}function getPageSize(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){b=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){pageHeight=d}else{pageHeight=a}if(c<b){pageWidth=b}else{pageWidth=c}arrayPageSize=new Array(pageWidth,pageHeight,b,d);return arrayPageSize}function pause(b){var a=new Date();var c=a.getTime()+b;while(true){a=new Date();if(a.getTime()>c){return}}}function getKey(a){if(a==null){keycode=event.keyCode}else{keycode=a.which}key=String.fromCharCode(keycode).toLowerCase();if(key=="x"){hideLightbox()}}function listenKey(){document.onkeypress=getKey}function showLightbox(c){var h=document.getElementById("overlay");var b=document.getElementById("lightbox");var e=document.getElementById("lightboxCaption");var i=document.getElementById("lightboxImage");var a=document.getElementById("loadingImage");var g=document.getElementById("lightboxDetails");var f=getPageSize();var d=getPageScroll();if(a){a.style.top=(d[1]+((f[3]-35-a.height)/2)+"px");a.style.left=(((f[0]-20-a.width)/2)+"px");a.style.display="block"}h.style.height=(f[1]+"px");h.style.display="block";imgPreload=new Image();imgPreload.onload=function(){i.src=c.href;var k=d[1]+((f[3]-35-imgPreload.height)/2);var j=((f[0]-20-imgPreload.width)/2);b.style.top=(k<0)?"0px":k+"px";b.style.left=(j<0)?"0px":j+"px";g.style.width=imgPreload.width+"px";if(c.getAttribute("title")){e.style.display="block";e.innerHTML=c.getAttribute("title")}else{e.style.display="none"}if(navigator.appVersion.indexOf("MSIE")!=-1){pause(250)}if(a){a.style.display="none"}b.style.display="block";f=getPageSize();h.style.height=(f[1]+"px");listenKey();return false};imgPreload.src=c.href}function hideLightbox(){objOverlay=document.getElementById("overlay");objLightbox=document.getElementById("lightbox");objOverlay.style.display="none";objLightbox.style.display="none";document.onkeypress=""}function initLightbox(){if(!document.getElementsByTagName){return}var b=document.getElementsByTagName("a");for(var e=0;e<b.length;e++){var f=b[e];if(f.getAttribute("href")&&(f.getAttribute("rel")=="lightbox")){f.onclick=function(){showLightbox(this);return false}}}var p=document.getElementsByTagName("body").item(0);var o=document.createElement("div");o.setAttribute("id","overlay");o.onclick=function(){hideLightbox();return false};o.style.display="none";o.style.position="absolute";o.style.top="0";o.style.left="0";o.style.zIndex="90";o.style.width="100%";p.insertBefore(o,p.firstChild);var h=getPageSize();var j=getPageScroll();var k=new Image();k.onload=function(){var q=document.createElement("a");q.setAttribute("href","#");q.onclick=function(){hideLightbox();return false};o.appendChild(q);var i=document.createElement("img");i.src=loadingImage;i.setAttribute("id","loadingImage");i.style.position="absolute";i.style.zIndex="150";q.appendChild(i);k.onload=function(){};return false};k.src=loadingImage;var c=document.createElement("div");c.setAttribute("id","lightbox");c.style.display="none";c.style.position="absolute";c.style.zIndex="100";p.insertBefore(c,o.nextSibling);var d=document.createElement("a");d.setAttribute("href","#");d.setAttribute("title","Clique Para Fechar");d.onclick=function(){hideLightbox();return false};c.appendChild(d);var l=new Image();l.onload=function(){var i=document.createElement("img");i.src=closeButton;i.setAttribute("id","closeButton");i.style.position="absolute";i.style.zIndex="200";d.appendChild(i);return false};l.src=closeButton;var n=document.createElement("img");n.setAttribute("id","lightboxImage");d.appendChild(n);var m=document.createElement("div");m.setAttribute("id","lightboxDetails");c.appendChild(m);var g=document.createElement("div");g.setAttribute("id","lightboxCaption");g.style.display="none";m.appendChild(g);var a=document.createElement("div");a.setAttribute("id","keyboardMsg");a.innerHTML="Tecle <kbd>x</kbd> pra fechar";m.appendChild(a)}function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){b();a()}}}addLoadEvent(initLightbox);function createObject(){var b;var a=navigator.appName;if(a=="Microsoft Internet Explorer"){b=new ActiveXObject("Microsoft.XMLHTTP")}else{b=new XMLHttpRequest()}return b}var http=createObject();var nocache=0;function fetchmail(){var a=document.getElementById("femail").value;var c=encodeURIComponent(document.getElementById("fnome").value);var b=encodeURIComponent(document.getElementById("fcodprd").value);if(a.indexOf("@",0)==-1||a.indexOf(".",0)==-1||a.length==0){alert(VldFaleConALERTcmpemailinc);document.getElementById("loading").style.display="none";document.getElementById("formcepajaxw").style.display="block";document.cepajax.femail.focus()}else{fetchmail2()}}function fetchmail2(){loading();var a=document.getElementById("femail").value;var c=document.getElementById("fnome").value;var b=encodeURIComponent(document.getElementById("fcodprd").value);nocache=Math.random();http.open("get","envia_email_listaespera2.asp?lang=PT_br&email="+a+"&nome="+c+"&codprod="+b+"&nocache="+nocache);http.onreadystatechange=insertReply;http.send(null)}function insertReply(){if(http.readyState==4){var a=http.responseText;document.getElementById("insert_response").innerHTML=""+a;loaded()}}function fetchcep(){var a=encodeURIComponent(document.getElementById("cep").value);var b=document.getElementById("codprod").value;if(a.length!=8){alert(ValPesqCepALERTcepinvalido);document.getElementById("loading").style.display="none";document.getElementById("formcepajaxw").style.display="block";document.cepajax.cep.focus()}else{fetchcep2()}}function fetchcep2(){loading();var c="BR";var a=encodeURIComponent(document.getElementById("cep").value);var d=document.getElementById("codprod").value;var b=document.getElementById("codcat").value;nocache=Math.random();http.open("get","cep_freteajaxengine.asp?cep="+a+"&pais="+c+"&codprod="+d+"&codcad="+b+"&nocache="+nocache);http.onreadystatechange=insertReply;http.send(null)}function insertReply(){if(http.readyState==4){var a=http.responseText;document.getElementById("insert_response").innerHTML=""+a;loaded()}}function loading(){document.getElementById("loading").style.display="block";document.getElementById("formcepajaxw").style.display="none"}function loaded(){document.getElementById("loading").style.display="none";document.getElementById("insert_response").style.display="block"}function newcep(){document.getElementById("insert_response").style.display="none";document.getElementById("formcepajaxw").style.display="block"};
