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);

//      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{
//    }

//      }

//}


function changeObjectHeight(objID, w, h) {
    var DName = "ctl00_divh3"
    //try{
    //alert(h);

    if (h == 0) { h = 175; }
    if (window.navigator.appName != "Microsoft Internet Explorer") {
        document.getElementById(DName).style.height = Number(h) + 150 + "px";
        document[objID].style.height = Number(h) + 150 + "px";
    } else {

        //IE
        if (document.all(DName)) {
            document.getElementById(DName).style.height = Number(h) + 150 + "px";
            document[objID].style.height = Number(h) + 150 + "px";
        } else {
        }
    }


}



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';
        
        }

}
