VGIMG = 'http://www.upconcert.com/img';
VGJS = 'http://www.upconcert.com/include/js';

function getElementDiv(id) {
		if (!document.getElementById) { 
			return;
		}

		if (document.all) {
			return eval("document.all." + id);
		} else {
			return document.getElementById(id);
		}
	}

	function DisplayDiv(id) {
		var DivArray;
		var i;
		
		DivArray = id.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(DivArray[i]).style.display = (getElementDiv(DivArray[i]).style.display == "none" ? "inline" : "none");
		}
	}

	function DivOn(id) {
		var DivArray;
		var i;
		
		DivArray = id.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(DivArray[i]).style.display = "inline";
		}
	}

	function DivOff(id) {
		var DivArray;
		var i;
		
		DivArray = id.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(DivArray[i]).style.display = "none";
		}
	}

	function DisplayDiv2(id) {
		var DivArray;
		var i;
		
		DivArray = id.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(DivArray[i]).style.display = (getElementDiv(DivArray[i]).style.display == "none" ? "block" : "none");
		}
	}

	function DivOn2(id) {
		var DivArray;
		var i;
		
		DivArray = id.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(DivArray[i]).style.display = "block";
		}
	}

	function SelectAll(id, nb) {
		var i;

		for (i = 0; i < nb; i++) {
			getElementDiv(id + i).checked = true;
		}
	}

	function UnselectAll(id, nb) {
		var i;

		for (i = 0; i < nb; i++) {
			getElementDiv(id + i).checked = false;
		}
	}

	function Inverser(id, nb) {
		var i;

		for (i = 0; i < nb; i++) {
			if (getElementDiv(id + i).checked) {
				getElementDiv(id + i).checked = false;
			} else {
				getElementDiv(id + i).checked = true;
			}
		}
	}

	function SelectList(id) {
		var DivArray;
		var i;
		
		DivArray = id.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(DivArray[i]).checked = true;
		}
	}

	function UnselectList(id) {
		var DivArray;
		var i;
		
		DivArray = id.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(DivArray[i]).checked = false;
		}
	}

	Ajax = {};

	Ajax.Request = function(url, options){
		var request = null;

		var tentatives = [
			function(){return new XMLHttpRequest();},
			function(){return new ActiveXObject("Msxml2.XMLHTTP");},
			function(){return new ActiveXObject("Microsoft.XMLHTTP");},
			];

		for (i=0;(null==request)&&i<tentatives.length;i++)
		{
			try{
				request = tentatives[i]();
			}
			catch(e){
				continue;
			}
		}

		if (null == request)
			throw new Error("XmlHttp non supporté");

		options = options||{};

		request.onreadystatechange = function() {
			if (request.readyState == 4)
				if ( (request.status == 200) && (options.onSuccess) )
					options.onSuccess(request);
				else if (options.onFailure)
					options.onFailure(request)
		}

		options.method = options.method || "get";

		switch(options.method.toLowerCase()){
			case "get":
				request.open(options.method.toUpperCase(), url + (options.parameters?("?" + options.parameters):""), true);
				request.send(null);
				break;
			case "post":
				request.open(options.method.toUpperCase(), url, true);
				request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				request.setRequestHeader("Content-Length", (options.parameters?("'" + options.parameters.length + "'"):"0"));
				request.send(options.parameters||"");
				break;
			default:
				break;
		}
	}

	Ajax.EncodeParameters = function(parameters){
		if ("object" == typeof parameters){
			var ar = [];
			for (name in parameters){
				var value = parameters[name].toString();
				ar.push(encodeURIComponent(name).replace(/%20/,"+") + '=' +
					encodeURIComponent(value).replace(/%20/,"+"));
			}
			return ar.join("&");
		}
		else
			return "";
	}

	function Confirmation(text, url) {
		var answer = confirm(text);
		if (answer){
			if (url != '' && url != undefined) {
				window.location = url;
			} else {
				return true;
			}
		} else{
			return false;
		}
	}

	function vire_accents(my_string) {
		var new_string = "";
		var pattern_accent = new Array("À","Á","Â","Ã","Ä","Å","à","á","â","ã","ä","å","Ò","Ó","Ô","Õ","Ö","Ø","ò","ó","ô","õ","ö","ø","È","É","Ê","Ë","è","é","ê","ë","Ì","Í","Î","Ï","ì","í","î","ï","Ù","Ú","Û","Ü","ù","ú","û","ü","ÿ","Ñ","ñ","Ç","ç");
		var pattern_replace_accent = new Array("A","A","A","A","A","A","a","a","a","a","a","a","O","O","O","O","O","O","o","o","o","o","o","o","E","E","E","E","e","e","e","e","I","I","I","I","i","i","i","i","U","U","U","U","u","u","u","u","y","N","n","C","c");
		if (my_string && my_string != "") {
			new_string = preg_replace (pattern_accent, pattern_replace_accent, my_string);
			}
		return new_string;
	}

	function preg_replace (array_pattern, array_pattern_replace, my_string) {
		var new_string = String (my_string);
		for (i=0; i<array_pattern.length; i++) {
			var reg_exp = RegExp(array_pattern[i], "gi");
			var val_to_replace = array_pattern_replace[i];
			new_string = new_string.replace (reg_exp, val_to_replace);
		}
		return new_string;
	}

	function updateEtoile(ref, note) {
		new Ajax.Request('/compte/agenda/noter.ajax.php',{method:'post',onSuccess:function(xhr){if (xhr.responseText == '1') {setEtoile(ref, note, 'red');setTimeout('setEtoile(' + ref + ', ' + note + ')', 600);getElementDiv('ietoile' + ref).value = note;}},onFailure:function(){getElementDiv('etoile' + ref).innerHTML = '<h5 style="color: #F00;">Une erreur est survenue</h5>';}, parameters:'refconcert=' + ref + '&note=' + note})
	}

	function setEtoile(ref, note, couleur) {
		if (couleur == undefined || couleur == '') { couleur = 'orange'; }
		for (i = 1; i <= 5; i++) {
			if (i <= note) {
				getElementDiv('e' + ref + 'p' + i).src = 'http://www.upconcert.com/img/etoile/' + couleur + '.gif';
			} else {
				getElementDiv('e' + ref + 'p' + i).src = 'http://www.upconcert.com/img/etoile/grey.gif';
			}
		}
	}

	function getNote(ref, note, couleur) {
		var text = '';
		if (couleur == undefined || couleur == '') { couleur = 'orange'; }
		for (i = 1; i <= 10; i++) {
			if (i % 2 == 1){ img = 'left'; } else { img = 'right'; }
			if (i <= note) {
				document.getElementById('e' + ref + 'p' + i).src = 'http://www.upconcert.com/img/note/' + couleur + '_' + img + '.gif';
			} else {
				document.getElementById('e' + ref + 'p' + i).src = 'http://www.upconcert.com/img/note/grey_' + img + '.gif';
			}
		}
	}

	function setNote(refnote, refconcert, refartiste, note) {
		getNote(refnote, note, 'red');
		document.getElementById('ietoile' + refnote).value = note;
		new Ajax.Request('/compte/agenda/ajax/setnote.ajax.html',{method:'post',onSuccess:function(xhr){if (xhr.responseText == '1') {getNote(refnote, note);}},onFailure:function(){}, parameters:'refconcert=' + refconcert + '&refartiste=' + refartiste + '&note=' + note / 2})
	}

	function printEtoile(ref, note) {
		for (i = 1; i <= 5; i++) {
			if (i <= note) {
				document.write('<a href="javascript:void(0);" onClick="updateEtoile(' + ref + ', ' + i + ')" style="outline: 0px;"><img id="e' + ref + 'p' + i + '" src="http://www.upconcert.com/img/etoile/orange.gif" width="14" height="13" border="0" alt="" onMouseOver="setEtoile(' + ref + ', ' + i + ')" onMouseOut="setEtoile(' + ref + ', getElementDiv(\'ietoile' + ref + '\').value)" /></a>');
			} else {
				document.write('<a href="javascript:void(0);" onClick="updateEtoile(' + ref + ', ' + i + ')" style="outline: 0px;"><img id="e' + ref + 'p' + i + '" src="http://www.upconcert.com/img/etoile/grey.gif" width="14" height="13" border="0" alt="" onMouseOver="setEtoile(' + ref + ', ' + i + ')" onMouseOut="setEtoile(' + ref + ', getElementDiv(\'ietoile' + ref + '\').value)" /></a>');
			}
		}
	}

	function printEtoileOff(ref, url) {
		for (i = 1; i <= 5; i++) {
			document.write('<a href="/compte/?url=' + url + '"><img id="e' + ref + 'p' + i + '" src="http://www.upconcert.com/img/etoile/grey.gif" width="14" height="13" border="0" alt="" onMouseOver="setEtoile(' + ref + ', ' + i + ')" onMouseOut="setEtoile(' + ref + ', 0)" /></a>');
		}
	}
	
	function trim (chaine) {
		return chaine.replace(/^\s+/g,'').replace(/\s+$/g,'')
	}

	function in_array(needle, haystack) {
		var key = '';

		for (key in haystack) {
			if (haystack[key] == needle) {
				return true;
			}
		}
		return false;
	}

	function addslashes(ch) {
		ch = ch.replace(/\\/g,"\\\\")
		ch = ch.replace(/\'/g,"\\'")
		ch = ch.replace(/\"/g,"\\\"")
		return ch
	}

	function tab(genre, step) {
		if (step == 'on') {
			DivOff(genre + '_off');
			DivOn2(genre + '_on');
		} else {
			DivOff(genre + '_on');
			DivOn2(genre + '_off');
		}
	}

	function trim(myString) {
		return myString.replace(/^\s+/g,'').replace(/\s+$/g,'');
	}

	function timestamp() {
		return Math.round(Math.random()*10000000000);
	}

	function EventOn(url) {
		var params = '';
		var postop = 0;
		if (url.indexOf('?') != -1) {
			params = url.substring(url.indexOf('?') + 1, url.length);
		}

		postop = document.body.scrollTop + document.documentElement.scrollTop;
		if (document.body) { iHauteur = (document.body.clientHeight); } else { iHauteur = (window.innerHeight); }

		if (document.getElementById('event').style.display != 'block') {
			document.getElementById('event').style.display = 'block';
			document.getElementById('eventbg').style.display = 'block';
			document.getElementById('event').style.top = (postop + (getWindowHeight() / 4)) + 'px';
		} else {
			window.location.href = "#event";
		}

		document.getElementById('eventbg').style.height = iHauteur + 'px';
		document.getElementById("eventbg").style.opacity = 0.6; 
		document.getElementById("eventbg").style.filter = 'alpha(opacity=60)';
		document.getElementById("eventbg").style.MozOpacity = 0.6;

		document.getElementById('eventframe').innerHTML = '<img src="http://www.upconcert.com/img/loading.gif" width="16" height="16" border="0" style="vertical-align: middle;" /><h5> Chargement...</h5>';
		new Ajax.Request(url,{method:'post',onSuccess:function(xhr){document.getElementById('eventframe').innerHTML = xhr.responseText;AddScript(document.getElementById('eventframe'));},onFailure:function(){document.getElementById('eventframe').innerHTML = '<h5 style="color: #F00;">Une erreur est survenue</h5>';}, parameters:params})
	}

	function EventOff() {
		DivOff('eventbg,event');
	}

	function error_message(message) {
		var text = ''; var img = ''; var color = '';
		if (message.substring(0, 4) == '[PB]') {
			img = '<img src="http://www.upconcert.com/img/icon/error_24.gif" width="24" height="24" border="0" alt="" style="vertical-align: middle;" />';
			color = 'C20000';
			message = message.substring(4, message.length);
		} else if (message.substring(0, 4) == '[OK]') {
			img = '<img src="http://www.upconcert.com/img/icon/check_24.gif" width="24" height="24" border="0" alt="" style="vertical-align: middle;" />';
			color = '390';
			message = message.substring(4, message.length);
		} else {
			color = '999';
		}
		text += '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>';
		if (img != '') {
			text += '<td width="24" style="padding: 5px;">' + img + '</td>';
		}
		text += '<td style="padding: 5px; background: #' + color + ';"><h4 style="color: #FFF;"><b>' + message + '</b></h4></td></tr></table>';
		return text;
	}

	function SignIn() {
		document.getElementById('eventmessage').innerHTML = '<img src="http://www.upconcert.com/img/loading.gif" width="16" height="16" border="0" style="vertical-align: middle;" /><h5> Chargement...</h5>';
		new Ajax.Request('/compte/auth.ajax.html',{method:'post',onSuccess:function(xhr){if(xhr.responseText=='1'){EventOn(document.getElementById('signinurl').value)}else{document.getElementById('eventmessage').innerHTML = error_message('[PB]Votre adresse e-mail et/ou votre mot de passe sont incorrects.');}},onFailure:function(){document.getElementById('eventmessage').innerHTML = error_message('[PB]Une erreur est survenue');}, parameters:'email=' + document.getElementById('signinemail').value + '&password=' + document.getElementById('signinpassword').value})
	}
	
	function showlist(id, list) {
		var DivArray;
		var i;
		var divid;
		
		DivArray = list.split(",")

		for (i = 0; i < DivArray.length; i++) {
			divid = id + DivArray[i];
			getElementDiv(divid).style.display = (getElementDiv(divid).style.display == "none" ? "block" : "none");
		}
	}
	
	function selectlist(id, list, flag) {
		var DivArray;
		var i;
		
		DivArray = list.split(",")

		for (i = 0; i < DivArray.length; i++) {
			getElementDiv(id + DivArray[i]).checked = flag;
		}
	}

	function postcritique(idconcert) {
		if (trim(document.getElementById('critiquetitle').value) != '' && trim(document.getElementById('critiquebody').value) != '') {
			document.getElementById('buttoncritique').innerHTML = '<img src="http://www.upconcert.com/img/loading.gif" width="16" height="16" border="0" style="vertical-align: middle;" /><h5> Envoi en cours...</h5>';
			new Ajax.Request('/compte/agenda/ajax/critique.ajax.html',{method:'post',onSuccess:function(xhr){document.getElementById('eventframe').innerHTML = xhr.responseText;},onFailure:function(){document.getElementById('eventmessage').innerHTML = error_message('[PB]Une erreur est survenue');}, parameters:'idconcert=' + idconcert + '&titre=' + encodeURIComponent(document.getElementById('critiquetitle').value) + '&corps=' + encodeURIComponent(document.getElementById('critiquebody').value)})
		} else {
			alert('Vous devez écrire un titre et une critique');
		}
	}

	function AddScript(object) {
		var d = object.getElementsByTagName("script");
		var t = d.length;
		for (var x = 0; x < t; x++) {
			var newScript = document.createElement('script');
			newScript.type = "text/javascript";
			newScript.text = d[x].text;
			object.appendChild (newScript);
		}
	}

	function SelectShow(id){
		if (document.getElementById(id).style.display == 'none') {
			document.getElementById(id).style.display = 'block';
			divactive = id;
		} else {
			document.getElementById(id).style.display = 'none';
		}
	}

	function SelectSet(type, id, text){
		document.getElementById('i' + type).value = id;
		document.getElementById('t' + type).innerHTML = '<h5>' + text + '</h5>';
	}

	function getWindowHeight() {
		var windowHeight=0;
		if (typeof(window.innerHeight)=='number') {
			windowHeight=window.innerHeight;
		} else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			} else {
				if (document.body&&document.body.clientHeight) {
					windowHeight=document.body.clientHeight;
				}
			}
		}
		return windowHeight;
	}

	function getConcert(artiste, ville, id) {
		var url = '/concert/';
		url += artiste + '-';
		url += ville + '-';
		url += id;
		window.location.href = url;
	}

	function getConcert2(param1, param2) {
		var url = param1 + '/';
		url += param2;
		window.location.href = url;
	}

	function getArtiste(artiste) {
		var url = '/artiste/';
		url += artiste;
		window.location.href = url;
	}

	var tabdiv = new Array();
	var divactive = '';
	document.onclick=checkdivactive;

	/* ---------------------------- */
	/* XMLHTTPRequest Enable 		*/
	/* ---------------------------- */
	function createObject() {
		var request_type;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
		request_type = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			request_type = new XMLHttpRequest();
		}
			return request_type;
	}

	var http = createObject();

	/* -------------------------- */
	/* SEARCH					 */
	/* -------------------------- */
	function autosuggest(urlsearch, urlaction, id, page) {
		var url = '';
		var query = '';
		var divresults = 'div' + id;

		if (page == '' || page == undefined) { page = 1; }

		document.getElementById(divresults).innerHTML = '<h5><img src="http://www.upconcert.com/img/loading.gif" width="16" height="16" border="0" style="vertical-align: middle;" /> Recherche en cours...</h5>';

		// Set the random number to add to URL request
		nocache = Math.random();
		if (urlsearch.indexOf('?') == '-1') {
			urlsearch = urlsearch + '?id=' + nocache;
 		}
		if (urlaction == '') {
			urlaction = 'javascript:fillinput(\'' + id + '\', \'#id#\', \'#value#\');';
		}
		query = document.getElementById('input' + id).value;
		while (query.indexOf('+') != '-1') {
			query = trim(String(query).substring(query.indexOf('+') + 1, query.length));
		}
		http.open('get', urlsearch + '&divid=' + id + '&q=' + encodeURIComponent(query) + '&page=' + page + '&nocache = ' + nocache + '&url=' + encodeURIComponent(urlaction));
		http.onreadystatechange = function() {
			if(http.readyState == 4){
				var response = http.responseText;
				e = document.getElementById(divresults);
				if(response!=""){
					e.innerHTML=response;
					e.style.display="block";
				} else {
					e.style.display="none";
				}
			}
		}
		http.send(null);
	}

	function fillinput(id, valueid, value){
		var text = document.getElementById('input' + id).value;
		var myArray;
		var fvalue = '';
		myArray = text.split("+")

		for (i = 0; i < myArray.length - 1; i++) {
			if (fvalue != '') {
				fvalue += ' + ';
			}
			fvalue += trim(myArray[i]);
		}

		if (fvalue != '') {
			fvalue += ' + ' + value;
		} else {
			fvalue = value;
		}
		document.getElementById('input' + id).value = fvalue;
		document.getElementById('id' + id).value = valueid;
		document.getElementById('div' + id).style.display = 'none';
		document.getElementById('input' + id).focus();
		return void(0);
	}

	function checkdivactive(){
		for (i = 0; i < tabdiv.length; i++) {
			if(divactive != tabdiv[i]){
				if (document.getElementById(tabdiv[i])) {
					document.getElementById(tabdiv[i]).style.display = 'none';
				}
			}
		}
		divactive = '';
	}
	var idselect = '';
	var acmotcle = '';
	var aclist = new Array();

	function AutoCompletionArtiste(e, object, action) {
		var evt = window.event? event : e;
		
		if (document.getElementById('i' + object).value == '') {
			document.getElementById('d' + object).innerHTML = '';
			document.getElementById('d' + object).style.display = 'none';
		} else {
			document.getElementById('d' + object).style.display = 'block';
		}

		// Touche entrée
		if (evt.keyCode == 13 && idselect != '') {
			eval(action);
		// Flèche bas
		} else if (evt.keyCode == 40 && idselect != '') {
			ACChooseArtiste(parseInt(idselect) + 1);
		// Flèche haut
		} else if (evt.keyCode == 38 && idselect != '') {
			ACChooseArtiste(parseInt(idselect) - 1);
		} else if (document.getElementById('i' + object).value != acmotcle && document.getElementById('i' + object).value != '') {
			acmotcle = document.getElementById('i' + object).value;
			document.getElementById('d' + object).innerHTML = '<img src="http://www.upconcert.com/img/loading.gif" width="16" height="16" border="0" style="vertical-align: middle;" /><h5> Chargement...</h5>';
			new Ajax.Request('/recherche/ajax/ac_artiste.ajax.html',{method:'post',onSuccess:function(xhr){document.getElementById('d' + object).innerHTML = xhr.responseText;AddScript(document.getElementById('d' + object));ACChooseArtiste();},onFailure:function(){document.getElementById('d' + object).style.display = 'none';}, parameters:'motcle=' + encodeURIComponent(document.getElementById('i' + object).value) + '&js=' + encodeURIComponent(action)})
		}
	}

	function ACChooseArtiste(id) {
		if (id == '' || id == undefined) { id = '0'; }
		if (document.getElementById('ac' + id)) { 
			if (document.getElementById('ac' + idselect)) { document.getElementById('ac' + idselect).className = ''; }
			idselect = id;
			document.getElementById('ac' + id).className = 'on';
		}
	}

	function ACDeleteArtiste(id, object) {
		var text = '';
		var aclisttmp = new Array();
		if (aclist.length > 0) {
			for (i = 0; i < aclist.length; i++) {
				tab = aclist[i].split('|@|');
				if (id != tab[0]) {
					aclisttmp.push(aclist[i]);;
				}
			}
			aclist = aclisttmp;
		}
		ACShowSelect(object);
	}

	function ACSelectArtiste(object, value) {
		if (document.getElementById('iac' + idselect)) {
			if (!in_array(document.getElementById('iac' + idselect).value, aclist)) { 
				aclist.push(document.getElementById('iac' + idselect).value);
			}
		} else if (value != '') {
			if (!in_array(value, aclist)) { 
				aclist.push(value);
			}
		}

		document.getElementById('d' + object).innerHTML = '';
		document.getElementById('d' + object).style.display = 'none';
		acmotcle = '';
		document.getElementById('i' + object).value = '';

		ACShowSelect(object)
	}

	function ACShowSelect(object) {
		var text = '';
		var listref = '';
		if (aclist.length > 0) {
			for (i = 0; i < aclist.length; i++) {
				tab = aclist[i].split('|@|');
				text += '<table border="0" cellpadding="0" cellspacing="0" style="margin-right: 5px; margin-bottom: 3px; float: left;"><tr><td valign="top"><img src="http://www.upconcert.com/img/ac/ac_left_off.gif" width="13" height="14" border="0" style="cursor: hand; cursor: pointer;" onMouseOver="this.src=\'http://www.upconcert.com/img/ac/ac_left_on.gif\'" onMouseOut="this.src=\'http://www.upconcert.com/img/ac/ac_left_off.gif\'" onClick="ACDeleteArtiste(' + tab[0] + ', \'' + object + '\')" /></td><td style="background: url(http://www.upconcert.com/img/ac/ac_bg.gif) repeat-x top; padding: 0px 2px;" nowrap="nowrap"><h5 style="color: #FFF;">' + tab[1] + '</h5></td><td valign="top"><img src="http://www.upconcert.com/img/ac/ac_right.gif" width="1" height="14" border="0" /></td></tr></table>';
				if (listref != '') { listref += ','; }
				listref += tab[0];
			}
		}
		document.getElementById('r' + object).innerHTML = text;
		document.getElementById('r' + object).style.display = 'block';
		document.getElementById(object).value = listref;
	}

	document.write('<scr' + 'ipt type="text/javascript" src="' + VGJS + '/json/area.js"></scr' + 'ipt>');
	var nbarea = 4;
	var tabarea = new Array();

	function ShowArea(name, id) {
		if (id == undefined) { id = ''; }
		document.write('<input id="i' + name + '" type="hidden" name="' + name + '" value="" />');
		for (var i = 0; i < nbarea; i++) {
			document.write('<div id="z' + name + '_' + i + '" style="display: inline;"></div>');
		}

		if (id != '') {
			var tab = id.split('-');
			for (var i = 0; i < tab.length; i++) {
				tabarea[i] = tab[i];
			}
		}

		SetArea(name);
		for (var i = 0; i < tabarea.length; i++) {
			if (tabarea[i] != '') {
				SetArea(name, tabarea[i], i + 1);
			}
		}
	}

	function SetArea(name, id, cpt) {
		if (cpt == '' || cpt == undefined) { cpt = '0'; }
		if (id == undefined || id == '0') { id = ''; }
		var ident = name + '_' + cpt;
		var tab = document.getElementById('i' + name).value.split('-');
		var setid = '';


		for (var i = 0; i < nbarea; i++) {
			if (i < cpt - 1) {
				if (setid != '') { setid += '-'; }
				if (tab[i] == undefined) { tab[i] = ''; }
				setid += tab[i];
			} else if (i >= cpt) {
				document.getElementById('z' + name + '_' + i).innerHTML = '';
			}
		}
		if (setid != '') { setid += '-'; }
		setid += id;
		document.getElementById('i' + name).value = setid;

		tabdiv.push('select' + ident);

		var str = '';
		str = '<div style="display: inline;">';

		if (cpt < nbarea && ((cpt == 0 && id == '') || (cpt > 0 && id != ''))) {
			var object = eval('jarea' + id);

			if (object) {
				while (object.length <= 2 && cpt < nbarea - 1) {
					var object = eval('jarea' + object[1].ref);
					cpt++;
				} 
				if (object.length > 2) { 
					var txtdefault = '';
					if (cpt > 0) {
						str += '<img src="' + VGIMG + '/fleche_droite.gif" width="7" height="9" border="0" alt="" style="margin: 0px 5px;" />';
					}
					str += '<span class="select" onClick="SelectShow(\'select' + ident + '\')"><span id="t' + ident + '"><h5>' + object[0].name + '</h5></span><img id="select' + ident + '_fleche" src="' + VGIMG + '/fleche_off.gif" width="13" height="14" border="0" style="vertical-align: middle; margin-left: 2px;" onMouseOver="this.src=\'' + VGIMG + '/fleche_on.gif\'" onMouseOut="this.src=\'' + VGIMG + '/fleche_off.gif\'" />';
					str += '<div id="select' + ident + '" style="z-index: 101; position: absolute; border: dashed 1px #999; margin-left: -2px; background: #FFF; padding: 1px; display: none;">';
					for (var i = 0; i < object.length; i++) {
						var item = object[i];

						if (tabarea[cpt] == item.ref) {
							txtdefault = '<h5>' + addslashes(item.name) + '</h5>';
						}

						str += '<div class="selectelt" onClick="document.getElementById(\'t' + ident + '\').innerHTML=\'<h5>' + addslashes(item.name) + '</h5>\';SetArea(\'' + name + '\', ' + item.ref + ', ' + (+cpt + 1) + ')"><h5>' + item.name + '</h5></div>';
					}
					str += '</div>';
		
					str += '</div>';
					document.getElementById('z' + ident).innerHTML = str;
					if (txtdefault != '') {
						document.getElementById('t' + ident).innerHTML = '<h5>' + addslashes(txtdefault) + '</h5>';
					}
				}
			}
		}
	}

	eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(J(){7(1f.18)L u=1f.18;L v=1f.18=J(a,b){K 1D v.2i.4D(a,b)};7(1f.$)L w=1f.$;1f.$=v;L x=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;L y=/^.[^:#\\[\\.]*$/;v.1i=v.2i={4D:J(a,b){a=a||S;7(a.15){6[0]=a;6.M=1;K 6}N 7(1t a=="29"){L c=x.2N(a);7(c&&(c[1]||!b)){7(c[1])a=v.53([c[1]],b);N{L d=S.5x(c[3]);7(d)7(d.2u!=c[3])K v().2v(a);N{6[0]=d;6.M=1;K 6}N a=[]}}N K 1D v(b).2v(a)}N 7(v.1r(a))K 1D v(S)[v.1i.22?"22":"3Q"](a);K 6.6y(a.1n==1L&&a||(a.59||a.M&&a!=1f&&!a.15&&a[0]!=Y&&a[0].15)&&v.2E(a)||[a])},59:"1.2.7X",7U:J(){K 6.M},M:0,1Z:J(a){K a==Y?v.2E(6):6[a]},2I:J(a){L b=v(a);b.4S=6;K b},6y:J(a){6.M=0;1L.2i.1h.1g(6,a);K 6},V:J(a,b){K v.V(6,a,b)},4K:J(a){L b=-1;6.V(J(i){7(6==a)b=i});K b},1G:J(a,b,c){L d=a;7(a.1n==47)7(b==Y)K 6.M&&v[c||"1G"](6[0],a)||Y;N{d={};d[a]=b}K 6.V(J(i){Q(a 1o d)v.1G(c?6.W:6,a,v.1m(6,d[a],c,i,a))})},1l:J(a,b){7((a==\'28\'||a==\'1O\')&&2F(b)<0)b=Y;K 6.1G(a,b,"2p")},23:J(a){7(1t a!="4w"&&a!=12)K 6.4t().3o((6[0]&&6[0].2k||S).5q(a));L b="";v.V(a||6,J(){v.V(6.3r,J(){7(6.15!=8)b+=6.15!=1?6.6C:v.1i.23([6])})});K b},5g:J(b){7(6[0])v(b,6[0].2k).5f().3n(6[0]).2c(J(){L a=6;2b(a.1w)a=a.1w;K a}).3o(6);K 6},8m:J(a){K 6.V(J(){v(6).6u().5g(a)})},8e:J(a){K 6.V(J(){v(6).5g(a)})},3o:J(){K 6.3v(1a,P,T,J(a){7(6.15==1)6.3j(a)})},6j:J(){K 6.3v(1a,P,P,J(a){7(6.15==1)6.3n(a,6.1w)})},6i:J(){K 6.3v(1a,T,T,J(a){6.1b.3n(a,6)})},4Z:J(){K 6.3v(1a,T,P,J(a){6.1b.3n(a,6.2J)})},3g:J(){K 6.4S||v([])},2v:J(b){L c=v.2c(6,J(a){K v.2v(b,a)});K 6.2I(/[^+>] [^+>]/.17(b)||b.1k("..")>-1?v.4W(c):c)},5f:J(d){L e=6.2c(J(){7(v.14.1e&&!v.3E(6)){L a=6.65(P),5l=S.35("1v"),4L=S.35("1v");5l.3j(a);4L.38=5l.38;K 4L.1w}N K 6.65(P)});L f=e.2v("*").4F().V(J(){7(6[A]!=Y)6[A]=12});7(d===P)6.2v("*").4F().V(J(i){L a=v.R(6,"32");Q(L b 1o a)Q(L c 1o a[b])v.16.1c(f[i],b,a[b][c],a[b][c].R)});K e},1C:J(b){K 6.2I(v.1r(b)&&v.3B(6,J(a,i){K b.1M(a,i)})||v.3e(b,6))},5G:J(a){7(a.1n==47)7(y.17(a))K 6.2I(v.3e(a,6,P));N a=v.3e(a,6);L b=a.M&&a[a.M-1]!==Y&&!a.15;K 6.1C(J(){K b?v.2W(6,a)<0:6!=a})},1c:J(a){K!a?6:6.2I(v.2U(6.1Z(),a.1n==47?v(a).1Z():a.M!=Y&&(!a.11||v.11(a,"39"))?a:[a]))},3N:J(a){K a?v.3e(a,6).M>0:T},9Y:J(a){K 6.3N("."+a)},76:J(b){7(b==Y){7(6.M){L c=6[0];7(v.11(c,"2o")){L d=c.42,5y=[],10=c.10,2X=c.U=="2o-2X";7(d<0)K 12;Q(L i=2X?d:0,24=2X?d+1:10.M;i<24;i++){L e=10[i];7(e.2r){b=v.14.1e&&!e.9m.1B.9f?e.23:e.1B;7(2X)K b;5y.1h(b)}}K 5y}N K(6[0].1B||"").1p(/\\r/g,"")}K Y}K 6.V(J(){7(6.15!=1)K;7(b.1n==1L&&/5k|5j/.17(6.U))6.3q=(v.2W(6.1B,b)>=0||v.2W(6.2T,b)>=0);N 7(v.11(6,"2o")){L a=b.1n==1L?b:[b];v("8V",6).V(J(){6.2r=(v.2W(6.1B,a)>=0||v.2W(6.23,a)>=0)});7(!a.M)6.42=-1}N 6.1B=b})},4r:J(a){K a==Y?(6.M?6[0].38:12):6.4t().3o(a)},6K:J(a){K 6.4Z(a).1T()},6H:J(i){K 6.2Y(i,i+1)},2Y:J(){K 6.2I(1L.2i.2Y.1g(6,1a))},2c:J(b){K 6.2I(v.2c(6,J(a,i){K b.1M(a,i,a)}))},4F:J(){K 6.1c(6.4S)},3v:J(d,e,f,g){L h=6.M>1,3s;K 6.V(J(){7(!3s){3s=v.53(d,6.2k);7(f)3s.8C()}L b=6;7(e&&v.11(6,"1S")&&v.11(3s[0],"4p"))b=6.3O("1U")[0]||6.3j(6.2k.35("1U"));L c=v([]);v.V(3s,J(){L a=h?v(6).5f(P)[0]:6;7(v.11(a,"1q")){c=c.1c(a)}N{7(a.15==1)c=c.1c(v("1q",a).1T());g.1M(b,a)}});c.V(6x)})}};v.2i.4D.2i=v.2i;J 6x(i,a){7(a.3M)v.3L({1d:a.3M,3m:T,1V:"1q"});N v.5c(a.23||a.6v||a.38||"");7(a.1b)a.1b.36(a)}v.1s=v.1i.1s=J(){L a=1a[0]||{},i=1,M=1a.M,58=T,10;7(a.1n==8c){58=a;a=1a[1]||{};i=2}7(1t a!="4w"&&1t a!="J")a={};7(M==1){a=6;i=0}Q(;i<M;i++)7((10=1a[i])!=12)Q(L b 1o 10){7(a===10[b])6s;7(58&&10[b]&&1t 10[b]=="4w"&&a[b]&&!10[b].15)a[b]=v.1s(a[b],10[b]);N 7(10[b]!=Y)a[b]=10[b]}K a};L A="18"+(1D 3t()).3J(),6p=0,55={};L B=/z-?4K|86-?85|1x|6k|80-?1O/i;v.1s({7Z:J(a){1f.$=w;7(a)1f.18=u;K v},1r:J(a){K!!a&&1t a!="29"&&!a.11&&a.1n!=1L&&/J/i.17(a+"")},3E:J(a){K a.1F&&!a.1j||a.26&&a.2k&&!a.2k.1j},5c:J(a){a=v.3i(a);7(a){L b=S.3O("6d")[0]||S.1F,1q=S.35("1q");1q.U="23/7T";7(v.14.1e)1q.23=a;N 1q.3j(S.5q(a));b.3j(1q);b.36(1q)}},11:J(a,b){K a.11&&a.11.2C()==b.2C()},1N:{},R:J(a,b,c){a=a==1f?55:a;L d=a[A];7(!d)d=a[A]=++6p;7(b&&!v.1N[d])v.1N[d]={};7(c!=Y)v.1N[d][b]=c;K b?v.1N[d][b]:d},3G:J(a,b){a=a==1f?55:a;L c=a[A];7(b){7(v.1N[c]){2S v.1N[c][b];b="";Q(b 1o v.1N[c])2d;7(!b)v.3G(a)}}N{1P{2S a[A]}1Q(e){7(a.4V)a.4V(A)}2S v.1N[c]}},V:J(a,b,c){7(c){7(a.M==Y)Q(L d 1o a)b.1g(a[d],c);N Q(L i=0,M=a.M;i<M;i++)7(b.1g(a[i],c)===T)2d}N{7(a.M==Y)Q(L d 1o a)b.1M(a[d],d,a[d]);N Q(L i=0,M=a.M,1B=a[0];i<M&&b.1M(1B,i,1B)!==T;1B=a[++i]){}}K a},1m:J(a,b,c,i,d){7(v.1r(b))b=b.1M(a,i);K b&&b.1n==4T&&c=="2p"&&!B.17(d)?b+"2Q":b},1u:{1c:J(b,c){v.V((c||"").2a(/\\s+/),J(i,a){7(b.15==1&&!v.1u.3S(b.1u,a))b.1u+=(b.1u?" ":"")+a})},1T:J(b,c){7(b.15==1)b.1u=c!=Y?v.3B(b.1u.2a(/\\s+/),J(a){K!v.1u.3S(c,a)}).68(" "):""},3S:J(a,b){K v.2W(b,(a.1u||a).3U().2a(/\\s+/))>-1}},66:J(a,b,c){L d={};Q(L e 1o b){d[e]=a.W[e];a.W[e]=b[e]}c.1M(a);Q(L e 1o b)a.W[e]=d[e]},1l:J(b,c,d){7(c=="28"||c=="1O"){L e,3V={3D:"4O",4N:"1Y",19:"40"},3d=c=="28"?["7K","7J"]:["7I","7H"];J 4I(){e=c=="28"?b.7G:b.7E;L a=0,2L=0;v.V(3d,J(){a+=2F(v.2p(b,"7C"+6,P))||0;2L+=2F(v.2p(b,"2L"+6+"5V",P))||0});e-=1X.7z(a+2L)}7(v(b).3N(":45"))4I();N v.66(b,3V,4I);K 1X.24(0,e)}K v.2p(b,c,d)},2p:J(c,d,e){L f;J 3x(a){7(!v.14.25)K T;L b=S.46.4A(a,12);K!b||b.4B("3x")==""}7(d=="1x"&&v.14.1e){f=v.1G(c.W,"1x");K f==""?"1":f}7(v.14.2z&&d=="19"){L g=c.W.19;c.W.19="40";c.W.19=g}7(d.1A(/4e/i))d=D;7(!e&&c.W[d])f=c.W[d];N 7(S.46&&S.46.4A){7(d.1A(/4e/i))d="4e";d=d.1p(/([A-Z])/g,"-$1").2g();L h=S.46.4A(c,12);7(h&&!3x(c))f=h.4B(d);N{L j=[],2B=[];Q(L a=c;a&&3x(a);a=a.1b)2B.4M(a);Q(L i=0;i<2B.M;i++)7(3x(2B[i])){j[i]=2B[i].W.19;2B[i].W.19="40"}f=d=="19"&&j[2B.M-1]!=12?"2R":(h&&h.4B(d))||"";Q(L i=0;i<j.M;i++)7(j[i]!=12)2B[i].W.19=j[i]}7(d=="1x"&&f=="")f="1"}N 7(c.4m){L k=d.1p(/\\-(\\w)/g,J(a,b){K b.2C()});f=c.4m[d]||c.4m[k];7(!/^\\d+(2Q)?$/i.17(f)&&/^\\d/.17(f)){L l=c.W.2f,3u=c.3u.2f;c.3u.2f=c.4m.2f;c.W.2f=f||0;f=c.W.7h+"2Q";c.W.2f=l;c.3u.2f=3u}}K f},53:J(h,k){L l=[];k=k||S;7(1t k.35==\'Y\')k=k.2k||k[0]&&k[0].2k||S;v.V(h,J(i,d){7(!d)K;7(d.1n==4T)d=d.3U();7(1t d=="29"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,J(a,b,c){K c.1A(/^(7e|7d|5J|7c|4k|79|9V|3l|9R|9P)$/i)?a:b+"></"+c+">"});L e=v.3i(d).2g(),1v=k.35("1v");L f=!e.1k("<9N")&&[1,"<2o 74=\'74\'>","</2o>"]||!e.1k("<9K")&&[1,"<73>","</73>"]||e.1A(/^<(9F|1U|9D|9B|9y)/)&&[1,"<1S>","</1S>"]||!e.1k("<4p")&&[2,"<1S><1U>","</1U></1S>"]||(!e.1k("<9x")||!e.1k("<9w"))&&[3,"<1S><1U><4p>","</4p></1U></1S>"]||!e.1k("<5J")&&[2,"<1S><1U></1U><6X>","</6X></1S>"]||v.14.1e&&[1,"1v<1v>","</1v>"]||[0,"",""];1v.38=f[1]+d+f[2];2b(f[0]--)1v=1v.5r;7(v.14.1e){L g=!e.1k("<1S")&&e.1k("<1U")<0?1v.1w&&1v.1w.3r:f[1]=="<1S>"&&e.1k("<1U")<0?1v.3r:[];Q(L j=g.M-1;j>=0;--j)7(v.11(g[j],"1U")&&!g[j].3r.M)g[j].1b.36(g[j]);7(/^\\s/.17(d))1v.3n(k.5q(d.1A(/^\\s*/)[0]),1v.1w)}d=v.2E(1v.3r)}7(d.M===0&&(!v.11(d,"39")&&!v.11(d,"2o")))K;7(d[0]==Y||v.11(d,"39")||d.10)l.1h(d);N l=v.2U(l,d)});K l},1G:J(c,d,e){7(!c||c.15==3||c.15==8)K Y;L f=v.3E(c)?{}:v.3V;7(d=="2r"&&v.14.25)c.1b.42;7(f[d]){7(e!=Y)c[f[d]]=e;K c[f[d]]}N 7(v.14.1e&&d=="W")K v.1G(c.W,"9v",e);N 7(e==Y&&v.14.1e&&v.11(c,"39")&&(d=="9r"||d=="9o"))K c.9l(d).6C;N 7(c.26){7(e!=Y){7(d=="U"&&v.11(c,"4k")&&c.1b)6U"U 9i 9g\'t 9e 9d";c.9a(d,""+e)}7(v.14.1e&&/6R|3M/.17(d)&&!v.3E(c))K c.4u(d,2);K c.4u(d)}N{7(d=="1x"&&v.14.1e){7(e!=Y){c.6k=1;c.1C=(c.1C||"").1p(/6P\\([^)]*\\)/,"")+(2F(e).3U()=="95"?"":"6P(1x="+e*6O+")")}K c.1C&&c.1C.1k("1x=")>=0?(2F(c.1C.1A(/1x=([^)]*)/)[1])/6O).3U():""}d=d.1p(/-([a-z])/94,J(a,b){K b.2C()});7(e!=Y)c[d]=e;K c[d]}},3i:J(a){K(a||"").1p(/^\\s+|\\s+$/g,"")},2E:J(a){L b=[];7(1t a!="93")Q(L i=0,M=a.M;i<M;i++)b.1h(a[i]);N b=a.2Y(0);K b},2W:J(a,b){Q(L i=0,M=b.M;i<M;i++)7(b[i]==a)K i;K-1},2U:J(a,b){7(v.14.1e){Q(L i=0;b[i];i++)7(b[i].15!=8)a.1h(b[i])}N Q(L i=0;b[i];i++)a.1h(b[i]);K a},4W:J(a){L b=[],2h={};1P{Q(L i=0,M=a.M;i<M;i++){L c=v.R(a[i]);7(!2h[c]){2h[c]=P;b.1h(a[i])}}}1Q(e){b=a}K b},3B:J(a,b,c){7(1t b=="29")b=4s("T||J(a,i){K "+b+"}");L d=[];Q(L i=0,M=a.M;i<M;i++)7(!c&&b(a[i],i)||c&&!b(a[i],i))d.1h(a[i]);K d},2c:J(a,b){L c=[];Q(L i=0,M=a.M;i<M;i++){L d=b(a[i],i);7(d!==12&&d!=Y){7(d.1n!=1L)d=[d];c=c.6M(d)}}K c}});L C=8W.8U.2g();v.14={5D:(C.1A(/.+(?:8R|8Q|8P|8O)[\\/: ]([\\d.]+)/)||[])[1],25:/6J/.17(C),2z:/2z/.17(C),1e:/1e/.17(C)&&!/2z/.17(C),41:/41/.17(C)&&!/(8L|6J)/.17(C)};L D=v.14.1e?"6G":"6F";v.1s({8I:!v.14.1e||S.6D=="77",3V:{"Q":"8F","8D":"1u","4e":D,6F:D,6G:D,38:"38",1u:"1u",1B:"1B",31:"31",3q:"3q",8B:"8A",2r:"2r",8z:"8y",42:"42",6A:"6A",26:"26",11:"11"}});v.V({6z:"O.1b",8x:"18.4o(O,\'1b\')",8w:"18.2Z(O,2,\'2J\')",8v:"18.2Z(O,2,\'4n\')",8u:"18.4o(O,\'2J\')",8t:"18.4o(O,\'4n\')",8s:"18.5e(O.1b.1w,O)",8r:"18.5e(O.1w)",6u:"18.11(O,\'8q\')?O.8p||O.8o.S:18.2E(O.3r)"},J(c,d){d=4s("T||J(O){K "+d+"}");v.1i[c]=J(a){L b=v.2c(6,d);7(a&&1t a=="29")b=v.3e(a,b);K 6.2I(v.4W(b))}});v.V({6w:"3o",8n:"6j",3n:"6i",8l:"4Z",8k:"6K"},J(b,c){v.1i[b]=J(){L a=1a;K 6.V(J(){Q(L i=0,M=a.M;i<M;i++)v(a[i])[c](6)})}});v.V({8j:J(a){v.1G(6,a,"");7(6.15==1)6.4V(a)},8i:J(a){v.1u.1c(6,a)},8h:J(a){v.1u.1T(6,a)},8g:J(a){v.1u[v.1u.3S(6,a)?"1T":"1c"](6,a)},1T:J(a){7(!a||v.1C(a,[6]).r.M){v("*",6).1c(6).V(J(){v.16.1T(6);v.3G(6)});7(6.1b)6.1b.36(6)}},4t:J(){v(">*",6).1T();2b(6.1w)6.36(6.1w)}},J(a,b){v.1i[a]=J(){K 6.V(b,1a)}});v.V(["8f","5V"],J(i,b){L c=b.2g();v.1i[c]=J(a){K 6[0]==1f?v.14.2z&&S.1j["5a"+b]||v.14.25&&1f["8d"+b]||S.6D=="77"&&S.1F["5a"+b]||S.1j["5a"+b]:6[0]==S?1X.24(1X.24(S.1j["57"+b],S.1F["57"+b]),1X.24(S.1j["56"+b],S.1F["56"+b])):a==Y?(6.M?v.1l(6[0],c):12):6.1l(c,a.1n==47?a:a+"2Q")}});L E=v.14.25&&49(v.14.5D)<8b?"(?:[\\\\w*4j-]|\\\\\\\\.)":"(?:[\\\\w\\8a-\\89*4j-]|\\\\\\\\.)",6q=1D 4i("^>\\\\s*("+E+"+)"),6o=1D 4i("^("+E+"+)(#)("+E+"+)"),6n=1D 4i("^([#.]?)("+E+"*)");v.1s({54:{"":"m[2]==\'*\'||18.11(a,m[2])","#":"a.4u(\'2u\')==m[2]",":":{88:"i<m[3]-0",87:"i>m[3]-0",2Z:"m[3]-0==i",6H:"m[3]-0==i",3k:"i==0",3I:"i==r.M-1",6m:"i%2==0",6l:"i%2","3k-4g":"a.1b.3O(\'*\')[0]==a","3I-4g":"18.2Z(a.1b.5r,1,\'4n\')==a","84-4g":"!18.2Z(a.1b.5r,2,\'4n\')",6z:"a.1w",4t:"!a.1w",83:"(a.6v||a.82||18(a).23()||\'\').1k(m[3])>=0",45:\'"1Y"!=a.U&&18.1l(a,"19")!="2R"&&18.1l(a,"4N")!="1Y"\',1Y:\'"1Y"==a.U||18.1l(a,"19")=="2R"||18.1l(a,"4N")=="1Y"\',81:"!a.31",31:"a.31",3q:"a.3q",2r:"a.2r||18.1G(a,\'2r\')",23:"\'23\'==a.U",5k:"\'5k\'==a.U",5j:"\'5j\'==a.U",52:"\'52\'==a.U",51:"\'51\'==a.U",50:"\'50\'==a.U",6h:"\'6h\'==a.U",6g:"\'6g\'==a.U",2D:\'"2D"==a.U||18.11(a,"2D")\',4k:"/4k|2o|6f|2D/i.17(a.11)",3S:"18.2v(m[3],a).M",7W:"/h\\\\d/i.17(a.11)",7V:"18.3B(18.3H,J(1i){K a==1i.O;}).M"}},6e:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1D 4i("^([:.#]*)("+E+"+)")],3e:J(a,b,c){L d,2j=[];2b(a&&a!=d){d=a;L f=v.1C(a,b,c);a=f.t.1p(/^\\s*,\\s*/,"");2j=c?b=f.r:v.2U(2j,f.r)}K 2j},2v:J(t,a){7(1t t!="29")K[t];7(a&&a.15!=1&&a.15!=9)K[];a=a||S;L b=[a],2h=[],3I,11;2b(t&&3I!=t){L r=[];3I=t;t=v.3i(t);L d=T;L e=6q;L m=e.2N(t);7(m){11=m[1].2C();Q(L i=0;b[i];i++)Q(L c=b[i].1w;c;c=c.2J)7(c.15==1&&(11=="*"||c.11.2C()==11))r.1h(c);b=r;t=t.1p(e,"");7(t.1k(" ")==0)6s;d=P}N{e=/^([>+~])\\s*(\\w*)/i;7((m=e.2N(t))!=12){r=[];L f={};11=m[2].2C();m=m[1];Q(L j=0,3h=b.M;j<3h;j++){L n=m=="~"||m=="+"?b[j].2J:b[j].1w;Q(;n;n=n.2J)7(n.15==1){L g=v.R(n);7(m=="~"&&f[g])2d;7(!11||n.11.2C()==11){7(m=="~")f[g]=P;r.1h(n)}7(m=="+")2d}}b=r;t=v.3i(t.1p(e,""));d=P}}7(t&&!d){7(!t.1k(",")){7(a==b[0])b.4d();2h=v.2U(2h,b);r=b=[a];t=" "+t.6c(1,t.M)}N{L h=6o;L m=h.2N(t);7(m){m=[0,m[2],m[3],m[1]]}N{h=6n;m=h.2N(t)}m[2]=m[2].1p(/\\\\/g,"");L k=b[b.M-1];7(m[1]=="#"&&k&&k.5x&&!v.3E(k)){L l=k.5x(m[2]);7((v.14.1e||v.14.2z)&&l&&1t l.2u=="29"&&l.2u!=m[2])l=v(\'[@2u="\'+m[2]+\'"]\',k)[0];b=r=l&&(!m[3]||v.11(l,m[3]))?[l]:[]}N{Q(L i=0;b[i];i++){L o=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];7(o=="*"&&b[i].11.2g()=="4w")o="3l";r=v.2U(r,b[i].3O(o))}7(m[1]==".")r=v.4Y(r,m[2]);7(m[1]=="#"){L p=[];Q(L i=0;r[i];i++)7(r[i].4u("2u")==m[2]){p=[r[i]];2d}r=p}b=r}t=t.1p(h,"")}}7(t){L q=v.1C(t,r);b=r=q.r;t=v.3i(q.t)}}7(t)b=[];7(b&&a==b[0])b.4d();2h=v.2U(2h,b);K 2h},4Y:J(r,m,a){m=" "+m+" ";L b=[];Q(L i=0;r[i];i++){L c=(" "+r[i].1u+" ").1k(m)>=0;7(!a&&c||a&&!c)b.1h(r[i])}K b},1C:J(t,r,b){L d;2b(t&&t!=d){d=t;L p=v.6e,m;Q(L i=0;p[i];i++){m=p[i].2N(t);7(m){t=t.7S(m[0].M);m[2]=m[2].1p(/\\\\/g,"");2d}}7(!m)2d;7(m[1]==":"&&m[2]=="5G")r=y.17(m[3])?v.1C(m[3],r,P).r:v(r).5G(m[3]);N 7(m[1]==".")r=v.4Y(r,m[2],b);N 7(m[1]=="["){L e=[],U=m[3];Q(L i=0,3h=r.M;i<3h;i++){L a=r[i],z=a[v.3V[m[2]]||m[2]];7(z==12||/6R|3M|2r/.17(m[2]))z=v.1G(a,m[2])||\'\';7((U==""&&!!z||U=="="&&z==m[5]||U=="!="&&z!=m[5]||U=="^="&&z&&!z.1k(m[5])||U=="$="&&z.6c(z.M-m[5].M)==m[5]||(U=="*="||U=="~=")&&z.1k(m[5])>=0)^b)e.1h(a)}r=e}N 7(m[1]==":"&&m[2]=="2Z-4g"){L g={},e=[],17=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2N(m[3]=="6m"&&"2n"||m[3]=="6l"&&"2n+1"||!/\\D/.17(m[3])&&"7R+"+m[3]||m[3]),3k=(17[1]+(17[2]||1))-0,d=17[3]-0;Q(L i=0,3h=r.M;i<3h;i++){L h=r[i],1b=h.1b,2u=v.R(1b);7(!g[2u]){L c=1;Q(L n=1b.1w;n;n=n.2J)7(n.15==1)n.4c=c++;g[2u]=P}L j=T;7(3k==0){7(h.4c==d)j=P}N 7((h.4c-d)%3k==0&&(h.4c-d)/3k>=0)j=P;7(j^b)e.1h(h)}r=e}N{L f=v.54[m[1]];7(1t f!="29")f=v.54[m[1]][m[2]];f=4s("T||J(a,i){K "+f+"}");r=v.3B(r,f,b)}}K{r:r,t:t}},4o:J(a,b){L c=[];L d=a[b];2b(d&&d!=S){7(d.15==1)c.1h(d);d=d[b]}K c},2Z:J(a,b,c,d){b=b||1;L e=0;Q(;a;a=a[c])7(a.15==1&&++e==b)2d;K a},5e:J(n,a){L r=[];Q(;n;n=n.2J){7(n.15==1&&(!a||n!=a))r.1h(n)}K r}});v.16={1c:J(e,f,g,h){7(e.15==3||e.15==8)K;7(v.14.1e&&e.4X!=Y)e=1f;7(!g.2K)g.2K=6.2K++;7(h!=Y){L i=g;g=J(){K i.1g(6,1a)};g.R=h;g.2K=i.2K}L j=v.R(e,"32")||v.R(e,"32",{}),1E=v.R(e,"1E")||v.R(e,"1E",J(){L a;7(1t v=="Y"||v.16.4U)K a;a=v.16.1E.1g(e,1a);K a});v.V(f.2a(/\\s+/),J(a,b){L c=b.2a(".");b=c[0];g.U=c[1];L d=j[b];7(!d){d=j[b]={};7(!v.16.2y[b]||v.16.2y[b].4l.1M(e)===T){7(e.3K)e.3K(b,1E,T);N 7(e.6b)e.6b("4b"+b,1E)}}d[g.2K]=g;v.16.2e[b]=P})},2K:1,2e:{},1T:J(d,e,f){7(d.15==3||d.15==8)K;L g=v.R(d,"32"),3f,4K;7(g){7(e==Y)Q(L h 1o g)6.1T(d,h);N{7(e.U){f=e.2m;e=e.U}v.V(e.2a(/\\s+/),J(a,b){L c=b.2a(".");b=c[0];7(g[b]){7(f)2S g[b][f.2K];N Q(f 1o g[b])7(!c[1]||g[b][f].U==c[1])2S g[b][f];Q(3f 1o g[b])2d;7(!3f){7(!v.16.2y[b]||v.16.2y[b].4a.1M(d)===T){7(d.6a)d.6a(b,v.R(d,"1E"),T);N 7(d.69)d.69("4b"+b,v.R(d,"1E"))}3f=12;2S g[b]}}})}Q(3f 1o g)2d;7(!3f){v.3G(d,"32");v.3G(d,"1E")}}},1R:J(a,b,c,d,f){b=v.2E(b||[]);7(!c){7(6.2e[a])v("*").1c([1f,S]).1R(a,b)}N{7(c.15==3||c.15==8)K Y;L g,h,1i=v.1r(c[a]||12),16=!b[0]||!b[0].2P;7(16)b.4M(6.4R({U:a,2H:c}));b[0].U=a;7(v.1r(v.R(c,"1E")))g=v.R(c,"1E").1g(c,b);7(!1i&&c["4b"+a]&&c["4b"+a].1g(c,b)===T)g=T;7(16)b.4d();7(f&&v.1r(f)){L h=f.1g(c,b.6M(g));7(h!==Y)g=h}7(1i&&d!==T&&g!==T&&!(v.11(c,\'a\')&&a=="4Q")){6.4U=P;1P{c[a]()}1Q(e){}}6.4U=T}K g},1E:J(a){L b;a=v.16.4R(a||1f.16||{});L c=a.U.2a(".");a.U=c[0];L d=v.R(6,"32")&&v.R(6,"32")[a.U],3F=1L.2i.2Y.1M(1a,1);3F.4M(a);Q(L j 1o d){L e=d[j];3F[0].2m=e;3F[0].R=e.R;7(!c[1]||e.U==c[1]){L f=e.1g(6,3F);7(b!==T)b=f;7(f===T){a.2P();a.3X()}}}7(v.14.1e)a.2H=a.2P=a.3X=a.2m=a.R=12;K b},4R:J(a){7(a[A])K a;L b=a;a=v.1s({},b);a[A]=P;a.2P=J(){7(b.2P)b.2P();b.7Q=T};a.3X=J(){7(b.3X)b.3X();b.7P=P};7(!a.2H)a.2H=a.7O||S;7(a.2H.15==3)a.2H=b.2H.1b;7(!a.5H&&a.5t)a.5H=a.5t==a.2H?a.7N:a.5t;7(a.64==12&&a.63!=12){L c=S.1F,1j=S.1j;a.64=a.63+(c&&c.2t||1j&&1j.2t||0)-(c.62||0);a.7M=a.7L+(c&&c.2w||1j&&1j.2w||0)-(c.61||0)}7(!a.3d&&(a.60||a.5Z))a.3d=a.60||a.5Z;7(!a.5Y&&a.5X)a.5Y=a.5X;7(!a.3d&&a.2D)a.3d=(a.2D&1?1:(a.2D&2?3:(a.2D&4?2:0)));K a},2y:{22:{4l:J(){5v();K},4a:J(){K}},3C:{4l:J(){7(v.14.1e)K T;v(6).2x("4J",v.16.2y.3C.2m);K P},4a:J(){7(v.14.1e)K T;v(6).43("4J",v.16.2y.3C.2m);K P},2m:J(a){7(G(a,6))K P;1a[0].U="3C";K v.16.1E.1g(6,1a)}},3A:{4l:J(){7(v.14.1e)K T;v(6).2x("4H",v.16.2y.3A.2m);K P},4a:J(){7(v.14.1e)K T;v(6).43("4H",v.16.2y.3A.2m);K P},2m:J(a){7(G(a,6))K P;1a[0].U="3A";K v.16.1E.1g(6,1a)}}}};v.1i.1s({2x:J(a,b,c){K a=="4G"?6.2X(a,b,c):6.V(J(){v.16.1c(6,a,c||b,c&&b)})},2X:J(b,c,d){K 6.V(J(){v.16.1c(6,b,J(a){v(6).43(a);K(d||c).1g(6,1a)},d&&c)})},43:J(a,b){K 6.V(J(){v.16.1T(6,a,b)})},1R:J(a,b,c){K 6.V(J(){v.16.1R(a,b,6,P,c)})},5W:J(a,b,c){7(6[0])K v.16.1R(a,b,6[0],T,c);K Y},2l:J(){L b=1a;K 6.4Q(J(a){6.4E=0==6.4E?1:0;a.2P();K b[6.4E].1g(6,1a)||T})},7D:J(a,b){K 6.2x(\'3C\',a).2x(\'3A\',b)},22:J(a){5v();7(v.2M)a.1M(S,v);N v.3z.1h(J(){K a.1M(6,v)});K 6}});v.1s({2M:T,3z:[],22:J(){7(!v.2M){v.2M=P;7(v.3z){v.V(v.3z,J(){6.1g(S)});v.3z=12}$(S).5W("22")}}});L F=T;J 5v(){7(F)K;F=P;7(S.3K&&!v.14.2z)S.3K("5U",v.22,T);7(v.14.1e&&1f==3c)(J(){7(v.2M)K;1P{S.1F.7A("2f")}1Q(3a){3y(1a.48,0);K}v.22()})();7(v.14.2z)S.3K("5U",J(){7(v.2M)K;Q(L i=0;i<S.4C.M;i++)7(S.4C[i].31){3y(1a.48,0);K}v.22()},T);7(v.14.25){L a;(J(){7(v.2M)K;7(S.3b!="5T"&&S.3b!="1y"){3y(1a.48,0);K}7(a===Y)a=v("W, 79[7y=7x]").M;7(S.4C.M!=a){3y(1a.48,0);K}v.22()})()}v.16.1c(1f,"3Q",v.22)}v.V(("7w,7v,3Q,7u,57,4G,4Q,7t,"+"7s,7r,7B,4J,4H,7q,2o,"+"50,7p,7o,7F,3a").2a(","),J(i,b){v.1i[b]=J(a){K a?6.2x(b,a):6.1R(b)}});L G=J(a,b){L c=a.5H;2b(c&&c!=b)1P{c=c.1b}1Q(3a){c=b};K c==b};v(1f).2x("4G",J(){v("*").1c(S).43()});v.1i.1s({3Q:J(c,d,e){7(v.1r(c))K 6.2x("3Q",c);L f=c.1k(" ");7(f>=0){L g=c.2Y(f,c.M);c=c.2Y(0,f)}e=e||J(){};L h="4P";7(d)7(v.1r(d)){e=d;d=12}N{d=v.3l(d);h="5S"}L i=6;v.3L({1d:c,U:h,1V:"4r",R:d,1y:J(a,b){7(b=="1W"||b=="5R")i.4r(g?v("<1v/>").3o(a.44.1p(/<1q(.|\\s)*?\\/1q>/g,"")).2v(g):a.44);i.V(e,[a.44,b,a])}});K 6},7n:J(){K v.3l(6.5Q())},5Q:J(){K 6.2c(J(){K v.11(6,"39")?v.2E(6.7m):6}).1C(J(){K 6.2T&&!6.31&&(6.3q||/2o|6f/i.17(6.11)||/23|1Y|51/i.17(6.U))}).2c(J(i,b){L c=v(6).76();K c==12?12:c.1n==1L?v.2c(c,J(a,i){K{2T:b.2T,1B:a}}):{2T:b.2T,1B:c}}).1Z()}});v.V("5P,5O,5N,67,5M,5L".2a(","),J(i,o){v.1i[o]=J(f){K 6.2x(o,f)}});L H=(1D 3t).3J();v.1s({1Z:J(a,b,c,d){7(v.1r(b)){c=b;b=12}K v.3L({U:"4P",1d:a,R:b,1W:c,1V:d})},7l:J(a,b){K v.1Z(a,12,b,"1q")},7k:J(a,b,c){K v.1Z(a,b,c,"3w")},7j:J(a,b,c,d){7(v.1r(b)){c=b;b={}}K v.3L({U:"5S",1d:a,R:b,1W:c,1V:d})},7Y:J(a){v.1s(v.4z,a)},4z:{2e:P,U:"4P",2V:0,5K:"7i/x-7g-39-7f",6r:P,3m:P,R:12},4h:{},3L:J(s){L c,2O=/=\\?(&|$)/g,1z,R;s=v.1s(P,s,v.1s(P,{},v.4z,s));7(s.R&&s.6r&&1t s.R!="29")s.R=v.3l(s.R);7(s.1V=="4f"){7(s.U.2g()=="1Z"){7(!s.1d.1A(2O))s.1d+=(s.1d.1A(/\\?/)?"&":"?")+(s.4f||"5I")+"=?"}N 7(!s.R||!s.R.1A(2O))s.R=(s.R?s.R+"&":"")+(s.4f||"5I")+"=?";s.1V="3w"}7(s.1V=="3w"&&(s.R&&s.R.1A(2O)||s.1d.1A(2O))){c="4f"+H++;7(s.R)s.R=(s.R+"").1p(2O,"="+c+"$1");s.1d=s.1d.1p(2O,"="+c+"$1");s.1V="1q";1f[c]=J(a){R=a;1W();1y();1f[c]=Y;1P{2S 1f[c]}1Q(e){}7(g)g.36(h)}}7(s.1V=="1q"&&s.1N==12)s.1N=T;7(s.1N===T&&s.U.2g()=="1Z"){L d=(1D 3t()).3J();L f=s.1d.1p(/(\\?|&)4j=.*?(&|$)/,"$7b="+d+"$2");s.1d=f+((f==s.1d)?(s.1d.1A(/\\?/)?"&":"?")+"4j="+d:"")}7(s.R&&s.U.2g()=="1Z"){s.1d+=(s.1d.1A(/\\?/)?"&":"?")+s.R;s.R=12}7(s.2e&&!v.5b++)v.16.1R("5P");7((!s.1d.1k("7a")||!s.1d.1k("//"))&&(s.1V=="1q"||s.1V=="3w")&&s.U.2g()=="1Z"){L g=S.3O("6d")[0];L h=S.35("1q");h.3M=s.1d;7(s.6t)h.9X=s.6t;7(!c){L i=T;h.9W=h.9U=J(){7(!i&&(!6.3b||6.3b=="5T"||6.3b=="1y")){i=P;1W();1y();g.36(h)}}}g.3j(h);K Y}L j=T;L k=1f.78?1D 78("9T.9S"):1D 75();k.9Q(s.U,s.1d,s.3m);1P{7(s.R)k.5C("9O-9M",s.5K);7(s.5d)k.5C("9L-5A-9J",v.4h[s.1d]||"9I, 9H 9G 9E 5E:5E:5E 9C");k.5C("X-9A-9z","75")}1Q(e){}7(s.71)s.71(k);7(s.2e)v.16.1R("5L",[k,s]);L l=J(a){7(!j&&k&&(k.3b==4||a=="2V")){j=P;7(m){70(m);m=12}1z=a=="2V"&&"2V"||!v.6Z(k)&&"3a"||s.5d&&v.6I(k,s.1d)&&"5R"||"1W";7(1z=="1W"){1P{R=v.6Y(k,s.1V)}1Q(e){1z="5u"}}7(1z=="1W"){L b;1P{b=k.5h("6B-5A")}1Q(e){}7(s.5d&&b)v.4h[s.1d]=b;7(!c)1W()}N v.5s(s,k,1z);1y();7(s.3m)k=12}};7(s.3m){L m=4X(l,13);7(s.2V>0)3y(J(){7(k){k.9t();7(!j)l("2V")}},s.2V)}1P{k.9s(s.R)}1Q(e){v.5s(s,k,12,e)}7(!s.3m)l();J 1W(){7(s.1W)s.1W(R,1z);7(s.2e)v.16.1R("5M",[k,s])}J 1y(){7(s.1y)s.1y(k,1z);7(s.2e)v.16.1R("5N",[k,s]);7(s.2e&&!--v.5b)v.16.1R("5O")}K k},5s:J(s,a,b,e){7(s.3a)s.3a(a,b,e);7(s.2e)v.16.1R("67",[a,s,e])},5b:0,6Z:J(r){1P{K!r.1z&&9q.9p=="52:"||(r.1z>=6W&&r.1z<9n)||r.1z==6V||r.1z==9k||v.14.25&&r.1z==Y}1Q(e){}K T},6I:J(a,b){1P{L c=a.5h("6B-5A");K a.1z==6V||c==v.4h[b]||v.14.25&&a.1z==Y}1Q(e){}K T},6Y:J(r,a){L b=r.5h("9j-U");L c=a=="6T"||!a&&b&&b.1k("6T")>=0;L d=c?r.9h:r.44;7(c&&d.1F.26=="5u")6U"5u";7(a=="1q")v.5c(d);7(a=="3w")d=4s("("+d+")");K d},3l:J(a){L s=[];7(a.1n==1L||a.59)v.V(a,J(){s.1h(3p(6.2T)+"="+3p(6.1B))});N Q(L j 1o a)7(a[j]&&a[j].1n==1L)v.V(a[j],J(){s.1h(3p(j)+"="+3p(6))});N s.1h(3p(j)+"="+3p(a[j]));K s.68("&").1p(/%20/g,"+")}});v.1i.1s({1I:J(b,c){K b?6.27({1O:"1I",28:"1I",1x:"1I"},b,c):6.1C(":1Y").V(J(){6.W.19=6.5m||"";7(v.1l(6,"19")=="2R"){L a=v("<"+6.26+" />").6w("1j");6.W.19=a.1l("19");a.1T()}}).3g()},1H:J(a,b){K a?6.27({1O:"1H",28:"1H",1x:"1H"},a,b):6.1C(":45").V(J(){6.5m=6.5m||v.1l(6,"19");6.W.19="2R"}).3g()},6S:v.1i.2l,2l:J(a,b){K v.1r(a)&&v.1r(b)?6.6S(a,b):a?6.27({1O:"2l",28:"2l",1x:"2l"},a,b):6.V(J(){v(6)[v(6).3N(":1Y")?"1I":"1H"]()})},9c:J(a,b){K 6.27({1O:"1I"},a,b)},9b:J(a,b){K 6.27({1O:"1H"},a,b)},99:J(a,b){K 6.27({1O:"2l"},a,b)},98:J(a,b){K 6.27({1x:"1I"},a,b)},97:J(a,b){K 6.27({1x:"1H"},a,b)},96:J(a,b,c){K 6.27({1x:b},a,c)},27:J(h,i,j,k){L l=v.6Q(i,j,k);K 6[l.34===T?"V":"34"](J(){7(6.15!=1)K T;L f=v.1s({},l);L g=v(6).3N(":1Y"),4v=6;Q(L p 1o h){7(h[p]=="1H"&&g||h[p]=="1I"&&!g)K v.1r(f.1y)&&f.1y.1g(6);7(p=="1O"||p=="28"){f.19=v.1l(6,"19");f.33=6.W.33}}7(f.33!=12)6.W.33="1Y";f.3Z=v.1s({},h);v.V(h,J(a,b){L e=1D v.2q(4v,f,a);7(/2l|1I|1H/.17(b))e[b=="2l"?g?"1I":"1H":b](h);N{L c=b.3U().1A(/^([+-]=)?([\\d+-.]+)(.*)$/),21=e.2j(P)||0;7(c){L d=2F(c[2]),2A=c[3]||"2Q";7(2A!="2Q"){4v.W[a]=(d||1)+2A;21=((d||1)/e.2j(P))*21;4v.W[a]=21+2A}7(c[1])d=((c[1]=="-="?-1:1)*d)+21;e.3W(21,d,2A)}N e.3W(21,b,"")}});K P})},34:J(a,b){7(v.1r(a)||(a&&a.1n==1L)){b=a;a="2q"}7(!a||(1t a=="29"&&!b))K I(6[0],a);K 6.V(J(){7(6.15!=1)K;7(b.1n==1L)I(6,a,b);N{I(6,a).1h(b);7(I(6,a).M==1)b.1g(6)}})},92:J(a,b){L c=v.3H;7(a)6.34([]);6.V(J(){Q(L i=c.M-1;i>=0;i--)7(c[i].O==6){7(b)c[i](P);c.6N(i,1)}});7(!b)6.5n();K 6}});L I=J(a,b,c){7(!a)K Y;b=b||"2q";L q=v.R(a,b+"34");7(!q||c)q=v.R(a,b+"34",c?v.2E(c):[]);K q};v.1i.5n=J(a){a=a||"2q";K 6.V(J(){L q=I(6,a);q.4d();7(q.M)q[0].1g(6)})};v.1s({6Q:J(a,b,c){L d=a&&a.1n==91?a:{1y:c||!c&&b||v.1r(a)&&a,2s:a,3Y:c&&b||b&&b.1n!=90&&b};d.2s=(d.2s&&d.2s.1n==4T?d.2s:{8Z:8Y,8X:6W}[d.2s])||9u;d.5o=d.1y;d.1y=J(){7(d.34!==T)v(6).5n();7(v.1r(d.5o))d.5o.1g(6)};K d},3Y:{6L:J(p,n,a,b){K a+b*p},5p:J(p,n,a,b){K((-1X.8T(p*1X.8S)/2)+0.5)*b+a}},3H:[],3P:12,2q:J(a,b,c){6.10=b;6.O=a;6.1m=c;7(!b.3R)b.3R={}}});v.2q.2i={4x:J(){7(6.10.30)6.10.30.1g(6.O,[6.2G,6]);(v.2q.30[6.1m]||v.2q.30.72)(6);7(6.1m=="1O"||6.1m=="28")6.O.W.19="40"},2j:J(a){7(6.O[6.1m]!=12&&6.O.W[6.1m]==12)K 6.O[6.1m];L r=2F(v.1l(6.O,6.1m,a));K r&&r>-8N?r:2F(v.2p(6.O,6.1m))||0},3W:J(b,c,d){6.5w=(1D 3t()).3J();6.21=b;6.3g=c;6.2A=d||6.2A||"2Q";6.2G=6.21;6.4y=6.4q=0;6.4x();L e=6;J t(a){K e.30(a)}t.O=6.O;v.3H.1h(t);7(v.3P==12){v.3P=4X(J(){L a=v.3H;Q(L i=0;i<a.M;i++)7(!a[i]())a.6N(i--,1);7(!a.M){70(v.3P);v.3P=12}},13)}},1I:J(){6.10.3R[6.1m]=v.1G(6.O.W,6.1m);6.10.1I=P;6.3W(0,6.2j());7(6.1m=="28"||6.1m=="1O")6.O.W[6.1m]="8M";v(6.O).1I()},1H:J(){6.10.3R[6.1m]=v.1G(6.O.W,6.1m);6.10.1H=P;6.3W(6.2j(),0)},30:J(a){L t=(1D 3t()).3J();7(a||t>6.10.2s+6.5w){6.2G=6.3g;6.4y=6.4q=1;6.4x();6.10.3Z[6.1m]=P;L b=P;Q(L i 1o 6.10.3Z)7(6.10.3Z[i]!==P)b=T;7(b){7(6.10.19!=12){6.O.W.33=6.10.33;6.O.W.19=6.10.19;7(v.1l(6.O,"19")=="2R")6.O.W.19="40"}7(6.10.1H)6.O.W.19="2R";7(6.10.1H||6.10.1I)Q(L p 1o 6.10.3Z)v.1G(6.O.W,p,6.10.3R[p])}7(b&&v.1r(6.10.1y))6.10.1y.1g(6.O);K T}N{L n=t-6.5w;6.4q=n/6.10.2s;6.4y=v.3Y[6.10.3Y||(v.3Y.5p?"5p":"6L")](6.4q,n,0,1,6.10.2s);6.2G=6.21+((6.3g-6.21)*6.4y);6.4x()}K P}};v.2q.30={2t:J(a){a.O.2t=a.2G},2w:J(a){a.O.2w=a.2G},1x:J(a){v.1G(a.O.W,"1x",a.2G)},72:J(a){a.O.W[a.1m]=a.2G+a.2A}};v.1i.56=J(){L b=0,3c=0,O=6[0],5i;7(O)8K(v.14){L c=O.1b,3T=O,1J=O.1J,1K=O.2k,5z=25&&49(5D)<8J,37=v.1l(O,"3D")=="37";7(O.6E){L d=O.6E();1c(d.2f+1X.24(1K.1F.2t,1K.1j.2t),d.3c+1X.24(1K.1F.2w,1K.1j.2w));1c(-1K.1F.62,-1K.1F.61)}N{1c(O.5B,O.5F);2b(1J){1c(1J.5B,1J.5F);7(41&&!/^t(8H|d|h)$/i.17(1J.26)||25&&!5z)2L(1J);7(!37&&v.1l(1J,"3D")=="37")37=P;3T=/^1j$/i.17(1J.26)?3T:1J;1J=1J.1J}2b(c&&c.26&&!/^1j|4r$/i.17(c.26)){7(!/^8G|1S.*$/i.17(v.1l(c,"19")))1c(-c.2t,-c.2w);7(41&&v.1l(c,"33")!="45")2L(c);c=c.1b}7((5z&&(37||v.1l(3T,"3D")=="4O"))||(41&&v.1l(3T,"3D")!="4O"))1c(-1K.1j.5B,-1K.1j.5F);7(37)1c(1X.24(1K.1F.2t,1K.1j.2t),1X.24(1K.1F.2w,1K.1j.2w))}5i={3c:3c,2f:b}}J 2L(a){1c(v.2p(a,"8E",P),v.2p(a,"9Z",P))}J 1c(l,t){b+=49(l)||0;3c+=49(t)||0}K 5i}})();',62,620,'||||||this|if||||||||||||||||||||||||||||||||||||||function|return|var|length|else|elem|true|for|data|document|false|type|each|style||undefined||options|nodeName|null||browser|nodeType|event|test|jQuery|display|arguments|parentNode|add|url|msie|window|apply|push|fn|body|indexOf|css|prop|constructor|in|replace|script|isFunction|extend|typeof|className|div|firstChild|opacity|complete|status|match|value|filter|new|handle|documentElement|attr|hide|show|offsetParent|doc|Array|call|cache|height|try|catch|trigger|table|remove|tbody|dataType|success|Math|hidden|get||start|ready|text|max|safari|tagName|animate|width|string|split|while|map|break|global|left|toLowerCase|done|prototype|cur|ownerDocument|toggle|handler||select|curCSS|fx|selected|duration|scrollLeft|id|find|scrollTop|bind|special|opera|unit|stack|toUpperCase|button|makeArray|parseFloat|now|target|pushStack|nextSibling|guid|border|isReady|exec|jsre|preventDefault|px|none|delete|name|merge|timeout|inArray|one|slice|nth|step|disabled|events|overflow|queue|createElement|removeChild|fixed|innerHTML|form|error|readyState|top|which|multiFilter|ret|end|rl|trim|appendChild|first|param|async|insertBefore|append|encodeURIComponent|checked|childNodes|elems|Date|runtimeStyle|domManip|json|color|setTimeout|readyList|mouseleave|grep|mouseenter|position|isXMLDoc|args|removeData|timers|last|getTime|addEventListener|ajax|src|is|getElementsByTagName|timerId|load|orig|has|offsetChild|toString|props|custom|stopPropagation|easing|curAnim|block|mozilla|selectedIndex|unbind|responseText|visible|defaultView|String|callee|parseInt|teardown|on|nodeIndex|shift|float|jsonp|child|lastModified|RegExp|_|input|setup|currentStyle|previousSibling|dir|tr|state|html|eval|empty|getAttribute|self|object|update|pos|ajaxSettings|getComputedStyle|getPropertyValue|styleSheets|init|lastToggle|andSelf|unload|mouseout|getWH|mouseover|index|container2|unshift|visibility|absolute|GET|click|fix|prevObject|Number|triggered|removeAttribute|unique|setInterval|classFilter|after|submit|password|file|clean|expr|windowData|offset|scroll|deep|jquery|client|active|globalEval|ifModified|sibling|clone|wrapAll|getResponseHeader|results|checkbox|radio|container|oldblock|dequeue|old|swing|createTextNode|lastChild|handleError|fromElement|parsererror|bindReady|startTime|getElementById|values|safari2|Modified|offsetLeft|setRequestHeader|version|00|offsetTop|not|relatedTarget|callback|col|contentType|ajaxSend|ajaxSuccess|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|POST|loaded|DOMContentLoaded|Width|triggerHandler|ctrlKey|metaKey|keyCode|charCode|clientTop|clientLeft|clientX|pageX|cloneNode|swap|ajaxError|join|detachEvent|removeEventListener|attachEvent|substr|head|parse|textarea|reset|image|before|prepend|zoom|odd|even|quickClass|quickID|uuid|quickChild|processData|continue|scriptCharset|contents|textContent|appendTo|evalScript|setArray|parent|defaultValue|Last|nodeValue|compatMode|getBoundingClientRect|cssFloat|styleFloat|eq|httpNotModified|webkit|replaceWith|linear|concat|splice|100|alpha|speed|href|_toggle|xml|throw|304|200|colgroup|httpData|httpSuccess|clearInterval|beforeSend|_default|fieldset|multiple|XMLHttpRequest|val|CSS1Compat|ActiveXObject|link|http|1_|img|br|abbr|urlencoded|www|pixelLeft|application|post|getJSON|getScript|elements|serialize|keypress|keydown|change|mouseup|mousedown|dblclick|resize|focus|blur|stylesheet|rel|round|doScroll|mousemove|padding|hover|offsetHeight|keyup|offsetWidth|Bottom|Top|Right|Left|clientY|pageY|toElement|srcElement|cancelBubble|returnValue|0n|substring|javascript|size|animated|header|2b2|ajaxSetup|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|417|Boolean|inner|wrap|Height|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|wrapInner|prependTo|contentWindow|contentDocument|iframe|children|siblings|prevAll|nextAll|prev|next|parents|maxLength|maxlength|readOnly|readonly|reverse|class|borderLeftWidth|htmlFor|inline|able|boxModel|522|with|compatible|1px|10000|ie|ra|it|rv|PI|cos|userAgent|option|navigator|fast|600|slow|Function|Object|stop|array|ig|NaN|fadeTo|fadeOut|fadeIn|slideToggle|setAttribute|slideUp|slideDown|changed|be|specified|can|responseXML|property|content|1223|getAttributeNode|attributes|300|method|protocol|location|action|send|abort|400|cssText|th|td|cap|With|Requested|colg|GMT|tfoot|1970|thead|Jan|01|Thu|Since|leg|If|Type|opt|Content|area|open|hr|XMLHTTP|Microsoft|onreadystatechange|meta|onload|charset|hasClass|borderTopWidth'.split('|'),0,{}));

/* 
 * Auto Expanding Text Area (1.2.2)
 * by Chrys Bader (www.chrysbader.com)
 * chrysb@gmail.com
 *
 * Special thanks to:
 * Jake Chapa - jake@hybridstudio.com
 * John Resig - jeresig@gmail.com
 *
 * Copyright (c) 2008 Chrys Bader (www.chrysbader.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 *
 * NOTE: This script requires jQuery to work.  Download jQuery at www.jquery.com
 *
 */
 
(function(jQuery) {
		  
	var self = null;
 
	jQuery.fn.autogrow = function(o)
	{	
		return this.each(function() {
			new jQuery.autogrow(this, o);
		});
	};
	

    /**
     * The autogrow object.
     *
     * @constructor
     * @name jQuery.autogrow
     * @param Object e The textarea to create the autogrow for.
     * @param Hash o A set of key/value pairs to set as configuration properties.
     * @cat Plugins/autogrow
     */
	
	jQuery.autogrow = function (e, o)
	{
		this.options		  	= o || {};
		this.dummy			  	= null;
		this.interval	 	  	= null;
		this.line_height	  	= this.options.lineHeight || parseInt(jQuery(e).css('line-height'));
		this.min_height		  	= this.options.minHeight || parseInt(jQuery(e).css('min-height'));
		this.max_height		  	= this.options.maxHeight || parseInt(jQuery(e).css('max-height'));;
		this.textarea		  	= jQuery(e);
		
		if(this.line_height == NaN)
		  this.line_height = 0;
		
		// Only one textarea activated at a time, the one being used
		this.init();
	};
	
	jQuery.autogrow.fn = jQuery.autogrow.prototype = {
    autogrow: '1.2.2'
  };
	
 	jQuery.autogrow.fn.extend = jQuery.autogrow.extend = jQuery.extend;
	
	jQuery.autogrow.fn.extend({
						 
		init: function() {			
			var self = this;			
			this.textarea.css({overflow: 'hidden', display: 'block'});
			this.textarea.bind('focus', function() { self.startExpand() } ).bind('blur', function() { self.stopExpand() });
			this.checkExpand();	
		},
						 
		startExpand: function() {				
		  var self = this;
			this.interval = window.setInterval(function() {self.checkExpand()}, 400);
		},
		
		stopExpand: function() {
			clearInterval(this.interval);	
		},
		
		checkExpand: function() {
			
			if (this.dummy == null)
			{
				this.dummy = jQuery('<div></div>');
				this.dummy.css({
												'font-size'  : this.textarea.css('font-size'),
												'font-family': this.textarea.css('font-family'),
												'width'      : this.textarea.css('width'),
												'padding'    : this.textarea.css('padding'),
												'line-height': this.line_height + 'px',
												'overflow-x' : 'hidden',
												'position'   : 'absolute',
												'top'        : 0,
												'left'		 : -9999
												}).appendTo('body');
			}
			
			// Strip HTML tags
			var html = this.textarea.val().replace(/(<|>)/g, '');
			
			// IE is different, as per usual
			if ($.browser.msie)
			{
				html = html.replace(/\n/g, '<BR>new');
			}
			else
			{
				html = html.replace(/\n/g, '<br>new');
			}
			
			if (this.dummy.html() != html)
			{
				this.dummy.html(html);	
				
				if (this.max_height > 0 && (this.dummy.height() + this.line_height > this.max_height))
				{
					this.textarea.css('overflow-y', 'auto');	
				}
				else
				{
					this.textarea.css('overflow-y', 'hidden');
					if (this.textarea.height() < this.dummy.height() + this.line_height || (this.dummy.height() < this.textarea.height()))
					{	
						this.textarea.animate({height: (this.dummy.height() + this.line_height) + 'px'}, 100);	
					}
				}
			}
		}
						 
	 });
})(jQuery);

$(document).ready (function() {
	$('textarea.expanding').autogrow();
});
