	//
	var SEP_AND = new String('|&|');
	var SEP_IGUAL = new String('|=|');
	

function ltrim(str){
	return str.replace(/^(\s+)/g, '');
}

function rtrim(str){
	return str.replace(/(\s+)$/g, '');
}

function trim(str){
	return ltrim(rtrim(str));
}
function $(i){
	return document.getElementById(i);
}
var Navegador = function(){
	this.esIE = false;// Internet Explorer
	this.esIE6 = false;
	this.esIE7 = false;
	this.esIE8 = false;
	this.esFf = false;// Mozilla
	this.esOp = false;// Opera
	this.esNs = false;// Netscape
	
	if(window.navigator.userAgent.search(RegExp("MSIE","im"))!=-1){
		this.esIE = true;
		if(window.navigator.userAgent.search(RegExp("MSIE 8","im"))!=-1) this.esIE8 = true;
		else if(window.navigator.userAgent.search(RegExp("MSIE 7","im"))!=-1) this.esIE7 = true;
		else if(window.navigator.userAgent.search(RegExp("MSIE 6","im"))!=-1) this.esIE6 = true;
	}
	else if(window.navigator.userAgent.search(RegExp("Firefox","im"))!=-1) this.esFf = true;
	else if(window.navigator.userAgent.search(RegExp("Opera","im"))!=-1) this.esOp = true;
	else if(window.navigator.userAgent.search(RegExp("Safari","im"))!=-1) this.esSa = true;
	else if(window.navigator.userAgent.search(RegExp("Netscape","im"))!=-1) this.esNs = true;
};
var Nav = new Navegador();
Function.prototype.closure = function(obj){
	// Init object storage.
	if (!window.__objs){
		window.__objs = [];
		window.__funs = [];
	}
	
	// For symmetry and clarity.
	var fun = this;
	
	// Make sure the object has an id and is stored in the object store.
	var objId = obj.__objId;
	if (!objId) __objs[objId = obj.__objId = __objs.length] = obj;
	
	// Make sure the function has an id and is stored in the function store.
	var funId = fun.__funId;
	if (!funId) __funs[funId = fun.__funId = __funs.length] = fun;
	
	// Init closure storage.
	if (!obj.__closures) obj.__closures = [];
	
	// See if we previously created a closure for this object/function pair.
	var closure = obj.__closures[funId];
	if (closure) return closure;
	
	// Clear references to keep them out of the closure scope.
	obj = null;
	fun = null;
	
	// Create the closure, store in cache and return result.
	var o = __objs[objId].__closures[funId] = function (){
		if(!!__funs[funId] && !!__objs[objId]) return __funs[funId].apply(__objs[objId], arguments);
		else return false;
	};
	o.__funId = funId;
	return o;
	
};

var EliminarClosures = function(o){
	var i = 0;
	if(o){
		if(o.__objId){
			for(i in o.__closures){
				delete(window.__funs[i]);
				delete(o.__closures[i]);
			}
			delete(window.__objs[o.__objId]);
			/*delete(o.__closures);
			delete(o.__objId);*/
			o.__closures = null;
			o.__objId = null;
		}
	}
	i = null;
}

var LimpiarClosures = function(){
	if(!!Nav && !Nav.esIE) window.addEventListener('unload', LimpiarClosures, false);
	else window.detachEvent("onunload",LimpiarClosures);
	
	if(window.__objs){
		for(i in window.__objs) EliminarClosures(window.__objs[i]);
	}
	window.__objs = [];
	window.__funs = [];
};

var Limpiar = function(){
	if(!!Nav && !Nav.esIE) window.addEventListener('unload', LimpiarClosures, false);
	else window.attachEvent("onunload", LimpiarClosures);
}();

