
	// *************************************

/*
	// SEGURIDAD
    // Indicamos en un array las páginas que son válidas como referer, es decir, 
    // si el usuario viene desde alguna de estas páginas entonces le dejamos 
    // ver lo que quiere ver 
    if(document.domain!="localhost")
    {
		var arrProcedenciaValida = new Array(
			"http://www.mercedes-benzseguros.es",
			"http://localhost"
			);

		// Dejamos que vengan desde nuestras páginas, si no, los redirigimos al índice de nuestra web, a continuación lo hacemos  
		var swProcedenciaValida = false; // Servirá para saber si se ha encontrado un referer bueno 
		for(i in arrProcedenciaValida) 
		{
			//alert("arrProcedenciaValida[i]::"+arrProcedenciaValida[i]);
			//alert("document.referrer.indexOf(arrProcedenciaValida[i])::"+document.referrer.indexOf(arrProcedenciaValida[i]));
			if( document.referrer.indexOf(arrProcedenciaValida[i]) == 0) 
			{
				swProcedenciaValida = true; // Hemos encontrado un refere bueno, ponemos ok a true 
			}
		}
		//if(!swProcedenciaValida) 
		//{
			//document.location.href="http://www.mercedes-benzseguros.es"; // Si no hemos encontrado un referer bueno redirigimos al index 
		//	document.location.href="http://www.mercedes-benzseguros.es"; 
		//}
	}
	// SEGURIDAD 
	// *************************************
    /* Anular F5 */
    document.onkeydown = function() 
    {
		if (window.event && window.event.keyCode==116) {
			window.event.keyCode=505;
		}
		if (window.event && window.event.keyCode==505) {
			return false;
		}
	} 

    /* ANULAR boton DERECHO DEL RATON */


//    document.oncontextmenu = function() {
//        if(document.domain!="localhost")
//            return false;
//        else
//            return true;
//    }
//    function right(e) {
        // var msg = "Prohibido usar Click Derecho !!! ";
        // alert(document.domain);
//        if(document.domain!="localhost"){
//            if (navigator.appName == 'Netscape' && e.which == 3) {
                //alert(msg); //- Si no quieres asustar a tu usuario entonces quita esta linea...
//                return false;
//            }   
//            else if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
                //alert(msg); 
//                return false;
//            }
//        }
//        return true;
//    }
//    document.onmousedown = right;
    /* FIN ANULAR boton DERECHO DEL RATON */



/*

	// *************************************
	// Control TimeOut 1ª parte
	// Establecido en 20 minutos.
	//
	document.onclick=IniciarTimeOut;
	document.onkeypress=IniciarTimeOut;
	document.onkeydown = IniciarTimeOutF5;
	function IniciarTimeOutF5() 
	{
		// F5  
		if (window.event && window.event.keyCode==116) {
			window.event.keyCode=505;
		}
		if (window.event && window.event.keyCode==505) {
			// IniciarTimeOut();
			// window.location="../home/Principal.asp";
			return false;
		}
		else 
			IniciarTimeOut();
	}
	function IniciarTimeOut() 
	{
		javascript:cTimeOut=0;
	}

	// *************************************
	// Control TimeOut 2ª parte
	//
	var idInterval,cTimeOut=0;
	// var tTimeOut=60*60;		// Tiempo para salir 60 minutos 
	// var tTimeOut=2000*60;	// Tiempo para salir 2000 minutos 
	// var tTimeOut=2*60;		// Tiempo para salir 2 minutos 
 	var tTimeOut=20*60;			// Tiempo para salir 20 minutos 
	AsignarIntervalo();
	function AsignarIntervalo()
	{
		// Activa intervalo en periodos de 1 segundo 
		idInterval=setInterval("ValidarIntervalo()",1000);
	}
	function ValidarIntervalo()
	{
		var totSec = tTimeOut;
		var actSec = cTimeOut;

		var statusMin = Math.floor(((totSec) - (actSec)) /60); 
		var statusSec = ((totSec) - (actSec) - (statusMin*60));
		cTimeOut++;
		// window.status="["+cTimeOut+" de "+tTimeOut+"] "+(tTimeOut-cTimeOut); 
		// window.status="["+statusMin+":"+statusSec+"]";
		if(cTimeOut >= tTimeOut)
		{
			clearInterval(idInterval);
			alert("Su sesión ha caducado por exceso de tiempo sin actividad");
			window.location="../home/Principal.asp";
		}
	}

	********************************************************* */

