function menuOver(num) {
	document.getElementById("m"+num).style.backgroundColor='#D8F2FC';
	document.getElementById("m"+num).style.cursor='pointer';
}

function menuOut(num) {
	document.getElementById("m"+num).style.backgroundColor='#F5F5F5';
	document.getElementById("m"+num).style.cursor.value='auto';
}

function smenuOut(num) {
	document.getElementById("m"+num).style.backgroundColor='#FFFFFF';
	document.getElementById("m"+num).style.cursor.value='auto';
}

function menuOn() {
	if(document.getElementById("m4").style.display!='block') {
		document.getElementById("m4").style.display='block';
	} else {
		document.getElementById("m4").style.display='none';
	}
	if(document.getElementById("m5").style.display!='block') {
		document.getElementById("m5").style.display='block';
	} else {
		document.getElementById("m5").style.display='none';
	}
}

function CreateControlFlash(divid, objectid, width, height, url, mode) {
	var d = document.getElementById(divid);
	var strHTML = '<object id="' + objectid + '" type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '">';
	strHTML = strHTML + '<param name="movie" value="' + url + '" />';
	if(mode=='1') { strHTML = strHTML + '<param name="wmode" value="transparent" />'; }
	strHTML = strHTML + '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;Lang=Spanish&amp;P5_Language=Spanish"><img src="flash/noflash.gif" border="0" alt="no tiene flash" /></a>';
	strHTML = strHTML + '</object>';
	d.innerHTML = strHTML;
}

function CreateControlFlash1(divid, objectid, width, height, url, mode) {
	var d = document.getElementById(divid);
	var strHTML = '<object align="right" id="' + objectid + '" type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '">';
	strHTML = strHTML + '<param name="movie" value="' + url + '" />';
	if(mode=='1') { strHTML = strHTML + '<param name="wmode" value="transparent" />'; }
	strHTML = strHTML + '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;Lang=Spanish&amp;P5_Language=Spanish"><img src="flash/noflash.gif" border="0" alt="no tiene flash" /></a>';
	strHTML = strHTML + '</object>';
	d.innerHTML = strHTML;
}

function MailLink (usuario, dominio, tld) {
	 var arroba = '@';
	 var punto = '.'
	 var etiqueta = 'ma' + '' + 'il';
	 var dospuntos = 'to:';
	 var localizador = usuario;
	 localizador = localizador + arroba + dominio;
	 localizador = localizador + punto + tld;
	 //document.write('<a href="' + etiqueta + dospuntos + localizador + '" class="' + clase + '">' + localizador + '</a>');
	 document.write('<a href="' + etiqueta + dospuntos + localizador + '">' + localizador + '</a>');
}

function navigate(dato) {
	document.negocios.pag.value=dato;
	document.negocios.submit();
}

function wopen(page,id,wname,wancho,walto) {
	var ancho = wancho;
	var alto = walto;
	var derecha=(screen.width-ancho)/2;
	var parameters="toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top=60";
	var url = page+'?id='+id;
	newwindow = window.open(url,wname,parameters);
	newwindow.focus();
}

function imgopen(page,id,order,wname,wancho,walto) {
	var ancho = wancho;
	var alto = walto;
	var derecha=(screen.width-ancho)/2;
	var parameters="toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top=60";
	var url = page+'?id='+id+'&order='+order;
	newwindow = window.open(url,wname,parameters);
	newwindow.focus();
}

function checkforblanks() {
	for (var i = 0; i < arguments.length; i += 2) {
		if (!arguments[i]) {
			alert("El campo " + arguments[i+1] + " es obligatorio.");
			return false;
		}
	}
	return true;
}

function validate() {
	var isFull = checkforblanks(document.getElementById("nombre").value, "[Persona de contacto]",
		document.getElementById("email").value, "[Email]",
		document.getElementById("consulta").value, "[Consulta]");
	if (!isFull) {
		return false;
	}
	var dirmail = document.getElementById("email").value;
	var filter = /^.+@.+\..{2,3}$/;
	if (!filter.test(dirmail)) {
		alert("La dirección de correo electrónico no es correcta.");
		return false;
	}
	if ((document.getElementById("nombre").value!="" && document.getElementById("nombre").value=="") || document.getElementById("nombre").value=="nombre") {
		alert("Debe indicar una persona de contacto.");
		return false;
	}
	if ((document.getElementById("consulta").value!="" && document.getElementById("consulta").value=="") || document.getElementById("consulta").value=="consulta") {
		alert("Debe indicar una consulta.");
		return false;
	}
	if (document.getElementById("email").value!="" && document.getElementById("email").value=="") {
		alert("Debe indicar un correo electrónico de contacto.");
		return false;
	}
}

function validate2() {
	var isFull = checkforblanks(document.getElementById("contacto").value, "[Nombre]",
		document.getElementById("poblacion").value, "[Población]",
		document.getElementById("telefono").value, "[Teléfono]",
		document.getElementById("email").value, "[E-mail]",
		document.getElementById("comentarios").value, "[Comentarios]");
	if (!isFull) {
		return false;
	}
	var dirmail = document.getElementById("email").value;
	var filter = /^.+@.+\..{2,3}$/;
	if (!filter.test(dirmail)) {
		alert("La dirección de correo electrónico no es correcta.");
		return false;
	}
}

function godoc(doc) {
	document.location.href = doc;
}

function borra(dato) {
	if (document.getElementById(dato).value==dato) {
		document.getElementById(dato).value='';
	}
}


// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 50;
PositionY = 50;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
writeln('width=300-(document.body.clientWidth-document.images[0].width);');
writeln('height=300-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}
