<script src="js\libs\jquery-ui-1.10.0.custom.js"></script>
<script src="js\plugins\flot\jquery.js"></script>
<script src="js\plugins\flot\jquery.flot.js"></script>
<script src="js\plugins\flot\jquery.flot.js"></script>
<script src="js\Application.js"></script>
<script src="js\plugins\msgGrowl\js\msgGrowl.js"></script>
<script src="js\plugins\lightbox\jquery.lightbox.js"></script>
<script src="js\demo\notifications.js"></script>
<script src="js/zelect.js"></script>
<script src="js/VentanaCentrada.js"></script>
<script src="js\plugins\validate\jquery.js"></script>
<script src="js\demo\validation.js"></script>

<script language="Javascript">
document.oncontextmenu = function(){return false}

enviando = false;
function checkSubmit() 
{
    if (!enviando) {
        enviando= true;
        return true;
    } else {
        alert("El formulario ya se esta enviando");
        return false;
    }
}

$(document).ready(documentoListo)
    function documentoListo() {
        $("body").on("click",".drop",function(e){
            if ($(this).is('[readonly]')) {
                           //e.preventDefault()
                $(this).blur()
            }
        })
      }
</script>

<?PHP
//contador de licencia
$fecha_hoy=date('Y-m-d');
$diasantes = strtotime($fecha_licencia."-8 days");
$diasantes= date("Y-m-d",$diasantes) . "\n";
if ($diasantes <= $fecha_hoy)
{
    $year = explode("-", $fecha_licencia); 
    $ye=$year[0]; 
    $mes = explode("-", $fecha_licencia); 
    $me=$mes[1]; 
    $dia = explode("-", $fecha_licencia); 
    $di=$dia[2]; 

    $hora = '00';
    $min = '00';
    $seg = '00';
?>

<script>
año="<?php echo $ye; ?>";
mes="<?php echo $me; ?>";
dia="<?php echo $di; ?>";
hora="<?php echo $hora; ?>";
minuto="<?php echo $min; ?>";
segundo="<?php echo $seg; ?>";
urlsitio ='include/cerrar_sesion_licencia.php'; //url del sitio web final     

dateFuture = new Date(año, mes-1 , dia, hora, minuto, segundo);   
window.onload=function(){GetCount();}

function GetCount(){
    dateNow = new Date();                                             
    amount = dateFuture.getTime() - dateNow.getTime();                
    delete dateNow;

    if(amount < 0){
    location.href=urlsitio;
    }
    else
    {
        days=0;hours=0;mins=0;secs=0;out="";
        amount = Math.floor(amount/1000);
        days=Math.floor(amount/86400);
        amount=amount%86400;
        hours=Math.floor(amount/3600);
        amount=amount%3600;
        mins=Math.floor(amount/60);
        amount=amount%60;
        secs=Math.floor(amount);
        if(days != 0){out += days +" DIA"+((days!=1)?"S":"")+", ";}
        if(days != 0 || hours != 0){out += hours +" HORA"+((hours!=1)?"S":"")+", ";}
        if(days != 0 || hours != 0 || mins != 0){out += mins +" MINUTO"+((mins!=1)?"S":"")+", ";}
        out += secs +" SEGUNDOS";
        document.getElementById('countbox').innerHTML=out;
        setTimeout("GetCount()", 1000);
    }
}
</script>
<?php } ?>