//Chrome Drop Down Menu- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: June 14th, 06'

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: true, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 1, //enable swipe effect? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

swipeeffect:function(){
if (this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdown.swipeeffect()", 10)
},

showhide:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffect()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
}
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'",this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchrome:function(){
for (var ids=0; ids<arguments.length; ids++){
var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
cssdropdown.dropit(this,event,this.getAttribute("rel"))
}
}
}
}
}

}

function val_contacto(contacto){
    if (contacto.nombre.value == ""){
      alert("Ingrese su Nombre"); contacto.nombre.focus(); return;}
              if (contacto.from.value == ""){
            alert("Ingrese su Correo"); contacto.from.focus(); return;}
        contacto.submit(); 
}


function PopIt(label, msg){  
        var s1 = "<TITLE>Bienvenidos a Novey.com.pa</TITLE>" +    
        		"<BODY onBlur='self.focus()' BGCOLOR='ffffff' TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>"+
				"<TABLE BORDER=0><TR>" +        
        		"<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+        
        		"<FONT SIZE=4>"    
        var s2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><P>"   
        var s3 = "</TD><TD WIDTH=10%></TD></TR><TR><TD></TD>"+    
        		 "<TD VALIGN=TOP ALIGN=RIGHT>"+    
        		 "<FORM><INPUT TYPE='BUTTON' VALUE='Cerrar'" +                   
        		 "onClick='self.close()'>"  +    
        		 "</FORM></TD></TR></TABLE></BODY>"   
        popup = window.open("","popDialog","left=0,top=0,height=180,width=300,scrollbars=no,resizable=0")  
        popup.document.write(s1+s2+msg+s3)  
        popup.document.close()
}

function PopCF(label, msg){  
        var s1 = "<TITLE>Bienvenidos a Novey.com.pa</TITLE>" +    
        		"<BODY onBlur='self.focus()' BGCOLOR='#FFFFFF' TOPMARGIN=0 LEFTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0>"+
				"<TABLE BORDER=0><TR>" +        
        		"<TD WIDTH=95% HEIGHT=90 VALIGN=TOP ALIGN=JUSTIFY>"+        
        		"<FONT SIZE=4>"    
        var s2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><P>"   
        var s3 = "</TD><TD WIDTH=5%></TD></TR><TR><TD></TD>"+    
        		 "<TD VALIGN=TOP ALIGN=RIGHT>"+    
        		 "<FORM><INPUT TYPE='BUTTON' VALUE='Cerrar'" +                   
        		 "onClick='self.close()'>"  +    
        		 "</FORM></TD></TR></TABLE></BODY>"   
        popup = window.open("","popDialog","left=0,top=0,height=250,width=350,scrollbars=no,resizable=0")  
        popup.document.write(s1+s2+msg+s3)  
        popup.document.close()
}


function popHelp(){  
        PopIt('Gracias por sus Comentarios', 'Su email fue enviado Correctamente...'  +  '.')
}


  function val_hv(hoja_vida){
    if (hoja_vida.nombre.value == ""){
      alert("Ingrese su Nombre"); hoja_vida.nombre.focus(); return;}
    if (hoja_vida.cedula.value == ""){
     alert("Ingrese su Cédula"); hoja_vida.cedula.focus(); return;}
   if (hoja_vida.fecha_nac.value == "" || hoja_vida.fecha_nac.value == "dd/mm/yyyy"){
     alert("Ingrese su Fecha de Nacimiento"); hoja_vida.fecha_nac.focus(); return;}
   if (hoja_vida.direccion.value == ""){
     alert("Ingrese su Dirección"); hoja_vida.direccion.focus(); return;}
   if (hoja_vida.estado_civil.value == ""){
     alert("Ingrese su Estado Civl"); hoja_vida.estado_civil.focus(); return;}
   if (hoja_vida.telefono1.value == ""){
      alert("Ingrese su No. de Teléfono"); hoja_vida.telefono1.focus(); return;}                                                                                                                 
   if (hoja_vida.nombre_inst.value == ""){
      alert("Ingrese el Nombre de la Institución"); hoja_vida.nombre_inst.focus(); return;}
   if (hoja_vida.titulo.value == ""){
      alert("Ingrese el Titulo Obtenido"); hoja_vida.titulo.focus(); return;}
   if (hoja_vida.ano_tit.value == ""){
      alert("Ingrese el Año en que obtuvo el Titulo"); hoja_vida.ano_tit.focus(); return;}
   if (hoja_vida.nombre_inst.value == ""){
      alert("Ingrese el Nombre de la Institución"); hoja_vida.nombre_inst.focus(); return;}
   if (hoja_vida.nom_ref1.value == ""){
      alert("Ingrese el Nombre de su Primer Referido"); hoja_vida.nom_ref1.focus(); return;}
   if (hoja_vida.emp_ref1.value == ""){
      alert("Ingrese la Empresa donde labora su Primer Referido"); hoja_vida.emp_ref1.focus(); return;}
   if (hoja_vida.cargo_ref1.value == ""){
      alert("Ingrese el Cargo de su Primer Referido"); hoja_vida.cargo_ref1.focus(); return;}
   if (hoja_vida.tel_ref1.value == ""){
      alert("Ingrese el Teléfono de su Primer Referido"); hoja_vida.tel_ref1.focus(); return;}
                                                                                                                   
   if (hoja_vida.nom_ref2.value == ""){
      alert("Ingrese el Nombre de su Segundo Referido"); hoja_vida.nom_ref2.focus(); return;}
  if (hoja_vida.emp_ref2.value == ""){
      alert("Ingrese la Empresa donde labora su Segundo Referido"); hoja_vida.emp_ref2.focus(); return;}
  if (hoja_vida.cargo_ref2.value == ""){
      alert("Ingrese el Cargo de su Segundo Referido"); hoja_vida.cargo_ref2.focus(); return;}
  if (hoja_vida.tel_ref2.value == ""){
      alert("Ingrese el Teléfono de su Segundo Referido"); hoja_vida.tel_ref2.focus(); return;}
                                                                                                                                                
  if (hoja_vida.nom_ref3.value == ""){
      alert("Ingrese el Nombre de su Tercer Referido"); hoja_vida.nom_ref3.focus(); return;}
  if (hoja_vida.emp_ref3.value == ""){
     alert("Ingrese la Empresa donde labora su Tercer Referido"); hoja_vida.emp_ref3.focus(); return;}
  if (hoja_vida.cargo_ref3.value == ""){
     alert("Ingrese el Cargo de su Tercer Referido"); hoja_vida.cargo_ref3.focus(); return;}
  if (hoja_vida.tel_ref3.value == ""){
     alert("Ingrese el Teléfono de su Tercer Referido"); hoja_vida.tel_ref3.focus(); return;}   
	document.getElementById('enviar').disabled = true;
        hoja_vida.submit(); //
        }
		
