window.onload=function(){
if(!NiftyCheck())
    return;
Rounded("div#box","all","#fff","#cbe7ff","border #ccd2d2");
Rounded("div#box1","tr bl","#fff","#fff","border #ccd2d2");
Rounded("div#box2","tr bl","#fff","#fff","border #ccd2d2");
Rounded("div#box3","tr bl","#fff","#fff","border #ccd2d2");
Rounded("div#boxpas","tr bl","#fff","#fff","border #ccd2d2");
Rounded("div#boxtar","tr bl","#fff","#fff","border #ccd2d2");
Rounded("div#calendario","tr bl","#fff","#fff","border #ccd2d2");
Rounded("div#sub2","all","#fff","#94bdde","border #ccd2d2");
Rounded("div#ppal1 div","all","transparent","#fff","border #ccd2d2");
Rounded("div#sub1 td","all","transparent","#fff","border #ccd2d2");
Rounded("div#sub2 div","all","transparent","#fff","border #94bdde");
}


/* Rounded("div#box2","tr bl","#fff","#044a91","smooth"); */


function valida(form){
    error = "";
    var nombre = form.ka_nombre.value;
    var apellido = form.ka_apellido.value;
    var ci = form.ka_rif_ci.value;
    var telp = form.ka_telf_ppal.value;
    var telm = form.ka_telf_movil.value;
    var usuario = form.ka_usuario.value;
    var correo = form.ka_mail.value;
    var pat = /^[\w\_\.ηρ]{2,255}@[\w]{2,255}\.[a-z]{1,3}\.?[a-z]{0,3}$/;
    
    if( nombre == ""){error+="Debes especificar el Nombre o Razon Social del Usuario\n"}
    if( apellido == ""){error+="Debes especificar el Apellido o Denominacion Comercial del Usuario\n"}
    if( ci == ""){error+="Debes especificar el Rif/CI/Nro.Pasaporte del Usuario\n"}
    if( telp == "" && telm == ""){error+="Debes especificar el Telefono Principal o Movil del Usuario\n"}
    if( correo != "" ) {
        if(!pat.test(correo)) {error+="Debes especificar un Correo Electronico Valido\n"}
    }
    
    if( error != "")
     {
        alert(error)
	return false;
     }
    else
     {
        return true;
     }
}

function validausu(form){
var nombre = form.ka_usuario.value;
href = "validausu.php?ka_usuario="+nombre;
mainWin=window.open(href,"ventana","toolbar=no;menubar=no,directories=no,status=no,scrollbars=no,resizable=no,width=300,height=180,top=10,left=510");
}

function validafor(form){
error = "";
var nombre = form.ka_nombre.value;
var apellido = form.ka_apellido.value;
var ci = form.ka_rif_ci.value;
var telp = form.ka_telf_ppal.value;
var telm = form.ka_telf_movil.value;
var usuario = form.ka_usuario.value;
var correo = form.ka_mail.value;
var pat = /^[\w\_\.ηρ]{2,255}@[\w]{2,255}\.[a-z]{1,3}\.?[a-z]{0,3}$/;

if( nombre == ""){error+="1"}
if( apellido == ""){error+="2"}
if( ci == ""){error+="3"}
if( telp == "" && telm == ""){error+="4"}
if( correo != "" ) {
    if(!pat.test(correo)) {error+="5"}
}
if(error != "") { 
    href = "validafor.php?ka_usuario="+usuario+"&ka_mail="+correo+"&ka_nombre="+nombre+"&ka_apellido="+apellido+"&ka_rif="+ci+"&ka_telp="+telp+"&ka_telm="+telm;
    mainWin=window.open(href,"ventana","toolbar=no;menubar=no,directories=no,status=no,scrollbars=no,resizable=no,width=400,height=240,top=10,left=510");
    return false;
} else { 
    return true; 
}

}

function acceptNum(evt){    
  var nav4 = window.Event ? true : false;
  // NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57    
  var key = nav4 ? evt.which : evt.keyCode;
  return (key <= 13 || (key >= 48 && key <= 57));
} 

function change_height(){
   if(document.getElementById && !(document.all))
   {
      height = document.getElementById('myiframe').contentDocument.body.scrollHeight;
      document.getElementById('myiframe').style.height = height;
   }
   else if(document.all)
   {
      height = document.frames('myiframe').document.body.scrollHeight;
      document.all.myiframe.style.height = height;
   }
}

function mapa(){
 mainWin=window.open("ka_mapa.php","ventana","scrollbars=no,resizable=no,width=360,height=450,top=10,left=510");
}

function registro1(){
 mainWin=window.open("registro1.php","ventana","scrollbars=yes,resizable=no,width=480,height=650,top=10,left=510");
}

function registro2(){
 mainWin=window.open("registro2.php","ventana","scrollbars=no,resizable=no,width=480,height=650,top=10,left=510");
}

function repoper1(){
 mainWin=window.open("repoper1.php","ventana","scrollbars=no,resizable=no,width=480,height=450,top=10,left=510");
}

function repoper2(){
 mainWin=window.open("repoper2.php","ventana","scrollbars=no,resizable=no,width=480,height=450,top=10,left=510");
}

function repvtas1(){
 mainWin=window.open("repvtas1.php","ventana","scrollbars=no,resizable=no,width=480,height=450,top=10,left=510");
}

function repvtas2(){
 mainWin=window.open("repvtas2.php","ventana","scrollbars=no,resizable=no,width=480,height=450,top=10,left=510");
}

function comprobar(){
    var mal=false;
    numero=document.forms[0].elements.length;
    for(a=0;a<numero;a++){
    if (document.forms[0].elements[a].value==""){document.forms[0].elements[a].style.backgroundColor="#ffffcc";mal=true;}
    else{document.forms[0].elements[a].style.backgroundColor="white";}
    }
    if(mal){
       alert("Por favor, rellene los campos coloreados")
       return false;
    }
    else{
       document.forms[0].submit()
       return true;
    }
}

function verificarFormu(kavok) {
for(m=0;m<kavok.length;m++)
	{
	if(kavok.elements[m].name.charAt(kavok.elements[m].name.length-1) == "*")
	{
		if(kavok.elements[m].value=="")
			{
			alert("Debe poner un " + kavok.elements[m].name.substring(0,kavok.elements[m].name.length-1))
			kavok.elements[m].focus()
			return false
			break;
			}
		if(kavok.elements[m].name=="Email" || kavok.elements[m].name=="Email*")
			{
			pat=/^[\w\_\.ηρ]{2,255}@[\w]{2,255}\.[a-z]{1,3}\.?[a-z]{0,3}$/
			if(!pat.test(kavok.elements[m].value))
				{
				alert("Introduzca un E-mail valido")
				kavok.elements[m].focus()
				return false
				}
		
			}
		}
	else
	{
	continue;
	}
	}
}

var msg="Kavok Airlines,C.A. ....... su aerolinera de confianza"
var delay=80
var startPos=300
var timerID=null
var timerRunning=false
var pos=0
StartScrolling()
function StartScrolling(){
    StopTheClock()
    for (var i = 0; i < startPos; i++) 
    msg=" " + msg
    DoTheScroll()
}
function StopTheClock(){
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning=false
}
function DoTheScroll(){
    if (pos < msg.length)
        self.status= 
    msg.substring(pos, msg.length);
    else
        pos=-1;
    ++pos
    timerRunning=true
    timerID= 
   self.setTimeout("DoTheScroll()", delay)
}
