var t
var m
function contractall(){if(document.getElementById){var inc=0
while(document.getElementById("sub"+inc)){document.getElementById("sub"+inc).style.display="none"
inc++}}}
function contractAllAbas(){document.getElementById("taba0").className='aba'
document.getElementById("taba1").className='aba'
document.getElementById("taba2").className='aba_large'
document.getElementById("taba3").className='aba_large'
document.getElementById("taba4").className='aba_large'}
function aba1()
{contractAllAbas()
document.getElementById("taba0").className='aba_hover aba'}
function doAba(x,size)
{contractAllAbas()
if(size==1)
{document.getElementById("taba"+x).className='aba_large_hover aba_large'}
else
{document.getElementById("taba"+x).className='aba_hover aba'}
expandone(x)}
function expandone1(x){clearTimeout(m);m=setTimeout('expandone(0)',2000)}
function expandone(x){clearTimeout(m);contractall();if(x==0)aba1()
document.getElementById("sub"+x).style.display="block"}
function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if(restore)selObj.selectedIndex=0;}
function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}
var disappeardelay=250
var enableanchorlink=0
var hidemenu_onclick=0
var ie5=document.all
var ns6=document.getElementById&&!document.all
if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1)}
function getposOffset(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;}
function showhide(obj,e,visible,hidden){if(ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if(e.type=="click"&&obj.display==hidden||e.type=="mouseover")
{if(ieversion<=6){document.getElementById('parametro').style.visibility="hidden"}
obj.display=visible}
else if(e.type=="click")
{obj.display=hidden}}
function iecompattest(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function clearbrowseredge(obj,whichedge){var edgeoffset=0;if(whichedge=="rightedge"){var windowedge=ie5&&!window.opera?iecompattest().scrollLeft+iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if(windowedge-dropmenuobj.x<dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth}
else{var topedge=ie5&&!window.opera?iecompattest().scrollTop:window.pageYOffset
var windowedge=ie5&&!window.opera?iecompattest().scrollTop+iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if(windowedge-dropmenuobj.y<dropmenuobj.contentmeasure){edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge}}
return edgeoffset}
function dropdownmenu(obj,e,dropmenuID){if(window.event)event.cancelBubble=true
else if(e.stopPropagation)e.stopPropagation()
if(typeof dropmenuobj!="undefined")
dropmenuobj.style.display="none"
clearhidemenu()
if(ie5||ns6){obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if(hidemenu_onclick)dropmenuobj.onclick=function(){dropmenuobj.style.display='none';}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5?function(){dynamichide(event)}:function(event){dynamichide(event)}
showhide(dropmenuobj.style,e,"block","none")
dropmenuobj.x=getposOffset(obj,"left")
dropmenuobj.y=getposOffset(obj,"top")
dropmenuobj.style.top=dropmenuobj.y+obj.offsetHeight+"px"
if(ieversion<=6){dropmenuobj.style.left=(980-dropmenuobj.clientWidth)/2+"px";}else{dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj,"rightedge")+"px";}}
return clickreturnvalue()}
function clickreturnvalue(){if((ie5||ns6)&&!enableanchorlink)return false
else return true}
function contains_ns6(a,b){if(b==null)return false
while(b.parentNode)
if((b=b.parentNode)==a)
return true;return false;}
function dynamichide(e){if(ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if(ns6&&e.currentTarget!=e.relatedTarget&&!contains_ns6(e.currentTarget,e.relatedTarget))
delayhidemenu()}
function delayhidemenu(){delayhide=setTimeout("dropmenuobj.style.display='none';",disappeardelay)}
function clearhidemenu(){document.getElementById('parametro').style.visibility='visible';if(typeof delayhide!="undefined")
clearTimeout(delayhide)}
var aguarde_ajax="<img src='images/wait.gif' width='16' height='16' alt='...' />";var ajaxResponse="";function callAjax(div,acao,params,aguarde,elMethod){if(div==undefined){}
else{var objDiv=document.getElementById(div);}
if(elMethod===undefined)elMethod='get';var varArquivo="http://www.letras.com.br/ajax.asp?acao="+acao;if(params>"")varArquivo+="&"+params
if(aguarde)objDiv.innerHTML=aguarde_ajax;var oAjax=new Ajax(objDiv,elMethod,varArquivo);}
function tag2script(texto){var ini=0;while(ini!=-1){ini=texto.indexOf('<'+'script',ini);if(ini>=0){ini=texto.indexOf('>',ini)+1;var fim=texto.indexOf('</'+'script'+'>',ini);codigo=texto.substring(ini,fim);eval(codigo);}}}
var Ajax=function(Objeto,Metodo,Arquivo){var xmlhttp;this.callAjax=function(){if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}
else if(window.ActiveXObject){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(E){xmlhttp=false;}}}}
switch(Metodo){case'post':this.callAjax();xmlhttp.abort()
xmlhttp.open('POST',Arquivo+'&'+Math.floor(Math.random()*999),true);xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;iso-8859-1");xmlhttp.setRequestHeader("CharSet","iso-8859-1")
xmlhttp.setRequestHeader("Cache-Control","no-store, no-cache, must-revalidate");xmlhttp.setRequestHeader("Cache-Control","post-check=0, pre-check=0");xmlhttp.setRequestHeader("Pragma","no-cache");xmlhttp.send(null);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var txtRetorno=xmlhttp.responseText;tag2script(txtRetorno);if(Objeto==null)ajaxResponse=txtRetorno;else Objeto.innerHTML=txtRetorno;}}
break;case'get':this.callAjax();xmlhttp.abort();xmlhttp.open('GET',Arquivo,true);xmlhttp.setRequestHeader("Content-Type","text/html;charset=iso-8859-1");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var txtRetorno=xmlhttp.responseText;tag2script(txtRetorno);if(Objeto==null)ajaxResponse=txtRetorno;else Objeto.innerHTML=txtRetorno;}}
xmlhttp.send(null);break;case'autocomplete':this.callAjax();xmlhttp.abort();var v2=Arquivo;Arquivo="http://www.letras.com.br/arquivos/autocomplete/artistas/"+v2.charAt(0)+"/_"+v2+".txt";xmlhttp.open('GET',Arquivo,true);xmlhttp.setRequestHeader("Content-Type","text/plain;charset=ISO-8859-1");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var txtRetorno=xmlhttp.responseText;if(txtRetorno.indexOf("<")==-1){tag2script(txtRetorno);ajaxResponse=txtRetorno;var arrArts=ajaxResponse.split("\n");for(var x=1;x<=arrArts.length-1;x++){addBusca(arrArts[x].split(" | ")[1],arrArts[x].split(" | ")[0]);}
cacheBuscas[v2]=Buscas;terminaAutoCompletar(Objeto);LastSearch=v2;LastSearchRows=Buscas.length;}
else{var v3="";if(v2.length>2)v3=v2.substr(0,v2.length-1)
cacheBuscas[v2]=cacheBuscas[v3];chamaAutoCompletar2(v3);terminaAutoCompletar(Objeto);LastSearch=v3;LastSearchRows=Buscas.length;}}}
xmlhttp.send(null);break;default:break;}}
function showPersonalizar(obj,e)
{if(document.getElementById("personalizar").innerHTML=="")callAjax("personalizar","SHOW_PERSONALIZAR","",true)
dropdownmenu(obj,e,'personalizar')}
function cleanWallpaper()
{callAjax(null,"ALTERAR_BG","p=1&p2=&p3=",false)
document.getElementById('fundo').src='images/bg/bg_branco.png'}
function cleanTopo()
{callAjax(null,"ALTERAR_BG","p=2&p2=&p3=",false)
document.getElementById('topo').style.backgroundImage='url(images/bg_topo_trans.png)'}
function changeBG(obj)
{callAjax(null,"ALTERAR_BG","p=1&p2="+obj.id.substr(2)+"&p3="+obj.value,false)
document.getElementById('fundo').src='arquivos/bg/wallpapers/'+obj.value}
function changeBG2(id,url)
{callAjax(null,"ALTERAR_BG","p=1&p2="+id+"&p3="+url,false)
document.getElementById('fundo').src='arquivos/bg/wallpapers/'+url}
function changeTopo(obj)
{callAjax(null,"ALTERAR_BG","p=2&p2="+obj.id.substr(2)+"&p3="+obj.value,false)
document.getElementById('topo').style.backgroundImage='url(arquivos/bg/topo/'+obj.value+')'}
function changeTopoCookie(url)
{document.getElementById('topo').style.backgroundImage='url(arquivos/bg/topo/'+url+')'}
function changeWallpaperCookie(url)
{document.getElementById('fundo').src='arquivos/bg/wallpapers/'+url}
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;}
var Buscas=new Array();var cacheBuscas=new Array();var Selecionado="";var IdSelecionado=0;var IdAnterior=0;var Quantidade=0;var TotalSelecionados=0;var LastSearch="";var LastSearchRows=999;String.prototype.trim=function(){var x=this;x=x.replace(/^\s*(.*)/,"$1");x=x.replace(/(.*?)\s*$/,"$1");return x}
String.prototype.replaceAll=function(de,para){var str=this;var pos=str.indexOf(de);while(pos>-1){str=str.replace(de,para);pos=str.indexOf(de);}return(str);}
String.prototype.stripTags=function(){var v=this;var re=/<\S[^>]*>/g;v=v.replace(re,"");return v;}
String.prototype.replacesBusca=function(){return this.stripAcentos().replace(/[^\w]/g,"")};String.prototype.stripAcentos=function(){var tmp=this.toLowerCase();tmp=tmp.replace(/[áàâãäÁÀÂÃÄ]/g,"a").replace(/[éèêëÉÈÊË]/g,"e").replace(/[íìîïÍÌÎÏ]/g,"i").replace(/[óòôõöÓÒÔÕÖ]/g,"o").replace(/[úùûüÚÙÛÜ]/g,"u").replace(/[çÇ]/g,"c").replace(/[ñÑ]/g,"n");return tmp};function addBusca(T1,T2){var Busca=new Array();Busca[0]=T1;Busca[1]=T2;Buscas.push(Busca);}
function doNegrito(T1,T2){var pos=0;var v=T2.stripTags();v=T2.split(' ');var T3=T1;for(n in v){pos=T3.toLowerCase().stripAcentos().indexOf(v[n].toLowerCase().stripAcentos());if(pos!=-1&&v[n].length>=1){t=T3.substring(0,pos);t+='kkkkkk'+T3.substring(pos,pos+v[n].length)+'zzzzzz';T3=t+T3.substring(pos+v[n].length);}}
return T3;}
function populaBusca(obj,o){var strLista="";var strItem="";var Cont=0;var Texto="";var Quantidade=0;var Ant="";var arrTexto=new Array();var arrTmp=new Array();arrTexto[0]=o.value.toString();Texto=arrTexto[0];if(Texto=="")return false;strLista="<ul id='lstBuscas' class=\"autocomplete\">";for(Cont=0;Cont<Buscas.length;Cont++){if(Buscas[Cont][0].toString().toLowerCase().replacesBusca().indexOf(Texto.toLowerCase().replacesBusca())>-1){if(Ant!=Buscas[Cont][0].toString()){arrTmp[Quantidade]=Buscas[Cont];Quantidade++;strItem=Buscas[Cont][0].toString();if(strItem.length>24)strItem=strItem.substr(0,24)+"...";strItem=doNegrito(strItem,Texto);strLista+="<li id=\"itmBusca"+Quantidade+"\" onMouseOver=\"SetBuscaSelecionada("+Quantidade+")\"><a href=\""+Buscas[Cont][1].toString()+"\" id=\"lnkBusca"+Quantidade+"\" style='font-weight:normal' onMouseDown='window.location.href=\""+Buscas[Cont][1].toString()+"\"'>"+strItem+"</a></li>";}
Ant=Buscas[Cont][0].toString();}}
strLista+="</ul>";Buscas=arrTmp;TotalSelecionados=Quantidade;if(TotalSelecionados>0){obj.innerHTML=strLista.replaceAll("kkkkkk","<B>").replaceAll("zzzzzz","</B>");var oLst=document.getElementById("lstBuscas");return true;}
else return true;}
function selectBusca(IdDestino,strOrigem,TextoDigitado){var objDestino=document.getElementById(IdDestino);unshowAutoCompletar(objDestino);if(strOrigem!="")document.location.href="http://www.letras.com.br/"+strOrigem;else document.formB.submit();}
function SetBuscaSelecionada(IdSel){var oInput=document.getElementById("busca");var oSel=document.getElementById("itmBusca"+IdSel);var oLnk=document.getElementById("lnkBusca"+IdSel);var Artista;var codArtista;IdAnterior=IdSelecionado;IdSelecionado=IdSel;if(Buscas[IdSel-1]==undefined)return false
Selecionado=Buscas[IdSel-1][1];oInput.value=Buscas[IdSel-1][0].toString().trim();oLnk.className="autoHover";doScrollBusca(oSel,IdSelecionado);if(IdAnterior>0){var oAnt=document.getElementById("lnkBusca"+IdAnterior);oAnt.className="autoOut";}}
function AutoCompletar(o,e){var tecla=(window.event)?event.keyCode:e.which;var Texto="";var arrTexto=new Array();var IdSelecionado2;if(o.value==""){unshowAutoCompletar(o);return false;}
arrTexto[0]=o.value.toString();Texto=arrTexto[arrTexto.length-1];Texto=Texto.trim();if(tecla==13){selectBusca(o.id,Selecionado,Texto);return false;}
else if(tecla==38||tecla==40){if(IdSelecionado<1){SetBuscaSelecionada(1);return false;}
if(tecla==38){IdSelecionado2=IdSelecionado-1;}
if(tecla==40){IdSelecionado2=IdSelecionado+1;}
if(TotalSelecionados>=IdSelecionado){if(IdSelecionado2==0){IdSelecionado2=TotalSelecionados}
else if(IdSelecionado2>TotalSelecionados){IdSelecionado2=1}
SetBuscaSelecionada(IdSelecionado2)}}
else if(tecla==8||(tecla>=48&&tecla<=57)||(tecla>=65&&tecla<=90)||(tecla>=97&&tecla<=122)||(tecla>=128&&tecla<=145)||(tecla>=128&&tecla<=165)||(e.type=="focus")){chamaAutoCompletar(o);}
return true;}
function chamaAutoCompletar(o){var v=o.value
var v2=v.replacesBusca();var v3="";var total=20;var totalMax=70;var totalAnt=0;Buscas.length=0;if(v2.length>1)v3=v2.substr(0,v2.length-1);IdAnterior=0;IdSelecionado=0;Selecionado="";document.getElementById("lstbusca").scrollTop=0;if(LastSearchRows<70&&v.toString().indexOf(LastSearch)>-1){Buscas=cacheBuscas[LastSearch];terminaAutoCompletar(o);return true;}
if(cacheBuscas[v2]!=undefined){Buscas=cacheBuscas[v2];terminaAutoCompletar(o);LastSearch=v2;LastSearchRows=Buscas.length;}
else{if(v2.length<=4){var oAjax=new Ajax(o,"autocomplete",v2);return true;}
else if(v2.length>4){v3=v2.substr(0,4);if(cacheBuscas[v3]!=undefined){chamaAutoCompletar2(v3);terminaAutoCompletar(o);}}
else if(v3!=""){if(cacheBuscas[v3]!=undefined){chamaAutoCompletar2(v3);terminaAutoCompletar(o);}}}}
function chamaAutoCompletar2(v){var total=20;var totalMax=70;Buscas.length=0;if(cacheBuscas[v]!=undefined){Buscas=cacheBuscas[v];LastSearch=v;LastSearchRows=Buscas.length;}
TotalSelecionados=Buscas.length;}
function terminaAutoCompletar(o){var objSpan;var objDiv;var IdSelecionado2;var oPos;var posTop=0;var posLeft=0;var posWith=0;oPos=getPosicaoElemento(o);posTop=oPos.top+o.offsetHeight;posLeft=oPos.left;posWith=o.offsetWidth;objSpan=document.getElementById("lst"+o.id+"");objSpan.style.left=posLeft+"px";objSpan.style.top=posTop+"px";objSpan.style.width=posWith+"px";if(populaBusca(objSpan,o)){objSpan.style.display="block";}
else{var oLst;oLst=document.getElementById("lstBuscas");if(oLst!=null){objSpan.style.display="none";Selecionado="";}}
return;}
function showAutoCompletar(o){if(TotalSelecionados>0){document.getElementById("lst"+o.id+"").style.display="block";}}
function unshowAutoCompletar(o){var ret;if(TotalSelecionados>0){document.getElementById("lst"+o.id+"").style.display="none";}
return ret;}
function getPosicaoElemento(elem){var offsetTrail=elem;var offsetLeft=0;var offsetTop=0;while(offsetTrail){offsetLeft+=offsetTrail.offsetLeft;offsetTop+=offsetTrail.offsetTop;offsetTrail=offsetTrail.offsetParent;}
if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){offsetLeft+=document.body.leftMargin;offsetTop+=document.body.topMargin;}
if(navigator.userAgent.indexOf("MSIE 6")>0){offsetLeft=offsetLeft-7};return{left:offsetLeft,top:offsetTop};}
function getPos(o){var bo,x,y,b;x=y=0;if(o.getBoundingClientRect){bo=o.getBoundingClientRect();x=bo.left;y=bo.top;x+=document.documentElement.scrollLeft;y+=document.documentElement.scrollTop;}
else{while(o&&o.nodeName!="BODY"){x+=o.offsetLeft;y+=o.offsetTop;if(window.opera){x--;y--}
else{x++;y++}
b=1;if(b>0){x+=b;y+=b}
o=o.offsetParent}}
return{x:x,y:y}}
function doScrollBusca(i,n){var oLst=document.getElementById("lstbusca");var t=24;if(IdSelecionado==TotalSelecionados){oLst.scrollTop=oLst.scrollHeight}
else if(n<=6){oLst.scrollTop=0;}
else{if(IdAnterior<IdSelecionado)oLst.scrollTop+=t;else oLst.scrollTop-=t;}}
var gPopupMask=null;var gPopupContainer=null;var gPopFrame=null;var gReturnFunc;var gPopupIsShown=false;var gHideSelects=false;var moveableWindow=true;var gTabIndexes=new Array();var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");if(!document.all){document.onkeypress=keyDownHandler;}
function initPopUp(){theBody=document.getElementsByTagName('BODY')[0];popmask=document.createElement('div');popmask.id='popupMask';popcont=document.createElement('div');popcont.id='popupContainer';popcont.innerHTML=''+'<div id="popupInner">'+'<div id="popupTitleBar">'+'<div id="popupTitle"></div>'+'<div id="popupControls">'+'<img src="/site/modalfiles/close.gif" onclick="hidePopWin(false);" id="popCloseBox" />'+'</div>'+'</div>'+'<iframe src="/site/modalfiles/loading.html" style="width:100%;height:100%;background-color:transparent;overflow-x:hidden" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>'+'</div>';theBody.appendChild(popmask);theBody.appendChild(popcont);gPopupMask=document.getElementById("popupMask");gPopupContainer=document.getElementById("popupContainer");gPopFrame=document.getElementById("popupFrame");var brsVersion=parseInt(window.navigator.appVersion.charAt(0),10);if(brsVersion<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true;}
var elms=document.getElementsByTagName('a');for(i=0;i<elms.length;i++){if(elms[i].className.indexOf("submodal")==0){elms[i].onclick=function(){var width=400;var height=200;params=this.className.split('-');if(params.length==3){width=parseInt(params[1]);height=parseInt(params[2]);}
showPopWin(this.href,width,height,null);return false;}}}}
addEvent(window,"load",initPopUp);function showPopWin(url,width,height,returnFunc,showCloseBox){if(showCloseBox==null||showCloseBox==true){document.getElementById("popCloseBox").style.display="block";}else{document.getElementById("popCloseBox").style.display="none";}
gPopupIsShown=true;disableTabIndexes();gPopupMask.style.display="block";gPopupContainer.style.display="block";centerPopWin(width,height);moveableWindow=false;var titleBarHeight=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.width=width+"px";gPopupContainer.style.height=(height+titleBarHeight)+"px";setMaskSize();gPopFrame.style.width=parseInt(document.getElementById("popupTitleBar").offsetWidth,10)+"px";gPopFrame.style.height=(height)+"px";gPopFrame.src=url;gReturnFunc=returnFunc;if(gHideSelects==true){hideSelectBoxes();}
window.setTimeout("setPopTitle();",600);}
var gi=0;var isPagLetra=false;function centerPopWin(width,height){if(isPagLetra)mueve_cabecera();if(gPopupIsShown==true){if(width==null||isNaN(width)){width=gPopupContainer.offsetWidth;}
if(height==null){height=gPopupContainer.offsetHeight;}
var theBody=document.getElementsByTagName("BODY")[0];if(!document.all)
{yOffSet=window.pageYOffset}
else
{if(typeof(document.body.style.maxHeight)!="undefined")
yOffSet=document.documentElement.scrollTop
else
yOffSet=theBody.scrollTop}
var scTop=yOffSet
var scLeft=parseInt(theBody.scrollLeft,10);if(document.all)
gPopupMask.style.top="0px";else
gPopupMask.style.top=scTop+"px";gPopupMask.style.left=scLeft+"px";setMaskSize();var titleBarHeight=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);var fullHeight=getViewportHeight();var fullWidth=getViewportWidth();if(!moveableWindow)return false;var center=(scTop+((fullHeight-(height+titleBarHeight))/2))
if(document.all)
{if(center<scTop)center=scTop
gPopupContainer.style.top=center+"px";}
else
{if(center<document.documentElement.scrollTop)center=document.documentElement.scrollTop
gPopupContainer.style.top=center+"px";}
gPopupContainer.style.left=(scLeft+((fullWidth-width)/2))+"px";}}
addEvent(window,"resize",centerPopWin);window.onscroll=centerPopWin;function setMaskSize(){var theBody=document.getElementsByTagName("BODY")[0];var fullHeight=getViewportHeight();var fullWidth=getViewportWidth();if(fullHeight>theBody.scrollHeight){popHeight=fullHeight;}else{popHeight=theBody.scrollHeight;}
if(fullWidth>theBody.scrollWidth){popWidth=fullWidth;}else{popWidth=theBody.scrollWidth;}
gPopupMask.style.height=popHeight+"px";gPopupMask.style.width=popWidth+"px";}
function hidePopWin(callReturnFunc){gPopupIsShown=false;moveableWindow=true;var theBody=document.getElementsByTagName("BODY")[0];theBody.style.overflow="";restoreTabIndexes();if(gPopupMask==null){return;}
gPopupMask.style.display="none";gPopupContainer.style.display="none";if(callReturnFunc==true&&gReturnFunc!=null){gReturnFunc(window.frames["popupFrame"].returnVal);}
gPopFrame.src='/site/modalfiles/loading.html';if(gHideSelects==true){displaySelectBoxes();}}
function setPopTitle(){return;if(window.frames["popupFrame"].document.title==null){window.setTimeout("setPopTitle();",10);}else{document.getElementById("popupTitle").innerHTML=window.frames["popupFrame"].document.title;}}
function chkSelo(){callAjax("selo","SELO");}
function keyDownHandler(e){if(gPopupIsShown&&e.keyCode==9)return false;}
function disableTabIndexes(){if(document.all){var i=0;for(var j=0;j<gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){gTabIndexes[i]=tagElements[k].tabIndex;tagElements[k].tabIndex="-1";i++;}}}}
function restoreTabIndexes(){if(document.all){var i=0;for(var j=0;j<gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){tagElements[k].tabIndex=gTabIndexes[i];tagElements[k].tabEnabled=true;i++;}}}}
function hideSelectBoxes(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT"){document.forms[i].elements[e].style.visibility="hidden";}}}}
function displaySelectBoxes(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT"){document.forms[i].elements[e].style.visibility="visible";}}}}
function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}
function removeEvent(obj,evType,fn,useCapture){if(obj.removeEventListener){obj.removeEventListener(evType,fn,useCapture);return true;}else if(obj.detachEvent){var r=obj.detachEvent("on"+evType,fn);return r;}else{alert("Handler could not be removed");}}
function getViewportHeight(){if(window.innerHeight!=window.undefined)return window.innerHeight;if(document.compatMode=='CSS1Compat')return document.documentElement.clientHeight;if(document.body)return document.body.clientHeight;return window.undefined;}
function getViewportWidth(){if(window.innerWidth!=window.undefined)return window.innerWidth;if(document.compatMode=='CSS1Compat')return document.documentElement.clientWidth;if(document.body)return document.body.clientWidth;return window.undefined;}
