window.DEBUG=true;
	
/*
 * Included file begin: /liligo/src/liligo.js
 * Included from:       /liligo/full.js:2
 */
(function() {

	var

	_window = "window",
	window = (function() {
		return this[_window] ? this : (this[_window] = this)
	})(),
	doc = window.document,

	_function = "function",
	_string = "string",

	Array_slice = Array.prototype.slice,
	slice,

	rescapeRegexp = /([\/()[\]{}|*+-.,^$?\\])/g,
	rescape,

	bind,

	liligo_nullFunc,
	liligo_extend,
	extend,
	lang,
	allLabels = {},

	liligo = window.liligo = {

		namespace: "",

		exportedExtend: extend = function(destination, source) {
			for (var property in source) {
				destination[property] = source[property];
			}
			return destination;
		},

		extend: liligo_extend = function(extension) {
			extend(liligo, extension);
			for (var property in extension) {
				if (extension.hasOwnProperty(property) && (property.charAt(0) != "@")) {
					liligo.namespace += ["var ","=liligo.",";"].join(property);
				}
			}
		}

	},

	Class,
	Application,

	Class_fixBase = function(baseProp, prevBase, actBase) {
		return function() {
			this[baseProp] = prevBase;
			var ret = actBase.apply(this, arguments);
			delete this[baseProp];
			return ret;
		};
	};

	liligo.namespace += "var extend=liligo.exportedExtend;";

	liligo_extend({

		Class: Class = function(parentClass, insta, stati) {
			var
				constructor = "constructor",
				__constructorFunc = "__constructorFunc",
				hasOwn = "hasOwnProperty",
				_base_constructor = "_base_constructor",
				toString = "toString",
				parentConstr,        // parentClass.constructor
				klass = function() { // this will be the new class
					this[__constructorFunc].apply(this, arguments);
				},
				klassProto = klass.prototype, // the prototype of the new class
				klassProtoConstrFunc,
				nullFunc = function() {},
				ppc = nullFunc,
				parentProto = null, // parentClass.prototype
				prop;               // property, for object enumeration

			// if the first parameter (parentClass) is not a real Class
			if (typeof parentClass != _function) {
				parentConstr = parentClass[constructor];
				// if the parentClass is a Singleton
				if (parentConstr && parentConstr[hasOwn]("__isSingleton")) {
					// then the parent should be the Class of the singleton
					parentClass = parentConstr;
				} else { // parentClass is not a Class and not a Singleton
					stati = insta || {};
					insta = parentClass || {};
					parentClass = 0; // 0 == false
				}
			}

			// if the new class is an subclass of the parentClass
			if (parentClass) {
				parentProto = parentClass.prototype;
				ppc = parentProto[__constructorFunc];
				parentProto[__constructorFunc] = nullFunc;
				klassProto = klass.prototype = new parentClass();
				if (parentClass.__isAbstract) {
					insta[constructor] =
						insta[hasOwn](constructor) ? insta[constructor] : nullFunc;
					for (prop in parentProto) if (parentProto[hasOwn](prop)) {
						if ((parentProto[prop] === null) && !insta[hasOwn](prop)) {
							if (DEBUG) {
								throw Error("Abstract property \""+prop+"\" not implemented");
							} else {
								throw Error("Abstract error");
							}
						}
					}
				}
				if (parentProto[hasOwn](_base_constructor)) {
					klassProto[_base_constructor] = function() {
						this[_base_constructor] = parentProto[_base_constructor];
						parentProto[__constructorFunc].apply(this, arguments);
						delete this[_base_constructor];
					};
					parentProto[__constructorFunc] = ppc;
				} else {
					klassProto[_base_constructor] = parentProto[__constructorFunc] = ppc;
				}
			}

			klassProtoConstrFunc =
				insta[hasOwn](constructor) ? insta[constructor] : ppc;
			delete insta[constructor];
			for (prop in insta) if (insta[hasOwn](prop)) {
				if (parentProto && parentProto[prop]) {
					if ((base = klassProto["_base_"+prop]) && (typeof base == _function)) {
						klassProto["_base_"+prop] = Class_fixBase("_base_"+prop, base, parentProto[prop]);
					} else {
						klassProto["_base_"+prop] = parentProto[prop];
					}
				}
				klassProto[prop] = insta[prop];
			}
			if (insta[hasOwn](toString)) {
				if (parentProto && parentProto[toString]) klassProto._base_toString = parentProto[toString];
				klassProto[toString] = insta[toString];
			}
			klassProto[__constructorFunc] = klassProtoConstrFunc;
			for (prop in stati) if (stati[hasOwn](prop) && (prop != "prototype")) klass[prop] = stati[prop];
			if (klass.init) klass.init();
			return klass;
		},

		Singleton: function(parentClass, insta, stati) {
			var klass = Class(parentClass, insta, stati);
			klass.__isSingleton = true;
			klass.prototype.constructor = klass;
			var ret = new klass();
			if (ret.init) ret.init();
			return ret;
		},

		Application: Application = function(parentClass, insta, stati) {
			var klass = Class(parentClass, insta, stati);
			klass.__isSingleton = true;
			var ret = new klass();
			if (ret.init) {
				liligo.domLoaded(bind(ret.init, ret));
			}
			return ret;
		},

		App: Application,

		Abstract: function(parentClass, insta, stati) {
			var klass = Class(parentClass, insta, stati);
			klass.prototype.__constructorFunc = function() {
				throw Error("Abstract class");
			};
			klass.__isAbstract = true;
			klass.isParentOf = function(subClass) {
				var proto = this.prototype;
				if (typeof subClass == _function) {
					return proto.isPrototypeOf(subClass.prototype);
				} else {
					return proto.isPrototypeOf(subClass);
				}
			};
			return klass;
		},

		nullFunc: liligo_nullFunc = function() {},

		require: function() {
			if (DEBUG) {
				var
					req = arguments[0],
					reqs = (arguments.length>1) ? arguments : req.split(","),
					i;
				for (i=0; req = reqs[i]; i++) {
					if (typeof liligo[req] == "undefined") {
						throw Error("liligo.require: "+req+" is missing");
					}
				}
			}
		},

		slice: slice = function(object) {
			return Array_slice.apply(object, Array_slice.call(arguments, 1));
		},

		bind: bind = function(f, t) {
			var userdef = slice(arguments, 2);
			return function() {
				return f.apply(t, userdef.concat(slice(arguments)))
			}
		},

		bindAsEventListener: function(f, t, a, b, c) {
			if (DEBUG) {
				if (typeof f != _function) {
					f(); // liligo.bindAsEventListener: first parameter not a function
				}
			}
			return function(event) {
				return f.call(t, event || window.event, a, b, c)
			}
		},

		rescape: rescape = function(string) {
			return String(string).replace(rescapeRegexp, "\\$1");
		},

		$: function(id) {
			return (typeof id == _string)?
				doc.getElementById(id)
			:
				id
			;
		},

		unique: (function(unique) {
			return function() {
				return unique++;
			};
		})(1234),

		escapeHTML: function(s) {
			return String(s)
				.replace(/&/g, "&amp;")
				.replace(/"/g, "&quot;")
				.replace(/</g, "&lt;")
				.replace(/>/g, "&gt;");
		},

		getLang: function() {
			if (lang) return lang;
			var temp = window.LANG;
			if (temp && (temp = temp.locale)) {
				return lang = temp;
			}
			temp = window.language;
			if (temp && (temp = temp.lang)) {
				return lang = temp;
			}
			temp = doc.body;
			if (temp && (temp = temp.className.match(/(^|\s)[a-z]{2}(\s|$)|/i))) {
				return lang = temp[0];
			}
			return null;
		},

		labels: {},

		allLabels: allLabels,

		setLang: function(pLang) {
			if (!allLabels[lang = pLang]) {
				allLabels[pLang] = {};
			}
			liligo.labels = allLabels[pLang];
		},

		addLabels: function(pLang, labels, hash) {
			if (pLang.length > 5) {
				if (DEBUG) {
					if (!liligo._addLazyLabels) {
						alert("Error: liligo.LazeLabels module is not loaded!");
					}
				}
				liligo._addLazyLabels(pLang, labels);
			} else {
				if (!labels) {
					labels = pLang;
					pLang = liligo.getLang();
				}
				if (!allLabels[pLang]) {
					allLabels[pLang] = labels;
				} else {
					extend(allLabels[pLang], labels);
				}
				// labels "variable" reused here:
				hash && (labels = liligo._onLazyLabels) && labels(hash);
			}
		},

		Trigger: function(events, callback) {
			var
				map = {},
				params = {}, // we store the got parameters of every event
				length = events.length,
				event, i, binded, realEvent,
				callAtTheEnd = [];
			for (i=0; i<length; i++) {
				event = events[i];
				realEvent = 0;
				if (typeof event != _string) {
					realEvent = event;
					/*
						if the event is not a string, then it's an array
						of an Observable and an event name, we have to
						observe it
					*/
					event = "$"+i; // generated event name
				}
				// this function will be called when the fired:
				binded = map[event] = bind(function() {
					var eventName = this;
					map[eventName] = liligo_nullFunc;
					params[eventName] = arguments;
					if (!--length) callback(params);
				}, event);
				// if it is a real event, then observe it
				if (realEvent) {
					if (realEvent == liligo.domLoaded) {
						document.body ? callAtTheEnd.push(binded) : realEvent(binded);
					} else {
						if (DEBUG) {
							try {
								liligo.Event.observe(realEvent[0], realEvent[1], binded);
							} catch(e) {
								throw new Error("Cannot observe for event: "+realEvent[1]+" of "+realEvent[0]);
							}
						} else {
							liligo.Event.observe(realEvent[0], realEvent[1], binded);
						}
					}
				}
			}
			while (i = callAtTheEnd.shift()) i();
			return map;
		}

	});

	if ("".replace(/^/, String)) {
		var
			proto = String.prototype;
			original = proto.replace;
		proto.replace = function(expression, replacement) {
			if (typeof replacement == _function) {
				if (expression instanceof RegExp) {
					var regexp = expression;
					var global = regexp.global;
					if (global == null) global = /(g|gi)$/.test(regexp);
					if (global) regexp = new RegExp(regexp.source);
				} else {
					regexp = new RegExp(rescape(expression));
				}
				var match, string = this, result = "";
				while (string && (match = regexp.exec(string))) {
					result += string.slice(0, match.index) + replacement.apply(this, match);
					string = string.slice(match.index + match[0].length);
					if (!global) break;
				}
				return result + string;
			} else {
				return original.apply(this, arguments);
			}
		};
	}

})();
/*
 * Included file end: /liligo/src/liligo.js
 * Included from:     /liligo/full.js:2
 */

	
/*
 * Included file begin: /liligo/src/liligo.BOM.js
 * Included from:       /liligo/full.js:3
 */
(function() {
	"cc:not evil,MSIE:nomunge,element:nomunge,userAgent:nomunge";

	var
		_liligo = liligo,
		Class = _liligo.Class,
		Singleton = _liligo.Singleton;
	
	if (_liligo.BOM) return;

	var
		MSIE = /*@cc_on!@*/false,
		navigator = window.navigator,
		isBrowser = !!((typeof navigator == "object") && navigator.userAgent),
		element = isBrowser ? document.createElement("span") : {addEventListener:1},
		IE6,
		IE7;

	if (!isBrowser && (!navigator)) {
		try {
			if (Packages.org.mozilla.javascript) {
				navigator = {
					platform: "Java",
					userAgent: "Rhino"
				};
			}
		} catch(e) {
			navigator = {
				platform: "unknown",
				userAgent: "unknown"
			};
		}
	}
	var userAgent;

	var BOM = Singleton({
		
		userAgent: "",
		
		_cache: {},
		
		init: function(url, options) {
			userAgent = navigator.userAgent;
			IE6 = MSIE && /IE\s*6/.test(userAgent);
			IE7 = !IE6 && (false/*@cc_on || (@_jscript_version == 5.7) @*/);
			if (!MSIE) userAgent = userAgent.replace(/MSIE\s[\d.]+/, "");
			userAgent = userAgent.replace(/([a-z])[\s\/](\d)/gi, "$1$2");
			this.userAgent = userAgent = navigator.platform + " " + userAgent;
			
			if (IE6) {
				/*
					IE6 css background image flicker fix
					http://www.hedgerwow.com/360/bugs/dom-fix-ie6-background-image-flicker.html
					http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B823727
				*/
				try {
					document.execCommand("BackgroundImageCache", false, true);
				} catch(e) {}
			}
			
			var sTmp; 
			this.isSafari2 = false;
			if ( (sTmp = navigator.userAgent.match(/Safari\/([0-9]*)/)) 
				&& (sTmp.length>0) && (sTmp[1]*1<420) )
				this.isSafari2 = true;
		},
		
		detect: function(test) {
			"eval:not evil,retVal:nomunge"; 
			if (typeof BOM._cache[test] != "undefined") return BOM._cache[test];
			var retVal = false;
			var not = test.charAt(0) == "!";
			test = test
				.replace(/^IE/, "MSIE")
				.replace(/^(["']?)([^\(].*)(\1)$/, "/$2/i.test(userAgent)");
			try {
				eval("retVal=!!" + test);
			} catch (e) {}
			return BOM._cache[test] = Boolean(not ^ retVal);
		},
		
		isBrowser: function() {
			return isBrowser;
		},
		
		helpers: Singleton({
				
			safariXMLWrapper: Class({
				
				constructor: function(node) {
					this.node = node;
				},
				
				getElementsByTagName: function(tag) {
					var list = this.node.getElementsByTagName(tag), r = [], tmpNode;
					if (!list.length) list = this.node.getElementsByTagNameNS("*", tag);
					
					forEach(list, function(lItem) { //# update if needed
						tmpNode = new BOM.helpers.safariXMLWrapper(lItem);
						if (lItem.firstChild) {
							tmpNode.firstChild = lItem.firstChild;
							if (lItem.firstChild.nodeValue) 
								tmpNode.text = tmpNode.firstChild.nodeValue = lItem.firstChild.nodeValue;
						}
						if (lItem.attributes) tmpNode.attributes = lItem.attributes;
						r.push(tmpNode);
					}, this);
					
					return r;
				}

			}),
			
			/**
			 * @classDescription Creates a safariImageButton object to replace
			 *   input type buttons into input type images or fake buttons; the original 
			 *   ones will be hidden - Safari does not allow button values and background 
			 *   images simultaneously. A class named "bumper" is required to wrap 
			 *   around the target elements. Warning, this tool WILL change dom structure. 
			 * @type   {Object}
			 * @param  {String}  ...  html id of target object
			 * @return {Boolean} Returns false if one or more elements were nonexistent
			 * @alias  BOM.safariImageButton
			 * @alias  liligo.BOM.safariImageButton
			 */
			safariImageButton: Class({
					
				/**
				 * Initializes the safariImageButton object
				 * @constructor
				 */
				constructor: function() {
					this.error = [];
					for (var i = 0; i < arguments.length; i++) 
						this._makeBtn(arguments[i]);
					if (this.error.length > 0) return false;
						else return true;
				},
				
				/**
				 * Returns the list of the nonexistent tags
				 * @return {Array} ids of the nonexistent tags
				 * @method
				 */
				getBroken: function() {
					return this.error;
				},
				
				/**
				 * Hides original button while copies some attributes to a fake span,
				 *   dispatches click and submit events
				 * @private
				 * @method
				 */
				_makeBtn: function(target) {
					var ot = target, target = $(target);
					if (target) {
						if (target.value.replace(/\s/,'').length == 0) { //# text rendered on image
							target.type = "image";
							target.value = " ";
							target.src = "/img/spacer.gif";
						} else { //# text is on button, is tricky
							var cnt = Query.up(target.id,".bumper");
							if (cnt) {
								var sp = document.createElement("SPAN");
								sp.style.display = "inline-block";
								sp.className = target.className;
								sp.targetId = target.id;
								sp.targetType = target.type;
								sp.id = "_" + sp.targetId;
								sp.appendChild(document.createTextNode(target.value));
								sp.onclick = function() { //# pipe
									if (this.targetType == "submit") {
										var form = Query.up(this.targetId,"form"),
											evt = document.createEvent('HTMLEvents');
										evt.initEvent('submit', true, true);
										form.dispatchEvent(evt);
									} else {
										var evt = document.createEvent("MouseEvents");
										evt.initEvent("click", true, true);
										$(this.targetId).dispatchEvent(evt);
									}
								}
								target.style.display = "none";
								cnt.appendChild(sp);
							} else {
								this.error.push(ot+": no bumper");
							}
						}
					} else {
						this.error.push(target);
					}
				}

			})
				
		})
		
	});
	
	_liligo.extend({
		BOM: BOM,
		detect: BOM.detect,
		IE: MSIE,
		IE6: IE6,
		IE7: IE7,
		safari: BOM.detect("Konqueror|Safari|KHTML|AppleWebKit")
	});
	
})();
/*
 * Included file end: /liligo/src/liligo.BOM.js
 * Included from:     /liligo/full.js:3
 */

	
/*
 * Included file begin: /liligo/src/liligo.SmartAd.js
 * Included from:       /liligo/full.js:4
 */
(function() {

	var
		_liligo = liligo,
		sas_tmstp = Math.round(Math.random()*10000000000),
		sas_masterflag = 1,
		reloadFactory = function(src) {
			return _liligo.IE ? function() {
				var cloned = this.cloneNode(true);
				cloned.src = src;
				cloned.reload = arguments.callee;
				this.parentNode.replaceChild(cloned, this);
			} : function() {
				this.src = src;
			}
		};
			
	_liligo.extend({
		
		smartAd: function(sas_pageid, sas_formatid, sas_target, sas_w, sas_h, id, lazy) {
			var
				urlTemplate =
					'http://www3.smartadserver.com/call/pubif/' + sas_pageid + '/' +
					sas_formatid + '/@/' + sas_tmstp + '/' + encodeURIComponent(sas_target) + '?',
				url = urlTemplate.replace(/@/, sas_masterflag ? 'M' : 'S'),
				iframes,
				iframeIdAttr = id ? 'id="'+id+'"' : "",
				iframeSrcAttr = lazy ? "" : 'src="'+url+'"',
				// https://bugzilla.mozilla.org/show_bug.cgi?id=388714#c57
				barfBag = _liligo.detect("Gecko.\\d{4}") ? '<iframe src="#" style="display:none;"></iframe>' : "";
			sas_masterflag = 0;
			
			document.write(
				barfBag +
				'<iframe ' + iframeIdAttr + ' class="smart-ad-'+sas_w+'x'+sas_h+'" ' + iframeSrcAttr +
				' name="' + document.domain + '" ' +
				' width=' + sas_w +
				' height=' + sas_h +
				' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>' +
				barfBag
			);
			iframes = document.getElementsByTagName("iframe");
			iframes[iframes.length - (barfBag == "" ? 1 : 2)].reload = reloadFactory(urlTemplate.replace(/@/, 'S'));
		}
						
	});

})();
/*
 * Included file end: /liligo/src/liligo.SmartAd.js
 * Included from:     /liligo/full.js:4
 */

	
/*
 * Included file begin: /liligo/src/liligo.DOM.js
 * Included from:       /liligo/full.js:5
 */
(function() {

	var _liligo = liligo;
	
	if (_liligo.DOM) return;

	var
		doc = window.document,
		extend = _liligo.exportedExtend,
		DOM, addScript, Element,
		body,
		getByTag = function(tagName) {
			return doc.getElementsByTagName(tagName);
		};

	DOM = _liligo.Singleton({
		
		addScript: addScript = function(source) {
			if (DEBUG) {
				var heads = getByTag("head");
				if (!heads.length) {
					var error = "liligo.DOM.addScript: DOM is not ready!";
					window.console && console.log(error);
					throw new Error(error);
				}
			}
			getByTag("head")[0].appendChild(
				Element("script", {
					src: source,
					type: "text/javascript"
				})
			);
		},
		
		Element: Element = function(tagName, attribs, _doc) {
			return extend(
				(_doc || doc).createElement(tagName),
				attribs || {}
			);
		},
		
		add: function(element) {
			if (typeof element != "object") {
				element = Element.apply(this, arguments);
			}
			if (!body) {
				body = getByTag("body")[0];
			}
			body.appendChild(element);
			return element;
		},
		
		remove: function(element) {
			element = _liligo.$(element);
			element.parentNode.removeChild(element);
		}
		
	});
	
	_liligo.extend({
		DOM: DOM,
		addScript: addScript,
		Element: Element
	});
	
})();
/*
 * Included file end: /liligo/src/liligo.DOM.js
 * Included from:     /liligo/full.js:5
 */

	
/*
 * Included file begin: /liligo/src/liligo.LazyLabels.js
 * Included from:       /liligo/full.js:6
 */
(function() {

	var
		_liligo = liligo,
		pending = {},
		done = {};
	
	_liligo._addLazyLabels = function(url, callback, _hash) {
		_hash = url.split(/=/)[1];
		if (done[_hash]) {
			callback();
		} else if (pending[_hash]) {
			callback && pending[_hash].push(callback);
		} else {
			pending[_hash] = callback ? [callback] : [];
			_liligo.addScript(url);
		}
	};
		
	_liligo._onLazyLabels = function(hash, _callbacks, _callback) {
		done[hash] = 1;
		_callbacks = pending[hash];
		if (_callbacks) {
			while (_callback = _callbacks.shift()) {
				_callback && _callback();
			}
			pending[hash] = 0;
		}
	};

})();
/*
 * Included file end: /liligo/src/liligo.LazyLabels.js
 * Included from:     /liligo/full.js:6
 */

	
/*
 * Included file begin: /liligo/src/liligo.Query.js
 * Included from:       /liligo/full.js:7
 */
(function() {

	"cc:not evil,quickId:nomunge,getNodes:nomunge,byId:nomunge,byTag:nomunge,nodup:nomunge,byClassName:nomunge,byPseudo:nomunge,byAttribute:nomunge,attrValue:nomunge";

	/*
		modified Ext.DomQuery
		license: http://www.opensource.org/licenses/mit-license.php
	*/

	var
		_liligo = liligo,
		$ = _liligo.$;

	if (_liligo.Query) return;

	var cache = {}, simpleCache = {}, valueCache = {};
	var nonSpace = /\S/;
	var trimRe = /^\s*(.*?)\s*$/;
	var tplRe = /\{(\d+)\}/g;
	var modeRe = /^(\s?[\/>]\s?|\s|$)/;
	var tagTokenRe = /^(#)?([\w-\*]+)/;
	var IE = /*@cc_on!@*/false;

	function child(p, index) {
		var i = 0;
		var n = p.firstChild;
		while (n) {
			if (n.nodeType == 1) {
				if (++i == index) {
					return n;
				}
			}
			n = n.nextSibling;
		}
		return null;
	};

	function next(n) {
		while ((n = n.nextSibling) && n.nodeType != 1);
		return n;
	};
	
	function prev(n) {
		while ((n = n.previousSibling) && n.nodeType != 1);
		return n;
	};
	
	function clean(d) {
		var n = d.firstChild, ni = -1;
		while(n) {
			var nx = n.nextSibling;
			if (n.nodeType == 3 && !nonSpace.test(n.nodeValue)) {
				d.removeChild(n);
			} else {
				n.nodeIndex = ++ni;
			}
			n = nx;
		}
		return this;
	};

	function byClassName(c, a, v, re, cn) {
		if (!v) {
			return c;
		}
		var r = [];
		for (var i = 0, ci; ci = c[i]; i++) {
			cn = ci.className;
			if (cn && (' '+cn+' ').indexOf(v) != -1) {
				r.push(ci);
			}
		}
		return r;
	};

	function attrValue(n, attr) {
		if (!n.tagName && typeof n.length != "undefined") {
			n = n[0];
		}
		if (!n) {
			return null;
		}
		if (attr == "for") {
			return n.htmlFor;
		}
		if (attr == "class" || attr == "className") {
			return n.className;
		}
		return n.getAttribute(attr) || n[attr];
	};
	
	function getNodes(ns, mode, tagName) {
		var result = [], cs;
		if (!ns) {
			return result;
		}
		mode = mode ? mode.replace(trimRe, "$1") : "";
		tagName = tagName || "*";
		if (typeof ns.getElementsByTagName != "undefined") {
			ns = [ns];   
		}
		if (mode != "/" && mode != ">") {
			for (var i = 0, ni; ni = ns[i]; i++) {
				cs = ni.getElementsByTagName(tagName);
				for (var j = 0, ci; ci = cs[j]; j++) {
					result.push(ci);
				}
			}
		} else {
			for (var i = 0, ni; ni = ns[i]; i++) {
				var cn = ni.getElementsByTagName(tagName);
				for (var j = 0, cj; cj = cn[j]; j++) {
					if (cj.parentNode == ni) {
						result.push(cj);
					}
				}
			}
		}
		return result;
	};

	function concat(a, b) {
		if (b.slice) {
			return a.concat(b);
		}
		for (var i = 0, l = b.length; i < l; i++) {
			a.push(b[i]);
		}
		return a;
	};
	
	function byTag(cs, tagName) {
		if (cs.tagName || cs == document) {
			cs = [cs];
		}
		if (!tagName) {
			return cs;
		}
		var r = []; tagName = tagName.toLowerCase();
		for (var i = 0, ci; ci = cs[i]; i++) {
			if (ci.nodeType == 1 && ci.tagName.toLowerCase()==tagName) {
				r.push(ci);
			}
		}
		return r; 
	};
	
	function byId(cs, attr, id) {
		if (cs.tagName || cs == document) {
			cs = [cs];
		}
		if (!id) {
			return cs;
		}
		var r = [];
		for (var i = 0,ci; ci = cs[i]; i++) {
			if (ci && ci.id == id) {
				r.push(ci);
				return r;
			}
		}
		return r; 
	};

	function byAttribute(cs, attr, value, op, custom) {
		var r = [], st = (custom == "{");
		var f = Query.operators[op], a, i;
		for (i = 0; ci = cs[i]; i++) {
			if (st) {
				a = Style.get(ci, attr);
			} else if (attr == "class" || attr == "className") {
				a = ci.className;
			} else if (attr == "for") {
				a = ci.htmlFor;
			} else if (attr == "href") {
				a = ci.getAttribute("href", 2);
			} else {
				a = ci.getAttribute(attr);
			}
			if ((f && f(a, value)) || (!f && a)) {
				r.push(ci);
			}
		}
		return r;
	};

	function byPseudo(cs, name, value) {
		return Query.pseudos[name](cs, value);
	};

	var key = 30803;
	
	function nodupIEXml(cs) {
		var d = ++key;
		cs[0].setAttribute("_nodup", d);
		var r = [cs[0]];
		for (var i = 1, len = cs.length; i < len; i++) {
			var c = cs[i];
			if (!c.getAttribute("_nodup") != d) {
				c.setAttribute("_nodup", d);
				r.push(c);
			}
		}
		for (var i = 0, len = cs.length; i < len; i++) {
			cs[i].removeAttribute("_nodup");
		}
		return r;
	};
	
	function nodup(cs) {
		var len = cs.length, c, i, r = cs, cj;
		if (!len || typeof cs.nodeType != "undefined" || len == 1) {
			return cs;
		}
		if (IE && typeof cs[0].selectSingleNode != "undefined") {
			return nodupIEXml(cs);
		}
		var d = ++key;
		cs[0]._nodup = d;
		for (i = 1; c = cs[i]; i++) {
			if (c._nodup != d) {
				c._nodup = d;
			} else {
				r = [];
				for (var j = 0; j < i; j++) {
					r.push(cs[j]);
				}
				for (j = i+1; cj = cs[j]; j++) {
					if (cj._nodup != d) {
						cj._nodup = d;
						r.push(cj);
					}
				}
				return r;
			}
		}
		return r;
	};

	function quickDiffIEXml(c1, c2) {
		var d = ++key;
		for (var i = 0, len = c1.length; i < len; i++) {
			c1[i].setAttribute("_qdiff", d);
		}
		var r = [];
		for (var i = 0, len = c2.length; i < len; i++) {
			if (c2[i].getAttribute("_qdiff") != d) {
				r.push(c2[i]);
			}
		}
		for (var i = 0, len = c1.length; i < len; i++) {
			c1[i].removeAttribute("_qdiff");
		}
		return r;
	};

	function quickDiff(c1, c2) {
		var len1 = c1.length;
		if (!len1) {
			return c2;
		}
		if (IE && c1[0].selectSingleNode) {
			return quickDiffIEXml(c1, c2);
		}
		var d = ++key;
		for (var i = 0; i < len1; i++) {
			c1[i]._qdiff = d;
		}
		var r = [];
		for (var i = 0, len = c2.length; i < len; i++) {
			if (c2[i]._qdiff != d) {
				r.push(c2[i]);
			}
		}
		return r;
	};

	function quickId(ns, mode, root, id) {
		if (ns == root) {
			var d = root.ownerDocument || root;
			return d.getElementById(id);
		}
		ns = getNodes(ns, mode, "*");
		return byId(ns, null, id);
	};

	var Query = _liligo.Singleton({
		
		/**
		* Compiles a selector/xpath query into a reusable function. The returned function
		* takes one parameter "root" (optional), which is the context node from where the query should start. 
		* @param {String} selector The selector/xpath query
		* @param {String} type (optional) Either "select" (the default) or "simple" for a simple selector match
		* @return {Function}
		*/
		compile: function(path, type) {
			"eval:not evil";
			// strip leading slashes
			while (path.substr(0, 1)=="/") {
				path = path.substr(1);
			}
			type = type || "select";
			
			var fn = ["var f=function(root){var mode,n=root||document;"];
			var q = path, mode, lq;
			var tk = Query.matchers;
			var tklen = tk.length;
			var mm;
			while (q && lq != q) {
				lq = q;
				var tm = q.match(tagTokenRe);
				if (type == "select") {
					if (tm) {
						if (tm[1] == "#") {
							fn.push('n=quickId(n,mode,root,"', tm[2], '");');
						} else {
							fn.push('n=getNodes(n,mode,"', tm[2], '");');
						}
						q = q.replace(tm[0], "");
					} else if (q.substr(0, 1) != '@') {
						fn.push('n=getNodes(n,mode,"*");');
					}
				} else {
					if (tm) {
						if (tm[1] == "#") {
							fn.push('n=byId(n,null,"', tm[2], '");');
						} else {
							fn.push('n=byTag(n,"',tm[2],'");');
						}
						q = q.replace(tm[0], "");
					}
				}
				while (!(mm = q.match(modeRe))) {
					var matched = false;
					for (var j = 0; j < tklen; j++) {
						var t = tk[j];
						var m = q.match(t[0]);
						if (m) {
							fn.push(t[1].replace(tplRe, function(x, i) {
								return m[i];
							}));
							q = q.replace(m[0], "");
							matched = true;
							break;
						}
					}
					// prevent infinite loop on bad selector
					if (!matched) {
						throw 'Error parsing selector, parsing failed at "' + q + '"';
					}
				}
				if (mm[1]) {
					fn.push('mode="', mm[1], '";');
					q = q.replace(mm[1], "");
				}
			}
			fn.push("return nodup(n);}");
			eval(fn.join(""));
			return f;
		},

		/**
		* Selects a group of elements.
		* @param {String} selector The selector/xpath query
		* @param {Node} root (optional) The start of the query (defaults to document).
		* @return {Array}
		*/
		select: function(path, root) {
			root = (!root || root == document) ? document : $(root);
			var paths = path.split(",");
			var results = [];
			for (var i = 0, len = paths.length; i < len; i++) {
				var p = paths[i].replace(trimRe, "$1");
				if (!cache[p]) {
					if (!(cache[p] = Query.compile(p))) {
						throw p + " is not a valid selector";
					}
				}
				var result = cache[p](root);
				if (result && result != document) {
					results = results.concat(result);
				}
			}
			return results;
		},

		/**
		* Selects a single element.
		* @param {String} selector The selector/xpath query
		* @param {Node} root (optional) The start of the query (defaults to document).
		* @return {Element}
		*/
		selectNode: function(path, root) {
			return Query.select(path, root)[0];
		},
	
		/**
		* Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child)
		* @param {String/HTMLElement/Array} el An element id, element or array of elements
		* @param {String} selector The simple selector to test
		* @return {Boolean}
		*/
		is: function(el, ss) {
			return (Query.filter([$(el)], ss).length > 0);
		},

		up: function(el, ss) {
			el = $(el);
			while (el) {
				if (Query.is(el, ss)) return el;
				el = el.parentNode;
			}
		},

		/**
		* Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child)
		* @param {Array} el An array of elements to filter
		* @param {String} selector The simple selector to test
		* @param {Boolean} nonMatches If true, it returns the elements that DON'T match 
		* the selector instead of the ones that match
		* @return {Array}
		*/
		filter: function(els, ss, nonMatches) {
			ss = ss.replace(trimRe, "$1");
			if (!simpleCache[ss]) {
				simpleCache[ss] = Query.compile(ss, "simple");
			}
			var result = simpleCache[ss](els);
			return nonMatches ? quickDiff(result, els) : result;
		},

		/**
		* Collection of matching regular expressions and code snippets. 
		*/
		matchers : [
			[
				/^\.([\w-]+)/,
				'n=byClassName(n,null," {1} ");'
			], [
				/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
				'n=byPseudo(n,"{1}","{2}");'
			], [
				/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
				'n=byAttribute(n,"{2}","{4}","{3}","{1}");'
			], [
				/^#([\w-]+)/,
				'n=byId(n,null,"{1}");'
			], [
				/^@([\w-]+)/,
				'return {firstChild:{nodeValue:attrValue(n,"{1}")}};'
			]
		],

		/**
		* Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *= and %=.
		* New operators can be added as long as the match the format <i>c</i>= where <i>c<i> is any character other than space, &gt; &lt;.
		*/
		operators: {
			"=": function(a, v) {
				return a == v;
			},
			"!=": function(a, v) {
				return a != v;
			},
			"^=": function(a, v) {
				return a && a.substr(0, v.length) == v;
			},
			"$=": function(a, v) {
				return a && a.substr(a.length-v.length) == v;
			},
			"*=": function(a, v) {
				return a && a.indexOf(v) !== -1;
			},
			"%=": function(a, v) {
				return (a % v) == 0;
			}
		},

		/**
		* Collection of "pseudo class" processors. Each processor is passed the current nodeset (array)
		* and the argument (if any) supplied in the selector.
		*/
		pseudos: {
			
			"first-child": function(c) {
				for (var i = 0, ci, r = [], n; ci = n = c[i]; i++) {
					n = prev(n);
					if (!n) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"last-child": function(c) {
				for (var i = 0, ci, r = []; ci = n = c[i]; i++) {
					n = next(n);
					if (!n) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"nth-child": function(c, a) {
				var r = [];
				if (a != "odd" && a != "even") {
					for (var i = 0, ci; ci = c[i]; i++) {
						var m = child(ci.parentNode, a);
						if (m == ci) {
							r.push(m);
						}
					}
					return r;
				}
				// first let's clean up the parent nodes
				for (var i = 0, p, l = c.length; i < l; i++) {
					var cp = c[i].parentNode;
					if (cp != p) {
						clean(cp);
						p = cp;
					}
				}
				// then lets see if we match
				for (var i = 0, ci; ci = c[i]; i++) {
					var m = false;
					if (a == "odd") {
						m = ((ci.nodeIndex+1) % 2 == 1);
					} else if (a == "even") {
						m = ((ci.nodeIndex+1) % 2 == 0);
					}
					if (m) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"only-child": function(c) {
				for (var i = 0, ci, r = []; ci = c[i]; i++) {
					if (!prev(ci) && !next(ci)) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"empty": function(c) {
				for (var i = 0, ci, r = []; ci = c[i]; i++) {
					var cns = ci.childNodes, j = 0, cn, empty = true;
					while (cn = cns[j]) {
						++j;
						if (cn.nodeType == 1 || cn.nodeType == 3) {
							empty = false;
							break;
						}
					}
					if (empty) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"contains": function(c, v) {
				for (var i = 0, ci, r = []; ci = c[i]; i++) {
					if (ci.innerHTML.indexOf(v) !== -1) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"nodeValue": function(c, v) {
				for (var i = 0, ci, r = []; ci = c[i]; i++) {
					if (ci.firstChild && ci.firstChild.nodeValue == v) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"checked": function(c) {
				for (var i = 0, ci, r = []; ci = c[i]; i++) {
					if (ci.checked == true) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"not": function(c, ss) {
				return Query.filter(c, ss, true);
			},
			
			"odd": function(c) {
				return this["nth-child"](c, "odd");
			},
			
			"even": function(c) {
				return this["nth-child"](c, "even");
			},
			
			"nth": function(c, a) {
				return c[a-1];
			},
			
			"first": function(c) {
				return c[0];
			},
			
			"last": function(c) {
				return c[c.length-1];
			},
			
			"has": function(c, ss) {
				var s = Query.select;
				for (var i = 0, ci, r = []; ci = c[i]; i++) {
					if (s(ss, ci).length > 0) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"next": function(c, ss) {
				for (var i = 0, ci, r = [], is = Query.is; ci = c[i]; i++) {
					var n = next(ci);
					if (n && is(n, ss)) {
						r.push(ci);
					}
				}
				return r;
			},
			
			"prev": function(c, ss) {
				for (var i = 0, ci, r = [], is = Query.is; ci = c[i]; i++) {
					var n = prev(ci);
					if (n && is(n, ss)) {
						r.push(ci);
					}
				}
				return r;
			}
		}
	});
	
	_liligo.extend({
		Query: Query,
		$$: Query.select
	});

})();
/*
 * Included file end: /liligo/src/liligo.Query.js
 * Included from:     /liligo/full.js:7
 */

	
/*
 * Included file begin: /liligo/src/liligo.JSON.js
 * Included from:       /liligo/full.js:8
 */
(function() {

	var _liligo = liligo;
	
	if (_liligo.JSON) return;

	var escapeMap = {
		"\b": "\\b",
		"\t": "\\t",
		"\n": "\\n",
		"\f": "\\f",
		"\r": "\\r",
		'"' : '\\"',
		"\\": "\\\\"
	};
	
	var JSON = _liligo.Singleton({
		
		encode: function(object) {
			var
				type = typeof object,
				_null = "null";
			switch (type) {
				case "undefined":
				case "function":
				case "unknown": return _null;
				case "boolean": return object?"true":"false";
				case "string": return JSON.escape(object);
				case "number": return isFinite(object) ? (""+object) : _null;
	    }
			if (object === null) return _null;
	    if (window.document && (object.ownerDocument === document)) return;
			if (object.getTimezoneOffset) {
				return JSON._date(object);
			} else if (object.join && object.slice) {
		    var results = [];
				for (var i=0,len=object.length;i<len;i++) {
		      results.push(JSON.encode(object[i]));
		    }
		    return "["+results.join(",")+"]";
			} else {
				var results = [];
		    for (var property in object) if (object.hasOwnProperty(property)) {
		      var value = JSON.encode(object[property]);
		      if (value !== undefined) {
						results.push(JSON.escape(property) + ':' + value);
					}
		    }
		    return "{"+results.join(",")+"}";
			}
		},
		
		escape: function(s) {
			if (/["\\\x00-\x1f]/.test(s)) {
				return '"'+s.replace(/([\x00-\x1f\\"])/g, function (a, b) {
					var c = escapeMap[b];
					if (c) {
						return c;
					}
					c = b.charCodeAt();
					return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
				})+'"';
			}
			return '"'+s+'"';
		},
		
		validate: function(json) {
			return (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(json));
		},
		
		decode: function(json) {
			"eval:not evil";
			try {
				return eval("("+json+")");
			} catch(e) {
				return undefined;
			}
		},
		
		_date: (function() {
			if (Date.toISOString) {
				return function(date) {
					return Date.toISOString(date);
				};
			} else {
				var f = function(n) {
					return n<10 ? ("0" + n) : n;
				};
				
				return function(date) {
					return [
						'"', date.getFullYear(), "-",
						f(date.getMonth()+1), "-",
						f(date.getDate()), "T",
						f(date.getHours()), ":",
						f(date.getMinutes()), ":",
						f(date.getSeconds()), '"'
					].join("");
				};
			}
		})() 
		
	});

	_liligo.extend({JSON: JSON});

})();
/*
 * Included file end: /liligo/src/liligo.JSON.js
 * Included from:     /liligo/full.js:8
 */

	
/*
 * Included file begin: /liligo/src/liligo.ArrayGen.js
 * Included from:       /liligo/full.js:9
 */
(function() {

	if (liligo.ArrayGen) return;

	var ArrayGen = liligo.Singleton({
		
		contains: function(arr, it) {
			for (var i=0,l=arr.length; i<l; i++) {
				if (arr[i] == it) return true;
			}
			return false;
		},
		
		forEach: function(obj, fn, cont) {
			cont = cont || null;
			var i,l;
			if ((typeof obj.forEach == "function") && (obj.forEach != arguments.callee)) {
				return obj.forEach(fn, cont);
			} else if (typeof obj.length == "number") {
				if (typeof Array.forEach == "function") {
					return Array.forEach(obj, fn, cont);
				} else {
					return ArrayGen.forEachArray(obj, fn, cont);
				}
			} else {
				return ArrayGen.forEachObject(obj, fn, cont);
			}
		},
		
		forEachArray: function(obj, fn, cont) {
			if (typeof obj == "string") {
				for (var i=0,l=obj.length; i<l; i++) {
					fn.call(cont, obj.charAt(i), i);
				}
			} else {
				for (var i=0,l=obj.length; i<l; i++) {
					fn.call(cont, obj[i], i);
				}
			}
		},
		
		forEachObject: function(obj, fn, cont) {
			var i;
			for (i in obj) if (obj.hasOwnProperty(i)) {
				fn.call(cont, obj[i], i);
			}
		},
		
		filter: function(obj, fn, cont) {
			if ((typeof obj.filter == "function") && (obj.filter != arguments.callee)) {
				return obj.filter(fn, cont);
			} else if (typeof obj.length == "number") {
				var ret = [];
				ArrayGen.forEachArray(obj, function(oi) {
					if (fn.apply(this, arguments)) {
						ret.push(oi);
					}
				}, cont);
				return ret;
			} else {
				var ret = {};
				ArrayGen.forEachObject(obj, function(oi, i) {
					if (fn.apply(this, arguments)) {
						ret[i] = oi;
					}
				}, cont);
				return ret;
			}
		},
		
		optionsPush: function(name, value) { // for <select> options
			var l = this.length++;
			this[l].text = name;
			this[l].value = value;
		},
		
		htmlOptions: function(target) { //# functional typecaster for Safari
			var hO = {};
			hO.self = target;
			hO.reset = function() { this.self.length = 0; };
			hO.push = function(name, value) {
				var l = this.self.length++;
				this.self[l].text = name;
				this.self[l].value = value;
			};
			return hO; 
		}
		
	});

	liligo.extend({
		ArrayGen: ArrayGen,
		contains: ArrayGen.contains,
		forEach: ArrayGen.forEach,
		filter: ArrayGen.filter,
		htmlOptions: ArrayGen.htmlOptions
	});

})();
/*
 * Included file end: /liligo/src/liligo.ArrayGen.js
 * Included from:     /liligo/full.js:9
 */

	
/*
 * Included file begin: /liligo/src/liligo.Event.js
 * Included from:       /liligo/full.js:10
 */
(function() {

	var
		_liligo = liligo,
		safari = _liligo.safari,
		Singleton = _liligo.Singleton,
		$ = _liligo.$,
		DOMContentLoaded = "DOMContentLoaded",
		singleObserve = "singleObserve",
		stopObserving = "stopObserving",
		onreadystatechange = "onreadystatechange",
		readyState = "readyState",
		doc = window.document;
	
	if (_liligo.Event) return;
	
	_liligo.require("BOM");
	
	var _onDOMContentLoaded = Singleton({
		
		_observers: [],
		_inited: false,
		_fired: false,
		
		fire: function() {
			if (_onDOMContentLoaded._fired) return;
			_onDOMContentLoaded._fired = true;
			if (_onDOMContentLoaded._timer) {
				clearInterval(_onDOMContentLoaded._timer);
			}
			var observers = _onDOMContentLoaded._observers;
			for (var i=0, length = observers.length; i<length; i++) {
				observers[i]();
			}
			_onDOMContentLoaded._observers = [];
		},
		
		_startTimer: function() {
			this._timer = setInterval(function() {
				if (/loaded|complete/.test(doc[readyState])) {
					_onDOMContentLoaded.fire();
				}
			}, 100);
		},
		
		_init: function() {
			if (this._inited) return;
			this._inited = true;
			if (safari || (window.opera && 1*opera.version() < 9)) {
				this._startTimer();
			} else if (_liligo.IE) {
				var id = ("__ie_onload_"+Math.random()).replace(/\./, "");
				doc.write('<script id="'+id+'" defer="defer" src="//:"><\/script>');
				$(id)[onreadystatechange] = function() {
					if (this[readyState] == "complete") {
						this.removeNode();
						if (doc[readyState] != "complete") {
							_onDOMContentLoaded._startTimer();
						} else {
							_onDOMContentLoaded.fire();
						}
					}
				};
			}
		},
		
		push: function(observer) {
			this._init();
			this._observers.push(observer);
		}
		
	});

	var Event = Singleton({
		
		KEY_BACKSPACE: 8,
		KEY_TAB:       9,
		KEY_RETURN:   13,
		KEY_ESC:      27,
		KEY_LEFT:     37,
		KEY_UP:       38,
		KEY_RIGHT:    39,
		KEY_DOWN:     40,
		KEY_DELETE:   46,
		KEY_HOME:     36,
		KEY_END:      35,
		KEY_PAGEUP:   33,
		KEY_PAGEDOWN: 34,
		
		pointerX: function(event) {
			return event.pageX || (event.clientX +
				(doc.documentElement.scrollLeft || doc.body.scrollLeft)
			);
		},
		
		pointerY: function(event) {
			return event.pageY || (event.clientY +
				(doc.documentElement.scrollTop || doc.body.scrollTop)
			);
		},
		
		element: function(event) {
			return event.target || event.srcElement;
		},
		
		stop: function(event) {	
			if (!event) return;
			if (event.preventDefault) {
				event.preventDefault();
				event.stopPropagation();
			} else {
				event.returnValue = false;
				event.cancelBubble = true;
			}
			return event;
		},
		
		bind: _liligo.bindAsEventListener,
		
		bindStop: function(f, t, a, b, c) {
			return function(event) {
				return f.call(t, Event.stop(event || window.event), a, b, c)
			};
		},
		
		observe: function(element, observers, f, useCapture) {
			element = $(element);
			if (!element) return false; // TODO: handle these errors properly, investigate Opera
			if (typeof observers == "object") {
				for (var i in observers) if (observers.hasOwnProperty(i)) {
					Event[singleObserve](element, i, observers[i]);
				}
			} else {
				Event[singleObserve](element, observers, f, useCapture);
			}
		},

		Observer: _liligo.Class({
			
			constructor: function() {
				this.args = arguments;
				Event.observe.apply(Event, arguments);
			},
			
			stop: function() {
				Event[stopObserving].apply(Event, this.args);
			}
			
		}),

		init: function() {
			
			if (_liligo.detect("(element.addEventListener)")) {
				
				this[singleObserve] = function(element, name, observer, useCapture) {
					var onDOMcl = (name == DOMContentLoaded);
					if (onDOMcl) element = doc;
					
					if (onDOMcl && (safari || (window.opera && 1*opera.version() < 9))) {
						_onDOMContentLoaded.push(observer);
					} else {
						if (safari && (name == "keypress")) {
							name = "keydown";
						}
						element.addEventListener(
							name, observer,
							useCapture = useCapture || false
						);
					}
				};
				
				this[stopObserving] = function(element, name, observer, useCapture) {
					if (safari && (name == "keypress")) {
						name = "keydown";
					}
					$(element).removeEventListener(
						name, observer,
						useCapture = useCapture || false
					);
				};
				
			} else {
				
				this[singleObserve] = function(element, name, observer, useCapture) {
					useCapture = useCapture || false;
					var onDOMcl = (name == DOMContentLoaded);
					if (onDOMcl) element = doc;
					
					if (name == DOMContentLoaded) {
						_onDOMContentLoaded.push(observer);
					} else {
						element.attachEvent("on" + name, observer);
					}
					if (!onDOMcl) {
						(this._observers || (this._observers = [])).push(
							[element, name, observer, useCapture]
						);
					}
				};
				
				this[stopObserving] = function(element, name, observer, useCapture) {
					try {
						$(element).detachEvent("on" + name, observer);
					} catch (e) {}
				};
				
				this._unloadCache = function() {
					if (!Event._observers) return;
					for (var i=0, length=Event._observers.length; i<length; i++) {
						Event[stopObserving].apply(Event, Event._observers[i]);
						Event._observers[i][0] = null;
					}
					Event._observers = false;
				};
				
				this[singleObserve](window, "unload", this._unloadCache, false);
				
			}
			
		}
		
	});
	
	_liligo.extend({

		Event: Event,

		__Eo: Event.observe,
		__Eb: Event.bind,
		__EbS: Event.bindStop,

		domLoaded: function(f) {
			Event[singleObserve](0, DOMContentLoaded, f);
		}
		
	});

})();
/*
 * Included file end: /liligo/src/liligo.Event.js
 * Included from:     /liligo/full.js:10
 */

	
/*
 * Included file begin: /liligo/src/liligo.VTemplate.js
 * Included from:       /liligo/full.js:11
 */
(function() {

	var _liligo = liligo, bind = _liligo.bind;

	if (_liligo.VTemplate) return;
	
	/* Cached template objects, we need them for Velocity include support */
	var cache = {};
	
	_liligo.extend({
	
		VTemplate: _liligo.Class({
		
			constructor: function(fileName, func) {
				this._render = func;
				if (fileName) {
					cache[fileName] = this;
				}
			},
		
			process: function(context, flags) {
				flags = flags || {};
				if (typeof flags == "string") flags = {lang:flags};
				context = context || {};
				if (flags.lang && !context.labels) {
					context.labels = _liligo.allLabels[flags.lang] || {};
				} else {
					context.labels = context.labels || _liligo.labels;
				}
				return this._render(context || {});
			}
			
		}),
		
		__VT_cache: cache,
		
		__VT_StringCat: function() {
			var output = [];
			output.p = output.push;
			output.toString = function() {
				return this.join("");
			};
			return output;
			
			/*
			
			// Based on vel2jstools.js of velocity2js:
			
			var
				sp,
				ep,
				l = 0,
				_this = this;
			
			_this.push =
			_this.p = function(what) {
				if (sp === undefined) {
					sp = ep = [];
				} else {
					var oldEp = ep;
					oldEp[1] = ep = [];
				}
				ep[0] = what;
				++l;
			};
			
			_this.toString = function() {
				if (l == 0) {
					return "";
				}
				
				while (l>1) {
					var
						ptr = sp,
						nsp = [],
						nep = nsp;
						nl = 0;
					
					while (ptr !== undefined) {
						if (nep[0] === undefined) {
							nep[0] = ptr[0];
							++nl;
						} else {
							if (ptr[0] !== undefined) {
								nep[0] += ptr[0];
							}
							nep = nep[1] = [];
						}
						ptr = ptr[1];
					}
					sp = nsp;
					ep = nep;
					l = nl;
				}
				return sp[0];
			};
			*/
		}
		
	});

})();
/*
 * Included file end: /liligo/src/liligo.VTemplate.js
 * Included from:     /liligo/full.js:11
 */

	
/*
 * Included file begin: /liligo/src/liligo.TPTemplate.js
 * Included from:       /liligo/full.js:12
 */
(function() {

	"__LSC__:nomunge";

	/*
		modified TrimPath Templates-R
		original Templates-R by Theodor Zoulias
		original Templates by TrimPath
	*/

	var
		_liligo = liligo,
		Class = _liligo.Class;
	
	if (_liligo.TPTemplate) return;

	var PRESERVE_CR = false;

	function minifyFunc($0, $1, body) {
		return body.replace(/\s*\n\s*/g, " ").replace(/^\s+|\s+$/g, "");
	}

	function encodeJS(s) {
		return s.replace(/([\\'])/g, "\\$1").replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t");
	}
	
	var __LSC__ = function() {
		this.level = -1;
		this.goUp = function() {
			this.level++;
			this[this.level] = 0
		};
		this.goDown = function() {
			this.level--;
		};
		this.increment = function() {
			this[this.level]++;
		};
		this.getCurrent = function() {
			return this[this.level];
		};
	};
	
	var tagFunctions = {
		"if": function(expression) {return "if(" + expression + "){"},
		elseif: function(expression) {return "}else if(" + expression + "){"},
		"else": function() {return "}else{"},
		"/if": function() {return "}"},
		"for": function(expression) {
			var match = expression.match(/^(\w+) in(\s*arr\S*)? (.+)$/i);
			if (match) {
				var listName = "__LIST__" + match[1];
				var indexName = match[1] + "_index";
				if (match[2]) {
					return [
						"var ", listName, "=", match[3], ";",
						"__LS__.goUp();",
						"if (", listName, "!=null){",
						"for(var ", indexName, "=0,", listName, "_len=", listName, ".length;", indexName, "<", listName, "_len;", indexName, "++){",
						"__LS__.increment();",
						"var ", match[1], "=", listName, "[", indexName, "];"
					].join("");
				} else {
					return [
						"var ", listName, "=", match[3], ";",
						"__LS__.goUp();",
						"if (", listName, "!=null){",
						"for(var ", indexName, " in ", listName, "){",
						"if (typeof ", listName, "[", indexName, "]=='function') continue;",
						"__LS__.increment();",
						"var ", match[1], "=", listName, "[", indexName, "];"
					].join("");
				}
			}
		},
		forelse: function() {
			return "}}if(!__LS__.getCurrent()){if(true){";
		},
		"/for": function() {return "}}__LS__.goDown();"},
		"var": function(expression) {return "var "+expression+";"},
		macro: function(expression) {
			var match = expression.match(/^(\w+)\s*\(([^\)]*)\)\s*$/);
			if (match) {
				return [
					"function ", match[1], "(", match[2], "){",
					"var __LS__= new __LSC__();",
					"var __OUT__=[];var _ECHO=function(s) {__OUT__[__OUT__.length]=s};",
				].join("");
			};
		},
		"/macro": function() {return "return __OUT__.join('')}"},
		"eval": function(expression) {
			return "eval('" + encodeJS(expression.replace(/\x07/g, "}")) + "');";
		},
		cdata: function(expression) {
			return "_ECHO('" + encodeJS(expression.replace(/\x07/g, "}")) + "');";
		}
	};

	var TPTemplate = Class({
		
		constructor: function(source) {
			if (typeof source == "function") {
				this._source = "";
				this._render = source;
			} else {
				this._source = source ? String(source) : "";
			}
			this.modifiers = new TPTemplate._Modifiers();
		},
		
		parse: function() {
			"eval:not evil";
			var temp = this._source.replace(/\s+$/, "");
			temp = temp.replace(/[\x00-\x08\x0b\x0c\x0e-\x19]/g, "");
			if (!PRESERVE_CR) temp = temp.replace(/\r/g, "");
			if (/\{eval/.test(temp)) {
				temp = temp.replace(/\{(\/?eval)\}/g, "{$1\x05");
				var reEval = /\{eval\x05([^\x05]*)\{\/eval\x05/g;
				temp = temp.replace(reEval, function($0, body) {
					return "{eval " + body.replace(/\}/g, "\x07") + "}"
				});
				temp = temp.replace(/\x05/g, "}");
				var reEvalEOF = /\{eval\s+(\w+)\s*\}([\s\S]*)\1/g;
				temp = temp.replace(reEvalEOF, function($0, $1, body) {
					return "{eval " + body.replace(/\}/g, "\x07") + "}";
				});
			}
			if (/\{cdata/.test(temp)) {
				temp = temp.replace(/\{(\/?cdata)\}/g, "{$1\x05");
				var reCData = /\{cdata\x05([^\x05]*)\{\/cdata\x05/g;
				do {
					var found = false;
					temp = temp.replace(reCData, function($0, body) {
						found = true; return "{cdata\x06" + body.replace(/[\}\x06]/g, "\x07") + "{/cdata\x06"
					});
				} while (found);
				temp = temp.replace(/\x06/g, "\x05");
				temp = temp.replace(reCData, function($0, body) {
					return "{cdata " + body + "}";
				});
				temp = temp.replace(/\x05/g, "}");
				var reCDataEOF = /\{cdata\s+(\w+)\s*\}([\s\S]*)\1/g;
				temp = temp.replace(reCDataEOF, function($0, $1, body) {
					return "{cdata " + body.replace(/\}/g, "\x07") + "}"
				});
			}
			var reMinify = /\{(minify)\}([^\}]*)\{\/minify\}/g;
			temp = temp.replace(reMinify, minifyFunc);
			var reMinifyEOF = /\{minify (\w+)\s*\}([^\}]*)\1/g;
			temp = temp.replace(reMinifyEOF, minifyFunc);
			var reExpression = /\$\{(%?)\s*([^\}\x07]+)\1\}/g;
			var expressions = [];
			temp = temp.replace(reExpression, function($0, $1, expression) {
				var rePipe = /([^\|])\|([^\|])/g;
				if (rePipe.test(expression)) {
					expression = expression.replace(rePipe, "$1\x08$2").replace(rePipe, "$1\x08$2");
					var pieces = expression.split("\x08");
					var identifier = pieces[0];
					var s1 = "_ECHO(";
					var s2 = ");";
					var reParams = /^([^:]*):?(.*)$/;
					for (var i = pieces.length - 1; i > 0; i--) {
						var match = pieces[i].match(reParams);
						params = match[2] && ("," + match[2]);
						s1 += "_MODIFIERS[\"" + match[1] + "\"](";
						s2 = params + ")" + s2;
					}
					expressions[expressions.length] = s1 + identifier + s2;
				} else {
					expressions[expressions.length] = "_ECHO(" + expression + ");";
				}
				return "\x01";
			});
			var reBlock = /\{(%?)((\/?[^\}\s]+)\s*([^\}]*))\1\}/g;
			var blocks = [];
			temp = temp.replace(reBlock, function($0, $1, $2, tag, expression) {
				var tagFunc = tagFunctions[tag];
				if (tagFunc) {
					blocks[blocks.length] = tagFunc(expression) || "";
					return "\x02";
				} else {
					return $0;
				}
			});
			var reWhiteSpaceLeft = /([\r\n]*)([^\x01\x02]+)/g;
			temp = temp.replace(reWhiteSpaceLeft, "$1\x04$2");
			var reWhiteSpaceRight = /(\x04[^\x01\x02]*[\r\n])([\t ]+[\x02])/g;
			temp = temp.replace(reWhiteSpaceRight, "$1\x04$2");
			temp = encodeJS(temp);
			var reLiteral = /([^\x01\x02\x04]*)\x04([^\x01\x02\x04]+)\x04?([^\x01\x02\x04]*)/g;
			var literals = [];
			temp = temp.replace(reLiteral, function($0, whitespaceLeft, body, whitespaceRight) {
				whitespaceLeft = whitespaceLeft && ("if(_FLAGS.keepWhitespace==true)_ECHO('" + whitespaceLeft + "');");
				body = body && ("_ECHO('" + body + "');");
				whitespaceRight = whitespaceRight && ("if(_FLAGS.keepWhitespace==true)_ECHO('" + whitespaceRight + "');");
				literals[literals.length] = whitespaceLeft + body + whitespaceRight;
				return "\x03";
			});
			var i1 = 0, i2 = 0, i3 = 0;
			temp = temp.replace(/\x01/g, function() {return expressions[i1++]});
			temp = temp.replace(/\x02/g, function() {return blocks[i2++]});
			temp = temp.replace(/\x03/g, function() {return literals[i3++]});
			this._sourceFunc = [
				"var _renderFunc=function(_CONTEXT,_ECHO,_FLAGS,_MODIFIERS) {function defined(p){return (_CONTEXT[p]!=null)};"+
				"var __LS__= new __LSC__();with(_CONTEXT){", temp, "}};_renderFunc"
			].join("");
			try {
				this._render = eval(this._sourceFunc);
			} catch(e) {
				this._render = function(_, _ECHO) {
					_ECHO("Error parsing template. Use original TrimPath engine to debug.");
				};
			}
		},
		
		process: function(context, flags) {
			flags = flags || {};
			if (typeof flags == "string") flags = {lang:flags};
			var out = [];
			context = context || {};
			if (flags.lang && !context.labels) {
				context.labels = _liligo.allLabels[flags.lang] || {};
			} else{
				context.labels = context.labels || _liligo.labels;
			}
			try {
				this._render(context || {}, function(s) {out.push(s)}, flags, this.modifiers);
			} catch (e) {
				if (flags.throwExceptions) throw e;
				return out.join("") + "[ERROR: " + e.toString() + (e.message ? "; " + e.message : "") + "]";
			}
			return out.join("");
		}
		
	}, {
	
		_Modifiers: Class({
			eat:        function()     {return ""},
			escape:     function(s)    {return _liligo.escapeHTML(String(s))},
			capitalize: function(s)    {return String(s).toUpperCase()},
			"default":  function(s, d) {return s!=null?s:d}
		}, {
			init: function() {
				this.prototype.h = this.prototype.escape;
			}
		}),
		
		init: function() {
			this.modifiers = this._Modifiers.prototype;
		},
		
		parse: function(source) {
			if (typeof source == "number") {
				var template = new TPTemplate(TPTemplate._precompiled[source]);
			} else {
				var template = new TPTemplate(source);
				template.parse();
			}
			return template;
		},
		
		parseDOM: function(elementId, document) {
			document = document || window.document;
			var element = document.getElementById(elementId);
			return TPTemplate.parse(
				(element.value || element.innerHTML)
					.replace(/&lt;/g, "<")
					.replace(/&gt;/g, ">")
					.replace(/^<!\[CDATA\[/, "")
					.replace(/\]\]>$/, "")
			);
		},
		
		processDOM: function(elementId, context, flags, document) {
			return TPTemplate.parseDOM(elementId, document).process(context, flags);
		},
		
		precompile: function(source) {
			return source;
			//return TPTemplate._precompiled.push(TPTemplate.parse(source)._render)-1;
		},
		
		_precompiled: []
		
	});
	
	_liligo.extend({
		TPTemplate: TPTemplate
	});

})();
/*
 * Included file end: /liligo/src/liligo.TPTemplate.js
 * Included from:     /liligo/full.js:12
 */

	
/*
 * Included file begin: /liligo/src/liligo.STemplate.js
 * Included from:       /liligo/full.js:13
 */
(function() {

	var _liligo = liligo;

	if (_liligo.STemplate) return;

	var STemplate = _liligo.Class({
		
		constructor: function(source, re) {
			re = re || /(^|[^\\]|\r|\n)\$\{(.*?)\}/g;
			this.source = 'return ["'+source.replace(/(\n|"|\\)/g, "\\$1").replace(
				re,
				function(x,a,b) {
					if (b.match(/^[a-z0-9_]*$/) || b.match(/\./)) {
						return a+'",d.'+b+',"';
					} else {
						return a+'",d["'+b+'"],"';
					}
				}
			)+'"].join("");';
			
			// TODO: make it nicer...
			if (window.opera) { //# Opera vs (new Function / regexp / eval return)
				this.process = _liligo.bind(function(){
					"eval:not evil";
					d=arguments[0];
						this.source = this.source.replace(/^return /g,''); //# can't eval return
						this.source = this.source.replace(/\\\n/g,''); //# leftovers
						this.source = this.source.replace(/\s/g,' '); //# TODO: double check 
					return eval(this.source);
				},this);
			} else {
				this.process = new Function("d", this.source);
			}
		}
		
	}, {
		
		parse: function(source) {
			return new STemplate(source);
		},
		
		process: function(source, data) {
			return (new STemplate(source)).process(data);
		}
		
	});
	
	_liligo.extend({
		STemplate: STemplate
	});

})();
/*
 * Included file end: /liligo/src/liligo.STemplate.js
 * Included from:     /liligo/full.js:13
 */

	
/*
 * Included file begin: /liligo/src/liligo.Observable.js
 * Included from:       /liligo/full.js:14
 */
(function() {

	var
		_liligo = liligo,
		slice = _liligo.slice,
		_eventMap = "_eventMap";
	
	if (_liligo.Observable) return;
	
	var Observable = _liligo.Abstract({
		
		_fireEvent: function(name) {
			var i;
			if ((i = this[_eventMap]) && (name = i[name])) {
				i = name.length;
				while (i--) { // you HAVE TO iterate in backwards (because the removeEventListener may be called inside)
					name[i].apply(this, slice(arguments, 1));
				}
			}
		},
		
		addEventListener: function(name, observer) {
			var map = this[_eventMap] || (this[_eventMap] = {});
			(map[name] || (map[name] = [])).push(observer);
		},
		
		removeEventListener: function(name, observer) {
			var i, map = this[_eventMap];
			if (!map) return false;
			if (name = map[name]) {
				for (i=0; i<name.length; i++) {
					if (name[i] == observer) {
						name.splice(i, 1);
						return true;
					}
				}
			}
			return false;
		},
		
		attachEvent: function(name, observer) {
			this.addEventListener(name.substring(2), observer);
		},
		
		detachEvent: function(name, observer) {
			this.removeEventListener(name.substring(2), observer);
		}
		
	}, {
	
		makeIt: function(object) {
			var oldConstructor = object.__constructorFunc;
			_liligo.exportedExtend(object, Observable.prototype);
			if (oldConstructor !== undefined) {
				object.__constructorFunc = oldConstructor;
			}
		}
	
	});
	
	_liligo.extend({Observable: Observable});

})();
/*
 * Included file end: /liligo/src/liligo.Observable.js
 * Included from:     /liligo/full.js:14
 */

	
/*
 * Included file begin: /liligo/src/liligo.Preloader.js
 * Included from:       /liligo/full.js:15
 */
(function() {

	var
		_liligo = liligo,
		bind = _liligo.bind,
		length = "length";
		
	if (_liligo.Preloader) return;
	
	_liligo.require("Observable");
	
	var callbackImage = function(src, callback) {
		var img = new Image;
		img.onload = img.onerror = img.onabort = function() {
			if (img) {
				img = null;
				callback();
			}
		};
		img.src = src;
	};
	
	var Preloader = _liligo.Class(_liligo.Observable, {
		
		_pos: 0,
		
		constructor: function(urls, callback) {
			var _this = this;
			urls = _this._urls = (typeof urls == "string") ? [urls] : urls;
			callback = callback || bind(_this._fireEvent, _this, "done");
			if (urls[length]) {
				_this._cb = callback;
				var
					next = _this._next,
					bindedNext = bind(next, _this);
				_this._next = function() {
					setTimeout(bindedNext, 5);
				};
				next.apply(_this);
			} else {
				callback();
			}
		},
		
		_next: function() {
			var _this = this;
			callbackImage(
				_this._urls[_this._pos++],
				(_this._pos == _this._urls[length]) ?
					_this._cb :
					_this._next
			);
		}
	
	}, {
		
		add: function(urls, callback) {
			new Preloader(urls, callback);
		}
		
	});
	
	_liligo.extend({
	
		Preloader: Preloader,
		
		preload: Preloader.add,
		
		preloaded: function() {
			var urls = arguments;
			if (urls[length] == 1) {
				urls = urls[0];
			}
			return [
				new Preloader(urls), "done"
			];
		}
		
	});

})();
/*
 * Included file end: /liligo/src/liligo.Preloader.js
 * Included from:     /liligo/full.js:15
 */

	
/*
 * Included file begin: /liligo/src/liligo.AjaxRequest.js
 * Included from:       /liligo/full.js:16
 */
(function() {

	var
		_liligo = liligo,
		extend = _liligo.exportedExtend,
		nullFunc = _liligo.nullFunc;

	if (_liligo.AjaxRequest) return;
	
	var AjaxRequest = _liligo.Class({
	
		_complete: false,
		
		constructor: function(url, options) {
			this.url = url;
			this.setOptions(options);
			
			var parameters = this.options.parameters;
			
			if (typeof parameters == "object") {
				var query = [];
				for (var i in parameters) if (parameters.hasOwnProperty(i)) {
					query.push(
						encodeURIComponent(i),
						"=",
						encodeURIComponent(parameters[i]),
						"&"
					);
				}
				parameters = this.options.parameters = query.join("").replace(/&$/, "");
			}
			
			if ((this.options.method == "GET") && parameters) {
				this.url += (this.url.indexOf("?") > -1 ? "&" : "?") + parameters;
			}
			try {
				this.xhr = AjaxRequest.newXHR();
				this.xhr.open(this.options.method, this.url, this.options.asynchronous);
				this.xhr.onreadystatechange = _liligo.bind(this.onStateChange, this);
				this.setRequestHeaders();
				this.xhr.send(this.options.method == "POST" ? (this.options.postBody || parameters) : null);
			} catch(e) {
				this.options.onException(e);
			}
		},
		
		setOptions: function(options) {
			this.options = {
				method:       "POST",
				asynchronous: true,
				contentType:  "application/x-www-form-urlencoded",
				encoding:     "UTF-8",
				parameters:   "",
				onException:  function(e) {
					if (_liligo.IE) {
						throw e
					} else {
						setTimeout(function() {
							throw e;
						}, 0);
					}
				}
			};
			if (typeof options == "function") {
				this.options.onComplete = options;
			} else {
				extend(this.options, options || {});
			}
			this.options.method = this.options.method.toUpperCase() == "GET"?"GET":"POST";
		},
		
		onStateChange: function() {
			var
				readyState = this.xhr.readyState,
				state = AjaxRequest.Events[readyState];
			try {
				if (readyState == 4) {
					if (this._complete) return;
					this._complete = true;
					var httpStatus = this.xhr.status;
					if (this.options.onReady4) this.options.onReady4();
					(
						this.options["on" + httpStatus] ||
						this.options["on" + (!httpStatus || (httpStatus >= 200 && httpStatus < 300)?
								"Success"
							:
								"Failure"
							)
						] ||
						nullFunc
					)(this.xhr, this.xhr.responseText);
				}
			} catch (e) {
				this.options.onException(e);
			}
			try {
				if (readyState == 4) {
					(this.options["on" + state] || nullFunc)(this.xhr, this.xhr.responseText);
				} else {
					(this.options["on" + state] || nullFunc)(this.xhr);
				}
			} catch (e) {
				this.options.onException(e);
			}
			if (readyState == 4) {
				this.xhr.onreadystatechange = nullFunc;
			}
			return;
		},
		
		setRequestHeaders: function() {
			var xhr = this.xhr;
			xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
			xhr.setRequestHeader("Accept", "text/javascript, text/html, application/xml, text/xml, * /*");
			var headers = {};
			if (this.options.method == "POST") {
				xhr.setRequestHeader(
					"Content-type",
					this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"")
				);
				if (
					this.xhr.overrideMimeType &&
					(navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005
				) {
					xhr.setRequestHeader("Connection", "close");
				}
			}
			if (typeof this.options.requestHeaders == "object") {
				var userDef = this.options.requestHeaders;
				if (userDef.constructor == Array) {
					for (var i=0, length=userDef.length; i<length; i+=2) {
						xhr.setRequestHeader(userDef[i], userDef[i+1]);
					}
				} else {
					for (var i in userDef) if (userDef.hasOwnProperty(i)) {
						xhr.setRequestHeader(i, userDef[i]);
					}
				}
			}
		},
		
		abort: function() {
			try {
				this.xhr.onreadystatechange = nullFunc;
				this.xhr.abort();
				this.options.onReady4();
			} catch (e) {};
		}
		
	}, {
		
		Events: ["Uninitialized", "Loading", "Loaded", "Interactive", "Complete"],
		
		init: function() {
			this.newXHR = window.XMLHttpRequest?
				function() {
					return new XMLHttpRequest();
				}
			:
				function() {
					try {
						return new ActiveXObject("Msxml2.XMLHTTP");
					} catch(e) {
						return new ActiveXObject("Microsoft.XMLHTTP");
					}
				}
			;
		}
		
	});

	_liligo.extend({AjaxRequest: AjaxRequest});

})();
/*
 * Included file end: /liligo/src/liligo.AjaxRequest.js
 * Included from:     /liligo/full.js:16
 */

	
/*
 * Included file begin: /liligo/src/liligo.Style.js
 * Included from:       /liligo/full.js:17
 */
(function() {

	var 
		_liligo = liligo,
		contains = _liligo.contains,
		$ = _liligo.$,
		safari = _liligo.safari;

	if (_liligo.Style) return;
	
	_liligo.require("BOM,ArrayGen");

	var toCamelCase = function(string) {
		return String(string).replace(/\-([a-z])/g, function(match, chr) {
			return chr.toUpperCase();
		});
	};
	
	var Style = _liligo.Singleton({
		
		set: function(element, styles) {
			if (!(element = $(element))) return;
			for (var name in styles) if (styles.hasOwnProperty(name)) {
				var value = styles[name];
				if (name == "opacity") {
					Style.setOpacity(element, value);
				} else {
					name = toCamelCase(name);
					if (contains(["float", "cssFloat"], name)) {
						name = Style._floatProp;
					}
					element.style[name] = value;
				}
			}
			return element;
		},
		
		get: function(element, name) {
			element = $(element);
			name = toCamelCase(name);
			if (contains(["float", "cssFloat"], name)) {
				name = Style._floatProp;
			}
			var value = element.style[name];
			if (!value) {
				value = Style._getComputedStyle(element, name);
			}
			if ((value == "auto") && contains(["width", "height"], name) && (Style.get(element, "display") != "none")) {
				value = element["offset"+style.replace(/./, function(chr) {return chr.toUpperCase();})]+"px";
			}
			if (window.opera && contains(["left", "top", "right", "bottom"], name)) {
				if (Style.get(element, "position") == "static") {
					value = "auto";
				}
			}
			if (name == "opacity") {
				if (value) return parseFloat(value);
				if (
					(value = (element.getStyle("filter") || "").match(/alpha\(opacity=(.*)\)/i))
					&& value[1]
				) return parseFloat(value[1]) / 100;
				return 1.0;
			}
			return (value == "auto")?null:value;
		},
		
		hide: function(element) {
			if (!(element = $(element))) return;
			element.style.display = "none";
			if (arguments.length > 1) {
				for (var i=0; i<arguments.length; i++) {
					arguments.callee(arguments[i]);
				}
			}
			return element;
		},
		
		show: function(element) {
			if (!(element = $(element))) return;
			element.style.display = "";
			if (arguments.length > 1) {
				for (var i=0; i<arguments.length; i++) {
					arguments.callee(arguments[i]);
				}
			}
			return element;
		},
		
		showIf: function(show, element) {
			(show ? this.show : this.hide)(element);
		},
				
		addClass: function(el, className) {
			if (!(el = $(el))) return;
			if (!Style.hasClass(el, className)) {
				el.className += (el.className ? " " : "") + className;
			}
		},
		
		removeClass: function(el, className) {
			if (!(el = $(el))) return;
			el.className = el.className.replace(
				new RegExp("(^|\\s)" + className + "(\\s|$)"), "$2"
			);
		},

		setClassIf: function(condition, element, className) {
			(condition ? this.addClass : this.removeClass)(element, className); 
		},
		
		hasClass: function(el, className) {
			return (new RegExp("(^|\\s)" + className + "(\\s|$)")).test($(el).className);
		},
		
		setOpacity: function(element, value) {
			if (!(element = $(element))) return;
			if (value == 1) {
				value = 0.999999;
			} else {
				if (value < 0.00001) value = 0;
			}
			element.style.MozOpacity = element.style.opacity = value;
			return element;
		},
		
		_getStyleCont: function() {
			if (!this.styleTag) {
				var st = this.styleTag = document.createElement("style");
				st.type = "text/css";
				st.media = "screen, projection";
				document.getElementsByTagName("head")[0].appendChild(st);
				if (safari) {
					st.appendChild(document.createTextNode("_safari {}")); // empty styles = headaches
					this.styleTag = document.styleSheets[document.styleSheets.length-1];
				}
			}
			return this.styleTag;
		},
		
		addRulesSafari: function( cStyletag, rules) {
			var rList = rules.split("}"), rule, i, st = cStyletag;
			if (rules.length > 0) {
				for (i = 0; i < rList.length; i++) { // speedwise
					rule = rList[i].replace(/^\s+|\s+$/g,""); // clean up
					if (rule.length > 0) st.ownerNode.appendChild(document.createTextNode(rule+"}"));
				}
			} else { // add nothing means remove all
				while (st.ownerNode.firstChild) {
					st.ownerNode.removeChild(st.ownerNode.firstChild);
				}
			}
		},
		
		addRules: function(rules) {
			var st = this._getStyleCont();
			if ((typeof rules != "string") && (rules.join)) {
				rules = rules.join("\n");
			}
			if (!safari) {
				if (st.styleSheet) {
					st.styleSheet.cssText += "\n"+rules;
				} else {
					st.innerHTML += "\n"+rules;
				}
			} else { // safari
				this.addRulesSafari(st, rules);
			}
		},
		
		fromFile: function(rules) {
			if (DEBUG) {
				if (typeof rules == "string") {
					alert("You have an old version of Preprocessor:\nnot compatible with Style.fromFile");
					return "";
				}
			}
			var output = "", style;
			while (style = rules.shift()) {
				if (
					(style.b == "all") ||
					(style.b == "IE6" && _liligo.IE6) ||
					(style.b == "IE7" && _liligo.IE7)
				) {
					output += style.rules+"\n";
				}
			}
			return output;
		},
		
		init: function() {
			this._floatProp = _liligo.detect("(typeof element.style.cssFloat == 'undefined')") ?
				"styleFloat"
			:
				"cssFloat"
			;
			if (_liligo.IE) {
				
				this._getComputedStyle = function(element, name) {
					return element.currentStyle ? element.currentStyle[name] : null;
				};
				
				this.setOpacity = function(element, value) {
					element = $(element);
					var filter = Style.get(element, "filter");
					if (filter) filter = filter.replace(/alpha\([^\)]*\)/gi, "");
					if (value == 1) {
						element.style.filter = filter+"alpha(opacity=100)";
					} else if (value == "") {
						element.style.filter = filter;
					} else {
						if (value < 0.00001) value = 0;
						element.style.filter = filter+"alpha(opacity="+value*100+")";
					}
					return element;
				};
				
			} else if (window.document && document.defaultView && document.defaultView.getComputedStyle) {
				
				this._getComputedStyle = function(element, name) {
					var styles = document.defaultView.getComputedStyle(element, "");
					return styles?styles[name]:null;
				}
				
			} else {
				
				this._getComputedStyle = function() {return "";};
				
			}
		}
		
	});

	_liligo.extend({Style: Style});

})();
/*
 * Included file end: /liligo/src/liligo.Style.js
 * Included from:     /liligo/full.js:17
 */

	
/*
 * Included file begin: /liligo/src/liligo.Geometry.js
 * Included from:       /liligo/full.js:18
 */
(function() {

	var
		_liligo = liligo,
		Style = _liligo.Style,
		$ = _liligo.$;

	if (_liligo.Geometry) return;

	_liligo.require("Style");

	var Geometry = _liligo.Singleton({
		
		position: function(element) {
			element = $(element);
			var valueT = 0, valueL = 0;
			do {
				valueT += element.offsetTop  || 0;
				valueL += element.offsetLeft || 0;
				element = element.offsetParent;
			} while (element);
			return [valueL, valueT];
		},
		
		dimension: function(element) {
			element = $(element);
			var els = element.style;
			var display = Style.get(element, "display");
			if ((display != "none") && (display != null)) {
				return [element.offsetWidth, element.offsetHeight];
			}
			var 
				originalVisibility = els.visibility,
				originalPosition = els.position,
				originalDisplay = els.display;
			els.visibility = "hidden";
			els.position = "absolute";
			els.display = "block";
			var dimension = [element.clientWidth, element.clientHeight];
			els.display = originalDisplay;
			els.position = originalPosition;
			els.visibility = originalVisibility;
			return dimension;
	  }
		
	});

	_liligo.extend({Geometry: Geometry});

})();
/*
 * Included file end: /liligo/src/liligo.Geometry.js
 * Included from:     /liligo/full.js:18
 */

	
/*
 * Included file begin: /liligo/src/liligo.SafeLayer.js
 * Included from:       /liligo/full.js:19
 */
(function() {

	var
		_liligo = liligo,
		Class = _liligo.Class,
		Geometry = _liligo.Geometry,
		$ = _liligo.$,
		nullFunc = _liligo.nullFunc;

	if (_liligo.SafeLayer) return;

	_liligo.require("BOM,Geometry");
	
	var SafeLayer = Class({
		
		constructor: function(element) {
			element = this.element = $(element);
			element.style.zIndex = 101;
		},
		
		hide: function(element) {
			element = $(element) || this.element;
			element.style.zIndex = 101;
			element.style.display = "none";
		},
		
		show: function(element) {
			element = $(element) || this.element;
			element.style.zIndex = 101;
			element.style.display = "block";
			element.style.visibility = "visible";
		},
		
		cover: nullFunc,
		updateSize: nullFunc,
		
		bind: function(element) {
			this.element = element;
		},
		
		move: function(x, y) {
			this.element.style.right = "auto";
			this.element.style.left = x+"px";
			this.element.style.top = y+"px";
			
		},
		moveRight: function(x, y) {
			this.element.style.left = "auto";
			this.element.style.right = x+"px";
			this.element.style.top = y+"px";
		}		
		
	});
	
	if (_liligo.IE) {
		
		var OldSafeLayer = SafeLayer;
		
		SafeLayer = new Class(OldSafeLayer, {
		
			widthOffset: 0,
			heightOffset: 0,
		
			constructor: function(element) {
				this._base_constructor(element);
				var
					container = this.container = document.body,
					iframe = document.createElement("iframe");
				iframe.src = "about:blank";
				iframe.style.zIndex = 100;
				iframe.style.display = "none";
				iframe.style.position = "absolute";
				container.appendChild(iframe);
				this.iframe = iframe;	
			},
			
			show: function(element) {
				element = $(element) || this.element;
				element.style.visibility = "hidden";
				element.style.display = "block";
				this.cover(element);
				element.style.visibility = "visible";
			},
			
			cover: function(element) {
				element = $(element) || this.element;
				var iframe = this.iframe;
				iframe.style.display = "none";
				var
					style = iframe.style,
					dim = Geometry.dimension(element),
					pos = Geometry.position(element),
					container = this.container;
				if (container != iframe.parentNode) {
					container.appendChild(iframe);
				}
				if (container != document.body) {
					var posDelta = Geometry.position(container);
					pos[0] -= posDelta[0];
					pos[1] -= posDelta[1];
				}
				element.style.zIndex = style.zIndex + 1;
				style.left = pos[0]+"px";
				style.top = pos[1]+"px";
				this.updateSize(element);
				style.display = "block";
			},
			
			updateSize: function(element) {
				element = $(element) || this.element;
				var
					style = this.iframe.style,
					dim = Geometry.dimension(element);
				style.width = dim[0]+this.widthOffset+"px";
				style.height = dim[1]+this.heightOffset+"px";
			},
			
			hide: function(element) {
				element = $(element) || this.element;
				this.iframe.style.display = "none";
				element.style.display = "none";
			},
			
			move: function(x, y) {
				this.iframe.style.left = this.element.style.left = x+"px";
				this.iframe.style.top = this.element.style.top = y+"px";
			}
			
		});
		
	}

	_liligo.extend({SafeLayer: SafeLayer});

})();
/*
 * Included file end: /liligo/src/liligo.SafeLayer.js
 * Included from:     /liligo/full.js:19
 */

	
/*
 * Included file begin: /liligo/src/liligo.CompLoc.js
 * Included from:       /liligo/full.js:20
 */
(function() {

	var
		_liligo = liligo,
		$ = _liligo.$,
		extend = _liligo.exportedExtend,
		TPTemplate = _liligo.TPTemplate,
		nullFunc = _liligo.nullFunc,
		Event = _liligo.Event,
		bind = _liligo.bind,
		bindAsEventListener = Event.bind,
		labels = _liligo.labels,
		JSON_decode = _liligo.JSON.decode,
		forEach = _liligo.forEach,
		Style = _liligo.Style,
		Style_addClass = Style.addClass,
		Geometry = _liligo.Geometry;
	
	if (_liligo.CompLoc) return;
	
	_liligo.require("Event,SafeLayer,TPTemplate,STemplate,Style,Preloader,Geometry,AjaxRequest,ArrayGen,Observable");
	
	var PREFIX = "liligo_cl_";
	
	var styles = "\
		#PREFIXcont,#PREFIXcont *{font-family:Verdana,sans-serif,Tahoma,Arial;margin:0;padding:0;font-size:11px;border:0;list-style:none}\
		#PREFIXcont{position:absolute;display:block}\
		#PREFIXcont div{background-color:#ffecdd;border:1px solid #bebebe;width:auto}\
		#PREFIXcont ul{margin:1px}\
		#PREFIXcont li{display:block;cursor:pointer;cursor:hand}\
		#PREFIXcont a{display:block;text-decoration:none;cursor:pointer;cursor:hand;font-size:bold;color:#111;padding:2px 2px 2px 2px}\
		#PREFIXcont .active a{background-color:#ff6d00;color:#fff}\
		#PREFIXcont .separator{margin:2px 0 1px 0;display:block;background:url(/img/hdots_transparent.gif) repeat-x;font-size:1px}\
		#PREFIXcont ul > .separator{min-height:1px}\
		\
		#PREFIXcont .air .type1{background:transparent url(/liligo/img/comploc-icons.png) no-repeat 0 -51px;padding-left:20px}\
		#PREFIXcont .air .type2{background:transparent url(/liligo/img/comploc-icons.png) no-repeat 0 -1px;padding-left:20px}\
		#PREFIXcont .air .type3{background:transparent url(/liligo/img/comploc-icons.png) no-repeat 0 -101px;padding-left:20px}\
		#PREFIXcont .air .type4{background:transparent url(/liligo/img/comploc-icons.png) no-repeat 0 -151px;padding-left:20px}\
		#PREFIXcont .air .type5{background:transparent url(/liligo/img/comploc-icons.png) no-repeat 0 -201px;padding-left:20px}\
		\
		#PREFIXcont .hotel ul{margin:1px}\
		#PREFIXcont .hotel .noresult,\
		#PREFIXcont .hotel li.last{background:0}\
		#PREFIXcont .hotel a{padding:4px 3px 4px 2px}\
		\
		#PREFIXcont .country ul{margin:1px}\
		#PREFIXcont .country .noresult,\
		#PREFIXcont .country li.last{background:0}\
		#PREFIXcont .country a{padding:4px 3px 4px 2px}\
		\
		#PREFIXcont .car .type1{padding-left:20px}\
		#PREFIXcont .car .type2{background:transparent url(/liligo/img/comploc-icons.png) no-repeat 0 -1px;padding-left:20px}\
		\
	";
	
	var stylesIE = "\
		#PREFIXcont ul li.separator{height:auto;min-height:auto !important}\
	";
	
	var CompLoc = _liligo.Class(_liligo.Observable, {
		
		minChars: 3,
		maxRows: 15,
		offsetLeft: 0,
		alignRight:false,
		offsetTop: 1,
		cssClass: "",
		format: "",
		fragRE: /^([^,]*)/,
		type: "air",
		url: "/air/new_comploc.jsp",
		AjaxRequest: _liligo.AjaxRequest,
		// container: undefined, // by the default it's undefined 
		onKeyDown: function(ev) { this._fireEvent("keydown", ev, this); },
		onKeyUp: nullFunc,
		onFocus: nullFunc,
		onBlur: nullFunc,
		onChange: nullFunc,
		template: TPTemplate.precompile(
			'<ul>\
				{if items.length == 0}\
					<li class="noresult"><a href="#"><span>${labels.comploc_no_results_found}</span></a></li>\
				{/if}\
				{for item inarray items}\
					{if item.separator}\
						<li class="separator"></li>\n\
					{else}\
						<li id="${item.id}" class="normal {if item.type}type${item.type}{/if}">\n\
							<a href="#">\n\
								<span>${item.label}</span>\n\
							</a>\n\
						</li>\n\
					{/if}\
				{/for}\
			</ul>'
		),
		
		_visible: false,
		_active: 0,
		
		constructor: function(params) {
			params = params || {};
			if (document.body) {
				this._init(params);
			} else {
				Event.observe(document, "DOMContentLoaded", bind(this._init, this, params));
			}
		},
		
		_init: function(params) {
			if (!CompLoc.initialized) CompLoc.initialize();
			extend(this, params);
			this.elem = $(this.field || this.elem || "fromLocation");
			if (!this.elem) return;
			this.elem.setAttribute("autocomplete", "off");
			if (!this.container) this.container = document.body;
			this.hidden = $(this.hidden);
			this.nextFocus = $(this.nextFocus);
			this.prevFocus = $(this.prevFocus);
			if (this.format) this._format = _liligo.STemplate.parse(this.format);
			if (!this.hidden) this._initHidden();
			if (!this.lang) this.lang = _liligo.getLang() || "fr";
			if (!params.url) this._initUrl();
			if (!params.offsetLeft && (this.type == "hotel")) this.offsetLeft = 0;
			if (params.template) {
				this.templateFunc = TPTemplate.parse(this.template);
			}
			this._bindedOnBlur = bind(this._onBlur, this);
			Event.observe(this.elem, {
				keydown: bindAsEventListener(this._onKeyDown, this),
				keyup: bindAsEventListener(this._onKeyUp, this),
				focus: bind(this._onFocus, this),
				blur: this._bindedOnBlur
			});
		},
		
		_initHidden: function() {
			var
				idPrefix = this.elem.id || this.elem.name,
				namePrefix = this.elem.name || this.elem.id;
			this.hidden = $(idPrefix + "Code");
			if (!this.hidden) {
				var hidden = document.createElement("input");
				hidden.type = "hidden";
				hidden.name = namePrefix + "Code";
				hidden.id = idPrefix + "Code";
				hidden.value = "";
				this.elem.parentNode.insertBefore(hidden, this.elem);
				this.hidden = hidden;
			}
		},
		
		_initUrl: function() {
			var defaultUrls = {
				air: "/air/new_comploc.jsp",
				car: "/cars/new_comploc.jsp",
				hotel: "/hotel/new_comploc.jsp",
				country: "/homepage/country_comploc.jsp"
			};
			if (defaultUrls[this.type]) {
				this.url = defaultUrls[this.type];
			}
		},
		
		clear: function() {
			this._active = 0;
			this._list = [];
			this.elem.value = "";
			this.hidden.value = "";
		},
		
		_onKeyUp: function(event) {
			if (CompLoc.getActive() != this) return;
			var v = this._getFrag();
			if (v.length < this.minChars) {
				this._list = [];
				this.hidden.value = "";
			}
			if (!this._visible || (this.prevValue != v)) {
				if (this.prevValue && (this.prevValue.length > v.length)) {
					this.hidden.value = "";
				}
				if (v.length >= this.minChars) {
					CompLoc.updateList(v);
				} else {
					this.hide();
				}
			}
			this.onKeyUp();
		},
		
		_onKeyDown: function(event) {
			this.prevValue = this._getFrag();
			CompLoc.setActive(this);
			switch (event.keyCode) {
				case Event.KEY_TAB:
				case Event.KEY_RETURN:
					var focElem = event.shiftKey?this.prevFocus:this.nextFocus;
					if (focElem) {
						focElem.focus();
						Event.stop(event);
					} else {
						this._onBlur();
					}
					break;
				case Event.KEY_DOWN:
					this._nextItem();
					Event.stop(event);
					break;
				case Event.KEY_UP:
					this._prevItem();
					Event.stop(event);
					break;
			};
			this.onKeyDown(event);
		},
		
		_onFocus: function() {
			CompLoc.setActive(this);
			this.beforeFocus = this.hidden.value;
			this.elem.select();
			this.onFocus();
		},
		
		_onBlur: function() {
			this._select();
			CompLoc.noActive();
			this.hide();
			this.onBlur();
		},
		
		_getFrag: function() {
			var res = this.elem.value.match(this.fragRE);
			return (res && res[1]) ? res[1].replace(/^\s+|\s+$/g, "") : "";
		},
		
		show: function() {
			this._visible = true;
			var
				div = CompLoc.div,
				safeLayer = CompLoc.safeLayer,
				elem = this.elem, 
				pos = Geometry.position(elem),
				dim = Geometry.dimension(elem),
				divParent = div.parentNode,
				container = this.container;
			div.className = this.cssClass+" "+this.type;
			if (container != divParent.parentNode) {
				container.appendChild(divParent);
			}
			if (container != document.body) {
				var posDelta = Geometry.position(container);
				pos[0] -= posDelta[0];
				pos[1] -= posDelta[1];
			}
			safeLayer.container = container;
			if(this.alignRight){
				safeLayer.moveRight(this.container.offsetWidth-pos[0]-this.elem.offsetWidth, pos[1]+dim[1]+this.offsetTop);
			}else{			
				safeLayer.move(pos[0]+this.offsetLeft, pos[1]+dim[1]+this.offsetTop);
			}
			safeLayer.show();
		},
		
		hide: function() {
			this._visible = false;
			CompLoc.safeLayer.hide();
		},
		
		prepareList: function() {
			var templateList = [];
			var lastGrp = 1;
			var sep = {separator:true};
			this._active = CompLoc.prototype._active;
			forEach(this._list, function(item, i) {
				if (item.value == this.hidden.value) {
					this._active = i;
				}
				if (this._format) {
					item.label = this._format.process(item);
				}
				if (lastGrp != item.group && item.group !== undefined) {
					lastGrp = item.group;
					templateList.push(sep);
				}
				item.index = i;
				item.id = PREFIX+"item_"+i;
				templateList.push(item);
			}, this);
			return templateList;
		},
		
		onList: function(list) {
			this._list = list;
			var templateList = this.prepareList();
			var html = this._template.process({items: templateList}, this.lang);
			CompLoc.div.innerHTML = html;
			this._itemOver(this._active);
			if (!this._list.length) this.hidden.value = "";
			forEach(this._list, function(item, i) {
				var elem = $(item.id);
				if (i == 0) Style_addClass(elem, "first");
				if (i == this._list.length-1) Style_addClass(elem, "last");
				Event.observe(elem, {
					mouseover: bind(this._itemOver, this, i),
					mouseout:  bind(this._itemOut, this, i),
					mousedown: bind(this._itemClick, this, i)
				});
			}, this);
			CompLoc.safeLayer.updateSize();
			if (!this._visible) {
				this.show();
			}
		},
		
		_itemOver: function(i) {
			var e;
			if (e = $(PREFIX+"item_"+i)) {
				this._itemOut(this._active);
				this._active = i;
				this.hidden.value = this._list[i].value;
				Style_addClass(e, "active");
			}
		},
		
		_itemOut: function(i) {
			if (i = $(PREFIX+"item_"+i)) {
				Style.removeClass(i, "active");
			}
		},
		
		_nextItem: function() {
			if (this._list) {
				this._itemOut(this._active);
				this._itemOver((++this._active >= this._list.length) ? this._active = 0 : this._active);
			}
		},
		
		_prevItem: function() {
			if (this._list) {
				this._itemOut(this._active);
				this._itemOver((--this._active < 0) ? this.active = this._list.length-1 : this._active);
			}
		},
		
		_itemClick: function(event) {
			if (this.nextFocus) {
				setTimeout(bind(function() {
					this.nextFocus.focus();
				}, this), 10);
			}
			Event.stop(event);
		},
		
		_select: function() {
			var item;
			if (this._list && (item = this._list[this._active])) {
				this.elem.value = item.label;
				this.hidden.value = item.value;
				this.value = item;
				if (this.beforeFocus != item.value) {
					this.beforeFocus = this.hidden.value;
					this.onChange(this.elem, item);
					this._fireEvent("change", this.elem, item);
				}else{
					this._fireEvent("unchange", this.elem, item);
				}
			}
		}		
	}, {
		
		cache: {},
		
		initialized: false,
		
		initialize: function() {
			this.initialized = true;
			this.prototype._template = TPTemplate.parse(this.prototype.template);
			if (!labels.comploc_no_results_found) {
				labels.comploc_no_results_found = labels.any_results;
			}
			var cont = document.createElement("div");
			cont.id = PREFIX+"cont";
			Style.hide(cont);
			this.div = document.createElement("div");
			document.body.appendChild(cont);
			cont.appendChild(this.div);
			this.safeLayer = new _liligo.SafeLayer(cont);
			if (_liligo.IE) styles = styles+stylesIE;
			styles = styles.replace(/PREFIX/g, PREFIX);
			Style.addRules(styles);
			var images = [];
			styles.replace(/url\((.*?)\)/g, function(x, url) {
				images.push(url);
				return x;
			});
			_liligo.preload(images);
		},
		
		setActive: function(active) {
			if (this.active && (this.active != active)) {
				this.active.hide();
				this.nextFrag = "";
				this.abortRequest();
				this.noActive();
			}
			if (!this.active || (this.active != active)) {
				this.active = active;
				this.cacheProp = active.maxRows+active.url;
				if (!this.cache[this.cacheProp]) {
					this.cache[this.cacheProp] = {};
				}
			}
		},
		
		getActive: function() {
			return this.active;
		},
		
		noActive: function() {
			this.cache[this.cacheProp] = null;
			this.active = null;
		},
		
		abortRequest: function() {
			if (this.request) {
				this.request.abort();
				this.request = null;
			}
			if (this.nextFrag) {
				var frag = this.nextFrag;
				this.nextFrag = "";
				this.updateList(frag);
			}
		},
		
		updateList: function(frag) {
			if (!this.active) return;
			if (this.cache[this.cacheProp] && this.cache[this.cacheProp][frag]) {
				this.nextFrag = "";
				this.abortRequest();
				this.active.onList(this.cache[this.cacheProp][frag]);
			} else {
				if (this.request) {
					if (this.request.frag != frag) {
						this.nextFrag = frag;
					}
				} else {
					this.request = new this.active.AjaxRequest(this.active.url, {
						method: "post",
						parameters : {
							frag: frag,
							lang: this.active.lang,
							maxrows: this.active.maxRows
						},
						onComplete: bind(this.onList, this, this.active),
						onException: bind(this.abortRequest, this)
					});
					this.request.frag = frag;
				}
			}
		},
		
		onList: function(active, _, resp) {
			if (typeof resp == "string") {
				var list = JSON_decode("("+resp+")");
			} else {
				list = resp;
			}
			if (list) {
				active.onList(list);
				if (this.active != active) {
					active._onBlur();
					return this.abortRequest();
				}
				this.cache[this.cacheProp][this.request.frag] = list;
			}
			this.abortRequest();
		}
		
	});
	
	_liligo.extend({
		CompLoc: CompLoc
	});

})();
/*
 * Included file end: /liligo/src/liligo.CompLoc.js
 * Included from:     /liligo/full.js:20
 */

	
/*
 * Included file begin: /liligo/src/liligo.DatePicker.js
 * Included from:       /liligo/full.js:21
 */
(function() {

	var
		_liligo = liligo,
		$ = _liligo.$,
		bind = _liligo.bind,
		nullFunc = _liligo.nullFunc,
		allLabels = _liligo.allLabels,
		IE = _liligo.IE,
		Event = _liligo.Event,
		__Eo = _liligo.__Eo,
		Style = _liligo.Style,
		Element = _liligo.Element,
		DOM = _liligo.DOM;
	
	if (_liligo.DatePicker) return;
	
	_liligo.require("BOM,DOM,Event,SafeLayer,Preloader,Geometry,Style,Observable");

	/*
		TODOs:
			*.on    ->   Event.observe
			custom classes
			liligo_dp_	prefix
			SafeLayer
	*/

	var labelMaps = {
		
		months: [
			"January", "February", "March", "April", "May", "June", "July",
			"August", "September", "October", "November", "December"
		],
		
		days: [
			"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
		]
		
	};

	var DateTools = _liligo.Singleton({
		
		getDayInitial: function(day, locale) {
			return allLabels[locale || _liligo.getLang()][labelMaps.days[day]+"_Initial"];
		},
		
		addDays: function(date, days) {
			var temp = new Date(new Date().setTime(date.getTime() + days*86400000 + 3600000));
			return new Date(temp.getFullYear(), temp.getMonth(), temp.getDate());
		},
		
		fromArray: function(array) {
			return new Date(
				array[0], array[1], array[2],
				array[3], array[4]
			);
		},
		
		//similar to php date, small deviations may occur
		format: function(date, format, locale) {
			var simple = function(format) {
				var
					dateDate = date.getDate(),
					month = date.getMonth(),
					year = date.getFullYear(),
					day = (date.getDay() || 7)-1;
				
				if (format == "%j") return dateDate;
				if (format == "%d") return (dateDate>9?"":"0")+dateDate;
				if (format == "%S") return allLabels[locale][labelMaps.days[day]+"_Short"];
				if (format == "%l") return allLabels[locale][labelMaps.days[day]+"_Long"];
				if (format == "%m") return (month>8?"":"0")+(1+month);
				if (format == "%F") return allLabels[locale][labelMaps.months[month]+"_Long"];
				if (format == "%M") return allLabels[locale][labelMaps.months[month]+"_Short"];
				if (format == "%Y") return year;
				if (format == "%y") return (""+year).match(/..$/)[0];
			};
			return format
				.replace(/(%.)%S/g, function(format, base) {
					base = simple(base);
					switch (base*1 % 10) {
						case 1: return base+"st";
						case 2: return base+"nd";
						case 3: return base+"rd";
						default: return base+"th";
					}
				})
				.replace(/%./g, simple);
		},
		
		isLeapYear: function(date) {
			if (0 == date.getFullYear() % 400) return true;
			if (0 == date.getFullYear() % 100) return false;
			return (0 == date.getFullYear() % 4) ? true : false;
		},
		
		getDaysInMonth: function (date) {
			var days = {0:31,2:31,3:30,4:31,5:30,6:31,7:31,8:30,9:31,10:30,11:31}[date.getMonth()];
			if (days == null) {
				return DateTools.isLeapYear(date) ? 29 : 28;
			} else {
				return days;
			}
		},
		
		getDayDate: function(date) {
			return new Date(date.getFullYear(), date.getMonth(), date.getDate());
		}
		
	});

	var DatePicker = new _liligo.Class(_liligo.Observable, {
		
		offsetLeft: 0,
		offsetTop: 0,
		months: 2,
		firstDay: 0,
		minDate: null,
		maxDate: new Date(3000,1,1),
		minDays: 0,
		className: "",
		
		constructor: function(params) {
			if (!DatePicker.initialized) DatePicker.initialize();
			this.elem = $(params.elem || params.field);
			if (!this.elem) throw "DatePicker constructor error: no elem";
			this.elem.setAttribute("readonly", "readonly");
			this.elem.readOnly = true;
			this.oldNaming = params.oldNaming;
			this.idPrefix = (this.elem.id || this.elem.name)+"-";
			this.namePrefix = (this.elem.name || this.elem.id)+(this.oldNaming ? "" : "-");
			this.opener =
				params.opener || params.picker || $(this.idPrefix+"picker");
			if (!this.opener) throw "DatePicker constructor error: no opener/picker found";
			this.dayDisplay = $(params.dayDisplay || this.idPrefix+"day-display");
			
			this.locale = params.lang || params.locale || _liligo.getLang();
			this.firstDay = params.firstDay || this.firstDay;
			this.minDays = params.minDays || this.minDays;
			this.preDepartureDays = (params.preDepartureDays == undefined) ? 7 : params.preDepartureDays;
			this.preReturnDays = (params.preReturnDays == undefined) ? 7 : params.preReturnDays;
			this.direction = params.direction || DatePicker.DIR_NORMAL;
			this.onClosed = params.onClosed || nullFunc;
			this.onSet = params.onSet || nullFunc;
			this.container = $(params.container || document.body);
			this.minDate = params.minDate || this.minDate; //allow dates before today
			this.maxDate = params.maxDate || this.maxDate;
			this.className = params.className || this.className;
			this.filter = (params.filter == undefined) ? this.filter : params.filter;
			
			if (this.direction == DatePicker.DIR_RET) {
				this.dontModify = false;
				if (params.depPicker == null) {
					throw "Datepicker constructor error: (direction == DatePicker.DIR_RET) but no depPicker";
				} else {
					this.depPicker = params.depPicker;
				}
			}
			this.retPicker = params.retPicker;
			if ((params.left == null) || (params.top == null)) {
				this.posOpener = true;
			} else {
				this.left = params.left;
				this.top = params.top;
				this.posOpener = false;
			}
			this.offsetLeft = params.offsetLeft || this.offsetLeft;
			this.offsetTop = params.offsetTop || this.offsetTop;
			
			this.fields = {
				year: $(params.yearField) || this.newHidden("year"),
				month: $(params.monthField) || this.newHidden("month"),
				day: $(params.dayField) || this.newHidden("day")
			};
			
			if (params.value == null) {
				if (this.direction == DatePicker.DIR_RET) {
					this.value = DateTools.addDays(this.depPicker.value, this.preReturnDays);
				} else {
					this.value = DateTools.addDays(DateTools.getDayDate(new Date()), this.preDepartureDays);
				}
			} else {
				this.value = DateTools.getDayDate(params.value);
			}
			this.nextFocus = $(params.nextFocus);
			this.months = params.months || this.months;
			
			if (!params.topFormat) {
				if (DatePicker.defaultFormats.top[this.locale]) {
					this.topFormat = DatePicker.defaultFormats.top[this.locale];
				} else {
					this.topFormat = DatePicker.defaultFormats.top.def;
				}
			} else {
				this.topFormat = params.topFormat;
			}
			if (!params.bottomFormat) {
				if (DatePicker.defaultFormats.bottom[this.locale]) {
					this.bottomFormat = DatePicker.defaultFormats.bottom[this.locale];
				} else {
					this.bottomFormat = DatePicker.defaultFormats.bottom.def;
				}
			} else {
				this.bottomFormat = params.bottomFormat;
			}
			if (!params.displayFormat) {
				if (DatePicker.defaultFormats.display[this.locale]) {
					this.displayFormat = DatePicker.defaultFormats.display[this.locale];
				} else {
					this.displayFormat = DatePicker.defaultFormats.display.def;
				}
			} else {
				this.displayFormat = params.displayFormat;
			}
			this.oneWayRadio = $(params.oneWayRadio);
			this.init();
		},
		
		init: function() {
			this.saveToFields();
			this.opener.onfocus = this.opener.onclick = bind(function() {
				this.open();
				return false;
			}, this);
			Event.observe(this.elem, "focus", bind(function() {
				this.elem.select();
				this.open();
			}, this));
			Event.observe(this.elem, "keydown", Event.bind(function(e) {
				if ((DatePicker.actual != this) && (e.keyCode == Event.KEY_TAB)) {
					Event.stop(e);
					this.open();
				}
			}, this));
			if (this.elem.select) {
				this.elem.onclick = bind(function() {
					this.elem.select();
					this.open();
				}, this);
			}			
			this.dontBlur = false;
			this.elem.onblur = this.opener.onblur = bind(function() {
				if (this.dontBlur) return false;
				try {
					DatePicker.actual.close();
				} catch(e) {};
			}, this);
		},
		
		newHidden: function(field) {
			var name = this.namePrefix+field;
			if (this.oldNaming) {
				name = this.namePrefix+
					field.charAt(0).toUpperCase()+
					field.substr(1);
			}
			var hidden = Element("input", {
				type: "hidden",
				name: name,
				id: this.idPrefix+field,
				value: ""
			});
			this.elem.parentNode.insertBefore(hidden, this.elem);
			return hidden;
		},
		
		saveToFields: function() {
			this.displayed = DateTools.format(this.value, this.displayFormat, this.locale);
			if (this.elem.nodeName == "INPUT") {
				this.elem.value = this.displayed;
			}
			if (this.dayDisplay) {
				var day = this.value.getDay();
				day = (day == 0) ? 6 : (day-1);
				this.dayDisplay.innerHTML = allLabels[this.locale][labelMaps.days[day]+"_Long"];
			}
			this.fields.year.value = this.value.getFullYear();
			this.fields.month.value = this.value.getMonth();
			this.fields.day.value = this.value.getDate();
		},
		
		open: function() {
			DatePicker.actual = this;
			var layerbg = DatePicker.layerbg;
			var div = DatePicker.div;
			var elements = DatePicker.elements;
			elements.dpBody.removeChild(elements.br);
			for (var i=0;i<elements.months.length;i++) {
				elements.dpBody.removeChild(elements.months[i]);
			}
			elements.months = [];
			div.className = this.className+" datepicker dp"+this.months;
			DatePicker.overed = null;
			this.rowsMax = 0;
			var firstMonth = this.getFirstMonth();
			for (var i=0;i<this.months;i++) {
				var month = Element("div", {
					className: "dpMonth dpMonth"+(i+1)
				});
				elements.dpBody.appendChild(month);
				month.value = new Date(firstMonth.year, firstMonth.month+i, 1);
				month.header = Element("div", {
					className: "dpMonthHeader"
				});
				month.appendChild(month.header);
				month.header.span = Element("span");
				month.header.appendChild(month.header.span);
				if (i == 0)	month.header.appendChild(elements.prev);
				if (i == this.months-1) month.header.appendChild(elements.next);
				month.table = Element("table");
				month.thead = month.table.createTHead();
				month.tbody = Element("tbody");
				month.table.appendChild(month.tbody);		
				var row = month.thead.insertRow(-1);
				for (var j=0;j<7;j++) {
					var cell = row.insertCell(-1);
					if (this.firstDay == 0) {
						cell.innerHTML = "<span>"+DateTools.getDayInitial(j, this.locale)+"</span>";
					} else {
						cell.innerHTML = "<span>"+DateTools.getDayInitial((j == 0) ? 6 : (j-1), this.locale)+"</span>";
					}
					if (j == 0) cell.className = "first";
					else if (j == 6) cell.className = "last";
				}
				this.buildMonth(month);
				month.appendChild(month.table);
				elements.months.push(month);
			}
			this.equalizeRows();
			elements.dpBody.appendChild(elements.br);
			elements.prev.onclick = function() {DatePicker.actual.prevMonth();return false;};
			elements.next.onclick = function() {DatePicker.actual.nextMonth();return false;};
			elements.prev.onmousedown =
			elements.next.onmousedown = function() {
				DatePicker.actual.dontBlur = true;
			};
			elements.prev.onmouseup = elements.prev.onmouseover =
			elements.next.onmouseup = elements.next.onmouseover = function() {
				DatePicker.actual.dontBlur = false;
			};
			var cont = DatePicker.actual.container;
			if (div.parentNode != cont) {
				cont.appendChild(div);
			}
			if (this.posOpener) {
				var pos = _liligo.Geometry.position(this.opener);
				if (cont != document.body) {
					var posDelta = _liligo.Geometry.position(cont);
					pos[0] -= posDelta[0];
					pos[1] -= posDelta[1];
				}
				div.style.left = pos[0]+this.offsetLeft+"px";
				div.style.top = pos[1]+this.offsetTop+"px";
			} else {
				div.style.left = this.left+"px";
				div.style.top = this.top+"px";
			}
			div.style.display = "block";
			DatePicker.actual.oldOnKeyDown = document.onkeydown; // TODO: Event.observe
			document.onkeydown = DatePicker.actual.onKey;
			div.style.zIndex = 101;
			if (IE) { // TODO: SafeLayer
				if (layerbg.parentNode != cont) {
					cont.appendChild(layerbg);
				}
				layerbg.style.left = div.offsetLeft+"px";
				layerbg.style.top = div.offsetTop+"px";
				layerbg.style.width = div.offsetWidth+"px";
				layerbg.style.height = div.offsetHeight+"px";
				layerbg.style.display = "block";
			}
			try {
				this.elem.focus();
			} catch(e) {};
		},
		
		buildMonths: function() {
			var elements = DatePicker.elements;
			this.rowsMax = 0;
			for (var i=0;i<elements.months.length;i++) {
				this.buildMonth(elements.months[i]);
			}
			this.equalizeRows();
			if (IE) {
				DatePicker.layerbg.style.width = DatePicker.div.offsetWidth+"px";
				DatePicker.layerbg.style.height = DatePicker.div.offsetHeight+"px";
			}
		},
		
		buildMonth: function(month) {
			month.header.span.innerHTML = DateTools.format(month.value, this.topFormat, this.locale);
			for (var i=month.tbody.rows.length-1;i>=0;i--) month.tbody.deleteRow(i);
			var row = month.tbody.insertRow(-1);	
			var blanks = month.value.getDay()-1;
			if (blanks == -1) blanks = 6; // because Sunday is 0
			var day = this.firstDay;
			if (this.firstDay != 0) blanks = (blanks == 6) ? 0 : blanks+1;
			for (var first=true;blanks>0;blanks--) {
				var cell = row.insertCell(-1);
				cell.innerHTML = "<span></span>";
				if (first) {
					cell.className = "first";
					first = false;
				}
				if ((day == 5) || (day == 6)) cell.className += " weekend";
				if (++day == 7) day = 0;
			}
			var cell, min, 
				lastDay   = (this.firstDay == 0)? 6 : 5,
				valueTime = this.value.getTime(),
				now       = (DateTools.getDayDate(new Date())).getTime(),
				max       = this.maxDate ? DateTools.getDayDate(this.maxDate).getTime() : Infinity;
			if (this.minDate) {
				min = this.minDate;
			} else if (this.direction == DatePicker.DIR_RET) {
				min = DateTools.addDays(this.depPicker.value, this.minDays).getTime();
			} else {
				min = now;
			}
			var tempDate = new Date(month.value.getFullYear(), month.value.getMonth(), 1);
			var length = DateTools.getDaysInMonth(month.value);
			for (var j=1;j<length+1;j++) {
				if ((day == this.firstDay) && (row.cells.length != 0)) row = month.tbody.insertRow(-1);
				cell = row.insertCell(-1);
				if (day == this.firstDay) cell.className = "first";
				else if (day == lastDay) cell.className = "last";
				tempDate.setDate(j);
				var tempTime = tempDate.getTime();
				if (tempTime == now) cell.className += " now";
				if (tempTime >= min && this.filter && !this.filter[tempTime]) {
					cell.className += " filtered";
					cell.innerHTML = "<span>"+j+"</span>";
				} else if ((tempTime < min) || (tempTime > max)) {
					cell.className += " disabled";
					var _labels = allLabels[this.locale];
					if (this.direction == DatePicker.DIR_RET) {
						cell.title = _labels.datepicker_return_before_depart || _labels.return_before_depart;
					} else if (this.direction == DatePicker.DIR_DEP) {
						cell.title = _labels.datepicker_date_not_available || _labels.date_not_available;
					}
					cell.innerHTML = "<span>"+j+"</span>";
				} else {
					cell.innerHTML = '<a href="#" onclick="return liligo.DatePicker.actual.select('+tempTime+')" onmousedown="liligo.DatePicker.actual.dontBlur=true" onmouseup="liligo.DatePicker.actual.dontBlur=false" onmouseover="liligo.DatePicker.mouseOver(this);" onmouseout="liligo.DatePicker.mouseOut(this);">'+j+"</a>";
				}
				if ((day == 5) || (day == 6)) cell.className += " weekend";
				cell.firstChild.value = tempTime;
				if (tempTime == valueTime) {
					cell.className += " actual";
					DatePicker.mouseOver(cell.firstChild);
				}
				if (++day == 7) day = 0;
			}
			if (day != this.firstDay) {
				for (;day<=lastDay;day++) {
					cell = row.insertCell(-1);
					cell.innerHTML = "<span></span>";
					if (day == lastDay) cell.className = "last";
					if ((day == 5) || (day == 6)) cell.className += " weekend";
				}
			}
			if (this.rowsMax < month.tbody.rows.length) this.rowsMax = month.tbody.rows.length;
		},
		
		equalizeRows: function() {
			var elements = DatePicker.elements;
			for (var i=0;i<elements.months.length;i++) {
				if (this.rowsMax > elements.months[i].tbody.rows.length) {
					for (var j=0;j<this.rowsMax-elements.months[i].tbody.rows.length;j++) {
						var row = elements.months[i].tbody.insertRow(-1), day = this.firstDay;
						for (var k=0;k<7;k++) {
							cell = row.insertCell(-1);
							cell.innerHTML = "<span></span>";
							if (k == 0) cell.className = "first";
							else if (k == 6) cell.className = "last";
							if ((day == 5) || (day == 6)) cell.className += " weekend";
							if (++day == 7)  day = 0;
						}
					}
				}
			}
		},
		
		getFirstMonth: function() {
			if (this.direction == DatePicker.DIR_RET) {
				var
					depFrom = new Date(this.depPicker.value.getFullYear(), this.depPicker.value.getMonth(), 1);
					depTo = new Date(this.depPicker.value.getFullYear(), this.depPicker.value.getMonth()+this.months, 1);
				if ((depFrom <= this.value) && (this.value < depTo)) {
					return {
						year: this.depPicker.value.getFullYear(),
						month: this.depPicker.value.getMonth()
					};
				}
			}
			return {
				year: this.value.getFullYear(),
				month: this.value.getMonth()
			};
		},
		
		prevMonth: function() {
			var elements = DatePicker.elements;
			DatePicker.overed = null;
			for (var i=0;i<elements.months.length;i++) {
				var oldValue = elements.months[i].value;
				elements.months[i].value = new Date(oldValue.getFullYear(), oldValue.getMonth()-1, oldValue.getDate());
			}
			this.buildMonths();
		},
		
		nextMonth: function() {
			var elements = DatePicker.elements;
			DatePicker.overed = null;
			for (var i=0;i<elements.months.length;i++) {
				var oldValue = elements.months[i].value;
				elements.months[i].value = new Date(oldValue.getFullYear(), oldValue.getMonth()+1, oldValue.getDate());
			}
			this.buildMonths();
		},
		
		saveToTemp: function() {
			this.fields.year.value = this.value.getFullYear();
			this.fields.month.value = this.value.getMonth();
			this.fields.day.value = this.value.getDate();
		},
		
		dispatchValue: function() {
			if (this.direction == DatePicker.DIR_DEP) {
				if (this.retPicker != undefined) {
					if ((this.retPicker.dontModify) && (this.retPicker.value >= this.value)) {
						this.retPicker.dontModify = false;
					} else {
						this.retPicker.value = DateTools.addDays(this.value, this.preReturnDays);
						//if ((this.maxDate) && (this.retPicker.value > this.maxDate)) {
						//	this.retPicker.value = this.maxDate;
						//}
						if  ((!this.oneWayRadio) || this.oneWayRadio.checked == false) {
							this.retPicker.saveToFields();
						} else {
						 	this.retPicker.saveToTemp();
						}				
					}
				}
			} else if (this.direction == DatePicker.DIR_RET) {
				this.dontModify = true;
			}
		},
		
		select: function(dateTime) {
			var actual = DatePicker.actual;
			actual.value.setTime(dateTime);
			actual.saveToFields();
			actual.dispatchValue();
			actual.close();
			if (actual.nextFocus) {
				try {
					actual.nextFocus.focus();
				} catch(e) {};
			}
	 		try {
	 			actual._fireEvent("set", actual, actual.value);
	 			actual.onSet(actual);
	 		} catch(e) {
	 			if (DEBUG) {
	 				console.log(e);
	 			}
	 		};
			return false;
		},
		
		set: function(dateTime) {
			if (dateTime && dateTime.length) {
				dateTime = DateTools.fromArray(dateTime).getTime();
			}
			this.value.setTime(dateTime);
			this.value = DateTools.getDayDate(this.value);
			this.saveToFields();
		},
		
		onKey: function(e) {
			var actual = DatePicker.actual;
			if (!actual) return;
			e = e || window.event;
			switch (e.keyCode) {
				case Event.KEY_TAB: {
					actual.close();
					var value = actual.elem.value;
					if (actual.nextFocus) actual.nextFocus.focus();
					actual.elem.value = value;
					break;
				}
				case Event.KEY_ESC: {
					actual.close();
					break;
				}
				case Event.KEY_PAGEDOWN: {
					actual.nextMonth();
					DatePicker.mouseOver(DatePicker.elements.months[0].tbody.rows[0].cells[0].firstChild);
					break;
				}
				case Event.KEY_PAGEUP: {
					actual.prevMonth();
					DatePicker.mouseOver(DatePicker.elements.months[DatePicker.elements.months.length-1].tbody.rows[0].cells[0].firstChild);
					break;
				}
				case 32: case Event.KEY_RETURN: {
					if (!DatePicker.overed) return false;
					if (DatePicker.overed.nodeName != "A") return false;
					if (!IE) {
						var stop = Event.bindStop(function() {
					actual.select(DatePicker.overed.value);
							Event.stopObserving(document, "keypress", stop);
						});
						Event.observe(document, "keypress", stop);
					} else {
						actual.select(DatePicker.overed.value);
					}
					break;
				}
				case Event.KEY_LEFT: {
					DatePicker.mouseOut(DatePicker.overed);
					var selected = DatePicker.overed.parentNode;
					var next = selected.previousSibling;
					if (next == null) {
						next = selected.parentNode.parentNode.parentNode.parentNode.previousSibling;
						if (next == null) {
							var oldRowIndex = selected.parentNode.sectionRowIndex;
							actual.prevMonth();
							next = DatePicker.elements.months[0].tbody.rows[oldRowIndex];
							if (next == null) {
								next = DatePicker.elements.months[0].tbody.rows[oldRowIndex-1].lastChild;
							} else {
								next = next.lastChild;
							}
						} else {
							next = next.lastChild.lastChild.rows[selected.parentNode.sectionRowIndex].lastChild;
						}
					}
					DatePicker.mouseOver(next.firstChild);
					break;
				}
				case Event.KEY_RIGHT: {
					DatePicker.mouseOut(DatePicker.overed);
					var selected = DatePicker.overed.parentNode;
					var next = selected.nextSibling;
					if (next == null) {
						next = selected.parentNode.parentNode.parentNode.parentNode.nextSibling;
						if (next.nodeName == "BR") {
							var oldRowIndex = selected.parentNode.sectionRowIndex;
							actual.nextMonth();
							next = DatePicker.elements.months[DatePicker.elements.months.length-1].tbody.rows[oldRowIndex];
							if (next == null) {
								next = DatePicker.elements.months[DatePicker.elements.months.length-1].tbody.rows[oldRowIndex-1].firstChild;
							} else {
								next = next.firstChild;
							}
						} else {
							next = next.lastChild.lastChild.rows[selected.parentNode.sectionRowIndex].firstChild;
						}
					}
					DatePicker.mouseOver(next.firstChild);
					break;
				}
				case Event.KEY_UP: {
					DatePicker.mouseOut(DatePicker.overed);
					var selected = DatePicker.overed.parentNode;
					var next = selected.parentNode.previousSibling;
					if (next == null) {
						next = selected;
					} else {
						next = next.cells[selected.cellIndex];
					}
					DatePicker.mouseOver(next.firstChild);
					break;
				}
				case Event.KEY_DOWN: {
					DatePicker.mouseOut(DatePicker.overed);
					var selected = DatePicker.overed.parentNode;
					var next = selected.parentNode.nextSibling;
					if (next == null) {
						next = selected;
					} else {
						next = next.cells[selected.cellIndex];
					}
					DatePicker.mouseOver(next.firstChild);
					break;
				}
				case 116: { // F5
					return true;
					break;
				}
			}
			return false;	
		},
		
		close: function() {		
			if (DatePicker.actual != null) {
				document.onkeydown = DatePicker.actual.oldOnKeyDown;
			}
			DatePicker.div.style.display = "none";
			if (IE) DatePicker.layerbg.style.display = "none";
			DatePicker.actual = null;
			this.onClosed();
		}
		
	}, {
		
		DIR_NORMAL: 0,
		DIR_DEP: 1,
		DIR_RET: 2,
		
		initialized: false,
		
		defaultFormats: {
			top: {
				fr: "%F, %Y",
				en: "%F, %Y",
				es: "%F, %Y",
				hu: "%Y. %F",
				def: "%F, %Y"
			},
			bottom: {
				fr: "%d %F %Y",
				en: "%d %F %Y",
				es: "%d %F %Y",
				hu: "%Y. %F %d.",
				def: "%d %F %Y"
			},
			display: {
				fr: "%d %M %Y",
				en: "%d %M %Y",
				es: "%d %M %Y",
				hu: "%M %d.",
				def: "%d %M %Y"
			}
		},
		
		initialize: function() {
			var div = Element("div", {
				className: "datepicker",
				innerHTML: ""
			});
			Style.hide(div);
			DOM.add(div);
			this.div = div;
			var elements = {
				months: []
			};
			elements.dpHeader = Element("div", {className: "dpHeader"});
			div.appendChild(elements.dpHeader);
			elements.dpHeader.a = Element("a", {href: "#"});
			elements.dpHeader.appendChild(elements.dpHeader.a);
			elements.dpHeader.a.onclick = function() {DatePicker.actual.close();return false;}; 
			elements.dpBody = Element("div", {className: "dpBody"});
			div.appendChild(elements.dpBody);
			elements.dpFooter = Element("div", {className: "dpFooter"});
			elements.dpFooter.span = Element("span");
			elements.dpFooter.appendChild(elements.dpFooter.span);
			div.appendChild(elements.dpFooter);
			elements.prev = Element("a", {
				className: "dpPrev",
				href: "#"
			});
			elements.next = Element("a", {
				className: "dpNext",
				href: "#"
			});
			elements.br = Element("br");
			elements.dpBody.appendChild(elements.br);
			this.elements = elements;
			if (IE) { // TODO: SafeLayer
				var layerbg = Element("iframe", {src: "about:blank"});
				layerbg.style.zIndex = 100;
				layerbg.style.position = "absolute";
				layerbg.style.display = "none";
				DOM.add(layerbg);
				this.layerbg = layerbg;
			}
			if (_liligo.detect("Gecko.\\d{4}")) {// Mozilla border-collapse+margin bug
				Style.addRules(".datepicker table{position:relative;left:1px}\n.datepicker .dpMonth1 table{position:auto;left:auto}");
			}
			Style.addRules(
				Style.fromFile([{"rules":".datepicker,.datepicker div,.datepicker span,.datepicker a{margin:0;padding:0;font-family:Verdana;font-size:9px;font-weight:normal;}.datepicker{position:absolute;border:1px solid #bebebe;padding:1px;margin:0;background:#fff;text-align:left;}.datepicker .dpHeader{background:#bebebe url(\/liligo\/img\/datepicker-sprites.png) no-repeat;height:18px;text-align:right;}.datepicker .dpHeader a{display:block;float:right;height:18px;width:26px;outline:none;}.dp1 .dpHeader{background-position:111px -99px;}.dp2 .dpHeader{background-position:246px -99px;}.datepicker .dpBody{background:#bebebe;height:1%;}.datepicker .dpFooter{background:#ff6d00;height:18px;}.datepicker .dpFooter span{display:block;text-align:center;color:#fff;padding-top:3px;}.dp1 .dpHeader,.dp1 .dpFooter,.dp1 .dpBody{width:133px;}.dp2 .dpHeader,.dp2 .dpFooter,.dp2 .dpBody{width:267px;}.datepicker .dpMonth{width:133px;float:left;background:#fff;}.datepicker .dpMonth2{margin-left:1px;}.datepicker br{clear:both;}.datepicker .dpMonthHeader{height:14px;position:relative;}.datepicker .dpMonthHeader span{text-align:center;display:block;}.datepicker .dpMonthHeader .dpPrev,.datepicker .dpMonthHeader .dpNext{width:20px;height:12px;position:absolute;top:0;border:0;outline:none;}.datepicker .dpMonthHeader .dpPrev{left:0;background:url(\/liligo\/img\/datepicker-sprites.png) 2px 1px no-repeat;}.datepicker .dpMonthHeader .dpNext{left:116px;background:url(\/liligo\/img\/datepicker-sprites.png) 2px -49px no-repeat;}.datepicker table{border-collapse:collapse;}.datepicker table td{text-align:center;background:#cdcdcd;padding:0;border:1px solid #fff;}.datepicker table thead td{background:#ff6d00;}.datepicker .dpMonth1 table td.first{border-left:0;}.datepicker table td.last{border-right:0;}.datepicker thead span{background:#ff6d00;display:block;margin:1px;width:16px;height:12px;color:#fff;font-weight:bold;}.datepicker tbody a{background:#fff;display:block;margin:1px;width:16px;height:12px;text-decoration:none;color:#000;}.datepicker tbody span{background:#fff;display:block;margin:1px;width:16px;height:12px;}.datepicker tbody td.weekend a,.datepicker tbody td.weekend span{background:#feecde;}.datepicker tbody td.now{background:#ff6d00;}.datepicker tbody td.disabled span{color:#c0c0c0;}.datepicker tbody td.hover{background:#ff6d00;}.datepicker tbody td.hover a{background:#ff6d00;color:#fff;}.datepicker tbody td.actual a{font-weight:bold;}.datepicker tbody td.filtered span{background-image:url(\/liligo\/img\/datepicker-filter.png);}","b":"all"},{"rules":".datepicker tbody td.filtered span{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\/liligo\/img\/datepicker-filter.png',sizingmethod='crop');}","b":"IE6"}])
			);
			_liligo.preload([
				"/liligo/img/datepicker-sprites.png"
			]);
			if (!liligo.BOM.detect("firefox")) __Eo(window, "resize", bind(this.close, this));
			this.initialized = true;
		},
		
		close: function() {		
			if (DatePicker.actual) {
				DatePicker.actual.close();
			}
		},
		
		mouseOver: function(elem) {
			var tempDate = new Date(), actual = DatePicker.actual;
			if (!actual) return;
			tempDate.setTime(elem.value);
			if (elem.value == undefined) {
				DatePicker.elements.dpFooter.span.innerHTML = "";
			} else {
				DatePicker.elements.dpFooter.span.innerHTML = DateTools.format(tempDate, actual.bottomFormat, actual.locale);
			}
			if (DatePicker.overed != null) this.mouseOut(DatePicker.overed);
			DatePicker.overed = elem;
			elem.parentNode.oldClassName = elem.parentNode.className;
			elem.parentNode.className += " hover";
		},
		
		mouseOut: function(elem) {
			if (elem.parentNode != undefined) elem.parentNode.className = elem.parentNode.oldClassName;
			if (DatePicker.actual) DatePicker.actual.dontBlur = false;
		}
		
	});

	_liligo.extend({
		DateTools: DateTools,
		DatePicker: DatePicker
	});

})();
/*
 * Included file end: /liligo/src/liligo.DatePicker.js
 * Included from:     /liligo/full.js:21
 */


	if (DEBUG) {
		
/*
 * Included file begin: /liligo/src/console/main.js
 * Included from:       /liligo/full.js:24
 */
(function() {

	eval(liligo.namespace);

	if (liligo.console || window.console || !BOM.isBrowser()) return;

	
/*
 * Included file begin: /liligo/src/console/utils.js
 * Included from:       /liligo/src/console/main.js:7
 */

	var escapeHTML = liligo.escapeHTML; 

	var stripNewLines = function(value) {
		return typeof(value) == "string" ? value.replace(/[\r\n]/g, " ") : value;
	};
	
	var cropString = function(text, limit) {
		text += text;
		limit = limit || 100;
		if (text.length > limit) {
			return escapeNewLines(text.substr(0, limit)) + "...";
		} else {
			return escapeNewLines(text);
		}
	};
	
	var escapeNewLines = function(value) {
		return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n");
	};
	
	var toString = function(object) {
		try {
			return ""+object;
		} catch(e) {
			return "";
		} 
	};
/*
 * Included file end: /liligo/src/console/utils.js
 * Included from:     /liligo/src/console/main.js:7
 */

	
	
/*
 * Included file begin: /liligo/src/console/Formatter.js
 * Included from:       /liligo/src/console/main.js:9
 */

	var Formatter = Class({
		
		constructor: function(doc) {
			this.doc = doc || document; 
		},
		
		create: function(tagName, className) {	
			var elem = this.doc.createElement(tagName);
			if (className) {
				elem.className = className;
			}
			return elem;  
		},
		
		general: function(typeName, string, parent) {
			var span = this.create("span", "objectBox-"+typeName);
			span.innerHTML = escapeHTML(string);
			parent.appendChild(span);
		},
	
		asObject: function(object, parent) {
			var type = typeof object;
			if (object === undefined) {
				this.general(type, type, parent);
			} else if (object === null) {
				this.general("null", "null", parent);
			} else if (type == "string") {
				this.general(type, '"'+toString(object)+'"', parent);
			} else if (type == "number") {
				this.asInteger(object, parent);
			} else if (type == "boolean") {
				this.general(type, object, parent);
			} else if (typeof object == "function") {
        var match = /function ?(.*?)\(/.exec(toString(object));
				this.general(type, match ? match[1] : type, parent);
			} else if (typeof object == "object") {
				this.general(type, toString(object), parent);
			} else {
				this.appendText(object, parent); 
			}
		},
		
		asText: function(s, parent) {
			parent.appendChild(this.doc.createTextNode(s));
		},
			
		asInteger: function(i, parent) {
			this.general("number", toString(i), parent);
		},

		asFloat: function(i, parent) {
			this.general("number", toString(i), parent);
		}
	
	});
/*
 * Included file end: /liligo/src/console/Formatter.js
 * Included from:     /liligo/src/console/main.js:9
 */

	
/*
 * Included file begin: /liligo/src/console/InputHistory.js
 * Included from:       /liligo/src/console/main.js:10
 */

	var InputHistory = Class(Observable, {
	
		constructor: function(params) {
			var that = this;
			extend(that, params || {});
			var elem = that.elem;
			that.history = that.history || [];
			__Eo(elem, "keydown", __Eb(that._keydown, that));
			this.historyPos = 0;
		},
		
		_keydown: function(event) {
			var
				that = this, keyCode = event.keyCode,
				historyPos = that.historyPos,
				history =  that.history;
			if (keyCode == Event.KEY_RETURN) {
				that._enter(event);
			} else if (keyCode == Event.KEY_ESC) {
				that.elem.value = "";
			} else if (keyCode == Event.KEY_DOWN) {
				if (!historyPos) return;
				that._saveActual();
				that.elem.value = history[--that.historyPos];
			} else if (keyCode == Event.KEY_UP) {
				if (historyPos+1 >= history.length) return;
				that._saveActual();
				that.elem.value = history[++that.historyPos];
			}
		},
		
		_saveActual: function() {
			this.history[this.historyPos] = this.elem.value;
		},
		
		_enter: function() {
			if (!this.elem.value) return;
			var
				history = this.history,
				historyPos = this.historyPos,
				cmd = history[historyPos] = this.elem.value;
			if (historyPos == 0) {
				if (history[0] === history[1]) {
					history[0] = "";
				} else {
					history.unshift("");
				}
			} else {
				if (!history[0]) {
					history.shift();
					historyPos--;
				} 
				if (history[0] != history[historyPos]) {
					history.unshift(history[historyPos]);
				}
				history.unshift("");
			}
			this.historyPos = 0;
			this.elem.value = "";
			this._fireEvent("command", cmd);
		}
	
	});
/*
 * Included file end: /liligo/src/console/InputHistory.js
 * Included from:     /liligo/src/console/main.js:10
 */

	
/*
 * Included file begin: /liligo/src/console/Appender.js
 * Included from:       /liligo/src/console/main.js:11
 */

	var Appender = new Class({
		
		maxItems: 500,
		
		_items: 0,

		constructor: function(container) {
			this._cont = container;
		},
		
		append: function(node) {
			var that = this;
			that._items++;
			that._fixItems();
			that._cont.appendChild(node);
			that.scroll();
			return node;
		},
		
		scroll: function() {
			this._cont.scrollTop = this._cont.scrollHeight;
		},
		
		clear: function() {
			this._items = 0;
			this._cont.innerHTML = "";
		},
		
		_fixItems: function() {
			while (this._items > this.maxItems) {
				this._cont.removeChild(this._cont.firstChild);
				this._items--;
			}
		}
		
	});
/*
 * Included file end: /liligo/src/console/Appender.js
 * Included from:     /liligo/src/console/main.js:11
 */

	
/*
 * Included file begin: /liligo/src/console/console.js
 * Included from:       /liligo/src/console/main.js:12
 */
	
	var console = Singleton(Observable, {
		
		init: function() {
			var that = this, trigger;
			that._queue = [];
			that._trigger = trigger = new Trigger([
				domLoaded, "logOrOpen"
			], bind(that._start, that));
			trigger.log = 
			trigger.open = trigger.logOrOpen;
			if (liligo.__openConsole) {
				liligo.console = this;
				that.open();
			}
		},

		/*************************** log ***************************/
		
		log: function() {
			this._logFormatted(arguments);
		},

		/*************************** open ***************************/
		
		open: function() {
			if (!this._started) {
				liligo.__openConsole = true;
				this._trigger.open();
				return;
			}
			this.isOpen = true;
			this._contDiv.style.visibility = "visible";
			try {
				this._input.elem.focus();
			} catch(e) {}
		},

		/*************************** close ***************************/
		
		close: function() {
			if (this._contDiv) {
				this.isOpen = false;
				this._contDiv.style.visibility = "hidden";
				if (IE) {
					var inputStyle = this._input.elem.style;
					inputStyle.visibility = "hidden";
					inputStyle.visibility = "";
				}
			}
		},

		/*************************** toggle ***************************/
		
		toggle: function() {
			this.isOpen ? this.close() : this.open();
		},

		/*************************** clear ***************************/
		
		clear: function() {
			this._appender.clear();
		},
		
		/*************************** private: ***************************/
		
		_styles: Style.fromFile([{"rules":"*{margin:0;padding:0;}html,body{background:#fff;font-size:11px;overflow:hidden;border:0;width:100%;height:100%;}.logRow{position:relative;font-family:Monaco,monospace;border-bottom:1px solid #D7D7D7;padding:2px 4px 1px 6px;background-color:#fff;}.logRow-command{font-family:Monaco,monospace;color:#00F;}.logRow-exception{font-family:Lucida Grande,Tahoma,sans-serif;padding:4px 4px 4px 6px;color:#000;}#resizer{position:absolute;z-index:2;bottom:0;right:0;width:18px;height:19px;cursor:nw-resize;font-size:15px;font-family:sans-serif;}#toolbar-cont{position:absolute;left:0;top:0;width:100%;height:auto;}#toolbar{height:14px;border-top:1px solid ThreeDHighlight;border-bottom:1px solid ThreeDShadow;padding:2px 6px;background:ThreeDFace;cursor:move;}#toolbar a{font-family:Lucida Grande,Tahoma,sans-serif;color:#000;text-decoration:none;}#toolbar .right{position:absolute;top:4px;right:6px;}#console{position:absolute;top:20px;left:0;bottom:0;width:100%;}#log{position:absolute;top:0;width:100%;bottom:18px;overflow:auto;}#console-bottom{position:absolute;bottom:0;left:0;width:100%;height:18px;border:none;border-top:1px solid #ccc;}#console-bottom .prompt{float:left;font-family:Monaco,monospace;color:#00f;padding:2px 4px 0 7px;display:block;}#console-cmd{position:absolute;left:32px;right:18px;font-size:11px;display:block;font-family:Monaco,monospace;padding:2px 0 0 0;border:0;}.objectBox-null,.objectBox-undefined{padding:0 2px;border:1px solid #666;background-color:#888;color:#fff;font-family:Lucida Grande,Tahoma,sans-serif;}.objectBox-boolean{font-family:Monaco,monospace;color:#008;white-space:pre;}.objectBox-string{font-family:Monaco,monospace;color:#f00;white-space:pre;}.objectBox-number{color:#008;}.objectLink-function,.objectBox-stackTrace,.objectLink-profile{color:DarkGreen;}.objectBox-object{font-family:Lucida Grande,sans-serif;font-weight:bold;color:DarkGreen;}","b":"all"},{"rules":"#console{height:expression(this.offsetParent.offsetHeight-20);}#log{height:expression(this.offsetParent.offsetHeight-19);}#console-cmd{width:expression(this.offsetParent.offsetWidth-50);}","b":"IE6"},{"rules":"#console{height:expression(this.offsetParent.offsetHeight-20);}#log{height:expression(this.offsetParent.offsetHeight-19);}#console-cmd{width:expression(this.offsetParent.offsetWidth-50);}","b":"IE7"}]),
		_template: (new VTemplate("/liligo/src/console/iframe.vm", function (context) { 
var text = new liligo.__VT_StringCat(), _function = 'function', 
velocityCount = 0;
if (context.velocityCount) velocityCount=context.velocityCount;

text.push('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">	<head><title>liligo console</title>		<script type="text/javascript" src="');
text.push( context.liligo);
text.push('"></script>	<script type="text/javascript">		window.onload = function() {			eval(liligo.namespace.replace(/var /, "window."));			parent.liligo.console._frameLoaded();		};	</script></head><body>	<div id="toolbar-cont">		<div id="toolbar">			<a id="clear" href="');
text.push('#clear');
text.push('">Clear</a>			<span class="right">				<a id="close" href="');
text.push('#close');
text.push('">Close</a>			</span>		</div>	</div>		<div id="console" class="oneline">			<div id="log">		</div>		<div id="console-bottom">			<span class="prompt">&gt;&gt;&gt;</span>			<input type="text" id="console-cmd" style="height:100%" />		</div>			</div>	<div id="resizer">		&harr;	</div>		</body></html>');
return text.toString();
}
)),


		/*************************** _start ***************************/ 		

		_start: function() {
			var frame = this._frame = document.createElement("iframe");
      frame.setAttribute("frameBorder", "0");
      Style.set(frame, {
      	width: "400px",
      	height: "200px"
      });
      var contDiv = this._contDiv = document.createElement("div");
      Style.set(contDiv, {
      	margin: 0, padding: 0,
      	position: "absolute",
      	top: "30px",
      	left: "50px",
      	zIndex: 99999,
      	border: "1px solid #000",
      	visibility: "hidden"
      });
      document.body.appendChild(contDiv);
      contDiv.appendChild(frame);
			var scripts = $$("script"), script;
			while (script = scripts.shift()) {
				if (
					/pp\/liligo\/full\.js/.test(script.src) ||
					/liligo-f.?\.js/.test(script.src)
				) {
					script = script.src;
					break;
				}
			}
			var 
				frameWin = this._win = frame.contentWindow,
				frameDoc = this._doc = frameWin.document; 
			this._formatter = new Formatter(frameDoc);
			frameDoc.write(this._template.process({
				liligo: script
			}));
			frameDoc.close();
		},
		
		/*************************** _frameLoaded ***************************/

		_frameLoaded: function() {
			var frameLiligo = this._liligo = this._win.liligo, input;
			
			// inject styles into iframe
			frameLiligo.Style.addRules(this._styles);
			
			// the appender for console
			this._appender = new Appender(
				frameLiligo.$("log")
			);
			
			// inputhistory object for command line			
			this._input = input = new InputHistory({
				elem: frameLiligo.$("console-cmd")
			});
			__Eo(input, "command", bind(this._command, this));
			
			var
				close = frameLiligo.$("close"),
				clear = frameLiligo.$("clear"),
				toolbar = this._toolbar = frameLiligo.$("toolbar"),
				resizer = this._resizer = frameLiligo.$("resizer");
				

			__Eo(clear, "click", __EbS(this.clear, this));
			__Eo(close, "click", __EbS(this.close, this));
			
			// drag&drop moving
			__Eo(toolbar, "mousedown", __Eb(this._toolBarMouseDown, this));
			try {
				__Eo(toolbar, "dragstart", __Eb(Event.stop, Event));
				__Eo(toolbar, "selectstart", __Eb(Event.stop, Event));
			} catch(e) {}

			// drag&drop resizing
			__Eo(resizer, "mousedown", __Eb(this._resizerMouseDown, this));
			try {
				__Eo(resizer, "dragstart", __Eb(Event.stop, Event));
				__Eo(resizer, "selectstart", __Eb(Event.stop, Event));
			} catch(e) {}

			// console is ready
			this._contDiv.style.visibility = "visible";
			this.isOpen = true;
			this._started = 1; // 1 == true
			if (liligo.__openConsole) {
				try {
					this._input.elem.focus();
				} catch(e) {}
			}

			// empty the queue
			var queue = this._queue, args;
			while (args = queue.shift()) {
				this._logFormatted.apply(this, args);
			}
		},
		
		/*************************** Drag & Drop moving ***************************/ 		
	
		_toolBarMouseDown: function(e) {
			this._dragEnd();
			var Evnt = Event, Observer = Evnt.Observer;
			if (Evnt.element(e) != this._toolbar) return;
			var divPos = Geometry.position(this._contDiv);
			this._dragStart = [
				Evnt.pointerX(e),
				Evnt.pointerY(e)
			];
			this._mouseup = new Observer(this._doc, "mouseup",
				bind(this._dragEnd, this)
			); 
			this._mousemove1 = new Observer(this._doc, "mousemove",
				Evnt.bind(this._dragging1, this)
			);
			this._mousemove2 = new Observer(document, "mousemove",
				Evnt.bind(this._dragging2, this)
			); 
		},
		
		// mousemove inside the iframe
		_dragging1: function(e) {
			var divPos = Geometry.position(this._contDiv);
			Style.set(this._contDiv, {
				left: Event.pointerX(e)+divPos[0]-this._dragStart[0]+"px",
				top: Event.pointerY(e)+divPos[1]-this._dragStart[1]+"px"
			});
		},
		
		// mouvemove outside the iframe
		_dragging2: function(e) {
			Style.set(this._contDiv, {
				left: Event.pointerX(e)-this._dragStart[0]+"px",
				top: Event.pointerY(e)-this._dragStart[1]+"px"
			});
		},
		
		// mouseup -> stop and free the listeners
		_dragEnd: function() {
			if (!this._mouseup) return;
			var list = ["_mouseup", "_mousemove1", "_mousemove2"], act;
			while (act = list.shift()) {
				this[act].stop();
				delete this[act];
			}
		},
			
		/*************************** Drag & Drop resizing ***************************/ 		
	
		_resizerMouseDown: function(e) {
			this._dragEnd();
			var Evnt = Event, Observer = Evnt.Observer; 
			this._startSize = Geometry.dimension(this._frame);
			this._dragStart = [
				Evnt.pointerX(e),
				Evnt.pointerY(e)
			];
			this._mouseup = new Observer(this._doc, "mouseup",
				bind(this._dragEnd, this)
			); 
			this._mousemove1 = new Observer(this._doc, "mousemove",
				Evnt.bind(this._resizing1, this)
			);
			this._mousemove2 = new Observer(document, "mousemove",
				Evnt.bind(this._resizing2, this)
			); 
		},
		
		// mouvemove inside the iframe
		_resizing1: function(e) {
			try {
				Style.set(this._frame, {
					width: this._startSize[0]+
						Event.pointerX(e)-this._dragStart[0]+"px",
					height: this._startSize[1]+
						Event.pointerY(e)-this._dragStart[1]+"px"
				});
			} catch(e) {}
		},
		
		// mouvemove outside the iframe
		_resizing2: function(e) {
			var framePos = Geometry.position(this._frame);
			try {
				Style.set(this._frame, {
					width: this._startSize[0]+
						Event.pointerX(e)-framePos[0]-this._dragStart[0]+"px",
					height: this._startSize[1]+
						Event.pointerY(e)-framePos[1]-this._dragStart[1]+"px"
				});
			} catch(e) {}
		},
		
		/*************************** _command ***************************/ 		

		_command: function(cmd) {
			var
				shortCmd = cropString(stripNewLines(cmd), 100),
				row = this._createRow("logRow-command"),
				result;
			row.innerHTML = escapeHTML(">>> "+cmd);
			this._append(row);
			result = this._evaluate(cmd);
			if (result !== undefined) {
				this._logFormatted(["%o", result]);
			}
		},
		
		/*************************** _evaluate ***************************/ 		

		_evaluate: function(code) {
			try {
				return (new Function("code", "console",
					"var "+
						"clear=liligo.bind(console.clear,console)," +
						"$=liligo.$;" +
					"return eval(code)"
				))(code, this);
			} catch(e) {
				var
					row = this._createRow("logRow-exception"),
					s = toString(e);
				if (IE && s == "[object Error]") {
					s = e.name+": "+e.message; 
				}
				row.innerHTML = escapeHTML(s);
				this._append(row);
			}
		},
		
		
		/*************************** _logFormatted ***************************/
		
		_logFormatted: function(args, className) {
			if (typeof args == "string") {
				return this._logFormatted(arguments);
			}
			if (!this._started) {
				this._queue.push(arguments);
				this._trigger.log();
				return;
			}
			var
				row = this._createRow(className),
				formatter = this._formatter,
				parts = this._parseFormat(args[0]), part,
				index = 0, object;
			if (parts.length) {
				index = 1;
			}
			while (part = parts.shift()) {
				if (part && typeof(part) == "object") {
					formatter["as"+part.appender](args[index++], row)
				} else {
					formatter.asText(part, row);
				}
			}
			while (index < args.length) {
				part = args[index++];
				(typeof part == "string") ?
					formatter.asText(part, row) :
					formatter.asObject(part, row)
			}
			this._append(row);
		},
		
		/*************************** _append ***************************/
		 		
		_append: function(className, args) {
			if (typeof className == "object") {
				row = className;
			} else {
				if (!args[0]) return;
				row = this._createRow(className);
				row.innerHTML = escapeHTML(args[0]);
			}
			if (row.childNodes.length) {
				this._appender.append(row);
			}
		},

		/*************************** _createRow ***************************/
		
		_createRow: function(className) {
			var row = this._doc.createElement("div");
			row.className = "logRow "+(className || "");
			return row;
		},
		
		/*************************** _parseFormat ***************************/

		_parseFormat: function(format) {
			if (typeof format != "string") {
				return [];
			}
			var
				parts = [],
				reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/,
				appenderMap = {s: "Text", d: "Integer", i: "Integer", f: "Float"},
				m, type, appender, precision, text;
	
			for (m = reg.exec(format); m; m = reg.exec(format)) {
				type = m[8] ? m[8] : m[5];
				appender = type in appenderMap ? appenderMap[type] : "Object";
				precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0);
				if (text = format.substr(0, m[0].charAt(0) == "%" ? m.index : m.index+1)) {
					parts.push(text);
				}
				parts.push({appender: appender, precision: precision});
				format = format.substr(m.index+m[0].length);
			}
			if (format) {
				parts.push(format);
			}
			return parts;
		}

	});
/*
 * Included file end: /liligo/src/console/console.js
 * Included from:     /liligo/src/console/main.js:12
 */

	
	liligo.extend({
		console: console
	});
	
	window.console = console;
	
})();
/*
 * Included file end: /liligo/src/console/main.js
 * Included from:     /liligo/full.js:24
 */

	}


