// JavaScript Document

function encodeCorreo(user_name,correo_container,domain_name,css_classname) {
	var at_char = String.fromCharCode(64);
	document.getElementById(correo_container).innerHTML = '<a href="mailto:' + user_name + at_char + domain_name +
								'" class="' + css_classname + '">' + user_name + at_char + domain_name + '</a>';
}

function fadeIn(objID,alpha) {
	var myObj = document.getElementById(objID);
	alpha = Math.min(alpha,100);
	myObj.style.fontSize = Math.ceil(100 * Math.sin(Math.PI * alpha / 200)) + "%";
	if (myObj.filters) { // deal with IE7 shortcommings via scripting...
		if (alpha == 0) {
			// make all other divs have z-index 0
			var alldivs = document.getElementsByTagName("DIV");
			for (var i = 0; i < alldivs.length; i++) { 
				if (alldivs[i].getAttribute("className") == "fadeincontainer") { 
					if (alldivs[i] == myObj.parentNode) { 
						alldivs[i].style.zIndex = 100;
						// and fix rubbish IE bug that seems to reset right alignment...
						// NOTE that it looks for stylesheet with ID of "fadedeclarations"
						for (j=0; j<document.styleSheets.length; j++) {
							if (document.styleSheets[j].id == "fadedeclarations") {
								var mysheet = document.styleSheets[j];
								for (k=0; k < mysheet.rules.length; k++) {
									if (mysheet.rules[k].selectorText == ".fadeincontainer"){
										alldivs[i].style.right = '-' + mysheet.rules[k].style.marginLeft;
										break;
									}
								}
								break;
							}
						}

					} else {
						alldivs[i].style.zIndex = 0;
					}
				}
			}
		}
		myObj.filters.alpha.opacity = alpha;
	} else {
		myObj.style.opacity = alpha / 100;
		myObj.style.MozOpacity = alpha / 100;
	}
	alpha += 7;
	if (alpha <= 100) {
		window.setTimeout("fadeIn('" + objID + "'," + alpha + ");",30);
	}
}

