Element.implement({
	toogle: function() {
		if (this.type == 'checkbox' || this.type == 'radio') { // Sanity check
			if (this.checked == true) {
				this.checked = false;
			} else {
				this.checked = true;
			}
		} else if (this.type == 'select') {
			if (this.selected == true) {
				this.selected = false;
			} else {
				this.selected = true;
			}
		}
	},
	hilight: function(inc) {
		if (this.get('tag') == 'img') { // Sanity check
			var bh = this.getHeight();
			var bw = this.getWidth();
			var bp = this.getPosition();
			var el = this;
			this.addEvent('mouseover', function(e) {
				e.stop();
				el.setProperties({'position': 'relative', 'top': bp.x - (inc * 2), 'left': bp.y - (inc * 2)});
				el.setStyles({'height': bh + inc, 'width': bw + inc});
			});
			this.addEvent('mouseout', function(e) {
				e.stop();
				el.setProperties({'top': bp.x, 'left': bp.y});
				el.setStyles({'height': bh, 'width': bw});
			});
		}
	},
	fix: function() {
		if (!window.ie6) {
			return this;
		}
		var img;
		if (this.type == 'img') {
			img = "'" + this.get('src') + "'";
			this.set('src', 'null.gif');
		} else {
			var bg = this.getStyle('background-image');
			if (bg && bg!='none') {
				img = bg.match(/\(([^)]+)\)/)[1];
			}
		}
		if (img) {
			if (this.getStyle('display')=='inline' && !['input', 'textarea', 'button'].contains($type(this))) {
				this.setStyles({'display': 'block', 'width': this.getStyle('width')});
			}
			this.setStyles({'background': '', 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', src=" + img + ", sizingMethod='scale')"});
		}
		return this;
	}
});
/*
Function ShowLoading()
	Function to Show the Loading GIF like all the AJAX appz...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 09/12/08 common.js AIO Ver 1.6.0
*/
var	fjsShowLoading = function(cico) {
	if (!$defined($('loadingimg'))) {
		var isize = (cico.substr(0, 4) == 'load' ? 32 : (cico.substr(0, 5) == 'ajaxs' ? 16 : 32));
		var loadingimg = new Element('img', {'alt': C_LANG_POR_FAVOR_ESPERE + '...', 'id': 'loadingimg', 'height': isize, 'src': '/img/' + cico + '.gif', 'title': C_LANG_POR_FAVOR_ESPERE + '...', 'width': isize}).inject($(document.body)).addEvent('click', fjsKillLoading);
		loadingimg = $(loadingimg);
		var icoh = loadingimg.getHeight();
		var icow = loadingimg.getWidth();
		var itop = (window.getScrollTop() + ($(document.body).getHeight() / 2)) - (icoh / 2);
		var ileft = (window.getScrollLeft() + ($(document.body).getWidth() / 2)) - (icow / 2);
		loadingimg.setStyles({'height': icoh, 'hspace': 0, 'left': ileft, 'position': 'absolute', 'top': itop, 'vspace': 0, 'width': icow});
	} else {
		$('loadingimg').setStyle('visibility', 'visible');
	}
};
/*
Function KillLoading()
	Function to Hide the Loading GIF like all the AJAX appz...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 09/12/08 common.js AIO Ver 1.6.0
*/
var fjsKillLoading = function() {
	if ($defined($('loadingimg'))) {
		$('loadingimg').removeEvents();
		$('loadingimg').setStyle('visibility', 'hidden');
	}
};
/*
Function GetAppropiateValues()
	Function to get window parameters aprop.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 03/08/09 common.js AIO Ver 1.6.4
*/
function fjsGetAppropiateValues(w) {
	var jsw = 0;
	var jsh = 0;
	if (typeof(screen) == 'object') {
		jsw = screen.width;
		jsh = screen.height;
	} else {
		jsw = window.getWidth();
		jsh = window.getHeight();
	}
	var iss = jsw * jsh;
	var iwsinc = (jsw > 0 ? jsw / jsh : 0).round();
	var ifsinc = (iss > 0 ? iss / 480000 : 0).round() - (iss <= 838656 ? 1 : 0) ;
	var icos = 16;
	var phpwm = (C_DEFAULT_WIDTH_BABOR.toInt() + iwsinc).round();
	var phpwe = (C_DEFAULT_WIDTH_ESTRIBOR.toInt() == 0 ? 0 : phpwm);
	var phpwc = (C_DEFAULT_WIDTH_ESTRIBOR.toInt() == 0 ? ((100 - C_DEFAULT_WIDTH_CUBIERTA.toInt()) == phpwm ? C_DEFAULT_WIDTH_CUBIERTA.toInt() : 100 - phpwm) : ((100 - C_DEFAULT_WIDTH_CUBIERTA.toInt()) == (phpwm + phpwe) ? C_DEFAULT_WIDTH_CUBIERTA.toInt() : 100 - phpwm - phpwe));
	var phpmh = (C_DEFAULT_MIN_HEIGHT.toInt() * iwsinc).round();
	var r;
	if (iss > 1920000) { // up to 2048x1280 (Only one user) and up.
		icos = 48;
	} else if (iss > 1310720 && iss <= 1920000) { // to 1600x1200
		icos = 32;
	} else if (iss > 838656 && iss <= 1310720) { // to 1280x1024
		icos = 24;
	} else if (iss <= 838656) { // 800x600 up to 1024x768
		icos = 16;
	} else {
		icos = 16;
	}
	if (w == 1) {
		r = phpwm;
	} else if (w == 2) {
		r = phpwc;
	} else if (w == 3) {
		r = phpwe;
	} else if (w == 4) {
		r = icos;
	} else if (w == 5) {
		r = phpmh;
	} else if (w == 6) {
		r = ifsinc;
	} else if (w == 7) {
		r = iwsinc;
	} else {
		r = icos;
	}
	return (r);
}
/*
Function UpdateDisplayParams()
	Function to setup window parameters aprop.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 03/06/09 common.js AIO Ver 1.6.3
*/
function fjsUpdateDisplayParams(title, itsys, itlang) {
//	document.domain = C_DOMAIN; // Produces FCKeditor not loaded err! Also NOT set C_COOKIE_SECURE
	window.defaultStatus = title;
	window.status = title;
	var widthbabor = fjsGetAppropiateValues(1);
	var widthcubierta = fjsGetAppropiateValues(2);
	var widthestribor = fjsGetAppropiateValues(3);
	var icosize = fjsGetAppropiateValues(4);
	var minheight = fjsGetAppropiateValues(5);
	var fsinc = fjsGetAppropiateValues(6);
	var wsinc = fjsGetAppropiateValues(7);
	var jlb = (navigator.appName == 'Netscape' ? navigator.language : navigator.userLanguage).toLowerCase();
	var jsl = (navigator.appName == 'Netscape' ? 0 : navigator.systemLanguage);
	var jul = itlang;
	widthbabor = widthbabor.toString() + "%";
	widthcubierta = widthcubierta.toString() + "%";
	widthestribor = widthestribor.toString() + "%";
	icosize = icosize.toString() + "x" + icosize.toString();
	minheight = minheight.toString() + "px";
	/* $$('body', 'form', 'input', 'textarea', 'select', 'option', 'a', 'table', 'thead', 'tfoot', 'tbody', 'tr', 'th', 'td', 'div', 'span', 'pre', 'p', 'strong', 'br', 'hr', 'ul', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6').each(function(e) {
		var ofs = e.getStyle('fontSize');
		var fs = ofs.substr(0, (ofs.length > 3 ? 2 : 1)).toInt();
		var sfs = (fs >= 6 ? fs : 11);
		var nfs = (sfs + fsinc).round().toString() + "px";
		e.setStyle('fontSize', nfs);
		e.setStyle('visibility', 'visible');
	});
	$$('input', 'textarea', 'select').each(function(e) {
		var os = e.getStyle('size');
		var ns = ((typeof(os) == 'undefined' ? 16 : os.toInt()) + wsinc).round();
		e.setStyle('size', ns);
		e.setStyle('visibility', 'visible');
	}); */
	if (Boolean(navigator.cookieEnabled) == true) {
		var bochng = false;
		var ojsonAIODisplayParams = new Hash.Cookie('cjsonAIODisplayParams', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_REMEMBER_JS, secure: false});
		ojsonAIODisplayParams.load();
		if (Boolean(ojsonAIODisplayParams.getLength()) == false) {
			ojsonAIODisplayParams.empty();
			ojsonAIODisplayParams = new Hash.Cookie('cjsonAIODisplayParams', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_REMEMBER_JS, secure: false});
			ojsonAIODisplayParams.extend({
				'browserlang': jlb,
				'systemlang': jsl,
				'userlang': jul,
				'widthbabor': widthbabor,
				'widthcubierta': widthcubierta,
				'widthestribor': widthestribor,
				'minheight': minheight,
				'icosize': icosize,
				'fsincrement': fsinc,
				'wsincrement': wsinc
			});
			bochng = true;
		} else {
			if (ojsonAIODisplayParams.get('browserlang') != jlb) {
				ojsonAIODisplayParams.set('browserlang', jlb);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('systemlang') != jsl) {
				ojsonAIODisplayParams.set('systemlang', jsl);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('userlang') != jul) {
				ojsonAIODisplayParams.set('userlang', jul);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('widthbabor') != widthbabor) {
				if (itsys == 1) {
					$('tdbabor').setStyle('width', widthbabor);
				}
				ojsonAIODisplayParams.set('widthbabor', widthbabor);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('widthcubierta') != widthcubierta) {
				if (itsys == 1) {
					$('tdcubierta').setStyle('width', widthcubierta);
				}
				ojsonAIODisplayParams.set('widthcubierta', widthcubierta);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('widthestribor') != widthestribor) {
				if (itsys == 1) {
					$('tdestribor').setStyle('width', widthestribor);
				}
				ojsonAIODisplayParams.set('widthestribor', widthestribor);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('icosize') != icosize) {
				ojsonAIODisplayParams.set('icosize', icosize);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('minheight') != minheight) {
				if (itsys == 1) {
					$('trsuperestructura').setStyle('min-height', minheight); 
				}
				ojsonAIODisplayParams.set('minheight', minheight);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('fsincrement') != fsinc) {
				ojsonAIODisplayParams.set('fsincrement', fsinc);
				bochng = true;
			}
			if (ojsonAIODisplayParams.get('wsincrement') != wsinc) {
				ojsonAIODisplayParams.set('wsincrement', wsinc);
				bochng = true;
			}
		}
		return (bochng == true ? ojsonAIODisplayParams.save() : true);
	} else {
		$('ixaiocriticalwarning').set('html', '<table class="cxaiocriticalwarning"><tr><td>' + C_LANG_JS_ALERT_COOKIES + '</td></tr></table>');
		return false;
	}
}
/*
Function AIOFixPNG()
	Function to fix some IE < 6 transparency PNG issues. New and Improved.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 08/11/08 Last Modify: 09/11/08 common.js AIO Ver 1.6.0
*/
var fjsAIOFixPNG = function() {
	if (Browser.Engine.trident) {
		var av = navigator.appVersion.split("MSIE");
		var v = parseFloat(av[1]);
		if (v < 7) {
			var clear = "/img/clear.gif" // path to clear.gif
			var els = document.getElementsByTagName('*');
			var ip = /\.png/i;
			var i = els.length;
			while (i-- > 0) {
				var el = els[i];
				var es = el.style;
				if (el.src && el.src.match(ip) && !es.filter) {
					es.height = el.height;
					es.width = el.width;
					es.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + el.src + "',sizingMethod='crop')";
					el.src = clear;
				} else {
					var elb = el.currentStyle.backgroundImage;
					if (elb.match(ip)) {
						var path = elb.split('"');
						var rep = (el.currentStyle.backgroundRepeat == 'no-repeat') ? 'crop' : 'scale';
						es.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + path[1] + "',sizingMethod='" + rep + "')";
						es.height = el.clientHeight + 'px';
						es.backgroundImage = 'none';
						var elkids = el.getElementsByTagName('*');
						if (elkids) {
							var j = elkids.length;
							if (el.currentStyle.position != "absolute") {
								es.position = 'static';
							}
							while (j-- > 0) {
								if (!elkids[j].style.position) {
									elkids[j].style.position = "relative";
								}
							}
						}
					}
				}
			}
		}
	}
}
/*
Function LogonChecker()
	Function that just check for empty values on login submit.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 17/12/08 Last Modify: 17/12/08 common.js AIO Ver 1.6.0
*/
var fjsLogonChecker = function(f) {
	var bOk = true;
	with ($(f)) {
		var cmsg = C_LANG_DATOS_REQUERIDOS + ":\n\n";
		if (cusr.value == "") {
			cmsg = cmsg + '* ' + C_LANG_NOMBRE_DE_USUARIO + "\n\n";
			bOk = false;
		}
		if (cpass.value == "") {
			cmsg = cmsg + '* ' + C_LANG_CONTRASENA + "\n\n";
			bOk = false;
		}
		if (bOk == true) {
			submit();
			return true;
		} else {
			alert(cmsg);
			return false;
		}
	}
}
/*
Function NoEnter()
	Function that just check for char 13.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 17/12/08 Last Modify: 03/06/09 common.js AIO Ver 1.6.3
*/
function fjsNoEnter() {
	return !(window.event && window.event.keyCode == 13); 
}
/*
Function ShowLoadingRelative()
	Function to Show the Loading GIF like all the AJAX appz... But, inside a container.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 29/05/09 Last Modify: 29/05/09 common.js AIO Ver 1.6.3
*/
var	fjsShowLoadingRelative = function(cico, cont) {
	if (!$defined($('loadingrelativeimg'))) {
		cont = $(cont);
		var isize = (cico.substr(0, 4) == 'load' ? 32 : (cico.substr(0, 5) == 'ajaxs' ? 16 : 32));
		var loadingrelativeimg = new Element('img', {'alt': C_LANG_POR_FAVOR_ESPERE + '...', 'id': 'loadingrelativeimg', 'height': isize, 'src': '/img/' + cico + '.gif', 'title': C_LANG_POR_FAVOR_ESPERE + '...', 'width': isize}).inject(cont).addEvent('click', fjsKillLoadingRelative);
		loadingrelativeimg = $(loadingrelativeimg);
		var icoh = loadingrelativeimg.getHeight();
		var icow = loadingrelativeimg.getWidth();
		var itop = ((cont.getHeight() / 2)) - (icoh / 2);
		var ileft = ((cont.getWidth() / 2)) - (icow / 2);
		loadingrelativeimg.setStyles({'height': icoh, 'hspace': 0, 'left': ileft, 'position': 'absolute', 'top': itop, 'vspace': 0, 'width': icow}).hilight();
	}
};
/*
Function KillLoadingRelative()
	Function to Hide the Loading GIF like all the AJAX appz... But, inside a container.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 29/05/09 Last Modify: 29/05/09 common.js AIO Ver 1.6.3
*/
var fjsKillLoadingRelative = function() {
	if ($defined($('loadingrelativeimg'))) {
		$('loadingrelativeimg').removeEvents();
		$('loadingrelativeimg').destroy();
	}
};
/*
Function fjsDebug()
	Function to debug AIO JS Modules.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 03/04/09 Last Modify: 03/04/09 common.js AIO Ver 1.6.1
*/
var fjsDebug = function(s, a) {
	if (C_REMOTE_IP === C_FIREFIGHTER_IP && C_MODE_DEBUG == 'on' && $defined($('ijsdebug'))) {
		if (a == 1) {
			s = $('ijsdebug').get('text') + ' / ' + s;
		}
		$('ijsdebug').set('text', s);
		return true;
	} else {
		return true;
	}
}
/*
Function fjsGetModule()
	Function to get HTML from an AIO module.
	Accepts a another function as parameter to prcocess it...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 20/12/08 Last Modify: 20/12/08 common.js AIO Ver 1.6.2
*/
var fjsGetModule = function(u, m, fn, d) {
	var req = new Request.HTML({
		url: C_WEB_URL + '?cmod=' + u,
		method: m, // "post" or "get"
		secure: true,
		data: d,
		link: 'ignore', // either "cancel" or "chain"
		async: true,
		encoding: C_DEFAULT_CHARSET,
		// headers: '';
		// isSuccess: func() 
		evalScripts: true,
		evalResponse: false,
		emulation: false,
		urlEncoded: true,
		onComplete: function(responseTree, responseElements, responseHTML, responseJavaScript) {
			fn(responseTree, responseElements, responseHTML, responseJavaScript);
		}
	}).send();
}
/*
Function fjsOpenModule()
	Function to get HTML from an AIO module.
	Accepts a another function as parameter to prcocess it...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 20/12/08 Last Modify: 20/12/08 common.js AIO Ver 1.6.2
*/
var fjsOpenModule = function(container, cmod) {
	fjsShowLoading('loading');
	var fjsSetHTML = function(responseTree, responseElements, responseHTML, responseJavaScript) {
		// console.debug(responseTree);
		// console.debug(responseElements);
		// console.debug(responseHTML);
		// console.debug(responseJavaScript);
		// console.debug(ccmod);
		$(container).set('html', responseHTML);
		fjsKillLoading();
	}
	fjsGetModule(cmod, 'post', fjsSetHTML, {'cAIOcbFlashAuth': fjsSendCookieBasedAuth()});
}
/*
Function fjsSetOpenModuleImage()
	Function to get an IMG from an AIO module.
	Accepts a another function as parameter to prcocess it...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 03/07/09 Last Modify: 03/07/09 common.js AIO Ver 1.6.4
*/
var fjsReloadModuleImage = function(v, k) {
	alert(v + ' ' + k + ' ' + fjsCrypt(v, k) + ' ' + fjsDecrypt(v, k));
}
var fjsReloadModuleImage2 = function(container, cmod) {
	fjsSLoading('loading');
	var s = '';
	alert(C_LANG_INDICE + ' ');
	$(container).set('src', cmod + '&' + $random(0, 65535));
	fjsKillLoading();
}
/*
Function fjsReceiveCookieBasedAuth()
	Function to receive Cookie Based authentication on AJAX requests.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 18/12/08 Last Modify: 18/12/08 common.js AIO Ver 1.6.0
*/
var fjsReceiveCookieBasedAuth = function(ajson) {
	var cAIOcbFlashAuth = Cookie.read("cAIOcbFlashAuth");
	Cookie.dispose("cAIOcbFlashAuth");
	var cAIOcbFlashAuthRet = ajson[0].cAIOcbFlashAuth;
	// alert('OPT leido: ' + cAIOcbFlashAuth + ' OTP recibido: ' + cAIOcbFlashAuthRet);
	if (cAIOcbFlashAuth === cAIOcbFlashAuthRet) {
		cAIOcbFlashAuth = cAIOcbFlashAuthRet = ""; // Insane sanity checks
		return true;
	} else {
		cAIOcbFlashAuth = cAIOcbFlashAuthRet = ""; // Insane sanity checks
		return false;
	}
}
/*
Function fjsSendCookieBasedAuth()
	Function to send Cookie Based authentication on AJAX requests.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 18/12/08 Last Modify: 18/12/08 common.js AIO Ver 1.6.0
*/
var fjsSendCookieBasedAuth = function() {
	var cAIOotp = Cookie.read("cAIOotp");
	var cAIOcbFlashAuth = Cookie.write("cAIOcbFlashAuth", cAIOotp, {domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_DEFAULT_JS, secure: false});
	// alert('OPT readed: ' + cAIOotp + ' OPT readed (just written): "' + Cookie.read("cAIOcbFlashAuth") + '" Returned value from Cookie.write(): "' + $type(cAIOcbFlashAuth) + '" (inmediatly erased)');
	cAIOcbFlashAuth = ""; // Insane sanity checks
	return cAIOotp;
}
var GenericPopup = new Class({
	initialize: function(relative, height, width) {
		if ($defined($('icontainer'))) {
			var icontainer = $('icontainer');
			return icontainer;
		} else {
			relative = (typeof(relative) == 'string' && relative.length > 0 ? relative : 'ixaiocriticalwarning');
			var icosize = fjsGetAppropiateValues(4);
			var opos = $(relative).getPosition();
			var osize = window.getSize();
			var oscroll = window.getScroll();
			var oscrollsize = window.getScrollSize();
			var left = (opos.x - (width / 2)).round();
			if (left < 1) {
				left = 1;
			}
			if ((left + width) > osize.x) {
				left = osize.x - width;
			}
			var top = (opos.y).round();
			if (top < 1) {
				top = 1;
			}
			if ((top + height) > osize.y) {
				top = osize.y - height;
			}
			var jpopup = new Element('div', {'class': 'cxaiodivpopup', 'id': 'jpopup', 'name': 'jpopup'}).inject(document.body);
			jpopup.setStyles({'cursor': 'move', 'height': height, 'left': left, 'position': 'absolute', 'text-align': 'center', 'top': top, 'visibility': 'visible', 'width': width, 'vertical-align': 'middle', '-webkit-border-radius': '16px', '-moz-border-radius': '16px', 'opacity': '0'});
			var closebutton = new Element('div', {'alt': C_LANG_CERRAR_VENTANA, 'id': 'close', 'title': C_LANG_CERRAR_VENTANA}).inject(jpopup);
			closebutton.setStyles({'cursor': 'pointer', 'height': 32, 'left': width - 48, 'position': 'absolute', 'text-align': 'right', 'top': 15, 'vertical-align': 'top', 'width': 32});
			closebutton.addEvent('click', function(e) {
				e.stop();
				jpopup.fade('out');
				// jpopup.destroy();
			});
			var closebutton = new Element('div', {'alt': C_LANG_CERRAR_VENTANA, 'id': 'close', 'title': C_LANG_CERRAR_VENTANA}).inject(jpopup);
			var icontainer = new Element('div', {'alt': 'Obtenga 7 d\u00edas gratis en Estimarte PRO (click para m\u00e1s info)', 'id': 'icontainer', 'title': 'Obtenga 7 d\u00edas gratis en Estimarte PRO (click para m\u00e1s info)'}).inject(jpopup);
			icontainer.setStyles({'cursor': 'default', 'height': 253, 'left': 0, 'position': 'absolute', 'text-align': 'center', 'top': 47, 'width': width, 'vertical-align': 'middle'});
			icontainer.addEvent('click', function(e) {
				e.stop();
				jpopup.fade('out');
				window.location.replace(C_WEB_URL + '?cmod=poll&popup=1');
			});
			var ilink = new Element('div', {'alt': 'Recibir m\u00e1s informaci\u00f3n', 'id': 'ilink', 'title': 'Recibir m\u00e1s informaci\u00f3n'}).inject(jpopup);
			ilink.setStyles({'cursor': 'pointer', 'height': 32, 'left': 0, 'position': 'absolute', 'text-align': 'center', 'top': 212, 'width': width - 90, 'vertical-align': 'middle'});
			ilink.addEvent('click', function(e) {
				e.stop();
				jpopup.fade('out');
				window.location.replace(C_WEB_URL + '?cmod=poll&popup=2');
			});
			var iremove = new Element('div', {'alt': 'No volver a recordarme sobre esta promoci\u00f3n', 'id': 'iremove', 'title': 'No volver a recordarme sobre esta promoci\u00f3n'}).inject(jpopup);
			iremove.setStyles({'cursor': 'pointer', 'height': 32, 'left': 90, 'position': 'absolute', 'text-align': 'center', 'top': 263, 'width': width - 90, 'vertical-align': 'middle'});
			iremove.addEvent('click', function(e) {
				e.stop();
				jpopup.fade('out');
				window.location.replace(C_WEB_URL + '?cmod=poll&nofurtherquestionsyourhonor');
			});
			drag = new Drag.Move($(jpopup), {});
			jpopup.fade('in');
			return icontainer;
		}
	}
});
	