document.LimpiarClosures  = LimpiarClosures;
function AddEvent(o, e, f){
	if(Nav.esIE) o.attachEvent('on'+e, f);
	else o.addEventListener(e, f, ((Nav.esOp)? false : true));
};
function RemEvent(o, e, f){
	if(Nav.esIE) o.detachEvent('on'+e, f);
	else o.removeEventListener(e, f, ((Nav.esOp)? false : true));
};
function FireEvent(o, e){
	var evt = null;
	if(Nav.esIE) o.fireEvent('on'+e);
	else{
		if(e=='click' || e=='dblclick' || e=='mousedown' || e=='mousemove' || e=='mouseout' || e=='mouseover' || e=='mouseup'){
			evt = document.createEvent("MouseEvents");
			evt.initMouseEvent(e, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
		}
		else if(e=='keydown' || e == 'keypress' || e == 'keyup'){
			evt = document.createEvent("KeyboardEvent");
			evt.initKeyEvent(e, true, true, null, false, false, false, false, 9, 0);
		}
		else{
			evt = document.createEvent("Event");
			evt.initEvent(e, true, false);
		}
		o.dispatchEvent(evt);
	}
}
function StopEvent(e){
	if(Nav.esIE){
		e.returnValue = false;
		e.cancelBubble = true;
	}
	else{
		e.preventDefault();
		e.stopPropagation();
	}
}
// JavaScript Document
	Request = function(oListener, metodo){
		this.pedido = new crearXHR();
		this.reportar = true;
		this.respuestaXML = null;
		this.respuestaHTML = null;
		this.archivo = null;
		this.valores = null;
		this.listener = oListener;
		//
		this.onError = null;
		this.onRetry = null;
		this.retrys = 0;
		this.curRetry = 0;
		
		if(!metodo) this.metodo = 'POST';
		else this.metodo = metodo;
	}
	
	Request.prototype.pedir = function(a, v, m, r){
		//inicializamos
		if(!!a) this.archivo = a;
		if(!!v) this.valores = v;
		if(!!m) this.metodo = m;
		if(!r) this.curRetry = 0;
		//
		this.respuestaXML = null;
		this.respuestaHTML = null;
		//
		this.cancelar(this.pedido);
		//
		this.pedido.onreadystatechange = this.procesar.closure(this);
		//
		this.pedido.open(this.metodo, this.archivo, true);
		//
		if(this.valores){
			this.valores = this.valores.puntualChars();
			this.pedido.send(this.valores);
		}
		else this.pedido.send();
	}
	
	Request.prototype.procesar = function(){
		var termino = false;
		if(this.pedido && this.pedido.readyState == 4){
			var stat = this.pedido.status;
			
			if((stat >= 200 && stat < 300) || stat == 304 || stat == 1223){
				if(this.pedido.responseXML) this.respuestaXML = this.pedido.responseXML.documentElement;
				this.respuestaHTML = this.pedido.responseText;
				
				this.cancelar();
				if(this.listener && this.listener.onRequestLoad) this.listener.onRequestLoad();
				else if(typeof(this.listener)=='function'){ this.listener(); }
			}
			else if(this.curRetry < this.retrys){
				this.curRetry++;
				this.pedir(false, false, false, true);
				if(typeof(this.onRetry) == 'function'){ this.onRetry(); }
			}
			else{
				if(this.reportar){
					ERROR.reportar("Error en clase Request."+
								   "\nESTADO: "+this.pedido.status+" "+this.pedido.statusText+
								   "\nARCHIVO: "+this.archivo+
								   "\nMETODO: "+this.metodo);
				}
				if(this.onError && (typeof(this.onError) == 'function' || typeof(this.onError) == 'object')){ this.onError(); }
				this.cancelar();
			}
		}
	}
	
	Request.prototype.cancelar = function(){
		cancelarPedido(this.pedido);
	}
	
	//
	String.prototype.puntualChars = function(){
		var chrs = new Array({'chr':'€', 'ent':'&euro;'}), i, str = this.toString();
		for(i = 0; i < chrs.length; i++){
			str = str.replace(chrs[i]['chr'], chrs[i]['ent']);
		}
		return str;
	}
	
	String.prototype.unPuntualChars = function(){
		var chrs = new Array({'chr':'€', 'ent':'&euro;'}), i, str = this.toString();
		for(i = 0; i < chrs.length; i++){
			str = str.replace(chrs[i]['ent'], chrs[i]['chr']);
		}
		return str;
	}
	
	/* FUNCION DE CREACION DE XMLHttpRequest */
	crearXHR = function(){
		var r = null
		if (window.XMLHttpRequest) r = new XMLHttpRequest()
		else if(window.ActiveXObject) {
			var msp = new Array('Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP')
			for(var i = 0; i < msp.length; i++){
				try { r = new ActiveXObject(msp[i]) } catch (e){}
			}
		}
		return r
	}
	
	/* FUNCION DE DETENCION DE XMLHttpRequest */
	cancelarPedido = function(reqXHR){
		if(reqXHR!=null){
			reqXHR.onreadystatechange=new Function()//una funcion vacia...
			reqXHR.abort()
		}
	}
	
	//
	ReportarError = function(f, m){
		this.archivo = (!!f)? f: DIR_FIX + 'xmlHttpRequest/reportarError.php';
		this.metodo = (!!m)? m:'POST';
		this.req = new Request();
		this.req.reportar = false;
		this.alerta = true;
		
		this.reportar = function(msj){
			var msg = "Ha ocurrido un error.\nLos administradores del sistema ya han sido notificados del mismo."+
			"\nSi el error continua pongase en contacto con los mismos.";
			

			this.req.pedir(this.archivo, msj, this.metodo);
			if(this.alerta){
				if(LayError){
					LayLoader.showed = Blocker.showed = 1;
					LayLoader.hide();
					Blocker.hide();
					
					LayError.message = msg;
					LayError.onAcept = function(){
						LayError.hide();
						Blocker.hide();
					};
					LayError.onCancel = function(){
						LayLoader.hide();
						Blocker.hide();
					};
					Blocker.show();
					LayError.show();
				}
				else{ alert(msg); }
			}
			return false;
		};
	}
	ERROR = new ReportarError();
// JavaScript Document
//Recibe como parametro un objeto de configuracion, con las siguientes propiedades
// o.zIndex = int
// o.width 	= int
// o.css	= str (nombre del estilo previamente declarado)
// o.msg	= str (mensaje que se visualizara default)
//
//Metodos
// mostrar(msg) = despliega el tooltip sobre el elemento en foco
// ocultar()	= oculta el tooltip
// mensaje(msg) = para cambiar el mensaje del tooltip

ToolTip = function(oConfig){
	//
	var z 	= 1;
	var css = '';
	var msg = '';
	//
	if(oConfig && oConfig.zIndex) z = oConfig.zIndex-1;
	if(oConfig && oConfig.css) css = oConfig.css;
	if(oConfig && oConfig.mensaje) msg = oConfig.mensaje;
	
	//
	this.cont = document.createElement('div');
	this.cont.style.position = 'absolute';
	this.cont.style.display = 'none';
	this.cont.style.zIndex = z;
	this.cont.unselectable = true;
	document.body.insertBefore(this.cont, document.body.firstChild);
	//
	/*this.iframe = document.createElement('iframe');
	this.iframe.style.position = 'absolute';
	this.iframe.style.zIndex = z;
	this.iframe.style.width = 0;
	this.iframe.border = 0;
	this.iframe.scrolling = 'no';
	this.iframe.src = 'about:blank';
	this.iframe.frameBorder = 0;
	this.iframe.disabled = true;
	this.cont.appendChild(this.iframe);*/
	//
	this.tip = document.createElement('div');
	this.tip.style.position = 'relative';
	this.tip.style.zIndex = z + 1;
	this.tip.style.width = 0;
	if(css) this.tip.className = css;
	if(msg) this.tip.innerHTML = msg;
	this.tip.unselectable = true;
	this.cont.appendChild(this.tip);
	
	//
	this.ocultar = function(){
		this.cont.style.display = 'none';
		if(this.ele) RemEvent(this.ele, 'mousemove', function(e){ this.controlarUbicacion(e); }.closure(this));
	}
	
	this.mostrar = function(e, msg, css){
		//
		this.mensaje(msg);
		if(css) this.tip.className = css;
		//
		this.cont.style.display = 'block';
		//this.iframe.style.width = 0;
		//this.iframe.style.height = 0;
		
		this.tip.style.width = 'auto';
		this.tip.style.height = 'auto';
		//
		this.controlarTamanios();
		this.controlarUbicacion(e);
		//
		if(e && e.srcElement.uniqueID!=this.tip.uniqueID){
			this.ele = e.srcElement;
			RemEvent(this.ele, 'mousemove', function(e){ this.controlarUbicacion(e); }.closure(this));
			AddEvent(this.ele, 'mousemove', function(e){ this.controlarUbicacion(e); }.closure(this));
		}
	}
	
	this.mensaje = function(msg){
		if(msg) this.tip.innerHTML = msg;
	}
	
	this.controlarUbicacion = function(e){
		this.cont.style.top  = (e.clientY + document.documentElement.scrollTop+ 19) + 'px';
		if(e.clientX + this.cont.offsetWidth - 2 + document.documentElement.scrollLeft  < document.body.offsetWidth)
			this.cont.style.left = (e.clientX - 2 + document.documentElement.scrollLeft) + 'px';
		else
			this.cont.style.left = (e.clientX + document.documentElement.scrollLeft + 10 - this.cont.offsetWidth) + 'px';
	}.closure(this);
	
	this.controlarTamanios = function(){
		//
		//this.iframe.style.width = (this.tip.offsetWidth + 2) + 'px';
		//this.iframe.style.height = (this.tip.offsetHeight + 2) + 'px';
		
		this.tip.style.width = (this.tip.offsetWidth - 4) + 'px';
		this.tip.style.height = (this.tip.offsetHeight - 4) + 'px';
	}
}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;//Javascript
	//Config
	var iZoomMinMarging = 30;//px
	var iZoomDelay = 4;//mlsgs
	var iZoomFrames = 16;//px
	
	//
	var iZoomImgW = 0;
	var iZoomImgH = 0;
	var iZoomImgY = 0;
	var iZoomImgX = 0;
	var bZoomImgOn = false;
	var bZoomImgAnim = false;
	var aZoomImgInfo = new Object();
	var eZoomImage = null;
	var oZoomImgLoad = null;
	var eZoomImgLoader = null;
	var eZoomImgLayer = null;
	var eZoomImgImage = null;
	var eZoomImgClose = null;
	var eZoomImgBack = null;
	var eZoomImgFord = null;
	var eZoomFromGalery = false;
	var eZoomFromBtnGalery = false;
	var eZoomHasFord = false;
	var eZoomHasBack = false;
	var eZoomImgBlock = null;
	var eZoomTransGalery = null;
	var eZoomImgClosePos = 'right';

	function zoomInit(){
		iZoomImgW = WBody();
		iZoomImgH = HScreen();
		iZoomImgY = YPos();
		iZoomImgX = XPos();
		
		eZoomImgLoader = document.getElementById('zoomLayLoader');
		eZoomImgLayer = document.getElementById('zoomLayPrev');
		eZoomImgImage = document.getElementById('zoomImagePrev');
		eZoomImgImage.onclick = zoomImageOut;
		eZoomImgEpi = document.getElementById('zoomImageEpi');
		eZoomImgEpi.firstChild.innerHTML = '';
		eZoomImgEpi.style.display = 'none';
		eZoomImgClose = document.getElementById('zoomImageClose');
		eZoomImgClose.onclick = zoomImageOut;
		eZoomImgClose.style.visibility = 'hidden';
		eZoomImgBack = document.getElementById('zoomImageBack');
		eZoomImgBack.onclick = zoomImagePrev;
		eZoomImgBack.style.visibility = 'hidden';
		eZoomImgFord = document.getElementById('zoomImageFord');
		eZoomImgFord.onclick = zoomImageNext;
		eZoomImgFord.style.visibility = 'hidden';
		eZoomImgBlock = document.getElementById('zoomLayBlock');
		if(!eZoomFromBtnGalery){
			eZoomImgBlock.style.display = 'none';
			eZoomFromBtnGalery = false;
		}
		setOpacity(70, eZoomImgBlock);
	}
	
	function zoomImage(event, image, galery){
		StopEvent(event);
		zoomInit();
		eZoomImage = image;
		eZoomFromGalery = (!galery)? false:true;
		zoomShowLoader(true);
		zoomImageLoad();
	}
	
	function zoomImageLoad(){
		oZoomImgLoad = new Image();
		oZoomImgLoad.onload = function(){ zoomImageLoaded(); }
		oZoomImgLoad.src = eZoomImage.src.substr(0, eZoomImage.src.lastIndexOf('.') - 1) + eZoomImage.src.substr(eZoomImage.src.lastIndexOf('.'), eZoomImage.src.length);
	}
	
	function zoomImageLoaded(){
		zoomShowLoader(false);
		zoomImageIn();
	}
	
	function zoomShowLoader(bShow){
		if(bShow){
			eZoomImgLoader.style.top = Math.ceil(((iZoomImgH - eZoomImgLoader.offsetHeight) / 2) + iZoomImgY) + 'px';
			eZoomImgLoader.style.left = Math.ceil(((iZoomImgW - eZoomImgLoader.offsetWidth) / 2) + iZoomImgX) + 'px';
			eZoomImgLoader.style.visibility = 'visible';
		}
		else{
			eZoomImgLoader.style.top = '-' + (eZoomImgLoader.offsetHeight + 20) + 'px';
			eZoomImgLoader.style.visibility = 'hidden';
		}
	}
	
	function zoomImageIn(){
		var iIniW = eZoomImage.width;
		var iIniH = eZoomImage.height;
		var iEndW = oZoomImgLoad.width;
		var iEndH = oZoomImgLoad.height;
		var iPorc = iEndW / iEndH;
		
		var oPos = getElementPos(eZoomImage);
		var iIniX = oPos.x;
		var iIniY = oPos.y;
		
		if(bZoomImgAnim != true){
			aZoomImgInfo['iIniW'] = iIniW;
			aZoomImgInfo['iIniH'] = iIniH;
			aZoomImgInfo['iIniX'] = iIniX;
			aZoomImgInfo['iIniY'] = iIniY;
			
			eZoomImgImage.style.height = iIniH + 'px';
			eZoomImgImage.style.width = iIniW + 'px';
			eZoomImgImage.src = oZoomImgLoad.src;
			eZoomImgImage.title = eZoomImage.title;
			
			eZoomImgLayer.style.top = iIniY + 'px';
			eZoomImgLayer.style.left = iIniX + 'px';
			
			setOpacity(0, eZoomImgLayer);
			eZoomImgLayer.style.visibility = 'visible';
			
			var iDif = 0;
			if(trim(eZoomImage.alt) != ''){
				eZoomImgEpi.firstChild.innerHTML = eZoomImage.alt;
				eZoomImgEpi.style.width = iIniW + 'px';
				eZoomImgEpi.style.display = 'block';
				
				iDif = eZoomImgEpi.offsetHeight;
			}
			
			if(iEndW > iZoomImgW - iZoomMinMarging){
				iEndW = iZoomImgW - iZoomMinMarging;
				iEndH = iEndW / iPorc;
			}
			if(iEndH > iZoomImgH - iZoomMinMarging - iDif){
				iEndH = iZoomImgH - iZoomMinMarging - iDif;
				iEndW = (iEndH - iDif) * iPorc;
			}
			
			var iChangeX = (((iZoomImgW / 2) - (iEndW / 2) - iIniX) + iZoomImgX);
			var iChangeY = (((iZoomImgH / 2) - (iEndH / 2) - iIniY) + iZoomImgY - (iDif / 2));
			var iChangeW = (iEndW - iIniW);
			var iChangeH = (iEndH - iIniH);
			var sOpacity = "(100 / iZoomFrames) * iCurFrame";
			
			setTimeout('zoomImageAnim('+iIniW+', '+iChangeW+', '+iIniH+', '+iChangeH+', '+iIniX+', '+iChangeX+', '+iIniY+', '+iChangeY+', 0, "in")', iZoomDelay);
			bZoomImgAnim = true;
			oPos = null;
		}
	}
	
	function zoomImageOut(){
		if(bZoomImgAnim != true){
			
			RemEvent(document, 'keypress', zoomImageKeypress);
			
			eZoomImgBlock.style.display = 'none';
			eZoomImgClose.style.visibility = eZoomImgBack.style.visibility = 
			eZoomImgFord.style.visibility = 'hidden';
			
			var iIniW = parseInt(eZoomImgImage.style.width);
			var iIniH = parseInt(eZoomImgImage.style.height);
			var iEndW = eZoomImage.width;
			var iEndH = eZoomImage.height;
			
			var iIniX = parseInt(eZoomImgLayer.style.left);
			var iIniY = parseInt(eZoomImgLayer.style.top);
			
			var iChangeX = aZoomImgInfo['iIniX'] - iIniX;
			var iChangeY = aZoomImgInfo['iIniY'] - iIniY;
			var iChangeW = aZoomImgInfo['iIniW'] - iIniW;
			var iChangeH = aZoomImgInfo['iIniH'] - iIniH;
			
			setTimeout('zoomImageAnim('+iIniW+', '+iChangeW+', '+iIniH+', '+iChangeH+', '+iIniX+', '+iChangeX+', '+iIniY+', '+iChangeY+', 0, "out")', iZoomDelay);
			bZoomImgAnim = true;
		}
	}
	
	function zoomImageAnim(iIniW, iChangeW, iIniH, iChangeH, iIniX, iChangeX, iIniY, iChangeY, iCurFrame, sMode){
		if(iCurFrame == (iZoomFrames + 1)){
			bZoomImgAnim = false;
			if(sMode == 'in'){ zoomImageInEnd(); }
			else{ zoomImageOutEnd(); }
		}
		else{
			var w = strongEaseInOut(iCurFrame, iIniW, iChangeW, iZoomFrames);
			var h = strongEaseInOut(iCurFrame, iIniH, iChangeH, iZoomFrames);
			var x = strongEaseInOut(iCurFrame, iIniX, iChangeX, iZoomFrames);
			var y = strongEaseInOut(iCurFrame, iIniY, iChangeY, iZoomFrames);
			var i = (sMode == 'in')? (100 / iZoomFrames) * iCurFrame : (100 / iZoomFrames) * (iZoomFrames - iCurFrame);
			
			eZoomImgLayer.style.left = x + 'px';
			eZoomImgLayer.style.top = y + 'px';
			eZoomImgImage.style.width = w + 'px';
			eZoomImgImage.style.height = h + 'px';
			
			if(eZoomImgEpi.style.display == 'block'){
				eZoomImgEpi.style.width = w + 'px';
			}
			
			setOpacity(i, eZoomImgLayer);
			
			iCurFrame++;
			
			setTimeout('zoomImageAnim('+iIniW+', '+iChangeW+', '+iIniH+', '+iChangeH+', '+iIniX+', '+iChangeX+', '+iIniY+', '+iChangeY+', '+iCurFrame+', "'+sMode+'")', iZoomDelay);
		}
	}
	
	function zoomImageInEnd(){
		bZoomImgOn = true;
		eZoomImgClose.style.top = (parseInt(eZoomImgLayer.style.top) - (eZoomImgClose.offsetHeight / 2)) + 'px';
		if(eZoomImgClosePos == 'left'){ eZoomImgClose.style.left = (parseInt(eZoomImgLayer.style.left) -  (eZoomImgClose.offsetWidth / 2)) + 'px'; }
		else{ eZoomImgClose.style.left = (parseInt(eZoomImgLayer.style.left) + parseInt(eZoomImgImage.style.width) -  (eZoomImgClose.offsetWidth / 2)) + 'px'; }
		eZoomImgClose.style.visibility = 'visible';
		if(!eZoomTransGalery){
			if(eZoomFromGalery && !!eZoomImage.parentNode && !!eZoomImage.parentNode.nextSibling && !!eZoomImage.parentNode.nextSibling.nextSibling){
				eZoomHasFord = true;
				eZoomImgFord.style.top = (((iZoomImgH - eZoomImgFord.offsetHeight) / 2) + iZoomImgY) + 'px';
				eZoomImgFord.style.visibility = 'visible';
			}
			else{ eZoomHasFord = false; }
			
			if(eZoomFromGalery && !!eZoomImage.parentNode && !!eZoomImage.parentNode.previousSibling && !!eZoomImage.parentNode.previousSibling.previousSibling){
				eZoomHasBack = true;
				eZoomImgBack.style.top = (((iZoomImgH - eZoomImgBack.offsetHeight) / 2) + iZoomImgY) + 'px';
				eZoomImgBack.style.visibility = 'visible';
			}
			else{ eZoomHasBack = false; }
		}
		else{
			eZoomTransGalery();
		}
		
		var n = (HBody() > iZoomImgH)? HBody():iZoomImgH;
		eZoomImgBlock.style.height = n + 'px';
		eZoomImgBlock.style.width = WBody() + 'px';
		eZoomImgBlock.style.display = 'block';
		
		AddEvent(document, 'keypress', zoomImageKeypress);
	}
	
	function zoomImageOutEnd(){
		bZoomImgOn = false;
		eZoomImgLayer.style.visibility = 'hidden';
		eZoomImgLayer.style.top = '-1000px';
		eZoomImgLayer.style.left = '0';
	}
	
	function zoomImageNext(){
		if(eZoomHasFord){
			eZoomFromBtnGalery = true;
			FireEvent(eZoomImage.parentNode.nextSibling.nextSibling.firstChild, 'click');
		}
	}
	
	function zoomImagePrev(){
		if(eZoomHasBack){
			eZoomFromBtnGalery = true;
			FireEvent(eZoomImage.parentNode.previousSibling.previousSibling.firstChild, 'click');
		}
	}
	
	function zoomImageKeypress(e){
		if(bZoomImgAnim != true){
			if(e.keyCode == 27){ zoomImageOut(); }
			else if(e.keyCode == 39){ zoomImageNext(); }
			else if(e.keyCode == 37){ zoomImagePrev(); }
		}
	}
// JavaScript Document
var oContador = new function(){
	var oEle = null;
	var accion = "";
	var arreglo = new Array();
	var listo = true;
	//OBJs
	var req = new Request();
	req.listener = function(){
		var d = req.respuestaXML;
		var banner = null;
		var pedido = null;
		var nombre = null;
		var part = '';
		var tag = '';
		if(d && accion == 'pedirBanner'){
			for(i=0;i<d.childNodes.length;i++){
				pedido = d.childNodes[i];

				for(j=0;j<pedido.childNodes.length;j++){
										
					banner = pedido.childNodes[j];
					nombre = banner.getAttribute('nombre');
					part = nombre.split('.');
					var cont = $(arreglo[i].contenedor);
					if(part[1] != 'swf'){

						tag = cTag('img');
						tag.src = nombre;
						tag.width = banner.getAttribute('width');
						tag.height = banner.getAttribute('height');
						if(banner.firstChild.data != ''){
							tag.style.cursor = 'pointer';
							asignarClick(tag,banner.getAttribute('id'),banner.firstChild.data);
						}
						if(cont)cont.appendChild(tag);
					}
					else{
						tag = cTag('div');
						tag.id = 'banner'+banner.getAttribute('id');
						if(cont)cont.appendChild(tag);
						var anex = '';
						if(banner.firstChild.data != ''){
							anex = '?clickTag=clicksBanners.php?id='+banner.getAttribute('id');	
						}
						var prev = new FlashObject(nombre+anex, "animaF", banner.getAttribute('width'), banner.getAttribute('height'), "8", "");
						prev.addParam("menu","false");
						prev.addParam("wmode","transparent");
						prev.write("banner"+banner.getAttribute('id'));
						
					}
					
				}
				var name = d.childNodes[i].getAttribute('nombre');
			}
			/*$('contadorLateral').innerHTML = d.firstChild.data;
			if($('contadorLateral').innerHTML == '')$('contadorLateral').style.display = 'none';*/
		}
		

		
	}.closure(this);
	
	var asignarClick = function(img,id,web){
		AddEvent(img,'click',function(){
			clickBanner(id,web);									  
	  	});
		
	}
	
	
	//METs
	this.setearPedido = function(idSeccion,posicion,cantidad,contenedor){
		var obj = new Object();
		obj.idSeccion = idSeccion;
		obj.posicion = posicion;
		obj.cantidad = cantidad;
		obj.contenedor = contenedor;
		arreglo.push(obj)
	}
	this.pedirContador = function(){
		accion = 'pedirBanner'
		var v = '';
		for(i=0;i<arreglo.length;i++){
			v += 'idSeccion'+i+SEP_IGUAL+arreglo[i].idSeccion+SEP_AND+'posicion'+i+SEP_IGUAL+arreglo[i].posicion+SEP_AND+'cantidad'+i+SEP_IGUAL+arreglo[i].cantidad+SEP_AND;
		}
		var resPos = 0;
		if(WScreen() == 1024)resPos = 1;
		else if(WScreen() > 1024)resPos = 2;
		v += 'indices'+SEP_IGUAL+arreglo.length+SEP_AND;
		v += 'resPos'+SEP_IGUAL+resPos+SEP_AND;	
		req.pedir(DIR_ROOT+'request/devolverBanner.php', v);
	}
	this.clickBanner = function(i,web,ventanaNueva,e){
		accion = '';
		req.pedir(DIR_ROOT+'requests/clickBanner.php', 'idBanner'+SEP_IGUAL+i+SEP_AND);
		if(web.substr(0,1) == "?")document.location = web;
		else{
			if(ventanaNueva == 1)window.open(web);
			else document.location = web;
		}
		if(e)StopEvent(e);
	}
}
//Javascript
function ZoomElement(){
	//Config
	var iZoomEleDelay = 4;//mlsgs
	var iZoomEleFrames = 10;//px
	var fZoomEleMove = strongEaseInOut;//function
	
	//
	var iZoomEleW = 0;
	var iZoomEleH = 0;
	var iZoomEleY = 0;
	var iZoomEleX = 0;
	var bZoomEleOn = false;
	var bZoomEleAnim = false;
	var eZoomEleFrom = null;
	var eZoomEleTo = null;
	var fZoomEleInEnd = null;
	var fZoomEleOutEnd = null;
	var fZoomEleAnim = null;
	
	var iIniW, iChangeW, iIniH, iChangeH, iIniX, iChangeX, iIniY, iChangeY, iCurFrame, sMode;

	var zoomElementInit = function(){
		if(!window.innerWidth){//IE
			iZoomEleW = document.documentElement.clientWidth;
			iZoomEleH = document.documentElement.clientHeight;
			iZoomEleY = document.documentElement.scrollTop;
			iZoomEleX = document.documentElement.scrollLeft;
		}
		else{
			iZoomEleW = window.innerWidth;
			iZoomEleH = window.innerHeight;
			iZoomEleY = window.pageYOffset;
			iZoomEleX = window.pageXOffset;
		}
	}
	
	this.zoomElement = function(eFrom, eTo, fOnInEnd, fOnOutEnd, fOnAmin, bNoStart){
		eZoomEleFrom = eFrom;
		eZoomEleTo = eTo;
		fZoomEleInEnd = fOnInEnd;
		fZoomEleOutEnd = fOnOutEnd;
		fZoomEleAnim = fOnAmin;
		zoomElementInit();
		if(!bNoStart){ zoomElementIn(); }
	}
	
	var zoomElementIn = function(){
		iIniW = eZoomEleFrom.offsetWidth;
		iIniH = eZoomEleFrom.offsetHeight;
		
		var iEndW = eZoomEleTo.offsetWidth;
		var iEndH = eZoomEleTo.offsetHeight;
		
		var oPos = getElementPos(eZoomEleFrom);
		iIniX = oPos.x;
		iIniY = oPos.y;
		
		if(bZoomEleAnim != true){
			eZoomEleTo.style.overflow = 'hidden';
			eZoomEleTo.style.height = iIniH + 'px';
			eZoomEleTo.style.width = iIniW + 'px';
			eZoomEleTo.style.top = iIniY + 'px';
			eZoomEleTo.style.left = iIniX + 'px';
			
			setOpacity(0, eZoomEleTo);
			eZoomEleTo.style.visibility = 'visible';
			
			iChangeX = (((iZoomEleW / 2) - (iEndW / 2) - iIniX) + iZoomEleX);
			iChangeY = (((iZoomEleH / 2) - (iEndH / 2) - iIniY) + iZoomEleY);
			iChangeW = (iEndW - iIniW);
			iChangeH = (iEndH - iIniH);
			iCurFrame = 0;
			sMode = 'in';
			
			setTimeout(zoomElementAnim, iZoomEleDelay);
			bZoomEleAnim = true;
			oPos = null;
		}
	}
	
	this.zoomElementOut = function(){
		if(bZoomEleAnim != true){
			eZoomEleTo.style.overflow = 'hidden';
			
			iIniW = eZoomEleTo.offsetWidth;
			eZoomEleTo.__width = iIniW;
			iIniH = eZoomEleTo.offsetHeight;
			var iEndW = eZoomEleFrom.offsetWidth;
			var iEndH = eZoomEleFrom.offsetHeight;
			
			iIniX = parseInt(eZoomEleTo.style.left);
			iIniY = parseInt(eZoomEleTo.style.top);
			
			var oPos = getElementPos(eZoomEleFrom);
			iChangeX = oPos.x - iIniX;
			iChangeY = oPos.y - iIniY;
			iChangeW = eZoomEleFrom.offsetWidth - iIniW;
			iChangeH = eZoomEleFrom.offsetHeight - iIniH;
			iCurFrame = 0;
			sMode = 'out';
			
			setTimeout(zoomElementAnim, iZoomEleDelay);
			bZoomEleAnim = true;
		}
	}
	
	var zoomElementAnim = function(){
		if(iCurFrame == (iZoomEleFrames + 1)){
			bZoomEleAnim = false;
			if(sMode == 'in'){ zoomElementInEnd(); }
			else{ zoomElementOutEnd(); }
		}
		else{
			var w = fZoomEleMove(iCurFrame, iIniW, iChangeW, iZoomEleFrames);
			var h = fZoomEleMove(iCurFrame, iIniH, iChangeH, iZoomEleFrames);
			var x = fZoomEleMove(iCurFrame, iIniX, iChangeX, iZoomEleFrames);
			var y = fZoomEleMove(iCurFrame, iIniY, iChangeY, iZoomEleFrames);
			var i = (sMode == 'in')? (100 / iZoomEleFrames) * iCurFrame : (100 / iZoomEleFrames) * (iZoomEleFrames - iCurFrame);
			
			eZoomEleTo.style.left = x + 'px';
			eZoomEleTo.style.top = y + 'px';
			eZoomEleTo.style.width = w + 'px';
			eZoomEleTo.style.height = h + 'px';
			
			setOpacity(i, eZoomEleTo);
			
			iCurFrame++;
			
			setTimeout(zoomElementAnim, iZoomEleDelay);
		}
		
		if(fZoomEleAnim){ fZoomEleAnim(iCurFrame, sMode); }
	}.closure(this);
	
	var zoomElementInEnd = function(){
		bZoomEleOn = true;
		eZoomEleTo.style.height = 'auto';
		if(fZoomEleInEnd){ fZoomEleInEnd(); }
	}
	
	var zoomElementOutEnd = function(){
		bZoomEleOn = false;
		eZoomEleTo.style.visibility = 'hidden';
		eZoomEleTo.style.top = '-1000px';
		eZoomEleTo.style.left = '0';
		eZoomEleTo.style.overflow = 'auto';
		eZoomEleTo.style.height = 'auto';
		eZoomEleTo.style.width = eZoomEleTo.__width + 'px';
		if(fZoomEleOutEnd){ fZoomEleOutEnd(); }
	}
	
}
// JavaScript Document
function layer(nombre, archivo){
	
	var capa = $('lay' + nombre);
	var fondo = $('bg' + nombre);
	var error = $('error' + nombre);
	
	var seccion = 0;
	var enviando = false;
	var errores = 0;
	var aCampos = new Array();
	var aValidar = new Array();
	var aLimpiar = new Array();
	var req = new Request();
	var animando = false;
	var elemento = false;
	var zoomEle = null;
	
	this.onSuccess = null;
	this.onError = null;
	this.onClose = null;
	
	//
	req.listener = function(){
		var d = req.respuestaXML;
		block(false);
		
		if(!d){ alert(req.respuestaHTML); }
		else if(d.getAttribute('exito') == 'si'){
			RemEvent(document, 'keypress', this.escape);
			block(true);
			if(!this.onSuccess){
				capa.style.zIndex = 9;
				Exito.onAccept = onAcceptSuccess;
				Exito.show(d.firstChild.data);
			}
			else{ this.onSuccess(); }
		}
		else{
			RemEvent(document, 'keypress', this.escape);
			block(true);
			if(!this.onError){
				capa.style.zIndex = 9;
				Error.onAccept = onAcceptError;
				Error.show(d.firstChild.data);
			}
			else{ this.onError(); }
		}
	}.closure(this);
	
	var onAcceptSuccess = function(){
		capa.style.zIndex = 10;
		clean();
		block(false);
		this.close();
	}.closure(this);
	var onAcceptError = function(){
		AddEvent(document, 'keypress', this.escape);
		block(false);
		capa.style.zIndex = 10;
	}.closure(this);
	
	var center = function(){
		//
		if(!!fondo){
			fondo.style.height = ((HBody() > HScreen())? HBody():HScreen()) + 'px';
			fondo.style.width = ((WBody() > WScreen())? WScreen():WBody()) + 'px';
		}
		//
		capa.style.top = (((HScreen() - capa.offsetHeight) / 2) + YPos()) + 'px';
		capa.style.left = (((WScreen() - capa.offsetWidth) / 2) + XPos()) + 'px';
	}.closure(this);
	this.escape = function(event){ if(event.keyCode == 27){ this.close(); } }.closure(this);
	this.enter = function(event){ if(event.keyCode == 13){ this.send(); } }.closure(this);
	
	this.open = function(ele, sec, event){

		if(!!event){ StopEvent(event); }
		if(!!animando){ return false; }
		animando = true;
		//
		elemento = ele;
		seccion = sec;

		animIn();
	
	}
	this.close = function(event){
		if(!!event){ StopEvent(event); }
		if(!!animando){ return false; }
		animando = true;
		
		RemEvent(window, 'scroll', center);
		RemEvent(window, 'resize', center);
		RemEvent(document, 'keypress', this.escape);
		
		clearTimeout(animBgInt);
		animBgFrame = 0;
		animBgMode = 'out';
		animBgInt = setTimeout(animBg, animBgRetardo);
	}.closure(this);
	
	this.addField = function(campo, nombre, expresion, clear){
		var o = {'c':campo, 'n':nombre};
		//
		aCampos.push(o);
		if(expresion){
			campo.expresion = expresion;
			campo.inputError = inputError;
			campo.onblur = funcVal.closure(campo);
			//
			aValidar.push(aCampos.length - 1);
		}
		if(clear){ aLimpiar.push(aCampos.length - 1); }
	}
	this.setBackground = function(oEle){ fondo = oEle; }
	
	var clean = function(){
		var i = null;
		//
		for(i in aLimpiar){ aCampos[aLimpiar[i]]['c'].value = ''; }
		for(i in aCampos){ inputError(aCampos[i]['c'], false); }
		errores = 0;
		showError();
	}
	
	this.send = function(event){
		var v = '', i = null;
		if(!!event){ StopEvent(event); }
		//
		if(enviando){ return false; }
		else if(validate()){ return false; }
		//
		block(true);
		//
		v += 'seccion' + SEP_IGUAL + seccion + SEP_AND;
		for(i in aCampos){ v += aCampos[i]['n'] + SEP_IGUAL + trim(aCampos[i]['c'].value) + SEP_AND; }
		if(this.moreInfo != ''){ v += this.moreInfo; }		
		//
		req.pedir(DIR_ROOT + 'requests/' + archivo + '.php', v);
	}.closure(this);
	
	var inputError = function(c, b){
		errores += (b)? 1:0;
		c.className = (b)? 'inputError':'';
	}.closure(this);
	var showError = function(){
		error.style.display = (errores > 0)? 'block':'none';
	}
	
	var funcVal = function(){
		this.value = trim(this.value);
		if(this.value.search(this.expresion) == 0 || this.errorDesactivado){ this.inputError(this, false); }
		else{ this.inputError(this, true); }
	}
	var validate = function(){
		var i = null;
		//
		errores = 0;
		for(i in aValidar){ aCampos[aValidar[i]]['c'].onblur(); }
		showError();
		return (errores > 0);
	}
	
	var block = function(b){
		var i = null;
		//
		enviando = b;
		for(i in aCampos){ aCampos[i]['c'].disabled = b; }
	}
	
	//Aminacion
	var animBgInt = 0;
	var animBgRetardo = 1;
	var animBgFrames = 5;
	var animBgFrame = 0;
	var animBgMode = '';
	
	var animIn = function(){
		center();
		if(!!fondo){
			setOpacity(0, fondo);
			fondo.style.display = 'block';
		}

		iZoomEleDelay = 1;
		if(!zoomEle){ zoomEle = new ZoomElement(); }

		zoomEle.zoomElement(elemento, capa, animInEnd, animOutEnd, false);
	}
	var animOut = function(){
		zoomEle.zoomElement(elemento, capa, animInEnd, animOutEnd, false, true);
		zoomEle.zoomElementOut();
	}
	var animInEnd = function(){
		center();
		//
		try{ aCampos[0]['c'].focus(); }catch(e){}
		AddEvent(window, 'scroll', center);
		AddEvent(window, 'resize', center);
		AddEvent(document, 'keypress', this.escape);
		
		clearTimeout(animBgInt);
		animBgFrame = (!!fondo)? 0 : animBgFrames + 1;
		animBgMode = 'in';
		animBgInt = setTimeout(animBg, animBgRetardo);
	}.closure(this);
	var animOutEnd = function(){
		if(!!fondo){ fondo.style.display = 'none'; }
		if(!!this.onClose){ this.onClose(); }
	}.closure(this);
	var animBg = function(){
		if(animBgFrame == animBgFrames + 1){
			animando = false;
			if(animBgMode == 'in'){ ; }
			else{ animOut(); }
		}
		else{
			var i = (animBgMode == 'in')? (60 / animBgFrames) * animBgFrame : (60 / animBgFrames) * (animBgFrames - animBgFrame);
			if(!!fondo){ setOpacity(i, fondo); }
			animBgFrame++;
			animBgInt = setTimeout(animBg, animBgRetardo);
		}
	}.closure(this);
}
// JavaScript Document
	var Exito = new function(){
		//
		this.show = function(msj){
			$('msjExito').innerHTML = msj;
			
			var l = $('capaExito');
			l.style.top = (((HScreen() - l.offsetHeight) / 2) + YPos()) + 'px';
			l.style.left = (((WScreen() - l.offsetWidth) / 2) + XPos()) + 'px';
			l.style.visibility = 'visible';
			
			try{ $('aceptarExito').focus(); }catch(e){ ; }
			AddEvent(document, 'keypress', escape);
			AddEvent($('aceptarExito'), 'click', accept);
			AddEvent($('cerrarExito'), 'click', accept);
		}
		
		this.hide = function(){
			RemEvent(document, 'keypress', escape);
			RemEvent($('aceptarExito'), 'click', accept);
			RemEvent($('cerrarExito'), 'click', accept);
			var l = $('capaExito');
			l.style.visibility = 'hidden';
			l.style.top = '-1000px';
		}
		
		this.onAccept = null;
		
		var accept = function(e){
			if(!!e){ StopEvent(e); }
			this.hide();
			if(!!this.onAccept){ this.onAccept(); }
		}.closure(this);
		
		var escape = function(event){
			if(event.keyCode == 27){ accept(); }
		}.closure(this);
		
		//
	}
// JavaScript Document
	var Error = new function(){
		//
		this.show = function(msj){
			$('msjError').innerHTML = msj;
			
			var l = $('capaError');
			l.style.top = (((HScreen() - l.offsetHeight) / 2) + YPos()) + 'px';
			l.style.left = (((WScreen() - l.offsetWidth) / 2) + XPos()) + 'px';
			l.style.visibility = 'visible';
			
			try{ $('aceptarError').focus(); }catch(e){ ; }
			AddEvent(document, 'keypress', escape);
			AddEvent($('aceptarError'), 'click', accept);
			AddEvent($('cerrarError'), 'click', accept);
		}
		
		this.hide = function(){
			RemEvent(document, 'keypress', escape);
			RemEvent($('aceptarError'), 'click', accept);
			RemEvent($('cerrarError'), 'click', accept);
			var l = $('capaError');
			l.style.visibility = 'hidden';
			l.style.top = '-1000px';
		}
		
		this.onAccept = null;
		
		var accept = function(e){
			if(!!e){ StopEvent(e); }
			this.hide();
			if(!!this.onAccept){ this.onAccept(); }
		}.closure(this);
		var escape = function(event){
			if(event.keyCode == 27){ accept(); }
		}.closure(this);
		
		//
	}
/**********************************************************************
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright (c) 2001 Robert Penner
JavaScript version copyright (C) 2006 by Philippe Maegerman
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
   * Neither the name of the author nor the names of contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*****************************************/
function Delegate() {}
Delegate.create = function (o, f) {
	var a = new Array() ;
	var l = arguments.length ;
	for(var i = 2 ; i < l ; i++) a[i - 2] = arguments[i] ;
	return function() {
		var aP = [].concat(arguments, a) ;
		f.apply(o, aP);
	}
}

Tween = function(obj, prop, func, begin, finish, duration, suffixe){
	this.init(obj, prop, func, begin, finish, duration, suffixe)
}
var t = Tween.prototype;

t.obj = new Object();
t.prop='';
t.func = function (t, b, c, d) { return c*t/d + b; };
t.begin = 0;
t.change = 0;
t.prevTime = 0;
t.prevPos = 0;
t.looping = false;
t._duration = 0;
t._time = 0;
t._pos = 0;
t._position = 0;
t._startTime = 0;
t._finish = 0;
t.name = '';
t.suffixe = '';
t._listeners = new Array();	
t.setTime = function(t){
	this.prevTime = this._time;
	if (t > this.getDuration()) {
		if (this.looping) {
			this.rewind (t - this._duration);
			this.update();
			this.broadcastMessage('onMotionLooped',{target:this,type:'onMotionLooped'});
		} else {
			this._time = this._duration;
			this.update();
			this.stop();
			this.broadcastMessage('onMotionFinished',{target:this,type:'onMotionFinished'});
		}
	} else if (t < 0) {
		this.rewind();
		this.update();
	} else {
		this._time = t;
		this.update();
	}
}
t.getTime = function(){
	return this._time;
}
t.setDuration = function(d){
	this._duration = (d == null || d <= 0) ? 100000 : d;
}
t.getDuration = function(){
	return this._duration;
}
t.setPosition = function(p){
	this.prevPos = this._pos;
	var a = this.suffixe != '' ? this.suffixe : '';
	this.obj[this.prop] = Math.round(p) + a;
	this._pos = p;
	this.broadcastMessage('onMotionChanged',{target:this,type:'onMotionChanged'});
}
t.getPosition = function(t){
	if (t == undefined) t = this._time;
	return this.func(t, this.begin, this.change, this._duration);
};
t.setFinish = function(f){
	this.change = f - this.begin;
};
t.geFinish = function(){
	return this.begin + this.change;
};
t.init = function(obj, prop, func, begin, finish, duration, suffixe){
	if (!arguments.length) return;
	this._listeners = new Array();
	this.addListener(this);
	if(suffixe) this.suffixe = suffixe;
	this.obj = obj;
	this.prop = prop;
	this.begin = begin;
	this._pos = begin;
	this.setDuration(duration);
	if (func!=null && func!='') {
		this.func = func;
	}
	this.setFinish(finish);
}
t.start = function(){
	this.rewind();
	this.startEnterFrame();
	this.broadcastMessage('onMotionStarted',{target:this,type:'onMotionStarted'});
	//alert('in');
}
t.rewind = function(t){
	this.stop();
	this._time = (t == undefined) ? 0 : t;
	this.fixTime();
	this.update();
}
t.fforward = function(){
	this._time = this._duration;
	this.fixTime();
	this.update();
}
t.update = function(){
	this.setPosition(this.getPosition(this._time));
	}
t.startEnterFrame = function(){
	this.stopEnterFrame();
	this.isPlaying = true;
	this.onEnterFrame();
}
t.onEnterFrame = function(){
	if(this.isPlaying) {
		this.nextFrame();
		setTimeout(Delegate.create(this, this.onEnterFrame), 0);
	}
}
t.nextFrame = function(){
	this.setTime((this.getTimer() - this._startTime) / 1000);
	}
t.stop = function(){
	this.stopEnterFrame();
	this.broadcastMessage('onMotionStopped',{target:this,type:'onMotionStopped'});
}
t.stopEnterFrame = function(){
	this.isPlaying = false;
}

t.continueTo = function(finish, duration){
	this.begin = this._pos;
	this.setFinish(finish);
	if (this._duration != undefined)
		this.setDuration(duration);
	this.start();
}
t.resume = function(){
	this.fixTime();
	this.startEnterFrame();
	this.broadcastMessage('onMotionResumed',{target:this,type:'onMotionResumed'});
}
t.yoyo = function (){
	this.continueTo(this.begin,this._time);
}

t.addListener = function(o){
	this.removeListener (o);
	return this._listeners.push(o);
}
t.removeListener = function(o){
	var a = this._listeners;	
	var i = a.length;
	while (i--) {
		if (a[i] == o) {
			a.splice (i, 1);
			return true;
		}
	}
	return false;
}
t.broadcastMessage = function(){
	var arr = new Array();
	for(var i = 0; i < arguments.length; i++){
		arr.push(arguments[i])
	}
	var e = arr.shift();
	var a = this._listeners;
	var l = a.length;
	for (var i=0; i<l; i++){
		if(a[i][e])
		a[i][e].apply(a[i], arr);
	}
}
t.fixTime = function(){
	this._startTime = this.getTimer() - this._time * 1000;
}
t.getTimer = function(){
	return new Date().getTime() - this._time;
}
Tween.backEaseIn = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*(t/=d)*t*((s+1)*t - s) + b;
}
Tween.backEaseOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
}
Tween.backEaseInOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158; 
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
Tween.elasticEaseIn = function(t,b,c,d,a,p){
		if (t==0) return b;  
		if ((t/=d)==1) return b+c;  
		if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) {
			a=c; var s=p/4;
		}
		else 
			var s = p/(2*Math.PI) * Math.asin (c/a);
		
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	
}
Tween.elasticEaseOut = function (t,b,c,d,a,p){
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
	}
