
function NewWindow(theURL, hauteur, largeur) 
{
var winl = (screen.width - largeur) / 2;
var wint = (screen.height - hauteur) / 2;
winprops = 'height='+hauteur+',width='+largeur+',top='+wint+',left='+winl+',scrollbars=0'
win = window.open(theURL, "", winprops)
}

function NewWindowScroll(theURL, hauteur, largeur) 
{
var winl = (screen.width - largeur) / 2;
var wint = (screen.height - hauteur) / 2;
if(theURL=="/nuevos_trabajos/default.html")
{
	winprops = 'height='+largeur+',width='+hauteur+',top='+wint+',left='+winl+',scrollbars=1'
}
else
{
	winprops = 'height='+hauteur+',width='+largeur+',top='+wint+',left='+winl+',scrollbars=1'	
}
win = window.open(theURL, "", winprops)
}


function NewWindowScrollResize(theURL, hauteur, largeur) 
{
var winl = (screen.width - largeur) / 2;
var wint = (screen.height - hauteur) / 2;
if(theURL=="/nuevos_trabajos/default.html")
{
	winprops = 'height='+largeur+',width='+hauteur+',top='+wint+',left='+winl+',scrollbars=1,resizable=1'
}
else
{
	winprops = 'height='+hauteur+',width='+largeur+',top='+wint+',left='+winl+',scrollbars=1,resizable=1'	
}
win = window.open(theURL, "", winprops)
}

var rr=parseInt(Math.random()*20000);

function getRandom()
{
	//alert(rr);
//	document.flash1.SetVariable("fl_random", rr);
//	document.flash2.SetVariable("fl_random", rr);
}

function cambiaColor(celda,color) {
	document.getElementById(celda).style.background=color;
}

function envia(texto1,texto2,motivo,idioma,html) {

	hoy = new Date();
	mes= hoy.getMonth() + 1;
	if (mes<10)	mes = "0"+mes;
	//fecha=hoy.getDate()+"/"+mes+"/"+hoy.getYear();
	fecha=hoy.getYear()+mes+hoy.getDate();
	aux=document.form.fechaini.value;
	fechainicial= new String(document.form.fechaini.value);
	fechainicial=fechainicial.substring(6,10)+fechainicial.substring(3,5)+fechainicial.substring(0,2);
	fecha=parseInt(fecha);
	fechainicial=parseInt(fechainicial);
	if (fechainicial < fecha) {
		alert("La fecha de entrada no puede ser anterior al día actual");
		document.form.fechaini.value=aux;
		document.form.fechafin.value="";
		
	}
	else {
	
		if (document.form.fechaini.value=="")	alert(texto1);
		else	{
			if (document.form.fechafin.value=="")	alert(texto2);
			else {
					if (html=="0")	NewWindowScroll("reservas.php?fechaini="+document.form.fechaini.value+"&fechafin="+document.form.fechafin.value+"&noches="+document.form.noches.value+"&NHab="+document.form.nhab.value+"&motivo="+motivo+"&idioma="+idioma,520,700);
					else	NewWindowScroll("../reservas.php?fechaini="+document.form.fechaini.value+"&fechafin="+document.form.fechafin.value+"&noches="+document.form.noches.value+"&NHab="+document.form.nhab.value+"&motivo="+motivo+"&idioma="+idioma,520,700);
			}
		}
	}
}


function guardaCookieIdioma(value)
{	
	var name="nidioma";
	var expires = new Date();
	expires.setTime(expires.getTime() - 3600);
	document.cookie = name + "=" + value + "; path=/" +   ((expires == null) ? "" : "; expires=" + expires.toGMTString());
	
}

function abreVideo()
{
	var fotogal=document.getElementById("frvideo");
	if (fotogal!=undefined)	Shadowbox.open(fotogal);
}