/*
 * REQUIRED: functions.js
 */

function blockBrowser(){
    return true;
}

function redirectFlipSuite(){

    // Major version of Flash required
    try{var requiredMajorVersion = flashVersion;
    }catch(e){ var requiredMajorVersion = 8; }

    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Minor version of Flash required
    var requiredRevision     = 0;

    var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
    
    if(hasReqestedVersion){
        queryString = getQueryString();
        window.name = "flipSuite20";
    	document.location = "flip/";
        //openBook("flip/"+queryString, 870, 780, "flipSuite20");
    }else{
    	alert("É necessário o FlashPlayer 8 ou superior. ");
        redirecionar(absolutePath+'aviso/flashPlayer.php');
    }

}

messageClient = "Não é permitido copiar textos!\nEssa funcionalidade está desabilitada!";

function copyright (){
	alert(messageClient);
}

function disableInterfaceThings() {
    try{
        if(copy == 1){
            copy = true;
        }else{
            copy = false;
        }
    }catch(e){
        copy = 0;
    }

    if(copy == 0){	
	document.ondragstart      = new Function("return false;");
	document.oncontextmenu    = new Function("return false;");
	document.onselectstart    = new Function("return false;");
    }	

    if (window.sidebar){ // FOR F.F.
//        document.onmousedown  = new Function("return false;"); // ESSA LINHA GERA UM ERRO NA HORA DE FOCAR UM INPUT TEXT
        document.onclick      = new Function("return true;");
    }

}disableInterfaceThings();
/***/
document.onkeypress = function (evt) {
    var r = '';
    var ctrl = 0;

    if (document.getElementById && (!document.all)) {
        ctrl = evt.ctrlKey;
        r = String.fromCharCode(evt.which).toUpperCase();
    }else if (document.layers) {
        ctrl = Event.CONTROL_MASK;
        r = String.fromCharCode(evt.which).toUpperCase();
    }
  
    if (ctrl){
        
        if (r=='A'||r=='C'){
	     if(copy == 0){	
            	copyright();
            	return false;
	     }else{
		return true;	
	     }
        }
    }
}
