

function init(){

	MM_preloadImages('img/menu_r1_c2_f2.jpg','img/menu_r1_c3_f2.jpg','img/menu_r1_c4_f2.jpg','img/menu_r1_c5_f2.jpg');	

	}

function cambiames(nmes,qflash){
	//alert("nmes: "+nmes+ " -- qflash: "+qflash);

	document.formRecarga.queFlash.value=qflash;
	document.formRecarga.mes.value=nmes;
	
	if(nmes=="" && qflash=="messig"){		
		nmes = mesActual - 6;
		if(nmes<=0) nmes+=12;
		document.formRecarga.mes.value=nmes;		
		
	}else if (nmes=="" && qflash=="mesant"){	
		nmes = mesActual - 5;
		if(nmes<=0) nmes+=12;
		document.formRecarga.mes.value=nmes;		
	}
	
	if(nmes>mesActual)
		document.formRecarga.anio.value = anioActual - 1;
	else
		document.formRecarga.anio.value = anioActual;
			
	document.formRecarga.submit();
	
}
// menu general

// Pinta el menu general

function menugeneral(){



menu_gen = '<table border="0" cellpadding="0" cellspacing="0" width="795">\n';

menu_gen += '  <tr>\n';

menu_gen += '   <td><img src="img/spacer.gif" width="172" height="1" border="0" alt=""></td>\n';

menu_gen += '   <td><img src="img/spacer.gif" width="131" height="1" border="0" alt=""></td>\n';

menu_gen += '   <td><img src="img/spacer.gif" width="143" height="1" border="0" alt=""></td>\n';

menu_gen += '   <td><img src="img/spacer.gif" width="133" height="1" border="0" alt=""></td>\n';

menu_gen += '   <td><img src="img/spacer.gif" width="216" height="1" border="0" alt=""></td>\n';

menu_gen += '   <td><img src="img/spacer.gif" width="1" height="1" border="0" alt=""></td>\n';

menu_gen += '  </tr>\n';

menu_gen += '  <tr>\n';

menu_gen += '   <td><a href="index.html"><img name="menu_r1_c1" src="img/menu_r1_c1.jpg" width="172" height="41" border="0" alt=""></a></td>\n';



if(queseccion == 0){

menu_gen += '   <td><img name="menu_r1_c2" src="img/menu_r1_c2_f2.jpg" width="131" height="41" border="0" alt=""></td>\n';

}

else{

menu_gen += '   <td><a href="embarazada.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'menu_r1_c2\',\'\',\'img/menu_r1_c2_f2.jpg\',1);"><img name="menu_r1_c2" src="img/menu_r1_c2.jpg" width="131" height="41" border="0" alt=""></a></td>\n';	

}





if(queseccion == 1){

menu_gen += '   <td><img name="menu_r1_c3" src="img/menu_r1_c3_f2.jpg" width="143" height="41" border="0" alt=""></td>\n';

}

else{

menu_gen += '   <td><a href="ytu.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'menu_r1_c3\',\'\',\'img/menu_r1_c3_f2.jpg\',1);"><img name="menu_r1_c3" src="img/menu_r1_c3.jpg" width="143" height="41" border="0" alt=""></a></td>\n';	

}





if(queseccion == 2){

menu_gen += '   <td><img name="menu_r1_c4" src="img/menu_r1_c4_f2.jpg" width="133" height="41" border="0" alt=""></td>\n';

}

else{

menu_gen += '   <td><a href="guia.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'menu_r1_c4\',\'\',\'img/menu_r1_c4_f2.jpg\',1);"><img name="menu_r1_c4" src="img/menu_r1_c4.jpg" width="133" height="41" border="0" alt=""></a></td>\n';	

}





if(queseccion == 3){

menu_gen += '   <td><img name="menu_r1_c5" src="img/menu_r1_c5_f2.jpg" width="216" height="41" border="0" alt=""></td>\n';

}

else{

menu_gen += '   <td><a href="nutricion.htm" onMouseOut="MM_swapImgRestore();" onMouseOver="MM_swapImage(\'menu_r1_c5\',\'\',\'img/menu_r1_c5_f2.jpg\',1);"><img name="menu_r1_c5" src="img/menu_r1_c5.jpg" width="216" height="41" border="0" alt=""></a></td>\n';	

}





menu_gen += '   <td><img src="img/spacer.gif" width="1" height="41" border="0" alt=""></td>\n';

menu_gen += '  </tr>\n';

menu_gen += '</table>\n';

	document.write(menu_gen);

}

