//<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--
function openNewWindoww(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->

/* MOM DAD1 ? */ 
      function showhidemomdad(val)
      {
      	if(val == 'Y')
      	{
      		document.getElementById('addopt').style.display = '';
			document.getElementById('addoptt').style.display = '';
      	}
      	else 
      	{
      		document.getElementById('addopt').style.display = 'none';
			document.getElementById('addoptt').style.display = 'none';
      	}
      }
/* MOM DAD2 ? */ 
      function showhidemomdad2(val){
      		if(val == 'N'){
      			document.getElementById('muestra').style.display = 'none';
				//document.getElementById('nomuestra').style.display = '';
      		}else{
				var valido=0;
				for (i=0;i<document.fregalos.elements.length;i++){ 
		    	  if(document.fregalos.elements[i].type == "checkbox"){
        	 		if(document.fregalos.elements[i].checked==1){
						valido=1;
					} 
				  }
				}
				if (valido==1){
		      		document.getElementById('muestra').style.display = '';
					document.getElementById('muestra1').style.display = '';
					document.getElementById('muestra2').style.display = '';
					document.getElementById('muestra3').style.display = '';
					document.getElementById('muestra4').style.display = '';
					document.getElementById('muestra5').style.display = '';
					document.getElementById('muestra6').style.display = '';
					document.getElementById('muestra7').style.display = '';
					document.getElementById('nomuestra').style.display = 'none';
				}else{
					alert('Error: To reserve a gift, you must select at least one gift from the list!');
				}
	      	}
	   }
/* VALIDAR LISTA DE REGALOS */
    function validaregalo(){
		var valido=0;
		for (i=0;i<document.fregalos.elements.length;i++){ 
		  if(document.fregalos.elements[i].type == "checkbox"){
         		if(document.fregalos.elements[i].checked==1){
					//document.fregalos.elements[i].disabled=1;
					valido=1;
				} 
		  }
		}
		if (valido==0){
			alert('Error: To reserve a gift, you must select at least one gift from the list!');
			return 0;
		}
		if(document.fregalos.nombre.value.length==0){
			alert('Please complete the field: "Your Name"');
			document.fregalos.nombre.focus()
			return 0;
		}
		var str= document.fregalos.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert('"Email address" invalid, please review and try again')
		   document.fregalos.email.focus()
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert('"Email address" invalid, please review and try again')
		   document.fregalos.email.focus()
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert('"Email address" invalid, please review and try again')
		    document.fregalos.email.focus()
			return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.fregalos.email.focus()
			return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert('"Email address" invalid, please review and try again')
		    document.fregalos.email.focus()
			return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert('"Email address" invalid, please review and try again')
		    document.fregalos.email.focus()
			return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.fregalos.email.focus()
			return false
		 }	
  		document.fregalos.submit();  	
	}
/* VALIDAR GUESTBOOK */
function valida_librovisitas(){ 
		var str= document.librovisitas.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if(document.librovisitas.nombre.value.length==0){
			alert('Please complete the field: "Your Name"');
			document.librovisitas.nombre.focus()
			return 0;
		}
	    /*
		if(document.librovisitas.email.value.length==0){
			alert('"Email address" invalid, please review and try again');
			document.librovisitas.email.focus()
			return 0;
		}		
		if (str.indexOf(at)==-1){
		   alert('"Email address" invalid, please review and try again')
		   document.librovisitas.email.focus()
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert('"Email address" invalid, please review and try again')
		   document.librovisitas.email.focus()
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert('"Email address" invalid, please review and try again')
		    document.librovisitas.email.focus()
			return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.librovisitas.email.focus()
			return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert('"Email address" invalid, please review and try again')
		    document.librovisitas.email.focus()
			return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert('"Email address" invalid, please review and try again')
		    document.librovisitas.email.focus()
			return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.librovisitas.email.focus()
			return false
		 }	*/
	document.librovisitas.submit();
}
/* VALIDA CONTACTANOS */
function valida_contactanos(){ 
		var str= document.contactanos.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if(document.contactanos.nombre.value.length==0){
			alert('Please complete the field: "Your Name"');
			document.contactanos.nombre.focus()
			return 0;
		}
	    if(document.contactanos.email.value.length==0){
			alert('"Email address" invalid, please review and try again');
			document.contactanos.email.focus()
			return 0;
		}
		if (str.indexOf(at)==-1){
		   alert('"Email address" invalid, please review and try again')
		   document.contactanos.email.focus()
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert('"Email address" invalid, please review and try again')
		   document.contactanos.email.focus()
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert('"Email address" invalid, please review and try again')
		    document.contactanos.email.focus()
			return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.contactanos.email.focus()
			return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert('"Email address" invalid, please review and try again')
		    document.contactanos.email.focus()
			return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert('"Email address" invalid, please review and try again')
		    document.contactanos.email.focus()
			return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.contactanos.email.focus()
			return false
		 }			
	document.contactanos.submit();
}
/* VALIDA ENVIA */
function valida_envia(){ 
		var str= document.rsvp.email.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if(document.rsvp.nombre.value.length==0){
			alert('Please complete the field: "Your Name"');
			document.rsvp.nombre.focus()
			return 0;
		}
	    if(document.rsvp.email.value.length==0){
			alert('"Email address" invalid, please review and try again');
			document.rsvp.email.focus()
			return 0;
		}
		if (str.indexOf(at)==-1){
		   alert('"Email address" invalid, please review and try again')
		   document.rsvp.email.focus()
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert('"Email address" invalid, please review and try again')
		   document.rsvp.email.focus()
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert('"Email address" invalid, please review and try again')
		    document.rsvp.email.focus()
			return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.rsvp.email.focus()
			return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert('"Email address" invalid, please review and try again')
		    document.rsvp.email.focus()
			return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert('"Email address" invalid, please review and try again')
		    document.rsvp.email.focus()
			return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert('"Email address" invalid, please review and try again')
		    document.rsvp.email.focus()
			return false
		 }			
	document.rsvp.submit();
}
// Open Popups
function openwin(nombre,ancho,alto) {
props = 'width=' + ancho + ',height=' + alto +
',scrollbars=no,resizable=no';
window.open(nombre,'',props)
}
// Open Popups / YES
function openwin2(nombre,ancho,alto) {
props = 'width=' + ancho + ',height=' + alto +
',scrollbars=yes,resizable=no';
window.open(nombre,'',props)
}
// Open Popups DE SONIDO
function openwin3(nombre,ancho,alto) {
props = 'width=' + ancho + ',height=' + alto +
',scrollbars=no,resizable=yes,menubar=no,status=no,directories=no,location=no';
window.open(nombre,'sonido',props)
}
