//aqui declaro las imagenes
foto0 = new Image();
foto0.src = "objetos/titulo_0.jpg";
foto1 = new Image();
foto1.src = "objetos/titulo_1.jpg";
foto2 = new Image();
foto2.src = "objetos/titulo_2.jpg";
foto3 = new Image();
foto3.src = "objetos/titulo_3.jpg";
foto4 = new Image();
foto4.src = "objetos/titulo_4.jpg";
foto5 = new Image();
foto5.src = "objetos/titulo_5.jpg";
foto6 = new Image();
foto6.src = "objetos/titulo_6.jpg";
foto7 = new Image();
foto7.src = "objetos/titulo_7.jpg";
foto8 = new Image();
foto8.src = "objetos/titulo_8.jpg";
foto9 = new Image();
foto9.src = "objetos/titulo_9.jpg";
//funcion que cambia las imagenes
function imageChange(imageID,imageName) {
	document.images[imageID].src = eval(imageName + ".src");
}
function cargarSWF(direccion,ancho,alto){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ancho+'" height="'+alto+'">');
    document.write('<param name="movie" value="'+direccion+'" /><param name="quality" value="high"><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="'+direccion+'" quality="high" wmode=transparent pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"></embed><noembed> <div align="center">Su navegador no dipone de una versión apropiada de flash player. <br> Puede obtenerla gratuitamente <a href="http://www.adobe.com/es/products/flashplayer/">aqui </a> </div> </noembed></object>');
}
function NewWindow(mypage,myname,w,h,scroll){
	//return false;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
	if(win.window.focus){win.window.focus();}
}
function enviarAltaCandidato(){
	NOMBRE = document.formulario.NOMBRE.value;
	APELLIDOS = document.formulario.APELLIDOS.value;
	DIRECCION = document.formulario.DIRECCION.value;
	CP = document.formulario.CP.value;
	CIUDAD = document.formulario.CIUDAD.value;
	EMAIL = document.formulario.EMAIL.value;
	TELEFONO_1 = document.formulario.TELEFONO_1.value;
	if (NOMBRE == "" || APELLIDOS == "" || DIRECCION == "" || CP == "" || CIUDAD == "" || EMAIL == "" || TELEFONO_1 == "")
		alert("Por favor, rellene todos los campos y vuelva a enviar el formulario. Muchas gracias.");
	else if ( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(EMAIL)) )
			alert("Introduzca un email valido.");
	else if (isNaN(TELEFONO_1))
			alert("El telefono debe contener solo numeros.");
	else
		document.formulario.submit();
}
function enviarContacto(){
	EMPRESA = document.formulario.EMPRESA.value;
	PERSONA_CONTACTO = document.formulario.PERSONA_CONTACTO.value;
	TELEFONO = document.formulario.TELEFONO.value;
	EMAIL = document.formulario.EMAIL.value;
	CONSULTA = document.formulario.CONSULTA.value;
	if (EMPRESA == "" || PERSONA_CONTACTO == "" || TELEFONO == "" || EMAIL == "" || CONSULTA == "")
		alert("Por favor, rellene todos los campos y vuelva a enviar el formulario. Muchas gracias.");
	else if ( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(EMAIL)) )
			alert("Introduzca un email valido.");
	else if (isNaN(TELEFONO))
			alert("El telefono debe contener solo numeros.");
	else
		document.formulario.submit();
}
function enviarNewsletter(){
	EMPRESA = document.formulario.EMPRESA.value;
	PERSONA_CONTACTO = document.formulario.PERSONA_CONTACTO.value;
	TELEFONO = document.formulario.TELEFONO.value;
	EMAIL = document.formulario.EMAIL.value;
	CONFIRMACION = document.formulario.CONFIRMACION.checked;
	if (EMPRESA == "" || PERSONA_CONTACTO == "" || TELEFONO == "" || EMAIL == "")
		alert("Por favor, rellene todos los campos y vuelva a enviar el formulario. Muchas gracias.");
	else if (CONFIRMACION == false)
		alert("Debe señalar la opcion de recibir la newsletter. Muchas gracias.");
	else if ( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(EMAIL)) )
			alert("Introduzca un email valido.");
	else if (isNaN(TELEFONO))
			alert("El telefono debe contener solo numeros.");
	else
		document.formulario.submit();
}
function enviarForum(){
	EMPRESA = document.formulario.EMPRESA.value;
	PERSONA_CONTACTO = document.formulario.PERSONA_CONTACTO.value;
	TELEFONO = document.formulario.TELEFONO.value;
	EMAIL = document.formulario.EMAIL.value;
	CONFIRMACION = document.formulario.CONFIRMACION.checked;
	if (EMPRESA == "" || PERSONA_CONTACTO == "" || TELEFONO == "" || EMAIL == "")
		alert("Por favor, rellene todos los campos y vuelva a enviar el formulario. Muchas gracias.");
	else if (CONFIRMACION == false)
		alert("Debe señalar la opcion de aceptar el alta en el forum. Muchas gracias.");
	else if ( !(/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(EMAIL)) )
			alert("Introduzca un email valido.");
	else if (isNaN(TELEFONO))
			alert("El telefono debe contener solo numeros.");
	else
		document.formulario.submit();
}
function accesoClientes(){
	USUARIO = document.formulario.usuario.value;
	CONTRASENA = document.formulario.pass.value;
	if (USUARIO == "" || CONTRASENA == "")
		alert("Por favor, rellene todos los campos y vuelva a enviar el formulario. Muchas gracias.");
	else {
		document.formulario.submit();
		self.close();
	}
}
