//======================================================================
// FUNÇÃO: POPUP CENTRALIZADO 
//======================================================================
var win = null;
function windowCenter(mypage,myname,w,h,scroll,rr,ss,mm){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+rr+',status='+ss+',menubar='+mm+','
	win = window.open(mypage,myname,settings)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//======================================================================


function click() 
	{
	if (event.button==2||event.button==3) 
	{
	oncontextmenu='return false';
	}
	}
	document.onmousedown=click
	document.oncontextmenu = new Function("return false")
	

function disableselect(e)
	{
	return false
	} 
  
  
function reEnable()
	{
	return true
	} 
  
 //if IE4+
	document.onselectstart=new Function ("return false") 
	document.oncopy=new Function ("return false")
 
 //if NS6
 	if (window.sidebar)
	{
//	document.onmousedown=disableselect
	document.onclick=reEnable
	}


function CreateBookmarkLink() {
title = document.title;
url = location.href;
if (window.sidebar) {
// Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"");
} else if( window.external ) {
// IE Favorite
window.external.AddFavorite( url, title);
}
else if(window.opera && window.print) {
// Opera Hotlist
return true; }
}


function closeWindow()
	{
    window.close();
    return true;
	}


var U = "http://www.navigari.com.br/page/popup.html";
var X = 290; 
var Y = 200; 
var W = 300; 
var H = 250; 
var s="toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,left="+X+",top="+Y+",screenX="+X+",screenY="+Y+",width="+W+",height="+H;
function popMe()
	{
	var SGW = window.open(U,'TheWindow',s)
	} 
	
	
function centerpopup(url,nome,altura,largura)
	{
	/*    Função que abre uma janela tipo popup no centro absoluto da janela.
	A função recebe a url, o nome, a altura e a largura.
	Para facilitar ainda mais, pode-se definir um tamanho fixo como
	mínimo baseado na resolução do monitor de quem está acessando     */
	var minimo = screen.width/4; // esta será a largura e a altura mínima    evitando uma 
	// janela muito pequena
	var maximo = screen.height - 100; // esta será a largura e a altura máxima
	// evitando uma janela muito grande
	var w = ( ( ( (largura>minimo)? largura:minimo )<maximo )?largura:maximo);
	var h = ( ( ( ( altura>minimo )? altura:minimo )<maximo )?altura:maximo);
	var l = (screen.width/2) - w/2;    // valor para a posição na horizontal
	var t = (screen.height/2) - h/2;    // valor para a posição na vertical
	var argumentos = 'copyhistory=yes,width='+w+',height='+h+',left='+l+',top='+t+',screenX='+l+',screenY='+t;
	var novajan = window.open(url,nome, argumentos);
	}


function exit() //desativada pq é inconviente
	{
//	window.open("http://www.charges.com.br/");window.focus() // 
	}
//	window.onunload=exit;