function CreateWindow(url, largura, altura,Scroll,nome)
//Cria uma popup centrada
{
	esq = (screen.availWidth - largura ) / 2 ;
	cim  = (screen.availHeight - altura) / 2 -10 ;	
	janela = window.open(url,nome,"toolbar=no,width="+ largura + ",height=" + altura + ",left=" + esq + ",top=" + cim + ",scrollbars="+ Scroll +",directories=no,status=no,resize=no,menubar=no")
}  


function changeObjectStyle(objID, altura){
       //alert("altura:" + altura);
        if(window.navigator.appName == "Netscape"){
            //window.document.getElementById(objID).setAttribute('style', "height:" +altura+";");
             window.document.getElementById(objID).style.height= altura + "px";            
        }
        else{
           //document.getElementById(objID).style.setAttribute('cssText', "height:" +altura+";");  
            document.getElementById(objID).style.height= altura;
            //window.document.getElementById(objID).style.setAttribute('cssText', estilo);
        }    
}

/*
function getQueryString()
{
	var strUrl = ""
	//alert(window.navigator.appName);
	//alert(document.location.href);
	if(window.navigator.appName == "Netscape")
	{
		strUrl = window.document.location.href;
	}
	else
	{	
		strUrl = document.location.href;
	}
	//alert(strUrl);
	return strUrl;
}
*/

function changeObjectHeight(objID, w, h){
    //try{
    //alert(objID);
    //alert(h);
        //alert(window.navigator.appName);
        //alert(window.navigator.userAgent)
        //alert(window.navigator.appVersion); 
        //alert(document.all('menu'));
        /*
        var element = document.getElementById(objID);
        if( element ) 
         alert("name=" + element.name + " - id=" + element.id );
        else
         alert("ERROR: could not find the requested element");
        }
        */
      if(window.navigator.appName != "Microsoft Internet Explorer"){
       //alert("Netscape");
       //if (document[objID]){
       if (window.navigator.vendor!=''){
        //Chrome
        //alert("1");
        //alert(document[objID]);
        document.getElementById('ctl00_divh3').style.height=Number(h) + 150+"px" ;
        document.getElementById('ctl00_HeaderExtras_panelMenu').style.height=Number(h) + 150+"px" ;
        document[objID].style.height=Number(h) + 150+"px" ;
       }else{        
        //Mozilla
        //alert("2");
        //alert(document.all(objID));
        //alert(document[objID]);
        //alert(document.getElementById(objID));
        document.getElementById('ctl00_divh3').style.height=Number(h) + 150+"px" ;
        document.getElementById('ctl00_HeaderExtras_panelMenu').style.height=Number(h) + 150+"px" ;
        document[objID].style.height=Number(h) + 150 +"px" ;
        //document.all(objID).style.height=Number(h) + 150 +"px" ;
       }
      }else{
      //IE
      if (h==0){
       h=175;
       }
       //alert("IE");
       //alert(document.all(objID));
       //alert(document.all('ctl00_divh3'));
       if (document.all('ctl00_divh3')){
        document.all('ctl00_divh3').style.height=Number(h) + 150 ;
        document.all('ctl00_HeaderExtras_panelMenu').style.height=Number(h) + 150 ;
        document.all(objID).style.height=Number(h) + 150 ;
       }else{
       } 
      }

        
        //alert("resize: (w:" +w + " h: " + h +  ")")
        
        //document.all('menu').style.height=Number(h) + 150 +"px";
        /*
        if(window.navigator.appName == "Netscape"){
            //alert("Netscape");
            //window.document.getElementById(objID).style.width = "100%";
            //alert("tam:" + menu.height);
            window.document.getElementById('ctl00_HeaderExtras_panelMenu').style.height =  Number(h) + 150 +"px";
            menu.height=Number(h)+"px";
            //alert(menu.height);
        }
        else{
            //document.getElementById(objID).style.height = w;
            //alert("IE");
            document.getElementById('ctl00_HeaderExtras_panelMenu').style.height = Number(h)+150;
        }
        */
        //document.getElementById(objID).style.height = Number(h)+20;
        
        //window.document.getElementById('ctl00_Menu_panelMenu').style.height =  h+"px";
        //alert("batata REI" + objID)
    
    //}
    //catch(e){
        //do nothing
    //}
    
}

function setText(objID,texto){
    //alert('ok')
    if (document.getElementById(objID).value==texto)
        document.getElementById(objID).value='';
    else if (document.getElementById(objID).value=='')
        document.getElementById(objID).value=texto;
}

function showPopupInviteFriend(lg){
    CreateWindow('/inviteafriend.aspx?lg=' + lg, 400, 320,'No','Invite')
}

function showPopupNewsletter(lg){
    CreateWindow('/newsletter.aspx?lg=' + lg, 380, 260,'No','Newsletter')   
}


function openClose(obj,k,path,height){


     
    if (document.getElementById(obj).style.visibility=='hidden'){
        document.getElementById(obj).style.height= height + "px";
        document.getElementById(obj).style.visibility='visible';
        //k.src=path + '/close.gif';
        }
    else{
        //k.src=path + '/expand.gif';
        document.getElementById(obj).style.height="0px";
        document.getElementById(obj).style.visibility='hidden';
        
        }

}