function redirige()
{
	setTimeout("location.href='index.php'", 1000);
}

function validaAbstractDetail(form){
	if (form.Presentation.value=="4"){

		alert("Please enter the presentation type.");
		form.Presentation.focus();
		return false;
	}
	else if (form.PresentationDay.value=="4")
	{
		alert("Please enter the presentation day.");
		form.PresentationDay.focus();
		return false;
	}
	else if (form.Slot.value=="0")
	{
		alert("Please enter the slot of the presentation day.");
		form.Slot.focus();
		return false;
	}
	form.submit();
}


function validaAsistente(form){
	//alert("entro en funcion javascript")
	if (form.strTitle.selectedIndex==0){
		alert("Please enter your title.");
		form.strTitle.focus();
		return false;
	}
	else if (form.strFirstName.value=="")
	{
		alert("Please enter your firstname.");
		form.strFirstName.focus();
		return false;
	}
	else if (form.strFamilyName.value=="")
	{
		alert("Please enter your family name.");
		form.strFamilyName.focus();
		return false;
	}
	else if ((form.strWorkEmail.value==""))
	{
		alert("Please enter your work email.");
		form.strWorkEmail.focus();
		return false;
	}
	else if (!form.strWorkEmail.value.match("@"))
	{
		alert("Please enter a valid email address.");
		form.strWorkEmail.focus();
		return false;
	}
	else if ((form.strWorkEmailConfirm.value==""))
	{
		alert("Please confirm your work email.");
		form.strWorkEmail.focus();
		return false;
	}
	else if ((form.strWorkEmail.value!=form.strWorkEmailConfirm.value))
	{
		alert("Emails do not match.");
		form.strWorkEmail.focus();
		return false;
	}
	else if ((form.strPassword.value==""))
	{
		alert("Please enter the password.");
		form.strPassword.focus();
		return false;
	}
	else if ((form.strPasswordConfirm.value==""))
	{
		alert("Please confirm the password.");
		form.strPassword.focus();
		return false;
	}
	else if ((form.strPassword.value!= form.strPasswordConfirm.value))
	{
		alert("Passwords do not match.");
		form.strPassword.focus();
		return false;
	}
	else if (form.strWorkPhone.value=="")
	{
		alert("Please enter your work phone in case we need to contact you.");
		form.strWorkPhone.focus();
		return false;
	}
	else if ((form.strOrg.value==""))
	{
		alert("Please enter the name of your organization.");
		form.strOrg.focus();
		return false;
	}
	else if ((form.strBadget.value==""))
	{
		alert("Please enter the institution for the id tag.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.nameBadget.value==""))
	{
		alert("Please enter the name to appear in the id tag.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.strAddress1.value==""))
	{
		alert("Please enter your address.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.strCity.value==""))
	{
		alert("Please enter your city.");
		form.strCity.focus();
		return false;
	}
	else if ((form.strZip.value==""))
	{
		alert("Please enter your Zip value or Postal Code.");
		form.strZip.focus();
		return false;
	}
	else if ((form.strCountryCode.value==""))
	{
		alert("Please enter your country.");
		form.strCountryCode.focus();
		return false;
	}
	form.submit();
}

function validaDatos(form){
	if (form.intTypeID.value=="13"){
		alert("Please enter the registration type.");
		form.intTypeID.focus();
		return false;
	}
	else if (form.intArrivalMonth.value=="13")
	{
		alert("Please enter the arrival month.");
		form.intArrivalMonth.focus();
		return false;
	}
	else if (form.intArrivalDay.value=="32")
	{
		alert("Please enter the arrival day.");
		form.intArrivalDay.focus();
		return false;
	}
	form.submit();
}

function validaOpinion(form){
	if (form.name.value=="")
	{
		alert("Please enter your first name.");
		form.name.focus();
		return false;
	}
	else if (form.surname.value=="")
	{
		alert("Please enter your family name.");
		form.surname.focus();
		return false;
	}
	else if (form.institution.value=="")
	{
		alert("Please enter your institution.");
		form.institution.focus();
		return false;
	}
	else if (form.country.value=="")
	{
		alert("Please enter your country.");
		form.country.focus();
		return false;
	}
	else if (form.opinion.value=="")
	{
		alert("Please enter your opinion.");
		form.opinion.focus();
		return false;
	}
	form.submit();
}

function validaDatosFactura(form){
	if ((form.strOrg.value==""))
	{
		alert("Please enter the name of your organization.");
		form.strOrg.focus();
		return false;
	}
	else if ((form.strAddress.value==""))
	{
		alert("Please enter your address.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.strCity.value==""))
	{
		alert("Please enter your city.");
		form.strCity.focus();
		return false;
	}
	else if ((form.strZip.value==""))
	{
		alert("Please enter your Zip value or Postal Code.");
		form.strZip.focus();
		return false;
	}
	else if ((form.strCountryCode.value==""))
	{
		alert("Please enter your country.");
		form.strCountryCode.focus();
		return false;
	}
	else if ((form.vatInvoice.value==""))
	{
		alert("Please enter the VAT number.");
		form.vatInvoice.focus();
		return false;
	}
	form.submit();
}

function validaDatosFacturaAcom(form){
	if ((form.strOrg.value==""))
	{
		alert("Please enter the name of your organization.");
		form.strOrg.focus();
		return false;
	}
	else if ((form.strAddress.value==""))
	{
		alert("Please enter your address.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.strCity.value==""))
	{
		alert("Please enter your city.");
		form.strCity.focus();
		return false;
	}
	else if ((form.strZip.value==""))
	{
		alert("Please enter your Zip value or Postal Code.");
		form.strZip.focus();
		return false;
	}
	else if ((form.strCountryCode.value==""))
	{
		alert("Please enter your country.");
		form.strCountryCode.focus();
		return false;
	}
	else if ((form.vatInvoice.value==""))
	{
		alert("Please enter the VAT number.");
		form.vatInvoice.focus();
		return false;
	}
	else if ((form.strOrgAcom.value==""))
	{
		alert("Please enter the name of the organization in the Accompanying's Invoice form.");
		form.strOrgAcom.focus();
		return false;
	}
	else if ((form.strAddressAcom.value==""))
	{
		alert("Please enter the address in the Accompanying's Invoice form.");
		form.strAddressAcom.focus();
		return false;
	}
	else if ((form.strCityAcom.value==""))
	{
		alert("Please enter your city in the Accompanying's Invoice form.");
		form.strCityAcom.focus();
		return false;
	}
	else if ((form.strZipAcom.value==""))
	{
		alert("Please enter the Zip value or Postal Code in the Accompanying's Invoice form.");
		form.strZipAcom.focus();
		return false;
	}
	else if ((form.strCountryCodeAcom.value==""))
	{
		alert("Please enter the country in the Accompanying's Invoice form.");
		form.strCountryCodeAcom.focus();
		return false;
	}
	else if ((form.vatInvoiceAcom.value==""))
	{
		alert("Please enter the VAT number in the Accompanying's Invoice form.");
		form.vatInvoiceAcom.focus();
		return false;
	}
	form.submit();
}

function userPass(form){
	if (form.strUsuario.value=="")
	{
		alert("Please enter your email.");
		form.strUsuario.focus();
		return false;
	}
	else if (form.strContrasenya.value=="")
	{
		alert("Please enter your password.");
		form.strContrasenya.focus();
		return false;
	}
	form.submit();
}

function userPassAdministracion(form){
	if (form.strUsuario.value=="")
	{
		alert("Por favor introduzca su correo electrónico.");
		form.strUsuario.focus();
		return false;
	}
	else if (form.strContrasenya.value=="")
	{
		alert("Por favor introduzca su contraseña.");
		form.strContrasenya.focus();
		return false;
	}
	form.submit();
}

function redimPagina()
{
	var altura;
	altura = document.documentElement.scrollHeight 
	altura = altura - 320;
	altura = altura + 'px';

	//document.getElementById("celdaIzquierda").style.height = altura;
	//document.getElementById("celdaDerecha").style.height = altura;
}

function posicionaTexto()
{
	var ancho;
	var distancia;
	var distanciaAdmin;
	var distanciaTexto;
	var distanciaSup;
	ancho = document.documentElement.clientWidth;

	distancia = ((ancho - 867) / 2);
	if(distancia > 0)
	{
		distancia = distancia + 34;
		//distanciaTexto = distancia - 34 + 253;
		distanciaTexto = distancia - 65 + 253;
		distanciaAdmin = distancia - 40;
		distanciaSup = 250;
		distancia = distancia + 'px';
		distanciaTexto = distanciaTexto + 'px';
		distanciaAdmin = distanciaAdmin + 'px';
		distanciaSup =  distanciaSup + 'px';
		if(document.getElementById('divTexto'))
			document.getElementById('divTexto').style["left"] = distanciaTexto;
		if(document.getElementById('divMenu'))
			document.getElementById('divMenu').style["left"] = distancia;
		if(document.getElementById('divMenuAdmin')){
			document.getElementById('divMenuAdmin').style["left"] = distanciaAdmin;
			document.getElementById('divMenuAdmin').style["top"] = distanciaSup;
		}
	}else
	{
		document.getElementById('divTexto').style["left"] = '253px';
		document.getElementById('divMenu').style["left"] = '34px';
		document.getElementById('divMenuAdmin').style["left"] = '1px';
	}
}
function pieDePagina()
{
	if(navigator.appName=="Microsoft Internet Explorer"){
		document.getElementById('footer').style["position"] = 'absolute';
		document.getElementById('footer').style["left"] = '-576px';
		document.getElementById('footer').style["top"] = '585px';
	}
}


function validaUpdate(form){
	if (form.strTitle.selectedIndex==0){
		alert("Please enter your title.");
		form.strTitle.focus();
		return false;
	}
	else if (form.strFirstName.value=="")
	{
		alert("Please enter your firstname.");
		form.strFirstName.focus();
		return false;
	}
	else if (form.strFamilyName.value=="")
	{
		alert("Please enter your family name.");
		form.strFamilyName.focus();
		return false;
	}
	else if ((form.strWorkEmail.value==""))
	{
		alert("Please enter your work email.");
		form.strWorkEmail.focus();
		return false;
	}
	else if (!form.strWorkEmail.value.match("@"))
	{
		alert("Please enter a valid email address.");
		form.strWorkEmail.focus();
		return false;
	}
	else if ((form.strPassword.value==""))
	{
		alert("Please enter the password.");
		form.strPassword.focus();
		return false;
	}

	else if (form.strWorkPhone.value=="")
	{
		alert("Please enter your work phone in case we need to contact you.");
		form.strWorkPhone.focus();
		return false;
	}
	else if ((form.strOrg.value==""))
	{
		alert("Please enter the name of your organization.");
		form.strOrg.focus();
		return false;
	}
	else if ((form.strBadget.value==""))
	{
		alert("Please enter the institution for the badget.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.nameBadget.value==""))
	{
		alert("Please enter the name for the badget.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.strAddress1.value==""))
	{
		alert("Please enter your address.");
		form.strAddress1.focus();
		return false;
	}
	else if ((form.strCity.value==""))
	{
		alert("Please enter your city.");
		form.strCity.focus();
		return false;
	}
	else if ((form.strZip.value==""))
	{
		alert("Please enter your Zip value or Postal Code.");
		form.strZip.focus();
		return false;
	}
	else if ((form.strCountryCode.value==""))
	{
		alert("Please enter your country.");
		form.strCountryCode.focus();
		return false;
	}
	form.submit();
}

function toggleMe(a){

	var e=document.getElementById(a);
	if(!e)return true;
	if(e.style.display=="none"){
		e.style.display="block"
	} else {
		e.style.display="none"
	}
	return true;
}
function MM_preloadImages() {
	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];}
	} 
}
