	function readCookie(name) 
	{
    	var nameEQ = name + "=";
    	var ca = document.cookie.split(';');
    	for(var i=0;i < ca.length;i++) 
    	{
    		var c = ca[i];
    		while (c.charAt(0)==' ') c = c.substring(1,c.length);
    		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    	}
    	return null;
	}
	
	function userLoggedIn()
	{
		//return readCookie('userloggedin');
		return (readCookie('userloggedin') || readCookie('venda') != null || readCookie('VLUID') != null);
	}
	
	function textSize()
	{
		//return readCookie('userloggedin');
		var iTextSize = readCookie('tsz');
		
		if (iTextSize != null && iTextSize > 0)
		{
			document.write('<style type="text/css" media="screen"><!--body { font-size: '+iTextSize+'px; }--></style>');
		}
		
	}	
	
	function toggleShowHide(sDiv)
	{
		if (document.getElementById(sDiv).style.display == "block")
		{
			document.getElementById(sDiv).style.display = "none";
		}else{
			document.getElementById(sDiv).style.display = "block";
		}
	}	
	
	function popup(name, sUrl, width, height) {
		window.open(sUrl, name,'width='+width+'px,height='+height+'px,menubar=no,status=yes,scrollbars=no,toolbar=no,location=no,directories=no,resizable=yes,top=25,left=30'); 
		return false; //necessary so it doesn't follow href 
	}
	