Tween.elasticEaseInOut = function (t,b,c,d,a,p){
	if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) var p=d*(.3*1.5);
	if (!a || a < Math.abs(c)) {var a=c; var s=p/4; }
	else var s = p/(2*Math.PI) * Math.asin (c/a);
	if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
}

Tween.bounceEaseOut = function(t,b,c,d){
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
}
Tween.bounceEaseIn = function(t,b,c,d){
	return c - Tween.bounceEaseOut (d-t, 0, c, d) + b;
	}
Tween.bounceEaseInOut = function(t,b,c,d){
	if (t < d/2) return Tween.bounceEaseIn (t*2, 0, c, d) * .5 + b;
	else return Tween.bounceEaseOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}

Tween.regularEaseIn = function(t,b,c,d){
	return c*(t/=d)*t + b;
	}
Tween.regularEaseOut = function(t,b,c,d){
	return -c *(t/=d)*(t-2) + b;
	}

Tween.regularEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t + b;
	return -c/2 * ((--t)*(t-2) - 1) + b;
	}
Tween.strongEaseIn = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}
Tween.strongEaseOut = function(t,b,c,d){
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
	return c/2*((t-=2)*t*t*t*t + 2) + b;
	}	//
	fCookie = function(){ this.init(); }
	var p = fCookie.prototype;
	
	p.path = DIR_ROOT;
	
	p.init = function(){ }
	
	p.set = function(n, v){
		var d = new Date();
		d.setHours(d.getHours() + 1);
		//d.setSeconds(d.getSeconds() + 3);
		var t = d.toGMTString();
		document.cookie = n + '=' + escape(v) + '; expires=' + t + '; path=' + this.path + ';';
	}
	
	p.unset = function(n){
		document.cookie = n + '=; expires=Fri, 21 Dec 1976 04:31:24 GMT; path=' + this.path + ';';
	}
	
	p.get = function(n){
		var iIni = 0, iEnd = 0, ret = '';
		if (document.cookie.length > 0){
			var iIni = document.cookie.indexOf(n + '=');
			if (iIni != -1){ 
				iIni = iIni + n.length + 1; 
				iEnd = document.cookie.indexOf(";", iIni);
				if(iEnd == -1) iEnd = document.cookie.length;
				ret = unescape(document.cookie.substring(iIni, iEnd));
			}
		}
		return ret;
	}
	
	var Cookie = new fCookie();
