<!--
function Imprimir($IDdiv,$titulo)
{

var bName = navigator.appName;
var bVer = parseFloat(navigator.appVersion);

var contenido = document.getElementById($IDdiv).innerHTML;
ventana=window.open("/print.php","ventana","width=560");
ventana.document.open();
ventana.document.write('<html><head><title>'+$titulo+'<\/title><link rel="stylesheet" type="text/css" href="print.css"><\/head><body style=\"background-color: #FFFFFF\">');

ventana.document.write(contenido);
ventana.document.close();
ventana.print();
ventana.focus();
}
//-->
<!--
function Contardias(contador){
 ventrada = document.getElementById(contador+"v-entrada").value;
 a = ventrada.split(',');
 aa = a[0];
 ba = a[1];
 ca = a[2];
 vsalida = document.getElementById(contador+"v-salida").value;
 b = vsalida.split(',');
 ab = b[0];
 bb = b[1];
 cb = b[2];

if(ventrada!=0&&vsalida!=0){
 entrada = new Date(aa,ba,ca);
 salida = new Date(ab,bb,cb);
 resta = salida.getTime() - entrada.getTime();
  resultado = Math.floor(resta/(1000*60*60*24));
	document.getElementById(contador+"contadordedias").innerHTML = "Nº de noches: "+resultado;
	document.getElementById(contador+"v-noches").value = resultado;

	  return (resultado > 0);
	}
	else {return false;}
	 true;
}
//-->
<!--

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;
}
//-->
<!--
var area=0;
var errors='';
var alpha=0;
var formulario;
function Defform(f) {
formulario=f;
}
function AreaActivadaM() {
area=1;
}
function AreaActivadaI() {
area=2;
}
function ValidarIncidencia(oEvento, oFormulario) {
errors='';
if (document.inci.tipodeaveria.value==0) {errors += '- Tipo de problema.\n'; };
if (errors) {alert('Debe rellenar los siguientes campos\n'+errors); 
alpha=1;}
errors='';

if (alpha == 0) {
oFormulario.submit();  
return true; 
};
alpha=0;
}

var rat = new Array();
rat[0]= 1;
function ValidarRatio(a)
{
rat[a]=1;
}

function Validar_Ratios(totalratios){
var err = '';

	for (i=1;i<=totalratios;i++){
		if (rat[i]!=1){
			err = '- Faltan campos por seleccionar.\n';
			
		}
	}
return (err);		
}
//-->
<!--
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
errors+=Validar_Ratios(3);
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(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 un correo electrónico válido.\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 una habitación válida.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es requerido.\n'; }
} if (errors) alert('Se han producido los siguientes errores:\n'+errors);
document.MM_returnValue = (errors == '' && Contardias('0'));
}
//-->
<!--
function ValidateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,args=ValidateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('uc3m.es');
        //if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe introducir un correo electrónico de la universidad (*@*.uc3m.es).\n';
      } 
 if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener una dirección válida.\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 una habitación válida.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+'.\n'; }
  } if (errors) alert('Debe rellenar los siguientes campos:\n'+errors)
   
   	if (!errors) {
   		//if (confirm('Antes de darse de alta confirme todos sus datos\n - Nombre: '+document.alta['nombre'].value+' '+document.alta['apellido1'].value+' '+document.alta['apellido2'].value+'\n - Habitación: '+document.alta['habitacion'].value+'\n - Email: '+document.alta['email'].value+'*\n*(recuerde que para los alumnos el formato del email es 100088888@alumnos.uc3m.es)'))
if (confirm('Antes de darse de alta confirme todos sus datos\n - Nombre: '+document.alta['nombre'].value+' '+document.alta['apellido1'].value+' '+document.alta['apellido2'].value+'\n - Habitación: '+document.alta['habitacion'].value+'\n - Email: '+document.alta['email'].value))
		{ 
		document.alta.submit();  
		return true; 
    	}
	};  
errors='';
}
//-->
<!--
var navegador = navigator.userAgent.toLowerCase();
var ie = /msie/

function Renovado() {
if (ie.test(navegador)) {
//IE 4+
document.getElementById("v1").style.display = "block";
document.getElementById("v2").style.display = "block";
document.getElementById("v3").style.display = "block";
document.getElementById("v4").style.display = "none";
document.getElementById("v5").style.display = "none";
} 
else {
//NS
document.getElementById("v1").style.display = "table-cell";
document.getElementById("v2").style.display = "table-cell";
document.getElementById("v3").style.display = "table-cell";
document.getElementById("v4").style.display = "none";
document.getElementById("v5").style.display = "none";
}}

function NoRenovado() {
if (ie.test(navegador)) {
document.getElementById("v1").style.display = "none";
document.getElementById("v2").style.display = "none";
document.getElementById("v3").style.display = "none";
document.getElementById("v4").style.display = "block";
document.getElementById("v5").style.display = "block";
} 
else {
//NS
document.getElementById("v1").style.display = "none";
document.getElementById("v2").style.display = "none";
document.getElementById("v3").style.display = "none";
document.getElementById("v4").style.display = "table-cell";
document.getElementById("v5").style.display = "table-cell";
}}
//-->
<!--
document.write('<style type="text/css">\n')
document.write('.oculto{display: none;}\n')
document.write('</style>\n')

//-->
