// JavaScript Document
<!--

//popup tips
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

///////



// fecha
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
/*document.write("<small><font color='ffffff' face='Arial'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></small>")*/

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

// Valicación de Formularios
<!--

function validacion(formulario) {

var er_nombre = /^([a-z]|[A-Z]|Ã¡|Ã©|Ã*|Ã³|Ãº|Ã±|Ã¼|\s|\.|-)+$/ //letras, '.' y '-' o vacio
var er_email = /^(.+\@.+\..+)$/
var er_telefono = /^([a-z]|[A-Z]|[0-9]|Ã¡|Ã©|Ã*|Ã³|Ãº|Ã±|Ã¼|\s|\.|-)+$/	//números y '-' o vacio
var er_asunto = /^([a-z]|[A-Z]|Ã¡|Ã©|Ã*|Ã³|Ãº|Ã±|Ã¼|\s|\.|-)+$/
var x


//comprueba campo de nombre
if(!er_nombre.test(formulario.nombre.value)) {
alert('Campo Nombre/Empresa Incorrecto - Ingrese solo letras')
return false
}

//comprueba campo de email
if(!er_email.test(formulario.email.value)) {
alert('Campo Email Incorrecto - Ingrese un email correcto')
return false
}

//comprueba campo telefono
if(!er_telefono.test(formulario.telefono.value)) {
alert('Campo Telefono Incorrecto - Ingrese solo numeros ')
return false
}

//comprueba si el campo sugerencia esta vacio
if (formulario.sugerencia.value.length < 1) {
alert("El campo Consulta/Comentario esta vacio - Escriba un Comentario");
formulario.sugerencia.focus();
return (false);
}

}
//-->



<!--

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function PopupLegales(img, ancho, alto){
  derecha=(screen.width-ancho)/2;
  arriba=(screen.height-alto)/2;
  string="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
  fin=window.open(img,"",string);
}
function CargarFoto(img, num, ancho, alto){
  derecha=(screen.width-ancho)/2;
  arriba=(screen.height-alto)/2;
  string="toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
  fin=window.open(img+"&num="+num,"",string);
}

function CargarVideo(img, ancho, alto){
  derecha=(screen.width-ancho)/2;
  arriba=(screen.height-alto)/2;
  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
  fin=window.open(img,"",string);
}
function CargarSwf(img, ancho, alto){
  derecha=(screen.width-ancho)/2;
  arriba=(screen.height-alto)/2;
  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
  fin=window.open(img,"",string);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->

//-->
function popUp(url)                                                     
{                                                                       
sealWin=window.open(url,"win",'toolbar=0,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');                   
self.name = "mainWin";                                                  
}        
//-->
function MM_showHideLayers2() { //v6.0

  var i,p,v,obj,args=MM_showHideLayers2.arguments;

  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }

    obj.display=v; }

}
//-->
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
function PopupPic(sPicURL) {
window.open( "popup.htm?"+sPicURL, "",  
"resizable=1,scrollbars=1,HEIGHT=400,WIDTH=400");
}
//-->
<!--
function MM_validateForm() { //v4.0 Español
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe ser un e-mail válido.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es obligatorio.\n'; }
  } if (errors) alert('Han ocurrido los siguientes errores:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->

//Dropdown selected

function checkDropdown(choice) {
var error = "";
    if (choice == 0) {
    error = "You didn't choose an option from the drop-down list.\n";
    }    
return error;
}
//-->

function valbutton(thisform) {
// place any other field validations that you require here
// validate myradiobuttons

myOption = -1;
for (i=thisform.pregunta_1.length-1; i > -1; i--) {
if (thisform.pregunta_1[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 1");
return false;
}

myOption = -1;
for (i=thisform.pregunta_2.length-1; i > -1; i--) {
if (thisform.pregunta_2[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 2");
return false;
}

myOption = -1;
for (i=thisform.pregunta_3.length-1; i > -1; i--) {
if (thisform.pregunta_3[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 3");
return false;
}

/*alert("You selected button number " + myOption
+ " which has a value of "
+ thisform.myradiobutton[myOption].value);
*/
// place any other field validations that you require here
thisform.submit(); // this line submits the form after validation
}

function valbutton6(thisform) {
// place any other field validations that you require here
// validate myradiobuttons

myOption = -1;
for (i=thisform.pregunta_1.length-1; i > -1; i--) {
if (thisform.pregunta_1[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 1");
return false;
}

myOption = -1;
for (i=thisform.pregunta_2.length-1; i > -1; i--) {
if (thisform.pregunta_2[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 2");
return false;
}

myOption = -1;
for (i=thisform.pregunta_3.length-1; i > -1; i--) {
if (thisform.pregunta_3[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 3");
return false;
}

myOption = -1;
for (i=thisform.pregunta_4.length-1; i > -1; i--) {
if (thisform.pregunta_4[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 4");
return false;
}

myOption = -1;
for (i=thisform.pregunta_5.length-1; i > -1; i--) {
if (thisform.pregunta_5[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 5");
return false;
}

myOption = -1;
for (i=thisform.pregunta_6.length-1; i > -1; i--) {
if (thisform.pregunta_6[i].checked) {
myOption = i; i = -1;
}
}
if (myOption == -1) {
alert("Debe seleccionar alguna opcion para la pregunta 6");
return false;
}

/*alert("You selected button number " + myOption
+ " which has a value of "
+ thisform.myradiobutton[myOption].value);
*/
// place any other field validations that you require here
thisform.submit(); // this line submits the form after validation


//abre popup
function abrir(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir){
     var opciones = "fullscreen=" + pantallacompleta +
                 ",toolbar=" + herramientas +
                 ",location=" + direcciones +
                 ",status=" + estado +
                 ",menubar=" + barramenu +
                 ",scrollbars=" + barrascroll +
                 ",resizable=" + cambiatamano +
                 ",width=" + ancho +
                 ",height=" + alto +
                 ",left=" + izquierda +
                 ",top=" + arriba;
     var ventana = window.open(direccion,"venta",opciones,sustituir);

}   
}