//Función que abre el aviso legal en una nueva ventana

function avisolegal(){
	

  window.open('avisolegal.htm','','scrollbars=1,width=600,height=400');
	
	
	}
function contacto(){
	

  window.open('contactar.htm','','scrollbars=1,width=640,height=307');
	
	
	}

//Función que abre la ficha de tu bebé en la red
function ficha(id, color){
  window.open('ficha.php?id='+id+'&color='+color,'','scrollbars=0,width=623,height=400');	
	
}



// El pie de todas las paginas





pie = '<img src="img/pie.gif" width="789" height="18" border="0" usemap="#Map">\n';

pie += '<map name="Map">\n';

pie += '  <area shape="rect" coords="6,2,69,14" href="javascript:contacto();">\n';

pie += '  <area shape="rect" coords="73,2,124,14" href="javascript:mapaweb()">\n';

pie += '  <area shape="rect" coords="130,2,205,13" href="javascript:avisolegal()">\n';

pie += '  <area shape="rect" coords="739,5,781,16" href="CREDITOS">\n';

pie += '</map>\n';

function pies(){

	document.write(pie);

	}

	

// cabeceras secciones





var cabeceras = new Array();



cabeceras[0] = '<img src="img/cabe_heroemb.jpg" width="795" height="87" border="0">';

cabeceras[1] = '<img src="img/cabe_heroytu.jpg" width="795" height="87" border="0">';

cabeceras[2] = '<img src="img/cabe_mibebe.jpg" width="795" height="87" border="0">';

cabeceras[3] = '<img src="img/cabe_nutri.jpg" width="795" height="87" border="0">';







// FUNCIONES DE MACROMEDIA



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 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 registrate(){

document.location.href="pertenece.htm"

}

function introcurso(){

document.location.href="pediatras_cursos.htm"

}


function programacurso(){

document.location.href="pediatras_programa.htm"

}

function profesorescurso(){

document.location.href="pediatras_profesores.htm"

}

function contactocurso(){

document.location.href="pediatras_contacto.htm"

}



function registrate2(){



	ua = navigator.userAgent.toLowerCase(); 

	if (ua.indexOf('safari')!=-1) { 

		var windowW = 700;

		var windowH = 550;

	}

	else{

		var windowW = 635;

		var windowH = 530;

	}









	var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );

	var windowY = Math.ceil( (window.screen.height - windowH) / 2 );

	URL = 'pertenece/html/index.php';

	window.open(URL,"REGISTROONLINE","scrollbars=yes,width="+ windowW +",height="+ windowH +",top=" + windowY + ",left=" + windowX);	

}


function abrir(windowW,windowH,url)

{

	var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );

	var windowY = Math.ceil( (window.screen.height - windowH) / 2 );

	window.open(url,"REGISTROONLINE","scrollbars=no,width="+ windowW +",height="+ windowH +",top=" + windowY + ",left=" + windowX);

}





function parseAte(campo){ // © 2001  - DGB

 var texto = location.search.substring(1, location.search.length);

 var result ='-';

 if(texto.indexOf(campo)>=0){

  var txtRst = texto.substring(texto.indexOf(campo),texto.length);

  var txtCmp = txtRst.substring(0,txtRst.indexOf('&'));

  if (txtCmp=='') txtCmp = txtRst.substring(0,txtRst.length);

  result = txtCmp.substring((txtCmp.indexOf('=')+1),txtCmp.length);

 }

 return(result);

}



function mapaweb(){

	var windowW = 500;

	var windowH = 300;

	var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );

	var windowY = Math.ceil( (window.screen.height - windowH) / 2 );

	URL = 'mapa_web.htm';

	window.open(URL,"REGISTROONLINE","scrollbars=yes,width="+ windowW +",height="+ windowH +",top=" + windowY + ",left=" + windowX);	

	

	}



function popup(w,h,pagina)

