// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function imprimirPagina() {
	
  if (window.print)
    window.print(); 
}

function ventanaSecundaria (URL){ 
   window.open(URL,"Xirivell","width=550,height=550,scrollbars=NO,") 
} 


function resetform() {
document.forms[0].elements[1]=="";
}


var resultado
function checkemail(){
    var str=document.validacion.email.value
    var filtro=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filtro.test(str))
        resultado=true
    else{
        alert("Error: Incorrect E-mail")
        resultado=false
    }
    return (resultado)
}

function check(){
	//valido el nombre
    if (document.validacion.name.value.length == 0){
       alert("Error: Write the Name")
       //document.validacion.nombre.focus()
       return false;
    }
	
	 if (document.validacion.surname.value.length == 0){
       alert("Error: Write the Surname")
       //document.validacion.nombre.focus()
       return false;
    }
	
    if (document.layers||document.getElementById||document.all)
        return checkemail() 
    else
	   return true
}


function locateImage(name){
   var image=false;
   if(document.images){
      image=document.images[name];
   }
   if(image){
      return image;
   }
   return false;
}

function swap(id,newsrc){
   var image=locateImage(id);
   if(image){
      image.src=newsrc;
   }
}
  