// JavaScript Document
var Loader = new function(){
	//H
	this.hide = function(){
		if(loader)loader.style.display = 'none';
	}
	
	//I
	this.init = function(){
		loader = $('LoaderGeneral');
	}
	
	//S
	this.show = function(){
		if(!iniciado)this.init();
		loader.style.top = Math.round((HScreen()-loader.offsetHeight)/2+YPos())+'px';		
		loader.style.width = Math.round((WScreen()-loader.offsetWidth/2))+'px';
		loader.style.visibility = 'visible';
	}
	
	var loader = null;
	var iniciado = false;
}// JavaScript Document
var Blocker = new function(){
	//H
	this.hide = function(){
		if(blocker)blocker.style.display = 'none';
	}
	
	//I
	this.init = function(){
		blocker = $('BlockeadorGeneral');
		setOpacity(70,blocker);
	}
	
	//S
	this.show = function(){
		if(!iniciado)this.init();
		blocker.style.height = HBody()+'px';		
		blocker.style.width = WScreen()+'px';
		blocker.style.display = 'block';
	}
	
	var blocker = null;
	var iniciado = false;
}	
	var DIR_ROOT = '/';
	var DIR_FIX = '/';	
	
	var ER_STR = /^([^ \t\n\r]([ \t\n\r]|[^ \t\n\r])*[^ \t\n\r])+$|^[^ \t\n\r]$/ig;
	var ER_ALFA_NUM = /^[a-z0-9][a-z0-9]+[a-z0-9]$/ig;
	var ER_EMAIL = /^[a-z0-9_\.\-]+@[a-z0-9_\-]+(\.[a-z0-9_\-]{2,20})*\.[a-z]{2,4}$/ig;
	var ER_NATURAL_NOCERO = /^[1-9]+[0-9]*$/;
	var ER_FECHA = /^(([0][1-9])|([12][0-9])|(3[01]))(\/|-)((0[1-9])|(1[012]))(\/|-)([12][0-9]{3})$/;	
	
	/////
	var aSolActs = new Object;
	function cambiarSolapa(id, pos, on, off, event){
		if(!!aSolActs[id]){
			aSolActs[id]['tit'].className = off;
			aSolActs[id]['con'].style.display = 'none';
		}
		aSolActs[id] = new Object;
		aSolActs[id]['tit'] = $('titSolDeCont'+id+'Pos'+pos);
		aSolActs[id]['tit'].className = on;
		aSolActs[id]['con'] = $('conSolDeCont'+id+'Pos'+pos);
		aSolActs[id]['con'].style.display = 'block';
		
		if(event) StopEvent(event);
	}
	//
	function writeInElement(elem, tld, name, acc, inner){
		elem['href'] = 'mailto:' + acc + '@' + name + '.' + tld;
		if(inner){ elem['innerHTML'] = acc + '@' + name + '.' + tld; }
	}
	
	function getElementPos(ele){
		var p = ele.style.position;
		ele.style.position = 'relative';
		var x = ele.offsetLeft;
		var y = ele.offsetTop;
		ele.style.position = p;
		while(ele.tagName.toLowerCase() != 'body'){
			ele = ele.parentNode;
			if(ele.style.position == 'absolute'){
				x += ele.offsetLeft;
				y += ele.offsetTop;
			}
		}
		return {'x':x, 'y':y};
	}
	
	function setOpacity(opa, ele){
		if(!window.innerWidth){ ele.style.filter = 'alpha(opacity='+opa+')'; }
		else{ ele.style.opacity = (opa / 100); }
	}
	
	function strongEaseInOut(t,b,c,d){
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	}	
	
	//
	function WScreen(){ return (Nav.esIE)? document.documentElement.clientWidth : window.innerWidth; }
	function HScreen(){ return (Nav.esIE)? document.documentElement.clientHeight : window.innerHeight; }
	function YPos(){ return (Nav.esIE)? document.documentElement.scrollTop : window.pageYOffset; }
	function XPos(){ return (Nav.esIE)? document.documentElement.scrollLeft : window.pageXOffset; }
	function HBody(){ return document.documentElement.scrollHeight; }
	function WBody(){ return document.documentElement.scrollWidth; }
	
	function serialize( mixed_value ) {
		// http://kevin.vanzonneveld.net
		// +   original by: Arpad Ray (mailto:arpad@php.net)
		// +   improved by: Dino
		// +   bugfixed by: Andrej Pavlovic
		// +   bugfixed by: Garagoth
		// %          note: We feel the main purpose of this function should be to ease the transport of data between php & js
		// %          note: Aiming for PHP-compatibility, we have to translate objects to arrays
		// *     example 1: serialize(['Kevin', 'van', 'Zonneveld']);
		// *     returns 1: 'a:3:{i:0;s:5:"Kevin";i:1;s:3:"van";i:2;s:9:"Zonneveld";}'
		// *     example 2: serialize({firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'});
		// *     returns 2: 'a:3:{s:9:"firstName";s:5:"Kevin";s:7:"midName";s:3:"van";s:7:"surName";s:9:"Zonneveld";}'
	 
		var _getType = function( inp ) {
			var type = typeof inp, match;
			var key;
			if (type == 'object' && !inp) {
				return 'null';
			}
			if (type == "object") {
				if (!inp.constructor) {
					return 'object';
				}
				var cons = inp.constructor.toString();
				if (match = cons.match(/(\w+)\(/)) {
					cons = match[1].toLowerCase();
				}
				var types = ["boolean", "number", "string", "array"];
				for (key in types) {
					if (cons == types[key]) {
						type = types[key];
						break;
					}
				}
			}
			return type;
		};
		var type = _getType(mixed_value);
		var val, ktype = '';
		
		switch (type) {
			case "function": 
				val = ""; 
				break;
			case "undefined":
				val = "N";
				break;
			case "boolean":
				val = "b:" + (mixed_value ? "1" : "0");
				break;
			case "number":
				val = (Math.round(mixed_value) == mixed_value ? "i" : "d") + ":" + mixed_value;
				break;
			case "string":
				val = "s:" + mixed_value.length + ":\"" + mixed_value + "\"";
				break;
			case "array":
			case "object":
				val = "a";
				/*
				if (type == "object") {
					var objname = mixed_value.constructor.toString().match(/(\w+)\(\)/);
					if (objname == undefined) {
						return;
					}
					objname[1] = serialize(objname[1]);
					val = "O" + objname[1].substring(1, objname[1].length - 1);
				}
				*/
				var count = 0;
				var vals = "";
				var okey;
				var key;
				for (key in mixed_value) {
					ktype = _getType(mixed_value[key]);
					if (ktype == "function") { 
						continue; 
					}
					
					okey = (key.match(/^[0-9]+$/) ? parseInt(key) : key);
					vals += serialize(okey) +
							serialize(mixed_value[key]);
					count++;
				}
				val += ":" + count + ":{" + vals + "}";
				break;
		}
		if (type != "object" && type != "array") val += ";";
		return val;
	}
	function unserialize(data){
		// http://kevin.vanzonneveld.net
		// +     original by: Arpad Ray (mailto:arpad@php.net)
		// +     improved by: Pedro Tainha (http://www.pedrotainha.com)
		// +     bugfixed by: dptr1988
		// +      revised by: d3x
		// +     improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
		// %            note: We feel the main purpose of this function should be to ease the transport of data between php & js
		// %            note: Aiming for PHP-compatibility, we have to translate objects to arrays 
		// *       example 1: unserialize('a:3:{i:0;s:5:"Kevin";i:1;s:3:"van";i:2;s:9:"Zonneveld";}');
		// *       returns 1: ['Kevin', 'van', 'Zonneveld']
		// *       example 2: unserialize('a:3:{s:9:"firstName";s:5:"Kevin";s:7:"midName";s:3:"van";s:7:"surName";s:9:"Zonneveld";}');
		// *       returns 2: {firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'}
		
		var error = function (type, msg, filename, line){throw new window[type](msg, filename, line);};
		var read_until = function (data, offset, stopchr){
			var buf = [];
			var chr = data.slice(offset, offset + 1);
			var i = 2;
			while(chr != stopchr){
				if((i+offset) > data.length){
					error('Error', 'Invalid');
				}
				buf.push(chr);
				chr = data.slice(offset + (i - 1),offset + i);
				i += 1;
			}
			return [buf.length, buf.join('')];
		};
		var read_chrs = function (data, offset, length){
			buf = [];
			for(var i = 0;i < length;i++){
				var chr = data.slice(offset + (i - 1),offset + i);
				buf.push(chr);
			}
			return [buf.length, buf.join('')];
		};
		var _unserialize = function (data, offset){
			if(!offset) offset = 0;
			var buf = [];
			var dtype = (data.slice(offset, offset + 1)).toLowerCase();
			
			var dataoffset = offset + 2;
			var typeconvert = new Function('x', 'return x');
			var chrs = 0;
			var datalength = 0;
			
			switch(dtype){
				case "i":
					typeconvert = new Function('x', 'return parseInt(x)');
					var readData = read_until(data, dataoffset, ';');
					var chrs = readData[0];
					var readdata = readData[1];
					dataoffset += chrs + 1;
				break;
				case "b":
					typeconvert = new Function('x', 'return (parseInt(x) == 1)');
					var readData = read_until(data, dataoffset, ';');
					var chrs = readData[0];
					var readdata = readData[1];
					dataoffset += chrs + 1;
				break;
				case "d":
					typeconvert = new Function('x', 'return parseFloat(x)');
					var readData = read_until(data, dataoffset, ';');
					var chrs = readData[0];
					var readdata = readData[1];
					dataoffset += chrs + 1;
				break;
				case "n":
					readdata = null;
				break;
				case "s":
					var ccount = read_until(data, dataoffset, ':');
					var chrs = ccount[0];
					var stringlength = ccount[1];
					dataoffset += chrs + 2;
					
					var readData = read_chrs(data, dataoffset+1, parseInt(stringlength));
					var chrs = readData[0];
					var readdata = readData[1];
					dataoffset += chrs + 2;
					if(chrs != parseInt(stringlength) && chrs != readdata.length){
						error('SyntaxError', 'String length mismatch');
					}
				break;
				case "a":
					var readdata = {};
					
					var keyandchrs = read_until(data, dataoffset, ':');
					var chrs = keyandchrs[0];
					var keys = keyandchrs[1];
					dataoffset += chrs + 2;
					
					for(var i = 0;i < parseInt(keys);i++){
						var kprops = _unserialize(data, dataoffset);
						var kchrs = kprops[1];
						var key = kprops[2];
						dataoffset += kchrs;
						
						var vprops = _unserialize(data, dataoffset);
						var vchrs = vprops[1];
						var value = vprops[2];
						dataoffset += vchrs;
						
						readdata[key] = value;
					}
					
					dataoffset += 1;
				break;
				default:
					error('SyntaxError', 'Unknown / Unhandled data type(s): ' + dtype);
				break;
			}
			return [dtype, dataoffset - offset, typeconvert(readdata)];
		};
		return _unserialize(data, 0)[2];
	}
	
	var objSubMenu = {}, intSubMenu = false;
	var lvlSubMenu = 0;
	var animSubMenu = false;
	function showSubMenu (evt, id, lvl, skip) {
		if (evt) { StopEvent(evt); }
		
		if (animSubMenu) {
			animSubMenu.stop();
			animSubMenu.onMotionFinished();
		}
		
		if (intSubMenu) {
			window.clearTimeout(intSubMenu);
			intSubMenu = false;
		}
		
		//
		if (!skip && !!objSubMenu[lvl]) {
			
			// Ocultamos los submenus internos
			var uls = $(objSubMenu[lvl]).getElementsByTagName('ul');
			for(var i = 0, t = uls.length; i < t; i++) {
				uls[i].style.height = '0';
				uls[i].style.overflow = 'hidden';
			}
			
			// Ocultamos el menu
			//showSubMenu(false, objSubMenu[lvl], lvl, true);
			
			// Borramos la referencia a los subs
			for (i = lvl; i <= lvlSubMenu; i++) {
				uls = $(objSubMenu[i])
				uls.parentNode.className = '';
				uls.style.height = '0';
				uls.style.overflow = 'hidden';
				delete (objSubMenu[i]);
			}
		}
		
		//
		if (id != '') {
			
			var menu = $(id), opa = 0;
			var from = 0, to = menu.scrollHeight;
			
			// Guardamos el nivel maximo alcanzado
			if (lvlSubMenu < lvl) { lvlSubMenu = lvl; }
			
			// Si vamos a cerrar
			if (menu.offsetHeight != 0){
				from = menu.offsetHeight;
				to = 0;
				menu.style.overflow = 'hidden';
				if (lvl > 0) { menu.parentNode.className = ''; }
			}
			else {
				objSubMenu[lvl] = id;
				if (lvl > 0) { menu.parentNode.className = 'onS'; }
			}
			
			animSubMenu = new Tween(menu.style, 'height', Tween.strongEaseOut, from, to, 0.5, 'px');
			animSubMenu.onMotionChanged = function(args){
				if (from == 0) { opa = (args.target._pos / to * 100).toFixed(0); }
				else { opa = (args.target._pos / from * 100).toFixed(0); }
				setOpacity(opa, menu);
			}
			animSubMenu.onMotionFinished = function(){
				if (from == 0) {
					menu.style.overflow = 'visible';
					if(Nav.esIE){
						menu.style.filter = '';
					}
				}
				animSubMenu = false;
			}
			animSubMenu.start();
		}
	}
	
	AddEvent(window, 'load', function(){
		AddEvent(document, 'click', function(){
			intSubMenu = window.setTimeout(function(){ showSubMenu(false, '', 0, false); }, 10);
		});
	});
	
	function verSubMenu(menu,nivel,display,e){
		if(menu){
			menu.style.display = display;
			menu.style.marginTop = '-1px';
			if(display == 'block'){
				menu.widthTemp = menu.offsetWidth;
				if(nivel > 0){
					menu.parentNode.parentNode.style.display = 'block';
					menu.parentNode.style.display = 'block';
					menu.style.display = 'block';
					if(WBody() >  menu.parentNode.parentNode.offsetLeft + menu.offsetWidth + (nivel*menu.offsetWidth)){
						menu.style.marginLeft = menu.offsetWidth+'px';
	
					}	
					else{
	
						menu.style.marginLeft = (-menu.offsetWidth-2) + 'px';
					}
					menu.style.marginTop = (-menu.parentNode.childNodes[1].offsetHeight)+'px';
				}
			 }
		 }
	}
	function verSubMenuArbol(menu,nivel,display,e){
		if(menu){
			if(!display)display = 'none';
			menu.style.display = display;
			if(display == 'block'){
				menu.widthTemp = menu.offsetWidth;
				if(nivel > 0){
					menu.parentNode.parentNode.style.display = 'inline';
					menu.parentNode.style.display = 'inline';
					menu.style.marginLeft = (menu.offsetWidth-2)+'px';					
					if(!Nav.esIE)menu.style.marginTop = (-menu.parentNode.childNodes[1].offsetHeight-1)+'px';
					else menu.style.marginTop = (-menu.parentNode.childNodes[0].offsetHeight-1)+'px';
				}
			 }
		 }
	}
	
	var INTERVAL_ARBOL = 0;
	var arbolAnterior = null;
	function verMenuArbolPrincipal(obj,display){
		if(display == 'inline'){
			clearInterval(INTERVAL_ARBOL);		
			obj.style.marginLeft = '-10px';
			if(arbolAnterior && arbolAnterior.id != obj.id)arbolAnterior.style.display = 'none';
		}
		arbolAnterior = obj;
		obj.style.display = display;
	}
	
	function ocultarArbolPrincipal(){
		clearInterval(INTERVAL_ARBOL);
		INTERVAL_ARBOL = setTimeout(function(){
			if(arbolAnterior){
				verMenuArbolPrincipal(arbolAnterior,'none');
			}
		},500);
	}	
	
	
