/*var w;
var h;

if (screen.availWidth<1024) {
	w = screen.availWidth;
} else if (screen.availWidth==1024) {
	w = 1024;
} else if (screen.availWidth>1024) {
	w = 1280;
}

if (screen.availHeight<800) {
	h = screen.availHeight;
} else if (screen.availHeight>=800) {
	h = 780;
}

window.resizeTo(w,h);

var px = (screen.availWidth-window.width)/2;
var py = (screen.availHeight-window.height)/2;


window.moveTo(px,py);*/


function abrir() { 
	wind=window.open("","","toolbar=no,location=no,status=no,resizable=no,scrollbars=no,menubar=no,fullscreen=no,left=0,top=0,width=1024,height=820");
	wind.focus()
	wind.location = "index.php";
	wind.name = "full";
} 

function getPath () {
	return "http://"+unescape(window.location.hostname)+"/";
}

function getContainerName()
{
	var sPath = window.location.pathname;
	//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	alert(sPage);
}

function SetCookie(cookieName,cookieValue,nDays, path) {
 //window.alert ("Nome: " + cookieName+"  Valor: " + cookieValue+"  Dias: " + nDays)
 var today = new Date();
 var expire = new Date();
 if (path == null || path == "") path = "/";
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString()+";path="+path;
}

function getCookie(cookie_name)
{
  if (!document.cookie.match(eval("/" + escape(cookie_name) + "=/")))
  {
   return false;
  }

	return unescape(document.cookie.replace(eval("/^.*?" + escape(cookie_name) + "=([^\\s;]*).*$/"), "$1"));
}


function closeBanner() 
{
	window.location = "/";
}

function closeBanner2() 
{
	szDivID = "bannercontent";
	iState = 0;
	var obj = document.layers ? document.layers[szDivID] :
	document.getElementById ?  document.getElementById(szDivID).style :  document.all[szDivID].style;
	obj.visibility = document.layers ? (iState ? "show" : "hide") :   (iState ? "visible" : "hidden");
}


function openBanner() 
{
	window.location = "/";
}


function getViewportSize() { 
        var size = [0, 0]; 
        if (typeof window.innerWidth != "undefined") { 
                size = [window.innerWidth, window.innerHeight];
        } 
        else if (typeof document.documentElement != "undefined" && 
                        typeof document.documentElement.clientWidth != "undefined" && 
                        document.documentElement.clientWidth != 0) {
                size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; 
        }
        else {
                size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; 
        }
        return size; 
}


var minWidth = 1000;
var minHeight = 570;

var resize = function () {
        var el = document.getElementById("flashcontent");
        var size = getViewportSize(); 
		//alert(size[0]+", " +size[1]);
		if (size[0]<900) {
			//document.body.style.overflow='hidden';
		} else {
			//document.body.style.overflow='';
		}
       	el.style.width = size[0] < minWidth ? minWidth + "px" : "100%";
        el.style.height = size[1] < minHeight ? minHeight + "px" : "100%";
	//	alert (el.style.height)
};

window.onresize = resize;
var resizer = setTimeout(resize, 100);

	/* for mozilla */
//	min-width: 990px;
	//min-height: 550px;
 
	/* for IE */
	//width:  expression( Math.max(document.body.clientWidth,990) + "px" );
	//height: expression( Math.max(document.body.clientHeight,550) + "px" );
	
	
function abreAmbiente() 
{ 
	szDivID = "bannercontent";
	iState = 1;
	var obj = document.layers ? document.layers[szDivID] :
	document.getElementById ?  document.getElementById(szDivID).style :  document.all[szDivID].style;
	obj.visibility = document.layers ? (iState ? "show" : "hide") :   (iState ? "visible" : "hidden");
		/*wind=window.open("","","toolbar=no,location=no,status=no,resizable=no,scrollbars=no,menubar=no,fullscreen=no,left=0,top=0,width=1024,height=420");
	wind.focus()
	wind.location = "salao360.swf";
	wind.name = "ambiente";*/
} 
