﻿//// JScript File


////var _isset=0;

////function InterceptWindowClose() {   
////    
////    window.onbeforeunload = function () {      
////        if (_isset==0) {         
////            _isset=1; 
////            return "This is a demonstration, you won't leave the page whichever option you select.";      
////        }   
////    }  
//// 
////    _isset=0;   
////    window.location.reload();   
////    return false;
////    
////}

////function InterceptWindowClose(){
// //  alert("Teste");
////}

////window.onbeforeunload = bunload;

////function bunload(){
////    //statements to execute
////    return "custom message";
////}

////window.onbeforeunload= function (evt) {
////    if (quit()) {
////        //do your actions, even launch xmlhttprequest
////    }
////}

////function quit() {
////    if confirm("Quitter ?") {
////        return true;
////    }
////}else {
////    return false;
////}


////var needToConfirm = true;

////function setDirtyFlag()
////{
////needToConfirm = true; 
//////Call this function if some changes is made to the web page and requires an alert
////// Of-course you could call this is Keypress event of a text box or so...
////}

////function releaseDirtyFlag()
////{
////needToConfirm = false; //Call this function if dosent requires an alert.
//////this could be called when save button is clicked 
////}


////window.onbeforeunload = confirmExit;
////function confirmExit()
////{
////if (needToConfirm)
////return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
////}

////function checkClose()
////{
////    event.returnValue = "If you are currently in a lesson and you close this screen your data will not be captured and you will not receive credit.";
////}

////function onFeforeUnloadAction(){

////    var flag=window.confirm("You are closing the window. do you want to continue. Click 'Ok' to close or click 'Cancel' to stay back");

////    if(flag) { 
////        alert("bye");
////    } else { 
////        // Stop the closing browser 
////        //....
////    }

////}
////window.onbeforeunload = function(){
////    if((window.event.clientX<0) || (window.event.clientY<0)){ 
////    onBeforeUnloadAction();
////    }
////}

////function InterceptWindowClose(evt) {
////    
////      var message = 'Are you sure you want to leave?';
////      
////     if (typeof evt == 'undefined') {
////        evt = window.event;
////      }
////      if (evt) {
////        evt.returnValue = message;
////      }
////      return message;
////      
////}   

////window.onbeforeunload = function (evt) {
////  
////  var message = 'Are you sure you want to leave?';
////  
////  if (typeof evt == 'undefined') {
////    evt = window.event;
////  }
////  if (evt) {
////    evt.returnValue = message;
////  }
////  return message;
////  
////}


//window.onbeforeunload=FechaSessao;
//document.onkeydown=Verificar;
//var ifMySelClosed=false; //variavel que define se ele mesmo que esta sendo fechado

////é IE?
//var IE = document.all?true:false;
//if (!IE) document.captureEvents(Event.MOUSEMOVE)
//document.onmousemove = getMouseXY;
//var tempY = 0;

//function getMouseXY(e) {
//    if (IE) { // grab the x-y pos.s if browser is IE
//    tempY = event.clientY + document.body.scrollTop;
//}else { // grab the x-y pos.s if browser is NS
//    tempY = e.pageY;
//}

//if (tempY < 0){tempY = 0;}
//    //document.getElementById('MouseY').value=tempY;
//    return true;
//}

//function FechaSessao()
//{
//    var bool = false;
//    var top=self.screenTop;
//    //controle de fechar com o botao direito do mouse na barra de tarefas (quando está minimizado)

//    if ((top <= -30000) && (top >= -32000)){
//        bool=true;
//    }

//    //controle de fechar com o botao direito do mouse na barra de tarefas
//    if (((tempY <= 100) || ((tempY >=750) && (tempY <= 800)))){
//        bool=true;
//    }

//    if(bool==true){
//        //se não for ele que clicou no sair entao nao entra.
//        if(!ifMySelClosed){
//            //alert("FechaSessao");
//            //event.keyCode=0; 
//            //event.returnValue="Ei! Não vá embora ainda!\nQue tal gravar seu espaço agora? Assim, quando você\nvoltar ao site vi encontrar dicas exclusivas.";
//            var str="";
//            for(var x in event)
//            {
//                str+=x + " = " +event[x]+"\n";
//            }
//            window.alert(str);
//            event.cancelBubble = true;
//            //return false;
//        }

//    }
//}

//function fnConfirmFechar(){
//    if(confirm('fnConfirmFechar')){
//        ifMySelClosed=true;
//        alert("fnConfirmFechar");
//        //event.keyCode=0; 
//        event.returnValue=false;
//    }else{
//        return false;
//    }
//}

//function Verificar(){

//    var tecla=window.event.keyCode; //tecla normal
//    var alt=window.event.altKey; // Para Controle da Tecla ALT
//    var ctrl=window.event.ctrlKey; // Para Controle da Tecla CTRL

//    // Evita feclar via Teclado
//    if (alt && tecla==115) {

//        if(confirm('Verificar pergunta?')){
//            
//            //window.location.href="../logout.aspx";
//            alert("Verificar");
//            //window.close();
//            //event.keyCode=0; 
//            event.returnValue=false;
//            
//        }else{
//            alert("Verificar2");
//            event.keyCode=116;
//            event.returnValue=false;
//        }

//    }

//    // Evita Nova Hanela
//    if (ctrl && tecla==78) {
//        //alert("CTRL+N bloqueado");
//        //event.keyCode=0; 
//        event.returnValue=false;
//    } 
//}