function revisa(nombre_form) {	
	if (nombre_form == "consulta") {
		if (consulta.consulta.value == ""){
		   alert("Ingrese el Código del Artículo");return false;		   
		}
		else
		 return true	
	}
	if (nombre_form == "consulta2") {
		if (consulta2.consulta.value == ""){
		   alert("Ingrese la Descripción del Artículo");return false;		   
		}
		else
		 return true		
	}
}

function inserto(str) {
  	searchWin = window.open(str,'inserto','scrollbars=no,resizable=yes,width=610,height=620,status=no,location=no,toolbar=no');
	//        searchWin.refer = self;
}
  
function val_ced(clte_frec){
    if (document.clte_frec.cedula.value == ""){
      alert("Ingrese su Cédula"); document.clte_frec.cedula.focus(); return false;
    }else{
         document.clte_frec.submit(); return true;      
    }
        
 }
 
   function val_visita(visitas){
    if (visitas.nombre.value == ""){
      alert("Ingrese su Nombre"); visitas.nombre.focus(); return;}
             if (visitas.direccion.value == ""){
                alert("Ingrese su Dirección"); visitas.direccion.focus(); return;}
                   if (visitas.telefono.value == "" && visitas.fax.value == "" && visitas.celular.value == ""){
                     alert("Ingrese su No. de Teléfono"); visitas.telefono.focus(); return;} 
                if (visitas.email.value == ""){
                        alert("Ingrese su Email"); visitas.email.focus(); return;}
                            if (visitas.descripcion.value == ""){
                           alert("Ingrese la Descripción de su Proyecto"); visitas.descripcion.focus(); return;}
                                   if (visitas.tiempo_disponible.value == "" || visitas.tiempo_disponible.value == "dd/mm/yyyy_hh:mm"){
                                 alert("Ingrese la Fecha y Hora para la Visita"); visitas.tiempo_disponible.focus(); return;}
        visitas.submit(); 
        }

 
 
//Carga los pop up del index 
function openmypage(){
		var kitescolar=dhtmlwindow.open("kit_escolar", "iframe", "kit_escolar.htm", "Kit Escolar", "width=575px,height=750px,resize=0,scrolling=0,top=10px,center=0")								
}

function openmypage2(){
		var lineablanca=dhtmlwindow.open("linea_blanca", "iframe", "linea_blanca.htm", "Linea Blanca", "width=575px,height=750px,resize=0,scrolling=0,top=10px,center=0")								
}
function openmypage3(vinc, serv){
		var CM=dhtmlwindow.open("CM", "iframe", vinc, serv, "width=315px,height=470px,resize=0,scrolling=0,top=10px,center=0")								
}

function openmypage4(vinc, serv, ancho, alto){
		var CM=dhtmlwindow.open("CM", "iframe", vinc, serv, "width="+ancho+"px,height="+alto+"px,resize=0,scrolling=0,top=10px,center=0")								
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
