	/*
		Global JS --> 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);
	}


	/*-------------------------------
        ::   control de EVENTOS   ::
        --------------------------------*/

    function addEvent( obj, type, fn ) {
    	if (obj.addEventListener) {
    		obj.addEventListener( type, fn, false );
    		EventCache.add(obj, type, fn);
    	}
    	else if (obj.attachEvent) {
    		obj["e"+type+fn] = fn;
    		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
    		obj.attachEvent( "on"+type, obj[type+fn] );
    		EventCache.add(obj, type, fn);
    	}
    	else {
    		obj["on"+type] = obj["e"+type+fn];
    	}
    }

    function removeEvent( obj, type, fn ) {
      if ( obj.detachEvent ) {
        obj.detachEvent( "on"+type, obj[type+fn] );
    		obj[type+fn] = null;
      } else
        obj.removeEventListener( type, fn, false );
    }

    var EventCache = function(){
    	var listEvents = [];
    	return {
    		listEvents : listEvents,
    		add : function(node, sEventName, fHandler){
    			listEvents.push(arguments);
    		},
    		flush : function(){
    			var i, item;
    			for(i = listEvents.length - 1; i >= 0; i = i - 1){
    				item = listEvents[i];
    				if(item[0].removeEventListener){
    					item[0].removeEventListener(item[1], item[2], item[3]);
    				};
    				if(item[1].substring(0, 2) != "on"){
    					item[1] = "on" + item[1];
    				};
    				if(item[0].detachEvent){
    					item[0].detachEvent(item[1], item[2]);
    				};
    				item[0][item[1]] = null;
    			};
    		}
    	};
    }();
    addEvent(window,'unload',EventCache.flush);


	/*
		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);
	}

	/*
		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();
	}
	
	/*
		Emular las pseudoclases de CSS con Javascript
	*/
	function suckerfish(type, tag, parentId) {
		if (window.attachEvent) {
			window.attachEvent("onload", function() {
				var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);
				type(sfEls);
			});
		}
	}
	// HOVER
	sfHover = function(sfEls) {
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	// FOCUS
	sfFocus = function(sfEls) {
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onfocus=function() {
				this.className+=" sffocus";
			}
			sfEls[i].onblur=function() {
				this.className=this.className.replace(new RegExp(" sffocus\\b"), "");
			}
		}
	}
	// ACTIVE
	sfActive = function(sfEls) {
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmousedown=function() {
				this.className+=" sfactive";
			}
			sfEls[i].onmouseup=function() {
				this.className=this.className.replace(new RegExp(" sfactive\\b"), "");
			}
		}
	}
	// TARGET
	sfTarget = function(sfEls) {
		var aEls = document.getElementsByTagName("A");
		document.lastTarget = null;
		for (var i=0; i<sfEls.length; i++) {
			if (sfEls[i].id) {
				if (location.hash==("#" + sfEls[i].id)) {
					sfEls[i].className+=" sftarget";
					document.lastTarget=sfEls[i];
				}
				for (var j=0; j<aEls.length; j++) {
					if (aEls[j].hash==("#" + sfEls[i].id)) aEls[j].targetEl = sfEls[i];
					aEls[j].onmousedown = function() {
						if (document.lastTarget) document.lastTarget.className = document.lastTarget.className.replace(new RegExp(" sftarget\\b"), "");
						if (this.targetEl) this.targetEl.className+=" sftarget";
						document.lastTarget=this.targetEl;
						return true;
					}
				}
			}
		}
	}
	
	// Soluciona las transparencias PNG para IE
	function fixPNG(myImage){
		if (document.all) {
			var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
			var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
			var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
			var imgStyle = "display:inline-block;" + myImage.style.cssText
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			strNewHTML += " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
			strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>" 
			myImage.outerHTML = strNewHTML
		}
	}
	
	// FunciÛn que ejecuta mÈtodos en el evento onload
	function addLoadEvent(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				oldonload();
				func();
			}
		}
	}
	/*
		METODOS CARGADOS EN ONLOAD
	*/
	