{

	//Movemos al centro

	var windowW = 680;

	var windowH = 500;

	var windowX = Math.ceil( (window.screen.width  - windowW) / 2 );

	var windowY = Math.ceil( (window.screen.height - windowH) / 2 );

	//Abrimos ventana

	window.open(pagina,"Vademecum","scrollbars=no,width="+ windowW +",height="+ windowH +",top=" + windowY + ",left=" + windowX);

}

//FUNCIÓN QUE RESALTA EL CAMPO REQUERIDO
function fixElement(element, message) {
	alert(message);
	element.focus();	
}

//FUNCIÓN QUE VERIFICA EL FORMULARIO

function verifica(form, diaActual, mesActual, anyoActual) {
	var passed = false;

	if (formulario.nombre.value == "") {
		fixElement(formulario.nombre, "Por favor, introduzca su nombre.");
	}
	else if (formulario.dia.value == "") {
		fixElement(formulario.nombre, "Por favor, introduzca el día de su nacimiento.");
	}else if(formulario.dia.value>31){
		alert('Introduzca correctamente su día de nacimiento');	
		
	}else if (formulario.mes.value == "") {
		fixElement(formulario.nombre, "Por favor, introduzca el mes de su nacimiento.");
	}else if(formulario.mes.value>12){
		alert('Introduzca correctamente su mes de nacimiento.');	
	}
	else if(formulario.anio.value == ""){
		fixElement(formulario.anio, "Por favor, introduzca el año de nacimiento.");
	}else if (formulario.foto.value == "") {
		fixElement(formulario.foto, "Por favor, seleccione la imagen de su bebe pulsando el botón examinar.");
	}else  {

	
		//COMPRUEBA LA FECHA DE NACIMIENTO
		// 1.- Comprueba que el año de nacimiento no sea mayor que el actual	
		if(formulario.anio.value.length > 0 || 
			formulario.mes.value.length > 0 ||
			formulario.dia.value.length > 0){
			
		if(formulario.anio.value>anyoActual || formulario.anio.value<1920){
			fixElement(formulario.anio, "Por favor, introduzca correctamente la fecha");
			return false;
		}		
		//2.- Comprueba que el mes de nacimiento no sea mayor que el actual siempre y cuando el año sea el actual		
		if(formulario.anio.value == anyoActual && formulario.mes.value > mesActual){
			fixElement(formulario.mes, "El mes de nacimiento introducido no puede ser mayor al mes actual.");
			return false;
		}
		//3.- Comprueba que el día corresponde con el número de días del mes introducido
		var elMes = formulario.mes.value;
		var meses = new Array(31, 28,31,30, 31,30, 31, 31, 30, 31, 30, 31);		
		if (Number(formulario.dia.value) > Number(meses[Number(elMes) - 1])){
			fixElement(formulario.dia, "El día de nacimiento introducido no puede ser mayor de "+meses[Number(elMes) - 1]+".");
			return false;
		}
		
		}
		
		var anio_introducido_bebe = Number(formulario.anio.value);
		var anioActual2 = Number(anyoActual);
		if(anio_introducido_bebe>anioActual2){		
			fixElement(formulario.anio,"Por favor, introduzca correctamente la fecha");
			return false;
			
		}else if(anio_introducido_bebe<anioActual2 - 3){
			fixElement(formulario.anio,"El bebé no puede ser mayor de 3 años");
			return false;
		}
			

		if (formulario.mail.value != ""){
			emailCheck(formulario.mail.value);
		}else{
			passed = true;
			registrarCliente();
		}
		
	}
	return passed;
}

function calculaMesAnterior(mes){

	//mes = mes -1;
	if(mes <= 0){					
		if (mes==0) mes=12;
		else if (mes==-1)	mes=11;
		else if (mes==-2)	mes=10;		
		
	}

	mes=Number(mes);
	return mes;
}
//REGISTRO
function registrarCliente(idioma) {
		//alert('terminado de revisar, se procede a enviar');
	document.getElementById("botEnviarCliente").disabled = true;
	formulario.submit();
	
	return true;
}

