// JavaScript Document

 function AgregarAFavoritos(url,titulo){ 

    if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) { 


       window.external.AddFavorite(url,titulo); 

    } 

    else { 

       if(navigator.appName == "Netscape") 

          alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 

    } 

 } 
 
 
 
 
 
  function MDM_openWindow(theURL,winName,features) 

 { 

           var _W=window.open(theURL,winName,features); 

           _W.focus(); 

       _W.moveTo(20,20); 

 }
 
 
 
function vergaleria(foto)
{
	
	
	           var _W=window.open('images/xga_'+foto+'.jpg','galeria','scrollbars=yes,width=480,height=380'); 

           _W.focus(); 

       _W.moveTo(20,20); 
	
	}
	
	
	
	
			function check()
			{

			
			if(document.form.Nombre.value==""){ alerta(); document.form.Nombre.focus(); }
			else if(document.form.Apellidos.value==""){ alerta(); document.form.Apellidos.focus(); }
			else if(document.form.Email.value==""){ alerta(); document.form.Email.focus(); }			
			else if(!check_email(document.form.Email.value)){ alert("Por favor, escriba un E-Mail Válido"); document.form.Email.focus();}
			else if(document.form.Telefono.value==""){ alerta(); document.form.Telefono.focus(); }			
			else if(document.form.Comentarios.value==""){ alerta(); document.form.Comentarios.focus(); }						
			else
			{
			document.form.submit();
			}
			
			}
			
			
			function alerta(){
			
			alert("\nPor favor:\nComplete los campos obligatorios\n");
			
			}
			
			function check_email(e) { 
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM"; 

for(i=0; i < e.length ;i++){ 
if(ok.indexOf(e.charAt(i))<0){ 
return (false); 
} 
} 

if (document.images) { 
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/; 
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 
if (!e.match(re) && e.match(re_two)) { 
return (-1); 
} 

} 

}










  
function FrontPage_Form1_Validator(theForm)

{
  if (theForm.Nombre.value == "")
  {
//    alert("Please enter a value for the \"Nombre\" field.");
alert("Por favor escriba su nombre.");
    theForm.Nombre.focus();
  }
else if (theForm.Nombre.value.length < 5)
  {
    alert("Por favor escriba almenos 5 caracteres en el campo Nombre.");
   theForm.Nombre.focus();
  }
  else if (theForm.Email.value == "")
  {
    alert("Por favor escriba su E-Mail.");
    theForm.Email.focus();
  }
  else if (theForm.Email.value.length < 5)
  {
    alert("Por favor escriba almenos 5 caracteres en el campo E-Mail");
    theForm.Email.focus();
  }
  else{
  document.form1.submit();
	  }
}

function FrontPage_Form1_Validator_Ing(theForm)

{
  if (theForm.Nombre.value == "")
  {
//    alert("Please enter a value for the \"Nombre\" field.");
alert("Please,  write your name.");
    theForm.Nombre.focus();
  }
else if (theForm.Nombre.value.length < 5)
  {
    alert("Please,  write at least 5 characters in the field Name.");
   theForm.Nombre.focus();
  }
  else if (theForm.Email.value == "")
  {
    alert("Please,  write your E-Mail.");
    theForm.Email.focus();
  }
  else if (theForm.Email.value.length < 5)
  {
    alert("Please,  write at least 5 characters in the field E-Mail");
    theForm.Email.focus();
  }
  else{
  document.form1.submit();
	  }
}

