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 CreateOutsideWindow(url, nome)
//Cria uma popup centrada
{
   
    janela = window.open(url, nome)
}  

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 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';
        
        }

}




function changeObjectHeight(objID, w, h){
    var DName="ctl00_divh3"
    //try{
    //alert(objID);
    if (h < 21) {
    h=30
    }
   //alert(h);
//      if(window.navigator.appName != "Microsoft Internet Explorer"){
          document.getElementById(DName).style.height = Number(h) + 0 + "px";
          document.getElementById('ctl00_MenuWebsites').style.height = Number(h) + 0 + "px";
            document[objID].style.height=Number(h) + 0+"px" ;
//      }else{

//      //IE
//       if (document.all(DName)){
//        document.all(DName).style.height=Number(h) + 0 ;
//        document.all(objID).style.height = Number(h) + 0;
//        document.getElementById('ctl00_MenuWebsites').style.height = Number(h) + 0 + "px";
//       }else{
//       } 
//      }

}

//function changeObjectHeight(objID, w, h) {
//    var DName = "divheadermenu"
//    //var DName = "ctl00_divh3"

//    //alert("L:" + w + " A:" + h);
//    //alert("DName " + DName + "  objID " + objID)
//    document[objID].style.width = Number(w) + "px";
//    document[objID].style.height = Number(h) + "px";

//}

  function resizeMenuLogos(objID, w, h) {
      var DName = "ctl00_placeContent_divMenuLogo"
      //try{
      //alert(objID);
      if (h < 21) {
          h = 30
      }
      //alert(h);
      if (window.navigator.appName != "Microsoft Internet Explorer") {
          document.getElementById(DName).style.height = Number(h) + 0 + "px";
          document[objID].style.height = Number(h) + 0 + "px";
      } else {

          //IE
          if (document.all(DName)) {
              document.all(DName).style.height = Number(h) + 0;
              document.all(objID).style.height = Number(h) + 0;
          
          } else {
          }
      }

  }
