/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
/*
 * jQuery UI 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
;(function($) {

var _remove = $.fn.remove,
	isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);

//Helper functions and ui object
$.ui = {
	version: "1.6rc6",

	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
	plugin: {
		add: function(module, option, set) {
			var proto = $.ui[module].prototype;
			for(var i in set) {
				proto.plugins[i] = proto.plugins[i] || [];
				proto.plugins[i].push([option, set[i]]);
			}
		},
		call: function(instance, name, args) {
			var set = instance.plugins[name];
			if(!set) { return; }

			for (var i = 0; i < set.length; i++) {
				if (instance.options[set[i][0]]) {
					set[i][1].apply(instance.element, args);
				}
			}
		}
	},

	contains: function(a, b) {
		return document.compareDocumentPosition
			? a.compareDocumentPosition(b) & 16
			: a !== b && a.contains(b);
	},

	cssCache: {},
	css: function(name) {
		if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }
		var tmp = $('<div class="ui-gen"></div>').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');

		//if (!$.browser.safari)
			//tmp.appendTo('body');

		//Opera and Safari set width and height to 0px instead of auto
		//Safari returns rgba(0,0,0,0) when bgcolor is not set
		$.ui.cssCache[name] = !!(
			(!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
			!(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
		);
		try { $('body').get(0).removeChild(tmp.get(0));	} catch(e){}
		return $.ui.cssCache[name];
	},

	hasScroll: function(el, a) {

		//If overflow is hidden, the element might have extra content, but the user wants to hide it
		if ($(el).css('overflow') == 'hidden') { return false; }

		var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
			has = false;

		if (el[scroll] > 0) { return true; }

		// TODO: determine which cases actually cause this to happen
		// if the element doesn't have the scroll set, see if it's possible to
		// set the scroll
		el[scroll] = 1;
		has = (el[scroll] > 0);
		el[scroll] = 0;
		return has;
	},

	isOverAxis: function(x, reference, size) {
		//Determines when x coordinate is over "b" element axis
		return (x > reference) && (x < (reference + size));
	},

	isOver: function(y, x, top, left, height, width) {
		//Determines when x, y coordinates is over "b" element
		return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
	},

	keyCode: {
		BACKSPACE: 8,
		CAPS_LOCK: 20,
		COMMA: 188,
		CONTROL: 17,
		DELETE: 46,
		DOWN: 40,
		END: 35,
		ENTER: 13,
		ESCAPE: 27,
		HOME: 36,
		INSERT: 45,
		LEFT: 37,
		NUMPAD_ADD: 107,
		NUMPAD_DECIMAL: 110,
		NUMPAD_DIVIDE: 111,
		NUMPAD_ENTER: 108,
		NUMPAD_MULTIPLY: 106,
		NUMPAD_SUBTRACT: 109,
		PAGE_DOWN: 34,
		PAGE_UP: 33,
		PERIOD: 190,
		RIGHT: 39,
		SHIFT: 16,
		SPACE: 32,
		TAB: 9,
		UP: 38
	}
};

// WAI-ARIA normalization
if (isFF2) {
	var attr = $.attr,
		removeAttr = $.fn.removeAttr,
		ariaNS = "http://www.w3.org/2005/07/aaa",
		ariaState = /^aria-/,
		ariaRole = /^wairole:/;

	$.attr = function(elem, name, value) {
		var set = value !== undefined;

		return (name == 'role'
			? (set
				? attr.call(this, elem, name, "wairole:" + value)
				: (attr.apply(this, arguments) || "").replace(ariaRole, ""))
			: (ariaState.test(name)
				? (set
					? elem.setAttributeNS(ariaNS,
						name.replace(ariaState, "aaa:"), value)
					: attr.call(this, elem, name.replace(ariaState, "aaa:")))
				: attr.apply(this, arguments)));
	};

	$.fn.removeAttr = function(name) {
		return (ariaState.test(name)
			? this.each(function() {
				this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
			}) : removeAttr.call(this, name));
	};
}

//jQuery plugins
$.fn.extend({
	remove: function() {
		// Safari has a native remove event which actually removes DOM elements,
		// so we have to use triggerHandler instead of trigger (#3037).
		$("*", this).add(this).each(function() {
			$(this).triggerHandler("remove");
		});
		return _remove.apply(this, arguments );
	},

	enableSelection: function() {
		return this
			.attr('unselectable', 'off')
			.css('MozUserSelect', '')
			.unbind('selectstart.ui');
	},

	disableSelection: function() {
		return this
			.attr('unselectable', 'on')
			.css('MozUserSelect', 'none')
			.bind('selectstart.ui', function() { return false; });
	},

	scrollParent: function() {
		var scrollParent;
		if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
			scrollParent = this.parents().filter(function() {
				return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		} else {
			scrollParent = this.parents().filter(function() {
				return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
			}).eq(0);
		}

		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
	}
});


//Additional selectors
$.extend($.expr[':'], {
	data: function(elem, i, match) {
		return !!$.data(elem, match[3]);
	},

	focusable: function(element) {
		var nodeName = element.nodeName.toLowerCase(),
			tabIndex = $.attr(element, 'tabindex');
		return (/input|select|textarea|button|object/.test(nodeName)
			? !element.disabled
			: 'a' == nodeName || 'area' == nodeName
				? element.href || !isNaN(tabIndex)
				: !isNaN(tabIndex))
			// the element and all of its ancestors must be visible
			// the browser may report that the area is hidden
			&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
	},

	tabbable: function(element) {
		var tabIndex = $.attr(element, 'tabindex');
		return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
	}
});


// $.widget is a factory to create jQuery plugins
// taking some boilerplate code out of the plugin code
function getter(namespace, plugin, method, args) {
	function getMethods(type) {
		var methods = $[namespace][plugin][type] || [];
		return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
	}

	var methods = getMethods('getter');
	if (args.length == 1 && typeof args[0] == 'string') {
		methods = methods.concat(getMethods('getterSetter'));
	}
	return ($.inArray(method, methods) != -1);
}

$.widget = function(name, prototype) {
	var namespace = name.split(".")[0];
	name = name.split(".")[1];

	// create plugin method
	$.fn[name] = function(options) {
		var isMethodCall = (typeof options == 'string'),
			args = Array.prototype.slice.call(arguments, 1);

		// prevent calls to internal methods
		if (isMethodCall && options.substring(0, 1) == '_') {
			return this;
		}

		// handle getter methods
		if (isMethodCall && getter(namespace, name, options, args)) {
			var instance = $.data(this[0], name);
			return (instance ? instance[options].apply(instance, args)
				: undefined);
		}

		// handle initialization and non-getter methods
		return this.each(function() {
			var instance = $.data(this, name);

			// constructor
			(!instance && !isMethodCall &&
				$.data(this, name, new $[namespace][name](this, options))._init());

			// method call
			(instance && isMethodCall && $.isFunction(instance[options]) &&
				instance[options].apply(instance, args));
		});
	};

	// create widget constructor
	$[namespace] = $[namespace] || {};
	$[namespace][name] = function(element, options) {
		var self = this;

		this.namespace = namespace;
		this.widgetName = name;
		this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
		this.widgetBaseClass = namespace + '-' + name;

		this.options = $.extend({},
			$.widget.defaults,
			$[namespace][name].defaults,
			$.metadata && $.metadata.get(element)[name],
			options);

		this.element = $(element)
			.bind('setData.' + name, function(event, key, value) {
				if (event.target == element) {
					return self._setData(key, value);
				}
			})
			.bind('getData.' + name, function(event, key) {
				if (event.target == element) {
					return self._getData(key);
				}
			})
			.bind('remove', function() {
				return self.destroy();
			});
	};

	// add widget prototype
	$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);

	// TODO: merge getter and getterSetter properties from widget prototype
	// and plugin prototype
	$[namespace][name].getterSetter = 'option';
};

$.widget.prototype = {
	_init: function() {},
	destroy: function() {
		this.element.removeData(this.widgetName)
			.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
			.removeAttr('aria-disabled');
	},

	option: function(key, value) {
		var options = key,
			self = this;

		if (typeof key == "string") {
			if (value === undefined) {
				return this._getData(key);
			}
			options = {};
			options[key] = value;
		}

		$.each(options, function(key, value) {
			self._setData(key, value);
		});
	},
	_getData: function(key) {
		return this.options[key];
	},
	_setData: function(key, value) {
		this.options[key] = value;

		if (key == 'disabled') {
			this.element
				[value ? 'addClass' : 'removeClass'](
					this.widgetBaseClass + '-disabled' + ' ' +
					this.namespace + '-state-disabled')
				.attr("aria-disabled", value);
		}
	},

	enable: function() {
		this._setData('disabled', false);
	},
	disable: function() {
		this._setData('disabled', true);
	},

	_trigger: function(type, event, data) {
		var callback = this.options[type],
			eventName = (type == this.widgetEventPrefix
				? type : this.widgetEventPrefix + type);

		event = $.Event(event);
		event.type = eventName;

		// copy original event properties over to the new event
		// this would happen if we could call $.event.fix instead of $.Event
		// but we don't have a way to force an event to be fixed multiple times
		if (event.originalEvent) {
			for (var i = $.event.props.length, prop; i;) {
				prop = $.event.props[--i];
				event[prop] = event.originalEvent[prop];
			}
		}

		this.element.trigger(event, data);

		return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
			|| event.isDefaultPrevented());
	}
};

$.widget.defaults = {
	disabled: false
};


/** Mouse Interaction Plugin **/

$.ui.mouse = {
	_mouseInit: function() {
		var self = this;

		this.element
			.bind('mousedown.'+this.widgetName, function(event) {
				return self._mouseDown(event);
			})
			.bind('click.'+this.widgetName, function(event) {
				if(self._preventClickEvent) {
					self._preventClickEvent = false;
					return false;
				}
			});

		// Prevent text selection in IE
		if ($.browser.msie) {
			this._mouseUnselectable = this.element.attr('unselectable');
			this.element.attr('unselectable', 'on');
		}

		this.started = false;
	},

	// TODO: make sure destroying one instance of mouse doesn't mess with
	// other instances of mouse
	_mouseDestroy: function() {
		this.element.unbind('.'+this.widgetName);

		// Restore text selection in IE
		($.browser.msie
			&& this.element.attr('unselectable', this._mouseUnselectable));
	},

	_mouseDown: function(event) {
		// don't let more than one widget handle mouseStart
		if (event.originalEvent.mouseHandled) { return; }

		// we may have missed mouseup (out of window)
		(this._mouseStarted && this._mouseUp(event));

		this._mouseDownEvent = event;

		var self = this,
			btnIsLeft = (event.which == 1),
			elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
			return true;
		}

		this.mouseDelayMet = !this.options.delay;
		if (!this.mouseDelayMet) {
			this._mouseDelayTimer = setTimeout(function() {
				self.mouseDelayMet = true;
			}, this.options.delay);
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted = (this._mouseStart(event) !== false);
			if (!this._mouseStarted) {
				event.preventDefault();
				return true;
			}
		}

		// these delegates are required to keep context
		this._mouseMoveDelegate = function(event) {
			return self._mouseMove(event);
		};
		this._mouseUpDelegate = function(event) {
			return self._mouseUp(event);
		};
		$(document)
			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		// preventDefault() is used to prevent the selection of text here -
		// however, in Safari, this causes select boxes not to be selectable
		// anymore, so this fix is needed
		($.browser.safari || event.preventDefault());

		event.originalEvent.mouseHandled = true;
		return true;
	},

	_mouseMove: function(event) {
		// IE mouseup check - mouseup happened when mouse was out of window
		if ($.browser.msie && !event.button) {
			return this._mouseUp(event);
		}

		if (this._mouseStarted) {
			this._mouseDrag(event);
			return event.preventDefault();
		}

		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
			this._mouseStarted =
				(this._mouseStart(this._mouseDownEvent, event) !== false);
			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
		}

		return !this._mouseStarted;
	},

	_mouseUp: function(event) {
		$(document)
			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);

		if (this._mouseStarted) {
			this._mouseStarted = false;
			this._preventClickEvent = true;
			this._mouseStop(event);
		}

		return false;
	},

	_mouseDistanceMet: function(event) {
		return (Math.max(
				Math.abs(this._mouseDownEvent.pageX - event.pageX),
				Math.abs(this._mouseDownEvent.pageY - event.pageY)
			) >= this.options.distance
		);
	},

	_mouseDelayMet: function(event) {
		return this.mouseDelayMet;
	},

	// These are placeholder methods, to be overriden by extending plugin
	_mouseStart: function(event) {},
	_mouseDrag: function(event) {},
	_mouseStop: function(event) {},
	_mouseCapture: function(event) { return true; }
};

$.ui.mouse.defaults = {
	cancel: null,
	distance: 1,
	delay: 0
};

})(jQuery);
/*
 * jQuery UI Draggable 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.draggable", $.extend({}, $.ui.mouse, {

	_init: function() {

		if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
			this.element[0].style.position = 'relative';

		(this.options.cssNamespace && this.element.addClass(this.options.cssNamespace+"-draggable"));
		(this.options.disabled && this.element.addClass(this.options.cssNamespace+'-draggable-disabled'));

		this._mouseInit();

	},

	destroy: function() {
		if(!this.element.data('draggable')) return;
		this.element.removeData("draggable").unbind(".draggable").removeClass(this.options.cssNamespace+'-draggable '+this.options.cssNamespace+'-draggable-dragging '+this.options.cssNamespace+'-draggable-disabled');
		this._mouseDestroy();
	},

	_mouseCapture: function(event) {

		var o = this.options;

		if (this.helper || o.disabled || $(event.target).is('.'+this.options.cssNamespace+'-resizable-handle'))
			return false;

		//Quit if we're not on a valid handle
		this.handle = this._getHandle(event);
		if (!this.handle)
			return false;

		return true;

	},

	_mouseStart: function(event) {

		var o = this.options;

		//Create and append the visible helper
		this.helper = this._createHelper(event);

		//Cache the helper size
		this._cacheHelperProportions();

		//If ddmanager is used for droppables, set the global draggable
		if($.ui.ddmanager)
			$.ui.ddmanager.current = this;

		/*
		 * - Position generation -
		 * This block generates everything position related - it's the core of draggables.
		 */

		//Cache the margins of the original element
		this._cacheMargins();

		//Store the helper's css position
		this.cssPosition = this.helper.css("position");
		this.scrollParent = this.helper.scrollParent();

		//The element's absolute position on the page minus margins
		this.offset = this.element.offset();
		this.offset = {
			top: this.offset.top - this.margins.top,
			left: this.offset.left - this.margins.left
		};

		$.extend(this.offset, {
			click: { //Where the click happened, relative to the element
				left: event.pageX - this.offset.left,
				top: event.pageY - this.offset.top
			},
			parent: this._getParentOffset(),
			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
		});

		//Generate the original position
		this.originalPosition = this._generatePosition(event);
		this.originalPageX = event.pageX;
		this.originalPageY = event.pageY;

		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
		if(o.cursorAt)
			this._adjustOffsetFromHelper(o.cursorAt);

		//Set a containment if given in the options
		if(o.containment)
			this._setContainment();

		//Call plugins and callbacks
		this._trigger("start", event);

		//Recache the helper size
		this._cacheHelperProportions();

		//Prepare the droppable offsets
		if ($.ui.ddmanager && !o.dropBehaviour)
			$.ui.ddmanager.prepareOffsets(this, event);

		this.helper.addClass(o.cssNamespace+"-draggable-dragging");
		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
		return true;
	},

	_mouseDrag: function(event, noPropagation) {

		//Compute the helpers position
		this.position = this._generatePosition(event);
		this.positionAbs = this._convertPositionTo("absolute");

		//Call plugins and callbacks and use the resulting position if something is returned
		if (!noPropagation) {
			var ui = this._uiHash();
			this._trigger('drag', event, ui);
			this.position = ui.position;
		}

		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);

		return false;
	},

	_mouseStop: function(event) {

		//If we are using droppables, inform the manager about the drop
		var dropped = false;
		if ($.ui.ddmanager && !this.options.dropBehaviour)
			dropped = $.ui.ddmanager.drop(this, event);

		//if a drop comes from outside (a sortable)
		if(this.dropped) {
			dropped = this.dropped;
			this.dropped = false;
		}

		if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
			var self = this;
			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
				self._trigger("stop", event);
				self._clear();
			});
		} else {
			this._trigger("stop", event);
			this._clear();
		}

		return false;
	},

	_getHandle: function(event) {

		var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
		$(this.options.handle, this.element)
			.find("*")
			.andSelf()
			.each(function() {
				if(this == event.target) handle = true;
			});

		return handle;

	},

	_createHelper: function(event) {

		var o = this.options;
		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element);

		if(!helper.parents('body').length)
			helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));

		if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
			helper.css("position", "absolute");

		return helper;

	},

	_adjustOffsetFromHelper: function(obj) {
		if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
		if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
		if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
		if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
	},

	_getParentOffset: function() {

		//Get the offsetParent and cache its position
		this.offsetParent = this.helper.offsetParent();
		var po = this.offsetParent.offset();

		// This is a special case where we need to modify a offset calculated on start, since the following happened:
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
			po.left += this.scrollParent.scrollLeft();
			po.top += this.scrollParent.scrollTop();
		}

		if((this.offsetParent[0] == document.body && $.browser.mozilla)	//Ugly FF3 fix
		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
			po = { top: 0, left: 0 };

		return {
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
		};

	},

	_getRelativeOffset: function() {

		if(this.cssPosition == "relative") {
			var p = this.element.position();
			return {
				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
			};
		} else {
			return { top: 0, left: 0 };
		}

	},

	_cacheMargins: function() {
		this.margins = {
			left: (parseInt(this.element.css("marginLeft"),10) || 0),
			top: (parseInt(this.element.css("marginTop"),10) || 0)
		};
	},

	_cacheHelperProportions: function() {
		this.helperProportions = {
			width: this.helper.outerWidth(),
			height: this.helper.outerHeight()
		};
	},

	_setContainment: function() {

		var o = this.options;
		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
		if(o.containment == 'document' || o.containment == 'window') this.containment = [
			0 - this.offset.relative.left - this.offset.parent.left,
			0 - this.offset.relative.top - this.offset.parent.top,
			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
		];

		if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
			var ce = $(o.containment)[0]; if(!ce) return;
			var co = $(o.containment).offset();
			var over = ($(ce).css("overflow") != 'hidden');

			this.containment = [
				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
			];
		} else if(o.containment.constructor == Array) {
			this.containment = o.containment;
		}

	},

	_convertPositionTo: function(d, pos) {

		if(!pos) pos = this.position;
		var mod = d == "absolute" ? 1 : -1;
		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		return {
			top: (
				pos.top																	// The absolute mouse position
				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
				- ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod
			),
			left: (
				pos.left																// The absolute mouse position
				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
				- ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod
			)
		};

	},

	_generatePosition: function(event) {

		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		// This is another very weird special case that only happens for relative elements:
		// 1. If the css position is relative
		// 2. and the scroll parent is the document or similar to the offset parent
		// we have to refresh the relative offset during the scroll so there are no jumps
		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
			this.offset.relative = this._getRelativeOffset();
		}

		var pageX = event.pageX;
		var pageY = event.pageY;

		/*
		 * - Position constraining -
		 * Constrain the position to a mix of grid, containment.
		 */

		if(this.originalPosition) { //If we are not dragging yet, we won't check for options

			if(this.containment) {
				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
			}

			if(o.grid) {
				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
				pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;

				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
				pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
			}

		}

		return {
			top: (
				pageY																// The absolute mouse position
				- this.offset.click.top													// Click offset (relative to the element)
				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
				+ ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )
			),
			left: (
				pageX																// The absolute mouse position
				- this.offset.click.left												// Click offset (relative to the element)
				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
				+ ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )
			)
		};

	},

	_clear: function() {
		this.helper.removeClass(this.options.cssNamespace+"-draggable-dragging");
		if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
		//if($.ui.ddmanager) $.ui.ddmanager.current = null;
		this.helper = null;
		this.cancelHelperRemoval = false;
	},

	// From now on bulk stuff - mainly helpers

	_trigger: function(type, event, ui) {
		ui = ui || this._uiHash();
		$.ui.plugin.call(this, type, [event, ui]);
		if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
		return $.widget.prototype._trigger.call(this, type, event, ui);
	},

	plugins: {},

	_uiHash: function(event) {
		return {
			helper: this.helper,
			position: this.position,
			absolutePosition: this.positionAbs, //deprecated
			offset: this.positionAbs
		};
	}

}));

$.extend($.ui.draggable, {
	version: "1.6rc6",
	eventPrefix: "drag",
	defaults: {
		appendTo: "parent",
		axis: false,
		cancel: ":input,option",
		connectToSortable: false,
		containment: false,
		cssNamespace: "ui",
		cursor: "default",
		cursorAt: false,
		delay: 0,
		distance: 1,
		grid: false,
		handle: false,
		helper: "original",
		iframeFix: false,
		opacity: false,
		refreshPositions: false,
		revert: false,
		revertDuration: 500,
		scope: "default",
		scroll: true,
		scrollSensitivity: 20,
		scrollSpeed: 20,
		snap: false,
		snapMode: "both",
		snapTolerance: 20,
		stack: false,
		zIndex: false
	}
});

$.ui.plugin.add("draggable", "connectToSortable", {
	start: function(event, ui) {

		var inst = $(this).data("draggable"), o = inst.options;
		inst.sortables = [];
		$(o.connectToSortable).each(function() {
			// 'this' points to a string, and should therefore resolved as query, but instead, if the string is assigned to a variable, it loops through the strings properties,
			// so we have to append '' to make it anonymous again
			$(typeof this == 'string' ? this+'': this).each(function() {
				if($.data(this, 'sortable')) {
					var sortable = $.data(this, 'sortable');
					inst.sortables.push({
						instance: sortable,
						shouldRevert: sortable.options.revert
					});
					sortable._refreshItems();	//Do a one-time refresh at start to refresh the containerCache
					sortable._trigger("activate", event, inst);
				}
			});
		});

	},
	stop: function(event, ui) {

		//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
		var inst = $(this).data("draggable");

		$.each(inst.sortables, function() {
			if(this.instance.isOver) {

				this.instance.isOver = 0;

				inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
				this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)

				//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
				if(this.shouldRevert) this.instance.options.revert = true;

				//Trigger the stop of the sortable
				this.instance._mouseStop(event);

				this.instance.options.helper = this.instance.options._helper;

				//If the helper has been the original item, restore properties in the sortable
				if(inst.options.helper == 'original')
					this.instance.currentItem.css({ top: 'auto', left: 'auto' });

			} else {
				this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
				this.instance._trigger("deactivate", event, inst);
			}

		});

	},
	drag: function(event, ui) {

		var inst = $(this).data("draggable"), self = this;

		var checkPos = function(o) {
			var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
			var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
			var itemHeight = o.height, itemWidth = o.width;
			var itemTop = o.top, itemLeft = o.left;

			return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
		};

		$.each(inst.sortables, function(i) {

			if(checkPos.call(inst, this.instance.containerCache)) {

				//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
				if(!this.instance.isOver) {
					this.instance.isOver = 1;
					//Now we fake the start of dragging for the sortable instance,
					//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
					//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
					this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
					this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
					this.instance.options.helper = function() { return ui.helper[0]; };

					event.target = this.instance.currentItem[0];
					this.instance._mouseCapture(event, true);
					this.instance._mouseStart(event, true, true);

					//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
					this.instance.offset.click.top = inst.offset.click.top;
					this.instance.offset.click.left = inst.offset.click.left;
					this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
					this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;

					inst._trigger("toSortable", event);
					inst.dropped = this.instance.element; //draggable revert needs that
					this.instance.fromOutside = inst; //Little hack so receive/update callbacks work

				}

				//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
				if(this.instance.currentItem) this.instance._mouseDrag(event);

			} else {

				//If it doesn't intersect with the sortable, and it intersected before,
				//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
				if(this.instance.isOver) {
					this.instance.isOver = 0;
					this.instance.cancelHelperRemoval = true;
					this.instance.options.revert = false; //No revert here
					this.instance._mouseStop(event, true);
					this.instance.options.helper = this.instance.options._helper;

					//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
					this.instance.currentItem.remove();
					if(this.instance.placeholder) this.instance.placeholder.remove();

					inst._trigger("fromSortable", event);
					inst.dropped = false; //draggable revert needs that
				}

			};

		});

	}
});

$.ui.plugin.add("draggable", "cursor", {
	start: function(event, ui) {
		var t = $('body'), o = $(this).data('draggable').options;
		if (t.css("cursor")) o._cursor = t.css("cursor");
		t.css("cursor", o.cursor);
	},
	stop: function(event, ui) {
		var o = $(this).data('draggable').options;
		if (o._cursor) $('body').css("cursor", o._cursor);
	}
});

$.ui.plugin.add("draggable", "iframeFix", {
	start: function(event, ui) {
		var o = $(this).data('draggable').options;
		$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
			$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
			.css({
				width: this.offsetWidth+"px", height: this.offsetHeight+"px",
				position: "absolute", opacity: "0.001", zIndex: 1000
			})
			.css($(this).offset())
			.appendTo("body");
		});
	},
	stop: function(event, ui) {
		$("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
	}
});

$.ui.plugin.add("draggable", "opacity", {
	start: function(event, ui) {
		var t = $(ui.helper), o = $(this).data('draggable').options;
		if(t.css("opacity")) o._opacity = t.css("opacity");
		t.css('opacity', o.opacity);
	},
	stop: function(event, ui) {
		var o = $(this).data('draggable').options;
		if(o._opacity) $(ui.helper).css('opacity', o._opacity);
	}
});

$.ui.plugin.add("draggable", "scroll", {
	start: function(event, ui) {
		var i = $(this).data("draggable");
		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
	},
	drag: function(event, ui) {

		var i = $(this).data("draggable"), o = i.options, scrolled = false;

		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {

			if(!o.axis || o.axis != 'x') {
				if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
				else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
			}

			if(!o.axis || o.axis != 'y') {
				if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
				else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
			}

		} else {

			if(!o.axis || o.axis != 'x') {
				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
			}

			if(!o.axis || o.axis != 'y') {
				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
			}

		}

		if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
			$.ui.ddmanager.prepareOffsets(i, event);

	}
});

$.ui.plugin.add("draggable", "snap", {
	start: function(event, ui) {

		var i = $(this).data("draggable"), o = i.options;
		i.snapElements = [];

		$(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
			var $t = $(this); var $o = $t.offset();
			if(this != i.element[0]) i.snapElements.push({
				item: this,
				width: $t.outerWidth(), height: $t.outerHeight(),
				top: $o.top, left: $o.left
			});
		});

	},
	drag: function(event, ui) {

		var inst = $(this).data("draggable"), o = inst.options;
		var d = o.snapTolerance;

		var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width,
			y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height;

		for (var i = inst.snapElements.length - 1; i >= 0; i--){

			var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
				t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;

			//Yes, I know, this is insane ;)
			if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
				if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
				inst.snapElements[i].snapping = false;
				continue;
			}

			if(o.snapMode != 'inner') {
				var ts = Math.abs(t - y2) <= d;
				var bs = Math.abs(b - y1) <= d;
				var ls = Math.abs(l - x2) <= d;
				var rs = Math.abs(r - x1) <= d;
				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
			}

			var first = (ts || bs || ls || rs);

			if(o.snapMode != 'outer') {
				var ts = Math.abs(t - y1) <= d;
				var bs = Math.abs(b - y2) <= d;
				var ls = Math.abs(l - x1) <= d;
				var rs = Math.abs(r - x2) <= d;
				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
			}

			if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);

		};

	}
});

$.ui.plugin.add("draggable", "stack", {
	start: function(event, ui) {

		var o = $(this).data("draggable").options;

		var group = $.makeArray($(o.stack.group)).sort(function(a,b) {
			return (parseInt($(a).css("zIndex"),10) || o.stack.min) - (parseInt($(b).css("zIndex"),10) || o.stack.min);
		});

		$(group).each(function(i) {
			this.style.zIndex = o.stack.min + i;
		});

		this[0].style.zIndex = o.stack.min + group.length;

	}
});

$.ui.plugin.add("draggable", "zIndex", {
	start: function(event, ui) {
		var t = $(ui.helper), o = $(this).data("draggable").options;
		if(t.css("zIndex")) o._zIndex = t.css("zIndex");
		t.css('zIndex', o.zIndex);
	},
	stop: function(event, ui) {
		var o = $(this).data("draggable").options;
		if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
	}
});

})(jQuery);
/*
 * jQuery UI Droppable 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Droppables
 *
 * Depends:
 *	ui.core.js
 *	ui.draggable.js
 */
(function($) {

$.widget("ui.droppable", {

	_init: function() {

		var o = this.options, accept = o.accept;
		this.isover = 0; this.isout = 1;

		this.options.accept = this.options.accept && $.isFunction(this.options.accept) ? this.options.accept : function(d) {
			return d.is(accept);
		};

		//Store the droppable's proportions
		this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };

		// Add the reference and positions to the manager
		$.ui.ddmanager.droppables[this.options.scope] = $.ui.ddmanager.droppables[this.options.scope] || [];
		$.ui.ddmanager.droppables[this.options.scope].push(this);

		(this.options.cssNamespace && this.element.addClass(this.options.cssNamespace+"-droppable"));

	},

	destroy: function() {
		var drop = $.ui.ddmanager.droppables[this.options.scope];
		for ( var i = 0; i < drop.length; i++ )
			if ( drop[i] == this )
				drop.splice(i, 1);

		this.element
			.removeClass(this.options.cssNamespace+"-droppable "+this.options.cssNamespace+"-droppable-disabled")
			.removeData("droppable")
			.unbind(".droppable");
	},

	_setData: function(key, value) {

		if(key == 'accept') {
			this.options.accept = value && $.isFunction(value) ? value : function(d) {
				return d.is(accept);
			};
		} else {
			$.widget.prototype._setData.apply(this, arguments);
		}

	},

	_activate: function(event) {
		var draggable = $.ui.ddmanager.current;
		if(this.options.activeClass) this.element.addClass(this.options.activeClass);
		(draggable && this._trigger('activate', event, this.ui(draggable)));
	},

	_deactivate: function(event) {
		var draggable = $.ui.ddmanager.current;
		if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
		(draggable && this._trigger('deactivate', event, this.ui(draggable)));
	},

	_over: function(event) {

		var draggable = $.ui.ddmanager.current;
		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element

		if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
			if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
			this._trigger('over', event, this.ui(draggable));
		}

	},

	_out: function(event) {

		var draggable = $.ui.ddmanager.current;
		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element

		if (this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
			this._trigger('out', event, this.ui(draggable));
		}

	},

	_drop: function(event,custom) {

		var draggable = custom || $.ui.ddmanager.current;
		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element

		var childrenIntersection = false;
		this.element.find(":data(droppable)").not("."+draggable.options.cssNamespace+"-draggable-dragging").each(function() {
			var inst = $.data(this, 'droppable');
			if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
				childrenIntersection = true; return false;
			}
		});
		if(childrenIntersection) return false;

		if(this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
			if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
			this._trigger('drop', event, this.ui(draggable));
			return this.element;
		}

		return false;

	},

	ui: function(c) {
		return {
			draggable: (c.currentItem || c.element),
			helper: c.helper,
			position: c.position,
			absolutePosition: c.positionAbs, //deprecated
			offset: c.positionAbs
		};
	}

});

$.extend($.ui.droppable, {
	version: "1.6rc6",
	eventPrefix: 'drop',
	defaults: {
		accept: '*',
		activeClass: false,
		cssNamespace: 'ui',
		greedy: false,
		hoverClass: false,
		scope: 'default',
		tolerance: 'intersect'
	}
});

$.ui.intersect = function(draggable, droppable, toleranceMode) {

	if (!droppable.offset) return false;

	var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
		y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
	var l = droppable.offset.left, r = l + droppable.proportions.width,
		t = droppable.offset.top, b = t + droppable.proportions.height;

	switch (toleranceMode) {
		case 'fit':
			return (l < x1 && x2 < r
				&& t < y1 && y2 < b);
			break;
		case 'intersect':
			return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
				&& x2 - (draggable.helperProportions.width / 2) < r // Left Half
				&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
				&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
			break;
		case 'pointer':
			var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
				draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
				isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
			return isOver;
			break;
		case 'touch':
			return (
					(y1 >= t && y1 <= b) ||	// Top edge touching
					(y2 >= t && y2 <= b) ||	// Bottom edge touching
					(y1 < t && y2 > b)		// Surrounded vertically
				) && (
					(x1 >= l && x1 <= r) ||	// Left edge touching
					(x2 >= l && x2 <= r) ||	// Right edge touching
					(x1 < l && x2 > r)		// Surrounded horizontally
				);
			break;
		default:
			return false;
			break;
		}

};

/*
	This manager tracks offsets of draggables and droppables
*/
$.ui.ddmanager = {
	current: null,
	droppables: { 'default': [] },
	prepareOffsets: function(t, event) {

		var m = $.ui.ddmanager.droppables[t.options.scope];
		var type = event ? event.type : null; // workaround for #2317
		var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();

		droppablesLoop: for (var i = 0; i < m.length; i++) {

			if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element[0],(t.currentItem || t.element)))) continue;	//No disabled and non-accepted
			for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
			m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; 									//If the element is not visible, continue

			m[i].offset = m[i].element.offset();
			m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };

			if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables

		}

	},
	drop: function(draggable, event) {

		var dropped = false;
		$.each($.ui.ddmanager.droppables[draggable.options.scope], function() {

			if(!this.options) return;
			if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
				dropped = this._drop.call(this, event);

			if (!this.options.disabled && this.visible && this.options.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
				this.isout = 1; this.isover = 0;
				this._deactivate.call(this, event);
			}

		});
		return dropped;

	},
	drag: function(draggable, event) {

		//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
		if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);

		//Run through all droppables and check their positions based on specific tolerance options

		$.each($.ui.ddmanager.droppables[draggable.options.scope], function() {

			if(this.options.disabled || this.greedyChild || !this.visible) return;
			var intersects = $.ui.intersect(draggable, this, this.options.tolerance);

			var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
			if(!c) return;

			var parentInstance;
			if (this.options.greedy) {
				var parent = this.element.parents(':data(droppable):eq(0)');
				if (parent.length) {
					parentInstance = $.data(parent[0], 'droppable');
					parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
				}
			}

			// we just moved into a greedy child
			if (parentInstance && c == 'isover') {
				parentInstance['isover'] = 0;
				parentInstance['isout'] = 1;
				parentInstance._out.call(parentInstance, event);
			}

			this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
			this[c == "isover" ? "_over" : "_out"].call(this, event);

			// we just moved out of a greedy child
			if (parentInstance && c == 'isout') {
				parentInstance['isout'] = 0;
				parentInstance['isover'] = 1;
				parentInstance._over.call(parentInstance, event);
			}
		});

	}
};

})(jQuery);
/*
 * jQuery UI Resizable 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Resizables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.resizable", $.extend({}, $.ui.mouse, {

	_init: function() {

		var self = this, o = this.options;
		this.element.addClass("ui-resizable");

		$.extend(this, {
			_aspectRatio: !!(o.aspectRatio),
			aspectRatio: o.aspectRatio,
			originalElement: this.element,
			proportionallyResize: o.proportionallyResize  ? [o.proportionallyResize] : [],
			_helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
		});

		//Wrap the element if it cannot hold child nodes
		if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {

			//Opera fix for relative positioning
			if (/relative/.test(this.element.css('position')) && $.browser.opera)
				this.element.css({ position: 'relative', top: 'auto', left: 'auto' });

			//Create a wrapper element and set the wrapper to the new current internal element
			this.element.wrap(
				$('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
					position: this.element.css('position'),
					width: this.element.outerWidth(),
					height: this.element.outerHeight(),
					top: this.element.css('top'),
					left: this.element.css('left')
				})
			);

			//Overwrite the original this.element
			this.element = this.element.parent();
			this.elementIsWrapper = true;

			//Move margins to the wrapper
			this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
			this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});

			//Prevent Safari textarea resize
			if ($.browser.safari && o.preventDefault) this.originalElement.css('resize', 'none');

			//Push the actual element to our proportionallyResize internal array
			this.proportionallyResize.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));

			// avoid IE jump (hard set the margin)
			this.originalElement.css({ margin: this.originalElement.css('margin') });

			// fix handlers offset
			this._proportionallyResize();

		}

		this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
		if(this.handles.constructor == String) {

			if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
			var n = this.handles.split(","); this.handles = {};

			for(var i = 0; i < n.length; i++) {

				var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
				var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');

				// increase zIndex of sw, se, ne, nw axis
				//TODO : this modifies original option
				if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });

				//TODO : What's going on here?
				if ('se' == handle) {
					axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
				};

				//Insert into internal handles object and append to element
				this.handles[handle] = '.ui-resizable-'+handle;
				this.element.append(axis);
			}

		}

		this._renderAxis = function(target) {

			target = target || this.element;

			for(var i in this.handles) {

				if(this.handles[i].constructor == String)
					this.handles[i] = $(this.handles[i], this.element).show();

				if (o.transparent)
					this.handles[i].css({ opacity: 0 });

				//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {

					var axis = $(this.handles[i], this.element), padWrapper = 0;

					//Checking the correct pad and border
					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();

					//The padding type i have to apply...
					var padPos = [ 'padding',
						/ne|nw|n/.test(i) ? 'Top' :
						/se|sw|s/.test(i) ? 'Bottom' :
						/^e$/.test(i) ? 'Right' : 'Left' ].join("");

					if (!o.transparent)
						target.css(padPos, padWrapper);

					this._proportionallyResize();

				}

				//TODO: What's that good for? There's not anything to be executed left
				if(!$(this.handles[i]).length)
					continue;

			}
		};

		//TODO: make renderAxis a prototype function
		this._renderAxis(this.element);

		this._handles = $('.ui-resizable-handle', this.element);

		if (o.disableSelection)
			this._handles.disableSelection();

		//Matching axis name
		this._handles.mouseover(function() {
			if (!self.resizing) {
				if (this.className)
					var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
				//Axis, default = se
				self.axis = axis && axis[1] ? axis[1] : 'se';
			}
		});

		//If we want to auto hide the elements
		if (o.autoHide) {
			this._handles.hide();
			$(this.element)
				.addClass("ui-resizable-autohide")
				.hover(function() {
					$(this).removeClass("ui-resizable-autohide");
					self._handles.show();
				},
				function(){
					if (!self.resizing) {
						$(this).addClass("ui-resizable-autohide");
						self._handles.hide();
					}
				});
		}

		//Initialize the mouse interaction
		this._mouseInit();

	},

	destroy: function() {

		this._mouseDestroy();

		var _destroy = function(exp) {
			$(exp).removeClass("ui-resizable ui-resizable-disabled")
				.removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
		};

		//TODO: Unwrap at same DOM position
		if (this.elementIsWrapper) {
			_destroy(this.element);
			this.wrapper.parent().append(
				this.originalElement.css({
					position: this.wrapper.css('position'),
					width: this.wrapper.outerWidth(),
					height: this.wrapper.outerHeight(),
					top: this.wrapper.css('top'),
					left: this.wrapper.css('left')
				})
			).end().remove();
		}

		_destroy(this.originalElement);

	},

	_mouseCapture: function(event) {

		var handle = false;
		for(var i in this.handles) {
			if($(this.handles[i])[0] == event.target) handle = true;
		}

		return this.options.disabled || !!handle;

	},

	_mouseStart: function(event) {

		var o = this.options, iniPos = this.element.position(), el = this.element;

		this.resizing = true;
		this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };

		// bugfix for http://dev.jquery.com/ticket/1749
		if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
			el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
		}

		//Opera fixing relative position
		if ($.browser.opera && (/relative/).test(el.css('position')))
			el.css({ position: 'relative', top: 'auto', left: 'auto' });

		this._renderProxy();

		var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));

		if (o.containment) {
			curleft += $(o.containment).scrollLeft() || 0;
			curtop += $(o.containment).scrollTop() || 0;
		}

		//Store needed variables
		this.offset = this.helper.offset();
		this.position = { left: curleft, top: curtop };
		this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
		this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
		this.originalPosition = { left: curleft, top: curtop };
		this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
		this.originalMousePosition = { left: event.pageX, top: event.pageY };

		//Aspect Ratio
		this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);

		if (o.preserveCursor) {
		    var cursor = $('.ui-resizable-' + this.axis).css('cursor');
		    $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
		}

		this._propagate("start", event);
		return true;
	},

	_mouseDrag: function(event) {

		//Increase performance, avoid regex
		var el = this.helper, o = this.options, props = {},
			self = this, smp = this.originalMousePosition, a = this.axis;

		var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
		var trigger = this._change[a];
		if (!trigger) return false;

		// Calculate the attrs that will be change
		var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;

		if (this._aspectRatio || event.shiftKey)
			data = this._updateRatio(data, event);

		data = this._respectSize(data, event);

		// plugins callbacks need to be called first
		this._propagate("resize", event);

		el.css({
			top: this.position.top + "px", left: this.position.left + "px",
			width: this.size.width + "px", height: this.size.height + "px"
		});

		if (!this._helper && this.proportionallyResize.length)
			this._proportionallyResize();

		this._updateCache(data);

		// calling the user callback at the end
		this._trigger('resize', event, this.ui());

		return false;
	},

	_mouseStop: function(event) {

		this.resizing = false;
		var o = this.options, self = this;

		if(this._helper) {
			var pr = this.proportionallyResize, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
						soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
							soffsetw = ista ? 0 : self.sizeDiff.width;

			var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
				left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
				top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;

			if (!o.animate)
				this.element.css($.extend(s, { top: top, left: left }));

			if (this._helper && !o.animate) this._proportionallyResize();
		}

		if (o.preserveCursor)
			$('body').css('cursor', 'auto');

		this._propagate("stop", event);

		if (this._helper) this.helper.remove();
		return false;

	},

	_updateCache: function(data) {
		var o = this.options;
		this.offset = this.helper.offset();
		if (data.left) this.position.left = data.left;
		if (data.top) this.position.top = data.top;
		if (data.height) this.size.height = data.height;
		if (data.width) this.size.width = data.width;
	},

	_updateRatio: function(data, event) {

		var o = this.options, cpos = this.position, csize = this.size, a = this.axis;

		if (data.height) data.width = (csize.height * this.aspectRatio);
		else if (data.width) data.height = (csize.width / this.aspectRatio);

		if (a == 'sw') {
			data.left = cpos.left + (csize.width - data.width);
			data.top = null;
		}
		if (a == 'nw') {
			data.top = cpos.top + (csize.height - data.height);
			data.left = cpos.left + (csize.width - data.width);
		}

		return data;
	},

	_respectSize: function(data, event) {

		var isNumber = function(value) {
			return !isNaN(parseInt(value, 10))
		};

		var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
				ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
					isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);

		if (isminw) data.width = o.minWidth;
		if (isminh) data.height = o.minHeight;
		if (ismaxw) data.width = o.maxWidth;
		if (ismaxh) data.height = o.maxHeight;

		var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
		var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);

		if (isminw && cw) data.left = dw - o.minWidth;
		if (ismaxw && cw) data.left = dw - o.maxWidth;
		if (isminh && ch)	data.top = dh - o.minHeight;
		if (ismaxh && ch)	data.top = dh - o.maxHeight;

		// fixing jump error on top/left - bug #2330
		var isNotwh = !data.width && !data.height;
		if (isNotwh && !data.left && data.top) data.top = null;
		else if (isNotwh && !data.top && data.left) data.left = null;

		return data;
	},

	_proportionallyResize: function() {

		var o = this.options;
		if (!this.proportionallyResize.length) return;
		var element = this.helper || this.element;

		for (var i=0; i < this.proportionallyResize.length; i++) {

			var prel = this.proportionallyResize[i];

			if (!this.borderDif) {
				var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
					p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];

				this.borderDif = $.map(b, function(v, i) {
					var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
					return border + padding;
				});
			}

			if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
				continue;

			prel.css({
				height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
				width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
			});

		};

	},

	_renderProxy: function() {

		var el = this.element, o = this.options;
		this.elementOffset = el.offset();

		if(this._helper) {

			this.helper = this.helper || $('<div style="overflow:hidden;"></div>');

			// fix ie6 offset TODO: This seems broken
			var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
			pxyoffset = ( ie6 ? 2 : -1 );

			this.helper.addClass(this._helper).css({
				width: this.element.outerWidth() + pxyoffset,
				height: this.element.outerHeight() + pxyoffset,
				position: 'absolute',
				left: this.elementOffset.left - ie6offset +'px',
				top: this.elementOffset.top - ie6offset +'px',
				zIndex: ++o.zIndex //TODO: Don't modify option
			});

			this.helper.appendTo("body");

			if (o.disableSelection)
				this.helper.disableSelection();

		} else {
			this.helper = this.element;
		}

	},

	_change: {
		e: function(event, dx, dy) {
			return { width: this.originalSize.width + dx };
		},
		w: function(event, dx, dy) {
			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
			return { left: sp.left + dx, width: cs.width - dx };
		},
		n: function(event, dx, dy) {
			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
			return { top: sp.top + dy, height: cs.height - dy };
		},
		s: function(event, dx, dy) {
			return { height: this.originalSize.height + dy };
		},
		se: function(event, dx, dy) {
			return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
		},
		sw: function(event, dx, dy) {
			return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
		},
		ne: function(event, dx, dy) {
			return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
		},
		nw: function(event, dx, dy) {
			return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
		}
	},

	_propagate: function(n, event) {
		$.ui.plugin.call(this, n, [event, this.ui()]);
		(n != "resize" && this._trigger(n, event, this.ui()));
	},

	plugins: {},

	ui: function() {
		return {
			originalElement: this.originalElement,
			element: this.element,
			helper: this.helper,
			position: this.position,
			size: this.size,
			originalSize: this.originalSize,
			originalPosition: this.originalPosition
		};
	}

}));

$.extend($.ui.resizable, {
	version: "1.6rc6",
	eventPrefix: "resize",
	defaults: {
		alsoResize: false,
		animate: false,
		animateDuration: "slow",
		animateEasing: "swing",
		aspectRatio: false,
		autoHide: false,
		cancel: ":input,option",
		containment: false,
		delay: 0,
		disableSelection: true,
		distance: 1,
		ghost: false,
		grid: false,
		handles: "e,s,se",
		helper: false,
		maxHeight: null,
		maxWidth: null,
		minHeight: 10,
		minWidth: 10,
		preserveCursor: true,
		preventDefault: true,
		proportionallyResize: false,
		transparent: false,
		zIndex: 1000
	}
});

/*
 * Resizable Extensions
 */

$.ui.plugin.add("resizable", "alsoResize", {

	start: function(event, ui) {

		var self = $(this).data("resizable"), o = self.options;

		_store = function(exp) {
			$(exp).each(function() {
				$(this).data("resizable-alsoresize", {
					width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
					left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
				});
			});
		};

		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
			if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0];	_store(o.alsoResize); }
			else { $.each(o.alsoResize, function(exp, c) { _store(exp); }); }
		}else{
			_store(o.alsoResize);
		}
	},

	resize: function(event, ui){
		var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;

		var delta = {
			height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
			top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
		},

		_alsoResize = function(exp, c) {
			$(exp).each(function() {
				var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];

				$.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
					var sum = (start[prop]||0) + (delta[prop]||0);
					if (sum && sum >= 0)
						style[prop] = sum || null;
				});

				//Opera fixing relative position
				if (/relative/.test(el.css('position')) && $.browser.opera) {
					self._revertToRelativePosition = true;
					el.css({ position: 'absolute', top: 'auto', left: 'auto' });
				}

				el.css(style);
			});
		};

		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
			$.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
		}else{
			_alsoResize(o.alsoResize);
		}
	},

	stop: function(event, ui){
		var self = $(this).data("resizable");

		//Opera fixing relative position
		if (self._revertToRelativePosition && $.browser.opera) {
			self._revertToRelativePosition = false;
			el.css({ position: 'relative' });
		}

		$(this).removeData("resizable-alsoresize-start");
	}
});

$.ui.plugin.add("resizable", "animate", {

	stop: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options;

		var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName),
						soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
							soffsetw = ista ? 0 : self.sizeDiff.width;

		var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
					left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
						top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;

		self.element.animate(
			$.extend(style, top && left ? { top: top, left: left } : {}), {
				duration: o.animateDuration,
				easing: o.animateEasing,
				step: function() {

					var data = {
						width: parseInt(self.element.css('width'), 10),
						height: parseInt(self.element.css('height'), 10),
						top: parseInt(self.element.css('top'), 10),
						left: parseInt(self.element.css('left'), 10)
					};

					if (pr) pr.css({ width: data.width, height: data.height });

					// propagating resize, and updating values for each animation step
					self._updateCache(data);
					self._propagate("resize", event);

				}
			}
		);
	}

});

$.ui.plugin.add("resizable", "containment", {

	start: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options, el = self.element;
		var oc = o.containment,	ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
		if (!ce) return;

		self.containerElement = $(ce);

		if (/document/.test(oc) || oc == document) {
			self.containerOffset = { left: 0, top: 0 };
			self.containerPosition = { left: 0, top: 0 };

			self.parentData = {
				element: $(document), left: 0, top: 0,
				width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
			};
		}

		// i'm a node, so compute top, left, right, bottom
		else {
			var element = $(ce), p = [];
			$([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });

			self.containerOffset = element.offset();
			self.containerPosition = element.position();
			self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };

			var co = self.containerOffset, ch = self.containerSize.height,	cw = self.containerSize.width,
						width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);

			self.parentData = {
				element: ce, left: co.left, top: co.top, width: width, height: height
			};
		}
	},

	resize: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options,
				ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
				pRatio = o._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;

		if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;

		if (cp.left < (self._helper ? co.left : 0)) {
			self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
			if (pRatio) self.size.height = self.size.width / o.aspectRatio;
			self.position.left = o.helper ? co.left : 0;
		}

		if (cp.top < (self._helper ? co.top : 0)) {
			self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
			if (pRatio) self.size.width = self.size.height * o.aspectRatio;
			self.position.top = self._helper ? co.top : 0;
		}

		var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
					hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );

		if (woset + self.size.width >= self.parentData.width) {
			self.size.width = self.parentData.width - woset;
			if (pRatio) self.size.height = self.size.width / o.aspectRatio;
		}

		if (hoset + self.size.height >= self.parentData.height) {
			self.size.height = self.parentData.height - hoset;
			if (pRatio) self.size.width = self.size.height * o.aspectRatio;
		}
	},

	stop: function(event, ui){
		var self = $(this).data("resizable"), o = self.options, cp = self.position,
				co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;

		var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;

		if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });

		if (self._helper && !o.animate && (/static/).test(ce.css('position')))
			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });

	}
});

$.ui.plugin.add("resizable", "ghost", {

	start: function(event, ui) {

		var self = $(this).data("resizable"), o = self.options, pr = o.proportionallyResize, cs = self.size;

		self.ghost = self.originalElement.clone();
		self.ghost
			.css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
			.addClass('ui-resizable-ghost')
			.addClass(typeof o.ghost == 'string' ? o.ghost : '');

		self.ghost.appendTo(self.helper);

	},

	resize: function(event, ui){
		var self = $(this).data("resizable"), o = self.options;
		if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
	},

	stop: function(event, ui){
		var self = $(this).data("resizable"), o = self.options;
		if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
	}

});

$.ui.plugin.add("resizable", "grid", {

	resize: function(event, ui) {
		var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
		o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
		var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);

		if (/^(se|s|e)$/.test(a)) {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
		}
		else if (/^(ne)$/.test(a)) {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
			self.position.top = op.top - oy;
		}
		else if (/^(sw)$/.test(a)) {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
			self.position.left = op.left - ox;
		}
		else {
			self.size.width = os.width + ox;
			self.size.height = os.height + oy;
			self.position.top = op.top - oy;
			self.position.left = op.left - ox;
		}
	}

});

var num = function(v) {
	return parseInt(v, 10) || 0;
};

})(jQuery);
/*
 * jQuery UI Selectable 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Selectables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.selectable", $.extend({}, $.ui.mouse, {

	_init: function() {
		var self = this;

		this.element.addClass("ui-selectable");

		this.dragged = false;

		// cache selectee children based on filter
		var selectees;
		this.refresh = function() {
			selectees = $(self.options.filter, self.element[0]);
			selectees.each(function() {
				var $this = $(this);
				var pos = $this.offset();
				$.data(this, "selectable-item", {
					element: this,
					$element: $this,
					left: pos.left,
					top: pos.top,
					right: pos.left + $this.outerWidth(),
					bottom: pos.top + $this.outerHeight(),
					startselected: false,
					selected: $this.hasClass('ui-selected'),
					selecting: $this.hasClass('ui-selecting'),
					unselecting: $this.hasClass('ui-unselecting')
				});
			});
		};
		this.refresh();

		this.selectees = selectees.addClass("ui-selectee");

		this._mouseInit();

		this.helper = $(document.createElement('div'))
			.css({border:'1px dotted black'})
			.addClass("ui-selectable-helper");
	},

	destroy: function() {
		this.element
			.removeClass("ui-selectable ui-selectable-disabled")
			.removeData("selectable")
			.unbind(".selectable");
		this._mouseDestroy();
	},

	_mouseStart: function(event) {
		var self = this;

		this.opos = [event.pageX, event.pageY];

		if (this.options.disabled)
			return;

		var options = this.options;

		this.selectees = $(options.filter, this.element[0]);

		this._trigger("start", event);

		$('body').append(this.helper);
		// position helper (lasso)
		this.helper.css({
			"z-index": 100,
			"position": "absolute",
			"left": event.clientX,
			"top": event.clientY,
			"width": 0,
			"height": 0
		});

		if (options.autoRefresh) {
			this.refresh();
		}

		this.selectees.filter('.ui-selected').each(function() {
			var selectee = $.data(this, "selectable-item");
			selectee.startselected = true;
			if (!event.metaKey) {
				selectee.$element.removeClass('ui-selected');
				selectee.selected = false;
				selectee.$element.addClass('ui-unselecting');
				selectee.unselecting = true;
				// selectable UNSELECTING callback
				self._trigger("unselecting", event, {
					unselecting: selectee.element
				});
			}
		});

		$(event.target).parents().andSelf().each(function() {
			var selectee = $.data(this, "selectable-item");
			if (selectee) {
				selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');
				selectee.unselecting = false;
				selectee.selecting = true;
				selectee.selected = true;
				// selectable SELECTING callback
				self._trigger("selecting", event, {
					selecting: selectee.element
				});
				return false;
			}
		});

	},

	_mouseDrag: function(event) {
		var self = this;
		this.dragged = true;

		if (this.options.disabled)
			return;

		var options = this.options;

		var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
		if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
		if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
		this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});

		this.selectees.each(function() {
			var selectee = $.data(this, "selectable-item");
			//prevent helper from being selected if appendTo: selectable
			if (!selectee || selectee.element == self.element[0])
				return;
			var hit = false;
			if (options.tolerance == 'touch') {
				hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
			} else if (options.tolerance == 'fit') {
				hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
			}

			if (hit) {
				// SELECT
				if (selectee.selected) {
					selectee.$element.removeClass('ui-selected');
					selectee.selected = false;
				}
				if (selectee.unselecting) {
					selectee.$element.removeClass('ui-unselecting');
					selectee.unselecting = false;
				}
				if (!selectee.selecting) {
					selectee.$element.addClass('ui-selecting');
					selectee.selecting = true;
					// selectable SELECTING callback
					self._trigger("selecting", event, {
						selecting: selectee.element
					});
				}
			} else {
				// UNSELECT
				if (selectee.selecting) {
					if (event.metaKey && selectee.startselected) {
						selectee.$element.removeClass('ui-selecting');
						selectee.selecting = false;
						selectee.$element.addClass('ui-selected');
						selectee.selected = true;
					} else {
						selectee.$element.removeClass('ui-selecting');
						selectee.selecting = false;
						if (selectee.startselected) {
							selectee.$element.addClass('ui-unselecting');
							selectee.unselecting = true;
						}
						// selectable UNSELECTING callback
						self._trigger("unselecting", event, {
							unselecting: selectee.element
						});
					}
				}
				if (selectee.selected) {
					if (!event.metaKey && !selectee.startselected) {
						selectee.$element.removeClass('ui-selected');
						selectee.selected = false;

						selectee.$element.addClass('ui-unselecting');
						selectee.unselecting = true;
						// selectable UNSELECTING callback
						self._trigger("unselecting", event, {
							unselecting: selectee.element
						});
					}
				}
			}
		});

		return false;
	},

	_mouseStop: function(event) {
		var self = this;

		this.dragged = false;

		var options = this.options;

		$('.ui-unselecting', this.element[0]).each(function() {
			var selectee = $.data(this, "selectable-item");
			selectee.$element.removeClass('ui-unselecting');
			selectee.unselecting = false;
			selectee.startselected = false;
			self._trigger("unselected", event, {
				unselected: selectee.element
			});
		});
		$('.ui-selecting', this.element[0]).each(function() {
			var selectee = $.data(this, "selectable-item");
			selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
			selectee.selecting = false;
			selectee.selected = true;
			selectee.startselected = true;
			self._trigger("selected", event, {
				selected: selectee.element
			});
		});
		this._trigger("stop", event);

		this.helper.remove();

		return false;
	}

}));

$.extend($.ui.selectable, {
	version: "1.6rc6",
	defaults: {
		appendTo: 'body',
		autoRefresh: true,
		cancel: ":input,option",
		delay: 0,
		distance: 0,
		filter: '*',
		tolerance: 'touch'
	}
});

})(jQuery);
/*
 * jQuery UI Sortable 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Sortables
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.sortable", $.extend({}, $.ui.mouse, {
	_init: function() {

		var o = this.options;
		this.containerCache = {};
		(this.options.cssNamespace && this.element.addClass(this.options.cssNamespace+"-sortable"));

		//Get the items
		this.refresh();

		//Let's determine if the items are floating
		this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;

		//Let's determine the parent's offset
		this.offset = this.element.offset();

		//Initialize mouse events for interaction
		this._mouseInit();

	},

	destroy: function() {
		this.element
			.removeClass(this.options.cssNamespace+"-sortable "+this.options.cssNamespace+"-sortable-disabled")
			.removeData("sortable")
			.unbind(".sortable");
		this._mouseDestroy();

		for ( var i = this.items.length - 1; i >= 0; i-- )
			this.items[i].item.removeData("sortable-item");
	},

	_mouseCapture: function(event, overrideHandle) {

		if (this.reverting) {
			return false;
		}

		if(this.options.disabled || this.options.type == 'static') return false;

		//We have to refresh the items data once first
		this._refreshItems(event);

		//Find out if the clicked node (or one of its parents) is a actual item in this.items
		var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {
			if($.data(this, 'sortable-item') == self) {
				currentItem = $(this);
				return false;
			}
		});
		if($.data(event.target, 'sortable-item') == self) currentItem = $(event.target);

		if(!currentItem) return false;
		if(this.options.handle && !overrideHandle) {
			var validHandle = false;

			$(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
			if(!validHandle) return false;
		}

		this.currentItem = currentItem;
		this._removeCurrentsFromItems();
		return true;

	},

	_mouseStart: function(event, overrideHandle, noActivation) {

		var o = this.options, self = this;
		this.currentContainer = this;

		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
		this.refreshPositions();

		//Create and append the visible helper
		this.helper = this._createHelper(event);

		//Cache the helper size
		this._cacheHelperProportions();

		/*
		 * - Position generation -
		 * This block generates everything position related - it's the core of draggables.
		 */

		//Cache the margins of the original element
		this._cacheMargins();

		//Get the next scrolling parent
		this.scrollParent = this.helper.scrollParent();

		//The element's absolute position on the page minus margins
		this.offset = this.currentItem.offset();
		this.offset = {
			top: this.offset.top - this.margins.top,
			left: this.offset.left - this.margins.left
		};

		// Only after we got the offset, we can change the helper's position to absolute
		// TODO: Still need to figure out a way to make relative sorting possible
		this.helper.css("position", "absolute");
		this.cssPosition = this.helper.css("position");

		$.extend(this.offset, {
			click: { //Where the click happened, relative to the element
				left: event.pageX - this.offset.left,
				top: event.pageY - this.offset.top
			},
			parent: this._getParentOffset(),
			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
		});

		//Generate the original position
		this.originalPosition = this._generatePosition(event);
		this.originalPageX = event.pageX;
		this.originalPageY = event.pageY;

		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
		if(o.cursorAt)
			this._adjustOffsetFromHelper(o.cursorAt);

		//Cache the former DOM position
		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };

		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
		if(this.helper[0] != this.currentItem[0]) {
			this.currentItem.hide();
		}

		//Create the placeholder
		this._createPlaceholder();

		//Set a containment if given in the options
		if(o.containment)
			this._setContainment();

		if(o.cursor) { // cursor option
			if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
			$('body').css("cursor", o.cursor);
		}

		if(o.opacity) { // opacity option
			if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
			this.helper.css("opacity", o.opacity);
		}

		if(o.zIndex) { // zIndex option
			if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
			this.helper.css("zIndex", o.zIndex);
		}

		//Prepare scrolling
		if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
			this.overflowOffset = this.scrollParent.offset();

		//Call callbacks
		this._trigger("start", event, this._uiHash());

		//Recache the helper size
		if(!this._preserveHelperProportions)
			this._cacheHelperProportions();


		//Post 'activate' events to possible containers
		if(!noActivation) {
			 for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); }
		}

		//Prepare possible droppables
		if($.ui.ddmanager)
			$.ui.ddmanager.current = this;

		if ($.ui.ddmanager && !o.dropBehaviour)
			$.ui.ddmanager.prepareOffsets(this, event);

		this.dragging = true;

		this.helper.addClass(o.cssNamespace+'-sortable-helper');
		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
		return true;

	},

	_mouseDrag: function(event) {

		//Compute the helpers position
		this.position = this._generatePosition(event);
		this.positionAbs = this._convertPositionTo("absolute");

		if (!this.lastPositionAbs) {
			this.lastPositionAbs = this.positionAbs;
		}

		//Do scrolling
		if(this.options.scroll) {
			var o = this.options, scrolled = false;
			if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {

				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
				else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;

				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
				else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;

			} else {

				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);

				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);

			}

			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
				$.ui.ddmanager.prepareOffsets(this, event);
		}

		//Regenerate the absolute position used for position checks
		this.positionAbs = this._convertPositionTo("absolute");

		//Set the helper position
		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';

		//Rearrange
		for (var i = this.items.length - 1; i >= 0; i--) {

			//Cache variables and intersection, continue if no intersection
			var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
			if (!intersection) continue;

			if(itemElement != this.currentItem[0] //cannot intersect with itself
				&&	this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
				&&	!$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
				&& (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)
			) {

				this.direction = intersection == 1 ? "down" : "up";

				if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
					this.options.sortIndicator.call(this, event, item);
				} else {
					break;
				}

				this._trigger("change", event, this._uiHash());
				break;
			}
		}

		//Post events to containers
		this._contactContainers(event);

		//Interconnect with droppables
		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);

		//Call callbacks
		this._trigger('sort', event, this._uiHash());

		this.lastPositionAbs = this.positionAbs;
		return false;

	},

	_mouseStop: function(event, noPropagation) {

		if(!event) return;

		//If we are using droppables, inform the manager about the drop
		if ($.ui.ddmanager && !this.options.dropBehaviour)
			$.ui.ddmanager.drop(this, event);

		if(this.options.revert) {
			var self = this;
			var cur = self.placeholder.offset();

			self.reverting = true;

			$(this.helper).animate({
				left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
				top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
			}, parseInt(this.options.revert, 10) || 500, function() {
				self._clear(event);
			});
		} else {
			this._clear(event, noPropagation);
		}

		return false;

	},

	cancel: function() {

		var self = this;

		if(this.dragging) {

			this._mouseUp();

			if(this.options.helper == "original")
				this.currentItem.css(this._storedCSS).removeClass(this.options.cssNamespace+"-sortable-helper");
			else
				this.currentItem.show();

			//Post deactivating events to containers
			for (var i = this.containers.length - 1; i >= 0; i--){
				this.containers[i]._trigger("deactivate", null, self._uiHash(this));
				if(this.containers[i].containerCache.over) {
					this.containers[i]._trigger("out", null, self._uiHash(this));
					this.containers[i].containerCache.over = 0;
				}
			}

		}

		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
		if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
		if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();

		$.extend(this, {
			helper: null,
			dragging: false,
			reverting: false,
			_noFinalSort: null
		});

		if(this.domPosition.prev) {
			$(this.domPosition.prev).after(this.currentItem);
		} else {
			$(this.domPosition.parent).prepend(this.currentItem);
		}

		return true;

	},

	serialize: function(o) {

		var items = this._getItemsAsjQuery(o && o.connected);
		var str = []; o = o || {};

		$(items).each(function() {
			var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
			if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
		});

		return str.join('&');

	},

	toArray: function(o) {

		var items = this._getItemsAsjQuery(o && o.connected);
		var ret = []; o = o || {};

		items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
		return ret;

	},

	/* Be careful with the following core functions */
	_intersectsWith: function(item) {

		var x1 = this.positionAbs.left,
			x2 = x1 + this.helperProportions.width,
			y1 = this.positionAbs.top,
			y2 = y1 + this.helperProportions.height;

		var l = item.left,
			r = l + item.width,
			t = item.top,
			b = t + item.height;

		var dyClick = this.offset.click.top,
			dxClick = this.offset.click.left;

		var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;

		if(	   this.options.tolerance == "pointer"
			|| this.options.forcePointerForContainers
			|| (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
		) {
			return isOverElement;
		} else {

			return (l < x1 + (this.helperProportions.width / 2) // Right Half
				&& x2 - (this.helperProportions.width / 2) < r // Left Half
				&& t < y1 + (this.helperProportions.height / 2) // Bottom Half
				&& y2 - (this.helperProportions.height / 2) < b ); // Top Half

		}
	},

	_intersectsWithPointer: function(item) {

		var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
			isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
			isOverElement = isOverElementHeight && isOverElementWidth,
			verticalDirection = this._getDragVerticalDirection(),
			horizontalDirection = this._getDragHorizontalDirection();

		if (!isOverElement)
			return false;

		return this.floating ?
			( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
			: ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );

	},

	_intersectsWithSides: function(item) {

		var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
			isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
			verticalDirection = this._getDragVerticalDirection(),
			horizontalDirection = this._getDragHorizontalDirection();

		if (this.floating && horizontalDirection) {
			return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
		} else {
			return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
		}

	},

	_getDragVerticalDirection: function() {
		var delta = this.positionAbs.top - this.lastPositionAbs.top;
		return delta != 0 && (delta > 0 ? "down" : "up");
	},

	_getDragHorizontalDirection: function() {
		var delta = this.positionAbs.left - this.lastPositionAbs.left;
		return delta != 0 && (delta > 0 ? "right" : "left");
	},

	refresh: function(event) {
		this._refreshItems(event);
		this.refreshPositions();
	},

	_getItemsAsjQuery: function(connected) {

		var self = this;
		var items = [];
		var queries = [];

		if(this.options.connectWith && connected) {
			var connectWith = this.options.connectWith.constructor == String ? [this.options.connectWith] : this.options.connectWith;
			for (var i = connectWith.length - 1; i >= 0; i--){
				var cur = $(connectWith[i]);
				for (var j = cur.length - 1; j >= 0; j--){
					var inst = $.data(cur[j], 'sortable');
					if(inst && inst != this && !inst.options.disabled) {
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not("."+inst.options.cssNamespace+"-sortable-helper"), inst]);
					}
				};
			};
		}

		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not("."+this.options.cssNamespace+"-sortable-helper"), this]);

		for (var i = queries.length - 1; i >= 0; i--){
			queries[i][0].each(function() {
				items.push(this);
			});
		};

		return $(items);

	},

	_removeCurrentsFromItems: function() {

		var list = this.currentItem.find(":data(sortable-item)");

		for (var i=0; i < this.items.length; i++) {

			for (var j=0; j < list.length; j++) {
				if(list[j] == this.items[i].item[0])
					this.items.splice(i,1);
			};

		};

	},

	_refreshItems: function(event) {

		this.items = [];
		this.containers = [this];
		var items = this.items;
		var self = this;
		var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];

		if(this.options.connectWith) {
			for (var i = this.options.connectWith.length - 1; i >= 0; i--){
				var cur = $(this.options.connectWith[i]);
				for (var j = cur.length - 1; j >= 0; j--){
					var inst = $.data(cur[j], 'sortable');
					if(inst && inst != this && !inst.options.disabled) {
						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
						this.containers.push(inst);
					}
				};
			};
		}

		for (var i = queries.length - 1; i >= 0; i--) {
			var targetData = queries[i][1];
			var _queries = queries[i][0];

			for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
				var item = $(_queries[j]);

				item.data('sortable-item', targetData); // Data for target checking (mouse manager)

				items.push({
					item: item,
					instance: targetData,
					width: 0, height: 0,
					left: 0, top: 0
				});
			};
		};

	},

	refreshPositions: function(fast) {

		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
		if(this.offsetParent && this.helper) {
			this.offset.parent = this._getParentOffset();
		}

		for (var i = this.items.length - 1; i >= 0; i--){
			var item = this.items[i];

			//We ignore calculating positions of all connected containers when we're not over them
			if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
				continue;

			var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;

			if (!fast) {
				if (this.options.accurateIntersection) {
					item.width = t.outerWidth();
					item.height = t.outerHeight();
				}
				else {
					item.width = t[0].offsetWidth;
					item.height = t[0].offsetHeight;
				}
			}

			var p = t.offset();
			item.left = p.left;
			item.top = p.top;
		};

		if(this.options.custom && this.options.custom.refreshContainers) {
			this.options.custom.refreshContainers.call(this);
		} else {
			for (var i = this.containers.length - 1; i >= 0; i--){
				var p = this.containers[i].element.offset();
				this.containers[i].containerCache.left = p.left;
				this.containers[i].containerCache.top = p.top;
				this.containers[i].containerCache.width	= this.containers[i].element.outerWidth();
				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
			};
		}

	},

	_createPlaceholder: function(that) {

		var self = that || this, o = self.options;

		if(!o.placeholder || o.placeholder.constructor == String) {
			var className = o.placeholder;
			o.placeholder = {
				element: function() {

					var el = $(document.createElement(self.currentItem[0].nodeName))
						.addClass(className || self.currentItem[0].className+" "+self.options.cssNamespace+"-sortable-placeholder")
						.removeClass(self.options.cssNamespace+'-sortable-helper')[0];

					if(!className)
						el.style.visibility = "hidden";

					return el;
				},
				update: function(container, p) {

					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
					if(className && !o.forcePlaceholderSize) return;

					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
					if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
					if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
				}
			};
		}

		//Create the placeholder
		self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));

		//Append it after the actual current item
		self.currentItem.after(self.placeholder);

		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
		o.placeholder.update(self, self.placeholder);

	},

	_contactContainers: function(event) {
		for (var i = this.containers.length - 1; i >= 0; i--){

			if(this._intersectsWith(this.containers[i].containerCache)) {
				if(!this.containers[i].containerCache.over) {

					if(this.currentContainer != this.containers[i]) {

						//When entering a new container, we will find the item with the least distance and append our item near it
						var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top'];
						for (var j = this.items.length - 1; j >= 0; j--) {
							if(!$.ui.contains(this.containers[i].element[0], this.items[j].item[0])) continue;
							var cur = this.items[j][this.containers[i].floating ? 'left' : 'top'];
							if(Math.abs(cur - base) < dist) {
								dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
							}
						}

						if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
							continue;

						this.currentContainer = this.containers[i];
						itemWithLeastDistance ? this.options.sortIndicator.call(this, event, itemWithLeastDistance, null, true) : this.options.sortIndicator.call(this, event, null, this.containers[i].element, true);
						this._trigger("change", event, this._uiHash());
						this.containers[i]._trigger("change", event, this._uiHash(this));

						//Update the placeholder
						this.options.placeholder.update(this.currentContainer, this.placeholder);

					}

					this.containers[i]._trigger("over", event, this._uiHash(this));
					this.containers[i].containerCache.over = 1;
				}
			} else {
				if(this.containers[i].containerCache.over) {
					this.containers[i]._trigger("out", event, this._uiHash(this));
					this.containers[i].containerCache.over = 0;
				}
			}

		};
	},

	_createHelper: function(event) {

		var o = this.options;
		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);

		if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
			$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);

		if(helper[0] == this.currentItem[0])
			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };

		if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
		if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());

		return helper;

	},

	_adjustOffsetFromHelper: function(obj) {
		if(obj.left != undefined) this.offset.click.left = obj.left + this.margins.left;
		if(obj.right != undefined) this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
		if(obj.top != undefined) this.offset.click.top = obj.top + this.margins.top;
		if(obj.bottom != undefined) this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
	},

	_getParentOffset: function() {


		//Get the offsetParent and cache its position
		this.offsetParent = this.helper.offsetParent();
		var po = this.offsetParent.offset();

		// This is a special case where we need to modify a offset calculated on start, since the following happened:
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
			po.left += this.scrollParent.scrollLeft();
			po.top += this.scrollParent.scrollTop();
		}

		if((this.offsetParent[0] == document.body && $.browser.mozilla)	//Ugly FF3 fix
		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
			po = { top: 0, left: 0 };

		return {
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
		};

	},

	_getRelativeOffset: function() {

		if(this.cssPosition == "relative") {
			var p = this.currentItem.position();
			return {
				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
			};
		} else {
			return { top: 0, left: 0 };
		}

	},

	_cacheMargins: function() {
		this.margins = {
			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
		};
	},

	_cacheHelperProportions: function() {
		this.helperProportions = {
			width: this.helper.outerWidth(),
			height: this.helper.outerHeight()
		};
	},

	_setContainment: function() {

		var o = this.options;
		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
		if(o.containment == 'document' || o.containment == 'window') this.containment = [
			0 - this.offset.relative.left - this.offset.parent.left,
			0 - this.offset.relative.top - this.offset.parent.top,
			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
		];

		if(!(/^(document|window|parent)$/).test(o.containment)) {
			var ce = $(o.containment)[0];
			var co = $(o.containment).offset();
			var over = ($(ce).css("overflow") != 'hidden');

			this.containment = [
				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
			];
		}

	},

	_convertPositionTo: function(d, pos) {

		if(!pos) pos = this.position;
		var mod = d == "absolute" ? 1 : -1;
		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		return {
			top: (
				pos.top																	// The absolute mouse position
				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
				- ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod
			),
			left: (
				pos.left																// The absolute mouse position
				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
				- ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod
			)
		};

	},

	_generatePosition: function(event) {

		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);

		// This is another very weird special case that only happens for relative elements:
		// 1. If the css position is relative
		// 2. and the scroll parent is the document or similar to the offset parent
		// we have to refresh the relative offset during the scroll so there are no jumps
		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
			this.offset.relative = this._getRelativeOffset();
		}

		var pageX = event.pageX;
		var pageY = event.pageY;

		/*
		 * - Position constraining -
		 * Constrain the position to a mix of grid, containment.
		 */

		if(this.originalPosition) { //If we are not dragging yet, we won't check for options

			if(this.containment) {
				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
			}

			if(o.grid) {
				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
				pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;

				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
				pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
			}

		}

		return {
			top: (
				pageY																// The absolute mouse position
				- this.offset.click.top													// Click offset (relative to the element)
				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
				+ ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )
			),
			left: (
				pageX																// The absolute mouse position
				- this.offset.click.left												// Click offset (relative to the element)
				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
				+ ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )
			)
		};

	},

	_rearrange: function(event, i, a, hardRefresh) {

		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));

		//Various things done here to improve the performance:
		// 1. we create a setTimeout, that calls refreshPositions
		// 2. on the instance, we have a counter variable, that get's higher after every append
		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
		// 4. this lets only the last addition to the timeout stack through
		this.counter = this.counter ? ++this.counter : 1;
		var self = this, counter = this.counter;

		window.setTimeout(function() {
			if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
		},0);

	},

	_clear: function(event, noPropagation) {

		this.reverting = false;
		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
		// everything else normalized again
		var delayedTriggers = [], self = this;

		//We first have to update the dom position of the actual currentItem
		if(!this._noFinalSort) this.placeholder.before(this.currentItem);
		this._noFinalSort = null;

		if(this.helper[0] == this.currentItem[0]) {
			for(var i in this._storedCSS) {
				if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
			}
			this.currentItem.css(this._storedCSS).removeClass(this.options.cssNamespace+"-sortable-helper");
		} else {
			this.currentItem.show();
		}

		if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
		if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not("."+this.options.cssNamespace+"-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
		if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
			if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
			for (var i = this.containers.length - 1; i >= 0; i--){
				if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
					delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
					delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.containers[i]));
				}
			};
		};

		//Post events to containers
		for (var i = this.containers.length - 1; i >= 0; i--){
			if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
			if(this.containers[i].containerCache.over) {
				delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
				this.containers[i].containerCache.over = 0;
			}
		}

		//Do what was originally in plugins
		if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
		if(this._storedOpacity) this.helper.css("opacity", this._storedCursor); //Reset cursor
		if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index

		this.dragging = false;
		if(this.cancelHelperRemoval) {
			if(!noPropagation) {
				this._trigger("beforeStop", event, this._uiHash());
				for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
				this._trigger("stop", event, this._uiHash());
			}
			return false;
		}

		if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());

		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);

		if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;

		if(!noPropagation) {
			for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
			this._trigger("stop", event, this._uiHash());
		}

		this.fromOutside = false;
		return true;

	},

	_trigger: function() {
		if ($.widget.prototype._trigger.apply(this, arguments) === false) {
			this.cancel();
		}
	},

	_uiHash: function(inst) {
		var self = inst || this;
		return {
			helper: self.helper,
			placeholder: self.placeholder || $([]),
			position: self.position,
			absolutePosition: self.positionAbs, //deprecated
			offset: self.positionAbs,
			item: self.currentItem,
			sender: inst ? inst.element : null
		};
	}

}));

$.extend($.ui.sortable, {
	getter: "serialize toArray",
	version: "1.6rc6",
	defaults: {
		accurateIntersection: true,
		appendTo: "parent",
		cancel: ":input,option",
		connectWith: false,
		cssNamespace: 'ui',
		delay: 0,
		distance: 1,
		dropOnEmpty: true,
		forcePlaceholderSize: false,
		forceHelperSize: false,
		handle: false,
		helper: "original",
		items: '> *',
		placeholder: false,
		scope: "default",
		scroll: true,
		scrollSensitivity: 20,
		scrollSpeed: 20,
		sortIndicator: $.ui.sortable.prototype._rearrange,
		tolerance: "intersect",
		zIndex: 1000
	}
});

})(jQuery);
/*
 * jQuery UI Effects 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/
 */
;(function($) {

$.effects = $.effects || {}; //Add the 'effects' scope

$.extend($.effects, {
	version: "1.6rc6",

	// Saves a set of properties in a data storage
	save: function(element, set) {
		for(var i=0; i < set.length; i++) {
			if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
		}
	},

	// Restores a set of previously saved properties from a data storage
	restore: function(element, set) {
		for(var i=0; i < set.length; i++) {
			if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
		}
	},

	setMode: function(el, mode) {
		if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
		return mode;
	},

	getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
		// this should be a little more flexible in the future to handle a string & hash
		var y, x;
		switch (origin[0]) {
			case 'top': y = 0; break;
			case 'middle': y = 0.5; break;
			case 'bottom': y = 1; break;
			default: y = origin[0] / original.height;
		};
		switch (origin[1]) {
			case 'left': x = 0; break;
			case 'center': x = 0.5; break;
			case 'right': x = 1; break;
			default: x = origin[1] / original.width;
		};
		return {x: x, y: y};
	},

	// Wraps the element around a wrapper that copies position properties
	createWrapper: function(element) {

		//if the element is already wrapped, return it
		if (element.parent().is('.ui-effects-wrapper'))
			return element.parent();

		//Cache width,height and float properties of the element, and create a wrapper around it
		var props = { width: element.outerWidth(true), height: element.outerHeight(true), 'float': element.css('float') };
		element.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
		var wrapper = element.parent();

		//Transfer the positioning of the element to the wrapper
		if (element.css('position') == 'static') {
			wrapper.css({ position: 'relative' });
			element.css({ position: 'relative'} );
		} else {
			var top = element.css('top'); if(isNaN(parseInt(top,10))) top = 'auto';
			var left = element.css('left'); if(isNaN(parseInt(left,10))) left = 'auto';
			wrapper.css({ position: element.css('position'), top: top, left: left, zIndex: element.css('z-index') }).show();
			element.css({position: 'relative', top: 0, left: 0 });
		}

		wrapper.css(props);
		return wrapper;
	},

	removeWrapper: function(element) {
		if (element.parent().is('.ui-effects-wrapper'))
			return element.parent().replaceWith(element);
		return element;
	},

	setTransition: function(element, list, factor, value) {
		value = value || {};
		$.each(list, function(i, x){
			unit = element.cssUnit(x);
			if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
		});
		return value;
	},

	//Base function to animate from one class to another in a seamless transition
	animateClass: function(value, duration, easing, callback) {

		var cb = (typeof easing == "function" ? easing : (callback ? callback : null));
		var ea = (typeof easing == "string" ? easing : null);

		return this.each(function() {

			var offset = {}; var that = $(this); var oldStyleAttr = that.attr("style") || '';
			if(typeof oldStyleAttr == 'object') oldStyleAttr = oldStyleAttr["cssText"]; /* Stupidly in IE, style is a object.. */
			if(value.toggle) { that.hasClass(value.toggle) ? value.remove = value.toggle : value.add = value.toggle; }

			//Let's get a style offset
			var oldStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
			if(value.add) that.addClass(value.add); if(value.remove) that.removeClass(value.remove);
			var newStyle = $.extend({}, (document.defaultView ? document.defaultView.getComputedStyle(this,null) : this.currentStyle));
			if(value.add) that.removeClass(value.add); if(value.remove) that.addClass(value.remove);

			// The main function to form the object for animation
			for(var n in newStyle) {
				if( typeof newStyle[n] != "function" && newStyle[n] /* No functions and null properties */
				&& n.indexOf("Moz") == -1 && n.indexOf("length") == -1 /* No mozilla spezific render properties. */
				&& newStyle[n] != oldStyle[n] /* Only values that have changed are used for the animation */
				&& (n.match(/color/i) || (!n.match(/color/i) && !isNaN(parseInt(newStyle[n],10)))) /* Only things that can be parsed to integers or colors */
				&& (oldStyle.position != "static" || (oldStyle.position == "static" && !n.match(/left|top|bottom|right/))) /* No need for positions when dealing with static positions */
				) offset[n] = newStyle[n];
			}

			that.animate(offset, duration, ea, function() { // Animate the newly constructed offset object
				// Change style attribute back to original. For stupid IE, we need to clear the damn object.
				if(typeof $(this).attr("style") == 'object') { $(this).attr("style")["cssText"] = ""; $(this).attr("style")["cssText"] = oldStyleAttr; } else $(this).attr("style", oldStyleAttr);
				if(value.add) $(this).addClass(value.add); if(value.remove) $(this).removeClass(value.remove);
				if(cb) cb.apply(this, arguments);
			});

		});
	}
});


function _normalizeArguments(a, m) {

	var o = a[1] && a[1].constructor == Object ? a[1] : {}; if(m) o.mode = m;
	var speed = a[1] && a[1].constructor != Object ? a[1] : o.duration; //either comes from options.duration or the second argument
		speed = $.fx.off ? 0 : typeof speed === "number" ? speed : $.fx.speeds[speed] || $.fx.speeds._default;
	var callback = o.callback || ( $.isFunction(a[2]) && a[2] ) || ( $.isFunction(a[3]) && a[3] );

	return [a[0], o, speed, callback];
	
}

//Extend the methods of jQuery
$.fn.extend({

	//Save old methods
	_show: $.fn.show,
	_hide: $.fn.hide,
	__toggle: $.fn.toggle,
	_addClass: $.fn.addClass,
	_removeClass: $.fn.removeClass,
	_toggleClass: $.fn.toggleClass,

	// New effect methods
	effect: function(fx, options, speed, callback) {
		return $.effects[fx] ? $.effects[fx].call(this, {method: fx, options: options || {}, duration: speed, callback: callback }) : null;
	},

	show: function() {
		if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
			return this._show.apply(this, arguments);
		else {
			return this.effect.apply(this, _normalizeArguments(arguments, 'show'));
		}
	},

	hide: function() {
		if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])))
			return this._hide.apply(this, arguments);
		else {
			return this.effect.apply(this, _normalizeArguments(arguments, 'hide'));
		}
	},

	toggle: function(){
		if(!arguments[0] || (arguments[0].constructor == Number || (/(slow|normal|fast)/).test(arguments[0])) || (arguments[0].constructor == Function))
			return this.__toggle.apply(this, arguments);
		else {
			return this.effect.apply(this, _normalizeArguments(arguments, 'toggle'));
		}
	},

	addClass: function(classNames, speed, easing, callback) {
		return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
	},
	removeClass: function(classNames,speed,easing,callback) {
		return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
	},
	toggleClass: function(classNames,speed,easing,callback) {
		return ( (typeof speed !== "boolean") && speed ) ? $.effects.animateClass.apply(this, [{ toggle: classNames },speed,easing,callback]) : this._toggleClass(classNames, speed);
	},
	morph: function(remove,add,speed,easing,callback) {
		return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
	},
	switchClass: function() {
		return this.morph.apply(this, arguments);
	},

	// helper functions
	cssUnit: function(key) {
		var style = this.css(key), val = [];
		$.each( ['em','px','%','pt'], function(i, unit){
			if(style.indexOf(unit) > 0)
				val = [parseFloat(style), unit];
		});
		return val;
	}
});

/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

// We override the animation for all of these color styles
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
		$.fx.step[attr] = function(fx) {
				if ( fx.state == 0 ) {
						fx.start = getColor( fx.elem, attr );
						fx.end = getRGB( fx.end );
				}

				fx.elem.style[attr] = "rgb(" + [
						Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0],10), 255), 0),
						Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1],10), 255), 0),
						Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2],10), 255), 0)
				].join(",") + ")";
			};
});

// Color Conversion functions from highlightFade
// By Blair Mitchelmore
// http://jquery.offput.ca/highlightFade/

// Parse strings looking for color tuples [255,255,255]
function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
				return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
				return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
				return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
				return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
				return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Look for rgba(0, 0, 0, 0) == transparent in Safari 3
		if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
				return colors['transparent'];

		// Otherwise, we're most likely dealing with a named color
		return colors[$.trim(color).toLowerCase()];
}

function getColor(elem, attr) {
		var color;

		do {
				color = $.curCSS(elem, attr);

				// Keep going until we find an element that has color, or we hit the body
				if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
						break;

				attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
};

// Some named colors to work with
// From Interface by Stefan Petre
// http://interface.eyecon.ro/

var colors = {
	aqua:[0,255,255],
	azure:[240,255,255],
	beige:[245,245,220],
	black:[0,0,0],
	blue:[0,0,255],
	brown:[165,42,42],
	cyan:[0,255,255],
	darkblue:[0,0,139],
	darkcyan:[0,139,139],
	darkgrey:[169,169,169],
	darkgreen:[0,100,0],
	darkkhaki:[189,183,107],
	darkmagenta:[139,0,139],
	darkolivegreen:[85,107,47],
	darkorange:[255,140,0],
	darkorchid:[153,50,204],
	darkred:[139,0,0],
	darksalmon:[233,150,122],
	darkviolet:[148,0,211],
	fuchsia:[255,0,255],
	gold:[255,215,0],
	green:[0,128,0],
	indigo:[75,0,130],
	khaki:[240,230,140],
	lightblue:[173,216,230],
	lightcyan:[224,255,255],
	lightgreen:[144,238,144],
	lightgrey:[211,211,211],
	lightpink:[255,182,193],
	lightyellow:[255,255,224],
	lime:[0,255,0],
	magenta:[255,0,255],
	maroon:[128,0,0],
	navy:[0,0,128],
	olive:[128,128,0],
	orange:[255,165,0],
	pink:[255,192,203],
	purple:[128,0,128],
	violet:[128,0,128],
	red:[255,0,0],
	silver:[192,192,192],
	white:[255,255,255],
	yellow:[255,255,0],
	transparent: [255,255,255]
};

/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 *
 * Open source under the BSD License.
 *
 * Copyright 2008 George McGinley Smith
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list
 * of conditions and the following disclaimer in the documentation and/or other materials
 * provided with the distribution.
 *
 * Neither the name of the author nor the names of contributors may be used to endorse
 * or promote products derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
$.easing.jswing = $.easing.swing;

$.extend($.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert($.easing.default);
		return $.easing[$.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 *
 * Open source under the BSD License.
 *
 * Copyright 2001 Robert Penner
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list
 * of conditions and the following disclaimer in the documentation and/or other materials
 * provided with the distribution.
 *
 * Neither the name of the author nor the names of contributors may be used to endorse
 * or promote products derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

})(jQuery);
/*
 * jQuery UI Effects Blind 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Blind
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.blind = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
		var direction = o.options.direction || 'vertical'; // Default direction

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
		var ref = (direction == 'vertical') ? 'height' : 'width';
		var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
		if(mode == 'show') wrapper.css(ref, 0); // Shift

		// Animation
		var animation = {};
		animation[ref] = mode == 'show' ? distance : 0;

		// Animate
		wrapper.animate(animation, o.duration, o.options.easing, function() {
			if(mode == 'hide') el.hide(); // Hide
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(el[0], arguments); // Callback
			el.dequeue();
		});

	});

};

})(jQuery);
/*
 * jQuery UI Effects Bounce 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Bounce
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.bounce = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
		var direction = o.options.direction || 'up'; // Default direction
		var distance = o.options.distance || 20; // Default distance
		var times = o.options.times || 5; // Default # of times
		var speed = o.duration || 250; // Default speed per bounce
		if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		$.effects.createWrapper(el); // Create Wrapper
		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
		var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
		if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
		if (mode == 'hide') distance = distance / (times * 2);
		if (mode != 'hide') times--;

		// Animate
		if (mode == 'show') { // Show Bounce
			var animation = {opacity: 1};
			animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
			el.animate(animation, speed / 2, o.options.easing);
			distance = distance / 2;
			times--;
		};
		for (var i = 0; i < times; i++) { // Bounces
			var animation1 = {}, animation2 = {};
			animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
			animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
			el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
			distance = (mode == 'hide') ? distance * 2 : distance / 2;
		};
		if (mode == 'hide') { // Last Bounce
			var animation = {opacity: 0};
			animation[ref] = (motion == 'pos' ? '-=' : '+=')  + distance;
			el.animate(animation, speed / 2, o.options.easing, function(){
				el.hide(); // Hide
				$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
				if(o.callback) o.callback.apply(this, arguments); // Callback
			});
		} else {
			var animation1 = {}, animation2 = {};
			animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
			animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
			el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
				$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
				if(o.callback) o.callback.apply(this, arguments); // Callback
			});
		};
		el.queue('fx', function() { el.dequeue(); });
		el.dequeue();
	});

};

})(jQuery);
/*
 * jQuery UI Effects Clip 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Clip
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.clip = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left','height','width'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
		var direction = o.options.direction || 'vertical'; // Default direction

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
		var animate = el[0].tagName == 'IMG' ? wrapper : el;
		var ref = {
			size: (direction == 'vertical') ? 'height' : 'width',
			position: (direction == 'vertical') ? 'top' : 'left'
		};
		var distance = (direction == 'vertical') ? animate.height() : animate.width();
		if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift

		// Animation
		var animation = {};
		animation[ref.size] = mode == 'show' ? distance : 0;
		animation[ref.position] = mode == 'show' ? 0 : distance / 2;

		// Animate
		animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
			if(mode == 'hide') el.hide(); // Hide
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(el[0], arguments); // Callback
			el.dequeue();
		}});

	});

};

})(jQuery);
/*
 * jQuery UI Effects Drop 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Drop
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.drop = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left','opacity'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
		var direction = o.options.direction || 'left'; // Default Direction

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		$.effects.createWrapper(el); // Create Wrapper
		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
		var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
		if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift

		// Animation
		var animation = {opacity: mode == 'show' ? 1 : 0};
		animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;

		// Animate
		el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
			if(mode == 'hide') el.hide(); // Hide
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(this, arguments); // Callback
			el.dequeue();
		}});

	});

};

})(jQuery);
/*
 * jQuery UI Effects Explode 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Explode
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.explode = function(o) {

	return this.queue(function() {

	var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
	var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;

	o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
	var el = $(this).show().css('visibility', 'hidden');
	var offset = el.offset();

	//Substract the margins - not fixing the problem yet.
	offset.top -= parseInt(el.css("marginTop")) || 0;
	offset.left -= parseInt(el.css("marginLeft")) || 0;

	var width = el.outerWidth(true);
	var height = el.outerHeight(true);

	for(var i=0;i<rows;i++) { // =
		for(var j=0;j<cells;j++) { // ||
			el
				.clone()
				.appendTo('body')
				.wrap('<div></div>')
				.css({
					position: 'absolute',
					visibility: 'visible',
					left: -j*(width/cells),
					top: -i*(height/rows)
				})
				.parent()
				.addClass('ui-effects-explode')
				.css({
					position: 'absolute',
					overflow: 'hidden',
					width: width/cells,
					height: height/rows,
					left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
					top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
					opacity: o.options.mode == 'show' ? 0 : 1
				}).animate({
					left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
					top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
					opacity: o.options.mode == 'show' ? 1 : 0
				}, o.duration || 500);
		}
	}

	// Set a timeout, to call the callback approx. when the other animations have finished
	setTimeout(function() {

		o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
				if(o.callback) o.callback.apply(el[0]); // Callback
				el.dequeue();

				$('div.ui-effects-explode').remove();

	}, o.duration || 500);


	});

};

})(jQuery);
/*
 * jQuery UI Effects Fold 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Fold
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.fold = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
		var size = o.options.size || 15; // Default fold size
		var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
		var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
		var widthFirst = ((mode == 'show') != horizFirst);
		var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
		var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
		var percent = /([0-9]+)%/.exec(size);
		if(percent) size = parseInt(percent[1]) / 100 * distance[mode == 'hide' ? 0 : 1];
		if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift

		// Animation
		var animation1 = {}, animation2 = {};
		animation1[ref[0]] = mode == 'show' ? distance[0] : size;
		animation2[ref[1]] = mode == 'show' ? distance[1] : 0;

		// Animate
		wrapper.animate(animation1, duration, o.options.easing)
		.animate(animation2, duration, o.options.easing, function() {
			if(mode == 'hide') el.hide(); // Hide
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(el[0], arguments); // Callback
			el.dequeue();
		});

	});

};

})(jQuery);
/*
 * jQuery UI Effects Highlight 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Highlight
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.highlight = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
		var color = o.options.color || "#ffff99"; // Default highlight color
		var oldColor = el.css("backgroundColor");

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		el.css({backgroundImage: 'none', backgroundColor: color}); // Shift

		// Animation
		var animation = {backgroundColor: oldColor };
		if (mode == "hide") animation['opacity'] = 0;

		// Animate
		el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
			if(mode == "hide") el.hide();
			$.effects.restore(el, props);
		if (mode == "show" && $.browser.msie) this.style.removeAttribute('filter');
			if(o.callback) o.callback.apply(this, arguments);
			el.dequeue();
		}});

	});

};

})(jQuery);
/*
 * jQuery UI Effects Pulsate 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Pulsate
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.pulsate = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this);

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
		var times = o.options.times || 5; // Default # of times
		var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;

		// Adjust
		if (mode == 'hide') times--;
		if (el.is(':hidden')) { // Show fadeIn
			el.css('opacity', 0);
			el.show(); // Show
			el.animate({opacity: 1}, duration, o.options.easing);
			times = times-2;
		}

		// Animate
		for (var i = 0; i < times; i++) { // Pulsate
			el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing);
		};
		if (mode == 'hide') { // Last Pulse
			el.animate({opacity: 0}, duration, o.options.easing, function(){
				el.hide(); // Hide
				if(o.callback) o.callback.apply(this, arguments); // Callback
			});
		} else {
			el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing, function(){
				if(o.callback) o.callback.apply(this, arguments); // Callback
			});
		};
		el.queue('fx', function() { el.dequeue(); });
		el.dequeue();
	});

};

})(jQuery);
/*
 * jQuery UI Effects Scale 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Scale
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.puff = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this);

		// Set options
		var options = $.extend(true, {}, o.options);
		var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
		var percent = parseInt(o.options.percent) || 150; // Set default puff percent
		options.fade = true; // It's not a puff if it doesn't fade! :)
		var original = {height: el.height(), width: el.width()}; // Save original

		// Adjust
		var factor = percent / 100;
		el.from = (mode == 'hide') ? original : {height: original.height * factor, width: original.width * factor};

		// Animation
		options.from = el.from;
		options.percent = (mode == 'hide') ? percent : 100;
		options.mode = mode;

		// Animate
		el.effect('scale', options, o.duration, o.callback);
		el.dequeue();
	});

};

$.effects.scale = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this);

		// Set options
		var options = $.extend(true, {}, o.options);
		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
		var percent = parseInt(o.options.percent) || (parseInt(o.options.percent) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
		var direction = o.options.direction || 'both'; // Set default axis
		var origin = o.options.origin; // The origin of the scaling
		if (mode != 'effect') { // Set default origin and restore for show/hide
			options.origin = origin || ['middle','center'];
			options.restore = true;
		}
		var original = {height: el.height(), width: el.width()}; // Save original
		el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state

		// Adjust
		var factor = { // Set scaling factor
			y: direction != 'horizontal' ? (percent / 100) : 1,
			x: direction != 'vertical' ? (percent / 100) : 1
		};
		el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state

		if (o.options.fade) { // Fade option to support puff
			if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
			if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
		};

		// Animation
		options.from = el.from; options.to = el.to; options.mode = mode;

		// Animate
		el.effect('size', options, o.duration, o.callback);
		el.dequeue();
	});

};

$.effects.size = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left','width','height','overflow','opacity'];
		var props1 = ['position','top','left','overflow','opacity']; // Always restore
		var props2 = ['width','height','overflow']; // Copy for children
		var cProps = ['fontSize'];
		var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
		var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
		var restore = o.options.restore || false; // Default restore
		var scale = o.options.scale || 'both'; // Default scale mode
		var origin = o.options.origin; // The origin of the sizing
		var original = {height: el.height(), width: el.width()}; // Save original
		el.from = o.options.from || original; // Default from state
		el.to = o.options.to || original; // Default to state
		// Adjust
		if (origin) { // Calculate baseline shifts
			var baseline = $.effects.getBaseline(origin, original);
			el.from.top = (original.height - el.from.height) * baseline.y;
			el.from.left = (original.width - el.from.width) * baseline.x;
			el.to.top = (original.height - el.to.height) * baseline.y;
			el.to.left = (original.width - el.to.width) * baseline.x;
		};
		var factor = { // Set scaling factor
			from: {y: el.from.height / original.height, x: el.from.width / original.width},
			to: {y: el.to.height / original.height, x: el.to.width / original.width}
		};
		if (scale == 'box' || scale == 'both') { // Scale the css box
			if (factor.from.y != factor.to.y) { // Vertical props scaling
				props = props.concat(vProps);
				el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
				el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
			};
			if (factor.from.x != factor.to.x) { // Horizontal props scaling
				props = props.concat(hProps);
				el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
				el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
			};
		};
		if (scale == 'content' || scale == 'both') { // Scale the content
			if (factor.from.y != factor.to.y) { // Vertical props scaling
				props = props.concat(cProps);
				el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
				el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
			};
		};
		$.effects.save(el, restore ? props : props1); el.show(); // Save & Show
		$.effects.createWrapper(el); // Create Wrapper
		el.css('overflow','hidden').css(el.from); // Shift

		// Animate
		if (scale == 'content' || scale == 'both') { // Scale the children
			vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
			hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
			props2 = props.concat(vProps).concat(hProps); // Concat
			el.find("*[width]").each(function(){
				child = $(this);
				if (restore) $.effects.save(child, props2);
				var c_original = {height: child.height(), width: child.width()}; // Save original
				child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
				child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
				if (factor.from.y != factor.to.y) { // Vertical props scaling
					child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
					child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
				};
				if (factor.from.x != factor.to.x) { // Horizontal props scaling
					child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
					child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
				};
				child.css(child.from); // Shift children
				child.animate(child.to, o.duration, o.options.easing, function(){
					if (restore) $.effects.restore(child, props2); // Restore children
				}); // Animate children
			});
		};

		// Animate
		el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
			if(mode == 'hide') el.hide(); // Hide
			$.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(this, arguments); // Callback
			el.dequeue();
		}});

	});

};

})(jQuery);
/*
 * jQuery UI Effects Shake 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Shake
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.shake = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
		var direction = o.options.direction || 'left'; // Default direction
		var distance = o.options.distance || 20; // Default distance
		var times = o.options.times || 3; // Default # of times
		var speed = o.duration || o.options.duration || 140; // Default speed per shake

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		$.effects.createWrapper(el); // Create Wrapper
		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';

		// Animation
		var animation = {}, animation1 = {}, animation2 = {};
		animation[ref] = (motion == 'pos' ? '-=' : '+=')  + distance;
		animation1[ref] = (motion == 'pos' ? '+=' : '-=')  + distance * 2;
		animation2[ref] = (motion == 'pos' ? '-=' : '+=')  + distance * 2;

		// Animate
		el.animate(animation, speed, o.options.easing);
		for (var i = 1; i < times; i++) { // Shakes
			el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
		};
		el.animate(animation1, speed, o.options.easing).
		animate(animation, speed / 2, o.options.easing, function(){ // Last shake
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(this, arguments); // Callback
		});
		el.queue('fx', function() { el.dequeue(); });
		el.dequeue();
	});

};

})(jQuery);
/*
 * jQuery UI Effects Slide 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Slide
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.slide = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','left'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
		var direction = o.options.direction || 'left'; // Default Direction

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		$.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
		var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
		if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift

		// Animation
		var animation = {};
		animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;

		// Animate
		el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
			if(mode == 'hide') el.hide(); // Hide
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(this, arguments); // Callback
			el.dequeue();
		}});

	});

};

})(jQuery);
/*
 * jQuery UI Effects Transfer 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Transfer
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.transfer = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this);

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
		var target = $(o.options.to); // Find Target
		var position = el.offset();
		var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body);
		if(o.options.className) transfer.addClass(o.options.className);

		// Set target css
		transfer.addClass(o.options.className);
		transfer.css({
			top: position.top,
			left: position.left,
			height: el.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
			width: el.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')),
			position: 'absolute'
		});

		// Animation
		position = target.offset();
		animation = {
			top: position.top,
			left: position.left,
			height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
			width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth'))
		};

		// Animate
		transfer.animate(animation, o.duration, o.options.easing, function() {
			transfer.remove(); // Remove div
			if(o.callback) o.callback.apply(el[0], arguments); // Callback
			el.dequeue();
		});

	});

};

})(jQuery);
/*
 * jQuery UI Accordion 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Accordion
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.accordion", {

	_init: function() {

		var o = this.options, self = this;
		this.running = 0;

		if ( o.navigation ) {
			var current = this.element.find("a").filter(o.navigationFilter);
			if ( current.length ) {
				if ( current.filter(o.header).length ) {
					this.active = current;
				} else {
					this.active = current.parent().parent().prev();
					current.addClass("ui-accordion-content-active");
				}
			}
		}

		this.element.addClass("ui-accordion ui-widget ui-helper-reset");

		this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
			.bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
			.bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); });

		this.headers
			.next()
				.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");

		this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
		this.active.next().addClass('ui-accordion-content-active');

		//Append icon elements
		$("<span/>").addClass("ui-icon " + o.icons.header).prependTo(this.headers);
		this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);

		// IE7-/Win - Extra vertical space in lists fixed
		if ($.browser.msie) {
			this.element.find('a').css('zoom', '1');
		}

		this.resize();

		//ARIA
		this.element.attr('role','tablist');

		this.headers
			.attr('role','tab')
			.bind('keydown', function(event) { return self._keydown(event); })
			.next()
			.attr('role','tabpanel');

		this.headers
			.not(this.active || "")
			.attr('aria-expanded','false')
			.attr("tabIndex", "-1")
			.next()
			.hide();

		// make sure at least one header is in the tab order
		if (!this.active.length) {
			this.headers.eq(0).attr('tabIndex','0');
		} else {
			this.active
				.attr('aria-expanded','true')
				.attr('tabIndex', '0');
		}

		// only need links in taborder for Safari
		if (!$.browser.safari)
			this.headers.find('a').attr('tabIndex','-1');

		if (o.event) {
			this.element.bind((o.event) + ".accordion", function(event) { return self._clickHandler.call(self, event); });
		}

	},

	destroy: function() {

		this.element
			.removeClass("ui-accordion ui-widget ui-helper-reset")
			.removeAttr("role")
			.unbind('.accordion')
			.removeData('accordion');

		this.headers
			.unbind(".accordion")
			.removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
			.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");

		this.headers.find("a").removeAttr("tabindex");
		this.headers.children(".ui-icon").remove();
		this.headers.next().removeClass("ui-accordion-content ui-accordion-content-active");

	},

	_keydown: function(event) {

		var o = this.options, keyCode = $.ui.keyCode;

		if (o.disabled || event.altKey || event.ctrlKey)
			return;

		var length = this.headers.length;
		var currentIndex = this.headers.index(event.target);
		var toFocus = false;

		switch(event.keyCode) {
			case keyCode.RIGHT:
			case keyCode.DOWN:
				toFocus = this.headers[(currentIndex + 1) % length];
				break;
			case keyCode.LEFT:
			case keyCode.UP:
				toFocus = this.headers[(currentIndex - 1 + length) % length];
				break;
			case keyCode.SPACE:
			case keyCode.ENTER:
				return this._clickHandler({ target: event.target });
		}

		if (toFocus) {
			$(event.target).attr('tabIndex','-1');
			$(toFocus).attr('tabIndex','0');
			toFocus.focus();
			return false;
		}

		return true;

	},

	resize: function() {

		var o = this.options, maxHeight;

		if (o.fillSpace) {
			
			if($.browser.msie) { var defOverflow = this.element.parent().css('overflow'); this.element.parent().css('overflow', 'hidden'); }
			maxHeight = this.element.parent().height();
			if($.browser.msie) { this.element.parent().css('overflow', defOverflow); }
	
			this.headers.each(function() {
				maxHeight -= $(this).outerHeight();
			});

			var maxPadding = 0;
			this.headers.next().each(function() {
				maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
			}).height(maxHeight - maxPadding)
			.css('overflow', 'auto');

		} else if ( o.autoHeight ) {
			maxHeight = 0;
			this.headers.next().each(function() {
				maxHeight = Math.max(maxHeight, $(this).outerHeight());
			}).height(maxHeight);
		}

	},

	activate: function(index) {
		// call clickHandler with custom event
		this._clickHandler({ target: this._findActive(index)[0] });
	},

	_findActive: function(selector) {
		return selector
			? typeof selector == "number"
				? this.headers.filter(":eq(" + selector + ")")
				: this.headers.not(this.headers.not(selector))
			: selector === false
				? $([])
				: this.headers.filter(":eq(0)");
	},

	_clickHandler: function(event) {

		var o = this.options;
		if (o.disabled) return false;

		// called only when using activate(false) to close all parts programmatically
		if (!event.target && !o.alwaysOpen) {
			this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
				.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
			this.active.next().addClass('ui-accordion-content-active');
			var toHide = this.active.next(),
				data = {
					options: o,
					newHeader: $([]),
					oldHeader: o.active,
					newContent: $([]),
					oldContent: toHide
				},
				toShow = (this.active = $([]));
			this._toggle(toShow, toHide, data);
			return false;
		}

		// get the click target
		var clicked = $(event.target);

		// due to the event delegation model, we have to check if one
		// of the parent elements is our actual header, and find that
		// otherwise stick with the initial target
		clicked = $( clicked.parents(o.header)[0] || clicked );
		var clickedIsActive = clicked[0] == this.active[0];

		// if animations are still active, or the active header is the target, ignore click
		if (this.running || (o.alwaysOpen && clickedIsActive)) {
			return false;
		}
		if (!clicked.is(o.header)) {
			return;
		}

		// switch classes
		this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
			.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
		this.active.next().addClass('ui-accordion-content-active');
		if (!clickedIsActive) {
			clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
				.find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);
			clicked.next().addClass('ui-accordion-content-active');
		}

		// find elements to show and hide
		var toShow = clicked.next(),
			toHide = this.active.next(),
			data = {
				options: o,
				newHeader: clickedIsActive && !o.alwaysOpen ? $([]) : clicked,
				oldHeader: this.active,
				newContent: clickedIsActive && !o.alwaysOpen ? $([]) : toShow.find('> *'),
				oldContent: toHide.find('> *')
			},
			down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );

		this.active = clickedIsActive ? $([]) : clicked;
		this._toggle(toShow, toHide, data, clickedIsActive, down);

		return false;

	},

	_toggle: function(toShow, toHide, data, clickedIsActive, down) {

		var o = this.options, self = this;

		this.toShow = toShow;
		this.toHide = toHide;
		this.data = data;

		var complete = function() { if(!self) return; return self._completed.apply(self, arguments); };

		// trigger changestart event
		this._trigger("changestart", null, this.data);

		// count elements to animate
		this.running = toHide.size() === 0 ? toShow.size() : toHide.size();

		if (o.animated) {

			var animOptions = {};

			if ( !o.alwaysOpen && clickedIsActive ) {
				animOptions = {
					toShow: $([]),
					toHide: toHide,
					complete: complete,
					down: down,
					autoHeight: o.autoHeight || o.fillSpace
				};
			} else {
				animOptions = {
					toShow: toShow,
					toHide: toHide,
					complete: complete,
					down: down,
					autoHeight: o.autoHeight || o.fillSpace
				};
			}

			if (!o.proxied) {
				o.proxied = o.animated;
			}

			if (!o.proxiedDuration) {
				o.proxiedDuration = o.duration;
			}

			o.animated = $.isFunction(o.proxied) ?
				o.proxied(animOptions) : o.proxied;

			o.duration = $.isFunction(o.proxiedDuration) ?
				o.proxiedDuration(animOptions) : o.proxiedDuration;

			var animations = $.ui.accordion.animations,
				duration = o.duration,
				easing = o.animated;

			if (!animations[easing]) {
				animations[easing] = function(options) {
					this.slide(options, {
						easing: easing,
						duration: duration || 700
					});
				};
			}

			animations[easing](animOptions);

		} else {

			if (!o.alwaysOpen && clickedIsActive) {
				toShow.toggle();
			} else {
				toHide.hide();
				toShow.show();
			}

			complete(true);

		}

		toHide.prev().attr('aria-expanded','false').attr("tabIndex", "-1");
		toShow.prev().attr('aria-expanded','true').attr("tabIndex", "0").focus();

	},

	_completed: function(cancel) {

		var o = this.options;

		this.running = cancel ? 0 : --this.running;
		if (this.running) return;

		if (o.clearStyle) {
			this.toShow.add(this.toHide).css({
				height: "",
				overflow: ""
			});
		}

		this._trigger('change', null, this.data);
	}

});


$.extend($.ui.accordion, {
	version: "1.6rc6",
	defaults: {
		active: null,
		autoHeight: true,
		alwaysOpen: true,
		animated: 'slide',
		clearStyle: false,
		event: "click",
		fillSpace: false,
		header: "a",
		icons: {
			header: "ui-icon-triangle-1-e",
			headerSelected: "ui-icon-triangle-1-s"
		},
		navigation: false,
		navigationFilter: function() {
			return this.href.toLowerCase() == location.href.toLowerCase();
		}
	},
	animations: {
		slide: function(options, additions) {
			options = $.extend({
				easing: "swing",
				duration: 300
			}, options, additions);
			if ( !options.toHide.size() ) {
				options.toShow.animate({height: "show"}, options);
				return;
			}
			var hideHeight = options.toHide.height(),
				showHeight = options.toShow.height(),
				difference = showHeight / hideHeight,
				overflow = options.toShow.css('overflow'),
				showProps = {},
				hideProps = {},
				fxAttrs = [ "height", "paddingTop", "paddingBottom" ];
			$.each(fxAttrs, function(i, prop) {
				hideProps[prop] = 'hide';
				showProps[prop] = parseFloat(options.toShow.css(prop));
			});
			options.toShow.css({ height: 0, overflow: 'hidden' }).show();
			options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{
				step: function(now, settings) {
					// if the alwaysOpen option is set to false, we may not have
					// a content pane to show
					if (!options.toShow[0]) { return; }
					
					var percentDone = settings.start != settings.end
						? (settings.now - settings.start) / (settings.end - settings.start)
						: 0,
						current = percentDone * showProps[settings.prop];
					if ($.browser.msie || $.browser.opera) {
						current = Math.ceil(current);
					}
					options.toShow[0].style[settings.prop] = current + 'px';
				},
				duration: options.duration,
				easing: options.easing,
				complete: function() {
					if ( !options.autoHeight ) {
						options.toShow.css("height", "auto");
					}
					options.toShow.css({overflow: overflow});
					options.complete();
				}
			});
		},
		bounceslide: function(options) {
			this.slide(options, {
				easing: options.down ? "easeOutBounce" : "swing",
				duration: options.down ? 1000 : 200
			});
		},
		easeslide: function(options) {
			this.slide(options, {
				easing: "easeinout",
				duration: 700
			});
		}
	}
});

})(jQuery);
/*
 * jQuery UI Datepicker 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Datepicker
 *
 * Depends:
 *	ui.core.js
 */

(function($) { // hide the namespace

$.extend($.ui, { datepicker: { version: "1.6rc6" } });

var PROP_NAME = 'datepicker';

/* Date picker manager.
   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
   Settings for (groups of) date pickers are maintained in an instance object,
   allowing multiple different settings on the same page. */

function Datepicker() {
	this.debug = false; // Change this to true to start debugging
	this._curInst = null; // The current instance in use
	this._keyEvent = false; // If the last event was a key event
	this._disabledInputs = []; // List of date picker inputs that have been disabled
	this._datepickerShowing = false; // True if the popup picker is showing , false if not
	this._inDialog = false; // True if showing within a "dialog", false if not
	this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
	this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
	this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
	this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
	this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
	this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
	this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
	this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
	this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
	this.regional = []; // Available regional settings, indexed by language code
	this.regional[''] = { // Default regional settings
		closeText: 'Done', // Display text for close link
		prevText: 'Prev', // Display text for previous month link
		nextText: 'Next', // Display text for next month link
		currentText: 'Today', // Display text for current month link
		monthNames: ['January','February','March','April','May','June',
			'July','August','September','October','November','December'], // Names of months for drop-down and formatting
		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
		dateFormat: 'mm/dd/yy', // See format options on parseDate
		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
		isRTL: false // True if right-to-left language, false if left-to-right
	};
	this._defaults = { // Global defaults for all the date picker instances
		showOn: 'focus', // 'focus' for popup on focus,
			// 'button' for trigger button, or 'both' for either
		showAnim: 'show', // Name of jQuery animation for popup
		showOptions: {}, // Options for enhanced animations
		defaultDate: null, // Used when field is blank: actual date,
			// +/-number for offset from today, null for today
		appendText: '', // Display text following the input box, e.g. showing the format
		buttonText: '...', // Text for trigger button
		buttonImage: '', // URL for trigger button image
		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
		hideIfNoPrevNext: false, // True to hide next/previous month links
			// if not applicable, false to just disable them
		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
		gotoCurrent: false, // True if today link goes back to current selection instead
		changeMonth: false, // True if month can be selected directly, false if only prev/next
		changeYear: false, // True if year can be selected directly, false if only prev/next
		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
		yearRange: '-10:+10', // Range of years to display in drop-down,
			// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
		showOtherMonths: false, // True to show dates in other months, false to leave blank
		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
			// takes a Date and returns the number of the week for it
		shortYearCutoff: '+10', // Short year values < this are in the current century,
			// > this are in the previous century,
			// string value starting with '+' for current year + value
		minDate: null, // The earliest selectable date, or null for no limit
		maxDate: null, // The latest selectable date, or null for no limit
		duration: 'normal', // Duration of display/closure
		beforeShowDay: null, // Function that takes a date and returns an array with
			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
		beforeShow: null, // Function that takes an input field and
			// returns a set of custom settings for the date picker
		onSelect: null, // Define a callback function when a date is selected
		onChangeMonthYear: null, // Define a callback function when the month or year is changed
		onClose: null, // Define a callback function when the datepicker is closed
		numberOfMonths: 1, // Number of months to show at a time
		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
		stepMonths: 1, // Number of months to step back/forward
		stepBigMonths: 12, // Number of months to step back/forward for the big links
		altField: '', // Selector for an alternate field to store selected dates into
		altFormat: '', // The date format to use for the alternate field
		constrainInput: true, // The input is constrained by the current date format
		showButtonPanel: false // True to show button panel, false to not show it
	};
	$.extend(this._defaults, this.regional['']);
	this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
}

$.extend(Datepicker.prototype, {
	/* Class name added to elements to indicate already configured with a date picker. */
	markerClassName: 'hasDatepicker',

	/* Debug logging (if enabled). */
	log: function () {
		if (this.debug)
			console.log.apply('', arguments);
	},

	/* Override the default settings for all instances of the date picker.
	   @param  settings  object - the new settings to use as defaults (anonymous object)
	   @return the manager object */
	setDefaults: function(settings) {
		extendRemove(this._defaults, settings || {});
		return this;
	},

	/* Attach the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span
	   @param  settings  object - the new settings to use for this date picker instance (anonymous) */
	_attachDatepicker: function(target, settings) {
		// check for settings on the control itself - in namespace 'date:'
		var inlineSettings = null;
		for (var attrName in this._defaults) {
			var attrValue = target.getAttribute('date:' + attrName);
			if (attrValue) {
				inlineSettings = inlineSettings || {};
				try {
					inlineSettings[attrName] = eval(attrValue);
				} catch (err) {
					inlineSettings[attrName] = attrValue;
				}
			}
		}
		var nodeName = target.nodeName.toLowerCase();
		var inline = (nodeName == 'div' || nodeName == 'span');
		if (!target.id)
			target.id = 'dp' + (++this.uuid);
		var inst = this._newInst($(target), inline);
		inst.settings = $.extend({}, settings || {}, inlineSettings || {});
		if (nodeName == 'input') {
			this._connectDatepicker(target, inst);
		} else if (inline) {
			this._inlineDatepicker(target, inst);
		}
	},

	/* Create a new instance object. */
	_newInst: function(target, inline) {
		var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); // escape jQuery meta chars
		return {id: id, input: target, // associated target
			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
			drawMonth: 0, drawYear: 0, // month being drawn
			inline: inline, // is datepicker inline or not
			dpDiv: (!inline ? this.dpDiv : // presentation div
			$('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))};
	},

	/* Attach the date picker to an input field. */
	_connectDatepicker: function(target, inst) {
		var input = $(target);
		if (input.hasClass(this.markerClassName))
			return;
		var appendText = this._get(inst, 'appendText');
		var isRTL = this._get(inst, 'isRTL');
		if (appendText)
			input[isRTL ? 'before' : 'after']('<span class="' + this._appendClass + '">' + appendText + '</span>');
		var showOn = this._get(inst, 'showOn');
		if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
			input.focus(this._showDatepicker);
		if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
			var buttonText = this._get(inst, 'buttonText');
			var buttonImage = this._get(inst, 'buttonImage');
			var trigger = $(this._get(inst, 'buttonImageOnly') ?
				$('<img/>').addClass(this._triggerClass).
					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
				$('<button type="button"></button>').addClass(this._triggerClass).
					html(buttonImage == '' ? buttonText : $('<img/>').attr(
					{ src:buttonImage, alt:buttonText, title:buttonText })));
			input[isRTL ? 'before' : 'after'](trigger);
			trigger.click(function() {
				if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
					$.datepicker._hideDatepicker();
				else
					$.datepicker._showDatepicker(target);
				return false;
			});
		}
		input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).
			bind("setData.datepicker", function(event, key, value) {
				inst.settings[key] = value;
			}).bind("getData.datepicker", function(event, key) {
				return this._get(inst, key);
			});
		$.data(target, PROP_NAME, inst);
	},

	/* Attach an inline date picker to a div. */
	_inlineDatepicker: function(target, inst) {
		var divSpan = $(target);
		if (divSpan.hasClass(this.markerClassName))
			return;
		divSpan.addClass(this.markerClassName).append(inst.dpDiv).
			bind("setData.datepicker", function(event, key, value){
				inst.settings[key] = value;
			}).bind("getData.datepicker", function(event, key){
				return this._get(inst, key);
			});
		$.data(target, PROP_NAME, inst);
		this._setDate(inst, this._getDefaultDate(inst));
		this._updateDatepicker(inst);
		this._updateAlternate(inst);
	},

	/* Pop-up the date picker in a "dialog" box.
	   @param  input     element - ignored
	   @param  dateText  string - the initial date to display (in the current format)
	   @param  onSelect  function - the function(dateText) to call when a date is selected
	   @param  settings  object - update the dialog date picker instance's settings (anonymous object)
	   @param  pos       int[2] - coordinates for the dialog's position within the screen or
	                     event - with x/y coordinates or
	                     leave empty for default (screen centre)
	   @return the manager object */
	_dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
		var inst = this._dialogInst; // internal instance
		if (!inst) {
			var id = 'dp' + (++this.uuid);
			this._dialogInput = $('<input type="text" id="' + id +
				'" size="1" style="position: absolute; top: -100px;"/>');
			this._dialogInput.keydown(this._doKeyDown);
			$('body').append(this._dialogInput);
			inst = this._dialogInst = this._newInst(this._dialogInput, false);
			inst.settings = {};
			$.data(this._dialogInput[0], PROP_NAME, inst);
		}
		extendRemove(inst.settings, settings || {});
		this._dialogInput.val(dateText);

		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
		if (!this._pos) {
			var browserWidth = window.innerWidth || document.documentElement.clientWidth ||	document.body.clientWidth;
			var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
			var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
			var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
			this._pos = // should use actual width/height below
				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
		}

		// move input on screen for focus, but hidden behind dialog
		this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
		inst.settings.onSelect = onSelect;
		this._inDialog = true;
		this.dpDiv.addClass(this._dialogClass);
		this._showDatepicker(this._dialogInput[0]);
		if ($.blockUI)
			$.blockUI(this.dpDiv);
		$.data(this._dialogInput[0], PROP_NAME, inst);
		return this;
	},

	/* Detach a datepicker from its control.
	   @param  target    element - the target input field or division or span */
	_destroyDatepicker: function(target) {
		var $target = $(target);
		if (!$target.hasClass(this.markerClassName)) {
			return;
		}
		var nodeName = target.nodeName.toLowerCase();
		$.removeData(target, PROP_NAME);
		if (nodeName == 'input') {
			$target.siblings('.' + this._appendClass).remove().end().
				siblings('.' + this._triggerClass).remove().end().
				removeClass(this.markerClassName).
				unbind('focus', this._showDatepicker).
				unbind('keydown', this._doKeyDown).
				unbind('keypress', this._doKeyPress);
		} else if (nodeName == 'div' || nodeName == 'span')
			$target.removeClass(this.markerClassName).empty();
	},

	/* Enable the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span */
	_enableDatepicker: function(target) {
		var $target = $(target);
		if (!$target.hasClass(this.markerClassName)) {
			return;
		}
		var nodeName = target.nodeName.toLowerCase();
		if (nodeName == 'input') {
		target.disabled = false;
			$target.siblings('button.' + this._triggerClass).
			each(function() { this.disabled = false; }).end().
				siblings('img.' + this._triggerClass).
				css({opacity: '1.0', cursor: ''});
		}
		else if (nodeName == 'div' || nodeName == 'span') {
			var inline = $target.children('.' + this._inlineClass);
			inline.children().removeClass('ui-state-disabled');
		}
		this._disabledInputs = $.map(this._disabledInputs,
			function(value) { return (value == target ? null : value); }); // delete entry
	},

	/* Disable the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span */
	_disableDatepicker: function(target) {
		var $target = $(target);
		if (!$target.hasClass(this.markerClassName)) {
			return;
		}
		var nodeName = target.nodeName.toLowerCase();
		if (nodeName == 'input') {
		target.disabled = true;
			$target.siblings('button.' + this._triggerClass).
			each(function() { this.disabled = true; }).end().
				siblings('img.' + this._triggerClass).
				css({opacity: '0.5', cursor: 'default'});
		}
		else if (nodeName == 'div' || nodeName == 'span') {
			var inline = $target.children('.' + this._inlineClass);
			inline.children().addClass('ui-state-disabled');
		}
		this._disabledInputs = $.map(this._disabledInputs,
			function(value) { return (value == target ? null : value); }); // delete entry
		this._disabledInputs[this._disabledInputs.length] = target;
	},

	/* Is the first field in a jQuery collection disabled as a datepicker?
	   @param  target    element - the target input field or division or span
	   @return boolean - true if disabled, false if enabled */
	_isDisabledDatepicker: function(target) {
		if (!target) {
			return false;
		}
		for (var i = 0; i < this._disabledInputs.length; i++) {
			if (this._disabledInputs[i] == target)
				return true;
		}
		return false;
	},

	/* Retrieve the instance data for the target control.
	   @param  target  element - the target input field or division or span
	   @return  object - the associated instance data
	   @throws  error if a jQuery problem getting data */
	_getInst: function(target) {
		try {
			return $.data(target, PROP_NAME);
		}
		catch (err) {
			throw 'Missing instance data for this datepicker';
		}
	},

	/* Update the settings for a date picker attached to an input field or division.
	   @param  target  element - the target input field or division or span
	   @param  name    object - the new settings to update or
	                   string - the name of the setting to change or
	   @param  value   any - the new value for the setting (omit if above is an object) */
	_optionDatepicker: function(target, name, value) {
		var settings = name || {};
		if (typeof name == 'string') {
			settings = {};
			settings[name] = value;
		}
		var inst = this._getInst(target);
		if (inst) {
			if (this._curInst == inst) {
				this._hideDatepicker(null);
			}
			extendRemove(inst.settings, settings);
			var date = new Date();
			extendRemove(inst, {rangeStart: null, // start of range
				endDay: null, endMonth: null, endYear: null, // end of range
				selectedDay: date.getDate(), selectedMonth: date.getMonth(),
				selectedYear: date.getFullYear(), // starting point
				currentDay: date.getDate(), currentMonth: date.getMonth(),
				currentYear: date.getFullYear(), // current selection
				drawMonth: date.getMonth(), drawYear: date.getFullYear()}); // month being drawn
			this._updateDatepicker(inst);
		}
	},

	// change method deprecated
	_changeDatepicker: function(target, name, value) {
		this._optionDatepicker(target, name, value);
	},

	/* Redraw the date picker attached to an input field or division.
	   @param  target  element - the target input field or division or span */
	_refreshDatepicker: function(target) {
		var inst = this._getInst(target);
		if (inst) {
			this._updateDatepicker(inst);
		}
	},

	/* Set the dates for a jQuery selection.
	   @param  target   element - the target input field or division or span
	   @param  date     Date - the new date
	   @param  endDate  Date - the new end date for a range (optional) */
	_setDateDatepicker: function(target, date, endDate) {
		var inst = this._getInst(target);
		if (inst) {
			this._setDate(inst, date, endDate);
			this._updateDatepicker(inst);
			this._updateAlternate(inst);
		}
	},

	/* Get the date(s) for the first entry in a jQuery selection.
	   @param  target  element - the target input field or division or span
	   @return Date - the current date or
	           Date[2] - the current dates for a range */
	_getDateDatepicker: function(target) {
		var inst = this._getInst(target);
		if (inst && !inst.inline)
			this._setDateFromField(inst);
		return (inst ? this._getDate(inst) : null);
	},

	/* Handle keystrokes. */
	_doKeyDown: function(event) {
		var inst = $.datepicker._getInst(event.target);
		var handled = true;
		var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
		inst._keyEvent = true;
		if ($.datepicker._datepickerShowing)
			switch (event.keyCode) {
				case 9:  $.datepicker._hideDatepicker(null, '');
						break; // hide on tab out
				case 13: var sel = $('td.' + $.datepicker._dayOverClass +
							', td.' + $.datepicker._currentClass, inst.dpDiv);
						if (sel[0])
							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
						else
							$.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
						return false; // don't submit the form
						break; // select the value on enter
				case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
						break; // hide on escape
				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
							-$.datepicker._get(inst, 'stepBigMonths') :
							-$.datepicker._get(inst, 'stepMonths')), 'M');
						break; // previous month/year on page up/+ ctrl
				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
							+$.datepicker._get(inst, 'stepBigMonths') :
							+$.datepicker._get(inst, 'stepMonths')), 'M');
						break; // next month/year on page down/+ ctrl
				case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
						handled = event.ctrlKey || event.metaKey;
						break; // clear on ctrl or command +end
				case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
						handled = event.ctrlKey || event.metaKey;
						break; // current on ctrl or command +home
				case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
						handled = event.ctrlKey || event.metaKey;
						// -1 day on ctrl or command +left
						if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
									-$.datepicker._get(inst, 'stepBigMonths') :
									-$.datepicker._get(inst, 'stepMonths')), 'M');
						// next month/year on alt +left on Mac
						break;
				case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
						handled = event.ctrlKey || event.metaKey;
						break; // -1 week on ctrl or command +up
				case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
						handled = event.ctrlKey || event.metaKey;
						// +1 day on ctrl or command +right
						if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
									+$.datepicker._get(inst, 'stepBigMonths') :
									+$.datepicker._get(inst, 'stepMonths')), 'M');
						// next month/year on alt +right
						break;
				case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
						handled = event.ctrlKey || event.metaKey;
						break; // +1 week on ctrl or command +down
				default: handled = false;
			}
		else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
			$.datepicker._showDatepicker(this);
		else {
			handled = false;
		}
		if (handled) {
			event.preventDefault();
			event.stopPropagation();
		}
	},

	/* Filter entered characters - based on date format. */
	_doKeyPress: function(event) {
		var inst = $.datepicker._getInst(event.target);
		if ($.datepicker._get(inst, 'constrainInput')) {
			var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
			var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
			return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
		}
	},

	/* Pop-up the date picker for a given input field.
	   @param  input  element - the input field attached to the date picker or
	                  event - if triggered by focus */
	_showDatepicker: function(input) {
		input = input.target || input;
		if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
			input = $('input', input.parentNode)[0];
		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
			return;
		var inst = $.datepicker._getInst(input);
		var beforeShow = $.datepicker._get(inst, 'beforeShow');
		extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
		$.datepicker._hideDatepicker(null, '');
		$.datepicker._lastInput = input;
		$.datepicker._setDateFromField(inst);
		if ($.datepicker._inDialog) // hide cursor
			input.value = '';
		if (!$.datepicker._pos) { // position below input
			$.datepicker._pos = $.datepicker._findPos(input);
			$.datepicker._pos[1] += input.offsetHeight; // add the height
		}
		var isFixed = false;
		$(input).parents().each(function() {
			isFixed |= $(this).css('position') == 'fixed';
			return !isFixed;
		});
		if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
			$.datepicker._pos[0] -= document.documentElement.scrollLeft;
			$.datepicker._pos[1] -= document.documentElement.scrollTop;
		}
		var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
		$.datepicker._pos = null;
		inst.rangeStart = null;
		// determine sizing offscreen
		inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
		$.datepicker._updateDatepicker(inst);
		// fix width for dynamic number of date pickers
		// and adjust position before showing
		offset = $.datepicker._checkOffset(inst, offset, isFixed);
		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
			'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
			left: offset.left + 'px', top: offset.top + 'px'});
		if (!inst.inline) {
			var showAnim = $.datepicker._get(inst, 'showAnim') || 'show';
			var duration = $.datepicker._get(inst, 'duration');
			var postProcess = function() {
				$.datepicker._datepickerShowing = true;
				if ($.browser.msie && parseInt($.browser.version,10) < 7) // fix IE < 7 select problems
					$('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4,
						height: inst.dpDiv.height() + 4});
			};
			if ($.effects && $.effects[showAnim])
				inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
			else
				inst.dpDiv[showAnim](duration, postProcess);
			if (duration == '')
				postProcess();
			if (inst.input[0].type != 'hidden')
				inst.input[0].focus();
			$.datepicker._curInst = inst;
		}
	},

	/* Generate the date picker content. */
	_updateDatepicker: function(inst) {
		var dims = {width: inst.dpDiv.width() + 4,
			height: inst.dpDiv.height() + 4};
		var self = this;
		inst.dpDiv.empty().append(this._generateHTML(inst))
			.find('iframe.ui-datepicker-cover').
				css({width: dims.width, height: dims.height})
			.end()
			.find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
				.bind('mouseout', function(){
					$(this).removeClass('ui-state-hover');
					if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover');
					if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover');
				})
				.bind('mouseover', function(){
					if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) {
						$(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
						$(this).addClass('ui-state-hover');
						if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover');
						if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover');
					}
				})
			.end()
			.find('.' + this._dayOverClass + ' a')
				.trigger('mouseover')
			.end();
		var numMonths = this._getNumberOfMonths(inst);
		var cols = numMonths[1];
		var width = 17;
		if (cols > 1) {
			inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
		} else {
			inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
		}
		inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
			'Class']('ui-datepicker-multi');
		inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
			'Class']('ui-datepicker-rtl');
		if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst)
			$(inst.input[0]).focus();
	},

	/* Check positioning to remain on screen. */
	_checkOffset: function(inst, offset, isFixed) {
		var dpWidth = inst.dpDiv.outerWidth();
		var dpHeight = inst.dpDiv.outerHeight();
		var inputWidth = inst.input ? inst.input.outerWidth() : 0;
		var inputHeight = inst.input ? inst.input.outerHeight() : 0;
		var viewWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) + $(document).scrollLeft();
		var viewHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) + $(document).scrollTop();

		offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
		offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
		offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;

		// now check if datepicker is showing outside window viewport - move to a better place if so.
		offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0;
		offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(offset.top + dpHeight + inputHeight*2 - viewHeight) : 0;

		return offset;
	},

	/* Find an object's position on the screen. */
	_findPos: function(obj) {
        while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
            obj = obj.nextSibling;
        }
        var position = $(obj).offset();
	    return [position.left, position.top];
	},

	/* Hide the date picker from view.
	   @param  input  element - the input field attached to the date picker
	   @param  duration  string - the duration over which to close the date picker */
	_hideDatepicker: function(input, duration) {
		var inst = this._curInst;
		if (!inst || (input && inst != $.data(input, PROP_NAME)))
			return;
		if (inst.stayOpen)
			this._selectDate('#' + inst.id, this._formatDate(inst,
				inst.currentDay, inst.currentMonth, inst.currentYear));
		inst.stayOpen = false;
		if (this._datepickerShowing) {
			duration = (duration != null ? duration : this._get(inst, 'duration'));
			var showAnim = this._get(inst, 'showAnim');
			var postProcess = function() {
				$.datepicker._tidyDialog(inst);
			};
			if (duration != '' && $.effects && $.effects[showAnim])
				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'),
					duration, postProcess);
			else
				inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' :
					(showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess);
			if (duration == '')
				this._tidyDialog(inst);
			var onClose = this._get(inst, 'onClose');
			if (onClose)
				onClose.apply((inst.input ? inst.input[0] : null),
					[(inst.input ? inst.input.val() : ''), inst]);  // trigger custom callback
			this._datepickerShowing = false;
			this._lastInput = null;
			if (this._inDialog) {
				this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
				if ($.blockUI) {
					$.unblockUI();
					$('body').append(this.dpDiv);
				}
			}
			this._inDialog = false;
		}
		this._curInst = null;
	},

	/* Tidy up after a dialog display. */
	_tidyDialog: function(inst) {
		inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');
	},

	/* Close date picker if clicked elsewhere. */
	_checkExternalClick: function(event) {
		if (!$.datepicker._curInst)
			return;
		var $target = $(event.target);
		if (($target.parents('#' + $.datepicker._mainDivId).length == 0) &&
				!$target.hasClass($.datepicker.markerClassName) &&
				!$target.hasClass($.datepicker._triggerClass) &&
				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))
			$.datepicker._hideDatepicker(null, '');
	},

	/* Adjust one of the date sub-fields. */
	_adjustDate: function(id, offset, period) {
		var target = $(id);
		var inst = this._getInst(target[0]);
		if (this._isDisabledDatepicker(target[0])) {
			return;
		}
		this._adjustInstDate(inst, offset +
			(period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning
			period);
		this._updateDatepicker(inst);
	},

	/* Action for current link. */
	_gotoToday: function(id) {
		var target = $(id);
		var inst = this._getInst(target[0]);
		if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
			inst.selectedDay = inst.currentDay;
			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
			inst.drawYear = inst.selectedYear = inst.currentYear;
		}
		else {
		var date = new Date();
		inst.selectedDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = date.getFullYear();
		}
		this._notifyChange(inst);
		this._adjustDate(target);
	},

	/* Action for selecting a new month/year. */
	_selectMonthYear: function(id, select, period) {
		var target = $(id);
		var inst = this._getInst(target[0]);
		inst._selectingMonthYear = false;
		inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
		inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
			parseInt(select.options[select.selectedIndex].value,10);
		this._notifyChange(inst);
		this._adjustDate(target);
	},

	/* Restore input focus after not changing month/year. */
	_clickMonthYear: function(id) {
		var target = $(id);
		var inst = this._getInst(target[0]);
		if (inst.input && inst._selectingMonthYear && !$.browser.msie)
			inst.input[0].focus();
		inst._selectingMonthYear = !inst._selectingMonthYear;
	},

	/* Action for selecting a day. */
	_selectDay: function(id, month, year, td) {
		var target = $(id);
		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
			return;
		}
		var inst = this._getInst(target[0]);
		inst.selectedDay = inst.currentDay = $('a', td).html();
		inst.selectedMonth = inst.currentMonth = month;
		inst.selectedYear = inst.currentYear = year;
		if (inst.stayOpen) {
			inst.endDay = inst.endMonth = inst.endYear = null;
		}
		this._selectDate(id, this._formatDate(inst,
			inst.currentDay, inst.currentMonth, inst.currentYear));
		if (inst.stayOpen) {
			inst.rangeStart = this._daylightSavingAdjust(
				new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
			this._updateDatepicker(inst);
		}
	},

	/* Erase the input field and hide the date picker. */
	_clearDate: function(id) {
		var target = $(id);
		var inst = this._getInst(target[0]);
		inst.stayOpen = false;
		inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null;
		this._selectDate(target, '');
	},

	/* Update the input field with the selected date. */
	_selectDate: function(id, dateStr) {
		var target = $(id);
		var inst = this._getInst(target[0]);
		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
		if (inst.input)
			inst.input.val(dateStr);
		this._updateAlternate(inst);
		var onSelect = this._get(inst, 'onSelect');
		if (onSelect)
			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
		else if (inst.input)
			inst.input.trigger('change'); // fire the change event
		if (inst.inline)
			this._updateDatepicker(inst);
		else if (!inst.stayOpen) {
			this._hideDatepicker(null, this._get(inst, 'duration'));
			this._lastInput = inst.input[0];
			if (typeof(inst.input[0]) != 'object')
				inst.input[0].focus(); // restore focus
			this._lastInput = null;
		}
	},

	/* Update any alternate field to synchronise with the main field. */
	_updateAlternate: function(inst) {
		var altField = this._get(inst, 'altField');
		if (altField) { // update alternate field too
			var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
			var date = this._getDate(inst);
			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
			$(altField).each(function() { $(this).val(dateStr); });
		}
	},

	/* Set as beforeShowDay function to prevent selection of weekends.
	   @param  date  Date - the date to customise
	   @return [boolean, string] - is this date selectable?, what is its CSS class? */
	noWeekends: function(date) {
		var day = date.getDay();
		return [(day > 0 && day < 6), ''];
	},

	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
	   @param  date  Date - the date to get the week for
	   @return  number - the number of the week within the year that contains this date */
	iso8601Week: function(date) {
		var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
		var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
		var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
		firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
		if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
			checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
			return $.datepicker.iso8601Week(checkDate);
		} else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
			firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
			if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
				return 1;
			}
		}
		return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
	},

	/* Parse a string value into a date object.
	   See formatDate below for the possible formats.

	   @param  format    string - the expected format of the date
	   @param  value     string - the date in the above format
	   @param  settings  Object - attributes include:
	                     shortYearCutoff  number - the cutoff year for determining the century (optional)
	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
	                     dayNames         string[7] - names of the days from Sunday (optional)
	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
	                     monthNames       string[12] - names of the months (optional)
	   @return  Date - the extracted date value or null if value is blank */
	parseDate: function (format, value, settings) {
		if (format == null || value == null)
			throw 'Invalid arguments';
		value = (typeof value == 'object' ? value.toString() : value + '');
		if (value == '')
			return null;
		var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
		var year = -1;
		var month = -1;
		var day = -1;
		var doy = -1;
		var literal = false;
		// Check whether a format character is doubled
		var lookAhead = function(match) {
			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
			if (matches)
				iFormat++;
			return matches;
		};
		// Extract a number from the string value
		var getNumber = function(match) {
			lookAhead(match);
			var origSize = (match == '@' ? 14 : (match == 'y' ? 4 : (match == 'o' ? 3 : 2)));
			var size = origSize;
			var num = 0;
			while (size > 0 && iValue < value.length &&
					value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
				num = num * 10 + parseInt(value.charAt(iValue++),10);
				size--;
			}
			if (size == origSize)
				throw 'Missing number at position ' + iValue;
			return num;
		};
		// Extract a name from the string value and convert to an index
		var getName = function(match, shortNames, longNames) {
			var names = (lookAhead(match) ? longNames : shortNames);
			var size = 0;
			for (var j = 0; j < names.length; j++)
				size = Math.max(size, names[j].length);
			var name = '';
			var iInit = iValue;
			while (size > 0 && iValue < value.length) {
				name += value.charAt(iValue++);
				for (var i = 0; i < names.length; i++)
					if (name == names[i])
						return i + 1;
				size--;
			}
			throw 'Unknown name at position ' + iInit;
		};
		// Confirm that a literal character matches the string value
		var checkLiteral = function() {
			if (value.charAt(iValue) != format.charAt(iFormat))
				throw 'Unexpected literal at position ' + iValue;
			iValue++;
		};
		var iValue = 0;
		for (var iFormat = 0; iFormat < format.length; iFormat++) {
			if (literal)
				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
					literal = false;
				else
					checkLiteral();
			else
				switch (format.charAt(iFormat)) {
					case 'd':
						day = getNumber('d');
						break;
					case 'D':
						getName('D', dayNamesShort, dayNames);
						break;
					case 'o':
						doy = getNumber('o');
						break;
					case 'm':
						month = getNumber('m');
						break;
					case 'M':
						month = getName('M', monthNamesShort, monthNames);
						break;
					case 'y':
						year = getNumber('y');
						break;
					case '@':
						var date = new Date(getNumber('@'));
						year = date.getFullYear();
						month = date.getMonth() + 1;
						day = date.getDate();
						break;
					case "'":
						if (lookAhead("'"))
							checkLiteral();
						else
							literal = true;
						break;
					default:
						checkLiteral();
				}
		}
		if (year == -1)
			year = new Date().getFullYear();
		else if (year < 100)
			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
				(year <= shortYearCutoff ? 0 : -100);
		if (doy > -1) {
			month = 1;
			day = doy;
			do {
				var dim = this._getDaysInMonth(year, month - 1);
				if (day <= dim)
					break;
				month++;
				day -= dim;
			} while (true);
		}
		var date = this._daylightSavingAdjust(new Date(year, month - 1, day));
		if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
			throw 'Invalid date'; // E.g. 31/02/*
		return date;
	},

	/* Standard date formats. */
	ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
	COOKIE: 'D, dd M yy',
	ISO_8601: 'yy-mm-dd',
	RFC_822: 'D, d M y',
	RFC_850: 'DD, dd-M-y',
	RFC_1036: 'D, d M y',
	RFC_1123: 'D, d M yy',
	RFC_2822: 'D, d M yy',
	RSS: 'D, d M y', // RFC 822
	TIMESTAMP: '@',
	W3C: 'yy-mm-dd', // ISO 8601

	/* Format a date object into a string value.
	   The format can be combinations of the following:
	   d  - day of month (no leading zero)
	   dd - day of month (two digit)
	   o  - day of year (no leading zeros)
	   oo - day of year (three digit)
	   D  - day name short
	   DD - day name long
	   m  - month of year (no leading zero)
	   mm - month of year (two digit)
	   M  - month name short
	   MM - month name long
	   y  - year (two digit)
	   yy - year (four digit)
	   @ - Unix timestamp (ms since 01/01/1970)
	   '...' - literal text
	   '' - single quote

	   @param  format    string - the desired format of the date
	   @param  date      Date - the date value to format
	   @param  settings  Object - attributes include:
	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
	                     dayNames         string[7] - names of the days from Sunday (optional)
	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
	                     monthNames       string[12] - names of the months (optional)
	   @return  string - the date in the above format */
	formatDate: function (format, date, settings) {
		if (!date)
			return '';
		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
		// Check whether a format character is doubled
		var lookAhead = function(match) {
			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
			if (matches)
				iFormat++;
			return matches;
		};
		// Format a number, with leading zero if necessary
		var formatNumber = function(match, value, len) {
			var num = '' + value;
			if (lookAhead(match))
				while (num.length < len)
					num = '0' + num;
			return num;
		};
		// Format a name, short or long as requested
		var formatName = function(match, value, shortNames, longNames) {
			return (lookAhead(match) ? longNames[value] : shortNames[value]);
		};
		var output = '';
		var literal = false;
		if (date)
			for (var iFormat = 0; iFormat < format.length; iFormat++) {
				if (literal)
					if (format.charAt(iFormat) == "'" && !lookAhead("'"))
						literal = false;
					else
						output += format.charAt(iFormat);
				else
					switch (format.charAt(iFormat)) {
						case 'd':
							output += formatNumber('d', date.getDate(), 2);
							break;
						case 'D':
							output += formatName('D', date.getDay(), dayNamesShort, dayNames);
							break;
						case 'o':
							var doy = date.getDate();
							for (var m = date.getMonth() - 1; m >= 0; m--)
								doy += this._getDaysInMonth(date.getFullYear(), m);
							output += formatNumber('o', doy, 3);
							break;
						case 'm':
							output += formatNumber('m', date.getMonth() + 1, 2);
							break;
						case 'M':
							output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
							break;
						case 'y':
							output += (lookAhead('y') ? date.getFullYear() :
								(date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
							break;
						case '@':
							output += date.getTime();
							break;
						case "'":
							if (lookAhead("'"))
								output += "'";
							else
								literal = true;
							break;
						default:
							output += format.charAt(iFormat);
					}
			}
		return output;
	},

	/* Extract all possible characters from the date format. */
	_possibleChars: function (format) {
		var chars = '';
		var literal = false;
		for (var iFormat = 0; iFormat < format.length; iFormat++)
			if (literal)
				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
					literal = false;
				else
					chars += format.charAt(iFormat);
			else
				switch (format.charAt(iFormat)) {
					case 'd': case 'm': case 'y': case '@':
						chars += '0123456789';
						break;
					case 'D': case 'M':
						return null; // Accept anything
					case "'":
						if (lookAhead("'"))
							chars += "'";
						else
							literal = true;
						break;
					default:
						chars += format.charAt(iFormat);
				}
		return chars;
	},

	/* Get a setting value, defaulting if necessary. */
	_get: function(inst, name) {
		return inst.settings[name] !== undefined ?
			inst.settings[name] : this._defaults[name];
	},

	/* Parse existing date and initialise date picker. */
	_setDateFromField: function(inst) {
		var dateFormat = this._get(inst, 'dateFormat');
		var dates = inst.input ? inst.input.val() : null;
		inst.endDay = inst.endMonth = inst.endYear = null;
		var date = defaultDate = this._getDefaultDate(inst);
		var settings = this._getFormatConfig(inst);
		try {
			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
		} catch (event) {
			this.log(event);
			date = defaultDate;
		}
		inst.selectedDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = date.getFullYear();
		inst.currentDay = (dates ? date.getDate() : 0);
		inst.currentMonth = (dates ? date.getMonth() : 0);
		inst.currentYear = (dates ? date.getFullYear() : 0);
		this._adjustInstDate(inst);
	},

	/* Retrieve the default date shown on opening. */
	_getDefaultDate: function(inst) {
		var date = this._determineDate(this._get(inst, 'defaultDate'), new Date());
		var minDate = this._getMinMaxDate(inst, 'min', true);
		var maxDate = this._getMinMaxDate(inst, 'max');
		date = (minDate && date < minDate ? minDate : date);
		date = (maxDate && date > maxDate ? maxDate : date);
		return date;
	},

	/* A date may be specified as an exact value or a relative one. */
	_determineDate: function(date, defaultDate) {
		var offsetNumeric = function(offset) {
			var date = new Date();
			date.setDate(date.getDate() + offset);
			return date;
		};
		var offsetString = function(offset, getDaysInMonth) {
			var date = new Date();
			var year = date.getFullYear();
			var month = date.getMonth();
			var day = date.getDate();
			var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
			var matches = pattern.exec(offset);
			while (matches) {
				switch (matches[2] || 'd') {
					case 'd' : case 'D' :
						day += parseInt(matches[1],10); break;
					case 'w' : case 'W' :
						day += parseInt(matches[1],10) * 7; break;
					case 'm' : case 'M' :
						month += parseInt(matches[1],10);
						day = Math.min(day, getDaysInMonth(year, month));
						break;
					case 'y': case 'Y' :
						year += parseInt(matches[1],10);
						day = Math.min(day, getDaysInMonth(year, month));
						break;
				}
				matches = pattern.exec(offset);
			}
			return new Date(year, month, day);
		};
		date = (date == null ? defaultDate :
			(typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
			(typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date)));
		date = (date && date.toString() == 'Invalid Date' ? defaultDate : date);
		if (date) {
			date.setHours(0);
			date.setMinutes(0);
			date.setSeconds(0);
			date.setMilliseconds(0);
		}
		return this._daylightSavingAdjust(date);
	},

	/* Handle switch to/from daylight saving.
	   Hours may be non-zero on daylight saving cut-over:
	   > 12 when midnight changeover, but then cannot generate
	   midnight datetime, so jump to 1AM, otherwise reset.
	   @param  date  (Date) the date to check
	   @return  (Date) the corrected date */
	_daylightSavingAdjust: function(date) {
		if (!date) return null;
		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
		return date;
	},

	/* Set the date(s) directly. */
	_setDate: function(inst, date, endDate) {
		var clear = !(date);
		var origMonth = inst.selectedMonth;
		var origYear = inst.selectedYear;
		date = this._determineDate(date, new Date());
		inst.selectedDay = inst.currentDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear();
		if (origMonth != inst.selectedMonth || origYear != inst.selectedYear)
			this._notifyChange(inst);
		this._adjustInstDate(inst);
		if (inst.input) {
			inst.input.val(clear ? '' : this._formatDate(inst));
		}
	},

	/* Retrieve the date(s) directly. */
	_getDate: function(inst) {
		var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
			this._daylightSavingAdjust(new Date(
			inst.currentYear, inst.currentMonth, inst.currentDay)));
			return startDate;
	},

	/* Generate the HTML for the current state of the date picker. */
	_generateHTML: function(inst) {
		var today = new Date();
		today = this._daylightSavingAdjust(
			new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
		var isRTL = this._get(inst, 'isRTL');
		var showButtonPanel = this._get(inst, 'showButtonPanel');
		var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
		var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
		var numMonths = this._getNumberOfMonths(inst);
		var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
		var stepMonths = this._get(inst, 'stepMonths');
		var stepBigMonths = this._get(inst, 'stepBigMonths');
		var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
		var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
			new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
		var minDate = this._getMinMaxDate(inst, 'min', true);
		var maxDate = this._getMinMaxDate(inst, 'max');
		var drawMonth = inst.drawMonth - showCurrentAtPos;
		var drawYear = inst.drawYear;
		if (drawMonth < 0) {
			drawMonth += 12;
			drawYear--;
		}
		if (maxDate) {
			var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
				maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate()));
			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
				drawMonth--;
				if (drawMonth < 0) {
					drawMonth = 11;
					drawYear--;
				}
			}
		}
		inst.drawMonth = drawMonth;
		inst.drawYear = drawYear;
		var prevText = this._get(inst, 'prevText');
		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
			this._getFormatConfig(inst)));
		var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
			'<a class="ui-datepicker-prev ui-corner-all" onclick="jQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
			' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
			(hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));
		var nextText = this._get(inst, 'nextText');
		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
			this._getFormatConfig(inst)));
		var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
			'<a class="ui-datepicker-next ui-corner-all" onclick="jQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
			' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
			(hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));
		var currentText = this._get(inst, 'currentText');
		var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
		currentText = (!navigationAsDateFormat ? currentText :
			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
		var controls = '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="jQuery.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>';
		var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
			(this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="jQuery.datepicker._gotoToday(\'#' + inst.id + '\');"' +
			'>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
		var firstDay = parseInt(this._get(inst, 'firstDay'),10);
		firstDay = (isNaN(firstDay) ? 0 : firstDay);
		var dayNames = this._get(inst, 'dayNames');
		var dayNamesShort = this._get(inst, 'dayNamesShort');
		var dayNamesMin = this._get(inst, 'dayNamesMin');
		var monthNames = this._get(inst, 'monthNames');
		var monthNamesShort = this._get(inst, 'monthNamesShort');
		var beforeShowDay = this._get(inst, 'beforeShowDay');
		var showOtherMonths = this._get(inst, 'showOtherMonths');
		var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
		var endDate = inst.endDay ? this._daylightSavingAdjust(
			new Date(inst.endYear, inst.endMonth, inst.endDay)) : currentDate;
		var defaultDate = this._getDefaultDate(inst);
		var html = '';
		for (var row = 0; row < numMonths[0]; row++) {
			var group = '';
			for (var col = 0; col < numMonths[1]; col++) {
				var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
				var cornerClass = ' ui-corner-all';
				var calender = '';
				if (isMultiMonth) {
					calender += '<div class="ui-datepicker-group ui-datepicker-group-';
					switch (col) {
						case 0: calender += 'first'; cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
						case numMonths[1]-1: calender += 'last'; cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
						default: calender += 'middle'; cornerClass = ''; break;
					}
					calender += '">';
				}
				calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
					(/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
					(/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
					selectedDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
					'</div><table class="ui-datepicker-calendar"><thead>' +
					'<tr>';
				var thead = '';
				for (var dow = 0; dow < 7; dow++) { // days of the week
					var day = (dow + firstDay) % 7;
					thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' +
						'<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';
				}
				calender += thead + '</tr></thead><tbody>';
				var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
				if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
				var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
				var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
				var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
				for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
					calender += '<tr>';
					var tbody = '';
					for (var dow = 0; dow < 7; dow++) { // create date picker days
						var daySettings = (beforeShowDay ?
							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
						var otherMonth = (printDate.getMonth() != drawMonth);
						var unselectable = otherMonth || !daySettings[0] ||
							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
						tbody += '<td class="' +
							((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
							(otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
							((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key
							(defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?
							// or defaultDate is current printedDate and defaultDate is selectedDate
							' ' + this._dayOverClass : '') + // highlight selected day
							(unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') +  // highlight unselectable days
							(otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
							(printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
							' ' + this._currentClass : '') + // highlight selected day
							(printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
							((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
							(unselectable ? '' : ' onclick="jQuery.datepicker._selectDay(\'#' +
							inst.id + '\',' + drawMonth + ',' + drawYear + ', this);return false;"') + '>' + // actions
							(otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
							(unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
							(printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
							(printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
							' ui-state-active' : '') + // highlight selected day
							'" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
						printDate.setDate(printDate.getDate() + 1);
						printDate = this._daylightSavingAdjust(printDate);
					}
					calender += tbody + '</tr>';
				}
				drawMonth++;
				if (drawMonth > 11) {
					drawMonth = 0;
					drawYear++;
				}
				calender += '</tbody></table>' + (isMultiMonth ? '</div>' : '');
				group += calender;
			}
			html += group;
		}
		html += (!inst.inline ? buttonPanel : '') +
			($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?
			'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
		inst._keyEvent = false;
		return html;
	},

	/* Generate the month and year header. */
	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
			selectedDate, secondary, monthNames, monthNamesShort) {
		minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
		var changeMonth = this._get(inst, 'changeMonth');
		var changeYear = this._get(inst, 'changeYear');
		var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
		var html = '<div class="ui-datepicker-title">';
		var monthHtml = '';
		// month selection
		if (secondary || !changeMonth)
			monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> ';
		else {
			var inMinYear = (minDate && minDate.getFullYear() == drawYear);
			var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
			monthHtml += '<select class="ui-datepicker-month" ' +
				'onchange="jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
				'onclick="jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
			 	'>';
			for (var month = 0; month < 12; month++) {
				if ((!inMinYear || month >= minDate.getMonth()) &&
						(!inMaxYear || month <= maxDate.getMonth()))
					monthHtml += '<option value="' + month + '"' +
						(month == drawMonth ? ' selected="selected"' : '') +
						'>' + monthNamesShort[month] + '</option>';
			}
			monthHtml += '</select>';
		}
		if (!showMonthAfterYear)
			html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? '&#xa0;' : '');
		// year selection
		if (secondary || !changeYear)
			html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
		else {
			// determine range of years to display
			var years = this._get(inst, 'yearRange').split(':');
			var year = 0;
			var endYear = 0;
			if (years.length != 2) {
				year = drawYear - 10;
				endYear = drawYear + 10;
			} else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
				year = drawYear + parseInt(years[0], 10);
				endYear = drawYear + parseInt(years[1], 10);
			} else {
				year = parseInt(years[0], 10);
				endYear = parseInt(years[1], 10);
			}
			year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
			endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
			html += '<select class="ui-datepicker-year" ' +
				'onchange="jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
				'onclick="jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
				'>';
			for (; year <= endYear; year++) {
				html += '<option value="' + year + '"' +
					(year == drawYear ? ' selected="selected"' : '') +
					'>' + year + '</option>';
			}
			html += '</select>';
		}
		if (showMonthAfterYear)
			html += (secondary || changeMonth || changeYear ? '&#xa0;' : '') + monthHtml;
		html += '</div>'; // Close datepicker_header
		return html;
	},

	/* Adjust one of the date sub-fields. */
	_adjustInstDate: function(inst, offset, period) {
		var year = inst.drawYear + (period == 'Y' ? offset : 0);
		var month = inst.drawMonth + (period == 'M' ? offset : 0);
		var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
			(period == 'D' ? offset : 0);
		var date = this._daylightSavingAdjust(new Date(year, month, day));
		// ensure it is within the bounds set
		var minDate = this._getMinMaxDate(inst, 'min', true);
		var maxDate = this._getMinMaxDate(inst, 'max');
		date = (minDate && date < minDate ? minDate : date);
		date = (maxDate && date > maxDate ? maxDate : date);
		inst.selectedDay = date.getDate();
		inst.drawMonth = inst.selectedMonth = date.getMonth();
		inst.drawYear = inst.selectedYear = date.getFullYear();
		if (period == 'M' || period == 'Y')
			this._notifyChange(inst);
	},

	/* Notify change of month/year. */
	_notifyChange: function(inst) {
		var onChange = this._get(inst, 'onChangeMonthYear');
		if (onChange)
			onChange.apply((inst.input ? inst.input[0] : null),
				[inst.selectedYear, inst.selectedMonth + 1, inst]);
	},

	/* Determine the number of months to show. */
	_getNumberOfMonths: function(inst) {
		var numMonths = this._get(inst, 'numberOfMonths');
		return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
	},

	/* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
	_getMinMaxDate: function(inst, minMax, checkRange) {
		var date = this._determineDate(this._get(inst, minMax + 'Date'), null);
		return (!checkRange || !inst.rangeStart ? date :
			(!date || inst.rangeStart > date ? inst.rangeStart : date));
	},

	/* Find the number of days in a given month. */
	_getDaysInMonth: function(year, month) {
		return 32 - new Date(year, month, 32).getDate();
	},

	/* Find the day of the week of the first of a month. */
	_getFirstDayOfMonth: function(year, month) {
		return new Date(year, month, 1).getDay();
	},

	/* Determines if we should allow a "next/prev" month display change. */
	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
		var numMonths = this._getNumberOfMonths(inst);
		var date = this._daylightSavingAdjust(new Date(
			curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1));
		if (offset < 0)
			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
		return this._isInRange(inst, date);
	},

	/* Is the given date in the accepted range? */
	_isInRange: function(inst, date) {
		// during range selection, use minimum of selected date and range start
		var newMinDate = (!inst.rangeStart ? null : this._daylightSavingAdjust(
			new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)));
		newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate);
		var minDate = newMinDate || this._getMinMaxDate(inst, 'min');
		var maxDate = this._getMinMaxDate(inst, 'max');
		return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
	},

	/* Provide the configuration settings for formatting/parsing. */
	_getFormatConfig: function(inst) {
		var shortYearCutoff = this._get(inst, 'shortYearCutoff');
		shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
		return {shortYearCutoff: shortYearCutoff,
			dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
			monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
	},

	/* Format the given date for display. */
	_formatDate: function(inst, day, month, year) {
		if (!day) {
			inst.currentDay = inst.selectedDay;
			inst.currentMonth = inst.selectedMonth;
			inst.currentYear = inst.selectedYear;
		}
		var date = (day ? (typeof day == 'object' ? day :
			this._daylightSavingAdjust(new Date(year, month, day))) :
			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
		return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
	}
});

/* jQuery extend now ignores nulls! */
function extendRemove(target, props) {
	$.extend(target, props);
	for (var name in props)
		if (props[name] == null || props[name] == undefined)
			target[name] = props[name];
	return target;
};

/* Determine whether an object is an array. */
function isArray(a) {
	return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
		(a.constructor && a.constructor.toString().match(/\Array\(\)/))));
};

/* Invoke the datepicker functionality.
   @param  options  string - a command, optionally followed by additional parameters or
                    Object - settings for attaching new datepicker functionality
   @return  jQuery object */
$.fn.datepicker = function(options){

	/* Initialise the date picker. */
	if (!$.datepicker.initialized) {
		$(document).mousedown($.datepicker._checkExternalClick).
			find('body').append($.datepicker.dpDiv);
		$.datepicker.initialized = true;
	}

	var otherArgs = Array.prototype.slice.call(arguments, 1);
	if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate'))
		return $.datepicker['_' + options + 'Datepicker'].
			apply($.datepicker, [this[0]].concat(otherArgs));
	return this.each(function() {
		typeof options == 'string' ?
			$.datepicker['_' + options + 'Datepicker'].
				apply($.datepicker, [this].concat(otherArgs)) :
			$.datepicker._attachDatepicker(this, options);
	});
};

$.datepicker = new Datepicker(); // singleton instance
$.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime();
$.datepicker.version = "1.6rc6";

})(jQuery);
/*
 * jQuery UI Dialog 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Dialog
 *
 * Depends:
 *	ui.core.js
 *	ui.draggable.js
 *	ui.resizable.js
 */
(function($) {

var setDataSwitch = {
	dragStart: "start.draggable",
	drag: "drag.draggable",
	dragStop: "stop.draggable",
	maxHeight: "maxHeight.resizable",
	minHeight: "minHeight.resizable",
	maxWidth: "maxWidth.resizable",
	minWidth: "minWidth.resizable",
	resizeStart: "start.resizable",
	resize: "drag.resizable",
	resizeStop: "stop.resizable"
};

$.widget("ui.dialog", {

	_init: function() {
		this.originalTitle = this.element.attr('title');

		var self = this,
			options = this.options,

			title = options.title || this.originalTitle || '&nbsp;',
			titleId = $.ui.dialog.getTitleId(this.element),

			uiDialog = (this.uiDialog = $('<div/>'))
				.appendTo(document.body)
				.hide()
				.addClass(
					'ui-dialog ' +
					'ui-widget ' +
					'ui-widget-content ' +
					'ui-corner-all ' +
					options.dialogClass
				)
				.css({
					position: 'absolute',
					overflow: 'hidden',
					zIndex: options.zIndex
				})
				// setting tabIndex makes the div focusable
				// setting outline to 0 prevents a border on focus in Mozilla
				.attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
					(options.closeOnEscape && event.keyCode
						&& event.keyCode == $.ui.keyCode.ESCAPE && self.close(event));
				})
				.attr({
					role: 'dialog',
					'aria-labelledby': titleId
				})
				.mousedown(function(event) {
					self.moveToTop(event);
				}),

			uiDialogContent = this.element
				.show()
				.removeAttr('title')
				.addClass(
					'ui-dialog-content ' +
					'ui-widget-content')
				.appendTo(uiDialog),

			uiDialogTitlebar = (this.uiDialogTitlebar = $('<div></div>'))
				.addClass(
					'ui-dialog-titlebar ' +
					'ui-widget-header ' +
					'ui-corner-all ' +
					'ui-helper-clearfix'
				)
				.prependTo(uiDialog),

			uiDialogTitlebarClose = $('<a href="#"/>')
				.addClass(
					'ui-dialog-titlebar-close ' +
					'ui-corner-all'
				)
				.attr('role', 'button')
				.hover(
					function() {
						uiDialogTitlebarClose.addClass('ui-state-hover');
					},
					function() {
						uiDialogTitlebarClose.removeClass('ui-state-hover');
					}
				)
				.focus(function() {
					uiDialogTitlebarClose.addClass('ui-state-focus');
				})
				.blur(function() {
					uiDialogTitlebarClose.removeClass('ui-state-focus');
				})
				.mousedown(function(ev) {
					ev.stopPropagation();
				})
				.click(function(event) {
					self.close(event);
					return false;
				})
				.appendTo(uiDialogTitlebar),

			uiDialogTitlebarCloseText = (this.uiDialogTitlebarCloseText = $('<span/>'))
				.addClass(
					'ui-icon ' +
					'ui-icon-closethick'
				)
				.text(options.closeText)
				.appendTo(uiDialogTitlebarClose),

			uiDialogTitle = $('<span/>')
				.addClass('ui-dialog-title')
				.attr('id', titleId)
				.html(title)
				.prependTo(uiDialogTitlebar);

		uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();

		(options.draggable && $.fn.draggable && this._makeDraggable());
		(options.resizable && $.fn.resizable && this._makeResizable());

		this._createButtons(options.buttons);
		this._isOpen = false;

		(options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
		(options.autoOpen && this.open());
		
	},

	destroy: function() {
		(this.overlay && this.overlay.destroy());
		(this.shadow && this._destroyShadow());
		this.uiDialog.hide();
		this.element
			.unbind('.dialog')
			.removeData('dialog')
			.removeClass('ui-dialog-content ui-widget-content')
			.hide().appendTo('body');
		this.uiDialog.remove();

		(this.originalTitle && this.element.attr('title', this.originalTitle));
	},

	close: function(event) {
		if (false === this._trigger('beforeclose', event)) {
			return;
		}

		(this.overlay && this.overlay.destroy());
		(this.shadow && this._destroyShadow());
		this.uiDialog
			.hide(this.options.hide)
			.unbind('keypress.ui-dialog');

		this._trigger('close', event);
		$.ui.dialog.overlay.resize();

		this._isOpen = false;
	},

	isOpen: function() {
		return this._isOpen;
	},

	// the force parameter allows us to move modal dialogs to their correct
	// position on open
	moveToTop: function(force, event) {

		if ((this.options.modal && !force)
			|| (!this.options.stack && !this.options.modal)) {
			return this._trigger('focus', event);
		}

		var maxZ = this.options.zIndex, options = this.options;
		$('.ui-dialog:visible').each(function() {
			maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex);
		});
		(this.overlay && this.overlay.$el.css('z-index', ++maxZ));
		(this.shadow && this.shadow.css('z-index', ++maxZ));

		//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
		//  http://ui.jquery.com/bugs/ticket/3193
		var saveScroll = { scrollTop: this.element.attr('scrollTop'), scrollLeft: this.element.attr('scrollLeft') };
		this.uiDialog.css('z-index', ++maxZ);
		this.element.attr(saveScroll);
		this._trigger('focus', event);
	},

	open: function(event) {
		if (this._isOpen) { return; }

		var options = this.options,
			uiDialog = this.uiDialog;

		this.overlay = options.modal ? new $.ui.dialog.overlay(this) : null;
		(uiDialog.next().length && uiDialog.appendTo('body'));
		this._size();
		this._position(options.position);
		uiDialog.show(options.show);
		this.moveToTop(true, event);

		// prevent tabbing out of modal dialogs
		(options.modal && uiDialog.bind('keypress.ui-dialog', function(event) {
			if (event.keyCode != $.ui.keyCode.TAB) {
				return;
			}

			var tabbables = $(':tabbable', this),
				first = tabbables.filter(':first')[0],
				last  = tabbables.filter(':last')[0];

			if (event.target == last && !event.shiftKey) {
				setTimeout(function() {
					first.focus();
				}, 1);
			} else if (event.target == first && event.shiftKey) {
				setTimeout(function() {
					last.focus();
				}, 1);
			}
		}));

		// set focus to the first tabbable element in:
		// - content area
		// - button pane
		// - title bar
		$([])
			.add(uiDialog.find('.ui-dialog-content :tabbable:first'))
			.add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
			.add(uiDialog.find('.ui-dialog-titlebar :tabbable:first'))
			.filter(':first')
			.focus();

		if(options.shadow)
			this._createShadow();

		this._trigger('open', event);
		this._isOpen = true;
	},

	_createButtons: function(buttons) {
		var self = this,
			hasButtons = false,
			uiDialogButtonPane = $('<div></div>')
				.addClass(
					'ui-dialog-buttonpane ' +
					'ui-widget-content ' +
					'ui-helper-clearfix'
				);

		// if we already have a button pane, remove it
		this.uiDialog.find('.ui-dialog-buttonpane').remove();

		(typeof buttons == 'object' && buttons !== null &&
			$.each(buttons, function() { return !(hasButtons = true); }));
		if (hasButtons) {
			$.each(buttons, function(name, fn) {
				$('<button type="button"></button>')
					.addClass(
						'ui-state-default ' +
						'ui-corner-all'
					)
					.text(name)
					.click(function() { fn.apply(self.element[0], arguments); })
					.hover(
						function() {
							$(this).addClass('ui-state-hover');
						},
						function() {
							$(this).removeClass('ui-state-hover');
						}
					)
					.focus(function() {
						$(this).addClass('ui-state-focus');
					})
					.blur(function() {
						$(this).removeClass('ui-state-focus');
					})
					.appendTo(uiDialogButtonPane);
			});
			uiDialogButtonPane.appendTo(this.uiDialog);
		}
	},

	_makeDraggable: function() {
		var self = this,
			options = this.options;

		this.uiDialog.draggable({
			cancel: '.ui-dialog-content',
			helper: options.dragHelper,
			handle: '.ui-dialog-titlebar',
			containment: 'document',
			start: function() {
				(options.dragStart && options.dragStart.apply(self.element[0], arguments));
				if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.hide();
			},
			drag: function() {
				(options.drag && options.drag.apply(self.element[0], arguments));
				self._refreshShadow(1);
			},
			stop: function() {
				(options.dragStop && options.dragStop.apply(self.element[0], arguments));
				$.ui.dialog.overlay.resize();
				if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.show();
				self._refreshShadow();
			}
		});
	},

	_makeResizable: function(handles) {
		handles = (handles === undefined ? this.options.resizable : handles);
		var self = this,
			options = this.options,
			resizeHandles = typeof handles == 'string'
				? handles
				: 'n,e,s,w,se,sw,ne,nw';

		this.uiDialog.resizable({
			cancel: '.ui-dialog-content',
			alsoResize: this.element,
			helper: options.resizeHelper,
			maxWidth: options.maxWidth,
			maxHeight: options.maxHeight,
			minWidth: options.minWidth,
			minHeight: options.minHeight,
			start: function() {
				(options.resizeStart && options.resizeStart.apply(self.element[0], arguments));
				if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.hide();
			},
			resize: function() {
				(options.resize && options.resize.apply(self.element[0], arguments));
				self._refreshShadow(1);
			},
			handles: resizeHandles,
			stop: function() {
				(options.resizeStop && options.resizeStop.apply(self.element[0], arguments));
				$.ui.dialog.overlay.resize();
				if($.browser.msie && $.browser.version < 7 && self.shadow) self.shadow.show();
				self._refreshShadow();
			}
		})
		.find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
	},

	_position: function(pos) {
		var wnd = $(window), doc = $(document),
			pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
			minTop = pTop;

		if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
			pos = [
				pos == 'right' || pos == 'left' ? pos : 'center',
				pos == 'top' || pos == 'bottom' ? pos : 'middle'
			];
		}
		if (pos.constructor != Array) {
			pos = ['center', 'middle'];
		}
		if (pos[0].constructor == Number) {
			pLeft += pos[0];
		} else {
			switch (pos[0]) {
				case 'left':
					pLeft += 0;
					break;
				case 'right':
					pLeft += wnd.width() - this.uiDialog.outerWidth();
					break;
				default:
				case 'center':
					pLeft += (wnd.width() - this.uiDialog.outerWidth()) / 2;
			}
		}
		if (pos[1].constructor == Number) {
			pTop += pos[1];
		} else {
			switch (pos[1]) {
				case 'top':
					pTop += 0;
					break;
				case 'bottom':
					pTop += wnd.height() - this.uiDialog.outerHeight();
					break;
				default:
				case 'middle':
					pTop += (wnd.height() - this.uiDialog.outerHeight()) / 2;
			}
		}

		// prevent the dialog from being too high (make sure the titlebar
		// is accessible)
		pTop = Math.max(pTop, minTop);
		this.uiDialog.css({top: pTop, left: pLeft});
	},

	_setData: function(key, value){
		(setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
		switch (key) {
			case "buttons":
				this._createButtons(value);
				break;
			case "closeText":
				this.uiDialogTitlebarCloseText.text(value);
				break;
			case "draggable":
				(value
					? this._makeDraggable()
					: this.uiDialog.draggable('destroy'));
				break;
			case "height":
				this.uiDialog.height(value);
				break;
			case "position":
				this._position(value);
				break;
			case "resizable":
				var uiDialog = this.uiDialog,
					isResizable = this.uiDialog.is(':data(resizable)');

				// currently resizable, becoming non-resizable
				(isResizable && !value && uiDialog.resizable('destroy'));

				// currently resizable, changing handles
				(isResizable && typeof value == 'string' &&
					uiDialog.resizable('option', 'handles', value));

				// currently non-resizable, becoming resizable
				(isResizable || this._makeResizable(value));

				break;
			case "title":
				$(".ui-dialog-title", this.uiDialogTitlebar).html(value || '&nbsp;');
				break;
			case "width":
				this.uiDialog.width(value);
				break;
		}

		$.widget.prototype._setData.apply(this, arguments);
	},

	_size: function() {
		/* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
		 * divs will both have width and height set, so we need to reset them
		 */
		var options = this.options;

		// reset content sizing
		this.element.css({
			height: 0,
			minHeight: 0,
			width: '100%'
		});

		// reset wrapper sizing
		// determine the height of all the non-content elements
		var nonContentHeight = this.uiDialog.css({
				height: 'auto',
				width: options.width
			})
			.height();

		this.element
			.css({
				minHeight: Math.max(options.minHeight - nonContentHeight, 0),
				height: options.height == 'auto'
					? 'auto'
					: options.height - nonContentHeight
			});
	},
	
	_createShadow: function() {
		this.shadow = $('<div class="ui-widget-shadow"></div>').css('position', 'absolute').appendTo(document.body);
		this._refreshShadow();
		return this.shadow;
	},
	
	_refreshShadow: function(dragging) {
		// IE6 is simply to slow to handle the reflow in a good way, so
		// resizing only happens on stop, and the shadow is hidden during drag/resize
		if(dragging && $.browser.msie && $.browser.version < 7) return;
		
		var offset = this.uiDialog.offset();
		this.shadow.css({
			left: offset.left,
			top: offset.top,
			width: this.uiDialog.outerWidth(),
			height: this.uiDialog.outerHeight()
		});
	},
	
	_destroyShadow: function() {
		this.shadow.remove();
		this.shadow = null;
	}
	
});

$.extend($.ui.dialog, {
	version: "1.6rc6",
	defaults: {
		autoOpen: true,
		bgiframe: false,
		buttons: {},
		closeOnEscape: true,
		closeText: 'close',
		draggable: true,
		height: 'auto',
		minHeight: 150,
		minWidth: 150,
		modal: false,
		position: 'center',
		resizable: true,
		shadow: true,
		stack: true,
		title: '',
		width: 300,
		zIndex: 1000
	},

	getter: 'isOpen',

	uuid: 0,

	getTitleId: function($el) {
		return 'ui-dialog-title-' + ($el.attr('id') || ++this.uuid);
	},

	overlay: function(dialog) {
		this.$el = $.ui.dialog.overlay.create(dialog);
	}
});

$.extend($.ui.dialog.overlay, {
	instances: [],
	events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
		function(event) { return event + '.dialog-overlay'; }).join(' '),
	create: function(dialog) {
		if (this.instances.length === 0) {
			// prevent use of anchors and inputs
			// we use a setTimeout in case the overlay is created from an
			// event that we're going to be cancelling (see #2804)
			setTimeout(function() {
				$('a, :input').bind($.ui.dialog.overlay.events, function() {
					// allow use of the element if inside a dialog and
					// - there are no modal dialogs
					// - there are modal dialogs, but we are in front of the topmost modal
					var allow = false;
					var $dialog = $(this).parents('.ui-dialog');
					if ($dialog.length) {
						var $overlays = $('.ui-dialog-overlay');
						if ($overlays.length) {
							var maxZ = parseInt($overlays.css('z-index'), 10);
							$overlays.each(function() {
								maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10));
							});
							allow = parseInt($dialog.css('z-index'), 10) > maxZ;
						} else {
							allow = true;
						}
					}
					return allow;
				});
			}, 1);

			// allow closing by pressing the escape key
			$(document).bind('keydown.dialog-overlay', function(event) {
				(dialog.options.closeOnEscape && event.keyCode
						&& event.keyCode == $.ui.keyCode.ESCAPE && dialog.close(event));
			});

			// handle window resize
			$(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
		}

		var $el = $('<div></div>').appendTo(document.body)
			.addClass('ui-widget-overlay').css({
				width: this.width(),
				height: this.height()
			});

		(dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());

		this.instances.push($el);
		return $el;
	},

	destroy: function($el) {
		this.instances.splice($.inArray(this.instances, $el), 1);

		if (this.instances.length === 0) {
			$('a, :input').add([document, window]).unbind('.dialog-overlay');
		}

		$el.remove();
	},

	height: function() {
		// handle IE 6
		if ($.browser.msie && $.browser.version < 7) {
			var scrollHeight = Math.max(
				document.documentElement.scrollHeight,
				document.body.scrollHeight
			);
			var offsetHeight = Math.max(
				document.documentElement.offsetHeight,
				document.body.offsetHeight
			);

			if (scrollHeight < offsetHeight) {
				return $(window).height() + 'px';
			} else {
				return scrollHeight + 'px';
			}
		// handle "good" browsers
		} else {
			return $(document).height() + 'px';
		}
	},

	width: function() {
		// handle IE 6
		if ($.browser.msie && $.browser.version < 7) {
			var scrollWidth = Math.max(
				document.documentElement.scrollWidth,
				document.body.scrollWidth
			);
			var offsetWidth = Math.max(
				document.documentElement.offsetWidth,
				document.body.offsetWidth
			);

			if (scrollWidth < offsetWidth) {
				return $(window).width() + 'px';
			} else {
				return scrollWidth + 'px';
			}
		// handle "good" browsers
		} else {
			return $(document).width() + 'px';
		}
	},

	resize: function() {
		/* If the dialog is draggable and the user drags it past the
		 * right edge of the window, the document becomes wider so we
		 * need to stretch the overlay. If the user then drags the
		 * dialog back to the left, the document will become narrower,
		 * so we need to shrink the overlay to the appropriate size.
		 * This is handled by shrinking the overlay before setting it
		 * to the full document size.
		 */
		var $overlays = $([]);
		$.each($.ui.dialog.overlay.instances, function() {
			$overlays = $overlays.add(this);
		});

		$overlays.css({
			width: 0,
			height: 0
		}).css({
			width: $.ui.dialog.overlay.width(),
			height: $.ui.dialog.overlay.height()
		});
	}
});

$.extend($.ui.dialog.overlay.prototype, {
	destroy: function() {
		$.ui.dialog.overlay.destroy(this.$el);
	}
});

})(jQuery);
/*
 * jQuery UI Progressbar 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Progressbar
 *
 * Depends:
 *   ui.core.js
 */
(function($) {

$.widget("ui.progressbar", {

	_init: function() {

		var self = this,
			options = this.options;

		this.element
			.addClass("ui-progressbar"
				+ " ui-widget"
				+ " ui-widget-content"
				+ " ui-corner-all")
			.attr({
				role: "progressbar",
				"aria-valuemin": this._valueMin(),
				"aria-valuemax": this._valueMax(),
				"aria-valuenow": this._value()
			});

		this.valueDiv = $('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);

		this._refreshValue();

	},

	destroy: function() {

		this.element
			.removeClass("ui-progressbar"
				+ " ui-widget"
				+ " ui-widget-content"
				+ " ui-corner-all")
			.removeAttr("role")
			.removeAttr("aria-valuemin")
			.removeAttr("aria-valuemax")
			.removeAttr("aria-valuenow")
			.removeData("progressbar")
			.unbind(".progressbar");

		this.valueDiv.remove();

		$.widget.prototype.destroy.apply(this, arguments);

	},

	value: function(newValue) {
		arguments.length && this._setData("value", newValue);

		return this._value();
	},

	_setData: function(key, value){
		switch (key) {
			case 'value':
				this.options.value = value;
				this._refreshValue();
				this._trigger('change', null, {});
				break;
		}

		$.widget.prototype._setData.apply(this, arguments);
	},

	_value: function() {
		var val = this.options.value;
		if (val < this._valueMin()) val = this._valueMin();
		if (val > this._valueMax()) val = this._valueMax();

		return val;
	},

	_valueMin: function() {
		var valueMin = 0;

		return valueMin;
	},

	_valueMax: function() {
		var valueMax = 100;

		return valueMax;
	},

	_refreshValue: function() {
		var value = this.value();
		this.valueDiv[value == this._valueMax() ? 'addClass' : 'removeClass']("ui-corner-right");
		this.valueDiv.width(value + '%');
		this.element.attr("aria-valuenow", value);
	}

});

$.extend($.ui.progressbar, {
	version: "1.6rc6",
	defaults: {
		value: 0
	}
});

})(jQuery);
/*
 * jQuery UI Slider 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Slider
 *
 * Depends:
 *	ui.core.js
 */

(function($) {

$.widget("ui.slider", $.extend({}, $.ui.mouse, {

	_init: function() {

		var self = this, o = this.options;
		this._keySliding = false;
		this._handleIndex = null;
		this._detectOrientation();
		this._mouseInit();

		this.element
			.addClass("ui-slider"
				+ " ui-slider-" + this.orientation
				+ " ui-widget"
				+ " ui-widget-content"
				+ " ui-corner-all");

		this.range = $([]);

		if (o.range) {

			if (o.range === true) {
				this.range = $('<div></div>');
				if (!o.values) o.values = [this._valueMin(), this._valueMin()];
				if (o.values.length && o.values.length != 2) {
					o.values = [o.values[0], o.values[0]];
				}
			} else {
				this.range = $('<div></div>');
			}

			this.range
				.appendTo(this.element)
				.addClass("ui-slider-range"
					+ " ui-widget-header");

			(o.range == "min") && (this.orientation == "horizontal") && this.range.css({ left : 0 });
			(o.range == "max") && (this.orientation == "horizontal") && this.range.css({ right : 0 });
			(o.range == "min") && (this.orientation == "vertical") && this.range.css({ bottom : 0 });
			(o.range == "max") && (this.orientation == "vertical") && this.range.css({ top : 0 });

		}

		if ($(".ui-slider-handle", this.element).length == 0)
			$('<a href="#"></a>')
				.appendTo(this.element)
				.addClass("ui-slider-handle");

		if (o.values && o.values.length) {
			while ($(".ui-slider-handle", this.element).length < o.values.length)
				$('<a href="#"></a>')
					.appendTo(this.element)
					.addClass("ui-slider-handle");
		}

		this.handles = $(".ui-slider-handle", this.element)
			.addClass("ui-state-default"
				+ " ui-corner-all");

		this.handle = this.handles.eq(0);

		this.handles.add(this.range).filter("a")
			.click(function(event) { event.preventDefault(); })
			.hover(function() { $(this).addClass('ui-state-hover'); }, function() { $(this).removeClass('ui-state-hover'); })
			.focus(function() { self.handles.removeClass('ui-state-focus'); $(this).addClass('ui-state-focus'); })
			.blur(function() { $(this).removeClass('ui-state-focus'); });

		this.handles.each(function(i) {
			$(this).data("index.ui-slider-handle", i);
		});

		this.handles.keydown(function(event) {

			var index = $(this).data("index.ui-slider-handle");

			if (self.options.disabled)
				return;

			switch (event.keyCode) {
				case $.ui.keyCode.HOME:
				case $.ui.keyCode.END:
				case $.ui.keyCode.UP:
				case $.ui.keyCode.RIGHT:
				case $.ui.keyCode.DOWN:
				case $.ui.keyCode.LEFT:
					if (!self._keySliding) {
						self._keySliding = true;
						$(this).addClass("ui-state-active");
						self._start(event);
					}
					break;
			}

			var curVal, newVal, step = self._step();
			if (self.options.values && self.options.values.length) {
				curVal = newVal = self.values(index);
			} else {
				curVal = newVal = self.value();
			}

			switch (event.keyCode) {
				case $.ui.keyCode.HOME:
					newVal = self._valueMin();
					break;
				case $.ui.keyCode.END:
					newVal = self._valueMax();
					break;
				case $.ui.keyCode.UP:
				case $.ui.keyCode.RIGHT:
					if(curVal == self._valueMax()) return;
					newVal = curVal + step;
					break;
				case $.ui.keyCode.DOWN:
				case $.ui.keyCode.LEFT:
					if(curVal == self._valueMin()) return;
					newVal = curVal - step;
					break;
			}

			self._slide(event, index, newVal);

		}).keyup(function(event) {

			if (self._keySliding) {
				self._stop(event);
				self._change(event);
				self._keySliding = false;
				$(this).removeClass("ui-state-active");
			}

		});

		this._refreshValue();

	},

	destroy: function() {

		this.handles.remove();

		this.element
			.removeClass("ui-slider"
				+ " ui-slider-horizontal"
				+ " ui-slider-vertical"
				+ " ui-slider-disabled"
				+ " ui-widget"
				+ " ui-widget-content"
				+ " ui-corner-all")
			.removeData("slider")
			.unbind(".slider");

		this._mouseDestroy();

	},

	_mouseCapture: function(event) {

		var o = this.options;

		if (o.disabled)
			return false;

		this._start(event);

		this.elementSize = {
			width: this.element.outerWidth(),
			height: this.element.outerHeight()
		};
		this.elementOffset = this.element.offset();

		var position = { x: event.pageX, y: event.pageY };
		var normValue = this._normValueFromMouse(position);

		var distance = this._valueMax() + 1, closestHandle;
		var self = this, index;
		this.handles.each(function(i) {
			var thisDistance = Math.abs(normValue - self.values(i));
			if (distance > thisDistance) {
				distance = thisDistance;
				closestHandle = $(this);
				index = i;
			}
		});
		
		// workaround for bug #3736 (if both handles of a range are at 0, the first is always used as the one with least distance,
		// and moving it is obviously prevented by preventing negative ranges)
		if(o.range && (this.values(0) + this.values(1)) == 0) {
			closestHandle = $(this.handles[++index]);
		}

		self._handleIndex = index;

		closestHandle
			.addClass("ui-state-active")
			.focus();
		
		var offset = closestHandle.offset();
		var mouseOverHandle = !$(event.target).parents().andSelf().is('.ui-slider-handle');
		this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
			left: event.pageX - offset.left + (parseInt(closestHandle.css('marginLeft'),10) || 0),
			top: event.pageY - offset.top + (parseInt(closestHandle.css('marginTop'),10) || 0)
		};

		normValue = this._normValueFromMouse(position);
		this._slide(event, index, normValue);
		return true;

	},

	_mouseStart: function(event) {
		return true;
	},

	_mouseDrag: function(event) {

		var position = { x: event.pageX, y: event.pageY };
		var normValue = this._normValueFromMouse(position);
		
		this._slide(event, this._handleIndex, normValue);

		return false;

	},

	_mouseStop: function(event) {

		this.handles.removeClass("ui-state-active");
		this._stop(event);
		this._change(event);
		this._handleIndex = null;
		this._clickOffset = null;

		return false;

	},
	
	_detectOrientation: function() {
		this.orientation = this.options.orientation == 'auto' ? (this.element[0].offsetWidth/this.element[0].offsetHeight > 1 ? 'horizontal' : 'vertical') : this.options.orientation;
	},

	_normValueFromMouse: function(position) {

		var pixelTotal, pixelMouse;
		if ('horizontal' == this.orientation) {
			pixelTotal = this.elementSize.width;
			pixelMouse = position.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0);
		} else {
			pixelTotal = this.elementSize.height;
			pixelMouse = position.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0);
		}

		var percentMouse = (pixelMouse / pixelTotal);
		if (percentMouse > 1) percentMouse = 1;
		if (percentMouse < 0) percentMouse = 0;
		if ('vertical' == this.orientation)
			percentMouse = 1 - percentMouse;

		var valueTotal = this._valueMax() - this._valueMin(),
			valueMouse = percentMouse * valueTotal,
			valueMouseModStep = valueMouse % this.options.step,
			normValue = this._valueMin() + valueMouse - valueMouseModStep;

		if (valueMouseModStep > (this.options.step / 2))
			normValue += this.options.step;

		return normValue;

	},

	_start: function(event) {
		this._trigger("start", event, {
			value: this.value()
		});
	},

	_slide: function(event, index, newVal) {

		var handle = this.handles[index];

		if (this.options.values && this.options.values.length) {

			var otherVal = this.values(index ? 0 : 1);

			if ((index == 0 && newVal >= otherVal) || (index == 1 && newVal <= otherVal))
				newVal = otherVal;

			if (newVal != this.values(index)) {
				var newValues = this.values();
				newValues[index] = newVal;
				// A slide can be canceled by returning false from the slide callback
				var allowed = this._trigger("slide", event, {
					handle: handle,
					value: newVal,
					values: newValues
				});
				var otherVal = this.values(index ? 0 : 1);
				if (allowed !== false) {
					this.values(index, newVal, !( event.type == 'mousedown' && this.options.animate ));
				}
			}

		} else {

			if (newVal != this.value()) {
				// A slide can be canceled by returning false from the slide callback
				var allowed = this._trigger("slide", event, {
					handle: handle,
					value: newVal
				});
				if (allowed !== false) {
					this._setData('value', newVal, ( event.type == 'mousedown' && this.options.animate ));
				}
					
			}

		}

	},

	_stop: function(event) {
		this._trigger("stop", event, {
			value: this.value()
		});
	},

	_change: function(event) {
		this._trigger("change", event, {
			value: this.value()
		});
	},

	value: function(newValue) {

		if (arguments.length) {
			this._setData("value", newValue);
			this._change();
		}

		return this._value();

	},

	values: function(index, newValue, noAnimation) {

		if(!this.options.animate) noAnimation = true;

		if (arguments.length > 1) {
			this.options.values[index] = newValue;
			this._refreshValue(!noAnimation);
			this._change();
		}

		if (arguments.length) {
			if (this.options.values && this.options.values.length) {
				return this._values(index);
			} else {
				return this.value();
			}
		} else {
			return this._values();
		}

	},

	_setData: function(key, value) {

		$.widget.prototype._setData.apply(this, arguments);

		switch (key) {
			case 'orientation':

				this._detectOrientation();
				
				this.element
					.removeClass("ui-slider-horizontal ui-slider-vertical")
					.addClass("ui-slider-" + this.orientation);
				this._refreshValue();
				break;
			case 'value':
				this._refreshValue();
				break;
		}

	},

	_step: function() {
		var step = this.options.step;
		return step;
	},

	_value: function() {

		var val = this.options.value;
		if (val < this._valueMin()) val = this._valueMin();
		if (val > this._valueMax()) val = this._valueMax();

		return val;

	},

	_values: function(index) {

		if (arguments.length) {
			var val = this.options.values[index];
			if (val < this._valueMin()) val = this._valueMin();
			if (val > this._valueMax()) val = this._valueMax();

			return val;
		} else {
			return this.options.values;
		}

	},

	_valueMin: function() {
		var valueMin = this.options.min;
		return valueMin;
	},

	_valueMax: function() {
		var valueMax = this.options.max;
		return valueMax;
	},

	_refreshValue: function(animate) {

		var oRange = this.options.range, o = this.options, self = this;

		if (this.options.values && this.options.values.length) {
			var vp0, vp1;
			this.handles.each(function(i, j) {
				var valPercent = (self.values(i) - self._valueMin()) / (self._valueMax() - self._valueMin()) * 100;
				var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%';
				$(this).stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate);
				if (self.options.range === true) {
					if (self.orientation == 'horizontal') {
						(i == 0) && self.range.stop(1,1)[animate ? 'animate' : 'css']({ left: valPercent + '%' }, o.animate);
						(i == 1) && self.range[animate ? 'animate' : 'css']({ width: (valPercent - lastValPercent) + '%' }, { queue: false, duration: o.animate });
					} else {
						(i == 0) && self.range.stop(1,1)[animate ? 'animate' : 'css']({ bottom: (valPercent) + '%' }, o.animate);
						(i == 1) && self.range[animate ? 'animate' : 'css']({ height: (valPercent - lastValPercent) + '%' }, { queue: false, duration: o.animate });
					}
				}
				lastValPercent = valPercent;
			});
		} else {
			var valPercent = (this.value() - this._valueMin()) / (this._valueMax() - this._valueMin()) * 100;
			var _set = {}; _set[self.orientation == 'horizontal' ? 'left' : 'bottom'] = valPercent + '%';
			this.handle.stop(1,1)[animate ? 'animate' : 'css'](_set, o.animate);

			(oRange == "min") && (this.orientation == "horizontal") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ left: 0, width: valPercent + '%' }, o.animate);
			(oRange == "max") && (this.orientation == "horizontal") && this.range[animate ? 'animate' : 'css']({ left: valPercent + '%', width: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
			(oRange == "min") && (this.orientation == "vertical") && this.range.stop(1,1)[animate ? 'animate' : 'css']({ top: (100 - valPercent) + '%', height: valPercent + '%' }, o.animate);
			(oRange == "max") && (this.orientation == "vertical") && this.range[animate ? 'animate' : 'css']({ bottom: valPercent + '%', height: (100 - valPercent) + '%' }, { queue: false, duration: o.animate });
		}

	}

}));

$.extend($.ui.slider, {
	getter: "value values",
	version: "1.6rc6",
	eventPrefix: "slide",
	defaults: {
		animate: false,
		delay: 0,
		distance: 0,
		max: 100,
		min: 0,
		orientation: 'auto',
		range: false,
		step: 1,
		value: 0,
		values: null
	}
});

})(jQuery);
/*
 * jQuery UI Tabs 1.6rc6
 *
 * Copyright (c) 2009 AUTHORS.txt (http://ui.jquery.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Tabs
 *
 * Depends:
 *	ui.core.js
 */
(function($) {

$.widget("ui.tabs", {

	_init: function() {
		// create tabs
		this._tabify(true);
	},

	_setData: function(key, value) {
		if ((/^selected/).test(key))
			this.select(value);
		else {
			this.options[key] = value;
			this._tabify();
		}
	},

	_tabId: function(a) {
		return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '')
			|| this.options.idPrefix + $.data(a);
	},

	_sanitizeSelector: function(hash) {
		return hash.replace(/:/g, '\\:'); // we need this because an id may contain a ":"
	},

	_cookie: function() {
		var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + $.data(this.list[0]));
		return $.cookie.apply(null, [cookie].concat($.makeArray(arguments)));
	},
	
	_ui: function(tab, panel) {
		return {
			tab: tab,
			panel: panel,
			index: this.$tabs.index(tab)
		};
	},

	_tabify: function(init) {

		this.list = this.element.is('div') ? this.element.children('ul:first, ol:first').eq(0) : this.element;
		this.$lis = $('li:has(a[href])', this.list);
		this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
		this.$panels = $([]);

		var self = this, o = this.options;

		var fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
		this.$tabs.each(function(i, a) {
			var href = $(a).attr('href');

			// inline tab
			if (fragmentId.test(href))
				self.$panels = self.$panels.add(self._sanitizeSelector(href));

			// remote tab
			else if (href != '#') { // prevent loading the page itself if href is just "#"
				$.data(a, 'href.tabs', href); // required for restore on destroy

				// TODO until #3808 is fixed strip fragment identifier from url
				// (IE fails to load from such url)
				$.data(a, 'load.tabs', href.replace(/#.*$/, '')); // mutable data

				var id = self._tabId(a);
				a.href = '#' + id;
				var $panel = $('#' + id);
				if (!$panel.length) {
					$panel = $(o.panelTemplate).attr('id', id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom')
						.insertAfter(self.$panels[i - 1] || self.list);
					$panel.data('destroy.tabs', true);
				}
				self.$panels = self.$panels.add($panel);
			}

			// invalid tab href
			else
				o.disabled.push(i + 1);
		});

		// initialization from scratch
		if (init) {

			// attach necessary classes for styling
			if (this.element.is('div')) {
				this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all');
			}
			this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix');
			this.$lis.addClass('ui-state-default ui-corner-top');
			this.$panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom');

			// Selected tab
			// use "selected" option or try to retrieve:
			// 1. from fragment identifier in url
			// 2. from cookie
			// 3. from selected class attribute on <li>
			if (o.selected === undefined) {
				if (location.hash) {
					this.$tabs.each(function(i, a) {
						if (a.hash == location.hash) {
							o.selected = i;
							return false; // break
						}
					});
				}
				else if (o.cookie)
					o.selected = parseInt(self._cookie(), 10);

				else if (this.$lis.filter('.ui-tabs-selected').length)
					o.selected = this.$lis.index(this.$lis.filter('.ui-tabs-selected'));

				else
				 	o.selected = 0;

			}
			else if (o.selected === null)
				o.selected = -1;

			// sanity check
			o.selected = ((o.selected >= 0 && this.$tabs[o.selected]) || o.selected < 0) ? o.selected : 0; // default to first tab

			// Take disabling tabs via class attribute from HTML
			// into account and update option properly.
			// A selected tab cannot become disabled.
			o.disabled = $.unique(o.disabled.concat(
				$.map(this.$lis.filter('.ui-state-disabled'),
					function(n, i) { return self.$lis.index(n); } )
			)).sort();
			if ($.inArray(o.selected, o.disabled) != -1)
				o.disabled.splice($.inArray(o.selected, o.disabled), 1);

			// highlight selected tab
			this.$panels.addClass('ui-tabs-hide');
			this.$lis.removeClass('ui-tabs-selected ui-state-active');
			if (o.selected >= 0 && this.$tabs.length) { // check for length avoids error when initializing empty list
				this.$panels.eq(o.selected).removeClass('ui-tabs-hide');
				var classes = ['ui-tabs-selected ui-state-active'];
				if (o.deselectable) classes.push('ui-tabs-deselectable');
				this.$lis.eq(o.selected).addClass(classes.join(' '));

				// seems to be expected behavior that the show callback is fired
				var onShow = function() {
					self._trigger('show', null,
						self._ui(self.$tabs[o.selected], self.$panels[o.selected]));
				};

				// load if remote tab
				if ($.data(this.$tabs[o.selected], 'load.tabs'))
					this.load(o.selected, onShow);
				// just trigger show event
				else onShow();
			}

			// states
			if (o.event != 'mouseover') {
				var handleState = function(state, el) {
					if (el.is(':not(.ui-state-disabled)')) el.toggleClass('ui-state-' + state);
				};
				this.$lis.bind('mouseover.tabs mouseout.tabs', function() {
					handleState('hover', $(this));
				});
				// TODO focus/blur don't seem to work with namespace
				this.$tabs.bind('focus.tabs blur.tabs', function() {
					handleState('focus', $(this).parents('li:first'));
				});
			}

			// clean up to avoid memory leaks in certain versions of IE 6
			$(window).bind('unload', function() {
				self.$lis.add(self.$tabs).unbind('.tabs');
				self.$lis = self.$tabs = self.$panels = null;
			});

		}
		// update selected after add/remove
		else
			o.selected = this.$lis.index(this.$lis.filter('.ui-tabs-selected'));

		// set or update cookie after init and add/remove respectively
		if (o.cookie) this._cookie(o.selected, o.cookie);

		// disable tabs
		for (var i = 0, li; li = this.$lis[i]; i++)
			$(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass('ui-tabs-selected') ? 'addClass' : 'removeClass']('ui-state-disabled');

		// reset cache if switching from cached to not cached
		if (o.cache === false) this.$tabs.removeData('cache.tabs');

		// set up animations
		var hideFx, showFx;
		if (o.fx) {
			if ($.isArray(o.fx)) {
				hideFx = o.fx[0];
				showFx = o.fx[1];
			}
			else hideFx = showFx = o.fx;
		}

		// Reset certain styles left over from animation
		// and prevent IE's ClearType bug...
		function resetStyle($el, fx) {
			$el.css({ display: '' });
			if ($.browser.msie && fx.opacity) $el[0].style.removeAttribute('filter');
		}

		// Show a tab...
		var showTab = showFx ?
			function(clicked, $show) {
				$show.hide().removeClass('ui-tabs-hide') // avoid flicker that way
					.animate(showFx, 500, function() {
						resetStyle($show, showFx);
						self._trigger('show', null, self._ui(clicked, $show[0]));
					});
			} :
			function(clicked, $show) {
				$show.removeClass('ui-tabs-hide');
				self._trigger('show', null, self._ui(clicked, $show[0]));
			};

		// Hide a tab, $show is optional...
		var hideTab = hideFx ?
			function(clicked, $hide, $show) {
				$hide.animate(hideFx, hideFx.duration || 'normal', function() {
					$hide.addClass('ui-tabs-hide');
					resetStyle($hide, hideFx);
					if ($show) showTab(clicked, $show);
				});
			} :
			function(clicked, $hide, $show) {
				$hide.addClass('ui-tabs-hide');
				if ($show) showTab(clicked, $show);
			};

		// Switch a tab...
		function switchTab(clicked, $li, $hide, $show) {
			var classes = ['ui-tabs-selected ui-state-active'];
			if (o.deselectable) classes.push('ui-tabs-deselectable');
			$li.removeClass('ui-state-default').addClass(classes.join(' '))
				.siblings().removeClass(classes.join(' ')).addClass('ui-state-default');
			hideTab(clicked, $hide, $show);
		}

		// attach tab event handler, unbind to avoid duplicates from former tabifying...
		this.$tabs.unbind('.tabs').bind(o.event + '.tabs', function() {

			var $li = $(this).parents('li:eq(0)'),
				$hide = self.$panels.filter(':visible'),
				$show = $(self._sanitizeSelector(this.hash));

			// If tab is already selected and not deselectable or tab disabled or
			// or is already loading or click callback returns false stop here.
			// Check if click handler returns false last so that it is not executed
			// for a disabled or loading tab!
			if (($li.hasClass('ui-state-active') && !o.deselectable)
				|| $li.hasClass('ui-state-disabled')
				|| $(this).hasClass('ui-tabs-loading')
				|| self._trigger('select', null, self._ui(this, $show[0])) === false
				) {
				this.blur();
				return false;
			}

			o.selected = self.$tabs.index(this);

			// if tab may be closed TODO avoid redundant code in this block
			if (o.deselectable) {
				if ($li.hasClass('ui-state-active')) {
					o.selected = -1;
					if (o.cookie) self._cookie(o.selected, o.cookie);
					$li.removeClass('ui-tabs-selected ui-state-active ui-tabs-deselectable')
						.addClass('ui-state-default');
					self.$panels.stop();
					hideTab(this, $hide);
					this.blur();
					return false;
				} else if (!$hide.length) {
					if (o.cookie) self._cookie(o.selected, o.cookie);
					self.$panels.stop();
					var a = this;
					self.load(self.$tabs.index(this), function() {
						$li.addClass('ui-tabs-selected ui-state-active ui-tabs-deselectable')
							.removeClass('ui-state-default');
						showTab(a, $show);
					});
					this.blur();
					return false;
				}
			}

			if (o.cookie) self._cookie(o.selected, o.cookie);

			// stop possibly running animations
			self.$panels.stop();

			// show new tab
			if ($show.length) {
				var a = this;
				self.load(self.$tabs.index(this), $hide.length ?
					function() {
						switchTab(a, $li, $hide, $show);
					} :
					function() {
						$li.addClass('ui-tabs-selected ui-state-active').removeClass('ui-state-default');
						showTab(a, $show);
					}
				);
			} else
				throw 'jQuery UI Tabs: Mismatching fragment identifier.';

			// Prevent IE from keeping other link focussed when using the back button
			// and remove dotted border from clicked link. This is controlled via CSS
			// in modern browsers; blur() removes focus from address bar in Firefox
			// which can become a usability and annoying problem with tabs('rotate').
			if ($.browser.msie) this.blur();

			return false;

		});

		// disable click if event is configured to something else
		if (o.event != 'click') this.$tabs.bind('click.tabs', function(){return false;});

	},
	
	destroy: function() {
		var o = this.options;

		this.element
			.removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all');

		this.list.unbind('.tabs')
			.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all')
			.removeData('tabs');

		this.$tabs.each(function() {
			var href = $.data(this, 'href.tabs');
			if (href)
				this.href = href;
			var $this = $(this).unbind('.tabs');
			$.each(['href', 'load', 'cache'], function(i, prefix) {
				$this.removeData(prefix + '.tabs');
			});
		});

		this.$lis.unbind('.tabs').add(this.$panels).each(function() {
			if ($.data(this, 'destroy.tabs'))
				$(this).remove();
			else
				$(this).removeClass(
					'ui-state-default ' +
					'ui-corner-top ' +
					'ui-tabs-selected ' +
					'ui-state-active ' +
					'ui-tabs-deselectable ' +
					'ui-state-disabled ' +
					'ui-tabs-panel ' +
					'ui-widget-content ' +
					'ui-corner-bottom ' +
					'ui-tabs-hide');
		});

		if (o.cookie)
			this._cookie(null, o.cookie);
	},

	add: function(url, label, index) {
		if (index == undefined)
			index = this.$tabs.length; // append by default

		var self = this, o = this.options;
		var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label));
		$li.addClass('ui-state-default ui-corner-top').data('destroy.tabs', true);

		var id = url.indexOf('#') == 0 ? url.replace('#', '') : this._tabId( $('a:first-child', $li)[0] );

		// try to find an existing element before creating a new one
		var $panel = $('#' + id);
		if (!$panel.length) {
			$panel = $(o.panelTemplate).attr('id', id).data('destroy.tabs', true);
		}
		$panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide');
		if (index >= this.$lis.length) {
			$li.appendTo(this.list);
			$panel.appendTo(this.list[0].parentNode);
		}
		else {
			$li.insertBefore(this.$lis[index]);
			$panel.insertBefore(this.$panels[index]);
		}

		o.disabled = $.map(o.disabled,
			function(n, i) { return n >= index ? ++n : n });

		this._tabify();

		if (this.$tabs.length == 1) { // after tabify
			$li.addClass('ui-tabs-selected ui-state-active');
			$panel.removeClass('ui-tabs-hide');
			var href = $.data(this.$tabs[0], 'load.tabs');
			if (href) this.load(0, function() {
				self._trigger('show', null,
					self._ui(self.$tabs[0], self.$panels[0]));
			});
		}

		// callback
		this._trigger('add', null, this._ui(this.$tabs[index], this.$panels[index]));
	},

	remove: function(index) {
		var o = this.options, $li = this.$lis.eq(index).remove(),
			$panel = this.$panels.eq(index).remove();

		// If selected tab was removed focus tab to the right or
		// in case the last tab was removed the tab to the left.
		if ($li.hasClass('ui-tabs-selected') && this.$tabs.length > 1)
			this.select(index + (index + 1 < this.$tabs.length ? 1 : -1));

		o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
			function(n, i) { return n >= index ? --n : n });

		this._tabify();

		// callback
		this._trigger('remove', null, this._ui($li.find('a')[0], $panel[0]));
	},

	enable: function(index) {
		var o = this.options;
		if ($.inArray(index, o.disabled) == -1)
			return;

		this.$lis.eq(index).removeClass('ui-state-disabled');
		o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });

		// callback
		this._trigger('enable', null, this._ui(this.$tabs[index], this.$panels[index]));
	},

	disable: function(index) {
		var self = this, o = this.options;
		if (index != o.selected) { // cannot disable already selected tab
			this.$lis.eq(index).addClass('ui-state-disabled');

			o.disabled.push(index);
			o.disabled.sort();

			// callback
			this._trigger('disable', null, this._ui(this.$tabs[index], this.$panels[index]));
		}
	},

	select: function(index) {
		if (typeof index == 'string')
			index = this.$tabs.index(this.$tabs.filter('[href$=' + index + ']'));
		this.$tabs.eq(index).trigger(this.options.event + '.tabs');
	},

	load: function(index, callback) { // callback is for internal usage only

		var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0],
				bypassCache = callback == undefined || callback === false, url = $a.data('load.tabs');
				// TODO bypassCache == false should work

		callback = callback || function() {};

		// no remote or from cache - just finish with callback
		// TODO in any case: insert cancel running load here..!
		
		if (!url || !bypassCache && $.data(a, 'cache.tabs')) {
			callback();
			return;
		}

		// load remote from here on

		var inner = function(parent) {
			var $parent = $(parent), $inner = $parent.find('*:last');
			return $inner.length && $inner.is(':not(img)') && $inner || $parent;
		};
		var cleanup = function() {
			self.$tabs.filter('.ui-tabs-loading').removeClass('ui-tabs-loading')
					.each(function() {
						if (o.spinner)
							inner(this).parent().html(inner(this).data('label.tabs'));
					});
			self.xhr = null;
		};

		if (o.spinner) {
			var label = inner(a).html();
			inner(a).wrapInner('<em></em>')
				.find('em').data('label.tabs', label).html(o.spinner);
		}

		var ajaxOptions = $.extend({}, o.ajaxOptions, {
			url: url,
			success: function(r, s) {
				$(self._sanitizeSelector(a.hash)).html(r);
				cleanup();

				if (o.cache)
					$.data(a, 'cache.tabs', true); // if loaded once do not load them again

				// callbacks
				self._trigger('load', null, self._ui(self.$tabs[index], self.$panels[index]));
				try {
					o.ajaxOptions.success(r, s);
				}
				catch (er) {}

				// This callback is required because the switch has to take
				// place after loading has completed. Call last in order to
				// fire load before show callback...
				callback();
			}
		});
		if (this.xhr) {
			// terminate pending requests from other tabs and restore tab label
			this.xhr.abort();
			cleanup();
		}
		$a.addClass('ui-tabs-loading');
		self.xhr = $.ajax(ajaxOptions);
	},

	url: function(index, url) {
		this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs', url);
	},
	
	length: function() {
		return this.$tabs.length;
	}

});

$.extend($.ui.tabs, {
	version: '1.6rc6',
	getter: 'length',
	defaults: {
		ajaxOptions: null,
		cache: false,
		cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
		deselectable: false,
		disabled: [],
		event: 'click',
		fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
		idPrefix: 'ui-tabs-',
		panelTemplate: '<div></div>',
		spinner: 'Loading&#8230;',
		tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
	}
});

/*
 * Tabs Extensions
 */

/*
 * Rotate
 */
$.extend($.ui.tabs.prototype, {
	rotation: null,
	rotate: function(ms, continuing) {

		var self = this, t = this.options.selected;

		function rotate() {
			clearTimeout(self.rotation);
			self.rotation = setTimeout(function() {
				t = ++t < self.$tabs.length ? t : 0;
				self.select(t);
			}, ms);
		}

		// start rotation
		if (ms) {
			this.element.bind('tabsshow', rotate); // will not be attached twice
			this.$tabs.bind(this.options.event + '.tabs', !continuing ?
				function(e) {
					if (e.clientX) { // in case of a true click
						clearTimeout(self.rotation);
						self.element.unbind('tabsshow', rotate);
					}
				} :
				function(e) {
					t = self.options.selected;
					rotate();
				}
			);
			rotate();
		}
		// stop rotation
		else {
			clearTimeout(self.rotation);
			this.element.unbind('tabsshow', rotate);
			this.$tabs.unbind(this.options.event + '.tabs', stop);
		}
	}
});

})(jQuery);
jQuery.autocomplete = function(input, options) {
	// Create a link to self
	var me = this;

	// Create jQuery object for input element
	var $input = $(input).attr("autocomplete", "off");

	// Apply inputClass if necessary
	if (options.inputClass) $input.addClass(options.inputClass);

	// Create results
	var results = document.createElement("div");
	// Create jQuery object for results
	var $results = $(results);
	$results.hide().addClass(options.resultsClass).css("position", "absolute");
	if( options.width > 0 ) $results.css("width", options.width);

	// Add to body element
	$("body").append(results);

	input.autocompleter = me;

	var timeout = null;
	var prev = "";
	var active = -1;
	var cache = {};
	var keyb = false;
	var hasFocus = false;
	var lastKeyPressCode = null;

	// flush cache
	function flushCache(){
		cache = {};
		cache.data = {};
		cache.length = 0;
	};

	// flush cache
	flushCache();

	// if there is a data array supplied
	if( options.data != null ){
		var sFirstChar = "", stMatchSets = {}, row = [];

		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
		if( typeof options.url != "string" ) options.cacheLength = 1;

		// loop through the array and create a lookup structure
		for( var i=0; i < options.data.length; i++ ){
			// if row is a string, make an array otherwise just reference the array
			row = ((typeof options.data[i] == "string") ? [options.data[i]] : options.data[i]);

			// if the length is zero, don't add to list
			if( row[0].length > 0 ){
				// get the first character
				sFirstChar = row[0].substring(0, 1).toLowerCase();
				// if no lookup array for this character exists, look it up now
				if( !stMatchSets[sFirstChar] ) stMatchSets[sFirstChar] = [];
				// if the match is a string
				stMatchSets[sFirstChar].push(row);
			}
		}

		// add the data items to the cache
		for( var k in stMatchSets ){
			// increase the cache size
			options.cacheLength++;
			// add to the cache
			addToCache(k, stMatchSets[k]);
		}
	}

	$input
	.keydown(function(e) {
		// track last key pressed
		lastKeyPressCode = e.keyCode;
		switch(e.keyCode) {
			case 38: // up
				e.preventDefault();
				moveSelect(-1);
				break;
			case 40: // down
				e.preventDefault();
				moveSelect(1);
				break;
			case 9:  // tab
			case 13: // return
				if( selectCurrent() ){
					// make sure to blur off the current field
					$input.get(0).blur();
					e.preventDefault();
				}
				break;
			default:
				active = -1;
				if (timeout) clearTimeout(timeout);
				timeout = setTimeout(function(){onChange();}, options.delay);
				break;
		}
	})
	.focus(function(){
		// track whether the field has focus, we shouldn't process any results if the field no longer has focus
		hasFocus = true;
	})
	.blur(function() {
		// track whether the field has focus
		hasFocus = false;
		hideResults();
	});

	hideResultsNow();

	function onChange() {
		// ignore if the following keys are pressed: [del] [shift] [capslock]
		if( lastKeyPressCode == 46 || (lastKeyPressCode > 8 && lastKeyPressCode < 32) ) return $results.hide();
		var v = $input.val();
		if (v == prev) return;
		prev = v;
		if (v.length >= options.minChars) {
			$input.addClass(options.loadingClass);
			requestData(v);
		} else {
			$input.removeClass(options.loadingClass);
			$results.hide();
		}
	};

 	function moveSelect(step) {

		var lis = $("li", results);
		if (!lis) return;

		active += step;

		if (active < 0) {
			active = 0;
		} else if (active >= lis.size()) {
			active = lis.size() - 1;
		}

		lis.removeClass("ac_over");

		$(lis[active]).addClass("ac_over");

		// Weird behaviour in IE
		// if (lis[active] && lis[active].scrollIntoView) {
		// 	lis[active].scrollIntoView(false);
		// }

	};

	function selectCurrent() {
		var li = $("li.ac_over", results)[0];
		if (!li) {
			var $li = $("li", results);
			if (options.selectOnly) {
				if ($li.length == 1) li = $li[0];
			} else if (options.selectFirst) {
				li = $li[0];
			}
		}
		if (li) {
			selectItem(li);
			return true;
		} else {
			return false;
		}
	};

	function selectItem(li) {
		if (!li) {
			li = document.createElement("li");
			li.extra = [];
			li.selectValue = "";
		}
		var v = $.trim(li.selectValue ? li.selectValue : li.innerHTML);
		input.lastSelected = v;
		prev = v;
		$results.html("");
		$input.val(v);
		hideResultsNow();
		if (options.onItemSelect) setTimeout(function() { options.onItemSelect(li) }, 1);
	};

	// selects a portion of the input string
	function createSelection(start, end){
		// get a reference to the input element
		var field = $input.get(0);
		if( field.createTextRange ){
			var selRange = field.createTextRange();
			selRange.collapse(true);
			selRange.moveStart("character", start);
			selRange.moveEnd("character", end);
			selRange.select();
		} else if( field.setSelectionRange ){
			field.setSelectionRange(start, end);
		} else {
			if( field.selectionStart ){
				field.selectionStart = start;
				field.selectionEnd = end;
			}
		}
		field.focus();
	};

	// fills in the input box w/the first match (assumed to be the best match)
	function autoFill(sValue){
		// if the last user key pressed was backspace, don't autofill
		if( lastKeyPressCode != 8 ){
			// fill in the value (keep the case the user has typed)
			$input.val($input.val() + sValue.substring(prev.length));
			// select the portion of the value not typed by the user (so the next character will erase)
			createSelection(prev.length, sValue.length);
		}
	};

	function showResults() {
		// get the position of the input field right now (in case the DOM is shifted)
		var pos = findPos(input);
		// either use the specified width, or autocalculate based on form element
		var iWidth = (options.width > 0) ? options.width : $input.width();
		// reposition
		$results.css({
			width: parseInt(iWidth) + "px",
			top: (pos.y + input.offsetHeight) + "px",
			left: pos.x + "px"
		}).show();
	};

	function hideResults() {
		if (timeout) clearTimeout(timeout);
		timeout = setTimeout(hideResultsNow, 200);
	};

	function hideResultsNow() {
		if (timeout) clearTimeout(timeout);
		$input.removeClass(options.loadingClass);
		if ($results.is(":visible")) {
			$results.hide();
		}
		if (options.mustMatch) {
			var v = $input.val();
			if (v != input.lastSelected) {
				selectItem(null);
			}
		}
	};

	function receiveData(q, data) {
		if (data) {
			$input.removeClass(options.loadingClass);
			results.innerHTML = "";

			// if the field no longer has focus or if there are no matches, do not display the drop down
			if( !hasFocus || data.length == 0 ) return hideResultsNow();

			if ($.browser.msie) {
				// we put a styled iframe behind the calendar so HTML SELECT elements don't show through
				$results.append(document.createElement('iframe'));
			}
			results.appendChild(dataToDom(data));
			// autofill in the complete box w/the first match as long as the user hasn't entered in more data
			if( options.autoFill && ($input.val().toLowerCase() == q.toLowerCase()) ) autoFill(data[0][0]);
			showResults();
		} else {
			hideResultsNow();
		}
	};

	function parseData(data) {
		if (!data) return null;
		var parsed = [];
		var rows = data.split(options.lineSeparator);
		for (var i=0; i < rows.length; i++) {
			var row = $.trim(rows[i]);
			if (row) {
				parsed[parsed.length] = row.split(options.cellSeparator);
			}
		}
		return parsed;
	};

	function dataToDom(data) {
		var ul = document.createElement("ul");
		var num = data.length;

		// limited results to a max number
		if( (options.maxItemsToShow > 0) && (options.maxItemsToShow < num) ) num = options.maxItemsToShow;

		for (var i=0; i < num; i++) {
			var row = data[i];
			if (!row) continue;
			var li = document.createElement("li");
			if (options.formatItem) {
				li.innerHTML = options.formatItem(row, i, num);
				li.selectValue = row[0];
			} else {
				li.innerHTML = row[0];
				li.selectValue = row[0];
			}
			var extra = null;
			if (row.length > 1) {
				extra = [];
				for (var j=1; j < row.length; j++) {
					extra[extra.length] = row[j];
				}
			}
			li.extra = extra;
			ul.appendChild(li);
			$(li).hover(
				function() { $("li", ul).removeClass("ac_over"); $(this).addClass("ac_over"); active = $("li", ul).indexOf($(this).get(0)); },
				function() { $(this).removeClass("ac_over"); }
			).click(function(e) { e.preventDefault(); e.stopPropagation(); selectItem(this) });
		}
		return ul;
	};

	function requestData(q) {
		if (!options.matchCase) q = q.toLowerCase();
		var data = options.cacheLength ? loadFromCache(q) : null;
		// recieve the cached data
		if (data) {
			receiveData(q, data);
		// if an AJAX url has been supplied, try loading the data now
		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
			$.get(makeUrl(q), function(data) {
				data = parseData(data);
				addToCache(q, data);
				receiveData(q, data);
			});
		// if there's been no data found, remove the loading class
		} else {
			$input.removeClass(options.loadingClass);
		}
	};

	function makeUrl(q) {
		var url = options.url + "?q=" + encodeURI(q);
		for (var i in options.extraParams) {
			url += "&" + i + "=" + encodeURI(options.extraParams[i]);
		}
		return url;
	};

	function loadFromCache(q) {
		if (!q) return null;
		if (cache.data[q]) return cache.data[q];
		if (options.matchSubset) {
			for (var i = q.length - 1; i >= options.minChars; i--) {
				var qs = q.substr(0, i);
				var c = cache.data[qs];
				if (c) {
					var csub = [];
					for (var j = 0; j < c.length; j++) {
						var x = c[j];
						var x0 = x[0];
						if (matchSubset(x0, q)) {
							csub[csub.length] = x;
						}
					}
					return csub;
				}
			}
		}
		return null;
	};

	function matchSubset(s, sub) {
		if (!options.matchCase) s = s.toLowerCase();
		var i = s.indexOf(sub);
		if (i == -1) return false;
		return i == 0 || options.matchContains;
	};

	this.flushCache = function() {
		flushCache();
	};

	this.setExtraParams = function(p) {
		options.extraParams = p;
	};

	this.findValue = function(){
		var q = $input.val();

		if (!options.matchCase) q = q.toLowerCase();
		var data = options.cacheLength ? loadFromCache(q) : null;
		if (data) {
			findValueCallback(q, data);
		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
			$.get(makeUrl(q), function(data) {
				data = parseData(data)
				addToCache(q, data);
				findValueCallback(q, data);
			});
		} else {
			// no matches
			findValueCallback(q, null);
		}
	}

	function findValueCallback(q, data){
		if (data) $input.removeClass(options.loadingClass);

		var num = (data) ? data.length : 0;
		var li = null;

		for (var i=0; i < num; i++) {
			var row = data[i];

			if( row[0].toLowerCase() == q.toLowerCase() ){
				li = document.createElement("li");
				if (options.formatItem) {
					li.innerHTML = options.formatItem(row, i, num);
					li.selectValue = row[0];
				} else {
					li.innerHTML = row[0];
					li.selectValue = row[0];
				}
				var extra = null;
				if( row.length > 1 ){
					extra = [];
					for (var j=1; j < row.length; j++) {
						extra[extra.length] = row[j];
					}
				}
				li.extra = extra;
			}
		}

		if( options.onFindValue ) setTimeout(function() { options.onFindValue(li) }, 1);
	}

	function addToCache(q, data) {
		if (!data || !q || !options.cacheLength) return;
		if (!cache.length || cache.length > options.cacheLength) {
			flushCache();
			cache.length++;
		} else if (!cache[q]) {
			cache.length++;
		}
		cache.data[q] = data;
	};

	function findPos(obj) {
		var curleft = obj.offsetLeft || 0;
		var curtop = obj.offsetTop || 0;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
		return {x:curleft,y:curtop};
	}
}

jQuery.fn.autocomplete = function(url, options, data) {
	// Make sure options exists
	options = options || {};
	// Set url as option
	options.url = url;
	// set some bulk local data
	options.data = ((typeof data == "object") && (data.constructor == Array)) ? data : null;

	// Set default values for required options
	options.inputClass = options.inputClass || "ac_input";
	options.resultsClass = options.resultsClass || "ac_results";
	options.lineSeparator = options.lineSeparator || "\n";
	options.cellSeparator = options.cellSeparator || "|";
	options.minChars = options.minChars || 1;
	options.delay = options.delay || 400;
	options.matchCase = options.matchCase || 0;
	options.matchSubset = options.matchSubset || 1;
	options.matchContains = options.matchContains || 0;
	options.cacheLength = options.cacheLength || 1;
	options.mustMatch = options.mustMatch || 0;
	options.extraParams = options.extraParams || {};
	options.loadingClass = options.loadingClass || "ac_loading";
	options.selectFirst = options.selectFirst || false;
	options.selectOnly = options.selectOnly || false;
	options.maxItemsToShow = options.maxItemsToShow || -1;
	options.autoFill = options.autoFill || false;
	options.width = parseInt(options.width, 10) || 0;

	this.each(function() {
		var input = this;
		new jQuery.autocomplete(input, options);
	});

	// Don't break the chain
	return this;
}

jQuery.fn.autocompleteArray = function(data, options) {
	return this.autocomplete(null, options, data);
}

jQuery.fn.indexOf = function(e){
	for( var i=0; i<this.length; i++ ){
		if( this[i] == e ) return i;
	}
	return -1;
};
/*
 *
 * Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version 2.2.4
 * Demo: http://www.texotela.co.uk/code/jquery/select/
 *
 * $LastChangedDate$
 * $Rev$
 *
 */
 
;(function($) {
 
/**
 * Adds (single/multiple) options to a select box (or series of select boxes)
 *
 * @name     addOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @example  $("#myselect").addOption("Value", "Text"); // add single value (will be selected)
 * @example  $("#myselect").addOption("Value 2", "Text 2", false); // add single value (won't be selected)
 * @example  $("#myselect").addOption({"foo":"bar","bar":"baz"}, false); // add multiple values, but don't select
 *
 */
$.fn.addOption = function()
{
	var add = function(el, v, t, sO)
	{
		var option = document.createElement("option");
		option.value = v, option.text = t;
		// get options
		var o = el.options;
		// get number of options
		var oL = o.length;
		if(!el.cache)
		{
			el.cache = {};
			// loop through existing options, adding to cache
			for(var i = 0; i < oL; i++)
			{
				el.cache[o[i].value] = i;
			}
		}
		// add to cache if it isn't already
		if(typeof el.cache[v] == "undefined") el.cache[v] = oL;
		el.options[el.cache[v]] = option;
		if(sO)
		{
			option.selected = true;
		}
	};
	
	var a = arguments;
	if(a.length == 0) return this;
	// select option when added? default is true
	var sO = true;
	// multiple items
	var m = false;
	// other variables
	var items, v, t;
	if(typeof(a[0]) == "object")
	{
		m = true;
		items = a[0];
	}
	if(a.length >= 2)
	{
		if(typeof(a[1]) == "boolean") sO = a[1];
		else if(typeof(a[2]) == "boolean") sO = a[2];
		if(!m)
		{
			v = a[0];
			t = a[1];
		}
	}
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return;
			if(m)
			{
				for(var item in items)
				{
					add(this, item, items[item], sO);
				}
			}
			else
			{
				add(this, v, t, sO);
			}
		}
	);
	return this;
};

/**
 * Add options via ajax
 *
 * @name     ajaxAddOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    String url      Page to get options from (must be valid JSON)
 * @param    Object params   (optional) Any parameters to send with the request
 * @param    Boolean select  (optional) Select the added options, default true
 * @param    Function fn     (optional) Call this function with the select object as param after completion
 * @param    Array args      (optional) Array with params to pass to the function afterwards
 * @example  $("#myselect").ajaxAddOption("myoptions.php");
 * @example  $("#myselect").ajaxAddOption("myoptions.php", {"code" : "007"});
 * @example  $("#myselect").ajaxAddOption("myoptions.php", {"code" : "007"}, false, sortoptions, [{"dir": "desc"}]);
 *
 */
$.fn.ajaxAddOption = function(url, params, select, fn, args)
{
	if(typeof(url) != "string") return this;
	if(typeof(params) != "object") params = {};
	if(typeof(select) != "boolean") select = true;
	this.each(
		function()
		{
			var el = this;
			$.getJSON(url,
				params,
				function(r)
				{
					$(el).addOption(r, select);
					if(typeof fn == "function")
					{
						if(typeof args == "object")
						{
							fn.apply(el, args);
						} 
						else
						{
							fn.call(el);
						}
					}
				}
			);
		}
	);
	return this;
};

/**
 * Removes an option (by value or index) from a select box (or series of select boxes)
 *
 * @name     removeOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    String|RegExp|Number what  Option to remove
 * @param    Boolean selectedOnly       (optional) Remove only if it has been selected (default false)   
 * @example  $("#myselect").removeOption("Value"); // remove by value
 * @example  $("#myselect").removeOption(/^val/i); // remove options with a value starting with 'val'
 * @example  $("#myselect").removeOption(/./); // remove all options
 * @example  $("#myselect").removeOption(/./, true); // remove all options that have been selected
 * @example  $("#myselect").removeOption(0); // remove by index
 * @example  $("#myselect").removeOption(["myselect_1","myselect_2"]); // values contained in passed array
 *
 */
$.fn.removeOption = function()
{
	var a = arguments;
	if(a.length == 0) return this;
	var ta = typeof(a[0]);
	var v, index;
	// has to be a string or regular expression (object in IE, function in Firefox)
	if(ta == "string" || ta == "object" || ta == "function" )
	{
		v = a[0];
		// if an array, remove items
		if(v.constructor == Array)
		{
			var l = v.length;
			for(var i = 0; i<l; i++)
			{
				this.removeOption(v[i], a[1]); 
			}
			return this;
		}
	}
	else if(ta == "number") index = a[0];
	else return this;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return;
			// clear cache
			if(this.cache) this.cache = null;
			// does the option need to be removed?
			var remove = false;
			// get options
			var o = this.options;
			if(!!v)
			{
				// get number of options
				var oL = o.length;
				for(var i=oL-1; i>=0; i--)
				{
					if(v.constructor == RegExp)
					{
						if(o[i].value.match(v))
						{
							remove = true;
						}
					}
					else if(o[i].value == v)
					{
						remove = true;
					}
					// if the option is only to be removed if selected
					if(remove && a[1] === true) remove = o[i].selected;
					if(remove)
					{
						o[i] = null;
					}
					remove = false;
				}
			}
			else
			{
				// only remove if selected?
				if(a[1] === true)
				{
					remove = o[index].selected;
				}
				else
				{
					remove = true;
				}
				if(remove)
				{
					this.remove(index);
				}
			}
		}
	);
	return this;
};

/**
 * Sort options (ascending or descending) in a select box (or series of select boxes)
 *
 * @name     sortOptions
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    Boolean ascending   (optional) Sort ascending (true/undefined), or descending (false)
 * @example  // ascending
 * $("#myselect").sortOptions(); // or $("#myselect").sortOptions(true);
 * @example  // descending
 * $("#myselect").sortOptions(false);
 *
 */
$.fn.sortOptions = function(ascending)
{
	// get selected values first
	var sel = $(this).selectedValues();
	var a = typeof(ascending) == "undefined" ? true : !!ascending;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			// create an array for sorting
			var sA = [];
			// loop through options, adding to sort array
			for(var i = 0; i<oL; i++)
			{
				sA[i] = {
					v: o[i].value,
					t: o[i].text
				}
			}
			// sort items in array
			sA.sort(
				function(o1, o2)
				{
					// option text is made lowercase for case insensitive sorting
					o1t = o1.t.toLowerCase(), o2t = o2.t.toLowerCase();
					// if options are the same, no sorting is needed
					if(o1t == o2t) return 0;
					if(a)
					{
						return o1t < o2t ? -1 : 1;
					}
					else
					{
						return o1t > o2t ? -1 : 1;
					}
				}
			);
			// change the options to match the sort array
			for(var i = 0; i<oL; i++)
			{
				o[i].text = sA[i].t;
				o[i].value = sA[i].v;
			}
		}
	).selectOptions(sel, true); // select values, clearing existing ones
	return this;
};
/**
 * Selects an option by value
 *
 * @name     selectOptions
 * @author   Mathias Bank (http://www.mathias-bank.de), original function
 * @author   Sam Collett (http://www.texotela.co.uk), addition of regular expression matching
 * @type     jQuery
 * @param    String|RegExp|Array value  Which options should be selected
 * can be a string or regular expression, or an array of strings / regular expressions
 * @param    Boolean clear  Clear existing selected options, default false
 * @example  $("#myselect").selectOptions("val1"); // with the value 'val1'
 * @example  $("#myselect").selectOptions(["val1","val2","val3"]); // with the values 'val1' 'val2' 'val3'
 * @example  $("#myselect").selectOptions(/^val/i); // with the value starting with 'val', case insensitive
 *
 */
$.fn.selectOptions = function(value, clear)
{
	var v = value;
	var vT = typeof(value);
	// handle arrays
	if(vT == "object" && v.constructor == Array)
	{
		var $this = this;
		$.each(v, function()
			{
      				$this.selectOptions(this, clear);
    			}
		);
	};
	var c = clear || false;
	// has to be a string or regular expression (object in IE, function in Firefox)
	if(vT != "string" && vT != "function" && vT != "object") return this;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return this;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			for(var i = 0; i<oL; i++)
			{
				if(v.constructor == RegExp)
				{
					if(o[i].value.match(v))
					{
						o[i].selected = true;
					}
					else if(c)
					{
						o[i].selected = false;
					}
				}
				else
				{
					if(o[i].value == v)
					{
						o[i].selected = true;
					}
					else if(c)
					{
						o[i].selected = false;
					}
				}
			}
		}
	);
	return this;
};

/**
 * Copy options to another select
 *
 * @name     copyOptions
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @param    String to  Element to copy to
 * @param    String which  (optional) Specifies which options should be copied - 'all' or 'selected'. Default is 'selected'
 * @example  $("#myselect").copyOptions("#myselect2"); // copy selected options from 'myselect' to 'myselect2'
 * @example  $("#myselect").copyOptions("#myselect2","selected"); // same as above
 * @example  $("#myselect").copyOptions("#myselect2","all"); // copy all options from 'myselect' to 'myselect2'
 *
 */
$.fn.copyOptions = function(to, which)
{
	var w = which || "selected";
	if($(to).size() == 0) return this;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return this;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			for(var i = 0; i<oL; i++)
			{
				if(w == "all" || (w == "selected" && o[i].selected))
				{
					$(to).addOption(o[i].value, o[i].text);
				}
			}
		}
	);
	return this;
};

/**
 * Checks if a select box has an option with the supplied value
 *
 * @name     containsOption
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     Boolean|jQuery
 * @param    String|RegExp value  Which value to check for. Can be a string or regular expression
 * @param    Function fn          (optional) Function to apply if an option with the given value is found.
 * Use this if you don't want to break the chaining
 * @example  if($("#myselect").containsOption("val1")) alert("Has an option with the value 'val1'");
 * @example  if($("#myselect").containsOption(/^val/i)) alert("Has an option with the value starting with 'val'");
 * @example  $("#myselect").containsOption("val1", copyoption).doSomethingElseWithSelect(); // calls copyoption (user defined function) for any options found, chain is continued
 *
 */
$.fn.containsOption = function(value, fn)
{
	var found = false;
	var v = value;
	var vT = typeof(v);
	var fT = typeof(fn);
	// has to be a string or regular expression (object in IE, function in Firefox)
	if(vT != "string" && vT != "function" && vT != "object") return fT == "function" ? this: found;
	this.each(
		function()
		{
			if(this.nodeName.toLowerCase() != "select") return this;
			// option already found
			if(found && fT != "function") return false;
			// get options
			var o = this.options;
			// get number of options
			var oL = o.length;
			for(var i = 0; i<oL; i++)
			{
				if(v.constructor == RegExp)
				{
					if (o[i].value.match(v))
					{
						found = true;
						if(fT == "function") fn.call(o[i], i);
					}
				}
				else
				{
					if (o[i].value == v)
					{
						found = true;
						if(fT == "function") fn.call(o[i], i);
					}
				}
			}
		}
	);
	return fT == "function" ? this : found;
};

/**
 * Returns values which have been selected
 *
 * @name     selectedValues
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     Array
 * @example  $("#myselect").selectedValues();
 *
 */
$.fn.selectedValues = function()
{
	var v = [];
	this.selectedOptions().each(
		function()
		{
			v[v.length] = this.value;
		}
	);
	return v;
};

/**
 * Returns text which has been selected
 *
 * @name     selectedTexts
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     Array
 * @example  $("#myselect").selectedText();
 *
 */
$.fn.selectedTexts = function()
{
	var t = [];
	this.selectedOptions().each(
		function()
		{
			t[t.length] = this.text;
		}
	);
	return t;
};

/**
 * Returns options which have been selected
 *
 * @name     selectedOptions
 * @author   Sam Collett (http://www.texotela.co.uk)
 * @type     jQuery
 * @example  $("#myselect").selectedOptions();
 *
 */
$.fn.selectedOptions = function()
{
	return this.find("option:selected");
};

})(jQuery);/*
(c) Copyrights 2007 - 2008

Original idea by by Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
 
jQuery Plugin by Tzury Bar Yochay 
tzury.by@gmail.com
http://evalinux.wordpress.com
http://facebook.com/profile.php?id=513676303

Project's sites: 
http://code.google.com/p/js-hotkeys/
http://github.com/tzuryby/hotkeys/tree/master

License: same as jQuery license. 

USAGE:
    // simple usage
    $(document).bind('keydown', 'Ctrl+c', function(){ alert('copy anyone?');});
    
    // special options such as disableInIput
    $(document).bind('keydown', {combi:'Ctrl+x', disableInInput: true} , function() {});
    
Note:
    This plugin wraps the following jQuery methods: $.fn.find, $.fn.bind and $.fn.unbind
*/

(function (jQuery){
    // keep reference to the original $.fn.bind, $.fn.unbind and $.fn.find
    jQuery.fn.__bind__ = jQuery.fn.bind;
    jQuery.fn.__unbind__ = jQuery.fn.unbind;
    jQuery.fn.__find__ = jQuery.fn.find;
    
    var hotkeys = {
        version: '0.7.9',
        override: /keypress|keydown|keyup/g,
        triggersMap: {},
        
        specialKeys: { 27: 'esc', 9: 'tab', 32:'space', 13: 'return', 8:'backspace', 145: 'scroll', 
            20: 'capslock', 144: 'numlock', 19:'pause', 45:'insert', 36:'home', 46:'del',
            35:'end', 33: 'pageup', 34:'pagedown', 37:'left', 38:'up', 39:'right',40:'down', 
            109: '-', 
            112:'f1',113:'f2', 114:'f3', 115:'f4', 116:'f5', 117:'f6', 118:'f7', 119:'f8', 
            120:'f9', 121:'f10', 122:'f11', 123:'f12', 191: '/', 192: '`'},
        
        shiftNums: { "`":"~", "1":"!", "2":"@", "3":"#", "4":"$", "5":"%", "6":"^", "7":"&", 
            "8":"*", "9":"(", "0":")", "-":"_", "=":"+", ";":":", "'":"\"", ",":"<", 
            ".":">",  "/":"?",  "\\":"|" },
        
        newTrigger: function (type, combi, callback) { 
            // i.e. {'keyup': {'ctrl': {cb: callback, disableInInput: false}}}
            var result = {};
            result[type] = {};
            result[type][combi] = {cb: callback, disableInInput: false};
            return result;
        }
    };
    // add firefox num pad char codes
    //if (jQuery.browser.mozilla){
    // add num pad char codes
    hotkeys.specialKeys = jQuery.extend(hotkeys.specialKeys, { 96: '0', 97:'1', 98: '2', 99: 
        '3', 100: '4', 101: '5', 102: '6', 103: '7', 104: '8', 105: '9', 106: '*', 
        107: '+', 109: '-', 110: '.', 111 : '/'
        });
    //}
    
    // a wrapper around of $.fn.find 
    // see more at: http://groups.google.com/group/jquery-en/browse_thread/thread/18f9825e8d22f18d
    jQuery.fn.find = function( selector ) {
        this.query = selector;
        return jQuery.fn.__find__.apply(this, arguments);
	};
    
    jQuery.fn.unbind = function (type, combi, fn){
        if (jQuery.isFunction(combi)){
            fn = combi;
            combi = null;
        }
        if (combi && typeof combi === 'string'){
            var selectorId = ((this.prevObject && this.prevObject.query) || (this[0].id && this[0].id) || this[0]).toString();
            var hkTypes = type.split(' ');
            for (var x=0; x<hkTypes.length; x++){
                delete hotkeys.triggersMap[selectorId][hkTypes[x]][combi];
            }
        }
        // call jQuery original unbind
        return  this.__unbind__(type, fn);
    };
    
    jQuery.fn.bind = function(type, data, fn){
        // grab keyup,keydown,keypress
        var handle = type.match(hotkeys.override);
        
        if (jQuery.isFunction(data) || !handle){
            // call jQuery.bind only
            return this.__bind__(type, data, fn);
        }
        else{
            // split the job
            var result = null,            
            // pass the rest to the original $.fn.bind
            pass2jq = jQuery.trim(type.replace(hotkeys.override, ''));
            
            // see if there are other types, pass them to the original $.fn.bind
            if (pass2jq){
                result = this.__bind__(pass2jq, data, fn);
            }            
            
            if (typeof data === "string"){
                data = {'combi': data};
            }
            if(data.combi){
                for (var x=0; x < handle.length; x++){
                    var eventType = handle[x];
                    var combi = data.combi.toLowerCase(),
                        trigger = hotkeys.newTrigger(eventType, combi, fn),
                        selectorId = ((this.prevObject && this.prevObject.query) || (this[0].id && this[0].id) || this[0]).toString();
                        
                    //trigger[eventType][combi].propagate = data.propagate;
                    trigger[eventType][combi].disableInInput = data.disableInInput;
                    
                    // first time selector is bounded
                    if (!hotkeys.triggersMap[selectorId]) {
                        hotkeys.triggersMap[selectorId] = trigger;
                    }
                    // first time selector is bounded with this type
                    else if (!hotkeys.triggersMap[selectorId][eventType]) {
                        hotkeys.triggersMap[selectorId][eventType] = trigger[eventType];
                    }
                    // make trigger point as array so more than one handler can be bound
                    var mapPoint = hotkeys.triggersMap[selectorId][eventType][combi];
                    if (!mapPoint){
                        hotkeys.triggersMap[selectorId][eventType][combi] = [trigger[eventType][combi]];
                    }
                    else if (mapPoint.constructor !== Array){
                        hotkeys.triggersMap[selectorId][eventType][combi] = [mapPoint];
                    }
                    else {
                        hotkeys.triggersMap[selectorId][eventType][combi][mapPoint.length] = trigger[eventType][combi];
                    }
                    
                    // add attribute and call $.event.add per matched element
                    this.each(function(){
                        // jQuery wrapper for the current element
                        var jqElem = jQuery(this);
                        
                        // element already associated with another collection
                        if (jqElem.attr('hkId') && jqElem.attr('hkId') !== selectorId){
                            selectorId = jqElem.attr('hkId') + ";" + selectorId;
                        }
                        jqElem.attr('hkId', selectorId);
                    });
                    result = this.__bind__(handle.join(' '), data, hotkeys.handler)
                }
            }
            return result;
        }
    };
    // work-around for opera and safari where (sometimes) the target is the element which was last 
    // clicked with the mouse and not the document event it would make sense to get the document
    hotkeys.findElement = function (elem){
        if (!jQuery(elem).attr('hkId')){
            if (jQuery.browser.opera || jQuery.browser.safari){
                while (!jQuery(elem).attr('hkId') && elem.parentNode){
                    elem = elem.parentNode;
                }
            }
        }
        return elem;
    };
    // the event handler
    hotkeys.handler = function(event) {
        var target = hotkeys.findElement(event.currentTarget), 
            jTarget = jQuery(target),
            ids = jTarget.attr('hkId');
        
        if(ids){
            ids = ids.split(';');
            var code = event.which,
                type = event.type,
                special = hotkeys.specialKeys[code],
                // prevent f5 overlapping with 't' (or f4 with 's', etc.)
                character = !special && String.fromCharCode(code).toLowerCase(),
                shift = event.shiftKey,
                ctrl = event.ctrlKey,            
                // patch for jquery 1.2.5 && 1.2.6 see more at:  
                // http://groups.google.com/group/jquery-en/browse_thread/thread/83e10b3bb1f1c32b
                alt = event.altKey || event.originalEvent.altKey,
                mapPoint = null;

            for (var x=0; x < ids.length; x++){
                if (hotkeys.triggersMap[ids[x]][type]){
                    mapPoint = hotkeys.triggersMap[ids[x]][type];
                    break;
                }
            }
            
            //find by: id.type.combi.options            
            if (mapPoint){ 
                var trigger;
                // event type is associated with the hkId
                if(!shift && !ctrl && !alt) { // No Modifiers
                    trigger = mapPoint[special] ||  (character && mapPoint[character]);
                }
                else{
                    // check combinations (alt|ctrl|shift+anything)
                    var modif = '';
                    if(alt) modif +='alt+';
                    if(ctrl) modif+= 'ctrl+';
                    if(shift) modif += 'shift+';
                    // modifiers + special keys or modifiers + character or modifiers + shift character or just shift character
                    trigger = mapPoint[modif+special];
                    if (!trigger){
                        if (character){
                            trigger = mapPoint[modif+character] 
                                || mapPoint[modif+hotkeys.shiftNums[character]]
                                // '$' can be triggered as 'Shift+4' or 'Shift+$' or just '$'
                                || (modif === 'shift+' && mapPoint[hotkeys.shiftNums[character]]);
                        }
                    }
                }
                if (trigger){
                    var result = false;
                    for (var x=0; x < trigger.length; x++){
                        if(trigger[x].disableInInput){
                            // double check event.currentTarget and event.target
                            var elem = jQuery(event.target);
                            if (jTarget.is("input") || jTarget.is("textarea") || jTarget.is("select") 
                                || elem.is("input") || elem.is("textarea") || elem.is("select")) {
                                return true;
                            }
                        }                       
                        // call the registered callback function
                        result = result || trigger[x].cb.apply(this, [event]);
                    }
                    return result;
                }
            }
        }
    };
    // place it under window so it can be extended and overridden by others
    window.hotkeys = hotkeys;
    return jQuery;
})(jQuery);
jQuery.fn.dump = function(showTypes, showAttributes) {
	jQuery.dump($(this), showTypes, showAttributes);
	return this;
};

jQuery.dump = function(object, showTypes, showAttributes) {
  var dump = '';
  var st = typeof showTypes == 'undefined' ? true : showTypes;
  var sa = typeof showAttributes == 'undefined' ? true : showAttributes;  
  var winName = 'dumpWin';
  var w = 760;
  var h = 500;
  var leftPos = screen.width ? (screen.width - w) / 2 : 0;
  var topPos = screen.height ? (screen.height - h) / 2 : 0;
  var settings = 'height=' + h + ',width=' + w + ',top=' + topPos + ',left=' + leftPos + ',scrollbars=yes,menubar=yes,status=yes,resizable=yes';
  var title = 'Dump';
  var script = 'function tRow(s) {t = s.parentNode.lastChild;tTarget(t, tSource(s)) ;}function tTable(s) {var switchToState = tSource(s) ;var table = s.parentNode.parentNode;for (var i = 1; i < table.childNodes.length; i++) {t = table.childNodes[i] ;if (t.style) {tTarget(t, switchToState);}}}function tSource(s) {if (s.style.fontStyle == "italic" || s.style.fontStyle == null) {s.style.fontStyle = "normal";s.title = "click to collapse";return "open";} else {s.style.fontStyle = "italic";s.title = "click to expand";return "closed" ;}}function tTarget (t, switchToState) {if (switchToState == "open") {t.style.display = "";} else {t.style.display = "none";}}';	
  
 var _recurse = function (o, type) {
    var i;
	var j = 0;
	var r = '';
	type = _dumpType(o);
	switch (type) {		
	  case 'regexp':
	    var t = type;
	    r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan="2"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';
	    r += '<tr><td colspan="2"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>RegExp: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>';  
	    j++;
	    break;
	  case 'date':
	    var t = type;
	    r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan="2"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';
	    r += '<tr><td colspan="2"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>Date: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>';  
	    j++;
	    break;
	  case 'function':
	    var t = type;
	    var a = o.toString().match(/^.*function.*?\((.*?)\)/im); 
	    var args = (a == null || typeof a[1] == 'undefined' || a[1] == '') ? 'none' : a[1];
	    r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan="2"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';
	    r += '<tr><td colspan="2"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>Arguments: </i></td><td' + _dumpStyles(type,'td-value') + '>' + args + '</td></tr><tr><td' + _dumpStyles('arguments','td-key') + '><i>Function: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>';  
	    j++;
	    break;
	  case 'domelement':
	    var t = type;
		var attr = '';
		if (sa) {
		  for (i in o) {if (!/innerHTML|outerHTML/i.test(i)) {attr += i + ': ' + o[i] + '<br />';}}
		}
	    r += '<table' + _dumpStyles(t,'table') + '><tr><th colspan="2"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';
	    r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Name: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeName.toLowerCase() + '</td></tr>';  
		r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Type: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeType + '</td></tr>'; 
		r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Value: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeValue + '</td></tr>';
		if (sa) {
		  r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Attributes: </i></td><td' + _dumpStyles(type,'td-value') + '>' + attr + '</td></tr>';  		
		  r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>innerHTML: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.innerHTML + '</td></tr>'; 
		  if (typeof o.outerHTML != 'undefined') {
		    r += '<tr><td' + _dumpStyles(t,'td-key') + '><i>outerHTML: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.outerHTML + '</td></tr>'; 
		  }
		}
	    j++;
	    break;		
	}
	if (/object|array/.test(type)) {
      for (i in o) {
	    var t = _dumpType(o[i]);
	    if (j < 1) {
	      r += '<table' + _dumpStyles(type,'table') + '><tr><th colspan="2"' + _dumpStyles(type,'th') + '>' + type + '</th></tr>';
		  j++;	  
	    }
	    if (typeof o[i] == 'object' && o[i] != null) { 
		  r += '<tr><td' + _dumpStyles(type,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + _recurse(o[i], t) + '</td></tr>';	
	    } else if (typeof o[i] == 'function') {
		  r += '<tr><td' + _dumpStyles(type ,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + _recurse(o[i], t) + '</td></tr>';  	
		} else {
		  r += '<tr><td' + _dumpStyles(type,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + o[i] + '</td></tr>';  
	    }
	  }
	}
	if (j == 0) {
	  r += '<table' + _dumpStyles(type,'table') + '><tr><th colspan="2"' + _dumpStyles(type,'th') + '>' + type + ' [empty]</th></tr>'; 	
	}
	r += '</table>';
	return r;
  };	
  var _dumpStyles = function(type, use) {
  var r = '';
  var table = 'font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;cell-spacing:2px;';
  var th = 'font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;text-align:left;color: white;padding: 5px;vertical-align :top;cursor:hand;cursor:pointer;';
  var td = 'font-size:xx-small;font-family:verdana,arial,helvetica,sans-serif;vertical-align:top;padding:3px;';
  var thScript = 'onClick="tTable(this);" title="click to collapse"';
  var tdScript = 'onClick="tRow(this);" title="click to collapse"';
  switch (type) {
	case 'string':
	case 'number':
	case 'boolean':
	case 'undefined':
	case 'object':
	  switch (use) {
		case 'table':  
		  r = ' style="' + table + 'background-color:#0000cc;"';
		  break;
		case 'th':
		  r = ' style="' + th + 'background-color:#4444cc;"' + thScript;
		  break;
		case 'td-key':
		  r = ' style="' + td + 'background-color:#ccddff;cursor:hand;cursor:pointer;"' + tdScript;
		  break;
		case 'td-value':
		  r = ' style="' + td + 'background-color:#fff;"';
		  break;
	  }
	  break;
	case 'array':
	  switch (use) {
		case 'table':  
		  r = ' style="' + table + 'background-color:#006600;"';
		  break;
		case 'th':
		  r = ' style="' + th + 'background-color:#009900;"' + thScript;
		  break;
		case 'td-key':
		  r = ' style="' + td + 'background-color:#ccffcc;cursor:hand;cursor:pointer;"' + tdScript;
		  break;
		case 'td-value':
		  r = ' style="' + td + 'background-color:#fff;"';
		  break;
	  }	
	  break;
	case 'function':
	  switch (use) {
		case 'table':  
		  r = ' style="' + table + 'background-color:#aa4400;"';
		  break;
		case 'th':
		  r = ' style="' + th + 'background-color:#cc6600;"' + thScript;
		  break;
		case 'td-key':
		  r = ' style="' + td + 'background-color:#fff;cursor:hand;cursor:pointer;"' + tdScript;
		  break;
		case 'td-value':
		  r = ' style="' + td + 'background-color:#fff;"';
		  break;
	  }	
	  break;
	case 'arguments':
	  switch (use) {
		case 'table':  
		  r = ' style="' + table + 'background-color:#dddddd;cell-spacing:3;"';
		  break;
		case 'td-key':
		  r = ' style="' + th + 'background-color:#eeeeee;color:#000000;cursor:hand;cursor:pointer;"' + tdScript;
		  break;	  
	  }	
	  break;
	case 'regexp':
	  switch (use) {
		case 'table':  
		  r = ' style="' + table + 'background-color:#CC0000;cell-spacing:3;"';
		  break;
		case 'th':
		  r = ' style="' + th + 'background-color:#FF0000;"' + thScript;
		  break;
		case 'td-key':
		  r = ' style="' + th + 'background-color:#FF5757;color:#000000;cursor:hand;cursor:pointer;"' + tdScript;
		  break;
		case 'td-value':
		  r = ' style="' + td + 'background-color:#fff;"';
		  break;		  
	  }	
	  break;
	case 'date':
	  switch (use) {
		case 'table':  
		  r = ' style="' + table + 'background-color:#663399;cell-spacing:3;"';
		  break;
		case 'th':
		  r = ' style="' + th + 'background-color:#9966CC;"' + thScript;
		  break;
		case 'td-key':
		  r = ' style="' + th + 'background-color:#B266FF;color:#000000;cursor:hand;cursor:pointer;"' + tdScript;
		  break;
		case 'td-value':
		  r = ' style="' + td + 'background-color:#fff;"';
		  break;		  
	  }	
	  break;
	case 'domelement':
	case 'document':
	case 'window':
	  switch (use) {
		case 'table':  
		  r = ' style="' + table + 'background-color:#FFCC33;cell-spacing:3;"';
		  break;
		case 'th':
		  r = ' style="' + th + 'background-color:#FFD966;"' + thScript;
		  break;
		case 'td-key':
		  r = ' style="' + th + 'background-color:#FFF2CC;color:#000000;cursor:hand;cursor:pointer;"' + tdScript;
		  break;
		case 'td-value':
		  r = ' style="' + td + 'background-color:#fff;"';
		  break;		  
	  }	
	  break;	  
  }
  return r;
  };
  var _dumpType = function (obj) {
    var t = typeof(obj);
    if (t == 'function') {
      var f = obj.toString();
      if ( ( /^\/.*\/[gi]??[gi]??$/ ).test(f)) {
        return 'regexp';
      } else if ((/^\[object.*\]$/i ).test(f)) {
        t = 'object'
      }
    }
    if (t != 'object') {
      return t;
    }
    switch (obj) {
      case null:
        return 'null';
      case window:
        return 'window';
	  case document:
	    return 'document';
      case window.event:
        return 'event';
    }
    if (window.event && (event.type == obj.type)) {
      return 'event';
    }
    var c = obj.constructor;
    if (c != null) {
      switch(c) {
        case Array:
          t = 'array';
          break;
        case Date:
          return 'date';
        case RegExp:
          return 'regexp';
        case Object:
          t = 'object';	
        break;
        case ReferenceError:
          return 'error';
        default:
          var sc = c.toString();
          var m = sc.match(/\s*function (.*)\(/);
          if (m != null) {
            return 'object';
          }
      }
    }
    var nt = obj.nodeType;
    if (nt != null) {
      switch(nt) {
        case 1:
          return 'domelement';
        case 3:
          return 'string';
      }
    }
    if (obj.toString != null) {
      var ex = obj.toString();
      var am = ex.match(/^\[object (.*)\]$/i);
      if (am != null) {
        var am = am[1];
        switch(am.toLowerCase()) {
          case 'event':
            return 'event';
          case 'nodelist':
          case 'htmlcollection':
          case 'elementarray':
            return 'array';
          case 'htmldocument':
            return 'htmldocument';
        }
      }
    }
    return t;
  };  
  dump += (/string|number|undefined|boolean/.test(typeof(object)) || object == null) ? object : _recurse(object, typeof object);
  winName = window.open('', '', settings);
  if (jQuery.browser.msie || jQuery.browser.browser == 'opera' || jQuery.browser.browser == 'safari') {
	winName.document.write('<html><head><title> ' + title + ' </title><script type="text/javascript">' + script + '</script><head>');
	winName.document.write('<body>' + dump + '</body></html>');
  } else {
	winName.document.body.innerHTML = dump;
	winName.document.title = title;
	var ffs = winName.document.createElement('script');
	ffs.setAttribute('type', 'text/javascript');
	ffs.appendChild(document.createTextNode(script));
	winName.document.getElementsByTagName('head')[0].appendChild(ffs);
  }
  winName.focus();  
};/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.5.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.5
 * @date April 11, 2008
 * @category jQuery plugin
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */

// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
(function($) {
	/**
	 * $ is an alias to jQuery object
	 *
	 */
	$.fn.lightBox = function(settings) {
		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			// Configuration related to overlay
			overlayBgColor: 		'#000',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
			overlayOpacity:			0.8,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
			// Configuration related to navigation
			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
			// Configuration related to images
			imageLoading:			'./js/jquery/themes/default/lightbox/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
			imageBtnPrev:			'./js/jquery/themes/default/lightbox/lightbox-btn-prev.gif',		// (string) Path and the name of the prev button image
			imageBtnNext:			'./js/jquery/themes/default/lightbox/lightbox-btn-next.gif',		// (string) Path and the name of the next button image
			imageBtnClose:			'./js/jquery/themes/default/lightbox/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
			imageBlank:				'./js/jquery/themes/default/lightbox/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
			// Configuration related to container image box
			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
			txtImage:				'Image',	// (string) Specify text "Image"
			txtOf:					'of',		// (string) Specify text "of"
			// Configuration related to keyboard navigation
			keyToClose:				'c',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image
			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.
			// Don´t alter these variables in any way
			imageArray:				[],
			activeImage:			0
		},settings);
		// Caching the jQuery object with all elements matched
		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
		/**
		 * Initializing the plugin calling the start function
		 *
		 * @return boolean false
		 */
		function _initialize() {
			_start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
			return false; // Avoid the browser following the link
		}
		/**
		 * Start the jQuery lightBox plugin
		 *
		 * @param object objClicked The object (link) whick the user have clicked
		 * @param object jQueryMatchedObj The jQuery object with all elements matched
		 */
		function _start(objClicked,jQueryMatchedObj) {
			if(objClicked.getAttribute('href') =="")return;

			// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'hidden' });
			// Call the function to create the markup structure; style some elements; assign events in some elements.
			_set_interface();
			// Unset total images in imageArray
			settings.imageArray.length = 0;
			// Unset image active information
			settings.activeImage = 0;
			// We have an image set? Or just an image? Let´s see it.
			if ( jQueryMatchedObj.length == 1 ) {
				settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));
			} else {
				// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references		
				for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
					settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
				}
			}
			while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
				settings.activeImage++;
			}
			// Call the function that prepares image exibition
			_set_image_to_view();
		}
		/**
		 * Create the jQuery lightBox plugin interface
		 *
		 * The HTML markup will be like that:
			<div id="jquery-overlay"></div>
			<div id="jquery-lightbox">
				<div id="lightbox-container-image-box">
					<div id="lightbox-container-image">
						<img src="../fotos/XX.jpg" id="lightbox-image">
						<div id="lightbox-nav">
							<a href="#" id="lightbox-nav-btnPrev"></a>
							<a href="#" id="lightbox-nav-btnNext"></a>
						</div>
						<div id="lightbox-loading">
							<a href="#" id="lightbox-loading-link">
								<img src="../themes/default/lightbox/lightbox-ico-loading.gif">
							</a>
						</div>
					</div>
				</div>
				<div id="lightbox-container-image-data-box">
					<div id="lightbox-container-image-data">
						<div id="lightbox-image-details">
							<span id="lightbox-image-details-caption"></span>
							<span id="lightbox-image-details-currentNumber"></span>
						</div>
						<div id="lightbox-secNav">
							<a href="#" id="lightbox-secNav-btnClose">
								<img src="../themes/default/lightbox/lightbox-btn-close.gif">
							</a>
						</div>
					</div>
				</div>
			</div>
		 *
		 */
		function _set_interface() {
			// Apply the HTML markup into body tag
			$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');	
			// Get page sizes
			var arrPageSizes = ___getPageSize();
			// Style overlay and show it
			$('#jquery-overlay').css({
				backgroundColor:	settings.overlayBgColor,
				opacity:			settings.overlayOpacity,
				width:				arrPageSizes[0],
				height:				arrPageSizes[1]
			}).fadeIn();
			// Get page scroll
			var arrPageScroll = ___getPageScroll();
			// Calculate top and left offset for the jquery-lightbox div object and show it
			$('#jquery-lightbox').css({
				top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
				left:	arrPageScroll[0]
			}).show();
			// Assigning click events in elements to close overlay
			$('#jquery-overlay,#jquery-lightbox').click(function() {
				_finish();									
			});
			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
			$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
				_finish();
				return false;
			});
			// If window was resized, calculate the new overlay dimensions
			$(window).resize(function() {
				// Get page sizes
				var arrPageSizes = ___getPageSize();
				// Style overlay and show it
				$('#jquery-overlay').css({
					width:		arrPageSizes[0],
					height:		arrPageSizes[1]
				});
				// Get page scroll
				var arrPageScroll = ___getPageScroll();
				// Calculate top and left offset for the jquery-lightbox div object and show it
				$('#jquery-lightbox').css({
					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
					left:	arrPageScroll[0]
				});
			});
		}
		/**
		 * Prepares image exibition; doing a image´s preloader to calculate it´s size
		 *
		 */
		function _set_image_to_view() { // show the loading
			// Show the loading
			$('#lightbox-loading').show();
			if ( settings.fixedNavigation ) {
				$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			} else {
				// Hide some elements
				$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			}
			// Image preload process
			var objImagePreloader = new Image();
			objImagePreloader.onload = function() {
				$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
				// Perfomance an effect in the image container resizing it
				_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
				//	clear onLoad, IE behaves irratically with animated gifs otherwise
				objImagePreloader.onload=function(){};
			};
			objImagePreloader.src = settings.imageArray[settings.activeImage][0];
		};
		/**
		 * Perfomance an effect in the image container resizing it
		 *
		 * @param integer intImageWidth The image´s width that will be showed
		 * @param integer intImageHeight The image´s height that will be showed
		 */
		function _resize_container_image_box(intImageWidth,intImageHeight) {
			// Get current width and height
			var intCurrentWidth = $('#lightbox-container-image-box').width();
			var intCurrentHeight = $('#lightbox-container-image-box').height();
			// Get the width and height of the selected image plus the padding
			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value
			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value
			// Diferences
			var intDiffW = intCurrentWidth - intWidth;
			var intDiffH = intCurrentHeight - intHeight;
			// Perfomance the effect
			$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
				if ( $.browser.msie ) {
					___pause(250);
				} else {
					___pause(100);	
				}
			} 
			$('#lightbox-container-image-data-box').css({ width: intImageWidth });
			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
		};
		/**
		 * Show the prepared image
		 *
		 */
		function _show_image() {
			$('#lightbox-loading').hide();
			$('#lightbox-image').fadeIn(function() {
				_show_image_data();
				_set_navigation();
			});
			_preload_neighbor_images();
		};
		/**
		 * Show the image information
		 *
		 */
		function _show_image_data() {
			$('#lightbox-container-image-data-box').slideDown('fast');
			$('#lightbox-image-details-caption').hide();
			if ( settings.imageArray[settings.activeImage][1] ) {
				$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
			}
			// If we have a image set, display 'Image X of X'
			if ( settings.imageArray.length > 1 ) {
				$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
			}		
		}
		/**
		 * Display the button navigations
		 *
		 */
		function _set_navigation() {
			$('#lightbox-nav').show();

			// Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just.
			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
			
			// Show the prev button, if not the first image in set
			if ( settings.activeImage != 0 ) {
				if ( settings.fixedNavigation ) {
					$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
						.unbind()
						.bind('click',function() {
							settings.activeImage = settings.activeImage - 1;
							_set_image_to_view();
							return false;
						});
				} else {
					// Show the images button for Next buttons
					$('#lightbox-nav-btnPrev').unbind().hover(function() {
						$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
					},function() {
						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
					}).show().bind('click',function() {
						settings.activeImage = settings.activeImage - 1;
						_set_image_to_view();
						return false;
					});
				}
			}
			
			// Show the next button, if not the last image in set
			if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
				if ( settings.fixedNavigation ) {
					$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
						.unbind()
						.bind('click',function() {
							settings.activeImage = settings.activeImage + 1;
							_set_image_to_view();
							return false;
						});
				} else {
					// Show the images button for Next buttons
					$('#lightbox-nav-btnNext').unbind().hover(function() {
						$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
					},function() {
						$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
					}).show().bind('click',function() {
						settings.activeImage = settings.activeImage + 1;
						_set_image_to_view();
						return false;
					});
				}
			}
			// Enable keyboard navigation
			_enable_keyboard_navigation();
		}
		/**
		 * Enable a support to keyboard navigation
		 *
		 */
		function _enable_keyboard_navigation() {
			$(document).keydown(function(objEvent) {
				_keyboard_action(objEvent);
			});
		}
		/**
		 * Disable the support to keyboard navigation
		 *
		 */
		function _disable_keyboard_navigation() {
			$(document).unbind();
		}
		/**
		 * Perform the keyboard actions
		 *
		 */
		function _keyboard_action(objEvent) {
			// To ie
			if ( objEvent == null ) {
				keycode = event.keyCode;
				escapeKey = 27;
			// To Mozilla
			} else {
				keycode = objEvent.keyCode;
				escapeKey = objEvent.DOM_VK_ESCAPE;
			}
			// Get the key in lower case form
			key = String.fromCharCode(keycode).toLowerCase();
			// Verify the keys to close the ligthBox
			if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
				_finish();
			}
			// Verify the key to show the previous image
			if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
				// If we´re not showing the first image, call the previous
				if ( settings.activeImage != 0 ) {
					settings.activeImage = settings.activeImage - 1;
					_set_image_to_view();
					_disable_keyboard_navigation();
				}
			}
			// Verify the key to show the next image
			if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
				// If we´re not showing the last image, call the next
				if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
					settings.activeImage = settings.activeImage + 1;
					_set_image_to_view();
					_disable_keyboard_navigation();
				}
			}
		}
		/**
		 * Preload prev and next images being showed
		 *
		 */
		function _preload_neighbor_images() {
			if ( (settings.imageArray.length -1) > settings.activeImage ) {
				objNext = new Image();
				objNext.src = settings.imageArray[settings.activeImage + 1][0];
			}
			if ( settings.activeImage > 0 ) {
				objPrev = new Image();
				objPrev.src = settings.imageArray[settings.activeImage -1][0];
			}
		}
		/**
		 * Remove jQuery lightBox plugin HTML markup
		 *
		 */
		function _finish() {
			$('#jquery-lightbox').remove();
			$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'visible' });
		}
		/**
		 / THIRD FUNCTION
		 * getPageSize() by quirksmode.com
		 *
		 * @return Array Return an array with page width, height and window width, height
		 */
		function ___getPageSize() {
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = window.innerWidth + window.scrollMaxX;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				if(document.documentElement.clientWidth){
					windowWidth = document.documentElement.clientWidth; 
				} else {
					windowWidth = self.innerWidth;
				}
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){	
				pageWidth = xScroll;		
			} else {
				pageWidth = windowWidth;
			}
			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
			return arrayPageSize;
		};
		/**
		 / THIRD FUNCTION
		 * getPageScroll() by quirksmode.com
		 *
		 * @return Array Return an array with x,y page scroll values.
		 */
		function ___getPageScroll() {
			var xScroll, yScroll;
			if (self.pageYOffset) {
				yScroll = self.pageYOffset;
				xScroll = self.pageXOffset;
			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
				yScroll = document.documentElement.scrollTop;
				xScroll = document.documentElement.scrollLeft;
			} else if (document.body) {// all other Explorers
				yScroll = document.body.scrollTop;
				xScroll = document.body.scrollLeft;	
			}
			arrayPageScroll = new Array(xScroll,yScroll);
			return arrayPageScroll;
		};
		 /**
		  * Stop the code execution from a escified time in milisecond
		  *
		  */
		 function ___pause(ms) {
			var date = new Date(); 
			curDate = null;
			do { var curDate = new Date(); }
			while ( curDate - date < ms);
		 };
		// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
		return this.unbind('click').click(_initialize);
	};
})(jQuery); // Call and execute the function immediately passing the jQuery object
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);/*! http://mths.be/placeholder v1.8.7 by @mathias */
(function(f,h,c){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=c.fn,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){return this.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind('focus.placeholder',b).bind('blur.placeholder',e).trigger('blur.placeholder').end()};j.input=a;j.textarea=d;c(function(){c(h).delegate('form','submit.placeholder',function(){var k=c('.placeholder',this).each(b);setTimeout(function(){k.each(e)},10)})});c(f).bind('unload.placeholder',function(){c('.placeholder').val('')})}function g(l){var k={},m=/^jQuery\d+$/;c.each(l.attributes,function(o,n){if(n.specified&&!m.test(n.name)){k[n.name]=n.value}});return k}function b(){var k=c(this);if(k.val()===k.attr('placeholder')&&k.hasClass('placeholder')){if(k.data('placeholder-password')){k.hide().next().show().focus().attr('id',k.removeAttr('id').data('placeholder-id'))}else{k.val('').removeClass('placeholder')}}}function e(){var o,n=c(this),k=n,m=this.id;if(n.val()===''){if(n.is(':password')){if(!n.data('placeholder-textinput')){try{o=n.clone().attr({type:'text'})}catch(l){o=c('<input>').attr(c.extend(g(this),{type:'text'}))}o.removeAttr('name').data('placeholder-password',true).data('placeholder-id',m).bind('focus.placeholder',b);n.data('placeholder-textinput',o).data('placeholder-id',m).before(o)}n=n.removeAttr('id').hide().prev().attr('id',m).show()}n.addClass('placeholder').val(n.attr('placeholder'))}else{n.removeClass('placeholder')}}}(this,document,jQuery));/* Created by Martin Hintzmann 2008 martin [a] hintzmann.dk
 * MIT (http://www.opensource.org/licenses/mit-license.php) licensed.
 *
 * Version: 0.2
 * Requires: jQuery 1.2+
 * http://plugins.jquery.com/project/textshadow
 *
 */
(function($) {
	$.fn.textShadow = function(option) {
		if (!$.browser.msie) return;
		var IE6 = $.browser.version < 7;
		return this.each(function() {
			var el = $(this);
			var shadow = el.textShadowParse(this.currentStyle["text-shadow"]);
			shadow = $.extend(shadow, option);

			el.textShadowRemove();

			if (shadow.x == 0 && shadow.y == 0 && shadow.radius == 0) return;

			if (el.css("position")=="static") {
				el.css({position:"relative"});
			}
			el.css({zIndex:"0"});
			if (IE6) {
				el.css({zoom:"1"});
			}
			
			var span=document.createElement("span");
			$(span).addClass("jQueryTextShadow");
			$(span).html(el.html());
			$(span).css({
				padding:		this.currentStyle["padding"],	
				width:		el.width(),
				position:	"absolute",
				zIndex:		"-1",
				color:		shadow.color!=null?shadow.color:el.css("color"),
				left:			(-parseInt(shadow.radius)+parseInt(shadow.x))+"px",
				top:			(-parseInt(shadow.radius)+parseInt(shadow.y))+"px"
			});
			
			if (shadow.radius != 0) {
				if (shadow.opacity != null) {
					$(span).css("filter", "progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true', makeShadow='true', ShadowOpacity="+shadow.opacity+")");
				} else {
					$(span).css("filter", "progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true')");
				}
			}	
			el.append(span);
		
	  });
	};
	
	$.fn.textShadowParse = function(value) 
	{
		value = String(value)
			.replace(/^\s+|\s+$/gi, '')
			.replace(/\s*!\s*important/i, '')
			.replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g, '($1/$2/$3/$4)')
			.replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g, '($1/$2/$3)')
	
		var shadow = {
			x      : 0,
			y      : 0,
			radius : 0,
			color  : null
		};

		if (value.length > 1 || value[0].toLowerCase() != 'none') {
			value = value.replace(/\//g, ',');
			var color;
			if ( value.match(/(\#[0-9a-f]{6}|\#[0-9a-f]{3}|(rgb|hsb)a?\([^\)]*\)|\b[a-z]+\b)/i) && (color = RegExp.$1) ) {
				shadow.color = color.replace(/^\s+/, '');
				value = value.replace(shadow.color, '');
			}

			value = value
				.replace(/^\s+|\s+$/g, '')
				.split(/\s+/)
				.map(function(item) {
						return (item || '').replace(/^0[a-z]*$/, '') ? item : 0 ;
					});

			switch (value.length)
			{
				case 1:
					shadow.x = shadow.y = value[0];
					break;
				case 2:
					shadow.x = value[0];
					shadow.y = value[1];
					break;
				case 3:
					shadow.x = value[0];
					shadow.y = value[1];
					shadow.radius = value[2];
					break;
			}
			if ((!shadow.x && !shadow.y && !shadow.radius) || shadow.color == 'transparent') {
				shadow.x = shadow.y = shadow.radius = 0;
				shadow.color = null;
			}
		}

		return shadow;
	};

	$.fn.textShadowRemove = function() {
		if (!$.browser.msie) return;
		return this.each(function() {
			$(this).children("span.jQueryTextShadow").remove();
		});
	};
})(jQuery);

if(typeof Array.prototype.map == 'undefined') {
	Array.prototype.map = function(fnc) {
		var a = new Array(this.length);
		for (var i = 0; i < this.length; i++) {
			a[i] = fnc(this[i]);
		}
		return a;
	}
}/* 
 * License: /js/phpjs/license.txt
 */ 


// Compression: minified


function _phpjs_shared_bc(){var libbcmath={PLUS:'+',MINUS:'-',BASE:10,scale:0,bc_num:function(){this.n_sign=null;this.n_len=null;this.n_scale=null;this.n_value=null;this.toString=function(){var r,tmp;tmp=this.n_value.join('');r=((this.n_sign==libbcmath.PLUS)?'':this.n_sign)+tmp.substr(0,this.n_len);if(this.n_scale>0){r+='.'+tmp.substr(this.n_len,this.n_scale);}
return r;};},bc_add:function(n1,n2,scale_min){var sum,cmp_res,res_scale;if(n1.n_sign===n2.n_sign){sum=libbcmath._bc_do_add(n1,n2,scale_min);sum.n_sign=n1.n_sign;}else{cmp_res=libbcmath._bc_do_compare(n1,n2,false,false);switch(cmp_res){case-1:sum=libbcmath._bc_do_sub(n2,n1,scale_min);sum.n_sign=n2.n_sign;break;case 0:res_scale=libbcmath.MAX(scale_min,libbcmath.MAX(n1.n_scale,n2.n_scale));sum=libbcmath.bc_new_num(1,res_scale);libbcmath.memset(sum.n_value,0,0,res_scale+1);break;case 1:sum=libbcmath._bc_do_sub(n1,n2,scale_min);sum.n_sign=n1.n_sign;}}
return sum;},bc_compare:function(n1,n2){return libbcmath._bc_do_compare(n1,n2,true,false);},_one_mult:function(num,n_ptr,size,digit,result,r_ptr){var carry,value;var nptr,rptr;if(digit===0){libbcmath.memset(result,0,0,size);}else{if(digit==1){libbcmath.memcpy(result,r_ptr,num,n_ptr,size);}else{nptr=n_ptr+size-1;rptr=r_ptr+size-1;carry=0;while(size-->0){value=num[nptr--]*digit+carry;result[rptr--]=value%libbcmath.BASE;carry=Math.floor(value/libbcmath.BASE);}
if(carry!==0){result[rptr]=carry;}}}},bc_divide:function(n1,n2,scale){var quot;var qval;var num1,num2;var ptr1,ptr2,n2ptr,qptr;var scale1,val;var len1,len2,scale2,qdigits,extra,count;var qdig,qguess,borrow,carry;var mval;var zero;var norm;var ptrs;if(libbcmath.bc_is_zero(n2)){return-1;}
if(libbcmath.bc_is_zero(n1)){return libbcmath.bc_new_num(1,scale);}
if(n2.n_scale===0){if(n2.n_len===1&&n2.n_value[0]===1){qval=libbcmath.bc_new_num(n1.n_len,scale);qval.n_sign=(n1.n_sign==n2.n_sign?libbcmath.PLUS:libbcmath.MINUS);libbcmath.memset(qval.n_value,n1.n_len,0,scale);libbcmath.memcpy(qval.n_value,0,n1.n_value,0,n1.n_len+libbcmath.MIN(n1.n_scale,scale));}}
scale2=n2.n_scale;n2ptr=n2.n_len+scale2-1;while((scale2>0)&&(n2.n_value[n2ptr--]===0)){scale2--;}
len1=n1.n_len+scale2;scale1=n1.n_scale-scale2;if(scale1<scale){extra=scale-scale1;}else{extra=0;}
num1=libbcmath.safe_emalloc(1,n1.n_len+n1.n_scale,extra+2);if(num1===null){libbcmath.bc_out_of_memory();}
libbcmath.memset(num1,0,0,n1.n_len+n1.n_scale+extra+2);libbcmath.memcpy(num1,1,n1.n_value,0,n1.n_len+n1.n_scale);len2=n2.n_len+scale2;num2=libbcmath.safe_emalloc(1,len2,1);if(num2===null){libbcmath.bc_out_of_memory();}
libbcmath.memcpy(num2,0,n2.n_value,0,len2);num2[len2]=0;n2ptr=0;while(num2[n2ptr]===0){n2ptr++;len2--;}
if(len2>len1+scale){qdigits=scale+1;zero=true;}else{zero=false;if(len2>len1){qdigits=scale+1;}else{qdigits=len1-len2+scale+1;}}
qval=libbcmath.bc_new_num(qdigits-scale,scale);libbcmath.memset(qval.n_value,0,0,qdigits);mval=libbcmath.safe_emalloc(1,len2,1);if(mval===null){libbcmath.bc_out_of_memory();}
if(!zero){norm=Math.floor(10/(n2.n_value[n2ptr]+1));if(norm!=1){libbcmath._one_mult(num1,0,len1+scale1+extra+1,norm,num1,0);libbcmath._one_mult(n2.n_value,n2ptr,len2,norm,n2.n_value,n2ptr);}
qdig=0;if(len2>len1){qptr=len2-len1;}else{qptr=0;}
while(qdig<=len1+scale-len2){if(n2.n_value[n2ptr]==num1[qdig]){qguess=9;}else{qguess=Math.floor((num1[qdig]*10+num1[qdig+1])/n2.n_value[n2ptr]);}
if(n2.n_value[n2ptr+1]*qguess>(num1[qdig]*10+num1[qdig+1]-n2.n_value[n2ptr]*qguess)*10+num1[qdig+2]){qguess--;if(n2.n_value[n2ptr+1]*qguess>(num1[qdig]*10+num1[qdig+1]-n2.n_value[n2ptr]*qguess)*10+num1[qdig+2]){qguess--;}}
borrow=0;if(qguess!==0){mval[0]=0;libbcmath._one_mult(n2.n_value,n2ptr,len2,qguess,mval,1);ptr1=qdig+len2;ptr2=len2;for(count=0;count<len2+1;count++){if(ptr2<0){val=num1[ptr1]-0-borrow;}else{val=num1[ptr1]-mval[ptr2--]-borrow;}
if(val<0){val+=10;borrow=1;}else{borrow=0;}
num1[ptr1--]=val;}}
if(borrow==1){qguess--;ptr1=qdig+len2;ptr2=len2-1;carry=0;for(count=0;count<len2;count++){if(ptr2<0){val=num1[ptr1]+0+carry;}else{val=num1[ptr1]+n2.n_value[ptr2--]+carry;}
if(val>9){val-=10;carry=1;}else{carry=0;}
num1[ptr1--]=val;}
if(carry==1){num1[ptr1]=(num1[ptr1]+1)%10;}}
qval.n_value[qptr++]=qguess;qdig++;}}
qval.n_sign=(n1.n_sign==n2.n_sign?libbcmath.PLUS:libbcmath.MINUS);if(libbcmath.bc_is_zero(qval)){qval.n_sign=libbcmath.PLUS;}
libbcmath._bc_rm_leading_zeros(qval);return qval;},MUL_BASE_DIGITS:80,MUL_SMALL_DIGITS:(this.MUL_BASE_DIGITS/4),bc_multiply:function(n1,n2,scale){var pval;var len1,len2;var full_scale,prod_scale;len1=n1.n_len+n1.n_scale;len2=n2.n_len+n2.n_scale;full_scale=n1.n_scale+n2.n_scale;prod_scale=libbcmath.MIN(full_scale,libbcmath.MAX(scale,libbcmath.MAX(n1.n_scale,n2.n_scale)));pval=libbcmath._bc_rec_mul(n1,len1,n2,len2,full_scale);pval.n_sign=(n1.n_sign==n2.n_sign?libbcmath.PLUS:libbcmath.MINUS);pval.n_len=len2+len1+1-full_scale;pval.n_scale=prod_scale;libbcmath._bc_rm_leading_zeros(pval);if(libbcmath.bc_is_zero(pval)){pval.n_sign=libbcmath.PLUS;}
return pval;},new_sub_num:function(length,scale,value){var temp=new libbcmath.bc_num();temp.n_sign=libbcmath.PLUS;temp.n_len=length;temp.n_scale=scale;temp.n_value=value;return temp;},_bc_simp_mul:function(n1,n1len,n2,n2len,full_scale){var prod;var n1ptr,n2ptr,pvptr;var n1end,n2end;var indx,sum,prodlen;prodlen=n1len+n2len+1;prod=libbcmath.bc_new_num(prodlen,0);n1end=n1len-1;n2end=n2len-1;pvptr=prodlen-1;sum=0;for(indx=0;indx<prodlen-1;indx++){n1ptr=n1end-libbcmath.MAX(0,indx-n2len+1);n2ptr=n2end-libbcmath.MIN(indx,n2len-1);while((n1ptr>=0)&&(n2ptr<=n2end)){sum+=n1.n_value[n1ptr--]*n2.n_value[n2ptr++];}
prod.n_value[pvptr--]=Math.floor(sum%libbcmath.BASE);sum=Math.floor(sum/libbcmath.BASE);}
prod.n_value[pvptr]=sum;return prod;},_bc_shift_addsub:function(accum,val,shift,sub){var accp,valp;var count,carry;count=val.n_len;if(val.n_value[0]===0){count--;}
if(accum.n_len+accum.n_scale<shift+count){throw new Error("len + scale < shift + count");}
accp=accum.n_len+accum.n_scale-shift-1;valp=val.n_len=1;carry=0;if(sub){while(count--){accum.n_value[accp]-=val.n_value[valp--]+carry;if(accum.n_value[accp]<0){carry=1;accum.n_value[accp--]+=libbcmath.BASE;}else{carry=0;accp--;}}
while(carry){accum.n_value[accp]-=carry;if(accum.n_value[accp]<0){accum.n_value[accp--]+=libbcmath.BASE;}else{carry=0;}}}else{while(count--){accum.n_value[accp]+=val.n_value[valp--]+carry;if(accum.n_value[accp]>(libbcmath.BASE-1)){carry=1;accum.n_value[accp--]-=libbcmath.BASE;}else{carry=0;accp--;}}
while(carry){accum.n_value[accp]+=carry;if(accum.n_value[accp]>(libbcmath.BASE-1)){accum.n_value[accp--]-=libbcmath.BASE;}else{carry=0;}}}
return true;},_bc_rec_mul:function(u,ulen,v,vlen,full_scale){var prod;var u0,u1,v0,v1;var u0len,v0len;var m1,m2,m3,d1,d2;var n,prodlen,m1zero;var d1len,d2len;if((ulen+vlen)<libbcmath.MUL_BASE_DIGITS||ulen<libbcmath.MUL_SMALL_DIGITS||vlen<libbcmath.MUL_SMALL_DIGITS){return libbcmath._bc_simp_mul(u,ulen,v,vlen,full_scale);}
n=Math.floor((libbcmath.MAX(ulen,vlen)+1)/2);if(ulen<n){u1=libbcmath.bc_init_num();u0=libbcmath.new_sub_num(ulen,0,u.n_value);}else{u1=libbcmath.new_sub_num(ulen-n,0,u.n_value);u0=libbcmath.new_sub_num(n,0,u.n_value+ulen-n);}
if(vlen<n){v1=libbcmath.bc_init_num();v0=libbcmath.new_sub_num(vlen,0,v.n_value);}else{v1=libbcmath.new_sub_num(vlen-n,0,v.n_value);v0=libbcmath.new_sub_num(n,0,v.n_value+vlen-n);}
libbcmath._bc_rm_leading_zeros(u1);libbcmath._bc_rm_leading_zeros(u0);u0len=u0.n_len;libbcmath._bc_rm_leading_zeros(v1);libbcmath._bc_rm_leading_zeros(v0);v0len=v0.n_len;m1zero=libbcmath.bc_is_zero(u1)||libbcmath.bc_is_zero(v1);d1=libbcmath.bc_init_num();d2=libbcmath.bc_init_num();d1=libbcmath.bc_sub(u1,u0,0);d1len=d1.n_len;d2=libbcmath.bc_sub(v0,v1,0);d2len=d2.n_len;if(m1zero){m1=libbcmath.bc_init_num();}else{m1=libbcmath._bc_rec_mul(u1,u1.n_len,v1,v1.n_len,0);}
if(libbcmath.bc_is_zero(d1)||libbcmath.bc_is_zero(d2)){m2=libbcmath.bc_init_num();}else{m2=libbcmath._bc_rec_mul(d1,d1len,d2,d2len,0);}
if(libbcmath.bc_is_zero(u0)||libbcmath.bc_is_zero(v0)){m3=libbcmath.bc_init_num();}else{m3=libbcmath._bc_rec_mul(u0,u0.n_len,v0,v0.n_len,0);}
prodlen=ulen+vlen+1;prod=libbcmath.bc_new_num(prodlen,0);if(!m1zero){libbcmath._bc_shift_addsub(prod,m1,2*n,0);libbcmath._bc_shift_addsub(prod,m1,n,0);}
libbcmath._bc_shift_addsub(prod,m3,n,0);libbcmath._bc_shift_addsub(prod,m3,0,0);libbcmath._bc_shift_addsub(prod,m2,n,d1.n_sign!=d2.n_sign);return prod;},_bc_do_compare:function(n1,n2,use_sign,ignore_last){var n1ptr,n2ptr;var count;if(use_sign&&(n1.n_sign!=n2.n_sign)){if(n1.n_sign==libbcmath.PLUS){return(1);}else{return(-1);}}
if(n1.n_len!=n2.n_len){if(n1.n_len>n2.n_len){if(!use_sign||(n1.n_sign==libbcmath.PLUS)){return(1);}else{return(-1);}}else{if(!use_sign||(n1.n_sign==libbcmath.PLUS)){return(-1);}else{return(1);}}}
count=n1.n_len+Math.min(n1.n_scale,n2.n_scale);n1ptr=0;n2ptr=0;while((count>0)&&(n1.n_value[n1ptr]==n2.n_value[n2ptr])){n1ptr++;n2ptr++;count--;}
if(ignore_last&&(count==1)&&(n1.n_scale==n2.n_scale)){return(0);}
if(count!==0){if(n1.n_value[n1ptr]>n2.n_value[n2ptr]){if(!use_sign||n1.n_sign==libbcmath.PLUS){return(1);}else{return(-1);}}else{if(!use_sign||n1.n_sign==libbcmath.PLUS){return(-1);}else{return(1);}}}
if(n1.n_scale!=n2.n_scale){if(n1.n_scale>n2.n_scale){for(count=(n1.n_scale-n2.n_scale);count>0;count--){if(n1.n_value[n1ptr++]!==0){if(!use_sign||n1.n_sign==libbcmath.PLUS){return(1);}else{return(-1);}}}}else{for(count=(n2.n_scale-n1.n_scale);count>0;count--){if(n2.n_value[n2ptr++]!==0){if(!use_sign||n1.n_sign==libbcmath.PLUS){return(-1);}else{return(1);}}}}}
return(0);},bc_sub:function(n1,n2,scale_min){var diff;var cmp_res,res_scale;if(n1.n_sign!=n2.n_sign){diff=libbcmath._bc_do_add(n1,n2,scale_min);diff.n_sign=n1.n_sign;}else{cmp_res=libbcmath._bc_do_compare(n1,n2,false,false);switch(cmp_res){case-1:diff=libbcmath._bc_do_sub(n2,n1,scale_min);diff.n_sign=(n2.n_sign==libbcmath.PLUS?libbcmath.MINUS:libbcmath.PLUS);break;case 0:res_scale=libbcmath.MAX(scale_min,libbcmath.MAX(n1.n_scale,n2.n_scale));diff=libbcmath.bc_new_num(1,res_scale);libbcmath.memset(diff.n_value,0,0,res_scale+1);break;case 1:diff=libbcmath._bc_do_sub(n1,n2,scale_min);diff.n_sign=n1.n_sign;break;}}
return diff;},_bc_do_add:function(n1,n2,scale_min){var sum;var sum_scale,sum_digits;var n1ptr,n2ptr,sumptr;var carry,n1bytes,n2bytes;var tmp;sum_scale=libbcmath.MAX(n1.n_scale,n2.n_scale);sum_digits=libbcmath.MAX(n1.n_len,n2.n_len)+1;sum=libbcmath.bc_new_num(sum_digits,libbcmath.MAX(sum_scale,scale_min));n1bytes=n1.n_scale;n2bytes=n2.n_scale;n1ptr=(n1.n_len+n1bytes-1);n2ptr=(n2.n_len+n2bytes-1);sumptr=(sum_scale+sum_digits-1);if(n1bytes!=n2bytes){if(n1bytes>n2bytes){while(n1bytes>n2bytes){sum.n_value[sumptr--]=n1.n_value[n1ptr--];n1bytes--;}}else{while(n2bytes>n1bytes){sum.n_value[sumptr--]=n2.n_value[n2ptr--];n2bytes--;}}}
n1bytes+=n1.n_len;n2bytes+=n2.n_len;carry=0;while((n1bytes>0)&&(n2bytes>0)){tmp=n1.n_value[n1ptr--]+n2.n_value[n2ptr--]+carry;if(tmp>=libbcmath.BASE){carry=1;tmp-=libbcmath.BASE;}else{carry=0;}
sum.n_value[sumptr]=tmp;sumptr--;n1bytes--;n2bytes--;}
if(n1bytes===0){while(n2bytes-->0){tmp=n2.n_value[n2ptr--]+carry;if(tmp>=libbcmath.BASE){carry=1;tmp-=libbcmath.BASE;}else{carry=0;}
sum.n_value[sumptr--]=tmp;}}else{while(n1bytes-->0){tmp=n1.n_value[n1ptr--]+carry;if(tmp>=libbcmath.BASE){carry=1;tmp-=libbcmath.BASE;}else{carry=0;}
sum.n_value[sumptr--]=tmp;}}
if(carry==1){sum.n_value[sumptr]+=1;}
libbcmath._bc_rm_leading_zeros(sum);return sum;},_bc_do_sub:function(n1,n2,scale_min){var diff;var diff_scale,diff_len;var min_scale,min_len;var n1ptr,n2ptr,diffptr;var borrow,count,val;diff_len=libbcmath.MAX(n1.n_len,n2.n_len);diff_scale=libbcmath.MAX(n1.n_scale,n2.n_scale);min_len=libbcmath.MIN(n1.n_len,n2.n_len);min_scale=libbcmath.MIN(n1.n_scale,n2.n_scale);diff=libbcmath.bc_new_num(diff_len,libbcmath.MAX(diff_scale,scale_min));n1ptr=(n1.n_len+n1.n_scale-1);n2ptr=(n2.n_len+n2.n_scale-1);diffptr=(diff_len+diff_scale-1);borrow=0;if(n1.n_scale!=min_scale){for(count=n1.n_scale-min_scale;count>0;count--){diff.n_value[diffptr--]=n1.n_value[n1ptr--];}}else{for(count=n2.n_scale-min_scale;count>0;count--){val=0-n2.n_value[n2ptr--]-borrow;if(val<0){val+=libbcmath.BASE;borrow=1;}else{borrow=0;diff.n_value[diffptr--]=val;}}}
for(count=0;count<min_len+min_scale;count++){val=n1.n_value[n1ptr--]-n2.n_value[n2ptr--]-borrow;if(val<0){val+=libbcmath.BASE;borrow=1;}else{borrow=0;}
diff.n_value[diffptr--]=val;}
if(diff_len!=min_len){for(count=diff_len-min_len;count>0;count--){val=n1.n_value[n1ptr--]-borrow;if(val<0){val+=libbcmath.BASE;borrow=1;}else{borrow=0;}
diff.n_value[diffptr--]=val;}}
libbcmath._bc_rm_leading_zeros(diff);return diff;},bc_new_num:function(length,scale){var temp;temp=new libbcmath.bc_num();temp.n_sign=libbcmath.PLUS;temp.n_len=length;temp.n_scale=scale;temp.n_value=libbcmath.safe_emalloc(1,length+scale,0);libbcmath.memset(temp.n_value,0,0,length+scale);return temp;},safe_emalloc:function(size,len,extra){return Array((size*len)+extra);},bc_init_num:function(){return new libbcmath.bc_new_num(1,0);},_bc_rm_leading_zeros:function(num){while((num.n_value[0]===0)&&(num.n_len>1)){num.n_value.shift();num.n_len--;}},php_str2num:function(str){var p;p=str.indexOf('.');if(p==-1){return libbcmath.bc_str2num(str,0);}else{return libbcmath.bc_str2num(str,(str.length-p));}},CH_VAL:function(c){return c-'0';},BCD_CHAR:function(d){return d+'0';},isdigit:function(c){return(isNaN(parseInt(c,10))?false:true);},bc_str2num:function(str_in,scale){var str,num,ptr,digits,strscale,zero_int,nptr;str=str_in.split('');ptr=0;digits=0;strscale=0;zero_int=false;if((str[ptr]==='+')||(str[ptr]==='-')){ptr++;}
while(str[ptr]==='0'){ptr++;}
while((str[ptr])%1===0){ptr++;digits++;}
if(str[ptr]==='.'){ptr++;}
while((str[ptr])%1===0){ptr++;strscale++;}
if((str[ptr])||(digits+strscale===0)){return libbcmath.bc_init_num();}
strscale=libbcmath.MIN(strscale,scale);if(digits===0){zero_int=true;digits=1;}
num=libbcmath.bc_new_num(digits,strscale);ptr=0;if(str[ptr]==='-'){num.n_sign=libbcmath.MINUS;ptr++;}else{num.n_sign=libbcmath.PLUS;if(str[ptr]==='+'){ptr++;}}
while(str[ptr]==='0'){ptr++;}
nptr=0;if(zero_int){num.n_value[nptr++]=0;digits=0;}
for(;digits>0;digits--){num.n_value[nptr++]=libbcmath.CH_VAL(str[ptr++]);}
if(strscale>0){ptr++;for(;strscale>0;strscale--){num.n_value[nptr++]=libbcmath.CH_VAL(str[ptr++]);}}
return num;},cint:function(v){if(typeof(v)=='undefined'){v=0;}
var x=parseInt(v,10);if(isNaN(x)){x=0;}
return x;},MIN:function(a,b){return((a>b)?b:a);},MAX:function(a,b){return((a>b)?a:b);},ODD:function(a){return(a&1);},memset:function(r,ptr,chr,len){var i;for(i=0;i<len;i++){r[ptr+i]=chr;}},memcpy:function(dest,ptr,src,srcptr,len){var i;for(i=0;i<len;i++){dest[ptr+i]=src[srcptr+i];}
return true;},bc_is_zero:function(num){var count;var nptr;count=num.n_len+num.n_scale;nptr=0;while((count>0)&&(num.n_value[nptr++]===0)){count--;}
if(count!==0){return false;}else{return true;}},bc_out_of_memory:function(){throw new Error("(BC) Out of memory");}};return libbcmath;}
function abs(mixed_number){return Math.abs(mixed_number)||0;}
function acos(arg){return Math.acos(arg);}
function acosh(arg){return Math.log(arg+Math.sqrt(arg*arg-1));}
function addcslashes(str,charlist){var target='',chrs=[],i=0,j=0,c='',next='',rangeBegin='',rangeEnd='',chr='',begin=0,end=0,octalLength=0,postOctalPos=0,cca=0,escHexGrp=[],encoded='',percentHex=/%([\dA-Fa-f]+)/g;var _pad=function(n,c){if((n=n+"").length<c){return new Array(++c-n.length).join("0")+n;}else{return n;}};for(i=0;i<charlist.length;i++){c=charlist.charAt(i);next=charlist.charAt(i+1);if(c==='\\'&&next&&(/\d/).test(next)){rangeBegin=charlist.slice(i+1).match(/^\d+/)[0];octalLength=rangeBegin.length;postOctalPos=i+octalLength+1;if(charlist.charAt(postOctalPos)+charlist.charAt(postOctalPos+1)==='..'){begin=rangeBegin.charCodeAt(0);if((/\\\d/).test(charlist.charAt(postOctalPos+2)+charlist.charAt(postOctalPos+3))){rangeEnd=charlist.slice(postOctalPos+3).match(/^\d+/)[0];i+=1;}
else if(charlist.charAt(postOctalPos+2)){rangeEnd=charlist.charAt(postOctalPos+2);}
else{throw'Range with no end point';}
end=rangeEnd.charCodeAt(0);if(end>begin){for(j=begin;j<=end;j++){chrs.push(String.fromCharCode(j));}}
else{chrs.push('.',rangeBegin,rangeEnd);}
i+=rangeEnd.length+2;}
else{chr=String.fromCharCode(parseInt(rangeBegin,8));chrs.push(chr);}
i+=octalLength;}
else if(next+charlist.charAt(i+2)==='..'){rangeBegin=c;begin=rangeBegin.charCodeAt(0);if((/\\\d/).test(charlist.charAt(i+3)+charlist.charAt(i+4))){rangeEnd=charlist.slice(i+4).match(/^\d+/)[0];i+=1;}
else if(charlist.charAt(i+3)){rangeEnd=charlist.charAt(i+3);}
else{throw'Range with no end point';}
end=rangeEnd.charCodeAt(0);if(end>begin){for(j=begin;j<=end;j++){chrs.push(String.fromCharCode(j));}}
else{chrs.push('.',rangeBegin,rangeEnd);}
i+=rangeEnd.length+2;}
else{chrs.push(c);}}
for(i=0;i<str.length;i++){c=str.charAt(i);if(chrs.indexOf(c)!==-1){target+='\\';cca=c.charCodeAt(0);if(cca<32||cca>126){switch(c){case'\n':target+='n';break;case'\t':target+='t';break;case'\u000D':target+='r';break;case'\u0007':target+='a';break;case'\v':target+='v';break;case'\b':target+='b';break;case'\f':target+='f';break;default:encoded=encodeURIComponent(c);if((escHexGrp=percentHex.exec(encoded))!==null){target+=_pad(parseInt(escHexGrp[1],16).toString(8),3);}
while((escHexGrp=percentHex.exec(encoded))!==null){target+='\\'+_pad(parseInt(escHexGrp[1],16).toString(8),3);}
break;}}
else{target+=c;}}
else{target+=c;}}
return target;}
function addslashes(str){return(str+'').replace(/([\\"'])/g,"\\$1").replace(/\u0000/g,"\\0");}
function aggregate(obj,class_name){var p='',record={},pos=-1;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};var indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(typeof class_name==='string'){class_name=this.window[class_name];}
this.php_js=this.php_js||{};this.php_js.aggregateKeys=this.php_js.aggregateKeys||[];this.php_js.aggregateRecords=this.php_js.aggregateRecords||[];this.php_js.aggregateClasses=this.php_js.aggregateClasses||[];this.php_js.aggregateClasses.push(getFuncName(class_name));for(p in class_name){if(!(p in obj)&&p!=='prototype'&&p[0]!=='_'){obj[p]=class_name[p];record[p]=class_name[p];}}
for(p in class_name.prototype){if(!(p in obj)&&p[0]!=='_'){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
pos=this.php_js.aggregateKeys.indexOf(obj);if(pos!==-1){this.php_js.aggregateRecords[pos].push(record);this.php_js.aggregateClasses[pos].push(getFuncName(class_name));}else{this.php_js.aggregateKeys.push(obj);this.php_js.aggregateRecords.push([record]);this.php_js.aggregateClasses[0]=[];this.php_js.aggregateClasses[0].push(getFuncName(class_name));}}
function aggregate_info(obj){var idx=-1,p='',infoObj={},retObj={},i=0,name='';var indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(!this.php_js||!this.php_js.aggregateRecords||!this.php_js.aggregateKeys||!this.php_js.aggregateClasses){return false;}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
idx=this.php_js.aggregateKeys.indexOf(obj);if(idx===-1){return false;}
for(i=0;i<this.php_js.aggregateClasses[idx].length;i++){name=this.php_js.aggregateClasses[idx][i];infoObj={methods:[],properties:[]};for(p in this.php_js.aggregateRecords[idx][i]){if(typeof this.php_js.aggregateRecords[idx][i][p]==='function'){infoObj.methods.push(p);}
else{infoObj.properties.push(p);}}
retObj[name]=infoObj;}
return retObj;}
function aggregate_methods(obj,class_name){var p='',record={},pos=-1;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};var indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(typeof class_name==='string'){class_name=this.window[class_name];}
this.php_js=this.php_js||{};this.php_js.aggregateKeys=this.php_js.aggregateKeys||[];this.php_js.aggregateRecords=this.php_js.aggregateRecords||[];this.php_js.aggregateClasses=this.php_js.aggregateClasses||[];this.php_js.aggregateClasses.push(getFuncName(class_name));for(p in class_name){if(!(p in obj)&&typeof class_name[p]==='function'&&p[0]!=='_'){obj[p]=class_name[p];record[p]=class_name[p];}}
for(p in class_name.prototype){if(!(p in obj)&&typeof class_name.prototype[p]==='function'&&p[0]!=='_'){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
pos=this.php_js.aggregateKeys.indexOf(obj);if(pos!==-1){this.php_js.aggregateRecords[pos].push(record);this.php_js.aggregateClasses[pos].push(getFuncName(class_name));}else{this.php_js.aggregateKeys.push(obj);this.php_js.aggregateRecords.push([record]);this.php_js.aggregateClasses[0]=[];this.php_js.aggregateClasses[0].push(getFuncName(class_name));}}
function aggregate_methods_by_list(obj,class_name,properties_list,exclude){var p='',i=0,record={},pos=-1;var indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(typeof class_name==='string'){class_name=this.window[class_name];}
this.php_js=this.php_js||{};this.php_js.aggregateKeys=this.php_js.aggregateKeys||[];this.php_js.aggregateRecords=this.php_js.aggregateRecords||[];this.php_js.aggregateClasses=this.php_js.aggregateClasses||[];var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};this.php_js.aggregateClasses.push(getFuncName(class_name));if(!properties_list.indexOf){properties_list.indexOf=indexOf;}
if(exclude){for(p in class_name){if(!(p in obj)&&typeof class_name[p]==='function'&&p[0]!=='_'&&properties_list.indexOf(p)===-1){obj[p]=class_name[p];record[p]=class_name[p];}}
for(p in class_name.prototype){if(!(p in obj)&&typeof class_name.prototype[p]==='function'&&p[0]!=='_'&&properties_list.indexOf(p)===-1){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}}else{for(i=0;i<properties_list.length;i++){p=properties_list[i];if(!(p in obj)&&p in class_name&&p[0]!=='_'&&typeof class_name.prototype[p]==='function'){obj[p]=class_name[p];record[p]=class_name[p];}else if(!(p in obj)&&p in class_name.prototype&&p[0]!=='_'&&typeof class_name.prototype[p]==='function'){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
pos=this.php_js.aggregateKeys.indexOf(obj);if(pos!==-1){this.php_js.aggregateRecords[pos].push(record);this.php_js.aggregateClasses[pos].push(getFuncName(class_name));}else{this.php_js.aggregateKeys.push(obj);this.php_js.aggregateRecords.push([record]);this.php_js.aggregateClasses[0]=[];this.php_js.aggregateClasses[0].push(getFuncName(class_name));}}
function aggregate_methods_by_regexp(obj,class_name,regexp,exclude){var p='',test=false,record={},pos=-1,indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(typeof regexp==='string'){regexp=eval(regexp);}
if(typeof class_name==='string'){class_name=this.window[class_name];}
this.php_js=this.php_js||{};this.php_js.aggregateKeys=this.php_js.aggregateKeys||[];this.php_js.aggregateRecords=this.php_js.aggregateRecords||[];this.php_js.aggregateClasses=this.php_js.aggregateClasses||[];var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};this.php_js.aggregateClasses.push(getFuncName(class_name));for(p in class_name){test=exclude?!regexp.test(p):regexp.test(p);if(!(p in obj)&&typeof class_name[p]==='function'&&p[0]!=='_'&&test){obj[p]=class_name[p];record[p]=class_name[p];}}
for(p in class_name.prototype){test=exclude?!regexp.test(p):regexp.test(p);if(!(p in obj)&&typeof class_name.prototype[p]==='function'&&p[0]!=='_'&&test){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
pos=this.php_js.aggregateKeys.indexOf(obj);if(pos!==-1){this.php_js.aggregateRecords[pos].push(record);this.php_js.aggregateClasses[pos].push(getFuncName(class_name));}else{this.php_js.aggregateKeys.push(obj);this.php_js.aggregateRecords.push([record]);this.php_js.aggregateClasses[0]=[];this.php_js.aggregateClasses[0].push(getFuncName(class_name));}}
function aggregate_properties(obj,class_name){var p='',record={},pos=-1,indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(typeof class_name==='string'){class_name=this.window[class_name];}
this.php_js=this.php_js||{};this.php_js.aggregateKeys=this.php_js.aggregateKeys||[];this.php_js.aggregateRecords=this.php_js.aggregateRecords||[];this.php_js.aggregateClasses=this.php_js.aggregateClasses||[];var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};this.php_js.aggregateClasses.push(getFuncName(class_name));for(p in class_name){if(!(p in obj)&&typeof class_name[p]!=='function'&&p[0]!=='_'){obj[p]=class_name[p];record[p]=class_name[p];}}
for(p in class_name.prototype){if(!(p in obj)&&typeof class_name.prototype[p]!=='function'&&p[0]!=='_'){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
pos=this.php_js.aggregateKeys.indexOf(obj);if(pos!==-1){this.php_js.aggregateRecords[pos].push(record);this.php_js.aggregateClasses[pos].push(getFuncName(class_name));}else{this.php_js.aggregateKeys.push(obj);this.php_js.aggregateRecords.push([record]);this.php_js.aggregateClasses[0]=[];this.php_js.aggregateClasses[0].push(getFuncName(class_name));}}
function aggregate_properties_by_list(obj,class_name,properties_list,exclude){var p='',i=0,record={},pos=-1,indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(!properties_list.indexOf){properties_list.indexOf=indexOf;}
if(typeof class_name==='string'){class_name=this.window[class_name];}
this.php_js=this.php_js||{};this.php_js.aggregateKeys=this.php_js.aggregateKeys||[];this.php_js.aggregateRecords=this.php_js.aggregateRecords||[];this.php_js.aggregateClasses=this.php_js.aggregateClasses||[];var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};this.php_js.aggregateClasses.push(getFuncName(class_name));if(exclude){for(p in class_name){if(!(p in obj)&&typeof class_name[p]!=='function'&&p[0]!=='_'&&properties_list.indexOf(p)===-1){obj[p]=class_name[p];record[p]=class_name[p];}}
for(p in class_name.prototype){if(!(p in obj)&&typeof class_name.prototype[p]!=='function'&&p[0]!=='_'&&properties_list.indexOf(p)===-1){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}}else{for(i=0;i<properties_list.length;i++){p=properties_list[i];if(!(p in obj)&&p in class_name&&p[0]!=='_'&&typeof class_name.prototype[p]!=='function'){obj[p]=class_name[p];record[p]=class_name[p];}else if(!(p in obj)&&p in class_name.prototype&&p[0]!=='_'&&typeof class_name.prototype[p]!=='function'){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
pos=this.php_js.aggregateKeys.indexOf(obj);if(pos!==-1){this.php_js.aggregateRecords[pos].push(record);this.php_js.aggregateClasses[pos].push(getFuncName(class_name));}else{this.php_js.aggregateKeys.push(obj);this.php_js.aggregateRecords.push([record]);this.php_js.aggregateClasses[0]=[];this.php_js.aggregateClasses[0].push(getFuncName(class_name));}}
function aggregate_properties_by_regexp(obj,class_name,regexp,exclude){var p='',test=false,record={},pos=-1,indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;};if(typeof regexp==='string'){regexp=eval(regexp);}
if(typeof class_name==='string'){class_name=this.window[class_name];}
this.php_js=this.php_js||{};this.php_js.aggregateKeys=this.php_js.aggregateKeys||[];this.php_js.aggregateRecords=this.php_js.aggregateRecords||[];this.php_js.aggregateClasses=this.php_js.aggregateClasses||[];var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};for(p in class_name){test=exclude?!regexp.test(p):regexp.test(p);if(!(p in obj)&&typeof class_name[p]!=='function'&&p[0]!=='_'&&test){obj[p]=class_name[p];record[p]=class_name[p];}}
for(p in class_name.prototype){test=exclude?!regexp.test(p):regexp.test(p);if(!(p in obj)&&typeof class_name.prototype[p]!=='function'&&p[0]!=='_'&&test){obj[p]=class_name.prototype[p];record[p]=class_name.prototype[p];}}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
pos=this.php_js.aggregateKeys.indexOf(obj);if(pos!==-1){this.php_js.aggregateRecords[pos].push(record);this.php_js.aggregateClasses[pos].push(getFuncName(class_name));}else{this.php_js.aggregateKeys.push(obj);this.php_js.aggregateRecords.push([record]);this.php_js.aggregateClasses[0]=[];this.php_js.aggregateClasses[0].push(getFuncName(class_name));}}
function aggregation_info(obj){return this.aggregate_info(obj);}
function array(){return Array.prototype.slice.call(arguments);}
function array_change_key_case(array){var case_fn,tmp_ar={},argc=arguments.length,argv=arguments,key;if(array instanceof Array){return array;}
if(array instanceof Object){if(argc===1||argv[1]==='CASE_LOWER'||argv[1]===0){case_fn="toLowerCase";}else{case_fn="toUpperCase";}
for(key in array){tmp_ar[key[case_fn]()]=array[key];}
return tmp_ar;}
return false;}
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]];}
return n;}
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;}
if(keycount!=values.length){return false;}
for(i=0;i<keycount;i++){new_array[keys[i]]=values[i];}
return new_array;}
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";}
return t;};var __countValue=function(value){switch(typeof(value)){case"number":if(Math.floor(value)!=value){return;}
case"string":if(value in this){++this[value];}else{this[value]=1;}}};t=__getType(array);if(t=='array'){for(key in array){__countValue.call(tmp_arr,array[key]);}}
return tmp_arr;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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;}}
return tmp_arr;}
function array_fill_keys(keys,value){var retObj={},key='';for(key in keys){retObj[keys[key]]=value;}
return retObj;}
function array_filter(arr,func){var retObj={},k;for(k in arr){if(func(arr[k])){retObj[k]=arr[k];}}
return retObj;}
function array_flip(trans){var key,tmp_ar={};for(key in trans){tmp_ar[trans[key]]=key;}
return tmp_ar;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
function array_key_exists(key,search){if(!search||(search.constructor!==Array&&search.constructor!==Object)){return false;}
return key in search;}
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;}}
if(include){tmp_arr[cnt]=key;cnt++;}}
return tmp_arr;}
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];}
m=0;k=1;if(callback){if(typeof callback==='string'){callback=this.window[callback];}
tmp_ar[i++]=callback.apply(null,tmp);}else{tmp_ar[i++]=tmp;}
tmp=[];}
return tmp_ar;}
function array_merge(){var args=Array.prototype.slice.call(arguments);var retObj={},k,j=0,i=0;var retArr;for(i=0,retArr=true;i<args.length;i++){if(!(args[i]instanceof Array)){retArr=false;break;}}
if(retArr){return args;}
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(this.is_int(k)){retObj[ct++]=args[i][k];}else{retObj[k]=args[i][k];}}}}
return retObj;}
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];}}}
return arr1;}
function array_multisort(arr){var flags={'SORT_REGULAR':16,'SORT_NUMERIC':17,'SORT_STRING':18,'SORT_ASC':32,'SORT_DESC':40},sortArrs=[[]],sortFlag=[0],sortKeys=[[]],g=0,i=0,j=0,k='',l=0,thingsToSort=[],vkey=0,zlast=null,args=arguments,nLastSort=[],lastSort=[],lastSorts=[],tmpArray=[],elIndex=0,sortDuplicator=function(a,b){return nLastSort.shift();};var sortFunctions=[[function(a,b){lastSort.push(a>b?1:(a<b?-1:0));return a>b?1:(a<b?-1:0);},function(a,b){lastSort.push(b>a?1:(b<a?-1:0));return b>a?1:(b<a?-1:0);}],[function(a,b){lastSort.push(a-b);return a-b;},function(a,b){lastSort.push(b-a);return b-a;}],[function(a,b){lastSort.push((a+'')>(b+'')?1:((a+'')<(b+'')?-1:0));return(a+'')>(b+'')?1:((a+'')<(b+'')?-1:0);},function(a,b){lastSort.push((b+'')>(a+'')?1:((b+'')<(a+'')?-1:0));return(b+'')>(a+'')?1:((b+'')<(a+'')?-1:0);}]];if(arr instanceof Array){sortArrs[0]=arr;}
else if(arr instanceof Object){for(i in arr){if(arr.hasOwnProperty(i)){sortKeys[0].push(i);sortArrs[0].push(arr[i]);}}}
else{return false;}
var arrMainLength=sortArrs[0].length,sortComponents=[0,arrMainLength];for(j=1;j<arguments.length;j++){if(arguments[j]instanceof Array){sortArrs[j]=arguments[j];sortFlag[j]=0;if(arguments[j].length!==arrMainLength){return false;}}else if(arguments[j]instanceof Object){sortKeys[j]=[];sortArrs[j]=[];sortFlag[j]=0;for(i in arguments[j]){if(arguments[j].hasOwnProperty(i)){sortKeys[j].push(i);sortArrs[j].push(arguments[j][i]);}}
if(sortArrs[j].length!==arrMainLength){return false;}}else if(typeof arguments[j]==='string'){var lFlag=sortFlag.pop();if(typeof flags[arguments[j]]==='undefined'||((((flags[arguments[j]])>>>4)&(lFlag>>>4))>0)){return false;}
sortFlag.push(lFlag+flags[arguments[j]]);}else{return false;}}
for(i=0;i!==arrMainLength;i++){thingsToSort.push(true);}
for(i in sortArrs){if(sortArrs.hasOwnProperty(i)){lastSorts=[];tmpArray=[];elIndex=0;nLastSort=[];lastSort=[];if(sortComponents.length===0){if(arguments[i]instanceof Array){args[i]=sortArrs[i];}
else{for(k in arguments[i]){if(arguments[i].hasOwnProperty(k)){delete arguments[i][k];}}
for(j=0,vkey=0;j<sortArrs[i].length;j++){vkey=sortKeys[i][j];args[i][vkey]=sortArrs[i][j];}}
delete sortArrs[i];delete sortKeys[i];continue;}
var sFunction=sortFunctions[(sortFlag[i]&3)][((sortFlag[i]&8)>0)?1:0];for(l=0;l!==sortComponents.length;l+=2){tmpArray=sortArrs[i].slice(sortComponents[l],sortComponents[l+1]+1);tmpArray.sort(sFunction);lastSorts[l]=[].concat(lastSort);elIndex=sortComponents[l];for(g in tmpArray){if(tmpArray.hasOwnProperty(g)){sortArrs[i][elIndex]=tmpArray[g];elIndex++;}}}
sFunction=sortDuplicator;for(j in sortArrs){if(sortArrs.hasOwnProperty(j)){if(sortArrs[j]===sortArrs[i]){continue;}
for(l=0;l!==sortComponents.length;l+=2){tmpArray=sortArrs[j].slice(sortComponents[l],sortComponents[l+1]+1);nLastSort=[].concat(lastSorts[l]);tmpArray.sort(sFunction);elIndex=sortComponents[l];for(g in tmpArray){if(tmpArray.hasOwnProperty(g)){sortArrs[j][elIndex]=tmpArray[g];elIndex++;}}}}}
for(j in sortKeys){if(sortKeys.hasOwnProperty(j)){for(l=0;l!==sortComponents.length;l+=2){tmpArray=sortKeys[j].slice(sortComponents[l],sortComponents[l+1]+1);nLastSort=[].concat(lastSorts[l]);tmpArray.sort(sFunction);elIndex=sortComponents[l];for(g in tmpArray){if(tmpArray.hasOwnProperty(g)){sortKeys[j][elIndex]=tmpArray[g];elIndex++;}}}}}
zlast=null;sortComponents=[];for(j in sortArrs[i]){if(sortArrs[i].hasOwnProperty(j)){if(!thingsToSort[j]){if((sortComponents.length&1)){sortComponents.push(j-1);}
zlast=null;continue;}
if(!(sortComponents.length&1)){if(zlast!==null){if(sortArrs[i][j]===zlast){sortComponents.push(j-1);}
else{thingsToSort[j]=false;}}
zlast=sortArrs[i][j];}else{if(sortArrs[i][j]!==zlast){sortComponents.push(j-1);zlast=sortArrs[i][j];}}}}
if(sortComponents.length&1){sortComponents.push(j);}
if(arguments[i]instanceof Array){args[i]=sortArrs[i];}
else{for(j in arguments[i]){if(arguments[i].hasOwnProperty(j)){delete arguments[i][j];}}
for(j=0,vkey=0;j<sortArrs[i].length;j++){vkey=sortKeys[i][j];args[i][vkey]=sortArrs[i][j];}}
delete sortArrs[i];delete sortKeys[i];}}
return true;}
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;}
pad=((pad_size<0)?newArray.concat(input):input.concat(newArray));}else{pad=input;}}
return pad;}
function array_pop(inputArr){var key='',lastKey='';if(inputArr.hasOwnProperty('length')){if(!inputArr.length){return null;}
return inputArr.pop();}else{for(key in inputArr){if(inputArr.hasOwnProperty(key)){lastKey=key;}}
if(lastKey){var tmp=inputArr[lastKey];delete(inputArr[lastKey]);return tmp;}else{return null;}}}
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;}
return product;}
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];}
return inputArr.length;}
for(pr in inputArr){if(inputArr.hasOwnProperty(pr)){++len;if(allDigits.test(pr)){size=parseInt(pr,10);highestIdx=size>highestIdx?size:highestIdx;}}}
for(i=1;i<argc;i++){inputArr[++highestIdx]=argv[i];}
return len+i-1;}
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;}
index++;}
return exist;};if(input instanceof Array&&ticks<=input.length){while(true){var rand=Math.floor((Math.random()*input.length));if(indexes.length===ticks){break;}
if(!checkDuplicate(indexes,rand)){indexes.push(rand);}}}else{indexes=null;}
return((ticks==1)?indexes.join():indexes);}
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;}
res+=callback.apply(null,tmp);tmp=[];}
return res;}
function array_replace(arr){if(arguments.length<2){throw new Error('There should be at least 2 arguments passed to array_replace()');}
var retObj={};for(var prop in arr){retObj[prop]=arr[prop];}
for(var i=1;i<arguments.length;i++){for(var p in arguments[i]){retObj[p]=arguments[i][p];}}
return retObj;}
function array_replace_recursive(arr){if(arguments.length<2){throw new Error('There should be at least 2 arguments passed to array_replace_recursive()');}
var retObj={};for(var prop in arr){retObj[prop]=arr[prop];}
for(var i=1;i<arguments.length;i++){for(var p in arguments[i]){if(typeof retObj[p]==='object'&&retObj[p]!==null){retObj[p]=this.array_replace_recursive(retObj[p],arguments[i][p]);}
else{retObj[p]=arguments[i][p];}}}
return retObj;}
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];}
return tmp_arr;}
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;}}
return false;}
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;}
ct=_checkToUpIndices(arr,ct,key);arr[ct]=arr[tmp];delete arr[tmp];}
return ct;};if(inputArr.length===0){return null;}
if(inputArr.length>0){return inputArr.shift();}}
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];}
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;}
if(it==offst){start=true;}
if(!start){continue;}
++arrlgth;if(this.is_int(key)&&!preserve_keys){assoc[no_pk_idx++]=arr[key];}else{assoc[key]=arr[key];}}
return assoc;}
if(lgth===undefined){return arr.slice(offst);}else if(lgth>=0){return arr.slice(offst,offst+lgth);}else{return arr.slice(offst,lgth);}}
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;}
ct=_checkToUpIndices(arr,ct,key);arr[ct]=arr[tmp];delete arr[tmp];}
return ct;};if(replacement&&typeof replacement!=='object'){replacement=[replacement];}
if(lgth===undefined){lgth=offst>=0?arr.length-offst:-offst;}else if(lgth<0){lgth=(offst>=0?arr.length-offst:-offst)+lgth;}
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;}
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;}
_checkToUpIndices(arr,int_ct,key);arr[int_ct]=arr[key];delete arr[key];}
continue;}
if(returnArr&&this.is_int(key)){rmvd.push(arr[key]);rmvdObj[rmvd_ct++]=arr[key];}else{rmvdObj[key]=arr[key];returnArr=false;}
rmvd_lgth+=1;if(replacement&&replacement[++repl_ct]){arr[key]=replacement[repl_ct];}else{delete arr[key];}}
return returnArr?rmvd:rmvdObj;}
if(replacement){replacement.unshift(offst,lgth);return Array.prototype.splice.apply(arr,replacement);}
return arr.splice(offst,lgth);}
function array_sum(array){var key,sum=0;if(typeof array!=='object'){return null;}
for(key in array){sum+=(array[key]*1);}
return sum;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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;}}
retArr[k1]=arr1[k1];}}
return retArr;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
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];}
continue arrs;}}
continue arr1keys;}}
return retArr;}
function array_unique(inputArr){var key='',tmp_arr2={},val='';var __array_search=function(needle,haystack){var fkey='';for(fkey in haystack){if(haystack.hasOwnProperty){if((haystack[fkey]+'')===(needle+'')){return fkey;}}}
return false;};for(key in inputArr){if(inputArr.hasOwnProperty){val=inputArr[key];if(false===__array_search(val,tmp_arr2)){tmp_arr2[key]=val;}}}
return tmp_arr2;}
function array_unshift(array){var argc=arguments.length,argv=arguments,i;for(i=1;i<argc;i++){array.unshift(argv[i]);}
return(array.length);}
function array_values(input){var tmp_arr=[],cnt=0;var key='';for(key in input){tmp_arr[cnt]=input[key];cnt++;}
return tmp_arr;}
function array_walk(array,funcname,userdata){var key;if(typeof array!=='object'||array===null){return false;}
for(key in array){if(typeof(userdata)!=='undefined'){eval(funcname+'( array [key] , key , userdata  )');}else{eval(funcname+'(  userdata ) ');}}
return true;}
function array_walk_recursive(array,funcname,userdata){var key;if(typeof array!='object'){return false;}
for(key in array){if(typeof array[key]=='object'){return this.array_walk_recursive(array[key],funcname,userdata);}
if(typeof(userdata)!='undefined'){eval(funcname+'( array [key] , key , userdata  )');}else{eval(funcname+'(  userdata ) ');}}
return true;}
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;}
if(a<b){return-1;}
return 0;};break;}
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){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
try{bubbleSort(keyArr,valArr);}catch(e){return false;}
for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
return strictForIn?true:populateArr;}
function asin(arg){return Math.asin(arg);}
function asinh(arg){return Math.log(arg+Math.sqrt(arg*arg+1));}
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;}
if(a<b){return-1;}
return 0;};break;}
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){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
try{bubbleSort(keyArr,valArr);}catch(e){return false;}
for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
return strictForIn?true:populateArr;}
function assert(assertion){var result=false,callback,retVal,err=undefined;this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};this.php_js.assert_values=this.php_js.assert_values||{};var getOption=function(value){if(this.php_js.assert_values[value]){return this.php_js.assert_values[value];}
if(this.php_js.ini[value]){return this.php_js.ini[value].local_value;}
switch(value){case'assert.active':return 1;case'assert.warning':throw'We have not yet implemented warnings in JavaScript (assert())';case'assert.bail':return 0;case'assert.quiet_eval':return 0;case'assert.callback':return null;default:throw'There was some problem';}};if(!getOption('assert.active')){return false;}
try{result=typeof assertion==='string'?eval(assertion):assertion;}
catch(e){if(!getOption('assert.quiet_eval')){throw e;}
err=e;result=false;}
retVal=result!==false;if(retVal===false){if(getOption('assert.bail')){throw'Assertion bailed';}
callback=getOption('assert.callback');if(typeof callback==='string'){callback=this.window[callback];}
callback(this.window.location.href,err&&err.lineNumber,(typeof assertion==='string'?assertion:''));}
return retVal;}
function assert_options(what,value){this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};this.php_js.assert_values=this.php_js.assert_values||{};var ini,dflt;switch(what){case'ASSERT_ACTIVE':ini='assert.active';dflt=1;break;case'ASSERT_WARNING':ini='assert.warning';dflt=1;throw'We have not yet implemented warnings for us to throw in JavaScript (assert_options())';case'ASSERT_BAIL':ini='assert.bail';dflt=0;break;case'ASSERT_QUIET_EVAL':ini='assert.quiet_eval';dflt=0;break;case'ASSERT_CALLBACK':ini='assert.callback';dflt=null;break;default:throw'Improper type for assert_options()';}
var originalValue=this.php_js.assert_values[ini]||(this.php_js.ini[ini]&&this.php_js.ini[ini].local_value)||dflt;if(value){this.php_js.assert_values[ini]=value;}
return originalValue;}
function atan(arg){return Math.atan(arg);}
function atan2(y,x){return Math.atan2(y,x);}
function atanh(arg){return 0.5*Math.log((1+arg)/(1-arg));}
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;}
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;}
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;}
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;}
return enc;}
function base_convert(number,frombase,tobase){return parseInt(number+'',frombase+0).toString(tobase+0);}
function basename(path,suffix){var b=path.replace(/^.*[\/\\]/g,'');if(typeof(suffix)=='string'&&b.substr(b.length-suffix.length)==suffix){b=b.substr(0,b.length-suffix.length);}
return b;}
function bcadd(left_operand,right_operand,scale){var libbcmath=this._phpjs_shared_bc();var first,second,result;if(typeof(scale)=='undefined'){scale=libbcmath.scale;}
scale=((scale<0)?0:scale);first=libbcmath.bc_init_num();second=libbcmath.bc_init_num();result=libbcmath.bc_init_num();first=libbcmath.php_str2num(left_operand.toString());second=libbcmath.php_str2num(right_operand.toString());result=libbcmath.bc_add(first,second,scale);if(result.n_scale>scale){result.n_scale=scale;}
return result.toString();}
function bccomp(left_operand,right_operand,scale){var libbcmath=this._phpjs_shared_bc();var first,second;if(typeof(scale)=='undefined'){scale=libbcmath.scale;}
scale=((scale<0)?0:scale);first=libbcmath.bc_init_num();second=libbcmath.bc_init_num();first=libbcmath.bc_str2num(left_operand.toString(),scale);second=libbcmath.bc_str2num(right_operand.toString(),scale);return libbcmath.bc_compare(first,second,scale);}
function bcdiv(left_operand,right_operand,scale){var libbcmath=this._phpjs_shared_bc();var first,second,result;if(typeof(scale)=='undefined'){scale=libbcmath.scale;}
scale=((scale<0)?0:scale);first=libbcmath.bc_init_num();second=libbcmath.bc_init_num();result=libbcmath.bc_init_num();first=libbcmath.php_str2num(left_operand.toString());second=libbcmath.php_str2num(right_operand.toString());result=libbcmath.bc_divide(first,second,scale);if(result===-1){throw new Error(11,"(BC) Division by zero");}
if(result.n_scale>scale){result.n_scale=scale;}
return result.toString();}
function bcmul(left_operand,right_operand,scale){var libbcmath=this._phpjs_shared_bc();var first,second,result;if(typeof(scale)=='undefined'){scale=libbcmath.scale;}
scale=((scale<0)?0:scale);first=libbcmath.bc_init_num();second=libbcmath.bc_init_num();result=libbcmath.bc_init_num();first=libbcmath.php_str2num(left_operand.toString());second=libbcmath.php_str2num(right_operand.toString());result=libbcmath.bc_multiply(first,second,scale);if(result.n_scale>scale){result.n_scale=scale;}
return result.toString();}
function bcround(val,precision){var libbcmath=this._phpjs_shared_bc();var temp,result,digit;var right_operand;temp=libbcmath.bc_init_num();temp=libbcmath.php_str2num(val.toString());if(precision>=temp.n_scale){while(temp.n_scale<precision){temp.n_value[temp.n_len+temp.n_scale]=0;temp.n_scale++;}
return temp.toString();}
digit=temp.n_value[temp.n_len+precision];right_operand=libbcmath.bc_init_num();right_operand=libbcmath.bc_new_num(1,precision);if(digit>=5){right_operand.n_value[right_operand.n_len+right_operand.n_scale-1]=1;if(temp.n_sign==libbcmath.MINUS){right_operand.n_sign=libbcmath.MINUS;}
result=libbcmath.bc_add(temp,right_operand,precision);}else{result=temp;}
if(result.n_scale>precision){result.n_scale=precision;}
return result.toString();}
function bcscale(scale){var libbcmath=this._phpjs_shared_bc();scale=parseInt(scale,10);if(isNaN(scale)){return false;}
if(scale<0){return false;}
libbcmath.scale=scale;return true;}
function bcsub(left_operand,right_operand,scale){var libbcmath=this._phpjs_shared_bc();var first,second,result;if(typeof(scale)=='undefined'){scale=libbcmath.scale;}
scale=((scale<0)?0:scale);first=libbcmath.bc_init_num();second=libbcmath.bc_init_num();result=libbcmath.bc_init_num();first=libbcmath.php_str2num(left_operand.toString());second=libbcmath.php_str2num(right_operand.toString());result=libbcmath.bc_sub(first,second,scale);if(result.n_scale>scale){result.n_scale=scale;}
return result.toString();}
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");}
return a.join('');}
function bindec(binary_string){binary_string=(binary_string+'').replace(/[^01]/gi,'');return parseInt(binary_string,2);}
function call_user_func(cb,parameters){var func;if(typeof cb=='string'){if(typeof this[cb]=='function'){func=this[cb];}else{func=(new Function(null,'return '+cb))();}}else if(cb instanceof Array){func=eval(cb[0]+"['"+cb[1]+"']");}
if(typeof func!='function'){throw new Error(func+' is not a valid function');}
return func.apply(null,Array.prototype.slice.call(arguments,1));}
function call_user_func_array(cb,parameters){var func;if(typeof cb=='string'){if(typeof this[cb]=='function'){func=this[cb];}else{func=(new Function(null,'return '+cb))();}}else if(cb instanceof Array){func=eval(cb[0]+"['"+cb[1]+"']");}
if(typeof func!='function'){throw new Error(func+' is not a valid function');}
return func.apply(null,parameters);}
function ceil(value){return Math.ceil(value);}
function checkdate(m,d,y){return m>0&&m<13&&y>0&&y<32768&&d>0&&d<=(new Date(y,m,0)).getDate();}
function chop(str,charlist){return this.rtrim(str,charlist);}
function chr(codePt){if(codePt>0xFFFF){codePt-=0x10000;return String.fromCharCode(0xD800+(codePt>>10),0xDC00+(codePt&0x3FF));}
else{return String.fromCharCode(codePt);}}
function chunk_split(body,chunklen,end){chunklen=parseInt(chunklen,10)||76;end=end||'\r\n';if(chunklen<1){return false;}
return body.match(new RegExp(".{0,"+chunklen+"}","g")).join(end);}
function class_alias(clss,alias,autoload){var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(autoload&&typeof this.window.__autoload==='function'){this.window.__autoload(clss);}
if(typeof clss==='string'){clss=this.window[clss];}
if(typeof clss==='undefined'){throw"Class '"+getFuncName(clss)+"' not found";return false;}
if(typeof clss!=='function'){throw'First argument of class_alias() must be a name of user defined class';return false;}
if(typeof this.window[alias]==='function'){throw'Cannot redeclare class '+alias;return false;}
this.window[alias]=clss;return true;}
function class_exists(cls){var i='';cls=this.window[cls];if(typeof cls!=='function'){return false;}
for(i in cls.prototype){return true;}
for(i in cls){if(i!=='prototype'){return true;}}
if(cls.toSource&&cls.toSource().match(/this\./)){return true;}
return false;}
function classkit_import(file){eval(this.file_get_contents(file));}
function classkit_method_add(classname,methodname,args,code,flags){var func,argmnts=[];switch(flags){case'CLASSKIT_ACC_PROTECTED':throw'Protected not supported';case'CLASSKIT_ACC_PRIVATE':throw'Private not supported';case'CLASSKIT_ACC_PUBLIC':default:break;}
argmnts=args.split(/,\s*/);if(typeof classname==='string'){classname=this.window[classname];}
func=Function.apply(null,argmnts.concat(code));classname.prototype[methodname]=func;return true;}
function classkit_method_copy(dClass,dMethod,sClass,sMethod){sMethod=sMethod||dMethod;if(typeof dClass==='string'){dClass=this.window[dClass];}
if(typeof sClass==='string'){sClass=this.window[sClass];}
dClass.prototype[dMethod]=sClass.prototype[sMethod];return true;}
function classkit_method_redefine(classname,methodname,args,code,flags){var argmnts=[],func;switch(flags){case'CLASSKIT_ACC_PROTECTED':throw'Protected not supported';case'CLASSKIT_ACC_PRIVATE':throw'Private not supported';case'CLASSKIT_ACC_PUBLIC':default:break;}
argmnts=args.split(/,\s*/);if(typeof classname==='string'){classname=this.window[classname];}
func=Function.apply(null,argmnts.concat(code));classname.prototype[methodname]=func;return true;}
function classkit_method_remove(classname,methodname){if(typeof classname==='string'){classname=this.window[classname];}
delete classname.prototype[methodname];return true;}
function classkit_method_rename(classname,methodname,newname){if(typeof classname==='string'){classname=this.window[classname];}
var method=classname.prototype[methodname];classname.prototype[newname]=method;delete classname.prototype[methodname];return true;}
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];}}}
return true;};process(arguments);return matrix;}
function constant(name){var clssPos=0,clssCnst=null;if((clssPos=name.indexOf('::'))!==-1){clssCnst=name.slice(clssPos+2);name=name.slice(0,clssPos);}
if(this.window[name]===undefined){return null;}
if(clssCnst){return this.window[name][clssCnst];}
return this.window[name];}
function convert_cyr_string(str,from,to){var _cyr_win1251=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,154,174,190,46,159,189,46,46,179,191,180,157,46,46,156,183,46,46,182,166,173,46,46,158,163,152,164,155,46,46,46,167,225,226,247,231,228,229,246,250,233,234,235,236,237,238,239,240,242,243,244,245,230,232,227,254,251,253,255,249,248,252,224,241,193,194,215,199,196,197,214,218,201,202,203,204,205,206,207,208,210,211,212,213,198,200,195,222,219,221,223,217,216,220,192,209,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,184,186,32,179,191,32,32,32,32,32,180,162,32,32,32,32,168,170,32,178,175,32,32,32,32,32,165,161,169,254,224,225,246,228,229,244,227,245,232,233,234,235,236,237,238,239,255,240,241,242,243,230,226,252,251,231,248,253,249,247,250,222,192,193,214,196,197,212,195,213,200,201,202,203,204,205,206,207,223,208,209,210,211,198,194,220,219,199,216,221,217,215,218,],_cyr_cp866=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,225,226,247,231,228,229,246,250,233,234,235,236,237,238,239,240,242,243,244,245,230,232,227,254,251,253,255,249,248,252,224,241,193,194,215,199,196,197,214,218,201,202,203,204,205,206,207,208,35,35,35,124,124,124,124,43,43,124,124,43,43,43,43,43,43,45,45,124,45,43,124,124,43,43,45,45,124,45,43,45,45,45,45,43,43,43,43,43,43,43,43,35,35,124,124,35,210,211,212,213,198,200,195,222,219,221,223,217,216,220,192,209,179,163,180,164,183,167,190,174,32,149,158,32,152,159,148,154,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,205,186,213,241,243,201,32,245,187,212,211,200,190,32,247,198,199,204,181,240,242,185,32,244,203,207,208,202,216,32,246,32,238,160,161,230,164,165,228,163,229,168,169,170,171,172,173,174,175,239,224,225,226,227,166,162,236,235,167,232,237,233,231,234,158,128,129,150,132,133,148,131,149,136,137,138,139,140,141,142,143,159,144,145,146,147,134,130,156,155,135,152,157,153,151,154,],_cyr_iso88595=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,179,32,32,32,32,32,32,32,32,32,32,32,32,32,32,225,226,247,231,228,229,246,250,233,234,235,236,237,238,239,240,242,243,244,245,230,232,227,254,251,253,255,249,248,252,224,241,193,194,215,199,196,197,214,218,201,202,203,204,205,206,207,208,210,211,212,213,198,200,195,222,219,221,223,217,216,220,192,209,32,163,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,241,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,161,32,32,32,32,32,32,32,32,32,32,32,32,238,208,209,230,212,213,228,211,229,216,217,218,219,220,221,222,223,239,224,225,226,227,214,210,236,235,215,232,237,233,231,234,206,176,177,198,180,181,196,179,197,184,185,186,187,188,189,190,191,207,192,193,194,195,182,178,204,203,183,200,205,201,199,202,],_cyr_mac=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,225,226,247,231,228,229,246,250,233,234,235,236,237,238,239,240,242,243,244,245,230,232,227,254,251,253,255,249,248,252,224,241,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,179,163,209,193,194,215,199,196,197,214,218,201,202,203,204,205,206,207,208,210,211,212,213,198,200,195,222,219,221,223,217,216,220,192,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,160,161,162,222,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,221,180,181,182,183,184,185,186,187,188,189,190,191,254,224,225,246,228,229,244,227,245,232,233,234,235,236,237,238,239,223,240,241,242,243,230,226,252,251,231,248,253,249,247,250,158,128,129,150,132,133,148,131,149,136,137,138,139,140,141,142,143,159,144,145,146,147,134,130,156,155,135,152,157,153,151,154,];var from_table=null,to_table=null,tmp,i=0,retStr='';switch(from.toUpperCase()){case'W':from_table=_cyr_win1251;break;case'A':case'D':from_table=_cyr_cp866;break;case'I':from_table=_cyr_iso88595;break;case'M':from_table=_cyr_mac;break;case'K':break;default:throw'Unknown source charset: '+from;break;}
switch(to.toUpperCase()){case'W':to_table=_cyr_win1251;break;case'A':case'D':to_table=_cyr_cp866;break;case'I':to_table=_cyr_iso88595;break;case'M':to_table=_cyr_mac;break;case'K':break;default:throw'Unknown destination charset: '+to;}
if(!str){return str;}
for(i=0;i<str.length;i++){tmp=(from_table===null)?str.charAt(i):String.fromCharCode(from_table[str.charAt(i).charCodeAt(0)]);retStr+=(to_table===null)?tmp:String.fromCharCode(to_table[tmp.charCodeAt(0)+256]);}
return retStr;}
function convert_uuencode(str){var chr=function(c){return String.fromCharCode(c);};if(!str||str==""){return chr(0);}else if(!this.is_scalar(str)){return false;}
var c=0,u=0,i=0,a=0;var encoded="",tmp1="",tmp2="",bytes={};var chunk=function(){bytes=str.substr(u,45);for(i in bytes){bytes[i]=bytes[i].charCodeAt(0);}
if(bytes.length!=0){return bytes.length;}else{return 0;}};while(chunk()!==0){c=chunk();u+=45;encoded+=chr(c+32);for(i in bytes){tmp1=bytes[i].charCodeAt(0).toString(2);while(tmp1.length<8){tmp1="0"+tmp1;}
tmp2+=tmp1;}
while(tmp2.length%6){tmp2=tmp2+"0";}
for(i=0;i<=(tmp2.length/6)-1;i++){tmp1=tmp2.substr(a,6);if(tmp1=="000000"){encoded+=chr(96);}else{encoded+=chr(parseInt(tmp1,2)+32);}
a+=6;}
a=0;tmp2="";encoded+="\n";}
encoded+=chr(96)+"\n";return encoded;}
function cos(arg){return Math.cos(arg);}
function cosh(arg){return(Math.exp(arg)+Math.exp(-arg))/2;}
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;}
if(mode==='COUNT_RECURSIVE'){mode=1;}
if(mode!=1){mode=0;}
for(key in mixed_var){cnt++;if(mode==1&&mixed_var[key]&&(mixed_var[key].constructor===Array||mixed_var[key].constructor===Object)){cnt+=this.count(mixed_var[key],1);}}
return cnt;}
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;}}
if(mode===2||mode===4){for(i=0;i!=str.length;i+=1){delete result[str[i].charCodeAt(0)];}
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;}}
if(mode<3){return result;}
for(i in result){resultArr.push(result[i]);}
return resultArr.join('');}
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;}
return crc^(-1);}
function create_function(args,code){try{return Function.apply(null,args.split(',').concat(code));}
catch(e){return false;}}
function ctype_alnum(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.an.test(text);}
function ctype_alpha(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.al.test(text);}
function ctype_cntrl(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.ct.test(text);}
function ctype_digit(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.dg.test(text);}
function ctype_graph(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.gr.test(text);}
function ctype_lower(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.lw.test(text);}
function ctype_print(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.pr.test(text);}
function ctype_punct(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.pu.test(text);}
function ctype_space(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.sp.test(text);}
function ctype_upper(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.up.test(text);}
function ctype_xdigit(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.xd.test(text);}
function current(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;}}
return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
var arrpos=pointers.indexOf(arr);var cursor=pointers[arrpos+1];if(arr instanceof Array){return arr[cursor]||false;}
var ct=0;for(var k in arr){if(ct===cursor){return arr[k];}
ct++;}
return false;}
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 Math.round(jsdate.getTime()/1000);}};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);}
function date_default_timezone_get(){var tal={},abbr='',i=0,curr_offset=-(new Date()).getTimezoneOffset()*60;if(this.php_js){if(this.php_js.default_timezone){return this.php_js.default_timezone;}
if(this.php_js.ENV&&this.php_js.ENV.TZ){return this.php_js.ENV.TZ;}
if(this.php_js.ini&&this.php_js.ini['date.timezone']){return this.php_js.ini['date.timezone'].local_value?this.php_js.ini['date.timezone'].local_value:this.php_js.ini['date.timezone'].global_value;}}
tal=this.timezone_abbreviations_list();for(abbr in tal){for(i=0;i<tal[abbr].length;i++){if(tal[abbr][i].offset===curr_offset){return tal[abbr][i].timezone_id;}}}
return'UTC';}
function date_default_timezone_set(tz){var tal={},abbr='',i=0;this.php_js=this.php_js||{};tal=this.timezone_abbreviations_list();for(abbr in tal){for(i=0;i<tal[abbr].length;i++){if(tal[abbr][i].timezone_id===tz){this.php_js.default_timezone=tz;return true;}}}
return false;}
function date_parse(date){this.php_js=this.php_js||{};var warningsOffset=this.php_js.warnings?this.php_js.warnings.length:null;var errorsOffset=this.php_js.errors?this.php_js.errors.length:null;try{var ts=this.strtotime(date);}
finally{if(!ts){return false;}}
var dt=new Date(ts*1000);var retObj={warning_count:warningsOffset!==null?this.php_js.warnings.slice(warningsOffset).length:0,warnings:warningsOffset!==null?this.php_js.warnings.slice(warningsOffset):[],error_count:errorsOffset!==null?this.php_js.errors.slice(errorsOffset).length:0,errors:errorsOffset!==null?this.php_js.errors.slice(errorsOffset):[]};retObj.year=dt.getFullYear();retObj.month=dt.getMonth()+1;retObj.day=dt.getDate();retObj.hour=dt.getHours();retObj.minute=dt.getMinutes();retObj.second=dt.getSeconds();retObj.fraction=parseFloat('0.'+dt.getMilliseconds());retObj.is_localtime=dt.getTimezoneOffset!==0;return retObj;}
function deaggregate(obj,class_name){var p='',idx=-1,pos=-1,i=0,indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;},getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(!this.php_js||!this.php_js.aggregateRecords||!this.php_js.aggregateKeys||!this.php_js.aggregateClasses){return;}
if(!this.php_js.aggregateKeys.indexOf){this.php_js.aggregateKeys.indexOf=indexOf;}
idx=this.php_js.aggregateKeys.indexOf(obj);if(idx===-1){return;}
if(class_name){if(typeof class_name==='string'){class_name=this.window[class_name];}
if(!this.php_js.aggregateClasses[idx].indexOf){this.php_js.aggregateClasses[idx].indexOf=indexOf;}
pos=this.php_js.aggregateClasses[idx].indexOf(getFuncName(class_name));if(pos!==-1){for(p in this.php_js.aggregateRecords[idx][pos]){delete obj[p];}
this.php_js.aggregateClasses[idx].splice(pos,1);this.php_js.aggregateRecords[idx].splice(pos,1);}}
else{for(i=0;i<this.php_js.aggregateClasses[idx].length;i++){for(p in this.php_js.aggregateRecords[idx][i]){delete obj[p];}}
this.php_js.aggregateClasses.splice(idx,1);this.php_js.aggregateRecords.splice(idx,1);}}
function decbin(number){if(number<0){number=0xFFFFFFFF+number+1;}
return parseInt(number,10).toString(2);}
function dechex(number){if(number<0){number=0xFFFFFFFF+number+1;}
return parseInt(number,10).toString(16);}
function decoct(number){if(number<0){number=0xFFFFFFFF+number+1;}
return parseInt(number,10).toString(8);}
function define(name,value){var defn,replace,script,that=this,d=this.window.document;var toString=function(name,value){return'const '+name+'='+(/^(null|true|false|(\+|\-)?\d+(\.\d+)?)$/.test(value=String(value))?value:'"'+replace(value)+'"');};try{eval('const e=1');replace=function(value){var replace={"\x08":"b","\x0A":"\\n","\x0B":"v","\x0C":"f","\x0D":"\\r",'"':'"',"\\":"\\"};return value.replace(/\x08|[\x0A-\x0D]|"|\\/g,function(value){return"\\"+replace[value];});};defn=function(name,value){if(d.createElementNS){script=d.createElementNS('http://www.w3.org/1999/xhtml','script');}else{script=d.createElement('script');}
script.type='text/javascript';script.appendChild(d.createTextNode(toString(name,value)));d.documentElement.appendChild(script);d.documentElement.removeChild(script);};}catch(e){replace=function(value){var replace={"\x0A":"\\n","\x0D":"\\r"};return value.replace(/"/g,'""').replace(/\n|\r/g,function(value){return replace[value];});};defn=(this.execScript?function(name,value){that.execScript(toString(name,value),'VBScript');}:function(name,value){eval(toString(name,value).substring(6));});}
defn(name,value);}
function defined(constant_name){var tmp=this.window[constant_name];this.window[constant_name]=this.window[constant_name]?'changed'+this.window[constant_name].toString():'changed';var returnval=this.window[constant_name]===tmp;if(!returnval){this.window[constant_name]=tmp;}
return returnval;}
function deg2rad(angle){return(angle/180)*Math.PI;}
function die(status){return this.exit(status);}
function dirname(path){return path.replace(/\\/g,'/').replace(/\/[^\/]*\/?$/,'');}
function doubleval(mixed_var){return this.floatval(mixed_var);}
function each(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;}}
return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
var arrpos=pointers.indexOf(arr);var cursor=pointers[arrpos+1];var pos=0;if(!(arr instanceof Array)){var ct=0;for(var k in arr){if(ct===cursor){pointers[arrpos+1]+=1;if(each.returnArrayOnly){return[k,arr[k]];}else{return{1:arr[k],value:arr[k],0:k,key:k};}}
ct++;}
return false;}
if(arr.length===0||cursor===arr.length){return false;}
pos=cursor;pointers[arrpos+1]+=1;if(each.returnArrayOnly){return[pos,arr[pos]];}else{return{1:arr[pos],value:arr[pos],0:pos,key:pos};}}
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+'"';}
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;}
else if(win.DOMParser){return new DOMParser().parseFromString(stringContainer,'text/xml').documentElement.firstChild;}
else if(win.ActiveXObject){var d=new ActiveXObject('MSXML2.DOMDocument');d.loadXML(str);return d.documentElement;}
else{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);}
else{holder=d.createElement(container);}
holder.innerHTML=str;while(holder.firstChild){parent.appendChild(holder.firstChild);}
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));}}
if(node.childNodes&&node.childNodes.length>0){for(i=0,len=node.childNodes.length;i<len;i++){newNode.appendChild(ieFix(node.childNodes[i]));}}
return newNode;}
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);}
else{return s;}});}
if(d.appendChild){if(d.body){if(win.navigator.appName=='Microsoft Internet Explorer'){d.body.appendChild(stringToDOM(ieFix(arg)));}
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);}}}
function empty(mixed_var){var key;if(mixed_var===""||mixed_var===0||mixed_var==="0"||mixed_var===null||mixed_var===false||typeof mixed_var==='undefined'){return true;}
if(typeof mixed_var=='object'){for(key in mixed_var){return false;}
return true;}
return false;}
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;}}
return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
var arrpos=pointers.indexOf(arr);if(!(arr instanceof Array)){var ct=0;for(var k in arr){ct++;var val=arr[k];}
if(ct===0){return false;}
pointers[arrpos+1]=ct-1;return val;}
if(arr.length===0){return false;}
pointers[arrpos+1]=arr.length-1;return arr[pointers[arrpos+1]];}
function error_get_last(){return this.php_js&&this.php_js.last_error?this.php_js.last_error:null;}
function error_reporting(level){return this.ini_set('error_reporting',level);}
function escapeshellarg(arg){var ret='';ret=arg.replace(/[^\\]'/g,function(m,i,s){return m.slice(0,1)+'\\\'';});return"'"+ret+"'";}
function exit(status){var i;if(typeof status==='string'){alert(status);}
this.window.addEventListener('error',function(e){e.preventDefault();e.stopPropagation();},false);var handlers=['copy','cut','paste','beforeunload','blur','change','click','contextmenu','dblclick','focus','keydown','keypress','keyup','mousedown','mousemove','mouseout','mouseover','mouseup','resize','scroll','DOMNodeInserted','DOMNodeRemoved','DOMNodeRemovedFromDocument','DOMNodeInsertedIntoDocument','DOMAttrModified','DOMCharacterDataModified','DOMElementNameChanged','DOMAttributeNameChanged','DOMActivate','DOMFocusIn','DOMFocusOut','online','offline','textInput','abort','close','dragdrop','load','paint','reset','select','submit','unload'];function stopPropagation(e){e.stopPropagation();}
for(i=0;i<handlers.length;i++){this.window.addEventListener(handlers[i],function(e){stopPropagation(e);},true);}
if(this.window.stop){this.window.stop();}
throw'';}
function exp(arg){return Math.exp(arg);}
function explode(delimiter,string,limit){var emptyArray={0:''};if(arguments.length<2||typeof arguments[0]=='undefined'||typeof arguments[1]=='undefined')
{return null;}
if(delimiter===''||delimiter===false||delimiter===null)
{return false;}
if(typeof delimiter=='function'||typeof delimiter=='object'||typeof string=='function'||typeof string=='object')
{return emptyArray;}
if(delimiter===true){delimiter='1';}
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;}}
function expm1(x){var ret=0,n=50;var factorial=function factorial(n){if((n===0)||(n===1)){return 1;}
else{var result=(n*factorial(n-1));return result;}};for(var i=1;i<n;i++){ret+=Math.pow(x,i)/factorial(i);}
return ret;}
function extract(arr,type,prefix){if(arr instanceof Array&&(type!=='EXTR_PREFIX_ALL'&&type!=='EXTR_PREFIX_INVALID')){return 0;}
var targetObj=this.window;if(this.php_js&&this.php_js.ini&&this.php_js.ini['phpjs.extractTargetObj']&&this.php_js.ini['phpjs.extractTargetObj'].local_value){targetObj=this.php_js.ini['phpjs.extractTargetObj'].local_value;}
var chng=0;for(var i in arr){var validIdent=/^[_a-zA-Z$][\w|$]*$/;var prefixed=prefix+'_'+i;try{switch(type){case'EXTR_PREFIX_SAME'||2:if(targetObj[i]!==undefined){if(prefixed.match(validIdent)!==null){targetObj[prefixed]=arr[i];++chng;}}
else{targetObj[i]=arr[i];++chng;}
break;case'EXTR_SKIP'||1:if(targetObj[i]===undefined){targetObj[i]=arr[i];++chng;}
break;case'EXTR_PREFIX_ALL'||3:if(prefixed.match(validIdent)!==null){targetObj[prefixed]=arr[i];++chng;}
break;case'EXTR_PREFIX_INVALID'||4:if(i.match(validIdent)!==null){if(prefixed.match(validIdent)!==null){targetObj[prefixed]=arr[i];++chng;}}
else{targetObj[i]=arr[i];++chng;}
break;case'EXTR_IF_EXISTS'||6:if(targetObj[i]!==undefined){targetObj[i]=arr[i];++chng;}
break;case'EXTR_PREFIX_IF_EXISTS'||5:if(targetObj[i]!==undefined&&prefixed.match(validIdent)!==null){targetObj[prefixed]=arr[i];++chng;}
break;case'EXTR_REFS'||256:throw'The EXTR_REFS type will not work in JavaScript';case'EXTR_OVERWRITE'||0:default:targetObj[i]=arr[i];++chng;break;}}
catch(e){}}
return chng;}
function fclose(handle){if(!handle||handle.opener!=='fopen'){return false;}
try{delete this.php_js.resourceDataPointer[handle.id];delete this.php_js.resourceData[handle.id];}
catch(e){return false;}
return true;}
function feof(handle){if(!handle||!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer){return true;}
return!this.php_js.resourceData[handle.id][this.php_js.resourceDataPointer[handle.id]];}
function fgetc(handle){if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer){return false;}
var start=this.php_js.resourceDataPointer[handle.id];if(start===undefined||!this.php_js.resourceData[handle.id][start]){return false;}
var length=1;this.php_js.resourceDataPointer[handle.id]+=length;var chr=this.php_js.resourceData[handle.id].substr(start,length);var nextChr=this.php_js.resourceData[handle.id].substr(start+1,1);var prevChr=start===0?false:this.php_js.resourceData[handle.id].substr(start-1,1);var code=chr.charCodeAt(0);if(0xD800<=code&&code<=0xDBFF){if(!nextChr){throw'High surrogate without following low surrogate (fgetc)';}
var next=nextChr.charCodeAt(0);if(0xDC00>next||next>0xDFFF){throw'High surrogate without following low surrogate (fgetc)';}
this.php_js.resourceDataPointer[handle.id]+=length;return chr+nextChr;}
else if(0xDC00<=code&&code<=0xDFFF){if(prevChr===false){throw'Low surrogate without preceding high surrogate (fgetc)';}
var prev=prevChr.charCodeAt(0);if(0xD800>prev||prev>0xDBFF){throw'Low surrogate without preceding high surrogate (fgetc)';}
return prevChr+chr;}
return chr;}
function fgetcsv(handle,length,delimiter,enclosure,escape){var start=0,fullline='';if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||length!==undefined&&!length){return false;}
start=this.php_js.resourceDataPointer[handle.id];if(start===undefined||!this.php_js.resourceData[handle.id][start]){return false;}
fullline=this.php_js.resourceData[handle.id].slice(start,this.php_js.resourceData[handle.id].indexOf('\n',start)+1);if(fullline===''){fullline=this.php_js.resourceData[handle.id].slice(start);}
length=(length===undefined||fullline.length<length)?fullline.length:Math.floor(length/2)||1;this.php_js.resourceDataPointer[handle.id]+=length;return this.str_getcsv(this.php_js.resourceData[handle.id].substr(start,length),delimiter,enclosure,escape);}
function fgets(handle,length){var start=0,fullline='',endlinePos=-1,content='';if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||length!==undefined&&!length){return false;}
start=this.php_js.resourceDataPointer[handle.id];if(start===undefined||!this.php_js.resourceData[handle.id][start]){return false;}
content=this.php_js.resourceData[handle.id].slice(start);endlinePos=content.search(/\r\n?|\n/)+start+1;fullline=this.php_js.resourceData[handle.id].slice(start,endlinePos+1);if(fullline===''){fullline=this.php_js.resourceData[handle.id].slice(start);}
length=(length===undefined||fullline.length<length)?fullline.length:Math.floor(length/2)||1;this.php_js.resourceDataPointer[handle.id]+=length;return this.php_js.resourceData[handle.id].substr(start,length);}
function fgetss(handle,length,allowable_tags){var start=0,fullline='';if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||length!==undefined&&!length){return false;}
start=this.php_js.resourceDataPointer[handle.id];if(start===undefined||!this.php_js.resourceData[handle.id][start]){return false;}
fullline=this.php_js.resourceData[handle.id].slice(start,this.php_js.resourceData[handle.id].indexOf('\n',start)+1);if(fullline===''){fullline=this.php_js.resourceData[handle.id].slice(start);}
length=(length===undefined||fullline.length<length)?fullline.length:Math.floor(length/2)||1;this.php_js.resourceDataPointer[handle.id]+=length-1;return this.strip_tags(this.php_js.resourceData[handle.id].substr(start,length),allowable_tags);}
function file(url){var req=this.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
req.open("GET",url,false);req.send(null);return req.responseText.split('\n');}
function file_exists(url){var req=this.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
req.open('HEAD',url,false);req.send(null);if(req.status==200){return true;}
return false;}
function file_get_contents(url,flags,context,offset,maxLen){var tmp,headers=[],newTmp=[],k=0,i=0,href='',pathPos=-1,flagNames=0,content=null,http_stream=false;var func=function(value){return value.substring(1)!=='';};this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};var ini=this.php_js.ini;context=context||this.php_js.default_streams_context||null;if(!flags){flags=0;}
var OPTS={FILE_USE_INCLUDE_PATH:1,FILE_TEXT:32,FILE_BINARY:64};if(typeof flags==='number'){flagNames=flags;}
else{flags=[].concat(flags);for(i=0;i<flags.length;i++){if(OPTS[flags[i]]){flagNames=flagNames|OPTS[flags[i]];}}}
if(flagNames&OPTS.FILE_BINARY&&(flagNames&OPTS.FILE_TEXT)){throw'You cannot pass both FILE_BINARY and FILE_TEXT to file_get_contents()';}
if((flagNames&OPTS.FILE_USE_INCLUDE_PATH)&&ini.include_path&&ini.include_path.local_value){var slash=ini.include_path.local_value.indexOf('/')!==-1?'/':'\\';url=ini.include_path.local_value+slash+url;}
else if(!/^(https?|file):/.test(url)){href=this.window.location.href;pathPos=url.indexOf('/')===0?href.indexOf('/',8)-1:href.lastIndexOf('/');url=href.slice(0,pathPos+1)+url;}
if(context){var http_options=context.stream_options&&context.stream_options.http;http_stream=!!http_options;}
if(!context||http_stream){var req=this.window.ActiveXObject?new ActiveXObject('Microsoft.XMLHTTP'):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
var method=http_stream?http_options.method:'GET';var async=!!(context&&context.stream_params&&context.stream_params['phpjs.async']);if(ini['phpjs.ajaxBypassCache']&&ini['phpjs.ajaxBypassCache'].local_value){url+=(url.match(/\?/)==null?"?":"&")+(new Date()).getTime();}
req.open(method,url,async);if(async){var notification=context.stream_params.notification;if(typeof notification==='function'){if(0&&req.addEventListener){}
else{req.onreadystatechange=function(aEvt){var objContext={responseText:req.responseText,responseXML:req.responseXML,status:req.status,statusText:req.statusText,readyState:req.readyState,evt:aEvt};var bytes_transferred;switch(req.readyState){case 0:notification.call(objContext,0,0,'',0,0,0);break;case 1:notification.call(objContext,0,0,'',0,0,0);break;case 2:notification.call(objContext,0,0,'',0,0,0);break;case 3:bytes_transferred=req.responseText.length*2;notification.call(objContext,7,0,'',0,bytes_transferred,0);break;case 4:if(req.status>=200&&req.status<400){bytes_transferred=req.responseText.length*2;notification.call(objContext,8,0,'',req.status,bytes_transferred,0);}
else if(req.status===403){notification.call(objContext,10,2,'',req.status,0,0);}
else{notification.call(objContext,9,2,'',req.status,0,0);}
break;default:throw'Unrecognized ready state for file_get_contents()';}}}}}
if(http_stream){var sendHeaders=http_options.header&&http_options.header.split(/\r?\n/);var userAgentSent=false;for(i=0;i<sendHeaders.length;i++){var sendHeader=sendHeaders[i];var breakPos=sendHeader.search(/:\s*/);var sendHeaderName=sendHeader.substring(0,breakPos);req.setRequestHeader(sendHeaderName,sendHeader.substring(breakPos+1));if(sendHeaderName==='User-Agent'){userAgentSent=true;}}
if(!userAgentSent){var user_agent=http_options.user_agent||(ini.user_agent&&ini.user_agent.local_value);if(user_agent){req.setRequestHeader('User-Agent',user_agent);}}
content=http_options.content||null;}
if(flagNames&OPTS.FILE_TEXT){var content_type='text/html';if(http_options&&http_options['phpjs.override']){content_type=http_options['phpjs.override'];}
else{var encoding=(ini['unicode.stream_encoding']&&ini['unicode.stream_encoding'].local_value)||'UTF-8';if(http_options&&http_options.header&&(/^content-type:/im).test(http_options.header)){content_type=http_options.header.match(/^content-type:\s*(.*)$/im)[1];}
if(!(/;\s*charset=/).test(content_type)){content_type+='; charset='+encoding;}}
req.overrideMimeType(content_type);}
else if(flagNames&OPTS.FILE_BINARY){req.overrideMimeType('text/plain; charset=x-user-defined');}
if(http_options&&http_options['phpjs.sendAsBinary']){req.sendAsBinary(content);}
else{req.send(content);}
tmp=req.getAllResponseHeaders();if(tmp){tmp=tmp.split('\n');for(k=0;k<tmp.length;k++){if(func(tmp[k])){newTmp.push(tmp[k]);}}
tmp=newTmp;for(i=0;i<tmp.length;i++){headers[i]=tmp[i];}
this.$http_response_header=headers;}
if(offset||maxLen){if(maxLen){return req.responseText.substr(offset||0,maxLen);}
return req.responseText.substr(offset);}
return req.responseText;}
return false;}
function filemtime(file){var headers={};headers=this.get_headers(file,1);return(headers&&headers['Last-Modified']&&Date.parse(headers['Last-Modified'])/1000)||false;}
function filesize(url){var req=this.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
req.open('HEAD',url,false);req.send(null);if(!req.getResponseHeader){try{throw new Error('No getResponseHeader!');}catch(e){return false;}}else if(!req.getResponseHeader('Content-Length')){try{throw new Error('No Content-Length!');}catch(e2){return false;}}else{return req.getResponseHeader('Content-Length');}}
function floatval(mixed_var){return(parseFloat(mixed_var)||0);}
function floor(value){return Math.floor(value);}
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;}
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));}}
function fopen(filename,mode,use_include_path,context){var resource={},i=0,that=this;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};var file_get_contents=function(url){var req=that.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
if(!(/^http/).test(url)){url=that.window.location.href+'/'+url;}
req.open("GET",url,false);req.send(null);return req.responseText;};if(use_include_path===1||use_include_path==='1'||use_include_path===true){}
if(context){}
for(i=0;i<mode.length;i++){if(mode.charAt(i)==='r'&&(!mode.charAt(i+1)||mode.charAt(i+1)!=='+')){continue;}
switch(mode.charAt(i)){case'r':case'w':case'a':case'x':throw'Writing is not implemented';case'b':case't':throw'Windows-only modes are not supported';default:throw'Unrecognized file mode passed to '+getFuncName(arguments.caller)+'()';}}
this.php_js=this.php_js||{};this.php_js.resourceData=this.php_js.resourceData||{};this.php_js.resourceDataPointer=this.php_js.resourceDataPointer||{};this.php_js.resourceIdCounter=this.php_js.resourceIdCounter||0;function PHPJS_Resource(type,id,opener){this.type=type;this.id=id;this.opener=opener;}
PHPJS_Resource.prototype.toString=function(){return'Resource id #'+this.id;};PHPJS_Resource.prototype.get_resource_type=function(){return this.type;};PHPJS_Resource.prototype.var_dump=function(){return'resource('+this.id+') of type ('+this.type+')';};this.php_js.resourceIdCounter++;this.php_js.resourceData[this.php_js.resourceIdCounter]=this.file_get_contents(filename);this.php_js.resourceDataPointer[this.php_js.resourceIdCounter]=0;resource=new PHPJS_Resource('stream',this.php_js.resourceIdCounter,'fopen');resource.mode=mode;return resource;}
function forward_static_call(cb,parameters){var func;if(typeof cb=='string'){if(typeof this[cb]=='function'){func=this[cb];}else{func=(new Function(null,'return '+cb))();}}else if(cb instanceof Array){func=eval(cb[0]+"['"+cb[1]+"']");}
if(typeof func!='function'){throw new Error(func+' is not a valid function');}
return func.apply(null,Array.prototype.slice.call(arguments,1));}
function forward_static_call_array(cb,parameters){var func;if(typeof cb=='string'){if(typeof this[cb]=='function'){func=this[cb];}else{func=(new Function(null,'return '+cb))();}}else if(cb instanceof Array){func=eval(cb[0]+"['"+cb[1]+"']");}
if(typeof func!='function'){throw new Error(func+' is not a valid function');}
return func.apply(null,parameters);}
function fpassthru(handle){if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||!handle||!handle.id){return false;}
var chrs=this.php_js.resourceData[handle.id].slice(this.php_js.resourceDataPointer[handle.id]);this.echo(chrs);this.php_js.resourceDataPointer[handle.id]=this.php_js.resourceData[handle.id].length;return chrs;}
function fread(handle,length){if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer){return false;}
length=length<8192?(Math.floor(length/2)||1):4096;var start=this.php_js.resourceDataPointer[handle.id];if(start===undefined){return false;}
if(!this.php_js.resourceData[handle.id][start]){return'';}
this.php_js.resourceDataPointer[handle.id]+=length;return this.php_js.resourceData[handle.id].substr(start,length);}
function fseek(handle,offset,whence){var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||!handle||!handle.constructor||getFuncName(handle.constructor)!=='PHPJS_Resource'){return-1;}
switch(whence){case undefined:case'SEEK_SET':this.php_js.resourceDataPointer[handle.id]=offset/2+1;break;case'SEEK_CUR':this.php_js.resourceDataPointer[handle.id]+=offset/2+1;break;case'SEEK_END':this.php_js.resourceDataPointer[handle.id]=this.php_js.resourceData[handle.id].length+offset/2+1;break;default:throw'Unrecognized whence value for fseek()';}
return 0;}
function ftell(handle){var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||!handle||!handle.constructor||getFuncName(handle.constructor)!=='PHPJS_Resource'){return false;}
return this.php_js.resourceDataPointer[handle.id]*2-1;}
function func_get_arg(num){if(!arguments.callee.caller){try{throw new Error('Either you are using this in a browser which does not support the "caller" property or you are calling this from a global context');}catch(e){return false;}}
if(num>arguments.callee.caller.arguments.length-1){try{throw new Error('Argument number is greater than the number of arguments actually passed');}catch(e2){return false;}}
return arguments.callee.caller.arguments[num];}
function func_get_args(){if(!arguments.callee.caller){try{throw new Error('Either you are using this in a browser which does not support the "caller" property or you are calling this from a global context');}catch(e){return false;}}
return Array.prototype.slice.call(arguments.callee.caller.arguments);}
function func_num_args(){if(!arguments.callee.caller){try{throw new Error('Either you are using this in a browser which does not support the "caller" property or you are calling this from a global context');}catch(e){return false;}}
return arguments.callee.caller.arguments.length;}
function function_exists(function_name){if(typeof function_name=='string'){return(typeof this.window[function_name]=='function');}else{return(function_name instanceof Function);}}
function get_cfg_var(varname){if(this.php_js&&this.php_js.ini&&this.php_js.ini[varname].global_value!==undefined){if(this.php_js.ini[varname].global_value===null){return'';}
return this.php_js.ini[varname].global_value;}
return'';}
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];}}
return false;}
function get_class_methods(name){var constructor,retArr={},method='';if(typeof name==='function'){constructor=name;}else if(typeof name==='string'){constructor=this.window[name];}else if(typeof name==='object'){constructor=name;for(method in constructor.constructor){if(typeof constructor.constructor[method]==='function'){retArr[method]=constructor.constructor[method];}}}
for(method in constructor){if(typeof constructor[method]==='function'){retArr[method]=constructor[method];}}
for(method in constructor.prototype){if(typeof constructor.prototype[method]==='function'){retArr[method]=constructor.prototype[method];}}
return retArr;}
function get_class_vars(name){var constructor,retArr={},prop='';if(typeof name==='function'){constructor=name;}else if(typeof name==='string'){constructor=this.window[name];}
for(prop in constructor){if(typeof constructor[prop]!=='function'&&prop!=='prototype'){retArr[prop]=constructor[prop];}}
if(constructor.prototype){for(prop in constructor.prototype){if(typeof constructor.prototype[prop]!=='function'){retArr[prop]=constructor.prototype[prop];}}}
return retArr;}
function get_declared_classes(){var i='',j='',arr=[],already={};for(i in this.window){try{if(typeof this.window[i]==='function'){if(!already[i]&&this.class_exists(i)){already[i]=1;arr.push(i);}}else if(typeof this.window[i]==='object'){for(j in this.window[i]){if(typeof this.window[j]==='function'&&this.window[j]&&!already[j]&&this.class_exists(j)){already[j]=1;arr.push(j);}}}}catch(e){}}
return arr;}
function get_defined_constants(categorize){var ext='',cnst='',constObj={},flatConstObj={},win,thisExt=false;constObj={'internal':{'E_ERROR':1,'E_RECOVERABLE_ERROR':4096,'E_WARNING':2,'E_PARSE':4,'E_NOTICE':8,'E_STRICT':2048,'E_CORE_ERROR':16,'E_CORE_WARNING':32,'E_COMPILE_ERROR':64,'E_COMPILE_WARNING':128,'E_USER_ERROR':256,'E_USER_WARNING':512,'E_USER_NOTICE':1024,'E_ALL':6143,'ZEND_THREAD_SAFE':true,'PHP_VERSION':'5.2.6','PHP_OS':'WINNT','PHP_SAPI':'apache2handler','DEFAULT_INCLUDE_PATH':'.;C:\\php5\\pear','PEAR_INSTALL_DIR':'C:\\php5\\pear','PEAR_EXTENSION_DIR':'C:\\php5','PHP_EXTENSION_DIR':'C:\\php5','PHP_PREFIX':'C:\\php5','PHP_BINDIR':'C:\\php5','PHP_LIBDIR':'C:\\php5','PHP_DATADIR':'C:\\php5','PHP_SYSCONFDIR':'C:\\php5','PHP_LOCALSTATEDIR':'C:\\php5','PHP_CONFIG_FILE_PATH':'C:\\Windows','PHP_CONFIG_FILE_SCAN_DIR':'','PHP_SHLIB_SUFFIX':'dll','PHP_EOL':'\n','PHP_INT_MAX':2147483647,'PHP_INT_SIZE':4,'PHP_OUTPUT_HANDLER_START':1,'PHP_OUTPUT_HANDLER_CONT':2,'PHP_OUTPUT_HANDLER_END':4,'UPLOAD_ERR_OK':0,'UPLOAD_ERR_INI_SIZE':1,'UPLOAD_ERR_FORM_SIZE':2,'UPLOAD_ERR_PARTIAL':3,'UPLOAD_ERR_NO_FILE':4,'UPLOAD_ERR_NO_TMP_DIR':6,'UPLOAD_ERR_CANT_WRITE':7,'UPLOAD_ERR_EXTENSION':8},'pcre':{'PREG_PATTERN_ORDER':1,'PREG_SET_ORDER':2,'PREG_OFFSET_CAPTURE':256,'PREG_SPLIT_NO_EMPTY':1,'PREG_SPLIT_DELIM_CAPTURE':2,'PREG_SPLIT_OFFSET_CAPTURE':4,'PREG_GREP_INVERT':1,'PREG_NO_ERROR':0,'PREG_INTERNAL_ERROR':1,'PREG_BACKTRACK_LIMIT_ERROR':2,'PREG_RECURSION_LIMIT_ERROR':3,'PREG_BAD_UTF8_ERROR':4,'PCRE_VERSION':'7.6 2008-01-28'},'session':{'DATE_ATOM':'Y-m-d\\TH:i:sP','DATE_COOKIE':'l, d-M-y H:i:s T','DATE_ISO8601':'Y-m-d\\TH:i:sO','DATE_RFC822':'D, d M y H:i:s O','DATE_RFC850':'l, d-M-y H:i:s T','DATE_RFC1036':'D, d M y H:i:s O','DATE_RFC1123':'D, d M Y H:i:s O','DATE_RFC2822':'D, d M Y H:i:s O','DATE_RFC3339':'Y-m-d\\TH:i:sP','DATE_RSS':'D, d M Y H:i:s O','DATE_W3C':'Y-m-d\\TH:i:sP','SUNFUNCS_RET_TIMESTAMP':0,'SUNFUNCS_RET_STRING':1,'SUNFUNCS_RET_DOUBLE':2},'standard':{'CONNECTION_ABORTED':1,'CONNECTION_NORMAL':0,'CONNECTION_TIMEOUT':2,'INI_USER':1,'INI_PERDIR':2,'INI_SYSTEM':4,'INI_ALL':7,'PHP_URL_SCHEME':0,'PHP_URL_HOST':1,'PHP_URL_PORT':2,'PHP_URL_USER':3,'PHP_URL_PASS':4,'PHP_URL_PATH':5,'PHP_URL_QUERY':6,'PHP_URL_FRAGMENT':7,'M_E':2.718281828459,'M_LOG2E':1.442695040889,'M_LOG10E':0.43429448190325,'M_LN2':0.69314718055995,'M_LN10':2.302585092994,'M_PI':3.1415926535898,'M_PI_2':1.5707963267949,'M_PI_4':0.78539816339745,'M_1_PI':0.31830988618379,'M_2_PI':0.63661977236758,'M_SQRTPI':1.7724538509055,'M_2_SQRTPI':1.1283791670955,'M_LNPI':1.1447298858494,'M_EULER':0.57721566490153,'M_SQRT2':1.4142135623731,'M_SQRT1_2':0.70710678118655,'M_SQRT3':1.7320508075689,'INF':Number.POSITIVE_INFINITY,'NAN':0,'INFO_GENERAL':1,'INFO_CREDITS':2,'INFO_CONFIGURATION':4,'INFO_MODULES':8,'INFO_ENVIRONMENT':16,'INFO_VARIABLES':32,'INFO_LICENSE':64,'INFO_ALL':-1,'CREDITS_GROUP':1,'CREDITS_GENERAL':2,'CREDITS_SAPI':4,'CREDITS_MODULES':8,'CREDITS_DOCS':16,'CREDITS_FULLPAGE':32,'CREDITS_QA':64,'CREDITS_ALL':-1,'HTML_SPECIALCHARS':0,'HTML_ENTITIES':1,'ENT_COMPAT':2,'ENT_QUOTES':3,'ENT_NOQUOTES':0,'STR_PAD_LEFT':0,'STR_PAD_RIGHT':1,'STR_PAD_BOTH':2,'PATHINFO_DIRNAME':1,'PATHINFO_BASENAME':2,'PATHINFO_EXTENSION':4,'PATHINFO_FILENAME':8,'CHAR_MAX':127,'LC_CTYPE':2,'LC_NUMERIC':4,'LC_TIME':5,'LC_COLLATE':1,'LC_MONETARY':3,'LC_ALL':0,'SEEK_SET':0,'SEEK_CUR':1,'SEEK_END':2,'LOCK_SH':1,'LOCK_EX':2,'LOCK_UN':3,'LOCK_NB':4,'STREAM_NOTIFY_CONNECT':2,'STREAM_NOTIFY_AUTH_REQUIRED':3,'STREAM_NOTIFY_AUTH_RESULT':10,'STREAM_NOTIFY_MIME_TYPE_IS':4,'STREAM_NOTIFY_FILE_SIZE_IS':5,'STREAM_NOTIFY_REDIRECTED':6,'STREAM_NOTIFY_PROGRESS':7,'STREAM_NOTIFY_FAILURE':9,'STREAM_NOTIFY_COMPLETED':8,'STREAM_NOTIFY_RESOLVE':1,'STREAM_NOTIFY_SEVERITY_INFO':0,'STREAM_NOTIFY_SEVERITY_WARN':1,'STREAM_NOTIFY_SEVERITY_ERR':2,'STREAM_FILTER_READ':1,'STREAM_FILTER_WRITE':2,'STREAM_FILTER_ALL':3,'STREAM_CLIENT_PERSISTENT':1,'STREAM_CLIENT_ASYNC_CONNECT':2,'STREAM_CLIENT_CONNECT':4,'STREAM_CRYPTO_METHOD_SSLv2_CLIENT':0,'STREAM_CRYPTO_METHOD_SSLv3_CLIENT':1,'STREAM_CRYPTO_METHOD_SSLv23_CLIENT':2,'STREAM_CRYPTO_METHOD_TLS_CLIENT':3,'STREAM_CRYPTO_METHOD_SSLv2_SERVER':4,'STREAM_CRYPTO_METHOD_SSLv3_SERVER':5,'STREAM_CRYPTO_METHOD_SSLv23_SERVER':6,'STREAM_CRYPTO_METHOD_TLS_SERVER':7,'STREAM_SHUT_RD':0,'STREAM_SHUT_WR':1,'STREAM_SHUT_RDWR':2,'STREAM_PF_INET':2,'STREAM_PF_INET6':23,'STREAM_PF_UNIX':1,'STREAM_IPPROTO_IP':0,'STREAM_IPPROTO_TCP':6,'STREAM_IPPROTO_UDP':17,'STREAM_IPPROTO_ICMP':1,'STREAM_IPPROTO_RAW':255,'STREAM_SOCK_STREAM':1,'STREAM_SOCK_DGRAM':2,'STREAM_SOCK_RAW':3,'STREAM_SOCK_SEQPACKET':5,'STREAM_SOCK_RDM':4,'STREAM_PEEK':2,'STREAM_OOB':1,'STREAM_SERVER_BIND':4,'STREAM_SERVER_LISTEN':8,'FILE_USE_INCLUDE_PATH':1,'FILE_IGNORE_NEW_LINES':2,'FILE_SKIP_EMPTY_LINES':4,'FILE_APPEND':8,'FILE_NO_DEFAULT_CONTEXT':16,'PSFS_PASS_ON':2,'PSFS_FEED_ME':1,'PSFS_ERR_FATAL':0,'PSFS_FLAG_NORMAL':0,'PSFS_FLAG_FLUSH_INC':1,'PSFS_FLAG_FLUSH_CLOSE':2,'CRYPT_SALT_LENGTH':12,'CRYPT_STD_DES':1,'CRYPT_EXT_DES':0,'CRYPT_MD5':1,'CRYPT_BLOWFISH':0,'DIRECTORY_SEPARATOR':'\\','PATH_SEPARATOR':';','GLOB_BRACE':128,'GLOB_MARK':8,'GLOB_NOSORT':32,'GLOB_NOCHECK':16,'GLOB_NOESCAPE':4096,'GLOB_ERR':4,'GLOB_ONLYDIR':1073741824,'GLOB_AVAILABLE_FLAGS':1073746108,'LOG_EMERG':1,'LOG_ALERT':1,'LOG_CRIT':1,'LOG_ERR':4,'LOG_WARNING':5,'LOG_NOTICE':6,'LOG_INFO':6,'LOG_DEBUG':6,'LOG_KERN':0,'LOG_USER':8,'LOG_MAIL':16,'LOG_DAEMON':24,'LOG_AUTH':32,'LOG_SYSLOG':40,'LOG_LPR':48,'LOG_NEWS':56,'LOG_UUCP':64,'LOG_CRON':72,'LOG_AUTHPRIV':80,'LOG_PID':1,'LOG_CONS':2,'LOG_ODELAY':4,'LOG_NDELAY':8,'LOG_NOWAIT':16,'LOG_PERROR':32,'EXTR_OVERWRITE':0,'EXTR_SKIP':1,'EXTR_PREFIX_SAME':2,'EXTR_PREFIX_ALL':3,'EXTR_PREFIX_INVALID':4,'EXTR_PREFIX_IF_EXISTS':5,'EXTR_IF_EXISTS':6,'EXTR_REFS':256,'SORT_ASC':4,'SORT_DESC':3,'SORT_REGULAR':0,'SORT_NUMERIC':1,'SORT_STRING':2,'SORT_LOCALE_STRING':5,'CASE_LOWER':0,'CASE_UPPER':1,'COUNT_NORMAL':0,'COUNT_RECURSIVE':1,'ASSERT_ACTIVE':1,'ASSERT_CALLBACK':2,'ASSERT_BAIL':3,'ASSERT_WARNING':4,'ASSERT_QUIET_EVAL':5,'STREAM_USE_PATH':1,'STREAM_IGNORE_URL':2,'STREAM_ENFORCE_SAFE_MODE':4,'STREAM_REPORT_ERRORS':8,'STREAM_MUST_SEEK':16,'STREAM_URL_STAT_LINK':1,'STREAM_URL_STAT_QUIET':2,'STREAM_MKDIR_RECURSIVE':1,'STREAM_IS_URL':1,'IMAGETYPE_GIF':1,'IMAGETYPE_JPEG':2,'IMAGETYPE_PNG':3,'IMAGETYPE_SWF':4,'IMAGETYPE_PSD':5,'IMAGETYPE_BMP':6,'IMAGETYPE_TIFF_II':7,'IMAGETYPE_TIFF_MM':8,'IMAGETYPE_JPC':9,'IMAGETYPE_JP2':10,'IMAGETYPE_JPX':11,'IMAGETYPE_JB2':12,'IMAGETYPE_SWC':13,'IMAGETYPE_IFF':14,'IMAGETYPE_WBMP':15,'IMAGETYPE_JPEG2000':9,'IMAGETYPE_XBM':16}};if(this.php_js&&this.php_js.ini&&this.php_js.ini['phpjs.get_defined_constants.setConstants']&&this.php_js.ini['phpjs.get_defined_constants.setConstants'].local_value){if(this.php_js.ini['phpjs.get_defined_constants.setConstants'].local_value==='this'){win=this;}
else if(this.php_js.ini['phpjs.get_defined_constants.setConstants'].local_value==='thisExt'){win=this;thisExt=true;}
else{win=this.window;}
for(ext in constObj){if(thisExt){for(cnst in constObj[ext]){if(!win[ext]){win[ext]={};}
win[ext][cnst]=constObj[ext][cnst];}}
else{for(cnst in constObj[ext]){if(this===this.window){this.define(cnst,constObj[ext][cnst]);}
else{win[cnst]=constObj[ext][cnst];}}}}}
if(typeof categorize!=='undefined'){return constObj;}
for(ext in constObj){for(cnst in constObj[ext]){flatConstObj[cnst]=constObj[ext][cnst];}}
return flatConstObj;}
function get_defined_functions(){var i='',arr=[],already={};for(i in this.window){try{if(typeof this.window[i]==='function'){if(!already[i]){already[i]=1;arr.push(i);}}
else if(typeof this.window[i]==='object'){for(var j in this.window[i]){if(typeof this.window[j]==='function'&&this.window[j]&&!already[j]){already[j]=1;arr.push(j);}}}}
catch(e){}}
return arr;}
function get_defined_vars(){var i='',arr=[],already={};for(i in this.window){try{if(typeof this.window[i]==='function'){if(!already[i]){already[i]=1;arr.push(i);}}
else if(typeof this.window[i]==='object'){for(var j in this.window[i]){if(typeof this.window[j]==='function'&&this.window[j]&&!already[j]){already[j]=1;arr.push(j);}}}}
catch(e){}}
return arr;}
function get_extension_funcs(module_name){this.php_js=this.php_js||{};this.php_js.exts=this.php_js.exts||{array:['array_change_key_case','array_chunk','array_combine','array_count_values','array_diff_assoc','array_diff_key','array_diff_uassoc','array_diff_ukey','array_diff','array_fill_keys','array_fill','array_filter','array_flip','array_intersect_assoc','array_intersect_key','array_intersect_uassoc','array_intersect_ukey','array_intersect','array_key_exists','array_keys','array_map','array_merge_recursive','array_merge','array_multisort','array_pad','array_pop','array_product','array_push','array_rand','array_reduce','array_replace_recursive','array_replace','array_reverse','array_search','array_shift','array_slice','array_splice','array_sum','array_udiff_assoc','array_udiff_uassoc','array_udiff','array_uintersect_assoc','array_uintersect_uassoc','array_uintersect','array_unique','array_unshift','array_values','array_walk_recursive','array_walk','array','arsort','asort','compact','count','current','each','end','extract','in_array','key','krsort','ksort','list','natcasesort','natsort','next','pos','prev','range','reset','rsort','shuffle','sizeof','sort','uasort','uksort','usort'],bc:['bcadd','bccomp','bcdiv','bcmod','bcmul','bcpow','bcpowmod','bcscale','bcsqrt','bcsub'],classkit:['classkit_import','classkit_method_add','classkit_method_copy','classkit_method_redefine','classkit_method_remove','classkit_method_rename'],classobj:['call_user_method_array','call_user_method','class_alias','class_exists','get_called_class','get_class_methods','get_class_vars','get_class','get_declared_classes','get_declared_interfaces','get_object_vars','get_parent_class','interface_exists','is_a','is_subclass_of','method_exists','property_exists'],ctype:['ctype_alnum','ctype_alpha','ctype_cntrl','ctype_digit','ctype_graph','ctype_lower','ctype_print','ctype_punct','ctype_space','ctype_upper','ctype_xdigit'],datetime:['checkdate','date_add','date_create_from_format','date_create','date_date_set','date_default_timezone_get','date_default_timezone_set','date_diff','date_format','date_get_last_errors','date_interval_create_from_date_string','date_interval_format','date_isodate_set','date_modify','date_offset_get','date_parse_from_format','date_parse','date_sub','date_sun_info','date_sunrise','date_sunset','date_time_set','date_timestamp_get','date_timestamp_set','date_timezone_get','date_timezone_set','date','getdate','gettimeofday','gmdate','gmmktime','gmstrftime','idate','localtime','microtime','mktime','strftime','strptime','strtotime','time','timezone_abbreviations_list','timezone_identifiers_list','timezone_location_get','timezone_name_from_abbr','timezone_name_get','timezone_offset_get','timezone_open','timezone_transitions_get','timezone_version_get'],dir:['chdir','chroot','dir','closedir','getcwd','opendir','readdir','rewinddir','scandir'],errorfunc:['debug_backtrace','debug_print_backtrace','error_get_last','error_log','error_reporting','restore_error_handler','restore_exception_handler','set_error_handler','set_exception_handler','trigger_error','user_error'],exec:['escapeshellarg','escapeshellcmd','exec','passthru','proc_close','proc_get_status','proc_nice','proc_open','proc_terminate','shell_exec','system'],filesystem:['basename','chgrp','chmod','chown','clearstatcache','copy','delete','dirname','disk_free_space','disk_total_space','diskfreespace','fclose','feof','fflush','fgetc','fgetcsv','fgets','fgetss','file_exists','file_get_contents','file_put_contents','file','fileatime','filectime','filegroup','fileinode','filemtime','fileowner','fileperms','filesize','filetype','flock','fnmatch','fopen','fpassthru','fputcsv','fputs','fread','fscanf','fseek','fstat','ftell','ftruncate','fwrite','glob','is_dir','is_executable','is_file','is_link','is_readable','is_uploaded_file','is_writable','is_writeable','lchgrp','lchown','link','linkinfo','lstat','mkdir','move_uploaded_file','parse_ini_file','parse_ini_string','pathinfo','pclose','popen','readfile','readlink','realpath','rename','rewind','rmdir','set_file_buffer','stat','symlink','tempnam','tmpfile','touch','umask','unlink'],funchand:['call_user_func_array','call_user_func','create_function','forward_static_call_array','forward_static_call','func_get_arg','func_get_args','func_num_args','function_exists','get_defined_functions','register_shutdown_function','register_tick_function','unregister_tick_function'],i18n:['locale_get_default','locale_set_default'],inclued:['inclued_get_data'],info:['assert_options','assert','dl','extension_loaded','gc_collect_cycles','gc_disable','gc_enable','gc_enabled','get_cfg_var','get_current_user','get_defined_constants','get_extension_funcs','get_include_path','get_included_files','get_loaded_extensions','get_magic_quotes_gpc','get_magic_quotes_runtime','get_required_files','getenv','getlastmod','getmygid','getmyinode','getmypid','getmyuid','getopt','getrusage','ini_alter','ini_get_all','ini_get','ini_restore','ini_set','magic_quotes_runtime','main','memory_get_peak_usage','memory_get_usage','php_ini_loaded_file','php_ini_scanned_files','php_logo_guid','php_sapi_name','php_uname','phpcredits','phpinfo','phpversion','putenv','restore_include_path','set_include_path','set_magic_quotes_runtime','set_time_limit','sys_get_temp_dir','version_compare','zend_logo_guid','zend_thread_id','zend_version'],json:['json_decode','json_encode','json_last_error'],language:['at','clone','declare','foreach','goto','include','include_once','php_user_filter','require','require_once','stdClass','ErrorException','Exception','HEREDOC','$_SESSION','__CLASS__','__DIR__','__FILE__','__FUNCTION__','__LINE__','__METHOD__',],math:['abs','acos','acosh','asin','asinh','atan2','atan','atanh','base_convert','bindec','ceil','cos','cosh','decbin','dechex','decoct','deg2rad','exp','expm1','floor','fmod','getrandmax','hexdec','hypot','is_finite','is_infinite','is_nan','lcg_value','log10','log1p','log','max','min','mt_getrandmax','mt_rand','mt_srand','octdec','pi','pow','rad2deg','rand','round','sin','sinh','sqrt','srand','tan','tanh'],misc:['connection_aborted','connection_status','connection_timeout','constant','define','defined','die','eval','exit','get_browser','__halt_compiler','highlight_file','highlight_string','ignore_user_abort','pack','php_check_syntax','php_strip_whitespace','show_source','sleep','sys_getloadavg','time_nanosleep','time_sleep_until','uniqid','unpack','usleep'],'net-gopher':['gopher_parsedir'],network:['checkdnsrr','closelog','define_syslog_variables','dns_check_record','dns_get_mx','dns_get_record','fsockopen','gethostbyaddr','gethostbyname','gethostbynamel','gethostname','getmxrr','getprotobyname','getprotobynumber','getservbyname','getservbyport','header_remove','header','headers_list','headers_sent','inet_ntop','inet_pton','ip2long','long2ip','openlog','pfsockopen','setcookie','setrawcookie','socket_get_status','socket_set_blocking','socket_set_timeout','syslog'],objaggregation:['aggregate_info','aggregate_methods_by_list','aggregate_methods_by_regexp','aggregate_methods','aggregate_properties_by_list','aggregate_properties_by_regexp','aggregate_properties','aggregate','aggregation_info','deaggregate'],outcontrol:['flush','ob_clean','ob_end_clean','ob_end_flush','ob_flush','ob_get_clean','ob_get_contents','ob_get_flush','ob_get_length','ob_get_level','ob_get_status','ob_gzhandler','ob_implicit_flush','ob_list_handlers','ob_start','output_add_rewrite_var','output_reset_rewrite_vars'],overload:['overload'],pcre:['preg_filter','preg_grep','preg_last_error','preg_match_all','preg_match','preg_quote','preg_replace_callback','preg_replace','preg_split'],runkit:['Runkit_Sandbox','Runkit_Sandbox_Parent','runkit_class_adopt','runkit_class_emancipate','runkit_constant_add','runkit_constant_redefine','runkit_constant_remove','runkit_function_add','runkit_function_copy','runkit_function_redefine','runkit_function_remove','runkit_function_rename','runkit_import','runkit_lint_file','runkit_lint','runkit_method_add','runkit_method_copy','runkit_method_redefine','runkit_method_remove','runkit_method_rename','runkit_return_value_used','runkit_sandbox_output_handler','runkit_superglobals'],session:['session_cache_expire','session_cache_limiter','session_commit','session_decode','session_destroy','session_encode','session_get_cookie_params','session_id','session_is_registered','session_module_name','session_name','session_regenerate_id','session_register','session_save_path','session_set_cookie_params','session_set_save_handler','session_start','session_unregister','session_unset','session_write_close'],stream:['set_socket_blocking','stream_bucket_append','stream_bucket_make_writeable','stream_bucket_new','stream_bucket_prepend','stream_context_create','stream_context_get_default','stream_context_get_options','stream_context_get_params','stream_context_set_default','stream_context_set_option','stream_context_set_params','stream_copy_to_stream','stream_encoding','stream_filter_append','stream_filter_prepend','stream_filter_register','stream_filter_remove','stream_get_contents','stream_get_filters','stream_get_line','stream_get_meta_data','stream_get_transports','stream_get_wrappers','stream_is_local','stream_notification_callback','stream_register_wrapper','stream_resolve_include_path','stream_select','stream_set_blocking','stream_set_timeout','stream_set_write_buffer','stream_socket_accept','stream_socket_client','stream_socket_enable_crypto','stream_socket_get_name','stream_socket_pair','stream_socket_recvfrom','stream_socket_sendto','stream_socket_server','stream_socket_shutdown','stream_supports_lock','stream_wrapper_register','stream_wrapper_restore','stream_wrapper_unregister'],strings:['addcslashes','addslashes','bin2hex','chop','chr','chunk_split','convert_cyr_string','convert_uudecode','convert_uuencode','count_chars','crc32','crypt','echo','explode','fprintf','get_html_translation_table','hebrev','hebrevc','html_entity_decode','htmlentities','htmlspecialchars_decode','htmlspecialchars','implode','join','lcfirst','levenshtein','localeconv','ltrim','md5_file','md5','metaphone','money_format','nl_langinfo','nl2br','number_format','ord','parse_str','print','printf','quoted_printable_decode','quoted_printable_encode','quotemeta','rtrim','setlocale','sha1_file','sha1','similar_text','soundex','sprintf','sscanf','str_getcsv','str_ireplace','str_pad','str_repeat','str_replace','str_rot13','str_shuffle','str_split','str_word_count','strcasecmp','strchr','strcmp','strcoll','strcspn','strip_tags','stripcslashes','stripos','stripslashes','stristr','strlen','strnatcasecmp','strnatcmp','strncasecmp','strncmp','strpbrk','strpos','strrchr','strrev','strripos','strrpos','strspn','strstr','strtok','strtolower','strtoupper','strtr','substr_compare','substr_count','substr_replace','substr','trim','ucfirst','ucwords','vfprintf','vprintf','vsprintf','wordwrap'],tokenizer:['token_get_all','token_name'],url:['base64_decode','base64_encode','get_headers','get_meta_tags','http_build_query','parse_url','rawurldecode','rawurlencode','urldecode','urlencode'],'var':['debug_zval_dump','doubleval','empty','floatval','get_defined_vars','get_resource_type','gettype','import_request_variables','intval','is_array','is_binary','is_bool','is_buffer','is_callable','is_double','is_float','is_int','is_integer','is_long','is_null','is_numeric','is_object','is_real','is_resource','is_scalar','is_string','is_unicode','isset','print_r','serialize','settype','strval','unserialize','unset','var_dump','var_export'],xml:['utf8_decode','utf8_encode','xml_error_string','xml_get_current_byte_index','xml_get_current_column_number','xml_get_current_line_number','xml_get_error_code','xml_parse_into_struct','xml_parse','xml_parser_create_ns','xml_parser_create','xml_parser_free','xml_parser_get_option','xml_parser_set_option','xml_set_character_data_handler','xml_set_default_handler','xml_set_element_handler','xml_set_end_namespace_decl_handler','xml_set_external_entity_ref_handler','xml_set_notation_decl_handler','xml_set_object','xml_set_processing_instruction_handler','xml_set_start_namespace_decl_handler','xml_set_unparsed_entity_decl_handler'],xmlreader:['XMLReader'],xmlwriter:['xmlwriter_end_attribute','xmlwriter_end_cdata','xmlwriter_end_comment','xmlwriter_end_document','xmlwriter_end_dtd_attlist','xmlwriter_end_dtd_element','xmlwriter_end_dtd_entity','xmlwriter_end_dtd','xmlwriter_end_element','xmlwriter_end_pi','xmlwriter_flush','xmlwriter_full_end_element','xmlwriter_open_memory','xmlwriter_open_uri','xmlwriter_output_memory','xmlwriter_set_indent_string','xmlwriter_set_indent','xmlwriter_start_attribute_ns','xmlwriter_start_attribute','xmlwriter_start_cdata','xmlwriter_start_comment','xmlwriter_start_document','xmlwriter_start_dtd_attlist','xmlwriter_start_dtd_element','xmlwriter_start_dtd_entity','xmlwriter_start_dtd','xmlwriter_start_element_ns','xmlwriter_start_element','xmlwriter_start_pi','xmlwriter_text','xmlwriter_write_attribute_ns','xmlwriter_write_attribute','xmlwriter_write_cdata','xmlwriter_write_comment','xmlwriter_write_dtd_attlist','xmlwriter_write_dtd_element','xmlwriter_write_dtd_entity','xmlwriter_write_dtd','xmlwriter_write_element_ns','xmlwriter_write_element','xmlwriter_write_pi','xmlwriter_write_raw']};return this.php_js.exts[module_name]||false;}
function get_headers(url,format){var req=this.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
var tmp,headers,pair,i,j=0;req.open('HEAD',url,false);req.send(null);if(req.readyState<3){return false;}
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];}}
return headers;}
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');}
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;';}
if(useQuoteStyle!=='ENT_NOQUOTES'){entities['34']='&quot;';}
if(useQuoteStyle==='ENT_QUOTES'){entities['39']='&#39;';}
entities['60']='&lt;';entities['62']='&gt;';for(decimal in entities){symbol=String.fromCharCode(decimal);hash_map[symbol]=entities[decimal];}
return hash_map;}
function get_include_path(){if(this.php_js&&this.php_js.ini&&this.php_js.ini.include_path&&this.php_js.ini.include_path.local_value){return this.php_js.ini.include_path.local_value;}
return'';}
function get_included_files(){var cur_file={};cur_file[this.window.location.href]=1;if(!this.php_js){this.php_js={};}
if(!this.php_js.includes){this.php_js.includes=cur_file;}
var includes=[];var i=0;for(var key in this.php_js.includes){includes[i]=key;i++;}
return includes;}
function get_meta_tags(file){var fulltxt='';if(false){fulltxt='<meta name="author" content="name">'+'<meta name="keywords" content="php documentation">'+'<meta name="DESCRIPTION" content="a php manual">'+'<meta name="geo.position" content="49.33;-86.59">'+'</head>';}else{fulltxt=this.file_get_contents(file).match(/^[\s\S]*<\/head>/i);}
var patt=/<meta[^>]*?>/gim;var patt1=/<meta\s+.*?name\s*=\s*(['"]?)(.*?)\1\s+.*?content\s*=\s*(['"]?)(.*?)\3/gim;var patt2=/<meta\s+.*?content\s*=\s*(['"?])(.*?)\1\s+.*?name\s*=\s*(['"]?)(.*?)\3/gim;var txt,match,name,arr={};while((txt=patt.exec(fulltxt))!==null){while((match=patt1.exec(txt))!==null){name=match[2].replace(/\W/g,'_').toLowerCase();arr[name]=match[4];}
while((match=patt2.exec(txt))!==null){name=match[4].replace(/\W/g,'_').toLowerCase();arr[name]=match[2];}}
return arr;}
function get_object_vars(obj){var retArr={},prop='';for(prop in obj){if(typeof obj[prop]!=='function'&&prop!=='prototype'){retArr[prop]=obj[prop];}}
for(prop in obj.prototype){if(typeof obj.prototype[prop]!=='function'){retArr[prop]=obj.prototype[prop];}}
return retArr;}
function get_required_files(){return this.get_included_files();}
function get_resource_type(handle){var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(!handle||typeof handle!=='object'||!handle.constructor||getFuncName(handle.constructor)!=='PHPJS_Resource'){return false;}
return handle.get_resource_type();}
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;}
function getenv(varname){if(!this.php_js||!this.php_js.ENV||!this.php_js.ENV[varname]){return false;}
return this.php_js.ENV[varname];}
function getlastmod(){return new Date(this.window.document.lastModified).getTime()/1000;}
function getrandmax()
{return 2147483647;}
function gettimeofday(return_float){var t=new Date(),y=0;if(return_float){return t.getTime()/1000;}
y=t.getFullYear();return{sec:t.getUTCSeconds(),usec:t.getUTCMilliseconds()*1000,minuteswest:t.getTimezoneOffset(),dsttime:0+(((new Date(y,0))-Date.UTC(y,0))!==((new Date(y,6))-Date.UTC(y,6)))};}
function gettype(mixed_var){var s=typeof mixed_var,name;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(s==='object'){if(mixed_var!==null){if(typeof mixed_var.length==='number'&&!(mixed_var.propertyIsEnumerable('length'))&&typeof mixed_var.splice==='function'){s='array';}
else if(mixed_var.constructor&&getFuncName(mixed_var.constructor)){name=getFuncName(mixed_var.constructor);if(name==='Date'){s='date';}
else if(name==='RegExp'){s='regexp';}
else if(name==='PHPJS_Resource'){s='resource';}}}else{s='null';}}
else if(s==='number'){s=this.is_float(mixed_var)?'double':'integer';}
return s;}
function gmdate(format,timestamp){var dt=((typeof(timestamp)=='undefined')?new Date():(typeof(timestamp)=='object')?new Date(timestamp):new Date(timestamp*1000));timestamp=Date.parse(dt.toUTCString().slice(0,-4))/1000;return this.date(format,timestamp);}
function gmmktime(){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['getUTC'+e[i]]();r[i]+=(i===3);}else{r[i]=parseInt(r[i],10);if(isNaN(r[i])){return false;}}}
r[5]+=(r[5]>=0?(r[5]<=69?2e3:(r[5]<=100?1900:0)):0);d.setUTCFullYear(r[5],r[3]-1,r[4]);d.setUTCHours(r[0],r[1],r[2]);return(d.getTime()/1e3>>0)-(d.getTime()<0);}
function gmstrftime(format,timestamp){var dt=((typeof(timestamp)=='undefined')?new Date():(typeof(timestamp)=='object')?new Date(timestamp):new Date(timestamp*1000));timestamp=Date.parse(dt.toUTCString().slice(0,-4))/1000;return this.strftime(format,timestamp);}
function gopher_parsedir(dirent){var entryPattern=/^(.)(.*?)\t(.*?)\t(.*?)\t(.*?)\u000d\u000a$/;var entry=dirent.match(entryPattern);if(entry===null){throw'Could not parse the directory entry';}
var type=entry[1];switch(type){case'i':type=255;break;case'1':type=1;break;case'0':type=0;break;case'4':type=4;break;case'5':type=5;break;case'6':type=6;break;case'9':type=9;break;case'h':type=254;break;default:return{type:-1,data:dirent};}
return{type:type,title:entry[2],path:entry[3],host:entry[4],port:entry[5]};}
function hexdec(hex_string){hex_string=(hex_string+'').replace(/[^a-f0-9]/gi,'');return parseInt(hex_string,16);}
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;}
delete(hash_map['&']);hash_map['&']='&amp;';for(symbol in hash_map){entity=hash_map[symbol];tmp_str=tmp_str.split(entity).join(symbol);}
tmp_str=tmp_str.split('&#039;').join("'");return tmp_str;}
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;}
hash_map["'"]='&#039;';for(symbol in hash_map){entity=hash_map[symbol];tmp_str=tmp_str.split(symbol).join(entity);}
return tmp_str;}
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;}
string=string.toString();if(double_encode!==false){string=string.replace(/&/g,'&amp;');}
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;}
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;}
else if(OPTS[quote_style[i]]){optTemp=optTemp|OPTS[quote_style[i]];}}
quote_style=optTemp;}
if(quote_style&OPTS.ENT_HTML_QUOTE_SINGLE){string=string.replace(/'/g,'&#039;');}
if(!noquotes){string=string.replace(/"/g,'&quot;');}
return string;}
function htmlspecialchars_decode(string,quote_style){var optTemp=0,i=0,noquotes=false;if(typeof quote_style==='undefined'){quote_style=2;}
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;}
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;}
else if(OPTS[quote_style[i]]){optTemp=optTemp|OPTS[quote_style[i]];}}
quote_style=optTemp;}
if(quote_style&OPTS.ENT_HTML_QUOTE_SINGLE){string=string.replace(/&#0*39;/g,"'");}
if(!noquotes){string=string.replace(/&quot;/g,'"');}
string=string.replace(/&amp;/g,'&');return string;}
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";}
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));}}
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="&";}
for(key in formdata){value=formdata[key];if(numeric_prefix&&!isNaN(key)){key=String(numeric_prefix)+key;}
tmp.push(_http_build_query_helper(key,value,arg_separator));}
return tmp.join(arg_separator);}
function hypot(x,y){return Math.sqrt(x*x+y*y)||0;}
function i18n_loc_get_default(){this.php_js=this.php_js||{};return this.php_js.i18nLocale||(i18n_loc_set_default('en_US_POSIX'),'en_US_POSIX');}
function i18n_loc_set_default(name){this.php_js=this.php_js||{};this.php_js.i18nLocales={en_US_POSIX:{sorting:function(str1,str2){return(str1==str2)?0:((str1>str2)?1:-1);}}};this.php_js.i18nLocale=name;return true;}
function idate(format,timestamp){if(format===undefined){throw'idate() expects at least 1 parameter, 0 given';}
if(!format.length||format.length>1){throw'idate format is one char';}
var date=((typeof timestamp==='undefined')?new Date():(timestamp instanceof Date)?new Date(timestamp):new Date(timestamp*1000)),a;switch(format){case'B':return Math.floor(((date.getUTCHours()*36e2)+(date.getUTCMinutes()*60)+
date.getUTCSeconds()+36e2)/86.4)%1e3;case'd':return date.getDate();case'h':return date.getHours()%12||12;case'H':return date.getHours();case'i':return date.getMinutes();case'I':a=date.getFullYear();return 0+(((new Date(a,0))-Date.UTC(a,0))!==((new Date(a,6))-Date.UTC(a,6)));case'L':a=date.getFullYear();return(!(a&3)&&(a%1e2||!(a%4e2)))?1:0;case'm':return date.getMonth()+1;case's':return date.getSeconds();case't':return(new Date(date.getFullYear(),date.getMonth()+1,0)).getDate();case'U':return Math.round(date.getTime()/1000);case'w':return date.getDay();case'W':a=new Date(date.getFullYear(),date.getMonth(),date.getDate()-(date.getDay()||7)+3);return 1+Math.round((a-(new Date(a.getFullYear(),0,4)))/864e5/7);case'y':return parseInt((date.getFullYear()+'').slice(2),10);case'Y':return date.getFullYear();case'z':return Math.floor((date-new Date(date.getFullYear(),0,1))/864e5);case'Z':return-date.getTimezoneOffset()*60;default:throw'Unrecognized date format token';}}
function implode(glue,pieces){var i='',retVal='',tGlue='';if(arguments.length===1){pieces=glue;glue='';}
if(typeof(pieces)==='object'){if(pieces instanceof Array){return pieces.join(glue);}
else{for(i in pieces){retVal+=tGlue+pieces[i];tGlue=glue;}
return retVal;}}
else{return pieces;}}
function import_request_variables(types,prefix){var i=0,current='',url='',vars='',arrayBracketPos=-1,arrName='',win=this.window,requestObj=this.window,getObj=false,cookieObj=false;prefix=prefix||'';var that=this;var _ini_get=function(ini){if(that.php_js&&that.php_js.ini&&that.php_js.ini[ini]&&that.php_js.ini[ini].local_value){return that.php_js.ini[ini].local_value;}
return false;};requestObj=_ini_get('phpjs.requestVarsObj')||requestObj;if(/g/i.test(types)){getObj=_ini_get('phpjs.getVarsObj')||getObj;for(i=0,url=win.location.href,vars=url.substring(url.lastIndexOf('?')+1,url.length).split('&');i<vars.length;i++){current=vars[i].split('=');current[1]=decodeURIComponent(current[1]);arrayBracketPos=current[0].indexOf('[');if(arrayBracketPos!==-1){arrName=current[0].substring(0,arrayBracketPos);arrName=decodeURIComponent(arrName);if(!requestObj[prefix+arrName]){requestObj[prefix+arrName]=[];}
requestObj[prefix+arrName].push(current[1]||null);if(getObj){if(!getObj[prefix+arrName]){getObj[prefix+arrName]=[];}
getObj[prefix+arrName].push(current[1]||null);}}
else{current[0]=decodeURIComponent(current[0]);requestObj[prefix+current[0]]=current[1]||null;if(getObj){getObj[prefix+current[0]]=current[1]||null;}}}}
if(/c/i.test(types)){cookieObj=_ini_get('phpjs.cookieVarsObj')||cookieObj;for(i=0,vars=win.document.cookie.split("&");i<vars.length;i++){current=vars[i].split("=");requestObj[prefix+current[0]]=current[1].split(";")[0]||null;if(cookieObj){cookieObj[prefix+current[0]]=current[1].split(";")[0]||null;}}}}
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;}}}
return false;}
function include(filename){var d=this.window.document;var js=d.createElementNS?d.createElementNS('http://www.w3.org/1999/xhtml','script'):d.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',filename);js.setAttribute('defer','defer');d.getElementsByTagNameNS?(d.getElementsByTagNameNS('http://www.w3.org/1999/xhtml','head')[0]?d.getElementsByTagNameNS('http://www.w3.org/1999/xhtml','head')[0].appendChild(js):d.documentElement.insertBefore(js,d.documentElement.firstChild)):d.getElementsByTagName('head')[0].appendChild(js);var cur_file={};cur_file[this.window.location.href]=1;this.php_js=this.php_js||{};if(!this.php_js.includes){this.php_js.includes=cur_file;}
if(!this.php_js.includes[filename]){this.php_js.includes[filename]=1;}else{this.php_js.includes[filename]++;}
return this.php_js.includes[filename];}
function include_once(filename){var cur_file={};cur_file[this.window.location.href]=1;try{php_js_shared;}
catch(e){php_js_shared={};}
if(!php_js_shared.includes){php_js_shared.includes=cur_file;}
if(!php_js_shared.includes[filename]){if(this.include(filename)){return true;}}else{return true;}
return false;}
function inet_ntop(a){var i=0,m='',c=[];a+='';if(a.length===4){return[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)].join('.');}else if(a.length===16){for(i=0;i<16;i++){c.push(((a.charCodeAt(i++)<<8)+a.charCodeAt(i)).toString(16));}
return c.join(':').replace(/((^|:)0(?=:|$))+:?/g,function(t){m=(t.length>m.length)?t:m;return t;}).replace(m||' ','::');}else{return false;}}
function inet_pton(a){var r,m,x,i,j,f=String.fromCharCode;m=a.match(/^(?:\d{1,3}(?:\.|$)){4}/);if(m){m=m[0].split('.');m=f(m[0])+f(m[1])+f(m[2])+f(m[3]);return m.length===4?m:false;}
r=/^((?:[\da-f]{1,4}(?::|)){0,8})(::)?((?:[\da-f]{1,4}(?::|)){0,8})$/;m=a.match(r);if(m){for(j=1;j<4;j++){if(j===2||m[j].length===0){continue;}
m[j]=m[j].split(':');for(i=0;i<m[j].length;i++){m[j][i]=parseInt(m[j][i],16);if(isNaN(m[j][i])){return false;}
m[j][i]=f(m[j][i]>>8)+f(m[j][i]&0xFF);}
m[j]=m[j].join('');}
x=m[1].length+m[3].length;if(x===16){return m[1]+m[3];}else if(x<16&&m[2].length>0){return m[1]+(new Array(16-x+1)).join('\x00')+m[3];}}
return false;}
function ini_alter(varname,newvalue){return this.ini_set(varname,newvalue);}
function ini_get(varname){if(this.php_js&&this.php_js.ini&&this.php_js.ini[varname]&&this.php_js.ini[varname].local_value!==undefined){if(this.php_js.ini[varname].local_value===null){return'';}
return this.php_js.ini[varname].local_value;}
return'';}
function ini_get_all(extension,details){var key='',ini={},noDetails={},extPattern;this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};if(extension){extPattern=new RegExp('^'+extension+'\\.');for(key in this.php_js.ini){if(extPattern.test(key)){ini[key]=this.php_js.ini[key];}}}
else{for(key in this.php_js.ini){ini[key]=this.php_js.ini[key];}}
if(details!==false){return ini;}
for(key in ini){noDetails[key]=ini[key].local_value;}
return noDetails;}
function ini_restore(varname){if(this.php_js&&this.php_js.ini&&this.php_js.ini[varname]){this.php_js.ini[varname].local_value=this.php_js.ini[varname].global_value;}}
function ini_set(varname,newvalue){var oldval='',that=this;this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};this.php_js.ini[varname]=this.php_js.ini[varname]||{};oldval=this.php_js.ini[varname].local_value;var _setArr=function(oldval){if(typeof oldval==='undefined'){that.php_js.ini[varname].local_value=[];}
that.php_js.ini[varname].local_value.push(newvalue);};switch(varname){case'extension':if(typeof this.dl==='function'){this.dl(newvalue);}
_setArr(oldval,newvalue);break;default:this.php_js.ini[varname].local_value=newvalue;break;}
return oldval;}
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;}}
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;}
IP[0]=0;for(i=1;i<5;i+=1){IP[0]+=!!((IP[i]||'').length);IP[i]=parseInt(IP[i])||0;}
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;}
return IP[1]*(IP[0]===1||16777216)+IP[2]*(IP[0]<=2||65536)+IP[3]*(IP[0]<=3||256)+IP[4]*1;}
function is_array(mixed_var){var key='';var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(!mixed_var){return false;}
this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};if(typeof mixed_var==='object'){if(this.php_js.ini['phpjs.objectsAsArrays']&&((this.php_js.ini['phpjs.objectsAsArrays'].local_value.toLowerCase&&this.php_js.ini['phpjs.objectsAsArrays'].local_value.toLowerCase()==='off')||parseInt(this.php_js.ini['phpjs.objectsAsArrays'].local_value,10)===0)){return mixed_var.hasOwnProperty('length')&&!mixed_var.propertyIsEnumerable('length')&&getFuncName(mixed_var.constructor)!=='String';}
if(mixed_var.hasOwnProperty){for(key in mixed_var){if(false===mixed_var.hasOwnProperty(key)){return false;}}}
return true;}
return false;}
function is_binary(vr){return typeof vr==='string';}
function is_bool(mixed_var)
{return(typeof mixed_var==='boolean');}
function is_buffer(vr){return typeof vr==='string';}
function is_callable(v,syntax_only,callable_name){var name='',obj={},method='';var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(typeof v==='string'){obj=this.window;method=v;name=v;}
else if(v instanceof Array&&v.length===2&&typeof v[0]==='object'&&typeof v[1]==='string'){obj=v[0];method=v[1];name=(obj.constructor&&getFuncName(obj.constructor))+'::'+method;}
else{return false;}
if(syntax_only||typeof obj[method]==='function'){if(callable_name){this.window[callable_name]=name;}
return true;}
return false;}
function is_double(mixed_var){return this.is_float(mixed_var);}
function is_finite(val){var warningType='';if(val===Infinity||val===-Infinity){return false;}
if(typeof val=='object'){warningType=(val instanceof Array?'array':'object');}else if(typeof val=='string'&&!val.match(/^[\+\-]?\d/)){warningType='string';}
if(warningType){throw new Error('Warning: is_finite() expects parameter 1 to be double, '+warningType+' given');}
return true;}
function is_float(mixed_var){if(typeof mixed_var!=='number'){return false;}
return!!(mixed_var%1);}
function is_infinite(val){var warningType='';if(val===Infinity||val===-Infinity){return true;}
if(typeof val=='object'){warningType=(val instanceof Array?'array':'object');}else if(typeof val=='string'&&!val.match(/^[\+\-]?\d/)){warningType='string';}
if(warningType){throw new Error('Warning: is_infinite() expects parameter 1 to be double, '+warningType+' given');}
return false;}
function is_int(mixed_var){if(typeof mixed_var!=='number'){return false;}
return!(mixed_var%1);}
function is_integer(mixed_var){return this.is_int(mixed_var);}
function is_long(mixed_var){return this.is_float(mixed_var);}
function is_nan(val){var warningType='';if(typeof val=='number'&&isNaN(val)){return true;}
if(typeof val=='object'){warningType=(val instanceof Array?'array':'object');}else if(typeof val=='string'&&!val.match(/^[\+\-]?\d/)){warningType='string';}
if(warningType){throw new Error('Warning: is_nan() expects parameter 1 to be double, '+warningType+' given');}
return false;}
function is_null(mixed_var){return(mixed_var===null);}
function is_numeric(mixed_var){return(typeof(mixed_var)==='number'||typeof(mixed_var)==='string')&&mixed_var!==''&&!isNaN(mixed_var);}
function is_object(mixed_var){if(mixed_var instanceof Array){return false;}else{return(mixed_var!==null)&&(typeof(mixed_var)=='object');}}
function is_real(mixed_var){return this.is_float(mixed_var);}
function is_resource(handle){var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};return!(!handle||typeof handle!=='object'||!handle.constructor||getFuncName(handle.constructor)!=='PHPJS_Resource');}
function is_scalar(mixed_var){return(/boolean|number|string/).test(typeof mixed_var);}
function is_string(mixed_var){return(typeof(mixed_var)=='string');}
function is_unicode(vr){if(typeof vr!=='string'){return false;}
var arr=[],any='([\s\S])',highSurrogate='[\uD800-\uDBFF]',lowSurrogate='[\uDC00-\uDFFF]',highSurrogateBeforeAny=new RegExp(highSurrogate+any,'g'),lowSurrogateAfterAny=new RegExp(any+lowSurrogate,'g'),singleLowSurrogate=new RegExp('^'+lowSurrogate+'$'),singleHighSurrogate=new RegExp('^'+highSurrogate+'$');while((arr=highSurrogateBeforeAny.exec(vr))!==null){if(!arr[1]||!arr[1].match(singleLowSurrogate)){return false;}}
while((arr=lowSurrogateAfterAny.exec(vr))!==null){if(!arr[1]||!arr[1].match(singleHighSurrogate)){return false;}}
return true;}
function isset(){var a=arguments,l=a.length,i=0;if(l===0){throw new Error('Empty isset');}
while(i!==l){if(typeof(a[i])=='undefined'||a[i]===null){return false;}else{i++;}}
return true;}
function join(glue,pieces){return this.implode(glue,pieces);}
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()');}
this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null;}}
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'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
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;}
this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null;}
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');}
return retVal;}
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);}
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';}
if(value instanceof PHPJS_Resource){throw new SyntaxError('json_encode');}
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';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
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()');}
this.php_js=this.php_js||{};this.php_js.last_error_json=4;return null;}}
function json_last_error(){return this.php_js&&this.php_js.last_error_json?this.php_js.last_error_json:0;}
function key(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;}}
return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
var cursor=pointers[pointers.indexOf(arr)+1];if(!(arr instanceof Array)){var ct=0;for(var k in arr){if(ct===cursor){return k;}
ct++;}
return false;}
if(arr.length===0){return false;}
return cursor;}
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;}
if(a>b){return-1;}
return 0;};break;}
for(k in inputArr){if(inputArr.hasOwnProperty){keys.push(k);}}
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];}}
for(i in tmp_arr){if(tmp_arr.hasOwnProperty){populateArr[i]=tmp_arr[i];}}
return strictForIn?true:populateArr;}
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;}
if(a<b){return-1;}
return 0;};break;}
for(k in inputArr){if(inputArr.hasOwnProperty){keys.push(k);}}
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];}}
for(i in tmp_arr){if(tmp_arr.hasOwnProperty){populateArr[i]=tmp_arr[i];}}
return strictForIn?true:populateArr;}
function lcfirst(str){str+='';var f=str.charAt(0).toLowerCase();return f+str.substr(1);}
function lcg_value(){return Math.random();}
function levenshtein(s1,s2){if(s1==s2){return 0;}
var s1_len=s1.length;var s2_len=s2.length;if(s1_len===0){return s2_len;}
if(s2_len===0){return s1_len;}
var split=false;try{split=!('0')[0];}catch(e){split=true;}
if(split){s1=s1.split('');s2=s2.split('');}
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;}
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;}
if(c<m_min){m_min=c;}
v1[s1_idx+1]=m_min;}
var v_tmp=v0;v0=v1;v1=v_tmp;}
return v0[s1_len];}
function localeconv(){var arr={},prop='';this.setlocale('LC_ALL',0);for(prop in this.php_js.locales[this.php_js.localeCategories.LC_NUMERIC].LC_NUMERIC){arr[prop]=this.php_js.locales[this.php_js.localeCategories.LC_NUMERIC].LC_NUMERIC[prop];}
for(prop in this.php_js.locales[this.php_js.localeCategories.LC_MONETARY].LC_MONETARY){arr[prop]=this.php_js.locales[this.php_js.localeCategories.LC_MONETARY].LC_MONETARY[prop];}
return arr;}
function localtime(timestamp,is_assoc){if(timestamp===undefined){timestamp=Math.round(new Date().getTime()/1000);}else if(timestamp instanceof Date){timestamp=timestamp/1000;}
var t=new Date(timestamp*1000);var jan1=new Date(t.getFullYear(),0,1);var yday=Math.ceil((t-jan1)/86400000)-1;jan1=new Date(t.getFullYear(),0,1,0,0,0,0);var june1=new Date(t.getFullYear(),6,1,0,0,0,0);var temp=jan1.toUTCString();var jan2=new Date(temp.slice(0,temp.lastIndexOf(' ')-1));temp=june1.toUTCString();var june2=new Date(temp.slice(0,temp.lastIndexOf(' ')-1));var std_time_offset=(jan1-jan2)/(1000*60*60);var daylight_time_offset=(june1-june2)/(1000*60*60);var dst;if(std_time_offset===daylight_time_offset){dst=0;}else{var hemisphere=std_time_offset-daylight_time_offset;if(hemisphere>=0){std_time_offset=daylight_time_offset;}
dst=1;}
if(is_assoc){return{'tm_sec':t.getSeconds(),'tm_min':t.getMinutes(),'tm_hour':t.getHours(),'tm_mday':t.getDate(),'tm_mon':t.getMonth(),'tm_year':t.getFullYear()-1900,'tm_wday':t.getDay(),'tm_yday':yday,'tm_isdst':dst};}
return[t.getSeconds(),t.getMinutes(),t.getHours(),t.getDate(),t.getMonth(),t.getFullYear()-1900,t.getDay(),yday,dst];}
function log(arg,base){if(base===undefined){return Math.log(arg);}else{return Math.log(arg)/Math.log(base);}}
function log10(arg){return Math.log(arg)/Math.LN10;}
function log1p(x){var ret=0,n=50;if(x<=-1){return'-INF';}
if(x<0||x>1){return Math.log(1+x);}
for(var i=1;i<n;i++){if((i%2)===0){ret-=Math.pow(x,i)/i;}
else{ret+=Math.pow(x,i)/i;}}
return ret;}
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))+'.'+
Math.floor((proper_address%Math.pow(256,3))/Math.pow(256,2))+'.'+
Math.floor(((proper_address%Math.pow(256,3))%Math.pow(256,2))/Math.pow(256,1))+'.'+
Math.floor((((proper_address%Math.pow(256,3))%Math.pow(256,2))%Math.pow(256,1))/Math.pow(256,0));}
return output;}
function ltrim(str,charlist){charlist=!charlist?' \\s\u00A0':(charlist+'').replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'$1');var re=new RegExp('^['+charlist+']+','g');return(str+'').replace(re,'');}
function mail(to,subject,message,additional_headers,additional_parameters){var _append=function(sm,prop,value){if(!sm[prop]){sm[prop]='';sm[prop]+=value;}
else{sm[prop]+=','+value;}};if(this.window.SendMail){var sm=new this.window.SendMail();var from=this.php_js&&this.php_js.ini&&this.php_js.ini.sendmail_from&&this.php_js.ini.sendmail_from.local_value;sm.To=to;sm.Subject=subject;sm.Body=message;sm.From=from;if(additional_headers){var headers=additional_headers.trim().split(/\r?\n/);for(var i=0;i<headers.length;i++){var header=headers[i];var colonPos=header.indexOf(':');if(colonPos===-1){throw new Error('Malformed headers');}
var prop=header.slice(0,colonPos).trim();var value=header.slice(colonPos+1).trim();switch(prop){case'Bcc':case'Cc':case'To':_append(sm,prop,value);break;case'Subject':break;case'Body':break;case'From':default:sm[prop]=value;break;}}}
if(!sm.From){throw new Error('Warning: mail(): "sendmail_from" not set in php.ini');}
return sm.send();}
return false;}
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]);}
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;}}
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()');}
if(ar.length===0){throw new Error('Array must contain at least one element for max()');}}else{ar=argv;}
retVal=ar[0];for(i=1,n=ar.length;i<n;++i){if(_compare(retVal,ar[i])==1){retVal=ar[i];}}
return retVal;}
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);}
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++;}
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);}
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);}
var temp=wordToHex(a)+wordToHex(b)+wordToHex(c)+wordToHex(d);return temp.toLowerCase();}
function md5_file(str_filename){var buf='';buf=this.file_get_contents(str_filename);if(!buf){return false;}
return this.md5(buf);}
function metaphone(word,phones){var wordlength=word.length,x=0,tempchar='',metaword='',removedbl=function(word){var wordlength=word.length,tempword=word.toLowerCase(),rebuilt,tempchar1,tempchar2,x;tempchar1=tempword.charAt(0);rebuilt=tempchar1;for(x=1;x<wordlength;x++){tempchar2=tempword.charAt(x);if(tempchar2!=tempchar1||tempchar2=='c'||tempchar2=='g'){rebuilt+=tempchar2;}
tempchar1=tempchar2;}
return rebuilt;},isVowel=function(a){switch(a.toLowerCase()){case'a':return true;case'e':return true;case'i':return true;case'o':return true;case'u':return true;default:return false;}},tempword=removedbl(word.toLowerCase());if(tempword.charAt(0)=='w'&&tempword.charAt(1)=='h'){tempword="w"+tempword.substr(2);}
for(x=0;x<wordlength;x++){tempchar=String(tempword).charAt(x);if(x===0&&x+1<=wordlength){switch(tempchar){case'a':if(tempword.charAt(x+1)=='e'){metaword+='e';}else{metaword+='a';}break;case'e':metaword+='e';break;case'i':metaword+='i';break;case'o':metaword+='o';break;case'u':metaword+='u';break;case'g':if(String(tempword).charAt(x+1)=='n'){x+=1;tempchar=String(tempword).charAt(x);}break;case'k':if(String(tempword).charAt(x+1)=='n'){x+=1;tempchar=String(tempword).charAt(x);}break;case'p':if(String(tempword).charAt(x+1)=='n'){x+=1;tempchar=String(tempword).charAt(x);}break;case'w':if(String(tempword).charAt(x+1)=='r'){x+=1;tempchar=String(tempword).charAt(x);break;}break;}}
if(isVowel(tempchar)===false){switch(tempchar){case'b':if(String(tempword).charAt(x-1)=='m'){break;}else{metaword+='b';}break;case'c':if(x+1<=wordlength){if(String(tempword).charAt(x+1)=='h'&&String(tempword).charAt(x-1)!='s'){if(x===0&&(x+2<=wordlength)&&isVowel(String(tempword).charAt(x+2))){metaword+='k';}else{metaword+='x';}}else if(String(tempword).charAt(x+1)=='i'&&String(tempword).charAt(x+2)=='a'){metaword+='x';}
else if(String(tempword).charAt(x+1)=='i'||String(tempword).charAt(x+1)=='e'||String(tempword).charAt(x+1)=='y'){if(x>0){if(String(tempword).charAt(x-1)=='s'){break;}else{metaword+='s';}}else{metaword+='s';}}else{metaword+='k';}}else{metaword+='k';}
break;case'd':if(x+2<=wordlength){if(String(tempword).charAt(x+1)=='g'){if(String(tempword).charAt(x+2)=='e'||String(tempword).charAt(x+2)=='y'||String(tempword).charAt(x+2)=='i'){metaword+='j';x+=2;}else{metaword+='t';}}else{metaword+='t';}}else{metaword+='t';}
break;case'f':metaword+='f';break;case'g':if(x<wordlength){if((String(tempword).charAt(x+1)=='n'&&x+1==wordlength-1)||(String(tempword).charAt(x+1)=='n'&&String(tempword).charAt(x+2)=='s'&&x+2==wordlength-1)){break;}
if(String(tempword).charAt(x+1)=='n'&&String(tempword).charAt(x+2)=='e'&&String(tempword).charAt(x+3)=='d'&&x+3==wordlength-1){break;}
if(String(tempword).charAt(x-1)=='n'&&String(tempword).charAt(x-2)=='i'&&x==wordlength-1){break;}
if(String(tempword).charAt(x+1)=='h'&&x+1<=wordlength-1&&String(tempword).charAt(x-1)=='u'&&String(tempword).charAt(x-2)=='o'){metaword+='f';break;}
if(String(tempword).charAt(x+1)=='h'&&x+2<=wordlength){if(isVowel(String(tempword).charAt(x+2))===false){break;}else{metaword+='k';}}
else if(x+1==wordlength){if(String(tempword).charAt(x+1)=='n'){break;}else{metaword+='k';}}
else if(x+3==wordlength){if(String(tempword).charAt(x+1)=='n'&&String(tempword).charAt(x+2)=='e'&&String(tempword).charAt(x+3)=='d'){}else{metaword+='k';}}
else if(x+1<=wordlength){if(String(tempword).charAt(x+1)=='i'||String(tempword).charAt(x+1)=='e'||String(tempword).charAt(x+1)=='y'){if(String(tempword).charAt(x-1)!='g'){metaword+='j';}}else if(x>0){if(String(tempword).charAt(x-1)=='d'){switch(String(tempword).charAt(x+1)){case'e':case'y':case'i':break;default:metaword+='k';}}else{metaword+='k';}}else{metaword+='k';}}else{metaword+='k';}}else{metaword+='k';}
break;case'm':metaword+='m';break;case'j':metaword+='j';break;case'n':metaword+='n';break;case'q':metaword+='k';break;case'r':metaword+='r';break;case'l':metaword+='l';break;case'v':metaword+='f';break;case'z':metaword+='s';break;case'x':if(x===0){metaword+='s';}else{metaword+='ks';}break;case'm':metaword+='m';break;case'k':if(x>0){if(String(tempword).charAt(x-1)!='c'){metaword+='k';}}else{metaword+='k';}break;case'p':if(x+1<=wordlength){if(String(tempword).charAt(x+1)=='h'){metaword+='f';}else{metaword+='p';}}else{metaword+='p';}break;case'y':if(x+1<=wordlength){if(isVowel(String(tempword).charAt(x+1))===true){metaword+='y';}}else{metaword+='y';}break;case'h':if(x===0||'csptg'.indexOf(String(tempword).charAt(x-1))===-1){if(isVowel(String(tempword).charAt(x+1))===true){metaword+='h';}}break;case's':if(x+1<=wordlength){if(String(tempword).charAt(x+1)=='h'){metaword+='x';}
else if(x+2<=wordlength){if(String(tempword).charAt(x+1)=='i'){if(String(tempword).charAt(x+2)=='o'||String(tempword).charAt(x+2)=='a'){metaword+='x';}else{metaword+='s';}}else{metaword+='s';}}else{metaword+='s';}}else{metaword+='s';}break;case't':if(x+1<=wordlength){if(String(tempword).charAt(x+1)=='h'){metaword+='0';}
else if(x+2<=wordlength){if(String(tempword).charAt(x+1)=='i'){if(String(tempword).charAt(x+2)=='o'||String(tempword).charAt(x+2)=='a'){metaword+='x';}else{metaword+='t';}}else{metaword+='t';}}else{metaword+='t';}}else{metaword+='t';}break;case'w':if(x+1<=wordlength){if(isVowel(String(tempword).charAt(x+1))===true){metaword+='w';}}break;}}}
phones=parseInt(phones,10);if(metaword.length>phones){return metaword.substr(0,phones).toUpperCase();}
return metaword.toUpperCase();}
function method_exists(obj,method){if(typeof obj==='string'){return this.window[obj]&&typeof this.window[obj][method]==='function';}
return typeof obj[method]==='function';}
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;}
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]);}
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;}}
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()');}
if(ar.length===0){throw new Error('Array must contain at least one element for min()');}}else{ar=argv;}
retVal=ar[0];for(i=1,n=ar.length;i<n;++i){if(_compare(retVal,ar[i])==-1){retVal=ar[i];}}
return retVal;}
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;}}}
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);}
function money_format(format,number){if(typeof number!=='number'){return null;}
var regex=/%((=.|[+^(!-])*?)(\d*?)(#(\d+))?(\.(\d+))?([in%])/g;this.setlocale('LC_ALL',0);var monetary=this.php_js.locales[this.php_js.localeCategories['LC_MONETARY']]['LC_MONETARY'];var doReplace=function(n0,flags,n2,width,n4,left,n6,right,conversion){var value='',repl='';if(conversion==='%'){return'%';}
var fill=flags&&/=./.test(flags)?flags.match(/=(.)/)[1]:' ';var showCurrSymbol=!flags||flags.indexOf('!')===-1;width=parseInt(width,10)||0;var neg=number<0;number=number+'';number=neg?number.slice(1):number;var decpos=number.indexOf('.');var integer=decpos!==-1?number.slice(0,decpos):number;var fraction=decpos!==-1?number.slice(decpos+1):'';var _str_splice=function(integerStr,idx,thous_sep){var integerArr=integerStr.split('');integerArr.splice(idx,0,thous_sep);return integerArr.join('');};var init_lgth=integer.length;left=parseInt(left,10);var filler=init_lgth<left;if(filler){var fillnum=left-init_lgth;integer=new Array(fillnum+1).join(fill)+integer;}
if(flags.indexOf('^')===-1){var thous_sep=monetary.mon_thousands_sep;var mon_grouping=monetary.mon_grouping;if(mon_grouping[0]<integer.length){for(var i=0,idx=integer.length;i<mon_grouping.length;i++){idx-=mon_grouping[i];if(idx<0){break;}
if(filler&&idx<fillnum){thous_sep=fill;}
integer=_str_splice(integer,idx,thous_sep);}}
if(mon_grouping[i-1]>0){while(idx>mon_grouping[i-1]){idx-=mon_grouping[i-1];if(filler&&idx<fillnum){thous_sep=fill;}
integer=_str_splice(integer,idx,thous_sep);}}}
if(right==='0'){value=integer;}
else{var dec_pt=monetary.mon_decimal_point;if(right===''||right===undefined){right=conversion==='i'?monetary.int_frac_digits:monetary.frac_digits;}
right=parseInt(right,10);if(right===0){fraction='';dec_pt='';}
else if(right<fraction.length){fraction=Math.round(parseFloat(fraction.slice(0,right)+'.'+fraction.substr(right,1),10))+'';}
else if(right>fraction.length){fraction+=new Array(right-fraction.length+1).join('0');}
value=integer+dec_pt+fraction;}
var symbol='';if(showCurrSymbol){symbol=conversion==='i'?monetary.int_curr_symbol:monetary.currency_symbol;}
var sign_posn=neg?monetary.n_sign_posn:monetary.p_sign_posn;var sep_by_space=neg?monetary.n_sep_by_space:monetary.p_sep_by_space;var cs_precedes=neg?monetary.n_cs_precedes:monetary.p_cs_precedes;if(flags.indexOf('(')!==-1){repl=(cs_precedes?symbol+(sep_by_space===1?' ':''):'')+
value+
(!cs_precedes?(sep_by_space===1?' ':'')+symbol:'');if(neg){repl='('+repl+')';}
else{repl=' '+repl+' ';}}
else{var pos_sign=monetary.positive_sign;var neg_sign=monetary.negative_sign;var sign=neg?(neg_sign):(pos_sign);var otherSign=neg?(pos_sign):(neg_sign);var signPadding='';if(sign_posn){signPadding=new Array(otherSign.length-sign.length+1).join(' ');}
var valueAndCS='';switch(sign_posn){case 0:valueAndCS=cs_precedes?symbol+(sep_by_space===1?' ':'')+value:value+(sep_by_space===1?' ':'')+symbol;repl='('+valueAndCS+')';break;case 1:valueAndCS=cs_precedes?symbol+(sep_by_space===1?' ':'')+value:value+(sep_by_space===1?' ':'')+symbol;repl=signPadding+sign+(sep_by_space===2?' ':'')+valueAndCS;break;case 2:valueAndCS=cs_precedes?symbol+(sep_by_space===1?' ':'')+value:value+(sep_by_space===1?' ':'')+symbol;repl=valueAndCS+(sep_by_space===2?' ':'')+sign+signPadding;break;case 3:repl=cs_precedes?signPadding+sign+(sep_by_space===2?' ':'')+symbol+(sep_by_space===1?' ':'')+value:value+(sep_by_space===1?' ':'')+sign+signPadding+(sep_by_space===2?' ':'')+symbol;break;case 4:repl=cs_precedes?symbol+(sep_by_space===2?' ':'')+signPadding+sign+(sep_by_space===1?' ':'')+value:value+(sep_by_space===1?' ':'')+symbol+(sep_by_space===2?' ':'')+sign+signPadding;break;}}
var padding=width-repl.length;if(padding>0){padding=new Array(padding+1).join(' ');if(flags.indexOf('-')!==-1){repl+=padding;}
else{repl=padding+repl;}}
return repl;};return format.replace(regex,doReplace);}
function mt_getrandmax()
{return 2147483647;}
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');}
return Math.floor(Math.random()*(max-min+1))+min;}
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){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
try{bubbleSort(keyArr,valArr);}catch(e){return false;}
for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
return strictForIn?true:populateArr;}
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){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
try{bubbleSort(keyArr,valArr);}catch(e){return false;}
for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
return strictForIn?true:populateArr;}
function next(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;}}
return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
var arrpos=pointers.indexOf(arr);var cursor=pointers[arrpos+1];if(!(arr instanceof Array)){var ct=0;for(var k in arr){if(ct===cursor+1){pointers[arrpos+1]+=1;return arr[k];}
ct++;}
return false;}
if(arr.length===0||cursor===(arr.length-1)){return false;}
pointers[arrpos+1]+=1;return arr[pointers[arrpos+1]];}
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');}
function nl_langinfo(item){this.setlocale('LC_ALL',0);var loc=this.php_js.locales[this.php_js.localeCategories.LC_TIME];if(item.indexOf('ABDAY_')===0){return loc.LC_TIME.a[parseInt(item.replace(/^ABDAY_/,''),10)-1];}
else if(item.indexOf('DAY_')===0){return loc.LC_TIME.A[parseInt(item.replace(/^DAY_/,''),10)-1];}
else if(item.indexOf('ABMON_')===0){return loc.LC_TIME.b[parseInt(item.replace(/^ABMON_/,''),10)-1];}
else if(item.indexOf('MON_')===0){return loc.LC_TIME.B[parseInt(item.replace(/^MON_/,''),10)-1];}
else{switch(item){case'AM_STR':return loc.LC_TIME.p[0];case'PM_STR':return loc.LC_TIME.p[1];case'D_T_FMT':return loc.LC_TIME.c;case'D_FMT':return loc.LC_TIME.x;case'T_FMT':return loc.LC_TIME.X;case'T_FMT_AMPM':return loc.LC_TIME.r;case'ERA':case'ERA_YEAR':case'ERA_D_T_FMT':case'ERA_D_FMT':case'ERA_T_FMT':return loc.LC_TIME[item];}
loc=this.php_js.locales[this.php_js.localeCategories.LC_MONETARY];if(item==='CRNCYSTR'){item='CURRENCY_SYMBOL';}
switch(item){case'INT_CURR_SYMBOL':case'CURRENCY_SYMBOL':case'MON_DECIMAL_POINT':case'MON_THOUSANDS_SEP':case'POSITIVE_SIGN':case'NEGATIVE_SIGN':case'INT_FRAC_DIGITS':case'FRAC_DIGITS':case'P_CS_PRECEDES':case'P_SEP_BY_SPACE':case'N_CS_PRECEDES':case'N_SEP_BY_SPACE':case'P_SIGN_POSN':case'N_SIGN_POSN':return loc.LC_MONETARY[item.toLowerCase()];case'MON_GROUPING':return loc.LC_MONETARY[item.toLowerCase()];}
loc=this.php_js.locales[this.php_js.localeCategories.LC_NUMERIC];switch(item){case'RADIXCHAR':case'DECIMAL_POINT':return loc.LC_NUMERIC[item.toLowerCase()];case'THOUSEP':case'THOUSANDS_SEP':return loc.LC_NUMERIC[item.toLowerCase()];case'GROUPING':return loc.LC_NUMERIC[item.toLowerCase()];}
loc=this.php_js.locales[this.php_js.localeCategories.LC_MESSAGES];switch(item){case'YESEXPR':case'NOEXPR':case'YESSTR':case'NOSTR':return loc.LC_MESSAGES[item];}
loc=this.php_js.locales[this.php_js.localeCategories.LC_CTYPE];if(item==='CODESET'){return loc.LC_CTYPE[item];}
return false;}}
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);}
if((s[1]||'').length<prec){s[1]=s[1]||'';s[1]+=new Array(prec-s[1].length+1).join('0');}
return s.join(dec);}
function octdec(oct_string){oct_string=(oct_string+'').replace(/[^0-7]/gi,'');return parseInt(oct_string,8);}
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;}
var low=str.charCodeAt(1);if(!low){}
return((hi-0xD800)*0x400)+(low-0xDC00)+0x10000;}
if(0xDC00<=code&&code<=0xDFFF){return code;}
return code;}
function pack(format){var formatPointer=0,argumentPointer=1,result='',argument='',i=0,r=[],instruction,quantifier,word,precisionBits,exponentBits,extraNullCount;var bias,minExp,maxExp,minUnnormExp,status,exp,len,bin,signal,n,intPart,floatPart,lastBit,rounded,j,k,tmpResult;while(formatPointer<format.length){instruction=format[formatPointer];quantifier='';formatPointer++;while((formatPointer<format.length)&&(format[formatPointer].match(/[\d\*]/)!==null)){quantifier+=format[formatPointer];formatPointer++;}
if(quantifier===''){quantifier='1';}
switch(instruction){case'a':case'A':if(typeof arguments[argumentPointer]==='undefined'){throw new Error('Warning:  pack() Type '+instruction+': not enough arguments');}else{argument=String(arguments[argumentPointer]);}
if(quantifier==='*'){quantifier=argument.length;}
for(i=0;i<quantifier;i++){if(typeof argument[i]==='undefined'){if(instruction==='a'){result+=String.fromCharCode(0);}else{result+=' ';}}else{result+=argument[i];}}
argumentPointer++;break;case'h':case'H':if(typeof arguments[argumentPointer]==='undefined'){throw new Error('Warning: pack() Type '+instruction+': not enough arguments');}else{argument=arguments[argumentPointer];}
if(quantifier==='*'){quantifier=argument.length;}
if(quantifier>argument.length){throw new Error('Warning: pack() Type '+instruction+': not enough characters in string');}
for(i=0;i<quantifier;i+=2){word=argument[i];if(((i+1)>=quantifier)||typeof(argument[i+1])==='undefined'){word+='0';}else{word+=argument[i+1];}
if(instruction==='h'){word=word[1]+word[0];}
result+=String.fromCharCode(parseInt(word,16));}
argumentPointer++;break;case'c':case'C':if(quantifier==='*'){quantifier=arguments.length-argumentPointer;}
if(quantifier>(arguments.length-argumentPointer)){throw new Error('Warning:  pack() Type '+instruction+': too few arguments');}
for(i=0;i<quantifier;i++){result+=String.fromCharCode(arguments[argumentPointer]);argumentPointer++;}
break;case's':case'S':case'v':if(quantifier==='*'){quantifier=arguments.length-argumentPointer;}
if(quantifier>(arguments.length-argumentPointer)){throw new Error('Warning:  pack() Type '+instruction+': too few arguments');}
for(i=0;i<quantifier;i++){result+=String.fromCharCode(arguments[argumentPointer]&0xFF);result+=String.fromCharCode(arguments[argumentPointer]>>8&0xFF);argumentPointer++;}
break;case'n':if(quantifier==='*'){quantifier=arguments.length-argumentPointer;}
if(quantifier>(arguments.length-argumentPointer)){throw new Error('Warning:  pack() Type '+instruction+': too few arguments');}
for(i=0;i<quantifier;i++){result+=String.fromCharCode(arguments[argumentPointer]>>8&0xFF);result+=String.fromCharCode(arguments[argumentPointer]&0xFF);argumentPointer++;}
break;case'i':case'I':case'l':case'L':case'V':if(quantifier==='*'){quantifier=arguments.length-argumentPointer;}
if(quantifier>(arguments.length-argumentPointer)){throw new Error('Warning:  pack() Type '+instruction+': too few arguments');}
for(i=0;i<quantifier;i++){result+=String.fromCharCode(arguments[argumentPointer]&0xFF);result+=String.fromCharCode(arguments[argumentPointer]>>8&0xFF);result+=String.fromCharCode(arguments[argumentPointer]>>16&0xFF);result+=String.fromCharCode(arguments[argumentPointer]>>24&0xFF);argumentPointer++;}
break;case'N':if(quantifier==='*'){quantifier=arguments.length-argumentPointer;}
if(quantifier>(arguments.length-argumentPointer)){throw new Error('Warning:  pack() Type '+instruction+': too few arguments');}
for(i=0;i<quantifier;i++){result+=String.fromCharCode(arguments[argumentPointer]>>24&0xFF);result+=String.fromCharCode(arguments[argumentPointer]>>16&0xFF);result+=String.fromCharCode(arguments[argumentPointer]>>8&0xFF);result+=String.fromCharCode(arguments[argumentPointer]&0xFF);argumentPointer++;}
break;case'f':case'd':precisionBits=23;exponentBits=8;if(instruction==='d'){precisionBits=52;exponentBits=11;}
if(quantifier==='*'){quantifier=arguments.length-argumentPointer;}
if(quantifier>(arguments.length-argumentPointer)){throw new Error('Warning:  pack() Type '+instruction+': too few arguments');}
for(i=0;i<quantifier;i++){argument=arguments[argumentPointer];bias=Math.pow(2,exponentBits-1)-1;minExp=-bias+1;maxExp=bias;minUnnormExp=minExp-precisionBits;status=isNaN(n=parseFloat(argument))||n===-Infinity||n===+Infinity?n:0;exp=0;len=2*bias+1+precisionBits+3;bin=new Array(len);signal=(n=status!==0?0:n)<0;n=Math.abs(n);intPart=Math.floor(n);floatPart=n-intPart;for(k=len;k;){bin[--k]=0;}
for(k=bias+2;intPart&&k;){bin[--k]=intPart%2;intPart=Math.floor(intPart/2);}
for(k=bias+1;floatPart>0&&k;--floatPart){(bin[++k]=((floatPart*=2)>=1)-0);}
for(k=-1;++k<len&&!bin[k];){}
if(bin[(lastBit=precisionBits-1+
(k=(exp=bias+1-k)>=minExp&&exp<=maxExp?k+1:bias+1-(exp=minExp-1)))+1]){if(!(rounded=bin[lastBit])){for(j=lastBit+2;!rounded&&j<len;rounded=bin[j++]){}}
for(j=lastBit+1;rounded&&--j>=0;(bin[j]=!bin[j]-0)&&(rounded=0)){}}
for(k=k-2<0?-1:k-3;++k<len&&!bin[k];){}
if((exp=bias+1-k)>=minExp&&exp<=maxExp){++k;}else{if(exp<minExp){if(exp!==bias+1-len&&exp<minUnnormExp){}
k=bias+1-(exp=minExp-1);}}
if(intPart||status!==0){exp=maxExp+1;k=bias+2;if(status===-Infinity){signal=1;}else if(isNaN(status)){bin[k]=1;}}
n=Math.abs(exp+bias);tmpResult='';for(j=exponentBits+1;--j;){tmpResult=(n%2)+tmpResult;n=n>>=1;}
n=0;j=0;k=(tmpResult=(signal?'1':'0')+tmpResult+
bin.slice(k,k+precisionBits).join('')).length;r=[];for(;k;){n+=(1<<j)*tmpResult.charAt(--k);if(j===7){r[r.length]=String.fromCharCode(n);n=0;}
j=(j+1)%8;}
r[r.length]=n?String.fromCharCode(n):'';result+=r.join('');argumentPointer++;}
break;case'x':if(quantifier==='*'){throw new Error('Warning: pack(): Type x: \'*\' ignored');}
for(i=0;i<quantifier;i++){result+=String.fromCharCode(0);}
break;case'X':if(quantifier==='*'){throw new Error('Warning: pack(): Type X: \'*\' ignored');}
for(i=0;i<quantifier;i++){if(result.length===0){throw new Error('Warning: pack(): Type X:'+' outside of string');}else{result=result.substring(0,result.length-1);}}
break;case'@':if(quantifier==='*'){throw new Error('Warning: pack(): Type X: \'*\' ignored');}
if(quantifier>result.length){extraNullCount=quantifier-result.length;for(i=0;i<extraNullCount;i++){result+=String.fromCharCode(0);}}
if(quantifier<result.length){result=result.substring(0,quantifier);}
break;default:throw new Error('Warning:  pack() Type '+instruction+': unknown format code');}}
if(argumentPointer<arguments.length){throw new Error('Warning: pack(): '+
(arguments.length-argumentPointer)+' arguments unused');}
return result;}
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;}
for(i=0;i<array2.length;i++){tmp=array2[i].split(glue1);if(tmp.length<2){tmp=[tmp,''];}
key=fixStr(tmp[0]);value=fixStr(tmp[1]);while(key.charAt(0)===' '){key=key.substr(1);}
if(key.indexOf('\0')!==-1){key=key.substr(0,key.indexOf('\0'));}
if(key&&key.charAt(0)!=='['){keys=[];bracket=0;for(j=0;j<key.length;j++){if(key.charAt(j)==='['&&!bracket){bracket=j+1;}
else if(key.charAt(j)===']'){if(bracket){if(!keys.length){keys.push(key.substr(0,bracket-1));}
keys.push(key.substr(bracket,j-bracket));bracket=0;if(key.charAt(j+1)!=='['){break;}}}}
if(!keys.length){keys=[key];}
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);}
if(chr==='['){break;}}
evalStr='array';for(j=0;j<keys.length;j++){key=keys[j];if((key!==''&&key!==' ')||j===0){key="'"+key+"'";}
else{key=eval(evalStr+'.push([]);')-1;}
evalStr+='['+key+']';if(j!==keys.length-1&&eval('typeof '+evalStr)==='undefined'){eval(evalStr+' = [];');}}
evalStr+=" = '"+value+"';\n";eval(evalStr);}}}
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]||"";}
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;}
if(uri.host!==''){retArr.host=uri.host;}
if(uri.port!==''){retArr.port=uri.port;}
if(uri.user!==''){retArr.user=uri.user;}
if(uri.password!==''){retArr.pass=uri.password;}
if(uri.path!==''){retArr.path=uri.path;}
if(uri.query!==''){retArr.query=uri.query;}
if(uri.anchor!==''){retArr.fragment=uri.anchor;}
return retArr;}}
function pathinfo(path,options){var opt='',optName='',optTemp=0,tmp_arr={},cnt=0,i=0;var have_basename=false,have_extension=false,have_filename=false;if(!path){return false;}
if(!options){options='PATHINFO_ALL';}
var OPTS={'PATHINFO_DIRNAME':1,'PATHINFO_BASENAME':2,'PATHINFO_EXTENSION':4,'PATHINFO_FILENAME':8,'PATHINFO_ALL':0};for(optName in OPTS){OPTS.PATHINFO_ALL=OPTS.PATHINFO_ALL|OPTS[optName];}
if(typeof options!=='number'){options=[].concat(options);for(i=0;i<options.length;i++){if(OPTS[options[i]]){optTemp=optTemp|OPTS[options[i]];}}
options=optTemp;}
var __getExt=function(path){var str=path+'';var dotP=str.lastIndexOf('.')+1;return str.substr(dotP);};if(options&OPTS.PATHINFO_DIRNAME){tmp_arr.dirname=this.dirname(path);}
if(options&OPTS.PATHINFO_BASENAME){if(false===have_basename){have_basename=this.basename(path);}
tmp_arr.basename=have_basename;}
if(options&OPTS.PATHINFO_EXTENSION){if(false===have_basename){have_basename=this.basename(path);}
if(false===have_extension){have_extension=__getExt(have_basename);}
tmp_arr.extension=have_extension;}
if(options&OPTS.PATHINFO_FILENAME){if(false===have_basename){have_basename=this.basename(path);}
if(false===have_extension){have_extension=__getExt(have_basename);}
if(false===have_filename){have_filename=have_basename.substr(0,(have_basename.length-have_extension.length)-1);}
tmp_arr.filename=have_filename;}
cnt=0;for(opt in tmp_arr){cnt++;}
if(cnt==1){return tmp_arr[opt];}
return tmp_arr;}
function pclose(handle){if(!handle||handle.opener!=='popen'){return false;}
try{delete this.php_js.resourceDataPointer[handle.id];delete this.php_js.resourceData[handle.id];}
catch(e){return false;}
return true;}
function php_ini_loaded_file(){if(!this.php_js||!this.php_js.ini_loaded_file){return false;}
return this.php_js.ini_loaded_file;}
function php_ini_scanned_files(){if(!this.php_js||!this.php_js.ini_scanned_files){return false;}
return this.php_js.ini_scanned_files;}
function php_strip_whitespace(file){try{var str=this.file_get_contents(file);}catch(e){return'';}
return str.replace(/\/\/.*?\n/g,'').replace(/\/\*[\s\S]*?\*\//g,'').replace(/[ \f\r\t\v\u00A0\u2028\u2029]+/g,' ').replace(/\s*\n+/g,'\n').replace(/^\s+/gm,'').replace(/\s*$/gm,'');}
function phpversion(){var xhtml=true,s={},firstScript={},d=this.window.document,c='createElement',cn='createElementNS',xn='http://www.w3.org/1999/xhtml',g='getElementsByTagName',gn='getElementsByTagNameNS';this.php_js=this.php_js||{};var getVersion=function(app){var att='',minVers=0,versionString='',temp_jsversion=undefined;if(this.php_js.jsversion!==undefined){return this.php_js.jsversion;}
while(this.php_js.jsversion===temp_jsversion&&minVers<10){temp_jsversion='1.'+minVers;if(gn){firstScript=d[gn](xn,'script')[0];}
if(!firstScript){firstScript=d[g]('script')[0];xhtml=false;}
if(d[cn]&&xhtml){s=d[cn](xn,'script');}
else{s=d[c]('script');}
if(app){att='type';versionString='application/javascript;version=1.';}
else{att='language';versionString='JavaScript1.';}
s.setAttribute(att,versionString+minVers);s.appendChild(d.createTextNode("this.php_js.jsversion="+"'1."+minVers+"'"));firstScript.parentNode.insertBefore(s,firstScript);s.parentNode.removeChild(s);minVers++;}
return this.php_js.jsversion;};getVersion(true);getVersion(false);return this.php_js.jsversion;}
function pi(){return Math.PI;}
function popen(filename,mode,use_include_path,context){var resource={},i=0,that=this;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};var file_get_contents=function(url){var req=that.window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(!req){throw new Error('XMLHttpRequest not supported');}
if(!(/^http/).test(url)){url=that.window.location.href+'/'+url;}
req.open("GET",url,false);req.send(null);return req.responseText;};if(use_include_path===1||use_include_path==='1'||use_include_path===true){}
if(context){}
for(i=0;i<mode.length;i++){switch(mode.charAt(i)){case'r':if(!mode.charAt(i+1)||mode.charAt(i+1)!=='+'){break;}
case'w':case'a':case'x':throw'Writing is not implemented';case'b':case't':throw'Windows-only modes are not supported';default:throw'Unrecognized file mode passed to '+getFuncName(arguments.caller)+'()';}}
this.php_js=this.php_js||{};this.php_js.resourceData=this.php_js.resourceData||{};this.php_js.resourceDataPointer=this.php_js.resourceDataPointer||{};this.php_js.resourceIdCounter=this.php_js.resourceIdCounter||0;function PHPJS_Resource(type,id,opener){this.type=type;this.id=id;this.opener=opener;}
PHPJS_Resource.prototype.toString=function(){return'Resource id #'+this.id;};PHPJS_Resource.prototype.get_resource_type=function(){return this.type;};PHPJS_Resource.prototype.var_dump=function(){return'resource('+this.id+') of type ('+this.type+')';};this.php_js.resourceIdCounter++;this.php_js.resourceData[this.php_js.resourceIdCounter]=this.file_get_contents(filename);this.php_js.resourceDataPointer[this.php_js.resourceIdCounter]=0;resource=new PHPJS_Resource('stream',this.php_js.resourceIdCounter,'popen');resource.mode=mode;return resource;}
function pos(arr){return this.current(arr);}
function pow(base,exp){return Math.pow(base,exp);}
function preg_grep(pattern,input,flags){var p='',retObj={};var invert=(flags===1||flags==='PREG_GREP_INVERT');if(typeof pattern==='string'){pattern=eval(pattern);}
if(invert){for(p in input){if(!pattern.test(input[p])){retObj[p]=input[p];}}}else{for(p in input){if(pattern.test(input[p])){retObj[p]=input[p];}}}
return retObj;}
function preg_quote(str){return(str+'').replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!<>\|\:])/g,"\\$1");}
function prev(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;}}
return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
var arrpos=pointers.indexOf(arr);var cursor=pointers[arrpos+1];if(pointers.indexOf(arr)===-1||cursor===0){return false;}
if(!(arr instanceof Array)){var ct=0;for(var k in arr){if(ct===cursor-1){pointers[arrpos+1]-=1;return arr[k];}
ct++;}}
if(arr.length===0){return false;}
pointers[arrpos+1]-=1;return arr[pointers[arrpos+1]];}
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)';}
return name[1];};var repeat_char=function(len,pad_char){var str="";for(var i=0;i<len;i++){str+=pad_char;}
return str;};var formatArray=function(obj,cur_depth,pad_val,pad_char){if(cur_depth>0){cur_depth++;}
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";}}
str+=base_pad+")\n";}else if(obj===null||obj===undefined){str='';}else{str=obj.toString();}
return str;};output=formatArray(array,0,pad_val,pad_char);if(return_val!==true){if(d.body){this.echo(output);}
else{try{d=XULDocument;this.echo('<pre xmlns="http://www.w3.org/1999/xhtml" style="white-space:pre;">'+output+'</pre>');}
catch(e){this.echo(output);}}
return true;}else{return output;}}
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;}
ret=this.sprintf.apply(this,arguments);elmt=d.createTextNode(ret);body.appendChild(elmt);return ret.length;}
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;}
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');}
function putenv(setting){this.php_js=this.php_js||{};this.php_js.ENV=this.php_js.ENV||{};var pos=setting.indexOf('=');this.php_js.ENV[setting.slice(0,pos)]=setting.slice(pos+1);return true;}
function quoted_printable_decode(str){var RFC2045Decode1=/=\r\n/gm,RFC2045Decode2IN=/=([0-9A-F]{2})/gim,RFC2045Decode2OUT=function(sMatch,sHex){return String.fromCharCode(parseInt(sHex,16));};return str.replace(RFC2045Decode1,'').replace(RFC2045Decode2IN,RFC2045Decode2OUT);}
function quoted_printable_encode(str){var hexChars=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'],RFC2045Encode1IN=/ \r\n|\r\n|[^!-<>-~ ]/gm,RFC2045Encode1OUT=function(sMatch){if(sMatch.length>1){return sMatch.replace(' ','=20');}
var chr=sMatch.charCodeAt(0);return'='+hexChars[((chr>>>4)&15)]+hexChars[(chr&15)];},RFC2045Encode2IN=/.{1,72}(?!\r\n)[^=]{0,3}/g,RFC2045Encode2OUT=function(sMatch){if(sMatch.substr(sMatch.length-2)==='\r\n'){return sMatch;}
return sMatch+'=\r\n';};str=str.replace(RFC2045Encode1IN,RFC2045Encode1OUT).replace(RFC2045Encode2IN,RFC2045Encode2OUT);return str.substr(0,str.length-3);}
function quotemeta(str){return(str+'').replace(/([\.\\\+\*\?\[\^\]\$\(\)])/g,'\\$1');}
function rad2deg(angle){return(angle/Math.PI)*180;}
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');}
return Math.floor(Math.random()*(max-min+1))+min;}
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);}
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;}}
return matrix;}
function rawurldecode(str){return decodeURIComponent(str);}
function rawurlencode(str){str=(str+'').toString();return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A');}
function readfile(filename,use_include_path,context){var read_data=this.file_get_contents(filename,use_include_path,context);this.echo(read_data);return read_data;}
function realpath(path){var p=0,arr=[];var r=this.window.location.href;path=(path+'').replace('\\','/');if(path.indexOf('://')!==-1){p=1;}
if(!p){path=r.substring(0,r.lastIndexOf('/')+1)+path;}
arr=path.split('/');path=[];for(var k in arr){if(arr[k]=='.'){continue;}
if(arr[k]=='..'){if(path.length>3){path.pop();}}
else{if((path.length<2)||(arr[k]!=='')){path.push(arr[k]);}}}
return path.join('/');}
function register_shutdown_function(cb){var args=[];args=Array.prototype.slice.call(arguments,1);this.window.addEventListener('unload',function(){cb.apply(null,args);},false);}
function require(filename){var d=this.window.document;var js_code=this.file_get_contents(filename);var script_block=d.createElementNS?d.createElementNS('http://www.w3.org/1999/xhtml','script'):d.createElement('script');script_block.type='text/javascript';var client_pc=navigator.userAgent.toLowerCase();if((client_pc.indexOf('msie')!==-1)&&(client_pc.indexOf('opera')===-1)){script_block.text=js_code;}else{script_block.appendChild(d.createTextNode(js_code));}
if(typeof(script_block)!="undefined"){d.getElementsByTagNameNS?d.getElementsByTagNameNS('http://www.w3.org/1999/xhtml','head')[0].appendChild(script_block):d.getElementsByTagName('head')[0].appendChild(script_block);var cur_file={};cur_file[this.window.location.href]=1;this.php_js=this.php_js||{};if(!this.php_js.includes){this.php_js.includes=cur_file;}
if(!this.php_js.includes[filename]){this.php_js.includes[filename]=1;return 1;}else{return++this.php_js.includes[filename];}}
return 0;}
function require_once(filename){var cur_file={};cur_file[this.window.location.href]=1;try{php_js_shared;}
catch(e){php_js_shared={};}
if(!php_js_shared.includes){php_js_shared.includes=cur_file;}
if(!php_js_shared.includes[filename]){if(this.require(filename)){return true;}}else{return true;}
return false;}
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;}}
return-1;};var pointers=this.php_js.pointers;if(!pointers.indexOf){pointers.indexOf=indexOf;}
if(pointers.indexOf(arr)===-1){pointers.push(arr,0);}
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;}
return arr[k];}
return false;}
if(arr.length===0){return false;}
pointers[arrpos+1]=0;return arr[pointers[arrpos+1]];}
function restore_include_path(){if(this.php_js&&this.php_js.ini&&this.php_js.ini.include_path){this.php_js.ini.include_path.local_value=this.php_js.ini.include_path.global_value;}}
function rewind(handle){var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||!handle||!handle.constructor||getFuncName(handle.constructor)!=='PHPJS_Resource'){return false;}
this.php_js.resourceDataPointer[handle.id]=0;return true;}
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+=1;}else{dtR-=1;}}}else if(dtLa>=5){dtR+=1;}}else{if(dtLa==5){if((dtR%2)===0){if(dtLa>=5){dtR+=1;}else{dtR-=1;}}}else if(dtLa>=5){dtR+=1;}}
return dtR;};var _round_half_ud=function(dtR,dtLa,up){if(up===true){if(dtLa>=5){dtR+=1;}}else{if(dtLa>5){dtR+=1;}}
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;}
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;}
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(integer)+1;}else{v=Number(integer+digitToRound);}}
return v;};if(typeof precision=='undefined'){precision=0;}
if(typeof mode=='undefined'){mode='PHP_ROUND_HALF_UP';}
if(val<0){negative=true;}else{negative=false;}
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';}}
if((precision>0)&&(precision>=decimal.length)){return val;}else if((precision<0)&&(Math.abs(precision)>=integer.length)){return 0;}
val=Number(integer+'.'+decimal);}
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;}
if(negative){return 0-retVal;}else{return retVal;}}
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;}
if(a>b){return-1;}
return 0;};break;}
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){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
valArr.sort(sorter);for(i=0;i<valArr.length;i++){populateArr[i]=valArr[i];}
return strictForIn?true:populateArr;}
function rtrim(str,charlist){charlist=!charlist?' \\s\u00A0':(charlist+'').replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g,'\\$1');var re=new RegExp('['+charlist+']+$','g');return(str+'').replace(re,'');}
function runkit_class_adopt(classname,parentname){if(typeof this.window[classname]!=='function'||typeof this.window[parentname]!=='function'){return false;}
this.window[classname].prototype=new this.window[parentname]();this.window[classname].constructor=this.window[classname];return true;}
function runkit_class_emancipate(classname){if(typeof this.window[classname]!=='function'){return false;}
for(var p in this.window[classname].prototype){delete this.window[classname].prototype[p];}
return true;}
function runkit_function_add(funcname,arglist,code){if(this.window[funcname]!==undefined){return false;}
try{this.window[funcname]=Function.apply(null,arglist.split(',').concat(code));}
catch(e){return false;}
return true;}
function runkit_function_copy(funcname,targetname){if(typeof this.window[funcname]!=='function'||this.window[targetname]!==undefined){return false;}
this.window[targetname]=this.window[funcname];return true;}
function runkit_function_redefine(funcname,arglist,code){if(this.window[funcname]===undefined){return false;}
try{this.window[funcname]=Function.apply(null,arglist.split(',').concat(code));}
catch(e){return false;}
return true;}
function runkit_function_remove(funcname){if(this.window[funcname]===undefined){return false;}
try{this.window[funcname]=undefined;}
catch(e){return false;}
return true;}
function runkit_function_rename(funcname,newname){if(typeof this.window[newname]!=='function'||this.window[funcname]!==undefined){return false;}
this.window[newname]=this.window[funcname];this.window[funcname]=undefined;return true;}
function runkit_import(file,flags){if(flags){throw'Flags not supported for runkit_import';}
eval(this.file_get_contents(file));}
function runkit_method_add(classname,methodname,args,code,flags){var func,argmnts=[];switch(flags){case'RUNKIT_ACC_PROTECTED':throw'Protected not supported';case'RUNKIT_ACC_PRIVATE':throw'Private not supported';case'RUNKIT_ACC_PUBLIC':default:break;}
argmnts=args.split(/,\s*/);if(typeof classname==='string'){classname=this.window[classname];}
func=Function.apply(null,argmnts.concat(code));classname.prototype[methodname]=func;return true;}
function runkit_method_copy(dClass,dMethod,sClass,sMethod){sMethod=sMethod||dMethod;if(typeof dClass==='string'){dClass=this.window[dClass];}
if(typeof sClass==='string'){sClass=this.window[sClass];}
dClass.prototype[dMethod]=sClass.prototype[sMethod];return true;}
function runkit_method_redefine(classname,methodname,args,code,flags){var argmnts=[],func;var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};switch(flags){case'RUNKIT_ACC_PROTECTED':throw'Protected not supported';case'RUNKIT_ACC_PRIVATE':throw'Private not supported';case'RUNKIT_ACC_PUBLIC':default:break;}
argmnts=args.split(/,\s*/);if(typeof classname==='string'){classname=this.window[classname];}
if(getFuncName(classname)!=='PHP_JS'||(this.php_js&&this.php_js.ini&&this.php_js.ini['runkit.internal_override']&&(this.php_js.ini['runkit.internal_override'].local_value===true||this.php_js.ini['runkit.internal_override'].local_value===1||this.php_js.ini['runkit.internal_override'].local_value==='1'||this.php_js.ini['runkit.internal_override'].local_value==='true'))){func=Function.apply(null,argmnts.concat(code));classname.prototype[methodname]=func;return true;}
return false;}
function runkit_method_remove(classname,methodname){if(typeof classname==='string'){classname=this.window[classname];}
if(getFuncName(classname)!=='PHP_JS'||(this.php_js&&this.php_js.ini&&this.php_js.ini['runkit.internal_override']&&(this.php_js.ini['runkit.internal_override'].local_value===true||this.php_js.ini['runkit.internal_override'].local_value===1||this.php_js.ini['runkit.internal_override'].local_value==='1'||this.php_js.ini['runkit.internal_override'].local_value==='true'))){delete classname.prototype[methodname];return true;}
return false;}
function runkit_method_rename(classname,methodname,newname){var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};if(typeof classname==='string'){classname=this.window[classname];}
if(getFuncName(classname)!=='PHP_JS'||(this.php_js&&this.php_js.ini&&this.php_js.ini['runkit.internal_override']&&(this.php_js.ini['runkit.internal_override'].local_value===true||this.php_js.ini['runkit.internal_override'].local_value===1||this.php_js.ini['runkit.internal_override'].local_value==='1'||this.php_js.ini['runkit.internal_override'].local_value==='true'))){var method=classname.prototype[methodname];classname.prototype[newname]=method;delete classname.prototype[methodname];return true;}
return false;}
function runkit_superglobals(){var superglobal={},p='',arr=[];var superglobals=['$_GET','$_POST','$_REQUEST','$_COOKIE','$_SESSION','$_SERVER','$_ENV','$_FILES'];for(var i=0;i<superglobals.length;i++){superglobal=this.window[superglobals[i]];for(p in superglobal){arr.push(superglobal[p]);}}
return arr;}
function serialize(mixed_value){var _getType=function(inp){var type=typeof inp,match;var key;if(type=='object'&&!inp){return'null';}
if(type=="object"){if(!inp.constructor){return'object';}
var cons=inp.constructor.toString();match=cons.match(/(\w+)\(/);if(match){cons=match[1].toLowerCase();}
var types=["boolean","number","string","array"];for(key in types){if(cons==types[key]){type=types[key];break;}}}
return type;};var type=_getType(mixed_value);var val,ktype='';switch(type){case"function":val="";break;case"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;}
okey=(key.match(/^[0-9]+$/)?parseInt(key,10):key);vals+=this.serialize(okey)+
this.serialize(mixed_value[key]);count++;}
val+=":"+count+":{"+vals+"}";break;case"undefined":default:val="N";break;}
if(type!="object"&&type!="array"){val+=";";}
return val;}
function set_include_path(new_include_path){this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};var old_path=this.php_js.ini.include_path&&this.php_js.ini.include_path.local_value;if(!old_path){this.php_js.ini.include_path={global_value:new_include_path,local_value:new_include_path};}
else{this.php_js.ini.include_path.global_value=new_include_path;this.php_js.ini.include_path.local_value=new_include_path;}
return old_path;}
function set_time_limit(seconds){this.php_js=this.php_js||{};this.window.setTimeout(function(){if(!this.php_js.timeoutStatus){this.php_js.timeoutStatus=true;}
throw'Maximum execution time exceeded';},seconds*1000);}
function setcookie(name,value,expires,path,domain,secure){return this.setrawcookie(name,encodeURIComponent(value),expires,path,domain,secure);}
function setlocale(category,locale){var categ='',cats=[],i=0,d=this.window.document;var _copy=function _copy(orig){var newObj={};for(var i in orig){if(typeof orig[i]==='object'){newObj[i]=_copy(orig[i]);}
else{newObj[i]=orig[i];}}
return newObj;};var _nplurals1=function(n){return 0;};var _nplurals2a=function(n){return n!==1?1:0;};var _nplurals2b=function(n){return n>1?1:0;};var _nplurals2c=function(n){return n%10===1&&n%100!==11?0:1;};var _nplurals3a=function(n){return n%10===1&&n%100!==11?0:n!==0?1:2;};var _nplurals3b=function(n){return n===1?0:n===2?1:2;};var _nplurals3c=function(n){return n===1?0:(n===0||(n%100>0&&n%100<20))?1:2;};var _nplurals3d=function(n){return n%10===1&&n%100!==11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2;};var _nplurals3e=function(n){return n%10===1&&n%100!==11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2;};var _nplurals3f=function(n){return n===1?0:n>=2&&n<=4?1:2;};var _nplurals3g=function(n){return n===1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2;};var _nplurals3h=function(n){return n%10===1?0:n%10===2?1:2;};var _nplurals4a=function(n){return n%100===1?0:n%100===2?1:n%100===3||n%100===4?2:3;};var _nplurals4b=function(n){return n===1?0:n===0||(n%100&&n%100<=10)?1:n%100>=11&&n%100<=19?2:3;};var _nplurals5=function(n){return n===1?0:n===2?1:n>=3&&n<=6?2:n>=7&&n<=10?3:4;};var _nplurals6=function(n){return n===0?5:n===1?0:n===2?1:n%100>=3&&n%100<=10?2:n%100>=11&&n%100<=99?3:4;};this.php_js=this.php_js||{};var phpjs=this.php_js;if(!phpjs.locales){phpjs.locales={};phpjs.locales.en={'LC_COLLATE':function(str1,str2){return(str1==str2)?0:((str1>str2)?1:-1);},'LC_CTYPE':{an:/^[A-Za-z\d]+$/g,al:/^[A-Za-z]+$/g,ct:/^[\u0000-\u001F\u007F]+$/g,dg:/^[\d]+$/g,gr:/^[\u0021-\u007E]+$/g,lw:/^[a-z]+$/g,pr:/^[\u0020-\u007E]+$/g,pu:/^[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/g,sp:/^[\f\n\r\t\v ]+$/g,up:/^[A-Z]+$/g,xd:/^[A-Fa-f\d]+$/g,CODESET:'UTF-8',lower:'abcdefghijklmnopqrstuvwxyz',upper:'ABCDEFGHIJKLMNOPQRSTUVWXYZ'},'LC_TIME':{a:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],A:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],b:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],B:['January','February','March','April','May','June','July','August','September','October','November','December'],c:'%a %d %b %Y %r %Z',p:['AM','PM'],P:['am','pm'],r:'%I:%M:%S %p',x:'%m/%d/%Y',X:'%r',alt_digits:'',ERA:'',ERA_YEAR:'',ERA_D_T_FMT:'',ERA_D_FMT:'',ERA_T_FMT:''},'LC_MONETARY':{int_curr_symbol:'USD',currency_symbol:'$',mon_decimal_point:'.',mon_thousands_sep:',',mon_grouping:[3],positive_sign:'',negative_sign:'-',int_frac_digits:2,frac_digits:2,p_cs_precedes:1,p_sep_by_space:0,n_cs_precedes:1,n_sep_by_space:0,p_sign_posn:3,n_sign_posn:0},'LC_NUMERIC':{decimal_point:'.',thousands_sep:',',grouping:[3]},'LC_MESSAGES':{YESEXPR:'^[yY].*',NOEXPR:'^[nN].*',YESSTR:'',NOSTR:''},nplurals:_nplurals2a};phpjs.locales.en_US=_copy(phpjs.locales.en);phpjs.locales.en_US.LC_TIME.c='%a %d %b %Y %r %Z';phpjs.locales.en_US.LC_TIME.x='%D';phpjs.locales.en_US.LC_TIME.X='%r';phpjs.locales.en_US.LC_MONETARY.int_curr_symbol='USD ';phpjs.locales.en_US.LC_MONETARY.p_sign_posn=1;phpjs.locales.en_US.LC_MONETARY.n_sign_posn=1;phpjs.locales.en_US.LC_MONETARY.mon_grouping=[3,3];phpjs.locales.en_US.LC_NUMERIC.thousands_sep='';phpjs.locales.en_US.LC_NUMERIC.grouping=[];phpjs.locales.en_GB=_copy(phpjs.locales.en);phpjs.locales.en_GB.LC_TIME.r='%l:%M:%S %P %Z';phpjs.locales.en_AU=_copy(phpjs.locales.en_GB);phpjs.locales.C=_copy(phpjs.locales.en);phpjs.locales.C.LC_CTYPE.CODESET='ANSI_X3.4-1968';phpjs.locales.C.LC_MONETARY={int_curr_symbol:'',currency_symbol:'',mon_decimal_point:'',mon_thousands_sep:'',mon_grouping:[],p_cs_precedes:127,p_sep_by_space:127,n_cs_precedes:127,n_sep_by_space:127,p_sign_posn:127,n_sign_posn:127,positive_sign:'',negative_sign:'',int_frac_digits:127,frac_digits:127};phpjs.locales.C.LC_NUMERIC={decimal_point:'.',thousands_sep:'',grouping:[]};phpjs.locales.C.LC_TIME.c='%a %b %e %H:%M:%S %Y';phpjs.locales.C.LC_TIME.x='%m/%d/%y';phpjs.locales.C.LC_TIME.X='%H:%M:%S';phpjs.locales.C.LC_MESSAGES.YESEXPR='^[yY]';phpjs.locales.C.LC_MESSAGES.NOEXPR='^[nN]';phpjs.locales.fr=_copy(phpjs.locales.en);phpjs.locales.fr.nplurals=_nplurals2b;phpjs.locales.fr.LC_TIME.a=['dim','lun','mar','mer','jeu','ven','sam'];phpjs.locales.fr.LC_TIME.A=['dimanche','lundi','mardi','mercredi','jeudi','vendredi','samedi'];phpjs.locales.fr.LC_TIME.b=['jan','f\u00E9v','mar','avr','mai','jun','jui','ao\u00FB','sep','oct','nov','d\u00E9c'];phpjs.locales.fr.LC_TIME.B=['janvier','f\u00E9vrier','mars','avril','mai','juin','juillet','ao\u00FBt','septembre','octobre','novembre','d\u00E9cembre'];phpjs.locales.fr.LC_TIME.c='%a %d %b %Y %T %Z';phpjs.locales.fr.LC_TIME.p=['',''];phpjs.locales.fr.LC_TIME.P=['',''];phpjs.locales.fr.LC_TIME.x='%d.%m.%Y';phpjs.locales.fr.LC_TIME.X='%T';phpjs.locales.fr_CA=_copy(phpjs.locales.fr);phpjs.locales.fr_CA.LC_TIME.x='%Y-%m-%d';}
if(!phpjs.locale){phpjs.locale='en_US';var NS_XHTML='http://www.w3.org/1999/xhtml';var NS_XML='http://www.w3.org/XML/1998/namespace';if(d.getElementsByTagNameNS&&d.getElementsByTagNameNS(NS_XHTML,'html')[0]){if(d.getElementsByTagNameNS(NS_XHTML,'html')[0].getAttributeNS&&d.getElementsByTagNameNS(NS_XHTML,'html')[0].getAttributeNS(NS_XML,'lang')){phpjs.locale=d.getElementsByTagName(NS_XHTML,'html')[0].getAttributeNS(NS_XML,'lang');}else if(d.getElementsByTagNameNS(NS_XHTML,'html')[0].lang){phpjs.locale=d.getElementsByTagNameNS(NS_XHTML,'html')[0].lang;}}else if(d.getElementsByTagName('html')[0]&&d.getElementsByTagName('html')[0].lang){phpjs.locale=d.getElementsByTagName('html')[0].lang;}}
phpjs.locale=phpjs.locale.replace('-','_');if(!(phpjs.locale in phpjs.locales)){if(phpjs.locale.replace(/_[a-zA-Z]+$/,'')in phpjs.locales){phpjs.locale=phpjs.locale.replace(/_[a-zA-Z]+$/,'');}}
if(!phpjs.localeCategories){phpjs.localeCategories={'LC_COLLATE':phpjs.locale,'LC_CTYPE':phpjs.locale,'LC_MONETARY':phpjs.locale,'LC_NUMERIC':phpjs.locale,'LC_TIME':phpjs.locale,'LC_MESSAGES':phpjs.locale};}
if(locale===null||locale===''){locale=this.getenv(category)||this.getenv('LANG');}else if(locale instanceof Array){for(i=0;i<locale.length;i++){if(!(locale[i]in this.php_js.locales)){if(i===locale.length-1){return false;}
continue;}
locale=locale[i];break;}}
if(locale==='0'||locale===0){if(category==='LC_ALL'){for(categ in this.php_js.localeCategories){cats.push(categ+'='+this.php_js.localeCategories[categ]);}
return cats.join(';');}
return this.php_js.localeCategories[category];}
if(!(locale in this.php_js.locales)){return false;}
if(category==='LC_ALL'){for(categ in this.php_js.localeCategories){this.php_js.localeCategories[categ]=locale;}}else{this.php_js.localeCategories[category]=locale;}
return locale;}
function setrawcookie(name,value,expires,path,domain,secure){if(typeof expires==='string'&&(/^\d+$/).test(expires)){expires=parseInt(expires,10);}
if(expires instanceof Date){expires=expires.toGMTString();}else if(typeof(expires)==='number'){expires=(new Date(expires*1e3)).toGMTString();}
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]);}}
return secure&&r.push('secure'),this.window.document.cookie=r.join(";"),true;}
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;}
else if(v==='0'){this[vr]=false;}
else if(typeof v==='object'&&!is_array(v)){var lgth=false;for(i in v){lgth=true;}
this[vr]=lgth;}
else{this[vr]=!!v;}
break;case'integer':if(typeof v==='number'){this[vr]=parseInt(v,10);}
else if(typeof v==='string'){mtch=v.match(/^([+\-]?)(\d+)/);if(!mtch){this[vr]=0;}
else{this[vr]=parseInt(v,10);}}
else if(v===true){this[vr]=1;}
else if(v===false||v===null){this[vr]=0;}
else if(is_array(v)&&v.length===0){this[vr]=0;}
else if(typeof v==='object'){this[vr]=1;}
break;case'float':if(typeof v==='string'){mtch=v.match(/^([+\-]?)(\d+(\.\d+)?|\.\d+)([eE][+\-]?\d+)?/);if(!mtch){this[vr]=0;}
else{this[vr]=parseFloat(v,10);}}
else if(v===true){this[vr]=1;}
else if(v===false||v===null){this[vr]=0;}
else if(is_array(v)&&v.length===0){this[vr]=0;}
else if(typeof v==='object'){this[vr]=1;}
break;case'string':if(v===null||v===false){this[vr]='';}
else if(is_array(v)){this[vr]='Array';}
else if(typeof v==='object'){this[vr]='Object';}
else if(v===true){this[vr]='1';}
else{this[vr]+='';}
break;case'array':if(v===null){this[vr]=[];}
else if(typeof v!=='object'){this[vr]=[v];}
break;case'object':if(v===null){this[vr]={};}
else if(is_array(v)){for(i=0,obj={};i<v.length;i++){obj[i]=v;}
this[vr]=obj;}
else if(typeof v!=='object'){this[vr]={scalar:v};}
break;case'null':delete this[vr];break;}
return true;}catch(e){return false;}}
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);}
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);}
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;}
word_array.push(i);while((word_array.length%16)!=14){word_array.push(0);}
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];}
for(i=16;i<=79;i++){W[i]=rotate_left(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);}
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;}
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;}
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;}
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;}
H0=(H0+A)&0x0ffffffff;H1=(H1+B)&0x0ffffffff;H2=(H2+C)&0x0ffffffff;H3=(H3+D)&0x0ffffffff;H4=(H4+E)&0x0ffffffff;}
temp=cvt_hex(H0)+cvt_hex(H1)+cvt_hex(H2)+cvt_hex(H3)+cvt_hex(H4);return temp.toLowerCase();}
function sha1_file(str_filename){var buf=this.file_get_contents(str_filename);return this.sha1(buf);}
function shuffle(inputArr){var valArr=[],k='',i=0,strictForIn=false,populateArr=[];for(k in inputArr){if(inputArr.hasOwnProperty){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
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];}
return strictForIn?true:populateArr;}
function sin(arg){return Math.sin(arg);}
function sinh(arg){return(Math.exp(arg)-Math.exp(-arg))/2;}
function sizeof(mixed_var,mode){return this.count(mixed_var,mode);}
function sleep(seconds){var start=new Date().getTime();while(new Date()<start+seconds*1000){}
return 0;}
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;}
if(a<b){return-1;}
return 0;};break;}
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){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
valArr.sort(sorter);for(i=0;i<valArr.length;i++){populateArr[i]=valArr[i];}
return strictForIn?true:populateArr;}
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;}}}
return r.length>p&&(r.length=p),r.join('')+(new Array(p-r.length+1)).join('0');}
function split(delimiter,string){return this.explode(delimiter,string);}
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=' ';}
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);}}
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);}
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'%';}
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;}}
if(!minWidth){minWidth=0;}else if(minWidth=='*'){minWidth=+a[i++];}else if(minWidth.charAt(0)=='*'){minWidth=+a[minWidth.slice(1,-1)];}else{minWidth=+minWidth;}
if(minWidth<0){minWidth=-minWidth;leftJustify=true;}
if(!isFinite(minWidth)){throw new Error('sprintf: (minimum-)width must be finite');}
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;}
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);}
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)+']';}
else{retStr+=str.charAt(i);}}
return retStr;}
function sqrt(arg){return Math.sqrt(arg);}
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));}
return output;}
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];}}}
if(!(search instanceof Array)){search=[search];}
while(search.length>replace.length){replace[replace.length]='';}
if(subject instanceof Array){for(k in subject){if(subject.hasOwnProperty(k)){subject[k]=str_ireplace(search,replace,subject[k]);}}
return subject;}
searchl=search.length;for(i=0;i<searchl;i++){reg=new RegExp(escapeRegex(search[i]),'gi');subject=subject.replace(reg,replace[i]);}
return subject;}
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;}
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';}
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;}
else if(pad_type=='STR_PAD_RIGHT'){input=input+str_pad_repeater(pad_string,pad_to_go);}
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);}}
return input;}
function str_repeat(input,multiplier){return new Array(multiplier+1).join(input);}
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;}
for(i=0,sl=s.length;i<sl;i++){if(s[i]===''){continue;}
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;}}}
return sa?s:s[0];}
function str_rot13(str){return(str+'').replace(/[A-Za-z]/g,function(c){return String.fromCharCode((((c=c.charCodeAt(0))&223)-52)%26+(c&32)+65);});}
function str_shuffle(str){if(str==undefined){throw'Wrong parameter count for str_shuffle()';}
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);}
return newStr;}
function str_split(string,split_length){if(string===undefined||!string.toString||split_length<1){return false;}
return string.toString().match(new RegExp('.{1,'+(split_length||'1')+'}','g'));}
function str_word_count(str,format,charlist){var l=str.length,tmpStr="";var i=0;var c='';var wArr=[],wC=0;var assArr={},aC=0,reg="";if(charlist){for(i=0;i<=charlist.length-1;i++){if(i!=charlist.length-1){reg=reg+charlist.charCodeAt(i)+"|";}else{reg=reg+charlist.charCodeAt(i);}}
reg=new RegExp(reg);}
for(i=0;i<=l-1;i++){c=str.charCodeAt(i);if((c<91&&c>64)||(c<123&&c>96)||c==45||c==39||(reg&&reg.test(c))){if(tmpStr==""&&format==2){aC=i;}
tmpStr=tmpStr+String.fromCharCode(c);}else if(tmpStr!=""){if(format!=2){wArr[wArr.length]=tmpStr;}else{assArr[aC]=tmpStr;}
tmpStr="";wC++;}}
if(!format){return wC;}else if(format==1){return wArr;}else if(format==2){return assArr;}
throw'You have supplied an incorrect format';}
function strcasecmp(f_string1,f_string2){var string1=(f_string1+'').toLowerCase();var string2=(f_string2+'').toLowerCase();if(string1>string2){return 1;}
else if(string1==string2){return 0;}
return-1;}
function strchr(haystack,needle,bool){return this.strstr(haystack,needle,bool);}
function strcmp(str1,str2){return((str1==str2)?0:((str1>str2)?1:-1));}
function strcoll(str1,str2){this.setlocale('LC_ALL',0);var cmp=this.php_js.locales[this.php_js.localeCategories.LC_COLLATE].LC_COLLATE;return cmp(str1,str2);}
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;}}
++lgth;}
return lgth;}
function stream_context_create(options,params){var resource={};options=options||{};this.php_js=this.php_js||{};this.php_js.resourceIdCounter=this.php_js.resourceIdCounter||0;function PHPJS_Resource(type,id,opener){this.type=type;this.id=id;this.opener=opener;}
PHPJS_Resource.prototype.toString=function(){return'Resource id #'+this.id;};PHPJS_Resource.prototype.get_resource_type=function(){return this.type;};PHPJS_Resource.prototype.var_dump=function(){return'resource('+this.id+') of type ('+this.type+')';};this.php_js.resourceIdCounter++;resource=new PHPJS_Resource('stream-context',this.php_js.resourceIdCounter,'stream_context_create');resource.stream_options=options;resource.stream_params=params;return resource;}
function stream_context_get_default(options){this.php_js=this.php_js||{};if(!this.php_js.default_streams_context){this.php_js.default_streams_context=this.stream_context_create(options);}
if(options){this.php_js.default_streams_context.stream_options=options;}
return this.php_js.default_streams_context;}
function stream_context_get_options(stream_or_context){return stream_or_context.stream_options;}
function stream_context_get_params(stream_or_context){return stream_or_context.stream_params;}
function stream_context_set_default(options){this.php_js=this.php_js||{};if(!this.php_js.default_streams_context){this.php_js.default_streams_context=this.stream_context_create(options);}
this.php_js.default_streams_context.stream_options=options;return this.php_js.default_streams_context;}
function stream_context_set_option(stream_or_context,optionsOrWrapper,option,value){if(option){if(!stream_or_context.stream_options[optionsOrWrapper]){stream_or_context.stream_options[optionsOrWrapper]={};}
stream_or_context.stream_options[optionsOrWrapper][option]=value;}
else{stream_or_context.stream_options=optionsOrWrapper;}
return true;}
function stream_context_set_params(stream_or_context,params){var param='';for(param in params){if(param==='options'){stream_or_context.stream_options=params[param];}
else{stream_or_context.stream_params[param]=params[param];}}
return true;}
function stream_get_contents(handle,maxLength,offset){if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||!handle||!handle.id){return false;}
offset=offset||0;this.php_js.resourceDataPointer[handle.id]+=offset;var chrs=this.php_js.resourceData[handle.id].slice(this.php_js.resourceDataPointer[handle.id]);chrs=maxLength>=0?chrs.substr(0,maxLength):chrs;this.echo(chrs);this.php_js.resourceDataPointer[handle.id]+=chrs.length;return chrs;}
function stream_get_line(handle,length,ending){var start=0,fullline='';if(!this.php_js||!this.php_js.resourceData||!this.php_js.resourceDataPointer||length!==undefined&&!length){return false;}
start=this.php_js.resourceDataPointer[handle.id];if(start===undefined||!this.php_js.resourceData[handle.id][start]){return false;}
fullline=this.php_js.resourceData[handle.id].slice(start,this.php_js.resourceData[handle.id].indexOf(ending,start)+1);if(fullline===''){fullline=this.php_js.resourceData[handle.id].slice(start);}
length=(length===undefined||fullline.length<length)?fullline.length:Math.floor(length/2)||1;this.php_js.resourceDataPointer[handle.id]+=length;return this.php_js.resourceData[handle.id].substr(start,length-(fullline&&ending&&ending.length?ending.length:0));}
function stream_is_local(stream_or_url){if(typeof stream_or_url==='string'){return(/^(https?|ftps?|ssl|tls):/.test(stream_or_url))?false:true;}
return stream_or_url.is_local?true:false;}
function strftime(fmt,timestamp){this.php_js=this.php_js||{};this.setlocale('LC_ALL',0);var phpjs=this.php_js;var _xPad=function(x,pad,r){if(typeof r==='undefined'){r=10;}
for(;parseInt(x,10)<r&&r>1;r/=10){x=pad.toString()+x;}
return x.toString();};var locale=phpjs.localeCategories.LC_TIME;var locales=phpjs.locales;var _formats={a:function(d){return locales[locale].LC_TIME.a[d.getDay()];},A:function(d){return locales[locale].LC_TIME.A[d.getDay()];},b:function(d){return locales[locale].LC_TIME.b[d.getMonth()];},B:function(d){return locales[locale].LC_TIME.B[d.getMonth()];},C:function(d){return _xPad(parseInt(d.getFullYear()/100,10),0);},d:['getDate','0'],e:['getDate',' '],g:function(d){return _xPad(parseInt(this.G(d)/100,10),0);},G:function(d){var y=d.getFullYear();var V=parseInt(_formats.V(d),10);var W=parseInt(_formats.W(d),10);if(W>V){y++;}
else if(W===0&&V>=52){y--;}
return y;},H:['getHours','0'],I:function(d){var I=d.getHours()%12;return _xPad(I===0?12:I,0);},j:function(d){var ms=d-new Date(''+d.getFullYear()+'/1/1 GMT');ms+=d.getTimezoneOffset()*60000;var doy=parseInt(ms/60000/60/24,10)+1;return _xPad(doy,0,100);},k:['getHours','0'],l:function(d){var l=d.getHours()%12;return _xPad(l===0?12:l,' ');},m:function(d){return _xPad(d.getMonth()+1,0);},M:['getMinutes','0'],p:function(d){return locales[locale].LC_TIME.p[d.getHours()>=12?1:0];},P:function(d){return locales[locale].LC_TIME.P[d.getHours()>=12?1:0];},s:function(d){return Date.parse(d)/1000;},S:['getSeconds','0'],u:function(d){var dow=d.getDay();return((dow===0)?7:dow);},U:function(d){var doy=parseInt(_formats.j(d),10);var rdow=6-d.getDay();var woy=parseInt((doy+rdow)/7,10);return _xPad(woy,0);},V:function(d){var woy=parseInt(_formats.W(d),10);var dow1_1=(new Date(''+d.getFullYear()+'/1/1')).getDay();var idow=woy+(dow1_1>4||dow1_1<=1?0:1);if(idow===53&&(new Date(''+d.getFullYear()+'/12/31')).getDay()<4){idow=1;}
else if(idow===0){idow=_formats.V(new Date(''+(d.getFullYear()-1)+'/12/31'));}
return _xPad(idow,0);},w:'getDay',W:function(d){var doy=parseInt(_formats.j(d),10);var rdow=7-_formats.u(d);var woy=parseInt((doy+rdow)/7,10);return _xPad(woy,0,10);},y:function(d){return _xPad(d.getFullYear()%100,0);},Y:'getFullYear',z:function(d){var o=d.getTimezoneOffset();var H=_xPad(parseInt(Math.abs(o/60),10),0);var M=_xPad(o%60,0);return(o>0?'-':'+')+H+M;},Z:function(d){return d.toString().replace(/^.*\(([^)]+)\)$/,'$1');},'%':function(d){return'%';}};var _date=((typeof(timestamp)=='undefined')?new Date():(typeof(timestamp)=='object')?new Date(timestamp):new Date(timestamp*1000));var _aggregates={c:'locale',D:'%m/%d/%y',F:'%y-%m-%d',h:'%b',n:'\n',r:'locale',R:'%H:%M',t:'\t',T:'%H:%M:%S',x:'locale',X:'locale'};while(fmt.match(/%[cDFhnrRtTxX]/)){fmt=fmt.replace(/%([cDFhnrRtTxX])/g,function(m0,m1)
{var f=_aggregates[m1];return(f==='locale'?locales[locale].LC_TIME[m1]:f);});}
var str=fmt.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,function(m0,m1){var f=_formats[m1];if(typeof f==='string'){return _date[f]();}else if(typeof f==='function'){return f(_date);}else if(typeof f==='object'&&typeof(f[0])==='string'){return _xPad(_date[f[0]](),f[1]);}else{return m1;}});return str;}
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);}
str+='';matches=str.match(/(<\/?[\S][^>]*>)/gi);for(key in matches){if(isNaN(key)){continue;}
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+'>');}
if(i!=0){i=html.toLowerCase().indexOf('<'+allowed_tag+' ');}
if(i!=0){i=html.toLowerCase().indexOf('</'+allowed_tag);}
if(i==0){allowed=true;break;}}
if(!allowed){str=replacer(html,"",str);}}
return str;}
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;}
return false;}
function stripslashes(str){return(str+'').replace(/\\(.?)/g,function(s,n1){switch(n1){case'\\':return'\\';case'0':return'\u0000';case'':return'';default:return n1;}});}
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);}}}
function strlen(string){var str=string+'';var i=0,chr='',lgth=0;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';}
next=str.charCodeAt(i+1);if(0xDC00>next||next>0xDFFF){throw'High surrogate without following low surrogate';}
return str.charAt(i)+str.charAt(i+1);}else if(0xDC00<=code&&code<=0xDFFF){if(i===0){throw'Low surrogate without preceding high surrogate';}
prev=str.charCodeAt(i-1);if(0xD800>prev||prev>0xDBFF){throw'Low surrogate without preceding high surrogate';}
return false;}
return str.charAt(i);};for(i=0,lgth=0;i<str.length;i++){if((chr=getWholeChar(str,i))===false){continue;}
lgth++;}
return lgth;}
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;}
ca=a.charAt(++ia);}
while(isWhitespaceChar(cb)||cb=='0'){if(cb=='0'){nzb++;}else{nzb=0;}
cb=b.charAt(++ib);}
if(isDigitChar(ca)&&isDigitChar(cb)){if((result=compareRight(a.substring(ia),b.substring(ib)))!=0){return result;}}
if(ca==0&&cb==0){return nza-nzb;}
if(ca<cb){return-1;}else if(ca>cb){return+1;}
++ia;++ib;}}
function strnatcmp(f_string1,f_string2,f_version){var i=0;if(f_version==undefined){f_version=false;}
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='';}
text=false;}
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='';}
text=true;}
buffer+=chr;}}
if(buffer.length>0){if(text){result[result.length]=buffer;}else{result[result.length]=parseInt(buffer,10);}}
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;}
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;}}
text=false;}}
return result;}
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;}
for(diff=0,i=0;i<len;i++){diff=str1.charCodeAt(i)-str2.charCodeAt(i);if(diff!==0){return diff;}}
return 0;}
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));}
function strpbrk(haystack,char_list){for(var i=0,len=haystack.length;i<len;++i){if(char_list.indexOf(haystack.charAt(i))>=0)
return haystack.slice(i);}
return false;}
function strpos(haystack,needle,offset){var i=(haystack+'').indexOf(needle,(offset?offset:0));return i===-1?false:i;}
function strrchr(haystack,needle){var pos=0;if(typeof needle!=='string'){needle=String.fromCharCode(parseInt(needle,10));}
needle=needle.charAt(0);pos=haystack.lastIndexOf(needle);if(pos===-1){return false;}
return haystack.substr(pos);}
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('');}
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;}}
else{i=(haystack+'').lastIndexOf(needle);}
return i>=0?i:false;}
function strrpos(haystack,needle,offset){var i=-1;if(offset){i=(haystack+'').slice(offset).lastIndexOf(needle);if(i!==-1){i+=offset;}}
else{i=(haystack+'').lastIndexOf(needle);}
return i>=0?i:false;}
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;}}
if(found!=1){return i;}}
return i;}
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);}}}
function strtok(str,tokens){this.php_js=this.php_js||{};if(tokens===undefined){tokens=str;str=this.php_js.strtokleftOver;}
if(str.length===0){return false;}
if(tokens.indexOf(str.charAt(0))!==-1){return this.strtok(str.substr(1),tokens);}
for(var i=0;i<str.length;i++){if(tokens.indexOf(str.charAt(i))!==-1){break;}}
this.php_js.strtokleftOver=str.substr(i+1);return str.substring(0,i);}
function strtolower(str){return(str+'').toLowerCase();}
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();}
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;}}
now.setDate(now.getDate()+diff);}}
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;}
break;}
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';}
s=match[1].split(/-/g);for(i in __is.mon){if(__is.mon[i]==s[1]-1){s[1]=i;}}
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);}
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;}
for(i=0;i<match.length;i++){if(!process(match[i].split(' '))){return false;}}
return(now.getTime()/1000);}
function strtoupper(str){return(str+'').toUpperCase();}
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]);}}
from=tmpFrom;to=tmpTo;}
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;}}}
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;}}}
if(match){ret+=toTypeStr?to.charAt(j):to[j];}else{ret+=str.charAt(i);}}
return ret;}
function strval(str){var type='';if(str===null){return'';}
type=this.gettype(str);switch(type){case'boolean':if(str===true){return'1';}
return'';case'array':return'Array';case'object':return'Object';}
return str;}
function substr(str,start,len){str+='';var end=str.length;if(start<0){start+=end;}
end=typeof len==='undefined'?end:(len<0?len+end:len+start);return start>=str.length||start<0||start>end?!1:str.slice(start,end);}
function substr_compare(main_str,str,offset,length,case_insensitivity){if(!offset&&offset!==0){throw'Missing offset for substr_compare()';}
if(offset<0){offset=main_str.length+offset;}
if(length&&length>(main_str.length-offset)){return false;}
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;}
return(main_str>str)?1:-1;}
return((main_str==str)?0:((main_str>str)?1:-1));}
function substr_count(haystack,needle,offset,length){var pos=0,cnt=0;haystack+='';needle+='';if(isNaN(offset)){offset=0;}
if(isNaN(length)){length=0;}
offset--;while((offset=haystack.indexOf(needle,offset+1))!=-1){if(length>0&&(offset+needle.length)>length){return false;}else{cnt++;}}
return cnt;}
function substr_replace(str,replace,start,length){if(start<0){start=start+str.length;}
length=length!==undefined?length:str.length;if(length<0){length=length+str.length-start;}
return str.slice(0,start)+replace.substr(0,length)+replace.slice(length)+str.slice(start+length);}
function tan(arg){return Math.tan(arg);}
function tanh(arg){return(Math.exp(arg)-Math.exp(-arg))/(Math.exp(arg)+Math.exp(-arg));}
function time(){return Math.floor(new Date().getTime()/1000);}
function time_nanosleep(seconds,nanosecs){var start=new Date().getTime();while(new Date()<(start+seconds*1000+nanosecs/1000000)){}
return true;}
function time_sleep_until(timestamp){while(new Date()<timestamp*1000){}
return true;}
function timezone_abbreviations_list(){var list={},i=0,j=0,len=0,jlen=0,indice='',curr='',currSub='',currSubPrefix='',timezone_id='';try{php_js_shared;}
catch(e){php_js_shared={};}
if(!php_js_shared.tz_abbrs){php_js_shared.tz_abbrs=[[[1,14,"Porto_Acre",9],[1,14,"Eirunepe",9],[1,14,"Rio_Branco",9],[1,14,"Acre",15]],[[0,11,"Porto_Acre",9],[0,11,"Eirunepe",9],[0,11,"Rio_Branco",9],[0,11,"Acre",15]],[[1,25,"Goose_Bay",9],[1,25,"Pangnirtung",9]],[[1,22,"Halifax",9],[1,22,"Barbados",9],[1,22,"Blanc-Sablon",9],[1,22,"Glace_Bay",9],[1,22,"Goose_Bay",9],[1,22,"Martinique",9],[1,22,"Moncton",9],[1,22,"Pangnirtung",9],[1,22,"Thule",9],[1,22,"Bermuda",13],[1,22,"Atlantic",16],[1,51,"Baghdad",12]],[[0,52,"Kabul",12]],[[1,6,"Anchorage",9],[1,6,"Alaska"]],[[0,4,"Anchorage",9],[0,4,"Adak",9],[0,4,"Atka",9],[0,4,"Alaska"],[0,4,"Aleutian"]],[[1,7,"Anchorage",9],[1,7,"Juneau",9],[1,7,"Nome",9],[1,7,"Yakutat",9],[1,7,"Alaska"]],[[0,6,"Anchorage",9],[0,6,"Juneau",9],[0,6,"Nome",9],[0,6,"Yakutat",9],[0,6,"Alaska"]],[[1,57,"Aqtobe",12]],[[0,51,"Aqtobe",12],[0,54,"Aqtobe",12],[0,57,"Aqtobe",12]],[[1,59,"Almaty",12]],[[0,54,"Almaty",12],[0,57,"Almaty",12]],[[1,51,"Yerevan",12],[1,54,"Yerevan",12],[1,22,"Boa_Vista",9],[1,22,"Campo_Grande",9],[1,22,"Cuiaba",9],[1,22,"Manaus",9],[1,22,"Porto_Velho",9],[1,22,"West",15]],[[0,47,"Yerevan",12],[0,51,"Yerevan",12],[0,14,"Boa_Vista",9],[0,14,"Campo_Grande",9],[0,14,"Cuiaba",9],[0,14,"Manaus",9],[0,14,"Porto_Velho",9],[0,14,"West",15],[0,32,"Amsterdam",18]],[[1,76,"Anadyr",12],[1,79,"Anadyr",12],[1,81,"Anadyr",12]],[[0,74,"Anadyr",12],[0,76,"Anadyr",12],[0,79,"Anadyr",12]],[[0,13,"Curacao",9],[0,13,"Aruba",9]],[[1,22,"Halifax",9],[1,22,"Blanc-Sablon",9],[1,22,"Glace_Bay",9],[1,22,"Moncton",9],[1,22,"Pangnirtung",9],[1,22,"Puerto_Rico",9],[1,22,"Atlantic",16]],[[1,54,"Aqtau",12],[1,57,"Aqtau",12],[1,57,"Aqtobe",12]],[[0,51,"Aqtau",12],[0,54,"Aqtau",12],[0,54,"Aqtobe",12]],[[1,22,"Buenos_Aires",9],[1,25,"Buenos_Aires",9],[1,22,"Buenos_Aires",2],[1,22,"Catamarca",2],[1,22,"ComodRivadavia",2],[1,22,"Cordoba",2],[1,22,"Jujuy",2],[1,22,"La_Rioja",2],[1,22,"Mendoza",2],[1,22,"Rio_Gallegos",2],[1,22,"San_Juan",2],[1,22,"Tucuman",2],[1,22,"Ushuaia",2],[1,22,"Catamarca",9],[1,22,"Cordoba",9],[1,22,"Jujuy",9],[1,22,"Mendoza",9],[1,22,"Rosario",9],[1,22,"Palmer",10],[1,25,"Buenos_Aires",2],[1,25,"Catamarca",2],[1,25,"ComodRivadavia",2],[1,25,"Cordoba",2],[1,25,"Jujuy",2],[1,25,"La_Rioja",2],[1,25,"Mendoza",2],[1,25,"Rio_Gallegos",2],[1,25,"San_Juan",2],[1,25,"Tucuman",2],[1,25,"Ushuaia",2],[1,25,"Catamarca",9],[1,25,"Cordoba",9],[1,25,"Jujuy",9],[1,25,"Mendoza",9],[1,25,"Rosario",9],[1,25,"Palmer",10]],[[0,22,"Buenos_Aires",9],[0,14,"Buenos_Aires",9],[0,22,"Buenos_Aires",2],[0,22,"Catamarca",2],[0,22,"ComodRivadavia",2],[0,22,"Cordoba",2],[0,22,"Jujuy",2],[0,22,"La_Rioja",2],[0,22,"Mendoza",2],[0,22,"Rio_Gallegos",2],[0,22,"San_Juan",2],[0,22,"Tucuman",2],[0,22,"Ushuaia",2],[0,22,"Catamarca",9],[0,22,"Cordoba",9],[0,22,"Jujuy",9],[0,22,"Mendoza",9],[0,22,"Rosario",9],[0,22,"Palmer",10],[0,14,"Buenos_Aires",2],[0,14,"Catamarca",2],[0,14,"ComodRivadavia",2],[0,14,"Cordoba",2],[0,14,"Jujuy",2],[0,14,"La_Rioja",2],[0,14,"Mendoza",2],[0,14,"Rio_Gallegos",2],[0,14,"San_Juan",2],[0,14,"Tucuman",2],[0,14,"Ushuaia",2],[0,14,"Catamarca",9],[0,14,"Cordoba",9],[0,14,"Jujuy",9],[0,14,"Mendoza",9],[0,14,"Rosario",9],[0,14,"Palmer",10]],[[1,54,"Ashkhabad",12],[1,57,"Ashkhabad",12],[1,54,"Ashgabat",12],[1,57,"Ashgabat",12]],[[0,51,"Ashkhabad",12],[0,54,"Ashkhabad",12],[0,51,"Ashgabat",12],[0,54,"Ashgabat",12]],[[0,47,"Riyadh",12],[0,14,"Anguilla",9],[0,14,"Antigua",9],[0,14,"Aruba",9],[0,14,"Barbados",9],[0,14,"Blanc-Sablon",9],[0,14,"Curacao",9],[0,14,"Dominica",9],[0,14,"Glace_Bay",9],[0,14,"Goose_Bay",9],[0,14,"Grenada",9],[0,14,"Guadeloupe",9],[0,14,"Halifax",9],[0,14,"Martinique",9],[0,14,"Miquelon",9],[0,14,"Moncton",9],[0,14,"Montserrat",9],[0,14,"Pangnirtung",9],[0,14,"Port_of_Spain",9],[0,14,"Puerto_Rico",9],[0,14,"Santo_Domingo",9],[0,14,"St_Kitts",9],[0,14,"St_Lucia",9],[0,14,"St_Thomas",9],[0,14,"St_Vincent",9],[0,14,"Thule",9],[0,14,"Tortola",9],[0,14,"Virgin",9],[0,14,"Bermuda",13],[0,14,"Atlantic",16],[0,47,"Aden",12],[0,47,"Baghdad",12],[0,47,"Bahrain",12],[0,47,"Kuwait",12],[0,47,"Qatar",12]],[[1,22,"Halifax",9],[1,22,"Blanc-Sablon",9],[1,22,"Glace_Bay",9],[1,22,"Moncton",9],[1,22,"Pangnirtung",9],[1,22,"Puerto_Rico",9],[1,22,"Atlantic",16]],[[1,31,"Azores",13]],[[1,28,"Azores",13],[1,31,"Azores",13]],[[0,28,"Azores",13],[0,25,"Azores",13]],[[1,51,"Baku",12],[1,54,"Baku",12]],[[0,47,"Baku",12],[0,51,"Baku",12]],[[1,51,"Baku",12],[1,54,"Baku",12]],[[0,47,"Baku",12],[0,51,"Baku",12]],[[1,42,"London",18],[1,42,"Belfast",18],[1,42,"Gibraltar",18],[1,42,"Guernsey",18],[1,42,"Isle_of_Man",18],[1,42,"Jersey",18],[1,42,"GB"],[1,42,"GB-Eire"]],[[1,4,"Adak",9],[1,4,"Atka",9],[1,4,"Nome",9],[1,4,"Aleutian"],[0,57,"Dacca",12],[0,57,"Dhaka",12]],[[0,43,"Mogadishu"],[0,43,"Kampala"],[0,43,"Nairobi"]],[[0,46,"Nairobi"],[0,46,"Dar_es_Salaam"],[0,46,"Kampala"]],[[0,15,"Barbados",9],[0,27,"Banjul"],[0,41,"Tiraspol",18],[0,41,"Chisinau",18]],[[0,63,"Brunei",12],[0,65,"Brunei",12]],[[1,66,"Kuching",12]],[[0,63,"Kuching",12],[0,65,"Kuching",12]],[[1,19,"La_Paz",9]],[[0,14,"La_Paz",9]],[[1,25,"Sao_Paulo",9],[1,25,"Araguaina",9],[1,25,"Bahia",9],[1,25,"Belem",9],[1,25,"Fortaleza",9],[1,25,"Maceio",9],[1,25,"Recife",9],[1,25,"East",15]],[[0,22,"Sao_Paulo",9],[0,22,"Araguaina",9],[0,22,"Bahia",9],[0,22,"Belem",9],[0,22,"Fortaleza",9],[0,22,"Maceio",9],[0,22,"Recife",9],[0,22,"East",15]],[[0,35,"London",18],[1,35,"London",18],[0,2,"Adak",9],[0,2,"Atka",9],[0,2,"Nome",9],[0,2,"Midway",21],[0,2,"Pago_Pago",21],[0,2,"Samoa",21],[0,2,"Aleutian"],[0,2,"Samoa"],[0,35,"Belfast",18],[0,35,"Guernsey",18],[0,35,"Isle_of_Man",18],[0,35,"Jersey",18],[0,35,"GB"],[0,35,"GB-Eire"],[1,35,"Eire"],[1,35,"Belfast",18],[1,35,"Dublin",18],[1,35,"Gibraltar",18],[1,35,"Guernsey",18],[1,35,"Isle_of_Man",18],[1,35,"Jersey",18],[1,35,"GB"],[1,35,"GB-Eire"]],[[0,57,"Thimbu",12],[0,57,"Thimphu",12]],[[0,58,"Calcutta",12],[0,58,"Dacca",12],[0,58,"Dhaka",12],[0,58,"Rangoon",12]],[[0,28,"Canary",13]],[[1,6,"Anchorage",9],[1,6,"Alaska"]],[[0,70,"Adelaide",14],[1,47,"Gaborone"],[1,47,"Khartoum"]],[[0,4,"Anchorage",9],[0,4,"Alaska"],[0,42,"Khartoum"],[0,42,"Blantyre"],[0,42,"Gaborone"],[0,42,"Harare"],[0,42,"Kigali"],[0,42,"Lusaka"],[0,42,"Maputo"],[0,42,"Windhoek"]],[[1,6,"Anchorage",9],[1,6,"Alaska"]],[[1,14,"Rankin_Inlet",9]],[[1,11,"Chicago",9],[1,14,"Havana",9],[1,14,"Cuba"],[1,11,"Atikokan",9],[1,11,"Belize",9],[1,11,"Cambridge_Bay",9],[1,11,"Cancun",9],[1,11,"Chihuahua",9],[1,11,"Coral_Harbour",9],[1,11,"Costa_Rica",9],[1,11,"El_Salvador",9],[1,11,"Fort_Wayne",9],[1,11,"Guatemala",9],[1,11,"Indianapolis",4],[1,11,"Knox",4],[1,11,"Marengo",4],[1,11,"Petersburg",4],[1,11,"Vevay",4],[1,11,"Vincennes",4],[1,11,"Winamac",4],[1,11,"Indianapolis",9],[1,11,"Iqaluit",9],[1,11,"Louisville",6],[1,11,"Monticello",6],[1,11,"Knox_IN",9],[1,11,"Louisville",9],[1,11,"Managua",9],[1,11,"Menominee",9],[1,11,"Merida",9],[1,11,"Mexico_City",9],[1,11,"Monterrey",9],[1,11,"Center",8],[1,11,"New_Salem",8],[1,11,"Pangnirtung",9],[1,11,"Rainy_River",9],[1,11,"Rankin_Inlet",9],[1,11,"Tegucigalpa",9],[1,11,"Winnipeg",9],[1,11,"Central",16],[1,11,"CST6CDT"],[1,11,"General",20],[1,11,"Central"],[1,11,"East-Indiana"],[1,11,"Indiana-Starke"],[1,69,"Shanghai",12],[1,69,"Chongqing",12],[1,69,"Chungking",12],[1,69,"Harbin",12],[1,69,"Kashgar",12],[1,69,"Taipei",12],[1,69,"Urumqi",12],[1,69,"PRC"],[1,69,"ROC"]],[[1,47,"Berlin",18],[1,47,"CET"]],[[1,42,"Berlin",18],[1,47,"Kaliningrad",18],[1,42,"Algiers"],[1,42,"Ceuta"],[1,42,"Tripoli"],[1,42,"Tunis"],[1,42,"Longyearbyen",11],[1,42,"Jan_Mayen",13],[1,42,"CET"],[1,42,"Amsterdam",18],[1,42,"Andorra",18],[1,42,"Athens",18],[1,42,"Belgrade",18],[1,42,"Bratislava",18],[1,42,"Brussels",18],[1,42,"Budapest",18],[1,42,"Chisinau",18],[1,42,"Copenhagen",18],[1,42,"Gibraltar",18],[1,42,"Kaliningrad",18],[1,42,"Kiev",18],[1,42,"Lisbon",18],[1,42,"Ljubljana",18],[1,42,"Luxembourg",18],[1,42,"Madrid",18],[1,42,"Malta",18],[1,42,"Minsk",18],[1,42,"Monaco",18],[1,42,"Oslo",18],[1,42,"Paris",18],[1,42,"Podgorica",18],[1,42,"Prague",18],[1,42,"Riga",18],[1,42,"Rome",18],[1,42,"San_Marino",18],[1,42,"Sarajevo",18],[1,42,"Simferopol",18],[1,42,"Skopje",18],[1,42,"Sofia",18],[1,42,"Stockholm",18],[1,42,"Tallinn",18],[1,42,"Tirane",18],[1,42,"Tiraspol",18],[1,42,"Uzhgorod",18],[1,42,"Vaduz",18],[1,42,"Vatican",18],[1,42,"Vienna",18],[1,42,"Vilnius",18],[1,42,"Warsaw",18],[1,42,"Zagreb",18],[1,42,"Zaporozhye",18],[1,42,"Zurich",18],[1,42,"Libya"],[1,42,"Poland"],[1,42,"Portugal"],[1,42,"WET"]],[[0,35,"Berlin",18],[0,35,"Algiers"],[0,35,"Casablanca"],[0,35,"Ceuta"],[0,35,"Tripoli"],[0,35,"Tunis"],[0,35,"Longyearbyen",11],[0,35,"Jan_Mayen",13],[0,35,"CET"],[0,35,"Amsterdam",18],[0,35,"Andorra",18],[0,35,"Athens",18],[0,35,"Belgrade",18],[0,35,"Bratislava",18],[0,35,"Brussels",18],[0,35,"Budapest",18],[0,35,"Chisinau",18],[0,35,"Copenhagen",18],[0,35,"Gibraltar",18],[0,35,"Kaliningrad",18],[0,35,"Kiev",18],[0,35,"Lisbon",18],[0,35,"Ljubljana",18],[0,35,"Luxembourg",18],[0,35,"Madrid",18],[0,35,"Malta",18],[0,35,"Minsk",18],[0,35,"Monaco",18],[0,35,"Oslo",18],[0,35,"Paris",18],[0,35,"Podgorica",18],[0,35,"Prague",18],[0,35,"Riga",18],[0,35,"Rome",18],[0,35,"San_Marino",18],[0,35,"Sarajevo",18],[0,35,"Simferopol",18],[0,35,"Skopje",18],[0,35,"Sofia",18],[0,35,"Stockholm",18],[0,35,"Tallinn",18],[0,35,"Tirane",18],[0,35,"Tiraspol",18],[0,35,"Uzhgorod",18],[0,35,"Vaduz",18],[0,35,"Vatican",18],[0,35,"Vienna",18],[0,35,"Vilnius",18],[0,35,"Warsaw",18],[0,35,"Zagreb",18],[0,35,"Zaporozhye",18],[0,35,"Zurich",18],[0,35,"Libya"],[0,35,"Poland"],[0,35,"Portugal"],[0,35,"WET"],[0,42,"Kaliningrad",18]],[[1,28,"Scoresbysund",9]],[[0,25,"Scoresbysund",9]],[[1,80,"Chatham",21],[1,80,"NZ-CHAT"]],[[0,78,"Chatham",21],[0,78,"NZ-CHAT"]],[[0,67,"Harbin",12],[0,69,"Harbin",12]],[[1,10,"Belize",9]],[[1,72,"Choibalsan",12]],[[0,69,"Choibalsan",12]],[[0,65,"Dili",12],[0,65,"Makassar",12],[0,65,"Pontianak",12],[0,65,"Ujung_Pandang",12]],[[0,69,"Sakhalin",12]],[[1,5,"Rarotonga",21]],[[0,4,"Rarotonga",21]],[[1,22,"Santiago",9],[1,14,"Santiago",9],[1,22,"Palmer",10],[1,22,"Continental",17],[1,14,"Continental",17]],[[0,14,"Santiago",9],[0,11,"Santiago",9],[0,14,"Palmer",10],[0,14,"Continental",17],[0,11,"Continental",17]],[[1,14,"Bogota",9]],[[0,11,"Bogota",9]],[[1,11,"Chicago",9],[1,11,"Atikokan",9],[1,11,"Coral_Harbour",9],[1,11,"Fort_Wayne",9],[1,11,"Indianapolis",4],[1,11,"Knox",4],[1,11,"Marengo",4],[1,11,"Petersburg",4],[1,11,"Vevay",4],[1,11,"Vincennes",4],[1,11,"Winamac",4],[1,11,"Indianapolis",9],[1,11,"Louisville",6],[1,11,"Monticello",6],[1,11,"Knox_IN",9],[1,11,"Louisville",9],[1,11,"Menominee",9],[1,11,"Rainy_River",9],[1,11,"Rankin_Inlet",9],[1,11,"Winnipeg",9],[1,11,"Central",16],[1,11,"CST6CDT"],[1,11,"Central"],[1,11,"East-Indiana"],[1,11,"Indiana-Starke"]],[[0,9,"Chicago",9],[0,11,"Havana",9],[0,11,"Cuba"],[0,9,"Atikokan",9],[0,9,"Belize",9],[0,9,"Cambridge_Bay",9],[0,9,"Cancun",9],[0,9,"Chihuahua",9],[0,9,"Coral_Harbour",9],[0,9,"Costa_Rica",9],[0,9,"Detroit",9],[0,9,"El_Salvador",9],[0,9,"Fort_Wayne",9],[0,9,"Guatemala",9],[0,9,"Hermosillo",9],[0,9,"Indianapolis",4],[0,9,"Knox",4],[0,9,"Marengo",4],[0,9,"Petersburg",4],[0,9,"Vevay",4],[0,9,"Vincennes",4],[0,9,"Winamac",4],[0,9,"Indianapolis",9],[0,9,"Iqaluit",9],[0,9,"Louisville",6],[0,9,"Monticello",6],[0,9,"Knox_IN",9],[0,9,"Louisville",9],[0,9,"Managua",9],[0,9,"Mazatlan",9],[0,9,"Menominee",9],[0,9,"Merida",9],[0,9,"Mexico_City",9],[0,9,"Monterrey",9],[0,9,"Center",8],[0,9,"New_Salem",8],[0,9,"Pangnirtung",9],[0,9,"Rainy_River",9],[0,9,"Rankin_Inlet",9],[0,9,"Regina",9],[0,9,"Swift_Current",9],[0,9,"Tegucigalpa",9],[0,9,"Winnipeg",9],[0,9,"Central",16],[0,9,"East-Saskatchewan",16],[0,9,"Saskatchewan",16],[0,9,"CST6CDT"],[0,9,"BajaSur",20],[0,9,"General",20],[0,9,"Central"],[0,9,"East-Indiana"],[0,9,"Indiana-Starke"],[0,9,"Michigan"],[0,65,"Chongqing",12],[0,65,"Chungking",12],[0,65,"Harbin",12],[0,65,"Kashgar",12],[0,65,"Macao",12],[0,65,"Macau",12],[0,65,"Shanghai",12],[0,65,"Taipei",12],[0,65,"Urumqi",12],[0,65,"PRC"],[0,65,"ROC"],[0,70,"Jayapura",12],[0,70,"Adelaide",14],[0,70,"Broken_Hill",14],[0,70,"Darwin",14],[0,70,"North",14],[0,70,"South",14],[0,70,"Yancowinna",14],[1,73,"Adelaide",14],[1,73,"Broken_Hill",14],[1,73,"Darwin",14],[1,73,"North",14],[1,73,"South",14],[1,73,"Yancowinna",14]],[[1,28,"Cape_Verde",13]],[[0,28,"Cape_Verde",13],[0,25,"Cape_Verde",13]],[[0,68,"Eucla",14],[1,71,"Eucla",14]],[[1,11,"Chicago",9],[1,11,"Atikokan",9],[1,11,"Coral_Harbour",9],[1,11,"Fort_Wayne",9],[1,11,"Indianapolis",4],[1,11,"Knox",4],[1,11,"Marengo",4],[1,11,"Petersburg",4],[1,11,"Vevay",4],[1,11,"Vincennes",4],[1,11,"Winamac",4],[1,11,"Indianapolis",9],[1,11,"Louisville",6],[1,11,"Monticello",6],[1,11,"Knox_IN",9],[1,11,"Louisville",9],[1,11,"Menominee",9],[1,11,"Mexico_City",9],[1,11,"Rainy_River",9],[1,11,"Rankin_Inlet",9],[1,11,"Winnipeg",9],[1,11,"Central",16],[1,11,"CST6CDT"],[1,11,"General",20],[1,11,"Central"],[1,11,"East-Indiana"],[1,11,"Indiana-Starke"]],[[0,72,"Guam",21],[0,72,"Saipan",21]],[[0,57,"Dacca",12],[0,57,"Dhaka",12]],[[0,59,"Davis",10]],[[0,72,"DumontDUrville",10]],[[1,57,"Dushanbe",12],[1,59,"Dushanbe",12]],[[0,54,"Dushanbe",12],[0,57,"Dushanbe",12]],[[1,11,"EasterIsland",17],[1,9,"EasterIsland",17],[1,11,"Easter",21],[1,9,"Easter",21]],[[0,9,"EasterIsland",17],[0,8,"EasterIsland",17],[0,9,"Easter",21],[0,8,"Easter",21],[1,51,"Antananarivo",19]],[[0,47,"Khartoum"],[0,47,"Addis_Ababa"],[0,47,"Asmara"],[0,47,"Asmera"],[0,47,"Dar_es_Salaam"],[0,47,"Djibouti"],[0,47,"Kampala"],[0,47,"Mogadishu"],[0,47,"Nairobi"],[0,47,"Antananarivo",19],[0,47,"Comoro",19],[0,47,"Mayotte",19]],[[0,11,"Guayaquil",9],[0,11,"Galapagos",21]],[[1,22,"Iqaluit",9]],[[1,14,"New_York",9],[1,14,"Cancun",9],[1,14,"Detroit",9],[1,14,"Fort_Wayne",9],[1,14,"Grand_Turk",9],[1,14,"Indianapolis",4],[1,14,"Marengo",4],[1,14,"Vevay",4],[1,14,"Vincennes",4],[1,14,"Winamac",4],[1,14,"Indianapolis",9],[1,14,"Iqaluit",9],[1,14,"Jamaica",9],[1,14,"Louisville",6],[1,14,"Monticello",6],[1,14,"Louisville",9],[1,14,"Montreal",9],[1,14,"Nassau",9],[1,14,"Nipigon",9],[1,14,"Pangnirtung",9],[1,14,"Port-au-Prince",9],[1,14,"Santo_Domingo",9],[1,14,"Thunder_Bay",9],[1,14,"Toronto",9],[1,14,"Eastern",16],[1,14,"EST"],[1,14,"EST5EDT"],[1,14,"Jamaica"],[1,14,"East-Indiana"],[1,14,"Eastern"],[1,14,"Michigan"]],[[1,47,"Helsinki",18],[1,47,"Cairo"],[1,47,"Amman",12],[1,47,"Beirut",12],[1,47,"Damascus",12],[1,47,"Gaza",12],[1,47,"Istanbul",12],[1,47,"Nicosia",12],[1,47,"EET"],[1,47,"Egypt"],[1,47,"Athens",18],[1,47,"Bucharest",18],[1,47,"Chisinau",18],[1,47,"Istanbul",18],[1,47,"Kaliningrad",18],[1,47,"Kiev",18],[1,47,"Mariehamn",18],[1,47,"Minsk",18],[1,47,"Moscow",18],[1,47,"Nicosia",18],[1,47,"Riga",18],[1,47,"Simferopol",18],[1,47,"Sofia",18],[1,47,"Tallinn",18],[1,47,"Tiraspol",18],[1,47,"Uzhgorod",18],[1,47,"Vilnius",18],[1,47,"Warsaw",18],[1,47,"Zaporozhye",18],[1,47,"Poland"],[1,47,"Turkey"],[1,47,"W-SU"]],[[0,42,"Helsinki",18],[1,47,"Gaza",12],[0,42,"Cairo"],[0,42,"Tripoli"],[0,42,"Amman",12],[0,42,"Beirut",12],[0,42,"Damascus",12],[0,42,"Gaza",12],[0,42,"Istanbul",12],[0,42,"Nicosia",12],[0,42,"EET"],[0,42,"Egypt"],[0,42,"Athens",18],[0,42,"Bucharest",18],[0,42,"Chisinau",18],[0,42,"Istanbul",18],[0,42,"Kaliningrad",18],[0,42,"Kiev",18],[0,42,"Mariehamn",18],[0,42,"Minsk",18],[0,42,"Moscow",18],[0,42,"Nicosia",18],[0,42,"Riga",18],[0,42,"Simferopol",18],[0,42,"Sofia",18],[0,42,"Tallinn",18],[0,42,"Tiraspol",18],[0,42,"Uzhgorod",18],[0,42,"Vilnius",18],[0,42,"Warsaw",18],[0,42,"Zaporozhye",18],[0,42,"Libya"],[0,42,"Poland"],[0,42,"Turkey"],[0,42,"W-SU"]],[[1,31,"Scoresbysund",9]],[[0,28,"Scoresbysund",9]],[[1,13,"Santo_Domingo",9]],[[0,69,"Jayapura",12]],[[1,14,"New_York",9],[1,14,"Detroit",9],[1,14,"Iqaluit",9],[1,14,"Montreal",9],[1,14,"Nipigon",9],[1,14,"Thunder_Bay",9],[1,14,"Toronto",9],[1,14,"Eastern",16],[1,14,"EST"],[1,14,"EST5EDT"],[1,14,"Eastern"],[1,14,"Michigan"]],[[0,11,"New_York",9],[0,11,"Antigua",9],[0,11,"Atikokan",9],[0,11,"Cambridge_Bay",9],[0,11,"Cancun",9],[0,11,"Cayman",9],[0,11,"Chicago",9],[0,11,"Coral_Harbour",9],[0,11,"Detroit",9],[0,11,"Fort_Wayne",9],[0,11,"Grand_Turk",9],[0,11,"Indianapolis",4],[0,11,"Knox",4],[0,11,"Marengo",4],[0,11,"Petersburg",4],[0,11,"Vevay",4],[0,11,"Vincennes",4],[0,11,"Winamac",4],[0,11,"Indianapolis",9],[0,11,"Iqaluit",9],[0,11,"Jamaica",9],[0,11,"Louisville",6],[0,11,"Monticello",6],[0,11,"Knox_IN",9],[0,11,"Louisville",9],[0,11,"Managua",9],[0,11,"Menominee",9],[0,11,"Merida",9],[0,11,"Montreal",9],[0,11,"Nassau",9],[0,11,"Nipigon",9],[0,11,"Panama",9],[0,11,"Pangnirtung",9],[0,11,"Port-au-Prince",9],[0,11,"Rankin_Inlet",9],[0,11,"Santo_Domingo",9],[0,11,"Thunder_Bay",9],[0,11,"Toronto",9],[0,11,"Eastern",16],[0,11,"EST"],[0,11,"EST5EDT"],[0,11,"Jamaica"],[0,11,"Central"],[0,11,"East-Indiana"],[0,11,"Eastern"],[0,11,"Indiana-Starke"],[0,11,"Michigan"],[0,72,"ACT",14],[0,72,"Brisbane",14],[0,72,"Canberra",14],[0,72,"Currie",14],[0,72,"Hobart",14],[0,72,"Lindeman",14],[0,72,"Melbourne",14],[0,72,"NSW",14],[0,72,"Queensland",14],[0,72,"Sydney",14],[0,72,"Tasmania",14],[0,72,"Victoria",14],[1,74,"Melbourne",14],[1,74,"ACT",14],[1,74,"Brisbane",14],[1,74,"Canberra",14],[1,74,"Currie",14],[1,74,"Hobart",14],[1,74,"Lindeman",14],[1,74,"NSW",14],[1,74,"Queensland",14],[1,74,"Sydney",14],[1,74,"Tasmania",14],[1,74,"Victoria",14]],[[1,14,"New_York",9],[1,14,"Detroit",9],[1,14,"Iqaluit",9],[1,14,"Montreal",9],[1,14,"Nipigon",9],[1,14,"Thunder_Bay",9],[1,14,"Toronto",9],[1,14,"Eastern",16],[1,14,"EST"],[1,14,"EST5EDT"],[1,14,"Eastern"],[1,14,"Michigan"]],[[1,79,"Fiji",21]],[[0,76,"Fiji",21]],[[1,22,"Stanley",13],[1,25,"Stanley",13]],[[0,22,"Stanley",13],[0,14,"Stanley",13]],[[1,28,"Noronha",9],[1,28,"DeNoronha",15]],[[0,25,"Noronha",9],[0,25,"DeNoronha",15]],[[0,51,"Aqtau",12],[0,54,"Aqtau",12]],[[1,57,"Bishkek",12],[1,59,"Bishkek",12]],[[0,54,"Bishkek",12],[0,57,"Bishkek",12]],[[0,9,"Galapagos",21]],[[0,6,"Gambier",21]],[[0,16,"Guyana",9]],[[1,51,"Tbilisi",12],[1,54,"Tbilisi",12]],[[0,47,"Tbilisi",12],[0,51,"Tbilisi",12]],[[0,22,"Cayenne",9],[0,14,"Cayenne",9]],[[1,33,"Accra"]],[[0,31,"Abidjan"],[0,31,"Accra"],[0,31,"Bamako"],[0,31,"Banjul"],[0,31,"Bissau"],[0,31,"Conakry"],[0,31,"Dakar"],[0,31,"Freetown"],[0,31,"Malabo"],[0,31,"Monrovia"],[0,31,"Niamey"],[0,31,"Nouakchott"],[0,31,"Ouagadougou"],[0,31,"Porto-Novo"],[0,31,"Sao_Tome"],[0,31,"Timbuktu"],[0,31,"Danmarkshavn",9],[0,31,"Reykjavik",13],[0,31,"St_Helena",13],[0,31,"Eire"],[0,31,"Belfast",18],[0,31,"Dublin",18],[0,31,"Gibraltar",18],[0,31,"Guernsey",18],[0,31,"Isle_of_Man",18],[0,31,"Jersey",18],[0,31,"London",18],[0,31,"GB"],[0,31,"GB-Eire"],[0,31,"Iceland"]],[[0,51,"Dubai",12],[0,51,"Bahrain",12],[0,51,"Muscat",12],[0,51,"Qatar",12]],[[0,22,"Guyana",9],[0,16,"Guyana",9],[0,14,"Guyana",9]],[[1,6,"Adak",9],[1,6,"Atka",9],[1,6,"Aleutian"]],[[0,4,"Adak",9],[0,4,"Atka",9],[0,4,"Aleutian"]],[[1,5,"Honolulu",21],[1,5,"HST"],[1,5,"Hawaii"]],[[1,69,"Hong_Kong",12],[1,69,"Hongkong"]],[[0,65,"Hong_Kong",12],[0,65,"Hongkong"]],[[1,65,"Hovd",12]],[[0,57,"Hovd",12],[0,59,"Hovd",12]],[[1,5,"Honolulu",21],[1,5,"HST"],[1,5,"Hawaii"]],[[0,4,"Honolulu",21],[0,3,"Honolulu",21],[0,4,"HST"],[0,4,"Hawaii"],[0,3,"HST"],[0,3,"Hawaii"]],[[1,5,"Honolulu",21],[1,5,"HST"],[1,5,"Hawaii"]],[[0,59,"Bangkok",12],[0,59,"Phnom_Penh",12],[0,59,"Saigon",12],[0,59,"Vientiane",12],[0,65,"Phnom_Penh",12],[0,65,"Saigon",12],[0,65,"Vientiane",12]],[[1,51,"Jerusalem",12],[1,51,"Tel_Aviv",12],[1,51,"Israel"]],[[1,47,"Jerusalem",12],[1,47,"Gaza",12],[1,47,"Tel_Aviv",12],[1,47,"Israel"]],[[1,57,"Colombo",12]],[[0,54,"Chagos",19],[0,57,"Chagos",19]],[[1,52,"Tehran",12],[1,54,"Tehran",12],[1,52,"Iran"],[1,54,"Iran"]],[[1,65,"Irkutsk",12],[1,69,"Irkutsk",12]],[[0,59,"Irkutsk",12],[0,65,"Irkutsk",12]],[[0,49,"Tehran",12],[0,51,"Tehran",12],[0,49,"Iran"],[0,51,"Iran"]],[[1,31,"Reykjavik",13],[1,31,"Iceland"]],[[0,42,"Jerusalem",12],[0,28,"Reykjavik",13],[0,28,"Iceland"],[0,55,"Calcutta",12],[0,55,"Colombo",12],[0,55,"Dacca",12],[0,55,"Dhaka",12],[0,55,"Karachi",12],[0,55,"Katmandu",12],[0,55,"Thimbu",12],[0,55,"Thimphu",12],[1,34,"Eire"],[1,34,"Dublin",18],[1,58,"Calcutta",12],[1,58,"Colombo",12],[1,58,"Karachi",12],[0,35,"Eire"],[0,35,"Dublin",18],[1,35,"Eire"],[1,35,"Dublin",18],[0,42,"Gaza",12],[0,42,"Tel_Aviv",12],[0,42,"Israel"]],[[0,62,"Jakarta",12]],[[1,72,"Tokyo",12],[1,72,"Japan"]],[[0,69,"Tokyo",12],[0,69,"Dili",12],[0,69,"Jakarta",12],[0,69,"Kuala_Lumpur",12],[0,69,"Kuching",12],[0,69,"Makassar",12],[0,69,"Manila",12],[0,69,"Pontianak",12],[0,69,"Rangoon",12],[0,69,"Sakhalin",12],[0,69,"Singapore",12],[0,69,"Ujung_Pandang",12],[0,69,"Japan"],[0,69,"Nauru",21],[0,69,"Singapore"]],[[0,54,"Karachi",12]],[[0,54,"Kashgar",12],[0,55,"Kashgar",12]],[[1,69,"Seoul",12],[1,72,"Seoul",12],[1,69,"ROK"],[1,72,"ROK"]],[[1,57,"Bishkek",12]],[[0,54,"Bishkek",12],[0,57,"Bishkek",12]],[[1,57,"Qyzylorda",12]],[[0,51,"Qyzylorda",12],[0,54,"Qyzylorda",12],[0,57,"Qyzylorda",12]],[[0,38,"Vilnius",18]],[[0,74,"Kosrae",21],[0,76,"Kosrae",21]],[[1,59,"Krasnoyarsk",12],[1,65,"Krasnoyarsk",12]],[[0,57,"Krasnoyarsk",12],[0,59,"Krasnoyarsk",12]],[[0,65,"Seoul",12],[0,67,"Seoul",12],[0,69,"Seoul",12],[0,65,"Pyongyang",12],[0,65,"ROK"],[0,67,"Pyongyang",12],[0,67,"ROK"],[0,69,"Pyongyang",12],[0,69,"ROK"]],[[1,47,"Samara",18],[1,51,"Samara",18],[1,54,"Samara",18]],[[0,47,"Samara",18],[0,51,"Samara",18]],[[0,0,"Kwajalein",21],[0,0,"Kwajalein"]],[[0,73,"Lord_Howe",14],[1,74,"Lord_Howe",14],[1,75,"Lord_Howe",14],[0,73,"LHI",14],[1,74,"LHI",14],[1,75,"LHI",14]],[[0,4,"Kiritimati",21],[0,81,"Kiritimati",21]],[[0,57,"Colombo",12],[0,58,"Colombo",12]],[[0,59,"Chongqing",12],[0,59,"Chungking",12]],[[0,29,"Monrovia"]],[[1,45,"Riga",18]],[[1,35,"Madeira",13]],[[1,31,"Madeira",13]],[[0,28,"Madeira",13]],[[1,74,"Magadan",12],[1,76,"Magadan",12]],[[0,72,"Magadan",12],[0,74,"Magadan",12]],[[1,62,"Singapore",12],[1,62,"Kuala_Lumpur",12],[1,62,"Singapore"]],[[0,59,"Singapore",12],[0,62,"Singapore",12],[0,63,"Singapore",12],[0,59,"Kuala_Lumpur",12],[0,59,"Singapore"],[0,62,"Kuala_Lumpur",12],[0,62,"Singapore"],[0,63,"Kuala_Lumpur",12],[0,63,"Singapore"]],[[0,5,"Marquesas",21]],[[0,57,"Mawson",10]],[[1,11,"Cambridge_Bay",9],[1,11,"Yellowknife",9]],[[1,53,"Moscow",18],[1,53,"W-SU"]],[[1,9,"Denver",9],[1,9,"Boise",9],[1,9,"Cambridge_Bay",9],[1,9,"Chihuahua",9],[1,9,"Edmonton",9],[1,9,"Hermosillo",9],[1,9,"Inuvik",9],[1,9,"Mazatlan",9],[1,9,"Center",8],[1,9,"New_Salem",8],[1,9,"Phoenix",9],[1,9,"Regina",9],[1,9,"Shiprock",9],[1,9,"Swift_Current",9],[1,9,"Yellowknife",9],[1,9,"East-Saskatchewan",16],[1,9,"Mountain",16],[1,9,"Saskatchewan",16],[1,9,"BajaSur",20],[1,9,"MST"],[1,9,"MST7MDT"],[1,9,"Navajo"],[1,9,"Arizona"],[1,9,"Mountain"]],[[1,42,"MET"]],[[0,35,"MET"]],[[0,76,"Kwajalein",21],[0,76,"Kwajalein"],[0,76,"Majuro",21]],[[0,44,"Moscow",18],[0,58,"Rangoon",12],[0,64,"Makassar",12],[0,64,"Ujung_Pandang",12],[0,44,"W-SU"]],[[1,69,"Macao",12],[1,69,"Macau",12]],[[0,65,"Macao",12],[0,65,"Macau",12]],[[1,9,"Denver",9],[1,9,"Boise",9],[1,9,"Cambridge_Bay",9],[1,9,"Edmonton",9],[1,9,"Center",8],[1,9,"New_Salem",8],[1,9,"Regina",9],[1,9,"Shiprock",9],[1,9,"Swift_Current",9],[1,9,"Yellowknife",9],[1,9,"East-Saskatchewan",16],[1,9,"Mountain",16],[1,9,"Saskatchewan",16],[1,9,"MST"],[1,9,"MST7MDT"],[1,9,"Navajo"],[1,9,"Mountain"],[0,72,"Saipan",21]],[[1,51,"Moscow",18],[1,54,"Moscow",18],[1,51,"Chisinau",18],[1,51,"Kaliningrad",18],[1,51,"Kiev",18],[1,51,"Minsk",18],[1,51,"Riga",18],[1,51,"Simferopol",18],[1,51,"Tallinn",18],[1,51,"Tiraspol",18],[1,51,"Uzhgorod",18],[1,51,"Vilnius",18],[1,51,"Zaporozhye",18],[1,51,"W-SU"],[1,54,"W-SU"]],[[0,47,"Moscow",18],[0,47,"Chisinau",18],[0,47,"Kaliningrad",18],[0,47,"Kiev",18],[0,47,"Minsk",18],[0,47,"Riga",18],[0,47,"Simferopol",18],[0,47,"Tallinn",18],[0,47,"Tiraspol",18],[0,47,"Uzhgorod",18],[0,47,"Vilnius",18],[0,47,"Zaporozhye",18],[0,47,"W-SU"]],[[0,8,"Denver",9],[0,8,"Boise",9],[0,8,"Cambridge_Bay",9],[0,8,"Chihuahua",9],[0,8,"Dawson_Creek",9],[0,8,"Edmonton",9],[0,8,"Ensenada",9],[0,8,"Hermosillo",9],[0,8,"Inuvik",9],[0,8,"Mazatlan",9],[0,8,"Mexico_City",9],[0,8,"Center",8],[0,8,"New_Salem",8],[0,8,"Phoenix",9],[0,8,"Regina",9],[0,8,"Shiprock",9],[0,8,"Swift_Current",9],[0,8,"Tijuana",9],[0,8,"Yellowknife",9],[0,8,"East-Saskatchewan",16],[0,8,"Mountain",16],[0,8,"Saskatchewan",16],[0,8,"BajaNorte",20],[0,8,"BajaSur",20],[0,8,"General",20],[0,8,"MST"],[0,8,"MST7MDT"],[0,8,"Navajo"],[0,8,"Arizona"],[0,8,"Mountain"],[1,50,"Moscow",18],[1,50,"W-SU"]],[[0,51,"Mauritius",19]],[[0,54,"Maldives",19]],[[1,9,"Denver",9],[1,9,"Boise",9],[1,9,"Cambridge_Bay",9],[1,9,"Edmonton",9],[1,9,"Center",8],[1,9,"New_Salem",8],[1,9,"Phoenix",9],[1,9,"Regina",9],[1,9,"Shiprock",9],[1,9,"Swift_Current",9],[1,9,"Yellowknife",9],[1,9,"East-Saskatchewan",16],[1,9,"Mountain",16],[1,9,"Saskatchewan",16],[1,9,"MST"],[1,9,"MST7MDT"],[1,9,"Navajo"],[1,9,"Arizona"],[1,9,"Mountain"]],[[0,65,"Kuala_Lumpur",12],[0,65,"Kuching",12]],[[1,76,"Noumea",21]],[[0,74,"Noumea",21]],[[1,26,"St_Johns",9],[1,26,"Newfoundland",16]],[[1,24,"St_Johns",9],[1,23,"St_Johns",9],[1,4,"Midway",21],[1,24,"Goose_Bay",9],[1,24,"Newfoundland",16],[1,23,"Goose_Bay",9],[1,23,"Newfoundland",16]],[[0,21,"Paramaribo",9]],[[1,37,"Amsterdam",18]],[[0,33,"Amsterdam",18]],[[0,75,"Norfolk",21]],[[1,59,"Novosibirsk",12],[1,65,"Novosibirsk",12]],[[0,57,"Novosibirsk",12],[0,59,"Novosibirsk",12]],[[1,24,"St_Johns",9],[1,4,"Adak",9],[1,4,"Atka",9],[1,4,"Nome",9],[1,4,"Aleutian"],[1,24,"Goose_Bay",9],[1,24,"Newfoundland",16],[0,56,"Katmandu",12]],[[0,75,"Nauru",21],[0,76,"Nauru",21]],[[0,21,"St_Johns",9],[0,20,"St_Johns",9],[0,21,"Goose_Bay",9],[0,21,"Newfoundland",16],[0,20,"Goose_Bay",9],[0,20,"Newfoundland",16],[0,2,"Adak",9],[0,2,"Atka",9],[0,2,"Nome",9],[0,2,"Midway",21],[0,2,"Pago_Pago",21],[0,2,"Samoa",21],[0,2,"Aleutian"],[0,2,"Samoa"],[1,36,"Amsterdam",18]],[[0,2,"Niue",21],[0,1,"Niue",21]],[[1,24,"St_Johns",9],[1,4,"Adak",9],[1,4,"Atka",9],[1,4,"Nome",9],[1,4,"Aleutian"],[1,24,"Goose_Bay",9],[1,24,"Newfoundland",16]],[[1,79,"Auckland",21],[1,79,"McMurdo",10],[1,79,"South_Pole",10],[1,79,"NZ"]],[[0,75,"Auckland",21],[0,75,"NZ"]],[[0,76,"Auckland",21],[1,76,"Auckland",21],[1,77,"Auckland",21],[0,76,"McMurdo",10],[0,76,"South_Pole",10],[0,76,"NZ"],[1,76,"NZ"],[1,77,"NZ"]],[[1,57,"Omsk",12],[1,59,"Omsk",12]],[[0,54,"Omsk",12],[0,57,"Omsk",12]],[[1,54,"Oral",12]],[[0,51,"Oral",12],[0,54,"Oral",12]],[[1,9,"Inuvik",9]],[[1,8,"Los_Angeles",9],[1,8,"Boise",9],[1,8,"Dawson",9],[1,8,"Dawson_Creek",9],[1,8,"Ensenada",9],[1,8,"Inuvik",9],[1,8,"Juneau",9],[1,8,"Tijuana",9],[1,8,"Vancouver",9],[1,8,"Whitehorse",9],[1,8,"Pacific",16],[1,8,"Yukon",16],[1,8,"BajaNorte",20],[1,8,"PST8PDT"],[1,8,"Pacific"],[1,8,"Pacific-New"]],[[1,14,"Lima",9]],[[1,76,"Kamchatka",12],[1,79,"Kamchatka",12]],[[0,74,"Kamchatka",12],[0,76,"Kamchatka",12]],[[0,11,"Lima",9]],[[0,2,"Enderbury",21],[0,79,"Enderbury",21]],[[1,69,"Manila",12]],[[0,65,"Manila",12]],[[1,57,"Karachi",12]],[[0,54,"Karachi",12]],[[1,25,"Miquelon",9]],[[0,22,"Miquelon",9]],[[0,18,"Paramaribo",9],[0,17,"Paramaribo",9],[0,61,"Pontianak",12],[0,72,"DumontDUrville",10]],[[1,8,"Los_Angeles",9],[1,8,"Dawson_Creek",9],[1,8,"Ensenada",9],[1,8,"Inuvik",9],[1,8,"Juneau",9],[1,8,"Tijuana",9],[1,8,"Vancouver",9],[1,8,"Pacific",16],[1,8,"BajaNorte",20],[1,8,"PST8PDT"],[1,8,"Pacific"],[1,8,"Pacific-New"]],[[0,7,"Los_Angeles",9],[0,7,"Boise",9],[0,7,"Dawson",9],[0,7,"Dawson_Creek",9],[0,7,"Ensenada",9],[0,7,"Hermosillo",9],[0,7,"Inuvik",9],[0,7,"Juneau",9],[0,7,"Mazatlan",9],[0,7,"Tijuana",9],[0,7,"Vancouver",9],[0,7,"Whitehorse",9],[0,7,"Pacific",16],[0,7,"Yukon",16],[0,7,"BajaNorte",20],[0,7,"BajaSur",20],[0,7,"Pitcairn",21],[0,7,"PST8PDT"],[0,7,"Pacific"],[0,7,"Pacific-New"]],[[1,8,"Los_Angeles",9],[1,8,"Dawson_Creek",9],[1,8,"Ensenada",9],[1,8,"Inuvik",9],[1,8,"Juneau",9],[1,8,"Tijuana",9],[1,8,"Vancouver",9],[1,8,"Pacific",16],[1,8,"BajaNorte",20],[1,8,"PST8PDT"],[1,8,"Pacific"],[1,8,"Pacific-New"]],[[1,22,"Asuncion",9]],[[0,22,"Asuncion",9],[0,14,"Asuncion",9]],[[1,59,"Qyzylorda",12]],[[0,54,"Qyzylorda",12],[0,57,"Qyzylorda",12]],[[0,51,"Reunion",19]],[[0,39,"Riga",18]],[[0,22,"Rothera",10]],[[1,74,"Sakhalin",12],[1,76,"Sakhalin",12]],[[0,72,"Sakhalin",12],[0,74,"Sakhalin",12]],[[1,57,"Samarkand",12],[1,54,"Samara",18]],[[0,51,"Samarkand",12],[0,54,"Samarkand",12],[0,1,"Apia",21],[0,1,"Pago_Pago",21],[0,1,"Samoa",21],[0,1,"Samoa"],[0,47,"Samara",18],[0,51,"Samara",18]],[[1,47,"Johannesburg"],[0,42,"Johannesburg"],[1,47,"Maseru"],[1,47,"Windhoek"],[0,42,"Maseru"],[0,42,"Mbabane"],[0,42,"Windhoek"]],[[0,74,"Guadalcanal",21]],[[0,51,"Mahe",19]],[[0,63,"Singapore",12],[0,65,"Singapore",12],[0,63,"Singapore"],[0,65,"Singapore"]],[[1,57,"Aqtau",12]],[[0,54,"Aqtau",12],[0,57,"Aqtau",12]],[[1,30,"Freetown"],[1,35,"Freetown"]],[[0,60,"Saigon",12],[0,12,"Santiago",9],[0,12,"Continental",17],[0,60,"Phnom_Penh",12],[0,60,"Vientiane",12]],[[0,22,"Paramaribo",9],[0,21,"Paramaribo",9]],[[0,2,"Samoa",21],[0,2,"Midway",21],[0,2,"Pago_Pago",21],[0,2,"Samoa"]],[[0,47,"Volgograd",18],[0,51,"Volgograd",18]],[[1,54,"Yekaterinburg",12],[1,57,"Yekaterinburg",12]],[[0,51,"Yekaterinburg",12],[0,54,"Yekaterinburg",12]],[[0,47,"Syowa",10]],[[0,4,"Tahiti",21]],[[1,59,"Samarkand",12],[1,57,"Tashkent",12],[1,59,"Tashkent",12]],[[0,57,"Samarkand",12],[0,54,"Tashkent",12],[0,57,"Tashkent",12]],[[1,51,"Tbilisi",12],[1,54,"Tbilisi",12]],[[0,47,"Tbilisi",12],[0,51,"Tbilisi",12]],[[0,54,"Kerguelen",19]],[[0,54,"Dushanbe",12]],[[0,65,"Dili",12],[0,69,"Dili",12]],[[0,48,"Tehran",12],[0,48,"Iran"],[0,51,"Ashgabat",12],[0,51,"Ashkhabad",12],[0,54,"Ashgabat",12],[0,54,"Ashkhabad",12],[0,40,"Tallinn",18]],[[1,81,"Tongatapu",21]],[[0,79,"Tongatapu",21]],[[1,51,"Istanbul",18],[1,51,"Istanbul",12],[1,51,"Turkey"]],[[0,47,"Istanbul",18],[0,47,"Istanbul",12],[0,47,"Turkey"]],[[0,47,"Volgograd",18]],[[1,69,"Ulaanbaatar",12],[1,69,"Ulan_Bator",12]],[[0,59,"Ulaanbaatar",12],[0,65,"Ulaanbaatar",12],[0,59,"Choibalsan",12],[0,59,"Ulan_Bator",12],[0,65,"Choibalsan",12],[0,65,"Ulan_Bator",12]],[[1,54,"Oral",12],[1,57,"Oral",12]],[[0,51,"Oral",12],[0,54,"Oral",12],[0,57,"Oral",12]],[[0,57,"Urumqi",12]],[[1,22,"Montevideo",9],[1,24,"Montevideo",9]],[[1,25,"Montevideo",9]],[[0,22,"Montevideo",9],[0,21,"Montevideo",9]],[[1,57,"Samarkand",12],[1,57,"Tashkent",12]],[[0,54,"Samarkand",12],[0,54,"Tashkent",12]],[[0,14,"Caracas",9],[0,13,"Caracas",9]],[[1,72,"Vladivostok",12]],[[0,69,"Vladivostok",12],[1,74,"Vladivostok",12]],[[0,69,"Vladivostok",12],[0,72,"Vladivostok",12]],[[1,51,"Volgograd",18],[1,54,"Volgograd",18]],[[0,47,"Volgograd",18],[0,51,"Volgograd",18]],[[0,57,"Vostok",10]],[[1,76,"Efate",21]],[[0,74,"Efate",21]],[[1,22,"Mendoza",9],[1,22,"Jujuy",2],[1,22,"Mendoza",2],[1,22,"Jujuy",9]],[[0,14,"Mendoza",9],[0,14,"Catamarca",2],[0,14,"ComodRivadavia",2],[0,14,"Cordoba",2],[0,14,"Jujuy",2],[0,14,"La_Rioja",2],[0,14,"Mendoza",2],[0,14,"Rio_Gallegos",2],[0,14,"San_Juan",2],[0,14,"Tucuman",2],[0,14,"Ushuaia",2],[0,14,"Catamarca",9],[0,14,"Cordoba",9],[0,14,"Jujuy",9],[0,14,"Rosario",9]],[[1,42,"Windhoek"],[1,42,"Ndjamena"]],[[0,28,"Dakar"],[0,28,"Bamako"],[0,28,"Banjul"],[0,28,"Bissau"],[0,28,"Conakry"],[0,28,"El_Aaiun"],[0,28,"Freetown"],[0,28,"Niamey"],[0,28,"Nouakchott"],[0,28,"Timbuktu"],[0,31,"Freetown"],[0,35,"Brazzaville"],[0,35,"Bangui"],[0,35,"Douala"],[0,35,"Lagos"],[0,35,"Libreville"],[0,35,"Luanda"],[0,35,"Malabo"],[0,35,"Ndjamena"],[0,35,"Niamey"],[0,35,"Porto-Novo"],[0,35,"Windhoek"]],[[1,42,"Lisbon",18],[1,42,"Madrid",18],[1,42,"Monaco",18],[1,42,"Paris",18],[1,42,"Portugal"],[1,42,"WET"]],[[1,35,"Paris",18],[1,35,"Algiers"],[1,35,"Casablanca"],[1,35,"Ceuta"],[1,35,"Canary",13],[1,35,"Faeroe",13],[1,35,"Faroe",13],[1,35,"Madeira",13],[1,35,"Brussels",18],[1,35,"Lisbon",18],[1,35,"Luxembourg",18],[1,35,"Madrid",18],[1,35,"Monaco",18],[1,35,"Portugal"],[1,35,"WET"],[1,42,"Luxembourg",18]],[[0,31,"Paris",18],[0,31,"Algiers"],[0,31,"Casablanca"],[0,31,"Ceuta"],[0,31,"El_Aaiun"],[0,31,"Azores",13],[0,31,"Canary",13],[0,31,"Faeroe",13],[0,31,"Faroe",13],[0,31,"Madeira",13],[0,31,"Brussels",18],[0,31,"Lisbon",18],[0,31,"Luxembourg",18],[0,31,"Madrid",18],[0,31,"Monaco",18],[0,31,"Portugal"],[0,31,"WET"],[0,35,"Luxembourg",18]],[[1,25,"Godthab",9],[1,25,"Danmarkshavn",9]],[[0,22,"Godthab",9],[0,22,"Danmarkshavn",9]],[[0,59,"Jakarta",12],[0,63,"Jakarta",12],[0,65,"Jakarta",12],[0,59,"Pontianak",12],[0,63,"Pontianak",12],[0,65,"Pontianak",12]],[[0,65,"Perth",14],[1,69,"Perth",14],[0,2,"Apia",21],[0,65,"Casey",10],[0,65,"West",14],[1,69,"West",14]],[[1,69,"Yakutsk",12],[1,72,"Yakutsk",12]],[[0,65,"Yakutsk",12],[0,69,"Yakutsk",12]],[[1,8,"Dawson",9],[1,8,"Whitehorse",9],[1,8,"Yukon",16]],[[1,7,"Dawson",9],[1,7,"Whitehorse",9],[1,7,"Yakutat",9],[1,7,"Yukon",16]],[[1,57,"Yekaterinburg",12]],[[0,54,"Yekaterinburg",12]],[[1,51,"Yerevan",12],[1,54,"Yerevan",12]],[[0,47,"Yerevan",12],[0,51,"Yerevan",12]],[[1,7,"Dawson",9],[1,7,"Whitehorse",9],[1,7,"Yakutat",9],[1,7,"Yukon",16]],[[0,6,"Anchorage",9],[0,6,"Dawson",9],[0,6,"Juneau",9],[0,6,"Nome",9],[0,6,"Whitehorse",9],[0,6,"Yakutat",9],[0,6,"Yukon",16],[0,6,"Alaska"]],[[1,7,"Dawson",9],[1,7,"Whitehorse",9],[1,7,"Yakutat",9],[1,7,"Yukon",16]],[[0,35]],[[0,42]],[[0,47]],[[0,51]],[[0,54]],[[0,57]],[[0,59]],[[0,65]],[[0,69]],[[0,72]],[[0,74]],[[0,76]],[[0,28]],[[0,25]],[[0,22]],[[0,14]],[[0,11]],[[0,9]],[[0,8]],[[0,31,"UTC"]],[[0,7]],[[0,6]],[[0,4]],[[0,2]],[[0,0]],[[0,31,"Davis",10],[0,31,"DumontDUrville",10]],[[0,31]]];}
if(!php_js_shared.tz_abbreviations){php_js_shared.tz_abbreviations=["acst","act","addt","adt","aft","ahdt","ahst","akdt","akst","aktst","aktt","almst","almt","amst","amt","anast","anat","ant","apt","aqtst","aqtt","arst","art","ashst","asht","ast","awt","azomt","azost","azot","azst","azt","bakst","bakt","bdst","bdt","beat","beaut","bmt","bnt","bortst","bort","bost","bot","brst","brt","bst","btt","burt","cant","capt","cast","cat","cawt","cddt","cdt","cemt","cest","cet","cgst","cgt","chadt","chast","chat","chdt","chost","chot","cit","cjt","ckhst","ckt","clst","clt","cost","cot","cpt","cst","cvst","cvt","cwst","cwt","chst","dact","davt","ddut","dusst","dust","easst","east","eat","ect","eddt","edt","eest","eet","egst","egt","ehdt","eit","ept","est","ewt","fjst","fjt","fkst","fkt","fnst","fnt","fort","frust","frut","galt","gamt","gbgt","gest","get","gft","ghst","gmt","gst","gyt","hadt","hast","hdt","hkst","hkt","hovst","hovt","hpt","hst","hwt","ict","iddt","idt","ihst","iot","irdt","irkst","irkt","irst","isst","ist","javt","jdt","jst","kart","kast","kdt","kgst","kgt","kizst","kizt","kmt","kost","krast","krat","kst","kuyst","kuyt","kwat","lhst","lint","lkt","lont","lrt","lst","madmt","madst","madt","magst","magt","malst","malt","mart","mawt","mddt","mdst","mdt","mest","met","mht","mmt","most","mot","mpt","msd","msk","mst","mut","mvt","mwt","myt","ncst","nct","nddt","ndt","negt","nest","net","nft","novst","novt","npt","nrt","nst","nut","nwt","nzdt","nzmt","nzst","omsst","omst","orast","orat","pddt","pdt","pest","petst","pett","pet","phot","phst","pht","pkst","pkt","pmdt","pmst","pmt","ppt","pst","pwt","pyst","pyt","qyzst","qyzt","ret","rmt","rott","sakst","sakt","samst","samt","sast","sbt","sct","sgt","shest","shet","slst","smt","srt","sst","stat","svest","svet","syot","taht","tasst","tast","tbist","tbit","tft","tjt","tlt","tmt","tost","tot","trst","trt","tsat","ulast","ulat","urast","urat","urut","uyhst","uyst","uyt","uzst","uzt","vet","vlasst","vlast","vlat","volst","volt","vost","vust","vut","warst","wart","wast","wat","wemt","west","wet","wgst","wgt","wit","wst","yakst","yakt","yddt","ydt","yekst","yekt","yerst","yert","ypt","yst","ywt","a","b","c","d","e","f","g","h","i","k","l","m","n","o","p","q","r","s","t","utc","u","v","w","x","y","zzz","z"];}
if(!php_js_shared.tz_offsets){php_js_shared.tz_offsets=[-43200,-41400,-39600,-37800,-36000,-34200,-32400,-28800,-25200,-21600,-19800,-18000,-16966,-16200,-14400,-14308,-13500,-13252,-13236,-12756,-12652,-12600,-10800,-9052,-9000,-7200,-5400,-3996,-3600,-2670,-1200,0,1172,1200,2079,3600,4772,4800,5736,5784,5940,6264,7200,9000,9048,9384,9885,10800,12344,12600,12648,14400,16200,16248,18000,19800,20700,21600,23400,25200,25580,26240,26400,27000,28656,28800,30000,30600,31500,32400,34200,35100,36000,37800,39600,41400,43200,45000,45900,46800,49500,50400];}
if(!php_js_shared.tz_prefixes){php_js_shared.tz_prefixes=['Africa','America','America/Argentina','America','America/Indiana','America','America/Kentucky','America','America/North_Dakota','America','Antarctica','Arctic','Asia','Atlantic','Australia','Brazil','Canada','Chile','Europe','Indian','Mexico','Pacific'];}
for(i=0,len=php_js_shared.tz_abbrs.length;i<len;i++){indice=php_js_shared.tz_abbreviations[i];curr=php_js_shared.tz_abbrs[i];list[indice]=[];for(j=0,jlen=curr.length;j<jlen;j++){currSub=curr[j];currSubPrefix=(currSub[3]?php_js_shared.tz_prefixes[currSub[3]]+'/':'');timezone_id=currSub[2]?(currSubPrefix+currSub[2]):null;list[indice].push({'dst':!!currSub[0],'offset':php_js_shared.tz_offsets[currSub[1]],'timezone_id':timezone_id});}}
return list;}
function timezone_identifiers_list(what,country){var i=0,new_what='',returnArr=[],continents=[],codes=[],indexOf=function(value){for(var i=0,length=this.length;i<length;i++){if(this[i]===value){return i;}}
return-1;},identifiers=['Africa/Abidjan','Africa/Accra','Africa/Addis_Ababa','Africa/Algiers','Africa/Asmara','Africa/Asmera','Africa/Bamako','Africa/Bangui','Africa/Banjul','Africa/Bissau','Africa/Blantyre','Africa/Brazzaville','Africa/Bujumbura','Africa/Cairo','Africa/Casablanca','Africa/Ceuta','Africa/Conakry','Africa/Dakar','Africa/Dar_es_Salaam','Africa/Djibouti','Africa/Douala','Africa/El_Aaiun','Africa/Freetown','Africa/Gaborone','Africa/Harare','Africa/Johannesburg','Africa/Kampala','Africa/Khartoum','Africa/Kigali','Africa/Kinshasa','Africa/Lagos','Africa/Libreville','Africa/Lome','Africa/Luanda','Africa/Lubumbashi','Africa/Lusaka','Africa/Malabo','Africa/Maputo','Africa/Maseru','Africa/Mbabane','Africa/Mogadishu','Africa/Monrovia','Africa/Nairobi','Africa/Ndjamena','Africa/Niamey','Africa/Nouakchott','Africa/Ouagadougou','Africa/Porto-Novo','Africa/Sao_Tome','Africa/Timbuktu','Africa/Tripoli','Africa/Tunis','Africa/Windhoek','America/Adak','America/Anchorage','America/Anguilla','America/Antigua','America/Araguaina','America/Argentina/Buenos_Aires','America/Argentina/Catamarca','America/Argentina/ComodRivadavia','America/Argentina/Cordoba','America/Argentina/Jujuy','America/Argentina/La_Rioja','America/Argentina/Mendoza','America/Argentina/Rio_Gallegos','America/Argentina/San_Juan','America/Argentina/San_Luis','America/Argentina/Tucuman','America/Argentina/Ushuaia','America/Aruba','America/Asuncion','America/Atikokan','America/Atka','America/Bahia','America/Barbados','America/Belem','America/Belize','America/Blanc-Sablon','America/Boa_Vista','America/Bogota','America/Boise','America/Buenos_Aires','America/Cambridge_Bay','America/Campo_Grande','America/Cancun','America/Caracas','America/Catamarca','America/Cayenne','America/Cayman','America/Chicago','America/Chihuahua','America/Coral_Harbour','America/Cordoba','America/Costa_Rica','America/Cuiaba','America/Curacao','America/Danmarkshavn','America/Dawson','America/Dawson_Creek','America/Denver','America/Detroit','America/Dominica','America/Edmonton','America/Eirunepe','America/El_Salvador','America/Ensenada','America/Fort_Wayne','America/Fortaleza','America/Glace_Bay','America/Godthab','America/Goose_Bay','America/Grand_Turk','America/Grenada','America/Guadeloupe','America/Guatemala','America/Guayaquil','America/Guyana','America/Halifax','America/Havana','America/Hermosillo','America/Indiana/Indianapolis','America/Indiana/Knox','America/Indiana/Marengo','America/Indiana/Petersburg','America/Indiana/Tell_City','America/Indiana/Vevay','America/Indiana/Vincennes','America/Indiana/Winamac','America/Indianapolis','America/Inuvik','America/Iqaluit','America/Jamaica','America/Jujuy','America/Juneau','America/Kentucky/Louisville','America/Kentucky/Monticello','America/Knox_IN','America/La_Paz','America/Lima','America/Los_Angeles','America/Louisville','America/Maceio','America/Managua','America/Manaus','America/Marigot','America/Martinique','America/Mazatlan','America/Mendoza','America/Menominee','America/Merida','America/Mexico_City','America/Miquelon','America/Moncton','America/Monterrey','America/Montevideo','America/Montreal','America/Montserrat','America/Nassau','America/New_York','America/Nipigon','America/Nome','America/Noronha','America/North_Dakota/Center','America/North_Dakota/New_Salem','America/Panama','America/Pangnirtung','America/Paramaribo','America/Phoenix','America/Port-au-Prince','America/Port_of_Spain','America/Porto_Acre','America/Porto_Velho','America/Puerto_Rico','America/Rainy_River','America/Rankin_Inlet','America/Recife','America/Regina','America/Resolute','America/Rio_Branco','America/Rosario','America/Santiago','America/Santo_Domingo','America/Sao_Paulo','America/Scoresbysund','America/Shiprock','America/St_Barthelemy','America/St_Johns','America/St_Kitts','America/St_Lucia','America/St_Thomas','America/St_Vincent','America/Swift_Current','America/Tegucigalpa','America/Thule','America/Thunder_Bay','America/Tijuana','America/Toronto','America/Tortola','America/Vancouver','America/Virgin','America/Whitehorse','America/Winnipeg','America/Yakutat','America/Yellowknife','Antarctica/Casey','Antarctica/Davis','Antarctica/DumontDUrville','Antarctica/Mawson','Antarctica/McMurdo','Antarctica/Palmer','Antarctica/Rothera','Antarctica/South_Pole','Antarctica/Syowa','Antarctica/Vostok','Arctic/Longyearbyen','Asia/Aden','Asia/Almaty','Asia/Amman','Asia/Anadyr','Asia/Aqtau','Asia/Aqtobe','Asia/Ashgabat','Asia/Ashkhabad','Asia/Baghdad','Asia/Bahrain','Asia/Baku','Asia/Bangkok','Asia/Beirut','Asia/Bishkek','Asia/Brunei','Asia/Calcutta','Asia/Choibalsan','Asia/Chongqing','Asia/Chungking','Asia/Colombo','Asia/Dacca','Asia/Damascus','Asia/Dhaka','Asia/Dili','Asia/Dubai','Asia/Dushanbe','Asia/Gaza','Asia/Harbin','Asia/Ho_Chi_Minh','Asia/Hong_Kong','Asia/Hovd','Asia/Irkutsk','Asia/Istanbul','Asia/Jakarta','Asia/Jayapura','Asia/Jerusalem','Asia/Kabul','Asia/Kamchatka','Asia/Karachi','Asia/Kashgar','Asia/Katmandu','Asia/Kolkata','Asia/Krasnoyarsk','Asia/Kuala_Lumpur','Asia/Kuching','Asia/Kuwait','Asia/Macao','Asia/Macau','Asia/Magadan','Asia/Makassar','Asia/Manila','Asia/Muscat','Asia/Nicosia','Asia/Novosibirsk','Asia/Omsk','Asia/Oral','Asia/Phnom_Penh','Asia/Pontianak','Asia/Pyongyang','Asia/Qatar','Asia/Qyzylorda','Asia/Rangoon','Asia/Riyadh','Asia/Saigon','Asia/Sakhalin','Asia/Samarkand','Asia/Seoul','Asia/Shanghai','Asia/Singapore','Asia/Taipei','Asia/Tashkent','Asia/Tbilisi','Asia/Tehran','Asia/Tel_Aviv','Asia/Thimbu','Asia/Thimphu','Asia/Tokyo','Asia/Ujung_Pandang','Asia/Ulaanbaatar','Asia/Ulan_Bator','Asia/Urumqi','Asia/Vientiane','Asia/Vladivostok','Asia/Yakutsk','Asia/Yekaterinburg','Asia/Yerevan','Atlantic/Azores','Atlantic/Bermuda','Atlantic/Canary','Atlantic/Cape_Verde','Atlantic/Faeroe','Atlantic/Faroe','Atlantic/Jan_Mayen','Atlantic/Madeira','Atlantic/Reykjavik','Atlantic/South_Georgia','Atlantic/St_Helena','Atlantic/Stanley','Australia/ACT','Australia/Adelaide','Australia/Brisbane','Australia/Broken_Hill','Australia/Canberra','Australia/Currie','Australia/Darwin','Australia/Eucla','Australia/Hobart','Australia/LHI','Australia/Lindeman','Australia/Lord_Howe','Australia/Melbourne','Australia/North','Australia/NSW','Australia/Perth','Australia/Queensland','Australia/South','Australia/Sydney','Australia/Tasmania','Australia/Victoria','Australia/West','Australia/Yancowinna','Brazil/Acre','Brazil/DeNoronha','Brazil/East','Brazil/West','Canada/Atlantic','Canada/Central','Canada/East-Saskatchewan','Canada/Eastern','Canada/Mountain','Canada/Newfoundland','Canada/Pacific','Canada/Saskatchewan','Canada/Yukon','CET','Chile/Continental','Chile/EasterIsland','CST6CDT','Cuba','EET','Egypt','Eire','EST','EST5EDT','Etc/GMT','Etc/GMT+0','Etc/GMT+1','Etc/GMT+10','Etc/GMT+11','Etc/GMT+12','Etc/GMT+2','Etc/GMT+3','Etc/GMT+4','Etc/GMT+5','Etc/GMT+6','Etc/GMT+7','Etc/GMT+8','Etc/GMT+9','Etc/GMT-0','Etc/GMT-1','Etc/GMT-10','Etc/GMT-11','Etc/GMT-12','Etc/GMT-13','Etc/GMT-14','Etc/GMT-2','Etc/GMT-3','Etc/GMT-4','Etc/GMT-5','Etc/GMT-6','Etc/GMT-7','Etc/GMT-8','Etc/GMT-9','Etc/GMT0','Etc/Greenwich','Etc/UCT','Etc/Universal','Etc/UTC','Etc/Zulu','Europe/Amsterdam','Europe/Andorra','Europe/Athens','Europe/Belfast','Europe/Belgrade','Europe/Berlin','Europe/Bratislava','Europe/Brussels','Europe/Bucharest','Europe/Budapest','Europe/Chisinau','Europe/Copenhagen','Europe/Dublin','Europe/Gibraltar','Europe/Guernsey','Europe/Helsinki','Europe/Isle_of_Man','Europe/Istanbul','Europe/Jersey','Europe/Kaliningrad','Europe/Kiev','Europe/Lisbon','Europe/Ljubljana','Europe/London','Europe/Luxembourg','Europe/Madrid','Europe/Malta','Europe/Mariehamn','Europe/Minsk','Europe/Monaco','Europe/Moscow','Europe/Nicosia','Europe/Oslo','Europe/Paris','Europe/Podgorica','Europe/Prague','Europe/Riga','Europe/Rome','Europe/Samara','Europe/San_Marino','Europe/Sarajevo','Europe/Simferopol','Europe/Skopje','Europe/Sofia','Europe/Stockholm','Europe/Tallinn','Europe/Tirane','Europe/Tiraspol','Europe/Uzhgorod','Europe/Vaduz','Europe/Vatican','Europe/Vienna','Europe/Vilnius','Europe/Volgograd','Europe/Warsaw','Europe/Zagreb','Europe/Zaporozhye','Europe/Zurich','Factory','GB','GB-Eire','GMT','GMT+0','GMT-0','GMT0','Greenwich','Hongkong','HST','Iceland','Indian/Antananarivo','Indian/Chagos','Indian/Christmas','Indian/Cocos','Indian/Comoro','Indian/Kerguelen','Indian/Mahe','Indian/Maldives','Indian/Mauritius','Indian/Mayotte','Indian/Reunion','Iran','Israel','Jamaica','Japan','Kwajalein','Libya','MET','Mexico/BajaNorte','Mexico/BajaSur','Mexico/General','MST','MST7MDT','Navajo','NZ','NZ-CHAT','Pacific/Apia','Pacific/Auckland','Pacific/Chatham','Pacific/Easter','Pacific/Efate','Pacific/Enderbury','Pacific/Fakaofo','Pacific/Fiji','Pacific/Funafuti','Pacific/Galapagos','Pacific/Gambier','Pacific/Guadalcanal','Pacific/Guam','Pacific/Honolulu','Pacific/Johnston','Pacific/Kiritimati','Pacific/Kosrae','Pacific/Kwajalein','Pacific/Majuro','Pacific/Marquesas','Pacific/Midway','Pacific/Nauru','Pacific/Niue','Pacific/Norfolk','Pacific/Noumea','Pacific/Pago_Pago','Pacific/Palau','Pacific/Pitcairn','Pacific/Ponape','Pacific/Port_Moresby','Pacific/Rarotonga','Pacific/Saipan','Pacific/Samoa','Pacific/Tahiti','Pacific/Tarawa','Pacific/Tongatapu','Pacific/Truk','Pacific/Wake','Pacific/Wallis','Pacific/Yap','Poland','Portugal','PRC','PST8PDT','ROC','ROK','Singapore','Turkey','UCT','Universal','US/Alaska','US/Aleutian','US/Arizona','US/Central','US/East-Indiana','US/Eastern','US/Hawaii','US/Indiana-Starke','US/Michigan','US/Mountain','US/Pacific','US/Pacific-New','US/Samoa','UTC','W-SU','WET','Zulu'];continents=['AFRICA','AMERICA','ANTARCTICA','ARCTIC','ASIA','ATLANTIC','AUSTRALIA','EUROPE','INDIAN','PACIFIC'];codes=[1,2,4,8,16,32,64,128,256,512];if(!codes.indexOf){codes.indexOf=indexOf;}
if(!continents.indexOf){continents.indexOf=indexOf;}
if(what){if(codes.indexOf(what)!==-1||continents.indexOf(what)!==-1){if(what&&what===parseInt(what,10)+''){new_what=continents[codes.indexOf(what)];}
if(what){new_what=what[0]+what.slice(1).toLowerCase();}
for(i=0;i<identifiers.length;i++){if(identifiers[i].indexOf(new_what+'/')!==-1){returnArr.push(identifiers[i]);}}
return returnArr;}else if(what==='UTC'||what===1024){throw'Unknown implementation';}else if(what==='ALL_WITH_BC'||what===4095){throw'Unknown implementation';}else if(what==='PER_COUNTRY'||what===4096){throw'Unknown implementation';}else if(what==='ALL'||what===2047){return identifiers;}}
return identifiers;}
function trigger_error(error_msg,error_type){var type=0,i=0,that=this,prepend='',append='';if(!error_type){error_type='E_USER_NOTICE';}
var ini_on=function(ini){return that.php_js.ini[ini]&&that.php_js.ini[ini].local_value&&((that.php_js.ini[ini].local_value.toString&&that.php_js.ini[ini].local_value.toString().toLowerCase&&(that.php_js.ini[ini].local_value.toString().toLowerCase()==='on'||that.php_js.ini[ini].local_value.toString().toLowerCase()==='true'))||parseInt(that.php_js.ini[ini].local_value,10)===1);};var display_errors=function(type){return that.php_js.ini.error_reporting&&(type&that.php_js.ini.error_reporting.local_value)&&ini_on('display_errors');};var TYPES={E_ERROR:1,E_WARNING:2,E_PARSE:4,E_NOTICE:8,E_CORE_ERROR:16,E_CORE_WARNING:32,E_COMPILE_ERROR:64,E_COMPILE_WARNING:128,E_USER_ERROR:256,E_USER_WARNING:512,E_USER_NOTICE:1024,E_STRICT:2048,E_RECOVERABLE_ERROR:4096,E_DEPRECATED:8192,E_USER_DEPRECATED:16384,E_ALL:30719};if(typeof error_type==='number'){type=error_type;}
else{error_type=[].concat(error_type);for(i=0;i<error_type.length;i++){if(TYPES[error_type[i]]){type=type|TYPES[error_type[i]];}}}
this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};if(type&TYPES.E_USER_ERROR||type&TYPES.E_ERROR||type&TYPES.E_CORE_ERROR||type&TYPES.E_COMPILE_ERROR||type&TYPES.E_RECOVERABLE_ERROR||type&TYPES.E_PARSE){if(ini_on('track_errors')){this.$php_errormsg=error_msg;}
if(display_errors(type)){prepend=this.php_js.ini.error_prepend_string?this.php_js.ini.error_prepend_string:'';append=this.php_js.ini.error_append_string?this.php_js.ini.error_append_string:'';this.echo(prepend+'Error: '+error_msg+' '+append);}
var e=new Error(error_msg);e.type=type;this.php_js.last_error={message:e.message,file:e.fileName,line:e.lineNumber,type:e.type};throw e;}
if(display_errors(type)){switch(type){case TYPES.E_USER_WARNING:case TYPES.E_WARNING:case TYPES.E_CORE_WARNING:case TYPES.E_COMPILE_WARNING:this.echo('Warning: '+error_msg);break;case TYPES.E_USER_NOTICE:case TYPES.E_NOTICE:this.echo('Notice: '+error_msg);break;case TYPES.E_DEPRECATED:case TYPES.E_USER_DEPRECATED:this.echo('Deprecated: '+error_msg);break;default:throw'Unrecognized error type';}}
return true;}
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');}
l=str.length;for(i=0;i<l;i++){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(i);break;}}
l=str.length;for(i=l-1;i>=0;i--){if(whitespace.indexOf(str.charAt(i))===-1){str=str.substring(0,i+1);break;}}
return whitespace.indexOf(str.charAt(0))===-1?str:'';}
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]];}
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){valArr.push(inputArr[k]);keyArr.push(k);if(strictForIn){delete inputArr[k];}}}
try{sorterNew(keyArr,valArr);}catch(e){return false;}
for(i=0;i<valArr.length;i++){populateArr[keyArr[i]]=valArr[i];}
return strictForIn?true:populateArr;}
function ucfirst(str){str+='';var f=str.charAt(0).toUpperCase();return f+str.substr(1);}
function ucwords(str){return(str+'').replace(/^(.)|\s(.)/g,function($1){return $1.toUpperCase();});}
function uksort(inputArr,sorter){var tmp_arr={},keys=[],i=0,k='',strictForIn=false,populateArr=[];if(typeof sorter==='string'){sorter=this.window[sorter];}
for(k in inputArr){if(inputArr.hasOwnProperty){keys.push(k);}}
try{if(sorter){keys.sort(sorter);}else{keys.sort();}}catch(e){return false;}
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];}}
for(i in tmp_arr){if(tmp_arr.hasOwnProperty){populateArr[i]=tmp_arr[i];}}
return strictForIn?true:populateArr;}
function uniqid(prefix,more_entropy){if(typeof prefix=='undefined'){prefix="";}
var retId;var formatSeed=function(seed,reqWidth){seed=parseInt(seed,10).toString(16);if(reqWidth<seed.length){return seed.slice(seed.length-reqWidth);}
if(reqWidth>seed.length){return Array(1+(reqWidth-seed.length)).join('0')+seed;}
return seed;};if(!this.php_js){this.php_js={};}
if(!this.php_js.uniqidSeed){this.php_js.uniqidSeed=Math.floor(Math.random()*0x75bcd15);}
this.php_js.uniqidSeed++;retId=prefix;retId+=formatSeed(parseInt(new Date().getTime()/1000,10),8);retId+=formatSeed(this.php_js.uniqidSeed,5);if(more_entropy){retId+=(Math.random()*10).toFixed(8).toString();}
return retId;}
function unserialize(data){var that=this;var utf8Overhead=function(chr){var code=chr.charCodeAt(0);if(code<0x0080){return 0;}
if(code<0x0800){return 1;}
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');}
buf.push(chr);chr=data.slice(offset+(i-1),offset+i);i+=1;}
return[buf.length,buf.join('')];};var read_chrs=function(data,offset,length){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);}
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;}
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');}
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;}
dataoffset+=1;break;default:error('SyntaxError','Unknown / Unhandled data type(s): '+dtype);break;}
return[dtype,dataoffset-offset,typeconvert(readdata)];};return _unserialize((data+''),0)[2];}
function urldecode(str){return decodeURIComponent(str.replace(/\+/g,'%20'));}
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,'+');}
function user_error(error_msg,error_type){return this.trigger_error(error_msg,error_type);}
function usleep(microseconds){var start=new Date().getTime();while(new Date()<(start+microseconds/1000)){}
return true;}
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]];}
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){valArr.push(inputArr[k]);if(strictForIn){delete inputArr[k];}}}
try{valArr.sort(sorter);}catch(e){return false;}
for(i=0;i<valArr.length;i++){populateArr[i]=valArr[i];}
return strictForIn?true:populateArr;}
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;}}
return tmp_arr.join('');}
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);}
if(enc!==null){if(end>start){utftext+=string.substring(start,end);}
utftext+=enc;start=end=n+1;}}
if(end>start){utftext+=string.substring(start,string.length);}
return utftext;}
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)';}
return name[1];};var repeat_char=function(len,pad_char){var str="";for(var i=0;i<len;i++){str+=pad_char;}
return str;};var getScalarVal=function(val){var ret='';if(val===null){ret='NULL';}
else if(typeof val==='boolean'){ret='bool('+val+')';}
else if(typeof val==='string'){ret='string('+val.length+') "'+val+'"';}
else if(typeof val==='number'){if(parseFloat(val)==parseInt(val,10)){ret='int('+val+')';}
else{ret='float('+val+')';}}
else if(val===undefined){ret='UNDEFINED';}
else if(typeof val==='function'){ret='FUNCTION';}
return ret;};var formatArray=function(obj,cur_depth,pad_val,pad_char){var someProp='';if(cur_depth>0){cur_depth++;}
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();}
lgth=0;for(someProp in obj){lgth++;}
str+="array("+lgth+") {\n";for(var key in obj){if(typeof obj[key]==='object'&&obj[key]!==null){str+=thick_pad+"["+key+"] =>\n"+thick_pad+formatArray(obj[key],cur_depth+1,pad_val,pad_char);}else{val=getScalarVal(obj[key]);str+=thick_pad+"["+key+"] =>\n"+thick_pad+val+"\n";}}
str+=base_pad+"}\n";}else{str=getScalarVal(obj);}
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);}
if(d.body){this.echo(output);}
else{try{d=XULDocument;this.echo('<pre xmlns="http://www.w3.org/1999/xhtml" style="white-space:pre;">'+output+'</pre>');}
catch(e){this.echo(output);}}}
function var_export(mixed_expression,bool_return){var retstr='',iret='',cnt=0,x=[],i=0,funcParts=[];var getFuncName=function(fn){var name=(/\W*function\s+([\w\$]+)\s*\(/).exec(fn);if(!name){return'(Anonymous)';}
return name[1];};var __getType=function(inp){var i=0;var match,type=typeof inp;if(type==='object'&&inp.constructor&&getFuncName(inp.constructor)==='PHPJS_Resource'){return'resource';}
if(type==='function'){return'function';}
if(type==='object'&&!inp){return'null';}
if(type==="object"){if(!inp.constructor){return'object';}
var cons=inp.constructor.toString();match=cons.match(/(\w+)\(/);if(match){cons=match[1].toLowerCase();}
var types=["boolean","number","string","array"];for(i=0;i<types.length;i++){if(cons===types[i]){type=types[i];break;}}}
return type;};var type=__getType(mixed_expression);if(type===null){retstr="NULL";}else if(type==='array'||type==='object'){for(i in mixed_expression){x[cnt++]=this.var_export(i,true)+" => "+this.var_export(mixed_expression[i],true);}
iret=x.join(',\n  ');retstr="array (\n  "+iret+"\n)";}
else if(type==='function'){funcParts=mixed_expression.toString().match(/function .*?\((.*?)\) \{([\s\S]*)\}/);retstr="create_function ('"+funcParts[1]+"', '"+funcParts[2].replace(new RegExp("'",'g'),"\\'")+"')";}
else if(type==='resource'){retstr='NULL';}else{retstr=(!isNaN(mixed_expression))?mixed_expression:"'"+mixed_expression.replace(/(["'])/g,"\\$1").replace(/\0/g,"\\0")+"'";}
if(bool_return!==true){this.echo(retstr);return null;}else{return retstr;}}
function version_compare(version1,version2,operator){this.php_js=this.php_js||{};this.php_js.ENV=this.php_js.ENV||{};if(!version1||!version2){throw'version_compare() is missing a required argument';}
var v1,v2,compare=0,i=0,x=0;var i1,i2;var parseVersionString=function(v){v=v.replace(/(^\s*)|(\s*$)/g,"").replace(/[-|_|+]/g,'.').replace(/([^0-9\.]+)/g,'.$1.');v=v.replace(/\.\.*/g,'.').toLowerCase().split('.');while(!v[0]){v.shift();}
while(!v[v.length-1]){v.pop();}
return v;};var versions={'dev':-1,'alpha':1,'a':1,'beta':2,'b':2,'rc':3,'#':4,'p':5,'pl':5};v1=parseVersionString(version1);v2=parseVersionString(version2);x=(v1.length>v2.length)?v2.length:v1.length;for(i=0;i<x;i++){if(v1[i]==v2[i]){continue;}
compare=0;i1=v1[i];i2=v2[i];if(!isNaN(i1)&&!isNaN(i2)){if(parseInt(i1,10)<parseInt(i2,10)){compare=-1;}else if(parseInt(i1,10)>parseInt(i2,10)){compare=1;}
break;}
if(i1=='#'){i1='';}else if(!isNaN(i1)){i1='#';}
if(i2=='#'){i2='';}else if(!isNaN(i2)){i2='#';}
if(versions[i1]&&versions[i2]){if(versions[i1]<versions[i2])
compare=-1;else if(versions[i1]>versions[i2])
compare=1;}else if(versions[i1]){compare=1;}else if(versions[i2]){compare=-1;}
break;}
if(compare==0&&v1.length!=v2.length){if(v2.length>v1.length){if(versions[v2[i]]){compare=(versions[v2[i]]<4)?1:-1;}else{compare=-1;}}else{if(versions[v1[i]]){compare=(versions[v1[i]]<4)?-1:1;}else{compare=1;}}}
if(operator){switch(operator.toLowerCase()){case'>':case'gt':return(compare>0);case'>=':case'ge':return(compare>=0);case'<=':case'le':return(compare<=0);case'==':case'=':case'eq':return(compare==0);case'<>':case'!=':case'ne':return(compare!=0);case'':case'<':case'lt':default:return(compare<0);}}
return compare;}
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;}
ret=this.sprintf.apply(this,[format].concat(args));elmt=d.createTextNode(ret);body.appendChild(elmt);return ret.length;}
function vsprintf(format,args){return this.sprintf.apply(this,[format].concat(args));}
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;}
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;}}
return r.join("\n");}/*
    http://www.JSON.org/json2.js
    2008-11-19

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See http://www.JSON.org/js.html

    This file creates a global JSON object containing two methods: stringify
    and parse.

        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as '\t' or '&nbsp;'),
                        it contains the characters used to indent at each level.

            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the object holding the key.

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' + n : n;
                    }

                    return this.getUTCFullYear()   + '-' +
                         f(this.getUTCMonth() + 1) + '-' +
                         f(this.getUTCDate())      + 'T' +
                         f(this.getUTCHours())     + ':' +
                         f(this.getUTCMinutes())   + ':' +
                         f(this.getUTCSeconds())   + 'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'


            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'

            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' + this[key] + ')' : value;
            });
            // text is '["Date(---current time---)"]'


        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                            +a[5], +a[6]));
                    }
                }
                return value;
            });

            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });


    This is a reference implementation. You are free to copy, modify, or
    redistribute.

    This code should be minified before deployment.
    See http://javascript.crockford.com/jsmin.html

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.
*/

/*jslint evil: true */

/*global JSON */

/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/

// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

if (!this.JSON) {
    JSON = {};
}
(function () {

    function f(n) {
        // Format integers to have at least two digits.
        return n < 10 ? '0' + n : n;
    }

    if (typeof Date.prototype.toJSON !== 'function') {

        Date.prototype.toJSON = function (key) {

            return this.getUTCFullYear()   + '-' +
                 f(this.getUTCMonth() + 1) + '-' +
                 f(this.getUTCDate())      + 'T' +
                 f(this.getUTCHours())     + ':' +
                 f(this.getUTCMinutes())   + ':' +
                 f(this.getUTCSeconds())   + 'Z';
        };

        String.prototype.toJSON =
        Number.prototype.toJSON =
        Boolean.prototype.toJSON = function (key) {
            return this.valueOf();
        };
    }

    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        gap,
        indent,
        meta = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        },
        rep;


    function quote(string) {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.

        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 + '"';
    }


    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
            k,          // The member key.
            v,          // The member value.
            length,
            mind = gap,
            partial,
            value = holder[key];

// If the value has a toJSON method, call it to obtain a replacement value.

        if (value && typeof value === 'object' &&
                typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }

// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.

        if (typeof rep === 'function') {
            value = rep.call(holder, key, value);
        }

// What happens next depends on the value's type.

        switch (typeof value) {
        case 'string':
            return quote(value);

        case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

            return isFinite(value) ? String(value) : 'null';

        case 'boolean':
        case 'null':

// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.

            return String(value);

// If the type is 'object', we might be dealing with an object or an array or
// null.

        case 'object':

// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.

            if (!value) {
                return 'null';
            }

// Make an array to hold the partial results of stringifying this object value.

            gap += indent;
            partial = [];

// Is the value an array?

            if (Object.prototype.toString.apply(value) === '[object Array]') {

// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                length = value.length;
                for (i = 0; i < length; i += 1) {
                    partial[i] = str(i, value) || 'null';
                }

// Join all of the elements together, separated with commas, and wrap them in
// brackets.

                v = partial.length === 0 ? '[]' :
                    gap ? '[\n' + gap +
                            partial.join(',\n' + gap) + '\n' +
                                mind + ']' :
                          '[' + partial.join(',') + ']';
                gap = mind;
                return v;
            }

// If the replacer is an array, use it to select the members to be stringified.

            if (rep && typeof rep === 'object') {
                length = rep.length;
                for (i = 0; i < length; i += 1) {
                    k = rep[i];
                    if (typeof k === 'string') {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            } else {

// Otherwise, iterate through all of the keys in the object.

                for (k in value) {
                    if (Object.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            }

// Join all of the member texts together, separated with commas,
// and wrap them in braces.

            v = partial.length === 0 ? '{}' :
                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
                        mind + '}' : '{' + partial.join(',') + '}';
            gap = mind;
            return v;
        }
    }

// If the JSON object does not yet have a stringify method, give it one.

    if (typeof JSON.stringify !== 'function') {
        JSON.stringify = function (value, replacer, space) {

// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.

            var i;
            gap = '';
            indent = '';

// If the space parameter is a number, make an indent string containing that
// many spaces.

            if (typeof space === 'number') {
                for (i = 0; i < space; i += 1) {
                    indent += ' ';
                }

// If the space parameter is a string, it will be used as the indent string.

            } else if (typeof space === 'string') {
                indent = space;
            }

// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.

            rep = replacer;
            if (replacer && typeof replacer !== 'function' &&
                    (typeof replacer !== 'object' ||
                     typeof replacer.length !== 'number')) {
                throw new Error('JSON.stringify');
            }

// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.

            return str('', {'': value});
        };
    }


// If the JSON object does not yet have a parse method, give it one.

    if (typeof JSON.parse !== 'function') {
        JSON.parse = function (text, reviver) {

// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.

            var j;

            function walk(holder, key) {

// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.

                var k, v, value = holder[key];
                if (value && typeof value === 'object') {
                    for (k in value) {
                        if (Object.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v;
                            } else {
                                delete value[k];
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value);
            }


// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.

            cx.lastIndex = 0;
            if (cx.test(text)) {
                text = text.replace(cx, function (a) {
                    return '\\u' +
                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
                });
            }

// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.

// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

            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, ''))) {

// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                j = eval('(' + text + ')');

// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.

                return typeof reviver === 'function' ?
                    walk({'': j}, '') : j;
            }

// If the text is not JSON parseable, then a SyntaxError is thrown.

            throw new SyntaxError('JSON.parse');
        };
    }
})();
/**
 * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
 *
 * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/,  http://www.vinterwebb.se/
 *
 * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */


/* ******************* */
/* Constructor & Init  */
/* ******************* */
var SWFUpload;

if (SWFUpload == undefined) {
	SWFUpload = function (settings) {
		this.initSWFUpload(settings);
	};
}

SWFUpload.prototype.initSWFUpload = function (settings) {
	try {
		this.customSettings = {};	// A container where developers can place their own settings associated with this instance.
		this.settings = settings;
		this.eventQueue = [];
		this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
		this.movieElement = null;


		// Setup global control tracking
		SWFUpload.instances[this.movieName] = this;

		// Load the settings.  Load the Flash movie.
		this.initSettings();
		this.loadFlash();
		this.displayDebugInfo();
	} catch (ex) {
		delete SWFUpload.instances[this.movieName];
		throw ex;
	}
};

/* *************** */
/* Static Members  */
/* *************** */
SWFUpload.instances = {};
SWFUpload.movieCount = 0;
SWFUpload.version = "2.2.0 2009-03-25";
SWFUpload.QUEUE_ERROR = {
	QUEUE_LIMIT_EXCEEDED	  		: -100,
	FILE_EXCEEDS_SIZE_LIMIT  		: -110,
	ZERO_BYTE_FILE			  		: -120,
	INVALID_FILETYPE		  		: -130
};
SWFUpload.UPLOAD_ERROR = {
	HTTP_ERROR				  		: -200,
	MISSING_UPLOAD_URL	      		: -210,
	IO_ERROR				  		: -220,
	SECURITY_ERROR			  		: -230,
	UPLOAD_LIMIT_EXCEEDED	  		: -240,
	UPLOAD_FAILED			  		: -250,
	SPECIFIED_FILE_ID_NOT_FOUND		: -260,
	FILE_VALIDATION_FAILED	  		: -270,
	FILE_CANCELLED			  		: -280,
	UPLOAD_STOPPED					: -290
};
SWFUpload.FILE_STATUS = {
	QUEUED		 : -1,
	IN_PROGRESS	 : -2,
	ERROR		 : -3,
	COMPLETE	 : -4,
	CANCELLED	 : -5
};
SWFUpload.BUTTON_ACTION = {
	SELECT_FILE  : -100,
	SELECT_FILES : -110,
	START_UPLOAD : -120
};
SWFUpload.CURSOR = {
	ARROW : -1,
	HAND : -2
};
SWFUpload.WINDOW_MODE = {
	WINDOW : "window",
	TRANSPARENT : "transparent",
	OPAQUE : "opaque"
};

// Private: takes a URL, determines if it is relative and converts to an absolute URL
// using the current site. Only processes the URL if it can, otherwise returns the URL untouched
SWFUpload.completeURL = function(url) {
	if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
		return url;
	}
	
	var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
	
	var indexSlash = window.location.pathname.lastIndexOf("/");
	if (indexSlash <= 0) {
		path = "/";
	} else {
		path = window.location.pathname.substr(0, indexSlash) + "/";
	}
	
	return /*currentURL +*/ path + url;
	
};


/* ******************** */
/* Instance Members  */
/* ******************** */

// Private: initSettings ensures that all the
// settings are set, getting a default value if one was not assigned.
SWFUpload.prototype.initSettings = function () {
	this.ensureDefault = function (settingName, defaultValue) {
		this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
	};
	
	// Upload backend settings
	this.ensureDefault("upload_url", "");
	this.ensureDefault("preserve_relative_urls", false);
	this.ensureDefault("file_post_name", "Filedata");
	this.ensureDefault("post_params", {});
	this.ensureDefault("use_query_string", false);
	this.ensureDefault("requeue_on_error", false);
	this.ensureDefault("http_success", []);
	this.ensureDefault("assume_success_timeout", 0);
	
	// File Settings
	this.ensureDefault("file_types", "*.*");
	this.ensureDefault("file_types_description", "All Files");
	this.ensureDefault("file_size_limit", 0);	// Default zero means "unlimited"
	this.ensureDefault("file_upload_limit", 0);
	this.ensureDefault("file_queue_limit", 0);

	// Flash Settings
	this.ensureDefault("flash_url", "swfupload.swf");
	this.ensureDefault("prevent_swf_caching", true);
	
	// Button Settings
	this.ensureDefault("button_image_url", "");
	this.ensureDefault("button_width", 1);
	this.ensureDefault("button_height", 1);
	this.ensureDefault("button_text", "");
	this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
	this.ensureDefault("button_text_top_padding", 0);
	this.ensureDefault("button_text_left_padding", 0);
	this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
	this.ensureDefault("button_disabled", false);
	this.ensureDefault("button_placeholder_id", "");
	this.ensureDefault("button_placeholder", null);
	this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
	this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
	
	// Debug Settings
	this.ensureDefault("debug", false);
	this.settings.debug_enabled = this.settings.debug;	// Here to maintain v2 API
	
	// Event Handlers
	this.settings.return_upload_start_handler = this.returnUploadStart;
	this.ensureDefault("swfupload_loaded_handler", null);
	this.ensureDefault("file_dialog_start_handler", null);
	this.ensureDefault("file_queued_handler", null);
	this.ensureDefault("file_queue_error_handler", null);
	this.ensureDefault("file_dialog_complete_handler", null);
	
	this.ensureDefault("upload_start_handler", null);
	this.ensureDefault("upload_progress_handler", null);
	this.ensureDefault("upload_error_handler", null);
	this.ensureDefault("upload_success_handler", null);
	this.ensureDefault("upload_complete_handler", null);
	
	this.ensureDefault("debug_handler", this.debugMessage);

	this.ensureDefault("custom_settings", {});

	// Other settings
	this.customSettings = this.settings.custom_settings;
	
	// Update the flash url if needed
	if (!!this.settings.prevent_swf_caching) {
		this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
	}
	
	if (!this.settings.preserve_relative_urls) {
		//this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url);	// Don't need to do this one since flash doesn't look at it
		this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
		this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
	}
	
	delete this.ensureDefault;
};

// Private: loadFlash replaces the button_placeholder element with the flash movie.
SWFUpload.prototype.loadFlash = function () {
	var targetElement, tempParent;

	// Make sure an element with the ID we are going to use doesn't already exist
	if (document.getElementById(this.movieName) !== null) {
		throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
	}

	// Get the element where we will be placing the flash movie
	targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;

	if (targetElement == undefined) {
		throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
	}

	// Append the container and load the flash
	tempParent = document.createElement("div");
	tempParent.innerHTML = this.getFlashHTML();	// Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
	targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);

	// Fix IE Flash/Form bug
	if (window[this.movieName] == undefined) {
		window[this.movieName] = this.getMovieElement();
	}
	
};

// Private: getFlashHTML generates the object tag needed to embed the flash in to the document
SWFUpload.prototype.getFlashHTML = function () {
	// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
	return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
				'<param name="wmode" value="', this.settings.button_window_mode, '" />',
				'<param name="movie" value="', this.settings.flash_url, '" />',
				'<param name="quality" value="high" />',
				'<param name="menu" value="false" />',
				'<param name="allowScriptAccess" value="always" />',
				'<param name="flashvars" value="' + this.getFlashVars() + '" />',
				'</object>'].join("");
};

// Private: getFlashVars builds the parameter string that will be passed
// to flash in the flashvars param.
SWFUpload.prototype.getFlashVars = function () {
	// Build a string from the post param object
	var paramString = this.buildParamString();
	var httpSuccessString = this.settings.http_success.join(",");
	
	// Build the parameter string
	return ["movieName=", encodeURIComponent(this.movieName),
			"&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
			"&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
			"&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
			"&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
			"&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
			"&amp;params=", encodeURIComponent(paramString),
			"&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
			"&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
			"&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
			"&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
			"&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
			"&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
			"&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
			"&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
			"&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
			"&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
			"&amp;buttonText=", encodeURIComponent(this.settings.button_text),
			"&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
			"&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
			"&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
			"&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
			"&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
			"&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
		].join("");
};

// Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
// The element is cached after the first lookup
SWFUpload.prototype.getMovieElement = function () {
	if (this.movieElement == undefined) {
		this.movieElement = document.getElementById(this.movieName);
	}

	if (this.movieElement === null) {
		throw "Could not find Flash element";
	}
	
	return this.movieElement;
};

// Private: buildParamString takes the name/value pairs in the post_params setting object
// and joins them up in to a string formatted "name=value&amp;name=value"
SWFUpload.prototype.buildParamString = function () {
	var postParams = this.settings.post_params; 
	var paramStringPairs = [];

	if (typeof(postParams) === "object") {
		for (var name in postParams) {
			if (postParams.hasOwnProperty(name)) {
				paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
			}
		}
	}

	return paramStringPairs.join("&amp;");
};

// Public: Used to remove a SWFUpload instance from the page. This method strives to remove
// all references to the SWF, and other objects so memory is properly freed.
// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
// Credits: Major improvements provided by steffen
SWFUpload.prototype.destroy = function () {
	try {
		// Make sure Flash is done before we try to remove it
		this.cancelUpload(null, false);
		

		// Remove the SWFUpload DOM nodes
		var movieElement = null;
		movieElement = this.getMovieElement();
		
		if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
			// Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
			for (var i in movieElement) {
				try {
					if (typeof(movieElement[i]) === "function") {
						movieElement[i] = null;
					}
				} catch (ex1) {}
			}

			// Remove the Movie Element from the page
			try {
				movieElement.parentNode.removeChild(movieElement);
			} catch (ex) {}
		}
		
		// Remove IE form fix reference
		window[this.movieName] = null;

		// Destroy other references
		SWFUpload.instances[this.movieName] = null;
		delete SWFUpload.instances[this.movieName];

		this.movieElement = null;
		this.settings = null;
		this.customSettings = null;
		this.eventQueue = null;
		this.movieName = null;
		
		
		return true;
	} catch (ex2) {
		return false;
	}
};


// Public: displayDebugInfo prints out settings and configuration
// information about this SWFUpload instance.
// This function (and any references to it) can be deleted when placing
// SWFUpload in production.
SWFUpload.prototype.displayDebugInfo = function () {
	this.debug(
		[
			"---SWFUpload Instance Info---\n",
			"Version: ", SWFUpload.version, "\n",
			"Movie Name: ", this.movieName, "\n",
			"Settings:\n",
			"\t", "upload_url:               ", this.settings.upload_url, "\n",
			"\t", "flash_url:                ", this.settings.flash_url, "\n",
			"\t", "use_query_string:         ", this.settings.use_query_string.toString(), "\n",
			"\t", "requeue_on_error:         ", this.settings.requeue_on_error.toString(), "\n",
			"\t", "http_success:             ", this.settings.http_success.join(", "), "\n",
			"\t", "assume_success_timeout:   ", this.settings.assume_success_timeout, "\n",
			"\t", "file_post_name:           ", this.settings.file_post_name, "\n",
			"\t", "post_params:              ", this.settings.post_params.toString(), "\n",
			"\t", "file_types:               ", this.settings.file_types, "\n",
			"\t", "file_types_description:   ", this.settings.file_types_description, "\n",
			"\t", "file_size_limit:          ", this.settings.file_size_limit, "\n",
			"\t", "file_upload_limit:        ", this.settings.file_upload_limit, "\n",
			"\t", "file_queue_limit:         ", this.settings.file_queue_limit, "\n",
			"\t", "debug:                    ", this.settings.debug.toString(), "\n",

			"\t", "prevent_swf_caching:      ", this.settings.prevent_swf_caching.toString(), "\n",

			"\t", "button_placeholder_id:    ", this.settings.button_placeholder_id.toString(), "\n",
			"\t", "button_placeholder:       ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
			"\t", "button_image_url:         ", this.settings.button_image_url.toString(), "\n",
			"\t", "button_width:             ", this.settings.button_width.toString(), "\n",
			"\t", "button_height:            ", this.settings.button_height.toString(), "\n",
			"\t", "button_text:              ", this.settings.button_text.toString(), "\n",
			"\t", "button_text_style:        ", this.settings.button_text_style.toString(), "\n",
			"\t", "button_text_top_padding:  ", this.settings.button_text_top_padding.toString(), "\n",
			"\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
			"\t", "button_action:            ", this.settings.button_action.toString(), "\n",
			"\t", "button_disabled:          ", this.settings.button_disabled.toString(), "\n",

			"\t", "custom_settings:          ", this.settings.custom_settings.toString(), "\n",
			"Event Handlers:\n",
			"\t", "swfupload_loaded_handler assigned:  ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
			"\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
			"\t", "file_queued_handler assigned:       ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
			"\t", "file_queue_error_handler assigned:  ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
			"\t", "upload_start_handler assigned:      ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
			"\t", "upload_progress_handler assigned:   ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
			"\t", "upload_error_handler assigned:      ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
			"\t", "upload_success_handler assigned:    ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
			"\t", "upload_complete_handler assigned:   ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
			"\t", "debug_handler assigned:             ", (typeof this.settings.debug_handler === "function").toString(), "\n"
		].join("")
	);
};

/* Note: addSetting and getSetting are no longer used by SWFUpload but are included
	the maintain v2 API compatibility
*/
// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
SWFUpload.prototype.addSetting = function (name, value, default_value) {
    if (value == undefined) {
        return (this.settings[name] = default_value);
    } else {
        return (this.settings[name] = value);
	}
};

// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
SWFUpload.prototype.getSetting = function (name) {
    if (this.settings[name] != undefined) {
        return this.settings[name];
	}

    return "";
};



// Private: callFlash handles function calls made to the Flash element.
// Calls are made with a setTimeout for some functions to work around
// bugs in the ExternalInterface library.
SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
	argumentArray = argumentArray || [];
	
	var movieElement = this.getMovieElement();
	var returnValue, returnString;

	// Flash's method if calling ExternalInterface methods (code adapted from MooTools).
	try {
		returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
		returnValue = eval(returnString);
	} catch (ex) {
		throw "Call to " + functionName + " failed";
	}
	
	// Unescape file post param values
	if (returnValue != undefined && typeof returnValue.post === "object") {
		returnValue = this.unescapeFilePostParams(returnValue);
	}

	return returnValue;
};

/* *****************************
	-- Flash control methods --
	Your UI should use these
	to operate SWFUpload
   ***************************** */

// WARNING: this function does not work in Flash Player 10
// Public: selectFile causes a File Selection Dialog window to appear.  This
// dialog only allows 1 file to be selected.
SWFUpload.prototype.selectFile = function () {
	this.callFlash("SelectFile");
};

// WARNING: this function does not work in Flash Player 10
// Public: selectFiles causes a File Selection Dialog window to appear/ This
// dialog allows the user to select any number of files
// Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
// If the selection name length is too long the dialog will fail in an unpredictable manner.  There is no work-around
// for this bug.
SWFUpload.prototype.selectFiles = function () {
	this.callFlash("SelectFiles");
};


// Public: startUpload starts uploading the first file in the queue unless
// the optional parameter 'fileID' specifies the ID 
SWFUpload.prototype.startUpload = function (fileID) {
	this.callFlash("StartUpload", [fileID]);
};

// Public: cancelUpload cancels any queued file.  The fileID parameter may be the file ID or index.
// If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
// If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
	if (triggerErrorEvent !== false) {
		triggerErrorEvent = true;
	}
	this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
};

// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
// If nothing is currently uploading then nothing happens.
SWFUpload.prototype.stopUpload = function () {
	this.callFlash("StopUpload");
};

/* ************************
 * Settings methods
 *   These methods change the SWFUpload settings.
 *   SWFUpload settings should not be changed directly on the settings object
 *   since many of the settings need to be passed to Flash in order to take
 *   effect.
 * *********************** */

// Public: getStats gets the file statistics object.
SWFUpload.prototype.getStats = function () {
	return this.callFlash("GetStats");
};

// Public: setStats changes the SWFUpload statistics.  You shouldn't need to 
// change the statistics but you can.  Changing the statistics does not
// affect SWFUpload accept for the successful_uploads count which is used
// by the upload_limit setting to determine how many files the user may upload.
SWFUpload.prototype.setStats = function (statsObject) {
	this.callFlash("SetStats", [statsObject]);
};

// Public: getFile retrieves a File object by ID or Index.  If the file is
// not found then 'null' is returned.
SWFUpload.prototype.getFile = function (fileID) {
	if (typeof(fileID) === "number") {
		return this.callFlash("GetFileByIndex", [fileID]);
	} else {
		return this.callFlash("GetFile", [fileID]);
	}
};

// Public: addFileParam sets a name/value pair that will be posted with the
// file specified by the Files ID.  If the name already exists then the
// exiting value will be overwritten.
SWFUpload.prototype.addFileParam = function (fileID, name, value) {
	return this.callFlash("AddFileParam", [fileID, name, value]);
};

// Public: removeFileParam removes a previously set (by addFileParam) name/value
// pair from the specified file.
SWFUpload.prototype.removeFileParam = function (fileID, name) {
	this.callFlash("RemoveFileParam", [fileID, name]);
};

// Public: setUploadUrl changes the upload_url setting.
SWFUpload.prototype.setUploadURL = function (url) {
	this.settings.upload_url = url.toString();
	this.callFlash("SetUploadURL", [url]);
};

// Public: setPostParams changes the post_params setting
SWFUpload.prototype.setPostParams = function (paramsObject) {
	this.settings.post_params = paramsObject;
	this.callFlash("SetPostParams", [paramsObject]);
};

// Public: addPostParam adds post name/value pair.  Each name can have only one value.
SWFUpload.prototype.addPostParam = function (name, value) {
	this.settings.post_params[name] = value;
	this.callFlash("SetPostParams", [this.settings.post_params]);
};

// Public: removePostParam deletes post name/value pair.
SWFUpload.prototype.removePostParam = function (name) {
	delete this.settings.post_params[name];
	this.callFlash("SetPostParams", [this.settings.post_params]);
};

// Public: setFileTypes changes the file_types setting and the file_types_description setting
SWFUpload.prototype.setFileTypes = function (types, description) {
	this.settings.file_types = types;
	this.settings.file_types_description = description;
	this.callFlash("SetFileTypes", [types, description]);
};

// Public: setFileSizeLimit changes the file_size_limit setting
SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
	this.settings.file_size_limit = fileSizeLimit;
	this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
};

// Public: setFileUploadLimit changes the file_upload_limit setting
SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
	this.settings.file_upload_limit = fileUploadLimit;
	this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
};

// Public: setFileQueueLimit changes the file_queue_limit setting
SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
	this.settings.file_queue_limit = fileQueueLimit;
	this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
};

// Public: setFilePostName changes the file_post_name setting
SWFUpload.prototype.setFilePostName = function (filePostName) {
	this.settings.file_post_name = filePostName;
	this.callFlash("SetFilePostName", [filePostName]);
};

// Public: setUseQueryString changes the use_query_string setting
SWFUpload.prototype.setUseQueryString = function (useQueryString) {
	this.settings.use_query_string = useQueryString;
	this.callFlash("SetUseQueryString", [useQueryString]);
};

// Public: setRequeueOnError changes the requeue_on_error setting
SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
	this.settings.requeue_on_error = requeueOnError;
	this.callFlash("SetRequeueOnError", [requeueOnError]);
};

// Public: setHTTPSuccess changes the http_success setting
SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
	if (typeof http_status_codes === "string") {
		http_status_codes = http_status_codes.replace(" ", "").split(",");
	}
	
	this.settings.http_success = http_status_codes;
	this.callFlash("SetHTTPSuccess", [http_status_codes]);
};

// Public: setHTTPSuccess changes the http_success setting
SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
	this.settings.assume_success_timeout = timeout_seconds;
	this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
};

// Public: setDebugEnabled changes the debug_enabled setting
SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
	this.settings.debug_enabled = debugEnabled;
	this.callFlash("SetDebugEnabled", [debugEnabled]);
};

// Public: setButtonImageURL loads a button image sprite
SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
	if (buttonImageURL == undefined) {
		buttonImageURL = "";
	}
	
	this.settings.button_image_url = buttonImageURL;
	this.callFlash("SetButtonImageURL", [buttonImageURL]);
};

// Public: setButtonDimensions resizes the Flash Movie and button
SWFUpload.prototype.setButtonDimensions = function (width, height) {
	this.settings.button_width = width;
	this.settings.button_height = height;
	
	var movie = this.getMovieElement();
	if (movie != undefined) {
		movie.style.width = width + "px";
		movie.style.height = height + "px";
	}
	
	this.callFlash("SetButtonDimensions", [width, height]);
};
// Public: setButtonText Changes the text overlaid on the button
SWFUpload.prototype.setButtonText = function (html) {
	this.settings.button_text = html;
	this.callFlash("SetButtonText", [html]);
};
// Public: setButtonTextPadding changes the top and left padding of the text overlay
SWFUpload.prototype.setButtonTextPadding = function (left, top) {
	this.settings.button_text_top_padding = top;
	this.settings.button_text_left_padding = left;
	this.callFlash("SetButtonTextPadding", [left, top]);
};

// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
SWFUpload.prototype.setButtonTextStyle = function (css) {
	this.settings.button_text_style = css;
	this.callFlash("SetButtonTextStyle", [css]);
};
// Public: setButtonDisabled disables/enables the button
SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
	this.settings.button_disabled = isDisabled;
	this.callFlash("SetButtonDisabled", [isDisabled]);
};
// Public: setButtonAction sets the action that occurs when the button is clicked
SWFUpload.prototype.setButtonAction = function (buttonAction) {
	this.settings.button_action = buttonAction;
	this.callFlash("SetButtonAction", [buttonAction]);
};

// Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
SWFUpload.prototype.setButtonCursor = function (cursor) {
	this.settings.button_cursor = cursor;
	this.callFlash("SetButtonCursor", [cursor]);
};

/* *******************************
	Flash Event Interfaces
	These functions are used by Flash to trigger the various
	events.
	
	All these functions a Private.
	
	Because the ExternalInterface library is buggy the event calls
	are added to a queue and the queue then executed by a setTimeout.
	This ensures that events are executed in a determinate order and that
	the ExternalInterface bugs are avoided.
******************************* */

SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
	// Warning: Don't call this.debug inside here or you'll create an infinite loop
	
	if (argumentArray == undefined) {
		argumentArray = [];
	} else if (!(argumentArray instanceof Array)) {
		argumentArray = [argumentArray];
	}
	
	var self = this;
	if (typeof this.settings[handlerName] === "function") {
		// Queue the event
		this.eventQueue.push(function () {
			this.settings[handlerName].apply(this, argumentArray);
		});
		
		// Execute the next queued event
		setTimeout(function () {
			self.executeNextEvent();
		}, 0);
		
	} else if (this.settings[handlerName] !== null) {
		throw "Event handler " + handlerName + " is unknown or is not a function";
	}
};

// Private: Causes the next event in the queue to be executed.  Since events are queued using a setTimeout
// we must queue them in order to garentee that they are executed in order.
SWFUpload.prototype.executeNextEvent = function () {
	// Warning: Don't call this.debug inside here or you'll create an infinite loop

	var  f = this.eventQueue ? this.eventQueue.shift() : null;
	if (typeof(f) === "function") {
		f.apply(this);
	}
};

// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
// properties that contain characters that are not valid for JavaScript identifiers. To work around this
// the Flash Component escapes the parameter names and we must unescape again before passing them along.
SWFUpload.prototype.unescapeFilePostParams = function (file) {
	var reg = /[$]([0-9a-f]{4})/i;
	var unescapedPost = {};
	var uk;

	if (file != undefined) {
		for (var k in file.post) {
			if (file.post.hasOwnProperty(k)) {
				uk = k;
				var match;
				while ((match = reg.exec(uk)) !== null) {
					uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
				}
				unescapedPost[uk] = file.post[k];
			}
		}

		file.post = unescapedPost;
	}

	return file;
};

// Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
SWFUpload.prototype.testExternalInterface = function () {
	try {
		return this.callFlash("TestExternalInterface");
	} catch (ex) {
		return false;
	}
};

// Private: This event is called by Flash when it has finished loading. Don't modify this.
// Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
SWFUpload.prototype.flashReady = function () {
	// Check that the movie element is loaded correctly with its ExternalInterface methods defined
	var movieElement = this.getMovieElement();

	if (!movieElement) {
		this.debug("Flash called back ready but the flash movie can't be found.");
		return;
	}

	this.cleanUp(movieElement);
	
	this.queueEvent("swfupload_loaded_handler");
};

// Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
// This function is called by Flash each time the ExternalInterface functions are created.
SWFUpload.prototype.cleanUp = function (movieElement) {
	// Pro-actively unhook all the Flash functions
	try {
		if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
			this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
			for (var key in movieElement) {
				try {
					if (typeof(movieElement[key]) === "function") {
						movieElement[key] = null;
					}
				} catch (ex) {
				}
			}
		}
	} catch (ex1) {
	
	}

	// Fix Flashes own cleanup code so if the SWFMovie was removed from the page
	// it doesn't display errors.
	window["__flash__removeCallback"] = function (instance, name) {
		try {
			if (instance) {
				instance[name] = null;
			}
		} catch (flashEx) {
		
		}
	};

};


/* This is a chance to do something before the browse window opens */
SWFUpload.prototype.fileDialogStart = function () {
	this.queueEvent("file_dialog_start_handler");
};


/* Called when a file is successfully added to the queue. */
SWFUpload.prototype.fileQueued = function (file) {
	file = this.unescapeFilePostParams(file);
	this.queueEvent("file_queued_handler", file);
};


/* Handle errors that occur when an attempt to queue a file fails. */
SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
	file = this.unescapeFilePostParams(file);
	this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
};

/* Called after the file dialog has closed and the selected files have been queued.
	You could call startUpload here if you want the queued files to begin uploading immediately. */
SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
	this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
};

SWFUpload.prototype.uploadStart = function (file) {
	file = this.unescapeFilePostParams(file);
	this.queueEvent("return_upload_start_handler", file);
};

SWFUpload.prototype.returnUploadStart = function (file) {
	var returnValue;
	if (typeof this.settings.upload_start_handler === "function") {
		file = this.unescapeFilePostParams(file);
		returnValue = this.settings.upload_start_handler.call(this, file);
	} else if (this.settings.upload_start_handler != undefined) {
		throw "upload_start_handler must be a function";
	}

	// Convert undefined to true so if nothing is returned from the upload_start_handler it is
	// interpretted as 'true'.
	if (returnValue === undefined) {
		returnValue = true;
	}
	
	returnValue = !!returnValue;
	
	this.callFlash("ReturnUploadStart", [returnValue]);
};



SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
	file = this.unescapeFilePostParams(file);
	this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
};

SWFUpload.prototype.uploadError = function (file, errorCode, message) {
	file = this.unescapeFilePostParams(file);
	this.queueEvent("upload_error_handler", [file, errorCode, message]);
};

SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
	file = this.unescapeFilePostParams(file);
	this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
};

SWFUpload.prototype.uploadComplete = function (file) {
	file = this.unescapeFilePostParams(file);
	this.queueEvent("upload_complete_handler", file);
};

/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
   internal debug console.  You can override this event and have messages written where you want. */
SWFUpload.prototype.debug = function (message) {
	this.queueEvent("debug_handler", message);
};


/* **********************************
	Debug Console
	The debug console is a self contained, in page location
	for debug message to be sent.  The Debug Console adds
	itself to the body if necessary.

	The console is automatically scrolled as messages appear.
	
	If you are using your own debug handler or when you deploy to production and
	have debug disabled you can remove these functions to reduce the file size
	and complexity.
********************************** */
   
// Private: debugMessage is the default debug_handler.  If you want to print debug messages
// call the debug() function.  When overriding the function your own function should
// check to see if the debug setting is true before outputting debug information.
SWFUpload.prototype.debugMessage = function (message) {
	if (this.settings.debug) {
		var exceptionMessage, exceptionValues = [];

		// Check for an exception object and print it nicely
		if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
			for (var key in message) {
				if (message.hasOwnProperty(key)) {
					exceptionValues.push(key + ": " + message[key]);
				}
			}
			exceptionMessage = exceptionValues.join("\n") || "";
			exceptionValues = exceptionMessage.split("\n");
			exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
			SWFUpload.Console.writeLine(exceptionMessage);
		} else {
			SWFUpload.Console.writeLine(message);
		}
	}
};

SWFUpload.Console = {};
SWFUpload.Console.writeLine = function (message) {
	var console, documentForm;

	try {
		console = document.getElementById("SWFUpload_Console");

		if (!console) {
			documentForm = document.createElement("form");
			document.getElementsByTagName("body")[0].appendChild(documentForm);

			console = document.createElement("textarea");
			console.id = "SWFUpload_Console";
			console.style.fontFamily = "monospace";
			console.setAttribute("wrap", "off");
			console.wrap = "off";
			console.style.overflow = "auto";
			console.style.width = "700px";
			console.style.height = "350px";
			console.style.margin = "5px";
			documentForm.appendChild(console);
		}

		console.value += message + "\n";

		console.scrollTop = console.scrollHeight - console.clientHeight;
	} catch (ex) {
		alert("Exception: " + ex.name + " Message: " + ex.message);
	}
};
//=============================================================================
CLoading = {};

//=============================================================================
CLoading.Toggle = function(Toggle) {
	if(Toggle) {
		$(document.body).css("cursor", "wait");
	}else{
		$(document.body).css("cursor", "default");
	}

	$("#CLoading").css("display", Toggle ? "block" : "none");
}

//=============================================================================
//=============================================================================
CModule = {};

//=============================================================================
CModule.Load = function(Name, Parms, Extra) {
	if(Extra == undefined) {
		Extra = "";
	}

	var ParmsString = "";

	if(Parms) {
		ParmsString = "?";

		for(var i in Parms) {
			ParmsString += i + "=" + encodeURIComponent(Parms[i]) + "&";
		}
	}

	document.location.href = "./." + Name + ParmsString + Extra;
}

//=============================================================================
CModule.ToggleHelp = function() {
	if($("#Module_Help").css("display") == "none") {
		$("#Module_Help_Content").html("<br/><br/><br/><br/><b>Loading...</b>");

		CAJAX.Add("Help", "Module", "GetContent", {"Page" : CURL.GetBasePage()}, function(Code, Content) {
			if(Code == 0) {
				$("#Module_Help_Content").html("<br/><br/><br/><br/><center><b>Help Information does not exist for this page. If you require immediate assistance, please visit the <a href='/.Support'>Support</a> page.</b></center>");
			}else{
				//$("#Module_Help_Edit").attr("onclick", "MHelp.Window_AddEdit(" + Code + ", '" + CURL.GetBasePage() + "');");

				$("#Module_Help_Content").html(Content);
			}
		});

		$("#Module_Help").css("height", "0px").css("display", "block").animate({
			"height" : "200px"
		});
	}else{
		$("#Module_Help").animate({
			"height" : "0px"
		}, function() {
			$("#Module_Help").css("display", "none");
		});
	}

	//$("#Module_Help").toggle("slow");
}

//=============================================================================
CModule.SaveSettings = function(Prefix) {
	CForm.Submit("CModule", "System", "SaveSettings", Prefix, function(Code, Content) {
		CModule.CloseSettings();
		CRefresh.Suggest();
	});
}

//-----------------------------------------------------------------------------
CModule.ToggleSettings = function() {
	$("#Module_Settings").toggle("slow");
}

//-----------------------------------------------------------------------------
CModule.CloseSettings = function() {
	$("#Module_Settings").hide("slow");
}

//=============================================================================
//=============================================================================
CPicPreview = {};

//=============================================================================
CPicPreview.Filename = "CPicPreview.php";

//=============================================================================
CPicPreview.GetImageSize = function(Filename, Callback) {
	var ImageObj = new Image();

	ImageObj.src = Filename;

	$(ImageObj).bind("load", function() {
		if(Callback) {
			Callback(ImageObj.width, ImageObj.height);
		}
	});
}

//-----------------------------------------------------------------------------
CPicPreview.GetURL = function(File, Size, Ratio) {
	var URL = CPicPreview.Filename;

	URL += "?CPP_File=" + encodeURIComponent(File) + "&CPP_Size=" + encodeURIComponent(Size) + "&CPP_Ratio=" + encodeURIComponent(Ratio);

	return URL;
}

//=============================================================================
//=============================================================================
CRefresh = {};

//=============================================================================
CRefresh.Element = null;

//=============================================================================
CRefresh.Go = function() {
	location.reload(true);
}

//-----------------------------------------------------------------------------
CRefresh.Suggest = function() {
	if($("#CRefresh_Suggest").get(0) == null) {
		$(document.body).append("<div id='CRefresh_Suggest' class='CRefresh_Suggest'></div>");

		$("#CRefresh_Suggest").bind("click", function(Event) {
			CRefresh.Go();
		});
	}
}

//=============================================================================
//=============================================================================
CTooltip = {};

//=============================================================================
CTooltip.Show = function(Event, Content) {
	if(Content == undefined || Content.length <= 0) return;

	var Offset = 15;

	X = Event.pageX + Offset;
	Y = Event.pageY + Offset;

	if($("#CTooltip").get(0) == null) {
		$(document.body).append("<div id='CTooltip' class='CTooltip'>" + Content + "</div>");
	}else{
		$("#CTooltip").show().html(Content);
	}

	$("#CTooltip").css("left", X + "px");
	$("#CTooltip").css("top", Y + "px");
}

//-----------------------------------------------------------------------------
CTooltip.Hide = function() {
	$("#CTooltip").hide();
}

//=============================================================================
//=============================================================================
CURL = {};

//=============================================================================
CURL.GetBasePage = function() {
	var Page		= "";
	var PathParts	= window.location.pathname.split("/");

	Page = PathParts[PathParts.length - 1];

	return Page;
}

//-----------------------------------------------------------------------------
CURL.GetLocation = function() {
	var Path		= "";
	var PathParts	= window.location.pathname.split("/");

	for(var i = 0;i < PathParts.length - 1;i++) {
		Path += PathParts[i] + "/";
	}

	return window.location.protocol + "//" + window.location.host + Path;
}

//-----------------------------------------------------------------------------
CURL.FormatURL = function(URL, Parms, UseGetParms, UseBasePage) {
	var ParmString = "?";

	if(UseGetParms) {
		var CurrentParms = CURL.GetCurrentParms();

		for(var Key in CurrentParms) {
			var Skip = false;

			for(var Key2 in Parms) {
				if(Key == Key2) Skip = true;
			}

			if(Skip) continue;

			var Value = CurrentParms[Key];

			ParmString += Key + "=" + encodeURIComponent(Value) + "&";
		}
	}

	for(var Key in Parms) {
		var Value = Parms[Key];

		if(Value == undefined) Value = "";

		ParmString += Key + "=" + encodeURIComponent(Value) + "&";
	}

	if(URL.length <= 0 || URL == "") {
		URL = CURL.GetLocation();
	}

	if(ParmString == "?") ParmString = "";

	if(UseBasePage) {
		return URL + CURL.GetBasePage() + ParmString;
	}

	return URL + ParmString;
}

//-----------------------------------------------------------------------------
CURL.GetCurrentParms = function() {
	var URLParts = window.location.href.split("?");

	if(URLParts.length <= 1) return {};

	var Parms = URLParts[1].split("&");

	var ParmObject = {};

	for(var i in Parms) {
		var ParmParts = Parms[i].split("=");

		if(ParmParts[0].length <= 0) continue;

		ParmObject[ParmParts[0]] = ParmParts[1];
	}

	return ParmObject;
}

//-----------------------------------------------------------------------------
CURL.Redirect = function(URL) {
	window.location.href = URL;
}

//=============================================================================
//=============================================================================
CAJAX = {};

//=============================================================================
CAJAX.DebugMode = false;

//=============================================================================
CAJAX.Queue = Array();

CAJAX.Sending = false;

CAJAX.Count = 0;

//=============================================================================
CAJAX.QueueItem = function() {
	var self		= this;

	self.ID			= "";

	self.Request	= "";
	self.Type		= "";
	self.Action		= "";
	self.Parms		= Array();

	self.Callback	= null;
	self.URI		= "";
};

//=============================================================================
CAJAX.Add = function(Request, Type, Action, Parms, Callback) {
	var Item = new CAJAX.QueueItem();

	Item.ID			= "JHA_Panel_PActions_" + CAJAX.Count;
	Item.Request	= Request;
	Item.Type		= Type;
	Item.Action		= Action;
	Item.Callback	= Callback;
	Item.Parms		= Parms;

	if(CAJAX.DebugMode) {
		try {
			PConsole.AddNotice("CAJAX.Add :: Pushing Item into Queue : (" + Request + ", " + Type + ", " + Action + ")", "Notice");

			for(var i in Parms) {
				PConsole.AddNotice(" - [" + i + "] = " + Parms[i], "Notice");
			}
		}catch(err) {};
	}

	CAJAX.Queue.push(Item);

	CAJAX.Count++;

	if(CAJAX.Sending == false) {
		CAJAX.OnLoop();
	}
}

//-----------------------------------------------------------------------------
CAJAX.OnInit = function() {
	try {
		//Register Debug Command with Console
		function AJAXDebug(Parts) {
			if(Parts[1] == 1) {
				CAJAX.DebugMode = true;

				PConsole.AddNotice("Debugging Turned On", "Notice");
			}else{
				CAJAX.DebugMode = false;

				PConsole.AddNotice("Debugging Turned Off", "Notice");
			}
		}

		PConsole.AddCommand("CAJAXDebug", AJAXDebug, "Turn on Debugging Mode");
	}catch(err) {};

	/*window.onbeforeunload = function(e) {
		if(CAJAX.Sending) {
			return "You have 1 or more requests running. If you continue, you may lose important data.";
		}

		return;
	};*/

	setTimeout(CAJAX.OnLoop, 500);
}

//-----------------------------------------------------------------------------
CAJAX.OnLoop = function() {
	if(CAJAX.Queue.length <= 0) {
		CAJAX.Sending = false;

		CLoading.Toggle(false);
		return;
	}

	if(CAJAX.Sending) {
		setTimeout(CAJAX.OnLoop, 1000);
		return;
	}

	CLoading.Toggle(true);

	CAJAX.Sending = true;
	
	var ID			= CAJAX.Queue[0].ID;
	var Request		= CAJAX.Queue[0].Request;
	var Type		= CAJAX.Queue[0].Type;
	var Action		= CAJAX.Queue[0].Action;
	var Parms		= CAJAX.Queue[0].Parms;

	var ParmsString = "";

	for(var i in Parms) {
		if(is_array(Parms[i]) || is_object(Parms[i])) {
			ParmsString += "&" + i + "=" + encodeURIComponent(JSON.stringify(Parms[i]));
		}else{
			ParmsString += "&" + i + "=" + encodeURIComponent(Parms[i]);
		}
	}

	var URI = "AJAX_Request=" + encodeURIComponent(Request) + "&AJAX_Type=" + encodeURIComponent(Type) + "&AJAX_Action=" + encodeURIComponent(Action) + ParmsString;

	if(CAJAX.DebugMode) {
		try {
			PConsole.AddNotice("CAJAX.OnLoop :: Starting AJAX Request", "Notice");
			PConsole.AddNotice(" - " + URI, "Notice");
		}catch(err) {};
	}

	$.ajax({
		async:		true,
		type:		"POST",
		url:		"/AJAX.php",
		data:		URI,
		dataType:	"text",

		success:	CAJAX.OnSuccess,
		error:		CAJAX.OnError
	});

	CAJAX.Queue[0].URI = URI;

	setTimeout(CAJAX.OnLoop, 1000);
}

//-----------------------------------------------------------------------------
CAJAX.OnSuccess = function(Data, TextStatus) {
	var ID			= CAJAX.Queue[0].ID;
	var Request		= CAJAX.Queue[0].Request;
	var Type		= CAJAX.Queue[0].Type;
	var Action		= CAJAX.Queue[0].Action;
	var Callback	= CAJAX.Queue[0].Callback;
	var URI			= CAJAX.Queue[0].URI;

	if(CAJAX.DebugMode) {
		try {
			PConsole.AddNotice("CAJAX.OnDone :: Request Finished Successfully", "Notice");
			PConsole.AddNotice(" - " + TextStatus, "Notice");
			PConsole.AddNotice(" - " + htmlspecialchars(Data), "Notice");
		}catch(err) {};
	}

	var Parts = explode("\n", Data, 2);

	if(Parts[0] <= 0 && CAJAX.DebugMode) {
		try {
			PConsole.AddNotice("CAJAX.OnDone :: " + Request + " :: (Code: " + Parts[0] + ") : " + Parts[1], "Error");
		}catch(err) {};
	}

	if(Callback) {
		Callback(Parts[0], Parts[1]);
	}

	CAJAX.Queue.reverse();
	CAJAX.Queue.pop();
	CAJAX.Queue.reverse();

	CAJAX.Sending = false;
}

//-----------------------------------------------------------------------------
CAJAX.OnError = function(Data, TextStatus) {
	var ID			= CAJAX.Queue[0].ID;
	var Request		= CAJAX.Queue[0].Request;
	var Type		= CAJAX.Queue[0].Type;
	var Action		= CAJAX.Queue[0].Action;
	var Callback	= CAJAX.Queue[0].Callback;
	var URI			= CAJAX.Queue[0].URI;

	if(CAJAX.DebugMode) {
		try {
			PConsole.AddNotice("CAJAX.OnDone :: " + Request + " :: HTTP Error : " + TextStatus + " (" + URI + ") : " + Data.responseText, "Error");
			PConsole.AddNotice(" - " + TextStatus, "Notice");
			PConsole.AddNotice(" - " + htmlspecialchars(Data), "Notice");
		}catch(err) {};
	}

	if(Callback) {
		Callback(0, Data.responseText);
	}

	CAJAX.Queue.reverse();
	CAJAX.Queue.pop();
	CAJAX.Queue.reverse();

	CAJAX.Sending = false;
}

//=============================================================================
$(CAJAX.OnInit);

//=============================================================================
//=============================================================================
CForm = {};

//=============================================================================
CForm.Error = "";

CForm.DebugMode = false;

//-----------------------------------------------------------------------------
CForm.OnInit = function() {
	try {
		//Register Debug Command with Console
		function FormDebug(Parts) {
			if(Parts[1] == 1) {
				CForm.DebugMode = true;

				PConsole.AddNotice("Debugging Turned On", "Notice");
			}else{
				CForm.DebugMode = false;

				PConsole.AddNotice("Debugging Turned Off", "Notice");
			}
		}

		PConsole.AddCommand("CFormDebug", FormDebug, "Turn on Debugging Mode");
	}catch(err) {}
}

//=============================================================================
CForm.Stylize = function() {
	$(".CForm_Textbox").each(function() {
		var ID = $(this).attr("id");

		$(this).wrap("<div class='CFormS_Textbox'></div>");
	});

	$(".CForm_Dropdown").each(function() {
		var ID = $(this).attr("id");

		var SelTexts = $(this).selectedTexts();

		$(this).before("<div class='CFormS_Dropdown' id='" + ID + "_Dropdown'><div class='CFormS_Dropdown_Text' id='" + ID + "_Text'>" + SelTexts[0] + "</div><div class='CFormS_Dropdown_Arrow' id='" + ID + "_Arrow'></div><div class='CFormS_Dropdown_List' id='" + ID + "_List'></div></div>");
		$(this).after("<input type='hidden' id='" + $(this).attr("id") + "' name='" + $(this).attr("id") + "' value='" + $(this).attr("value") +"'/>");

		$(this).attr("id", $(this).attr("id") + "_Old");
		$(this).attr("name", $(this).attr("name") + "_Old");
		$(this).attr("class", "");

		$(this).css("display", "none");

		$("#" + ID + "_Arrow").bind("click", function() {
			$(".CFormS_Dropdown_List").each(function(i) {
				if($(this).attr("id") == ID + "_List") return;

				$(this).slideUp("fast");
			});

			$("#" + ID + "_List").slideToggle("normal");
		});

		(function(ID, OldDrop) {
			$("#" + ID).bind("change", function() {
				$(OldDrop).trigger("change");
			});
		})(ID, $(this));

		$(this).find("option").each(function(i) {
			$("#" + ID + "_List").append("<div class='CFormS_Dropdown_List_Item' id='" + ID + "_List_Item_" + i + "' rel='" + $(this).attr("value") + "'>" + $(this).html() + "</div>");

			$("#" + ID + "_List_Item_" + i).bind("click", function() {
				$("[id^=" + ID + "_List_Item]").removeClass("CFormS_Dropdown_List_Item_Selected");

				$(this).addClass("CFormS_Dropdown_List_Item_Selected");				
					
				$("#" + ID).attr("value", $(this).attr("rel"));
				$("#" + ID + "_Text").html($(this).html());

				$("#" + ID + "_List").slideUp("fast");

				$("#" + ID).trigger("change");
			}).bind("mouseover", function() {
				$(this).addClass("CFormS_Dropdown_List_Item_Hover");
			}).bind("mouseout", function() {
				$(this).removeClass("CFormS_Dropdown_List_Item_Hover");
			});
		});
	});
}

//=============================================================================
CForm.UpdateTimestamp = function(ID) {
	var ElementHidden = $("#" + ID).get(0);

	var Month	= parseInt($("#" + ID + "_Month").attr("value"));
	var Day		= parseInt($("#" + ID + "_Day").attr("value"));
	var Year	= parseInt($("#" + ID + "_Year").attr("value"));

	var TempDate = new Date();

	TempDate.setTime(0);
	TempDate.setHours(0);
	TempDate.setMinutes(0);
	TempDate.setSeconds(0);

	TempDate.setMonth(Month - 1, Day);
	TempDate.setDate(Day);
	TempDate.setFullYear(Year);

	ElementHidden.value = (TempDate.getTime() / 1000);
}

//=============================================================================
CForm.Submit = function(Request, Type, Action, Prefix, Callback) {
	var Parms = Array();

	var Elements = $("[id^=" + Prefix + "]").get();

	var Valid = true;

	for(var i = 0;i < Elements.length;i++) {
		var Element = Elements[i];

		$(Element).removeClass("CForm_Error");

		if(Valid == false) continue;

		if(Element.title.length > 0 && Element.value == "") {

			if($(Element).attr("rel") == "Autocomplete") {
				$("#" + Element.id + "_Search").focus();
				$("#" + Element.id + "_Search").addClass("CForm_Error");
			}else{
				$(Element).addClass("CForm_Error");
				Element.focus();
			}

			CForm.Error = Element.title;

			Valid = false;
		}

		if($(Element).attr("rel") == "CForm_RTE") {
			Element.value = CKEDITOR.instances[Element.id].getData();
		}

		if($(Element).attr("multiple")) {
			var NewValue = Array();

			var SelValues = $(Element).selectedValues();

			Parms[Element.id.replace(Prefix, "")] = JSON.stringify(SelValues);
		}else{
			Parms[Element.id.replace(Prefix, "")] = Element.value;
		}
	}

	if(CForm.DebugMode) {
		try {
			PConsole.AddNotice("CForm.Submit :: Submitting Form", "Notice");

			for(var i in Parms) {
				PConsole.AddNotice(" - [" + i + "] = " + Parms[i], "Notice");
			}
		}catch(err) {}
	}

	if(Valid == false) {
		return false;
	}

	if(!Callback) {
		Callback = CForm.SubmitCallback;
	}

	CAJAX.Add(Request, Type, Action, Parms, function(Code, Content) {
		if(Callback) {
			if(Callback(Code, Content)) {
				CForm.SubmitCallback(Code, Content);
			}
		}else{
			CForm.SubmitCallback(Code, Content);
		}
	});

	return true;
}

CForm.SubmitCallback = function(Code, Content) {
	if(Code == 0) {
		alert("There was an error submitting this form:\n\n" + Content);
	}else{
		CPageNotice.Add("Success", Content);

		CRefresh.Suggest();
	}
}

//=============================================================================
CForm.GetLastError = function() {
	return CForm.Error;
}

//=============================================================================
CForm.Prefix	= "";
CForm.Tooltip	= "";

//-----------------------------------------------------------------------------
CForm.SetPrefix = function(Prefix) {
	CForm.Prefix = Prefix;
}

//-----------------------------------------------------------------------------
CForm.AddHidden = function(Name, FormName, Value) {
	if(Value == undefined) {
		Value = "";
	}

	return "\
	<tr>\
		<td class='CForm_Value' valign='top' colspan='2'><input type='hidden' name='" + CForm.Prefix + FormName + "' id='" + CForm.Prefix + FormName + "' value='" + Value + "'/></td>\
	</tr>\
	";

	CForm.ResetTooltip();
}

//-----------------------------------------------------------------------------
CForm.AddTextbox = function(Name, FormName, Value, Error) {
	if(Value == undefined) {
		Value = "";
	}

	return "\
	<tr>\
		<td align='right' class='CForm_Name' valign='top'><b onMouseOver=\"CForm.ShowTooltip('" + CForm.Tooltip + "');\" onMouseOut=\"CForm.HideTooltip();\">" + Name + ":</b>&nbsp;</td>\
		<td class='CForm_Value' valign='top'><input type='text' name='" + CForm.Prefix + FormName + "' id='" + CForm.Prefix + FormName + "' value='" + Value + "' title='" + Error + "' class='CForm_Textbox'/></td>\
	</tr>\
	";

	CForm.ResetTooltip();
}

//-----------------------------------------------------------------------------
CForm.AddTextarea = function(Name, FormName, Value, Error) {
	if(Value == undefined) {
		Value = "";
	}

	return "\
	<tr>\
		<td align='right' class='CForm_Name' valign='top'><b onMouseOver=\"CForm.ShowTooltip('" + CForm.Tooltip + "');\" onMouseOut=\"CForm.HideTooltip();\">" + Name + ":</b>&nbsp;</td>\
		<td class='CForm_Value' valign='top'><textarea name='" + CForm.Prefix + FormName + "' id='" + CForm.Prefix + FormName + "' title='" + Error + "'  class='CForm_Textarea'>" + Value + "</textarea></td>\
	</tr>\
	";

	CForm.ResetTooltip();
}

//-----------------------------------------------------------------------------
CForm.AddDropdown = function(Name, FormName, Values, SelectedValue, Error) {
	Content = "\
	<tr>\
		<td align='right' class='CForm_Name' valign='top'><b onMouseOver=\"CTooltip.Show('" + CForm.Tooltip + "');\" onMouseOut=\"CTooltip.Hide();\">" + Name + ":</b>&nbsp;</td>\
		<td class='CForm_Value' valign='top'>\
		<select name='" + CForm.Prefix + FormName + "' id='" + CForm.Prefix + FormName + "' title='" + Error + "' class='CForm_Dropdown'>";

	for(var i in Values) {
		Content += "<option value='" + i +"'";

		if(Values[i] == SelectedValue) {
			Content += "selected='selected'";
		}

		Content += ">" + Values[i] + "</option>";
	}

	Content += "\
		</select>\
		</td>\
	</tr>\
	";

	CForm.ResetTooltip();

	return Content;
}

//-----------------------------------------------------------------------------
CForm.AddAdvancedRTEControl = function(ID, Config) {
	setTimeout(function() { 
		$("#" + ID).markItUp(Config);
	}, 1000);
}

//-----------------------------------------------------------------------------
CForm.AddRTEControl = function(ID, Config) {
	setTimeout(function() { 
	    if(CKEDITOR.instances[ID]) {
			delete CKEDITOR.instances[ID];
		}

		CKEDITOR.replace(ID, Config);
	}, 1000);
}

//-----------------------------------------------------------------------------
CForm.AddYesNo = function(Name, FormName, SelectedValue, Error) {
	return CForm.AddDropdown(Name, FormName, {0 : "No", 1 : "Yes"}, SelectedValue, Error);
}

//-----------------------------------------------------------------------------
CForm.AddYesNoControl = function(ID, FormID) {
	var OnClick = function() {
		var HiddenInput = $("#" + FormID).get(0);

		if(HiddenInput.value == 0) {
			$("#" + ID).css("background-position", "0px 15px");
			HiddenInput.value = 1;
		}else{
			$("#" + ID).css("background-position", "0px 0px");
			HiddenInput.value = 0;
		}
	}

	$("#" + ID).bind("click", OnClick);

	var HiddenInput = $("#" + FormID).get(0);

	if(HiddenInput.value == 0) {
		$("#" + ID).css("background-position", "0px 0px");
	}else{
		$("#" + ID).css("background-position", "0px 15px");
	}
}

//-----------------------------------------------------------------------------
CForm.AddAutocomplete = function(ID, Request, Type, Action, Callback) {
	$("#" + ID + "_Search").autocomplete("AJAX.php", {
		width : "250px",
		onItemSelect : function(LI) {
			//ID - LI.extra[0]
			//Text - 

			$("#" + ID).attr("value", LI.extra[0]);
			$("#" + ID + "_Search").attr("value", ""); //Clear
			$("#" + ID + "_Text").attr("value", LI.innerHTML);

			$("#" + ID + "_Text").attr("alt", LI.innerHTML);
			$("#" + ID + "_Text").attr("title", LI.innerHTML);

			$("#" + ID + "_Search").focus();

			if(Callback) {
				Callback(LI.extra[0], LI.innerHTML);
			}
		},
		extraParams : {
			"AJAX_Request"	: Request,
			"AJAX_Type"		: Type,
			"AJAX_Action"	: Action
		}
	}); 
}

//-----------------------------------------------------------------------------
CForm.DualListboxUpdate = function(ID) {
	var Left	= $("#" + ID + "_Left");
	var Right	= $("#" + ID + "_Right");

	var Selected = $(Right).find("option");
	var Data = {};

	for(var i = 0;i < Selected.length;i++) {
		Data[ $(Selected[i]).attr("value") ] = $(Selected[i]).html();
	}

	$("#" + ID).attr("value", JSON.stringify(Data));
}

//-----------------------------------------------------------------------------
CForm.AddDualListboxControl = function(ID) {
	var Left	= $("#" + ID + "_Left");
	var Right	= $("#" + ID + "_Right");

	Left.bind("dblclick", function(e) {
		$(Left).copyOptions(Right, "selected");

		CForm.DualListboxUpdate(ID);
	});

	Right.bind("dblclick", function(e) {
		$(Right).removeOption(/./, true);

		CForm.DualListboxUpdate(ID);
	});

	CForm.DualListboxUpdate(ID);
}

//-----------------------------------------------------------------------------
CTooltip.Show = function() {
}

//-----------------------------------------------------------------------------
CTooltip.Hide = function() {
}

//-----------------------------------------------------------------------------
CForm.SetTooltip = function(Content) {
	CForm.Tooltip = Content;
}

//-----------------------------------------------------------------------------
CForm.ResetTooltip = function() {
	CForm.Tooltip = "";
}

//-----------------------------------------------------------------------------
CForm.AddUpload = function(Name, FormName) {
	Content = "\
	<tr>\
		<td align='right' class='CForm_Name' valign='top'><b onMouseOver=\"CTooltip.Show('" + CForm.Tooltip + "');\" onMouseOut=\"CTooltip.Hide();\">" + Name + ":</b>&nbsp;</td>\
		<td class='CForm_Value' valign='top'>\
		<table width='100%'>\
		<tr>\
			<!-- <td valign='top'><div id='" + CForm.Prefix + FormName + "_SWFUpload_Preview' class='CForm_Upload_Preview'></div></td> -->\
			<td width='100%' valign='top'>\
			<div id='" + CForm.Prefix + FormName + "_SWFUpload_Icon' class='CForm_Upload_Icon'></div>\
			<span class='CForm_Upload_Button' id='" + CForm.Prefix + FormName + "_SWFUpload' rel='SWFUpload'></span>\
			<input type='hidden' name='" + CForm.Prefix + FormName + "' id='" + CForm.Prefix + FormName + "'/>\
			<input type='hidden' name='" + CForm.Prefix + FormName + "Original' id='" + CForm.Prefix + FormName + "Original'/>\
			</td>\
		</tr>\
		</table>\
		<script language='Javascript'>CForm.AddUploadControl('" + CForm.Prefix + FormName + "_SWFUpload', '" + CForm.Prefix + FormName + "');</script>\
		</td>\
	</tr>";

	CForm.ResetTooltip();

	return Content;
}

//-----------------------------------------------------------------------------
CForm.AddUploadControl = function(ID, FormID) {
	var Icon = $("#" + ID + "_Icon").get(0);

	Icon.className = "CForm_Upload_Icon";

	$("#" + ID).each(function(Index, Element) {
		new SWFUpload({ 
			upload_url				: CURL.GetLocation() + "AJAX.php?AJAX_Request=CData&AJAX_Type=System&AJAX_Action=UploadTemp",
			flash_url				: "./js/swfupload/Flash/swfupload.swf",
			file_size_limit			: "20 MB",

			button_image_url		: CURL.GetLocation() + "Theme/Default/Default/XPButtonUploadText_61x22.png",
			button_placeholder_id	: Element.id,
			button_width			: 61,
			button_height			: 22,
			button_window_mode		: "transparent",
			//debug					: true,

			file_queued_handler		: function(file) {
			},
			file_queue_error_handler : function(file, errorCode, message) {
			},
			file_dialog_complete_handler : function(numFilesSelected, numFilesQueued) {
				if (numFilesSelected > 0) {
					$("#" + this.customSettings.cancelButtonId).attr("disabled", false);
				}

				this.startUpload();
			},
			upload_start_handler	: function(file) {
				Icon.className = "CForm_Upload_Icon_Progress";

				return true;
			}, 
			upload_progress_handler : function(file, bytesLoaded, bytesTotal) {
				var Percent = (bytesLoaded / bytesTotal) * 100;
					Percent = Percent.toFixed(2);

				$(Icon).html(Percent + "%");
			},
			upload_error_handler	: function(file, errorCode, message) {
				alert("There was an error uploading your file : (" + errorCode + ") : " + message);

				$(Icon).html("");

				Icon.className = "CForm_Upload_Icon_Error";

				return true;
			},
			upload_success_handler	: function(file, serverData) {
				var Parts = explode("\n", serverData, 2);

				Parts[0] = intval(Parts[0]);

				$(Icon).html("");

				if(Parts[0] <= 0) {
					alert("There was an error uploading your file : " + Parts[1] + "\nComplete Response : " + serverData);

					Icon.className = "CForm_Upload_Icon_Error";
				}else{
					$("#" + FormID).attr("value", Parts[1]);
					$("#" + FormID + "Original").attr("value", file["name"]);

					Icon.className = "CForm_Upload_Icon_Done";
				}

				return true;
			},
			upload_complete_handler : function(file) {
			},
			queue_complete_handler	: function(numFilesUploaded) {
			}
		}); 
	});
}

//-----------------------------------------------------------------------------
CForm.AddUploadMultipleControl = function(ID, FormID, Callback) {
	var Icon = $("#" + ID + "_Icon").get(0);

	Icon.className = "CForm_Upload_Icon";

	$("#" + ID).each(function(Index, Element) {
		new SWFUpload({ 
			upload_url				: CURL.GetLocation() + "AJAX.php?AJAX_Request=CData&AJAX_Type=System&AJAX_Action=UploadTemp",
			flash_url				: "./js/swfupload/Flash/swfupload.swf",
			file_size_limit			: "20 MB",

			button_image_url		: CURL.GetLocation() + "Theme/Default/Default/XPButtonUploadText_61x22.png",
			button_placeholder_id	: Element.id,
			button_width			: 61,
			button_height			: 22,
			button_window_mode		: "transparent",

			file_dialog_complete_handler : function(numFilesSelected, numFilesQueued) {
				if (numFilesSelected > 0) {
					$("#" + this.customSettings.cancelButtonId).attr("disabled", false);
				}

				this.startUpload();
			},
			upload_start_handler	: function(file) {
				Icon.className = "CForm_Upload_Icon_Progress";

				return true;
			}, 
			upload_progress_handler : function(file, bytesLoaded, bytesTotal) {
				var Percent = (bytesLoaded / bytesTotal) * 100;
					Percent = Percent.toFixed(2);

				var Stats = this.getStats();

				var NumFiles = Stats.files_queued + Stats.successful_uploads;

				$(Icon).html("(File: " + (Stats.successful_uploads + 1) + "/" + NumFiles + ") " + Percent + "%");
			},
			upload_error_handler	: function(file, errorCode, message) {
				alert("There was an error uploading your file : (" + errorCode + ") : " + message);

				$(Icon).html("");

				Icon.className = "CForm_Upload_Icon_Error";

				return true;
			},
			upload_success_handler	: function(file, serverData) {
				var Parts = explode("\n", serverData, 2);

				Parts[0] = intval(Parts[0]);

				$(Icon).html("");

				if(Parts[0] <= 0) {
					alert("There was an error uploading your file : " + Parts[1] + "\nComplete Response : " + serverData);

					Icon.className = "CForm_Upload_Icon_Error";
				}else{
					Icon.className = "CForm_Upload_Icon_Done";

					Callback(Parts[1], file["name"]);
				}

				this.startUpload();

				return true;
			},
			upload_complete_handler : function(file) {
			},
			queue_complete_handler	: function(numFilesUploaded) {
			}
		}); 
	});
}

//-----------------------------------------------------------------------------
CForm.AddDragUploadControl = function(ID, DragClass, Callback) {
	if(DragClass != "") {
		$("#" + ID).get(0).addEventListener("dragenter", function(e) {
			$("#" + ID).addClass(DragClass);
		}, false);

		$("#" + ID).get(0).addEventListener("dragexit", function(e) {
			$("#" + ID).removeClass(DragClass);
		}, false);
	}

	$("#" + ID).get(0).addEventListener("drop", function(e) {
	    var DataTransfer	= e.dataTransfer;
	    var Files			= DataTransfer.files;

		e.stopPropagation();
		e.preventDefault();

		if(Files.length <= 0) {
			//Supposed to Handle Data
			//DataTransfer
		}else{
			for (var i = 0; i < Files.length;i++) {
				(function(File) {
					var xhr				= new XMLHttpRequest();
					var BinaryReader	= new FileReader();

					BinaryReader.onload = function(File) {
						var boundary = '------multipartformboundary' + (new Date).getTime();
						var dashdash = '--';
						var crlf     = '\r\n';

						var builder = '';

						builder += dashdash;
						builder += boundary;
						builder += crlf;

						builder += 'Content-Disposition: form-data; name="Filedata"';
						if (File.fileName) {
						  builder += '; filename="' + File.fileName + '"';
						}
						builder += crlf;

						builder += 'Content-Type: application/octet-stream';
						builder += crlf;
						builder += crlf; 

						builder += File.target.result; //File.getAsBinary();
						builder += crlf;

						builder += dashdash;
						builder += boundary;
						builder += crlf;

						builder += dashdash;
						builder += boundary;
						builder += dashdash;
						builder += crlf;

						xhr.open("POST", CURL.GetLocation() + "AJAX.php?AJAX_Request=CData&AJAX_Type=System&AJAX_Action=UploadTemp", true);
						xhr.setRequestHeader('content-type', 'multipart/form-data; boundary=' + boundary);
						xhr.sendAsBinary(builder);        
						
						xhr.onload = function(e2) { 
							var Parts = explode("\n", xhr.responseText);
							
							if(parseInt(Parts[0]) == 0) {
								alert(Parts[1]);
							}else{
								if(Callback) {
									Callback(Parts[1], File.fileName);
								}
							}
						};
					};

					BinaryReader.readAsBinaryString(File);
				})(Files[i]);
			}
		}
	}, false);

	$("#" + ID).get(0).addEventListener("dragover", function(e) {
		e.preventDefault();
	}, false);
}

//=============================================================================
CForm.AddCCControl = function(JID) {
	for(var i = 1;i < 4;i++) {
		$("#" + JID + i).data("Pos", i);

		$("#" + JID + i).bind("keydown", function(e) {
			var Pos = parseInt($(this).data("Pos"));

			if($(this).attr("value").length >= 4) {
				$("#" + JID + (Pos + 1)).focus();
			}
		});
	}
}

//=============================================================================
CForm.Button = {}

//-----------------------------------------------------------------------------
CForm.Button.OnMouseDown = function(Element) {
	if(Element.hasChildNodes() == false) return;

	for(var i = 0;i < Element.childNodes.length;i++) {
		var Child = Element.childNodes[i];

		if(Child.className == "CForm_Button_Left") {
			Child.style.backgroundPosition = "-12px 0px";
		}else
		if(Child.className == "CForm_Button_Right") {
			Child.style.backgroundPosition = "-18px 0px";
		}else
		if(Child.className == "CForm_Button_Content") {
			Child.style.backgroundPosition = "0px -52px";
		}
	}
}

//-----------------------------------------------------------------------------
CForm.Button.OnMouseUp = function(Element) {
	if(Element.hasChildNodes() == false) return;

	for(var i = 0;i < Element.childNodes.length;i++) {
		var Child = Element.childNodes[i];

		if(Child.className == "CForm_Button_Left") {
			Child.style.backgroundPosition = "0px 0px";
		}else
		if(Child.className == "CForm_Button_Right") {
			Child.style.backgroundPosition = "-6px 0px";
		}else
		if(Child.className == "CForm_Button_Content") {
			Child.style.backgroundPosition = "0px -26px";
		}
	}
}

//=============================================================================
$(CForm.OnInit);

//=============================================================================
//=============================================================================
CShippingMethods = {};

//=============================================================================
CShippingMethods.Package = function() {
	var self = this;

	self.Length	= 0;
	self.Width	= 0;
	self.Height = 0;
	self.Pounds = 0;
}

//=============================================================================
CShippingMethods.Class = function() {
	var self		= this;

	var Packages	= Array();

	var Name		= "";
	var Service		= "";

	var OriginZipcode	= 0;
	var OriginCountry	= "";

	var DestinationZipcode	= 0;
	var DestinationCountry	= "";

	//-------------------------------------------------------------------------
	self.SetOrigin = function(Zipcode, Country) {
		OriginZipcode	= Zipcode;
		OriginCountry	= Country;
	}

	//-------------------------------------------------------------------------
	self.SetDestination = function(Zipcode, Country) {
		DestinationZipcode	= Zipcode;
		DestinationCountry	= Country;
	}

	//-------------------------------------------------------------------------
	self.SetShippingMethod = function(NewName, NewService) {
		Name	= NewName;
		Service = NewService;
	}

	//-------------------------------------------------------------------------
	self.AddPackage = function(Length, Width, Height, Pounds) {
		var Package = new CShippingMethods.Package();

		Package.Length	= Length;
		Package.Width	= Width;
		Package.Height	= Height;
		Package.Pounds	= Pounds;

		Packages.push(Package);
	}

	//-------------------------------------------------------------------------
	self.GetCost = function(Callback) {
		var Parms = Array();

		Parms["Service"]			= Service;

		Parms["OriginCountry"]		= OriginCountry;
		Parms["OriginZipcode"]		= OriginZipcode;

		Parms["DestinationCountry"]	= DestinationCountry;
		Parms["DestinationZipcode"] = DestinationZipcode;

		for(var i = 0;i < Packages.length;i++) {
			Parms["Package_" + i + "_Length"]	= Packages[i].Length;
			Parms["Package_" + i + "_Width"]	= Packages[i].Width;
			Parms["Package_" + i + "_Height"]	= Packages[i].Height;
			Parms["Package_" + i + "_Pounds"]	= Packages[i].Pounds;
		}

		function OnDone(Code, Content) {
			if(Code == 1) {
				Callback(Content);
			}else{
				Callback("Bad Shipping Method : " + Content);
			}
		}

		CAJAX.Add(Name, "ShippingMethod", "GetCost", Parms, OnDone);
	}
};

//=============================================================================

