function mm_openbrwindow(theURL,winName,features){window.open(theURL,winName,features);}
function mm_jumpmenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if(restore)selObj.selectedIndex=0;}
function mm_preloadimages(){var d=document;if(d.images){if(!d.mm_p)d.mm_p=new Array();var i,j=d.mm_p.length,a=mm_preloadimages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.mm_p[j]=new Image;d.mm_p[j++].src=a[i];}}}
function mm_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=mm_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
var rotate_delay=3000;current=0;function next(){if(document.slideform.slide[current+1]){document.images.show.src=document.slideform.slide[current+1].value;document.slideform.slide.selectedIndex=++current;}
else first();}
function previous(){if(current-1>=0){document.images.show.src=document.slideform.slide[current-1].value;document.slideform.slide.selectedIndex=--current;}
else last();}
function ap(text){document.slideform.slidebutton.value=(text=="stop")?"play":"stop";rotate();}
function change(){current=document.slideform.slide.selectedIndex;document.images.show.src=document.slideform.slide[current].value;}
function rotate(){if(document.slideform.slidebutton.value=="stop"){current=(current==document.slideform.slide.length-1)?0:current+1;document.images.show.src=document.slideform.slide[current].value;document.slideform.slide.selectedIndex=current;window.setTimeout("rotate()",rotate_delay);}}
function flevDivPositionValue(sDivID,sPositionProperty){var sPositionValue;if(document.getElementById&&!document.all){var docObj=document.getElementById(sDivID);if(document.defaultView!=null){sPositionValue=document.defaultView.getComputedStyle(docObj,"").getPropertyValue(sPositionProperty);}
else{if(sPositionProperty=="height"){sPositionValue=docObj.style.pixelHeight;}
else if(sPositionProperty=="width"){sPositionValue=docObj.style.pixelWidth;}
else{sPositionValue=eval("docObj.style."+sPositionProperty);}}
sPositionValue=(sPositionValue=="")?"0":sPositionValue;}
else if(document.layers){var docObj=eval("mm_findObj('"+sDivID+"')");if((sPositionProperty=="width")||(sPositionProperty=="height")){sPositionValue=eval("docObj.clip."+sPositionProperty);}
else{sPositionValue=eval("docObj."+sPositionProperty);}
sPositionValue=(sPositionValue=="")?"0":sPositionValue;}
else if(document.all){if(sPositionProperty=="width"){sPositionValue=eval(sDivID+".offsetWidth");}
else if(sPositionProperty=="height"){sPositionValue=eval(sDivID+".offsetHeight");}
else if(sPositionProperty=="top"){sPositionValue=eval(sDivID+".offsetTop");}
else if(sPositionProperty=="left"){sPositionValue=eval(sDivID+".offsetLeft");}
sPositionValue=(sPositionValue=="")?"0":sPositionValue;}
if(isNaN(sPositionValue)){if(sPositionValue.indexOf('px')>0){sPositionValue=sPositionValue.substring(0,sPositionValue.indexOf('px'));}}
return parseInt(sPositionValue);}
function flevMoveDiv(sDivID,sLeft,sTop){var docObj=eval("mm_findObj('"+sDivID+"')");if(document.layers){eval("docObj.top = '"+sTop+"'");eval("docObj.left = '"+sLeft+"'");}
else{eval("docObj.style.top = '"+sTop+"'");eval("docObj.style.left = '"+sLeft+"'");}}
function change2()
{document.images.show.onload=function aoCarregarImagem(){var prox=document.getElementById('proxima').disabled;var ant=document.getElementById('anterior').disabled;var num=document.slideform.slide.selectedIndex;var numFts=document.getElementById('meio');if(prox==true&&num<numFts){document.getElementById('proxima').disabled=false}
else{if(prox==false&&num==numFts){document.getElementById('proxima').disabled=true}};if(ant==true&&num>1){document.getElementById('anterior').disabled=false}
else{if(ant==false&&num==1){document.getElementById('anterior').disabled=true}};}}
function mm_validateform(){var i,p,q,nm,test,num,min,max,errors='',args=mm_validateform.arguments;for(i=0;i<(args.length-2);i+=3){test=args[i+2];val=mm_findObj(args[i]);if(val){nm=val.name;if((val=val.value)!=""){if(test.indexOf('isEmail')!=-1){p=val.indexOf('@');if(p<1||p==(val.length-1))errors+='- '+nm+' : endereço não é válido.\n';}else if(test!='R'){num=parseFloat(val);if(isNaN(val))errors+='- '+nm+' must contain a number.\n';if(test.indexOf('inRange')!=-1){p=test.indexOf(':');min=test.substring(8,p);max=test.substring(p+1);if(num<min||max<num)errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';}}}else if(test.charAt(0)=='R')errors+='- '+nm+' : campo não preenchido.\n';}}if(errors)alert('Não é possível enviar. Favor verificar:\n'+errors);document.mm_returnvalue=(errors=='');}
var persistmenu="yes"
var persisttype="sitewide"
if(document.getElementById){document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('<\/style>\n')}
function SwitchMenu(obj){if(document.getElementById){var el=document.getElementById(obj);var ar=document.getElementById("masterdiv").getElementsByTagName("span");if(el.style.display!="block"){for(var i=0;i<ar.length;i++){if(ar[i].className=="submenu")
ar[i].style.display="none";}
el.style.display="block";}else{el.style.display="none";}}}
function get_cookie(Name){var search=Name+"="
var returnvalue="";if(document.cookie.length>0){offset=document.cookie.indexOf(search)
if(offset!=-1){offset+=search.length
end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;returnvalue=unescape(document.cookie.substring(offset,end))}}
return returnvalue;}
function onloadfunction(){if(persistmenu=="yes"){var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=get_cookie(cookiename)
if(cookievalue!="")
document.getElementById(cookievalue).style.display="block"}}
function savemenustate(){var inc=1,blockid=""
while(document.getElementById("sub"+inc)){if(document.getElementById("sub"+inc).style.display=="block"){blockid="sub"+inc
break}
inc++}
var cookiename=(persisttype=="sitewide")?"switchmenu":window.location.pathname
var cookievalue=(persisttype=="sitewide")?blockid+";path=/":blockid
document.cookie=cookiename+"="+cookievalue}
if(window.addEventListener)
window.addEventListener("load",onloadfunction,false)
else if(window.attachEvent)
window.attachEvent("onload",onloadfunction)
else if(document.getElementById)
window.onload=onloadfunction
if(persistmenu=="yes"&&document.getElementById)
window.onunload=savemenustate
