
	/*
		
		Global JS
		
	*/


	/*
		Custom functions.
	*/
	if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	window.attachEvent("onload", startList);
	}
	function startList() {
		if (document.all && document.getElementById) {
			navRoot = document.getElementById("nav");
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace
						(" over", "");
					}
				}
			}
		}
	}
	
	// funcion para quitar el punteado de los enlaces cuando el foco está sobre ellos
	function noFocus() {
		anclas=document.getElementsByTagName("a").length;
		for (i=0;i<anclas;i++)
			document.getElementsByTagName("a").item(i).onfocus=new Function("if(this.blur)this.blur()");
    }
	
	/*
		--------------------------------------------------------------------
	*/
	
	/*
		Global functions. Please do NOT edit.
	*/


	/*
		Cookie Recipes
	*/

	function saveCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}else expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i<ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}

	function deleteCookie(name) {
		saveCookie(name,"",-1);
	}


	/*
		Event Listener Interface
	*/

	function addEvent(obj, evType, fn){
		if (obj.addEventListener){
			obj.addEventListener(evType, fn, true);
			return true;
		}else if (obj.attachEvent){
			var r = obj.attachEvent("on"+evType, fn);
			return r;
		}else{
			//alert("Handler could not be attached");
			return false;
		}
	}

	function removeEvent(obj, evType, fn){
		if (obj.removeEventListener){
			obj.removeEventListener(evType, fn, true);
			return true;
		}else if (obj.detachEvent){
			var r = obj.detachEvent("on"+evType, fn);
			return r;
		}else{
			//alert("Handler could not be removed");
			return false;
		}
	}


	/*
		Language Check, Cookie Save & Redirect
	*/
	
	function checkLang() {
		if(readCookie('httpLang')) {
				var theLang=readCookie('httpLang');
		}else{
			if(document.all) {
				theLang=navigator.browserLanguage.substring(0,2).toLowerCase();
			}else{
				theLang=navigator.language.substring(0,2).toLowerCase();
			}
		}
		setLang(theLang);
	}
	
	function setLang(l) {
		saveCookie('httpLang',l,666);
		location=l+'/';
	}


	/*
		Language URL Switch & Resist! Now with RegExp!
	*/
	
	function switchLang(l) {
		saveCookie('httpLang',l,666);
		var x='/'+l+'/';
		location=location.href.replace(/\/\w\w\//, x);
	}


	/*
		Switch Div
	*/

	function switchDiv(divNum){
		var x=document.getElementById("s" + divNum);
		var y=document.getElementById("i" + divNum);
		if(x.style.display != "block"){
			x.style.display="block";
			y.src="img/menuOpen.png";
		}else{
			x.style.display="none";
			y.src="img/menuClosed.png";
		}
	}


	/*
		Switch List
	*/
	
	function switchList(x){
		if(x.parentNode.getElementsByTagName('ul')[0].style.display == "block") {
			resetList(x);
		}else{
			resetList(x);
			x.parentNode.getElementsByTagName('ul')[0].style.display="block";
		}
	}
	
	function resetList(x){
		var theUL=x.parentNode.parentNode.getElementsByTagName('ul');
		for(var n=0; n<theUL.length; n++) {
			theUL[n].style.display="none";
		}	
	}


	/*
		The xRollovers
	*/

	function xOn(theId) {
		var xfile=document.getElementById(theId);
		var xname=xfile.getAttribute('src');
		var x=xname.length;
		var xext=xname.substring(x-4,xname.length);
		xname=xname.substring(0,x-4);
		xfile.src=xname+".on"+xext;
	}

	function xOff(theId) {
		var xfile=document.getElementById(theId);
		var xname=xfile.getAttribute('src');
		var x=xname.length;
		var xext=xname.substring(x-4,xname.length);
		xname=xname.substring(0,x-7);
		xfile.src=xname+xext;
	}


	/*
		Window Popper
	*/

	function pop(url, name, width, height, centered, features) {
		if(window.screen)if(centered)if(centered=="1"){
			var l = (screen.width-width)/2;
			var t = (screen.height-height)/2;
			features+=(features!='')?',':'';
			features+='left='+l+',top='+t;
		}
		var flop=window.open(url, name, features+((features!='')?',':'')+'width='+width+',height='+height);
		flop.focus();
	}
	

