xcpweb

changeset 2:4857e0ca0450

some very basic things
author root@mx1.coremakers.org
date Mon May 24 19:49:40 2010 +0300 (2010-05-24)
parents 723e4abed581
children fdb07e066bc0
files libxen/README libxen/callbacks.js libxen/core.js libxen/db_callbacks.js libxen/libxen.js libxen/other_libs/json.js libxen/test/najax.js libxen/test/php.default.min.js libxen/test/test.html
line diff
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/libxen/callbacks.js	Mon May 24 19:49:40 2010 +0300
     2.3 @@ -0,0 +1,1 @@
     2.4 +function xen_callback_proceed_init(result,xmldoc,param_pass)
{
var params=new Array();
var event_params=new Array();
params[0]=xen_db['session_id'];
event_params[0]=xen_db['session_id'];
event_params[1]=new Array('*');

ApiCall('event.register',event_params,true,0,xen_callback_get_next_event,0,0); //TODO callback error
var initCalls=new Array('VM.get_all_records','task.get_all_records','VBD.get_all_records','VBD_metrics.get_all_records','VDI.get_all_records','network.get_all_records','PIF.get_all_records','PIF_metrics.get_all_records','PBD.get_all_records','VIF.get_all_records','VIF_metrics.get_all_records','VM_guest_metrics.get_all_records','VM_metrics.get_all_records','host_metrics.get_all_records','host_cpu.get_all_records','Bond.get_all_records','pool_patch.get_all_records','host_patch.get_all_records','console.get_all_records','host.get_all_records','pool.get_all_records','SR.get_all_records','message.get_all_records');
for (call_id in initCalls)ApiCall(initCalls[call_id],params,false,1,0,0,0); //TODO callback error
param_pass();
return ;
}

function xen_callback_get_next_event(result,xmldoc,param_pass)
{
//this calls the next event function
var params=new Array();
params[0]=xen_db['session_id'];

ApiCall('event.next',params,true,1,xen_callback_get_next_event,0,0); //TODO callback error
}

function xen_callback_login_error(raw,xmldoc,param_pass)
{
xen_db['errors']['login_error']=0;
return ;
}
     2.5 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/libxen/core.js	Mon May 24 19:49:40 2010 +0300
     3.3 @@ -0,0 +1,194 @@
     3.4 +//TODO:
     3.5 +//to parse the json with the json.js provided by json.org (safer way)
     3.6 +//because of the 4096 node limit in firefox
     3.7 +/*
     3.8 +//for some reason firefox loops on this function and stuck
     3.9 +//For now I will parse the request as a string.
    3.10 +function exportNodeText(xmlNode) {  
    3.11 +    if(!xmlNode) return '';  
    3.12 +    if(typeof(xmlNode.textContent) != "undefined") return xmlNode.textContent;  
    3.13 +    return xmlNode.childNodes[0].nodeValue;  
    3.14 +}  
    3.15 +*/
    3.16 +var loadvar=false;
    3.17 +var version='1.0';
    3.18 +var url='/json';
    3.19 +
    3.20 +
    3.21 +function CreateHttpRequestObject()
    3.22 +{
    3.23 +	var http_request=false;
    3.24 +
    3.25 +
    3.26 +	if (window.XMLHttpRequest) { // Mozilla, Safari,...
    3.27 +		http_request = new XMLHttpRequest();
    3.28 +		if (http_request.overrideMimeType) http_request.overrideMimeType('text/xml');
    3.29 +	} else if (window.ActiveXObject) { // IE
    3.30 +		try {
    3.31 +			http_request = new ActiveXObject("Msxml2.XMLHTTP");
    3.32 +			}			
    3.33 +		catch (e) {
    3.34 +		try {
    3.35 +			http_request = new ActiveXObject("Microsoft.XMLHTTP");
    3.36 +			}
    3.37 +		catch (e) {return 0;}
    3.38 +		}
    3.39 +	}
    3.40 +
    3.41 +	return http_request;
    3.42 +}
    3.43 +
    3.44 +
    3.45 +ApiCall=function(method,params,async,doupdate,callback,error_callback,param_pass)
    3.46 +{
    3.47 +var data=xmlRpc(method, params);
    3.48 +makeRequest(url,method,data,async,doupdate,callback,error_callback,param_pass);
    3.49 +}
    3.50 +
    3.51 +
    3.52 +function parse_xml_to_json(response)
    3.53 +{
    3.54 +	return response=response.substring(137,response.length - 68); // bad way to make it, but it will be that way for some time
    3.55 +}
    3.56 +
    3.57 +makeRequest=function(url,method,data,async,doupdate,callback,error_callback,param_pass) {
    3.58 +rand=parseInt(Math.random()*99999999);
    3.59 +url+='&'+rand;
    3.60 +       var httpRequest=CreateHttpRequestObject();
    3.61 +	   var result;
    3.62 +	   var cur;
    3.63 +	   var par;
    3.64 +	if(!httpRequest)
    3.65 +	{
    3.66 +	alert('AJAX not supported.');
    3.67 +		   return false;
    3.68 +	}
    3.69 +		
    3.70 +	function parse_request(){
    3.71 +	if (httpRequest.readyState == 4) {
    3.72 +            if (httpRequest.status == 200) {
    3.73 +				var xmldoc = httpRequest.responseXML;
    3.74 +				if(xmldoc)
    3.75 +				{
    3.76 +				
    3.77 +				//debug
    3.78 +				//document.write('<br><textarea style="width:1200px;height:100px">==DATA FROM SERVER== '+httpRequest.responseText+'</textarea>');
    3.79 +				//first looking for Status
    3.80 +				//todo: to make it better
    3.81 +					cur=xmldoc.getElementsByTagName('member');
    3.82 +						if(cur[0].childNodes[0].childNodes[0].nodeValue=='Status')
    3.83 +							{
    3.84 +								if(cur[0].childNodes[1].childNodes[0].nodeValue!='Success')
    3.85 +									{ //request error
    3.86 +									//alert('error');
    3.87 +									if(error_callback)error_callback(httpRequest.responseText,xmldoc,param_pass);
    3.88 +									return false;
    3.89 +									}
    3.90 +							}
    3.91 +
    3.92 +					if(cur[1].childNodes[0].childNodes[0].nodeValue=='Value')
    3.93 +					{
    3.94 +					
    3.95 +					//TODO: to make better xml parser
    3.96 +					//response=parse_xml_to_json(httpRequest.responseText);
    3.97 +					response=cur[1].childNodes[1].textContent; //TODO: this is for firefox, have to make it for other browsers too.
    3.98 +					if(typeof(response)!="undefined" && response != '' && response != null)result=eval('('+response.replace(/&quot;/gi, '"').replace(/&apos;/gi, "'")+')');
    3.99 +					response = null;
   3.100 +					//eval('result='+response); //TODO to parse this with json.js if security is required
   3.101 +					//result=eval('(' + parse_xml_to_json() + ')');
   3.102 +					}
   3.103 +								
   3.104 +					if(doupdate)db_callbacks[method](result);
   3.105 +					
   3.106 +					if(callback)callback(result,xmldoc,param_pass);
   3.107 +					
   3.108 +				}
   3.109 +			 	else
   3.110 +				{
   3.111 +				alert(httpRequest.responseText);
   3.112 +				}
   3.113 +				if(loadvar!=false)
   3.114 +				{
   3.115 +				document.getElementById(loadvar).style.display="none";
   3.116 +				}
   3.117 +			} else {
   3.118 +				if(httpRequest.status!=0)
   3.119 +				alert("Error: status code is " + httpRequest.status);
   3.120 +					}
   3.121 +		}
   3.122 +	}
   3.123 +	
   3.124 +    httpRequest.onreadystatechange = function() { 
   3.125 +		        parse_request();
   3.126 +	};
   3.127 +		
   3.128 +		if(loadvar!=false)
   3.129 +				{
   3.130 +				document.getElementById(loadvar).style.display="";
   3.131 +				}
   3.132 +        httpRequest.open('POST', url, async);
   3.133 +		
   3.134 +		
   3.135 +		httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   3.136 +		
   3.137 +		//debug
   3.138 +		//document.write('<br><textarea style="width:1200px;height:100px">==DATA TO SERVER== '+data+'</textarea>');
   3.139 +		httpRequest.send(data);
   3.140 +		if(async==false)parse_request();
   3.141 +		
   3.142 +    }
   3.143 +
   3.144 +
   3.145 +	
   3.146 +pad2 = function(number) {
   3.147 +     return (number < 10 ? '0' : '') + number 
   3.148 +}
   3.149 +
   3.150 +
   3.151 +//This 2 functions below are copyed and modified from the jquery rpc.
   3.152 +serializeToXml = function(data) {
   3.153 +			switch (typeof data) {
   3.154 +			case 'boolean':
   3.155 +				return '<boolean>'+ ((data) ? '1' : '0') +'</boolean>';
   3.156 +			case 'number':
   3.157 +				var parsed = parseInt(data);
   3.158 +				if(parsed == data) {
   3.159 +					return '<int>'+ data +'</int>';
   3.160 +				}
   3.161 +				return '<double>'+ data +'</double>';
   3.162 +			case 'string':
   3.163 +				return '<string>'+ data +'</string>';
   3.164 +			case 'object':
   3.165 +				if(data instanceof Date) {
   3.166 +					return '<dateTime.iso8601>'+ data.getFullYear() + pad2(data.getMonth()) + pad2(data.getDate()) +'T'+ pad2(data.getHours()) +':'+ pad2(data.getMinutes()) +':'+ pad2(data.getSeconds()) +'</dateTime.iso8601>';
   3.167 +				} else if(data instanceof Array) {
   3.168 +					var ret = '<array><data>'+"\n";
   3.169 +					for (var i=0; i < data.length; i++) {
   3.170 +						ret += '  <value>'+ serializeToXml(data[i]) +"</value>\n";
   3.171 +					}
   3.172 +					ret += '</data></array>';
   3.173 +					return ret;
   3.174 +				} else {
   3.175 +					var ret = '<struct>'+"\n";
   3.176 +					for (key in data)
   3.177 +					{
   3.178 +					var value = data[key];
   3.179 +					ret += "  <member><name>"+ key +"</name><value>";
   3.180 +					ret += serializeToXml(value) +"</value></member>\n";
   3.181 +					}
   3.182 +					ret += '</struct>';
   3.183 +					return ret;
   3.184 +				}
   3.185 +			}
   3.186 +		}
   3.187 +xmlRpc = function(method, params) {
   3.188 +			var ret='<?xml version="'+version+'"?><methodCall><methodName>'+method+'</methodName><params>';
   3.189 +			var len=params.length;
   3.190 +			for(var i=0; i<len; i++)ret+="<param><value>"+serializeToXml(params[i])+"</value></param>";
   3.191 +			ret+="</params></methodCall>";
   3.192 +			return ret;
   3.193 +		}
   3.194 +
   3.195 +
   3.196 +
   3.197 +	
   3.198 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/libxen/db_callbacks.js	Mon May 24 19:49:40 2010 +0300
     4.3 @@ -0,0 +1,1 @@
     4.4 +function invoke_event(array_name){if(typeof(xen_db_events[array_name])!='undefined'){xen_db_events[array_name]();}if(typeof(xen_db_events['*'])!='undefined'){xen_db_events['*']();}}
var db_callbacks=new Array();

db_callbacks['session.login_with_password']=function(result)
{
xen_db['session_id']=result;
xen_db['is_logged']=1;
xen_db['logged']=1;
return ;
}

db_callbacks['VM.get_all_records']=function(result){xen_db['VM']=result;invoke_event('VM');return;} 
db_callbacks['task.get_all_records']=function(result){xen_db['task']=result;invoke_event('task');return;} 
db_callbacks['VBD.get_all_records']=function(result){xen_db['VBD']=result;invoke_event('VBD');return;} 
db_callbacks['VBD_metrics.get_all_records']=function(result){xen_db['VBD_metrics']=result;invoke_event('VBD_metrics');return;} 
db_callbacks['VDI.get_all_records']=function(result){xen_db['VDI']=result;invoke_event('VDI');return;} 
db_callbacks['network.get_all_records']=function(result){xen_db['network']=result;invoke_event('network');return;} 
db_callbacks['PIF.get_all_records']=function(result){xen_db['PIF']=result;invoke_event('PIF');return;} 
db_callbacks['PIF_metrics.get_all_records']=function(result){xen_db['PIF_metrics']=result;invoke_event('PIF_metrics');return;} 
db_callbacks['PBD.get_all_records']=function(result){xen_db['PBD']=result;invoke_event('PBD');return;} 
db_callbacks['VIF.get_all_records']=function(result){xen_db['VIF']=result;invoke_event('VIF');return;} 
db_callbacks['VIF_metrics.get_all_records']=function(result){xen_db['VIF_metrics']=result;invoke_event('VIF_metrics');return;} 
db_callbacks['VM_guest_metrics.get_all_records']=function(result){xen_db['VM_guest_metrics']=result;invoke_event('VM_guest_metrics');return;} 
db_callbacks['VM_metrics.get_all_records']=function(result){xen_db['VM_metrics']=result;invoke_event('VM_metrics');return;} 
db_callbacks['host_metrics.get_all_records']=function(result){xen_db['host_metrics']=result;invoke_event('host_metrics');return;} 
db_callbacks['host_cpu.get_all_records']=function(result){xen_db['host_cpu']=result;invoke_event('host_cpu');return;} 
db_callbacks['Bond.get_all_records']=function(result){xen_db['Bond']=result;invoke_event('Bond');return;} 
db_callbacks['pool_patch.get_all_records']=function(result){xen_db['pool_patch']=result;invoke_event('pool_patch');return;} 
db_callbacks['host_patch.get_all_records']=function(result){xen_db['host_patch']=result;invoke_event('host_patch');return;} 
db_callbacks['console.get_all_records']=function(result){xen_db['console']=result;invoke_event('console');return;} 
db_callbacks['host.get_all_records']=function(result){xen_db['host']=result;invoke_event('host');return;} 
db_callbacks['pool.get_all_records']=function(result){xen_db['pool']=result;invoke_event('pool');return;} 
db_callbacks['SR.get_all_records']=function(result){xen_db['SR']=result;invoke_event('SR');return;} 
db_callbacks['message.get_all_records']=function(result){xen_db['message']=result;invoke_event('message');return;}

