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 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 = "divheadermenu"
//    //var DName = "ctl00_divh3"

//    //alert("L:" + w + " A:" + h);
//    if (window.navigator.appName != "Microsoft Internet Explorer") 
//    {
//        //alert("DName " + DName + "  objID " + objID)
//        document[objID].style.width = Number(w) + "px";
//        document[objID].style.height = Number(h) + "px";
//    }
//    else 
//    {
//        //alert("DName " + DName + "  objID " + objID)
//        document[objID].style.width = Number(w) + "px";
//        document[objID].style.height = Number(h) + "px";
//    }

//}

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";

}
