function openBook(theURL, w, h, winID) { // url

 h = ( screen.height < h ) ? screen.height-40 : h;
 w = w + 10; 

 var is = new Is();
 if (is.win) {
 	 janela = window.open(theURL,winID,'status=no,width=10,height=10,scrollbars=yes,resizable=1');
		 checkPopupBlocker();
		 if (checkPopup(janela)) {
			 try {
			 janela.resizeTo(w,h);
				janela.moveTo((screen.width-w)/2, (screen.height -h)/2);
				janela.focus();
			 }catch(error){
			 	alert("Para acessar o conteúdo das edições é necessário DESATIVAR QUAISQUER MECANISMOS DE ANTI-POPUP");
			 }
		 } else {
		 	alert("Para acessar o conteúdo das edições é necessário DESATIVAR QUAISQUER MECANISMOS DE ANTI-POPUP");
		 }
 }else {
 		if (screen.width > 800){
 			janela = window.open(theURL,winID,'status=no,width=1024,height=768,scrollbars=yes,resizable=1');
 		} else {
 			janela = window.open(theURL,winID,'status=no,width=800,height=600,scrollbars=yes,resizable=1');
 		}
 }
}

function IsPopupBlocker() {
		var oWin = window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000");
		if (oWin==null || typeof(oWin)=="undefined") {
			return true;
		} else {
			oWin.close();
			return false;
		}
}

function checkPopup(pop){ return (pop==null || typeof(pop)=="undefined") ? false : true;}

function checkPopupBlocker(){
    if (IsPopupBlocker())
        alert("Você possui bloqueador de Popups. Para acessar o conteúdo das edições é necessário DESATIVAR QUAISQUER MECANISMOS DE ANTI-POPUP");
}

function disableInterfaceThings() {
	document.ondragstart = new Function("return false;");
	document.oncontextmenu = new Function("return false;");
	document.onselectstart = new Function("return false;");
}

function openTour(){
	janela = window.open('/tour/tour.swf','tour','width=700,height=582');
}

window.onfocus = new Function("disableInterfaceThings();");	