function abrePopUp(x)
{
	javascript:window.open('popup/'+x.name+'.htm','win','dependent=yes,toolbar=no,location=no,Directory=no,Status=no,menubar=no,scrollbars=yes,resizable=no,width=700,height=600');
}

function abrePopUpMapas(x)
{
	javascript:window.open('popup/'+x.name+'.htm','win','dependent=yes,toolbar=no,location=no,Directory=no,Status=no,menubar=no,scrollbars=yes,resizable=no,width=750,height=600');
}

function cambiaImagen(x)
{	
	if (x==1)
	{
		document.getElementById("menusup").src="imagenes/" + menu_idioma + "/historiaover.gif";
	}
	if (x==2)
	{
		document.getElementById("menusup").src="imagenes/" + menu_idioma + "/talleresover.gif";
	}
	if (x==3)
	{
		document.getElementById("menusup").src="imagenes/" + menu_idioma + "/tiendasover.gif";
	}
	if (x==4)
	{
		document.getElementById("menusup").src="imagenes/" + menu_idioma + "/catalogover.gif";
	}
	if (x==5)
	{
		document.getElementById("menusup").src="imagenes/" + menu_idioma + "/joyasover.gif";
	}
	if (x==6)
	{
		document.getElementById("menuinf").src="imagenes/" + menu_idioma + "/consejosover.gif";
	}
	if (x==7)
	{
		document.getElementById("menuinf").src="imagenes/" + menu_idioma + "/materialesover.gif";
		//document.getElementById("menuinf").src="imagenes/" + menu_idioma + "/campanasover.gif";
	}
	if (x==8)
	{
		document.getElementById("menuinf").src="imagenes/" + menu_idioma + "/contactaover.gif";
	/*	document.getElementById("menuinf").src="imagenes/" + menu_idioma + "/eventosover.gif";
	}
	if (x==9)
	{
		document.getElementById("menuinf").src="imagenes/" + menu_idioma + "/contactaover.gif";*/
	}

}

function cambiaImagenOut()
{	
	document.getElementById("menusup").src="imagenes/" + menu_idioma + "/menusup.gif";
	document.getElementById("menuinf").src="imagenes/" + menu_idioma + "/menuinf.gif";

}


function trim(x)  { 
	y = new String(x) ;
	while (y.lastIndexOf(" ")!=-1)
		y = y.replace(" ","");
	return y;
}

function submitContacta()
{
	var msj = "No se puede enviar:\n";
	var error = 0;

	/*if (document.contacta.nombre.value == "")
	{
		msj += "El nombre no puede estar vacío.\n"
		error = 1;
	}
	valor = trim(document.contacta.telefono.value);
	if (valor.match(/\D/))
	{
		msj += "El teléfono deben ser sólo números.\n"; 
		error = 1;
	}
	else 
	{
		if ((document.contacta.telefono.value.length < 9) && (document.contacta.telefono.value != ""))
		{
			msj += "El teléfono debe tener al menos 9 dígitos.\n"; 
			error = 1;
		}
	}
*/
	if (document.contacta.correo.value == "")
	{
		msj += mail_no_vacio;
		error = 1;

	}
	else 
	{
		if ((!checkMail(document.contacta.correo.value))  && (document.contacta.correo.value!=""))
		{
			msj += mail_incorrecto; 
			error = 1;
		}

	}
/*
	if (document.contacta.comentario.value == "")
	{
		msj += "El comentario no puede estar vacío.\n"
		error = 1;
	}*/
	if (error)
	{
		alert(msj);
	}
	else 
	{	
		document.contacta.submit();
	}



}
function mOvr(src,clrOver) {
	if (!src.contains(event.fromElement)) {
		src.style.cursor = 'hand';
		src.bgColor = clrOver;
	}
}

function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
		src.style.cursor = 'default';
		src.bgColor = clrIn;
	}
}

function mClk(src,url) {
	if(event.srcElement.tagName=='TD'){
		src.children.tags('A')[0].click();
	}
	location.href = url;
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}