//ESTA FUNCIÓN LIMITA EL EMAIL
function emailCheck (emailStr) {
	
/* The following pattern is used to check if the entered e-mail address
   fits the user@domain format.  It also is used to separate the username
   from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]    */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
   which case, there are no rules about which characters are allowed
   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
   is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
   e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
/* The following string represents an atom (basically a series of
   non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
   For example, in john.doe@somewhere.com, john and doe are words.
   Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
   domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


/* Finally, let's start trying to figure out if the supplied address is
   valid. */

/* Begin with the coarse pattern to simply break up user@domain into
   different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
  /* Too many/few @'s or something; basically, this address doesn't
     even fit the general mould of a valid e-mail address. */
	alert("La entrada de e-mail parece ser incorrecta")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    alert("El nombre de usuario parece no ser correcto.")
    return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Direccion IP no valida")
		return false
	    }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("El nombre de dominio parace no ser correcto.")
    return false
}

/* domain name seems valid, but now make sure that it ends in a
   three-letter word (like com, edu, gov) or a two-letter word,
   representing country (uk, nl), and that there's a hostname preceding 
   the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   alert("La direccion de correo debe acabar en 3 letras de dominio o 2 de un pais.")
   return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   var errStr="Esta direccion es desconocida como IP"
   alert(errStr)
   return false
}

// If we've gotten this far, everything's valid!
passed = true;
registrarCliente();
}

function registrar(){
	alert('Formulario enviado a dirección de correo');

}

function consulta(){

if (formulario.mail.value != ""){
			//alert('Se ha introducido un mail');
			emailCheck(formulario.mail.value);
		}else{
			passed = true;
			registrarCliente();
		}
}

//////////////////Funciones de Película mi bebé/////////////


//Carga de archivos en Iframe
function loadIframe(theURL){
    top.document.getElementById("testiframe").src = theURL;
} 
 


//Ajuste de tamaño de Iframe
function adjustIFrameSize(iframeWindow){

var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;
 
 var oBody= testiframe.document.body;
 
 if (ie4)
 {
     oFrame= document.all("testiframe").style;
	 oFrame.height='1px';
	 oFrame.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
	if (oBody.scrollHeight < 455)
	{
		oFrame.height = 370;
		
	}
 }
 else
 {
     oFrame= document.getElementById("testiframe").style;
     oFrame.height='1px';
	 oFrame.height = oBody.offsetHeight;
	if (oBody.scrollHeight < 420)
	{
		oFrame.height = 420;
	}
 }
 parent.scrollTo(1,1);

}

//FUNCIÓN QUE NOS COMPRUEBA EL CAMPO DE E-MAIL Y CÓDIGO REGALO. SI SE ENCUENTRA VACÍO NO PROSIGUE AL CARGA
function fixElement_pmb(element, message) {
	alert(message);
	element.focus();
	
	
	
}

//FUNCIÓN QUE VERIFICA EL FORMULARIO

function pmb_login(form) {

	var passed = false;
	var passed2 = false;
	var passed3 = false;
	if (formulario.email.value != ""){
		passed2 = emailCheck_pmb(formulario.email.value);
		
	}else{
		fixElement(formulario.email, "Por favor, introduzca un e-mail");
	}
	if (formulario.codigo.value == "") {		
		fixElement_pmb(formulario.codigo, "Por favor, introduzca su código. En caso de que aún no se haya registrado, haga clic en el enlace inferior");	
		passed3 = false;
	}else{passed3 = true;}
	if((passed2==true)&&(passed3==true)){
		//alert(' E-mail y Código verdaderos');
		passed = true;
		validaCodigo();
		}else{
			//alert('passed2'+passed2+'passed3'+passed3);
			passed=false;}
	
	
	
	return passed;	
}


function emailCheck_pmb (emailStr) {

/* The following pattern is used to check if the entered e-mail address
   fits the user@domain format.  It also is used to separate the username
   from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]    */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
   which case, there are no rules about which characters are allowed
   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
   is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
   e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
/* The following string represents an atom (basically a series of
   non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
   For example, in john.doe@somewhere.com, john and doe are words.
   Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
   domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


/* Finally, let's start trying to figure out if the supplied address is
   valid. */

/* Begin with the coarse pattern to simply break up user@domain into
   different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
  /* Too many/few @'s or something; basically, this address doesn't
     even fit the general mould of a valid e-mail address. */
	alert("La entrada de e-mail parece ser incorrecta")
	return false;
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    alert("El nombre de usuario parece no ser correcto.")
    return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Dirección IP no válida")
		return false;
	    }
    }
    return true;
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("El nombre de dominio parace no ser correcto.")
    return false;
}

