// JavaScript

	// - Método que abre um popup do tipo window.open,
	function NewWindow(mypage,myname,w,h,scroll,rez,maxi,menu,tool,loc){
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
		var settings  = (maxi) ? 'top=0,' : 'top='+wint+',';
			settings += (maxi) ? 'left=0,' : 'left='+winl+',';
			settings += (menu != null) ? "menubar="+menu+"," : "";
			settings += (tool != null) ? "toolbar="+tool+"," : "";
			settings += (loc != null) ? "location="+loc+"," : "";
			settings +='scrollbars='+scroll+',';
			settings +='resizable='+rez+',';			
			settings += (maxi) ? 'width='+getScreenWidth()+',' : 'width='+w+',';
			settings += (maxi) ? 'height='+getScreenHeight()+',' : 'height='+h+',';
			settings +='innerwidth='+w+',';
			settings +='innerheight='+h;

		if (parseInt(navigator.appVersion) > 3){
			win = window.open(mypage,myname,settings);
			//win.window.focus();
		} else
			alert("Seu navegador é muito antigo ou incompatível com esta função.");
	}

	// - Método que abre um popup do tipo window.showModalDialog
	//   tipos(nome do arquivo .jsp,nome da página, largura, altura, yes/no scroll, yes/no resize, yes/no ???)
	function NewWindowModal(mypage,myname,w,h,scroll,rez,par){
		var winl = (screen.width-w)/2;
	  	var wint = (screen.height-h)/2;
	  	var settings  ='dialogHeight:'+h+'px;';
		  	settings +='dialogWidth:'+w+'px;';
		  	settings +='dialogTop:'+wint+'px;';
		  	settings +='dialogLeft:'+winl+'px;';
		  	settings +='scroll:'+scroll+';';
		  	settings +='resizable:'+rez+';';
		  	settings +='status: No;';
		  	settings +='help: No;';
		  	settings +=par+';';
		  
		if (navigator.appName != "Netscape")
		  	window.showModalDialog(mypage,myname,settings);
		else {
			if (parseInt(navigator.appVersion) > 3){
				win = window.open(mypage,myname,settings);
				//win.window.focus();
			} else
				alert("Seu navegador é muito antigo ou incompatível com esta função.");
		}
	}

//*****************************************************************************************************************************//
	function getScreenWidth(){
		if (navigator.userAgent.indexOf("MSIE") > 0)		
			return screen.AvailWidth;
		else
			return screen.width;
	}

//*****************************************************************************************************************************//
	function getScreenHeight(){
		if (navigator.userAgent.indexOf("MSIE") > 0)		
			return screen.AvailHeight;
		else
			return screen.height;
	}
