function MM_validateForm() { //v4.0
  if (document.getElementById){
    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=document.getElementById(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 contener una direción de e-mail.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' debe contener un número.\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+' debe contener un número entre '+min+' y '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es obligatorio.\n'; }
    } if (errors) alert('Han ocurrido los errores siguientes:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

function popupCentrado(theURL,winName,features,ancho,alto) { 
   var left = Math.floor( (screen.width-ancho) / 2);
   var top = Math.floor( (screen.height-alto) / 2);
   var parametros = features + ',top=' + top + ',left=' + left + ',width=' + ancho + ',height=' + alto;
   window.open(theURL,winName,parametros);
}

// Este script carga un object de Flash evitando la protección de Microsoft
function embedFlash(pelicula,ancho,alto) {
	bordancho=parseInt(ancho)+2;
	bordalto=parseInt(alto)+2;
	document.write('<div style="width:' + bordancho + '; height:' + bordalto + '; border:1px solid #000000;">');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ancho+'" height="'+alto+'">');
	document.write('  <param name="movie" value="'+pelicula+'" />');
	document.write('  <param name="quality" value="high" />');
	document.write('  <embed src="'+pelicula+'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'" ></embed>');
	document.write('</object></div>');
}
// Este script carga un object de Flash evitando la protección de Microsoft
function embedFlashT(pelicula,ancho,alto) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ancho+'" height="'+alto+'">');
	document.write('  <param name="movie" value="'+pelicula+'" />');
	document.write('  <param name="quality" value="high" />');
	document.write('  <param name="wmode" value="transparent" />');
	document.write('  <embed src="'+pelicula+'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"  wmode="transparent"></embed>');
	document.write('</object>');
}

// Este script carga un object de Flash evitando la protección de Microsoft
function embedFlash1(pelicula,ancho,alto) {
	bordancho=parseInt(ancho)+2;
	bordalto=parseInt(alto)+2;
	document.write('<div style="width:' + bordancho + '; height:' + bordalto + '; border:1px solid #000000;">');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+ancho+'" height="'+alto+'">');
	document.write('  <param name="movie" value="'+pelicula+'" />');
	document.write('  <param name="quality" value="high" />');
	document.write('  <embed src="'+pelicula+'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"></embed>');
	document.write('</object></div>');
}

//Script para galerias
function Fotos(foto, carpeta)
{
		document.getElementById("foto").src="fotos/"+carpeta+"/"+foto+".jpg";
}