db_callbacks['event.next']=function(result)
{
	for ( var i in result )
	{
		if(result[i].operation=='mod' || result[i].operation=='add')
		{
		if(typeof(xen_db[result[i].class][result[i].ref])!='undefined')
			{
			xen_db[result[i].class][result[i].ref]=result[i].snapshot;
			invoke_event(result[i].class);
			}
		else
			{
			alert("non existing class in xen_db class name:"+result[i].class+" reference:"+result[i].ref);
			}
		}
		if(result[i].operation=='del')
		{
		delete xen_db[result[i].class][result[i].ref];
		invoke_event('del');
		}
	}
	
	return;
}
     4.5 \ No newline at end of file
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/libxen/libxen.js	Mon May 24 19:49:40 2010 +0300
     5.3 @@ -0,0 +1,24 @@
     5.4 +//Here are the functions that are recomended to be used by the UI
     5.5 +//some inits
     5.6 +var xen_db=new Array();
     5.7 +var xen_db_events=new Array(); 
     5.8 +//var xen=new xen_core();
     5.9 +//This function initializes the session.
    5.10 +function xen_init(username,password,callback_login)
    5.11 +{
    5.12 +var params=new Array();
    5.13 +//var xen=new xen_core();
    5.14 +var params=new Array();
    5.15 +params[0]=username;
    5.16 +params[1]=password;
    5.17 +//xen.ApiCall('session.login_with_password',params,1,xen_callback_proceed_init,xen_callback_login_error,callback_login);
    5.18 +ApiCall('session.login_with_password',params,true,1,xen_callback_proceed_init,xen_callback_login_error,callback_login);
    5.19 +return ;
    5.20 +}
    5.21 +
    5.22 +function xen_register_db_event(db_array,function_call) //this register event (function to invoke after some xen_db array is changed)
    5.23 +//example 1 xen_register_db_event('VM',vm_list_change);
    5.24 +//example 2 xen_register_db_event('*',make_UI_modifications);
    5.25 +{
    5.26 +xen_db_events[db_array]=function_call;
    5.27 +}
    5.28 \ No newline at end of file
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/libxen/other_libs/json.js	Mon May 24 19:49:40 2010 +0300
     6.3 @@ -0,0 +1,333 @@
     6.4 +
     6.5 +
     6.6 +JSON = JSON || {};
     6.7 +
     6.8 +(function () {
     6.9 +
    6.10 +    function f(n) {
    6.11 +        // Format integers to have at least two digits.
    6.12 +        return n < 10 ? '0' + n : n;
    6.13 +    }
    6.14 +
    6.15 +    if (typeof Date.prototype.toJSON !== 'function') {
    6.16 +
    6.17 +        Date.prototype.toJSON = function (key) {
    6.18 +
    6.19 +            return this.getUTCFullYear()   + '-' +
    6.20 +                 f(this.getUTCMonth() + 1) + '-' +
    6.21 +                 f(this.getUTCDate())      + 'T' +
    6.22 +                 f(this.getUTCHours())     + ':' +
    6.23 +                 f(this.getUTCMinutes())   + ':' +
    6.24 +                 f(this.getUTCSeconds())   + 'Z';
    6.25 +        };
    6.26 +
    6.27 +        String.prototype.toJSON =
    6.28 +        Number.prototype.toJSON =
    6.29 +        Boolean.prototype.toJSON = function (key) {
    6.30 +            return this.valueOf();
    6.31 +        };
    6.32 +    }
    6.33 +
    6.34 +    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    6.35 +        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
    6.36 +        gap,
    6.37 +        indent,
    6.38 +        meta = {    // table of character substitutions
    6.39 +            '\b': '\\b',
    6.40 +            '\t': '\\t',
    6.41 +            '\n': '\\n',
    6.42 +            '\f': '\\f',
    6.43 +            '\r': '\\r',
    6.44 +            '"' : '\\"',
    6.45 +            '\\': '\\\\'
    6.46 +        },
    6.47 +        rep;
    6.48 +
    6.49 +
    6.50 +    function quote(string) {
    6.51 +
    6.52 +// If the string contains no control characters, no quote characters, and no
    6.53 +// backslash characters, then we can safely slap some quotes around it.
    6.54 +// Otherwise we must also replace the offending characters with safe escape
    6.55 +// sequences.
    6.56 +
    6.57 +        escapable.lastIndex = 0;
    6.58 +        return escapable.test(string) ?
    6.59 +            '"' + string.replace(escapable, function (a) {
    6.60 +                var c = meta[a];
    6.61 +                return typeof c === 'string' ? c :
    6.62 +                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
    6.63 +            }) + '"' :
    6.64 +            '"' + string + '"';
    6.65 +    }
    6.66 +
    6.67 +
    6.68 +    function str(key, holder) {
    6.69 +
    6.70 +// Produce a string from holder[key].
    6.71 +
    6.72 +        var i,          // The loop counter.
    6.73 +            k,          // The member key.
    6.74 +            v,          // The member value.
    6.75 +            length,
    6.76 +            mind = gap,
    6.77 +            partial,
    6.78 +            value = holder[key];
    6.79 +
    6.80 +// If the value has a toJSON method, call it to obtain a replacement value.
    6.81 +
    6.82 +        if (value && typeof value === 'object' &&
    6.83 +                typeof value.toJSON === 'function') {
    6.84 +            value = value.toJSON(key);
    6.85 +        }
    6.86 +
    6.87 +// If we were called with a replacer function, then call the replacer to
    6.88 +// obtain a replacement value.
    6.89 +
    6.90 +        if (typeof rep === 'function') {
    6.91 +            value = rep.call(holder, key, value);
    6.92 +        }
    6.93 +
    6.94 +// What happens next depends on the value's type.
    6.95 +
    6.96 +        switch (typeof value) {
    6.97 +        case 'string':
    6.98 +            return quote(value);
    6.99 +
   6.100 +        case 'number':
   6.101 +
   6.102 +// JSON numbers must be finite. Encode non-finite numbers as null.
   6.103 +
   6.104 +            return isFinite(value) ? String(value) : 'null';
   6.105 +
   6.106 +        case 'boolean':
   6.107 +        case 'null':
   6.108 +
   6.109 +// If the value is a boolean or null, convert it to a string. Note:
   6.110 +// typeof null does not produce 'null'. The case is included here in
   6.111 +// the remote chance that this gets fixed someday.
   6.112 +
   6.113 +            return String(value);
   6.114 +
   6.115 +// If the type is 'object', we might be dealing with an object or an array or
   6.116 +// null.
   6.117 +
   6.118 +        case 'object':
   6.119 +
   6.120 +// Due to a specification blunder in ECMAScript, typeof null is 'object',
   6.121 +// so watch out for that case.
   6.122 +
   6.123 +            if (!value) {
   6.124 +                return 'null';
   6.125 +            }
   6.126 +
   6.127 +// Make an array to hold the partial results of stringifying this object value.
   6.128 +
   6.129 +            gap += indent;
   6.130 +            partial = [];
   6.131 +
   6.132 +// Is the value an array?
   6.133 +
   6.134 +            if (Object.prototype.toString.apply(value) === '[object Array]') {
   6.135 +
   6.136 +// The value is an array. Stringify every element. Use null as a placeholder
   6.137 +// for non-JSON values.
   6.138 +
   6.139 +                length = value.length;
   6.140 +                for (i = 0; i < length; i += 1) {
   6.141 +                    partial[i] = str(i, value) || 'null';
   6.142 +                }
   6.143 +
   6.144 +// Join all of the elements together, separated with commas, and wrap them in
   6.145 +// brackets.
   6.146 +
   6.147 +                v = partial.length === 0 ? '[]' :
   6.148 +                    gap ? '[\n' + gap +
   6.149 +                            partial.join(',\n' + gap) + '\n' +
   6.150 +                                mind + ']' :
   6.151 +                          '[' + partial.join(',') + ']';
   6.152 +                gap = mind;
   6.153 +                return v;
   6.154 +            }
   6.155 +
   6.156 +// If the replacer is an array, use it to select the members to be stringified.
   6.157 +
   6.158 +            if (rep && typeof rep === 'object') {
   6.159 +                length = rep.length;
   6.160 +                for (i = 0; i < length; i += 1) {
   6.161 +                    k = rep[i];
   6.162 +                    if (typeof k === 'string') {
   6.163 +                        v = str(k, value);
   6.164 +                        if (v) {
   6.165 +                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
   6.166 +                        }
   6.167 +                    }
   6.168 +                }
   6.169 +            } else {
   6.170 +
   6.171 +// Otherwise, iterate through all of the keys in the object.
   6.172 +
   6.173 +                for (k in value) {
   6.174 +                    if (Object.hasOwnProperty.call(value, k)) {
   6.175 +                        v = str(k, value);
   6.176 +                        if (v) {
   6.177 +                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
   6.178 +                        }
   6.179 +                    }
   6.180 +                }
   6.181 +            }
   6.182 +
   6.183 +// Join all of the member texts together, separated with commas,
   6.184 +// and wrap them in braces.
   6.185 +
   6.186 +            v = partial.length === 0 ? '{}' :
   6.187 +                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
   6.188 +                        mind + '}' : '{' + partial.join(',') + '}';
   6.189 +            gap = mind;
   6.190 +            return v;
   6.191 +        }
   6.192 +    }
   6.193 +
   6.194 +// If the JSON object does not yet have a stringify method, give it one.
   6.195 +
   6.196 +    if (typeof JSON.stringify !== 'function') {
   6.197 +        JSON.stringify = function (value, replacer, space) {
   6.198 +
   6.199 +// The stringify method takes a value and an optional replacer, and an optional
   6.200 +// space parameter, and returns a JSON text. The replacer can be a function
   6.201 +// that can replace values, or an array of strings that will select the keys.
   6.202 +// A default replacer method can be provided. Use of the space parameter can
   6.203 +// produce text that is more easily readable.
   6.204 +
   6.205 +            var i;
   6.206 +            gap = '';
   6.207 +            indent = '';
   6.208 +
   6.209 +// If the space parameter is a number, make an indent string containing that
   6.210 +// many spaces.
   6.211 +
   6.212 +            if (typeof space === 'number') {
   6.213 +                for (i = 0; i < space; i += 1) {
   6.214 +                    indent += ' ';
   6.215 +                }
   6.216 +
   6.217 +// If the space parameter is a string, it will be used as the indent string.
   6.218 +
   6.219 +            } else if (typeof space === 'string') {
   6.220 +                indent = space;
   6.221 +            }
   6.222 +
   6.223 +// If there is a replacer, it must be a function or an array.
   6.224 +// Otherwise, throw an error.
   6.225 +
   6.226 +            rep = replacer;
   6.227 +            if (replacer && typeof replacer !== 'function' &&
   6.228 +                    (typeof replacer !== 'object' ||
   6.229 +                     typeof replacer.length !== 'number')) {
   6.230 +                throw new Error('JSON.stringify');
   6.231 +            }
   6.232 +
   6.233 +// Make a fake root object containing our value under the key of ''.
   6.234 +// Return the result of stringifying the value.
   6.235 +
   6.236 +            return str('', {'': value});
   6.237 +        };
   6.238 +    }
   6.239 +
   6.240 +
   6.241 +// If the JSON object does not yet have a parse method, give it one.
   6.242 +
   6.243 +    if (typeof JSON.parse !== 'function') {
   6.244 +        JSON.parse = function (text, reviver) {
   6.245 +
   6.246 +// The parse method takes a text and an optional reviver function, and returns
   6.247 +// a JavaScript value if the text is a valid JSON text.
   6.248 +
   6.249 +            var j;
   6.250 +
   6.251 +            function walk(holder, key) {
   6.252 +
   6.253 +// The walk method is used to recursively walk the resulting structure so
   6.254 +// that modifications can be made.
   6.255 +
   6.256 +                var k, v, value = holder[key];
   6.257 +                if (value && typeof value === 'object') {
   6.258 +                    for (k in value) {
   6.259 +                        if (Object.hasOwnProperty.call(value, k)) {
   6.260 +                            v = walk(value, k);
   6.261 +                            if (v !== undefined) {
   6.262 +                                value[k] = v;
   6.263 +                            } else {
   6.264 +                                delete value[k];
   6.265 +                            }
   6.266 +                        }
   6.267 +                    }
   6.268 +                }
   6.269 +                return reviver.call(holder, key, value);
   6.270 +            }
   6.271 +            text = String(text);
   6.272 +
   6.273 +// Parsing happens in four stages. In the first stage, we replace certain
   6.274 +// Unicode characters with escape sequences. JavaScript handles many characters
   6.275 +// incorrectly, either silently deleting them, or treating them as line endings.
   6.276 +
   6.277 +            cx.lastIndex = 0;
   6.278 +            if (cx.test(text)) {
   6.279 +                text = text.replace(cx, function (a) {
   6.280 +                    return '\\u' +
   6.281 +                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
   6.282 +                });
   6.283 +            }
   6.284 +
   6.285 +// In the second stage, we run the text against regular expressions that look
   6.286 +// for non-JSON patterns. We are especially concerned with '()' and 'new'
   6.287 +// because they can cause invocation, and '=' because it can cause mutation.
   6.288 +// But just to be safe, we want to reject all unexpected forms.
   6.289 +
   6.290 +// We split the second stage into 4 regexp operations in order to work around
   6.291 +// crippling inefficiencies in IE's and Safari's regexp engines. First we
   6.292 +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
   6.293 +// replace all simple value tokens with ']' characters. Third, we delete all
   6.294 +// open brackets that follow a colon or comma or that begin the text. Finally,
   6.295 +// we look to see that the remaining characters are only whitespace or ']' or
   6.296 +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
   6.297 +
   6.298 +            if (/^[\],:{}\s]*$/.
   6.299 +test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
   6.300 +replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
   6.301 +replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
   6.302 +
   6.303 +// In the third stage we use the eval function to compile the text into a
   6.304 +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
   6.305 +// in JavaScript: it can begin a block or an object literal. We wrap the text
   6.306 +// in parens to eliminate the ambiguity.
   6.307 +
   6.308 +                j = eval('(' + text + ')');
   6.309 +
   6.310 +// In the optional fourth stage, we recursively walk the new structure, passing
   6.311 +// each name/value pair to a reviver function for possible transformation.
   6.312 +
   6.313 +                return typeof reviver === 'function' ?
   6.314 +                    walk({'': j}, '') : j;
   6.315 +            }
   6.316 +
   6.317 +// If the text is not JSON parseable, then a SyntaxError is thrown.
   6.318 +
   6.319 +            throw new SyntaxError('JSON.parse');
   6.320 +        };
   6.321 +    }
   6.322 +}());
   6.323 +
   6.324 +
   6.325 +// Augment the basic prototypes if they have not already been augmented.
   6.326 +// These forms are obsolete. It is recommended that JSON.stringify and
   6.327 +// JSON.parse be used instead.
   6.328 +
   6.329 +if (!Object.prototype.toJSONString) {
   6.330 +    Object.prototype.toJSONString = function (filter) {
   6.331 +        return JSON.stringify(this, filter);
   6.332 +    };
   6.333 +    Object.prototype.parseJSON = function (filter) {
   6.334 +        return JSON.parse(this, filter);
   6.335 +    };
   6.336 +}
   6.337 \ No newline at end of file
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/libxen/test/najax.js	Mon May 24 19:49:40 2010 +0300
     7.3 @@ -0,0 +1,156 @@
     7.4 +function xen_core() {
     7.5 +var loadvar=false;
     7.6 +var version='1.0';
     7.7 +var url='/json';
     7.8 +function CreateHttpRequestObject()
     7.9 +{
    7.10 +	var http_request=false;
    7.11 +
    7.12 +
    7.13 +	if (window.XMLHttpRequest) { // Mozilla, Safari,...
    7.14 +		http_request = new XMLHttpRequest();
    7.15 +		if (http_request.overrideMimeType) http_request.overrideMimeType('text/xml');
    7.16 +	} else if (window.ActiveXObject) { // IE
    7.17 +		try {
    7.18 +			http_request = new ActiveXObject("Msxml2.XMLHTTP");
    7.19 +			}			
    7.20 +		catch (e) {
    7.21 +		try {
    7.22 +			http_request = new ActiveXObject("Microsoft.XMLHTTP");
    7.23 +			}
    7.24 +		catch (e) {return 0;}
    7.25 +		}
    7.26 +	}
    7.27 +
    7.28 +	return http_request;
    7.29 +}
    7.30 +
    7.31 +this.ApiCall=function(method,params,doupdate,callback,error_callback)
    7.32 +{
    7.33 +var data=this.xmlRpc(method, params);
    7.34 +this.makeRequest(url,'POST',data,1,doupdate,callback,error_callback);
    7.35 +}
    7.36 +
    7.37 +this.makeRequest=function(url,method,data,async,doupdate,callback,error_callback) {
    7.38 +
    7.39 +       var httpRequest=CreateHttpRequestObject();
    7.40 +	   var result;
    7.41 +	   var cur;
    7.42 +	   var par;
    7.43 +	if(!httpRequest)
    7.44 +	{
    7.45 +	alert('AJAX not supported.');
    7.46 +		   return false;
    7.47 +	}
    7.48 +		
    7.49 +    httpRequest.onreadystatechange = function() { 
    7.50 +		        if (httpRequest.readyState == 4) {
    7.51 +            if (httpRequest.status == 200) {
    7.52 +				var xmldoc = httpRequest.responseXML;
    7.53 +				if(xmldoc)
    7.54 +				{
    7.55 +				//first looking for Status
    7.56 +				//todo da go napravq po dobre
    7.57 +					cur=xmldoc.getElementsByTagName('member');
    7.58 +						if(cur[0].childNodes[0].childNodes[0].nodeValue=='Status')
    7.59 +							{
    7.60 +								if(cur[0].childNodes[1].childNodes[0].nodeValue!='Success')
    7.61 +									{ //request error
    7.62 +									alert('error '+httpRequest.responseText);
    7.63 +									// call error_callback
    7.64 +									return;
    7.65 +									}
    7.66 +							}
    7.67 +
    7.68 +					if(cur[1].childNodes[0].childNodes[0].nodeValue=='Value')
    7.69 +					{
    7.70 +					result=eval('(' + cur[1].childNodes[1].childNodes[0].nodeValue + ')');
    7.71 +					}
    7.72 +					
    7.73 +					
    7.74 +					if(doupdate)
    7.75 +					{
    7.76 +					//update the global database
    7.77 +					}
    7.78 +					
    7.79 +					if(callback)
    7.80 +					{
    7.81 +					callback(result,xmldoc);
    7.82 +					}
    7.83 +				}
    7.84 +			 	else
    7.85 +				{
    7.86 +				alert(httpRequest.responseText);
    7.87 +				}
    7.88 +				if(loadvar==false)
    7.89 +				{
    7.90 +				document.getElementById(loadvar).style.display="none";
    7.91 +				}
    7.92 +			} else {
    7.93 +				if(httpRequest.status!=0)
    7.94 +				alert("Error: status code is " + httpRequest.status);
    7.95 +					}
    7.96 +		}
    7.97 +	};
    7.98 +		
    7.99 +		if(loadvar!=false)
   7.100 +				{
   7.101 +				document.getElementById(loadvar).style.display="";
   7.102 +				}
   7.103 +        httpRequest.open(method, url, async);
   7.104 +
   7.105 +		if(method=='POST')
   7.106 +		{
   7.107 +			httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   7.108 +		}
   7.109 +
   7.110 +		httpRequest.send(data);
   7.111 +	
   7.112 +    }
   7.113 +
   7.114 +this.serializeToXml=function(data) {
   7.115 +			switch (typeof data) {
   7.116 +			case 'boolean':
   7.117 +				return '<boolean>'+ ((data) ? '1' : '0') +'</boolean>';
   7.118 +			case 'number':
   7.119 +				var parsed = parseInt(data);
   7.120 +				if(parsed == data) {
   7.121 +					return '<int>'+ data +'</int>';
   7.122 +				}
   7.123 +				return '<double>'+ data +'</double>';
   7.124 +			case 'string':
   7.125 +				return '<string>'+ data +'</string>';
   7.126 +			case 'object':
   7.127 +				if(data instanceof Date) {
   7.128 +					return '<dateTime.iso8601>'+ data.getFullYear() + pad2(data.getMonth()) + pad2(data.getDate()) +'T'+ pad2(data.getHours()) +':'+ pad2(data.getMinutes()) +':'+ pad2(data.getSeconds()) +'</dateTime.iso8601>';
   7.129 +				} else if(data instanceof Array) {
   7.130 +					var ret = '<array><data>'+"\n";
   7.131 +					for (var i=0; i < data.length; i++) {
   7.132 +						ret += '  <value>'+ serializeToXml(data[i]) +"</value>\n";
   7.133 +					}
   7.134 +					ret += '</data></array>';
   7.135 +					return ret;
   7.136 +				} else {
   7.137 +					var ret = '<struct>'+"\n";
   7.138 +					for (key in data)
   7.139 +					{
   7.140 +					var value = data[key];
   7.141 +					ret += "  <member><name>"+ key +"</name><value>";
   7.142 +					ret += serializeToXml(value) +"</value></member>\n";
   7.143 +					}
   7.144 +					ret += '</struct>';
   7.145 +					return ret;
   7.146 +				}
   7.147 +			}
   7.148 +		}
   7.149 +this.xmlRpc=function(method, params) {
   7.150 +			var ret='<?xml version="'+version+'"?><methodCall><methodName>'+method+'</methodName><params>';
   7.151 +			var len=params.length;
   7.152 +			for(var i=0; i<len; i++) {
   7.153 +				ret+="<param><value>"+this.serializeToXml(params[i])+"</value></param>";
   7.154 +			}
   7.155 +			ret+="</params></methodCall>";
   7.156 +			return ret;
   7.157 +		}
   7.158 +}
   7.159 +	
   7.160 \ No newline at end of file
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/libxen/test/php.default.min.js	Mon May 24 19:49:40 2010 +0300
     8.3 @@ -0,0 +1,993 @@
     8.4 +/* 
     8.5 + * More info at: http://phpjs.org
     8.6 + * 
     8.7 + * This is version: 3.16
     8.8 + * php.js is copyright 2010 Kevin van Zonneveld.
     8.9 + * 
    8.10 + * Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
    8.11 + * (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
    8.12 + * (http://getsprink.com), Waldo Malqui Silva, Paulo Ricardo F. Santos, Jonas
    8.13 + * Raoni Soares Silva (http://www.jsfromhell.com), Jack, Philip Peterson, Ates
    8.14 + * Goral (http://magnetiq.com), Legaev Andrey, Ratheous, Alex, Martijn
    8.15 + * Wieringa, Nate, lmeyrick (https://sourceforge.net/projects/bcmath-js/),
    8.16 + * Philippe Baumann, Enrique Gonzalez, Webtoolkit.info
    8.17 + * (http://www.webtoolkit.info/), travc, Ole Vrijenhoek, Carlos R. L.
    8.18 + * Rodrigues (http://www.jsfromhell.com), Jani Hartikainen, Ash Searle
    8.19 + * (http://hexmen.com/blog/), Erkekjetter, Johnny Mast
    8.20 + * (http://www.phpvrouwen.nl), pilus, marrtins, Rafał Kukawski
    8.21 + * (http://blog.kukawski.pl), T.Wild, Michael Grier, stag019, WebDevHobo
    8.22 + * (http://webdevhobo.blogspot.com/), GeekFG (http://geekfg.blogspot.com),
    8.23 + * Andrea Giammarchi (http://webreflection.blogspot.com), d3x,
    8.24 + * http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
    8.25 + * majak, gettimeofday, Tim de Koning (http://www.kingsquare.nl), Joris,
    8.26 + * Martin (http://www.erlenwiese.de/), Steven Levithan
    8.27 + * (http://blog.stevenlevithan.com), Marc Palau, Paul Smith, Robin, David,
    8.28 + * Imgen Tata (http://www.myipdf.com/), Mailfaker (http://www.weedem.fr/),
    8.29 + * mdsjack (http://www.mdsjack.bo.it), felix, Mirek Slugen, Public Domain
    8.30 + * (http://www.json.org/json2.js), Chris, Oleg Eremeev, KELAN, Karol Kowalski,
    8.31 + * Michael White, Breaking Par Consulting Inc
    8.32 + * (http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
    8.33 + * Josh Fraser
    8.34 + * (http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
    8.35 + * Arpad Ray (mailto:arpad@php.net), Felix Geisendoerfer
    8.36 + * (http://www.debuggable.com/felix), Caio Ariede (http://caioariede.com),
    8.37 + * Aman Gupta, Thunder.m, Lars Fischer, Sakimori, Tyler Akins
    8.38 + * (http://rumkin.com), Alfonso Jimenez (http://www.alfonsojimenez.com),
    8.39 + * Kankrelune (http://www.webfaktory.info/), AJ, Steve Hilder, gorthaur,
    8.40 + * Pellentesque Malesuada, saulius, Douglas Crockford
    8.41 + * (http://javascript.crockford.com), paulo kuong, mktime, john
    8.42 + * (http://www.jd-tech.net), noname, Marco, Frank Forte, duncan, Bayron
    8.43 + * Guevara, madipta, Nick Kolosov (http://sammy.ru), ger, Mateusz "loonquawl"
    8.44 + * Zalega, 0m3r, ReverseSyntax, Sanjoy Roy, Francois, Scott Cariss, Slawomir
    8.45 + * Kaniecki, Arno, Nathan, sankai, class_exists, Gilbert, marc andreu, Fox,
    8.46 + * josh, Subhasis Deb, nobbler, Steve Clay, David James, Jon Hohle, Pyerre,
    8.47 + * merabi, nord_ua, Ozh, echo is bad, Oskar Larsson Högfeldt
    8.48 + * (http://oskar-lh.name/), XoraX (http://www.xorax.info), Soren Hansen,
    8.49 + * T0bsn, Tim Wiel, Brad Touesnard, MeEtc (http://yass.meetcweb.com), Bryan
    8.50 + * Elliott, David Randall, Denny Wardhana, JT, Thomas Beaucourt
    8.51 + * (http://www.webapp.fr), Shingo, Der Simon
    8.52 + * (http://innerdom.sourceforge.net/), kenneth, Hyam Singer
    8.53 + * (http://www.impact-computing.com/), djmix, Lincoln Ramsay, Raphael (Ao
    8.54 + * RUDLER), Peter-Paul Koch (http://www.quirksmode.org/js/beat.html), T. Wild,
    8.55 + * Ole Vrijenhoek (http://www.nervous.nl/), Paul, lmeyrick
    8.56 + * (https://sourceforge.net/projects/bcmath-js/this.), LH, JB, Eugene Bulkin
    8.57 + * (http://doubleaw.com/), Stoyan Kyosev (http://www.svest.org/), Francesco, J
    8.58 + * A R, Linuxworld, Marc Jansen, Thiago Mata (http://thiagomata.blog.com),
    8.59 + * Matt Bradley, date, Kristof Coomans (SCK-CEN Belgian Nucleair Research
    8.60 + * Centre), Pierre-Luc Paour, Martin Pool, Brant Messenger
    8.61 + * (http://www.brantmessenger.com/), Kirk Strobeck, Saulo Vallory, Christoph,
    8.62 + * Wagner B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong
    8.63 + * (http://carrot.org/), Daniel Esteban, strftime, Rick Waldron, Mick@el,
    8.64 + * Anton Ongson, Simon Willison (http://simonwillison.net), Gabriel Paderni,
    8.65 + * Philipp Lenssen, Marco van Oort, Bug?, Blues (http://tech.bluesmoon.info/),
    8.66 + * Tomasz Wesolowski, rezna, Eric Nagel, Bobby Drake, Luke Godfrey, Pul,
    8.67 + * uestla, Alan C, Ulrich, Yves Sucaet, sowberry, Norman "zEh" Fuchs, hitwork,
    8.68 + * Zahlii, johnrembo, Nick Callen, Steven Levithan (stevenlevithan.com),
    8.69 + * ejsanders, Aidan Lister (http://aidanlister.com/), Brian Tafoya
    8.70 + * (http://www.premasolutions.com/), Philippe Jausions
    8.71 + * (http://pear.php.net/user/jausions), Rob, Orlando, HKM, metjay, strcasecmp,
    8.72 + * strcmp, Taras Bogach, jpfle, ChaosNo1, Alexander Ermolaev
    8.73 + * (http://snippets.dzone.com/user/AlexanderErmolaev), dptr1988, kilops, Le
    8.74 + * Torbi, James, DxGx, Pedro Tainha (http://www.pedrotainha.com),
    8.75 + * penutbutterjelly, Christian Doebler, baris ozdil, Greg Frazier, Tod
    8.76 + * Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M Beedie,
    8.77 + * FGFEmperor, gabriel paderni, Atli Þór, Maximusya, daniel airton wermann
    8.78 + * (http://wermann.com.br), 3D-GRAF, Yannoo, jakes, T.J. Leahy, FremyCompany,
    8.79 + * stensi, Billy, vlado houba, Itsacon (http://www.itsacon.net/), Jalal
    8.80 + * Berrami, Matteo, Victor, Tim de Koning, Luis Salazar
    8.81 + * (http://www.freaky-media.com/), taith, Manish, fearphage
    8.82 + * (http://http/my.opera.com/fearphage/), Cord, davook, Benjamin Lupton,
    8.83 + * Garagoth, Andrej Pavlovic, Dino, William, rem, Russell Walker
    8.84 + * (http://www.nbill.co.uk/), Jamie Beck (http://www.terabit.ca/), setcookie,
    8.85 + * Michael, YUI Library:
    8.86 + * http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at
    8.87 + * http://hacks.bluesmoon.info/strftime/strftime.js, DtTvB
    8.88 + * (http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, meo,
    8.89 + * Greenseed, Luke Smith (http://lucassmith.name), Kheang Hok Chin
    8.90 + * (http://www.distantia.ca/), Rival, Diogo Resende, Allan Jensen
    8.91 + * (http://www.winternet.no), Howard Yeend, Jay Klehr, Amir Habibi
    8.92 + * (http://www.residence-mixte.com/), mk.keck, Yen-Wei Liu, Leslie Hoare, Ben
    8.93 + * Bryan, Cagri Ekin, booeyOH
    8.94 + * 
    8.95 + * Dual licensed under the MIT (MIT-LICENSE.txt)
    8.96 + * and GPL (GPL-LICENSE.txt) licenses.
    8.97 + * 
    8.98 + * Permission is hereby granted, free of charge, to any person obtaining a
    8.99 + * copy of this software and associated documentation files (the
   8.100 + * "Software"), to deal in the Software without restriction, including
   8.101 + * without limitation the rights to use, copy, modify, merge, publish,
   8.102 + * distribute, sublicense, and/or sell copies of the Software, and to
   8.103 + * permit persons to whom the Software is furnished to do so, subject to
   8.104 + * the following conditions:
   8.105 + * 
   8.106 + * The above copyright notice and this permission notice shall be included
   8.107 + * in all copies or substantial portions of the Software.
   8.108 + * 
   8.109 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   8.110 + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   8.111 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   8.112 + * IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
   8.113 + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
   8.114 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
   8.115 + * OTHER DEALINGS IN THE SOFTWARE.
   8.116 + */ 
   8.117 +
   8.118 +
   8.119 +// Compression: minified
   8.120 +
   8.121 +
   8.122 +function abs(mixed_number){return Math.abs(mixed_number)||0;}
   8.123 +function acos(arg){return Math.acos(arg);}
   8.124 +function acosh(arg){return Math.log(arg+Math.sqrt(arg*arg-1));}
   8.125 +function addslashes(str){return(str+'').replace(/[\\"']/g,'\\$&').replace(/\u0000/g,'\\0');}
   8.126 +function array_change_key_case(array){var case_fn,tmp_ar={},argc=arguments.length,argv=arguments,key;if(array instanceof Array){return array;}
   8.127 +if(array instanceof Object){if(argc===1||argv[1]==='CASE_LOWER'||argv[1]===0){case_fn="toLowerCase";}else{case_fn="toUpperCase";}
   8.128 +for(key in array){tmp_ar[key[case_fn]()]=array[key];}
   8.129 +return tmp_ar;}
   8.130 +return false;}
   8.131 +function array_chunk(input,size){for(var x,i=0,c=-1,l=input.length,n=[];i<l;i++){(x=i%size)?n[c][x]=input[i]:n[++c]=[input[i]];}
   8.132 +return n;}
   8.133 +function array_combine(keys,values){var new_array={},keycount=keys&&keys.length,i=0;if(typeof keys!=='object'||typeof values!=='object'||typeof keycount!=='number'||typeof values.length!=='number'||!keycount){return false;}
   8.134 +if(keycount!=values.length){return false;}
   8.135 +for(i=0;i<keycount;i++){new_array[keys[i]]=values[i];}
   8.136 +return new_array;}
   8.137 +function array_count_values(array){var tmp_arr={},key='',t='';var __getType=function(obj){var t=typeof obj;t=t.toLowerCase();if(t==="object"){t="array";}
   8.138 +return t;};var __countValue=function(value){switch(typeof(value)){case"number":if(Math.floor(value)!==value){return;}
   8.139 +case"string":if(value in this&&this.hasOwnProperty(value)){++this[value];}else{this[value]=1;}}};t=__getType(array);if(t==='array'){for(key in array){if(array.hasOwnProperty(key)){__countValue.call(tmp_arr,array[key]);}}}
   8.140 +return tmp_arr;}
   8.141 +function array_diff(){var arr1=arguments[0],retArr={};var k1='',i=1,k='',arr={};arr1keys:for(k1 in arr1){for(i=1;i<arguments.length;i++){arr=arguments[i];for(k in arr){if(arr[k]===arr1[k1]){continue arr1keys;}}
   8.142 +retArr[k1]=arr1[k1];}}
   8.143 +return retArr;}
   8.144 +function array_diff_assoc(){var arr1=arguments[0],retArr={};var k1='',i=1,k='',arr={};arr1keys:for(k1 in arr1){for(i=1;i<arguments.length;i++){arr=arguments[i];for(k in arr){if(arr[k]===arr1[k1]&&k===k1){continue arr1keys;}}
   8.145 +retArr[k1]=arr1[k1];}}
   8.146 +return retArr;}
   8.147 +function array_diff_key(){var arr1=arguments[0],retArr={};var k1='',i=1,k='',arr={};arr1keys:for(k1 in arr1){for(i=1;i<arguments.length;i++){arr=arguments[i];for(k in arr){if(k===k1){continue arr1keys;}}
   8.148 +retArr[k1]=arr1[k1];}}
   8.149 +return retArr;}
   8.150 +function array_diff_uassoc(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var arr={},i=1,k1='',k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(arr[k]===arr1[k1]&&cb(k,k1)===0){continue arr1keys;}}
   8.151 +retArr[k1]=arr1[k1];}}
   8.152 +return retArr;}
   8.153 +function array_diff_ukey(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var arr={},i=1,k1='',k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(cb(k,k1)===0){continue arr1keys;}}
   8.154 +retArr[k1]=arr1[k1];}}
   8.155 +return retArr;}
   8.156 +function array_fill(start_index,num,mixed_val){var key,tmp_arr={};if(!isNaN(start_index)&&!isNaN(num)){for(key=0;key<num;key++){tmp_arr[(key+start_index)]=mixed_val;}}
   8.157 +return tmp_arr;}
   8.158 +function array_fill_keys(keys,value){var retObj={},key='';for(key in keys){retObj[keys[key]]=value;}
   8.159 +return retObj;}
   8.160 +function array_filter(arr,func){var retObj={},k;for(k in arr){if(func(arr[k])){retObj[k]=arr[k];}}
   8.161 +return retObj;}
   8.162 +function array_flip(trans){var key,tmp_ar={};for(key in trans){tmp_ar[trans[key]]=key;}
   8.163 +return tmp_ar;}
   8.164 +function array_intersect(){var arr1=arguments[0],retArr={};var k1='',arr={},i=0,k='';arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length;i++){arr=arguments[i];for(k in arr){if(arr[k]===arr1[k1]){if(i===arguments.length-1){retArr[k1]=arr1[k1];}
   8.165 +continue arrs;}}
   8.166 +continue arr1keys;}}
   8.167 +return retArr;}
   8.168 +function array_intersect_assoc(){var arr1=arguments[0],retArr={};var k1='',arr={},i=0,k='';arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length;i++){arr=arguments[i];for(k in arr){if(arr[k]===arr1[k1]&&k===k1){if(i===arguments.length-1){retArr[k1]=arr1[k1];}
   8.169 +continue arrs;}}
   8.170 +continue arr1keys;}}
   8.171 +return retArr;}
   8.172 +function array_intersect_key(){var arr1=arguments[0],retArr={};var k1='',arr={},i=0,k='';arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length;i++){arr=arguments[i];for(k in arr){if(k===k1){if(i===arguments.length-1){retArr[k1]=arr1[k1];}
   8.173 +continue arrs;}}
   8.174 +continue arr1keys;}}
   8.175 +return retArr;}
   8.176 +function array_intersect_uassoc(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var k1='',i=1,arr={},k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(arr[k]===arr1[k1]&&cb(k,k1)===0){if(i===arguments.length-2){retArr[k1]=arr1[k1];}
   8.177 +continue arrs;}}
   8.178 +continue arr1keys;}}
   8.179 +return retArr;}
   8.180 +function array_intersect_ukey(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var k1='',i=1,arr={},k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(cb(k,k1)===0){if(i===arguments.length-2){retArr[k1]=arr1[k1];}
   8.181 +continue arrs;}}
   8.182 +continue arr1keys;}}
   8.183 +return retArr;}
   8.184 +function array_key_exists(key,search){if(!search||(search.constructor!==Array&&search.constructor!==Object)){return false;}
   8.185 +return key in search;}
   8.186 +function array_keys(input,search_value,argStrict){var tmp_arr={},strict=!!argStrict,include=true,cnt=0;var key='';for(key in input){include=true;if(search_value!=undefined){if(strict&&input[key]!==search_value){include=false;}else if(input[key]!=search_value){include=false;}}
   8.187 +if(include){tmp_arr[cnt]=key;cnt++;}}
   8.188 +return tmp_arr;}
   8.189 +function array_map(callback){var argc=arguments.length,argv=arguments;var j=argv[1].length,i=0,k=1,m=0;var tmp=[],tmp_ar=[];while(i<j){while(k<argc){tmp[m++]=argv[k++][i];}
   8.190 +m=0;k=1;if(callback){if(typeof callback==='string'){callback=this.window[callback];}
   8.191 +tmp_ar[i++]=callback.apply(null,tmp);}else{tmp_ar[i++]=tmp;}
   8.192 +tmp=[];}
   8.193 +return tmp_ar;}
   8.194 +function array_merge(){var args=Array.prototype.slice.call(arguments),retObj={},k,j=0,i=0,retArr=true;for(i=0;i<args.length;i++){if(!(args[i]instanceof Array)){retArr=false;break;}}
   8.195 +if(retArr){retArr=[];for(i=0;i<args.length;i++){retArr=retArr.concat(args[i]);}
   8.196 +return retArr;}
   8.197 +var ct=0;for(i=0,ct=0;i<args.length;i++){if(args[i]instanceof Array){for(j=0;j<args[i].length;j++){retObj[ct++]=args[i][j];}}else{for(k in args[i]){if(args[i].hasOwnProperty(k)){if(parseInt(k,10)+''===k){retObj[ct++]=args[i][k];}else{retObj[k]=args[i][k];}}}}}
   8.198 +return retObj;}
   8.199 +function array_merge_recursive(arr1,arr2){var idx='';if((arr1&&(arr1 instanceof Array))&&(arr2&&(arr2 instanceof Array))){for(idx in arr2){arr1.push(arr2[idx]);}}else if((arr1&&(arr1 instanceof Object))&&(arr2&&(arr2 instanceof Object))){for(idx in arr2){if(idx in arr1){if(typeof arr1[idx]=='object'&&typeof arr2=='object'){arr1[idx]=this.array_merge(arr1[idx],arr2[idx]);}else{arr1[idx]=arr2[idx];}}else{arr1[idx]=arr2[idx];}}}
   8.200 +return arr1;}
   8.201 +function array_pad(input,pad_size,pad_value){var pad=[],newArray=[],newLength,i=0;if(input instanceof Array&&!isNaN(pad_size)){newLength=((pad_size<0)?(pad_size*-1):pad_size);if(newLength>input.length){for(i=0;i<(newLength-input.length);i++){newArray[i]=pad_value;}
   8.202 +pad=((pad_size<0)?newArray.concat(input):input.concat(newArray));}else{pad=input;}}
   8.203 +return pad;}
   8.204 +function array_pop(inputArr){var key='',lastKey='';if(inputArr.hasOwnProperty('length')){if(!inputArr.length){return null;}
   8.205 +return inputArr.pop();}else{for(key in inputArr){if(inputArr.hasOwnProperty(key)){lastKey=key;}}
   8.206 +if(lastKey){var tmp=inputArr[lastKey];delete(inputArr[lastKey]);return tmp;}else{return null;}}}
   8.207 +function array_product(input){var Index=0,product=1;if(input instanceof Array){while(Index<input.length){product*=(!isNaN(input[Index])?input[Index]:0);Index++;}}else{product=null;}
   8.208 +return product;}
   8.209 +function array_push(inputArr){var i=0,pr='',argv=arguments,argc=argv.length,allDigits=/^\d$/,size=0,highestIdx=0,len=0;if(inputArr.hasOwnProperty('length')){for(i=1;i<argc;i++){inputArr[inputArr.length]=argv[i];}
   8.210 +return inputArr.length;}
   8.211 +for(pr in inputArr){if(inputArr.hasOwnProperty(pr)){++len;if(pr.search(allDigits)!==-1){size=parseInt(pr,10);highestIdx=size>highestIdx?size:highestIdx;}}}
   8.212 +for(i=1;i<argc;i++){inputArr[++highestIdx]=argv[i];}
   8.213 +return len+i-1;}
   8.214 +function array_rand(input,num_req){var indexes=[];var ticks=num_req||1;var checkDuplicate=function(input,value){var exist=false,index=0;while(index<input.length){if(input[index]===value){exist=true;break;}
   8.215 +index++;}
   8.216 +return exist;};if(input instanceof Array&&ticks<=input.length){while(true){var rand=Math.floor((Math.random()*input.length));if(indexes.length===ticks){break;}
   8.217 +if(!checkDuplicate(indexes,rand)){indexes.push(rand);}}}else{indexes=null;}
   8.218 +return((ticks==1)?indexes.join():indexes);}
   8.219 +function array_reduce(a_input,callback){var lon=a_input.length;var res=0,i=0;var tmp=[];for(i=0;i<lon;i+=2){tmp[0]=a_input[i];if(a_input[(i+1)]){tmp[1]=a_input[(i+1)];}else{tmp[1]=0;}
   8.220 +res+=callback.apply(null,tmp);tmp=[];}
   8.221 +return res;}
   8.222 +function array_reverse(array,preserve_keys){var arr_len=array.length,newkey=0,tmp_arr={},key='';preserve_keys=!!preserve_keys;for(key in array){newkey=arr_len-key-1;tmp_arr[preserve_keys?key:newkey]=array[key];}
   8.223 +return tmp_arr;}
   8.224 +function array_search(needle,haystack,argStrict){var strict=!!argStrict;var key='';for(key in haystack){if((strict&&haystack[key]===needle)||(!strict&&haystack[key]==needle)){return key;}}
   8.225 +return false;}
   8.226 +function array_shift(inputArr){var props=false,shift=undefined,pr='',allDigits=/^\d$/,int_ct=-1,_checkToUpIndices=function(arr,ct,key){if(arr[ct]!==undefined){var tmp=ct;ct+=1;if(ct===key){ct+=1;}
   8.227 +ct=_checkToUpIndices(arr,ct,key);arr[ct]=arr[tmp];delete arr[tmp];}
   8.228 +return ct;};if(inputArr.length===0){return null;}
   8.229 +if(inputArr.length>0){return inputArr.shift();}}
   8.230 +function array_slice(arr,offst,lgth,preserve_keys){var key='';if(!(arr instanceof Array)||(preserve_keys&&offst!==0)){var lgt=0,newAssoc={};for(key in arr){lgt+=1;newAssoc[key]=arr[key];}
   8.231 +arr=newAssoc;offst=(offst<0)?lgt+offst:offst;lgth=lgth===undefined?lgt:(lgth<0)?lgt+lgth-offst:lgth;var assoc={};var start=false,it=-1,arrlgth=0,no_pk_idx=0;for(key in arr){++it;if(arrlgth>=lgth){break;}
   8.232 +if(it==offst){start=true;}
   8.233 +if(!start){continue;}
   8.234 +++arrlgth;if(this.is_int(key)&&!preserve_keys){assoc[no_pk_idx++]=arr[key];}else{assoc[key]=arr[key];}}
   8.235 +return assoc;}
   8.236 +if(lgth===undefined){return arr.slice(offst);}else if(lgth>=0){return arr.slice(offst,offst+lgth);}else{return arr.slice(offst,lgth);}}
   8.237 +function array_splice(arr,offst,lgth,replacement){var _checkToUpIndices=function(arr,ct,key){if(arr[ct]!==undefined){var tmp=ct;ct+=1;if(ct===key){ct+=1;}
   8.238 +ct=_checkToUpIndices(arr,ct,key);arr[ct]=arr[tmp];delete arr[tmp];}
   8.239 +return ct;};if(replacement&&typeof replacement!=='object'){replacement=[replacement];}
   8.240 +if(lgth===undefined){lgth=offst>=0?arr.length-offst:-offst;}else if(lgth<0){lgth=(offst>=0?arr.length-offst:-offst)+lgth;}
   8.241 +if(!(arr instanceof Array)){var lgt=0,ct=-1,rmvd=[],rmvdObj={},repl_ct=-1,int_ct=-1;var returnArr=true,rmvd_ct=0,rmvd_lgth=0,key='';for(key in arr){lgt+=1;}
   8.242 +offst=(offst>=0)?offst:lgt+offst;for(key in arr){ct+=1;if(ct<offst){if(this.is_int(key)){int_ct+=1;if(parseInt(key,10)===int_ct){continue;}
   8.243 +_checkToUpIndices(arr,int_ct,key);arr[int_ct]=arr[key];delete arr[key];}
   8.244 +continue;}
   8.245 +if(returnArr&&this.is_int(key)){rmvd.push(arr[key]);rmvdObj[rmvd_ct++]=arr[key];}else{rmvdObj[key]=arr[key];returnArr=false;}
   8.246 +rmvd_lgth+=1;if(replacement&&replacement[++repl_ct]){arr[key]=replacement[repl_ct];}else{delete arr[key];}}
   8.247 +return returnArr?rmvd:rmvdObj;}
   8.248 +if(replacement){replacement.unshift(offst,lgth);return Array.prototype.splice.apply(arr,replacement);}
   8.249 +return arr.splice(offst,lgth);}
   8.250 +function array_sum(array){var key,sum=0;if(typeof array!=='object'){return null;}
   8.251 +for(key in array){sum+=(array[key]*1);}
   8.252 +return sum;}
   8.253 +function array_udiff(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var arr='',i=1,k1='',k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(cb(arr[k],arr1[k1])===0){continue arr1keys;}}
   8.254 +retArr[k1]=arr1[k1];}}
   8.255 +return retArr;}
   8.256 +function array_udiff_assoc(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var arr={},i=1,k1='',k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(cb(arr[k],arr1[k1])===0&&k===k1){continue arr1keys;}}
   8.257 +retArr[k1]=arr1[k1];}}
   8.258 +return retArr;}
   8.259 +function array_udiff_uassoc(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1],cb0=arguments[arguments.length-2];var k1='',i=1,k='',arr={};cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;cb0=(typeof cb0==='string')?this.window[cb0]:(cb0 instanceof Array)?this.window[cb0[0]][cb0[1]]:cb0;arr1keys:for(k1 in arr1){for(i=1;i<arguments.length-2;i++){arr=arguments[i];for(k in arr){if(cb0(arr[k],arr1[k1])===0&&cb(k,k1)===0){continue arr1keys;}}
   8.260 +retArr[k1]=arr1[k1];}}
   8.261 +return retArr;}
   8.262 +function array_uintersect(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var k1='',i=1,arr={},k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(cb(arr[k],arr1[k1])===0){if(i===arguments.length-2){retArr[k1]=arr1[k1];}
   8.263 +continue arrs;}}
   8.264 +continue arr1keys;}}
   8.265 +return retArr;}
   8.266 +function array_uintersect_assoc(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1];var k1='',i=1,arr={},k='';cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length-1;i++){arr=arguments[i];for(k in arr){if(cb(arr[k],arr1[k1])===0&&k===k1){if(i===arguments.length-2){retArr[k1]=arr1[k1];}
   8.267 +continue arrs;}}
   8.268 +continue arr1keys;}}
   8.269 +return retArr;}
   8.270 +function array_uintersect_uassoc(){var arr1=arguments[0],retArr={},cb=arguments[arguments.length-1],cb0=arguments[arguments.length-2];var k1='',i=1,k='',arr={};cb=(typeof cb==='string')?this.window[cb]:(cb instanceof Array)?this.window[cb[0]][cb[1]]:cb;cb0=(typeof cb0==='string')?this.window[cb0]:(cb0 instanceof Array)?this.window[cb0[0]][cb0[1]]:cb0;arr1keys:for(k1 in arr1){arrs:for(i=1;i<arguments.length-2;i++){arr=arguments[i];for(k in arr){if(cb0(arr[k],arr1[k1])===0&&cb(k,k1)===0){if(i===arguments.length-3){retArr[k1]=arr1[k1];}
   8.271 +continue arrs;}}
   8.272 +continue arr1keys;}}
   8.273 +return retArr;}
   8.274 +function array_unique(inputArr){var key='',tmp_arr2={},val='';var __array_search=function(needle,haystack){var fkey='';for(fkey in haystack){if(haystack.hasOwnProperty(fkey)){if((haystack[fkey]+'')===(needle+'')){return fkey;}}}
   8.275 +return false;};for(key in inputArr){if(inputArr.hasOwnProperty(key)){val=inputArr[key];if(false===__array_search(val,tmp_arr2)){tmp_arr2[key]=val;}}}
   8.276 +return tmp_arr2;}
   8.277 +function array_unshift(array){var argc=arguments.length,argv=arguments,i;for(i=1;i<argc;i++){array.unshift(argv[i]);}
   8.278 +return(array.length);}
   8.279 +function array_values(input){var tmp_arr=[],cnt=0;var key='';for(key in input){tmp_arr[cnt]=input[key];cnt++;}
   8.280 +return tmp_arr;}
   8.281 +function array_walk(array,funcname,userdata){var key;if(typeof array!=='object'||array===null){return false;}
   8.282 +for(key in array){if(typeof(userdata)!=='undefined'){eval(funcname+'( array [key] , key , userdata  )');}else{eval(funcname+'(  userdata ) ');}}
   8.283 +return true;}
   8.284 +function array_walk_recursive(array,funcname,userdata){var key;if(typeof array!='object'){return false;}
   8.285 +for(key in array){if(typeof array[key]=='object'){return this.array_walk_recursive(array[key],funcname,userdata);}
   8.286 +if(typeof(userdata)!='undefined'){eval(funcname+'( array [key] , key , userdata  )');}else{eval(funcname+'(  userdata ) ');}}
   8.287 +return true;}
   8.288 +function arsort(inputArr,sort_flags){var valArr=[],keyArr=[],k,i,ret,sorter,that=this,strictForIn=false,populateArr=[];switch(sort_flags){case'SORT_STRING':sorter=function(a,b){return that.strnatcmp(b,a);};break;case'SORT_LOCALE_STRING':var loc=this.i18n_loc_get_default();sorter=this.php_js.i18nLocales[loc].sorting;break;case'SORT_NUMERIC':sorter=function(a,b){return(a-b);};break;case'SORT_REGULAR':default:sorter=function(a,b){if(a>b){return 1;}
   8.289 +if(a<b){return-1;}
   8.290 +return 0;};break;}
   8.291 +var bubbleSort=function(keyArr,inputArr){var i,j,tempValue,tempKeyVal;for(i=inputArr.length-2;i>=0;i--){for(j=0;j<=i;j++){ret=sorter(inputArr[j+1],inputArr[j]);if(ret>0){tempValue=inputArr[j];inputArr[j]=inputArr[j+1];inputArr[j+1]=tempValue;tempKeyVal=keyArr[j];keyArr[j]=keyArr[j+1];keyArr[j+1]=tempKeyVal;}}}};this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
   8.292 +try{bubbleSort(keyArr,valArr);}catch(e){return false;}
   8.293 +for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
   8.294 +return strictForIn?true:populateArr;}
   8.295 +function asin(arg){return Math.asin(arg);}
   8.296 +function asinh(arg){return Math.log(arg+Math.sqrt(arg*arg+1));}
   8.297 +function asort(inputArr,sort_flags){var valArr=[],keyArr=[],k,i,ret,sorter,that=this,strictForIn=false,populateArr=[];switch(sort_flags){case'SORT_STRING':sorter=function(a,b){return that.strnatcmp(a,b);};break;case'SORT_LOCALE_STRING':var loc=this.i18n_loc_get_default();sorter=this.php_js.i18nLocales[loc].sorting;break;case'SORT_NUMERIC':sorter=function(a,b){return(a-b);};break;case'SORT_REGULAR':default:sorter=function(a,b){if(a>b){return 1;}
   8.298 +if(a<b){return-1;}
   8.299 +return 0;};break;}
   8.300 +var bubbleSort=function(keyArr,inputArr){var i,j,tempValue,tempKeyVal;for(i=inputArr.length-2;i>=0;i--){for(j=0;j<=i;j++){ret=sorter(inputArr[j+1],inputArr[j]);if(ret<0){tempValue=inputArr[j];inputArr[j]=inputArr[j+1];inputArr[j+1]=tempValue;tempKeyVal=keyArr[j];keyArr[j]=keyArr[j+1];keyArr[j+1]=tempKeyVal;}}}};this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
   8.301 +try{bubbleSort(keyArr,valArr);}catch(e){return false;}
   8.302 +for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
   8.303 +return strictForIn?true:populateArr;}
   8.304 +function atan(arg){return Math.atan(arg);}
   8.305 +function atan2(y,x){return Math.atan2(y,x);}
   8.306 +function atanh(arg){return 0.5*Math.log((1+arg)/(1-arg));}
   8.307 +function base64_decode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,dec="",tmp_arr=[];if(!data){return data;}
   8.308 +data+='';do{h1=b64.indexOf(data.charAt(i++));h2=b64.indexOf(data.charAt(i++));h3=b64.indexOf(data.charAt(i++));h4=b64.indexOf(data.charAt(i++));bits=h1<<18|h2<<12|h3<<6|h4;o1=bits>>16&0xff;o2=bits>>8&0xff;o3=bits&0xff;if(h3==64){tmp_arr[ac++]=String.fromCharCode(o1);}else if(h4==64){tmp_arr[ac++]=String.fromCharCode(o1,o2);}else{tmp_arr[ac++]=String.fromCharCode(o1,o2,o3);}}while(i<data.length);dec=tmp_arr.join('');dec=this.utf8_decode(dec);return dec;}
   8.309 +function base64_encode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc="",tmp_arr=[];if(!data){return data;}
   8.310 +data=this.utf8_encode(data+'');do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&0x3f;h2=bits>>12&0x3f;h3=bits>>6&0x3f;h4=bits&0x3f;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4);}while(i<data.length);enc=tmp_arr.join('');switch(data.length%3){case 1:enc=enc.slice(0,-2)+'==';break;case 2:enc=enc.slice(0,-1)+'=';break;}
   8.311 +return enc;}
   8.312 +function base_convert(number,frombase,tobase){return parseInt(number+'',frombase|0).toString(tobase|0);}
   8.313 +function bin2hex(s){var i,f=0,a=[];s+='';f=s.length;for(i=0;i<f;i++){a[i]=s.charCodeAt(i).toString(16).replace(/^([\da-f])$/,"0$1");}
   8.314 +return a.join('');}
   8.315 +function bindec(binary_string){binary_string=(binary_string+'').replace(/[^01]/gi,'');return parseInt(binary_string,2);}
   8.316 +function ceil(value){return Math.ceil(value);}
   8.317 +function checkdate(m,d,y){return m>0&&m<13&&y>0&&y<32768&&d>0&&d<=(new Date(y,m,0)).getDate();}
   8.318 +function chop(str,charlist){return this.rtrim(str,charlist);}
   8.319 +function chr(codePt){if(codePt>0xFFFF){codePt-=0x10000;return String.fromCharCode(0xD800+(codePt>>10),0xDC00+(codePt&0x3FF));}
   8.320 +else{return String.fromCharCode(codePt);}}
   8.321 +function chunk_split(body,chunklen,end){chunklen=parseInt(chunklen,10)||76;end=end||'\r\n';if(chunklen<1){return false;}
   8.322 +return body.match(new RegExp(".{0,"+chunklen+"}","g")).join(end);}
   8.323 +function class_exists(cls){var i='';cls=this.window[cls];if(typeof cls!=='function'){return false;}
   8.324 +for(i in cls.prototype){return true;}
   8.325 +for(i in cls){if(i!=='prototype'){return true;}}
   8.326 +if(cls.toSource&&cls.toSource().match(/this\./)){return true;}
   8.327 +return false;}
   8.328 +function compact(){var matrix={},that=this;var process=function(value){var i=0,l=value.length,key_value='';for(i=0;i<l;i++){key_value=value[i];if(key_value instanceof Array){process(key_value);}else{if(typeof that.window[key_value]!=='undefined'){matrix[key_value]=that.window[key_value];}}}
   8.329 +return true;};process(arguments);return matrix;}
   8.330 +function cos(arg){return Math.cos(arg);}
   8.331 +function cosh(arg){return(Math.exp(arg)+Math.exp(-arg))/2;}
   8.332 +function count(mixed_var,mode){var key,cnt=0;if(mixed_var===null){return 0;}else if(mixed_var.constructor!==Array&&mixed_var.constructor!==Object){return 1;}
   8.333 +if(mode==='COUNT_RECURSIVE'){mode=1;}
   8.334 +if(mode!=1){mode=0;}
   8.335 +for(key in mixed_var){if(mixed_var.hasOwnProperty(key)){cnt++;if(mode==1&&mixed_var[key]&&(mixed_var[key].constructor===Array||mixed_var[key].constructor===Object)){cnt+=this.count(mixed_var[key],1);}}}
   8.336 +return cnt;}
   8.337 +function count_chars(str,mode){var result={},resultArr=[],i;str=(''+str).split('').sort().join('').match(/(.)\1*/g);if((mode&1)==0){for(i=0;i!=256;i++){result[i]=0;}}
   8.338 +if(mode===2||mode===4){for(i=0;i!=str.length;i+=1){delete result[str[i].charCodeAt(0)];}
   8.339 +for(i in result){result[i]=(mode===4)?String.fromCharCode(i):0;}}else if(mode===3){for(i=0;i!=str.length;i+=1){result[i]=str[i].slice(0,1);}}else{for(i=0;i!=str.length;i+=1){result[str[i].charCodeAt(0)]=str[i].length;}}
   8.340 +if(mode<3){return result;}
   8.341 +for(i in result){resultArr.push(result[i]);}
   8.342 +return resultArr.join('');}
   8.343 +function crc32(str){str=this.utf8_encode(str);var table="00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D";var crc=0;var x=0;var y=0;crc=crc^(-1);for(var i=0,iTop=str.length;i<iTop;i++){y=(crc^str.charCodeAt(i))&0xFF;x="0x"+table.substr(y*9,8);crc=(crc>>>8)^x;}
   8.344 +return crc^(-1);}
   8.345 +function date(format,timestamp){var that=this,jsdate,f,formatChr=/\\?([a-z])/gi,formatChrCb,_pad=function(n,c){if((n=n+"").length<c){return new Array((++c)-n.length).join("0")+n;}else{return n;}},txt_words=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],txt_ordin={1:"st",2:"nd",3:"rd",21:"st",22:"nd",23:"rd",31:"st"};formatChrCb=function(t,s){return f[t]?f[t]():s;};f={d:function(){return _pad(f.j(),2);},D:function(){return f.l().slice(0,3);},j:function(){return jsdate.getDate();},l:function(){return txt_words[f.w()]+'day';},N:function(){return f.w()||7;},S:function(){return txt_ordin[f.j()]||'th';},w:function(){return jsdate.getDay();},z:function(){var a=new Date(f.Y(),f.n()-1,f.j()),b=new Date(f.Y(),0,1);return Math.round((a-b)/864e5)+1;},W:function(){var a=new Date(f.Y(),f.n()-1,f.j()-f.N()+3),b=new Date(a.getFullYear(),0,4);return 1+Math.round((a-b)/864e5/7);},F:function(){return txt_words[6+f.n()];},m:function(){return _pad(f.n(),2);},M:function(){return f.F().slice(0,3);},n:function(){return jsdate.getMonth()+1;},t:function(){return(new Date(f.Y(),f.n(),0)).getDate();},L:function(){var y=f.Y(),a=y&3,b=y%4e2,c=y%1e2;return 0+(!a&&(c||!b));},o:function(){var n=f.n(),W=f.W(),Y=f.Y();return Y+(n===12&&W<9?-1:n===1&&W>9);},Y:function(){return jsdate.getFullYear();},y:function(){return(f.Y()+"").slice(-2);},a:function(){return jsdate.getHours()>11?"pm":"am";},A:function(){return f.a().toUpperCase();},B:function(){var H=jsdate.getUTCHours()*36e2,i=jsdate.getUTCMinutes()*60,s=jsdate.getUTCSeconds();return _pad(Math.floor((H+i+s+36e2)/86.4)%1e3,3);},g:function(){return f.G()%12||12;},G:function(){return jsdate.getHours();},h:function(){return _pad(f.g(),2);},H:function(){return _pad(f.G(),2);},i:function(){return _pad(jsdate.getMinutes(),2);},s:function(){return _pad(jsdate.getSeconds(),2);},u:function(){return _pad(jsdate.getMilliseconds()*1000,6);},e:function(){return'UTC';},I:function(){var a=new Date(f.Y(),0),c=Date.UTC(f.Y(),0),b=new Date(f.Y(),6),d=Date.UTC(f.Y(),6);return 0+((a-c)!==(b-d));},O:function(){var a=jsdate.getTimezoneOffset();return(a>0?"-":"+")+_pad(Math.abs(a/60*100),4);},P:function(){var O=f.O();return(O.substr(0,3)+":"+O.substr(3,2));},T:function(){return'UTC';},Z:function(){return-jsdate.getTimezoneOffset()*60;},c:function(){return'Y-m-d\\Th:i:sP'.replace(formatChr,formatChrCb);},r:function(){return'D, d M Y H:i:s O'.replace(formatChr,formatChrCb);},U:function(){return jsdate.getTime()/1000|0;}};this.date=function(format,timestamp){that=this;jsdate=((typeof timestamp==='undefined')?new Date():(timestamp instanceof Date)?new Date(timestamp):new Date(timestamp*1000));return format.replace(formatChr,formatChrCb);};return this.date(format,timestamp);}
   8.346 +function decbin(number){if(number<0){number=0xFFFFFFFF+number+1;}
   8.347 +return parseInt(number,10).toString(2);}
   8.348 +function dechex(number){if(number<0){number=0xFFFFFFFF+number+1;}
   8.349 +return parseInt(number,10).toString(16);}
   8.350 +function decoct(number){if(number<0){number=0xFFFFFFFF+number+1;}
   8.351 +return parseInt(number,10).toString(8);}
   8.352 +function deg2rad(angle){return(angle/180)*Math.PI;}
   8.353 +function doubleval(mixed_var){return this.floatval(mixed_var);}
   8.354 +function echo(){var arg='',argc=arguments.length,argv=arguments,i=0;var win=this.window;var d=win.document;var ns_xhtml='http://www.w3.org/1999/xhtml';var ns_xul='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul';var holder;var stringToDOM=function(str,parent,ns,container){var extraNSs='';if(ns===ns_xul){extraNSs=' xmlns:html="'+ns_xhtml+'"';}
   8.355 +var stringContainer='<'+container+' xmlns="'+ns+'"'+extraNSs+'>'+str+'</'+container+'>';if(win.DOMImplementationLS&&win.DOMImplementationLS.createLSInput&&win.DOMImplementationLS.createLSParser){var lsInput=DOMImplementationLS.createLSInput();lsInput.stringData=stringContainer;var lsParser=DOMImplementationLS.createLSParser(1,null);return lsParser.parse(lsInput).firstChild;}
   8.356 +else if(win.DOMParser){try{var fc=new DOMParser().parseFromString(stringContainer,'text/xml');if(!fc||!fc.documentElement||fc.documentElement.localName!=='parsererror'||fc.documentElement.namespaceURI!=='http://www.mozilla.org/newlayout/xml/parsererror.xml'){return fc.documentElement.firstChild;}}
   8.357 +catch(e){}}
   8.358 +else if(win.ActiveXObject){var axo=new ActiveXObject('MSXML2.DOMDocument');axo.loadXML(str);return axo.documentElement;}
   8.359 +if(d.createElementNS&&d.documentElement.namespaceURI&&(d.documentElement.namespaceURI!==null||d.documentElement.nodeName.toLowerCase()!=='html'||(d.contentType&&d.contentType!=='text/html'))){holder=d.createElementNS(ns,container);}
   8.360 +else{holder=d.createElement(container);}
   8.361 +holder.innerHTML=str;while(holder.firstChild){parent.appendChild(holder.firstChild);}
   8.362 +return false;};var ieFix=function(node){if(node.nodeType===1){var newNode=d.createElement(node.nodeName);var i,len;if(node.attributes&&node.attributes.length>0){for(i=0,len=node.attributes.length;i<len;i++){newNode.setAttribute(node.attributes[i].nodeName,node.getAttribute(node.attributes[i].nodeName));}}
   8.363 +if(node.childNodes&&node.childNodes.length>0){for(i=0,len=node.childNodes.length;i<len;i++){newNode.appendChild(ieFix(node.childNodes[i]));}}
   8.364 +return newNode;}
   8.365 +else{return d.createTextNode(node.nodeValue);}};for(i=0;i<argc;i++){arg=argv[i];if(this.php_js&&this.php_js.ini&&this.php_js.ini['phpjs.echo_embedded_vars']){arg=arg.replace(/(.?)\{\$(.*?)\}/g,function(s,m1,m2){if(m1!=='\\'){return m1+eval(m2);}
   8.366 +else{return s;}});}
   8.367 +if(d.appendChild){if(d.body){if(win.navigator.appName=='Microsoft Internet Explorer'){d.body.appendChild(stringToDOM(ieFix(arg)));}
   8.368 +else{var unappendedLeft=stringToDOM(arg,d.body,ns_xhtml,'div').cloneNode(true);if(unappendedLeft){d.body.appendChild(unappendedLeft);}}}else{d.documentElement.appendChild(stringToDOM(arg,d.documentElement,ns_xul,'description'));}}else if(d.write){d.write(arg);}}}
   8.369 +function end(arr){this.php_js=this.php_js||{};this.php_js.pointers=this.php_js.pointers||[];var indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
   8.370 +return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
   8.371 +if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
   8.372 +var arrpos=pointers.indexOf(arr);if(!(arr instanceof Array)){var ct=0;for(var k in arr){ct++;var val=arr[k];}
   8.373 +if(ct===0){return false;}
   8.374 +pointers[arrpos+1]=ct-1;return val;}
   8.375 +if(arr.length===0){return false;}
   8.376 +pointers[arrpos+1]=arr.length-1;return arr[pointers[arrpos+1]];}
   8.377 +function exp(arg){return Math.exp(arg);}
   8.378 +function explode(delimiter,string,limit){var emptyArray={0:''};if(arguments.length<2||typeof arguments[0]=='undefined'||typeof arguments[1]=='undefined'){return null;}
   8.379 +if(delimiter===''||delimiter===false||delimiter===null){return false;}
   8.380 +if(typeof delimiter=='function'||typeof delimiter=='object'||typeof string=='function'||typeof string=='object'){return emptyArray;}
   8.381 +if(delimiter===true){delimiter='1';}
   8.382 +if(!limit){return string.toString().split(delimiter.toString());}else{var splitted=string.toString().split(delimiter.toString());var partA=splitted.splice(0,limit-1);var partB=splitted.join(delimiter.toString());partA.push(partB);return partA;}}
   8.383 +function expm1(x){var ret=0,n=50;var factorial=function factorial(n){if((n===0)||(n===1)){return 1;}
   8.384 +else{var result=(n*factorial(n-1));return result;}};for(var i=1;i<n;i++){ret+=Math.pow(x,i)/factorial(i);}
   8.385 +return ret;}
   8.386 +function floatval(mixed_var){return(parseFloat(mixed_var)||0);}
   8.387 +function floor(value){return Math.floor(value);}
   8.388 +function fmod(x,y){var tmp,tmp2,p=0,pY=0,l=0.0,l2=0.0;tmp=x.toExponential().match(/^.\.?(.*)e(.+)$/);p=parseInt(tmp[2],10)-(tmp[1]+'').length;tmp=y.toExponential().match(/^.\.?(.*)e(.+)$/);pY=parseInt(tmp[2],10)-(tmp[1]+'').length;if(pY>p){p=pY;}
   8.389 +tmp2=(x%y);if(p<-100||p>20){l=Math.round(Math.log(tmp2)/Math.log(10));l2=Math.pow(10,l);return(tmp2/l2).toFixed(l-p)*l2;}else{return parseFloat(tmp2.toFixed(-p));}}
   8.390 +function get_class(obj){if(obj instanceof Object&&!(obj instanceof Array)&&!(obj instanceof Function)&&obj.constructor&&obj!=this.window){var arr=obj.constructor.toString().match(/function\s*(\w+)/);if(arr&&arr.length==2){return arr[1];}}
   8.391 +return false;}
   8.392 +function get_defined_vars(){var i='',arr=[],already={};for(i in this.window){try{if(typeof this.window[i]==='object'){for(var j in this.window[i]){if(this.window[j]&&!already[j]){already[j]=1;arr.push(j);}}}
   8.393 +else if(!already[i]){already[i]=1;arr.push(i);}}
   8.394 +catch(e){if(!already[i]){already[i]=1;arr.push(i);}}}
   8.395 +return arr;}
   8.396 +function get_headers(url,format){var req=this.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
   8.397 +var tmp,headers,pair,i,j=0;req.open('HEAD',url,false);req.send(null);if(req.readyState<3){return false;}
   8.398 +tmp=req.getAllResponseHeaders();tmp=tmp.split('\n');tmp=this.array_filter(tmp,function(value){return value.substring(1)!=='';});headers=format?{}:[];for(i in tmp){if(format){pair=tmp[i].split(':');headers[pair.splice(0,1)]=pair.join(':').substring(1);}else{headers[j++]=tmp[i];}}
   8.399 +return headers;}
   8.400 +function get_html_translation_table(table,quote_style){var entities={},hash_map={},decimal=0,symbol='';var constMappingTable={},constMappingQuoteStyle={};var useTable={},useQuoteStyle={};constMappingTable[0]='HTML_SPECIALCHARS';constMappingTable[1]='HTML_ENTITIES';constMappingQuoteStyle[0]='ENT_NOQUOTES';constMappingQuoteStyle[2]='ENT_COMPAT';constMappingQuoteStyle[3]='ENT_QUOTES';useTable=!isNaN(table)?constMappingTable[table]:table?table.toUpperCase():'HTML_SPECIALCHARS';useQuoteStyle=!isNaN(quote_style)?constMappingQuoteStyle[quote_style]:quote_style?quote_style.toUpperCase():'ENT_COMPAT';if(useTable!=='HTML_SPECIALCHARS'&&useTable!=='HTML_ENTITIES'){throw new Error("Table: "+useTable+' not supported');}
   8.401 +entities['38']='&amp;';if(useTable==='HTML_ENTITIES'){entities['160']='&nbsp;';entities['161']='&iexcl;';entities['162']='&cent;';entities['163']='&pound;';entities['164']='&curren;';entities['165']='&yen;';entities['166']='&brvbar;';entities['167']='&sect;';entities['168']='&uml;';entities['169']='&copy;';entities['170']='&ordf;';entities['171']='&laquo;';entities['172']='&not;';entities['173']='&shy;';entities['174']='&reg;';entities['175']='&macr;';entities['176']='&deg;';entities['177']='&plusmn;';entities['178']='&sup2;';entities['179']='&sup3;';entities['180']='&acute;';entities['181']='&micro;';entities['182']='&para;';entities['183']='&middot;';entities['184']='&cedil;';entities['185']='&sup1;';entities['186']='&ordm;';entities['187']='&raquo;';entities['188']='&frac14;';entities['189']='&frac12;';entities['190']='&frac34;';entities['191']='&iquest;';entities['192']='&Agrave;';entities['193']='&Aacute;';entities['194']='&Acirc;';entities['195']='&Atilde;';entities['196']='&Auml;';entities['197']='&Aring;';entities['198']='&AElig;';entities['199']='&Ccedil;';entities['200']='&Egrave;';entities['201']='&Eacute;';entities['202']='&Ecirc;';entities['203']='&Euml;';entities['204']='&Igrave;';entities['205']='&Iacute;';entities['206']='&Icirc;';entities['207']='&Iuml;';entities['208']='&ETH;';entities['209']='&Ntilde;';entities['210']='&Ograve;';entities['211']='&Oacute;';entities['212']='&Ocirc;';entities['213']='&Otilde;';entities['214']='&Ouml;';entities['215']='&times;';entities['216']='&Oslash;';entities['217']='&Ugrave;';entities['218']='&Uacute;';entities['219']='&Ucirc;';entities['220']='&Uuml;';entities['221']='&Yacute;';entities['222']='&THORN;';entities['223']='&szlig;';entities['224']='&agrave;';entities['225']='&aacute;';entities['226']='&acirc;';entities['227']='&atilde;';entities['228']='&auml;';entities['229']='&aring;';entities['230']='&aelig;';entities['231']='&ccedil;';entities['232']='&egrave;';entities['233']='&eacute;';entities['234']='&ecirc;';entities['235']='&euml;';entities['236']='&igrave;';entities['237']='&iacute;';entities['238']='&icirc;';entities['239']='&iuml;';entities['240']='&eth;';entities['241']='&ntilde;';entities['242']='&ograve;';entities['243']='&oacute;';entities['244']='&ocirc;';entities['245']='&otilde;';entities['246']='&ouml;';entities['247']='&divide;';entities['248']='&oslash;';entities['249']='&ugrave;';entities['250']='&uacute;';entities['251']='&ucirc;';entities['252']='&uuml;';entities['253']='&yacute;';entities['254']='&thorn;';entities['255']='&yuml;';}
   8.402 +if(useQuoteStyle!=='ENT_NOQUOTES'){entities['34']='&quot;';}
   8.403 +if(useQuoteStyle==='ENT_QUOTES'){entities['39']='&#39;';}
   8.404 +entities['60']='&lt;';entities['62']='&gt;';for(decimal in entities){symbol=String.fromCharCode(decimal);hash_map[symbol]=entities[decimal];}
   8.405 +return hash_map;}
   8.406 +function getdate(timestamp){var _w=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];var _m=['January','February','March','April','May','June','July','August','September','October','November','December'];var d=((typeof(timestamp)=='undefined')?new Date():(typeof(timestamp)=='object')?new Date(timestamp):new Date(timestamp*1000));var w=d.getDay();var m=d.getMonth();var y=d.getFullYear();var r={};r.seconds=d.getSeconds();r.minutes=d.getMinutes();r.hours=d.getHours();r.mday=d.getDate();r.wday=w;r.mon=m+1;r.year=y;r.yday=Math.floor((d-(new Date(y,0,1)))/86400000);r.weekday=_w[w];r.month=_m[m];r['0']=parseInt(d.getTime()/1000,10);return r;}
   8.407 +function getrandmax()
   8.408 +{return 2147483647;}
   8.409 +function hexdec(hex_string){hex_string=(hex_string+'').replace(/[^a-f0-9]/gi,'');return parseInt(hex_string,16);}
   8.410 +function html_entity_decode(string,quote_style){var hash_map={},symbol='',tmp_str='',entity='';tmp_str=string.toString();if(false===(hash_map=this.get_html_translation_table('HTML_ENTITIES',quote_style))){return false;}
   8.411 +delete(hash_map['&']);hash_map['&']='&amp;';for(symbol in hash_map){entity=hash_map[symbol];tmp_str=tmp_str.split(entity).join(symbol);}
   8.412 +tmp_str=tmp_str.split('&#039;').join("'");return tmp_str;}
   8.413 +function htmlentities(string,quote_style){var hash_map={},symbol='',tmp_str='',entity='';tmp_str=string.toString();if(false===(hash_map=this.get_html_translation_table('HTML_ENTITIES',quote_style))){return false;}
   8.414 +hash_map["'"]='&#039;';for(symbol in hash_map){entity=hash_map[symbol];tmp_str=tmp_str.split(symbol).join(entity);}
   8.415 +return tmp_str;}
   8.416 +function htmlspecialchars(string,quote_style,charset,double_encode){var optTemp=0,i=0,noquotes=false;if(typeof quote_style==='undefined'||quote_style===null){quote_style=2;}
   8.417 +string=string.toString();if(double_encode!==false){string=string.replace(/&/g,'&amp;');}
   8.418 +string=string.replace(/</g,'&lt;').replace(/>/g,'&gt;');var OPTS={'ENT_NOQUOTES':0,'ENT_HTML_QUOTE_SINGLE':1,'ENT_HTML_QUOTE_DOUBLE':2,'ENT_COMPAT':2,'ENT_QUOTES':3,'ENT_IGNORE':4};if(quote_style===0){noquotes=true;}
   8.419 +if(typeof quote_style!=='number'){quote_style=[].concat(quote_style);for(i=0;i<quote_style.length;i++){if(OPTS[quote_style[i]]===0){noquotes=true;}
   8.420 +else if(OPTS[quote_style[i]]){optTemp=optTemp|OPTS[quote_style[i]];}}
   8.421 +quote_style=optTemp;}
   8.422 +if(quote_style&OPTS.ENT_HTML_QUOTE_SINGLE){string=string.replace(/'/g,'&#039;');}
   8.423 +if(!noquotes){string=string.replace(/"/g,'&quot;');}
   8.424 +return string;}
   8.425 +function htmlspecialchars_decode(string,quote_style){var optTemp=0,i=0,noquotes=false;if(typeof quote_style==='undefined'){quote_style=2;}
   8.426 +string=string.toString().replace(/&lt;/g,'<').replace(/&gt;/g,'>');var OPTS={'ENT_NOQUOTES':0,'ENT_HTML_QUOTE_SINGLE':1,'ENT_HTML_QUOTE_DOUBLE':2,'ENT_COMPAT':2,'ENT_QUOTES':3,'ENT_IGNORE':4};if(quote_style===0){noquotes=true;}
   8.427 +if(typeof quote_style!=='number'){quote_style=[].concat(quote_style);for(i=0;i<quote_style.length;i++){if(OPTS[quote_style[i]]===0){noquotes=true;}
   8.428 +else if(OPTS[quote_style[i]]){optTemp=optTemp|OPTS[quote_style[i]];}}
   8.429 +quote_style=optTemp;}
   8.430 +if(quote_style&OPTS.ENT_HTML_QUOTE_SINGLE){string=string.replace(/&#0*39;/g,"'");}
   8.431 +if(!noquotes){string=string.replace(/&quot;/g,'"');}
   8.432 +string=string.replace(/&amp;/g,'&');return string;}
   8.433 +function http_build_query(formdata,numeric_prefix,arg_separator){var value,key,tmp=[];var _http_build_query_helper=function(key,val,arg_separator){var k,tmp=[];if(val===true){val="1";}else if(val===false){val="0";}
   8.434 +if(val!==null&&typeof(val)==="object"){for(k in val){if(val[k]!==null){tmp.push(_http_build_query_helper(key+"["+k+"]",val[k],arg_separator));}}
   8.435 +return tmp.join(arg_separator);}else if(typeof(val)!=="function"){return this.urlencode(key)+"="+this.urlencode(val);}else{throw new Error('There was an error processing for http_build_query().');}};if(!arg_separator){arg_separator="&";}
   8.436 +for(key in formdata){value=formdata[key];if(numeric_prefix&&!isNaN(key)){key=String(numeric_prefix)+key;}
   8.437 +tmp.push(_http_build_query_helper(key,value,arg_separator));}
   8.438 +return tmp.join(arg_separator);}
   8.439 +function hypot(x,y){return Math.sqrt(x*x+y*y)||0;}
   8.440 +function implode(glue,pieces){var i='',retVal='',tGlue='';if(arguments.length===1){pieces=glue;glue='';}
   8.441 +if(typeof(pieces)==='object'){if(pieces instanceof Array){return pieces.join(glue);}
   8.442 +else{for(i in pieces){retVal+=tGlue+pieces[i];tGlue=glue;}
   8.443 +return retVal;}}
   8.444 +else{return pieces;}}
   8.445 +function in_array(needle,haystack,argStrict){var key='',strict=!!argStrict;if(strict){for(key in haystack){if(haystack[key]===needle){return true;}}}else{for(key in haystack){if(haystack[key]==needle){return true;}}}
   8.446 +return false;}
   8.447 +function intval(mixed_var,base){var tmp;var type=typeof(mixed_var);if(type==='boolean'){return(mixed_var)?1:0;}else if(type==='string'){tmp=parseInt(mixed_var,base||10);return(isNaN(tmp)||!isFinite(tmp))?0:tmp;}else if(type==='number'&&isFinite(mixed_var)){return Math.floor(mixed_var);}else{return 0;}}
   8.448 +function ip2long(IP){var i=0;IP=IP.match(/^([1-9]\d*|0[0-7]*|0x[\da-f]+)(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?$/i);if(!IP){return false;}
   8.449 +IP[0]=0;for(i=1;i<5;i+=1){IP[0]+=!!((IP[i]||'').length);IP[i]=parseInt(IP[i])||0;}
   8.450 +IP.push(256,256,256,256);IP[4+IP[0]]*=Math.pow(256,4-IP[0]);if(IP[1]>=IP[5]||IP[2]>=IP[6]||IP[3]>=IP[7]||IP[4]>=IP[8]){return false;}
   8.451 +return IP[1]*(IP[0]===1||16777216)+IP[2]*(IP[0]<=2||65536)+IP[3]*(IP[0]<=3||256)+IP[4]*1;}
   8.452 +function is_bool(mixed_var)
   8.453 +{return(typeof mixed_var==='boolean');}
   8.454 +function is_double(mixed_var){return this.is_float(mixed_var);}
   8.455 +function is_finite(val){var warningType='';if(val===Infinity||val===-Infinity){return false;}
   8.456 +if(typeof val=='object'){warningType=(val instanceof Array?'array':'object');}else if(typeof val=='string'&&!val.match(/^[\+\-]?\d/)){warningType='string';}
   8.457 +if(warningType){throw new Error('Warning: is_finite() expects parameter 1 to be double, '+warningType+' given');}
   8.458 +return true;}
   8.459 +function is_float(mixed_var){if(typeof mixed_var!=='number'){return false;}
   8.460 +return!!(mixed_var%1);}
   8.461 +function is_infinite(val){var warningType='';if(val===Infinity||val===-Infinity){return true;}
   8.462 +if(typeof val=='object'){warningType=(val instanceof Array?'array':'object');}else if(typeof val=='string'&&!val.match(/^[\+\-]?\d/)){warningType='string';}
   8.463 +if(warningType){throw new Error('Warning: is_infinite() expects parameter 1 to be double, '+warningType+' given');}
   8.464 +return false;}
   8.465 +function is_int(mixed_var){if(typeof mixed_var!=='number'){return false;}
   8.466 +return!(mixed_var%1);}
   8.467 +function is_integer(mixed_var){return this.is_int(mixed_var);}
   8.468 +function is_long(mixed_var){return this.is_float(mixed_var);}
   8.469 +function is_nan(val){var warningType='';if(typeof val=='number'&&isNaN(val)){return true;}
   8.470 +if(typeof val=='object'){warningType=(val instanceof Array?'array':'object');}else if(typeof val=='string'&&!val.match(/^[\+\-]?\d/)){warningType='string';}
   8.471 +if(warningType){throw new Error('Warning: is_nan() expects parameter 1 to be double, '+warningType+' given');}
   8.472 +return false;}
   8.473 +function is_null(mixed_var){return(mixed_var===null);}
   8.474 +function is_numeric(mixed_var){return(typeof(mixed_var)==='number'||typeof(mixed_var)==='string')&&mixed_var!==''&&!isNaN(mixed_var);}
   8.475 +function is_real(mixed_var){return this.is_float(mixed_var);}
   8.476 +function is_scalar(mixed_var){return(/boolean|number|string/).test(typeof mixed_var);}
   8.477 +function is_string(mixed_var){return(typeof(mixed_var)=='string');}
   8.478 +function join(glue,pieces){return this.implode(glue,pieces);}
   8.479 +function json_decode(str_json){var json=this.window.JSON;if(typeof json==='object'&&typeof json.parse==='function'){try{return json.parse(str_json);}catch(err){if(!(err instanceof SyntaxError)){throw new Error('Unexpected error type in json_decode()');}
   8.480 +this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null;}}
   8.481 +var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;var j;var text=str_json;cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
   8.482 +('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
   8.483 +if((/^[\],:{}\s]*$/).test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return j;}
   8.484 +this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null;}
   8.485 +function json_encode(mixed_val){var retVal,json=this.window.JSON;try{if(typeof json==='object'&&typeof json.stringify==='function'){retVal=json.stringify(mixed_val);if(retVal===undefined){throw new SyntaxError('json_encode');}
   8.486 +return retVal;}
   8.487 +var value=mixed_val;var quote=function(string){var escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';};var str=function(key,holder){var gap='';var indent='    ';var i=0;var k='';var v='';var length=0;var mind=gap;var partial=[];var value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
   8.488 +switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
   8.489 +if((this.PHPJS_Resource&&value instanceof this.PHPJS_Resource)||(window.PHPJS_Resource&&value instanceof window.PHPJS_Resource)){throw new SyntaxError('json_encode');}
   8.490 +gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
   8.491 +v=partial.length===0?'[]':gap?'[\n'+gap+
   8.492 +partial.join(',\n'+gap)+'\n'+
   8.493 +mind+']':'['+partial.join(',')+']';gap=mind;return v;}
   8.494 +for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}
   8.495 +v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
   8.496 +mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;case'undefined':case'function':default:throw new SyntaxError('json_encode');}};return str('',{'':value});}catch(err){if(!(err instanceof SyntaxError)){throw new Error('Unexpected error type in json_encode()');}
   8.497 +this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null;}}
   8.498 +function krsort(inputArr,sort_flags){var tmp_arr={},keys=[],sorter,i,k,that=this,strictForIn=false,populateArr=[];switch(sort_flags){case'SORT_STRING':sorter=function(a,b){return that.strnatcmp(b,a);};break;case'SORT_LOCALE_STRING':var loc=this.i18n_loc_get_default();sorter=this.php_js.i18nLocales[loc].sorting;break;case'SORT_NUMERIC':sorter=function(a,b){return(b-a);};break;case'SORT_REGULAR':default:sorter=function(a,b){if(a<b){return 1;}
   8.499 +if(a>b){return-1;}
   8.500 +return 0;};break;}
   8.501 +for(k in inputArr){if(inputArr.hasOwnProperty(k)){keys.push(k);}}
   8.502 +keys.sort(sorter);this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(i=0;i<keys.length;i++){k=keys[i];tmp_arr[k]=inputArr[k];if(strictForIn){delete inputArr[k];}}
   8.503 +for(i in tmp_arr){if(tmp_arr.hasOwnProperty(i)){populateArr[i]=tmp_arr[i];}}
   8.504 +return strictForIn?true:populateArr;}
   8.505 +function ksort(inputArr,sort_flags){var tmp_arr={},keys=[],sorter,i,k,that=this,strictForIn=false,populateArr=[];switch(sort_flags){case'SORT_STRING':sorter=function(a,b){return that.strnatcmp(a,b);};break;case'SORT_LOCALE_STRING':var loc=this.i18n_loc_get_default();sorter=this.php_js.i18nLocales[loc].sorting;break;case'SORT_NUMERIC':sorter=function(a,b){return(a-b);};break;case'SORT_REGULAR':default:sorter=function(a,b){if(a>b){return 1;}
   8.506 +if(a<b){return-1;}
   8.507 +return 0;};break;}
   8.508 +for(k in inputArr){if(inputArr.hasOwnProperty(k)){keys.push(k);}}
   8.509 +keys.sort(sorter);this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(i=0;i<keys.length;i++){k=keys[i];tmp_arr[k]=inputArr[k];if(strictForIn){delete inputArr[k];}}
   8.510 +for(i in tmp_arr){if(tmp_arr.hasOwnProperty(i)){populateArr[i]=tmp_arr[i];}}
   8.511 +return strictForIn?true:populateArr;}
   8.512 +function lcfirst(str){str+='';var f=str.charAt(0).toLowerCase();return f+str.substr(1);}
   8.513 +function lcg_value(){return Math.random();}
   8.514 +function levenshtein(s1,s2){if(s1==s2){return 0;}
   8.515 +var s1_len=s1.length;var s2_len=s2.length;if(s1_len===0){return s2_len;}
   8.516 +if(s2_len===0){return s1_len;}
   8.517 +var split=false;try{split=!('0')[0];}catch(e){split=true;}
   8.518 +if(split){s1=s1.split('');s2=s2.split('');}
   8.519 +var v0=new Array(s1_len+1);var v1=new Array(s1_len+1);var s1_idx=0,s2_idx=0,cost=0;for(s1_idx=0;s1_idx<s1_len+1;s1_idx++){v0[s1_idx]=s1_idx;}
   8.520 +var char_s1='',char_s2='';for(s2_idx=1;s2_idx<=s2_len;s2_idx++){v1[0]=s2_idx;char_s2=s2[s2_idx-1];for(s1_idx=0;s1_idx<s1_len;s1_idx++){char_s1=s1[s1_idx];cost=(char_s1==char_s2)?0:1;var m_min=v0[s1_idx+1]+1;var b=v1[s1_idx]+1;var c=v0[s1_idx]+cost;if(b<m_min){m_min=b;}
   8.521 +if(c<m_min){m_min=c;}
   8.522 +v1[s1_idx+1]=m_min;}
   8.523 +var v_tmp=v0;v0=v1;v1=v_tmp;}
   8.524 +return v0[s1_len];}
   8.525 +function log(arg,base){if(base===undefined){return Math.log(arg);}else{return Math.log(arg)/Math.log(base);}}
   8.526 +function log10(arg){return Math.log(arg)/Math.LN10;}
   8.527 +function log1p(x){var ret=0,n=50;if(x<=-1){return'-INF';}
   8.528 +if(x<0||x>1){return Math.log(1+x);}
   8.529 +for(var i=1;i<n;i++){if((i%2)===0){ret-=Math.pow(x,i)/i;}
   8.530 +else{ret+=Math.pow(x,i)/i;}}
   8.531 +return ret;}
   8.532 +function long2ip(proper_address){var output=false;if(!isNaN(proper_address)&&(proper_address>=0||proper_address<=4294967295)){output=Math.floor(proper_address/Math.pow(256,3))+'.'+
   8.533 +Math.floor((proper_address%Math.pow(256,3))/Math.pow(256,2))+'.'+
   8.534 +Math.floor(((proper_address%Math.pow(256,3))%Math.pow(256,2))/Math.pow(256,1))+'.'+
   8.535 +Math.floor((((proper_address%Math.pow(256,3))%Math.pow(256,2))%Math.pow(256,1))/Math.pow(256,0));}
   8.536 +return output;}
   8.537 +function ltrim(str,charlist){charlist=!charlist?' \\s\u00A0':(charlist+'').replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'$1');var re=new RegExp('^['+charlist+']+','g');return(str+'').replace(re,'');}
   8.538 +function max(){var ar,retVal,i=0,n=0;var argv=arguments,argc=argv.length;var _obj2Array=function(obj){if(obj instanceof Array){return obj;}else{var ar=[];for(var i in obj){ar.push(obj[i]);}
   8.539 +return ar;}};var _compare=function(current,next){var i=0,n=0,tmp=0;var nl=0,cl=0;if(current===next){return 0;}else if(typeof current=='object'){if(typeof next=='object'){current=_obj2Array(current);next=_obj2Array(next);cl=current.length;nl=next.length;if(nl>cl){return 1;}else if(nl<cl){return-1;}else{for(i=0,n=cl;i<n;++i){tmp=_compare(current[i],next[i]);if(tmp==1){return 1;}else if(tmp==-1){return-1;}}
   8.540 +return 0;}}else{return-1;}}else if(typeof next=='object'){return 1;}else if(isNaN(next)&&!isNaN(current)){if(current==0){return 0;}else{return(current<0?1:-1);}}else if(isNaN(current)&&!isNaN(next)){if(next==0){return 0;}else{return(next>0?1:-1);}}else{if(next==current){return 0;}else{return(next>current?1:-1);}}};if(argc===0){throw new Error('At least one value should be passed to max()');}else if(argc===1){if(typeof argv[0]==='object'){ar=_obj2Array(argv[0]);}else{throw new Error('Wrong parameter count for max()');}
   8.541 +if(ar.length===0){throw new Error('Array must contain at least one element for max()');}}else{ar=argv;}
   8.542 +retVal=ar[0];for(i=1,n=ar.length;i<n;++i){if(_compare(retVal,ar[i])==1){retVal=ar[i];}}
   8.543 +return retVal;}
   8.544 +function md5(str){var xl;var rotateLeft=function(lValue,iShiftBits){return(lValue<<iShiftBits)|(lValue>>>(32-iShiftBits));};var addUnsigned=function(lX,lY){var lX4,lY4,lX8,lY8,lResult;lX8=(lX&0x80000000);lY8=(lY&0x80000000);lX4=(lX&0x40000000);lY4=(lY&0x40000000);lResult=(lX&0x3FFFFFFF)+(lY&0x3FFFFFFF);if(lX4&lY4){return(lResult^0x80000000^lX8^lY8);}
   8.545 +if(lX4|lY4){if(lResult&0x40000000){return(lResult^0xC0000000^lX8^lY8);}else{return(lResult^0x40000000^lX8^lY8);}}else{return(lResult^lX8^lY8);}};var _F=function(x,y,z){return(x&y)|((~x)&z);};var _G=function(x,y,z){return(x&z)|(y&(~z));};var _H=function(x,y,z){return(x^y^z);};var _I=function(x,y,z){return(y^(x|(~z)));};var _FF=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_F(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var _GG=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_G(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var _HH=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_H(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var _II=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(_I(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b);};var convertToWordArray=function(str){var lWordCount;var lMessageLength=str.length;var lNumberOfWords_temp1=lMessageLength+8;var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1%64))/64;var lNumberOfWords=(lNumberOfWords_temp2+1)*16;var lWordArray=new Array(lNumberOfWords-1);var lBytePosition=0;var lByteCount=0;while(lByteCount<lMessageLength){lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=(lWordArray[lWordCount]|(str.charCodeAt(lByteCount)<<lBytePosition));lByteCount++;}
   8.546 +lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=lWordArray[lWordCount]|(0x80<<lBytePosition);lWordArray[lNumberOfWords-2]=lMessageLength<<3;lWordArray[lNumberOfWords-1]=lMessageLength>>>29;return lWordArray;};var wordToHex=function(lValue){var wordToHexValue="",wordToHexValue_temp="",lByte,lCount;for(lCount=0;lCount<=3;lCount++){lByte=(lValue>>>(lCount*8))&255;wordToHexValue_temp="0"+lByte.toString(16);wordToHexValue=wordToHexValue+wordToHexValue_temp.substr(wordToHexValue_temp.length-2,2);}
   8.547 +return wordToHexValue;};var x=[],k,AA,BB,CC,DD,a,b,c,d,S11=7,S12=12,S13=17,S14=22,S21=5,S22=9,S23=14,S24=20,S31=4,S32=11,S33=16,S34=23,S41=6,S42=10,S43=15,S44=21;str=this.utf8_encode(str);x=convertToWordArray(str);a=0x67452301;b=0xEFCDAB89;c=0x98BADCFE;d=0x10325476;xl=x.length;for(k=0;k<xl;k+=16){AA=a;BB=b;CC=c;DD=d;a=_FF(a,b,c,d,x[k+0],S11,0xD76AA478);d=_FF(d,a,b,c,x[k+1],S12,0xE8C7B756);c=_FF(c,d,a,b,x[k+2],S13,0x242070DB);b=_FF(b,c,d,a,x[k+3],S14,0xC1BDCEEE);a=_FF(a,b,c,d,x[k+4],S11,0xF57C0FAF);d=_FF(d,a,b,c,x[k+5],S12,0x4787C62A);c=_FF(c,d,a,b,x[k+6],S13,0xA8304613);b=_FF(b,c,d,a,x[k+7],S14,0xFD469501);a=_FF(a,b,c,d,x[k+8],S11,0x698098D8);d=_FF(d,a,b,c,x[k+9],S12,0x8B44F7AF);c=_FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);b=_FF(b,c,d,a,x[k+11],S14,0x895CD7BE);a=_FF(a,b,c,d,x[k+12],S11,0x6B901122);d=_FF(d,a,b,c,x[k+13],S12,0xFD987193);c=_FF(c,d,a,b,x[k+14],S13,0xA679438E);b=_FF(b,c,d,a,x[k+15],S14,0x49B40821);a=_GG(a,b,c,d,x[k+1],S21,0xF61E2562);d=_GG(d,a,b,c,x[k+6],S22,0xC040B340);c=_GG(c,d,a,b,x[k+11],S23,0x265E5A51);b=_GG(b,c,d,a,x[k+0],S24,0xE9B6C7AA);a=_GG(a,b,c,d,x[k+5],S21,0xD62F105D);d=_GG(d,a,b,c,x[k+10],S22,0x2441453);c=_GG(c,d,a,b,x[k+15],S23,0xD8A1E681);b=_GG(b,c,d,a,x[k+4],S24,0xE7D3FBC8);a=_GG(a,b,c,d,x[k+9],S21,0x21E1CDE6);d=_GG(d,a,b,c,x[k+14],S22,0xC33707D6);c=_GG(c,d,a,b,x[k+3],S23,0xF4D50D87);b=_GG(b,c,d,a,x[k+8],S24,0x455A14ED);a=_GG(a,b,c,d,x[k+13],S21,0xA9E3E905);d=_GG(d,a,b,c,x[k+2],S22,0xFCEFA3F8);c=_GG(c,d,a,b,x[k+7],S23,0x676F02D9);b=_GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);a=_HH(a,b,c,d,x[k+5],S31,0xFFFA3942);d=_HH(d,a,b,c,x[k+8],S32,0x8771F681);c=_HH(c,d,a,b,x[k+11],S33,0x6D9D6122);b=_HH(b,c,d,a,x[k+14],S34,0xFDE5380C);a=_HH(a,b,c,d,x[k+1],S31,0xA4BEEA44);d=_HH(d,a,b,c,x[k+4],S32,0x4BDECFA9);c=_HH(c,d,a,b,x[k+7],S33,0xF6BB4B60);b=_HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);a=_HH(a,b,c,d,x[k+13],S31,0x289B7EC6);d=_HH(d,a,b,c,x[k+0],S32,0xEAA127FA);c=_HH(c,d,a,b,x[k+3],S33,0xD4EF3085);b=_HH(b,c,d,a,x[k+6],S34,0x4881D05);a=_HH(a,b,c,d,x[k+9],S31,0xD9D4D039);d=_HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);c=_HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);b=_HH(b,c,d,a,x[k+2],S34,0xC4AC5665);a=_II(a,b,c,d,x[k+0],S41,0xF4292244);d=_II(d,a,b,c,x[k+7],S42,0x432AFF97);c=_II(c,d,a,b,x[k+14],S43,0xAB9423A7);b=_II(b,c,d,a,x[k+5],S44,0xFC93A039);a=_II(a,b,c,d,x[k+12],S41,0x655B59C3);d=_II(d,a,b,c,x[k+3],S42,0x8F0CCC92);c=_II(c,d,a,b,x[k+10],S43,0xFFEFF47D);b=_II(b,c,d,a,x[k+1],S44,0x85845DD1);a=_II(a,b,c,d,x[k+8],S41,0x6FA87E4F);d=_II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);c=_II(c,d,a,b,x[k+6],S43,0xA3014314);b=_II(b,c,d,a,x[k+13],S44,0x4E0811A1);a=_II(a,b,c,d,x[k+4],S41,0xF7537E82);d=_II(d,a,b,c,x[k+11],S42,0xBD3AF235);c=_II(c,d,a,b,x[k+2],S43,0x2AD7D2BB);b=_II(b,c,d,a,x[k+9],S44,0xEB86D391);a=addUnsigned(a,AA);b=addUnsigned(b,BB);c=addUnsigned(c,CC);d=addUnsigned(d,DD);}
   8.548 +var temp=wordToHex(a)+wordToHex(b)+wordToHex(c)+wordToHex(d);return temp.toLowerCase();}
   8.549 +function method_exists(obj,method){if(typeof obj==='string'){return this.window[obj]&&typeof this.window[obj][method]==='function';}
   8.550 +return typeof obj[method]==='function';}
   8.551 +function microtime(get_as_float){var now=new Date().getTime()/1000;var s=parseInt(now,10);return(get_as_float)?now:(Math.round((now-s)*1000)/1000)+' '+s;}
   8.552 +function min(){var ar,retVal,i=0,n=0;var argv=arguments,argc=argv.length;var _obj2Array=function(obj){if(obj instanceof Array){return obj;}else{var ar=[];for(var i in obj){ar.push(obj[i]);}
   8.553 +return ar;}};var _compare=function(current,next){var i=0,n=0,tmp=0;var nl=0,cl=0;if(current===next){return 0;}else if(typeof current=='object'){if(typeof next=='object'){current=_obj2Array(current);next=_obj2Array(next);cl=current.length;nl=next.length;if(nl>cl){return 1;}else if(nl<cl){return-1;}else{for(i=0,n=cl;i<n;++i){tmp=_compare(current[i],next[i]);if(tmp==1){return 1;}else if(tmp==-1){return-1;}}
   8.554 +return 0;}}else{return-1;}}else if(typeof next=='object'){return 1;}else if(isNaN(next)&&!isNaN(current)){if(current==0){return 0;}else{return(current<0?1:-1);}}else if(isNaN(current)&&!isNaN(next)){if(next==0){return 0;}else{return(next>0?1:-1);}}else{if(next==current){return 0;}else{return(next>current?1:-1);}}};if(argc===0){throw new Error('At least one value should be passed to min()');}else if(argc===1){if(typeof argv[0]==='object'){ar=_obj2Array(argv[0]);}else{throw new Error('Wrong parameter count for min()');}
   8.555 +if(ar.length===0){throw new Error('Array must contain at least one element for min()');}}else{ar=argv;}
   8.556 +retVal=ar[0];for(i=1,n=ar.length;i<n;++i){if(_compare(retVal,ar[i])==-1){retVal=ar[i];}}
   8.557 +return retVal;}
   8.558 +function mktime(){var d=new Date(),r=arguments,i=0,e=['Hours','Minutes','Seconds','Month','Date','FullYear'];for(i=0;i<e.length;i++){if(typeof r[i]==='undefined'){r[i]=d['get'+e[i]]();r[i]+=(i===3);}else{r[i]=parseInt(r[i],10);if(isNaN(r[i])){return false;}}}
   8.559 +r[5]+=(r[5]>=0?(r[5]<=69?2e3:(r[5]<=100?1900:0)):0);d.setFullYear(r[5],r[3]-1,r[4]);d.setHours(r[0],r[1],r[2]);return(d.getTime()/1e3>>0)-(d.getTime()<0);}
   8.560 +function mt_getrandmax()
   8.561 +{return 2147483647;}
   8.562 +function mt_rand(min,max){var argc=arguments.length;if(argc===0){min=0;max=2147483647;}else if(argc===1){throw new Error('Warning: mt_rand() expects exactly 2 parameters, 1 given');}
   8.563 +return Math.floor(Math.random()*(max-min+1))+min;}
   8.564 +function natcasesort(inputArr){var valArr=[],keyArr=[],k,i,ret,that=this,strictForIn=false,populateArr=[];var bubbleSort=function(keyArr,inputArr){var i,j,tempValue,tempKeyVal;for(i=inputArr.length-2;i>=0;i--){for(j=0;j<=i;j++){ret=that.strnatcasecmp(inputArr[j+1],inputArr[j]);if(ret<0){tempValue=inputArr[j];inputArr[j]=inputArr[j+1];inputArr[j+1]=tempValue;tempKeyVal=keyArr[j];keyArr[j]=keyArr[j+1];keyArr[j+1]=tempKeyVal;}}}};this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
   8.565 +try{bubbleSort(keyArr,valArr);}catch(e){return false;}
   8.566 +for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
   8.567 +return strictForIn?true:populateArr;}
   8.568 +function natsort(inputArr){var valArr=[],keyArr=[],k,i,ret,that=this,strictForIn=false,populateArr=[];var bubbleSort=function(keyArr,inputArr){var i,j,tempValue,tempKeyVal;for(i=inputArr.length-2;i>=0;i--){for(j=0;j<=i;j++){ret=that.strnatcmp(inputArr[j+1],inputArr[j]);if(ret<0){tempValue=inputArr[j];inputArr[j]=inputArr[j+1];inputArr[j+1]=tempValue;tempKeyVal=keyArr[j];keyArr[j]=keyArr[j+1];keyArr[j+1]=tempKeyVal;}}}};this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
   8.569 +try{bubbleSort(keyArr,valArr);}catch(e){return false;}
   8.570 +for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
   8.571 +return strictForIn?true:populateArr;}
   8.572 +function nl2br(str,is_xhtml){var breakTag=(is_xhtml||typeof is_xhtml==='undefined')?'<br />':'<br>';return(str+'').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,'$1'+breakTag+'$2');}
   8.573 +function number_format(number,decimals,dec_point,thousands_sep){var n=!isFinite(+number)?0:+number,prec=!isFinite(+decimals)?0:Math.abs(decimals),sep=(typeof thousands_sep==='undefined')?',':thousands_sep,dec=(typeof dec_point==='undefined')?'.':dec_point,s='',toFixedFix=function(n,prec){var k=Math.pow(10,prec);return''+Math.round(n*k)/k;};s=(prec?toFixedFix(n,prec):''+Math.round(n)).split('.');if(s[0].length>3){s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,sep);}
   8.574 +if((s[1]||'').length<prec){s[1]=s[1]||'';s[1]+=new Array(prec-s[1].length+1).join('0');}
   8.575 +return s.join(dec);}
   8.576 +function octdec(oct_string){oct_string=(oct_string+'').replace(/[^0-7]/gi,'');return parseInt(oct_string,8);}
   8.577 +function ord(string){var str=string+'';var code=str.charCodeAt(0);if(0xD800<=code&&code<=0xDBFF){var hi=code;if(str.length===1){return code;}
   8.578 +var low=str.charCodeAt(1);if(!low){}
   8.579 +return((hi-0xD800)*0x400)+(low-0xDC00)+0x10000;}
   8.580 +if(0xDC00<=code&&code<=0xDFFF){return code;}
   8.581 +return code;}
   8.582 +function parse_str(str,array){var glue1='=',glue2='&',array2=String(str).split(glue2),i,j,chr,tmp,key,value,bracket,keys,evalStr,that=this,fixStr=function(str){return that.urldecode(str).replace(/([\\"'])/g,'\\$1').replace(/\n/g,'\\n').replace(/\r/g,'\\r');};if(!array){array=this.window;}
   8.583 +for(i=0;i<array2.length;i++){tmp=array2[i].split(glue1);if(tmp.length<2){tmp=[tmp,''];}
   8.584 +key=fixStr(tmp[0]);value=fixStr(tmp[1]);while(key.charAt(0)===' '){key=key.substr(1);}
   8.585 +if(key.indexOf('\0')!==-1){key=key.substr(0,key.indexOf('\0'));}
   8.586 +if(key&&key.charAt(0)!=='['){keys=[];bracket=0;for(j=0;j<key.length;j++){if(key.charAt(j)==='['&&!bracket){bracket=j+1;}
   8.587 +else if(key.charAt(j)===']'){if(bracket){if(!keys.length){keys.push(key.substr(0,bracket-1));}
   8.588 +keys.push(key.substr(bracket,j-bracket));bracket=0;if(key.charAt(j+1)!=='['){break;}}}}
   8.589 +if(!keys.length){keys=[key];}
   8.590 +for(j=0;j<keys[0].length;j++){chr=keys[0].charAt(j);if(chr===' '||chr==='.'||chr==='['){keys[0]=keys[0].substr(0,j)+'_'+keys[0].substr(j+1);}
   8.591 +if(chr==='['){break;}}
   8.592 +evalStr='array';for(j=0;j<keys.length;j++){key=keys[j];if((key!==''&&key!==' ')||j===0){key="'"+key+"'";}
   8.593 +else{key=eval(evalStr+'.push([]);')-1;}
   8.594 +evalStr+='['+key+']';if(j!==keys.length-1&&eval('typeof '+evalStr)==='undefined'){eval(evalStr+' = [];');}}
   8.595 +evalStr+=" = '"+value+"';\n";eval(evalStr);}}}
   8.596 +function parse_url(str,component){var o={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/\/?)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var m=o.parser[o.strictMode?"strict":"loose"].exec(str),uri={},i=14;while(i--){uri[o.key[i]]=m[i]||"";}
   8.597 +switch(component){case'PHP_URL_SCHEME':return uri.protocol;case'PHP_URL_HOST':return uri.host;case'PHP_URL_PORT':return uri.port;case'PHP_URL_USER':return uri.user;case'PHP_URL_PASS':return uri.password;case'PHP_URL_PATH':return uri.path;case'PHP_URL_QUERY':return uri.query;case'PHP_URL_FRAGMENT':return uri.anchor;default:var retArr={};if(uri.protocol!==''){retArr.scheme=uri.protocol;}
   8.598 +if(uri.host!==''){retArr.host=uri.host;}
   8.599 +if(uri.port!==''){retArr.port=uri.port;}
   8.600 +if(uri.user!==''){retArr.user=uri.user;}
   8.601 +if(uri.password!==''){retArr.pass=uri.password;}
   8.602 +if(uri.path!==''){retArr.path=uri.path;}
   8.603 +if(uri.query!==''){retArr.query=uri.query;}
   8.604 +if(uri.anchor!==''){retArr.fragment=uri.anchor;}
   8.605 +return retArr;}}
   8.606 +function pi(){return Math.PI;}
   8.607 +function pow(base,exp){return Math.pow(base,exp);}
   8.608 +function preg_grep(pattern,input,flags){var p='',retObj={};var invert=(flags===1||flags==='PREG_GREP_INVERT');if(typeof pattern==='string'){pattern=eval(pattern);}
   8.609 +if(invert){for(p in input){if(input[p].search(pattern)===-1){retObj[p]=input[p];}}}else{for(p in input){if(input[p].search(pattern)!==-1){retObj[p]=input[p];}}}
   8.610 +return retObj;}
   8.611 +function preg_quote(str){return(str+'').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!<>\|\:])/g,'\\$1');}
   8.612 +function print_r(array,return_val){var output="",pad_char=" ",pad_val=4,d=this.window.document;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
   8.613 +return name[1];};var repeat_char=function(len,pad_char){var str="";for(var i=0;i<len;i++){str+=pad_char;}
   8.614 +return str;};var formatArray=function(obj,cur_depth,pad_val,pad_char){if(cur_depth>0){cur_depth++;}
   8.615 +var base_pad=repeat_char(pad_val*cur_depth,pad_char);var thick_pad=repeat_char(pad_val*(cur_depth+1),pad_char);var str="";if(typeof obj==='object'&&obj!==null&&obj.constructor&&getFuncName(obj.constructor)!=='PHPJS_Resource'){str+="Array\n"+base_pad+"(\n";for(var key in obj){if(obj[key]instanceof Array){str+=thick_pad+"["+key+"] => "+formatArray(obj[key],cur_depth+1,pad_val,pad_char);}else{str+=thick_pad+"["+key+"] => "+obj[key]+"\n";}}
   8.616 +str+=base_pad+")\n";}else if(obj===null||obj===undefined){str='';}else{str=obj.toString();}
   8.617 +return str;};output=formatArray(array,0,pad_val,pad_char);if(return_val!==true){if(d.body){this.echo(output);}
   8.618 +else{try{d=XULDocument;this.echo('<pre xmlns="http://www.w3.org/1999/xhtml" style="white-space:pre;">'+output+'</pre>');}
   8.619 +catch(e){this.echo(output);}}
   8.620 +return true;}else{return output;}}
   8.621 +function printf(){var body,elmt,d=this.window.document;var ret='';var HTMLNS='http://www.w3.org/1999/xhtml';body=d.getElementsByTagNameNS?(d.getElementsByTagNameNS(HTMLNS,'body')[0]?d.getElementsByTagNameNS(HTMLNS,'body')[0]:d.documentElement.lastChild):d.getElementsByTagName('body')[0];if(!body){return false;}
   8.622 +ret=this.sprintf.apply(this,arguments);elmt=d.createTextNode(ret);body.appendChild(elmt);return ret.length;}
   8.623 +function property_exists(cls,prop){cls=(typeof cls==='string')?this.window[cls]:cls;if(typeof cls==='function'&&cls.toSource&&cls.toSource().match(new RegExp('this\\.'+prop+'\\s'))){return true;}
   8.624 +return(cls[prop]!==undefined&&typeof cls[prop]!=='function')||(cls.prototype!==undefined&&cls.prototype[prop]!==undefined&&typeof cls.prototype[prop]!=='function')||(cls.constructor&&cls.constructor[prop]!==undefined&&typeof cls.constructor[prop]!=='function');}
   8.625 +function quotemeta(str){return(str+'').replace(/([\.\\\+\*\?\[\^\]\$\(\)])/g,'\\$1');}
   8.626 +function rad2deg(angle){return(angle/Math.PI)*180;}
   8.627 +function rand(min,max){var argc=arguments.length;if(argc===0){min=0;max=2147483647;}else if(argc===1){throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');}
   8.628 +return Math.floor(Math.random()*(max-min+1))+min;}
   8.629 +function range(low,high,step){var matrix=[];var inival,endval,plus;var walker=step||1;var chars=false;if(!isNaN(low)&&!isNaN(high)){inival=low;endval=high;}else if(isNaN(low)&&isNaN(high)){chars=true;inival=low.charCodeAt(0);endval=high.charCodeAt(0);}else{inival=(isNaN(low)?0:low);endval=(isNaN(high)?0:high);}
   8.630 +plus=((inival>endval)?false:true);if(plus){while(inival<=endval){matrix.push(((chars)?String.fromCharCode(inival):inival));inival+=walker;}}else{while(inival>=endval){matrix.push(((chars)?String.fromCharCode(inival):inival));inival-=walker;}}
   8.631 +return matrix;}
   8.632 +function rawurldecode(str){return decodeURIComponent(str);}
   8.633 +function rawurlencode(str){str=(str+'').toString();return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A');}
   8.634 +function reset(arr){this.php_js=this.php_js||{};this.php_js.pointers=this.php_js.pointers||[];var indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
   8.635 +return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
   8.636 +if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
   8.637 +var arrpos=pointers.indexOf(arr);if(!(arr instanceof Array)){for(var k in arr){if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}else{pointers[arrpos+1]=0;}
   8.638 +return arr[k];}
   8.639 +return false;}
   8.640 +if(arr.length===0){return false;}
   8.641 +pointers[arrpos+1]=0;return arr[pointers[arrpos+1]];}
   8.642 +function round(val,precision,mode){var retVal=0,v='',integer='',decimal='',decp=0,negative=false;var _round_half_oe=function(dtR,dtLa,even){if(even===true){if(dtLa===50){if((dtR%2)===1){if(dtLa>=5){dtR++;}else{dtR--;}}}else if(dtLa>=5){dtR++;}}else{if(dtLa===5){if((dtR%2)===0){if(dtLa>=5){dtR++;}else{dtR--;}}}else if(dtLa>=5){dtR++;}}
   8.643 +return dtR;};var _round_half_ud=function(dtR,dtLa,up){if(up===true){if(dtLa>=5){dtR++;}}else{if(dtLa>5){dtR++;}}
   8.644 +return dtR;};var _round_half=function(val,decplaces,mode){var v=val.toString(),vlen=0,vlenDif=0;var decp=v.indexOf('.');var digitToRound=0,digitToLookAt=0;var integer='',decimal='';var round=null,bool=false;switch(mode){case'up':bool=true;case'down':round=_round_half_ud;break;case'even':bool=true;case'odd':round=_round_half_oe;break;}
   8.645 +if(decplaces<0){vlen=v.length;decplaces=vlen+decplaces;digitToLookAt=Number(v.charAt(decplaces));digitToRound=Number(v.charAt(decplaces-1));digitToRound=round(digitToRound,digitToLookAt,bool);v=v.slice(0,decplaces-1);vlenDif=vlen-v.length-1;if(digitToRound===10){v=String(Number(v)+1)+'0';}else{v+=digitToRound;}
   8.646 +v=Number(v)*(Math.pow(10,vlenDif));}else if(decplaces>0){integer=v.slice(0,decp);decimal=v.slice(decp+1);digitToLookAt=Number(decimal.charAt(decplaces));digitToRound=Number(decimal.charAt(decplaces-1));digitToRound=round(digitToRound,digitToLookAt,bool);decimal=decimal.slice(0,decplaces-1);if(digitToRound===10){v=Number(integer+'.'+decimal)+(1*(Math.pow(10,(0-decimal.length))));}else{v=Number(integer+'.'+decimal+digitToRound);}}else{integer=v.slice(0,decp);decimal=v.slice(decp+1);digitToLookAt=Number(decimal.charAt(decplaces));digitToRound=Number(integer.charAt(integer.length-1));digitToRound=round(digitToRound,digitToLookAt,bool);decimal='0';integer=integer.slice(0,integer.length-1);if(digitToRound===10){v=Number((Number(integer)+1)+decimal);}else{v=Number(integer+digitToRound);}}
   8.647 +return v;};if(typeof precision==='undefined'){precision=0;}
   8.648 +if(typeof mode==='undefined'){mode='PHP_ROUND_HALF_UP';}
   8.649 +negative=val<0;v=Math.abs(val).toString();decp=v.indexOf('.');if(decp===-1&&precision>=0){return val;}else{if(decp===-1){integer=v;decimal='0';}else{integer=v.slice(0,decp);if(precision>=0){decimal=v.substr(decp+1,precision+1);}else{decimal='0';}}
   8.650 +if(precision>0&&precision>=decimal.length){return val;}else if(precision<0&&Math.abs(precision)>=integer.length){return 0;}
   8.651 +if(decimal==='0'){return Number(integer);}
   8.652 +val=Number(integer+'.'+decimal);}
   8.653 +switch(mode){case 0:case'PHP_ROUND_HALF_UP':retVal=_round_half(val,precision,'up');break;case 1:case'PHP_ROUND_HALF_DOWN':retVal=_round_half(val,precision,'down');break;case 2:case'PHP_ROUND_HALF_EVEN':retVal=_round_half(val,precision,'even');break;case 3:case'PHP_ROUND_HALF_ODD':retVal=_round_half(val,precision,'odd');break;}
   8.654 +return negative?0-retVal:retVal;}
   8.655 +function rsort(inputArr,sort_flags){var valArr=[],k='',i=0,sorter=false,that=this,strictForIn=false,populateArr=[];switch(sort_flags){case'SORT_STRING':sorter=function(a,b){return that.strnatcmp(b,a);};break;case'SORT_LOCALE_STRING':var loc=this.i18n_loc_get_default();sorter=this.php_js.i18nLocales[loc].sorting;break;case'SORT_NUMERIC':sorter=function(a,b){return(b-a);};break;case'SORT_REGULAR':default:sorter=function(a,b){if(a<b){return 1;}
   8.656 +if(a>b){return-1;}
   8.657 +return 0;};break;}
   8.658 +this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
   8.659 +valArr.sort(sorter);for(i=0;i<valArr.length;i++){populateArr[i]=valArr[i];}
   8.660 +return strictForIn?true:populateArr;}
   8.661 +function rtrim(str,charlist){charlist=!charlist?' \\s\u00A0':(charlist+'').replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'\\$1');var re=new RegExp('['+charlist+']+$','g');return(str+'').replace(re,'');}
   8.662 +function serialize(mixed_value){var _getType=function(inp){var type=typeof inp,match;var key;if(type=='object'&&!inp){return'null';}
   8.663 +if(type=="object"){if(!inp.constructor){return'object';}
   8.664 +var cons=inp.constructor.toString();match=cons.match(/(\w+)\(/);if(match){cons=match[1].toLowerCase();}
   8.665 +var types=["boolean","number","string","array"];for(key in types){if(cons==types[key]){type=types[key];break;}}}
   8.666 +return type;};var type=_getType(mixed_value);var val,ktype='';switch(type){case"function":val="";break;case"boolean":val="b:"+(mixed_value?"1":"0");break;case"number":val=(Math.round(mixed_value)==mixed_value?"i":"d")+":"+mixed_value;break;case"string":mixed_value=this.utf8_encode(mixed_value);val="s:"+encodeURIComponent(mixed_value).replace(/%../g,'x').length+":\""+mixed_value+"\"";break;case"array":case"object":val="a";var count=0;var vals="";var okey;var key;for(key in mixed_value){ktype=_getType(mixed_value[key]);if(ktype=="function"){continue;}
   8.667 +okey=(key.match(/^[0-9]+$/)?parseInt(key,10):key);vals+=this.serialize(okey)+
   8.668 +this.serialize(mixed_value[key]);count++;}
   8.669 +val+=":"+count+":{"+vals+"}";break;case"undefined":default:val="N";break;}
   8.670 +if(type!="object"&&type!="array"){val+=";";}
   8.671 +return val;}
   8.672 +function setcookie(name,value,expires,path,domain,secure){return this.setrawcookie(name,encodeURIComponent(value),expires,path,domain,secure);}
   8.673 +function setrawcookie(name,value,expires,path,domain,secure){if(typeof expires==='string'&&(/^\d+$/).test(expires)){expires=parseInt(expires,10);}
   8.674 +if(expires instanceof Date){expires=expires.toGMTString();}else if(typeof(expires)==='number'){expires=(new Date(expires*1e3)).toGMTString();}
   8.675 +var r=[name+'='+value],s={},i='';s={expires:expires,path:path,domain:domain};for(i in s){if(s.hasOwnProperty(i)){s[i]&&r.push(i+'='+s[i]);}}
   8.676 +return secure&&r.push('secure'),this.window.document.cookie=r.join(";"),true;}
   8.677 +function settype(vr,type){var is_array=function(arr){return typeof arr==='object'&&typeof arr.length==='number'&&!(arr.propertyIsEnumerable('length'))&&typeof arr.splice==='function';};var v,mtch,i,obj;v=this[vr]?this[vr]:vr;try{switch(type){case'boolean':if(is_array(v)&&v.length===0){this[vr]=false;}
   8.678 +else if(v==='0'){this[vr]=false;}
   8.679 +else if(typeof v==='object'&&!is_array(v)){var lgth=false;for(i in v){lgth=true;}
   8.680 +this[vr]=lgth;}
   8.681 +else{this[vr]=!!v;}
   8.682 +break;case'integer':if(typeof v==='number'){this[vr]=parseInt(v,10);}
   8.683 +else if(typeof v==='string'){mtch=v.match(/^([+\-]?)(\d+)/);if(!mtch){this[vr]=0;}
   8.684 +else{this[vr]=parseInt(v,10);}}
   8.685 +else if(v===true){this[vr]=1;}
   8.686 +else if(v===false||v===null){this[vr]=0;}
   8.687 +else if(is_array(v)&&v.length===0){this[vr]=0;}
   8.688 +else if(typeof v==='object'){this[vr]=1;}
   8.689 +break;case'float':if(typeof v==='string'){mtch=v.match(/^([+\-]?)(\d+(\.\d+)?|\.\d+)([eE][+\-]?\d+)?/);if(!mtch){this[vr]=0;}
   8.690 +else{this[vr]=parseFloat(v,10);}}
   8.691 +else if(v===true){this[vr]=1;}
   8.692 +else if(v===false||v===null){this[vr]=0;}
   8.693 +else if(is_array(v)&&v.length===0){this[vr]=0;}
   8.694 +else if(typeof v==='object'){this[vr]=1;}
   8.695 +break;case'string':if(v===null||v===false){this[vr]='';}
   8.696 +else if(is_array(v)){this[vr]='Array';}
   8.697 +else if(typeof v==='object'){this[vr]='Object';}
   8.698 +else if(v===true){this[vr]='1';}
   8.699 +else{this[vr]+='';}
   8.700 +break;case'array':if(v===null){this[vr]=[];}
   8.701 +else if(typeof v!=='object'){this[vr]=[v];}
   8.702 +break;case'object':if(v===null){this[vr]={};}
   8.703 +else if(is_array(v)){for(i=0,obj={};i<v.length;i++){obj[i]=v;}
   8.704 +this[vr]=obj;}
   8.705 +else if(typeof v!=='object'){this[vr]={scalar:v};}
   8.706 +break;case'null':delete this[vr];break;}
   8.707 +return true;}catch(e){return false;}}
   8.708 +function sha1(str){var rotate_left=function(n,s){var t4=(n<<s)|(n>>>(32-s));return t4;};var cvt_hex=function(val){var str="";var i;var v;for(i=7;i>=0;i--){v=(val>>>(i*4))&0x0f;str+=v.toString(16);}
   8.709 +return str;};var blockstart;var i,j;var W=new Array(80);var H0=0x67452301;var H1=0xEFCDAB89;var H2=0x98BADCFE;var H3=0x10325476;var H4=0xC3D2E1F0;var A,B,C,D,E;var temp;str=this.utf8_encode(str);var str_len=str.length;var word_array=[];for(i=0;i<str_len-3;i+=4){j=str.charCodeAt(i)<<24|str.charCodeAt(i+1)<<16|str.charCodeAt(i+2)<<8|str.charCodeAt(i+3);word_array.push(j);}
   8.710 +switch(str_len%4){case 0:i=0x080000000;break;case 1:i=str.charCodeAt(str_len-1)<<24|0x0800000;break;case 2:i=str.charCodeAt(str_len-2)<<24|str.charCodeAt(str_len-1)<<16|0x08000;break;case 3:i=str.charCodeAt(str_len-3)<<24|str.charCodeAt(str_len-2)<<16|str.charCodeAt(str_len-1)<<8|0x80;break;}
   8.711 +word_array.push(i);while((word_array.length%16)!=14){word_array.push(0);}
   8.712 +word_array.push(str_len>>>29);word_array.push((str_len<<3)&0x0ffffffff);for(blockstart=0;blockstart<word_array.length;blockstart+=16){for(i=0;i<16;i++){W[i]=word_array[blockstart+i];}
   8.713 +for(i=16;i<=79;i++){W[i]=rotate_left(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);}
   8.714 +A=H0;B=H1;C=H2;D=H3;E=H4;for(i=0;i<=19;i++){temp=(rotate_left(A,5)+((B&C)|(~B&D))+E+W[i]+0x5A827999)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
   8.715 +for(i=20;i<=39;i++){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0x6ED9EBA1)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
   8.716 +for(i=40;i<=59;i++){temp=(rotate_left(A,5)+((B&C)|(B&D)|(C&D))+E+W[i]+0x8F1BBCDC)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
   8.717 +for(i=60;i<=79;i++){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0xCA62C1D6)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
   8.718 +H0=(H0+A)&0x0ffffffff;H1=(H1+B)&0x0ffffffff;H2=(H2+C)&0x0ffffffff;H3=(H3+D)&0x0ffffffff;H4=(H4+E)&0x0ffffffff;}
   8.719 +temp=cvt_hex(H0)+cvt_hex(H1)+cvt_hex(H2)+cvt_hex(H3)+cvt_hex(H4);return temp.toLowerCase();}
   8.720 +function shuffle(inputArr){var valArr=[],k='',i=0,strictForIn=false,populateArr=[];for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
   8.721 +valArr.sort(function(){return 0.5-Math.random();});this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(i=0;i<valArr.length;i++){populateArr[i]=valArr[i];}
   8.722 +return strictForIn?true:populateArr;}
   8.723 +function sin(arg){return Math.sin(arg);}
   8.724 +function sinh(arg){return(Math.exp(arg)-Math.exp(-arg))/2;}
   8.725 +function sizeof(mixed_var,mode){return this.count(mixed_var,mode);}
   8.726 +function sort(inputArr,sort_flags){var valArr=[],keyArr=[],k='',i=0,sorter=false,that=this,strictForIn=false,populateArr=[];switch(sort_flags){case'SORT_STRING':sorter=function(a,b){return that.strnatcmp(a,b);};break;case'SORT_LOCALE_STRING':var loc=this.i18n_loc_get_default();sorter=this.php_js.i18nLocales[loc].sorting;break;case'SORT_NUMERIC':sorter=function(a,b){return(a-b);};break;case'SORT_REGULAR':default:sorter=function(a,b){if(a>b){return 1;}
   8.727 +if(a<b){return-1;}
   8.728 +return 0;};break;}
   8.729 +this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
   8.730 +valArr.sort(sorter);for(i=0;i<valArr.length;i++){populateArr[i]=valArr[i];}
   8.731 +return strictForIn?true:populateArr;}
   8.732 +function soundex(str){var s='';var i,j,l,p=isNaN(p)?4:p>10?10:p<4?4:p;var m={BFPV:1,CGJKQSXZ:2,DT:3,L:4,MN:5,R:6};var r=(s=(str+'').toUpperCase().replace(/[^A-Z]/g,'').split('')).splice(0,1);var sl=0;sl=s.length;for(i=-1,l=sl;++i<l;){for(j in m){if(j.indexOf(s[i])+1&&r[r.length-1]!=m[j]&&r.push(m[j])){break;}}}
   8.733 +return r.length>p&&(r.length=p),r.join('')+(new Array(p-r.length+1)).join('0');}
   8.734 +function split(delimiter,string){return this.explode(delimiter,string);}
   8.735 +function sprintf(){var regex=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g;var a=arguments,i=0,format=a[i++];var pad=function(str,len,chr,leftJustify){if(!chr){chr=' ';}
   8.736 +var padding=(str.length>=len)?'':Array(1+len-str.length>>>0).join(chr);return leftJustify?str+padding:padding+str;};var justify=function(value,prefix,leftJustify,minWidth,zeroPad,customPadChar){var diff=minWidth-value.length;if(diff>0){if(leftJustify||!zeroPad){value=pad(value,minWidth,customPadChar,leftJustify);}else{value=value.slice(0,prefix.length)+pad('',diff,'0',true)+value.slice(prefix.length);}}
   8.737 +return value;};var formatBaseX=function(value,base,prefix,leftJustify,minWidth,precision,zeroPad){var number=value>>>0;prefix=prefix&&number&&{'2':'0b','8':'0','16':'0x'}[base]||'';value=prefix+pad(number.toString(base),precision||0,'0',false);return justify(value,prefix,leftJustify,minWidth,zeroPad);};var formatString=function(value,leftJustify,minWidth,precision,zeroPad,customPadChar){if(precision!=null){value=value.slice(0,precision);}
   8.738 +return justify(value,'',leftJustify,minWidth,zeroPad,customPadChar);};var doFormat=function(substring,valueIndex,flags,minWidth,_,precision,type){var number;var prefix;var method;var textTransform;var value;if(substring=='%%'){return'%';}
   8.739 +var leftJustify=false,positivePrefix='',zeroPad=false,prefixBaseX=false,customPadChar=' ';var flagsl=flags.length;for(var j=0;flags&&j<flagsl;j++){switch(flags.charAt(j)){case' ':positivePrefix=' ';break;case'+':positivePrefix='+';break;case'-':leftJustify=true;break;case"'":customPadChar=flags.charAt(j+1);break;case'0':zeroPad=true;break;case'#':prefixBaseX=true;break;}}
   8.740 +if(!minWidth){minWidth=0;}else if(minWidth=='*'){minWidth=+a[i++];}else if(minWidth.charAt(0)=='*'){minWidth=+a[minWidth.slice(1,-1)];}else{minWidth=+minWidth;}
   8.741 +if(minWidth<0){minWidth=-minWidth;leftJustify=true;}
   8.742 +if(!isFinite(minWidth)){throw new Error('sprintf: (minimum-)width must be finite');}
   8.743 +if(!precision){precision='fFeE'.indexOf(type)>-1?6:(type=='d')?0:undefined;}else if(precision=='*'){precision=+a[i++];}else if(precision.charAt(0)=='*'){precision=+a[precision.slice(1,-1)];}else{precision=+precision;}
   8.744 +value=valueIndex?a[valueIndex.slice(0,-1)]:a[i++];switch(type){case's':return formatString(String(value),leftJustify,minWidth,precision,zeroPad,customPadChar);case'c':return formatString(String.fromCharCode(+value),leftJustify,minWidth,precision,zeroPad);case'b':return formatBaseX(value,2,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'o':return formatBaseX(value,8,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'x':return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'X':return formatBaseX(value,16,prefixBaseX,leftJustify,minWidth,precision,zeroPad).toUpperCase();case'u':return formatBaseX(value,10,prefixBaseX,leftJustify,minWidth,precision,zeroPad);case'i':case'd':number=parseInt(+value,10);prefix=number<0?'-':positivePrefix;value=prefix+pad(String(Math.abs(number)),precision,'0',false);return justify(value,prefix,leftJustify,minWidth,zeroPad);case'e':case'E':case'f':case'F':case'g':case'G':number=+value;prefix=number<0?'-':positivePrefix;method=['toExponential','toFixed','toPrecision']['efg'.indexOf(type.toLowerCase())];textTransform=['toString','toUpperCase']['eEfFgG'.indexOf(type)%2];value=prefix+Math.abs(number)[method](precision);return justify(value,prefix,leftJustify,minWidth,zeroPad)[textTransform]();default:return substring;}};return format.replace(regex,doFormat);}
   8.745 +function sql_regcase(str){this.setlocale('LC_ALL',0);var i=0,upper='',lower='',pos=0,retStr='';upper=this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.upper;lower=this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.lower;for(i=0;i<str.length;i++){if(((pos=upper.indexOf(str.charAt(i)))!==-1)||((pos=lower.indexOf(str.charAt(i)))!==-1)){retStr+='['+upper.charAt(pos)+lower.charAt(pos)+']';}
   8.746 +else{retStr+=str.charAt(i);}}
   8.747 +return retStr;}
   8.748 +function sqrt(arg){return Math.sqrt(arg);}
   8.749 +function str_getcsv(input,delimiter,enclosure,escape){var output=[];var backwards=function(str){return str.split('').reverse().join('');};var pq=function(str){return(str+'').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1");};delimiter=delimiter||',';enclosure=enclosure||'"';escape=escape||'\\';input=input.replace(new RegExp('^\\s*'+pq(enclosure)),'').replace(new RegExp(pq(enclosure)+'\\s*$'),'');input=backwards(input).split(new RegExp(pq(enclosure)+'\\s*'+pq(delimiter)+'\\s*'+pq(enclosure)+'(?!'+pq(escape)+')','g')).reverse();for(var i=0;i<input.length;i++){output.push(backwards(input[i]).replace(new RegExp(pq(escape)+pq(enclosure),'g'),enclosure));}
   8.750 +return output;}
   8.751 +function str_ireplace(search,replace,subject){var i,k='';var searchl=0;var reg;var escapeRegex=function(s){return s.replace(/([\\\^\$*+\[\]?{}.=!:(|)])/g,'\\$1');};search+='';searchl=search.length;if(!(replace instanceof Array)){replace=[replace];if(search instanceof Array){while(searchl>replace.length){replace[replace.length]=replace[0];}}}
   8.752 +if(!(search instanceof Array)){search=[search];}
   8.753 +while(search.length>replace.length){replace[replace.length]='';}
   8.754 +if(subject instanceof Array){for(k in subject){if(subject.hasOwnProperty(k)){subject[k]=str_ireplace(search,replace,subject[k]);}}
   8.755 +return subject;}
   8.756 +searchl=search.length;for(i=0;i<searchl;i++){reg=new RegExp(escapeRegex(search[i]),'gi');subject=subject.replace(reg,replace[i]);}
   8.757 +return subject;}
   8.758 +function str_pad(input,pad_length,pad_string,pad_type){var half='',pad_to_go;var str_pad_repeater=function(s,len){var collect='',i;while(collect.length<len){collect+=s;}
   8.759 +collect=collect.substr(0,len);return collect;};input+='';pad_string=pad_string!==undefined?pad_string:' ';if(pad_type!='STR_PAD_LEFT'&&pad_type!='STR_PAD_RIGHT'&&pad_type!='STR_PAD_BOTH'){pad_type='STR_PAD_RIGHT';}
   8.760 +if((pad_to_go=pad_length-input.length)>0){if(pad_type=='STR_PAD_LEFT'){input=str_pad_repeater(pad_string,pad_to_go)+input;}
   8.761 +else if(pad_type=='STR_PAD_RIGHT'){input=input+str_pad_repeater(pad_string,pad_to_go);}
   8.762 +else if(pad_type=='STR_PAD_BOTH'){half=str_pad_repeater(pad_string,Math.ceil(pad_to_go/2));input=half+input+half;input=input.substr(0,pad_length);}}
   8.763 +return input;}
   8.764 +function str_repeat(input,multiplier){return new Array(multiplier+1).join(input);}
   8.765 +function str_replace(search,replace,subject,count){var i=0,j=0,temp='',repl='',sl=0,fl=0,f=[].concat(search),r=[].concat(replace),s=subject,ra=r instanceof Array,sa=s instanceof Array;s=[].concat(s);if(count){this.window[count]=0;}
   8.766 +for(i=0,sl=s.length;i<sl;i++){if(s[i]===''){continue;}
   8.767 +for(j=0,fl=f.length;j<fl;j++){temp=s[i]+'';repl=ra?(r[j]!==undefined?r[j]:''):r[0];s[i]=(temp).split(f[j]).join(repl);if(count&&s[i]!==temp){this.window[count]+=(temp.length-s[i].length)/f[j].length;}}}
   8.768 +return sa?s:s[0];}
   8.769 +function str_rot13(str){return(str+'').replace(/[a-z]/gi,function(s){return String.fromCharCode(s.charCodeAt(0)+(s.toLowerCase()<'n'?13:-13));});}
   8.770 +function str_shuffle(str){if(str==undefined){throw'Wrong parameter count for str_shuffle()';}
   8.771 +var getRandomInt=function(max){return Math.floor(Math.random()*(max+1));};var newStr='',rand=0;while(str.length){rand=getRandomInt(str.length-1);newStr+=str.charAt(rand);str=str.substring(0,rand)+str.substr(rand+1);}
   8.772 +return newStr;}
   8.773 +function str_split(string,split_length){if(string===undefined||!string.toString||split_length<1){return false;}
   8.774 +return string.toString().match(new RegExp('.{1,'+(split_length||'1')+'}','g'));}
   8.775 +function str_word_count(str,format,charlist){var len=str.length,cl=charlist&&charlist.length,chr='',tmpStr='',i=0,c='',wArr=[],wC=0,assoc={},aC=0,reg='',match=false;var _preg_quote=function(str){return(str+'').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!<>\|\:])/g,'\\$1');},_getWholeChar=function(str,i){var code=str.charCodeAt(i);if(code<0xD800||code>0xDFFF){return str.charAt(i);}
   8.776 +if(0xD800<=code&&code<=0xDBFF){if(str.length<=(i+1)){throw'High surrogate without following low surrogate';}
   8.777 +var next=str.charCodeAt(i+1);if(0xDC00>next||next>0xDFFF){throw'High surrogate without following low surrogate';}
   8.778 +return str.charAt(i)+str.charAt(i+1);}
   8.779 +if(i===0){throw'Low surrogate without preceding high surrogate';}
   8.780 +var prev=str.charCodeAt(i-1);if(0xD800>prev||prev>0xDBFF){throw'Low surrogate without preceding high surrogate';}
   8.781 +return false;};if(cl){reg='^('+_preg_quote(_getWholeChar(charlist,0));for(i=1;i<cl;i++){if((chr=_getWholeChar(charlist,i))===false){continue;}
   8.782 +reg+='|'+_preg_quote(chr);}
   8.783 +reg+=')$';reg=new RegExp(reg);}
   8.784 +for(i=0;i<len;i++){if((c=_getWholeChar(str,i))===false){continue;}
   8.785 +match=this.ctype_alpha(c)||(reg&&c.search(reg)!==-1)||((i!==0&&i!==len-1)&&c==='-')||(i!==0&&c==="'");if(match){if(tmpStr===''&&format===2){aC=i;}
   8.786 +tmpStr=tmpStr+c;}
   8.787 +if(i===len-1||!match&&tmpStr!==''){if(format!==2){wArr[wArr.length]=tmpStr;}else{assoc[aC]=tmpStr;}
   8.788 +tmpStr='';wC++;}}
   8.789 +if(!format){return wC;}else if(format===1){return wArr;}else if(format===2){return assoc;}
   8.790 +throw'You have supplied an incorrect format';}
   8.791 +function strcasecmp(f_string1,f_string2){var string1=(f_string1+'').toLowerCase();var string2=(f_string2+'').toLowerCase();if(string1>string2){return 1;}
   8.792 +else if(string1==string2){return 0;}
   8.793 +return-1;}
   8.794 +function strchr(haystack,needle,bool){return this.strstr(haystack,needle,bool);}
   8.795 +function strcmp(str1,str2){return((str1==str2)?0:((str1>str2)?1:-1));}
   8.796 +function strcspn(str,mask,start,length){start=start?start:0;var count=(length&&((start+length)<str.length))?start+length:str.length;strct:for(var i=start,lgth=0;i<count;i++){for(var j=0;j<mask.length;j++){if(str.charAt(i).indexOf(mask[j])!==-1){continue strct;}}
   8.797 +++lgth;}
   8.798 +return lgth;}
   8.799 +function strip_tags(str,allowed_tags){var key='',allowed=false;var matches=[];var allowed_array=[];var allowed_tag='';var i=0;var k='';var html='';var replacer=function(search,replace,str){return str.split(search).join(replace);};if(allowed_tags){allowed_array=allowed_tags.match(/([a-zA-Z0-9]+)/gi);}
   8.800 +str+='';matches=str.match(/(<\/?[\S][^>]*>)/gi);for(key in matches){if(isNaN(key)){continue;}
   8.801 +html=matches[key].toString();allowed=false;for(k in allowed_array){allowed_tag=allowed_array[k];i=-1;if(i!=0){i=html.toLowerCase().indexOf('<'+allowed_tag+'>');}
   8.802 +if(i!=0){i=html.toLowerCase().indexOf('<'+allowed_tag+' ');}
   8.803 +if(i!=0){i=html.toLowerCase().indexOf('</'+allowed_tag);}
   8.804 +if(i==0){allowed=true;break;}}
   8.805 +if(!allowed){str=replacer(html,"",str);}}
   8.806 +return str;}
   8.807 +function stripos(f_haystack,f_needle,f_offset){var haystack=(f_haystack+'').toLowerCase();var needle=(f_needle+'').toLowerCase();var index=0;if((index=haystack.indexOf(needle,f_offset))!==-1){return index;}
   8.808 +return false;}
   8.809 +function stripslashes(str){return(str+'').replace(/\\(.?)/g,function(s,n1){switch(n1){case'\\':return'\\';case'0':return'\u0000';case'':return'';default:return n1;}});}
   8.810 +function stristr(haystack,needle,bool){var pos=0;haystack+='';pos=haystack.toLowerCase().indexOf((needle+'').toLowerCase());if(pos==-1){return false;}else{if(bool){return haystack.substr(0,pos);}else{return haystack.slice(pos);}}}
   8.811 +function strlen(string){var str=string+'';var i=0,chr='',lgth=0;if(!this.php_js||!this.php_js.ini||!this.php_js.ini['unicode.semantics']||this.php_js.ini['unicode.semantics'].local_value.toLowerCase()!=='on'){return string.length;}
   8.812 +var getWholeChar=function(str,i){var code=str.charCodeAt(i);var next='',prev='';if(0xD800<=code&&code<=0xDBFF){if(str.length<=(i+1)){throw'High surrogate without following low surrogate';}
   8.813 +next=str.charCodeAt(i+1);if(0xDC00>next||next>0xDFFF){throw'High surrogate without following low surrogate';}
   8.814 +return str.charAt(i)+str.charAt(i+1);}else if(0xDC00<=code&&code<=0xDFFF){if(i===0){throw'Low surrogate without preceding high surrogate';}
   8.815 +prev=str.charCodeAt(i-1);if(0xD800>prev||prev>0xDBFF){throw'Low surrogate without preceding high surrogate';}
   8.816 +return false;}
   8.817 +return str.charAt(i);};for(i=0,lgth=0;i<str.length;i++){if((chr=getWholeChar(str,i))===false){continue;}
   8.818 +lgth++;}
   8.819 +return lgth;}
   8.820 +function strnatcasecmp(str1,str2){var a=(str1+'').toLowerCase();var b=(str2+'').toLowerCase();var isWhitespaceChar=function(a){return a.charCodeAt(0)<=32;};var isDigitChar=function(a){var charCode=a.charCodeAt(0);return(charCode>=48&&charCode<=57);};var compareRight=function(a,b){var bias=0;var ia=0;var ib=0;var ca;var cb;for(;;ia++,ib++){ca=a.charAt(ia);cb=b.charAt(ib);if(!isDigitChar(ca)&&!isDigitChar(cb)){return bias;}else if(!isDigitChar(ca)){return-1;}else if(!isDigitChar(cb)){return+1;}else if(ca<cb){if(bias==0){bias=-1;}}else if(ca>cb){if(bias==0){bias=+1;}}else if(ca==0&&cb==0){return bias;}}};var ia=0,ib=0;var nza=0,nzb=0;var ca,cb;var result;while(true){nza=nzb=0;ca=a.charAt(ia);cb=b.charAt(ib);while(isWhitespaceChar(ca)||ca=='0'){if(ca=='0'){nza++;}else{nza=0;}
   8.821 +ca=a.charAt(++ia);}
   8.822 +while(isWhitespaceChar(cb)||cb=='0'){if(cb=='0'){nzb++;}else{nzb=0;}
   8.823 +cb=b.charAt(++ib);}
   8.824 +if(isDigitChar(ca)&&isDigitChar(cb)){if((result=compareRight(a.substring(ia),b.substring(ib)))!=0){return result;}}
   8.825 +if(ca==0&&cb==0){return nza-nzb;}
   8.826 +if(ca<cb){return-1;}else if(ca>cb){return+1;}
   8.827 +++ia;++ib;}}
   8.828 +function strnatcmp(f_string1,f_string2,f_version){var i=0;if(f_version==undefined){f_version=false;}
   8.829 +var __strnatcmp_split=function(f_string){var result=[];var buffer='';var chr='';var i=0,f_stringl=0;var text=true;f_stringl=f_string.length;for(i=0;i<f_stringl;i++){chr=f_string.substring(i,i+1);if(chr.match(/\d/)){if(text){if(buffer.length>0){result[result.length]=buffer;buffer='';}
   8.830 +text=false;}
   8.831 +buffer+=chr;}else if((text==false)&&(chr=='.')&&(i<(f_string.length-1))&&(f_string.substring(i+1,i+2).match(/\d/))){result[result.length]=buffer;buffer='';}else{if(text==false){if(buffer.length>0){result[result.length]=parseInt(buffer,10);buffer='';}
   8.832 +text=true;}
   8.833 +buffer+=chr;}}
   8.834 +if(buffer.length>0){if(text){result[result.length]=buffer;}else{result[result.length]=parseInt(buffer,10);}}
   8.835 +return result;};var array1=__strnatcmp_split(f_string1+'');var array2=__strnatcmp_split(f_string2+'');var len=array1.length;var text=true;var result=-1;var r=0;if(len>array2.length){len=array2.length;result=1;}
   8.836 +for(i=0;i<len;i++){if(isNaN(array1[i])){if(isNaN(array2[i])){text=true;if((r=this.strcmp(array1[i],array2[i]))!=0){return r;}}else if(text){return 1;}else{return-1;}}else if(isNaN(array2[i])){if(text){return-1;}else{return 1;}}else{if(text||f_version){if((r=(array1[i]-array2[i]))!=0){return r;}}else{if((r=this.strcmp(array1[i].toString(),array2[i].toString()))!=0){return r;}}
   8.837 +text=false;}}
   8.838 +return result;}
   8.839 +function strncasecmp(argStr1,argStr2,len){var diff,i=0;var str1=(argStr1+'').toLowerCase().substr(0,len);var str2=(argStr2+'').toLowerCase().substr(0,len);if(str1.length!==str2.length){if(str1.length<str2.length){len=str1.length;if(str2.substr(0,str1.length)==str1){return str1.length-str2.length;}}else{len=str2.length;if(str1.substr(0,str2.length)==str2){return str1.length-str2.length;}}}else{len=str1.length;}
   8.840 +for(diff=0,i=0;i<len;i++){diff=str1.charCodeAt(i)-str2.charCodeAt(i);if(diff!==0){return diff;}}
   8.841 +return 0;}
   8.842 +function strncmp(str1,str2,lgth){var s1=(str1+'').substr(0,lgth);var s2=(str2+'').substr(0,lgth);return((s1==s2)?0:((s1>s2)?1:-1));}
   8.843 +function strpbrk(haystack,char_list){for(var i=0,len=haystack.length;i<len;++i){if(char_list.indexOf(haystack.charAt(i))>=0)
   8.844 +return haystack.slice(i);}
   8.845 +return false;}
   8.846 +function strpos(haystack,needle,offset){var i=(haystack+'').indexOf(needle,(offset||0));return i===-1?false:i;}
   8.847 +function strrchr(haystack,needle){var pos=0;if(typeof needle!=='string'){needle=String.fromCharCode(parseInt(needle,10));}
   8.848 +needle=needle.charAt(0);pos=haystack.lastIndexOf(needle);if(pos===-1){return false;}
   8.849 +return haystack.substr(pos);}
   8.850 +function strrev(string){string=string+'';var grapheme_extend=/(.)([\uDC00-\uDFFF\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065E\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0901-\u0903\u093C\u093E-\u094D\u0951-\u0954\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F90-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B6-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAA\u1C24-\u1C37\u1DC0-\u1DE6\u1DFE\u1DFF\u20D0-\u20F0\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA67C\uA67D\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA926-\uA92D\uA947-\uA953\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uFB1E\uFE00-\uFE0F\uFE20-\uFE26])/g;string=string.replace(grapheme_extend,'$2$1');return string.split('').reverse().join('');}
   8.851 +function strripos(haystack,needle,offset){haystack=(haystack+'').toLowerCase();needle=(needle+'').toLowerCase();var i=-1;if(offset){i=(haystack+'').slice(offset).lastIndexOf(needle);if(i!==-1){i+=offset;}}
   8.852 +else{i=(haystack+'').lastIndexOf(needle);}
   8.853 +return i>=0?i:false;}
   8.854 +function strrpos(haystack,needle,offset){var i=-1;if(offset){i=(haystack+'').slice(offset).lastIndexOf(needle);if(i!==-1){i+=offset;}}
   8.855 +else{i=(haystack+'').lastIndexOf(needle);}
   8.856 +return i>=0?i:false;}
   8.857 +function strspn(str1,str2,start,lgth){var found;var stri;var strj;var j=0;var i=0;start=start?(start<0?(str1.length+start):start):0;lgth=lgth?((lgth<0)?(str1.length+lgth-start):lgth):str1.length-start;str1=str1.substr(start,lgth);for(i=0;i<str1.length;i++){found=0;stri=str1.substring(i,i+1);for(j=0;j<=str2.length;j++){strj=str2.substring(j,j+1);if(stri==strj){found=1;break;}}
   8.858 +if(found!=1){return i;}}
   8.859 +return i;}
   8.860 +function strstr(haystack,needle,bool){var pos=0;haystack+='';pos=haystack.indexOf(needle);if(pos==-1){return false;}else{if(bool){return haystack.substr(0,pos);}else{return haystack.slice(pos);}}}
   8.861 +function strtok(str,tokens){this.php_js=this.php_js||{};if(tokens===undefined){tokens=str;str=this.php_js.strtokleftOver;}
   8.862 +if(str.length===0){return false;}
   8.863 +if(tokens.indexOf(str.charAt(0))!==-1){return this.strtok(str.substr(1),tokens);}
   8.864 +for(var i=0;i<str.length;i++){if(tokens.indexOf(str.charAt(i))!==-1){break;}}
   8.865 +this.php_js.strtokleftOver=str.substr(i+1);return str.substring(0,i);}
   8.866 +function strtolower(str){return(str+'').toLowerCase();}
   8.867 +function strtotime(str,now){var i,match,s,strTmp='',parse='';strTmp=str;strTmp=strTmp.replace(/\s{2,}|^\s|\s$/g,' ');strTmp=strTmp.replace(/[\t\r\n]/g,'');if(strTmp=='now'){return(new Date()).getTime()/1000;}else if(!isNaN(parse=Date.parse(strTmp))){return(parse/1000);}else if(now){now=new Date(now*1000);}else{now=new Date();}
   8.868 +strTmp=strTmp.toLowerCase();var __is={day:{'sun':0,'mon':1,'tue':2,'wed':3,'thu':4,'fri':5,'sat':6},mon:{'jan':0,'feb':1,'mar':2,'apr':3,'may':4,'jun':5,'jul':6,'aug':7,'sep':8,'oct':9,'nov':10,'dec':11}};var process=function(m){var ago=(m[2]&&m[2]=='ago');var num=(num=m[0]=='last'?-1:1)*(ago?-1:1);switch(m[0]){case'last':case'next':switch(m[1].substring(0,3)){case'yea':now.setFullYear(now.getFullYear()+num);break;case'mon':now.setMonth(now.getMonth()+num);break;case'wee':now.setDate(now.getDate()+(num*7));break;case'day':now.setDate(now.getDate()+num);break;case'hou':now.setHours(now.getHours()+num);break;case'min':now.setMinutes(now.getMinutes()+num);break;case'sec':now.setSeconds(now.getSeconds()+num);break;default:var day;if(typeof(day=__is.day[m[1].substring(0,3)])!='undefined'){var diff=day-now.getDay();if(diff==0){diff=7*num;}else if(diff>0){if(m[0]=='last'){diff-=7;}}else{if(m[0]=='next'){diff+=7;}}
   8.869 +now.setDate(now.getDate()+diff);}}
   8.870 +break;default:if(/\d+/.test(m[0])){num*=parseInt(m[0],10);switch(m[1].substring(0,3)){case'yea':now.setFullYear(now.getFullYear()+num);break;case'mon':now.setMonth(now.getMonth()+num);break;case'wee':now.setDate(now.getDate()+(num*7));break;case'day':now.setDate(now.getDate()+num);break;case'hou':now.setHours(now.getHours()+num);break;case'min':now.setMinutes(now.getMinutes()+num);break;case'sec':now.setSeconds(now.getSeconds()+num);break;}}else{return false;}
   8.871 +break;}
   8.872 +return true;};match=strTmp.match(/^(\d{2,4}-\d{2}-\d{2})(?:\s(\d{1,2}:\d{2}(:\d{2})?)?(?:\.(\d+))?)?$/);if(match!=null){if(!match[2]){match[2]='00:00:00';}else if(!match[3]){match[2]+=':00';}
   8.873 +s=match[1].split(/-/g);for(i in __is.mon){if(__is.mon[i]==s[1]-1){s[1]=i;}}
   8.874 +s[0]=parseInt(s[0],10);s[0]=(s[0]>=0&&s[0]<=69)?'20'+(s[0]<10?'0'+s[0]:s[0]+''):(s[0]>=70&&s[0]<=99)?'19'+s[0]:s[0]+'';return parseInt(this.strtotime(s[2]+' '+s[1]+' '+s[0]+' '+match[2])+(match[4]?match[4]/1000:''),10);}
   8.875 +var regex='([+-]?\\d+\\s'+'(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?'+'|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday'+'|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday)'+'|(last|next)\\s'+'(years?|months?|weeks?|days?|hours?|min|minutes?|sec|seconds?'+'|sun\\.?|sunday|mon\\.?|monday|tue\\.?|tuesday|wed\\.?|wednesday'+'|thu\\.?|thursday|fri\\.?|friday|sat\\.?|saturday))'+'(\\sago)?';match=strTmp.match(new RegExp(regex,'gi'));if(match==null){return false;}
   8.876 +for(i=0;i<match.length;i++){if(!process(match[i].split(' '))){return false;}}
   8.877 +return(now.getTime()/1000);}
   8.878 +function strtoupper(str){return(str+'').toUpperCase();}
   8.879 +function strtr(str,from,to){var fr='',i=0,j=0,lenStr=0,lenFrom=0,tmpStrictForIn=false,fromTypeStr='',toTypeStr='',istr='';var tmpFrom=[];var tmpTo=[];var ret='';var match=false;if(typeof from==='object'){tmpStrictForIn=this.ini_set('phpjs.strictForIn',false);from=this.krsort(from);this.ini_set('phpjs.strictForIn',tmpStrictForIn);for(fr in from){if(from.hasOwnProperty(fr)){tmpFrom.push(fr);tmpTo.push(from[fr]);}}
   8.880 +from=tmpFrom;to=tmpTo;}
   8.881 +lenStr=str.length;lenFrom=from.length;fromTypeStr=typeof from==='string';toTypeStr=typeof to==='string';for(i=0;i<lenStr;i++){match=false;if(fromTypeStr){istr=str.charAt(i);for(j=0;j<lenFrom;j++){if(istr==from.charAt(j)){match=true;break;}}}
   8.882 +else{for(j=0;j<lenFrom;j++){if(str.substr(i,from[j].length)==from[j]){match=true;i=(i+from[j].length)-1;break;}}}
   8.883 +if(match){ret+=toTypeStr?to.charAt(j):to[j];}else{ret+=str.charAt(i);}}
   8.884 +return ret;}
   8.885 +function substr(str,start,len){var i=0,allBMP=true,es=0,el=0,se=0,ret='';str+='';var end=str.length;this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};switch((this.php_js.ini['unicode.semantics']&&this.php_js.ini['unicode.semantics'].local_value.toLowerCase())){case'on':for(i=0;i<str.length;i++){if(/[\uD800-\uDBFF]/.test(str.charAt(i))&&/[\uDC00-\uDFFF]/.test(str.charAt(i+1))){allBMP=false;break;}}
   8.886 +if(!allBMP){if(start<0){for(i=end-1,es=(start+=end);i>=es;i--){if(/[\uDC00-\uDFFF]/.test(str.charAt(i))&&/[\uD800-\uDBFF]/.test(str.charAt(i-1))){start--;es--;}}}
   8.887 +else{var surrogatePairs=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;while((surrogatePairs.exec(str))!=null){var li=surrogatePairs.lastIndex;if(li-2<start){start++;}
   8.888 +else{break;}}}
   8.889 +if(start>=end||start<0){return false;}
   8.890 +if(len<0){for(i=end-1,el=(end+=len);i>=el;i--){if(/[\uDC00-\uDFFF]/.test(str.charAt(i))&&/[\uD800-\uDBFF]/.test(str.charAt(i-1))){end--;el--;}}
   8.891 +if(start>end){return false;}
   8.892 +return str.slice(start,end);}
   8.893 +else{se=start+len;for(i=start;i<se;i++){ret+=str.charAt(i);if(/[\uD800-\uDBFF]/.test(str.charAt(i))&&/[\uDC00-\uDFFF]/.test(str.charAt(i+1))){se++;}}
   8.894 +return ret;}
   8.895 +break;}
   8.896 +case'off':default:if(start<0){start+=end;}
   8.897 +end=typeof len==='undefined'?end:(len<0?len+end:len+start);return start>=str.length||start<0||start>end?!1:str.slice(start,end);}
   8.898 +return undefined;}
   8.899 +function substr_compare(main_str,str,offset,length,case_insensitivity){if(!offset&&offset!==0){throw'Missing offset for substr_compare()';}
   8.900 +if(offset<0){offset=main_str.length+offset;}
   8.901 +if(length&&length>(main_str.length-offset)){return false;}
   8.902 +length=length||main_str.length-offset;main_str=main_str.substr(offset,length);str=str.substr(0,length);if(case_insensitivity){main_str=(main_str+'').toLowerCase();str=(str+'').toLowerCase();if(main_str==str){return 0;}
   8.903 +return(main_str>str)?1:-1;}
   8.904 +return((main_str==str)?0:((main_str>str)?1:-1));}
   8.905 +function substr_count(haystack,needle,offset,length){var pos=0,cnt=0;haystack+='';needle+='';if(isNaN(offset)){offset=0;}
   8.906 +if(isNaN(length)){length=0;}
   8.907 +offset--;while((offset=haystack.indexOf(needle,offset+1))!=-1){if(length>0&&(offset+needle.length)>length){return false;}else{cnt++;}}
   8.908 +return cnt;}
   8.909 +function substr_replace(str,replace,start,length){if(start<0){start=start+str.length;}
   8.910 +length=length!==undefined?length:str.length;if(length<0){length=length+str.length-start;}
   8.911 +return str.slice(0,start)+replace.substr(0,length)+replace.slice(length)+str.slice(start+length);}
   8.912 +function tan(arg){return Math.tan(arg);}
   8.913 +function tanh(arg){return(Math.exp(arg)-Math.exp(-arg))/(Math.exp(arg)+Math.exp(-arg));}
   8.914 +function time(){return Math.floor(new Date().getTime()/1000);}
   8.915 +function trim(str,charlist){var whitespace,l=0,i=0;str+='';if(!charlist){whitespace=" \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";}else{charlist+='';whitespace=charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'$1');}
   8.916 +l=str.length;for(i=0;i<l;i++){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(i);break;}}
   8.917 +l=str.length;for(i=l-1;i>=0;i--){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(0,i+1);break;}}
   8.918 +return whitespace.indexOf(str.charAt(0))===-1?str:'';}
   8.919 +function uasort(inputArr,sorter){var valArr=[],keyArr=[],tempKeyVal,tempValue,ret,k='',i=0,strictForIn=false,populateArr=[];if(typeof sorter==='string'){sorter=this[sorter];}else if(sorter instanceof Array){sorter=this[sorter[0]][sorter[1]];}
   8.920 +var sorterNew=function(keyArr,valArr){for(var i=valArr.length-2;i>=0;i--){for(var j=0;j<=i;j++){ret=sorter(valArr[j+1],valArr[j]);if(ret<0){tempValue=valArr[j];valArr[j]=valArr[j+1];valArr[j+1]=tempValue;tempKeyVal=keyArr[j];keyArr[j]=keyArr[j+1];keyArr[j+1]=tempKeyVal;}}}};this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
   8.921 +try{sorterNew(keyArr,valArr);}catch(e){return false;}
   8.922 +for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
   8.923 +return strictForIn?true:populateArr;}
   8.924 +function ucfirst(str){str+='';var f=str.charAt(0).toUpperCase();return f+str.substr(1);}
   8.925 +function ucwords(str){return(str+'').replace(/^(.)|\s(.)/g,function($1){return $1.toUpperCase();});}
   8.926 +function uksort(inputArr,sorter){var tmp_arr={},keys=[],i=0,k='',strictForIn=false,populateArr=[];if(typeof sorter==='string'){sorter=this.window[sorter];}
   8.927 +for(k in inputArr){if(inputArr.hasOwnProperty(k)){keys.push(k);}}
   8.928 +try{if(sorter){keys.sort(sorter);}else{keys.sort();}}catch(e){return false;}
   8.929 +this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(i=0;i<keys.length;i++){k=keys[i];tmp_arr[k]=inputArr[k];if(strictForIn){delete inputArr[k];}}
   8.930 +for(i in tmp_arr){if(tmp_arr.hasOwnProperty(i)){populateArr[i]=tmp_arr[i];}}
   8.931 +return strictForIn?true:populateArr;}
   8.932 +function unserialize(data){var that=this;var utf8Overhead=function(chr){var code=chr.charCodeAt(0);if(code<0x0080){return 0;}
   8.933 +if(code<0x0800){return 1;}
   8.934 +return 2;};var error=function(type,msg,filename,line){throw new that.window[type](msg,filename,line);};var read_until=function(data,offset,stopchr){var buf=[];var chr=data.slice(offset,offset+1);var i=2;while(chr!=stopchr){if((i+offset)>data.length){error('Error','Invalid');}
   8.935 +buf.push(chr);chr=data.slice(offset+(i-1),offset+i);i+=1;}
   8.936 +return[buf.length,buf.join('')];};var read_chrs=function(data,offset,length){var buf;buf=[];for(var i=0;i<length;i++){var chr=data.slice(offset+(i-1),offset+i);buf.push(chr);length-=utf8Overhead(chr);}
   8.937 +return[buf.length,buf.join('')];};var _unserialize=function(data,offset){var readdata;var readData;var chrs=0;var ccount;var stringlength;var keyandchrs;var keys;if(!offset){offset=0;}
   8.938 +var dtype=(data.slice(offset,offset+1)).toLowerCase();var dataoffset=offset+2;var typeconvert=function(x){return x;};switch(dtype){case'i':typeconvert=function(x){return parseInt(x,10);};readData=read_until(data,dataoffset,';');chrs=readData[0];readdata=readData[1];dataoffset+=chrs+1;break;case'b':typeconvert=function(x){return parseInt(x,10)!==0;};readData=read_until(data,dataoffset,';');chrs=readData[0];readdata=readData[1];dataoffset+=chrs+1;break;case'd':typeconvert=function(x){return parseFloat(x);};readData=read_until(data,dataoffset,';');chrs=readData[0];readdata=readData[1];dataoffset+=chrs+1;break;case'n':readdata=null;break;case's':ccount=read_until(data,dataoffset,':');chrs=ccount[0];stringlength=ccount[1];dataoffset+=chrs+2;readData=read_chrs(data,dataoffset+1,parseInt(stringlength,10));chrs=readData[0];readdata=readData[1];dataoffset+=chrs+2;if(chrs!=parseInt(stringlength,10)&&chrs!=readdata.length){error('SyntaxError','String length mismatch');}
   8.939 +readdata=that.utf8_decode(readdata);break;case'a':readdata={};keyandchrs=read_until(data,dataoffset,':');chrs=keyandchrs[0];keys=keyandchrs[1];dataoffset+=chrs+2;for(var i=0;i<parseInt(keys,10);i++){var kprops=_unserialize(data,dataoffset);var kchrs=kprops[1];var key=kprops[2];dataoffset+=kchrs;var vprops=_unserialize(data,dataoffset);var vchrs=vprops[1];var value=vprops[2];dataoffset+=vchrs;readdata[key]=value;}
   8.940 +dataoffset+=1;break;default:error('SyntaxError','Unknown / Unhandled data type(s): '+dtype);break;}
   8.941 +return[dtype,dataoffset-offset,typeconvert(readdata)];};return _unserialize((data+''),0)[2];}
   8.942 +function urldecode(str){return decodeURIComponent(str.replace(/\+/g,'%20'));}
   8.943 +function urlencode(str){str=(str+'').toString();return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/%20/g,'+');}
   8.944 +function usort(inputArr,sorter){var valArr=[],k='',i=0,strictForIn=false,populateArr=[];if(typeof sorter==='string'){sorter=this[sorter];}else if(sorter instanceof Array){sorter=this[sorter[0]][sorter[1]];}
   8.945 +this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value;populateArr=strictForIn?inputArr:populateArr;for(k in inputArr){if(inputArr.hasOwnProperty(k)){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
   8.946 +try{valArr.sort(sorter);}catch(e){return false;}
   8.947 +for(i=0;i<valArr.length;i++){populateArr[i]=valArr[i];}
   8.948 +return strictForIn?true:populateArr;}
   8.949 +function utf8_decode(str_data){var tmp_arr=[],i=0,ac=0,c1=0,c2=0,c3=0;str_data+='';while(i<str_data.length){c1=str_data.charCodeAt(i);if(c1<128){tmp_arr[ac++]=String.fromCharCode(c1);i++;}else if((c1>191)&&(c1<224)){c2=str_data.charCodeAt(i+1);tmp_arr[ac++]=String.fromCharCode(((c1&31)<<6)|(c2&63));i+=2;}else{c2=str_data.charCodeAt(i+1);c3=str_data.charCodeAt(i+2);tmp_arr[ac++]=String.fromCharCode(((c1&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
   8.950 +return tmp_arr.join('');}
   8.951 +function utf8_encode(argString){var string=(argString+'');var utftext="";var start,end;var stringl=0;start=end=0;stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n);var enc=null;if(c1<128){end++;}else if(c1>127&&c1<2048){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128);}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128);}
   8.952 +if(enc!==null){if(end>start){utftext+=string.substring(start,end);}
   8.953 +utftext+=enc;start=end=n+1;}}
   8.954 +if(end>start){utftext+=string.substring(start,string.length);}
   8.955 +return utftext;}
   8.956 +function var_dump(){var output='',pad_char=' ',pad_val=4,lgth=0,i=0,d=this.window.document;var _getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
   8.957 +return name[1];};var _repeat_char=function(len,pad_char){var str='';for(var i=0;i<len;i++){str+=pad_char;}
   8.958 +return str;};var _getInnerVal=function(val,thick_pad){var ret='';if(val===null){ret='NULL';}
   8.959 +else if(typeof val==='boolean'){ret='bool('+val+')';}
   8.960 +else if(typeof val==='string'){ret='string('+val.length+') "'+val+'"';}
   8.961 +else if(typeof val==='number'){if(parseFloat(val)==parseInt(val,10)){ret='int('+val+')';}
   8.962 +else{ret='float('+val+')';}}
   8.963 +else if(typeof val==='undefined'){ret='undefined';}
   8.964 +else if(typeof val==='function'){var funcLines=val.toString().split('\n');ret='';for(var i=0,fll=funcLines.length;i<fll;i++){ret+=(i!==0?'\n'+thick_pad:'')+funcLines[i];}}
   8.965 +else if(val instanceof Date){ret='Date('+val+')';}
   8.966 +else if(val instanceof RegExp){ret='RegExp('+val+')';}
   8.967 +else if(val.nodeName){switch(val.nodeType){case 1:if(typeof val.namespaceURI==='undefined'||val.namespaceURI==='http://www.w3.org/1999/xhtml'){ret='HTMLElement("'+val.nodeName+'")';}
   8.968 +else{ret='XML Element("'+val.nodeName+'")';}
   8.969 +break;case 2:ret='ATTRIBUTE_NODE('+val.nodeName+')';break;case 3:ret='TEXT_NODE('+val.nodeValue+')';break;case 4:ret='CDATA_SECTION_NODE('+val.nodeValue+')';break;case 5:ret='ENTITY_REFERENCE_NODE';break;case 6:ret='ENTITY_NODE';break;case 7:ret='PROCESSING_INSTRUCTION_NODE('+val.nodeName+':'+val.nodeValue+')';break;case 8:ret='COMMENT_NODE('+val.nodeValue+')';break;case 9:ret='DOCUMENT_NODE';break;case 10:ret='DOCUMENT_TYPE_NODE';break;case 11:ret='DOCUMENT_FRAGMENT_NODE';break;case 12:ret='NOTATION_NODE';break;}}
   8.970 +return ret;};var _formatArray=function(obj,cur_depth,pad_val,pad_char){var someProp='';if(cur_depth>0){cur_depth++;}
   8.971 +var base_pad=_repeat_char(pad_val*(cur_depth-1),pad_char);var thick_pad=_repeat_char(pad_val*(cur_depth+1),pad_char);var str='';var val='';if(typeof obj==='object'&&obj!==null){if(obj.constructor&&_getFuncName(obj.constructor)==='PHPJS_Resource'){return obj.var_dump();}
   8.972 +lgth=0;for(someProp in obj){lgth++;}
   8.973 +str+='array('+lgth+') {\n';for(var key in obj){var objVal=obj[key];if(typeof objVal==='object'&&objVal!==null&&!(objVal instanceof Date)&&!(objVal instanceof RegExp)&&!objVal.nodeName){str+=thick_pad+'['+key+'] =>\n'+thick_pad+_formatArray(objVal,cur_depth+1,pad_val,pad_char);}else{val=_getInnerVal(objVal,thick_pad);str+=thick_pad+'['+key+'] =>\n'+thick_pad+val+'\n';}}
   8.974 +str+=base_pad+'}\n';}else{str=_getInnerVal(obj,thick_pad);}
   8.975 +return str;};output=_formatArray(arguments[0],0,pad_val,pad_char);for(i=1;i<arguments.length;i++){output+='\n'+_formatArray(arguments[i],0,pad_val,pad_char);}
   8.976 +if(d.body){this.echo(output);}
   8.977 +else{try{d=XULDocument;this.echo('<pre xmlns="http://www.w3.org/1999/xhtml" style="white-space:pre;">'+output+'</pre>');}
   8.978 +catch(e){this.echo(output);}}}
   8.979 +function var_export(mixed_expression,bool_return){var retstr='',iret='',cnt=0,x=[],i=0,funcParts=[],idtLevel=arguments[2]||2,innerIndent='',outerIndent='';var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
   8.980 +return name[1];};var _makeIndent=function(idtLevel){return(new Array(idtLevel+1)).join(' ');};var __getType=function(inp){var i=0;var match,type=typeof inp;if(type==='object'&&inp.constructor&&getFuncName(inp.constructor)==='PHPJS_Resource'){return'resource';}
   8.981 +if(type==='function'){return'function';}
   8.982 +if(type==='object'&&!inp){return'null';}
   8.983 +if(type==="object"){if(!inp.constructor){return'object';}
   8.984 +var cons=inp.constructor.toString();match=cons.match(/(\w+)\(/);if(match){cons=match[1].toLowerCase();}
   8.985 +var types=["boolean","number","string","array"];for(i=0;i<types.length;i++){if(cons===types[i]){type=types[i];break;}}}
   8.986 +return type;};var type=__getType(mixed_expression);if(type===null){retstr="NULL";}else if(type==='array'||type==='object'){outerIndent=_makeIndent(idtLevel-2);innerIndent=_makeIndent(idtLevel);for(i in mixed_expression){var value=this.var_export(mixed_expression[i],true,idtLevel+2);value=typeof value==='string'?value.replace(/</g,'&lt;').replace(/>/g,'&gt;'):value;x[cnt++]=innerIndent+i+' => '+(__getType(mixed_expression[i])==='array'?'\n':'')+value;}
   8.987 +iret=x.join(',\n');retstr=outerIndent+"array (\n"+iret+'\n'+outerIndent+')';}
   8.988 +else if(type==='function'){funcParts=mixed_expression.toString().match(/function .*?\((.*?)\) \{([\s\S]*)\}/);retstr="create_function ('"+funcParts[1]+"', '"+funcParts[2].replace(new RegExp("'",'g'),"\\'")+"')";}
   8.989 +else if(type==='resource'){retstr='NULL';}else{retstr=(typeof(mixed_expression)!=='string')?mixed_expression:"'"+mixed_expression.replace(/(["'])/g,"\\$1").replace(/\0/g,"\\0")+"'";}
   8.990 +if(bool_return!==true){this.echo(retstr);return null;}else{return retstr;}}
   8.991 +function vprintf(format,args){var body,elmt;var ret='',d=this.window.document;var HTMLNS='http://www.w3.org/1999/xhtml';body=d.getElementsByTagNameNS?(d.getElementsByTagNameNS(HTMLNS,'body')[0]?d.getElementsByTagNameNS(HTMLNS,'body')[0]:d.documentElement.lastChild):d.getElementsByTagName('body')[0];if(!body){return false;}
   8.992 +ret=this.sprintf.apply(this,[format].concat(args));elmt=d.createTextNode(ret);body.appendChild(elmt);return ret.length;}
   8.993 +function vsprintf(format,args){return this.sprintf.apply(this,[format].concat(args));}
   8.994 +function wordwrap(str,int_width,str_break,cut){var m=((arguments.length>=2)?arguments[1]:75);var b=((arguments.length>=3)?arguments[2]:"\n");var c=((arguments.length>=4)?arguments[3]:false);var i,j,l,s,r;str+='';if(m<1){return str;}
   8.995 +for(i=-1,l=(r=str.split(/\r\n|\n|\r/)).length;++i<l;r[i]+=s){for(s=r[i],r[i]="";s.length>m;r[i]+=s.slice(0,j)+((s=s.slice(j)).length?b:"")){j=c==2||(j=s.slice(0,m+1).match(/\S*(\s)?$/))[1]?m:j.input.length-j[0].length||c==1&&m||j.input.length+(j=s.slice(m).match(/^\S*/)).input.length;}}
   8.996 +return r.join("\n");}
   8.997 \ No newline at end of file
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/libxen/test/test.html	Mon May 24 19:49:40 2010 +0300
     9.3 @@ -0,0 +1,23 @@
     9.4 +<html>
     9.5 +<head>
     9.6 +<script type="text/javascript" src="/interface/js/php.default.min.js"></script>
     9.7 +<script type="text/javascript" src="/libxen/callbacks.js"></script>
     9.8 +<script type="text/javascript" src="/libxen/db_callbacks.js"></script>
     9.9 +<script type="text/javascript" src="/libxen/core.js"></script>
    9.10 +<script type="text/javascript" src="/libxen/libxen.js"></script>
    9.11 +<script type="text/javascript" >
    9.12 +function callback_login()
    9.13 +{
    9.14 +alert(xen_db['session_id']);
    9.15 +return;
    9.16 +}
    9.17 +</script>
    9.18 +</head>
    9.19 +<body>
    9.20 +<script type="text/javascript">
    9.21 +xen_init('root','xcpweb',callback_login);
    9.22 +</script>
    9.23 +just for test2
    9.24 +</body>
    9.25 +
    9.26 +</html>
    9.27 \ No newline at end of file