<!--

//******************************************************************************
//
// Browser check for all versions of IE and NS
//
//******************************************************************************

var agt = navigator.userAgent.toLowerCase(); 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 

//Just to be safe we can check for all versions of IE and NS

var is_nav  = ((agt.indexOf('mozilla')!=-1));
var is_nav2 = (is_nav && (is_major == 2)); 
var is_nav3 = (is_nav && (is_major == 3)); 
var is_nav4 = (is_nav && (is_major == 4)); 
var is_nav4up = (is_nav && (is_major >= 4)); 
var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) ); 
var is_nav5 = (is_nav && (is_major == 5)); 
var is_nav5up = (is_nav && (is_major >= 5)); 

var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
var is_ie4up  = (is_ie  && (is_major >= 4)); 
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4); 

if (is_ie4up) {
document.write("<LINK rel='stylesheet' href='css/globalstyle_ie.css' type='text/css'>");
}
else { 
document.write("<LINK rel='stylesheet' href='css/globalstyle_ns.css' type='text/css'>");
}


//******************************************************************************
//
// Show link description in the window status bar
//
//******************************************************************************
function showStatus(text) {
	window.status = text;
}

//******************************************************************************
//
// For pop up windows. Specifies html file, height and width within the string
//
//******************************************************************************
function openNewWindow(fileName,windowName,theWidth,theHeight) {
	window.open(fileName,windowName,"toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,top=20,left=20,width="+theWidth+",height="+theHeight)
}

//-->




var WindowDialog = new Object();
WindowDialog.Show = function(pageUrl, dialogWidth, dialogHeight, parentWindow, resizable)
{
	var browser = navigator.appName;
	var oReturn = null;
	
	if (browser == "Microsoft Internet Explorer") { // Checa o Browser
		if ( !parentWindow ) {
	    	parentWindow = window;
	    }	        
	    oReturn = parentWindow.showModalDialog(pageUrl, parentWindow, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:yes;status:no" + ";resizable:"+(resizable?"yes":"no"));
	    
	} else {
		
		var iTop  = (screen.height - dialogHeight)/2;
	    var iLeft = (screen.width  - dialogWidth)/2;
	
		var sOption  = "location=no,menubar=no,toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes" +
	            ",resizable="  + ( resizable ? 'yes' : 'no' ) +
	            ",width="  + dialogWidth +
	            ",height=" + dialogHeight +
	            ",top="  + iTop +
	            ",left=" + iLeft;
	        
	    if ( !parentWindow )
	    	parentWindow = window;
	        
	    var oWindow = parentWindow.open('',"Caixa de Diálogo", sOption, true);
	            
	    oWindow.moveTo(iLeft, iTop); // Para navegadores que não aceitem os índices top e left;
	    oWindow.resizeTo(dialogWidth, dialogHeight);
	    oWindow.focus();// Mantém o foco na janela aberta
	    oWindow.location.href = pageUrl;
	}
	
	return oReturn;
}
