function toggleMenu(number) {
	var myDiv;
	var whichLayer = 'menubar';

  if(document.getElementById) // this is the way the standards work
    myDiv = document.getElementById(whichLayer);
  else if(document.all) // this is the way old msie versions work
    myDiv = document.all[whichLayer];
  else if(document.layers) // this is the way nn4 works
    myDiv = document.layers[whichLayer];
	//alert(whichLayer);
	if (number == 0) {
		myDiv.className = 'menubar';
	}
	if (number == 1) {
		myDiv.className = 'menubar1';
	}
	if (number == 2) {
		myDiv.className = 'menubar2';
	}
	if (number == 3) {
		myDiv.className = 'menubar3';
	}
	if (number == 4) {
		myDiv.className = 'menubar4';
	}
} 

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 validaFormSupport() {
  if (document.getElementById) {  // this is the way the standards work 
		var miForm = document.getElementById('formSupport');
  } 
  else if (document.all) { // this is the way old msie versions work 
		var miForm = document.all['formPerformer'];
  }
  //alert(miForm.id);
  var errores = "";
  if (miForm.nombre.value.length < 9)						errores = errores + "Debe escribir su nombre y apellidos\n";
  if (validateEmail(miForm.email.value) == false)	errores = errores + "E-mail incorrecto\n";
  if (errores != "") {
		alert("Por favor, corrija los siguientes errores:\n\n" + errores);
		return false;
  } else {
		miForm.enviar.disabled = true;
		miForm.enviar.value = 'Enviando formulario...';
		return true;
  }
}

function validaFormPerformer() {
  if (document.getElementById) {  // this is the way the standards work 
		var miForm = document.getElementById('formPerformer');
  } 
  else if (document.all) { // this is the way old msie versions work 
		var miForm = document.all['formPerformer'];
  }
  //alert(miForm.id);
  var errores = "";
  if (miForm.nombre.value == "")								errores = errores + "Debes escribir tu nombre\n";
  if (!miForm.apellidos.value)									errores = errores + "Debes escribir tus apellidos\n";
  if (miForm.ciudad.value == "")								errores = errores + "Debes especificar tu ciudad\n";
  if (!miForm.pais.value)												errores = errores + "Debes especificar tu pais\n";
  if (validateEmail(miForm.email.value) == false)	errores = errores + "E-mail incorrecto\n";
  if (miForm.telefono.value.length < 9)					errores = errores + "Telefono incorrecto\n";
  if (!miForm.horario.value)										errores = errores + "Indica tu horario de contacto\n";
  if (errores != "") {
		alert("Por favor, corrija los siguientes errores:\n\n" + errores);
		return false;
  } else {
		miForm.enviar.disabled = true;
		miForm.enviar.value = 'Enviando datos y fotos...';
		return true;
  }
}

function validateEmail(address) {
  var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  return reg.test(address);
}


