var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

// Change the color of the object, and change the cursor into a Hand
function cambiaColor(obj, pcolor) {
	obj.style.backgroundColor = pcolor;
	obj.style.cursor = "pointer"; // Firefox and Netscape
	obj.style.cursor = "hand"; // Explorer
}

// Internal link
function salta(m0, m1, m2) {
	document.location.href="conten.php?m0="+m0+"&m1="+m1+"&m2="+m2;
}

// External link
function saltaFuera(url) {
	window.open(url);
}

// Internal link
function saltaDentro(name) {
	document.location.href="#"+name;
}

// Change the image on RollOver
function cambiaImg(img) {
	id_img = img.id;
	obj = document.getElementById(id_img);
	src = obj.src;
	src1 = src.substr(0, src.indexOf("."));
	src2 = src.substr(src.indexOf("."), src.length);
	if (src1.indexOf("_on") > 0) {
		src1 = src.substr(0, src.indexOf("_on"));
	} else {
		src1 += "_on";
	}
	obj.src = src1+src2;
}

// Send the contact form
function sendContactForm() {
}

// Opens a hidden div
var actual = 0;
var inc = 0;
var inc2 = 0;
var anterior = "";
var altoAnterior = 0;
function abre(etiqueta) {
	objeto = document.getElementById(etiqueta);
	objeto.style.display = "block";
	alto = objeto.offsetHeight;
	inc = 0;
	if (anterior != "") {
		objeto2 = document.getElementById(anterior);
		if (InternetExplorer) {
			altoAnterior = objeto2.offsetHeight;
			inc2 = 0;
			setTimeout("cierraAnim('"+anterior+"', "+altoAnterior+");",10);
		} else {
			objeto2.style.display = "none";
		}
	}
	if (anterior != etiqueta) {
		anterior = etiqueta;
		setTimeout("abreAnim('"+etiqueta+"', "+actual+", "+alto+");",10);
	} else {
		anterior = "";
	}
}

// Opens a hidden div: Animation
function abreAnim(etiqueta, act, alt) {
	objeto = document.getElementById(etiqueta);
	objeto.style.display = "block";
	act += 20+inc*4;
	inc++;
	if (act > alt) {
		objeto.style.height = alt+"px";
	} else {
		objeto.style.height = act+"px";
		setTimeout("abreAnim('"+etiqueta+"', "+act+", "+alt+");",10);
	}
}

// Closes a hidden div: Animation
function cierraAnim(etiqueta2, alt2) {
	objeto2 = document.getElementById(etiqueta2);
	alt2 -= 20+inc2*4;
	inc2++;
	if (alt2 <= 0) {
		objeto2.style.height = altoAnterior+" px";
		objeto2.style.display = "none";
	} else {
		objeto2.style.height = alt2+"px";
		setTimeout("cierraAnim('"+etiqueta2+"', "+alt2+");",10);
	}
}

// Opens a new window with the Alliance data
function abreAlianza(n) {
	v = open("alianza.php?n="+n);
	v.focus();
}