/* domain name seems valid, but now make sure that it ends in a
   three-letter word (like com, edu, gov) or a two-letter word,
   representing country (uk, nl), and that there's a hostname preceding 
   the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   alert("La direccion de correo debe acabar en 3 letras de dominio o 2 de un pais.")
   return false;
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   var errStr="Esta direccion es desconocida como IP"
   alert(errStr)
   return false;
}

// If we've gotten this far, everything's valid!
passed2 = true;
return passed2;
}


//Comprobado el código y aceptado

function validaCodigo(){
	
	//alert('Su contraseña está en proceso de validación. Espere por favor');	
	//loadIframe("pmb_fotografias.htm");
	document.formCrearPelicula.submit();
}

///A partir de aquí están las restricciones de las fotografías. Comprobamos que estén al menos 5 de ellas y que todas las que se incluyan tengan comentario
function fixElement_fotos(element, message) {
	alert(message);
	element.focus();
		
}
function compruebaFotos(form){
	
	var passed = false;
	
	if(formFotografias.nombre.value==""){
		fixElement(formFotografias.nombre, "Por favor, introduzca el nombre del bebé");
	}
	else if(formFotografias.dia.value==""){
		fixElement(formFotografias.dia, "Por favor, introduzca una fecha válida");
	}
	else if(formFotografias.mes.value==""){
		fixElement(formFotografias.mes, "Por favor, introduzca una fecha válida");
	}
	else if(formFotografias.anyo.value==""){
		fixElement(formFotografias.anyo, "Por favor, introduzca una fecha válida");
	}
	else if(formFotografias.foto1.value==""){
			
		fixElement(formulario.foto1, "Debe introducir al menos 5 fotografías para componer la película");	
	}
	else if(formFotografias.foto2.value==""){
			
		fixElement(formulario.foto2, "Debe introducir al menos 5 fotografías para componer la película");	
	}
	else if(formFotografias.foto3.value==""){
			
		fixElement(formFotografias.foto3, "Debe introducir al menos 5 fotografías para componer la película");	
	}
	else if(formFotografias.foto4.value==""){
			
		fixElement(formFotografias.foto4, "Debe introducir al menos 5 fotografías para componer la película");	
	}
	else if(formFotografias.foto5.value==""){
			
		fixElement(formFotografias.foto5, "Debe introducir al menos 5 fotografías para componer la película");	
	}else{
		
	//passed = true;
	//alert('esta todo correcto '+passed);

	// 040906 Hacemos visible la capa que indique que deben aguardar
	document.getElementById('contenido').style.visibility = 'visible';





	document.formFotografias.submit();
	//return passed;
		}
	
	
}

//Si se han introducido 5 fotos, el nombre del bebé y una fecha correcta



function descargar(){
	alert(identificador_pelicula);
}
function enviaCorreo(){
	alert(identificador_pelicula);
}

function ayb_blister(urlo){
	
	  window.open(urlo,'','scrollbars=0,width=509,height=746');
	
	}
function cambiaimg(imagen,imgcambio,imgorigen,hover){
	if(hover==1){
	
		for(i=0;i<document.images.length;i++){
			
			if(document.images[i].name===imagen){
				
				
				document.images[i].src=imgcambio
			}
		}
	}else{
		for(i=0;i<document.images.length;i++){
			
			if(document.images[i].name===imagen){
				
				
				document.images[i].src=imgorigen
			}
		}
	}
}


//Creamos dinámicamente la cabecera haciendo distinción del navegador, permitiéndonos el reescalado en cualquier sistema

function create()
{
	
		
	
	
	
	if ((window.ActiveXObject) && 
		  (navigator.userAgent.indexOf("MSIE")!= -1) && (navigator.userAgent.indexOf("Windows") != -1))
		{
			
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write(' width="555" height="200" id="flashMov1" align="top">');
		document.write(' <param name="movie" value="assets/claqueta.swf">');
		document.write(' <param name=quality value=high>');
		document.write(' <param name=menu value=false>');
		document.write(' <param name="scale" value="noscale">');
		document.write(' <param name="swliveconnect" value="true">');
		document.write(' <param name="bgcolor" value="#ffffff" >');
		document.write(' <param name="salign" value="lt">');
		document.write('<' + '/object>');
		}
	else
		{
		var version_check = getFlashPluginVersion();
		if (version_check.scriptable)
			{

			
			document.write('<object id="flashMov1" data="assets/claqueta.swf" type="application/x-shockwave-flash"');
			document.write(' width="555" height="200" align="top">');
			document.write('<param name="movie" value="assets/claqueta.swf" type="application/x-shockwave-flash">');
			document.write('<param name="quality" value="high">');
			document.write(' <param name="scale" value="noscale">');
			document.write(' <param name="salign" value="lt">');
			document.write(' <param name="bgcolor" value="#ffffff" >');
			document.write('<param name="swliveconnect" value="true">');    	
			document.write('<embed src="assets/claqueta.swf" quality="high" scale="noscale" salign="lt" bgcolor="#ffffff" width="555" height="200" name="cabecera" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'); 
			document.write('<\/object>'); 
			}
	else
		identifyFlash()
		}
	
		//document.getElementById('flashid').style.visibility = 'visible';	
		
		// hacemos visible la capa una vez cargado el flash
		
		
		
}


//Detección de plugin
function getFlashPluginVersion() 
{ 
  var version = { 
        major: -1, 
        minor: -1, 
        installed: false,
        scriptable: false,
        machoArchitectureProblem: false
      };
var osxFlashVersion = 12;

  var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin; 
  if (!plugin) 
  {
    return version;
  }

  version.installed = true;

  var description = plugin.description; 
  
  // use RegExp to obtain the relevant version strings 
  // obtain an array of size 2 with version information
  
  var versionArray = description.match(/[\d.]+/g); 
  
  if (!versionArray)
  {
    return version;
  }

  if (versionArray.length >= 1 && !isNaN(versionArray[0]))
  {
    version.major = parseFloat(versionArray[0]);
  }

  if (versionArray.length >= 2 && !isNaN(versionArray[1]))
  {
    version.minor = parseFloat(versionArray[1]);
  }
    
  if (version.major < 6 || navigator.product != 'Gecko')
  {
    return version;
  }

  if (version.major > 6 || version.minor >= 47)
  {
    version.scriptable = true;
  }
  
  if((version.major < osxFlashVersion) && (navigator.userAgent.indexOf("Mach-O") != -1))
  {
  	version.scriptable = false;
  	version.machoArchitectureProblem = true;
  
  }

  return version;
}

function identifyFlash() 
{ 
  if ((window.ActiveXObject) && 
      (navigator.userAgent.indexOf("MSIE")!= -1) && (navigator.userAgent.indexOf("Windows") != -1))
  {
    document.write("<p>This browser is an <b>IE browser<\/b> which" +
        " supports ActiveX -- this article is about scripting the plugin in Netscape Gecko browsers.<\/p>");
    return;
  }
  var flashversion = getFlashPluginVersion();

  if (!flashversion.installed)
  {
    document.write("<p>Flash is not installed as a plugin. " +
                   "You need to install the latest version available from " +"<\/p>");
     return;
	 
  }

  if (flashversion.major == -1 || flashversion.minor == -1)
  {
    document.write("<p>Flash is installed as a plugin but the version could not be determined.<\/p>");
    return;
  }

  if (flashversion.scriptable)
  {
    document.write("<p>Flash is installed as a plugin and is scriptable in Gecko. " +
				   "The version of Flash installed is " + flashversion.major + "r" + flashversion.minor + "<\/p>");
    return;
  }
  if ((!flashversion.scriptable) && (!flashversion.machoArchitectureProblem))
  {
	document.write("<p>Flash is not scriptable and so the examples in this article will not work ." +
                   "You need to install the latest scriptable version available from macromedia.com" + "<\/p>");
                 
    return;
  }
if(flashversion.machoArchitectureProblem)
{
	document.write("<p>Flash is not yet scriptable for your OS X browser.  Check back soon for updates -- currently, the examples in this article will not work.  " +
					"The version of Flash installed is " + flashversion.major + "r" + flashversion.minor + "<\/p>");
	return;
	document.getElementById('menu_wcag').style.visibility = 'visible';			 
}
  document.write("<p>Flash is installed as a plugin and " +
                 "is version " + flashversion.major + "r" +
                 flashversion.minor + "<\/p>");
  document.getElementById('menu_wcag').style.visibility = 'visible';			
} 