var fjsDrawGenericPopup = function(relative, height, width) {
	var icosize = fjsGetAppropiateValues(4);
	var opos = $(relative).getPosition();
	var osize = window.getSize();
	var oscroll = window.getScroll();
	var oscrollsize = window.getScrollSize();
	var left = (opos.x - (width / 2)).round();
	if (left < 1) {
		left = 1;
	}
	if ((left + width) > osize.x) {
		left = osize.x - width;
	}
	var top = (opos.y - (height / 2)).round();
	if (top < 1) {
		top = 1;
	}
	if ((top + height) > osize.y) {
		top = osize.y - height;
	}
	// fjsDebug('$(relative).getPosition(); X: ' + opos.x + ' Y: ' + opos.y + '\nwindow.getSize(); X: ' + osize.x + ' Y: ' + osize.y + '\nwindow.getScroll(); X: ' + oscroll.x + ' Y: ' + oscroll.y + '\nwindow.getScrollSize(); X: ' + oscrollsize.x + ' Y: ' + oscrollsize.y + '\nSo Left: ' + left + ' and Right: ' + top);
	var jpopup = new Element('div', {'class': 'cxaiodiv', 'id': 'jpopup', 'name': 'jpopup'}).inject(document.body);
	jpopup.setStyles({'background-color': '#FFFFFF', 'border': '12px solid #EFEFEF', 'cursor': 'move', 'height': height, 'left': left, 'position': 'absolute', 'text-align': 'center', 'top': top, 'visibility': 'visible', 'width': width, 'vertical-align': 'middle', '-webkit-border-radius': '16px', '-moz-border-radius': '16px'});
	var legend = new Element('div', {'id': 'legend', 'title': C_LANG_MOVER_VENTANA}).inject(jpopup);
	legend.setStyles({'cursor': 'move', 'font-weight': 'bolder', 'left': 4, 'position': 'absolute', 'text-align': 'left', 'top': 0, 'vertical-align': 'middle'});
	var closebutton = new Element('img', {'alt': C_LANG_CERRAR_VENTANA, 'id': 'close', 'src': C_ICO_PATH + C_ICO_CERRAR_VENTANA, 'title': C_LANG_CERRAR_VENTANA}).inject(jpopup);
	closebutton.setStyles({'cursor': 'pointer', 'left': width - icosize, 'position': 'absolute', 'text-align': 'right', 'top': 0, 'vertical-align': 'top'});
	closebutton.addEvent('click', function(e) {
		e.stop();
		jpopup.destroy();
	});
	var icontainer = new Element('div', {'id': 'icontainer'}).inject(jpopup);
	icontainer.setStyles({'cursor': 'default', 'height': height - 84, 'left': 10, 'position': 'absolute', 'text-align': 'center', 'top': 32, 'width': width - 20, 'vertical-align': 'middle', '-webkit-border-radius': '16px', '-moz-border-radius': '16px'});
	drag = new Drag.Move($(jpopup), {});
	return icontainer;
};
/*
Function fjsJeantify()
	Function that checks, unchecks or toggles a series of input checks ala Jean Sanchez.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 16/12/08 Last Modify: 13/01/10 common.js AIO Ver 1.6.4
*/
var fjsJeantify = function(e, isOnload) {
	if ((e.name == 'cchkall') && (e.type == 'checkbox')) { // Sanity check
		var f = e.form;
		var el = $(e);
		if (el.checked == true) {
			el.store('tip:title', C_LANG_BOTON_IZQUIERDO_DESELECCIONAR_TODO);
			el.store('tip:text', C_LANG_BOTON_DERECHO_CAMBIAR_ESTADO);
		} else {
			el.store('tip:title', C_LANG_BOTON_IZQUIERDO_SELECCIONAR_TODO);
			el.store('tip:text', C_LANG_BOTON_DERECHO_CAMBIAR_ESTADO);
		}
		el.removeEvents('mousedown');
		el.addEvent('mousedown', function(e) {
			e.stop();
			if (e.rightClick) {
				$(f).getElements('input[name^=cchk_]').each(function(elem) {
					elem.toogle();
				});
			} else {
				if (isOnload != 1) {
					el.toogle();
					var stat = el.checked;
					$(f).getElements('input[name^=cchk_]').each(function(elem) {
						elem.checked = stat;												 
					});
					el.toogle();
				}
			}
		});
	} else if (e.type == 'checkbox') { // Sanity check
		var el = $(e);
		var ctit = el.get('alt');
		if (el.checked == true) {
			el.store('tip:title', (ctit != '' ? C_LANG_DESELECCIONAR + ' ' + ctit : C_LANG_DESELECCIONAR_FILA));
		} else {
			el.store('tip:title', (ctit != '' ? C_LANG_SELECCIONAR + ' ' + ctit : C_LANG_SELECCIONAR_FILA));
		}
	}
}
/*
Function fjsPShowIcon()
	Function to to show icons.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 11/12/08 Last Modify: 14/01/2010 common.js AIO Ver 1.6.4
*/
var fjsPShowIcon = function(cico, calt, itsys, id, csss, container, js) {
	itsys = ($defined(itsys) && itsys > 0 ? itsys : C_SYS);
	id = ($defined(id) && id.length > 0 ? id : '');
	csss = ($defined(csss) && csss.length > 0 ? csss : C_CLASS_ICONS);
	var cfile = C_ICO_PATH + cico;
	if (js != '') {
		var newimg = new Asset.image(cfile, {'alt': calt, 'class': csss, 'id': (id != '' ? cico + '_' + id : cico + '_' + $random(65535, 65536)), 'title': calt}).inject($(container)).setStyle('cursor', 'pointer').addEvent('click', js).store('tip:title', calt);
	} else {
		var newimg = new Asset.image(cfile, {'alt': calt, 'class': csss, 'id': (id != '' ? cico + '_' + id : cico + '_' + $random(65535, 65536)), 'title': calt}).inject($(container)).store('tip:title', calt);
	}
	return newimg;
}
/*
Function fjsPShowImg()
	Function to show imgs.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 05/08/09 Last Modify: 14/01/2010 common.js AIO Ver 1.6.4
*/
var fjsPShowImg = function(cimg, calt, itsys, id, csss, container, js) {
	itsys = ($defined(itsys) && itsys > 0 ? itsys : C_SYS);
	id = ($defined(id) && id.length > 0 ? id : '');
	csss = ($defined(csss) && csss.length > 0 ? csss : C_CLASS_ICONS);
	var cfile = C_IMG_PATH + cico;
	if (js != '') {
		var newimg = new Asset.image(cfile, {'alt': calt, 'class': csss, 'id': (id != '' ? cimg + '_' + id : cimg + '_' + $random(65535, 65536)), 'title': calt}).inject($(container)).setStyle('cursor', 'pointer').addEvent('click', js).store('tip:title', calt);
	} else {
		var newimg = new Asset.image(cfile, {'alt': calt, 'class': csss, 'id': (id != '' ? cimg + '_' + id : cimg + '_' + $random(65535, 65536)), 'title': calt}).inject($(container)).store('tip:title', calt);
	}
	return newimg;
}
/*
Function fjsDecodeAccents()
	Function to decode htmlentities and encode them to js.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 11/12/08 Last Modify: 15/08/10 common.js AIO Ver 1.6.4
*/
var fjsDecodeAccents = function(s) {
	s = unescape(s);
	s = s.replace(/&amp;/g, '\u0026');
	s = s.replace(/&lt;/g, '\u003c');
	s = s.replace(/&gt;/g, '\u003e');
	s = s.replace(/&aacute;/g, '\u00e1');
	s = s.replace(/&eacute;/g, '\u00e9');
	s = s.replace(/&iacute;/g, '\u00ed');
	s = s.replace(/&oacute;/g, '\u00f3');
	s = s.replace(/&uacute;/g, '\u00fa');
	s = s.replace(/&Aacute;/g, '\u00c1');
	s = s.replace(/&Eacute;/g, '\u00c9');
	s = s.replace(/&Iacute;/g, '\u00cd');
	s = s.replace(/&Oacute;/g, '\u00d3');
	s = s.replace(/&Uacute;/g, '\u00da');
	s = s.replace(/&ntilde;/g, '\u00f1');
	s = s.replace(/&Ntilde;/g, '\u00d1');
	s = s.replace(/&#8482;/g, '\u2122');
	return s;
}
/*
Function fjsAddCommas()
	Function to commas striped by fScriptCommas() PHP func.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 02/07/09 Last Modify: 02/07/09 common.js AIO Ver 1.6.4
*/
var fjsAddCommas = function(s) {
	s = unescape(s);
	s = s.replace(/C_SYMBOL_COMMA/g, ',');
	return s;
}
/*
Function fjsAddDoubleDots()
	Function to commas striped by fScriptDoubleDots() PHP func.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 03/07/09 Last Modify: 03/07/09 common.js AIO Ver 1.6.4
*/
var fjsAddDoubleDots = function(s) {
	s = unescape(s);
	s = s.replace(/C_SYMBOL_DOUBLE_DOTS/g, ':');
	return s;
}
/*
Function fjsCheckSTRLen()
	Function to check the lenght of strings for rows.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 10/12/08 common.js AIO Ver 1.6.0
*/
var fjsCheckSTRLen = function(c, l) {
	if (c.length > l) {
		c = c.substr(0, l) + '...';
	}	
	return c;
}
/*
Function fjsSecurePrintSQLValue()
	Function to print a SQL retrieved value or a string if it's not available.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 10/12/08 common.js AIO Ver 1.6.0
*/
var fjsSecurePrintSQLValue = function(v, d, s, p, z) {
	v = ($defined(v) && v.length > 0 ? v : '');
	d = ($defined(d) && d.length > 0 ? d : C_LANG_ABR_ND);
	s = ($defined(s) && s.length > 0 ? s : '');
	p = ($defined(p) && p.length > 0 ? p : '');
	z = ($defined(z) && z > 0 ? z : 0);
	return (v != '' && v != z ? (p != '' ? p + ' ' : '') + fjsDecodeAccents(v) + (s != '' ? ' ' + s : '') : d);
}
/*
Function fjsGetTableFields()
	Function to get fields from a table.
	Accepts a another function as parameter to prcocess them...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 18/12/08 common.js AIO Ver 1.6.0
*/
var fjsGetTableFields = function(t, f, c, op, v, e, ord, ad, l, fn, syn) {
	fjsShowLoading('loading');
	var req = new Request.JSON({
		url: C_WEB_URL + '?cmod=json' + (e.indexOf('&') != -1 ? e : ''),
		method: 'post', // or "get"
		secure: true,
		data: {
			'cAIOcbFlashAuth': fjsSendCookieBasedAuth(),
 			'p': 'gf', 
			'm': 'pop', 
			'n': 'jtable', 
			't': t, 
			'f': f, 
			'c': c, 
			'o': op, 
			'i': v,
			'e': e,
			'b': ord, 
			'a': ad, 
			'l': l
		},
		link: 'ignore', // either "cancel" or "chain"
		async: syn,
		encoding: C_DEFAULT_CHARSET,
		// headers: '';
		// isSuccess: func() 
		evalScripts: true,
		evalResponse: false,
		emulation: false,
		urlEncoded: true,
		onComplete: function(jsonObj) {
			if (jsonObj && fjsReceiveCookieBasedAuth(jsonObj.jtable) == true) {
				fn(jsonObj.jtable, v);
				fjsKillLoading();
			}
		}
	}).send();
}
/*
Function CheckMultipleExpandTableList()
	Function to Expand a list with...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 09/12/08 common.js AIO Ver 1.6.0
*/
var fjsCheckMultipleExpandTableLists = function(el) {
	el.each(function(elem) {
		fjsExpandTableList(elem);
	});
}
/*
Function ExpandTableList()
	Function to Expand a list with...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/12/08 Last Modify: 23/05/08 common.js AIO Ver 1.6.3
*/
var fjsExpandTableList = function(element) {
	var showDelay = 100;
	var hideDelay = 100;
	var className = null;
	var fields = 'id, cuid, cid, date, lh, orig, ip, sid';
	var table = C_TBL_UNIQVISITS;
	if (Browser.Engine.trident) { // Ver la 423 etc...
		// var cond = element.getAttribute('rev', 2); // (i.indexOf('.') != -1 ? 'ip' : 'cuid');
		// var i = (cond == 'ip' ? element.getAttribute('rel', 2).split(': ')[1] : (cond == 'cuid' ? element.getAttribute('rel', 2).split(': ')[2] : '')); 
		element = $(element); // Again workaround bug for IE
	}
	var cond = element.get('rev'); // (i.indexOf('.') != -1 ? 'ip' : 'cuid');
	var i = (cond == 'ip' ? element.get('rel').split(': ')[1] : (cond == 'cuid' ? element.get('rel').split(': ')[2] : ''));
	var op = '=';
	var val = i;
//	var extras = (cond == 'cuid' ? 'and ip = "' + element.get('rel').split(': ')[4] + '" and id <> "' + element.get('rel').split(': ')[6] + '"' : (cond == 'ip' ? 'and id <> "' + element.get('rel').split(': ')[3] + '"' : ''));
	var extras = (cond == 'cuid' ? 'and ip = "' + element.get('rel').split(': ')[4] + '"' : (cond == 'ip' ? 'and id <> "' + element.get('rel').split(': ')[3] + '"' : ''));
	var ord = 'id';
	var ad = 'desc';
	var limit = 64;
	var fixed = false;
	var thistd = element.getParent('td');
	var thistr = element.getParent('tr');
	var thistable = thistr.getParent('table');
	var laststylebg = (thistr.getStyle('background').toLowerCase().substr(0, 7) == '#f1f1e3' ? '#f2f2f2' : '#e7eafa');
	var newtr = $empty;
	var newtd = $empty;
	var replaceValue = function(val, id) {
		if ($defined(val[0])) {
			$$('.id' +  id).set('html', fjsCheckSTRLen(fjsSecurePrintSQLValue((typeof(val[0].cusr) != 'undefined' ? val[0].cusr : (typeof(val[0].cname) != 'undefined' ? val[0].cname : C_LANG_ABR_ND))), 72));
			if (typeof(val[0].cusr) != 'undefined') {
				$$('.id' +  id).setStyles({'border': 'solid 1px #000', 'text-align': 'center'});
			} else if (typeof(val[0].cname) != 'undefined') {
				var newimg = new Asset.image(C_ICO_PATH + C_ICO_VISTA_PREVIA, {'alt': C_LANG_VISTA_PREVIA, 'class': C_CLASS_ICONS, 'id': (id != '' ? C_ICO_VISTA_PREVIA + '_' + id : C_ICO_VISTA_PREVIA + '_' + $random(65535, 65536)), 'title': C_LANG_VISTA_PREVIA}).setStyle('cursor', 'pointer');
				$$('.id' +  id).setStyle('cursor', 'pointer').adopt(newimg);
			}
		}
		return true;
	}
	var expandTable = function(rows) {
		if ($type($('expandedtabletr_' + i + rows.getLast().id)) == 'element') {
			rows.each(function(row) {
				if ($('expandedtabletr_' + i + row.id) != null) {
					$('expandedtabletr_' + i + row.id).destroy();
				}
			});
			element.store('tip:title', C_LANG_EXPANDIR_LA_LISTA);
			if ($type($('ico' + cond + rows.getLast().ip)) == 'element') {
				$('ico' + cond + rows.getLast().ip).store('tip:title', C_LANG_EXPANDIR_LA_LISTA);
			}
			if ($type($('txt' + cond + rows.getLast().ip)) == 'element') {
				$('txt' + cond + rows.getLast().ip).store('tip:title', C_LANG_EXPANDIR_LA_LISTA);
			}
			if ($type($(C_ICO_CONTRAER + '_' + cond + rows.getLast().ip)) == 'element') {
				$(C_ICO_CONTRAER + '_' + cond + rows.getLast().ip).store('tip:title', C_LANG_EXPANDIR);
				$(C_ICO_CONTRAER + '_' + cond + rows.getLast().ip).set('id', C_ICO_EXPANDIR + '_' + cond + rows.getLast().ip).set('src', C_ICO_PATH + C_ICO_EXPANDIR);
			}
		} else {
			rows.each(function(orow) {
				var row = $H(orow);
				if (row.id > 0) {
					newtr = new Element('tr', {'id': 'expandedtabletr_' + i + row.id}).injectAfter(thistr).setStyle('background', (C_REMOTE_IP == row.ip ? '#adb9ef' : (laststylebg == '#e7eafa' ? '#f2f2f2' : '#e7eafa')));
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr).set('text', row.id);
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr).set('text', row.date);
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr).set('text', row.lh);
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr);
					// alert('cid: ' + $defined(row.cid) + ' ' + row.cid + ' orig: ' + $defined(row.orig) + ' ' + row.orig);
					newa = new Element('a', {'class': 'id' + (row.has('cid') ? row.cid : 'nocid_' + row.id), 'href': (row.has('orig') ? row.orig : (row.has('cid') ? C_SITE_URL + '?cmod=' + row.cid : C_SITE_URL)), 'target': '_blank'}).inject(newtd);
					if ($defined(row.cid)) {
						fjsGetTableFields(C_TBL_MODS, 'cname, curl', 'curl', '=', row.cid, '', 'id', 'asc', 1, replaceValue, true);
					}
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr).set('text', (row.nu == 1 ? C_LANG_SI : C_LANG_NO));
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr).set('text', row.ip);
					newtd = new Element('td', {'class': 'id' + ($defined(row.cuid) ? row.cuid : 'nocuid_' + row.id)}).inject(newtr);
					if ($defined(row.cuid)) {
						fjsGetTableFields(C_TBL_USRS, 'cusr, cuid', 'cuid', '=', row.cuid, '', 'id', 'asc', 1, replaceValue, true);
						fjsGetTableFields(C_TBL_CRM_LST_GUEST, 'cname, cuid', 'cuid', '=', row.cuid, '', 'id', 'asc', 1, replaceValue, true);
					}
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr);
					fjsPShowIcon(C_ICO_EXPANDIDO, C_LANG_EXPANDIDO, '', '', '', newtd, '');
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr);
					newa = new Element('a', {'class': C_CLASS_LINKS, 'href': '?cmod=stats&sid=' + row.sid}).inject(newtd);
					fjsPShowIcon(C_ICO_MAS_INFO, C_LANG_MAS_INFO, '', '', '', newa, '');
					newtd = new Element('td', {'class': C_CLASS_TEXTS}).inject(newtr);
					newa = new Element('a', {'class': C_CLASS_LINKS, 'href': '?cmod=stats&more=1&sid=' + row.sid}).inject(newtd);
					fjsPShowIcon(C_ICO_PAGINAS, C_LANG_PAGINAS, '', '', '', newa, '');
					laststylebg = newtr.getStyle('background').toLowerCase().substr(0, 7);
				}
			});
			element.store('tip:title', C_LANG_CONTRAER_LA_LISTA);
			if ($type($('ico' + cond + rows.getLast().ip)) == 'element') {
				$('ico' + cond + rows.getLast().ip).store('tip:title', C_LANG_CONTRAER_LA_LISTA);
			}
			if ($type($('txt' + cond + rows.getLast().ip)) == 'element') {
				$('txt' + cond + rows.getLast().ip).store('tip:title', C_LANG_CONTRAER_LA_LISTA);
			}
			if ($type($(C_ICO_EXPANDIR + '_' + cond + rows.getLast().ip)) == 'element') {
				$(C_ICO_EXPANDIR + '_' + cond + rows.getLast().ip).store('tip:title', C_LANG_CONTRAER);
				$(C_ICO_EXPANDIR + '_' + cond + rows.getLast().ip).set('id', C_ICO_CONTRAER + '_' + cond + rows.getLast().ip).set('src', C_ICO_PATH + C_ICO_CONTRAER);
			}
		}
		element.focus();
	}
	fjsGetTableFields(table, fields, cond, op, val, extras, ord, ad, limit, expandTable, true);
	// Para hablarle al ajax/json http://www.sitio.dominio/?cmod=json&p=gf&m=pop&n=jtable&f=*&t=tuniqvisits&c=ip&o==&i=190.173.218.128&b=id&a=asc&l=1024
}
/*
Function fjsChangeImageOnLoad()
	Function to Change de header image on load and unload. Based on MooTools JSon.js.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/12/08 Last Modify: 26/07/09 common.js AIO Ver 1.6.4
*/
function fjsChangeImageOnLoad() {
	new AIOSlideShow($$('#ixaioheaderproa img)')).play(true);
}
/*
Class: AIOSlideShow.js
	Class for a nice Slide Show.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/12/08 Last Modify: 04/12/08 common.js AIO Ver 1.6.0
*/
var AIOSlideShow = new Class({
	mode: 'alpha',
	modes: ['top', 'right', 'bottom', 'left', 'alpha'],
	sizes: {w: 315, h: 175},
	fxOptions: {duration: 500},
	interval: 4000,
	initialize: function(items, options) {
		if (options) {
			for (var o in options) {
				this[o] = options[o];
			}
		}
		if (this.buttons) {
			this.buttons.previous.addEvent('click', this.previous.bind(this, [true]));
			this.buttons.next.addEvent('click', this.next.bind(this, [true]));
		}
		this.curr = 0;
		this.prev = null;
		this.items = items.setStyle('display', 'none');
		this.items[this.curr].setStyle('display', 'block');
		this.disabled = false;
		this.attrs = {
			left: ['left', - this.sizes.w, 0, 'px'],
			top: ['top', - this.sizes.h, 0, 'px'],
			right: ['left', this.sizes.w, 0, 'px'],
			bottom: ['top', this.sizes.h, 0, 'px'],
			alpha: ['opacity', 0, 1, '']
		};
		this.rand = this.mode == 'rand';
		this.sequence = typeof(this.mode) == 'object' ? this.mode : false;
		this.curseq = 0;
		this.timer = null;
	},
	walk: function(n, manual) {
		if (this.curr !== n && !this.disabled) {
			this.disabled = true;
			if (manual) {
				this.stop();
			}
			if (this.rand) {
				this.mode = this.modes.getRandom();
			} else if (this.sequence) {
				this.mode = this.sequence[this.curseq];
				this.curseq += this.curseq + 1 < this.sequence.length ? 1 : - this.curseq;
			}
			this.prev = this.curr; 
			this.curr = n;
			var a = this.attrs[this.mode].associate(['p', 'f', 't', 'u']);
			for (var i = 0; i < this.items.length; i++) {
				if (this.curr === i) {
					this.items[i].setStyles($extend({'display': 'block', 'z-index': '2'}, JSON.decode('{"' + a.p + '": "' + a.f + a.u + '"}')));
				} else if (this.prev === i) {
					this.items[i].setStyles({'display': 'none', 'z-index': '1'});
				} else {
					this.items[i].setStyles({'display': 'none', 'z-index': '0'});
				}
			}
			this.items[n].set('tween', {onComplete: this.onComplete.bind(this)}).tween(a.p, a.f, a.t);
		}
	},
	play: function(wait) {
		this.stop();
		if (!wait) {
			this.next();
		}
		this.timer = this.next.periodical(this.interval, this, [false]);
	},
	stop: function() {
		$clear(this.timer);
	},
	next: function(manual) {
		this.walk(this.curr + 1 < this.items.length ? this.curr + 1 : 0, manual);
	},
	previous: function(manual) {
		this.walk(this.curr > 0 ? this.curr - 1 : this.items.length - 1, manual);
	},
	onComplete: function() {
		this.disabled = false;
		this.items[this.prev].setStyle('display', 'none');
		if (this.onWalk) {
			this.onWalk(this.curr);
		}
	}
});
/*
Script: MultiUpload.js
	Class for a Upload Multiple Files in a single input file tag.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 16/11/08 Last Modify: 16/11/08 common.js AIO Ver 1.6.0
*/
var MultiUpload = new Class({
	initialize: function(input_element, max, name_suffix_template, show_filename_only, remove_empty_element, allowed_ext_types, ext_types_with_screener, allowed_ext_screener_types) {
		this.elements = [];
		this.uid_lookup = {}; 
		this.uid = 0;
		if ($defined(max)) {
			this.max = max;
		} else {
			this.max = 0;
		}
		if ($defined(name_suffix_template)) {
			this.name_suffix_template = name_suffix_template;
		} else {
			this.name_suffix_template= '_{id}';
		}
		if ($defined(show_filename_only)) {
			this.show_filename_only = show_filename_only;
		} else {
			this.show_filename_only = false;
		}
		if ($defined(remove_empty_element)) {
			this.remove_empty_element = remove_empty_element;
		} else {
			this.remove_empty_element = false;
		}
		if ($defined(allowed_ext_types)) {
			this.allowed_ext_types = allowed_ext_types.toLowerCase();
		} else {
			this.allowed_ext_types = '*';
		}
		if ($defined(ext_types_with_screener)) {
			this.ext_types_with_screener = ext_types_with_screener.toLowerCase();
		} else {
			this.ext_types_with_screener = '';
		}
		if ($defined(allowed_ext_screener_types)) {
			this.allowed_ext_screener_types = allowed_ext_screener_types.toLowerCase();
		} else {
			this.allowed_ext_screener_types = '*';
		}
		input_element = $(input_element);
		this.id = input_element.id;
		this.name = input_element.name;
		this.form = input_element.form;
		this.initializeElement(input_element);
		var container = new Element('div', {'id': 'cont', 'class': 'multiupload'});
		this.list = new Element('div', {'class': 'list'});
		container.injectAfter(input_element);
		container.adopt(input_element);
		container.adopt(this.list);
		// Not send last empty element
		if (this.remove_empty_element) {
			input_element.form.addEvent('submit',function() {this.elements.getLast().element.disabled = true;}.bind(this));
		}
	},
	fjsDrawPopup: function(uid, cfile) {
		var jdescpopup = new Element('div', {'class': 'cxaiodiv', 'id': 'jdescpopup', 'name': 'jdescpopup'}).inject(document.body);
		var pos = $('cont').getPosition();
		var height = 192;
		var width = 384;
		var left = (pos.x + (width / 3)).round();
		var top = (pos.y - (height / 2)).round();
		var icosize = fjsGetAppropiateValues(4);
		jdescpopup.setStyles({'background-color': '#FFFFFF', 'border': '10px solid #EFEFEF', 'cursor': 'move', 'height': height, 'left': left, 'position': 'absolute', 'text-align': 'center', 'top': top, 'visibility': 'visible', 'width': width, 'vertical-align': 'middle', '-webkit-border-radius': '16px', '-moz-border-radius': '16px'});
		var closebutton = new Element('img', {'alt': C_LANG_CERRAR_VENTANA, 'id': 'close', 'src': C_ICO_PATH + C_ICO_CERRAR_VENTANA, 'title': C_LANG_CERRAR_VENTANA}).inject(jdescpopup);
		closebutton.setStyles({'cursor': 'pointer', 'left': width - icosize, 'position': 'absolute', 'text-align': 'right', 'top': 0, 'vertical-align': 'top'});
		closebutton.addEvent('click', function(e) {
			e.stop();
			$('jdescpopup').destroy();
		});
		var savebutton = new Element('img', {'alt': C_LANG_GUARDAR, 'id': 'save', 'src': C_ICO_PATH + C_ICO_GUARDAR, 'title': C_LANG_GUARDAR}).inject(jdescpopup);
		savebutton.setStyles({'cursor': 'pointer', 'left': width - icosize, 'position': 'absolute', 'text-align': 'right', 'top': height - icosize, 'vertical-align': 'bottom'});
		savebutton.addEvent('click', function() {
			if ($defined($('inputtext' + uid))) {
				var cname_content = $('inputtext' + uid).value;
			} else {
				var cname_content = "";
			}
			if ($defined($('textarea' + uid))) {
				var cdesc_content = $('textarea' + uid).value;
			} else {
				var cdesc_content = "";
			}
			if (!$defined($('cname_' + uid))) {
				var input_hidden_cname = new Element('input', {'id': 'cname_' + uid, 'name': 'cname_' + uid, 'type': 'hidden', 'value': cname_content}).inject($('cont'));
				$('cb' + uid).setProperties({'alt': C_LANG_EDITAR_COMENTARIO, 'src': C_ICO_PATH + C_ICO_EDITAR_COMENTARIO, 'title': C_LANG_EDITAR_COMENTARIO});
			} else {
				$('cname_' + uid).value = cname_content;
			}
			if (!$defined($('cdesc_' + uid))) {
				var input_hidden_cdesc = new Element('input', {'id': 'cdesc_' + uid, 'name': 'cdesc_' + uid, 'type': 'hidden', 'value': cdesc_content}).inject($('cont'));
				$('cb' + uid).setProperties({'alt': C_LANG_EDITAR_COMENTARIO, 'src': C_ICO_PATH + C_ICO_EDITAR_COMENTARIO, 'title': C_LANG_EDITAR_COMENTARIO});
			} else {
				$('cdesc_' + uid).value = cdesc_content;
			}
			$('jdescpopup').destroy();
		});
		var icontainer = new Element('div', {'id': 'icontainer'}).inject(jdescpopup);
		icontainer.setStyles({'cursor': 'default', 'height': height - 84, 'left': 10, 'position': 'absolute', 'text-align': 'center', 'top': 32, 'width': width - 20, 'vertical-align': 'middle'});
		var span_text_inputtext = new Element('span', {'class': 'sublist'}).set('text', C_LANG_TITULO).inject(icontainer);
		var inputtext = new Element('input', {'class': C_CLASS_INPUT_TEXT, 'id': 'inputtext' + uid, 'maxlength': 255, 'name': 'inputtext' + uid, 'size': 72, 'type': 'text'}).inject(icontainer).addEvent('click', function () {inputtext.focus();});
		if ($defined($('cname_' + uid))) {
			var inputtext_content = $('cname_' + uid).value;
			$('inputtext' + uid).set('value', inputtext_content);
		}
		var span_text_textarea = new Element('span', {'class': 'sublist'}).set('text', C_LANG_DESCRIPCION).inject(icontainer);
		var textarea = new Element('textarea', {'class': 'cxaioinputtextarea', 'id': 'textarea' + uid, 'name': 'textarea' + uid, 'rows': 4, 'cols': 64}).inject(icontainer).addEvent('click', function () {textarea.focus();});
		if ($defined($('cdesc_' + uid))) {
			var textarea_content = $('cdesc_' + uid).value;
			$('textarea' + uid).set('value', textarea_content);
		}
		var span_text_file = new Element('span', {'class': 'sublist'}).set('text', C_LANG_CAMBIANDO_TITULO_Y_DESCRIPCION_PARA + ': ' + cfile + ' (' + uid + ')').inject(icontainer).setStyle('vertical-align', 'bottom');
		drag = new Drag.Move($(jdescpopup), {});
	},
	addRow: function() {
		if (this.max == 0 || this.elements.length <= this.max) {
			current_element = this.elements.getLast();
			var name = current_element.element.value;
			if (this.show_filename_only) {
				if (name.contains('\\')) {
					name = name.substring(name.lastIndexOf('\\') + 1);
				} else if (name.contains('//')) {
					name = name.substring(name.lastIndexOf('//') + 1);
				}
			}
			if (this.allowed_ext_types.contains(name.split('.')[1].toLowerCase()) == true || this.allowed_ext_types.contains('*') == true) {
				var item = new Element('span').set('text', name);
				var delete_button = new Element('img', {'alt': C_LANG_BORRAR, 'src': '/img/cross_small.gif', 'title': C_LANG_BORRAR, 'events': {'click': function(uid) {this.deleteRow(uid);}.pass(current_element.uid, this)}});
				var comments_button = new Element('img', {'alt': C_LANG_COMENTARIO, 'id': 'cb' + current_element.uid, 'src': C_ICO_PATH + C_ICO_COMENTARIO, 'title': C_LANG_COMENTARIO, 'events': {'click': function(uid) {this.fjsDrawPopup(uid, name);}.pass(current_element.uid, this)}});
				if (this.ext_types_with_screener.contains(name.split('.')[1].toLowerCase()) == true) {
					var sub_text = new Element('span', {'class': 'sublist'}).set('text', C_LANG_MINIATURA + ': ');
					var sub_input_file = new Element('input', {'id': 'ffilescrnr', 'name': 'ffilescrnr', 'type': 'file'});
					var sub_text_no_check = new Element('span', {'class': 'sublist'}).set('text', C_LANG_SIN_MINIATURA + ': ');
					var sub_input_check = new Element('input', {'type': 'checkbox'});
					sub_input_file.id = sub_input_file.id + this.name_suffix_template.replace( /\{id\}/, this.elements.length - 1);
					sub_input_file.name = sub_input_file.name + this.name_suffix_template.replace( /\{id\}/, this.elements.length - 1);
					sub_input_file.addEvent('change', function() {
						if (this.show_filename_only) {
							if (sub_input_file.value.contains('\\')) {
								sub_name = sub_input_file.value.substring(sub_input_file.value.lastIndexOf('\\') + 1);
							} else if (sub_input_file.value.contains('//')) {
								sub_name = sub_input_file.value.substring(sub_input_file.value.lastIndexOf('//') + 1);
							} else {
								sub_name = sub_input_file.value;
							}
						}
						if (this.allowed_ext_screener_types.contains(sub_input_file.value.split('.')[1].toLowerCase()) == true) {
							sub_input_file.setStyle('visibility', 'hidden');
							sub_text_no_check.destroy();
							sub_input_check.destroy();
							var sub_tmp_text = sub_text.get('text');
							sub_text.set('text', sub_tmp_text + sub_name);
						} else {
							sub_input_file.value = "";
							sub_name = "";
							alert(C_LANG_ERROR + ': ' + C_LANG_EXTENSION_NO_EN_LISTA_DE_TIPOS_ACEPTADOS_PARA_MINIATURAS + ': ' + this.allowed_ext_screener_types);
						}
					}.bind(this));
					if (this.remove_empty_element) {
						sub_input_file.addEvent('submit', function() {
							if (sub_input_file.value == "") {
								sub_input_file.destroy();
							}
						}.bind(this));
					}
					sub_input_check.addEvent('click', function(e) {
						if (confirm(C_LANG_ESTA_SEGURO_DE_QUERER_ITEM + ' "' +  name + '" ' + C_LANG_SIN_MINIATURA + '?')) {
							sub_input_file.destroy();
							sub_input_check.setProperties({'class': C_CLASS_ICONS, 'disabled': '"disabled"', 'readonly': '"readonly"'});
						} else {
							e.stop();
							sub_input_check.checked = false;
						}
					}.bind(this));
					if (this.form.id == 'fmailusr') {
						var row_element = new Element('div', {'class': 'item'}).adopt(delete_button).adopt(item);
					} else {
						var row_element = new Element('div', {'class': 'item'}).adopt(delete_button).adopt(item).adopt(comments_button).adopt(sub_text).adopt(sub_input_file).adopt(sub_text_no_check).adopt(sub_input_check);
					}
				} else if (this.allowed_ext_screener_types.contains(name.split('.')[1].toLowerCase()) == true) {
					var sub_text_ubicacion = new Element('span', {'class': 'sublist'}).set('text', ' ' + C_LANG_UBICACION + ': ');
					var sub_text_media = new Element('span', {'class': 'sublist'}).set('text', C_LANG_MEDIA);
					var sub_input_radio_media = new Element('input', {'alt': C_LANG_MEDIA, 'checked': 'checked', 'class': 'cxaioinputradio', 'id': 'iuse_' + current_element.uid, 'name': 'iuse_' + current_element.uid, 'title': C_LANG_MEDIA, 'type': 'radio', 'value': '1'});
					var sub_text_header = new Element('span', {'class': 'sublist'}).set('text', C_LANG_ENCABEZADO);
					var sub_input_radio_header = new Element('input', {'alt': C_LANG_ENCABEZADO, 'class': 'cxaioinputradio', 'id': 'iuse_' + current_element.uid, 'name': 'iuse_' + current_element.uid, 'title': C_LANG_ENCABEZADO, 'type': 'radio', 'value': '2'});
					var sub_text_submenu = new Element('span', {'class': 'sublist'}).set('text', C_LANG_SUBMENU);
					var sub_input_radio_submenu = new Element('input', {'alt': C_LANG_SUBMENU, 'class': 'cxaioinputradio', 'id': 'iuse_' + current_element.uid, 'name': 'iuse_' + current_element.uid, 'title': C_LANG_SUBMENU, 'type': 'radio', 'value': '3'});
					var sub_text_background = new Element('span', {'class': 'sublist'}).set('text', C_LANG_FONDO);
					var sub_input_radio_background = new Element('input', {'alt': C_LANG_FONDO, 'class': 'cxaioinputradio', 'id': 'iuse_' + current_element.uid, 'name': 'iuse_' + current_element.uid, 'title': C_LANG_FONDO, 'type': 'radio', 'value': '4'});
					var sub_text_height = new Element('span', {'class': 'sublist'}).set('text', C_LANG_ALTO + ': ');
					var sub_input_text_height = new Element('input', {'alt': C_LANG_ALTO, 'class': C_CLASS_INPUT_TEXT, 'id': 'iheight_' + current_element.uid, 'name': 'iheight_' + current_element.uid, 'title': C_LANG_ALTO, 'type': 'text', 'value': '', 'size': 4});
					var sub_text_width = new Element('span', {'class': 'sublist'}).set('text', C_LANG_ANCHO + ': ');
					var sub_input_text_width = new Element('input', {'alt': C_LANG_ANCHO, 'class': C_CLASS_INPUT_TEXT, 'id': 'iwidth_' + current_element.uid, 'name': 'iwidth_' + current_element.uid, 'title': C_LANG_ANCHO, 'type': 'text', 'value': '', 'size': 4});
					if (this.form.id == 'fmailusr') {
						var row_element = new Element('div', {'class': 'item'}).adopt(delete_button).adopt(item);
					} else {
						var row_element = new Element('div', {'class': 'item'}).adopt(delete_button).adopt(item).adopt(comments_button).adopt(sub_text).adopt(sub_input_file).adopt(sub_text_ubicacion).adopt(sub_text_media).adopt(sub_input_radio_media).adopt(sub_text_header).adopt(sub_input_radio_header).adopt(sub_text_submenu).adopt(sub_input_radio_submenu).adopt(sub_text_background).adopt(sub_input_radio_background).adopt(sub_text_height).adopt(sub_input_text_height).adopt(sub_text_width).adopt(sub_input_text_width);
					}
				} else {
					if (this.form.id == 'fmailusr') {
						var row_element = new Element('div', {'class': 'item'}).adopt(delete_button).adopt(item).adopt(comments_button);
					} else {
						var row_element = new Element('div', {'class': 'item'}).adopt(delete_button).adopt(item);
					}
				}
				this.list.adopt(row_element);
				current_element.row = row_element;
				var new_input = new Element('input', {'type':'file', 'disabled': (this.elements.length == this.max) ? true : false});
				this.initializeElement(new_input);
				current_element.element.style.position = 'absolute';
				current_element.element.style.left = '-1000px';
				new_input.injectAfter(current_element.element);
			} else {
				alert(C_LANG_ERROR + ': ' + C_LANG_EXTENSION_NO_EN_LISTA_DE_TIPOS_ACEPTADOS_PARA_MINIATURAS + ': ' + this.allowed_ext_types );
			}
		} else {
			alert(C_LANG_NO_SE_PERMITE_SUBIR_MAS_DE + ' ' + this.max + ' ' + C_LANG_ARCHIVOS);
		}
	},
	deleteRow: function(uid) {
		deleted_row = this.elements[this.uid_lookup[uid]];
		var todelete;
		if (this.show_filename_only) {
			if (deleted_row.element.value.contains('\\')) {
				todelete = deleted_row.element.value.substring(deleted_row.element.value.lastIndexOf('\\') + 1);
			} else if (deleted_row.element.value.contains('//')) {
				todelete = deleted_row.element.value.substring(deleted_row.element.value.lastIndexOf('//') + 1);
			} else {
				todelete = deleted_row.element.value;
			}
		}
		if (confirm(C_LANG_ESTA_SEGURO_DE_QUERER_REMOVER_EL_ITEM + ' "' +  todelete + '" ' + C_LANG_DE_LA_COLA_DE_SUBIDA + '?')) {
			this.elements.getLast().element.disabled = false;
			deleted_row.element.destroy();
			deleted_row.row.destroy();
			delete(this.elements[this.uid_lookup[uid]]);
			var new_elements = [];
			this.uid_lookup = {};
			for (var i = 0; i < this.elements.length; i++ ) {
				if ($defined(this.elements[i])) {
					this.elements[i].element.id = this.id + this.name_suffix_template.replace( /\{id\}/, new_elements.length);
					this.elements[i].element.name = this.name + this.name_suffix_template.replace( /\{id\}/, new_elements.length);
					this.uid_lookup[this.elements[i].uid] = new_elements.length;
					new_elements.push(this.elements[i]);
				}
			}
			this.elements = new_elements;
		}
	},
	initializeElement: function(element) {
		element.addEvent('change', function() {this.addRow()}.bind(this));
		element.id = this.id + this.name_suffix_template.replace( /\{id\}/, this.elements.length);
		element.name = this.name + this.name_suffix_template.replace( /\{id\}/, this.elements.length );
		this.uid_lookup[this.uid] = this.elements.length;
		this.elements.push({'uid': this.uid, 'element': element});
		this.uid++;
	}
});
var fjsCheckMultipleAvailability = function (e, i) {
	e.each(function(el) {
		fjsCheckAvailability(el, i);
		/* if (C_SYS == 1) { // Gives an error on module edition so don´t use it
			el.addEvents({'blur': fjsCheckAvailability(el, 0), 'change': fjsCheckAvailability(el, 0), 'mouseout': fjsCheckAvailability(el, 0), 'selectend': fjsCheckAvailability(el, 0), 'submit': fjsCheckAvailability(el, 0)});
		} */
		/* el.addEvent('paste', function() { // Ojala =)
			fjsCheckAvailability(el, i);
		}); */
	});
}
var fjsSetAvailableState = function(e) {
	e.setStyle('background', '#EEFFEE');
	if ($defined($(C_ICO_NO_DISPONIBLE + '_i' + e.name))) {
		$(C_ICO_NO_DISPONIBLE + '_i' + e.name).setProperties({'id': C_ICO_DISPONIBLE + '_i' + e.name, 'alt': C_LANG_DISPONIBLE, 'src': C_ICO_PATH + C_ICO_DISPONIBLE, 'title': C_LANG_DISPONIBLE}).store('tip:title', C_LANG_DISPONIBLE);
	} else if ($defined($(C_ICO_DISPONIBLE + '_i' + e.name))) {
		$(C_ICO_DISPONIBLE + '_i' + e.name).setProperties({'alt': C_LANG_DISPONIBLE, 'src': C_ICO_PATH + C_ICO_DISPONIBLE, 'title': C_LANG_DISPONIBLE}).store('tip:title', C_LANG_DISPONIBLE);
	}
}
var fjsSetNotAvailableState = function(e) {
	e.setStyle('background', '#FFEEEE');
	if ($defined($(C_ICO_DISPONIBLE + '_i' + e.name))) {
		$(C_ICO_DISPONIBLE + '_i' + e.name).setProperties({'id': C_ICO_NO_DISPONIBLE + '_i' + e.name, 'alt': C_LANG_NO_DISPONIBLE, 'src': C_ICO_PATH + C_ICO_NO_DISPONIBLE, 'title': C_LANG_NO_DISPONIBLE}).store('tip:title', C_LANG_DISPONIBLE);
	} else if ($defined($(C_ICO_NO_DISPONIBLE + '_i' + e.name))) {
		$(C_ICO_NO_DISPONIBLE + '_i' + e.name).setProperties({'alt': C_LANG_NO_DISPONIBLE, 'src': C_ICO_PATH + C_ICO_NO_DISPONIBLE, 'title': C_LANG_NO_DISPONIBLE}).store('tip:title', C_LANG_NO_DISPONIBLE);
	}
}
/*
fjsCheckAvailability()
	Function to checking availability of names on a DB via JSON.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/11/08 Last Modify: 23/05/08 common.js AIO Ver 1.6.3
*/
var fjsCheckAvailability = function (e, i) {
	if (Browser.Engine.trident) {
		e = $(e);
	}
	i = (e.name.lastIndexOf('_') != -1 ? e.name.split('_')[1] : (i.toInt() > 0 ? i.toInt() : 0));
	var c = (e.name.lastIndexOf('_') != -1 ? e.name.split('_')[0] : e.name);
	var t = (typeof(e.alt) == 'string' && e.alt != '' ? (e.alt.lastIndexOf('::') != -1 ? e.alt.split('::')[0] : e.alt) : C_TBL_MODS);
	var fields = 'id' + (t == C_TBL_MODS || t == C_TBL_CONSTS || t == C_TBL_ICONS ? ', itsys, itlang' : '');
	var f = e.form;
	var fname = (C_DEFAULT_BROWSER == 'IE' || C_DEFAULT_BROWSER == 'OTHER' ? f.name : f.get('id'));
	var itlang = (typeof(f.itlang) != 'undefined' && typeof(f.itlang.type) != 'undefined' ? (f.itlang.type.substr(0, 5) == 'selec' ? fjsGetSelectSelectedValue(f.itlang) : (f.itlang.type.substr(0, 5) == 'radio' ? fjsGetRadioCheckedValue(f, 'itlang') : f.itlang.value)) : 1);
	var itsys = (typeof(f.itsys) != 'undefined' && typeof(f.itsys.type) != 'undefined' ? (f.itsys.type.substr(0, 5) == 'selec' ? fjsGetSelectSelectedValue(f.itsys) : (f.itsys.type.substr(0, 5) == 'radio' ? fjsGetRadioCheckedValue(f, 'itsys') : f.itsys.value)) : 1);
	var imedia = fjsGetRadioCheckedValue(f, 'imedia');
	var extras = (e.name == 'cfile' && imedia == 1 ? 'and itsys = "' + itsys + '" and itlang = "' + itlang + '"' : '&itsys=' + itsys + '&itlang=' + itlang);
	// fjsDebug('c: ' + c + ' i: ' + i + ' t: ' + t + ' f: ' + fname + ' itlang: ' + itlang + ' itsys: ' + itsys + ' e.value.length: ' + e.value.length + ' e.value: ' + e.value + ' e.name ' + e.name + ' imedia ' + imedia, 0);
 	if (e.value.length >= 2 && e.value != '' && e.value != (itsys == 2 ? C_WEB_URL : C_SITE_URL) + '?cmod=') {
		var fjsCheckData = function(rows) {
			rows.each(function(row) {
				// fjsDebug('row.itsys: ' + row.itsys + ' row.itlang: ' + row.itlang + ' itsys: ' + itsys + ' itlang: ' + itlang + ' imedia: ' + imedia, 1);			   
				if ((row.id != 0 && row.id != i) && ((row.itsys == itsys && row.itlang == itlang) || (typeof(row.itsys) == 'undefined' || typeof(row.itlang) == 'undefined')) && (e.name != 'cfile')) {
					fjsSetNotAvailableState(e);
				} else if ((row.id == 0 || row.id == i) && ((row.itsys == itsys && row.itlang == itlang) || (typeof(row.itsys) == 'undefined' || typeof(row.itlang) == 'undefined')) && (e.name != 'cfile')) {
					fjsSetAvailableState(e);
				} else if ((row.id != 0 && row.id != i) && ((row.itsys == itsys && row.itlang == itlang) || (typeof(row.itsys) == 'undefined' || typeof(row.itlang) == 'undefined')) && (e.name == 'cfile' && imedia != 2)) {
					fjsSetNotAvailableState(e);
				} else if ((row.id == 0 || row.id == i || (i == 0 && imedia == 2)) && ((row.itsys == itsys && row.itlang == itlang) || (typeof(row.itsys) == 'undefined' || typeof(row.itlang) == 'undefined')) && (e.name == 'cfile')) {
					fjsSetAvailableState(e);
				}
			});
			if ($defined($('clink')) && e.name == 'curl' && $('clink').value != (itsys == 1 ? C_SITE_URL : C_WEB_URL) + '?cmod=' + e.value) {
				$('clink').value = (itsys == 1 ? C_SITE_URL : C_WEB_URL) + '?cmod=' + e.value;
				fjsCheckAvailability($('clink'), i);
			} else if ($defined($('ctitle')) && e.name == 'cname' && fname.indexOf('add', 0) > 0 && $('ctitle').value != e.value) {
				$('ctitle').value = e.value;
				fjsCheckAvailability($('ctitle'), i);
			}
		}
		if (t == C_TBL_MODS) {
			if (Browser.Engine.trident || Browser.Engine.presto) {
				$$('input[name=imedia]').removeEvents('click');
				$$('input[name=imedia]').addEvent('click', function() {
					fjsCheckAvailability($('cfile'), i);
				});
				$$('input[name=itsys]').removeEvents('click');
				$$('input[name=itsys]').addEvent('click', function() {
					fjsCheckMultipleAvailability($$('.' + C_CLASS_INPUT_TEXT_CHECK), i);
				});
			} else {
				$$('input[name=imedia]').removeEvents('change');
				$$('input[name=imedia]').addEvent('change', function() {
					fjsCheckAvailability($('cfile'), i);
				});
				$$('input[name=itsys]').removeEvents('change');
				$$('input[name=itsys]').addEvent('change', function() {
					fjsCheckMultipleAvailability($$('.' + C_CLASS_INPUT_TEXT_CHECK), i);
				});
			}
		}
		fjsGetTableFields(t, fields, c, '=', escape(e.value), extras, 'id', 'desc', '32', fjsCheckData, true);		
	} else {
		fjsSetNotAvailableState(e);
	}
}
var fjsCheckMultipleIfExists = function (e, i) {
	e.each(function(el) {
		fjsCheckIfExists(el, i);
		/* if (C_SYS == 1) { // Gives an error on module edition so don´t use it
			el.addEvents({'blur': fjsCheckIfExists(el, 0), 'change': fjsCheckIfExists(el, 0), 'mouseout': fjsCheckIfExists(el, 0), 'selectend': fjsCheckIfExists(el, 0), 'submit': fjsCheckIfExists(el, 0)});
		} */
	});
}
/*
fjsCheckIfExists()
	Function to checking existence of names on a DB via JSON.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/11/08 Last Modify: 23/05/08 common.js AIO Ver 1.6.3
*/
var fjsCheckIfExists = function (e, i) {
	if (Browser.Engine.trident) {
		e = $(e);
	}
	var c = (e.name.lastIndexOf('_') != -1 ? e.name.split('_')[0] : e.name);
	i = (e.name.lastIndexOf('_') != -1 ? e.name.split('_')[1] : (typeof(i) == 'number' && i > 0 ? i : 0));
	var t = (typeof(e.alt) == 'string' && e.alt != '' ? (e.alt.lastIndexOf('::') != -1 ? e.alt.split('::')[0] : e.alt) : C_TBL_MODS);
	var fields = 'id' + (t == C_TBL_MODS || t == C_TBL_CONSTS || t == C_TBL_ICONS ? ', itsys, itlang' : '');
	var f = e.form;
	// fjsDebug('c: ' + c + ' i: ' + i + ' t: ' + t + ' f: ' + (C_DEFAULT_BROWSER == 'IE' || C_DEFAULT_BROWSER == 'OTHER' ? f.name : f.get('id')) + ' e.value.length: ' + e.value.length + ' e.value: ' + e.value, 0);
	var fjsCheckData = function(rows) {
		rows.each(function(row) {
			// fjsDebug(row.id + ' ' + i, 1);
			if ((row.id >= 1 && e.value.length > 2) || (row.id == i && i != 0 && e.value.length > 2)) {
				fjsSetAvailableState(e);
			} else {
				fjsSetNotAvailableState(e);
			}
		});
	}
	fjsGetTableFields(t, fields, c, '=', escape(e.value), '', 'id', 'desc', '32', fjsCheckData, true);		
}
/*
Script: AIOMenu.js
	Class for a JSON.request enabled infinite categories menu.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 09/11/08 Last Modify: 12/11/08 common.js AIO Ver 1.6.0
*/
var AIOMenu = new Class({
	Implements: [Events, Options],
	options: {
		showDelay: 0,
		curl: C_WEB_URL + '?cmod=json',
		sid: 0,
		preload: false,
		opacity: false
	},
	initialize: function() {
		var params = Array.link(arguments, {options: Object.type, elements: $defined});
		this.setOptions(params.options || null);
		window.onerror = function() {return true;};
		if (params.elements) this.attach(params.elements);
	},
	
	attach: function(elements) {
		var showDelay = this.options.showDelay;
		var curl = this.options.curl;
		var sid = this.options.sid;
		$$(elements).each(function(element) {
			if (Browser.Engine.trident) {					   
				element = $(element); // IE hack
			}
			element.setStyle('cursor', 'pointer');
			element.addEvent('click', function(e) {
				e.stop();
				fjsShowLoading('loading');
				var id = element.get('rev');
				var ib = element.get('rel');
				if ($defined($('divcontainer'))) {
					$('divcontainer').fade('out');
					$('divcontainer').destroy();
				}
				var request = new Request.JSON({
					url: curl,
					method: 'post', // or "get"
					secure: true,
					data: {'cAIOcbFlashAuth': fjsSendCookieBasedAuth(), 'p': 'menu', 'n': 'jtree', 'ib': ib, 'id': id},
					link: 'ignore', // either "cancel" or "chain"
					async: true,
					encoding: C_DEFAULT_CHARSET,
					// headers: '';
					// isSuccess: func() 
					evalScripts: false,
					evalResponse: false,
					emulation: false,
					urlEncoded: true,
					onComplete: function(jsonObj) {
						if (jsonObj && fjsReceiveCookieBasedAuth(jsonObj.jtree) == true) {
							var bret = jsonObj && fjsDropTree(jsonObj.jtree);
							bret = jsonObj && fjsDisplayTree(jsonObj.jtree);
							fjsKillLoading();
						}
					}
				}).send();
			});
		});
		var fjsDropTree = function(jtree) {
			jtree.each(function(jbranch) {
				if (Browser.Engine.trident || Browser.Engine.webkit) {
					if (jbranch.jump == "yes") {
						window.location.replace(C_WEB_URL + '?cmod=' + jbranch.curl);
						return false;
					}
				}
				if (jbranch.jump == "out") {
					navmenu = $('idtrail').get('html').replace(/\s+$/, ""); // Right trim()
					if (!navmenu.search(jbranch.cname) == -1) {
						$('idtrail').empty();
						navmenu.split(' � ' + jbranch.cname).join('');
						$('idtrail').set('html', navmenu + ' � ' + jbranch.cname + '  ');
					}
					if ($defined($("li" + jbranch.curl))) {
						$("li" + jbranch.curl).destroy();
					}
				}
				if (jbranch.jump == "no") {
					if ($defined($("li" + jbranch.curl))) {
						$("li" + jbranch.curl).destroy();
					}
				}
				if (jbranch.jump == "in") {
					navmenu = $('idtrail').get('html').replace(/\s+$/, ""); // Right trim()
					if (navmenu.search(jbranch.cname) == -1) {
						$('idtrail').empty();
						$('idtrail').set('html', navmenu + ' � ' + jbranch.cname + '  ');
					}
				}
				return true;
			});
			return true;
		}
		var fjsDisplayTree = function(jtree) {
			jtree.each(function(jbranch) {
				if (jbranch.jump == "yes") {
					window.location.replace(C_WEB_URL + '?cmod=' + jbranch.curl);
					return false;
				} else if (jbranch.jump == "in") {
					if ($defined($('endli'))) {
						$('endli').fade('out');
						$('endli').destroy();
					}
					licontainer = $("li" + jbranch.curl);
					divcontainer = new Element('div', {'id': 'divcontainer'}).injectAfter(licontainer);
					divcontainer.injectAfter(licontainer);
					$$('.cxaiolimenu').setStyles({'background': 'none', 'background-image': 'none'});
					$$('.cxaiolisubmenu').setStyles({'background': 'none', 'background-image': 'none'});
					licontainer.setStyles({'background': 'url(/img/arrow_right.gif)', 'background-image': 'url(/img/arrow_right.gif)', 'background-repeat': 'no-repeat'});
					e = new Element('li', {'class': 'cxaiolisubmenu', 'id': "endli"}).injectAfter(divcontainer);
					e.setStyles({'background': 'none', 'background-image': 'none', 'opacity': '0'});
					ea = new Element('a', {'class': 'cxaioasubmenu', 'id': "ea"}).inject(e);
					ea.set('text', 'NO SE VE');
					if ($defined(jbranch.chtml) && jbranch.chtml != "") {
						var cubierta = $('cubiertamaincontainer');
						cubierta.setStyle('opacity','0');
						var eop = '<div style="page-break-after: always;"><span style="display: none;">&nbsp;</span></div>';
						var callhtml = decodeURIComponent(jbranch.chtml).replace(/\+/g," ");
						if (callhtml.search(eop) == -1) {
							var chtml = callhtml;
						} else {
							var achtml = callhtml.split(eop);
							var chtml = achtml[0] + '<p class="alignright"><a href="?cmod=' + jbranch.curl + '&ipage=2">' + C_LANG_SIGUIENTE + '<img alt="' + C_LANG_SIGUIENTE + '" class="cxaioimgabsmiddle" id="' + C_ICO_SIGUIENTE + '_1222362052" src="' + C_ICO_PATH + C_ICO_SIGUIENTE + '" title="' + C_LANG_SIGUIENTE + '"></a></p>';
						}
						cubierta.set('html', chtml);
						cubierta.fade('in');
					} else {
						fjsKillLoading();
						// $('cubiertamaincontainer').fade('out');
						// $('cubiertamaincontainer').empty();
					}
				} else if (jbranch.jump == "no") {
					var li = new Element('li', {'class': 'cxaiolisubmenu', 'id': "li" + jbranch.curl}).injectAfter(divcontainer);
					li.setStyles({'background': 'none', 'background-image': 'none', 'opacity': '0'});
					var a = new Element('a', {'class': 'cxaioasubmenu', 'href': '?cmod=' + jbranch.curl, 'id': "a" + jbranch.curl, 'rel': jbranch.id, 'rev': jbranch.ibelong}).inject(li);
					a.set('text', jbranch.cname);
					li.fade('in');
				}
				return true;
			});
			return true;
		}
	}
});
/*
Script: AIOIcons.js
	Class for a nice Icon picker in a popup.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.
*/
var AIOIcons = new Class({
	Implements: [Number, Events, Options],
	options: {
		id: 1,
		cext: '.png',
		itsys: 1,
		curl: C_WEB_URL + '?cmod=json',
		a: 128
	},
	initialize: function(element, options) {
		this.setOptions(options);
		fjsDebug(element);
		var icontochange = $(element);
		var cid = this.options.id; 
		var s = this.options.itsys; 
		var a = this.options.a;
		var ext = this.options.cext;
		var curl = this.options.curl;
		var icosize = fjsGetAppropiateValues(4);
		var i = 1;
		var t = a;
		var d = 1;
		var ojsonAIODisplayParams = new Hash.Cookie('cjsonAIODisplayParams', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_REMEMBER_JS, secure: false});
		var is = 4 + (icontochange.getWidth() < 48 && icontochange.getWidth() > 0 ? icontochange.getWidth() : (ojsonAIODisplayParams.get('icosize') > 0 ? ojsonAIODisplayParams.get('icosize') : fjsGetAppropiateValues(4)));
		var height = ((is * (a.sqrt() - 3)) + 84).round();
		var width = ((is * (a.sqrt() + 4)) + 20).round();
		// alert(width + "x" + height);
		icontochange.setStyle('cursor', 'pointer');
		icontochange.addEvent('click', function(e) {
			fjsShowLoading('loading');
			e.stop();
			var request = new Request.JSON({
				url: curl,
				method: 'post', // or "get"
				secure: true,
				data: {'cAIOcbFlashAuth': fjsSendCookieBasedAuth(), 'p': 'ico', 's': s, 'i': i, 't': t, 'e': ext},
				link: 'ignore', // either "cancel" or "chain"
				async: true,
				encoding: C_DEFAULT_CHARSET,
				// headers: '';
				// isSuccess: func() 
				evalScripts: false,
				evalResponse: false,
				emulation: false,
				urlEncoded: true,
				onComplete: function(jsonObj) {
					if (jsonObj && fjsReceiveCookieBasedAuth(jsonObj.jicoset) == true) {
						var bret = jsonObj && fjsDisplayIcons(jsonObj.jicoset);
						fjsKillLoading();
					}
				}
			}).send();
			var fjsDrawPopup = function(icoset) {
				if ($defined($('jicopopup'))) {
					var jicopopup = $('jicopopup');
					fjsKillIcons();
				} else {
					var jicopopup = new Element('div', {'class': 'cxaiodiv', 'id': 'jicopopup', 'name': 'jicopopup'}).inject(document.body);
				}
				var pos = $(icontochange).getPosition();
				var left = (pos.x - (width + a)).round();
				var top = (pos.y - (height / 2)).round();
				jicopopup.setStyles({'background-color': '#FFFFFF', 'border': '12px solid #EFEFEF', 'cursor': 'move', 'height': height, 'left': left, 'position': 'absolute', 'text-align': 'center', 'top': top, 'visibility': 'visible', 'width': width, 'vertical-align': 'middle', '-webkit-border-radius': '16px', '-moz-border-radius': '16px'});
				if ($defined($('legend'))) {
					var legend = $('legend');
				} else {
					var legend = new Element('div', {'id': 'legend', 'title': C_LANG_MOVER_VENTANA}).inject(jicopopup);
				}
				legend.set('html', i + " / " + t + " (" + icoset[1]['icohm'] + ")");
				legend.setStyles({'cursor': 'move', 'font-weight': 'bolder', 'left': 4, 'position': 'absolute', 'text-align': 'left', 'top': 0, 'vertical-align': 'middle'});
				if ($defined($('closebutton'))) {
					var closebutton = $('closebutton');
				} else {
					var closebutton = new Element('img', {'alt': C_LANG_CERRAR_VENTANA, 'id': 'close', 'src': C_ICO_PATH + C_ICO_CERRAR_VENTANA, 'title': C_LANG_CERRAR_VENTANA}).inject(jicopopup);
				}
				closebutton.setStyles({'cursor': 'pointer', 'left': width - icosize, 'position': 'absolute', 'text-align': 'right', 'top': 0, 'vertical-align': 'top'});
				closebutton.addEvent('click', function(e) {
					e.stop();
					fjsKillIcons();
				});
				if ($defined($('icontainer'))) {
					var icontainer = $('icontainer');
				} else {
					var icontainer = new Element('div', {'id': 'icontainer'}).inject(jicopopup);
					icontainer.setStyles({'cursor': 'default', 'height': height - 84, 'left': 10, 'position': 'absolute', 'text-align': 'center', 'top': 32, 'width': width - 20, 'vertical-align': 'middle', '-webkit-border-radius': '16px', '-moz-border-radius': '16px'});
				}
				if ($defined($('leftbutton'))) {
					var leftbutton = $('leftbutton');
				} else {
					var leftbutton = new Element('img', {'alt': C_LANG_ANTERIORES, 'id': 'left', 'src': C_ICO_PATH + C_ICO_ANTERIORES, 'title': C_LANG_ANTERIORES}).inject(jicopopup);
				}
				leftbutton.setStyles({'cursor': 'pointer', 'left': 0, 'position': 'absolute', 'text-align': 'left', 'top': height - icosize, 'vertical-align': 'bottom'});
				leftbutton.addEvent('click', function(e) {
					e.stop();
					$('jicopopup').removeEvents();
					fjsShowLoadingRelative('loading', $('icontainer'));
					var h = icoset[1]['icohm'];
					var st = i + " " + t;
					i = (i === 1 && t === a && d === 1 ? h - (h % a) + 1 : (i <= 1 ? 1 : i - a));
					t = (i === (h - (h % a) + 1) && t === a && d === 1 ? h : (t <= a ? a : (i <= 1 ? a : (t >= h - (h % a) && i >= t - (h % a) - a ? t - (h % a) : t - a))));
					d = ((i === 1 && t === a) || (i === (h - (h % a) + 1) && t === h) ? 1 : 0);
					// alert(st + " => " + i + " " + t + " : " + d);
					var request = new Request.JSON({
						url: curl,
						method: 'post', // or "get"
						secure: true,
						data: {'cAIOcbFlashAuth': fjsSendCookieBasedAuth(), 'p': 'ico', 's': s, 'i': i, 't': t, 'e': ext},
						link: 'ignore', // either "cancel" or "chain"
						async: true,
						encoding: C_DEFAULT_CHARSET,
						// headers: '';
						// isSuccess: func() 
						evalScripts: false,
						evalResponse: false,
						emulation: false,
						urlEncoded: true,
						onComplete: function(jsonObj) {
							if (jsonObj && fjsReceiveCookieBasedAuth(jsonObj.jicoset) == true) {
								var bret = jsonObj && fjsDisplayIcons(jsonObj.jicoset);
								fjsKillLoading();
							}
						}
					}).send();
				});
				if ($defined($('rightbutton'))) {
					var rightbutton = $('rightbutton');
				} else {
					var rightbutton = new Element('img', {'alt': C_LANG_PROXIMOS, 'id': 'next', 'src': C_ICO_PATH + C_ICO_SIGUIENTES, 'title': C_LANG_PROXIMOS}).inject(jicopopup);
				}
				rightbutton.setStyles({'cursor': 'pointer', 'left': width - icosize, 'position': 'absolute', 'text-align': 'right', 'top': height - icosize, 'vertical-align': 'bottom'});
				rightbutton.addEvent('click', function(e) {
					e.stop();
					$('jicopopup').removeEvents();
					fjsShowLoadingRelative('loading', $('icontainer'));
					var h = icoset[1]['icohm'];
					var st = i + " " + t;
					i = (i === (h - (h % a) + 1) && t === h && d === 1 ? 1 : (i <= h - a ? (i + a >= h ? h - (h % a) : i + a) : (i >= h - (h % a) ? h - (h % a) + 1 : h - a)));
					t = (i === 1 && t === h && d === 1 ? a : (t <= h ? (t + a >= h ? h : t + a) : h));
					d = ((i === (h - (h % a) + 1) && t === h) || (i === 1 && t === a) ? 1 : 0);
					// alert(st + " => " + i + " " + t + " : " + d);
					var request = new Request.JSON({
						url: curl,
						method: 'post', // or "get"
						secure: true,
						data: {'cAIOcbFlashAuth': fjsSendCookieBasedAuth(), 'p': 'ico', 's': s, 'i': i, 't': t, 'e': ext},
						link: 'ignore', // either "cancel" or "chain"
						async: true,
						encoding: C_DEFAULT_CHARSET,
						// headers: '';
						// isSuccess: func() 
						evalScripts: false,
						evalResponse: false,
						emulation: false,
						urlEncoded: true,
						onComplete: function(jsonObj) {
							if (jsonObj && fjsReceiveCookieBasedAuth(jsonObj.jicoset) == true) {
								var bret = jsonObj && fjsDisplayIcons(jsonObj.jicoset);
								fjsKillLoading();
							}
						}
					}).send();
				});
				var drag = new Drag.Move($(jicopopup), {});
			};
			var fjsDisplayIcons = function(icoset) {
				fjsDrawPopup(icoset);
				icoset.each(function(ico) {
					var thumb = new Element('img', {'hspace': 2, 'id': ico.icofile, 'src': ico.icopath + ico.icofile, 'title': ico.icofile, 'vspace': 2}).inject($('icontainer'));
					thumb.setStyles({'cursor': 'pointer', 'text-align': 'center', 'vertical-align': 'middle'});
					var cfile = $(element.get('id'));
					var cpath = ico.icopath + ico.icofile;
					var backupsrc = cfile.get('src');
					if (C_CFG_USE_TOOGLE_EDIT_FIELD_GADGET == 'on') {
						var backupvalue = $('is_cvalue_' + cid).get('text');
					} else {
						var backupvalue = $('cvalue_' + cid).get('value');
					}
					$(ico.icofile).addEvent('mouseover', function(e) {
						e.stop();
						cfile.set('src', cpath);
						if (C_CFG_USE_TOOGLE_EDIT_FIELD_GADGET == 'on') {
							$('is_cvalue_' + cid).set('text', ico.icofile);
						} else {
							$('cvalue_' + cid).set('value', ico.icofile);
						} 
					});
					$(ico.icofile).addEvent('mouseout', function(e) {
						e.stop();
						cfile.set('src', backupsrc);
						if (C_CFG_USE_TOOGLE_EDIT_FIELD_GADGET == 'on') {
							$('is_cvalue_' + cid).set('text', backupvalue);
						} else {
							$('cvalue_' + cid).set('value', backupvalue);
						}
					});
					$(ico.icofile).addEvent('dblclick', function(e) {
						e.stop();
						$(cfile).set('src', cpath);
						if (C_CFG_USE_TOOGLE_EDIT_FIELD_GADGET == 'on') {
							$('is_cvalue_' + cid).set('text', ico.icofile);
							fjsToogleEditField($('is_cvalue_' + cid));
						}
						$('cvalue_' + cid).set('value', ico.icofile);
						fjsKillIcons();
					});
				});
				fjsKillLoadingRelative();
			};
			var fjsKillIcons = function() {
				$('jicopopup').removeEvents();
				$('icontainer').empty();
				$('jicopopup').setStyle('visibility', 'hidden');
			};
		});
	}
});
/*
Script: AIOZoom.js and AIOScroller.js
	Class for creating nice zoom/magnifiying glass-like scroll windows that follow the mouse cursor when hovering an image element. Plus title and caption. Based on MooTools plugin Tips.js.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.
*/
var AIOZoom = new Class({

	Implements: [Events, Options],

	options: {
		onShow: function(zoom) {
			zoom.setStyle('visibility', 'visible');
		},
		onHide: function(zoom) {
			zoom.setStyle('visibility', 'hidden');
		},
		showDelay: 64,
		hideDelay: 64,
		scrollDelay: 8,
		className: null,
		offsets: {x: 64, y: 32},
		fixed: false,
		glass: false,
		debug: false,
		debugPos: false,
		debugMouse: false,
		opacity: false,
		preload: false
	},

	initialize: function() {
		var params = Array.link(arguments, {options: Object.type, elements: $defined});
		this.setOptions(params.options || null);
		this.zoomwindow = new Element('div', {'id': 'zoomwindow'}).inject(document.body);
		if (this.options.preload) {
			this.zoomcache = new Element('div', {'id': 'zoomcache'}).inject(document.body);
		}
		if (this.options.glass) {
			this.aiozoomcursor = Element('div', {'id': 'aiozoomcursor', 'class': 'zoomcursor'}).inject(document.body);
		}
		if (this.options.className) this.zoomwindow.addClass(this.options.className);
		this.zoomcontainer = new Element('div', {'id': 'zoomcontainer'}).inject(this.zoomwindow);
		this.zoomwindow.setStyles({'border': '10px solid #fff', position: 'absolute', top: 0, left: 0, visibility: 'hidden'});
		if (params.elements) this.attach(params.elements);
	},
	
	attach: function(elements) {
		var count = 0;
		$$(elements).each(function(element) {
			var title = element.retrieve('zoom:title', element.get('title'));
			var longdesc = element.retrieve('zoom:longdesc', element.get('longdesc') || element.get('href'));
			var aioimg = element.retrieve('zoom:alt', element.get('alt'));
			if (this.options.preload) {
				var preloadqueue = this.zoomcache.get('html') + '<img id="cacheimage' + count + '" src="' + aioimg + '" style="position: absolute; top: 0; left: 0; visibility: hidden;" />';
				this.zoomcache.set('html', preloadqueue);
			}
			var enter = element.retrieve('zoom:enter', this.elementEnter.bindWithEvent(this, element));
			var leave = element.retrieve('zoom:leave', this.elementLeave.bindWithEvent(this, element));
			var move = element.retrieve('zoom:move', this.elementMove.bindWithEvent(this, element));
			element.addEvents({mouseenter: enter, mouseleave: leave, mousemove: move});
			if (this.options.glass) {
				var vanish = this.aiozoomcursor.retrieve('zoom:vanish', this.elementVanish.bindWithEvent(this, this.aiozoomcursor));
				this.aiozoomcursor.addEvent('mouseover', vanish);
				element.setStyle('cursor', 'none');
			} else {
				element.setStyle('cursor', 'crosshair');
			}
			element.store('zoom:alter', element.get('alt'));
			element.erase('alt');
			element.store('zoom:native', element.get('title'));
			element.erase('title');
			count = count + 1;
		}, this);
		return this;
	},
	
	detach: function(elements) {
		$$(elements).each(function(element) {
			element.removeEvent('mouseenter', element.retrieve('zoom:enter') || $empty);
			element.removeEvent('mouseleave', element.retrieve('zoom:leave') || $empty);
			element.removeEvent('mousemove', element.retrieve('zoom:move') || $empty);
			element.eliminate('zoom:enter').eliminate('zoom:leave').eliminate('zoom:move');
			if (this.options.glass) {
				this.aiozoomcursor.removeEvent('mouseover', this.aiozoomcursor.retrieve('zoom:vanish') || $empty);
				this.aiozoomcursor.eliminate('zoom:vanish');
			}
			var orig = element.retrieve('zoom:alter');
			if (orig) element.set('alt', orig);
			var original = element.retrieve('zoom:native');
			if (original) element.set('title', original);
		});
		return this;
	},
	
	elementEnter: function(event, element) {
		if (this.options.opacity) {
			$(document.body).fade(this.options.opacity);
		}
		$A(this.zoomcontainer.childNodes).each(Element.dispose);
		this.aioframe = new Element('div', {'id': 'aioframe'}).inject(this.zoomcontainer);
		this.aioinside = new Element('div', {'id': 'aioinside'}).inject(this.aioframe);
		var title = element.retrieve('zoom:title');
		if (title) {
			this.titleElement = new Element('div', {'id': 'zoomtitle', 'class': 'zoomtitle'}).inject(this.zoomcontainer, 'bottom');
			this.fill(this.titleElement, title);
			
		}
		var longdesc = element.retrieve('zoom:longdesc');
		if (longdesc) {
			this.textElement = new Element('div', {'id': 'zoomlongdesc', 'class': 'zoomlongdesc'}).inject(this.zoomcontainer, 'bottom');
			this.fill(this.textElement, longdesc);
		}
		this.timer = $clear(this.timer);
		this.timer = this.show.delay(this.options.showDelay, this);
		this.position((!this.options.fixed) ? event : {page: element.getPosition()});
		this.aioscroll = new AIOScroller(element, {debug: this.options.debug, scrollDelay: this.options.scrollDelay, preload: this.options.preload, glass: this.options.glass, onChange: function(x, y) {
				var frame = $('aioframe');
				var imgnum = $A($$('.AIOZoom')).indexOf(element);
				var aioimgid = 'cacheimage' + imgnum;
				if (this.options.preload) {
					var aioimage = $(aioimgid);
					var aioimgstr = aioimage.retrieve('zoom:src', aioimage.get('src'));
					var sizei = {x: aioimage.width, y: aioimage.height};
				} else {
					if (!$defined($(aioimgid))) {
						var aioimgstr = element.retrieve('zoom:alt', element.get('alt'));
						var aioimage = new Element('img', {'id': 'cacheimage' + imgnum, 'src': aioimgstr}).inject($(document.body));
						aioimage.setStyles({'position': 'absolute', 'top': 0, 'left': 0, 'visibility': 'hidden'});
					} else {
						var aioimage = $(aioimgid);
						var aioimgstr = aioimage.retrieve('zoom:src', aioimage.get('src'));
					}
					var sizei = {x: aioimage.width, y: aioimage.height};
				}
				var sizet = {x: element.width, y: element.height};
				var scalex = (sizei['x'] / sizet['x']);
				var scaley = (sizei['y'] / sizet['y']);
				var pos = element.getPosition();
				if (this.options.glass) {
					var aiozoomcursor = $('aiozoomcursor')
					var sizecursorx = sizet['x'] / (scalex / 1.5);
					var sizecursory = sizet['y'] / (scaley / 1.5);
					aiozoomcursor.setStyles({'width': sizecursorx, 'height': sizecursory, 'left': (x + pos.x - (sizecursorx / 2)), 'top': (y + pos.y - (sizecursory / 2)), 'visibility': 'visible', 'opacity': 0.5});
					// aiozoomcursor.fireEvent('mouseenter', aiozoomcursor);
				}
				var sizeframex = sizet['x'] * (scalex / 2);
				var sizeframey = sizet['y'] * (scaley / 2);
				$('aioframe').setStyles({'overflow': 'hidden', 'width': sizeframex, 'height': sizeframey});
				$('aioinside').setStyles({'background': 'url(' + aioimgstr + ')', 'background-repeat': 'no-repeat', 'width': sizei['x'], 'height': sizei['y']});
				($defined($('zoomtitle')) ? $('zoomtitle').setStyle('width', sizeframex) : '');
				($defined($('zoomlongdesc')) ? $('zoomlongdesc').setStyle('width', sizeframex) : '');
				var xp = (x * (scalex / 2)) + x;
				var yp = (y * (scaley / 2)) + x;
				frame.scrollTo(xp, yp);
				if (this.options.debug) {
					var debug = ($defined($('debug')) ? $('debug') : $('zoomtitle'));
					debug.set('text', 'X: ' + x + ' Y: ' + y + ' Xp: ' + xp + ' Yp: ' + yp + ' (Escala X: ' + scalex + ' Escala Y: ' + scaley + ')' + ' (Frame X: ' + sizeframex + ' Frame Y: ' + sizeframey + ')' + ' (Cursor size X: ' + sizecursorx + ' Cursor size Y: ' + sizecursory + ')' + ' (left: ' + (x + pos.x) + ' top: ' + (y + pos.y) + ')');
				}
			}
		});
/*		if (this.options.opacity) {
			element.addEvent('click', function () { 
				$('zoomwindow').fade(0);
				$(document.body).fade(0);
			});
		} */
		element.addEvent('mouseout', this.aioscroll.stop.bind(this.aioscroll));
		element.addEvent('mousemove', this.aioscroll.start.bind(this.aioscroll));
		element.addEvent('mouseleave', this.aioscroll.stop.bind(this.aioscroll));
	},
	
	elementLeave: function(event) {
		if (this.options.opacity) {
			$(document.body).fade(1);
		}
		$clear(this.timer);
		this.timer = this.hide.delay(this.options.hideDelay, this);
	},
	
	elementMove: function(event, element) {
		if (this.options.debugMouse) {
			var debugmouse = ($defined($('debugmouse')) ? $('debugmouse') : $('zoomtitle'));
			var size = element.getSize(), scroll = element.getScrollSize(), pos = element.getPosition(), change = {'x': 0, 'y': 0}, page = event.page;
			for (var z in page) {
				if (page[z] < (size[z] + pos[z]) && scroll[z] != 0)
					change[z] = (page[z] - size[z] - pos[z]);
				else if (page[z] + size[z] > (size[z] + pos[z]) && size[z] + size[z] != scroll[z])
					change[z] = (page[z] - pos[z]);
			}
			if (change.y || change.x) { 
				debugmouse.set('text', 'X: ' + (pos['x'] + change.x) + ' Y: ' + (pos['y'] + change.y));
			}
		}
		if (this.options.glass) {
			$('aiozoomcursor').setStyles({'left': 0, 'top': 0, 'visibility': 'hidden'});
		}
	},
	
	elementVanish: function(event, element) {
		this.timer = $clear(this.timer);
		this.timer = this.show.delay(this.options.showDelay, this);
		this.position((!this.options.fixed) ? event : {page: element.getPosition()});
		this.fireEvent('show', this.zoomwindow);
	},
	
	position: function(event) {
		var size = window.getSize(), scroll = window.getScrollSize();
		var zoom = {x: this.zoomwindow.offsetWidth, y: this.zoomwindow.offsetHeight};
		var props = {x: 'left', y: 'top'};
		var debugposition;
		for (var z in props) {
			var pos = event.page[z] + this.options.offsets[z];
			if ((pos + zoom[z] - scroll[z]) > size[z]) pos = event.page[z] - this.options.offsets[z] - zoom[z];
			this.zoomwindow.setStyle(props[z], pos);
			if (this.options.debugPos) {
				if (!$defined(debugposition)) {
					var debugposition = pos;
				}
				var debugpos = ($defined($('debugpos')) ? $('debugpos') : $('zoomlongdesc'));
				debugpos.set('text', 'window size: left: ' + size['x'] +  ' top: ' + size['y'] + ' scroll size: left: ' + scroll['x'] +  ' top: ' + scroll['y'] + ' zoom size: left: ' + zoom['x'] +  ' top: ' + zoom['y'] + ' SO left: ' + debugposition + ' top: ' + pos);
			}
		}
	},
	
	fill: function(element, contents) {
		(typeof contents == 'string') ? element.set('html', contents) : element.adopt(contents);
	},

	show: function() {
		this.fireEvent('show', this.zoomwindow);
	},

	hide: function() {
		this.fireEvent('hide', this.zoomwindow);
	}

});
var AIOScroller = new Class({

	Implements: [Events, Options],

	options: {
		debug: false,
		preload: true,
		glass: false,
		scrollDelay: 50,
		onChange: function(x, y) {
			this.element.scrollTo(x, y);
		}
	},

	initialize: function(element, options) {
		this.setOptions(options);
		this.element = $(element);
		this.timer = null;
		this.coord = this.getCoords.bind(this);
	},

	start: function() {
		this.element.addEvent('mousemove', this.coord);
	},

	stop: function() {
		this.element.removeEvent('mousemove', this.coord);
		this.timer = $clear(this.timer);
	},

	getCoords: function(event) {
		this.page = event.page;
		if (!this.timer) this.timer = this.scroll.periodical(this.options.scrollDelay, this);
	},

	scroll: function() {
		var size = this.element.getSize(), scroll = this.element.getScrollSize(), pos = this.element.getPosition(), change = {'x': 0, 'y': 0};
		for (var z in this.page) {
			if (this.page[z] < (size[z] + pos[z]) && scroll[z] != 0)
				change[z] = (this.page[z] - size[z] - pos[z]);
			else if (this.page[z] + size[z] > (size[z] + pos[z]) && size[z] + size[z] != scroll[z])
				change[z] = (this.page[z] - pos[z]);
		}
		if (change.y || change.x) this.fireEvent('change', [scroll.x + change.x, scroll.y + change.y]);
	}
});
function fjsChkUsrForm(f) {
	f = $(f);
	var okSoFar = true
	with (f) {
		var foundAt = cemail.value.indexOf("@", 0);
		if (foundAt < 1 && okSoFar) {
			okSoFar = false;
			alert(C_LANG_INGRESE_UNA_DIRECCION_DE_EMAIL_VALIDA);
			cemail.focus();
		}
		if ($defined($(C_ICO_NO_DISPONIBLE + '_icemail')) && $(C_ICO_NO_DISPONIBLE + '_icemail').get('alt').substr(0, 2) == 'No' && okSoFar) {
			okSoFar = false;
			alert(C_LANG_EL_EMAIL_INGRESADO_YA_SE_ENCUENTRA_EN_USO_DOT);
			cemail.focus();
		}
		if (cusr.value == "" && okSoFar) {
			if (typeof(bforgot) == 'undefined') {
				okSoFar = false;
				alert(C_LANG_POR_FAVOR_INGRESE_NOMBRE_DE_USUARIO);
				cusr.focus();
			}
		}
		if ($defined($(C_ICO_NO_DISPONIBLE + '_icusr')) && $(C_ICO_NO_DISPONIBLE + '_icusr').get('alt').substr(0, 2) == 'No' && okSoFar) {
			okSoFar = false;
			alert(C_LANG_EL_NOMBRE_DE_USUARIO_INGRESADO_YA_SE_ENCUENTRA_EN_USO_DOT);
			cusr.focus();
		}
		if (typeof(ccurpass) != 'undefined' && ccurpass.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_SU_CLAVE_ACTUAL);
			ccurpass.focus();
		}
		if (typeof(cnewpass) != 'undefined' && cnewpass.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_SU_CLAVE_NUEVA);
			cnewpass.focus();
		}
		if (typeof(cnewmpass) != 'undefined' && cnewmpass.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_REPITA_SU_CLAVE_NUEVA);
			cnewmpass.focus();
		}
		if (typeof(cnewpass) != 'undefined' && $defined(cnewmpass) && cnewpass.value != cnewmpass.value && okSoFar) {
			okSoFar = false;
			alert(C_LANG_LAS_CLAVES_NUEVAS_NO_COINCIDEN);
			cnewpass.focus();
		}
		if (typeof(cpass) != 'undefined' && cpass.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_SU_CLAVE);
			cpass.focus();
		}
		if (typeof(cmpass) != 'undefined' && cmpass.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_SU_CLAVE_OTRA_VEZ);
			cmpass.focus();
		}
		if (typeof(cpass) != 'undefined' && $defined(cmpass) && cpass.value != cmpass.value && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_REINTENTE_LAS_CLAVES_NO_COINCIDEN);
			cpass.focus();
		}
		if (typeof(cpass) != 'undefined' && okSoFar && cpass.value.length < C_CFG_MIN_REG_LEN_PASS) {
			okSoFar = false;
			alert(C_LANG_LA_CLAVE_DE_USUARIO_NO_PUEDE_SER_MENOR_A + ' ' + C_CFG_MIN_REG_LEN_PASS + ' ' + C_LANG_CARACTERES);
			cpass.focus();
		}
		if (typeof(cpass) != 'undefined' && okSoFar && cpass.value.length > C_CFG_MAX_REG_LEN_PASS) {
			okSoFar = false;
			alert(C_LANG_LA_CLAVE_DE_USUARIO_NO_PUEDE_SER_MAYOR_A + ' ' + C_CFG_MAX_REG_LEN_PASS + ' ' + C_LANG_CARACTERES);
			cpass.focus();
		}
		if (typeof(cname) != 'undefined' && cname.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_SU_NOMBRE);
			cname.focus();
		}
		if (typeof(clastname) != 'undefined' && clastname.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_SU_APELLIDO);
			clastname.focus();
		}
		if (typeof(ctel) != 'undefined' && ctel.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_SU_TELEFONO);
			ctel.focus();
		}
		if (typeof(cterms) != 'undefined' && cterms.checked == false && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_DEBE_ACEPTAR_LOS_TERMINOS_Y_CONDICIONES_DE_USO);
			cterms.focus();
		}
		if (ccaptcha.value == "" && okSoFar) {
			okSoFar = false;
			alert(C_LANG_POR_FAVOR_INGRESE_LA_VALIDACION_DE_SEGURIDAD);
			ccaptcha.focus();
		}
		if (okSoFar == true) {
			submit();
			return true;
		} else {
			return false;
		}
	}
}
function fjsChkForgotForm(f) {
	f = $(f);
	var okSoFar = true
	with (f) {
		if (($defined($('cemail')) && cemail.value == "") && ($defined($('cusr')) && cusr.value == "") && okSoFar) {
			alert(C_LANG_DEBE_INGRESAR_SU_USUARIO_O_SU_EMAIL_PARA_IDENTIFICARLO_EN_LA_BASE_DE_DATOS);
		} else {
			if ($defined($('cemail')) && cemail.value != "") {
				var foundAt = cemail.value.indexOf("@", 0);
				if (foundAt < 1 && okSoFar) {
					okSoFar = false;
					alert(C_LANG_INGRESE_UNA_DIRECCION_DE_EMAIL_VALIDA);
					cemail.focus();
				}
				if ($defined($(C_ICO_NO_DISPONIBLE + '_icemail')) && $(C_ICO_NO_DISPONIBLE + '_icemail').get('alt').substr(0, 2) == 'No' && okSoFar) {
					okSoFar = false;
					alert(C_LANG_EL_EMAIL_INGRESADO_NO_SE_ENCUENTRA_EN_EL_SISTEMA);
					cemail.focus();
				}
			} else {
				if ($defined($('cusr')) && cusr.value == "" && okSoFar) {
					okSoFar = false;
					alert(C_LANG_POR_FAVOR_INGRESE_NOMBRE_DE_USUARIO);
					cusr.focus();
				}
				if ($defined($(C_ICO_NO_DISPONIBLE + '_icusr')) && $(C_ICO_NO_DISPONIBLE + '_icusr').get('alt').substr(0, 2) == 'No' && okSoFar) {
					okSoFar = false;
					alert(C_LANG_EL_NOMBRE_DE_USUARIO_INGRESADO_NO_SE_ENCUENTRA_EN_EL_SISTEMA);
					cusr.focus();
				}
			}
			if (ccaptcha.value == "" && okSoFar) {
				okSoFar = false;
				alert(C_LANG_POR_FAVOR_INGRESE_LA_VALIDACION_DE_SEGURIDAD);
				ccaptcha.focus();
			}
		}
		if (okSoFar == true) {
			submit();
			return true;
		} else {
			return false;
		}
	}
}
function fjsValidateFormContact() {
	var okSoFar = true;
	var foundAt = $('cemail').value.indexOf("@", 0);
	if ($('cname').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_NOMBRE);
		$('cname').focus();
	}
	if ($('clastname').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_APELLIDO);
		$('clastname').focus();
	}
	if (($('clastname').value == "" || foundAt < 1) && okSoFar) {
		okSoFar = false;
		alert(C_LANG_INGRESE_UNA_DIRECCION_DE_EMAIL_VALIDA);
		$('cemail').focus();
	}
	if ($('caddress').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_DIRECCION);
		$('caddress').focus();
	}
	if ($('ccity').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_CIUDAD);
		$('ccity').focus();
	}
	if ($('czip').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_CODIGO_POSTAL);
		$('czip').focus();
	}
	if ($('cstate').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_PROVINCIA);
		$('cstate').focus();
	}
	if ($('ccountry').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_PAIS);
		$('ccountry').focus();
	}
	if ($('ctel').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_TELEFONO);
		$('ctel').focus();
	}
	if ($('cjob').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_SU_OCUPACION);
		$('cjob').focus();
	}
	if ($('csubject').value == "" && okSoFar) {
		okSoFar = false;
		alert(C_LANG_POR_FAVOR_INGRESE_EL_MOTIVO_O_ASUNTO);
		$('csubject').focus();
	}
	if (okSoFar == true) {
		$('fcontact').submit();
		return true;
	} else {
		return false;
	}
}
function fjsNoRightClick() {
	window.addEvent('click', function(e) {
		if (e.rightClick) {
			e.stop();
			alert(fjsDecodeAccents(C_MSG_NO_RIGHT_CLICK));
		}
	});
	function rightClickIE(e) {
		if (Browser.Engine.trident || Browser.Engine.webkit) {
			if (event.button == 2 || event.button == 3) {
				alert(fjsDecodeAccents(C_MSG_NO_RIGHT_CLICK));
				return false;
			}
		}
		return true;
	}
	document.onmousedown = rightClickIE;
}
// csshorizontalmenu
var fjsActivateMenu = function(nav) {
    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
       var navroot = document.getElementById(nav);
		/* Get all the list items within the menu */
		var lis = navroot.getElementsByTagName("LI");  
        for (i = 0; i < lis.length; i++) {
           /* If the LI has another menu lvl */
            if (lis[i].lastChild.tagName == "UL") {
                /* assign the function to the LI */
             	lis[i].onmouseover = function() {	
                   /* display the inner menu */
                   this.lastChild.style.display = "block";
                }				
                lis[i].onmouseout = function() {                       
                   this.lastChild.style.display = "none";
                }
            }
        }
  	}
}
var fjsActivateMooMenu = function () {
   $("#zone-bar li em").addEvent("click", function() {
		$("#zone-bar>ul>li>ul").hide()        
	   	$("#zone-bar>ul>li>a").removeClass();
	   	if ($(this).parents("li").children("ul").is(":hidden")) {
	   		$(this).parents("li").children("ul").toggle().parents("li").children("a").addClass("zoneCur");
	   	} 
   });
}
function fjsAIOTracker(cc, sid, cid) {
	var nu = 0;
	var res = 0;
	var col = 0;
	var ref = '';
	var ec = 0;
	var cuaiotrk = '';
	var cpu = '';
	var taint = 0;
	var date = new Date();
	var datetime = date.getFullYear() + "-" + (date.getMonth() < 9 ? "0" + (date.getMonth() + 1) : (date.getMonth() + 1)) + "-" + (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " " + (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":" + (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) + ":" + (date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds());
	var browser = navigator.appName;
	var online = (navigator.onLine ? 1 : 0);
	if (browser != 'Netscape') {
		cpu = navigator.cpuClass;
	} else {
		cpu = navigator.oscpu;
	}
	var java = navigator.javaEnabled();
	var hjava = (java == 0 ? 0 : 1);
	/* further try:
	window.java: object
	window.java.lang: object
	window.java.lang.System: function
	window.java.lang.System.getProperty("java.version"): 1.6.0_02
	window.java.lang.System.getProperty("java.vendor"): Sun Microsystems Inc. */
	var lb = (browser == 'Netscape' ? navigator.language : navigator.userLanguage);
	var sl = (browser == 'Netscape' ? 0 : navigator.systemLanguage);
	var version = escape(navigator.appVersion);
	var xhr = (Browser.Features.xhr ? 1 : 0);
	var engine = Browser.Engine.name;
	var ver = Browser.Engine.version;
	var flashver = Browser.Plugins.Flash.version;
	var flashbuild = Browser.Plugins.Flash.build;
	var plataform = Browser.Platform.name;
	var xpath = (Browser.Features.xpath ? 1 : 0);
	var bd = 0;
	var dxdpi = 0;
	var dydpi = 0;
	var lxdpi = 0;
	var lydpi = 0;
	var fse = 0;
	var ui = 0;
	var bl = '';
	var sp = '';
	if (Browser.Engine.trident) {
		bd = screen.bufferDepth;
		dxdpi = screen.deviceXDPI;
		dydpi = screen.deviceYDPI;
		lxdpi = screen.logicalXDPI;
		lydpi = screen.logicalYDPI;
		fse = (screen.fontSmoothingEnabled == false ? 0 : 1);
		ui = screen.updateInterval;
		bl = navigator.browserLanguage;
		taint = navigator.taintEnabled();
	} else if (Browser.Engine.presto) {
		bl = navigator.browserLanguage;
		taint = navigator.taintEnabled();
	} else if (Browser.Engine.gecko) {
		sp = navigator.securityPolicy;
		taint = navigator.taintEnabled();
	}
	taint = (taint == 0 ? 0 : 1);
	if (parent.document.referrer != '') {
		ref = escape(parent.document.referrer);
	} else if (top.document.referrer != '') {
		ref = escape(top.document.referrer);
	} else {
		ref = escape(document.referrer);
	}
	if (typeof(screen) == 'object') {
		res = screen.width + 'X' + screen.height;
		if (browser != 'Netscape') {
			col = screen.colorDepth;
		} else {
			col = screen.pixelDepth;
		}	
	} else {
		res = window.getWidth() + 'X' + window.getHeight();
	}
	if (Boolean(navigator.cookieEnabled) == true) {
		var bochng = false;
		var ojsonAIOXtrk = new Hash.Cookie('cjsonAIOXtrk', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_REMEMBER_JS, secure: false});
		ojsonAIOXtrk.load();
		if (Boolean(ojsonAIOXtrk.getLength()) == false) {
			ojsonAIOXtrk.empty();
			ojsonAIOXtrk = new Hash.Cookie('cjsonAIOXtrk', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_REMEMBER_JS, secure: false});
			nu = 1;
			ojsonAIOXtrk.extend({
				'cuaiotrk': sid,
				'hjava': hjava,
				'taint': taint,
				'cpu': cpu,
				'browser': browser,
				'version': version,
				'xhr': xhr,
				'engine': engine,
				'ver': ver,
				'flashver': flashver,
				'flashbuild': flashbuild,
				'plataform': plataform,
				'xpath': xpath,
				'fse': fse
			});
			bochng = true;
		} else {
			if (ojsonAIOXtrk.get('hjava') != hjava) {
				ojsonAIOXtrk.set('hjava', hjava);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('taint') != taint) {
				ojsonAIOXtrk.set('taint', taint);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('cpu') != cpu) {
				ojsonAIOXtrk.set('cpu', cpu);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('browser') != browser) {
				ojsonAIOXtrk.set('browser', browser);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('version') != version) {
				ojsonAIOXtrk.set('version', version);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('xhr') != xhr) {
				ojsonAIOXtrk.set('xhr', xhr);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('engine') != engine) {
				ojsonAIOXtrk.set('engine', engine);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('ver') != ver) {
				ojsonAIOXtrk.set('ver', ver);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('flashver') != flashver) {
				ojsonAIOXtrk.set('flashver', flashver);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('flashbuild') != flashbuild) {
				ojsonAIOXtrk.set('flashbuild', flashbuild);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('plataform') != plataform) {
				ojsonAIOXtrk.set('plataform', plataform);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('xpath') != xpath) {
				ojsonAIOXtrk.set('xpath', xpath);
				bochng = true;
			}
			if (ojsonAIOXtrk.get('fse') != fse) {
				ojsonAIOXtrk.set('fse', fse);
				bochng = true;
			}
		}
		cuaiotrk = sid;
		ec = ojsonAIOXtrk.getLength();
	}
	if (xhr == 1 && C_TRACK_METHOD.split('||')[0].substr(0, 3) == 'xhr') {
		var request = new Request({
			url: C_WEB_URL + '?cmod=trk',
			method: 'post', // or "get"
			data: {
				'cAIOcbFlashAuth': fjsSendCookieBasedAuth(),
				'cuaiotrk': cuaiotrk, 
				'cid': cid, 
				'referrer': ref,
				'time': datetime,
				'tag': 3,
				'lb': lb,
				'hjava': hjava,
				'taint': taint,
				'res': res,
				'col': col,
				'ec': ec,
				'nu': nu,
				'sl': sl,
				'online': online,
				'cpu': cpu,
				'browser': browser,
				'version': version,
				'sid': sid,
				'xhr': xhr,
				'engine': engine,
				'ver': ver,
				'flashver': flashver,
				'flashbuild': flashbuild,
				'plataform': plataform,
				'xpath': xpath,
				'bd': bd,
				'dxdpi': dxdpi,
				'dydpi': dydpi,
				'lxdpi': lxdpi,
				'lydpi': lydpi,
				'fse': fse,
				'ui': ui,
				'bl': bl,
				'sp': sp,
				'hjs': 1
			},
			link: 'ignore', // either "cancel" or "chain"
			async: true,
			encoding: C_DEFAULT_CHARSET,
			// headers: '';
			// isSuccess: func() 
			evalScripts: false,
			evalResponse: false,
			emulation: false,
			urlEncoded: true
		}).send();
	} else {
		var a = "<img alt=\"\" border=\"0\" id=\"i" + cuaiotrk + "\" height=\"1\" src=\"" + C_WEB_URL + "?cmod=trk";
		var b = "&cuaiotrk=" + cuaiotrk;
		var c = "&cid=" + cid;
		var d = "&referrer=" + ref;
		var e = "&time=" + datetime;
		var f = "&tag=2";
		var g = "&lb=" + lb;
		var h = "&hjava=" + hjava;
		var i = "&taint=" + taint;
		var j = "&res=" + res;
		var k = "&col=" + col;
		var l = "&ec=" + ec;
		var m = "&nu=" + nu;
		var n = "&sl=" + sl;
		var o = "&online=" + online;
		var p = "&cpu=" + cpu;
		var q = "&browser=" + browser;
		var r = "&version=" + version;
		var s = "&sid=" + sid;
		var t = "&xhr=" + xhr;
		var u = "&engine=" + engine;
		var v = "&ver=" + ver;
		var w = "&flashver=" + flashver;
		var x = "&flashbuild=" + flashbuild;
		var y = "&plataform=" + plataform;
		var z = "&xpath=" + xpath;
		var aa = "&bd=" + bd;
		var ab = "&dxdpi=" + dxdpi;
		var ac = "&dydpi=" + dydpi;
		var ad = "&lxdpi=" + lxdpi;
		var ae = "&lydpi=" + lydpi;
		var af = "&fse=" + fse;
		var ag = "&ui=" + ui;
		var ah = "&bl=" + bl;
		var ai = "&sp=" + sp;
		var aj = "&hjs=1";
		var ak = "&cAIOcbFlashAuth=" + fjsSendCookieBasedAuth();
		var end = "\" width=\"1\" />";
		var str = a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + aa + ab + ac + ad + ae + af + ag + ah + ai + aj + ak + end;
		$(cc).set('html', str);
	}
	return (bochng == true ? ojsonAIOXtrk.save() : true);
}
function fjsAddToSearchEngines(cc) {
    // if (window.external && (("IsSearchProviderInstalled" in window.external && window.external.IsSearchProviderInstalled(C_WEB_URL) == false) || (!("IsSearchProviderInstalled" in window.external) && "AddSearchProvider" in window.external))) {
    if (window.external && "AddSearchProvider" in window.external) {
		var newimg = new Asset.image(C_ICO_PATH + C_ICO_ADD_TO_SEARCH_ENGINES, {'alt': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SU_BARRA_DE_BUSCADORES, 'class': C_CLASS_ICONS, 'id': 'addtosearchengines', 'title': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SU_BARRA_DE_BUSCADORES}).inject($(cc)).setStyle('cursor', 'pointer').addEvent('click', function () {
			if (window.external && ("AddSearchProvider" in window.external)) {
				if (document.location.protocol == "https:") {
					window.external.AddSearchProvider(C_WEB_URL + "xml/opensearch_ssl.xml");
				} else {
					window.external.AddSearchProvider(C_WEB_URL + "xml/opensearch.xml");
				}
				// setTimeout("top.location.replace(C_WEB_URL)", 10);
			}
		});
	}
}
function fjsAddService(cc) {
	if (window.external && (("IsServiceInstalled" in window.external && window.external.IsServiceInstalled(C_WEB_URL + "xml/acelerador.xml", '') == 0) || (!("IsServiceInstalled" in window.external) && "AddService" in window.external))) {
		var newimg = new Asset.image(C_ICO_PATH + C_ICO_ADD_SERVICE, {'alt': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SU_COLECCION_DE_ACELERADORES, 'class': C_CLASS_ICONS, 'id': 'addservice', 'title': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SU_COLECCION_DE_ACELERADORES}).inject($(cc)).setStyle('cursor', 'pointer').addEvent('click', function () {
			window.external.AddService(C_WEB_URL + "xml/acelerador.xml");
		});
	}
}
function fjsAddToFavoritesBar(cc) {
	if (Browser.Engine.trident && C_DEFAULT_BROWSER_VERSION >= 8) {
		var newimg = new Asset.image(C_ICO_PATH + C_ICO_ADD_TO_FAVORITES_BAR, {'alt': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SU_BARRA_DE_FAVORITOS, 'class': C_CLASS_ICONS, 'id': 'addtofavoritesbar', 'title': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SU_BARRA_DE_FAVORITOS}).inject($(cc)).setStyle('cursor', 'pointer').addEvent('click', function () { 
			window.external.AddToFavoritesBar(C_WEB_URL, C_SITE_NAME); 
		});
	}
}
function fjsAddToBookmarks(cc) {
	if (Browser.Engine.trident) {
		var newimg = new Asset.image(C_ICO_PATH + C_ICO_ADD_TO_BOOKMARKS, {'alt': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SUS_FAVORITOS, 'class': C_CLASS_ICONS, 'id': 'addtobookmarks', 'title': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SUS_FAVORITOS}).inject($(cc)).setStyle('cursor', 'pointer').addEvent('click', function () {
			window.external.AddFavorite(C_WEB_URL, C_SITE_NAME); 
		});
	} else if ((typeof(window.sidebar) == "object") && (typeof(window.sidebar.addPanel) == "function")) {
		var newimg = new Asset.image(C_ICO_PATH + C_ICO_ADD_TO_BOOKMARKS, {'alt': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SUS_FAVORITOS, 'class': C_CLASS_ICONS, 'id': 'addtobookmarks', 'title': C_LANG_AGREGAR + ' ' + C_SITE_NAME + ' ' + C_LANG_A_SUS_FAVORITOS}).inject($(cc)).setStyle('cursor', 'pointer').addEvent('click', function () {
			window.sidebar.addPanel(C_SITE_NAME, C_WEB_URL, ''); 
		});
	}
}
function fjsSetHomePage(cc) {
	if (Browser.Engine.trident) {
			var newimg = new Asset.image(C_ICO_PATH + C_ICO_SET_HOME_PAGE, {'alt': C_LANG_ESTABLECER + ' ' + C_SITE_NAME + ' ' + C_LANG_COMO_PAGINA_DE_INICIO, 'class': C_CLASS_ICONS, 'id': 'sethomepage', 'title': C_LANG_ESTABLECER + ' ' + C_SITE_NAME + ' ' + C_LANG_COMO_PAGINA_DE_INICIO}).inject($(cc)).setStyles({'cursor': 'pointer', 'behavior': 'url(#default#homepage)'}).addEvent('click', function () {
			if (this.isHomePage(C_SITE_URL)) { 
				alert(C_SITE_URL + ' ' + C_LANG_YA_ES_SU_PAGINA_DE_INICIO); 
			} else { 
				this.setHomePage(C_SITE_URL); 
			}
		});
	}
}
function fjsSelectSearch(cfield) {
	cfield.value = "";
}
function fjsLetEnterSubmit(e, el) {
	if (e.keyCode == 13) {
		// alert(e.keyCode + ' ' + el.form + ' ' + el.id + ' ' + $('ido').onclick);
		if ($defined($('ido'))) {
			$('ido').destroy();
		}
		el.form.submit();
	}
}
function fjsDeSelectSearch(cfield, cmsg) {
	if (cfield.value == "") {
		cfield.value = (typeof(cmsg) == "undefined" ? C_LANG_BUSCAR : cmsg);
	}
}
function fjsSearchSubmit(f, c, cmsg, clej) {
	if (f.type == "button") {
		var fs = document.forms;
		if (fs.length > 0) {
			for (var i = 0; i < fs.length; i++) {
				var fi = document.forms[i];
				for (var j = 0; j < fi.length; j++) {
					var e = fi.elements[j];
					if (e === f) {
						var n = $(fi.id);
					}
				}
			}
		}
	} else if (typeof(f) == "object") {
		var p = f.getPrevious();
		var n = p.form;
	} else {
		var n = $(f);
	}
	var t = $((typeof(c) == "undefined" ? "csearch" : c));
	if (t.value != "" && t.value != (typeof(cmsg) == "undefined" ? C_LANG_BUSCAR : cmsg)) {
		n.submit();
	} else {
		alert((typeof(clej) == "undefined" ? C_LANG_INGRESE_EL_TEXTO_A_BUSCAR_POR_FAVOR_MAS_DE_2_LETRAS : clej));
	}
}
function fjsInitContextMenu() {
    var oPageMenu = new DDMenu ('ddmenu2', document, {
        onOpen: function(e) { 
            this.enableItems(true);
            this.enableItems('menu_item_with_icon2', false);
        }, 
        onItemSelect: function (act_id, act_el, menu_bindon) {
            // console.info("menu action -> item id: \"%s\" from: %o in %o", act_id, act_el, menu_bindon) 
        }
    });
}
// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function fjsGetRadioCheckedValue(f, s) {
	var r = 0;
	$(f).getElements('input[name^=' + s + ']').each(function(elem) {
		if (elem.checked == true) {
			r = elem.value;
		}
	});
	return r;
}
// return the value of the select that is selected
// return an empty string if none are selected, or
// there are no selects
function fjsGetSelectSelectedValue(o) {
	if (!o) {
		return "";
	}
	var l = o.length;
	if (l == 'undefined') {
		if (o.selected) {
			return o.value;
		} else {
			return "";
		}
	}
	for(var i = 0; i < l; i++) {
		if (o[i].selected) {
			return o[i].value;
		}
	}
	return "";
}
function fjsRiddleMe(ce) {
	var aemail = [105, 110, 102, 111, 64, 97, 108, 100, 101, 97, 114, 97, 100, 104, 97, 110, 97, 46, 99, 111, 109, 46, 97, 114];
	var ceemail = '';
	for (var i = 0; i < aemail.length; i++) {
		ceemail += String.fromCharCode(aemail[i]);
	} 
	document.write('<a class="cxaioemailriddler" href="mailto: ' + ceemail + '">' + ceemail + '</a>');
}
var fjsMandelbrot = function(pre) {
	var epre = $(pre);
	var m = 0;
	var X = m;
	var r = X;
	var i = r;
	var k = i;
	var t = k;
	var n = 0;
	var col = [];
	var fjsChngCol = function() {
		col = [$random(1, 100), $random(1, 100), $random(1, 100)];
		epre.setStyle('color', col.hexToRgb());
	}
	epre.addEvents({'mouseover': fjsChngCol, 'click': fjsChngCol, 'mousewheel': fjsChngCol});
	var mandelbrot = function() {
		for (var d = 'Algorithmic Solution: WEB 2.1', C = Math.cos(n -= 88), S = Math.sin(n), Y = m = 1 + C, z = 1024; z; Y -= m / 16) {
			for (d += '<br>', X = m; --z & 63; X -= m / 32, d += d.charAt(k)) {
				for (r = i = k = 0; ++k + r * r + i * i < 13; i = t) {
					t = 2 * r * i - X * C + Y * S, r = r * r - i * i - X * S - Y * C + C - 1;
				}
			}
		}
		epre.set('html', d);
	}
	setInterval(mandelbrot, n = 9);
	epre.removeEvents();
}
function fjsClearAdvancedSearch() {
	with ($('fbusquedaavanzada')) {
		cartist.value = "";
		cartwork.value = "";
		dfirstdateofcreation.value = "";
		dseconddateofcreation.value = "";
		istroke.value = "";
		itechnique.value = "";
		iroom.value = "";
		ffirstprice.value = "";
		fsecondprice.value = "";
		dauctiondate.value = "";
	}
}
function fjsCheckAdvancedSearch() {
	var f = $('fbusquedaavanzada');
	if (f.cartist.value == "" &&	f.cartwork.value == "" && f.dfirstdateofcreation.value == "" && f.dseconddateofcreation.value == "" && f.istroke.value == 0 && f.itechnique.value == 0 && f.iroom.value == 0 && f.ffirstprice.value == "" && f.fsecondprice.value == "" && f.dauctiondate.value == "") {
		alert(C_LANG_POR_FAVOR_COMPLETE_ALGUNO_DE_LOS_CRITERIOS_DE_BUSQUEDA);
		return false;
	} else {
		f.submit();
		return true;
	}
}
/*
fjsMultipleToogleEditField()
	Function to toggle between an item listed and a edit field input.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/11/08 Last Modify: 18/12/08 common.js AIO Ver 1.6.0
*/
var fjsMultipleToogleEditField = function(e) {
	e.each(function(el) {
		el.addEvent('click', function(e) {
			e.stop();
			fjsToogleEditField(el);
		});
	});
}
/*
Function fjsToogleEditField()
	Function to toggle between an item listed and a edit field input.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/11/08 Last Modify: 18/12/08 common.js AIO Ver 1.6.0
*/
var fjsToogleEditField = function(e) {
	if (Browser.Engine.trident) {
		e = $(e); // Again workaround bug for IE
	}
	e.setStyle('visibility', 'hidden');
	var bv = e.get('text');
	e.set('text', '');
	var cjson = JSON.decode('{"' + e.get('rev').replace(/,/g, '","').replace(/:/g, '":"') + '"}');
	// console.debug(cjson);
	var newinput = new Element('input', {'alt': cjson.alt , 'class': C_CLASS_TOOGLE_LIST_INPUT_TEXT, 'id': cjson.id, 'name': cjson.id, 'title': cjson.title, 'size': cjson.size, 'type': 'text', 'value': (bv == C_LANG_NO_DISPONIBLE ? '' : bv)}).injectBefore(e);
	var input = $(newinput);
	input.setStyle('cursor', 'text').focus();
	input.addEvent('keyup', function(ev) {
		ev.stop();
		if (cjson.rel == 3) {
			fjsNoEnter();
		} else if (cjson.rel == 2) {
			fjsCheckIfExists(input, cjson.rev);
		} else if (cjson.rel == 1) {
			fjsCheckAvailability(input, cjson.rev);
		} else if (cjson.rel == 0) {
			fjsNoEnter();
		}
	});
	input.addEvent('blur', function(ev) {
		ev.stop();
		var ib = ($defined(input.value) ? input.value : '');
		var ibt = ($defined(input.value) ? input.value : C_LANG_NO_DISPONIBLE);
		input.removeEvents();
		input.destroy();
		var newinput = new Element('input', {'alt': ibt , 'class': C_CLASS_TOOGLE_LIST_INPUT_TEXT, 'id': cjson.id, 'name': cjson.id, 'title': ibt, 'size': cjson.size, 'type': 'hidden', 'value': ib}).injectBefore(e);
		input = $(newinput);
		e.set('text', (input.value == '' ? C_LANG_NO_DISPONIBLE : input.value));
		e.setStyle('visibility', 'visible');
	});
}
/*
fjsMultipleToogleEditField()
	Function to toggle between an item listed and a edit field input.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/11/08 Last Modify: 18/12/08 common.js AIO Ver 1.6.0
*/
var fjsMultipleToogleEditFieldNew = function(e) {
	e.each(function(el) {
		el.addEvent('click', function(e) {
			e.stop();
			fjsToogleEditFieldNew(el);
		});
	});
}
/*
Function fjsToogleEditFieldNew() (DOESNT WORK ON ESTIMARTE!!!)
	Function to toggle between an item listed and a edit field input.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 04/11/08 Last Modify: 18/12/08 common.js AIO Ver 1.6.4
*/
var fjsToogleEditFieldNew = function(e) {
	if (Browser.Engine.trident) {
		e = $(e); // Again workaround bug for IE
	}
	e.setStyle('visibility', 'hidden');
	var cjson = JSON.decode('{"' + e.get('rev').replace(/,/g, '","').replace(/:/g, '":"') + '"}');
	var bv = fjsAddDoubleDots(fjsAddCommas(cjson.stor));
	e.set('text', '');
	var newinput = new Element('input', {'alt': fjsAddDoubleDots(fjsAddCommas(cjson.alt)) , 'class': C_CLASS_TOOGLE_LIST_INPUT_TEXT_NEW, 'id': cjson.id, 'name': cjson.id, 'title': fjsAddDoubleDots(fjsAddCommas(cjson.title)), 'size': cjson.size, 'type': 'text', 'value': (bv == C_LANG_NO_DISPONIBLE ? '' : bv)}).injectBefore(e);
	var input = $(newinput);
	input.setStyle('cursor', 'text').focus();
	input.addEvent('keyup', function(ev) {
		ev.stop();
		if (cjson.rel == 3) {
			fjsNoEnter();
		} else if (cjson.rel == 2) {
			fjsCheckIfExists(input, cjson.rev);
		} else if (cjson.rel == 1) {
			fjsCheckAvailability(input, cjson.rev);
		} else if (cjson.rel == 0) {
			fjsNoEnter();
		}
	});
	input.addEvent('blur', function(ev) {
		ev.stop();
		var ib = ($defined(input.value) ? input.value : '');
		var ibt = ($defined(input.value) ? input.value : C_LANG_NO_DISPONIBLE);
		input.removeEvents();
		input.destroy();
		var newinput = new Element('input', {'alt': ibt , 'class': C_CLASS_TOOGLE_LIST_INPUT_TEXT_NEW, 'id': cjson.id, 'name': cjson.id, 'title': ibt, 'size': cjson.size, 'type': 'hidden', 'value': ib}).injectBefore(e);
		input = $(newinput);
		e.set('text', (input.value == '' ? C_LANG_NO_DISPONIBLE : fjsCheckSTRLen(input.value, cjson.size)));
		e.setStyle('visibility', 'visible');
	});
}
function fjsGNBSPs(c) { 
	c = ($defined(c) ? c : 1);
	var snbsps = '';
	for (var i = 1; i <= c; i++) {
		snbsps += '&nbsp;';
	}
	return snbsps;
}
function fjsPNBSPs(ec, c) { 
	$(ec).set('text', fjsGNBSPs(c));
}
/*
Functions fjsConvertPaymentFormTo...()
	Functions to convert payment form to the selected one...

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 03/11/09 Last Modify: 03/11/09 common.js AIO Ver 1.6.4
*/
var fjsConvertPaymentFormToMercadoPago = function(idfrm, cfaction, cmpenc, cmpaccid, cmpcurrency, cmpshippingcost, cmpurlpost, cmpurlcancel, cmpurlprocess, cmpurlsuccesfull, cipn) {
	idfrm = $(idfrm);
	idfrm.set('action', cfaction);
	var iopt = fjsGetSelectSelectedValue($('iopt'));
	// fjsGetRadioCheckedValue(f, s)
	if (iopt == 2) {
		cmpitemid = '1dia3dolares';
		cmpname = 'Subscripci\u00f3n Diaria (24 Horas) a Estimarte PRO';
		cmpprice = '3.00';
	} else if (iopt == 1) {
		cmpitemid = '1mes15dolares';
		cmpname = 'Subscripci\u00f3n Mensual (30 Dias) a Estimarte PRO';
		cmpprice = '15.00';
	} else if (iopt == 0) {
		cmpitemid = '1ano120dolares';
		cmpname = 'Subscripci\u00f3n Anual (12 Meses) a Estimarte PRO';
		cmpprice = '120.00';
	} else {
		cmpitemid = '1ano120dolares';
		cmpname = 'Subscripci\u00f3n Anual (12 Meses) a Estimarte PRO';
		cmpprice = '120.00';
	}
	new Element('input', {'id': 'enc', 'name': 'enc', 'type': 'hidden', 'value': cmpenc}).inject(idfrm);
	new Element('input', {'id': 'acc_id', 'name': 'acc_id', 'type': 'hidden', 'value': cmpaccid}).inject(idfrm);
	new Element('input', {'id': 'item_id', 'name': 'item_id', 'type': 'hidden', 'value': cmpitemid}).inject(idfrm);
	new Element('input', {'id': 'name', 'name': 'name', 'type': 'hidden', 'value': cmpname}).inject(idfrm);
	new Element('input', {'id': 'currency', 'name': 'currency', 'type': 'hidden', 'value': cmpcurrency}).inject(idfrm);
	new Element('input', {'id': 'price', 'name': 'price', 'type': 'hidden', 'value': cmpprice}).inject(idfrm);
	new Element('input', {'id': 'shipping_cost', 'name': 'shipping_cost', 'type': 'hidden', 'value': cmpshippingcost}).inject(idfrm);
	new Element('input', {'id': 'url_post', 'name': 'url_post', 'type': 'hidden', 'value': cmpurlpost}).inject(idfrm);
	new Element('input', {'id': 'url_cancel', 'name': 'url_cancel', 'type': 'hidden', 'value': C_WEB_URL + '?cmod=' + cmpurlcancel + '&stat=cancel'}).inject(idfrm);
	new Element('input', {'id': 'url_process', 'name': 'url_process', 'type': 'hidden', 'value': C_WEB_URL + '?cmod=' + cmpurlprocess + '&stat=wait'}).inject(idfrm);
	new Element('input', {'id': 'url_succesfull', 'name': 'url_succesfull', 'type': 'hidden', 'value': C_WEB_URL + '?cmod=' + cmpurlsuccesfull + '&stat=success'}).inject(idfrm);
	new Element('input', {'id': 'extraPar', 'name': 'extraPar', 'type': 'hidden', 'value': cipn}).inject(idfrm);
	if (Boolean(navigator.cookieEnabled) == true) {
		var ojsonAIOXpayAttempt = new Hash.Cookie('cjsonAIOXpayAttempt', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_DEFAULT_JS, secure: false});
		ojsonAIOXpayAttempt.load();
		if (Boolean(ojsonAIOXpayAttempt.getLength()) == false) {
			ojsonAIOXpayAttempt.empty();
			ojsonAIOXpayAttempt = new Hash.Cookie('cjsonAIOXpayAttempt', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_DEFAULT_JS, secure: false});
			ojsonAIOXpayAttempt.extend({
				'cmethod': 'MP',
				'iopt': iopt,
				'sid': cipn,
				'cstat': false,
				'iver': 1
			});
		} else {
			ojsonAIOXpayAttempt.set('cmethod', ojsonAIOXpayAttempt.get('cmethod') + '/' + 'MP');
			ojsonAIOXpayAttempt.set('iopt', ojsonAIOXpayAttempt.get('iopt') + '/' + iopt);
			ojsonAIOXpayAttempt.set('sid', ojsonAIOXpayAttempt.get('sid') + '/' + cipn);
			if (Boolean(ojsonAIOXpayAttempt.get('cstat')) != false) {
				ojsonAIOXpayAttempt.set('iver', ojsonAIOXpayAttempt.get('iver') - 1);
			} else {
				ojsonAIOXpayAttempt.set('iver', ojsonAIOXpayAttempt.get('iver') + 1);
			}
		}
		ojsonAIOXpayAttempt.save();
		return true;
	} else {
		return false;
	}
}
var fjsConvertPaymentFormToDineroMail = function(idfrm, cfaction, cdmE_Comercio, cdmTipoMoneda, cdmDireccionExito, cdmDireccionFracaso, cdmDireccionEnvio, cdmMensaje, cdmMediosPago, cdmtxnid) {
	idfrm = $(idfrm);
	idfrm.set('action', cfaction);
	var iopt = fjsGetSelectSelectedValue($('iopt'));
	// fjsGetRadioCheckedValue(f, s)
	if (iopt == 2) {
		cdmNroItem = '1dia3dolares';
		cdmNombreItem = 'Subscripci\u00f3n Diaria (24 Horas) a Estimarte PRO';
		cdmPrecioItem = '3.00';
	} else if (iopt == 1) {
		cdmNroItem = '1mes15dolares';
		cdmNombreItem = 'Subscripci\u00f3n Mensual (30 Dias) a Estimarte PRO';
		cdmPrecioItem = '15.00';
	} else if (iopt == 0) {
		cdmNroItem = '1ano120dolares';
		cdmNombreItem = 'Subscripci\u00f3n Anual (12 Meses) a Estimarte PRO';
		cdmPrecioItem = '120.00';
	} else {
		cdmNroItem = '1ano120dolares';
		cdmNombreItem = 'Subscripci\u00f3n Anual (12 Meses) a Estimarte PRO';
		cdmPrecioItem = '120.00';
	}
	new Element('input', {'id': 'NombreItem', 'name': 'NombreItem', 'type': 'hidden', 'value': cdmNombreItem}).inject(idfrm);
	new Element('input', {'id': 'TipoMoneda', 'name': 'TipoMoneda', 'type': 'hidden', 'value': cdmTipoMoneda}).inject(idfrm);
	new Element('input', {'id': 'PrecioItem', 'name': 'PrecioItem', 'type': 'hidden', 'value': cdmPrecioItem}).inject(idfrm);
	new Element('input', {'id': 'E_Comercio', 'name': 'E_Comercio', 'type': 'hidden', 'value': cdmE_Comercio}).inject(idfrm);
	new Element('input', {'id': 'NroItem', 'name': 'NroItem', 'type': 'hidden', 'value': cdmNroItem}).inject(idfrm);
	new Element('input', {'id': 'image_url', 'name': 'image_url', 'type': 'hidden', 'value': 'http://'}).inject(idfrm);
	new Element('input', {'id': 'DireccionExito', 'name': 'DireccionExito', 'type': 'hidden', 'value': C_WEB_URL + '?cmod=' + cdmDireccionExito + '&amp;stat=success'}).inject(idfrm);
	new Element('input', {'id': 'DireccionFracaso', 'name': 'DireccionFracaso', 'type': 'hidden', 'value': C_WEB_URL + '?cmod=' + cdmDireccionFracaso + '&amp;stat=fail'}).inject(idfrm);
	new Element('input', {'id': 'DireccionEnvio', 'name': 'DireccionEnvio', 'type': 'hidden', 'value': cdmDireccionEnvio}).inject(idfrm);
	new Element('input', {'id': 'Mensaje', 'name': 'Mensaje', 'type': 'hidden', 'value': cdmMensaje}).inject(idfrm);
	new Element('input', {'id': 'MediosPago', 'name': 'MediosPago', 'type': 'hidden', 'value': cdmMediosPago}).inject(idfrm);
	new Element('input', {'id': 'TRX_ID', 'name': 'TRX_ID', 'type': 'hidden', 'value': cdmtxnid}).inject(idfrm); // IPN of transaction
	if (Boolean(navigator.cookieEnabled) == true) {
		var ojsonAIOXpayAttempt = new Hash.Cookie('cjsonAIOXpayAttempt', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_DEFAULT_JS, secure: false});
		ojsonAIOXpayAttempt.load();
		if (Boolean(ojsonAIOXpayAttempt.getLength()) == false) {
			ojsonAIOXpayAttempt.empty();
			ojsonAIOXpayAttempt = new Hash.Cookie('cjsonAIOXpayAttempt', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_DEFAULT_JS, secure: false});
			ojsonAIOXpayAttempt.extend({
				'cmethod': 'DM',
				'iopt': iopt,
				'sid': cdmtxnid,
				'cstat': false,
				'iver': 1
			});
		} else {
			ojsonAIOXpayAttempt.set('cmethod', ojsonAIOXpayAttempt.get('cmethod') + '/' + 'DM');
			ojsonAIOXpayAttempt.set('iopt', ojsonAIOXpayAttempt.get('iopt') + '/' + iopt);
			ojsonAIOXpayAttempt.set('sid', ojsonAIOXpayAttempt.get('sid') + '/' + cdmtxnid);
			if (Boolean(ojsonAIOXpayAttempt.get('cstat')) != false) {
				ojsonAIOXpayAttempt.set('iver', ojsonAIOXpayAttempt.get('iver') - 1);
			} else {
				ojsonAIOXpayAttempt.set('iver', ojsonAIOXpayAttempt.get('iver') + 1);
			}
		}
		ojsonAIOXpayAttempt.save();
		return true;
	} else {
		return false;
	}
}
var fjsConvertPaymentFormToPayPal = function(idfrm, cfaction, cppcmd, cppcustom, cppinvoice, osessid) {
	idfrm = $(idfrm);
	idfrm.set('action', cfaction);
	var iopt = fjsGetSelectSelectedValue($('iopt'));
	// fjsGetRadioCheckedValue(f, s)
	if (osessid < 10 && C_MODULE_PAYMENT_PAYPAL_PLAYING == 'on') {
		if (iopt == 2) {
			var cpphosted_button_id = '1085171'; // 3
			var cppitem_number = '1dia3dolares'; // 3
		} else if (iopt == 1) {
			var cpphosted_button_id = '1085170'; // 15
			var cppitem_number = '1mes15dolares'; // 15
		} else if (iopt == 0) {
			var cpphosted_button_id = '1085169'; // 120
			var cppitem_number = '1ano120dolares'; // 120
		}
	} else {
		if (iopt == 2) {
			var cpphosted_button_id = '9410605'; // 3
			var cppitem_number = '1dia3dolares'; // 3
		} else if (iopt == 1) {
			var cpphosted_button_id = '9410673'; // 15
			var cppitem_number = '1mes15dolares'; // 15
		} else if (iopt == 0) {
			var cpphosted_button_id = '9410729'; // 120
			var cppitem_number = '1ano120dolares'; // 120
		}
	}
	new Element('input', {'id': 'cmd', 'name': 'cmd', 'type': 'hidden', 'value': cppcmd}).inject(idfrm);
	new Element('input', {'id': 'hosted_button_id', 'name': 'hosted_button_id', 'type': 'hidden', 'value': cpphosted_button_id}).inject(idfrm);
	new Element('input', {'id': 'item_number', 'name': 'item_number', 'type': 'hidden', 'value': cppitem_number}).inject(idfrm);
	new Element('input', {'id': 'custom', 'name': 'custom', 'type': 'hidden', 'value': cppcustom}).inject(idfrm); // custom id of transaction
	new Element('input', {'id': 'invoice', 'name': 'invoice', 'type': 'hidden', 'value': cppinvoice}).inject(idfrm); // invoice id of transaction
	if (osessid < 10 && C_MODULE_PAYMENT_PAYPAL_PLAYING == 'on') {
		new Element('input', {'id': 'test_ipn', 'name': 'test_ipn', 'type': 'hidden', 'value': '1'}).inject(idfrm); // Testing with the Sandbox
	}
	if (Boolean(navigator.cookieEnabled) == true) {
		var ojsonAIOXpayAttempt = new Hash.Cookie('cjsonAIOXpayAttempt', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_DEFAULT_JS, secure: false});
		ojsonAIOXpayAttempt.load();
		if (Boolean(ojsonAIOXpayAttempt.getLength()) == false) {
			ojsonAIOXpayAttempt.empty();
			ojsonAIOXpayAttempt = new Hash.Cookie('cjsonAIOXpayAttempt', {autoSave: false, domain: C_COOKIE_DOMAIN, path: C_COOKIE_PATH, duration: C_COOKIE_EXPIRE_DEFAULT_JS, secure: false});
			ojsonAIOXpayAttempt.extend({
				'cmethod': 'PP',
				'iopt': iopt,
				'sid': osessid,
				'cstat': false,
				'iver': 1
			});
		} else {
			ojsonAIOXpayAttempt.set('cmethod', ojsonAIOXpayAttempt.get('cmethod') + '/' + 'PP');
			ojsonAIOXpayAttempt.set('iopt', ojsonAIOXpayAttempt.get('iopt') + '/' + iopt);
			ojsonAIOXpayAttempt.set('sid', ojsonAIOXpayAttempt.get('sid') + '/' + osessid);
			if (Boolean(ojsonAIOXpayAttempt.get('cstat')) != false) {
				ojsonAIOXpayAttempt.set('iver', ojsonAIOXpayAttempt.get('iver') - 1);
			} else {
				ojsonAIOXpayAttempt.set('iver', ojsonAIOXpayAttempt.get('iver') + 1);
			}
		}
		ojsonAIOXpayAttempt.save();
		return true;
	} else {
		return false;
	}
}
/*
fjsChkArtists() suit.
	Functions to checking existence of names on a DB via JSON.

License:
	NOMELOCOPIESOTECAGOABOLLOS-style license.

Build: 08/11/09 Last Modify: 09/11/09 common.js AIO Ver 1.6.4
*/
var fjsChangeAlertStatus = function() {
	if ($defined($(C_ICO_ARTISTS_EMAIL_ALERT_ENABLED + '_ialertstatusico'))) {
		var ialertstatusico = $(C_ICO_ARTISTS_EMAIL_ALERT_ENABLED + '_ialertstatusico');
	} else if ($defined($(C_ICO_ARTISTS_EMAIL_ALERT_DISABLED + '_ialertstatusico'))) {
		var ialertstatusico = $(C_ICO_ARTISTS_EMAIL_ALERT_DISABLED + '_ialertstatusico')
	}
	var ialertstatusstring = $('ialertstatusstring');
	var cstrstat = ialertstatusstring.get('text');
	if (cstrstat == C_LANG_ACTIVA) {
		ialertstatusstring.set('text', C_LANG_INACTIVA);
		ialertstatusico.setProperties({'alt': '', 'src': C_ICO_PATH + C_ICO_ARTISTS_EMAIL_ALERT_ENABLED, 'title': C_LANG_ACTIVAR_ALERTA_DE_ARTISTAS_FAVORITOS}).store('tip:title', C_LANG_ACTIVAR_ALERTA_DE_ARTISTAS_FAVORITOS);
	} else if (cstrstat == C_LANG_INACTIVA) {
		ialertstatusstring.set('text', C_LANG_ACTIVA);
		ialertstatusico.setProperties({'alt': '', 'src': C_ICO_PATH + C_ICO_ARTISTS_EMAIL_ALERT_DISABLED, 'title': C_LANG_DESACTIVAR_ALERTA_DE_ARTISTAS_FAVORITOS}).store('tip:title', C_LANG_DESACTIVAR_ALERTA_DE_ARTISTAS_FAVORITOS);
	}
	if (!$defined($('cartistfav'))) {
		var einputhidden = new Element('input', {'id': 'cartistfav', 'name': 'cartistfav', 'type': 'hidden', 'value': (cstrstat == C_LANG_ACTIVA ? 'of' : (cstrstat == C_LANG_INACTIVA ? 'on' : 'on'))}).injectBefore(ialertstatusstring);
	} else {
		$('cartistfav').set('value', (cstrstat == C_LANG_ACTIVA ? 'of' : (cstrstat == C_LANG_INACTIVA ? 'on' : 'on')));
	}
}
var fjsDropThisOne = function(itartist) {
	itdelartist = itartist.substring(1).toInt();
	var einputhidden = new Element('input', {'id': 'itdelartist[]', 'name': 'itdelartist[]', 'type': 'hidden', 'value': itdelartist}).injectBefore($(itartist));
	$(itartist).empty();
	$(itartist).destroy();
	var ifollowedartists = $('ifollowedartists').get('text').toInt() - 1;
	$('ifollowedartists').set('text', ifollowedartists);
}
var fjsSaveThisOne = function(itartist) {
	itartist = itartist.toInt();
	if (!$defined($('i' + itartist)) && typeof(itartist) == 'number') {
		var etr = new Element('tr', {'id': 'i' + itartist}).injectBefore('isubmitfavlsttr');
		var fjsInjectCol = function(rows) {
			rows.each(function(orow) {
				var row = $H(orow);
				var etd = new Element('td').inject(etr);
				if (row.has('cname')) {
					etd.set('html', row.cname);
				} else if (row.has('iauctions')) {
					etd.set('html', row.iauctions);
				} else if (row.has('inextauctions')) {
					etd.set('html', row.inextauctions);
				}
			});
		}
		fjsGetTableFields('artists', 'cname', 'id', '=', itartist, '', 'cname', 'asc', '1', fjsInjectCol, false);		
		fjsGetTableFields('sales inner join artworks on sales.iartwork = artworks.id', 'count(*) as iauctions', 'artworks.iartist', '=', itartist, 'and sales.cnext <> "on"', 'cname', 'asc', '1', fjsInjectCol, false);		
		fjsGetTableFields('sales inner join artworks on sales.iartwork = artworks.id', 'count(*) as inextauctions', 'artworks.iartist', '=', itartist, 'and sales.cnext = "on"', 'cname', 'asc', '1', fjsInjectCol, false);
		var etd = new Element('td').inject(etr);
		var einputhidden = new Element('input', {'id': 'itartist[]', 'name': 'itartist[]', 'type': 'hidden', 'value': itartist}).inject(etd);
		fjsPShowIcon(C_ICO_DIS_SAVABLE, C_LANG_QUITAR_DE_LA_LISTA, 1, 'idelete_' + itartist, 'cxaioiconabsmiddle', etd, 'fjsDropThisOne(\'i' + itartist + '\')');
		var ifollowedartists = $('ifollowedartists').get('text').toInt() + 1;
		$('ifollowedartists').set('text', ifollowedartists);
	}
	$('cname').set('value', '');
	$('itc').empty();
	fjsSetNotSaveableState($('cname'));
}
var fjsChooseThisOne = function(e, i) {
	var cartists = $(i).get('title');
	$(e).set('value', cartists);
	fjsChkArtists(e);
}
var fjsSetSaveableState = function(e, i) {
	e.setStyle('background', '#EEFFEE');
	var itartist = i.toString().split('_')[1];
	if ($defined($(C_ICO_NOT_SAVABLE + '_i' + e.name))) {
		$(C_ICO_NOT_SAVABLE + '_i' + e.name).setProperties({'alt': '', 'id': C_ICO_SAVABLE + '_i' + e.name, 'src': C_ICO_PATH + C_ICO_SAVABLE, 'title': C_LANG_AGREGAR_A_LA_LISTA}).setStyle('cursor', 'pointer').store('tip:title', C_LANG_AGREGAR_A_LA_LISTA).addEvent('click', function() {fjsSaveThisOne(itartist)});
	} else if ($defined($(C_ICO_SAVABLE + '_i' + e.name))) {
		$(C_ICO_SAVABLE + '_i' + e.name).setProperties({'alt': '', 'src': C_ICO_PATH + C_ICO_SAVABLE, 'title': C_LANG_AGREGAR_A_LA_LISTA}).setStyle('cursor', 'pointer').store('tip:title', C_LANG_AGREGAR_A_LA_LISTA).addEvent('click', function() {fjsSaveThisOne(itartist)});
	}
}
var fjsSetNotSaveableState = function(e) {
	e.setStyle('background', '#FFEEEE');
	if ($defined($(C_ICO_SAVABLE + '_i' + e.name))) {
		$(C_ICO_SAVABLE + '_i' + e.name).setProperties({'alt': '', 'id': C_ICO_NOT_SAVABLE + '_i' + e.name, 'src': C_ICO_PATH + C_ICO_NOT_SAVABLE, 'title': C_LANG_NO_DISPONIBLE}).store('tip:title', C_LANG_NO_DISPONIBLE);
	} else if ($defined($(C_ICO_NOT_SAVABLE + '_i' + e.name))) {
		$(C_ICO_NOT_SAVABLE + '_i' + e.name).setProperties({'alt': '', 'src': C_ICO_PATH + C_ICO_NOT_SAVABLE, 'title': C_LANG_NO_DISPONIBLE}).store('tip:title', C_LANG_NO_DISPONIBLE);
	}
}
var fjsChkArtists = function (e) {
	var t = (typeof(e.alt) == 'string' && e.alt != '' ? (e.alt.lastIndexOf('::') != -1 ? e.alt.split('::')[0] : e.alt) : C_TBL_MODS);
	var c = (e.name.lastIndexOf('_') != -1 ? e.name.split('_')[0] : e.name);
	var f = 'id, cname';
	var fjsWriteData = function(rows) {
		if ($defined($('itc'))) {
			var emaintr = $('itc');
			emaintr.empty();
		} else {
			var emaintr = new Element('tr', {'id': 'itc', 'name': 'itc'}).injectBefore($('isinopticboard'));
		}
		var emaintd = new Element('td').inject(emaintr);
		var emaintable = new Element('table', {'class': 'totalwidthbordernonealignleft'}).inject(emaintd);
		rows.each(function(orow) {
			var row = $H(orow);
			if (row.id >= 1 && row.has('cname')) {
				var etr = new Element('tr').inject(emaintable);
				var etd = new Element('td').inject(etr);
				var einputradio = new Element('input', {'alt': '', 'class': 'cxaioinputradio', 'id': 'iname_' + row.id, 'name': 'iname', 'title': row.cname, 'type': 'radio', 'value': row.id}).inject(etd).addEvent('click', function() { fjsChooseThisOne(e, 'iname_' + row.id) });
				etd.appendText(row.cname);
			}
		});
		if (rows.length == 1 && $$('input[name=iname]').get('id') == '') {
			var etr = new Element('tr').inject(emaintable);
			var etd = new Element('td').inject(etr);
			etd.set('html', C_LANG_NO_HAY_NOMBRES_DE_ARTISTAS_QUE_COINCIDAN_CON_EL_CRITERIO_DE_BUSQUEDA);
			fjsSetNotSaveableState(e);
		} else if (rows.length == 1) {
			$('cname').set('text', $$('input[name=iname]').get('title'));
			$$('input[name=iname]').setProperties({'checked': 'checked', 'readonly': 'readonly'});
			fjsSetSaveableState(e, $$('input[name=iname]').get('id'));
		} else if (rows.length >= 2) {
			fjsSetNotSaveableState(e);
		}
	}
	if (e.value.length != '') {
		fjsGetTableFields(t, f, c, 'likel', escape(e.value), '', 'cname', 'asc', '8', fjsWriteData, true);
	}
}
var fjsRequestDineromailIPN = function (sess, osessid) {
	var xml = '<reporte><nrocta>' + (osessid < 10 && C_MODULE_PAYMENT_DINEROMAIL_PLAYING == "on" ? C_MODULE_PAYMENT_DINEROMAIL_ECOMMERCE_ID_SANDBOX : C_MODULE_PAYMENT_DINEROMAIL_ECOMMERCE_ID) + '</nrocta><detalle><consulta><clave>' + (osessid < 10 && C_MODULE_PAYMENT_DINEROMAIL_PLAYING == "on" ? C_MODULE_PAYMENT_DINEROMAIL_IPN_PASSWORD : C_MODULE_PAYMENT_DINEROMAIL_PASSWORD) + '</clave><tipo>1</tipo><operaciones><id>' + sess + '</id></operaciones></consulta></detalle></reporte>';
	/* console.debug(xml);
	var fjsReadResponse = function(responseTree, responseElements, responseHTML, responseJavaScript) {
		console.debug(responseTree);
		console.debug(responseElements);
		console.debug(responseHTML);
		console.debug(responseJavaScript);
	} */
	// Also try on: 'http://www.estimarte.com/src/ipn.php';
	// console.debug(C_MODULE_PAYMENT_DINEROMAIL_IPN_URL);
	var req = new Request.HTML({
		url: 'http://www.estimarte.com/src/ipn.php',
		method: 'post', // "post" or "get"
		secure: true,
		data: {'data': xml},
		link: 'ignore', // either "cancel" or "chain"
		async: true,
		encoding: C_DEFAULT_CHARSET,
		// headers: '';
		// isSuccess: func() 
		evalScripts: true,
		evalResponse: false,
		emulation: false,
		urlEncoded: true,
		onComplete: function(responseTree, responseElements, responseHTML, responseJavaScript) {
			fjsReadResponse(responseTree, responseElements, responseHTML, responseJavaScript);
		}
	}).send();
}