(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);
if(!register_regex_rule)var register_regex_rule="[a-zA-Z0-9_-]";if(!register_regex_message)var register_regex_message="Your username may only contain letters and numbers (no spaces)";if(!register_username_unique_message)var register_username_unique_message="This username is already taken";if(!register_email_unique_message)var register_email_unique_message="This e-mail address is already in use";if(!ADMIN)var ADMIN=false;if(!links_external_window)var links_external_window=0;if(!links_admin_window)var links_admin_window=0;if(!texteditor_links_suggestions)var texteditor_links_suggestions=0;if(!include)var include={};$(document).ready(function(){refreshIt();nest();png();if(links_external_window==1){var d=url_base(window.location.host);$("a[href^=http]").each(function(){if(this.href.indexOf(d)==-1)$(this).attr('target','_blank');});}
if(links_admin_window==1){var url=window.location.pathname;if(url.indexOf('/admin/')!=-1){$("a[href^=http]").each(function(){if(this.href.indexOf('/admin/')==-1&&this.href.indexOf('logout')==-1)$(this).attr('target','_blank');});}}});function refreshIt(tb){if(tb!=1)thickbox();else{rows();counter();texteditor();keep();map();messages();validate();tables();calendar();swfupload();sortable();rating();scroller();suggestions();quicksearch();buttons();fancybox();colorbox();tagIt();tips();defaults();crop();}}
function loader(div,c){var d={text:"Loading..",image:1,image_url:DOMAIN+"core/images/ajax-loader.gif",fade:0,fade_speed:500,fade_opacity:.3,position:'over'}
c=$.extend(d,c);if(div.substr(0,1)!="#"&&div.substr(0,1)!=".")div="#"+div;var html=$(div).html();if(c.position=="over"){var h=$(div).height();if(h<=5)c.position="left";else{var w=$(div).width();$(div).prepend("<div class='loader'><div class='loader-image'>"+(c.image==1?"<img src='"+c.image_url+"' alt='..' /> ":"")+c.text+"</div><div class='loader-div"+(c.fade==1?" loader-fade":"")+"' style='width:"+w+"px;height:"+h+"px;'></div></div>");if(c.fade==1)$(div+' div.loader-fade').fadeTo(c.fade_speed,(1-(1*c.fade_opacity)));}}
if(c.position=="replace")$(div).html((c.image==1?"<img src='"+c.image_url+"' alt='..' class='loader' /> ":"")+c.text);if(c.position=="left"||c.position=="right"||c.position=="center")$(div).html("<div style='text-align:"+c.position+";'>"+(c.image==1?"<img src='"+c.image_url+"' alt='..' class='loader' /> ":"")+c.text+"</div>");}
function pageIt(id,p){$('#pages_'+id+'_counter').val(p);$('#pages_'+id+' .p-current').removeClass('selected p-selected');$('#pages_'+id+'_'+p).addClass('selected p-selected');}
function confirmIt(text,url){if(confirm(text)){location.replace(url);}}
function debugIt(text){$('#debugger').append(text);}
function toggleIt(id,c){var d={animiation:"slide",speed:400,class_open:"",class_closed:"",heading:"",heading_class_open:"toggle_open",heading_class_closed:"toggle_closed"}
c=$.extend(d,c);e=$('#'+id);if(e.is(':visible')){if(c.animiation=="slide")e.slideUp(c.speed);else if(c.animiation=="fade")e.fadeOut(c.speed);else e.hide();if(x(c.class_open)||x(c.class_closed))e.addClass(c.class_closed).removeClass(c.class_open);if(x(c.heading))$("#"+c.heading).addClass(c.heading_class_closed).removeClass(c.heading_class_open);}
else{if(c.animiation=="slide")e.slideDown(c.speed);else if(c.animiation=="fade")e.fadeIn(c.speed);else e.show();if(x(c.class_open)||x(c.class_closed))e.addClass(c.class_open).removeClass(c.class_closed);if(x(c.heading))$("#"+c.heading).addClass(c.heading_class_open).removeClass(c.heading_class_closed);}}
function showIt(div,time){$("#"+div).show();}
function hideIt(div,time){$("#"+div).hide();}
function checkNested(id){var checked=0;$('#checkbox_'+id+':checked').each(function(){$('#checkboxes_'+id+' input').attr('checked','checked');checked=1;});if(checked==0)$('#checkboxes_'+id+' input').removeAttr('checked');}
function allIt(id){var e;var tag;$('#'+id).each(function(){e=$(this);tag=this.tagName;});if(e){var v=e.val();if(v=='-all-'){if(tag=="SELECT"){$("#"+id+" option").attr("selected","selected");$("#"+id+" option[value='-all-']").removeAttr('selected');$("#"+id+" option[value='']").removeAttr('selected');}
if(tag=="INPUT"){var name=e.attr('name');var ischecked=0;$("#"+id+":checked").each(function(){$("input."+id).attr("checked","checked");ischecked=1;});if(ischecked==0){$("input[name='"+name+"']").removeAttr("checked");$("input."+id).removeAttr("checked");}}}}}
var keepTimer;function keep(){$('.keep').hover(function(){if(keepTimer)clearTimeout(keepTimer);var content=$(this).metadata().keepContent;var content_class=$(this).metadata().keepContentClass;$('.'+content_class).hide();$('#'+content).show();},function(){var content=$(this).metadata().keepContent;keepTimer=setTimeout('hideIt("'+content+'");',400);});}
function tabIt(tabClass,tabId,contentClass,contentId){$("li."+tabClass).removeClass('selected');if(tabId)$("#"+tabId).addClass('selected');if(contentClass)$("."+contentClass).hide();if(contentId)$("#"+contentId).show();}
function submitIt(f){var s=$(f).find("input[type='submit']");$(s).after("<img src='"+DOMAIN+"core/images/ajax-loader.gif' class='loader' />");$('img.loader').fadeTo(100,1,function(){f.submit();$(s).attr("disabled","disabled").fadeTo("normal",0.4);});}
function editInline(div,module,id,column,c){var _c=JSON.stringify(c);$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=editInline&div='+div+'&module='+module+'&id='+id+'&column='+column+'&c='+_c,success:function(html){$('#'+div).html(html);calendar();$('#'+div+'_inline').focus().keypress(function(e){if(e.which==13)saveInline(1,div,module,id,column,c);});var calendar=html.split("calendar");if(!c.buttons&&!calendar[1]){$('#'+div+'_inline').blur(function(){$('#'+div+'_inline').animate({opacity:1.0},300,function(){saveInline(1,div,module,id,column,c);});});}}});}
function saveInline(save,div,module,id,column,c){var _c=JSON.stringify(c);var value;var v=$('#'+div+'_inline');if(v.type=="radio"||v.type=="checkbox"){if(v.checked==true)value=v.value;}
else value=encodeURIComponent($(v).val());$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=saveInline&save='+save+'&value='+value+'&div='+div+'&module='+module+'&id='+id+'&column='+column+'&c='+_c,success:function(html){$('#'+div).html(html);if(x(c.redirect))location.assign(c.redirect);thickbox();}});}
function suggestions(){if(in_array('core/js/jquery.autocomplete.js',include)){$('input[className^="suggest"]').each(function(){var type=$(this).attr('class');$(this).autocomplete(DOMAIN+"?ajaxRequest=suggestIt&type="+type,{minChars:2});});}}
var tags;function tagIt(div){if(in_array('core/js/jquery.autocomplete.js',include)){if(div==null)div='tags';$('input.tag').unautocomplete();var r=Math.floor(Math.random()*9999);if(tags){$('input.tag').autocomplete(tags,{minChars:0,matchContains:true,autoFill:false,formatItem:function(row){return row.name+' <span class="tiny">'+row.note+'</span>';},formatMatch:function(row,i,max){return row.name+' '+row.username;}}).result(function(event,data,formatted){$(this).val('');$('#'+div).append("<div class='tag_green' id='tag_"+r+"'>Adding..</div>");$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=tagIt&module='+data.module+'&id='+data.id,success:function(html){$('#'+div+' #tag_'+r).replaceWith(html);messages();if(document.getElementById('tag_counter')){var c=$('#tag_counter').val();var test=html.split("class='_error");if(!test[1])$('#tag_counter').val((c*1)+1);if($('label.error').is(':visible'))$(".require").valid();}}});});}}}
function untagIt(div,module,id){if(in_array('core/js/jquery.autocomplete.js',include)){removeIt(div);$('#check_'+module+'_'+id+'_text').slideDown(400);$('#check_'+module+'_'+id+'_input').removeAttr('checked');$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=untagIt&module='+module+'&id='+id});var c=$('#tag_counter').val();if(c)$('#tag_counter').val((c*1)-1);}}
function checkIt(module,id,div){if(div==null)div='tags';$('#check_'+module+'_'+id+'_text').slideUp(400);var r=Math.floor(Math.random()*9999);$('#'+div).append("<div class='tag_green' id='tag_"+r+"'>Adding..</div>");$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=tagIt&module='+module+'&id='+id,success:function(html){$('#'+div+' #tag_'+r).replaceWith(html);messages();if(document.getElementById('tag_counter')){var c=$('#tag_counter').val();var test=html.split("class='_error");if(!test[1])$('#tag_counter').val((c*1)+1);if($('label.error').is(':visible'))$(".require").valid();}}});}
function removeIt(div,text){if(str_replace('#','',div)==div&&str_replace('.','',div)==div)div="#"+div;if(text){if(confirm(text)){$(div).fadeOut(500,function(){$(this).remove();rows();});}}
else $(div).fadeOut(500,function(){$(this).remove();rows();});}
function deleteIt(text,div,table,key,id,redirect){if(div.substr(0,1)!="#"&&div.substr(0,1)!=".")div="#"+div;if(confirm(text)){$(div).fadeOut(500,function(){$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=deleteIt&table='+table+'&div='+div+'&id='+id+'&key='+key,success:function(html){if(html.length>0)$(div).html(html);else $(div).remove();if(x(redirect))location.assign(redirect);else{var redirect=$(div+' #redirect').val();if(x(redirect))location.assign(redirect);}
rows();}});});}}
function deactivateIt(text,div,table,column,key,id,value,redirect){if(confirm(text)){if(!value||value=="undefined")value=2;$('#'+div).fadeOut(500,function(){$(this).remove();$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=deactivateIt&table='+table+'&column='+column+'&div='+div+'&key='+key+'&id='+id+'&value='+value,success:function(html){if(redirect!=""&&redirect!="undefined"&&redirect!=undefined&&redirect)location.assign(redirect);}});rows();});}}
var saveItStatus={};function saveIt(form,div,loc,method,auto,redirect,loading,div2,preview){if(saveItStatus[form]==1){setTimeout(function(){saveIt(form,div,loc,method,auto,redirect,loading,div2,preview)},500);}
else{saveItStatus[form]=1;var vals;for(instance in CKEDITOR.instances)CKEDITOR.instances[instance].updateElement();$('#'+form+' :input').each(function(){if(this.type=="radio"||this.type=="checkbox"){if(this.checked==true)vals+='&'+this.name+'='+encodeURIComponent(this.value);}
else if(this.type=="select-multiple"){var name=this.name;$("option:selected",this).each(function(i,selected){vals+='&'+name+'='+encodeURIComponent($(selected).val())});}
else vals+='&'+this.name+'='+encodeURIComponent(this.value);});if(loading==1)loader(div);var data='ajaxRequest=saveIt'+(auto==1?"Auto":(preview==1?"Preview":""))+'&form='+form+'&div='+div+vals;if(method==null)method='POST';if(method=='GET'){var url=DOMAIN+'?'+data;var data='';}
if(method=='POST'){var url=DOMAIN;var data=data;}
$.ajax({type:method,url:url,data:data,success:function(html){if(str_replace("comment","",form)!=form){$("#"+form+" :input").not('input[type=submit], input[type=button]').val('');$("#"+form).parents("div.comment-reply:first").slideUp(450);}
if(form=="contacts_add"||form=="contact_add"){debugIt('<xmp>'+html+'</xmp>');var s=html.split('|||');$("#"+div).html(s[0]);if(s[1])$("#tags").append(s[1]);if(document.getElementById('tag_counter')){var c=$('#tag_counter').val();$('#tag_counter').val((c*1)+1);if($('#'+form+' label.error').is(':visible'))$(".require").valid();}
if(form=="contacts_add"){$('#contacts_get input[name=email]').val("");$('#contacts_get input[name=password]').val("");}
if(form=="contact_add")$('#contact_add input[name=email]').val("");}
else if(form=="task_form"){var s=html.split('|||');$("#"+div).html(s[0]);if(s[1])$("#tasks").html(s[1]);}
else if(form=="canvas_shape_form"){var s=html.split('|||');$("#"+div).html(s[0]);if(s[1])$("#"+div2).replaceWith(s[1]);}
else if(auto==1||preview==1){if(html)$('#'+form+'_id').html(html);debugIt("<xmp>"+html+"</xmp>");if(preview==1){var preview_url=$('#'+form+'_id #preview_url').val();window.open(preview_url);}}
else{if(loc=="prepend")$('#'+div).prepend(html);else if(loc=="append")$('#'+div).append(html);else if(loc=="replace")$('#'+div).replaceWith(html);else $("#"+div).html(html);}
if($('#tb_close').length>0){tb_remove();$('#tb_close').remove();}
saveItStatus[form]=0;if(redirect!=""&&redirect!="undefined"&&redirect!=undefined&&redirect)location.assign(redirect);if(form!="auto"&&auto!=1){var s=$("#"+form+" input[type='submit']").fadeTo("normal",1.0).removeAttr("disabled");$('img.loader').each(function(){$(this).remove();});refreshIt();}},error:function(data,status,e){saveItStatus[form]=0;}});}}
function updateIt(table,column,key,id){$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=updateIt&table='+table+'&column='+column+'&key='+key+'&id='+id,success:function(html){var array=html.split('|||');for(var i in array){if(!(i%2)){var j=(i*1)+1;if(array[j]){$('#'+array[i]).html(array[j]);}}}}});}
function scroller(c){$('ul.scroller').each(function(){scrollerScroll($(this),c);});}
function scrollerScroll(scroller,c){if(typeof scroller!="object"){if(scroller.substr(0,1)!="#"&&scroller.substr(0,1)!=".")scroller="#"+scroller;scroller=$(scroller);}
if(!scroller.hasClass("scroller-div")){var d={speed:500,opacity:.3,visible:0,auto:0,auto_speed:5000,auto_pause:5000,auto_rebound_speed:1000,retry:0,retry_pause:200,retry_limit:5}
c=$.extend(d,c);if(c.retry_pause<50)c.retry_pause=50;if(c.retry_limit>999)c.retry_limit=999;var container_w=scroller.width();if(container_w==0&&c.retry<c.retry_limit){var id=element_id(scroller,'scroller-');setTimeout("scrollerScroll('#"+id+"',{retry:"+(c.retry+1)+"})",c.retry_pause);}
else if(container_w){var w=0;var h=0;var total_w=0;scroller.addClass('scroller-div');var items=scroller.children('li').size();for(i=1;i<=items;i++){var current_item=$('li:nth-child('+i+')',scroller);current_item.addClass('scroller-'+i+' {scrollerid:'+i+'}');var item_w=current_item.width()*1;var item_h=current_item.height()*1;if((w+item_w)<=container_w){w+=item_w;current_item.addClass('scroller-visible');c.visible++;}
else current_item.addClass('scroller-invisible');if(item_h>h)h=item_h;total_w+=item_w;}
container_w=w;scroller.wrap("<div class='scroller-wrapper'></div>").wrap("<div class='scroller-container'></div>");var wrapper=scroller.parents('.scroller-wrapper');var container=scroller.parents('.scroller-container');wrapper.css({width:container_w+"px",height:h+"px",overflow:'hidden',position:'relative'});container.css({width:container_w+"px",height:h+"px",overflow:'hidden',position:'relative'});scroller.css({width:total_w,position:'absolute',left:0,top:0});wrapper.prepend("<div class='scroller-left'></div>");wrapper.append("<div class='scroller-right'></div>");container.css({left:$('div.scroller-left',wrapper).width()+"px"});wrapper.css({width:(wrapper.width()+($('div.scroller-left',wrapper).width()+$('div.scroller-right',wrapper).width()))+"px"});var scroller_left=$('div.scroller-left',wrapper);var scroller_right=$('div.scroller-right',wrapper);scrollerRemaining(scroller,c);scroller_left.click(function(){scrollerClick('left',scroller,c);});scroller_right.click(function(){scrollerClick('right',scroller,c);});}}}
function scrollerClick(direction,scroller,c){var wrapper=scroller.parents('.scroller-wrapper');$('.scroller-'+direction,wrapper).unbind('click');if(direction=="left")var next=$('.scroller-visible',scroller).prev('.scroller-invisible');if(direction=="right")var next=$('.scroller-visible',scroller).next('.scroller-invisible');if(next.width()){var i=next.metadata().scrollerid;if(direction=="left")var new_left=(str_replace("px","",scroller.css('left'))*1)+(next.width()*1);if(direction=="right")var new_left=(str_replace("px","",scroller.css('left'))*1)-(next.width()*1);scroller.animate({left:new_left+"px"},c.speed,function(){$('.scroller-'+direction,wrapper).click(function(){scrollerClick(direction,scroller,c);});});next.addClass('scroller-visible').removeClass('scroller-invisible');if(direction=="left")$('.scroller-'+(i+c.visible),scroller).removeClass('scroller-visible').addClass('scroller-invisible');if(direction=="right")$('.scroller-'+(i-c.visible),scroller).removeClass('scroller-visible').addClass('scroller-invisible');scrollerRemaining(scroller,c);}
else{$('.scroller-'+direction,wrapper).click(function(){scrollerClick(direction,scroller,c);});}}
function scrollerRemaining(scroller,c){var wrapper=scroller.parents('.scroller-wrapper');if($('.scroller-visible',wrapper).nextAll('.scroller-invisible').length>0)$('div.scroller-right',wrapper).fadeTo(100,1);else $('div.scroller-right',wrapper).fadeTo(100,c.opacity);if($('.scroller-visible',wrapper).prevAll('.scroller-invisible').length>0)$('div.scroller-left',wrapper).fadeTo(100,1);else $('div.scroller-left',wrapper).fadeTo(100,c.opacity);}
var scrolling=new Array();var scrolls=new Array();var scrolls_start=new Array();function scrollIt(div,direction,html,number,c){if(div.substr(0,1)!="#"&&div.substr(0,1)!=".")div="#"+div;var id=div.substr(1);if(!scrolling[div])scrolling[div]=0;if(!scrolls_start[div])scrolls_start[div]=0;if(!scrolls[div])scrolls[div]=new Array();scrolls[div][scrolls_start[div]]=new Array();if(!x(c))c={}
if(!c['scroll_speed'])c['scroll_speed']=1200;if(!c['animation'])c['animation']='swing';if(!number||number==null){number=scrolls_start[div];scrolls[div][number]['direction']=direction;scrolls[div][number]['html']=html;scrolls_start[div]+=1;}
if(scrolling[div]==0){scrolling[div]=1;var zero=0;var parent=$(div);var parent_w=parent.width();var parent_h=parent.height();parent.css({position:'relative',overflow:'hidden',height:parent_h+'px',width:parent_w+'px'});var scroller=$('#scroll_inner_'+id);if(scroller.length==0){parent.wrapInner('<div id="scroll_inner_'+id+'" />');var scroller=$('#scroll_inner_'+id);scroller.wrapInner('<div />');}
var old_content=scroller.children('div:nth-child(1)');var child_w=old_content.width();var child_h=old_content.height();scroller.css({'position':'absolute','width':(child_w*2)+'px'});if(direction=="left")scroller.css({'left':zero+'px','right':'auto'});if(direction=="right")scroller.css({'right':zero+'px','left':'auto'});if(direction=="up")scroller.css({'top':zero+'px','bottom':'auto'});if(direction=="down")scroller.css({'bottom':zero+'px','top':'auto'});old_content.css({'position':'absolute','width':child_w+'px','height':child_h+'px'});if(direction=="left")old_content.css({'left':zero+'px','right':'auto'});if(direction=="right")old_content.css({'right':zero+'px','left':'auto'});if(direction=="up")old_content.css({'top':zero+'px','bottom':'auto'});if(direction=="down")old_content.css({'bottom':zero+'px','top':'auto'});if(html){scroller.append('<div id="scroll_content_new_'+id+'">'+html+'</div>');var new_content=scroller.children('#scroll_content_new_'+id);new_content.css({'position':'absolute','width':child_w+'px','height':child_h+'px'});if(direction=="left")new_content.css({'left':(zero+child_w)+'px','right':'auto'});if(direction=="right")new_content.css({'right':(zero+child_w)+'px','left':'auto'});if(direction=="up")new_content.css({'top':(zero+child_h)+'px','bottom':'auto'});if(direction=="down")new_content.css({'bottom':(zero+child_h)+'px','top':'auto'});}
if(direction=="left")scroller.animate({'left':(zero-child_w)},c['scroll_speed'],c['animation'],function(){scrollItFinish(div,number,old_content,new_content);});if(direction=="right")scroller.animate({'right':(zero-child_w)},c['scroll_speed'],c['animation'],function(){scrollItFinish(div,number,old_content,new_content);});if(direction=="up")scroller.animate({'top':(zero-child_h)},c['scroll_speed'],c['animation'],function(){scrollItFinish(div,number,old_content,new_content);});if(direction=="down")scroller.animate({'bottom':(zero-child_h)},c['scroll_speed'],c['animation'],function(){scrollItFinish(div,number,old_content,new_content);});refreshIt();}}
function scrollItFinish(div,number,old_content,new_content){if(old_content)old_content.remove();if(new_content)new_content.removeAttr('id');scrolling[div]=0;if(scrolls[div][number])scrolls[div][number]=null;if(scrolls[div][number+1])scrollIt(div,scrolls[div][number+1]['direction'],scrolls[div][number+1]['html'],(number+1));scrolling[div]=0;}
function loadIt(div,type,c){if(div.substr(0,1)!="#"&&div.substr(0,1)!=".")div="#"+div;if(c.loading==1)loader(div,{text:c.loading_text,fade:c.loading_fade,fade_speed:c.loading_fade_out_speed,position:c.loading_position});if(c.loading_fade==1&&!c.loading_fade_in_speed)c.loading_fade_in_speed=400;if(!c.fade_out_speed)c.fade_out_speed=300;if(!c.fade_in_speed)c.fade_in_speed=400;if(!c.vars)c.vars=null;$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=loadIt&div='+div+'&type='+type+'&id='+c.id+'&animation='+c.animation+'&'+c.vars,success:function(html){if(c.loading_fade==1)$(div+' div.loader-div-fade').fadeTo(c.loading_fade_in_speed,1,function(){$(div+' .loader').remove();});else if(c.loading==1)$(div+' .loader').remove();if(c.loc=="prepend")$(div).prepend(html);else if(c.loc=="append")$(div).append(html);else if(c.loc=="replace"){if(c.animation=="fade"){$(div).fadeTo(c.fade_out_speed,.01,function(){$(this).replaceWith(html).css('opacity',.01).fadeTo(c.fade_in_speed,1);});}
else $(div).replaceWith(html);}
else{if(c.animation=="scroll")scrollIt(div,c.direction,html);else if(c.animation=="fade"){$(div).fadeTo(c.fade_out_speed,.01,function(){$(this).html(html).fadeTo(c.fade_in_speed,1);});}
else $(div).html(html);}
if(c.animation!="scroll"){refreshIt();}}});}
function updateIt(table,column,key,id){$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=updateIt&table='+table+'&column='+column+'&key='+key+'&id='+id,success:function(html){var array=html.split('|||');for(var i in array){if(!(i%2)){var j=(i*1)+1;if(array[j]){$('#'+array[i]).html(array[j]);}}}}});}
function uploadIt(div,input,path,vars){loader(div,{text:'Uploading..',fade:1,fade_speed:300});if(!vars)vars=null;var form=$('#'+input).parents('form:first');var action=form.attr('action');if(str_replace('javascript:','',action)!=action)$("input[type='submit']",form).fadeTo("normal",0.4).attr('disabled','disabled');$.ajaxFileUpload({url:DOMAIN+"?ajaxRequest=uploadIt&path="+path+"&input="+input+"&"+vars,secureuri:false,fileElementId:input,dataType:'script',success:function(data,status){$("#"+div).html(data);$("#"+input).val("").removeClass('required');$("input[type='submit']",form).fadeTo("normal",1.0).removeAttr("disabled");refreshIt();},error:function(data,status,e){if(ADMIN==true)alert(e);}});return false;}
function ableIt(active,div,button,c){if(active==1)$('#'+div).fadeTo("normal",1);else $('#'+div).fadeTo("normal",0.3);var json=JSON.stringify(c);if(c.table){$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=ableIt&active='+active+'&div='+div+'&button='+button+'&c='+json,success:function(html){$('#'+button).html(html);refreshIt();}});}}
function lockIt(locked,button,c){loader(button,{text:"",image_url:DOMAIN+"core/images/ajax-loader-sm.gif",position:"replace"});var json=JSON.stringify(c);if(c.table){$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=lockIt&locked='+locked+'&button='+button+'&c='+json,success:function(html){$('#'+button).html(html);refreshIt();}});}}
function hideAudio(div,file){$('#'+div).html("");}
function defaults(){$('input.default, textarea.default').focus(function(){if(this.defaultValue==this.value)$(this).val('').removeClass('default');}).blur(function(){if(!this.value)$(this).val(this.defaultValue).addClass('default');});}
function checkAll(c,classID){if(classID){if(c.checked)$('input[type=checkbox].'+classID).attr('checked','checked');else $('input[type=checkbox].'+classID).removeAttr('checked');}
else{if(c.checked)$('input[type=checkbox]').attr('checked','checked');else $('input[type=checkbox]').removeAttr('checked');}}
function tips(){$('a.tip:not(.tipped), img.tip:not(.tipped), div.tip:not(.tipped)').tooltip({track:true,delay:0,showURL:false}).addClass('tipped');}
function rows(){$('tbody tr.row:odd, div.row:odd, table.row:odd, td.row:odd, li.row:odd').addClass("odd").removeClass("even");$('tbody tr.row:even, div.row:even, table.row:even, td.row:even, li.row:even').addClass("even").removeClass("odd");if($.browser.msie){$('table.rows tbody tr:odd, div.rows div:odd, ul.rows li:odd').addClass("odd").removeClass("even");$('table.rows tbody tr:even, div.rows div:even, ul.rows li:even').addClass("even").removeClass("odd");}}
function map(){if(in_array('core/js/jquery.maps.js',include)){$('div.map:not(.mapped)').addClass('mapped').each(function(){var parent=$(this);var m=parent.children("._map");if(m.length==0){var m=$("<div class='_map'><div>").css({width:parent.css('width'),height:parent.css('height')});parent.append(m);}
var options={mapZoom:15,mapType:G_NORMAL_MAP,mapControl:'large',lat:0,lng:0,markers:{},markersRecenter:1,markersRezoom:1,markersCounter:0};var c=$.metadata.get(this);c=$.extend(options,c);c.mapCenter=[c.lat,c.lng];parent.children(':input').each(function(){if(this.name=="marker"){c.markers[c.markersCounter]=$.metadata.get(this);c.markersCounter+=1;}});m.jmap('init',c,function(map,element,options){if(c.address){m.jmap('SearchAddress',{'query':c.address,'returnType':'getLatLng'},function(result,options){m.jmap('MoveTo',{'mapCenter':[result.lat(),result.lng()]});});}
if(c.markers){var bounds=new GLatLngBounds();var markers=c.markers;for(i=0;i<c.markersCounter;i++){var marker=c.markers[i];if(marker){marker.i=i;if(marker.lat&&marker.lng)mapMarker(m,map,c,marker,bounds);else{m.jmap('SearchAddress',{'query':marker.address,'returnType':'getLocations','marker':marker},function(result,options){var valid=Mapifies.SearchCode(result.Status.code);var marker=options.marker;if(valid.success){var point=result.Placemark[0];marker.lat=point.Point.coordinates[1];marker.lng=point.Point.coordinates[0];if(!marker.html)marker.html=point.address;mapMarker(m,map,c,marker,bounds);}
else{debugIt('Error geocoding <em>'+marker.address+'</em> ('+str_replace('<br />',', ',marker.html)+')<br /> Message:'+valid.message+'<br /> Code: '+result.Status.code+'<br /> Request: '+result.Status.request+'<br />');}});}}}}});});}}
function mapDirections(id,div){if(!id)id=".map";if(!div)div="#directions";loader(div);var m=$(id).children('._map');if(m.length==0)var m=$(id);m.jmap('SearchDirections',{'query':'from: '+$('#driveFrom').val()+' to: '+$('#driveTo').val(),'panel':div},function(result,options){$(div+" .loader").remove();var valid=Mapifies.SearchCode(result.getStatus().code);if(valid.success){}
else $(div).html("<div class='none'>"+valid.message+"</div>");});return false;}
function mapMarker(m,map,c,marker,bounds){if(marker.lat&&marker.lng){var options={};options.pointLatLng=[marker.lat,marker.lng];if(marker.html)options.pointHTML=marker.html;if(marker.icon){var icon=new GIcon();if(!marker.icon.image)marker.icon.image="http://www.google.com/intl/en_us/mapfiles/ms/icons/red-dot.png";if(!marker.icon.width)marker.icon.width=12;if(!marker.icon.height)marker.icon.height=20;if(!marker.icon.anchor_x)marker.icon.anchor_x=(marker.icon.width*1)/2;if(!marker.icon.anchor_y)marker.icon.anchor_y=marker.icon.height;if(!marker.icon.shadow)marker.icon.shadow="http://chart.apis.google.com/chart?chst=d_map_pin_shadow";if(!marker.icon.shadow_width)marker.icon.shadow_width=34;if(!marker.icon.shadow_height)marker.icon.shadow_height=36;if(!marker.icon.info_anchor_x)marker.icon.info_anchor_x=(marker.icon.width*1)/2;if(!marker.icon.info_anchor_y)marker.icon.info_anchor_y=1;icon.image=marker.icon.image;icon.shadow=marker.icon.shadow;icon.size=new GSize(marker.icon.width,marker.icon.height);icon.iconAnchor=new GPoint(marker.icon.anchor_x,marker.icon.anchor_y);icon.shadowSize=new GSize(marker.icon.shadow_width,marker.icon.shadow_height);icon.infoWindowAnchor=new GPoint(marker.icon.info_anchor_x,marker.icon.info_anchor_y)
options.pointIcon=icon;}
m.jmap('AddMarker',options);bounds.extend(new GLatLng(marker.lat,marker.lng));if(bounds){if(c.markersRecenter)var new_center=bounds.getCenter();else var new_center=map.getCenter();if(c.markersRezoom){var new_zoom=map.getBoundsZoomLevel(bounds);if(new_zoom>17)new_zoom=17;}
else var new_zoom=map.getZoom();m.jmap('MoveTo',{'mapCenter':[new_center.lat(),new_center.lng()],'mapZoom':new_zoom});}}}
function calendar(){if(in_array('core/js/jquery.datepicker.js',include)){$('input.calendar:not(.calendared)').each(function(){$(this).simpleDatepicker({startdate:1900,enddate:2100}).addClass('calendared');});}}
function validate(){$('input.required:not(.norequired, input[type=hidden], input[type=checkbox], input[type=radio]), select.required:not(.norequired), textarea.required:not(.norequired)').after('<img src="'+DOMAIN+'core/images/required.gif" width="10" height="10" alt="Required" class="absmiddle" style="padding-left:1px;" />').addClass('norequired');$('form.require').each(function(){$(this).validate({submitHandler:function(form){submitIt(form);}});});$("form.register").each(function(){$(this).validate({rules:{user_name:{remote:DOMAIN+"?ajaxRequest=checkUsername",regex:register_regex_rule},user_email:{remote:DOMAIN+"?ajaxRequest=checkEmail"},user_confirm_password:{equalTo:"#user_password"}},messages:{user_name:{remote:register_username_unique_message,regex:register_regex_message},user_email:{remote:register_email_unique_message},user_confirm_password:{equalTo:"Your passwords don't match"}},submitHandler:function(form){submitIt(form);}});});}
function counter(){$('input.counter:not(.counted), textarea.counter:not(.counted)').each(function(){var maxlength=$(this).attr('maxlength');if(maxlength>0){var length=$(this).val().length;$(this).after("<span class='counter'><span title='You have typed "+length+" characters of the "+maxlength+" characters allowed'>"+length+"/"+maxlength+"</span></span>");$(this).keyup(function(){var new_length=$(this).val().length;var x=0;$(this).nextAll("span.counter").each(function(){if(x==0)$(this).html("<span title='You have typed "+new_length+" characters of the "+maxlength+" characters allowed'>"+new_length+"/"+maxlength+"</span>");x++;});});$(this).addClass('counted');}});}
function sortable(){$('div.sort, ul.sort').each(function(){if($(this).attr('id').length<=0)$(this).attr('id','sortable_'+Math.round(Math.random()*9999999));if($(".handle:not(.sortable)",this).length>0)var handle=".handle";else var handle="";$(this).sortable({items:'div.sortable, li.sortable',placeholder:'helper',handle:handle,opacity:0.5,stop:function(event,ui){var order='';var c=$(this).metadata();$('input.sorted',this).each(function(){order+='|'+this.value;});if(order)$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=orderIt&order='+order+(c['vars']?'&'+c['vars']:""),success:function(html){debugIt(html);}});rows();}});});$('div.sortThese, ul.sortThese').sortable({items:'div.sortThis, li.sortThis',placeholder:'helper',opacity:0.5,stop:function(){rows();}});$('table.sort:not(.sorted)').each(function(){$(this).children('tr:not(.sortable)').addClass('nodrag');if($(".handle:not(.sortable)",this).length>0)var handle="handle";else var handle="";$(this).addClass('sorted').tableDnD({dragHandle:handle,onDragClass:"sorting",onDrop:function(table,row){var order='';var c=$(table).metadata();$('input.sorted',table).each(function(){order+='|'+this.value;});if(order)$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=orderIt&order='+order+(c['vars']?'&'+c['vars']:""),success:function(html){debugIt(html);}});rows();}});});$('table.sortThese:not(.sorted)').each(function(){$(this).children('tr:not(.sortable)').addClass('nodrag');$(this).addClass('sorted').tableDnD({onDragClass:"sorting",onDrop:function(table,row){rows();}});});}
function tables(){if(in_array('core/js/jquery.datatables.js',include)){$('.datatable').each(function(){var module=$('input[name=module]',this).val();var section=$('input[name=section]',this).val();$(this).dataTable({"bProcessing":true,"bServerSide":true,"sAjaxSource":DOMAIN+"?ajaxRequest=data&module="+module+"&section="+section});});}}
function rating(){if(in_array('core/js/jquery.rating.js',include)){$('div.rating').each(function(){$("input",this).rating();});}}
function thickbox(){var plugin;if(in_array('core/js/jquery.colorbox.js',include))plugin="colorbox";else if(in_array('core/js/jquery.fancybox.js',include))plugin="fancybox";if(plugin){$("a.thickbox").filter(function(){return this.href.match(/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$|\.swf$|\.swf\?|^http:\/\/www\.youtube\.com\/v\/|^http:\/\/www\.youtube\.com\/embed\//);}).removeClass('thickbox').addClass(plugin);}
$('a.thickbox, area.thickbox, input.thickbox').each(function(i){$(this).unbind('click');});tb_init('a.thickbox, area.thickbox, input.thickbox');}
function fancybox(){var items=$(".fancybox:not(.fancyboxed)");if(in_array('core/js/jquery.fancybox.js',include)){items.each(function(){var d={'overlayOpacity':.75,'overlayColor':'#000','titlePosition':'over','centerOnScroll':true,'cyclic':true}
if(this.href.match(/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/)){d['type']="image";d['autoDimensions']=true;}
else if(this.href.match(/\.swf$|\.swf\?|^http:\/\/www\.youtube\.com\/v\/|^http:\/\/www\.youtube\.com\/embed\//)){d['type']="swf";d['titleShow']=false;d['autoDimensions']=true;d['swf']={allowscriptaccess:'always',allowFullScreen:true,quality:'high',wmode:'transparent'}}
else{d['width']=700;d['height']=440;d['autoDimensions']=false;}
c=$.extend(d,$(this).metadata());$(this).addClass('fancyboxed').fancybox(c);});}
else if(items.length>0){if(in_array('core/js/jquery.colorbox.js',include))$(".fancybox").removeClass('fancybox').addClass('colorbox');else{$(".fancybox").removeClass('fancybox').addClass('thickbox');thickbox();}}}
function colorbox(){var items=$(".colorbox:not(.colorboxed)");if(in_array('core/js/jquery.colorbox.js',include)){$(".colorbox:not(.colorboxed)").each(function(){var d={'opacity':.75,'initialWidth':500,'initialHeight':350,'iframe':false};if(this.href.match(/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/)){d['maxWidth']="95%";d['maxHeight']="95%";}
else if(this.href.match(/\.swf$|\.swf\?|^http:\/\/www\.youtube\.com\/v\/|^http:\/\/www\.youtube\.com\/embed\//)){d['iframe']=true;d['innerWidth']=600;d['innerHeight']=420;d['maxWidth']="95%";d['maxHeight']="95%";}
c=$.extend(d,$(this).metadata());$(this).addClass('colorboxed').colorbox(c);});}
else if(items.length>0){if(in_array('core/js/jquery.fancybox.js',include))$(".colorbox").removeClass('colorbox').addClass('fancybox');else{$(".colorbox").removeClass('colorbox').addClass('thickbox');thickbox();}}}
function crop(){if(in_array('core/js/jquery.jcrop.js',include)){$(".crop:not(.cropped)").addClass('cropped').each(function(){var id=element_id($(this),'crop_');var d={aspectRatio:0,bgOpacity:.2,onSelect:function(c){$('#'+id+'_x').val(c.x);$('#'+id+'_y').val(c.y);$('#'+id+'_w').val(c.w);$('#'+id+'_h').val(c.h);},onChange:function(c){$('#'+id+'_x').val(c.x);$('#'+id+'_y').val(c.y);$('#'+id+'_w').val(c.w);$('#'+id+'_h').val(c.h);}}
c=$.extend(d,$(this).metadata());$(this).after("<input type='hidden' id='"+id+"_x' value='' />").after("<input type='hidden' id='"+id+"_y' value='' />").after("<input type='hidden' id='"+id+"_w' value='' />").after("<input type='hidden' id='"+id+"_h' value='' />").after("<div class='crop-button'><input type='button' id='"+id+"_crop' value='Crop' style='margin-top:5px;' /></div>").Jcrop(c);$('#'+id+'_crop').click(function(){var c=$('#'+id).metadata();var data=c.url+'&x='+$('#'+id+'_x').val()+'&y='+$('#'+id+'_y').val()+'&w='+$('#'+id+'_w').val()+'&h='+$('#'+id+'_h').val();loader('crop-div',{text:'Cropping..'});$.ajax({type:'POST',url:DOMAIN,data:data,success:function(html){tb_remove();$('#'+c.div).html(html);refreshIt();}});});});}}
function quicksearch(){$('#quicksearch_q').liveUpdate('#quicksearch');$('select.quicksearch:not(.quicksearched)').each(function(){var id=element_id($(this),'quicksearch_');$(this).before("<input type='text' id='"+id+"_q' class='quicksearch default' value='Search..' style='margin-bottom:4px;' /><br />");$("#"+id+"_q").liveUpdate({parent:'#'+id,children:'option',placeholder:'Search..',nested:0});}).addClass('quicksearched');}
function texteditor(){if(MOBILE==false){$('textarea.texteditor:not(.textedited)').addClass('textedited').rte({css:[CSS_PUBLIC],style:'lwrte_body',controls_rte:default_toolbar,controls_html:html_toolbar});$('textarea.texteditor_basic:not(.textedited)').addClass('textedited').rte({css:[CSS_PUBLIC],style:'lwrte_body',controls_rte:basic_toolbar,controls_html:html_toolbar});$('textarea.texteditor_full:not(.textedited)').addClass('textedited').rte({css:[CSS_PUBLIC],style:'lwrte_body',controls_rte:full_toolbar,controls_html:html_toolbar});}
if(typeof CKEDITOR=="object"){$('textarea.ckeditor').removeClass('ckeditor').each(function(){var name=$(this).attr('name');delete CKEDITOR.instances[name];CKEDITOR.replace(name);});}}
function nest(){$('div.nest > ul').each(function(){var id=this.id;if(str_replace('navigator','',id)==id)var space=30;else var space=8;$(this).NestedSortable({accept:'nest-item',noNestingClass:"nonest-item",nestingPxSpace:space,opacity:.8,helperclass:'nest-helper',autoScroll:true,onChange:function(serialized){var module=$('#'+id+' input[name=module]').val();var parent=$('#'+id+' input[name=parent]').val();$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=nestIt&module='+module+'&parent='+parent+'&'+serialized[0].hash,success:function(html){debugIt(html);}});rows();}});});}
function swfupload(){$('.swfupload:not(.swfupload-created)').each(function(){var id=element_id($(this),'swfupload-');$(this).prepend("<div class='swfupload-button' id='swfupload-button-"+id+"'></div>");var info=$(".swfupload-info",this);if(info.length>0)info.attr("id","swfupload-info-"+id);else $(this).append("<div class='swfupload-info' id='swfupload-info-"+id+"'></div>");$(this).prepend("<input type='hidden' class='swfupload-counter' id='swfupload-counter-"+id+"' value='0' />");var d={upload_url:DOMAIN+"?ajaxRequest=uploadIt&flash=1",file_post_name:'file',file_types:"*",file_types_description:"Files",limit:1,instant_upload:1,flash_url:DOMAIN+"core/flash/libraries/swfupload/swfupload.swf",button_image_url:DOMAIN+"core/images/button-browse.png",button_width:73,button_height:23,button_placeholder:$("#swfupload-button-"+id)[0],debug:false};var c=$.extend(d,$(this).metadata());$(".swfupload-placeholder",this).hide();$(this).addClass("swfupload-created").swfupload(c).bind('fileQueued',function(event,file){debugIt('queing, file_id: '+file.id+'<br />');var listitem='<div class="swfupload-file {\'file_id\':\''+file.id+'\'}" id="swfupload-file-'+id+'-'+file.id+'" >'+'File: <em>'+(file.name.length>23?file.name.substr(0,23)+'..':file.name)+'</em> ('+Math.round(file.size/1024)+' KB) <span class="swfupload-file-progressvalue" ></span>'+'<div class="swfupload-file-progressbar" ><div class="swfupload-file-progress" ></div></div>'+'<span class="swfupload-file-status" >Pending</span>'+'<span class="swfupload-file-cancel i i-cancel"></span>'+'</div>';if(c.limit==1){var previous=$('.swfupload-file:first',this);if(previous.length>0){debugIt('previous: '+previous.metadata().file_id+'<br />');swfuploadCancel(id,previous.metadata().file_id,c);}
$("#swfupload-info-"+id).html(listitem);}
else $("#swfupload-info-"+id).append(listitem);swfuploadCount(id,c,1,'added to list');$("#swfupload-file-"+id+"-"+file.id+" .swfupload-file-cancel").bind('click',function(){swfuploadCancel(id,file.id,c);});var form=$('#'+id).parents('form:first');if(c.instant_upload==1){debugIt('instant upload, uploading<br />');$("input[type='submit']",form).fadeTo(200,0.4).attr('disabled','disabled');$(this).swfupload('startUpload');}
else{debugIt('non-instant upload, binding submit click<br />');$("input[type='submit']",form).fadeTo(200,1).removeAttr('disabled').next("img.loader").remove();$("input[type='submit']",form).unbind('click').click(function(){debugIt('submit clicked, starting upload<br />');swfuploadStart(id,c);$(this).fadeTo(200,0.4).attr('disabled','disabled').after("<img src='"+DOMAIN+"core/images/ajax-loader.gif' class='loader' />");return false;});}}).bind('fileQueueError',function(event,file,errorCode,message){debugIt("event = "+event+", file = "+file+", error code = "+errorCode+", message = "+message+"<br />");alert((c['error']?c['error']:"You are not allowed to upload this type of file here."));}).bind('fileDialogComplete',function(event,numFilesSelected,numFilesQueued){var queue=$("#swfupload-queue-"+id);if(queue.length==0){$("swfupload-info-"+id).prepend("<div class='swfupload-queue' id='swfupload-queue-"+id+"'></div>");var queue=$("#swfupload-queue-"+id);}
queue.text('Files Selected: '+numFilesSelected+' / Queued Files: '+numFilesQueued);}).bind('uploadStart',function(event,file){$("#swfupload-file-"+id+"-"+file.id+" span.swfupload-file-status").text('Uploading...');$("#swfupload-file-"+id+"-"+file.id+" span.swfupload-file-progressvalue").text('0%');}).bind('uploadProgress',function(event,file,bytesLoaded){var percentage=Math.round((bytesLoaded/file.size)*100);$("#swfupload-file-"+id+"-"+file.id+" div.swfupload-file-progress").css('width',percentage+'%');$("#swfupload-file-"+id+"-"+file.id+" span.swfupload-file-progressvalue").text(percentage+'%');if(percentage>=100){$("#swfupload-file-"+id+"-"+file.id+" span.swfupload-file-status").text('Processing...');$("#swfupload-file-"+id+"-"+file.id).addClass('swfupload-file-processing');}}).bind('uploadSuccess',function(event,file,serverData){debugIt('data id: '+serverData+'<br />');$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=loadIt&type=data&id='+serverData,success:function(serverData){debugIt('saved data: <xmp>'+serverData+'</xmp>');var item=$("#swfupload-file-"+id+"-"+file.id);item.find('div.swfupload-file-progress').css('width','100%');item.find('span.swfupload-file-progressvalue').text('100%');debugIt('adding success, about to fade<br />');item.addClass('swfupload-file-success').fadeOut(300,function(){debugIt('item hidden<br />');$(this).removeClass('swfupload-file').removeClass('swfupload-file-processing').removeClass('swfupload-file-success').html(serverData).fadeIn(300);debugIt('getting form<br />');var form=$('#'+id).parents('form:first');debugIt('getting count<br />');var count=swfuploadCount(id,c,-1,'compelted upload');debugIt('getting total count<br />');var count_total=swfuploadCountTotal(id,c);debugIt('upload complete (id = '+id+'), count = '+count+', count_total = '+count_total+'<br />');if(count_total>0)swfuploadStart(id,c);else{debugIt('finished uploading all<br />');if(c.instant_upload==1){$("input[type='submit']",form).fadeTo(200,1).removeAttr('disabled');}
if(c.instant_upload==0){$("input[type='submit']",form).next("img.loader").remove();form.submit();}}
debugIt('about to refresh jquery<br />');refreshIt();});$("#"+id+" .swfupload-placeholder").removeClass('required');$("#"+id+" label.error").hide();}});}).bind('uploadError',function(event,file,errorCode,message){debugIt('upload error. id: '+file.id+', name: '+file.name+', errorCode: '+errorCode+', message: '+message+'<br />');swfuploadCount(id,c,-1,'upload error');}).bind('uploadComplete',function(event,file){debugIt('upload complete<br />');});});}
function swfuploadStart(id,c){debugIt('starting upload for input '+id+'<br />');var form=$('#'+id).parents('form:first');debugIt('input '+id+'\'s insant_upload value: '+c.instant_upload+'<br />');if(c.instant_upload==1){var count=swfuploadCount(id,c);debugIt('input '+id+'\'s count: '+count+'<br />');if(count>0)$(this).swfupload('startUpload');else{debugIt('checking to see if all instant swfupload input\'s are complete<br />');var show=true;$('.swfupload-created',form).each(function(){var _c=$(this).metadata();var _id=$(this).attr('id');debugIt('other swfupload: id = '+_id+', instant_upload = '+_c.instant_upload+'<br />');if(_c.instant_upload==1){var _count=swfuploadCount(_id,_c);debugIt('other swfupload: id = '+_id+', count = '+_count+'<br />');if(_count>0){debugIt('other swfupload '+_id+' has items left to upload and is "instant_upload", do NOT enable submit<br />');show=false;}}});if(show==true)$("input[type='submit']",form).fadeTo(200,1).removeAttr('disabled');}}
else{$('.swfupload-created',form).each(function(){debugIt('starting upload for id = '+$(this).attr('id')+'<br />');$(this).swfupload('startUpload');});}}
function swfuploadCancel(id,file,c){var swfu=$.swfupload.getInstance('#'+id);swfu.cancelUpload(file);$("#swfupload-file-"+id+"-"+file).slideUp('fast');debugIt('cancelled file '+file+'<br />');}
function swfuploadCount(id,c,change,reason){var counter=$("#swfupload-counter-"+id);count=(counter.val()*1);if(change)count+=change;counter.val(count);debugIt('count ('+id+'): '+count+' ['+reason+']<br />');swfuploadCountTotal(id,c);return count;}
function swfuploadCountTotal(id,c){var form=$('#'+id).parents('form:first');var count=0;$('input.swfupload-counter',form).each(function(){count+=($(this).val()*1);});debugIt('total count: '+count+'<br />');if(count<=0){$("input[type='submit']",form).fadeTo(200,1).removeAttr('disabled').unbind('click').click(function(){form.submit();}).next("img.loader").remove();}
return count;}
function buttons(){$('div.button, li.button').mouseover(function(){$('div.buttons',this).show();}).mouseout(function(){$('div.buttons',this).hide();});}
function png(){$('body').pngFix();}
function lazyload(){}
function messages(){$('div.slideDown').slideDown(650,0).removeClass('slideDown');$('div.slideUp').slideUp(650,0).removeClass('slideUp');$('div.fadeOut').fadeOut(650,0).removeClass('fadeOut');$('div.fadeIn').fadeIn(650,0).removeClass('fadeIn');$('div._error').animate({opacity:1.0},5000).slideUp(650,function(){$(this).remove();});$('div._message').animate({opacity:1.0},5000).slideUp(650,function(){$(this).remove();});}
var ap_instances=new Array();function ap_stopAll(playerID){for(var i=0;i<ap_instances.length;i++){try{if(ap_instances[i]!=playerID)document.getElementById("audioplayer"+ap_instances[i].toString()).SetVariable("closePlayer",1);else document.getElementById("audioplayer"+ap_instances[i].toString()).SetVariable("closePlayer",0);}catch(errorObject){}}}
function ap_registerPlayers(){var objectID;var objectTags=document.getElementsByTagName("object");for(var i=0;i<objectTags.length;i++){objectID=objectTags[i].id;if(objectID.indexOf("audioplayer")==0){ap_instances[i]=objectID.substring(11,objectID.length);}}}
var ap_clearID=setInterval(ap_registerPlayers,100);var AudioPlayer=function(){var H=[];var D;var F="";var A={};var E=-1;var G="9";function B(I){if(document.all&&!window[I]){for(var J=0;J<document.forms.length;J++){if(document.forms[J][I]){return document.forms[J][I];break}}}return document.all?window[I]:document[I]}function C(I,J,K){B(I).addListener(J,K)}return{setup:function(J,I){F=J;A=I;if(swfobject.hasFlashPlayerVersion(G)){swfobject.switchOffAutoHideShow();swfobject.createCSS("p.audioplayer_container span","visibility:hidden;height:24px;overflow:hidden;padding:0;border:none;")}},getPlayer:function(I){return B(I)},addListener:function(I,J,K){C(I,J,K)},embed:function(I,K){var N={};var L;var J={};var O={};var M={};for(L in A){N[L]=A[L]}for(L in K){N[L]=K[L]}if(N.transparentpagebg=="yes"){J.bgcolor="#FFFFFF";J.wmode="transparent"}else{if(N.pagebg){J.bgcolor="#"+N.pagebg}J.wmode="opaque"}J.menu="false";for(L in N){if(L=="pagebg"||L=="width"||L=="transparentpagebg"){continue}O[L]=N[L]}M.name=I;M.style="outline: none";O.playerID=I;swfobject.embedSWF(F,I,N.width.toString(),"24",G,false,O,J,M);H.push(I)},syncVolumes:function(I,K){E=K;for(var J=0;J<H.length;J++){if(H[J]!=I){B(H[J]).setVolume(E)}}},activate:function(I,J){if(D&&D!=I){B(D).close()}D=I},load:function(K,I,L,J){B(K).load(I,L,J)},close:function(I){B(I).close();if(I==D){D=null}},open:function(I,J){if(J==undefined){J=1}B(I).open(J==undefined?0:J-1)},getVolume:function(I){return E}}}();function x(value){if(value!=""&&value!="undefined"&&value!=undefined&&value)return true;else return false;}
function element_id(element,prefix){if(!x(prefix))prefix="";var id=element.attr('id');if(!id){id=prefix+Math.round(Math.random()*99999);element.attr('id',id);}
return id;}
function url_base(url){var d;var parts=url.split('.');if(parts[3])d=parts[1];else if(parts[2]){if(parts[2].length<=3&&parts[1].length<=3)d=parts[0];}else if(parts[1]){if(parts[1].length<=3)d=parts[0];}if(!d)d=parts[1];return d;}
function str_replace(search,replace,subject){var f=search,r=replace,s=subject;var ra=is_array(r),sa=is_array(s),f=[].concat(f),r=[].concat(r),i=(s=[].concat(s)).length;while(j=0,i--){while(s[i]=s[i].split(f[j]).join(ra?r[j]||"":r[0]),++j in f){};};return sa?s:s[0];}
function is_array(mixed_var){return(mixed_var instanceof Array);}
function in_array(string,array){for(i=0;i<array.length;i++){if(array[i]==string)return true;}
return false;}
function print_array(array){var data="";jQuery.each(array,function(i,val){data+=i+" => "+val+"<br />";});return data;}
function number_format(number,decimals,dec_point,thousands_sep){var n=number,c=isNaN(decimals=Math.abs(decimals))?2:decimals;var d=dec_point==undefined?".":dec_point;var t=thousands_sep==undefined?",":thousands_sep,s=n<0?"-":"";var i=parseInt(n=Math.abs(+n||0).toFixed(c))+"",j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"");}
$.fn.outerHTML=function(){return $('<div>').append(this.eq(0).clone()).html();};$.fn.rte=function(options,editors){if(!editors||editors.constructor!=Array)
editors=new Array();$(this).each(function(i){var id=(this.id)?this.id:editors.length;editors[id]=new lwRTE(this,options||{});});return editors;}
var lwRTE_resizer=function(textarea){this.drag=false;this.rte_zone=$(textarea).parents('.rte-zone');}
lwRTE_resizer.mousedown=function(resizer,e){resizer.drag=true;resizer.event=(typeof(e)=="undefined")?window.event:e;resizer.rte_obj=$(".rte-resizer",resizer.rte_zone).prev().eq(0);$('body',document).css('cursor','se-resize');return false;}
lwRTE_resizer.mouseup=function(resizer,e){resizer.drag=false;$('body',document).css('cursor','auto');return false;}
lwRTE_resizer.mousemove=function(resizer,e){if(resizer.drag){e=(typeof(e)=="undefined")?window.event:e;var w=Math.max(1,resizer.rte_zone.width()+e.screenX-resizer.event.screenX);var h=Math.max(1,resizer.rte_obj.height()+e.screenY-resizer.event.screenY);resizer.rte_zone.width(w);resizer.rte_obj.height(h);resizer.event=e;}
return false;}
var lwRTE=function(textarea,options){this.css=[];this.css_class=options.frame_class||'rte-iframe';this.base_url=options.base_url||'';this.width=options.width||$(textarea).width()||'100%';this.height=options.height||$(textarea).height()||350;this.iframe=null;this.iframe_doc=null;this.textarea=null;this.event=null;this.range=null;this.toolbars={rte:'',html:''};this.controls={rte:{disable:{hint:'Source editor'}},html:{enable:{hint:'Visual editor'}}};$.extend(this.controls.rte,options.controls_rte||{});$.extend(this.controls.html,options.controls_html||{});$.extend(this.css,options.css||{});if(document.designMode||document.contentEditable){$(textarea).wrap($('<div></div>').addClass('rte-zone').width(this.width));$('<div class="rte-resizer"><a href="#"></a></div>').insertAfter(textarea);var resizer=new lwRTE_resizer(textarea);$(".rte-resizer a",$(textarea).parents('.rte-zone')).mousedown(function(e){$(document).mousemove(function(e){return lwRTE_resizer.mousemove(resizer,e);});$(document).mouseup(function(e){return lwRTE_resizer.mouseup(resizer,e)});return lwRTE_resizer.mousedown(resizer,e);});this.textarea=textarea;this.enable_design_mode();}}
lwRTE.prototype.editor_cmd=function(command,args){this.iframe.contentWindow.focus();try{this.iframe_doc.execCommand(command,false,args);}
catch(e){}
this.iframe.contentWindow.focus();}
lwRTE.prototype.get_toolbar=function(){var editor=(this.iframe)?$(this.iframe):$(this.textarea);return(editor.prev().hasClass('rte-toolbar'))?editor.prev():null;}
lwRTE.prototype.activate_toolbar=function(editor,tb){var old_tb=this.get_toolbar();if(old_tb)
old_tb.remove();$(editor).before($(tb).clone(true));}
lwRTE.prototype.enable_design_mode=function(){var self=this;self.iframe=document.createElement("iframe");self.iframe.frameBorder=0;self.iframe.frameMargin=0;self.iframe.framePadding=0;self.iframe.width='100%';self.iframe.height=self.height||'100%';self.iframe.src="javascript:void(0);";var id=element_id($(self.textarea),'lwrte_');if($(self.textarea).attr('class'))
self.iframe.className=$(self.textarea).attr('class');if($(self.textarea).attr('id'))
self.iframe.id=$(self.textarea).attr('id');if($(self.textarea).attr('name'))
self.iframe.title=$(self.textarea).attr('name');var content=$(self.textarea).val();$(self.textarea).hide().after(self.iframe);var css='';for(var i in self.css)css+="<link type='text/css' rel='stylesheet' href='"+self.css[i]+"' />";var base=(self.base_url)?"<base href='"+self.base_url+"' />":'';var style=(self.css_class)?"class='"+self.css_class+"'":'';var doc="<html><head>"+base+css+"</head><body "+style+" style='padding:5px'>"+content+"</body></html>";self.iframe_doc=self.iframe.contentWindow.document;try{self.iframe_doc.designMode='on';}catch(e){$(self.iframe_doc).focus(function(){self.iframe_doc.designMode();});}
self.iframe_doc.open();self.iframe_doc.write(doc);self.iframe_doc.close();if(!self.toolbars.rte)
self.toolbars.rte=self.create_toolbar(self.controls.rte);self.activate_toolbar(self.iframe,self.toolbars.rte);$(self.iframe).parents('form').submit(function(){lwrte_save(self);});lwrte_save(self);if(ADMIN==true){$(self.iframe_doc).bind("contextmenu",function(e){var html=self.get_selected_html();if(html.indexOf('<img')>-1){self.lwrte_menu(e,'img');return false;}});}
$(self.iframe_doc).bind('keydown','Ctrl+l',function(evt){});$(self.iframe_doc).bind('keydown','Ctrl+b',function(evt){self.editor_cmd("bold");return false;});$(self.iframe_doc).bind('keydown','Ctrl+i',function(evt){self.editor_cmd("italic");return false;});$(self.iframe_doc).bind('keydown','Ctrl+u',function(evt){self.editor_cmd("underline");return false;});$(self.iframe_doc).bind('paste',function(e){if(texteditor_cleanup_paste==1)setTimeout('lwrte_cleanup("'+self.iframe.id+'")',30);});$(self.iframe_doc).mouseup(function(event){if(self.iframe_doc.selection)self.range=self.iframe_doc.selection.createRange();self.set_selected_controls((event.target)?event.target:event.srcElement,self.controls.rte);});$(self.iframe).blur(function(event){lwrte_save(self);});$(self.iframe_doc).blur(function(event){lwrte_save(self);if(self.iframe_doc.selection)self.range=self.iframe_doc.selection.createRange();});$(self.iframe_doc).keyup(function(event){lwrte_save(self);self.set_selected_controls(self.get_selected_element(),self.controls.rte);});if(!$.browser.msie)
self.editor_cmd('styleWithCSS',false);}
function lwrte_save(self){var html=$("body",self.iframe_doc).html();$(self.textarea).val(html);if(self.iframe.title=="post_text")$('#preview_text').html(html);}
var lwrte_timer;lwRTE.prototype.lwrte_menu=function(e,type){var self=this;var menu="";var id="";var iframe_position=$(self.iframe).offset();var top=iframe_position.top+e.pageY-10;var left=iframe_position.left+e.pageX-10;if(type=="img"){menu+="<span onclick=\"alert('clicked left');lwrte_menu_command('align-left','"+id+"');\">Align Left</span>";menu+="<span onclick=\"alert('clicked right');lwrte_menu_command('align-right','"+id+"');\">Align Right</span>";}
menu="<div class='rte-menu' style='top:"+top+"px;left:"+left+"px;'>"+menu+"</div>";$("body").append(menu);$("div.rte-menu").mouseout(function(){if(lwrte_timer)clearTimeout(lwrte_timer);lwrte_timer=setTimeout('lwrte_menu_remove();',250);});$("div.rte-menu").mouseover(function(){if(lwrte_timer)clearTimeout(lwrte_timer);});}
function lwrte_menu_remove(){$('div.rte-menu').remove();}
function lwrte_menu_command(command,id){alert(command+','+id);}
function lwrte_parse(html,attribute){var value='';var regex=new RegExp(attribute+"=[\"|'](.*?)[\"|']","g");if(html.indexOf(attribute)>-1){var matches=regex.exec(html);if(matches[1])value=matches[1];}
return value;}
function lwrte_cleanup(id){var w=$('iframe').each(function(){var iframe_doc=this.contentDocument;var html=$("body",iframe_doc).html();$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=cleanIt&text='+encodeURIComponent(html),success:function(html){$("body",iframe_doc).html(html);}});});}
lwRTE.prototype.disable_design_mode=function(submit){var self=this;self.textarea=(submit)?$('<input type="hidden" />').get(0):$('<textarea></textarea>').width('100%').height(self.height).get(0);if(self.iframe.className)
self.textarea.className=self.iframe.className;if(self.iframe.id)
self.textarea.id=self.iframe.id;if(self.iframe.title)
self.textarea.name=self.iframe.title;$(self.textarea).val($('body',self.iframe_doc).html());if(!self.toolbars.html)
self.toolbars.html=self.create_toolbar(self.controls.html);if(submit!=true){$(self.iframe_doc).remove();$(self.iframe).remove();self.iframe=self.iframe_doc=null;self.activate_toolbar(self.textarea,self.toolbars.html);}
lwrte_save(self);}
lwRTE.prototype.toolbar_click=function(obj,control){var fn=control.exec;var args=control.args||[];var is_select=(obj.tagName.toUpperCase()=='SELECT');$('.rte-panel',this.get_toolbar()).remove();if(fn){if(is_select)
args.push(obj);try{fn.apply(this,args);}catch(e){}}else if(this.iframe&&control.command){if(is_select){args=obj.options[obj.selectedIndex].value;if(args.length<=0)
return;}
this.editor_cmd(control.command,args);}
lwrte_save(this);}
lwRTE.prototype.create_toolbar=function(controls){var self=this;var tb=$("<div></div>").addClass('rte-toolbar').width('100%').append($("<ul></ul>")).append($("<div></div>").addClass('clear'));var obj,li;for(var key in controls){if(controls[key].separator){li=$("<li></li>").addClass('separator');}else{if(controls[key].init){try{controls[key].init.apply(controls[key],[this]);}catch(e){}}
if(controls[key].select){obj=$(controls[key].select).change(function(e){debugIt('class 1: '+this.className+'<br />');self.event=e;self.toolbar_click(this,controls[this.className]);$(this).removeClass('valid');return false;});}else{obj=$("<a href='#'></a>").attr('title',(controls[key].hint)?controls[key].hint:key).attr('rel',key).click(function(e){self.event=e;self.toolbar_click(this,controls[this.rel]);return false;})}
li=$("<li></li>").append(obj.addClass(key));}
if(key=="suggestions"&&texteditor_links_suggestions!=1){}
else $("ul",tb).append(li);}
$('.enable',tb).click(function(){self.enable_design_mode();return false;});$('.disable',tb).click(function(){self.disable_design_mode();return false;});return tb.get(0);}
lwRTE.prototype.create_panel=function(title,width){var self=this;var tb=self.get_toolbar();if(!tb)
return false;$('.rte-panel',tb).remove();var drag,event;var left=self.event.pageX;var top=self.event.pageY;var panel=$('<div></div>').hide().addClass('rte-panel');if($.browser.msie&&$.browser.version=="6.0")panel.css({left:left,top:top});$('<div></div>').addClass('rte-panel-title').html(title).append($("<a class='close' href='#'>X</a>").click(function(){self.panel_remove(panel);return false;})).mousedown(function(){drag=true;return false;}).mouseup(function(){drag=false;return false;}).mousemove(function(e){if(drag&&event){left-=event.pageX-e.pageX;top-=event.pageY-e.pageY;}
event=e;return false;}).appendTo(panel);if(width)panel.width(width);tb.append(panel);return panel;}
lwRTE.prototype.panel_show=function(panel){$(panel).fadeIn(400);}
lwRTE.prototype.panel_remove=function(panel){panel.fadeOut(400,function(){panel.remove();});}
lwRTE.prototype.get_content=function(){return(this.iframe)?$('body',this.iframe_doc).html():$(this.textarea).val();}
lwRTE.prototype.set_content=function(content){(this.iframe)?$('body',this.iframe_doc).html(content):$(this.textarea).val(content);}
lwRTE.prototype.set_selected_controls=function(node,controls){var toolbar=this.get_toolbar();if(!toolbar)
return false;var key,i_node,obj,control,tag,i,value;try{for(key in controls){control=controls[key];obj=$('.'+key,toolbar);obj.removeClass('active');if(!control.tags)
continue;i_node=node;do{if(i_node.nodeType!=1)
continue;tag=i_node.nodeName.toLowerCase();if($.inArray(tag,control.tags)<0)
continue;if(control.select){obj=obj.get(0);if(obj.tagName.toUpperCase()=='SELECT'){obj.selectedIndex=0;for(i=0;i<obj.options.length;i++){value=obj.options[i].value;if(value&&((control.tag_cmp&&control.tag_cmp(i_node,value))||tag==value)){obj.selectedIndex=i;break;}}}}else
obj.addClass('active');}while(i_node=i_node.parentNode)}}catch(e){}
return true;}
lwRTE.prototype.get_selected_element=function(){var node,selection,range;var iframe_win=this.iframe.contentWindow;if(iframe_win.getSelection){try{selection=iframe_win.getSelection();range=selection.getRangeAt(0);node=range.commonAncestorContainer;}catch(e){return false;}}else{try{selection=iframe_win.document.selection;range=selection.createRange();node=range.parentElement();}catch(e){return false;}}
return node;}
lwRTE.prototype.get_selection_range=function(){var rng=null;var iframe_window=this.iframe.contentWindow;this.iframe.focus();if(iframe_window.getSelection){rng=iframe_window.getSelection().getRangeAt(0);if($.browser.opera){var s=rng.startContainer;if(s.nodeType===Node.TEXT_NODE)
rng.setStartBefore(s.parentNode);}}else{if(this.range){this.range.select();rng=this.iframe_doc.selection.createRange();}}
return rng;}
lwRTE.prototype.get_selected_text=function(){var iframe_win=this.iframe.contentWindow;if(iframe_win.getSelection)
return iframe_win.getSelection().toString();this.range.select();return iframe_win.document.selection.createRange().text;};lwRTE.prototype.get_selected_html=function(){var html=null;var iframe_window=this.iframe.contentWindow;var rng=this.get_selection_range();if(rng&&iframe_window){if(iframe_window.getSelection){var e=document.createElement('div');e.appendChild(rng.cloneContents());html=e.innerHTML;}else{if(rng.htmlText)html=rng.htmlText;else{elm=rng.item?rng.item(0):rng.parentElement();var html=elm.outerHTML;}}}
return html;};lwRTE.prototype.selection_replace_with=function(html){var rng=this.get_selection_range();var iframe_window=this.iframe.contentWindow;if(!rng)return;this.editor_cmd('removeFormat');if(iframe_window.getSelection){rng.deleteContents();rng.insertNode(rng.createContextualFragment(html));this.editor_cmd('delete');}else{if(rng.htmlText){this.editor_cmd('delete');rng.pasteHTML(html);}
else{elm=rng.item?rng.item(0):rng.parentElement();var e=$(elm);$(e).replaceWith(html);}}}
var rte_tag='-rte-tmp-tag-';var full_toolbar={bold:{command:"bold",tags:["b","strong"]},italic:{command:"italic",tags:["i","em"]},strikeThrough:{command:"strikethrough",tags:["s","strike"]},underline:{command:"underline",tags:["u"]},s2:{separator:true},justifyLeft:{command:"justifyleft"},justifyCenter:{command:"justifycenter"},justifyRight:{command:"justifyright"},justifyFull:{command:"justifyfull"},s3:{separator:true},indent:{command:"indent"},outdent:{command:"outdent"},s4:{separator:true},subscript:{command:"subscript",tags:["sub"]},superscript:{command:"superscript",tags:["sup"]},s5:{separator:true},orderedList:{command:"insertorderedlist",tags:["ol"]},unorderedList:{command:"insertunorderedlist",tags:["ul"]},s6:{separator:true},color:{exec:lwrte_color},image:{exec:lwrte_image,tags:["img"]},link:{exec:lwrte_link_basic,tags:["a"]},unlink:{command:"unlink"},suggestions:{exec:lwrte_link_suggestions},s8:{separator:true},block:{command:"formatblock",select:'<select> <option value="">- Format -</option> <option value="<p>">Paragraph</option> <option value="<h1>">Header 1</option> <option value="<h2>">Header 2</options> <option value="<h3>">Header 3</option> <option value="<h4>">Header 4</options> <option value="<h5>">Header 5</option> <option value="<h6>">Header 6</options></select> ',tag_cmp:lwrte_block_compare,tags:["p","h1","h2","h3","h4","h5","h6"]},font:{command:"fontname",select:'<select> <option value="">- Font -</option> <option value="arial">Arial</option> <option value="comic sans ms">Comic Sans</option> <option value="courier new">Courier New</options> <option value="georgia">Georgia</option> <option value="helvetica">Helvetica</options> <option value="impact">Impact</option> <option value="times new roman">Times</options> <option value="trebuchet ms">Trebuchet</options> <option value="verdana">Verdana</options></select> ',tags:["span"]},size:{command:"fontsize",select:'<select> <option value="">- Size -</option> <option value="1">1 (8pt)</option> <option value="2">2 (10pt)</option> <option value="3">3 (12pt)</options> <option value="4">4 (14pt)</option> <option value="5">5 (16pt)</options> <option value="6">6 (18pt)</option> <option value="7">7 (20pt)</options></select> ',tags:["span"]}};var html_toolbar={s1:{separator:true}};var default_toolbar={bold:{command:"bold",tags:["b","strong"]},italic:{command:"italic",tags:["i","em"]},underline:{command:"underline",tags:["u"]},s2:{separator:true},indent:{command:"indent"},outdent:{command:"outdent"},unorderedList:{command:"insertunorderedlist",tags:["ul"]},s6:{separator:true},image:{exec:lwrte_image,tags:["img"]},link:{exec:lwrte_link_basic,tags:["a"]},unlink:{command:"unlink"},suggestions:{exec:lwrte_link_suggestions},s8:{separator:true}};var basic_toolbar={bold:{command:"bold",tags:["b","strong"]},italic:{command:"italic",tags:["i","em"]},underline:{command:"underline",tags:["u"]},s2:{separator:true},indent:{command:"indent"},outdent:{command:"outdent"},unorderedList:{command:"insertunorderedlist",tags:["ul"]}};function lwrte_block_compare(node,tag){tag=tag.replace(/<([^>]*)>/,'$1');return(tag.toLowerCase()==node.nodeName.toLowerCase());}
function lwrte_color(){var self=this;var panel=self.create_panel('Set color for text',385);var mouse_down=false;var mouse_over=false;panel.append('\<div class="rte-panel-content"><div class="colorpicker1"><div class="rgb" id="rgb"></div></div>\<div class="colorpicker1"><div class="gray" id="gray"></div></div>\<div class="colorpicker2">\<div class="palette" id="palette"></div>\<div class="preview" id="preview"></div>\<div class="color" id="color"></div>\</div>\<div class="clear"></div></div>\<p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>');self.panel_show(panel);var preview=$('#preview',panel);var color=$("#color",panel);var palette=$("#palette",panel);var colors=['#660000','#990000','#cc0000','#ff0000','#333333','#006600','#009900','#00cc00','#00ff00','#666666','#000066','#000099','#0000cc','#0000ff','#999999','#909000','#900090','#009090','#ffffff','#cccccc','#ffff00','#ff00ff','#00ffff','#000000','#eeeeee'];for(var i=0;i<colors.length;i++)
$("<div></div>").addClass("item").css('background',colors[i]).appendTo(palette);var height=$('#rgb').height();var part_width=$('#rgb').width()/6;$('#rgb,#gray,#palette',panel).mousedown(function(e){mouse_down=true;return false;}).mouseup(function(e){mouse_down=false;return false;}).mouseout(function(e){mouse_over=false;return false;}).mouseover(function(e){mouse_over=true;return false;});$('#rgb').mousemove(function(e){if(mouse_down&&mouse_over)compute_color(this,true,false,false,e);return false;});$('#gray').mousemove(function(e){if(mouse_down&&mouse_over)compute_color(this,false,true,false,e);return false;});$('#palette').mousemove(function(e){if(mouse_down&&mouse_over)compute_color(this,false,false,true,e);return false;});$('#rgb').click(function(e){compute_color(this,true,false,false,e);return false;});$('#gray').click(function(e){compute_color(this,false,true,false,e);return false;});$('#palette').click(function(e){compute_color(this,false,false,true,e);return false;});$('#cancel',panel).click(function(){self.panel_remove(panel);return false;});$('#ok',panel).click(function(){var value=color.html();if(value.length>0&&value.charAt(0)=='#'){if(self.iframe_doc.selection)
self.range.select();self.editor_cmd('foreColor',value);}
self.panel_remove(panel);return false;});function to_hex(n){var s="0123456789abcdef";return s.charAt(Math.floor(n/16))+s.charAt(n%16);}
function get_abs_pos(element){var r={x:element.offsetLeft,y:element.offsetTop};if(element.offsetParent){var tmp=get_abs_pos(element.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}
return r;};function get_xy(obj,event){var x,y,top;event=event||window.event;var el=event.target||event.srcElement;var pos=get_abs_pos(obj);if($('div.rte-panel').css('position')=="fixed")top=$(window).scrollTop();x=event.pageX-pos.x;y=event.pageY-pos.y-top;return{x:x,y:y};}
function compute_color(obj,is_rgb,is_gray,is_palette,e){var r,g,b,c;var mouse=get_xy(obj,e);var x=mouse.x;var y=mouse.y;if(is_rgb){r=(x>=0)*(x<part_width)*255+(x>=part_width)*(x<2*part_width)*(2*255-x*255/part_width)+(x>=4*part_width)*(x<5*part_width)*(-4*255+x*255/part_width)+(x>=5*part_width)*(x<6*part_width)*255;g=(x>=0)*(x<part_width)*(x*255/part_width)+(x>=part_width)*(x<3*part_width)*255+(x>=3*part_width)*(x<4*part_width)*(4*255-x*255/part_width);b=(x>=2*part_width)*(x<3*part_width)*(-2*255+x*255/part_width)+(x>=3*part_width)*(x<5*part_width)*255+(x>=5*part_width)*(x<6*part_width)*(6*255-x*255/part_width);var k=(height-y)/height;r=128+(r-128)*k;g=128+(g-128)*k;b=128+(b-128)*k;}else if(is_gray){r=g=b=(height-y)*1.7;}else if(is_palette){x=Math.floor(x/10);y=Math.floor(y/10);c=colors[x+y*5];}
if(!is_palette)
c='#'+to_hex(r)+to_hex(g)+to_hex(b);preview.css('background',c);color.html(c);}}
function lwrte_image(){var self=this;var img_url='';var img_align='';var img_style='';var html=self.get_selected_html();if(html){if($(html).attr('src'))img_url=$(html).attr('src');if($(html).attr('align'))img_align=$(html).attr('align');if($(html).attr('style'))img_style=$(html).attr('style');}
var panel_text='\<div class="rte-panel-content"><p><label>Image</label><input type="text" id="url" size="30" value="'+img_url+'" /><button id="view">View</button></p>';panel_text=panel_text+'\<p><label>Upload</label><input type="file" name="lwrte_file" id="lwrte_file" size="22" /></p>';panel_text=panel_text+'\<div class="clear"></div>\<p><label>Align</label><select id="align"><option value=""></option><option value="left"';if(img_align=="left")panel_text+=' selected="selected"';panel_text+='>Left</option><option value="right"';if(img_align=="right")panel_text+=' selected="selected"';panel_text+='>Right</option></select></p>\<div class="clear"></div>\<div id="preview" style="margin-left:25px;"></div></div>\<p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>';var panel=self.create_panel('Insert image',385);panel.append(panel_text);self.panel_show(panel);var url=$('#url',panel);$('#lwrte_file',panel).change(function(){loader("preview",{text:'Uploading..'});$.ajaxFileUpload({url:DOMAIN+'?ajaxRequest=upload_rte',secureuri:false,fileElementId:'lwrte_file',dataType:'json',success:function(data,status){$("#url",panel).val(data.file);$('#lwrte_file',panel).val("");$("#preview",panel).html('');$("#red",panel).animate({opacity:1.0},1500).slideUp(500,function(){$(this).remove();});}});});$('#view',panel).click(function(){(url.val().length>0)?window.open(url.val()):alert("Enter URL of image to view");return false;});$('#cancel',panel).click(function(){self.panel_remove(panel);return false;});$('#ok',panel).click(function(){var file=url.val();var align=$('#align',panel).val();var h="<img src='"+file+"' alt=''";if(align)h+=" align='"+align+"'";h+=" />";self.selection_replace_with(h);self.panel_remove(panel);lwrte_save(self);return false;})}
function lwrte_unformat(){this.editor_cmd('removeFormat');this.editor_cmd('unlink');}
function lwrte_clear(){if(confirm('Clear Document?'))
this.set_content('');}
function lwrte_link(){var self=this;var panel=self.create_panel("Create link / Attach file",385);panel.append('\<div class="rte-panel-content"><p><label>URL</label><input type="text" id="url" size="30" value=""><button id="file">Attach File</button><button id="view">View</button></p>\<div class="clear"></div>\<p><label>Title</label><input type="text" id="title" size="30" value=""><label>Target</label><select id="target"><option value="">default</option><option value="_blank">new</option></select></p>\<div class="clear"></div></div>\<p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>');self.panel_show(panel);$('#cancel',panel).click(function(){self.panel_remove(panel);return false;});var url=$('#url',panel);var upload=$('#file',panel).upload({autoSubmit:true,action:'uploader.php',onComplete:function(response){if(response.length<=0)
return;response=eval("("+response+")");if(response.error&&response.error.length>0)
alert(response.error);else
url.val((response.file&&response.file.length>0)?response.file:'');}});$('#view',panel).click(function(){(url.val().length>0)?window.open(url.val()):alert("Enter URL to view");return false;});$('#ok',panel).click(function(){var url=$('#url',panel).val();var target=$('#target',panel).val();var title=$('#title',panel).val();if(self.get_selected_text().length<=0){alert('Select the text you wish to link!');return false;}
self.panel_remove(panel);if(url.length<=0)
return false;self.editor_cmd('unlink');self.editor_cmd('createLink',rte_tag);var tmp=$('<span></span>').append(self.get_selected_html());if(target.length>0)$('a[href*="'+rte_tag+'"]',tmp).attr('target',target);if(title.length>0)$('a[href*="'+rte_tag+'"]',tmp).attr('title',title);$('a[href*="'+rte_tag+'"]',tmp).attr('href',url);self.selection_replace_with(tmp.html());lwrte_save(self);return false;})}
function lwrte_link_basic(){var self=this;var text=self.get_selected_text();if(text.length<=0){alert("Please select the text which you'd like to link.");return false}
var panel=self.create_panel("Add a Link",385);panel.append('<div class="rte-panel-content"><p><label>URL</label><input type="text" id="url" size="30" value=""><button id="view">View</button></p><div class="clear"></div><p><label>Title</label><input type="text" id="title" size="30" value=""></p><div class="clear"></div></div><p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>');self.panel_show(panel);$("#cancel",panel).click(function(){self.panel_remove(panel);return false});var url=$("#url",panel);$("#view",panel).click(function(){(url.val().length>0)?window.open(url.val()):alert("Enter URL to view");return false});$("#ok",panel).click(function(){var url=$("#url",panel).val();var title=$("#title",panel).val();var target=$("#target",panel).val();if(self.get_selected_text().length<=0){alert("Select the text you wish to link!");return false}
self.panel_remove(panel);if(url.length<=0){return false}
self.editor_cmd("unlink");if($.browser.msie)self.editor_cmd('createLink',url);else{var h='<a href="'+url+'"';if(target)h+=' target="'+target+'"';if(title)h+=' title="'+title+'"';h+='>'+self.get_selected_html()+'</a>';self.editor_cmd("insertHTML",h);}
lwrte_save(self);return false;})};function lwrte_link_suggestions(text){var self=this;var text=self.get_selected_text();var html=self.get_selected_text();if(text.length<=0){alert("Please select the text which you'd like to link.");return false}
var panel=self.create_panel("Add a Link",450);panel.append('<div class="rte-panel-content"><div id="rte_link_suggestions"><div class="none"><img src="'+DOMAIN+'core/images/ajax-loader.gif" alt="Loading.." /></div><br /><br /></div></div><p class="submit"><button id="ok">Ok</button><button id="cancel">Cancel</button></p>');self.panel_show(panel);$("#cancel",panel).click(function(){self.panel_remove(panel);return false});$.ajax({type:'POST',url:DOMAIN,data:'ajaxRequest=suggestIt&type=link&text='+encodeURIComponent(text),success:function(html){$('#rte_link_suggestions').html(html);thickbox();$("tr.suggestion",panel).click(function(){$("tr.selected",panel).removeClass('selected');$(this).addClass('selected');});}});$("#ok",panel).click(function(){var url=$("tr.selected input[name=url]",panel).val();var title=$("tr.selected input[name=title]",panel).val();var target=$("tr.selected input[name=target]",panel).val();if(url.length<=0){alert("Please select a suggested link");return false}
if(self.get_selected_text().length<=0){alert("Please select the text in the texteditor which you'd like to link.");return false}
self.panel_remove(panel);self.editor_cmd("unlink");if($.browser.msie)self.editor_cmd('createLink',url);else{var h='<a href="'+url+'"';if(target)h+=' target="'+target+'"';if(title)h+=' title="'+title+'"';h+='>'+self.get_selected_html()+'</a>';self.editor_cmd("insertHTML",h);}
lwrte_save(self);return false;})};eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('9.J={1C:6(e){4 x=0;4 y=0;4 7=e.Y;4 12=1H;c(9(e).8(\'A\')==\'T\'){4 N=7.B;4 Q=7.z;12=1f;7.B=\'1r\';7.A=\'1q\';7.z=\'1d\'}4 3=e;R(3){x+=3.1h+(3.O&&!9.1m.1i?d(3.O.17)||0:0);y+=3.1n+(3.O&&!9.1m.1i?d(3.O.18)||0:0);3=3.1t}3=e;R(3&&3.1e&&3.1e.16()!=\'f\'){x-=3.u||0;y-=3.F||0;3=3.1D}c(12==1f){7.A=\'T\';7.z=Q;7.B=N}a{x:x,y:y}},1B:6(3){4 x=0,y=0;R(3){x+=3.1h||0;y+=3.1n||0;3=3.1t}a{x:x,y:y}},1s:6(e){4 w=9.8(e,\'1E\');4 h=9.8(e,\'1G\');4 o=0;4 q=0;4 7=e.Y;c(9(e).8(\'A\')!=\'T\'){o=e.V;q=e.U}p{4 N=7.B;4 Q=7.z;7.B=\'1r\';7.A=\'1q\';7.z=\'1d\';o=e.V;q=e.U;7.A=\'T\';7.z=Q;7.B=N}a{w:w,h:h,o:o,q:q}},1F:6(3){a{o:3.V||0,q:3.U||0}},1I:6(e){4 h,w,C;c(e){w=e.I;h=e.G}p{C=5.j;w=1c.14||P.14||(C&&C.I)||5.f.I;h=1c.10||P.10||(C&&C.G)||5.f.G}a{w:w,h:h}},1p:6(e){4 t=0,l=0,w=0,h=0,s=0,E=0;c(e&&e.1u.16()!=\'f\'){t=e.F;l=e.u;w=e.15;h=e.W;s=0;E=0}p{c(5.j){t=5.j.F;l=5.j.u;w=5.j.15;h=5.j.W}p c(5.f){t=5.f.F;l=5.f.u;w=5.f.15;h=5.f.W}s=P.14||5.j.I||5.f.I||0;E=P.10||5.j.G||5.f.G||0}a{t:t,l:l,w:w,h:h,s:s,E:E}},1v:6(e,D){4 3=9(e);4 t=3.8(\'1w\')||\'\';4 r=3.8(\'1x\')||\'\';4 b=3.8(\'1A\')||\'\';4 l=3.8(\'1z\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)};p a{t:t,r:r,b:b,l:l}},1y:6(e,D){4 3=9(e);4 t=3.8(\'1J\')||\'\';4 r=3.8(\'1M\')||\'\';4 b=3.8(\'27\')||\'\';4 l=3.8(\'28\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)};p a{t:t,r:r,b:b,l:l}},26:6(e,D){4 3=9(e);4 t=3.8(\'18\')||\'\';4 r=3.8(\'22\')||\'\';4 b=3.8(\'23\')||\'\';4 l=3.8(\'17\')||\'\';c(D)a{t:d(t)||0,r:d(r)||0,b:d(b)||0,l:d(l)||0};p a{t:t,r:r,b:b,l:l}},2e:6(L){4 x=L.2d||(L.2b+(5.j.u||5.f.u))||0;4 y=L.2c||(L.29+(5.j.F||5.f.F))||0;a{x:x,y:y}},X:6(g,13){13(g);g=g.1O;R(g){9.J.X(g,13);g=g.1L}},1N:6(g){9.J.X(g,6(3){19(4 Z 1T 3){c(1Z 3[Z]===\'6\'){3[Z]=1a}}})},1X:6(3,H){4 k=9.J.1p();4 11=9.J.1s(3);c(!H||H==\'1W\')9(3).8({1U:k.t+((1g.1o(k.h,k.E)-k.t-11.q)/2)+\'1j\'});c(!H||H==\'20\')9(3).8({1Y:k.l+((1g.1o(k.w,k.s)-k.l-11.o)/2)+\'1j\'})},2f:6(3,1l){4 1k=9(\'25[@M*="S"]\',3||5),S;1k.24(6(){S=K.M;K.M=1l;K.Y.2a="21:1R.1P.1V(M=\'"+S+"\')"})}};[].1b||(1S.1Q.1b=6(v,n){n=(n==1a)?0:n;4 m=K.1K;19(4 i=n;i<m;i++)c(K[i]==v)a i;a-1});',62,140,'|||el|var|document|function|es|css|jQuery|return||if|parseInt||body|nodeEl|||documentElement|clientScroll||||wb|else|hb||iw||scrollLeft|||||position|display|visibility|de|toInteger|ih|scrollTop|clientHeight|axis|clientWidth|iUtil|this|event|src|oldVisibility|currentStyle|self|oldPosition|while|png|none|offsetHeight|offsetWidth|scrollHeight|traverseDOM|style|attr|innerHeight|windowSize|restoreStyles|func|innerWidth|scrollWidth|toLowerCase|borderLeftWidth|borderTopWidth|for|null|indexOf|window|absolute|tagName|true|Math|offsetLeft|opera|px|images|emptyGIF|browser|offsetTop|max|getScroll|block|hidden|getSize|offsetParent|nodeName|getMargins|marginTop|marginRight|getPadding|marginLeft|marginBottom|getPositionLite|getPosition|parentNode|width|getSizeLite|height|false|getClient|paddingTop|length|nextSibling|paddingRight|purgeEvents|firstChild|Microsoft|prototype|DXImageTransform|Array|in|top|AlphaImageLoader|vertically|centerEl|left|typeof|horizontally|progid|borderRightWidth|borderBottomWidth|each|img|getBorder|paddingBottom|paddingLeft|clientY|filter|clientX|pageY|pageX|getPointer|fixPNG'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('8.c={m:W,7:W,2g:z(){B a.1x(z(){9(a.1v){a.5.P.27(\'2L\',8.c.1X);a.5=W;a.1v=d;9(8.13.1o){a.1U="3o"}H{a.v.3n=\'\';a.v.2V=\'\';a.v.2G=\'\'}}})},1X:z(e){9(8.c.7!=W){8.c.1H(e);B d}k 6=a.1z;8(1c).24(\'2u\',8.c.20).24(\'2r\',8.c.1H);6.5.C=8.E.2U(e);6.5.10=6.5.C;6.5.1E=d;6.5.3g=a!=a.1z;8.c.7=6;9(6.5.12&&a!=a.1z){21=8.E.26(6.1p);22=8.E.1K(6);25={x:u(8.q(6,\'K\'))||0,y:u(8.q(6,\'J\'))||0};j=6.5.10.x-21.x-22.1h/2-25.x;g=6.5.10.y-21.y-22.Y/2-25.y;8.1Y.3y(6,[j,g])}B 8.3f||d},2I:z(e){k 6=8.c.7;6.5.1E=G;k 1G=6.v;6.5.1B=8.q(6,\'T\');6.5.1q=8.q(6,\'1N\');9(!6.5.2p)6.5.2p=6.5.1q;6.5.n={x:u(8.q(6,\'K\'))||0,y:u(8.q(6,\'J\'))||0};6.5.1L=0;6.5.1J=0;9(8.13.1o){k 1V=8.E.2f(6,G);6.5.1L=1V.l||0;6.5.1J=1V.t||0}6.5.f=8.1A(8.E.26(6),8.E.1K(6));9(6.5.1q!=\'2A\'&&6.5.1q!=\'2W\'){1G.1N=\'2A\'}8.c.m.2h();k V=6.34(G);8(V).q({T:\'2x\',K:\'16\',J:\'16\'});V.v.2w=\'0\';V.v.2v=\'0\';V.v.2t=\'0\';V.v.2s=\'0\';8.c.m.1y(V);k F=8.c.m.Z(0).v;9(6.5.1Z){F.2d=\'2B\';F.2c=\'2B\'}H{F.2c=6.5.f.Y+\'O\';F.2d=6.5.f.1h+\'O\'}F.T=\'2x\';F.2w=\'16\';F.2v=\'16\';F.2t=\'16\';F.2s=\'16\';8.1A(6.5.f,8.E.1K(V));9(6.5.A){9(6.5.A.K){6.5.n.x+=6.5.C.x-6.5.f.x-6.5.A.K;6.5.f.x=6.5.C.x-6.5.A.K}9(6.5.A.J){6.5.n.y+=6.5.C.y-6.5.f.y-6.5.A.J;6.5.f.y=6.5.C.y-6.5.A.J}9(6.5.A.2b){6.5.n.x+=6.5.C.x-6.5.f.x-6.5.f.Y+6.5.A.2b;6.5.f.x=6.5.C.x-6.5.f.1h+6.5.A.2b}9(6.5.A.28){6.5.n.y+=6.5.C.y-6.5.f.y-6.5.f.Y+6.5.A.28;6.5.f.y=6.5.C.y-6.5.f.Y+6.5.A.28}}6.5.1I=6.5.n.x;6.5.1M=6.5.n.y;9(6.5.1u||6.5.p==\'1w\'){1r=8.E.2f(6.1p,G);6.5.f.x=6.37+(8.13.1o?0:8.13.2n?-1r.l:1r.l);6.5.f.y=6.38+(8.13.1o?0:8.13.2n?-1r.t:1r.t);8(6.1p).1y(8.c.m.Z(0))}9(6.5.p){8.c.2q(6);6.5.S.p=8.c.2j}9(6.5.12){8.1Y.31(6)}F.K=6.5.f.x-6.5.1L+\'O\';F.J=6.5.f.y-6.5.1J+\'O\';F.2d=6.5.f.1h+\'O\';F.2c=6.5.f.Y+\'O\';8.c.7.5.1F=d;9(6.5.1i){6.5.S.X=8.c.2o}9(6.5.17!=d){8.c.m.q(\'17\',6.5.17)}9(6.5.N){8.c.m.q(\'N\',6.5.N);9(1P.1O){8.c.m.q(\'2y\',\'2C(N=\'+6.5.N*2z+\')\')}}9(6.5.1f){8.c.m.3a(6.5.1f);8.c.m.Z(0).3e.v.T=\'M\'}9(6.5.1j)6.5.1j.1m(6,[V,6.5.n.x,6.5.n.y]);9(8.L&&8.L.2a>0){8.L.2Z(6)}9(6.5.19==d){1G.T=\'M\'}B d},2q:z(6){9(6.5.p.I==2P){9(6.5.p==\'1w\'){6.5.s=8.1A({x:0,y:0},8.E.1K(6.1p));k 1t=8.E.2f(6.1p,G);6.5.s.w=6.5.s.1h-1t.l-1t.r;6.5.s.h=6.5.s.Y-1t.t-1t.b}H 9(6.5.p==\'1c\'){k 29=8.E.3x();6.5.s={x:0,y:0,w:29.w,h:29.h}}}H 9(6.5.p.I==2F){6.5.s={x:u(6.5.p[0])||0,y:u(6.5.p[1])||0,w:u(6.5.p[2])||0,h:u(6.5.p[3])||0}}6.5.s.j=6.5.s.x-6.5.f.x;6.5.s.g=6.5.s.y-6.5.f.y},1C:z(7){9(7.5.1u||7.5.p==\'1w\'){8(\'2H\',1c).1y(8.c.m.Z(0))}8.c.m.2h().3v().q(\'N\',1);9(1P.1O){8.c.m.q(\'2y\',\'2C(N=2z)\')}},1H:z(e){8(1c).27(\'2u\',8.c.20).27(\'2r\',8.c.1H);9(8.c.7==W){B}k 7=8.c.7;8.c.7=W;9(7.5.1E==d){B d}9(7.5.15==G){8(7).q(\'1N\',7.5.1q)}k 1G=7.v;9(7.12){8.c.m.q(\'2J\',\'2N\')}9(7.5.1f){8.c.m.3t(7.5.1f)}9(7.5.1T==d){9(7.5.R>0){9(!7.5.D||7.5.D==\'1S\'){k x=2D 8.R(7,{2m:7.5.R},\'K\');x.2i(7.5.n.x,7.5.1l)}9(!7.5.D||7.5.D==\'1Q\'){k y=2D 8.R(7,{2m:7.5.R},\'J\');y.2i(7.5.n.y,7.5.1k)}}H{9(!7.5.D||7.5.D==\'1S\')7.v.K=7.5.1l+\'O\';9(!7.5.D||7.5.D==\'1Q\')7.v.J=7.5.1k+\'O\'}8.c.1C(7);9(7.5.19==d){8(7).q(\'T\',7.5.1B)}}H 9(7.5.R>0){7.5.1F=G;k 1e=d;9(8.L&&8.1D&&7.5.15){1e=8.E.26(8.1D.m.Z(0))}8.c.m.3i({K:1e?1e.x:7.5.f.x,J:1e?1e.y:7.5.f.y},7.5.R,z(){7.5.1F=d;9(7.5.19==d){7.v.T=7.5.1B}8.c.1C(7)})}H{8.c.1C(7);9(7.5.19==d){8(7).q(\'T\',7.5.1B)}}9(8.L&&8.L.2a>0){8.L.3h(7)}9(8.1D&&7.5.15){8.1D.3m(7)}9(7.5.11&&(7.5.1l!=7.5.n.x||7.5.1k!=7.5.n.y)){7.5.11.1m(7,7.5.3r||[0,0,7.5.1l,7.5.1k])}9(7.5.1g)7.5.1g.1m(7);B d},2o:z(x,y,j,g){9(j!=0)j=u((j+(a.5.1i*j/U.2k(j))/2)/a.5.1i)*a.5.1i;9(g!=0)g=u((g+(a.5.1s*g/U.2k(g))/2)/a.5.1s)*a.5.1s;B{j:j,g:g,x:0,y:0}},2j:z(x,y,j,g){j=U.2l(U.2T(j,a.5.s.j),a.5.s.w+a.5.s.j-a.5.f.1h);g=U.2l(U.2T(g,a.5.s.g),a.5.s.h+a.5.s.g-a.5.f.Y);B{j:j,g:g,x:0,y:0}},20:z(e){9(8.c.7==W||8.c.7.5.1F==G){B}k 7=8.c.7;7.5.10=8.E.2U(e);9(7.5.1E==d){2E=U.3l(U.2O(7.5.C.x-7.5.10.x,2)+U.2O(7.5.C.y-7.5.10.y,2));9(2E<7.5.1R){B}H{8.c.2I(e)}}k j=7.5.10.x-7.5.C.x;k g=7.5.10.y-7.5.C.y;3k(k i 3s 7.5.S){k 14=7.5.S[i].1m(7,[7.5.n.x+j,7.5.n.y+g,j,g]);9(14&&14.I==3A){j=i!=\'1d\'?14.j:(14.x-7.5.n.x);g=i!=\'1d\'?14.g:(14.y-7.5.n.y)}}7.5.1I=7.5.f.x+j-7.5.1L;7.5.1M=7.5.f.y+g-7.5.1J;9(7.5.12&&(7.5.1a||7.5.11)){8.1Y.1a(7,7.5.1I,7.5.1M)}9(7.5.18)7.5.18.1m(7,[7.5.n.x+j,7.5.n.y+g]);9(!7.5.D||7.5.D==\'1S\'){7.5.1l=7.5.n.x+j;8.c.m.Z(0).v.K=7.5.1I+\'O\'}9(!7.5.D||7.5.D==\'1Q\'){7.5.1k=7.5.n.y+g;8.c.m.Z(0).v.J=7.5.1M+\'O\'}9(8.L&&8.L.2a>0){8.L.3u(7)}B d},2M:z(o){9(!8.c.m){8(\'2H\',1c).1y(\'<2X 3w="2S"></2X>\');8.c.m=8(\'#2S\');k 1n=8.c.m.Z(0);k Q=1n.v;Q.1N=\'2W\';Q.T=\'M\';Q.2J=\'2N\';Q.30=\'M\';Q.39=\'3c\';9(1P.1O){1n.1U="2R"}H{Q.3d=\'M\';Q.2G=\'M\';Q.2V=\'M\'}}9(!o){o={}}B a.1x(z(){9(a.1v||!8.E)B;9(1P.1O){a.33=z(){B d};a.32=z(){B d}}k 1n=a;k P=o.2Q?8(a).35(o.2Q):8(a);9(8.13.1o){P.1x(z(){a.1U="2R"})}H{P.q(\'-36-1d-1W\',\'M\');P.q(\'1d-1W\',\'M\');P.q(\'-2Y-1d-1W\',\'M\')}a.5={P:P,1T:o.1T?G:d,19:o.19?G:d,15:o.15?o.15:d,12:o.12?o.12:d,1u:o.1u?o.1u:d,17:o.17?u(o.17)||0:d,N:o.N?3B(o.N):d,R:u(o.R)||W,23:o.23?o.23:d,S:{},C:{},1j:o.1j&&o.1j.I==1b?o.1j:d,1g:o.1g&&o.1g.I==1b?o.1g:d,11:o.11&&o.11.I==1b?o.11:d,D:/1Q|1S/.3j(o.D)?o.D:d,1R:o.1R?u(o.1R)||0:0,A:o.A?o.A:d,1Z:o.1Z?G:d,1f:o.1f||d};9(o.S&&o.S.I==1b)a.5.S.1d=o.S;9(o.18&&o.18.I==1b)a.5.18=o.18;9(o.p&&((o.p.I==2P&&(o.p==\'1w\'||o.p==\'1c\'))||(o.p.I==2F&&o.p.2K==4))){a.5.p=o.p}9(o.2e){a.5.2e=o.2e}9(o.X){9(3C o.X==\'3q\'){a.5.1i=u(o.X)||1;a.5.1s=u(o.X)||1}H 9(o.X.2K==2){a.5.1i=u(o.X[0])||1;a.5.1s=u(o.X[1])||1}}9(o.1a&&o.1a.I==1b){a.5.1a=o.1a}a.1v=G;P.1x(z(){a.1z=1n});P.24(\'2L\',8.c.1X)})}};8.3z.1A({3p:8.c.2g,3b:8.c.2M});',62,225,'|||||dragCfg|elm|dragged|jQuery|if|this||iDrag|false||oC|dy|||dx|var||helper|oR||containment|css||cont||parseInt|style||||function|cursorAt|return|pointer|axis|iUtil|dhs|true|else|constructor|top|left|iDrop|none|opacity|px|dhe|els|fx|onDragModifier|display|Math|clonedEl|null|grid|hb|get|currentPointer|onChange|si|browser|newCoords|so|0px|zIndex|onDrag|ghosting|onSlide|Function|document|user|dh|frameClass|onStop|wb|gx|onStart|nRy|nRx|apply|el|msie|parentNode|oP|parentBorders|gy|contBorders|insideParent|isDraggable|parent|each|append|dragElem|extend|oD|hidehelper|iSort|init|prot|dEs|dragstop|nx|diffY|getSize|diffX|ny|position|ActiveXObject|window|vertically|snapDistance|horizontally|revert|unselectable|oldBorder|select|draginit|iSlider|autoSize|dragmove|parentPos|sliderSize|hpc|bind|sliderPos|getPosition|unbind|bottom|clnt|count|right|height|width|fractions|getBorder|destroy|empty|custom|fitToContainer|abs|min|duration|opera|snapToGrid|initialPosition|getContainment|mouseup|marginLeft|marginBottom|mousemove|marginRight|marginTop|block|filter|100|relative|auto|alpha|new|distance|Array|userSelect|body|dragstart|cursor|length|mousedown|build|move|pow|String|handle|on|dragHelper|max|getPointer|KhtmlUserSelect|absolute|div|khtml|highlight|listStyle|modifyContainer|ondragstart|onselectstart|cloneNode|find|moz|offsetLeft|offsetTop|overflow|addClass|Draggable|hidden|mozUserSelect|firstChild|selectKeyHelper|fromHandler|checkdrop|animate|test|for|sqrt|check|MozUserSelect|off|DraggableDestroy|number|lastSi|in|removeClass|checkhover|hide|id|getClient|dragmoveBy|fn|Object|parseFloat|typeof'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1.4={1o:l(u,r,G,F){v u<=1.6.8.9.X&&(u+G)>=(1.6.8.9.X+1.6.8.9.S.w)&&r<=1.6.8.9.Q&&(r+F)>=(1.6.8.9.Q+1.6.8.9.S.h)?k:7},1r:l(u,r,G,F){v!(u>(1.6.8.9.X+1.6.8.9.S.w)||(u+G)<1.6.8.9.X||r>(1.6.8.9.Q+1.6.8.9.S.h)||(r+F)<1.6.8.9.Q)?k:7},1q:l(u,r,G,F){v u<1.6.8.9.O.x&&(u+G)>1.6.8.9.O.x&&r<1.6.8.9.O.y&&(r+F)>1.6.8.9.O.y?k:7},C:7,g:{},1u:0,j:{},1E:l(D){5(1.6.8==E){v}n i;1.4.g={};n 15=7;T(i R 1.4.j){5(1.4.j[i]!=E){n 2=1.4.j[i].q(0);5(1(1.6.8).1d(\'.\'+2.3.a)){5(2.3.m==7){2.3.p=1.18(1.K.1c(2),1.K.1b(2));2.3.m=k}5(2.3.A){1.4.j[i].13(2.3.A)}1.4.g[i]=1.4.j[i];5(1.c&&2.3.s&&1.6.8.9.W){2.3.1e=1(\'.\'+2.3.a,2);D.I.H=\'16\';1.c.1f(2);2.3.1k=1.c.1l(1.12(2,\'z\')).1t;D.I.H=D.9.1h;15=k}5(2.3.V){2.3.V.Z(1.4.j[i].q(0),[1.6.8])}}}}5(15){1.c.1F()}},1w:l(){1.4.g={};T(i R 1.4.j){5(1.4.j[i]!=E){n 2=1.4.j[i].q(0);5(1(1.6.8).1d(\'.\'+2.3.a)){2.3.p=1.18(1.K.1c(2),1.K.1b(2));5(2.3.A){1.4.j[i].13(2.3.A)}1.4.g[i]=1.4.j[i];5(1.c&&2.3.s&&1.6.8.9.W){2.3.1e=1(\'.\'+2.3.a,2);D.I.H=\'16\';1.c.1f(2);D.I.H=D.9.1h}}}}},1a:l(e){5(1.6.8==E){v}1.4.C=7;n i;n 14=7;n 1g=0;T(i R 1.4.g){n 2=1.4.g[i].q(0);5(1.4.C==7&&1.4[2.3.t](2.3.p.x,2.3.p.y,2.3.p.1A,2.3.p.1y)){5(2.3.B&&2.3.h==7){1.4.g[i].13(2.3.B)}5(2.3.h==7&&2.3.M){14=k}2.3.h=k;1.4.C=2;5(1.c&&2.3.s&&1.6.8.9.W){1.c.P.q(0).1J=2.3.1m;1.c.1a(2)}1g++}1U 5(2.3.h==k){5(2.3.N){2.3.N.Z(2,[e,1.6.P.q(0).1i,2.3.J])}5(2.3.B){1.4.g[i].11(2.3.B)}2.3.h=7}}5(1.c&&!1.4.C&&1.6.8.W){1.c.P.q(0).I.H=\'16\'}5(14){1.4.C.3.M.Z(1.4.C,[e,1.6.P.q(0).1i])}},1N:l(e){n i;T(i R 1.4.g){n 2=1.4.g[i].q(0);5(2.3.A){1.4.g[i].11(2.3.A)}5(2.3.B){1.4.g[i].11(2.3.B)}5(2.3.s){1.c.19[1.c.19.1Q]=i}5(2.3.L&&2.3.h==k){2.3.h=7;2.3.L.Z(2,[e,2.3.J])}2.3.m=7;2.3.h=7}1.4.g={}},1v:l(){v b.1j(l(){5(b.U){5(b.3.s){z=1.12(b,\'z\');1.c.1p[z]=E;1(\'.\'+b.3.a,b).1P()}1.4.j[\'d\'+b.17]=E;b.U=7;b.f=E}})},1n:l(o){v b.1j(l(){5(b.U==k||!o.1s||!1.K||!1.6){v}b.3={a:o.1s,A:o.1R||7,B:o.1O||7,1m:o.1K||7,L:o.1L||o.L||7,M:o.M||o.1T||7,N:o.N||o.1S||7,V:o.V||7,t:o.Y&&(o.Y==\'1o\'||o.Y==\'1r\')?o.Y:\'1q\',J:o.J?o.J:7,m:7,h:7};5(o.1D==k&&1.c){z=1.12(b,\'z\');1.c.1p[z]=b.3.a;b.3.s=k;5(o.10){b.3.10=o.10;b.3.1k=1.c.1l(z).1t}}b.U=k;b.17=1H(1G.1I()*1B);1.4.j[\'d\'+b.17]=1(b);1.4.1u++})}};1.1z.18({1x:1.4.1v,1C:1.4.1n});1.1M=1.4.1w;',62,119,'|jQuery|iEL|dropCfg|iDrop|if|iDrag|false|dragged|dragCfg||this|iSort||||highlighted|||zones|true|function||var|||get|zoney|||zonex|return||||id|ac|hc|overzone|elm|null|zoneh|zonew|display|style|fx|iUtil|onDrop|onHover|onOut|currentPointer|helper|ny|in|oC|for|isDroppable|onActivate|so|nx|tolerance|apply|onChange|removeClass|attr|addClass|applyOnHover|oneIsSortable|none|idsa|extend|changed|checkhover|getSizeLite|getPositionLite|is|el|measure|hlt|oD|firstChild|each|os|serialize|shc|build|fit|collected|pointer|intersect|accept|hash|count|destroy|remeasure|DroppableDestroy|hb|fn|wb|10000|Droppable|sortable|highlight|start|Math|parseInt|random|className|helperclass|ondrop|recallDroppables|checkdrop|hoverclass|DraggableDestroy|length|activeclass|onout|onhover|else'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3.4={17:[],H:{},d:6,T:n,1T:k(){5(3.f.j==n){D}m w,U,c,I;3.4.d.8(0).1U=3.f.j.9.14;w=3.4.d.8(0).L;w.M=\'1k\';3.4.d.1l=3.1i(3.S.1X(3.4.d.8(0)),3.S.1Y(3.4.d.8(0)));w.1V=3.f.j.9.1l.1r+\'1E\';w.27=3.f.j.9.1l.1h+\'1E\';U=3.S.20(3.f.j);w.1z=U.t;w.1C=U.r;w.1y=U.b;w.1Q=U.l;5(3.f.j.9.J==u){c=3.f.j.28(u);I=c.L;I.1z=\'13\';I.1C=\'13\';I.1y=\'13\';I.1Q=\'13\';I.M=\'1k\';3.4.d.24().18(c)}3(3.f.j).1x(3.4.d.8(0));3.f.j.L.M=\'1a\'},23:k(e){5(!e.9.1e&&3.15.1t.1K){5(e.9.P)e.9.P.22(j);3(e).21(\'25\',e.9.26||e.9.2a);3(e).1u();3(3.15.1t).1S(e)}3.4.d.29(e.9.14).2b(\'&1N;\');3.4.T=n;m w=3.4.d.8(0).L;w.M=\'1a\';3.4.d.1x(e);5(e.9.v>0){3(e).1Z(e.9.v)}3(\'1D\').18(3.4.d.8(0));m Y=[];m V=6;Z(m i=0;i<3.4.17.A;i++){m N=3.15.1W[3.4.17[i]].8(0);m p=3.E(N,\'p\');m X=3.4.1p(p);5(N.g.1q!=X.1b){N.g.1q=X.1b;5(V==6&&N.g.10){V=N.g.10}X.p=p;Y[Y.A]=X}}3.4.17=[];5(V!=6&&Y.A>0){V(Y)}},2e:k(e,o){5(!3.f.j)D;m B=6;m i=0;5(e.g.q.1s()>0){Z(i=e.g.q.1s();i>0;i--){5(e.g.q.8(i-1)!=3.f.j){5(!e.C.1g){5((e.g.q.8(i-1).K.y+e.g.q.8(i-1).K.1h/2)>3.f.j.9.1v){B=e.g.q.8(i-1)}W{2v}}W{5((e.g.q.8(i-1).K.x+e.g.q.8(i-1).K.1r/2)>3.f.j.9.2t&&(e.g.q.8(i-1).K.y+e.g.q.8(i-1).K.1h/2)>3.f.j.9.1v){B=e.g.q.8(i-1)}}}}}5(B&&3.4.T!=B){3.4.T=B;3(B).2x(3.4.d.8(0))}W 5(!B&&(3.4.T!=n||3.4.d.8(0).2B!=e)){3.4.T=n;3(e).18(3.4.d.8(0))}3.4.d.8(0).L.M=\'1k\'},2z:k(e){5(3.f.j==n){D}e.g.q.F(k(){7.K=3.1i(3.S.2A(7),3.S.2y(7))})},1p:k(s){m i;m h=\'\';m o={};5(s){5(3.4.H[s]){o[s]=[];3(\'#\'+s+\' .\'+3.4.H[s]).F(k(){5(h.A>0){h+=\'&\'}h+=s+\'[]=\'+3.E(7,\'p\');o[s][o[s].A]=3.E(7,\'p\')})}W{Z(a 1w s){5(3.4.H[s[a]]){o[s[a]]=[];3(\'#\'+s[a]+\' .\'+3.4.H[s[a]]).F(k(){5(h.A>0){h+=\'&\'}h+=s[a]+\'[]=\'+3.E(7,\'p\');o[s[a]][o[s[a]].A]=3.E(7,\'p\')})}}}}W{Z(i 1w 3.4.H){o[i]=[];3(\'#\'+i+\' .\'+3.4.H[i]).F(k(){5(h.A>0){h+=\'&\'}h+=i+\'[]=\'+3.E(7,\'p\');o[i][o[i].A]=3.E(7,\'p\')})}}D{1b:h,o:o}},1L:k(e){5(!e.2h){D}D 7.F(k(){5(!7.C||!3(e).2g(\'.\'+7.C.z))3(e).2d(7.C.z);3(e).1I(7.C.9)})},1M:k(){D 7.F(k(){3(\'.\'+7.C.z).1u();3(7).2c();7.C=n;7.1H=n})},1A:k(o){5(o.z&&3.S&&3.f&&3.15){5(!3.4.d){3(\'1D\',2i).18(\'<1P p="1R">&1N;</1P>\');3.4.d=3(\'#1R\');3.4.d.8(0).L.M=\'1a\'}7.2j({z:o.z,19:o.19?o.19:6,1c:o.1c?o.1c:6,G:o.G?o.G:6,1O:o.1O||o.2o,1J:o.1J||o.2n,1K:u,10:o.10||o.2m,v:o.v?o.v:6,J:o.J?u:6,1m:o.1m?o.1m:\'2k\'});D 7.F(k(){m 9={11:o.11?u:6,1G:1F,O:o.O?1B(o.O):6,14:o.G?o.G:6,v:o.v?o.v:6,1e:u,J:o.J?u:6,R:o.R?o.R:n,Q:o.Q?o.Q:n,12:o.12&&o.12.1o==1n?o.12:6,16:o.16&&o.16.1o==1n?o.16:6,P:o.P&&o.P.1o==1n?o.P:6,1d:/2l|2f/.2p(o.1d)?o.1d:6,1j:o.1j?2q(o.1j)||0:6,1f:o.1f?o.1f:6};3(\'.\'+o.z,7).1I(9);7.1H=u;7.C={z:o.z,11:o.11?u:6,1G:1F,O:o.O?1B(o.O):6,14:o.G?o.G:6,v:o.v?o.v:6,1e:u,J:o.J?u:6,R:o.R?o.R:n,Q:o.Q?o.Q:n,1g:o.1g?u:6,9:9}})}}};3.2w.1i({2s:3.4.1A,1S:3.4.1L,2r:3.4.1M});3.2u=3.4.1p;',62,162,'|||jQuery|iSort|if|false|this|get|dragCfg||||helper||iDrag|dropCfg|||dragged|function||var|null||id|el||||true|fx|shs|||accept|length|cur|sortCfg|return|attr|each|helperclass|collected|cs|ghosting|pos|style|display|iEL|opacity|onStop|containment|handle|iUtil|inFrontOf|margins|fnc|else|ser|ts|for|onChange|revert|onStart|0px|hpc|iDrop|onDrag|changed|append|activeclass|none|hash|hoverclass|axis|so|cursorAt|floats|hb|extend|snapDistance|block|oC|tolerance|Function|constructor|serialize|os|wb|size|overzone|DraggableDestroy|ny|in|after|marginBottom|marginTop|build|parseFloat|marginRight|body|px|3000|zindex|isSortable|Draggable|onOut|sortable|addItem|destroy|nbsp|onHover|div|marginLeft|sortHelper|SortableAddItem|start|className|width|zones|getPosition|getSize|fadeIn|getMargins|css|apply|check|empty|position|initialPosition|height|cloneNode|removeClass|oP|html|DroppableDestroy|addClass|checkhover|horizontally|is|childNodes|document|Droppable|intersect|vertically|onchange|onout|onhover|test|parseInt|SortableDestroy|Sortable|nx|SortSerialize|break|fn|before|getPositionLite|measure|getSizeLite|parentNode'.split('|'),0,{}))
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.6={28:9(e,o){5(e.L){2.6.1R(e);8 2.6.1K(e)}r{8 2.6.1D(e,o)}},1D:2.p.2b,1K:9(e){5(!2.v.A){8}5(!(e.1q.1r.1k()>0)){8}5(!e.3.Z){2.p.2n(e);e.3.Z=C}7 a=2.6.1A(e);7 b=2.6.1v(e,a);7 c=(!a)?2.6.24(e):n;7 d=n;5(a){5(e.3.1m===a&&e.3.1W===b){d=C}}r 5(e.3.1m===a&&e.3.1V===c){d=C}e.3.1m=a;e.3.1W=b;e.3.1V=c;5(d){8}5(a!==N){5(b){2.6.1U(e,a)}r{2.6.1Q(e,a)}}r 5(c){2.6.1P(e)}},1R:9(e){5(!e.3.16){8 n}7 a=e.3.15;7 b=e.3.14;7 c=2.v.A.B.2o;7 d=2.1i.1L();5((c.y-d.M)-d.t>-a){1H.1F(0,b)}5(c.y-d.t<a){1H.1F(0,-b)}},18:9(a){2.6.1C(a);8 2.6.1B(a)},1B:2.p.18,1C:9(a){5(2.6.S&&2.6.D){2.6.D.1y(2.6.S);2.6.D=N;2.6.S=""}5(2.1d.1w.L){2.1d.1w.3.Z=n}},X:9(s){5(2(\'#\'+s).q(0).L){8 2.6.27(s)}r{8 2.6.29(s)}},29:2.p.X,27:9(s){7 i;7 h=\'\';7 j=\'\';7 o={};7 e;7 k=9(f){7 g=[];1X=2(f).J(\'.\'+2.p.1b[s]);1X.1p(9(i){7 a=2.2s(m,\'1l\');5(a&&a.1S){a=a.1S(e.3.11)[0]}5(h.I>0){h+=\'&\'}h+=s+j+\'[\'+i+\'][1l]=\'+a;g[i]={1l:a};7 b=2(m).J(e.3.G+"."+e.3.W.V(" ").T(".")).q(0);7 c=j;j+=\'[\'+i+\'][J]\';7 d=k(b);5(d.I>0){g[i].J=d}j=c});8 g};5(s){5(2.p.1b[s]){e=2(\'#\'+s).q(0);o[s]=k(e)}r{1O(a 1N s){5(2.p.1b[s[a]]){e=2(\'#\'+s[a]).q(0);o[s[a]]=k(e)}}}}r{1O(i 1N 2.p.1b){e=2(\'#\'+i).q(0);o[i]=k(e)}}8{2p:h,o:o}},1A:9(e){7 d=0;7 f=2.1M(e.1q.1r,9(i){7 a=(i.z.y<2.v.A.B.1j)&&(i.z.y>d);5(!a){8 n}7 b;5(e.3.Q){b=(i.z.x+i.z.13+e.3.P>2.v.A.B.12+2.v.A.B.1h.13)}r{b=(i.z.x-e.3.P<2.v.A.B.12)}5(!b){8 n}7 c=2.6.1g(e,i);5(c){8 n}d=i.z.y;8 C});5(f.I>0){8 f[(f.I-1)]}r{8 N}},24:9(e){7 c;7 d=2.1M(e.1q.1r,9(i){7 a=(c===1J||i.z.y<c);5(!a){8 n}7 b=2.6.1g(e,i);5(b){8 n}c=i.z.y;8 C});5(d.I>0){d=d[(d.I-1)];8 d.z.y<2.v.A.B.1j+2.v.A.B.1h.2m&&d.z.y>2.v.A.B.1j}r{8 n}},1g:9(e,a){7 b=2.v.A;5(!b){8 n}5(a==b){8 C}5(2(a).2l("."+e.1I.1f.V(" ").T(".")).1G(9(){8 m==b}).I!==0){8 C}r{8 n}},1v:9(e,a){5(!a){8 n}5(e.3.O&&2(a).1G("."+e.3.O).q(0)===a){8 n}5(e.3.Q){8 a.z.x+a.z.13-(e.3.H-e.3.P)>2.v.A.B.12+2.v.A.B.1h.13}r{8 a.z.x+(e.3.H-e.3.P)<2.v.A.B.12}},1U:9(e,a){7 b=2(a).J(e.3.G+"."+e.3.W.V(" ").T("."));7 c=2.p.U;1E=c.q(0).2k;1E.2j=\'2i\';5(!b.1k()){7 d="<"+e.3.G+" 2h=\'"+e.3.W+"\'></"+e.3.G+">";b=2(a).2g(d).J(e.3.G).1z(e.3.1e)}2.6.17(e,b);2.6.Y(e);b.1x(c.q(0));2.6.1a(e)},1Q:9(e,a){2.6.17(e,2(a).1t());2.6.Y(e);2(a).2f(2.p.U.q(0));2.6.1a(e)},1P:9(e){2.6.17(e,e);2.6.Y(e);2(e).1x(2.p.U.q(0));2.6.1a(e)},Y:9(e){7 a=2.p.U.1t(e.3.G+"."+e.3.W.V(" ").T("."));7 b=a.J("."+e.1I.1f.V(" ").T(".")+":2e").1k();5(b===0&&a.q(0)!==e){a.2d()}},1a:9(e){7 a=2.p.U.1t();5(a.q(0)!==e){a.2c()}e.3.Z=n},17:9(e,a){7 b=2(a);5((e.3.K)&&(!2.6.D||b.q(0)!=2.6.D.q(0))){5(2.6.D){2.6.D.1y(e.3.K)}5(b.q(0)!=e){2.6.D=b;b.2E(e.3.K);2.6.S=e.3.K}r{2.6.D=N;2.6.S=""}}},2a:9(){8 m.1p(9(){5(m.L){m.3=N;m.L=N;2(m).2D()}})},26:9(a){5(a.1f&&2.1i&&2.v&&2.1d&&2.p){m.1p(9(){m.L=C;m.3={O:a.O?a.O:n,Q:a.Q?C:n,H:25(a.H,10)||2C,K:a.K?a.K:"",1u:a.1u?a.1u:n,16:a.16!==1J?a.16==C:C,15:a.15?a.15:20,14:a.14?a.14:20,11:a.11?a.11:/[^\\-]*$/};m.3.P=25(m.3.H*0.4,10);m.3.G=m.2B;m.3.W=m.2A;m.3.1e=(m.3.Q)?{"1c-21":0,"1c-1Z":m.3.H+\'1Y\'}:{"1c-21":m.3.H+\'1Y\',"1c-1Z":0};2(m.3.G,m).1z(m.3.1e)});2.p.2b=2.6.28;2.p.18=2.6.18;2.p.X=2.6.X}8 m.2z(a)}};2.2y.2x({2w:2.6.26,2v:2.6.2a});2.1i.1L=9(e){7 t,l,w,h,R,M;5(e&&e.2u.2t()!=\'F\'){t=e.19;l=e.1o;w=e.1n;h=e.1s;R=0;M=0}r{5(u.E&&u.E.19){t=u.E.19;l=u.E.1o;w=u.E.1n;h=u.E.1s}r 5(u.F){t=u.F.19;l=u.F.1o;w=u.F.1n;h=u.F.1s}R=1T.2r||u.E.23||u.F.23||0;M=1T.2q||u.E.22||u.F.22||0}8{t:t,l:l,w:w,h:h,R:R,M:M}};',62,165,'||jQuery|nestedSortCfg||if|iNestedSortable|var|return|function|||||||||||||this|false||iSort|get|else|||document|iDrag||||pos|dragged|dragCfg|true|currentNesting|documentElement|body|nestingTag|nestingPxSpace|length|children|currentNestingClass|isNestedSortable|ih|null|noNestingClass|snapTolerance|rightToLeft|iw|latestNestingClass|join|helper|split|nestingTagClass|serialize|beforeHelperRemove|remeasured||serializeRegExp|nx|wb|scrollSpeed|scrollSensitivity|autoScroll|updateCurrentNestingClass|check|scrollTop|afterHelperInsert|collected|padding|iDrop|styleToAttach|accept|isBeingDragged|oC|iUtil|ny|size|id|lastPrecedingItem|scrollWidth|scrollLeft|each|dropCfg|el|scrollHeight|parent|nestingLimit|shouldNestItem|overzone|prepend|removeClass|css|findPrecedingItem|oldCheck|newCheck|oldCheckHover|styleHelper|scrollBy|filter|window|sortCfg|undefined|newCheckHover|getScroll|grep|in|for|insertOnTop|appendItem|scroll|match|self|nestItem|lastTouchingFirst|lastShouldNest|thisChildren|px|right||left|clientHeight|clientWidth|isTouchingFirstItem|parseInt|build|newSerialize|checkHover|oldSerialize|destroy|checkhover|show|hide|visible|after|append|class|auto|width|style|parents|hb|measure|currentPointer|hash|innerHeight|innerWidth|attr|toLowerCase|nodeName|NestedSortableDestroy|NestedSortable|extend|fn|Sortable|className|tagName|30|SortableDestroy|addClass'.split('|'),0,{}))
var arrowimages={down:['menu_arrow_down',DOMAIN+'core/images/arrow-down.gif',10],right:['menu_arrow_right',DOMAIN+'core/images/arrow-right.gif']}
var jquerycssmenu={fadesettings:{overduration:150,outduration:100},buildmenu:function(menuid,arrowsvar){jQuery(document).ready(function($){var $mainmenu=$(menuid+">ul")
var $headers=$mainmenu.find("ul").parent()
$headers.each(function(i){var $curobj=$(this)
var $subul=$(this).find('ul:eq(0)')
this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:$subul.outerWidth(),subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1?true:false
$subul.css({top:this.istopheader?this._dimensions.h+"px":0})
$curobj.children("a:eq(0)").css(this.istopheader?{paddingRight:arrowsvar.down[2]}:{}).append('<!-- <img src="'+(this.istopheader?arrowsvar.down[1]:arrowsvar.right[1])
+'" class="'+(this.istopheader?arrowsvar.down[0]:arrowsvar.right[0])
+'" style="border:0;" align="top" /> -->')
$curobj.hover(function(e){var $targetul=$(this).children("ul:eq(0)")
this._offsets={left:$(this).offset().left,top:$(this).offset().top}
var menuleft=this.istopheader?0:this._dimensions.w
menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())?(this.istopheader?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):menuleft
$targetul.css({left:menuleft+"px"}).fadeIn(jquerycssmenu.fadesettings.overduration)},function(e){$(this).children("ul:eq(0)").hide();})})
$mainmenu.find("ul").css({display:'none',visibility:'visible'})})}}
jquerycssmenu.buildmenu(".menu_javascript",arrowimages);;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><div class="tooltip-title"></div><div class="tooltip-body"></div><div class="tooltip-url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('div.tooltip-title',helper.parent);helper.body=$('div.tooltip-body',helper.parent);helper.url=$('div.tooltip-url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);$.extend({createUploadIframe:function(id,uri){var frameId='jUploadFrame'+id;if(window.ActiveXObject){var io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof uri=='boolean'){io.src='javascript:false';}else if(typeof uri=='string'){io.src=uri;}}else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);return io;},createUploadForm:function(id,fileElementId){var formId='jUploadForm'+id;var fileId='jUploadFile'+id;var form=$('<form  action="" method="POST" name="'+formId+'" id="'+formId+'" enctype="multipart/form-data"></form>');var oldElement=$('#'+fileElementId);var newElement=$(oldElement).clone();$(oldElement).attr('id',fileId);$(oldElement).before(newElement);$(oldElement).appendTo(form);$(form).css('position','absolute');$(form).css('top','-1200px');$(form).css('left','-1200px');$(form).appendTo('body');return form;},ajaxFileUpload:function(s){s=$.extend({},$.ajaxSettings,s);var id=new Date().getTime();var form=$.createUploadForm(id,s.fileElementId);var io=$.createUploadIframe(id,s.secureuri);var frameId='jUploadFrame'+id;var formId='jUploadForm'+id;if(s.global&&!$.active++){$.event.trigger("ajaxStart");}var requestDone=false;var xml={};if(s.global)$.event.trigger("ajaxSend",[xml,s]);var uploadCallback=function(isTimeout){var io=document.getElementById(frameId);try{if(io.contentWindow){xml.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;xml.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}else if(io.contentDocument){xml.responseText=io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;xml.responseXML=io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;}}catch(e){$.handleError(s,xml,null,e);}if(xml||isTimeout=="timeout"){requestDone=true;var status;try{status=isTimeout!="timeout"?"success":"error";if(status!="error"){var data=$.uploadHttpData(xml,s.dataType);if(s.success)s.success(data,status);if(s.global)$.event.trigger("ajaxSuccess",[xml,s]);}else $.handleError(s,xml,status);}catch(e){status="error";$.handleError(s,xml,status,e);}if(s.global)$.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--$.active)$.event.trigger("ajaxStop");if(s.complete)s.complete(xml,status);jQuery(io).unbind();setTimeout(function(){try{$(io).remove();$(form).remove();}catch(e){$.handleError(s,xml,null,e);}},100);xml=null;}};if(s.timeout>0){setTimeout(function(){if(!requestDone)uploadCallback("timeout");},s.timeout);}try{var form=$('#'+formId);$(form).attr('action',s.url);$(form).attr('method','POST');$(form).attr('target',frameId);if(form.encoding)form.encoding='multipart/form-data';else form.enctype='multipart/form-data';$(form).submit();}catch(e){$.handleError(s,xml,null,e);}if(window.attachEvent){document.getElementById(frameId).attachEvent('onload',uploadCallback);}else{document.getElementById(frameId).addEventListener('load',uploadCallback,false);}return{abort:function(){}};},uploadHttpData:function(r,type){var data=!type;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script")$.globalEval(data);if(type=="json")eval("data = "+data);if(type=="html")jQuery("<div>").html(data).evalScripts();return data;}});(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);else if(element.parentNode.name in this.submitted)this.element(element.parentNode)},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox, select, option",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$|^-?\.\d+$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery);$.validator.addMethod("regex",function(value,element,regex){var expression=new RegExp(regex,'g');return(value.replace(expression,"").length==0);});$.validator.addMethod("phoneUS",function(phone_number,element){phone_number=phone_number.replace(/\s+/g,"");return this.optional(element)||phone_number.length>9&&phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);},"Please specify a valid phone number");$.validator.addMethod("emails",function(value,element){if(this.optional(element))return true;var valid=true;var emails=value.split(new RegExp("\\s*,\\s*","gi"));for(var i=0;i<emails.length;i++){var email=emails[i];valid=valid&&/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(email);}
return valid;},$.validator.messages.email);$.validator.addMethod("url_basic",function(value,element){return this.optional(element)||/^(http:\/\/|https:\/\/|ftp:\/\/|www\.)(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},"Please enter a valid url");var tb_pathToImage=DOMAIN+"core/images/loadingAnimation.gif";$(document).ready(function(){imgLoader=new Image();imgLoader.src=tb_pathToImage;});function tb_init(domChunk){$(domChunk).click(function(){var t=this.title||this.name||null;var a=this.href||this.alt;var g=this.rel||false;tb_show(t,a,g);this.blur();return false;});refreshIt(1);}
function tb_show(caption,url,imageGroup){try{if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove);}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove);}}
if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{$("#TB_overlay").addClass("TB_overlayBG");}
if(caption===null){caption="";}
$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;}
var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var urlType=baseURL.toLowerCase().match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(imageGroup){TB_TempArray=$("a[rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);if(!(TB_TempArray[TB_Counter].href==url)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length);}}}
imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=tb_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}}
TB_WIDTH=imageWidth+30;TB_HEIGHT=imageHeight+60;$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>"+"<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='"+DOMAIN+"core/images/close_text.gif' alt='[x]' /></a></div>");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;}
$("#TB_prev").click(goPrev);}
if(!(TB_NextHTML==="")){function goNext(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;}
$("#TB_next").click(goNext);}
document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
if(keycode==27){tb_remove();}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext();}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev();}}};tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(tb_remove);$("#TB_window").css({display:"block"});};imgPreloader.src=url;}else{var queryString=url.replace(/^[^\?]+\??/,'');var params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30||740;if(TB_WIDTH>1000)TB_WIDTH=1000;TB_HEIGHT=(params['height']*1)+40||500;if(TB_HEIGHT>700)TB_HEIGHT=700;TB_PAD=(params['nopad']==1?0:1);ajaxContentW=TB_WIDTH-(TB_PAD==1?30:0);ajaxContentH=TB_HEIGHT-(TB_PAD==1?45:0);if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');$("#TB_iframeContent").remove();if(params['modal']!="true"||params['modal_title']=="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='"+DOMAIN+"core/images/close.gif' alt='[x]' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>");}
else $("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>");if(params['modal']=="true")$("#TB_overlay").unbind();}else{if($("#TB_window").css("display")!="block"){if(params['modal']!="true"||params['modal_title']=="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src='"+DOMAIN+"core/images/close.gif' alt='[x]' /></a></div></div><div id='TB_ajaxContent'"+(TB_PAD==1?"":" class='TB_noPad'")+" style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");}
else $("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal"+(TB_PAD==1?"":" TB_noPad")+"' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");if(params['modal']=="true")$("#TB_overlay").unbind();}else{$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";$("#TB_ajaxContent")[0].scrollTop=0;$("#TB_ajaxWindowTitle").html(caption);}}
$("#TB_closeWindowButton").click(tb_remove);if(url.indexOf('TB_inline')!=-1){$("#TB_ajaxContent").append($('#'+params['inlineId']).children());$("#TB_window").unload(function(){$('#'+params['inlineId']).append($("#TB_ajaxContent").children());});tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"});}else if(url.indexOf('TB_iframe')!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({display:"block"});}}else{$("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display:"block"});});}}
if(!params['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
if(keycode==27){tb_remove();}};}}catch(e){}}
function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"});}
function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","");}
document.onkeydown="";document.onkeyup="";return false;}
function tb_position(){$("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});}}
function tb_parseQuery(query){var Params={};if(!query){return Params;}
var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2){continue;}
var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}
return Params;}
function tb_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=[w,h];return arrayPageSize;}
function tb_detectMacXFF(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('mac')!=-1&&userAgent.indexOf('firefox')!=-1){return true;}};(function(h){var m=h.scrollTo=function(b,c,g){h(window).scrollTo(b,c,g)};m.defaults={axis:'y',duration:1};m.window=function(b){return h(window).scrollable()};h.fn.scrollable=function(){return this.map(function(){var b=this.parentWindow||this.defaultView,c=this.nodeName=='#document'?b.frameElement||b:this,g=c.contentDocument||(c.contentWindow||c).document,i=c.setInterval;return c.nodeName=='IFRAME'||i&&h.browser.safari?g.body:i?g.documentElement:this})};h.fn.scrollTo=function(r,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};a=h.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=h(k),d=r,l,e={},p=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(d)){d=n(d);break}d=h(d,this);case'object':if(d.is||d.style)l=(d=h(d)).offset()}h.each(a.axis.split(''),function(b,c){var g=c=='x'?'Left':'Top',i=g.toLowerCase(),f='scroll'+g,s=k[f],t=c=='x'?'Width':'Height',v=t.toLowerCase();if(l){e[f]=l[i]+(p?0:s-o.offset()[i]);if(a.margin){e[f]-=parseInt(d.css('margin'+g))||0;e[f]-=parseInt(d.css('border'+g+'Width'))||0}e[f]+=a.offset[i]||0;if(a.over[i])e[f]+=d[v]()*a.over[i]}else e[f]=d[i];if(/^\d+$/.test(e[f]))e[f]=e[f]<=0?0:Math.min(e[f],u(t));if(!b&&a.queue){if(s!=e[f])q(a.onAfterFirst);delete e[f]}});q(a.onAfter);function q(b){o.animate(e,j,a.easing,b&&function(){b.call(this,r,a)})};function u(b){var c='scroll'+b,g=k.ownerDocument;return p?Math.max(g.documentElement[c],g.body[c]):k[c]}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";var getData=function(data){if(typeof data!="string")return data;if(data.indexOf('{')<0){data=eval("("+data+")");}}
var getObject=function(data){if(typeof data!="string")return data;data=eval("("+data+")");return data;}
if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/))name=name.replace(/^data-/,'');else return true;object[name]=getObject(this.nodeValue);});}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
object=getObject(data.indexOf("{")<0?"{"+data+"}":data);}
$.data(elem,settings.single,object);return object;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);(function($){$.fn.pngFix=function(settings){settings=$.extend({blankgif:DOMAIN+'core/images/blank.gif'},settings);var ie55=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1);var ie6=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1);if($.browser.msie&&(ie55||ie6)){jQuery(this).find("img[src$=.png]").each(function(){jQuery(this).attr('width',jQuery(this).width());jQuery(this).attr('height',jQuery(this).height());var prevStyle='';var strNewHTML='';var imgId=(jQuery(this).attr('id'))?'id="'+jQuery(this).attr('id')+'" ':'';var imgClass=(jQuery(this).attr('class'))?'class="'+jQuery(this).attr('class')+'" ':'';var imgTitle=(jQuery(this).attr('title'))?'title="'+jQuery(this).attr('title')+'" ':'';var imgAlt=(jQuery(this).attr('alt'))?'alt="'+jQuery(this).attr('alt')+'" ':'';var imgAlign=(jQuery(this).attr('align'))?'float:'+jQuery(this).attr('align')+';':'';var imgHand=(jQuery(this).parent().attr('href'))?'cursor:hand;':'';if(this.style.border){prevStyle+='border:'+this.style.border+';';this.style.border='';}if(this.style.padding){prevStyle+='padding:'+this.style.padding+';';this.style.padding='';}if(this.style.margin){prevStyle+='margin:'+this.style.margin+';';this.style.margin='';}var imgStyle=(this.style.cssText);strNewHTML+='<span '+imgId+imgClass+imgTitle+imgAlt;strNewHTML+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;strNewHTML+='width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;';strNewHTML+='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+jQuery(this).attr('src')+'\', sizingMethod=\'scale\');';strNewHTML+=imgStyle+'"></span>';if(prevStyle!=''){strNewHTML='<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;'+'">'+strNewHTML+'</span>';}jQuery(this).hide();jQuery(this).after(strNewHTML);});jQuery(this).find("*").each(function(){var bgIMG=jQuery(this).css('background-image');if(bgIMG.indexOf(".png")!=-1){var iebg=bgIMG.split('url("')[1].split('")')[0];jQuery(this).css('background-image','none');jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+iebg+"',sizingMethod='scale')";}});jQuery(this).find("input[src$=.png]").each(function(){var bgIMG=jQuery(this).attr('src');jQuery(this).get(0).runtimeStyle.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+bgIMG+'\', sizingMethod=\'scale\');';jQuery(this).attr('src',settings.blankgif);});}return jQuery;};})(jQuery);(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",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:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"}};function keyHandler(handleObj){if(typeof handleObj.data!=="string"){return;}
var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text")){return;}
var special=event.type!=="keypress"&&jQuery.hotkeys.specialKeys[event.which],character=String.fromCharCode(event.which).toLowerCase(),key,modif="",possible={};if(event.altKey&&special!=="alt"){modif+="alt+";}
if(event.ctrlKey&&special!=="ctrl"){modif+="ctrl+";}
if(event.metaKey&&!event.ctrlKey&&special!=="meta"){modif+="meta+";}
if(event.shiftKey&&special!=="shift"){modif+="shift+";}
if(special){possible[modif+special]=true;}else{possible[modif+character]=true;possible[modif+jQuery.hotkeys.shiftNums[character]]=true;if(modif==="shift+"){possible[jQuery.hotkeys.shiftNums[character]]=true;}}
for(var i=0,l=keys.length;i<l;i++){if(possible[keys[i]]){return origHandler.apply(this,arguments);}}};}
jQuery.each(["keydown","keyup","keypress"],function(){jQuery.event.special[this]={add:keyHandler};});})(jQuery);jQuery.ui||function(c){c.ui={version:"1.8.1",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")=="hidden")return false;b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,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}};c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}(jQuery);;(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g=b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f,h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);;(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-
a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);;(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+
this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+
b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");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";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-
parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[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(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.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 a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-
this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+
this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-
this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+
(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.1"})})(jQuery);if(!this.JSON){this.JSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};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={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){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){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
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';}
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;}
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{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;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){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);}
text=String(text);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 typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());(function($){var defaultHandlers=['swfupload_loaded_handler','file_queued_handler','file_queue_error_handler','file_dialog_start_handler','file_dialog_complete_handler','upload_start_handler','upload_progress_handler','upload_error_handler','upload_success_handler','upload_complete_handler','queue_complete_handler'];var additionalHandlers=[];$.fn.swfupload=function(){var args=$.makeArray(arguments);return this.each(function(){var swfu;if(args.length==1&&typeof(args[0])=='object'){swfu=$(this).data('__swfu');if(!swfu){var settings=args[0];var $magicUploadControl=$(this);var handlers=[];$.merge(handlers,defaultHandlers);$.merge(handlers,additionalHandlers);$.each(handlers,function(i,v){var eventName=v.replace(/_handler$/,'').replace(/_([a-z])/g,function(){return arguments[1].toUpperCase();});settings[v]=function(){var event=$.Event(eventName);$magicUploadControl.trigger(event,$.makeArray(arguments));return!event.isDefaultPrevented();};});$(this).data('__swfu',new SWFUpload(settings));}}else if(args.length>0&&typeof(args[0])=='string'){var methodName=args.shift();swfu=$(this).data('__swfu');if(swfu&&swfu[methodName]){swfu[methodName].apply(swfu,args);}}});};$.swfupload={additionalHandlers:function(){if(arguments.length===0){return additionalHandlers.slice();}else{$(arguments).each(function(i,v){$.merge(additionalHandlers,$.makeArray(v));});}},defaultHandlers:function(){return defaultHandlers.slice();},getInstance:function(el){return $(el).data('__swfu');}};})(jQuery);jQuery.tableDnD={currentTable:null,dragObject:null,mouseOffset:null,oldY:0,build:function(options){this.each(function(){this.tableDnDConfig=jQuery.extend({onDragStyle:null,onDropStyle:null,onDragClass:"tDnD_whileDrag",onDrop:null,onDragStart:null,scrollAmount:5,serializeRegexp:/[^\-]*$/,serializeParamName:null,dragHandle:null},options||{});jQuery.tableDnD.makeDraggable(this);});jQuery(document).bind('mousemove',jQuery.tableDnD.mousemove).bind('mouseup',jQuery.tableDnD.mouseup);return this;},makeDraggable:function(table){var config=table.tableDnDConfig;if(table.tableDnDConfig.dragHandle){var cells=jQuery("."+table.tableDnDConfig.dragHandle,table);cells.each(function(){jQuery(this).mousedown(function(ev){jQuery.tableDnD.dragObject=jQuery.tableDnD.parentTr(this);jQuery.tableDnD.currentTable=table;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,ev);if(config.onDragStart){config.onDragStart(table,this);}
return false;});})}else{var rows=jQuery("tr",table);rows.each(function(){var row=jQuery(this);if(!row.hasClass("nodrag")){row.mousedown(function(ev){if(ev.target.tagName=="TD"){jQuery.tableDnD.dragObject=this;jQuery.tableDnD.currentTable=table;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,ev);if(config.onDragStart){config.onDragStart(table,this);}
return false;}}).css("cursor","move");}});}},parentTr:function(e){var parent=e.parentNode;if(parent.nodeName=="TR")return parent;else return jQuery.tableDnD.parentTr(parent);},updateTables:function(){this.each(function(){if(this.tableDnDConfig){jQuery.tableDnD.makeDraggable(this);}})},mouseCoords:function(ev){if(ev.pageX||ev.pageY){return{x:ev.pageX,y:ev.pageY};}
return{x:ev.clientX+document.body.scrollLeft-document.body.clientLeft,y:ev.clientY+document.body.scrollTop-document.body.clientTop};},getMouseOffset:function(target,ev){ev=ev||window.event;var docPos=this.getPosition(target);var mousePos=this.mouseCoords(ev);return{x:mousePos.x-docPos.x,y:mousePos.y-docPos.y};},getPosition:function(e){var left=0;var top=0;if(e.offsetHeight==0){e=e.firstChild;}
while(e.offsetParent){left+=e.offsetLeft;top+=e.offsetTop;e=e.offsetParent;}
left+=e.offsetLeft;top+=e.offsetTop;return{x:left,y:top};},mousemove:function(ev){if(jQuery.tableDnD.dragObject==null){return;}
var dragObj=jQuery(jQuery.tableDnD.dragObject);var config=jQuery.tableDnD.currentTable.tableDnDConfig;var mousePos=jQuery.tableDnD.mouseCoords(ev);var y=mousePos.y-jQuery.tableDnD.mouseOffset.y;var yOffset=window.pageYOffset;if(document.all){if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat'){yOffset=document.documentElement.scrollTop;}
else if(typeof document.body!='undefined'){yOffset=document.body.scrollTop;}}
if(mousePos.y-yOffset<config.scrollAmount){window.scrollBy(0,-config.scrollAmount);}else{var windowHeight=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;if(windowHeight-(mousePos.y-yOffset)<config.scrollAmount){window.scrollBy(0,config.scrollAmount);}}
if(y!=jQuery.tableDnD.oldY){var movingDown=y>jQuery.tableDnD.oldY;jQuery.tableDnD.oldY=y;if(config.onDragClass){dragObj.addClass(config.onDragClass);}else{dragObj.css(config.onDragStyle);}
var currentRow=jQuery.tableDnD.findDropTargetRow(dragObj,y);if(currentRow){if(movingDown&&jQuery.tableDnD.dragObject!=currentRow){jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,currentRow.nextSibling);}else if(!movingDown&&jQuery.tableDnD.dragObject!=currentRow){jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,currentRow);}}}
return false;},findDropTargetRow:function(draggedRow,y){var rows=jQuery.tableDnD.currentTable.rows;for(var i=0;i<rows.length;i++){var row=rows[i];var rowY=this.getPosition(row).y;var rowHeight=parseInt(row.offsetHeight)/2;if(row.offsetHeight==0){rowY=this.getPosition(row.firstChild).y;rowHeight=parseInt(row.firstChild.offsetHeight)/2;}
if((y>rowY-rowHeight)&&(y<(rowY+rowHeight))){if(row==draggedRow){return null;}
var config=jQuery.tableDnD.currentTable.tableDnDConfig;if(config.onAllowDrop){if(config.onAllowDrop(draggedRow,row)){return row;}else{return null;}}else{var nodrop=jQuery(row).hasClass("nodrop");if(!nodrop){return row;}else{return null;}}
return row;}}
return null;},mouseup:function(e){if(jQuery.tableDnD.currentTable&&jQuery.tableDnD.dragObject){var droppedRow=jQuery.tableDnD.dragObject;var config=jQuery.tableDnD.currentTable.tableDnDConfig;if(config.onDragClass){jQuery(droppedRow).removeClass(config.onDragClass);}else{jQuery(droppedRow).css(config.onDropStyle);}
jQuery.tableDnD.dragObject=null;if(config.onDrop){config.onDrop(jQuery.tableDnD.currentTable,droppedRow);}
jQuery.tableDnD.currentTable=null;}},serialize:function(){if(jQuery.tableDnD.currentTable){return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);}else{return"Error: No Table id set, you need to set an id on your table and every row";}},serializeTable:function(table){var result="";var tableId=table.id;var rows=table.rows;for(var i=0;i<rows.length;i++){if(result.length>0)result+="&";var rowId=rows[i].id;if(rowId&&rowId&&table.tableDnDConfig&&table.tableDnDConfig.serializeRegexp){rowId=rowId.match(table.tableDnDConfig.serializeRegexp)[0];}
result+=tableId+'[]='+rowId;}
return result;},serializeTables:function(){var result="";this.each(function(){result+=jQuery.tableDnD.serializeTable(this);});return result;}}
jQuery.fn.extend({tableDnD:jQuery.tableDnD.build,tableDnDUpdate:jQuery.tableDnD.updateTables,tableDnDSerialize:jQuery.tableDnD.serializeTables});(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.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]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;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]),parseInt(result[2]),parseInt(result[3])];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];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)];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)];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};})(jQuery);$.fn.liveUpdate=function(parent,options){var defaults={children:'li',placeholder:'',nested:1}
if(typeof(parent)=='object'){options=parent;parent=options.parent;}
parent=$(parent);options=$.extend(defaults,options);if(parent.length){var rows=parent.children(options.children),cache=rows.map(function(){return this.innerHTML.toLowerCase();});this.keyup(filter).keyup().parents('form').submit(function(){return false;});}
return this;function filter(){var q=$(this).val();var term=$.trim(q.toLowerCase()),scores=[];if(!term||q==options.placeholder){rows.show();if(options.children=="option"&&options.nested!=1)$('optgroup',parent).show();}
else{if(options.children=="option"&&options.nested!=1)$('optgroup',parent).hide();rows.hide();cache.each(function(i){var score=this.score(term);if(score>0){scores.push([score,i]);}});$.each(scores.sort(function(a,b){return b[0]-a[0];}),function(){$(rows[this[1]]).show();});}}};String.prototype.score=function(abbreviation,offset){offset=offset||0;if(abbreviation.length==0)return 0.9;if(abbreviation.length>this.length)return 0.0;for(var i=abbreviation.length;i>0;i--){var sub_abbreviation=abbreviation.substring(0,i);var index=this.indexOf(sub_abbreviation);if(index<0)continue;if(index+abbreviation.length>this.length+offset)continue;var next_string=this.substring(index+sub_abbreviation.length);var next_abbreviation=null;if(i>=abbreviation.length)next_abbreviation='';else next_abbreviation=abbreviation.substring(i);var remaining_score=next_string.score(next_abbreviation,offset+index);if(remaining_score>0){var score=this.length-next_string.length;if(index!=0){var j=0;var c=this.charCodeAt(index-1);if(c==32||c==9){for(var j=(index-2);j>=0;j--){c=this.charCodeAt(j);score-=((c==32||c==9)?1:0.15);}}else score-=index;}score+=remaining_score*next_string.length;score/=this.length;return score;}}return 0.0;}
$.fn.watch=function(props,func,interval,id){if(!interval)
interval=200;if(!id)
id="_watcher";return this.each(function(){var _t=this;var el=$(this);var fnc=function(){__watcher.call(_t,id)};var itId=null;if(typeof(this.onpropertychange)=="object")
el.bind("propertychange."+id,fnc);else if($.browser.mozilla)
el.bind("DOMAttrModified."+id,fnc);else
itId=setInterval(fnc,interval);var data={id:itId,props:props.split(","),func:func,vals:[]};$.each(data.props,function(i){data.vals[i]=el.css(data.props[i]);});el.data(id,data);});function __watcher(id){var el=$(this);var w=el.data(id);var changed=false;var i=0;for(i;i<w.props.length;i++){var newVal=el.css(w.props[i]);if(w.vals[i]!=newVal){w.vals[i]=newVal;changed=true;break;}}
if(changed&&w.func){var _t=this;w.func.call(_t,w,i)}}}
$.fn.unwatch=function(id){this.each(function(){var w=$(this).data(id);var el=$(this);el.removeData();if(typeof(this.onpropertychange)=="object")
el.unbind("propertychange."+id,fnc);else if($.browser.mozilla)
el.unbind("DOMAttrModified."+id,fnc);else
clearInterval(w.id);});return this;}
var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(settings){this.initSWFUpload(settings);};}
SWFUpload.prototype.initSWFUpload=function(settings){try{this.customSettings={};this.settings=settings;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo();}catch(ex){delete SWFUpload.instances[this.movieName];throw ex;}};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"};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 path+url;};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(settingName,defaultValue){this.settings[settingName]=(this.settings[settingName]==undefined)?defaultValue:this.settings[settingName];};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);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);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);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;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",{});this.customSettings=this.settings.custom_settings;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.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url);}
delete this.ensureDefault;};SWFUpload.prototype.loadFlash=function(){var targetElement,tempParent;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";}
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;}
tempParent=document.createElement("div");tempParent.innerHTML=this.getFlashHTML();targetElement.parentNode.replaceChild(tempParent.firstChild,targetElement);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement();}};SWFUpload.prototype.getFlashHTML=function(){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("");};SWFUpload.prototype.getFlashVars=function(){var paramString=this.buildParamString();var httpSuccessString=this.settings.http_success.join(",");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("");};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;};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;");};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var movieElement=null;movieElement=this.getMovieElement();if(movieElement&&typeof(movieElement.CallFunction)==="unknown"){for(var i in movieElement){try{if(typeof(movieElement[i])==="function"){movieElement[i]=null;}}catch(ex1){}}
try{movieElement.parentNode.removeChild(movieElement);}catch(ex){}}
window[this.movieName]=null;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;}};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(""));};SWFUpload.prototype.addSetting=function(name,value,default_value){if(value==undefined){return(this.settings[name]=default_value);}else{return(this.settings[name]=value);}};SWFUpload.prototype.getSetting=function(name){if(this.settings[name]!=undefined){return this.settings[name];}
return"";};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+'</invoke>');returnValue=eval(returnString);}catch(ex){throw"Call to "+functionName+" failed";}
if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue);}
return returnValue;};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile");};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles");};SWFUpload.prototype.startUpload=function(fileID){this.callFlash("StartUpload",[fileID]);};SWFUpload.prototype.cancelUpload=function(fileID,triggerErrorEvent){if(triggerErrorEvent!==false){triggerErrorEvent=true;}
this.callFlash("CancelUpload",[fileID,triggerErrorEvent]);};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload");};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats");};SWFUpload.prototype.setStats=function(statsObject){this.callFlash("SetStats",[statsObject]);};SWFUpload.prototype.getFile=function(fileID){if(typeof(fileID)==="number"){return this.callFlash("GetFileByIndex",[fileID]);}else{return this.callFlash("GetFile",[fileID]);}};SWFUpload.prototype.addFileParam=function(fileID,name,value){return this.callFlash("AddFileParam",[fileID,name,value]);};SWFUpload.prototype.removeFileParam=function(fileID,name){this.callFlash("RemoveFileParam",[fileID,name]);};SWFUpload.prototype.setUploadURL=function(url){this.settings.upload_url=url.toString();this.callFlash("SetUploadURL",[url]);};SWFUpload.prototype.setPostParams=function(paramsObject){this.settings.post_params=paramsObject;this.callFlash("SetPostParams",[paramsObject]);};SWFUpload.prototype.addPostParam=function(name,value){this.settings.post_params[name]=value;this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.removePostParam=function(name){delete this.settings.post_params[name];this.callFlash("SetPostParams",[this.settings.post_params]);};SWFUpload.prototype.setFileTypes=function(types,description){this.settings.file_types=types;this.settings.file_types_description=description;this.callFlash("SetFileTypes",[types,description]);};SWFUpload.prototype.setFileSizeLimit=function(fileSizeLimit){this.settings.file_size_limit=fileSizeLimit;this.callFlash("SetFileSizeLimit",[fileSizeLimit]);};SWFUpload.prototype.setFileUploadLimit=function(fileUploadLimit){this.settings.file_upload_limit=fileUploadLimit;this.callFlash("SetFileUploadLimit",[fileUploadLimit]);};SWFUpload.prototype.setFileQueueLimit=function(fileQueueLimit){this.settings.file_queue_limit=fileQueueLimit;this.callFlash("SetFileQueueLimit",[fileQueueLimit]);};SWFUpload.prototype.setFilePostName=function(filePostName){this.settings.file_post_name=filePostName;this.callFlash("SetFilePostName",[filePostName]);};SWFUpload.prototype.setUseQueryString=function(useQueryString){this.settings.use_query_string=useQueryString;this.callFlash("SetUseQueryString",[useQueryString]);};SWFUpload.prototype.setRequeueOnError=function(requeueOnError){this.settings.requeue_on_error=requeueOnError;this.callFlash("SetRequeueOnError",[requeueOnError]);};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]);};SWFUpload.prototype.setAssumeSuccessTimeout=function(timeout_seconds){this.settings.assume_success_timeout=timeout_seconds;this.callFlash("SetAssumeSuccessTimeout",[timeout_seconds]);};SWFUpload.prototype.setDebugEnabled=function(debugEnabled){this.settings.debug_enabled=debugEnabled;this.callFlash("SetDebugEnabled",[debugEnabled]);};SWFUpload.prototype.setButtonImageURL=function(buttonImageURL){if(buttonImageURL==undefined){buttonImageURL="";}
this.settings.button_image_url=buttonImageURL;this.callFlash("SetButtonImageURL",[buttonImageURL]);};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]);};SWFUpload.prototype.setButtonText=function(html){this.settings.button_text=html;this.callFlash("SetButtonText",[html]);};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]);};SWFUpload.prototype.setButtonTextStyle=function(css){this.settings.button_text_style=css;this.callFlash("SetButtonTextStyle",[css]);};SWFUpload.prototype.setButtonDisabled=function(isDisabled){this.settings.button_disabled=isDisabled;this.callFlash("SetButtonDisabled",[isDisabled]);};SWFUpload.prototype.setButtonAction=function(buttonAction){this.settings.button_action=buttonAction;this.callFlash("SetButtonAction",[buttonAction]);};SWFUpload.prototype.setButtonCursor=function(cursor){this.settings.button_cursor=cursor;this.callFlash("SetButtonCursor",[cursor]);};SWFUpload.prototype.queueEvent=function(handlerName,argumentArray){if(argumentArray==undefined){argumentArray=[];}else if(!(argumentArray instanceof Array)){argumentArray=[argumentArray];}
var self=this;if(typeof this.settings[handlerName]==="function"){this.eventQueue.push(function(){this.settings[handlerName].apply(this,argumentArray);});setTimeout(function(){self.executeNextEvent();},0);}else if(this.settings[handlerName]!==null){throw"Event handler "+handlerName+" is unknown or is not a function";}};SWFUpload.prototype.executeNextEvent=function(){var f=this.eventQueue?this.eventQueue.shift():null;if(typeof(f)==="function"){f.apply(this);}};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;};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface");}catch(ex){return false;}};SWFUpload.prototype.flashReady=function(){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");};SWFUpload.prototype.cleanUp=function(movieElement){try{if(this.movieElement&&typeof(movieElement.CallFunction)==="unknown"){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){}
window["__flash__removeCallback"]=function(instance,name){try{if(instance){instance[name]=null;}}catch(flashEx){}};};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler");};SWFUpload.prototype.fileQueued=function(file){file=this.unescapeFilePostParams(file);this.queueEvent("file_queued_handler",file);};SWFUpload.prototype.fileQueueError=function(file,errorCode,message){file=this.unescapeFilePostParams(file);this.queueEvent("file_queue_error_handler",[file,errorCode,message]);};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";}
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);};SWFUpload.prototype.debug=function(message){this.queueEvent("debug_handler",message);};SWFUpload.prototype.debugMessage=function(message){if(this.settings.debug){var exceptionMessage,exceptionValues=[];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);}};
(function($,window){var
defaults={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true},colorbox='colorbox',prefix='cbox',event_open=prefix+'_open',event_load=prefix+'_load',event_complete=prefix+'_complete',event_cleanup=prefix+'_cleanup',event_closed=prefix+'_closed',event_purge=prefix+'_purge',event_loaded=prefix+'_loaded',isIE=$.browser.msie&&!$.support.opacity,isIE6=isIE&&$.browser.version<7,event_ie6=prefix+'_IE6',$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,element,index,settings,open,active,closing=false,publicMethod,boxElement=prefix+'Element';function $div(id,css){id=id?' id="'+prefix+id+'"':'';css=css?' style="'+css+'"':'';return $('<div'+id+css+'/>');}
function setSize(size,dimension){dimension=dimension==='x'?$window.width():$window.height();return(typeof size==='string')?Math.round((/%/.test(size)?(dimension/100)*parseInt(size,10):parseInt(size,10))):size;}
function isImage(url){return settings.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(url);}
function process(settings){for(var i in settings){if($.isFunction(settings[i])&&i.substring(0,2)!=='on'){settings[i]=settings[i].call(element);}}
settings.rel=settings.rel||element.rel||'nofollow';settings.href=settings.href||$(element).attr('href');settings.title=settings.title||element.title;return settings;}
function trigger(event,callback){if(callback){callback.call(element);}
$.event.trigger(event);}
function slideshow(){var
timeOut,className=prefix+"Slideshow_",click="click."+prefix,start,stop,clear;if(settings.slideshow&&$related[1]){start=function(){$slideshow.text(settings.slideshowStop).unbind(click).bind(event_complete,function(){if(index<$related.length-1||settings.loop){timeOut=setTimeout(publicMethod.next,settings.slideshowSpeed);}}).bind(event_load,function(){clearTimeout(timeOut);}).one(click+' '+event_cleanup,stop);$box.removeClass(className+"off").addClass(className+"on");timeOut=setTimeout(publicMethod.next,settings.slideshowSpeed);};stop=function(){clearTimeout(timeOut);$slideshow.text(settings.slideshowStart).unbind([event_complete,event_load,event_cleanup,click].join(' ')).one(click,start);$box.removeClass(className+"on").addClass(className+"off");};if(settings.slideshowAuto){start();}else{stop();}}}
function launch(elem){if(!closing){element=elem;settings=process($.extend({},$.data(element,colorbox)));$related=$(element);index=0;if(settings.rel!=='nofollow'){$related=$('.'+boxElement).filter(function(){var relRelated=$.data(this,colorbox).rel||this.rel;return(relRelated===settings.rel);});index=$related.index(element);if(index===-1){$related=$related.add(element);index=$related.length-1;}}
if(!open){open=active=true;$box.show();if(settings.returnFocus){try{element.blur();$(element).one(event_closed,function(){try{this.focus();}catch(e){}});}catch(e){}}
$overlay.css({"opacity":+settings.opacity,"cursor":settings.overlayClose?"pointer":"auto"}).show();settings.w=setSize(settings.initialWidth,'x');settings.h=setSize(settings.initialHeight,'y');publicMethod.position(0);if(isIE6){$window.bind('resize.'+event_ie6+' scroll.'+event_ie6,function(){$overlay.css({width:$window.width(),height:$window.height(),top:$window.scrollTop(),left:$window.scrollLeft()});}).trigger('scroll.'+event_ie6);}
trigger(event_open,settings.onOpen);$current.add($prev).add($next).add($slideshow).add($title).hide();$close.html(settings.close).show();}
publicMethod.load(true);}}
publicMethod=$.fn[colorbox]=$[colorbox]=function(options,callback){var $this=this,autoOpen;if(!$this[0]&&$this.selector){return $this;}
options=options||{};if(callback){options.onComplete=callback;}
if(!$this[0]||$this.selector===undefined){$this=$('<a/>');options.open=true;}
$this.each(function(){$.data(this,colorbox,$.extend({},$.data(this,colorbox)||defaults,options));$(this).addClass(boxElement);});autoOpen=options.open;if($.isFunction(autoOpen)){autoOpen=autoOpen.call($this);}
if(autoOpen){launch($this[0]);}
return $this;};publicMethod.init=function(){$window=$(window);$box=$div().attr({id:colorbox,'class':isIE?prefix+'IE':''});$overlay=$div("Overlay",isIE6?'position:absolute':'').hide();$wrap=$div("Wrapper");$content=$div("Content").append($loaded=$div("LoadedContent",'width:0; height:0; overflow:hidden'),$loadingOverlay=$div("LoadingOverlay").add($div("LoadingGraphic")),$title=$div("Title"),$current=$div("Current"),$next=$div("Next"),$prev=$div("Previous"),$slideshow=$div("Slideshow").bind(event_open,slideshow),$close=$div("Close"));$wrap.append($div().append($div("TopLeft"),$topBorder=$div("TopCenter"),$div("TopRight")),$div(false,'clear:left').append($leftBorder=$div("MiddleLeft"),$content,$rightBorder=$div("MiddleRight")),$div(false,'clear:left').append($div("BottomLeft"),$bottomBorder=$div("BottomCenter"),$div("BottomRight"))).children().children().css({'float':'left'});$loadingBay=$div(false,'position:absolute; width:9999px; visibility:hidden; display:none');$('body').prepend($overlay,$box.append($wrap,$loadingBay));$content.children().hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');}).addClass('hover');interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(true)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(true)-$content.width();loadedHeight=$loaded.outerHeight(true);loadedWidth=$loaded.outerWidth(true);$box.css({"padding-bottom":interfaceHeight,"padding-right":interfaceWidth}).hide();$next.click(publicMethod.next);$prev.click(publicMethod.prev);$close.click(publicMethod.close);$content.children().removeClass('hover');$('.'+boxElement).live('click',function(e){if(!((e.button!==0&&typeof e.button!=='undefined')||e.ctrlKey||e.shiftKey||e.altKey)){e.preventDefault();launch(this);}});$overlay.click(function(){if(settings.overlayClose){publicMethod.close();}});$(document).bind("keydown",function(e){if(open&&settings.escKey&&e.keyCode===27){e.preventDefault();publicMethod.close();}
if(open&&settings.arrowKey&&!active&&$related[1]){if(e.keyCode===37&&(index||settings.loop)){e.preventDefault();$prev.click();}else if(e.keyCode===39&&(index<$related.length-1||settings.loop)){e.preventDefault();$next.click();}}});};publicMethod.remove=function(){$box.add($overlay).remove();$('.'+boxElement).die('click').removeData(colorbox).removeClass(boxElement);};publicMethod.position=function(speed,loadedCallback){var
animate_speed,posTop=Math.max(document.documentElement.clientHeight-settings.h-loadedHeight-interfaceHeight,0)/2+$window.scrollTop(),posLeft=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2+$window.scrollLeft();animate_speed=($box.width()===settings.w+loadedWidth&&$box.height()===settings.h+loadedHeight)?0:speed;$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(that){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=that.style.width;$loadingOverlay[0].style.height=$loadingOverlay[1].style.height=$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=that.style.height;}
$box.dequeue().animate({width:settings.w+loadedWidth,height:settings.h+loadedHeight,top:posTop,left:posLeft},{duration:animate_speed,complete:function(){modalDimensions(this);active=false;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if(loadedCallback){loadedCallback();}},step:function(){modalDimensions(this);}});};publicMethod.resize=function(options){if(open){options=options||{};if(options.width){settings.w=setSize(options.width,'x')-loadedWidth-interfaceWidth;}
if(options.innerWidth){settings.w=setSize(options.innerWidth,'x');}
$loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,'y')-loadedHeight-interfaceHeight;}
if(options.innerHeight){settings.h=setSize(options.innerHeight,'y');}
if(!options.innerHeight&&!options.height){var $child=$loaded.wrapInner("<div style='overflow:auto'></div>").children();settings.h=$child.height();$child.replaceWith($child.children());}
$loaded.css({height:settings.h});publicMethod.position(settings.transition==="none"?0:settings.speed);}};publicMethod.prep=function(object){if(!open){return;}
var photo,speed=settings.transition==="none"?0:settings.speed;$window.unbind('resize.'+prefix);$loaded.remove();$loaded=$div('LoadedContent').html(object);function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw<settings.w?settings.mw:settings.w;return settings.w;}
function getHeight(){settings.h=settings.h||$loaded.height();settings.h=settings.mh&&settings.mh<settings.h?settings.mh:settings.h;return settings.h;}
$loaded.hide().appendTo($loadingBay.show()).css({width:getWidth(),overflow:settings.scrolling?'auto':'hidden'}).css({height:getHeight()}).prependTo($content);$loadingBay.hide();$('#'+prefix+'Photo').css({cssFloat:'none',marginLeft:'auto',marginRight:'auto'});if(isIE6){$('select').not($box.find('select')).filter(function(){return this.style.visibility!=='hidden';}).css({'visibility':'hidden'}).one(event_cleanup,function(){this.style.visibility='inherit';});}
function setPosition(s){var prev,prevSrc,next,nextSrc,total=$related.length,loop=settings.loop;publicMethod.position(s,function(){function defilter(){if(isIE){$box[0].style.filter=false;}}
if(!open){return;}
if(isIE){if(photo){$loaded.fadeIn(100);}}
$loaded.show();trigger(event_loaded);$title.show().html(settings.title);if(total>1){if(typeof settings.current==="string"){$current.html(settings.current.replace(/\{current\}/,index+1).replace(/\{total\}/,total)).show();}
$next[(loop||index<total-1)?"show":"hide"]().html(settings.next);$prev[(loop||index)?"show":"hide"]().html(settings.previous);prev=index?$related[index-1]:$related[total-1];next=index<total-1?$related[index+1]:$related[0];if(settings.slideshow){$slideshow.show();}
if(settings.preloading){nextSrc=$.data(next,colorbox).href||next.href;prevSrc=$.data(prev,colorbox).href||prev.href;nextSrc=$.isFunction(nextSrc)?nextSrc.call(next):nextSrc;prevSrc=$.isFunction(prevSrc)?prevSrc.call(prev):prevSrc;if(isImage(nextSrc)){$('<img/>')[0].src=nextSrc;}
if(isImage(prevSrc)){$('<img/>')[0].src=prevSrc;}}}
$loadingOverlay.hide();if(settings.transition==='fade'){$box.fadeTo(speed,1,function(){defilter();});}else{defilter();}
$window.bind('resize.'+prefix,function(){publicMethod.position(0);});trigger(event_complete,settings.onComplete);});}
if(settings.transition==='fade'){$box.fadeTo(speed,0,function(){setPosition(0);});}else{setPosition(speed);}};publicMethod.load=function(launched){var href,img,setResize,prep=publicMethod.prep;active=true;element=$related[index];if(!launched){settings=process($.extend({},$.data(element,colorbox)));}
trigger(event_purge);trigger(event_load,settings.onLoad);settings.h=settings.height?setSize(settings.height,'y')-loadedHeight-interfaceHeight:settings.innerHeight&&setSize(settings.innerHeight,'y');settings.w=settings.width?setSize(settings.width,'x')-loadedWidth-interfaceWidth:settings.innerWidth&&setSize(settings.innerWidth,'x');settings.mw=settings.w;settings.mh=settings.h;if(settings.maxWidth){settings.mw=setSize(settings.maxWidth,'x')-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.w<settings.mw?settings.w:settings.mw;}
if(settings.maxHeight){settings.mh=setSize(settings.maxHeight,'y')-loadedHeight-interfaceHeight;settings.mh=settings.h&&settings.h<settings.mh?settings.h:settings.mh;}
href=settings.href;$loadingOverlay.show();if(settings.inline){$div().hide().insertBefore($(href)[0]).one(event_purge,function(){$(this).replaceWith($loaded.children());});prep($(href));}else if(settings.iframe){$box.one(event_loaded,function(){var $iframe=$("<iframe name='"+new Date().getTime()+"' frameborder=0"+(settings.scrolling?"":" scrolling='no'")+(isIE?" allowtransparency='true'":'')+" style='width:100%; height:100%; border:0; display:block;'/>");$iframe[0].src=settings.href;$iframe.appendTo($loaded).one(event_purge,function(){$iframe[0].src='//about:blank';});});prep(" ");}else if(settings.html){prep(settings.html);}else if(isImage(href)){img=new Image();img.onload=function(){var percent;img.onload=null;img.id=prefix+'Photo';$(img).css({border:'none',display:'block',cssFloat:'left'});if(settings.scalePhotos){setResize=function(){img.height-=img.height*percent;img.width-=img.width*percent;};if(settings.mw&&img.width>settings.mw){percent=(img.width-settings.mw)/img.width;setResize();}
if(settings.mh&&img.height>settings.mh){percent=(img.height-settings.mh)/img.height;setResize();}}
if(settings.h){img.style.marginTop=Math.max(settings.h-img.height,0)/2+'px';}
if($related[1]&&(index<$related.length-1||settings.loop)){$(img).css({cursor:'pointer'}).click(publicMethod.next);}
if(isIE){img.style.msInterpolationMode='bicubic';}
setTimeout(function(){prep(img);},1);};setTimeout(function(){img.src=href;},1);}else if(href){$loadingBay.load(href,function(data,status,xhr){prep(status==='error'?'Request unsuccessful: '+xhr.statusText:$(this).children());});}};publicMethod.next=function(){if(!active){index=index<$related.length-1?index+1:0;publicMethod.load();}};publicMethod.prev=function(){if(!active){index=index?index-1:$related.length-1;publicMethod.load();}};publicMethod.close=function(){if(open&&!closing){closing=true;open=false;trigger(event_cleanup,settings.onCleanup);$window.unbind('.'+prefix+' .'+event_ie6);$overlay.fadeTo('fast',0);$box.stop().fadeTo('fast',0,function(){trigger(event_purge);$loaded.remove();$box.add($overlay).css({'opacity':1,cursor:'auto'}).hide();setTimeout(function(){closing=false;trigger(event_closed,settings.onClosed);},1);});}};publicMethod.element=function(){return $(element);};publicMethod.settings=defaults;$(publicMethod.init);}(jQuery,this));;(function($){var today=new Date();var months='January,February,March,April,May,June,July,August,September,October,November,December'.split(',');var monthlengths='31,28,31,30,31,30,31,31,30,31,30,31'.split(',');var dateRegEx=/^\d{1,2}\/\d{1,2}\/\d{2}|\d{4}$/;var yearRegEx=/^\d{4,4}$/;$.fn.simpleDatepicker=function(options){var opts=$.extend({},$.fn.simpleDatepicker.defaults,options);setupYearRange();function setupYearRange(){var startyear,endyear;if(opts.startdate.constructor==Date){startyear=opts.startdate.getFullYear();}else if(opts.startdate){if(yearRegEx.test(opts.startdate)){startyear=opts.startdate;}else if(dateRegEx.test(opts.startdate)){opts.startdate=new Date(opts.startdate);startyear=opts.startdate.getFullYear();}else{startyear=today.getFullYear();}}else{startyear=today.getFullYear();}
opts.startyear=startyear;if(opts.enddate.constructor==Date){endyear=opts.enddate.getFullYear();}else if(opts.enddate){if(yearRegEx.test(opts.enddate)){endyear=opts.enddate;}else if(dateRegEx.test(opts.enddate)){opts.enddate=new Date(opts.enddate);endyear=opts.enddate.getFullYear();}else{endyear=today.getFullYear();}}else{endyear=today.getFullYear();}
opts.endyear=endyear;}
function newDatepickerHTML(){var years=[];for(var i=0;i<=opts.endyear-opts.startyear;i++)years[i]=opts.startyear+i;var table=$('<table class="datepicker" cellpadding="0" cellspacing="0"></table>');table.append('<thead></thead>');table.append('<tfoot></tfoot>');table.append('<tbody></tbody>');var monthselect='<select name="month">';for(var i=0;i<months.length;i++)monthselect+='<option value="'+i+'">'+months[i]+'</option>';monthselect+='</select>';var yearselect='<select name="year">';for(var i=0;i<years.length;i++)yearselect+='<option value="'+years[i]+'">'+years[i]+'</option>';yearselect+='</select>';$("thead",table).append('<tr class="controls"><th colspan="7"><span class="prevMonth">&laquo;</span>&nbsp;'+monthselect+yearselect+'&nbsp;<span class="nextMonth">&raquo;</span></th></tr>');$("thead",table).append('<tr class="days"><th>S</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th></tr>');$("tfoot",table).append('<tr><td colspan="2"><span class="today">today</span></td><td colspan="3">&nbsp;</td><td colspan="2"><span class="close">close</span></td></tr>');for(var i=0;i<6;i++)$("tbody",table).append('<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>');return table;}
function findPosition(obj){var curleft=curtop=0;var tb=false;$(obj).parents('#TB_window').each(function(){tb=true;});if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);if(tb==true){curleft+=$(window).scrollLeft();curtop+=$(window).scrollTop();}
return[curleft,curtop];}else{return false;}}
function loadMonth(e,el,datepicker,chosendate){var mo=$("select[name=month]",datepicker).get(0).selectedIndex;var yr=$("select[name=year]",datepicker).get(0).selectedIndex;var yrs=$("select[name=year] option",datepicker).get().length;if(e&&$(e.target).hasClass('prevMonth')){if(0==mo&&yr){yr-=1;mo=11;$("select[name=month]",datepicker).get(0).selectedIndex=11;$("select[name=year]",datepicker).get(0).selectedIndex=yr;}else{mo-=1;$("select[name=month]",datepicker).get(0).selectedIndex=mo;}}else if(e&&$(e.target).hasClass('nextMonth')){if(11==mo&&yr+1<yrs){yr+=1;mo=0;$("select[name=month]",datepicker).get(0).selectedIndex=0;$("select[name=year]",datepicker).get(0).selectedIndex=yr;}else{mo+=1;$("select[name=month]",datepicker).get(0).selectedIndex=mo;}}
if(0==mo&&!yr)$("span.prevMonth",datepicker).hide();else $("span.prevMonth",datepicker).show();if(yr+1==yrs&&11==mo)$("span.nextMonth",datepicker).hide();else $("span.nextMonth",datepicker).show();var cells=$("tbody td",datepicker).unbind().empty().removeClass('date');var m=$("select[name=month]",datepicker).val();var y=$("select[name=year]",datepicker).val();var d=new Date(y,m,1);var startindex=d.getDay();var numdays=monthlengths[m];if(1==m&&((y%4==0&&y%100!=0)||y%400==0))numdays=29;if(opts.startdate.constructor==Date){var startMonth=opts.startdate.getMonth();var startDate=opts.startdate.getDate();}
if(opts.enddate.constructor==Date){var endMonth=opts.enddate.getMonth();var endDate=opts.enddate.getDate();}
for(var i=0;i<numdays;i++){var cell=$(cells.get(i+startindex)).removeClass('chosen');if((yr||((!startDate&&!startMonth)||((i+1>=startDate&&mo==startMonth)||mo>startMonth)))&&(yr+1<yrs||((!endDate&&!endMonth)||((i+1<=endDate&&mo==endMonth)||mo<endMonth)))){cell.text(i+1).addClass('date').hover(function(){$(this).addClass('over');},function(){$(this).removeClass('over');}).click(function(){var chosenDateObj=new Date($("select[name=year]",datepicker).val(),$("select[name=month]",datepicker).val(),$(this).text());closeIt(el,datepicker,chosenDateObj);});if(i+1==chosendate.getDate()&&m==chosendate.getMonth()&&y==chosendate.getFullYear())cell.addClass('chosen');}}}
function closeIt(el,datepicker,dateObj){if(dateObj&&dateObj.constructor==Date)
el.val($.fn.simpleDatepicker.formatOutput(dateObj));datepicker.remove();datepicker=null;$.data(el.get(0),"simpleDatepicker",{hasDatepicker:false});}
function createIt(t,b){$('table.datepicker').remove();$('input.calendar').each(function(e){$.data(this,"simpleDatepicker",{hasDatepicker:false});});var $this=$(t);if(false==$.data($this.get(0),"simpleDatepicker").hasDatepicker){$.data($this.get(0),"simpleDatepicker",{hasDatepicker:true});var initialDate=$this.val();if(initialDate&&dateRegEx.test(initialDate)){var chosendate=new Date(initialDate);}else if(opts.chosendate.constructor==Date){var chosendate=opts.chosendate;}else if(opts.chosendate){var chosendate=new Date(opts.chosendate);}else{var chosendate=today;}
datepicker=newDatepickerHTML();$("body").prepend(datepicker);if(b==1)var elPos=findPosition($this.nextAll('img.datepicker_button').get(0));else var elPos=findPosition($this.get(0));var x=(parseInt(opts.x)?parseInt(opts.x):0)+elPos[0];var y=(parseInt(opts.y)?parseInt(opts.y):0)+elPos[1];$(datepicker).css({position:'absolute',left:x,top:y});$("span",datepicker).css("cursor","pointer");$("select",datepicker).bind('change',function(){loadMonth(null,$this,datepicker,chosendate);});$("span.prevMonth",datepicker).click(function(e){loadMonth(e,$this,datepicker,chosendate);});$("span.nextMonth",datepicker).click(function(e){loadMonth(e,$this,datepicker,chosendate);});$("span.today",datepicker).click(function(){closeIt($this,datepicker,new Date());});$("span.close",datepicker).click(function(){closeIt($this,datepicker);});$("select[name=month]",datepicker).get(0).selectedIndex=chosendate.getMonth();$("select[name=year]",datepicker).get(0).selectedIndex=Math.max(0,chosendate.getFullYear()-opts.startyear);loadMonth(null,$this,datepicker,chosendate);}}
return this.each(function(){var id=$(this).attr('id');if(!id){id="datepicker_"+Math.floor(Math.random()*99999);$(this).attr('id',id);}
if($(this).is('input')&&('text'==$(this).attr('type')||'date'==$(this).attr('type'))){var datepicker;$.data($(this).get(0),"simpleDatepicker",{hasDatepicker:false});$(this).click(function(ev){createIt(this);});if(opts.button==true&&opts.button_url){var x=0;$(this).after("<img src='"+opts.button_url+"' alt='...' width='16' height='16' class='datepicker_button' />");$(this).nextAll("img.datepicker_button").each(function(){if(x==0)$(this).click(function(){createIt($('#'+id),1);});x++;});}}});};$.fn.simpleDatepicker.formatOutput=function(dateObj){return(dateObj.getMonth()+1)+"/"+dateObj.getDate()+"/"+dateObj.getFullYear();};$.fn.simpleDatepicker.defaults={chosendate:today,startdate:today.getFullYear(),enddate:today.getFullYear()+1,x:18,y:18,button:true,button_url:DOMAIN+"core/images/calendar.png"};})(jQuery);;(function($){var tmp,loading,overlay,wrap,outer,content,close,title,nav_left,nav_right,selectedIndex=0,selectedOpts={},selectedArray=[],currentIndex=0,currentOpts={},currentArray=[],ajaxLoader=null,imgPreloader=new Image(),imgRegExp=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,swfRegExp=/[^\.]\.(swf)\s*$/i,loadingTimer,loadingFrame=1,titleHeight=0,titleStr='',start_pos,final_pos,busy=false,fx=$.extend($('<div/>')[0],{prop:0}),isIE6=$.browser.msie&&$.browser.version<7&&!window.XMLHttpRequest,_abort=function(){loading.hide();imgPreloader.onerror=imgPreloader.onload=null;if(ajaxLoader){ajaxLoader.abort();}
tmp.empty();},_error=function(){if(false===selectedOpts.onError(selectedArray,selectedIndex,selectedOpts)){loading.hide();busy=false;return;}
selectedOpts.titleShow=false;selectedOpts.width='auto';selectedOpts.height='auto';tmp.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');_process_inline();},_start=function(){var obj=selectedArray[selectedIndex],href,type,title,str,emb,ret;_abort();selectedOpts=$.extend({},$.fn.fancybox.defaults,(typeof $(obj).data('fancybox')=='undefined'?selectedOpts:$(obj).data('fancybox')));ret=selectedOpts.onStart(selectedArray,selectedIndex,selectedOpts);if(ret===false){busy=false;return;}else if(typeof ret=='object'){selectedOpts=$.extend(selectedOpts,ret);}
title=selectedOpts.title||(obj.nodeName?$(obj).attr('title'):obj.title)||'';if(obj.nodeName&&!selectedOpts.orig){selectedOpts.orig=$(obj).children("img:first").length?$(obj).children("img:first"):$(obj);}
if(title===''&&selectedOpts.orig&&selectedOpts.titleFromAlt){title=selectedOpts.orig.attr('alt');}
href=selectedOpts.href||(obj.nodeName?$(obj).attr('href'):obj.href)||null;if((/^(?:javascript)/i).test(href)||href=='#'){href=null;}
if(selectedOpts.type){type=selectedOpts.type;if(!href){href=selectedOpts.content;}}else if(selectedOpts.content){type='html';}else if(href){if(href.match(imgRegExp)){type='image';}else if(href.match(swfRegExp)){type='swf';}else if($(obj).hasClass("iframe")){type='iframe';}else if(href.indexOf("#")===0){type='inline';}else{type='ajax';}}
if(!type){_error();return;}
if(type=='inline'){obj=href.substr(href.indexOf("#"));type=$(obj).length>0?'inline':'ajax';}
selectedOpts.type=type;selectedOpts.href=href;selectedOpts.title=title;if(selectedOpts.autoDimensions){if(selectedOpts.type=='html'||selectedOpts.type=='inline'||selectedOpts.type=='ajax'){selectedOpts.width='auto';selectedOpts.height='auto';}else{selectedOpts.autoDimensions=false;}}
if(selectedOpts.modal){selectedOpts.overlayShow=true;selectedOpts.hideOnOverlayClick=false;selectedOpts.hideOnContentClick=false;selectedOpts.enableEscapeButton=false;selectedOpts.showCloseButton=false;}
selectedOpts.padding=parseInt(selectedOpts.padding,10);selectedOpts.margin=parseInt(selectedOpts.margin,10);tmp.css('padding',(selectedOpts.padding+selectedOpts.margin));$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change',function(){$(this).replaceWith(content.children());});switch(type){case'html':tmp.html(selectedOpts.content);_process_inline();break;case'inline':if($(obj).parent().is('#fancybox-content')===true){busy=false;return;}
$('<div class="fancybox-inline-tmp" />').hide().insertBefore($(obj)).bind('fancybox-cleanup',function(){$(this).replaceWith(content.children());}).bind('fancybox-cancel',function(){$(this).replaceWith(tmp.children());});$(obj).appendTo(tmp);_process_inline();break;case'image':busy=false;$.fancybox.showActivity();imgPreloader=new Image();imgPreloader.onerror=function(){_error();};imgPreloader.onload=function(){busy=true;imgPreloader.onerror=imgPreloader.onload=null;_process_image();};imgPreloader.src=href;break;case'swf':selectedOpts.scrolling='no';str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"><param name="movie" value="'+href+'"></param>';emb='';$.each(selectedOpts.swf,function(name,val){str+='<param name="'+name+'" value="'+val+'"></param>';emb+=' '+name+'="'+val+'"';});str+='<embed src="'+href+'" type="application/x-shockwave-flash" width="'+selectedOpts.width+'" height="'+selectedOpts.height+'"'+emb+'></embed></object>';tmp.html(str);_process_inline();break;case'ajax':busy=false;$.fancybox.showActivity();selectedOpts.ajax.win=selectedOpts.ajax.success;ajaxLoader=$.ajax($.extend({},selectedOpts.ajax,{url:href,data:selectedOpts.ajax.data||{},error:function(XMLHttpRequest,textStatus,errorThrown){if(XMLHttpRequest.status>0){_error();}},success:function(data,textStatus,XMLHttpRequest){var o=typeof XMLHttpRequest=='object'?XMLHttpRequest:ajaxLoader;if(o.status==200){if(typeof selectedOpts.ajax.win=='function'){ret=selectedOpts.ajax.win(href,data,textStatus,XMLHttpRequest);if(ret===false){loading.hide();return;}else if(typeof ret=='string'||typeof ret=='object'){data=ret;}}
tmp.html(data);_process_inline();}}}));break;case'iframe':_show();break;}},_process_inline=function(){var
w=selectedOpts.width,h=selectedOpts.height;if(w.toString().indexOf('%')>-1){w=parseInt(($(window).width()-(selectedOpts.margin*2))*parseFloat(w)/100,10)+'px';}else{w=w=='auto'?'auto':w+'px';}
if(h.toString().indexOf('%')>-1){h=parseInt(($(window).height()-(selectedOpts.margin*2))*parseFloat(h)/100,10)+'px';}else{h=h=='auto'?'auto':h+'px';}
tmp.wrapInner('<div style="width:'+w+';height:'+h+';overflow: '+(selectedOpts.scrolling=='auto'?'auto':(selectedOpts.scrolling=='yes'?'scroll':'hidden'))+';position:relative;"></div>');selectedOpts.width=tmp.width();selectedOpts.height=tmp.height();_show();},_process_image=function(){selectedOpts.width=imgPreloader.width;selectedOpts.height=imgPreloader.height;$("<img />").attr({'id':'fancybox-img','src':imgPreloader.src,'alt':selectedOpts.title}).appendTo(tmp);_show();},_show=function(){var pos,equal;loading.hide();if(wrap.is(":visible")&&false===currentOpts.onCleanup(currentArray,currentIndex,currentOpts)){$.event.trigger('fancybox-cancel');busy=false;return;}
busy=true;$(content.add(overlay)).unbind();$(window).unbind("resize.fb scroll.fb");$(document).unbind('keydown.fb');if(wrap.is(":visible")&&currentOpts.titlePosition!=='outside'){wrap.css('height',wrap.height());}
currentArray=selectedArray;currentIndex=selectedIndex;currentOpts=selectedOpts;if(currentOpts.overlayShow){overlay.css({'background-color':currentOpts.overlayColor,'opacity':currentOpts.overlayOpacity,'cursor':currentOpts.hideOnOverlayClick?'pointer':'auto','height':$(document).height()});if(!overlay.is(':visible')){if(isIE6){$('select:not(#fancybox-tmp select)').filter(function(){return this.style.visibility!=='hidden';}).css({'visibility':'hidden'}).one('fancybox-cleanup',function(){this.style.visibility='inherit';});}
overlay.show();}}else{overlay.hide();}
final_pos=_get_zoom_to();_process_title();if(wrap.is(":visible")){$(close.add(nav_left).add(nav_right)).hide();pos=wrap.position(),start_pos={top:pos.top,left:pos.left,width:wrap.width(),height:wrap.height()};equal=(start_pos.width==final_pos.width&&start_pos.height==final_pos.height);content.fadeTo(currentOpts.changeFade,0.3,function(){var finish_resizing=function(){content.html(tmp.contents()).fadeTo(currentOpts.changeFade,1,_finish);};$.event.trigger('fancybox-change');content.empty().removeAttr('filter').css({'border-width':currentOpts.padding,'width':final_pos.width-currentOpts.padding*2,'height':selectedOpts.autoDimensions?'auto':final_pos.height-titleHeight-currentOpts.padding*2});if(equal){finish_resizing();}else{fx.prop=0;$(fx).animate({prop:1},{duration:currentOpts.changeSpeed,easing:currentOpts.easingChange,step:_draw,complete:finish_resizing});}});return;}
wrap.removeAttr("style");content.css('border-width',currentOpts.padding);if(currentOpts.transitionIn=='elastic'){start_pos=_get_zoom_from();content.html(tmp.contents());wrap.show();if(currentOpts.opacity){final_pos.opacity=0;}
fx.prop=0;$(fx).animate({prop:1},{duration:currentOpts.speedIn,easing:currentOpts.easingIn,step:_draw,complete:_finish});return;}
if(currentOpts.titlePosition=='inside'&&titleHeight>0){title.show();}
content.css({'width':final_pos.width-currentOpts.padding*2,'height':selectedOpts.autoDimensions?'auto':final_pos.height-titleHeight-currentOpts.padding*2}).html(tmp.contents());wrap.css(final_pos).fadeIn(currentOpts.transitionIn=='none'?0:currentOpts.speedIn,_finish);},_format_title=function(title){if(title&&title.length){if(currentOpts.titlePosition=='float'){return'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+title+'</td><td id="fancybox-title-float-right"></td></tr></table>';}
return'<div id="fancybox-title-'+currentOpts.titlePosition+'">'+title+'</div>';}
return false;},_process_title=function(){titleStr=currentOpts.title||'';titleHeight=0;title.empty().removeAttr('style').removeClass();if(currentOpts.titleShow===false){title.hide();return;}
titleStr=$.isFunction(currentOpts.titleFormat)?currentOpts.titleFormat(titleStr,currentArray,currentIndex,currentOpts):_format_title(titleStr);if(!titleStr||titleStr===''){title.hide();return;}
title.addClass('fancybox-title-'+currentOpts.titlePosition).html(titleStr).appendTo('body').show();switch(currentOpts.titlePosition){case'inside':title.css({'width':final_pos.width-(currentOpts.padding*2),'marginLeft':currentOpts.padding,'marginRight':currentOpts.padding});titleHeight=title.outerHeight(true);title.appendTo(outer);final_pos.height+=titleHeight;break;case'over':title.css({'marginLeft':currentOpts.padding,'width':final_pos.width-(currentOpts.padding*2),'bottom':currentOpts.padding}).appendTo(outer);break;case'float':title.css('left',parseInt((title.width()-final_pos.width-40)/2,10)*-1).appendTo(wrap);break;default:title.css({'width':final_pos.width-(currentOpts.padding*2),'paddingLeft':currentOpts.padding,'paddingRight':currentOpts.padding}).appendTo(wrap);break;}
title.hide();},_set_navigation=function(){if(currentOpts.enableEscapeButton||currentOpts.enableKeyboardNav){$(document).bind('keydown.fb',function(e){if(e.keyCode==27&&currentOpts.enableEscapeButton){e.preventDefault();$.fancybox.close();}else if((e.keyCode==37||e.keyCode==39)&&currentOpts.enableKeyboardNav&&e.target.tagName!=='INPUT'&&e.target.tagName!=='TEXTAREA'&&e.target.tagName!=='SELECT'){e.preventDefault();$.fancybox[e.keyCode==37?'prev':'next']();}});}
if(!currentOpts.showNavArrows){nav_left.hide();nav_right.hide();return;}
if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!==0){nav_left.show();}
if((currentOpts.cyclic&&currentArray.length>1)||currentIndex!=(currentArray.length-1)){nav_right.show();}},_finish=function(){if(!$.support.opacity){content.get(0).style.removeAttribute('filter');wrap.get(0).style.removeAttribute('filter');}
if(selectedOpts.autoDimensions){content.css('height','auto');}
wrap.css('height','auto');if(titleStr&&titleStr.length){title.show();}
if(currentOpts.showCloseButton){close.show();}
_set_navigation();if(currentOpts.hideOnContentClick){content.bind('click',$.fancybox.close);}
if(currentOpts.hideOnOverlayClick){overlay.bind('click',$.fancybox.close);}
$(window).bind("resize.fb",$.fancybox.resize);if(currentOpts.centerOnScroll){$(window).bind("scroll.fb",$.fancybox.center);}
if(currentOpts.type=='iframe'){$('<iframe id="fancybox-frame" name="fancybox-frame'+new Date().getTime()+'" frameborder="0" hspace="0" '+($.browser.msie?'allowtransparency="true""':'')+' scrolling="'+selectedOpts.scrolling+'" src="'+currentOpts.href+'"></iframe>').appendTo(content);}
wrap.show();busy=false;$.fancybox.center();currentOpts.onComplete(currentArray,currentIndex,currentOpts);_preload_images();},_preload_images=function(){var href,objNext;if((currentArray.length-1)>currentIndex){href=currentArray[currentIndex+1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href;}}
if(currentIndex>0){href=currentArray[currentIndex-1].href;if(typeof href!=='undefined'&&href.match(imgRegExp)){objNext=new Image();objNext.src=href;}}},_draw=function(pos){var dim={width:parseInt(start_pos.width+(final_pos.width-start_pos.width)*pos,10),height:parseInt(start_pos.height+(final_pos.height-start_pos.height)*pos,10),top:parseInt(start_pos.top+(final_pos.top-start_pos.top)*pos,10),left:parseInt(start_pos.left+(final_pos.left-start_pos.left)*pos,10)};if(typeof final_pos.opacity!=='undefined'){dim.opacity=pos<0.5?0.5:pos;}
wrap.css(dim);content.css({'width':dim.width-currentOpts.padding*2,'height':dim.height-(titleHeight*pos)-currentOpts.padding*2});},_get_viewport=function(){return[$(window).width()-(currentOpts.margin*2),$(window).height()-(currentOpts.margin*2),$(document).scrollLeft()+currentOpts.margin,$(document).scrollTop()+currentOpts.margin];},_get_zoom_to=function(){var view=_get_viewport(),to={},resize=currentOpts.autoScale,double_padding=currentOpts.padding*2,ratio;if(currentOpts.width.toString().indexOf('%')>-1){to.width=parseInt((view[0]*parseFloat(currentOpts.width))/100,10);}else{to.width=currentOpts.width+double_padding;}
if(currentOpts.height.toString().indexOf('%')>-1){to.height=parseInt((view[1]*parseFloat(currentOpts.height))/100,10);}else{to.height=currentOpts.height+double_padding;}
if(resize&&(to.width>view[0]||to.height>view[1])){if(selectedOpts.type=='image'||selectedOpts.type=='swf'){ratio=(currentOpts.width)/(currentOpts.height);if((to.width)>view[0]){to.width=view[0];to.height=parseInt(((to.width-double_padding)/ratio)+double_padding,10);}
if((to.height)>view[1]){to.height=view[1];to.width=parseInt(((to.height-double_padding)*ratio)+double_padding,10);}}else{to.width=Math.min(to.width,view[0]);to.height=Math.min(to.height,view[1]);}}
to.top=parseInt(Math.max(view[3]-20,view[3]+((view[1]-to.height-40)*0.5)),10);to.left=parseInt(Math.max(view[2]-20,view[2]+((view[0]-to.width-40)*0.5)),10);return to;},_get_obj_pos=function(obj){var pos=obj.offset();pos.top+=parseInt(obj.css('paddingTop'),10)||0;pos.left+=parseInt(obj.css('paddingLeft'),10)||0;pos.top+=parseInt(obj.css('border-top-width'),10)||0;pos.left+=parseInt(obj.css('border-left-width'),10)||0;pos.width=obj.width();pos.height=obj.height();return pos;},_get_zoom_from=function(){var orig=selectedOpts.orig?$(selectedOpts.orig):false,from={},pos,view;if(orig&&orig.length){pos=_get_obj_pos(orig);from={width:pos.width+(currentOpts.padding*2),height:pos.height+(currentOpts.padding*2),top:pos.top-currentOpts.padding-20,left:pos.left-currentOpts.padding-20};}else{view=_get_viewport();from={width:currentOpts.padding*2,height:currentOpts.padding*2,top:parseInt(view[3]+view[1]*0.5,10),left:parseInt(view[2]+view[0]*0.5,10)};}
return from;},_animate_loading=function(){if(!loading.is(':visible')){clearInterval(loadingTimer);return;}
$('div',loading).css('top',(loadingFrame*-40)+'px');loadingFrame=(loadingFrame+1)%12;};$.fn.fancybox=function(options){if(!$(this).length){return this;}
$(this).data('fancybox',$.extend({},options,($.metadata?$(this).metadata():{}))).unbind('click.fb').bind('click.fb',function(e){e.preventDefault();if(busy){return;}
busy=true;$(this).blur();selectedArray=[];selectedIndex=0;var rel=$(this).attr('rel')||'';if(!rel||rel==''||rel==='nofollow'){selectedArray.push(this);}else{selectedArray=$("a[rel="+rel+"], area[rel="+rel+"]");selectedIndex=selectedArray.index(this);}
_start();return;});return this;};$.fancybox=function(obj){var opts;if(busy){return;}
busy=true;opts=typeof arguments[1]!=='undefined'?arguments[1]:{};selectedArray=[];selectedIndex=parseInt(opts.index,10)||0;if($.isArray(obj)){for(var i=0,j=obj.length;i<j;i++){if(typeof obj[i]=='object'){$(obj[i]).data('fancybox',$.extend({},opts,obj[i]));}else{obj[i]=$({}).data('fancybox',$.extend({content:obj[i]},opts));}}
selectedArray=jQuery.merge(selectedArray,obj);}else{if(typeof obj=='object'){$(obj).data('fancybox',$.extend({},opts,obj));}else{obj=$({}).data('fancybox',$.extend({content:obj},opts));}
selectedArray.push(obj);}
if(selectedIndex>selectedArray.length||selectedIndex<0){selectedIndex=0;}
_start();};$.fancybox.showActivity=function(){clearInterval(loadingTimer);loading.show();loadingTimer=setInterval(_animate_loading,66);};$.fancybox.hideActivity=function(){loading.hide();};$.fancybox.next=function(){return $.fancybox.pos(currentIndex+1);};$.fancybox.prev=function(){return $.fancybox.pos(currentIndex-1);};$.fancybox.pos=function(pos){if(busy){return;}
pos=parseInt(pos);selectedArray=currentArray;if(pos>-1&&pos<currentArray.length){selectedIndex=pos;_start();}else if(currentOpts.cyclic&&currentArray.length>1){selectedIndex=pos>=currentArray.length?0:currentArray.length-1;_start();}
return;};$.fancybox.cancel=function(){if(busy){return;}
busy=true;$.event.trigger('fancybox-cancel');_abort();selectedOpts.onCancel(selectedArray,selectedIndex,selectedOpts);busy=false;};$.fancybox.close=function(){if(busy||wrap.is(':hidden')){return;}
busy=true;if(currentOpts&&false===currentOpts.onCleanup(currentArray,currentIndex,currentOpts)){busy=false;return;}
_abort();$(close.add(nav_left).add(nav_right)).hide();$(content.add(overlay)).unbind();$(window).unbind("resize.fb scroll.fb");$(document).unbind('keydown.fb');content.find('iframe').attr('src',isIE6&&/^https/i.test(window.location.href||'')?'javascript:void(false)':'about:blank');if(currentOpts.titlePosition!=='inside'){title.empty();}
wrap.stop();function _cleanup(){overlay.fadeOut('fast');title.empty().hide();wrap.hide();$.event.trigger('fancybox-cleanup');content.empty();currentOpts.onClosed(currentArray,currentIndex,currentOpts);currentArray=selectedOpts=[];currentIndex=selectedIndex=0;currentOpts=selectedOpts={};busy=false;}
if(currentOpts.transitionOut=='elastic'){start_pos=_get_zoom_from();var pos=wrap.position();final_pos={top:pos.top,left:pos.left,width:wrap.width(),height:wrap.height()};if(currentOpts.opacity){final_pos.opacity=1;}
title.empty().hide();fx.prop=1;$(fx).animate({prop:0},{duration:currentOpts.speedOut,easing:currentOpts.easingOut,step:_draw,complete:_cleanup});}else{wrap.fadeOut(currentOpts.transitionOut=='none'?0:currentOpts.speedOut,_cleanup);}};$.fancybox.resize=function(){if(overlay.is(':visible')){overlay.css('height',$(document).height());}
$.fancybox.center(true);};$.fancybox.center=function(){var view,align;if(busy){return;}
align=arguments[0]===true?1:0;view=_get_viewport();if(!align&&(wrap.width()>view[0]||wrap.height()>view[1])){return;}
wrap.stop().animate({'top':parseInt(Math.max(view[3]-20,view[3]+((view[1]-content.height()-40)*0.5)-currentOpts.padding)),'left':parseInt(Math.max(view[2]-20,view[2]+((view[0]-content.width()-40)*0.5)-currentOpts.padding))},typeof arguments[0]=='number'?arguments[0]:200);};$.fancybox.init=function(){if($("#fancybox-wrap").length){return;}
$('body').append(tmp=$('<div id="fancybox-tmp"></div>'),loading=$('<div id="fancybox-loading"><div></div></div>'),overlay=$('<div id="fancybox-overlay"></div>'),wrap=$('<div id="fancybox-wrap"></div>'));outer=$('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(wrap);outer.append(content=$('<div id="fancybox-content"></div>'),close=$('<a id="fancybox-close"></a>'),title=$('<div id="fancybox-title"></div>'),nav_left=$('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),nav_right=$('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));close.click($.fancybox.close);loading.click($.fancybox.cancel);nav_left.click(function(e){e.preventDefault();$.fancybox.prev();});nav_right.click(function(e){e.preventDefault();$.fancybox.next();});if($.fn.mousewheel){wrap.bind('mousewheel.fb',function(e,delta){if(busy){e.preventDefault();}else if($(e.target).get(0).clientHeight==0||$(e.target).get(0).scrollHeight===$(e.target).get(0).clientHeight){e.preventDefault();$.fancybox[delta>0?'prev':'next']();}});}
if(!$.support.opacity){wrap.addClass('fancybox-ie');}
if(isIE6){loading.addClass('fancybox-ie6');wrap.addClass('fancybox-ie6');$('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||'')?'javascript:void(false)':'about:blank')+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);}};$.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:'auto',width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:'transparent'},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:'#777',titleShow:true,titlePosition:'float',titleFormat:null,titleFromAlt:false,transitionIn:'fade',transitionOut:'fade',speedIn:300,speedOut:300,changeSpeed:300,changeFade:'fast',easingIn:'swing',easingOut:'swing',showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};$(document).ready(function(){$.fancybox.init();});})(jQuery);
(function(){var
undefined,doc=document,win=window,math=Math,mathRound=math.round,mathFloor=math.floor,mathMax=math.max,mathAbs=math.abs,mathCos=math.cos,mathSin=math.sin,userAgent=navigator.userAgent,isIE=/msie/i.test(userAgent)&&!win.opera,isWebKit=/AppleWebKit/.test(userAgent),styleTag,canvasCounter=0,colorCounter,symbolCounter,symbolSizes={},idCounter=0,timeFactor=1,garbageBin,DIV='div',ABSOLUTE='absolute',RELATIVE='relative',HIDDEN='hidden',HIGHCHARTS_HIDDEN='highcharts-'+HIDDEN,VISIBLE='visible',PX='px',makeTime,getMinutes,getHours,getDay,getDate,getMonth,getFullYear,setMinutes,setHours,setDate,setMonth,setFullYear,globalAdapter=win.HighchartsAdapter,adapter=globalAdapter||{},each=adapter.each,grep=adapter.grep,map=adapter.map,merge=adapter.merge,hyphenate=adapter.hyphenate,addEvent=adapter.addEvent,fireEvent=adapter.fireEvent,animate=adapter.animate,getAjax=adapter.getAjax,seriesTypes={};if(!globalAdapter&&win.jQuery){var jQ=jQuery;each=function(arr,fn){for(var i=0,len=arr.length;i<len;i++){if(fn.call(arr[i],arr[i],i,arr)===false){return i;}}};grep=jQ.grep;map=function(arr,fn){var results=[];for(var i=0,len=arr.length;i<len;i++){results[i]=fn.call(arr[i],arr[i],i,arr);}
return results;}
merge=function(){var args=arguments;return jQ.extend(true,null,args[0],args[1],args[2],args[3]);}
hyphenate=function(str){return str.replace(/([A-Z])/g,function(a,b){return'-'+b.toLowerCase()});}
addEvent=function(el,event,fn){jQ(el).bind(event,fn);}
fireEvent=function(el,type,eventArguments,defaultFunction){var event=jQ.Event(type),detachedType='detached'+type;extend(event,eventArguments);if(el[type]){el[detachedType]=el[type];el[type]=null;}
jQ(el).trigger(event);if(el[detachedType]){el[type]=el[detachedType];el[detachedType]=null;}
if(defaultFunction&&!event.isDefaultPrevented()){defaultFunction(event);}}
animate=function(el,params,options){jQ(el).animate(params,options);}
getAjax=function(url,callback){jQ.get(url,null,callback);}
jQ.extend(jQ.easing,{easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;}});}else if(!globalAdapter&&win.MooTools){each=$each;map=function(arr,fn){return arr.map(fn);}
grep=function(arr,fn){return arr.filter(fn)}
merge=$merge;hyphenate=function(str){return str.hyphenate();}
addEvent=function(el,type,fn){if(!el.addEvent){if(el.nodeName)el=$(el);else extend(el,new Events());}
el.addEvent(type,fn);}
fireEvent=function(el,event,eventArguments,defaultFunction){event=new Event({type:event,target:el});event=extend(event,eventArguments);event.preventDefault=function(){defaultFunction=null;}
if(el.fireEvent)el.fireEvent(event.type,event);if(defaultFunction)defaultFunction(event);}
animate=function(el,params,options){var myEffect=new Fx.Morph($(el),extend(options,{transition:Fx.Transitions.Quad.easeInOut}));myEffect.start(params);}
getAjax=function(url,callback){(new Request({url:url,method:'get',onSuccess:callback})).send();}}
function splat(obj){if(!obj||obj.constructor!=Array)obj=[obj];return obj;}
function defined(obj){return obj!==undefined&&obj!==null;}
function pick(){var args=arguments,i,arg;for(i=0;i<args.length;i++){arg=args[i];if(defined(arg))return arg;};}
function addCSSRule(selector,declaration,print){var key,serialized='',styleSheets,last,media=print?'print':'',createStyleTag=function(print){return createElement('style',{type:'text/css',media:print?'print':''},null,doc.getElementsByTagName('HEAD')[0]);};if(!styleTag)styleTag=createStyleTag();for(key in declaration)
serialized+=hyphenate(key)+':'+declaration[key]+';';if(!isIE){styleTag.appendChild(doc.createTextNode(selector+" {"+serialized+"}\n"));}else{var styleSheets=doc.styleSheets,index,styleSheet;if(print){createStyleTag(true);}
index=styleSheets.length-1;while(index>=0&&styleSheets[index].media!=media)index--;styleSheet=styleSheets[index];styleSheet.addRule(selector,serialized);}}
function extend(a,b){if(!a)a={};for(var n in b)a[n]=b[n];return a;}
function setOptions(options){defaultOptions=merge(defaultOptions,options);setTimeMethods();return defaultOptions;}
function discardElement(element){if(!garbageBin)garbageBin=createElement(DIV);if(element)garbageBin.appendChild(element);garbageBin.innerHTML='';}
var defaultFont='normal 12px "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',defaultLabelOptions={enabled:true,align:'center',x:0,y:15,style:{color:'#666',font:defaultFont.replace('12px','11px')}},defaultOptions={colors:['#4572A7','#AA4643','#89A54E','#80699B','#3D96AE','#DB843D','#92A8CD','#A47D7C','#B5CA92'],symbols:['circle','diamond','square','triangle','triangle-down'],lang:{loading:'Loading...',months:['January','February','March','April','May','June','July','August','September','October','November','December'],weekdays:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],decimalPoint:'.',resetZoom:'Reset zoom',resetZoomTitle:'Reset zoom level 1:1',thousandsSep:','},global:{useUTC:true},chart:{margin:[50,50,60,80],borderColor:'#4572A7',borderRadius:5,defaultSeriesType:'line',ignoreHiddenSeries:true,plotBorderColor:'#C0C0C0'},title:{text:'Chart title',style:{textAlign:'center',color:'#3E576F',font:defaultFont.replace('12px','16px'),margin:'10px 0 0 0'}},subtitle:{text:'',style:{textAlign:'center',color:'#6D869F',font:defaultFont,margin:0}},plotOptions:{line:{allowPointSelect:false,showCheckbox:false,animation:true,events:{},lineWidth:2,shadow:true,marker:{enabled:true,symbol:'auto',lineWidth:0,radius:4,lineColor:'#FFFFFF',fillColor:'auto',states:{hover:{},select:{fillColor:'#FFFFFF',lineColor:'auto',lineWidth:2}}},point:{events:{}},dataLabels:merge(defaultLabelOptions,{enabled:false,y:-6,formatter:function(){return this.y;}}),showInLegend:true,states:{hover:{lineWidth:3,marker:{}},select:{marker:{}}}}},labels:{style:{position:ABSOLUTE,color:'#3E576F',font:defaultFont}},legend:{enabled:true,layout:'horizontal',labelFormatter:function(){return this.name},borderColor:'#909090',borderRadius:5,shadow:true,style:{bottom:'10px',left:'80px',padding:'5px'},itemStyle:{listStyle:'none',margin:0,padding:'0 2em 0 0',font:defaultFont,cursor:'pointer',color:'#3E576F',position:RELATIVE},itemHoverStyle:{color:'#000'},itemHiddenStyle:{color:'#CCC'},itemCheckboxStyle:{position:ABSOLUTE,right:0},symbolWidth:16,symbolPadding:5},loading:{hideDuration:100,labelStyle:{font:defaultFont.replace('normal','bold'),position:RELATIVE,top:'1em'},showDuration:100,style:{position:ABSOLUTE,backgroundColor:'white',opacity:0.5,textAlign:'center'}},tooltip:{enabled:true,formatter:function(){var pThis=this,series=pThis.series,xAxis=series.xAxis,x=pThis.x;return'<b>'+(pThis.point.name||series.name)+'</b><br/>'+
(defined(x)?'X value: '+(xAxis&&xAxis.options.type=='datetime'?dateFormat('%Y-%m-%d %H:%M:%S',x):x)+'<br/>':'')+'Y value: '+pThis.y;},backgroundColor:'rgba(255, 255, 255, .85)',borderWidth:2,borderRadius:5,shadow:true,snap:10,style:{color:'#333333',font:defaultFont,fontSize:'9pt',padding:'5px',whiteSpace:'nowrap'}},toolbar:{itemStyle:{color:'#4572A7',cursor:'pointer',margin:'20px',font:defaultFont}},credits:{enabled:true,text:'Highcharts.com',href:'http://www.highcharts.com',style:{position:ABSOLUTE,right:'10px',bottom:'5px',color:'#999',textDecoration:'none',font:defaultFont.replace('12px','10px')},target:'_self'}};var defaultXAxisOptions={dateTimeLabelFormats:{second:'%H:%M:%S',minute:'%H:%M',hour:'%H:%M',day:'%e. %b',week:'%e. %b',month:'%b \'%y',year:'%Y'},endOnTick:false,gridLineColor:'#C0C0C0',labels:defaultLabelOptions,lineColor:'#C0D0E0',lineWidth:1,max:null,min:null,maxZoom:null,minorGridLineColor:'#E0E0E0',minorGridLineWidth:1,minorTickColor:'#A0A0A0',minorTickLength:2,minorTickPosition:'outside',minorTickWidth:1,showFirstLabel:true,showLastLabel:false,startOfWeek:1,startOnTick:false,tickColor:'#C0D0E0',tickInterval:'auto',tickLength:5,tickmarkPlacement:'between',tickPixelInterval:100,tickPosition:'outside',tickWidth:1,title:{enabled:false,text:'X-values',align:'middle',margin:35,style:{color:'#6D869F',font:defaultFont.replace('normal','bold')}},type:'linear'},defaultYAxisOptions=merge(defaultXAxisOptions,{endOnTick:true,gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:'right',x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:true,tickWidth:0,title:{enabled:true,margin:40,rotation:270,text:'Y-values'}}),defaultLeftAxisOptions={labels:{align:'right',x:-8,y:3},title:{rotation:270}},defaultRightAxisOptions={labels:{align:'left',x:8,y:3},title:{rotation:90}},defaultBottomAxisOptions={labels:{align:'center',x:0,y:14},title:{rotation:0}},defaultTopAxisOptions=merge(defaultBottomAxisOptions,{labels:{y:-5}});var defaultPlotOptions=defaultOptions.plotOptions,defaultSeriesOptions=defaultPlotOptions.line;defaultPlotOptions.spline=merge(defaultSeriesOptions);defaultPlotOptions.scatter=merge(defaultSeriesOptions,{lineWidth:0,states:{hover:{lineWidth:0}}});defaultPlotOptions.area=merge(defaultSeriesOptions,{fillColor:'auto'});defaultPlotOptions.areaspline=merge(defaultPlotOptions.area);defaultPlotOptions.column=merge(defaultSeriesOptions,{borderColor:'#FFFFFF',borderWidth:1,borderRadius:0,groupPadding:0.2,pointPadding:0.1,states:{hover:{brightness:0.1,shadow:false},select:{color:'#C0C0C0',borderColor:'#000000',shadow:false}}});defaultPlotOptions.bar=merge(defaultPlotOptions.column,{dataLabels:{align:'left',x:5,y:0}});defaultPlotOptions.pie=merge(defaultSeriesOptions,{borderColor:'#FFFFFF',borderWidth:1,center:['50%','50%'],legendType:'point',size:'90%',slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});setTimeMethods();function extendClass(parent,members){var object=function(){};object.prototype=new parent();extend(object.prototype,members);return object;}
function setColor(val,ctx){if(typeof val=='string'){return val;}else if(val.linearGradient){var gradient=ctx.createLinearGradient.apply(ctx,val.linearGradient);each(val.stops,function(stop){gradient.addColorStop(stop[0],stop[1]);});return gradient;}}
var Color=function(input){var rgba=[],result;function parse(input){if((result=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(input)))
rgba=[parseInt(result[1]),parseInt(result[2]),parseInt(result[3]),parseFloat(result[4])];else if((result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(input)))
rgba=[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16),1];}
function get(){if(rgba&&!isNaN(rgba[0]))return'rgba('+rgba.join(',')+')';else return input;}
function brighten(alpha){if(typeof alpha=='number'&&alpha!=0){for(var i=0;i<3;i++){rgba[i]+=parseInt(alpha*255);if(rgba[i]<0)rgba[i]=0;if(rgba[i]>255)rgba[i]=255;}}
return this;}
function setOpacity(alpha){rgba[3]=alpha;return this;}
parse(input);return{get:get,brighten:brighten,setOpacity:setOpacity};};function createElement(tag,attribs,styles,parent,nopad){var el=doc.createElement(tag);if(attribs)extend(el,attribs);if(nopad)setStyles(el,{padding:0,border:'none',margin:0});if(styles)setStyles(el,styles);if(parent)parent.appendChild(el);return el;};function setStyles(el,styles){if(isIE){if(styles.opacity!==undefined)
styles.filter='alpha(opacity='+(styles.opacity*100)+')';}
extend(el.style,styles);};function numberFormat(number,decimals,decPoint,thousandsSep){var lang=defaultOptions.lang,n=number,c=isNaN(decimals=mathAbs(decimals))?2:decimals,d=decPoint===undefined?lang.decimalPoint:decPoint,t=thousandsSep===undefined?lang.thousandsSep:thousandsSep,s=n<0?"-":"",i=parseInt(n=mathAbs(+n||0).toFixed(c))+"",j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+
(c?d+mathAbs(n-i).toFixed(c).slice(2):"");};function dateFormat(format,timestamp,capitalize){function pad(number){return number.toString().replace(/^([0-9])$/,'0$1');}
if(!defined(timestamp))return'Invalid date';var date=new Date(timestamp*timeFactor),hours=date[getHours](),day=date[getDay](),dayOfMonth=date[getDate](),month=date[getMonth](),fullYear=date[getFullYear](),lang=defaultOptions.lang,langWeekdays=lang.weekdays,langMonths=lang.months,replacements={'a':langWeekdays[day].substr(0,3),'A':langWeekdays[day],'d':pad(dayOfMonth),'e':dayOfMonth,'b':langMonths[month].substr(0,3),'B':langMonths[month],'m':pad(month+1),'y':fullYear.toString().substr(2,2),'Y':fullYear,'H':pad(hours),'I':pad((hours%12)||12),'l':(hours%12)||12,'M':pad(date[getMinutes]()),'p':hours<12?'AM':'PM','P':hours<12?'am':'pm','S':pad(date.getSeconds())};for(var key in replacements)format=format.replace('%'+key,replacements[key]);return capitalize?format.substr(0,1).toUpperCase()+format.substr(1):format;};function setTimeMethods(){var useUTC=defaultOptions.global.useUTC;makeTime=useUTC?Date.UTC:function(year,month,date,hours,minutes,seconds){return new Date(year,month,pick(date,1),pick(hours,0),pick(minutes,0),pick(seconds,0)).getTime();};getMinutes=useUTC?'getUTCMinutes':'getMinutes';getHours=useUTC?'getUTCHours':'getHours';getDay=useUTC?'getUTCDay':'getDay';getDate=useUTC?'getUTCDate':'getDate';getMonth=useUTC?'getUTCMonth':'getMonth';getFullYear=useUTC?'getUTCFullYear':'getFullYear';setMinutes=useUTC?'setUTCMinutes':'setMinutes';setHours=useUTC?'setUTCHours':'setHours';setDate=useUTC?'setUTCDate':'setDate';setMonth=useUTC?'setUTCMonth':'setMonth';setFullYear=useUTC?'setUTCFullYear':'setFullYear';};function getPosition(el){var p={x:el.offsetLeft,y:el.offsetTop};while(el.offsetParent){el=el.offsetParent;p.x+=el.offsetLeft;p.y+=el.offsetTop;if(el!=doc.body&&el!=doc.documentElement){p.x-=el.scrollLeft;p.y-=el.scrollTop;}}
return p;}
var Layer=function(name,appendTo,props,styles){var layer=this,div,appendToStyle=appendTo.style;props=extend({className:'highcharts-'+name},props);styles=extend({width:appendToStyle.width,height:appendToStyle.height,position:ABSOLUTE,top:0,left:0,margin:0,padding:0,border:'none'},styles);div=createElement(DIV,props,styles,appendTo);extend(layer,{div:div,width:parseInt(styles.width),height:parseInt(styles.height)});layer.svg=isIE?'':'<?xml version="1.0" encoding="utf-8"?>'+'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" '+'xmlns:xlink="http://www.w3.org/1999/xlink" width="'+layer.width
+'px" height="'+layer.height+'">';layer.basicSvg=layer.svg;}
Layer.prototype={getCtx:function(){if(!this.ctx){var cvs=createElement('canvas',{id:'highcharts-canvas-'+idCounter++,width:this.width,height:this.height},{position:ABSOLUTE},this.div);if(isIE){G_vmlCanvasManager.initElement(cvs);cvs=doc.getElementById(cvs.id);}
this.ctx=cvs.getContext('2d');}
return this.ctx;},getSvg:function(){if(!this.svgObject){var layer=this,div=layer.div,width=layer.width,height=layer.height;if(isIE){if(!doc.namespaces["g_vml_"]){doc.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml");doc.createStyleSheet().cssText="g_vml_\\:*{behavior:url(#default#VML)}";}
this.svgObject=createElement(DIV,null,{width:width+PX,height:height+PX,position:ABSOLUTE},div);}else{this.svgObject=createElement('object',{width:width,height:height,type:'image/svg+xml'},{position:ABSOLUTE,left:0,top:0},div);}}
return this.svgObject;},drawLine:function(x1,y1,x2,y2,color,width){var ctx=this.getCtx(),xBefore=x1;if(x1==x2)x1=x2=mathRound(x1)+(width%2/2);if(y1==y2)y1=y2=mathRound(y1)+(width%2/2);ctx.lineWidth=width;ctx.lineCap='round';ctx.beginPath();ctx.moveTo(x1,y1);ctx.strokeStyle=color;ctx.lineTo(x2,y2);ctx.closePath();ctx.stroke();},drawPolyLine:function(points,color,width,shadow,fillColor){var ctx=this.getCtx(),shadowLine=[];if(shadow&&width){each(points,function(point){shadowLine.push(point===undefined?point:point+1);});for(var i=1;i<=3;i++)
this.drawPolyLine(shadowLine,'rgba(0, 0, 0, '+(0.05*i)+')',6-2*i);}
ctx.beginPath();for(i=0;i<points.length;i+=2)
ctx[i==0?'moveTo':'lineTo'](points[i],points[i+1]);extend(ctx,{lineWidth:width,lineJoin:'round'});if(color&&width){ctx.strokeStyle=setColor(color,ctx);ctx.stroke();}
if(fillColor){ctx.fillStyle=setColor(fillColor,ctx);ctx.fill();}},drawRect:function(x,y,w,h,color,width,radius,fill,shadow,image){var drawPath=function(){var ret;if(w>0&&h>0){ctx.beginPath();if(!radius){ctx.rect(x,y,w,h);}else{ctx.moveTo(x,y+radius);ctx.lineTo(x,y+h-radius);ctx.quadraticCurveTo(x,y+h,x+radius,y+h);ctx.lineTo(x+w-radius,y+h);ctx.quadraticCurveTo(x+w,y+h,x+w,y+h-radius);ctx.lineTo(x+w,y+radius);ctx.quadraticCurveTo(x+w,y,x+w-radius,y);ctx.lineTo(x+radius,y);ctx.quadraticCurveTo(x,y,x,y+radius);}
ctx.closePath();ret=true;}
return ret;};var ctx=this.getCtx(),normalizer=(width||0)%2/2;x=mathRound(x)+normalizer;y=mathRound(y)+normalizer;w=mathRound(w-2*normalizer);h=mathRound(h-2*normalizer);if(shadow)for(var i=1;i<=3;i++){this.drawRect(x+1,y+1,w,h,'rgba(0, 0, 0, '+(0.05*i)+')',6-2*i,radius);}
if(image)ctx.drawImage(image,x,y,w,h);if(drawPath()){if(fill){ctx.fillStyle=setColor(fill,ctx);ctx.fill();if(win.G_vmlCanvasManager)drawPath();}
if(width){ctx.strokeStyle=setColor(color,ctx);ctx.lineWidth=width;ctx.stroke();}}},drawSymbol:function(symbol,x,y,radius,lineWidth,lineColor,fillColor){var ctx=this.getCtx(),imageRegex=/^url\((.*?)\)$/;ctx.beginPath();if(symbol=='square'){var len=0.707*radius;ctx.moveTo(x-len,y-len);ctx.lineTo(x+len,y-len);ctx.lineTo(x+len,y+len);ctx.lineTo(x-len,y+len);ctx.lineTo(x-len,y-len);}else if(symbol=='triangle'){y++;ctx.moveTo(x,y-1.33*radius);ctx.lineTo(x+radius,y+0.67*radius);ctx.lineTo(x-radius,y+0.67*radius);ctx.lineTo(x,y-1.33*radius);}else if(symbol=='triangle-down'){y--;ctx.moveTo(x,y+1.33*radius);ctx.lineTo(x-radius,y-0.67*radius);ctx.lineTo(x+radius,y-0.67*radius);ctx.lineTo(x,y+1.33*radius);}else if(symbol=='diamond'){ctx.moveTo(x,y-radius);ctx.lineTo(x+radius,y);ctx.lineTo(x,y+radius);ctx.lineTo(x-radius,y);ctx.lineTo(x,y-radius);}else if(imageRegex.test(symbol)){createElement('img',{onload:function(){var img=this,size=symbolSizes[img.src]||[img.width,img.height];setStyles(img,{left:mathRound(x-size[0]/2)+PX,top:mathRound(y-size[1]/2)+PX,visibility:VISIBLE})
symbolSizes[img.src]=size;},src:symbol.match(imageRegex)[1]},{position:ABSOLUTE,visibility:isIE?VISIBLE:HIDDEN},this.div);}else{ctx.arc(x,y,radius,0,2*math.PI,true);}
if(fillColor){ctx.fillStyle=fillColor;ctx.fill();}
if(lineColor&&lineWidth){ctx.strokeStyle=lineColor||"rgb(100, 100, 255)";ctx.lineWidth=lineWidth||2;ctx.stroke();}},drawHtml:function(html,attributes,styles){createElement(DIV,extend(attributes,{innerHTML:html}),extend(styles,{position:ABSOLUTE}),this.div);},drawText:function(){this.addText.apply(this,arguments);this.strokeText();},addText:function(str,x,y,style,rotation,align){if(str||str===0){var layer=this,hasObject,div=layer.div,CSStransform,css='',style=style||{},fill=style.color||'#000000',align=align||'left',fontSize=parseInt(style.fontSize||style.font.replace(/^[a-z ]+/,'')),span,spanWidth,transformOriginX;for(var key in style)css+=hyphenate(key)+':'+style[key]+';';each(['MozTransform','WebkitTransform','transform'],function(str){if(str in div.style)CSStransform=str;});if(!rotation||CSStransform){span=createElement('span',{innerHTML:str},extend(style,{position:ABSOLUTE,left:x+PX,whiteSpace:'nowrap',bottom:mathRound(layer.height-y-fontSize*0.25)+PX,color:fill}),div);spanWidth=span.offsetWidth;if(align=='right')setStyles(span,{left:(x-spanWidth)+PX});else if(align=='center')setStyles(span,{left:mathRound(x-spanWidth/2)+PX});if(rotation){transformOriginX={left:0,center:50,right:100}[align]
span.style[CSStransform]='rotate('+rotation+'deg)';span.style[CSStransform+'Origin']=transformOriginX+'% 100%';}}else if(isIE){hasObject=true;var radians=(rotation||0)*math.PI*2/360,costheta=mathCos(radians),sintheta=mathSin(radians),length=layer.width,baselineCorrection=fontSize/3||3,left=align=='left',right=align=='right',x1=left?x:x-length*costheta,x2=right?x:x+length*costheta,y1=left?y:y-length*sintheta,y2=right?y:y+length*sintheta;x1+=baselineCorrection*sintheta;x2+=baselineCorrection*sintheta;y1-=baselineCorrection*costheta;y2-=baselineCorrection*costheta;if(mathAbs(x1-x2)<0.1)x1+=0.1;if(mathAbs(y1-y2)<0.1)y1+=0.1;layer.svg+='<g_vml_:line from="'+x1+', '+y1+'" to="'+x2+', '+y2+'" stroked="false">'+'<g_vml_:fill on="true" color="'+fill+'"/>'+'<g_vml_:path textpathok="true"/>'+'<g_vml_:textpath on="true" string="'+str+'" '+'style="v-text-align:'+align+';'+css+'"/>'+'</g_vml_:line>';}else{hasObject=true;layer.svg+='<g>'+'<text transform="translate('+x+','+y+') rotate('+(rotation||0)+')" '+'style="fill:'+fill+';text-anchor:'+
{left:'start',center:'middle',right:'end'}[align]+';'+css.replace(/"/g,"'")+'">'+str+'</text>'+'</g>';}
layer.hasObject=hasObject;}},strokeText:function(){if(this.hasObject){var svgObject=this.getSvg(),svg=this.svg;if(isIE){svgObject.innerHTML=svg;}else{svgObject.data='data:image/svg+xml,'+svg+'</svg>';if(isWebKit)this.div.appendChild(svgObject);}}},clear:function(){var layer=this,div=this.div,childNodes=div.childNodes,node;if(layer.ctx)layer.ctx.clearRect(0,0,layer.width,layer.height);if(layer.svgObject){discardElement(layer.svgObject);layer.svgObject=null;layer.svg=layer.basicSvg;}
for(var i=childNodes.length-1;i>=0;i--){node=childNodes[i];if(/(SPAN|IMG)/.test(node.tagName))discardElement(node);}},hide:function(){setStyles(this.div,{display:'none'})},show:function(){setStyles(this.div,{display:''})},destroy:function(){discardElement(this.div);return null;}};function Chart(options){function addSeries(options,redraw){var series;redraw=pick(redraw,true);fireEvent(chart,'addSeries',{options:options},function(){series=initSeries(options);series.isDirty=true;chart.isDirty=true;if(redraw)chart.redraw();});return series;};function redraw(){var redrawLegend=chart.isDirty;each(series,function(serie){if(serie.isDirty){serie.cleanData();serie.getSegments();if(serie.options.legendType=='point')redrawLegend=true;}});maxTicks=null;if(hasCartesianSeries){each(axes,function(axis){axis.setScale();})
adjustTickAmounts();each(axes,function(axis){if(axis.isDirty)axis.redraw();})}
each(series,function(serie){if(serie.isDirty&&serie.visible)serie.redraw();});if(redrawLegend){if(legend&&legend.renderHTML){legend.renderHTML(true);legend.drawGraphics(true);}
chart.isDirty=false;}
if(tracker&&tracker.resetTracker)tracker.resetTracker();fireEvent(chart,'redraw');}
function initSeries(options){var type=options.type||optionsChart.defaultSeriesType,typeClass=seriesTypes[type],serie,hasRendered=chart.hasRendered;if(hasRendered){if(inverted&&type=='column')typeClass=BarSeries;else if(!inverted&&type=='bar')typeClass=ColumnSeries;}
serie=new typeClass();serie.init(chart,options);if(!hasRendered&&serie.inverted)inverted=true;if(serie.isCartesian)hasCartesianSeries=serie.isCartesian;series.push(serie);return serie;}
function showLoading(){var loadingOptions=options.loading;if(!loadingLayer){loadingLayer=createElement(DIV,{className:'highcharts-loading'},extend(loadingOptions.style,{left:marginLeft+PX,top:marginTop+PX,width:plotWidth+PX,height:plotHeight+PX,zIndex:10,display:'none'}),container);createElement('span',{innerHTML:options.lang.loading},loadingOptions.labelStyle,loadingLayer);}
setStyles(loadingLayer,{display:''});animate(loadingLayer,{opacity:loadingOptions.style.opacity},{duration:loadingOptions.showDuration});}
function hideLoading(){animate(loadingLayer,{opacity:0},{duration:options.loading.hideDuration,complete:function(){setStyles(loadingLayer,{display:'none'});}});}
function get(id){var i,j,match,data;for(i=0;i<axes.length;i++){if(axes[i].options.id==id)return axes[i];}
for(i=0;i<series.length;i++){if(series[i].options.id==id)return series[i];}
for(i=0;i<series.length;i++){data=series[i].data;for(j=0;j<data.length;j++){if(data[j].id==id)return data[j];}}
return null;}
function updatePosition(){var container=doc.getElementById(containerId);if(container){position=getPosition(container);}}
function getAxes(){var xAxisOptions=options.xAxis||{},yAxisOptions=options.yAxis||{},axis;xAxisOptions=splat(xAxisOptions);each(xAxisOptions,function(axis,i){axis.index=i;axis.isX=true;});yAxisOptions=splat(yAxisOptions);each(yAxisOptions,function(axis,i){axis.index=i;});axes=xAxisOptions.concat(yAxisOptions);chart.xAxis=[];chart.yAxis=[];axes=map(axes,function(axisOptions){axis=new Axis(chart,axisOptions);chart[axis.isXAxis?'xAxis':'yAxis'].push(axis);return axis;});adjustTickAmounts();};function adjustTickAmounts(){if(optionsChart.alignTicks!==false)each(axes,function(axis){axis.adjustTickAmount();});}
function getSelectedPoints(){var points=[];each(series,function(serie){points=points.concat(grep(serie.data,function(point){return point.selected;}));});return points;};function getSelectedSeries(){return grep(series,function(serie){return serie.selected;});}
function zoom(event){var lang=defaultOptions.lang;chart.toolbar.add('zoom',lang.resetZoom,lang.resetZoomTitle,function(){fireEvent(chart,'selection',{resetSelection:true},zoom);chart.toolbar.remove('zoom');});if(!event||event.resetSelection)each(axes,function(axis){axis.setExtremes(null,null,false);});else{each(event.xAxis.concat(event.yAxis),function(axisData){var axis=axisData.axis;if(chart.tracker[axis.isXAxis?'zoomX':'zoomY'])
axis.setExtremes(axisData.min,axisData.max,false);});}
redraw();}
function showTitle(){var title=options.title,subtitle=options.subtitle;if(!chart.titleLayer){var titleLayer=new Layer('title-layer',container,null,{zIndex:2});if(title&&title.text)createElement('h2',{className:'highcharts-title',innerHTML:title.text},title.style,titleLayer.div);if(subtitle&&subtitle.text)createElement('h3',{className:'highcharts-subtitle',innerHTML:subtitle.text},subtitle.style,titleLayer.div);chart.titleLayer=titleLayer;}}
function checkResources(){var allLoaded=true;for(var n in chart.resources){if(!chart.resources[n])allLoaded=false;}
if(allLoaded)resourcesLoaded();};function resourcesLoaded(){getAxes();each(series,function(serie){serie.translate();serie.setTooltipPoints();serie.createArea();});chart.render=render;setTimeout(function(){render();fireEvent(chart,'load');},0);}
function getContainer(){renderTo=optionsChart.renderTo;containerId='highcharts-'+idCounter++;if(typeof renderTo=='string'){renderTo=doc.getElementById(renderTo);}
renderTo.innerHTML='';if(!renderTo.offsetWidth){renderToClone=renderTo.cloneNode(0);setStyles(renderToClone,{position:ABSOLUTE,top:'-9999px',display:''});doc.body.appendChild(renderToClone);}
var renderToOffsetHeight=(renderToClone||renderTo).offsetHeight;chartWidth=optionsChart.width||(renderToClone||renderTo).offsetWidth||600;chartHeight=optionsChart.height||(renderToOffsetHeight>marginTop+marginBottom?renderToOffsetHeight:0)||400;container=createElement(DIV,{className:'highcharts-container'+
(optionsChart.className?' '+optionsChart.className:''),id:containerId},extend({position:RELATIVE,overflow:HIDDEN,width:chartWidth+PX,height:chartHeight+PX,textAlign:'left'},optionsChart.style),renderToClone||renderTo);}
function render(){var mgn,div,i,labels=options.labels,credits=options.credits;mgn=2*(optionsChart.borderWidth||0)+(optionsChart.shadow?8:0);backgroundLayer.drawRect(mgn/2,mgn/2,chartWidth-mgn,chartHeight-mgn,optionsChart.borderColor,optionsChart.borderWidth,optionsChart.borderRadius,optionsChart.backgroundColor,optionsChart.shadow);backgroundLayer.drawRect(marginLeft,marginTop,plotWidth,plotHeight,null,null,null,optionsChart.plotBackgroundColor,null,plotBackground);(new Layer('plot-border',container,null,{zIndex:4})).drawRect(marginLeft,marginTop,plotWidth,plotHeight,optionsChart.plotBorderColor,optionsChart.plotBorderWidth,null,null,optionsChart.plotShadow);if(isIE)addCSSRule('.highcharts-image-map',{display:'none'},'print');if(hasCartesianSeries)each(axes,function(axis){axis.render();});showTitle();if(labels.items)each(labels.items,function(){var attributes=extend({className:'highcharts-label'},this.attributes);plotLayer.drawHtml(this.html,attributes,extend(labels.style,this.style));});each(series,function(serie){serie.render();});legend=chart.legend=new Legend(chart);if(!chart.toolbar)chart.toolbar=Toolbar(chart);if(credits.enabled&&!chart.credits)
chart.credits=createElement('a',{className:'highcharts-credits',href:credits.href,innerHTML:credits.text,target:credits.target},extend(credits.style,{zIndex:8}),container);chart.hasRendered=true;if(renderToClone){renderTo.appendChild(container);discardElement(renderToClone);updatePosition()}};function destroy(){function purge(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=l-1;i>=0;i-=1){n=a[i].name;try{if(typeof d[n]=='function'){d[n]=null;}}catch(e){}}}
a=d.childNodes;if(a){l=a.length;for(i=l-1;i>=0;i--){var node=d.childNodes[i];purge(node);if(!node.childNodes.length)discardElement(node);}}}
each(series,function(serie){serie.destroy();});series=[];purge(container);};function Axis(chart,options){function setOptions(){options=merge(isXAxis?defaultXAxisOptions:defaultYAxisOptions,horiz?(opposite?defaultTopAxisOptions:defaultBottomAxisOptions):(opposite?defaultRightAxisOptions:defaultLeftAxisOptions),options);};function getSeriesExtremes(){var stack=[],run;dataMin=dataMax=null;associatedSeries=[];each(series,function(serie){run=false;each(['xAxis','yAxis'],function(strAxis){if((strAxis=='xAxis'&&isXAxis||strAxis=='yAxis'&&!isXAxis)&&((serie.options[strAxis]==options.index)||(serie.options[strAxis]===undefined&&options.index==0))){serie[strAxis]=axis;associatedSeries.push(serie);run=true;}});if(!serie.visible&&optionsChart.ignoreHiddenSeries)run=false;if(run){var stacking;if(!isXAxis){stacking=serie.options.stacking;usePercentage=stacking=='percent';if(stacking){var typeStack=stack[serie.type]||[];stack[serie.type]=typeStack;}
if(usePercentage){dataMin=0;dataMax=99;}}
if(serie.isCartesian){each(serie.data,function(point,i){var pointX=point.x,pointY=point.y;if(dataMin===null){dataMin=dataMax=point[xOrY];}
if(isXAxis){if(pointX>dataMax)dataMax=pointX;else if(pointX<dataMin)dataMin=pointX;}
else if(defined(pointY)){if(stacking)
typeStack[pointX]=typeStack[pointX]?typeStack[pointX]+pointY:pointY;var stackedPoint=typeStack?typeStack[pointX]:pointY;if(!usePercentage){if(stackedPoint>dataMax)dataMax=stackedPoint;else if(stackedPoint<dataMin)dataMin=stackedPoint;}
if(stacking)stacks[serie.type][pointX]={total:stackedPoint,cum:stackedPoint};}});if(!isXAxis&&/(area|column|bar)/.test(serie.type)){if(dataMin>=0){dataMin=0;ignoreMinPadding=true;}else if(dataMax<0){dataMax=0;ignoreMaxPadding=true;}}}}});};function translate(val,backwards,cvsCoord){var sign=1,cvsOffset=0,returnValue;if(cvsCoord){sign*=-1;cvsOffset=axisLength;}
if(reversed){sign*=-1;cvsOffset-=sign*axisLength;}
if(backwards){if(reversed)val=axisLength-val;returnValue=val/transA+min;}else{returnValue=sign*(val-min)*transA+cvsOffset;}
return returnValue;};function drawPlotLine(value,color,width){if(width){var x1,y1,x2,y2,translatedValue=translate(value),skip;x1=x2=translatedValue+transB;y1=y2=chartHeight-translatedValue-transB;if(horiz){y1=marginTop;y2=chartHeight-marginBottom;if(x1<marginLeft||x1>marginLeft+plotWidth)skip=true;}else{x1=marginLeft;x2=chartWidth-marginRight;if(y1<marginTop||y1>marginTop+plotHeight)skip=true;}
if(!skip)gridLayer.drawLine(x1,y1,x2,y2,color,width);}};function drawPlotBand(from,to,color){from=mathMax(from,min);to=Math.min(to,max);var width=(to-from)*transA;drawPlotLine(from+(to-from)/2,color,width);}
function addTick(pos,tickPos,color,width,len,withLabel,index){var x1,y1,x2,y2,str,labelOptions=options.labels;if(tickPos=='inside')len=-len;if(opposite)len=-len;x1=x2=translate(pos+tickmarkOffset)+transB;y1=y2=chartHeight-translate(pos+tickmarkOffset)-transB;if(horiz){y1=chartHeight-marginBottom-(opposite?plotHeight:0)+offset;y2=y1+len;}else{x1=marginLeft+(opposite?plotWidth:0)+offset;x2=x1-len;}
if(width)axisLayer.drawLine(x1,y1,x2,y2,color,width);if(withLabel&&labelOptions.enabled){str=labelFormatter.call({index:index,isFirst:pos==tickPositions[0],isLast:pos==tickPositions[tickPositions.length-1],value:(categories&&categories[pos]?categories[pos]:pos)});if(str||str===0)axisLayer.addText(str,x1+labelOptions.x-(tickmarkOffset&&horiz?tickmarkOffset*transA*(reversed?-1:1):0),y1+labelOptions.y-(tickmarkOffset&&!horiz?tickmarkOffset*transA*(reversed?1:-1):0),labelOptions.style,labelOptions.rotation,labelOptions.align);}};function normalizeTickInterval(interval,multiples){var normalized,allowDecimals=pick(options.allowDecimals,true);magnitude=multiples?1:math.pow(10,mathFloor(math.log(interval)/math.LN10));normalized=interval/magnitude;if(!multiples)multiples=[1,2,2.5,5,10];for(var i=0;i<multiples.length;i++){interval=multiples[i];if(normalized<=(multiples[i]+(multiples[i+1]||multiples[i]))/2){break;}}
interval*=magnitude;return interval;};function setDateTimeTickPositions(){tickPositions=[];var useUTC=defaultOptions.global.useUTC,oneSecond=1000/timeFactor,oneMinute=60000/timeFactor,oneHour=3600000/timeFactor,oneDay=24*3600000/timeFactor,oneWeek=7*24*3600000/timeFactor,oneMonth=30*24*3600000/timeFactor,oneYear=31556952000/timeFactor,units=[['second',oneSecond,[1,2,5,10,15,30]],['minute',oneMinute,[1,2,5,10,15,30]],['hour',oneHour,[1,2,3,4,6,8,12]],['day',oneDay,[1,2]],['week',oneWeek,[1,2]],['month',oneMonth,[1,2,3,4,6]],['year',oneYear,null]],unit=units[6],interval=unit[1],multiples=unit[2];for(var i=0;i<units.length;i++){unit=units[i];interval=unit[1];multiples=unit[2];if(units[i+1]){var lessThan=(interval*multiples[multiples.length-1]+
units[i+1][1])/2;if(tickInterval<=lessThan)break;}}
if(interval==oneYear&&tickInterval<5*interval)
multiples=[1,2,5];var multitude=normalizeTickInterval(tickInterval/interval,multiples),minYear,minDate=new Date(min*timeFactor);minDate.setMilliseconds(0);if(interval>=oneSecond)
minDate.setSeconds(interval>=oneMinute?0:multitude*mathFloor(minDate.getSeconds()/multitude));if(interval>=oneMinute)
minDate[setMinutes](interval>=oneHour?0:multitude*mathFloor(minDate[getMinutes]()/multitude));if(interval>=oneHour)
minDate[setHours](interval>=oneDay?0:multitude*mathFloor(minDate[getHours]()/multitude));if(interval>=oneDay)
minDate[setDate](interval>=oneMonth?1:multitude*mathFloor(minDate[getDate]()/multitude));if(interval>=oneMonth){minDate[setMonth](interval>=oneYear?0:multitude*mathFloor(minDate[getMonth]()/multitude));minYear=minDate[getFullYear]();}
if(interval>=oneYear){minYear-=minYear%multitude;minDate[setFullYear](minYear);}
if(interval==oneWeek){minDate[setDate](minDate[getDate]()-minDate[getDay]()+
options.startOfWeek);}
var i=1,time=minDate.getTime()/timeFactor,minYear=minDate[getFullYear](),minMonth=minDate[getMonth](),minDateDate=minDate[getDate]();while(time<max&&i<plotWidth){tickPositions.push(time);if(interval==oneYear){time=makeTime(minYear+i*multitude,0)/timeFactor;}else if(interval==oneMonth){time=makeTime(minYear,minMonth+i*multitude)/timeFactor;}else if(!useUTC&&(interval==oneDay||interval==oneWeek)){time=makeTime(minYear,minMonth,minDateDate+
i*multitude*(interval==oneDay?1:7));}else{time+=interval*multitude;}
i++;}
tickPositions.push(time);if(!options.labels.formatter)labelFormatter=function(){return dateFormat(options.dateTimeLabelFormats[unit[0]],this.value,1);}}
function setLinearTickPositions(){var correctFloat=function(num){var invMag=(magnitude<1?mathRound(1/magnitude):1)*10;return mathRound(num*invMag)/invMag},i,roundedMin=mathFloor(min/tickInterval)*tickInterval,roundedMax=math.ceil(max/tickInterval)*tickInterval;tickPositions=[];i=correctFloat(roundedMin);while(i<=roundedMax){tickPositions.push(i);i=correctFloat(i+tickInterval);}
if(categories){min-=0.5;max+=0.5;}
if(!labelFormatter)labelFormatter=function(){return this.value;}};function setTickPositions(){if(isDatetimeAxis)setDateTimeTickPositions();else setLinearTickPositions();var roundedMin=tickPositions[0],roundedMax=tickPositions[tickPositions.length-1];if(options.startOnTick){min=roundedMin;}else if(min>roundedMin){tickPositions.shift();}
if(options.endOnTick){max=roundedMax;}else if(max<roundedMax){tickPositions.pop();}}
function adjustTickAmount(){if(!isDatetimeAxis&&!categories){var oldTickAmount=tickAmount,calculatedTickAmount=tickPositions.length;tickAmount=maxTicks[xOrY];if(calculatedTickAmount<tickAmount){while(tickPositions.length<tickAmount)
tickPositions.push(tickPositions[tickPositions.length-1]+tickInterval);transA*=(calculatedTickAmount-1)/(tickAmount-1);}
if(defined(oldTickAmount)&&tickAmount!=oldTickAmount)axis.isDirty=true;}};function setScale(){var length,type,i,total,oldMin=min,oldMax=max,maxZoom=options.maxZoom,zoomOffset;getSeriesExtremes();min=pick(userSetMin,options.min,dataMin);max=pick(userSetMax,options.max,dataMax);if(max-min<maxZoom){zoomOffset=(maxZoom-max+min)/2;min=mathMax(min-zoomOffset,pick(options.min,min-zoomOffset));max=math.min(min+maxZoom,pick(options.max,min+maxZoom));}
if(!categories&&!usePercentage){length=(max-min)||1;if(!defined(options.min)&&minPadding&&(dataMin<0||!ignoreMinPadding))
min-=length*minPadding;if(!defined(options.max)&&maxPadding&&(dataMax>0||!ignoreMaxPadding))
max+=length*maxPadding;}
if(categories||min==max)tickInterval=1;else tickInterval=options.tickInterval=='auto'?(max-min)*options.tickPixelInterval/axisLength:options.tickInterval;if(!isDatetimeAxis&&options.tickInterval=='auto')
tickInterval=normalizeTickInterval(tickInterval);minorTickInterval=(options.minorTickInterval=='auto'&&tickInterval)?tickInterval/5:options.minorTickInterval;setTickPositions();transA=axisLength/((max-min)||1);if(!maxTicks)maxTicks={x:0,y:0};if(!isDatetimeAxis&&tickPositions.length>maxTicks[xOrY])
maxTicks[xOrY]=tickPositions.length;if(!isXAxis)for(type in stacks)for(i in stacks[type]){stacks[type][i].cum=stacks[type][i].total;}
axis.isDirty=(min!=oldMin||max!=oldMax);};function setExtremes(newMin,newMax,redraw){redraw=pick(redraw,true);fireEvent(axis,'setExtremes',{min:newMin,max:newMax},function(){if(categories){if(newMin<0)newMin=0;if(newMax>categories.length-1)newMax=categories.length-1;}
userSetMin=newMin;userSetMax=newMax;if(redraw)chart.redraw();});};function setCategories(newCategories,doRedraw){categories=newCategories;if(pick(doRedraw,true))redraw();};function getExtremes(){return{min:min,max:max,dataMin:dataMin,dataMax:dataMax}}
function addPlotBandOrLine(item){var isLine=item.width,collection=isLine?plotLines:plotBands;collection.push(item);if(isLine)drawPlotLine(item.value,item.color,item.width);else drawPlotBand(item.from,item.to,item.color);}
function removePlotBandOrLine(id){each([plotBands,plotLines],function(collection){for(var i=0;i<collection.length;i++){if(collection[i].id==id){collection.splice(i,1);break;}}});render();}
function redraw(){if(tracker.resetTracker)tracker.resetTracker();render();each(associatedSeries,function(series){series.isDirty=true;});}
function render(){var axisTitle=options.title,alternateGridColor=options.alternateGridColor,minorTickWidth=options.minorTickWidth,lineWidth=options.lineWidth,lineLeft,lineTop,tickmarkPos,hasData=associatedSeries.length&&defined(min)&&defined(max);axisLayer.clear();gridLayer.clear();if(hasData){if(alternateGridColor){each(tickPositions,function(pos,i){if(i%2==0&&pos<max){drawPlotBand(pos,tickPositions[i+1]!==undefined?tickPositions[i+1]:max,alternateGridColor);}});}
each(plotBands,function(plotBand){drawPlotBand(plotBand.from,plotBand.to,plotBand.color);});if(minorTickInterval&&!categories)for(var i=min;i<=max;i+=minorTickInterval){drawPlotLine(i,options.minorGridLineColor,options.minorGridLineWidth);if(minorTickWidth)addTick(i,options.minorTickPosition,options.minorTickColor,minorTickWidth,options.minorTickLength);}
each(tickPositions,function(pos,index){tickmarkPos=pos+tickmarkOffset;drawPlotLine(tickmarkPos,options.gridLineColor,options.gridLineWidth);addTick(pos,options.tickPosition,options.tickColor,options.tickWidth,options.tickLength,!((pos==min&&!options.showFirstLabel)||(pos==max&&!options.showLastLabel)),index);});each(plotLines,function(plotLine){drawPlotLine(plotLine.value,plotLine.color,plotLine.width);});}
if(lineWidth){lineLeft=marginLeft+(opposite?plotWidth:0)+offset;lineTop=chartHeight-marginBottom-(opposite?plotHeight:0)+offset;axisLayer.drawLine(horiz?marginLeft:lineLeft,horiz?lineTop:marginTop,horiz?chartWidth-marginRight:lineLeft,horiz?lineTop:chartHeight-marginBottom,options.lineColor,lineWidth);}
if(axisTitle&&axisTitle.enabled&&axisTitle.text){var margin=horiz?marginLeft:marginTop,length=horiz?plotWidth:plotHeight;var alongAxis={low:margin+(horiz?0:length),middle:margin+length/2,high:margin+(horiz?length:0)}[axisTitle.align];var offAxis=(horiz?marginTop+plotHeight:marginLeft)+
(horiz?1:-1)*(opposite?-1:1)*axisTitle.margin
-(isIE?parseInt(axisTitle.style.fontSize||axisTitle.style.font.replace(/^[a-z ]+/,''))/3:0);axisLayer.addText(axisTitle.text,horiz?alongAxis:offAxis+(opposite?plotWidth:0)+offset,horiz?offAxis-(opposite?plotHeight:0)+offset:alongAxis,axisTitle.style,axisTitle.rotation||0,{low:'left',middle:'center',high:'right'}[axisTitle.align]);}
axisLayer.strokeText();axis.isDirty=false;};var isXAxis=options.isX,opposite=options.opposite,horiz=inverted?!isXAxis:isXAxis,stacks={bar:{},column:{},area:{},areaspline:{}};setOptions();var axis=this,isDatetimeAxis=options.type=='datetime',offset=options.offset||0,xOrY=isXAxis?'x':'y',axisLength=horiz?plotWidth:plotHeight,transA,transB=horiz?marginLeft:marginBottom,axisLayer=new Layer('axis-layer',container,null,{zIndex:7}),gridLayer=new Layer('grid-layer',container,null,{zIndex:1}),dataMin,dataMax,associatedSeries,userSetMin,userSetMax,max=null,min=null,minPadding=options.minPadding,maxPadding=options.maxPadding,ignoreMinPadding,ignoreMaxPadding,usePercentage,events=options.events,eventType,plotBands=options.plotBands||[],plotLines=options.plotLines||[],tickInterval,minorTickInterval,magnitude,tickPositions,tickAmount,zoom=1,labelFormatter=options.labels.formatter,categories=options.categories||(isXAxis&&chart.columnCount),reversed=options.reversed,tickmarkOffset=(categories&&options.tickmarkPlacement=='between')?0.5:0;if(inverted&&isXAxis&&reversed===undefined)reversed=true;if(!opposite)offset*=-1;if(horiz)offset*=-1;extend(axis,{addPlotBand:addPlotBandOrLine,addPlotLine:addPlotBandOrLine,adjustTickAmount:adjustTickAmount,categories:categories,getExtremes:getExtremes,isXAxis:isXAxis,options:options,render:render,setExtremes:setExtremes,setScale:setScale,setCategories:setCategories,translate:translate,redraw:redraw,removePlotBand:removePlotBandOrLine,removePlotLine:removePlotBandOrLine,reversed:reversed,stacks:stacks});for(eventType in events){addEvent(axis,eventType,events[eventType]);}
setScale();};function Toolbar(chart){var toolbarLayer,buttons={};toolbarLayer=new Layer('toolbar',container,null,{zIndex:1004,width:'auto',height:'auto'});function add(id,text,title,fn){if(!buttons[id]){var button=createElement(DIV,{innerHTML:text,title:title,onclick:fn},extend(options.toolbar.itemStyle,{zIndex:1003}),toolbarLayer.div);buttons[id]=button;}}
function remove(id){discardElement(buttons[id]);buttons[id]=null;}
return{add:add,remove:remove}};function MouseTracker(chart,options){function getActivePoint(){return activePoint;};function normalizeMouseEvent(e){e=e||win.event;if(!e.target)e.target=e.srcElement;if(!e.pageX)
e.pageX=e.clientX+(doc.documentElement.scrollLeft||doc.body.scrollLeft);if(!e.pageY)
e.pageY=e.clientY+(doc.documentElement.scrollTop||doc.body.scrollTop);return e;}
function getMouseCoordinates(e){var coordinates={xAxis:[],yAxis:[]};each(axes,function(axis,i){var translate=axis.translate,isXAxis=axis.isXAxis,isHorizontal=inverted?!isXAxis:isXAxis;coordinates[isXAxis?'xAxis':'yAxis'].push({axis:axis,value:translate(isHorizontal?e.pageX-position.x-marginLeft:plotHeight-e.pageY+position.y+marginTop,true)})});return coordinates;}
function setDOMEvents(){imagemap.onmousedown=function(e){e=normalizeMouseEvent(e);if(e.preventDefault)e.preventDefault();chart.mouseIsDown=mouseIsDown=true;mouseDownX=e.pageX;mouseDownY=e.pageY;if(hasCartesianSeries&&(zoomX||zoomY)){if(!selectionMarker)selectionMarker=createElement(DIV,null,{position:ABSOLUTE,border:'none',background:'#4572A7',opacity:0.25,width:zoomHor?0:plotWidth+PX,height:zoomVert?0:plotHeight+PX});plotLayer.div.appendChild(selectionMarker);}};imagemap.onmousemove=function(e){e=normalizeMouseEvent(e);e.returnValue=false;if(mouseIsDown){hasDragged=Math.sqrt(Math.pow(mouseDownX-e.pageX,2)+
Math.pow(mouseDownY-e.pageY,2))>10;if(zoomHor){var xSize=e.pageX-mouseDownX;setStyles(selectionMarker,{width:mathAbs(xSize)+PX,left:((xSize>0?0:xSize)
+mouseDownX-position.x-marginLeft)+PX});}
if(zoomVert){var ySize=e.pageY-mouseDownY;setStyles(selectionMarker,{height:mathAbs(ySize)+PX,top:((ySize>0?0:ySize)+
+mouseDownY-position.y-marginTop)+PX});}}else{onmousemove(e);}
return false;};imagemap.onmouseup=function(){var selectionIsMade;if(selectionMarker){var selectionData={xAxis:[],yAxis:[]},selectionLeft=selectionMarker.offsetLeft,selectionTop=selectionMarker.offsetTop,selectionWidth=selectionMarker.offsetWidth,selectionHeight=selectionMarker.offsetHeight;if(hasDragged){each(axes,function(axis,i){var translate=axis.translate,isXAxis=axis.isXAxis,isHorizontal=inverted?!isXAxis:isXAxis,selectionMin=translate(isHorizontal?selectionLeft:plotHeight-selectionTop-selectionHeight,true),selectionMax=translate(isHorizontal?selectionLeft+selectionWidth:plotHeight-selectionTop,true);selectionData[isXAxis?'xAxis':'yAxis'].push({axis:axis,min:math.min(selectionMin,selectionMax),max:mathMax(selectionMin,selectionMax)});});fireEvent(chart,'selection',selectionData,zoom);selectionIsMade=true;}
discardElement(selectionMarker);selectionMarker=null;}
chart.mouseIsDown=mouseIsDown=hasDragged=false;};imagemap.onmouseout=function(e){e=e||win.event;var related=e.relatedTarget||e.toElement;if(related&&related!=trackerImage&&related.tagName!='AREA'){resetTracker();chart.mouseIsDown=mouseIsDown=hasDragged=false;}}
imagemap.onclick=function(e){e=normalizeMouseEvent(e);e.cancelBubble=true;if(!hasDragged){if(activePoint&&e.target.tagName=='AREA'){var plotX=activePoint.plotX,plotY=activePoint.plotY;extend(activePoint,{pageX:position.x+marginLeft+
(inverted?plotWidth-plotY:plotX),pageY:position.y+marginTop+
(inverted?plotHeight-plotX:plotY)});fireEvent(chart.hoverSeries,'click',extend(e,{point:activePoint}));activePoint.firePointEvent('click',e);}else{extend(e,getMouseCoordinates(e));fireEvent(chart,'click',e);}}
hasDragged=false;};};function onmousemove(e){var point=chart.hoverPoint,series=chart.hoverSeries;if(series){if(!point)point=series.tooltipPoints[inverted?e.pageY-position.y-marginTop:e.pageX-position.x-marginLeft];if(point&&point!=activePoint){if(activePoint)activePoint.firePointEvent('mouseOut');point.firePointEvent('mouseOver');if(tooltip)tooltip.refresh(point);activePoint=point;}}};function createImageMap(){var id='highchartsMap'+canvasCounter++;chart.imagemap=imagemap=createElement('map',{name:id,id:id,className:'highcharts-image-map'},null,container);trackerImage=createElement('img',{useMap:'#'+id},{width:plotWidth+PX,height:plotHeight+PX,left:marginLeft+PX,top:marginTop+PX,opacity:0,border:'none',position:ABSOLUTE,clip:'rect(1px,'+plotWidth+'px,'+plotHeight+'px,1px)',zIndex:9},imagemap);if(!isIE)trackerImage.src='data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';};function resetTracker(){if(tooltip)tooltip.hide();if(chart.hoverSeries){chart.hoverSeries.setState();chart.hoverSeries=null;activePoint=null;}}
function insertAtFront(area){var before=0,i,childNodes=imagemap.childNodes;for(i=0;i<childNodes.length;i++){if(childNodes[i].isLegendArea){before=i+1;break;}}
imagemap.insertBefore(area,childNodes[before]);}
var activePoint,mouseDownX,mouseDownY,hasDragged,selectionMarker,zoomType=optionsChart.zoomType,zoomX=/x/.test(zoomType),zoomY=/y/.test(zoomType),zoomHor=zoomX&&!inverted||zoomY&&inverted,zoomVert=zoomY&&!inverted||zoomX&&inverted;createImageMap();if(options.enabled)chart.tooltip=tooltip=Tooltip(options);setDOMEvents();setInterval(function(){if(tooltipTick)tooltipTick();},32);extend(this,{insertAtFront:insertAtFront,zoomX:zoomX,zoomY:zoomY,resetTracker:resetTracker});};var Legend=function(chart){var options=chart.options.legend;if(!options.enabled)return;var li,layout=options.layout,symbolWidth=options.symbolWidth,dom,topRule='#'+container.id+' .highcharts-legend li',allItems=[],legendLayer=new Layer('legend',container,null,{zIndex:7}),legendArea,series=chart.series,reversedLegend=options.reversed;this.dom=dom=createElement(DIV,{className:'highcharts-legend highcharts-legend-'+layout,innerHTML:'<ul style="margin:0;padding:0"></ul>'},extend({position:ABSOLUTE,zIndex:7},options.style),container);addCSSRule(topRule,extend(options.itemStyle,{paddingLeft:(symbolWidth+options.symbolPadding)+PX,'float':layout=='horizontal'?'left':'none'}));addCSSRule(topRule+':hover',options.itemHoverStyle);addCSSRule(topRule+'.'+HIGHCHARTS_HIDDEN,options.itemHiddenStyle);addCSSRule('.highcharts-legend-horizontal li',{'float':'left'});renderHTML();drawGraphics();function renderHTML(clear){if(clear){each(allItems,function(item){discardElement(item.legendItem);});allItems=[];}
if(reversedLegend){series.reverse();}
each(series,function(serie){if(!serie.options.showInLegend)return;var items=(serie.options.legendType=='point')?serie.data:[serie];each(items,function(item){item.simpleSymbol=/(bar|pie|area|column)/.test(serie.type);item.legendItem=li=createElement('li',{innerHTML:options.labelFormatter.call(item),className:item.visible?'':HIGHCHARTS_HIDDEN},null,dom.firstChild);if(item.options&&item.options.showCheckbox){item.checkbox=createElement('input',{type:'checkbox',checked:item.selected,defaultChecked:item.selected},options.itemCheckboxStyle,li);}
addEvent(li,'mouseover',function(){item.setState('hover');});addEvent(li,'mouseout',function(){item.setState();});addEvent(li,'click',function(event){var target=event.target,strLegendItemClick='legendItemClick',fnLegendItemClick=function(){item.setVisible();};if(target.tagName=='INPUT'){fireEvent(item,'checkboxClick',{checked:target.checked},function(){item.select();});}else if(item.firePointEvent){item.firePointEvent(strLegendItemClick,null,fnLegendItemClick);}else{fireEvent(item,strLegendItemClick,null,fnLegendItemClick);}});allItems.push(item);});});if(reversedLegend){series.reverse();}}
function drawGraphics(clear){if(clear){legendLayer.clear();discardElement(legendArea);legendArea=null;}
if(series.length){if(options.borderWidth||options.backgroundColor)
legendLayer.drawRect(dom.offsetLeft,dom.offsetTop,dom.offsetWidth,dom.offsetHeight,options.borderColor,options.borderWidth,options.borderRadius,options.backgroundColor,options.shadow);each(allItems,function(item){if(!item.legendItem)return;var li=item.legendItem,symbolX=dom.offsetLeft+li.offsetLeft,symbolY=dom.offsetTop+li.offsetTop+li.offsetHeight/2,markerOptions,isHidden=item.legendItem.className==HIGHCHARTS_HIDDEN,color=isHidden?options.itemHiddenStyle.color:item.color;if(!item.simpleSymbol&&item.options&&item.options.lineWidth)
legendLayer.drawLine(symbolX,symbolY,symbolX+symbolWidth,symbolY,color,item.options.lineWidth);if(item.simpleSymbol)
legendLayer.drawRect(symbolX,symbolY-6,16,12,null,0,2,color);else if(item.options&&item.options.marker&&item.options.marker.enabled)
item.drawMarker(legendLayer,symbolX+symbolWidth/2,symbolY,merge(item.options.marker,isHidden?{fillColor:color,lineColor:color}:null));});if(imagemap){legendArea=createElement('area',{shape:'rect',isLegendArea:true,coords:[dom.offsetLeft-marginLeft,dom.offsetTop-marginTop,dom.offsetLeft+dom.offsetWidth-marginLeft,dom.offsetTop+dom.offsetHeight-marginTop].join(',')});tracker.insertAtFront(legendArea);legendArea.onmouseover=function(e){e=e||win.event;var relatedTarget=e.relatedTarget||e.fromElement;if(relatedTarget!=dom&&!mouseIsDown){if(tooltip)tooltip.hide();setStyles(dom,{zIndex:10});}}
dom.onmouseout=legendArea.onmouseout=function(e){e=e||win.event;var relatedTarget=e.relatedTarget||e.toElement;if(relatedTarget&&(relatedTarget==trackerImage||(relatedTarget.tagName=='AREA'&&relatedTarget!=legendArea)))
setStyles(dom,{zIndex:7});}}}}
return{renderHTML:renderHTML,drawGraphics:drawGraphics};};function Tooltip(options){var currentSeries,innerDiv,borderWidth=options.borderWidth,boxLayer;tooltipDiv=createElement(DIV,null,{position:ABSOLUTE,visibility:HIDDEN,overflow:HIDDEN,padding:'0 50px 5px 0',zIndex:8},container);boxLayer=new Layer('tooltip-box',tooltipDiv,null,{width:chartWidth+PX,height:chartHeight+PX});innerDiv=createElement(DIV,{className:"highcharts-tooltip"},extend(options.style,{maxWidth:(chartWidth-40)+PX,textOverflow:'ellipsis',position:RELATIVE,zIndex:2}),tooltipDiv);function refresh(point,series){var tooltipPos=point.tooltipPos,series=point.series,borderColor=options.borderColor||point.color||series.color||'#606060',inverted=chart.inverted,x,y,boxX,boxY,boxWidth,boxHeight,oldInnerDivHeight=innerDiv.offsetHeight,show,text=point.tooltipText;currentSeries=series;x=tooltipPos?tooltipPos[0]:(inverted?plotWidth-point.plotY:point.plotX);y=tooltipPos?tooltipPos[1]:(inverted?plotHeight-point.plotX:point.plotY);if(x>=0&&x<=plotWidth&&y>=0&&y<=plotHeight){show=true;}
if(text===false||!show){hide();}else{innerDiv.innerHTML=text;setStyles(innerDiv,{overflow:VISIBLE});boxWidth=innerDiv.offsetWidth-borderWidth;boxHeight=innerDiv.offsetHeight-borderWidth;setStyles(innerDiv,{overflow:HIDDEN});if(boxWidth>(boxLayer.w||0)+20||boxWidth<(boxLayer.w||0)-20||boxHeight>boxLayer.h||boxLayer.c!=borderColor||oldInnerDivHeight!=innerDiv.offsetHeight){boxLayer.clear();boxLayer.drawRect(borderWidth/2,borderWidth/2,boxWidth+20,boxHeight,borderColor,borderWidth,options.borderRadius,options.backgroundColor,options.shadow);extend(boxLayer,{w:boxWidth,h:boxHeight,c:borderColor});}
boxX=x-boxLayer.w+marginLeft-35;boxY=y-boxLayer.h+10+marginTop;if(boxX<5){boxX=5;boxY-=20;}
if(boxY<5)boxY=5;else if(boxY+boxLayer.h>chartHeight)
boxY=chartHeight-boxLayer.h-5;move(mathRound(boxX),mathRound(boxY));series.drawPointState(point,'hover');tooltipDiv.style.visibility=VISIBLE;}};function move(finalX,finalY){var hidden=(tooltipDiv.style.visibility==HIDDEN),x=hidden?finalX:(tooltipDiv.offsetLeft+finalX)/2,y=hidden?finalY:(tooltipDiv.offsetTop+finalY)/2;setStyles(tooltipDiv,{left:x+PX,top:y+PX});if(mathAbs(finalX-x)>1||mathAbs(finalY-y)>1){tooltipTick=function(){move(finalX,finalY);};}else{tooltipTick=null;}};function hide(){if(tooltipDiv)tooltipDiv.style.visibility=HIDDEN;if(currentSeries)currentSeries.drawPointState();};return{refresh:refresh,hide:hide}};if(win.G_vmlCanvasManager){win.G_vmlCanvasManager.init_(document);}
defaultXAxisOptions=merge(defaultXAxisOptions,defaultOptions.xAxis);defaultYAxisOptions=merge(defaultYAxisOptions,defaultOptions.yAxis);defaultOptions.xAxis=defaultOptions.yAxis=null;options=merge(defaultOptions,options);var optionsChart=options.chart;var optionsMargin=optionsChart.margin,margin=typeof optionsMargin=='number'?[optionsMargin,optionsMargin,optionsMargin,optionsMargin]:optionsMargin,marginTop=margin[0],marginRight=margin[1],marginBottom=margin[2],marginLeft=margin[3],renderTo,renderToClone,container,containerId,chartWidth,chartHeight;getContainer();var chart=this,chartEvents=optionsChart.events,eventType,imagemap,tooltip,mouseIsDown,backgroundLayer=new Layer('chart-background',container),loadingLayer,plotLayer,plotHeight,plotWidth,tracker,trackerImage,legend,position=getPosition(container),hasCartesianSeries=optionsChart.showAxes,axes=[],maxTicks,series=[],resourcesLoaded,plotBackground,inverted,tooltipTick,tooltipDiv;colorCounter=0;symbolCounter=0;addEvent(win,'resize',updatePosition);addEvent(win,'unload',destroy);if(chartEvents)for(eventType in chartEvents){addEvent(chart,eventType,chartEvents[eventType]);}
chart.addLoading=function(loadingId){chart.resources[loadingId]=false;}
chart.clearLoading=function(loadingId){chart.resources[loadingId]=true;checkResources();}
chart.options=options;chart.series=series;chart.container=container;chart.resources={};chart.inverted=inverted=options.chart.inverted
chart.chartWidth=chartWidth;chart.chartHeight=chartHeight;chart.plotWidth=plotWidth=chartWidth-marginLeft-marginRight;chart.plotHeight=plotHeight=chartHeight-marginTop-marginBottom;chart.plotLeft=marginLeft;chart.plotTop=marginTop;chart.redraw=redraw;chart.addSeries=addSeries;chart.getSelectedPoints=getSelectedPoints;chart.getSelectedSeries=getSelectedSeries;chart.showLoading=showLoading;chart.hideLoading=hideLoading;chart.get=get;chart.destroy=destroy;chart.updatePosition=updatePosition;chart.plotLayer=plotLayer=new Layer('plot',container,null,{position:ABSOLUTE,width:plotWidth+PX,height:plotHeight+PX,left:marginLeft+PX,top:marginTop+PX,overflow:HIDDEN,zIndex:3});if(optionsChart.plotBackgroundImage){chart.addLoading('plotBack');plotBackground=createElement('img');plotBackground.onload=function(){chart.clearLoading('plotBack');}
plotBackground.src=optionsChart.plotBackgroundImage;}
each(options.series||[],function(serieOptions){initSeries(serieOptions);});chart.tracker=tracker=new MouseTracker(chart,options.tooltip);checkResources();};var Point=function(){};Point.prototype={init:function(series,options){var point=this;point.series=series;point.applyOptions(options);return point;},applyOptions:function(options){var point=this,series=point.series,n;if(typeof options=='number'||options===null){point.y=options;}
else if(typeof options=='object'&&typeof options.length!='number'){extend(point,options);point.options=options;}
else if(typeof options[0]=='string'){point.name=options[0];point.y=options[1];}
else if(typeof options[0]=='number'){point.x=options[0];point.y=options[1];}
if(point.x===undefined)point.x=series.autoIncrement();},destroy:function(){var point=this;if(point.stateLayer)point.stateLayer.destroy();for(prop in point)point[prop]=null;},select:function(selected,accumulate){var point=this,series=point.series,chart=series.chart,stateLayers,state,singlePointLayer=pick(point.stateLayer,series.singlePointLayer,chart.singlePointLayer);point.selected=selected=pick(selected,!point.selected);series.isDirty=true;point.firePointEvent(selected?'select':'unselect');if(singlePointLayer)singlePointLayer.clear();each(chart.series,function(series){stateLayers=series.stateLayers;if(!accumulate)each(series.data,function(loopPoint){if(loopPoint.selected&&loopPoint!=point){loopPoint.selected=false;fireEvent(loopPoint,'unselect');series.isDirty=true;}});if(series.isDirty){for(state in stateLayers){stateLayers[state].clear();}
series.render();}})},update:function(options,redraw){var point=this,series=point.series;redraw=pick(redraw,true);point.firePointEvent('update',{options:options},function(){point.applyOptions(options);series.isDirty=true;if(redraw)series.chart.redraw();});},remove:function(redraw){var point=this,series=point.series,chart=series.chart,data=series.data;redraw=pick(redraw,true);point.firePointEvent('remove',null,function(){each(data,function(existingPoint,i){if(existingPoint==point){data.splice(i,1);}})
if(point.layer)point.layer=point.layer.destroy();if(point.legendItem){discardElement(point.legendItem);point.legendItem=null;chart.isDirty=true;}
series.isDirty=true;if(redraw)chart.redraw();})},firePointEvent:function(eventType,eventArgs,defaultFunction){var point=this,series=this.series,seriesOptions=series.options;if(seriesOptions.point.events[eventType]||(point.options&&point.options.events&&point.options.events[eventType]))
this.importEvents();if(eventType=='click'&&seriesOptions.allowPointSelect)
defaultFunction=function(event){point.select(null,event.ctrlKey||event.metaKey||event.shiftKey);}
fireEvent(this,eventType,eventArgs,defaultFunction);},importEvents:function(){if(!this.hasImportedEvents){var point=this,options=merge(point.series.options.point,point.options),events=options.events,eventType;point.events=events;for(eventType in events){addEvent(point,eventType,events[eventType]);}
this.hasImportedEvents=true;}},setTooltipText:function(){var point=this;point.tooltipText=point.series.chart.options.tooltip.formatter.call({series:point.series,point:point,x:point.category,y:point.y,percentage:point.percentage,total:point.stackTotal});}};var Series=function(){this.isCartesian=true;this.type='line';this.pointClass=Point;};Series.prototype={init:function(chart,options){var series=this,eventType,events,pointEvent,index=chart.series.length;series.chart=chart;options=series.setOptions(options);extend(series,{index:index,options:options,name:options.name||'Series '+(index+1),state:'',visible:options.visible!==false,selected:options.selected==true});events=options.events;for(eventType in events){addEvent(series,eventType,events[eventType]);}
series.getColor();series.getSymbol();series.getData(options);},getData:function(options){var series=this,chart=series.chart,loadingId='series'+idCounter++;if(!options.data&&options.dataURL){chart.addLoading(loadingId);getAjax(options.dataURL,function(data){series.dataLoaded(data);chart.clearLoading(loadingId);});}else{series.dataLoaded(options.data);}},dataLoaded:function(data){var series=this,chart=series.chart,options=series.options,enabledStates=[''],dataParser=options.dataParser,stateLayers={},layerGroup,point,x;if(options.dataURL&&!dataParser)
dataParser=function(data){return eval(data);}
if(dataParser)data=dataParser.call(series,data);series.layerGroup=layerGroup=new Layer('series-group',chart.plotLayer.div,null,{zIndex:2});if(options.states.hover.enabled)enabledStates.push('hover');each(enabledStates,function(state){stateLayers[state]=new Layer('state-'+state,layerGroup.div);});series.stateLayers=stateLayers;series.setData(data,false);},autoIncrement:function(){var series=this,options=series.options,xIncrement=series.xIncrement;xIncrement=pick(xIncrement,options.pointStart,0);series.pointInterval=pick(series.pointInterval,options.pointInterval,1);series.xIncrement=xIncrement+series.pointInterval;return xIncrement;},cleanData:function(){var series=this,data=series.data,i;data.sort(function(a,b){return(a.x-b.x);});for(i=data.length-1;i>=0;i--){if(data[i-1]){if(data[i-1].x==data[i].x)data.splice(i-1,1);}}},getSegments:function(){var lastNull=-1,segments=[],data=this.data;each(data,function(point,i){if(point.y===null){if(i>lastNull+1)
segments.push(data.slice(lastNull+1,i));lastNull=i;}else if(i==data.length-1){segments.push(data.slice(lastNull+1,i+1));}});this.segments=segments;},setOptions:function(options){var plotOptions=this.chart.options.plotOptions,options=merge(plotOptions[this.type],plotOptions.series,options),normalSeriesMarkerOptions=options.marker,hoverSeriesMarkerOptions=options.states.hover.marker;if(hoverSeriesMarkerOptions.lineWidth===undefined)
hoverSeriesMarkerOptions.lineWidth=normalSeriesMarkerOptions.lineWidth+1;if(hoverSeriesMarkerOptions.radius===undefined)
hoverSeriesMarkerOptions.radius=normalSeriesMarkerOptions.radius+1;return options;},getColor:function(){var defaultColors=this.chart.options.colors;this.color=this.options.color||defaultColors[colorCounter++]||'#0000ff';if(colorCounter>=defaultColors.length)
colorCounter=0;},getSymbol:function(){var defaultSymbols=this.chart.options.symbols,symbol=this.options.marker.symbol||'auto';if(symbol=='auto')symbol=defaultSymbols[symbolCounter++];this.symbol=symbol;if(symbolCounter>=defaultSymbols.length)
symbolCounter=0;},addPoint:function(options,redraw,shift){var series=this,data=series.data,point=(new series.pointClass).init(series,options);redraw=pick(redraw,true);data.push(point);if(shift)data.shift();series.isDirty=true;if(redraw)series.chart.redraw();},setData:function(data,redraw){var series=this;series.xIncrement=null;data=map(splat(data),function(pointOptions){return(new series.pointClass).init(series,pointOptions);});series.data=data;series.cleanData();series.getSegments();series.isDirty=true;if(pick(redraw,true))series.chart.redraw();},remove:function(redraw){var series=this,chart=series.chart;redraw=pick(redraw,true);if(!series.isRemoving){series.isRemoving=true;fireEvent(series,'remove',null,function(){discardElement(series.layerGroup.div);each(series.areas,function(area){discardElement(area);});discardElement(series.legendItem);series.legendItem=null;each(chart.series,function(existingSeries,i){if(existingSeries==series){chart.series.splice(i,1);}})
chart.isDirty=true;if(redraw)chart.redraw();})}
series.isRemoving=false},translate:function(){var chart=this.chart,series=this,stacking=series.options.stacking,categories=series.xAxis.categories,yAxis=series.yAxis,stack=yAxis.stacks[series.type];each(this.data,function(point){var xValue=point.x,yValue=point.y,yBottom,pointStack,pointStackTotal;point.plotX=series.xAxis.translate(point.x);if(stacking&&series.visible&&stack[xValue]){pointStack=stack[xValue];pointStackTotal=pointStack.total;pointStack.cum=yBottom=pointStack.cum-yValue;yValue=yBottom+yValue;if(stacking=='percent'){yBottom=pointStackTotal?yBottom*100/pointStackTotal:0;yValue=pointStackTotal?yValue*100/pointStackTotal:0;}
point.percentage=pointStackTotal?point.y*100/pointStackTotal:0;point.stackTotal=pointStackTotal;point.yBottom=yAxis.translate(yBottom,0,1);}
if(yValue!==null)
point.plotY=yAxis.translate(yValue,0,1);point.clientX=chart.inverted?chart.plotHeight-point.plotX+chart.plotTop:point.plotX+chart.plotLeft;point.category=categories&&categories[point.x]!==undefined?categories[point.x]:point.x;});},setTooltipPoints:function(renew){var series=this,chart=series.chart,inverted=chart.inverted,data=[],plotSize=inverted?chart.plotHeight:chart.plotWidth,low,high,tooltipPoints=[];if(renew)series.tooltipPoints=null;each(series.segments,function(segment){data=data.concat(segment);});if(series.xAxis.reversed)data=data.reverse();each(data,function(point,i){if(!series.tooltipPoints)
point.setTooltipText();low=data[i-1]?data[i-1].high+1:0;high=point.high=data[i+1]?(mathFloor((point.plotX+(data[i+1]?data[i+1].plotX:plotSize))/2)):plotSize;while(low<=high){tooltipPoints[inverted?plotSize-low++:low++]=point;}});series.tooltipPoints=tooltipPoints;},drawLine:function(state){var i,j,series=this,options=series.options,chart=series.chart,doAnimation=options.animation&&series.animate,layer=series.stateLayers[state],data=series.data,color=options.lineColor||series.color,fillColor=options.fillColor=='auto'?Color(series.color).setOpacity(options.fillOpacity||0.75).get():options.fillColor,inverted=chart.inverted,y0=(inverted?0:chart.plotHeight)-series.yAxis.translate(0);if(state)
options=merge(options,options.states[state]);if(doAnimation)series.animate(true);each(series.segments,function(segment){var line=[],area=[];each(segment,function(point,i){if(i&&options.step){var lastPoint=segment[i-1];line.push(inverted?chart.plotWidth-lastPoint.plotY:point.plotX,inverted?chart.plotHeight-point.plotX:lastPoint.plotY);}
line.push(inverted?chart.plotWidth-point.plotY:point.plotX,inverted?chart.plotHeight-point.plotX:point.plotY);});if(/area/.test(series.type)){for(i=0;i<line.length;i++)
area.push(line[i]);if(options.stacking&&series.type!='areaspline'){for(i=segment.length-1;i>=0;i--)
area.push(segment[i].plotX,segment[i].yBottom);}else{area.push(inverted?y0:segment[segment.length-1].plotX,inverted?chart.plotHeight-segment[segment.length-1].plotX:y0,inverted?y0:segment[0].plotX,inverted?chart.plotHeight-segment[0].plotX:y0);}
layer.drawPolyLine(area,null,null,options.shadow,fillColor);}
if(options.lineWidth)layer.drawPolyLine(line,color,options.lineWidth,options.shadow);});if(doAnimation)series.animate();},animate:function(init){var series=this,chart=series.chart,inverted=chart.inverted,div=series.layerGroup.div;if(series.visible){if(init){setStyles(div,extend({overflow:HIDDEN},inverted?{height:0}:{width:0}));}else{animate(div,inverted?{height:chart.plotHeight+PX}:{width:chart.plotWidth+PX},{duration:1000});this.animate=null;}}},drawPoints:function(state){var series=this,i,layer=series.stateLayers[state],seriesOptions=series.options,markerOptions=seriesOptions.marker,data=series.data,chart=series.chart,inverted=chart.inverted;if(markerOptions.enabled){each(data,function(point){if(point.plotY!==undefined)
series.drawMarker(layer,inverted?chart.plotWidth-point.plotY:point.plotX,inverted?chart.plotHeight-point.plotX:point.plotY,merge(markerOptions,point.marker));if(point.selected)series.drawPointState(point,'select',layer);});}},drawMarker:function(layer,x,y,options){if(options.lineColor=='auto')
options.lineColor=this.color;if(options.fillColor=='auto')
options.fillColor=this.color;if(options.symbol=='auto')
options.symbol=this.symbol;layer.drawSymbol(options.symbol,x,y,options.radius,options.lineWidth,options.lineColor,options.fillColor);},drawDataLabels:function(){if(this.options.dataLabels.enabled){var series=this,i,x,y,data=series.data,options=series.options.dataLabels,color,str,dataLabelsLayer=series.dataLabelsLayer,chart=series.chart,inverted=chart.inverted,seriesType=series.type,isPie=(seriesType=='pie'),align;if(dataLabelsLayer){dataLabelsLayer.clear();}else{series.dataLabelsLayer=dataLabelsLayer=new Layer('data-labels',series.layerGroup.div,null,{zIndex:1});}
options.style.color=options.color=='auto'?series.color:options.color;each(data,function(point){var plotX=point.plotX,plotY=point.plotY,tooltipPos=point.tooltipPos;str=options.formatter.call({x:point.x,y:point.y,series:series,point:point});x=(inverted?chart.plotWidth-plotY:plotX)+options.x;y=(inverted?chart.plotHeight-plotX:plotY)+options.y;if(tooltipPos){x=tooltipPos[0]+options.x;y=tooltipPos[1]+options.y;}
if(isPie){if(!point.dataLabelsLayer)point.dataLabelsLayer=new Layer('data-labels',point.layer.div,null,{zIndex:3});dataLabelsLayer=point.dataLabelsLayer;}
align=options.align;if(seriesType=='column')
x+={center:point.w/2,right:point.w}[align]||0;if(str)dataLabelsLayer[isPie?'drawText':'addText'](str,x,y,options.style,options.rotation,align);});if(!isPie)dataLabelsLayer.strokeText();}},drawPointState:function(point,state,layer){var chart=this.chart,inverted=chart.inverted,isHoverState=state=='hover',layer=layer||chart.singlePointLayer,options=this.options,stateOptions;if(isHoverState){if(!layer)layer=chart.singlePointLayer=new Layer('single-point',chart.plotLayer.div,null,{zIndex:3});layer.clear();}
if(state){var seriesStateOptions=options.states[state].marker,pointStateOptions=options.marker.states[state];if(isHoverState&&pointStateOptions.radius===undefined)
pointStateOptions.radius=seriesStateOptions.radius+2;stateOptions=merge(options.marker,point.marker,seriesStateOptions,pointStateOptions);if(stateOptions&&stateOptions.enabled)
this.drawMarker(layer,inverted?chart.plotWidth-point.plotY:point.plotX,inverted?chart.plotHeight-point.plotX:point.plotY,stateOptions);}},destroy:function(){var series=this,prop;each(series.data,function(point){point.destroy();});for(prop in series)series[prop]=null;},render:function(){var series=this,state,stateLayers=series.stateLayers;series.drawDataLabels();if(series.visible)for(state in stateLayers){series.drawLine(state);series.drawPoints(state);}
else series.setVisible(false,false);if(!series.hasRendered&&stateLayers.hover){stateLayers.hover.hide();hasRendered=true;}
series.isDirty=false;},redraw:function(){var series=this;series.translate();series.setTooltipPoints(true);series.createArea();series.clear();series.render();},clear:function(){var stateLayers=this.stateLayers;for(var state in stateLayers){stateLayers[state].clear();stateLayers[state].cleared=true;}
if(this.dataLabelsLayer){this.dataLabelsLayer.clear();this.hasDrawnDataLabels=false;}},setState:function(state){state=state||'';if(this.state!=state){var series=this,stateLayers=series.stateLayers,newStateLayer=stateLayers[state],oldStateLayer=stateLayers[series.state],singlePointLayer=series.singlePointLayer||series.chart.singlePointLayer;series.state=state;if(newStateLayer){if(state)
newStateLayer.show();else{if(oldStateLayer)oldStateLayer.hide();if(singlePointLayer)singlePointLayer.clear();}}}},setVisible:function(vis,redraw){var series=this,chart=series.chart,layerGroup=series.layerGroup,legendItem=series.legendItem,areas=series.areas,oldVisibility=series.visible;series.visible=vis=vis===undefined?!oldVisibility:vis;if(vis){series.isDirty=true;layerGroup.show();}else{layerGroup.hide();}
if(legendItem){legendItem.className=vis?'':HIGHCHARTS_HIDDEN;chart.legend.drawGraphics(true);}
if(areas)each(areas,function(area){if(vis)
chart.tracker.insertAtFront(area);else
discardElement(area);});if(chart.options.chart.ignoreHiddenSeries){if(series.options.stacking)each(chart.series,function(otherSeries){if(otherSeries.options.stacking&&otherSeries.visible)
otherSeries.isDirty=true;});}
if(redraw!==false)chart.redraw();fireEvent(series,vis?'show':'hide');},show:function(){this.setVisible(true);},hide:function(){this.setVisible(false);},select:function(selected){var series=this;series.selected=selected=(selected===undefined)?!series.selected:selected;if(series.checkbox)series.checkbox.checked=selected;fireEvent(series,selected?'select':'unselect');},getAreaCoords:function(){var data=this.data,series=this,datas=[],chart=this.chart,inverted=chart.inverted,plotWidth=chart.plotWidth,plotHeight=chart.plotHeight,reversedXAxis=series.xAxis.reversed,reversedData,snap=chart.options.tooltip.snap,dataIsReverse,i=0,ret=[];each(series.splinedata||series.segments,function(data,i){reversedData=data.length>1&&data[0].x>data[1].x;if(reversedData&&!reversedXAxis||reversedXAxis&&!reversedData){data=data.reverse();}
var coords=[],outlineTop=[],outlineBottom=[];each([outlineTop,outlineBottom],function(outline){var last=0,i=0,extreme,slice,peaks=[data[0]],sign=outline==outlineTop?1:-1,intersects,num,x,y,lastX,lastY,x1,y1,x2,y2,dX,dY,pX,pY,l,factor,p1,p2,mA,mB,iX,iY,area;while(data[i]){if(data[i].plotX>data[last].plotX+snap||i==data.length-1){extreme=data[i];slice=data.slice(last,i-1);each(slice,function(point){if(sign*point.plotY<sign*extreme.plotY){extreme=point;}});if(mathRound(data[last].plotX)<mathRound(extreme.plotX)||data[i].plotX>data[last].plotX+snap){peaks.push(extreme);}
last=i;}
i++;}
if(peaks[peaks.length-1]!=data[data.length-1])
peaks.push(data[data.length-1]);for(i=0;i<peaks.length;i++){if(i>0){x=peaks[i].plotX;y=peaks[i].plotY;lastX=peaks[i-1].plotX;lastY=peaks[i-1].plotY;dX=x-peaks[i-1].plotX;dY=y-peaks[i-1].plotY;pX=dY;pY=-dX;l=math.sqrt(math.pow(pX,2)+math.pow(pY,2));if(i==1){lastX-=(snap/l)*dX;lastY-=(snap/l)*dY;}else if(i==peaks.length-1){x+=(snap/l)*dX;y+=(snap/l)*dY;}
factor=sign*snap/l;x1=mathRound(lastX+factor*pX);y1=mathRound(lastY+factor*pY);x2=mathRound(x+factor*pX);y2=mathRound(y+factor*pY);if(outline[outline.length-1]&&outline[outline.length-1][0]>x1){intersects=false;while(!intersects){p2=outline.pop();p1=outline[outline.length-1];if(!p1)
break;mA=(y1-y2)/(x1-x2);mB=(p1[1]-p2[1])/(p1[0]-p2[0]);iX=((-mB*p1[0])+p1[1]+(mA*x1)-y1)/(mA-mB);iY=(mA*(iX-x1))+y1;if(iX>p1[0]){outline.push([mathRound(iX),mathRound(iY),1]);intersects=true;}}}
else{if(!isNaN(x1))
outline.push([x1,y1]);}
if(outline[outline.length-1]&&outline[outline.length-1][0]<x2)
outline.push([x2,y2]);}}});for(i=0;i<outlineTop.length;i++){coords.push(inverted?plotWidth-outlineTop[i][1]:outlineTop[i][0],inverted?plotHeight-outlineTop[i][0]:outlineTop[i][1]);}
for(i=outlineBottom.length-1;i>=0;i--){coords.push(inverted?plotWidth-outlineBottom[i][1]:outlineBottom[i][0],inverted?plotHeight-outlineBottom[i][0]:outlineBottom[i][1]);}
if(!coords.length){coords.push(mathRound(data[0].plotX),mathRound(data[0].plotY));}
if(coords.length)ret.push([coords.join(',')]);});return ret;},createArea:function(){if(this.options.enableMouseTracking===false)return;var area,series=this,options=series.options,chart=series.chart,inverted=chart.inverted,tracker=chart.tracker,coordsArray=series.getAreaCoords(),firstArea,seriesAreas=[],existingAreas=series.areas,isCircle;if(existingAreas)each(existingAreas,function(area){discardElement(area);})
each(coordsArray,function(coords){isCircle=/^[0-9]+,[0-9]+$/.test(coords[0]);area=createElement('area',{shape:isCircle?'circle':'poly',chart:chart,coords:coords[0]+(isCircle?','+chart.options.tooltip.snap:''),onmouseover:function(e){if(!series.visible||chart.mouseIsDown)return;var hoverSeries=chart.hoverSeries;chart.hoverPoint=coords[1];if(options.events.mouseOver){fireEvent(series,'mouseOver',{point:chart.hoverPoint});}
if(hoverSeries&&hoverSeries!=series)
hoverSeries.setState();if(!/(column|bar|pie)/.test(series.type)){tracker.insertAtFront(area);}
series.setState('hover');chart.hoverSeries=series;},onmouseout:function(){var hoverSeries=chart.hoverSeries;if(hoverSeries&&options.events.mouseOut){fireEvent(hoverSeries,'mouseOut');}}});if(options.cursor=='pointer'){area.href='javascript:;';}
tracker.insertAtFront(area);seriesAreas.push(area);});series.areas=seriesAreas;}};var LineSeries=extendClass(Series);seriesTypes.line=LineSeries;var AreaSeries=extendClass(Series,{type:'area'});seriesTypes.area=AreaSeries;var SplineSeries=extendClass(Series,{type:'spline',translate:function(){var series=this;Series.prototype.translate.apply(series,arguments);series.splinedata=series.getSplineData();},drawLine:function(state){var series=this,realSegments=series.segments;series.segments=series.splinedata;Series.prototype.drawLine.apply(series,arguments);series.segments=realSegments;},getSplineData:function(){var series=this,chart=series.chart,splinedata=[],num;each(series.segments,function(data){if(series.xAxis.reversed)data=data.reverse();var croppedData=[],nextUp,nextDown;each(data,function(point,i){nextUp=data[i+2]||data[i+1]||point;nextDown=data[i-2]||data[i-1]||point;if(nextUp.plotX>0&&nextDown.plotY<chart.plotWidth){croppedData.push(point);}});if(croppedData.length>1){num=mathRound(mathMax(chart.plotWidth,croppedData[croppedData.length-1].clientX-croppedData[0].clientX)/3);}
splinedata.push(data.length>1?num?(new SplineHelper(croppedData)).get(num):[]:data);});series.splinedata=splinedata;return splinedata;}});seriesTypes.spline=SplineSeries;function SplineHelper(data){var xdata=[];var ydata=[];for(var i=0;i<data.length;i++){xdata[i]=data[i].plotX;ydata[i]=data[i].plotY;}
this.xdata=xdata;this.ydata=ydata;var delta=[];this.y2=[];var n=ydata.length;this.n=n;this.y2[0]=0.0;this.y2[n-1]=0.0;delta[0]=0.0;for(var i=1;i<n-1;i++){var d=(xdata[i+1]-xdata[i-1]);var s=(xdata[i]-xdata[i-1])/d;var p=s*this.y2[i-1]+2.0;this.y2[i]=(s-1.0)/p;delta[i]=(ydata[i+1]-ydata[i])/(xdata[i+1]-xdata[i])-
(ydata[i]-ydata[i-1])/(xdata[i]-xdata[i-1]);delta[i]=(6.0*delta[i]/(xdata[i+1]-xdata[i-1])-s*delta[i-1])/p;}
for(var j=n-2;j>=0;j--){this.y2[j]=this.y2[j]*this.y2[j+1]+delta[j];}};SplineHelper.prototype={get:function(num){if(!num)num=50;var n=this.n;var step=(this.xdata[n-1]-this.xdata[0])/(num-1);var xnew=[];var ynew=[];xnew[0]=this.xdata[0];ynew[0]=this.ydata[0];var data=[{plotX:xnew[0],plotY:ynew[0]}];for(var j=1;j<num;j++){xnew[j]=xnew[0]+j*step;ynew[j]=this.interpolate(xnew[j]);data[j]={plotX:xnew[j],plotY:ynew[j]};}
return data;},interpolate:function(xpoint){var max=this.n-1;var min=0;while(max-min>1){var k=(max+min)/2;if(this.xdata[mathFloor(k)]>xpoint)
max=k;else
min=k;}
var intMax=mathFloor(max),intMin=mathFloor(min);var h=this.xdata[intMax]-this.xdata[intMin];var a=(this.xdata[intMax]-xpoint)/h;var b=(xpoint-this.xdata[intMin])/h;return a*this.ydata[intMin]+b*this.ydata[intMax]+
((a*a*a-a)*this.y2[intMin]+(b*b*b-b)*this.y2[intMax])*(h*h)/6.0;}};var AreaSplineSeries=extendClass(SplineSeries,{type:'areaspline'});seriesTypes.areaspline=AreaSplineSeries
var ColumnSeries=extendClass(Series,{type:'column',init:function(){Series.prototype.init.apply(this,arguments);var series=this,chart=series.chart;if(chart.hasRendered)each(chart.series,function(otherSeries){if(otherSeries.type==series.type)otherSeries.isDirty=true;});},translate:function(){var series=this,chart=series.chart,columnCount=0,stackedIndex;Series.prototype.translate.apply(series);each(chart.series,function(otherSeries){if(otherSeries.type==series.type){if(!otherSeries.options.stacking){otherSeries.columnIndex=columnCount++;}else{if(!defined(stackedIndex))stackedIndex=columnCount++;otherSeries.columnIndex=stackedIndex;}}});var options=series.options,data=series.data,inverted=chart.inverted,plotWidth=chart.plotWidth,plotHeight=chart.plotHeight,closestPoints=series.closestPoints,categoryWidth=mathAbs(data[1]?data[closestPoints].plotX-data[closestPoints-1].plotX:(inverted?plotHeight:plotWidth)),groupPadding=categoryWidth*options.groupPadding,groupWidth=categoryWidth-2*groupPadding,pointOffsetWidth=groupWidth/columnCount,optionPointWidth=options.pointWidth,pointPadding=defined(optionPointWidth)?(pointOffsetWidth-optionPointWidth)/2:pointOffsetWidth*options.pointPadding,pointWidth=pick(optionPointWidth,pointOffsetWidth-2*pointPadding),columnIndex=(chart.options.xAxis.reversed?columnCount-
series.columnIndex:series.columnIndex)||0,pointX=-(categoryWidth/2)+groupPadding+columnIndex*pointOffsetWidth+pointPadding,translatedY0=series.yAxis.translate(0);each(data,function(point){point.plotX+=pointX;point.w=pointWidth;point.y0=(inverted?plotWidth:plotHeight)-translatedY0;point.h=(point.yBottom||point.y0)-point.plotY;});},drawLine:function(){},getSymbol:function(){},drawPoints:function(state){var series=this,options=series.options,chart=series.chart,doAnimation=options.animation&&series.animate,plot=chart.plot,inverted=chart.inverted,data=series.data,layer=series.stateLayers[state];if(doAnimation)this.animate(true);each(data,function(point){if(point.plotY!==undefined)layer.drawRect(inverted?(point.h>=0?chart.plotWidth-point.plotY-point.h:chart.plotWidth-point.plotY):point.plotX,inverted?chart.plotHeight-point.plotX-point.w:(point.h>=0?point.plotY:point.plotY+point.h),inverted?mathAbs(point.h):point.w,inverted?point.w:mathAbs(point.h),options.borderColor,options.borderWidth,options.borderRadius,point.color||series.color,options.shadow);if(point.selected)series.drawPointState(point,'select',layer);});if(doAnimation)series.animate();},drawPointState:function(point,state,layer){var series=this,chart=series.chart,seriesOptions=series.options,pointOptions=point?point.options:null,plot=chart.plot,inverted=chart.inverted,layer=layer||series.singlePointLayer;if(state=='hover'){if(!layer)layer=series.singlePointLayer=new Layer('single-point',series.layerGroup.div);layer.clear();}
if(state&&this.options.states[state]){var options=merge(seriesOptions,seriesOptions.states[state],pointOptions);layer.drawRect(inverted?chart.plotWidth-point.plotY-point.h:point.plotX,inverted?chart.plotHeight-point.plotX-point.w:point.plotY,inverted?point.h:point.w,inverted?point.w:point.h,options.borderColor,options.borderWidth,options.borderRadius,Color(options.color||this.color).brighten(options.brightness).get(),options.shadow)}},getAreaCoords:function(){var areas=[],chart=this.chart,inverted=chart.inverted;each(this.data,function(point){var pointH=mathMax(mathAbs(point.h),3)*(point.h<0?-1:1),x1=inverted?chart.plotWidth-point.plotY-pointH:point.plotX,y2=inverted?chart.plotHeight-point.plotX-point.w:point.plotY,y1=y2+(inverted?point.w:pointH),x2=x1+(inverted?pointH:point.w);if(!inverted&&mathAbs(x2-x1)<1)x2=x1+1;else if(inverted&&mathAbs(y2-y1)<1)y2=y1+1;areas.push([map([x1,y1,x1,y2,x2,y2,x2,y1],mathRound).join(','),point]);});return areas;},cleanData:function(){var series=this,data=series.data,interval,smallestInterval,closestPoints,i;Series.prototype.cleanData.apply(series);for(i=data.length-1;i>=0;i--){if(data[i-1]){interval=data[i].x-data[i-1].x;if(smallestInterval===undefined||interval<smallestInterval){smallestInterval=interval;closestPoints=i;}}}
series.closestPoints=closestPoints;},animate:function(init){var series=this,chart=series.chart,inverted=chart.inverted,div=series.layerGroup.div,dataLabelsLayer=series.dataLabelsLayer;if(init){div.style[inverted?'left':'top']=(inverted?-chart.plotWidth:chart.plotHeight)+PX;}else{animate(div,chart.inverted?{left:0}:{top:0});series.animate=null;}},remove:function(){var series=this,chart=series.chart;if(chart.hasRendered)each(chart.series,function(otherSeries){if(otherSeries.type==series.type)otherSeries.isDirty=true;});Series.prototype.remove.apply(series,arguments);}});seriesTypes.column=ColumnSeries;var BarSeries=extendClass(ColumnSeries,{type:'bar',init:function(chart){chart.inverted=this.inverted=true;ColumnSeries.prototype.init.apply(this,arguments);}});seriesTypes.bar=BarSeries;var ScatterSeries=extendClass(Series,{type:'scatter',getAreaCoords:function(){var data=this.data,coords,ret=[];each(data,function(point){ret.push([[mathRound(point.plotX),mathRound(point.plotY)].join(','),point]);});return ret;},cleanData:function(){}});seriesTypes.scatter=ScatterSeries;var PiePoint=extendClass(Point,{setState:function(state){this.series.drawPointState(this,state);},init:function(){Point.prototype.init.apply(this,arguments);var point=this,series=point.series,defaultColors=series.chart.options.colors,toggleSlice;extend(point,{visible:point.visible!==false,name:pick(point.name,'Slice'),color:point.color||defaultColors[colorCounter++]});if(colorCounter>=defaultColors.length)colorCounter=0;if(!point.layer)point.layer=new Layer('pie',series.layerGroup.div);toggleSlice=function(){point.slice();}
addEvent(point,'select',toggleSlice);addEvent(point,'unselect',toggleSlice);return point;},setVisible:function(vis){var point=this,layer=point.layer,legendItem=point.legendItem;point.visible=vis=vis===undefined?!point.visible:vis;if(vis)
layer.show();else
layer.hide();if(legendItem){legendItem.className=vis?'':HIGHCHARTS_HIDDEN;point.series.chart.legend.drawGraphics(true);}},slice:function(sliced,redraw){var point=this,series=point.series;redraw=pick(redraw,true);point.sliced=defined(sliced)?sliced:!point.sliced;series.isDirty=true;if(redraw)series.chart.redraw();}});var PieSeries=extendClass(Series,{type:'pie',isCartesian:false,pointClass:PiePoint,getColor:function(){},translate:function(){var sum=0,series=this,cumulative=-0.25,options=series.options,slicedOffset=options.slicedOffset,positions=options.center,size=options.size,chart=series.chart,data=series.data,circ=2*math.PI,fraction;positions.push(options.size);positions=map(positions,function(length,i){return/%$/.test(length)?chart['plot'+(i?'Height':'Width')]*parseInt(length)/100:length;});each(data,function(point){sum+=point.y;});each(data,function(point){fraction=sum?point.y/sum:0
point.start=cumulative*circ;cumulative+=fraction;point.end=cumulative*circ;point.percentage=fraction*100;point.center=[positions[0],positions[1]];point.size=positions[2];var angle=(point.end+point.start)/2;point.centerSliced=map([mathCos(angle)*slicedOffset+positions[0],mathSin(angle)*slicedOffset+positions[1]],mathRound);});this.setTooltipPoints();},render:function(){this.drawPoints();this.drawDataLabels();},drawPoints:function(state){var series=this;each(this.data,function(point){series.drawPoint(point,point.layer.getCtx(),point.color);if(point.visible===false)point.setVisible(false);if(point.selected)series.drawPointState(point,'select',point.layer);});},getSymbol:function(){},drawPointState:function(point,state,layer){var series=this,seriesOptions=series.options;if(point){layer=layer||point.stateLayer;if(state=='hover'){if(!layer)layer=point.stateLayer=new Layer('single-point',point.layer.div);layer.clear();}
if(state&&series.options.states[state]){var options=merge(seriesOptions,seriesOptions.states[state]);this.drawPoint(point,layer.getCtx(),options.color||point.color,options.brightness);}}
if(series.hoverPoint&&series.hoverPoint.stateLayer)series.hoverPoint.stateLayer.clear();series.hoverPoint=point;},drawPoint:function(point,ctx,color,brightness){var options=this.options,center=point.sliced?point.centerSliced:point.center,centerX=center[0],centerY=center[1],size=point.size,borderWidth=options.borderWidth,end=isIE&&point.percentage==100?point.start:point.end;if(point.y>0){ctx.fillStyle=setColor(Color(color).brighten(brightness).get(ctx),ctx);ctx.strokeStyle=options.borderColor;ctx.lineWidth=borderWidth;ctx.beginPath();ctx.moveTo(centerX,centerY);ctx.arc(centerX,centerY,size/2,point.start,end,false);ctx.lineTo(centerX,centerY);ctx.closePath();ctx.fill();if(borderWidth)ctx.stroke();}},getAreaCoords:function(){var areas=[];var series=this;each(this.data,function(point){var centerX=point.center[0],centerY=point.center[1],radius=point.size/2,start=point.start,end=point.end,coords=[];for(var angle=start;angle;angle+=0.25){if(angle>=end)angle=end;coords=coords.concat([centerX+mathCos(angle)*radius,centerY+mathSin(angle)*radius])
if(angle>=end)break;}
coords=coords.concat([centerX,centerY]);point.tooltipPos=[centerX+2*mathCos((start+end)/2)*radius/3,centerY+2*mathSin((start+end)/2)*radius/3];areas.push([map(coords,mathRound).join(','),point])});return areas;},setData:function(){var series=this,data=series.data,i;if(data){for(i=data.length-1;i>=0;i--){data[i].remove();}}
Series.prototype.setData.apply(series,arguments);},clear:function(){each(this.data,function(point){point.layer.clear();if(point.dataLabelsLayer)point.dataLabelsLayer.clear();if(point.stateLayer)point.stateLayer.clear();});}});seriesTypes.pie=PieSeries;Highcharts={numberFormat:numberFormat,dateFormat:dateFormat,defaultOptions:defaultOptions,setOptions:setOptions,Chart:Chart,extendClass:extendClass,seriesTypes:seriesTypes,Layer:Layer}})();
document.createElement("canvas").getContext||(function(){var s=Math,j=s.round,F=s.sin,G=s.cos,V=s.abs,W=s.sqrt,k=10,v=k/2;function X(){return this.context_||(this.context_=new H(this))}var L=Array.prototype.slice;function Y(b,a){var c=L.call(arguments,2);return function(){return b.apply(a,c.concat(L.call(arguments)))}}var M={init:function(b){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var a=b||document;a.createElement("canvas");a.attachEvent("onreadystatechange",Y(this.init_,this,a))}},init_:function(b){b.namespaces.g_vml_||b.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");b.namespaces.g_o_||b.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!b.styleSheets.ex_canvas_){var a=b.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=b.getElementsByTagName("canvas"),d=0;for(;d<c.length;d++)this.initElement(c[d])},initElement:function(b){if(!b.getContext){b.getContext=X;b.innerHTML="";b.attachEvent("onpropertychange",Z);b.attachEvent("onresize",$);var a=b.attributes;if(a.width&&a.width.specified)b.style.width=a.width.nodeValue+"px";else b.width=b.clientWidth;if(a.height&&a.height.specified)b.style.height=a.height.nodeValue+"px";else b.height=b.clientHeight}return b}};function Z(b){var a=b.srcElement;switch(b.propertyName){case"width":a.style.width=a.attributes.width.nodeValue+"px";a.getContext().clearRect();break;case"height":a.style.height=a.attributes.height.nodeValue+"px";a.getContext().clearRect();break}}function $(b){var a=b.srcElement;if(a.firstChild){a.firstChild.style.width=a.clientWidth+"px";a.firstChild.style.height=a.clientHeight+"px"}}M.init();var N=[],B=0;for(;B<16;B++){var C=0;for(;C<16;C++)N[B*16+C]=B.toString(16)+C.toString(16)}function I(){return[[1,0,0],[0,1,0],[0,0,1]]}function y(b,a){var c=I(),d=0;for(;d<3;d++){var f=0;for(;f<3;f++){var h=0,g=0;for(;g<3;g++)h+=b[d][g]*a[g][f];c[d][f]=h}}return c}function O(b,a){a.fillStyle=b.fillStyle;a.lineCap=b.lineCap;a.lineJoin=b.lineJoin;a.lineWidth=b.lineWidth;a.miterLimit=b.miterLimit;a.shadowBlur=b.shadowBlur;a.shadowColor=b.shadowColor;a.shadowOffsetX=b.shadowOffsetX;a.shadowOffsetY=b.shadowOffsetY;a.strokeStyle=b.strokeStyle;a.globalAlpha=b.globalAlpha;a.arcScaleX_=b.arcScaleX_;a.arcScaleY_=b.arcScaleY_;a.lineScale_=b.lineScale_}function P(b){var a,c=1;b=String(b);if(b.substring(0,3)=="rgb"){var d=b.indexOf("(",3),f=b.indexOf(")",d+
1),h=b.substring(d+1,f).split(",");a="#";var g=0;for(;g<3;g++)a+=N[Number(h[g])];if(h.length==4&&b.substr(3,1)=="a")c=h[3]}else a=b;return{color:a,alpha:c}}function aa(b){switch(b){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function H(b){this.m_=I();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=k*1;this.globalAlpha=1;this.canvas=b;var a=b.ownerDocument.createElement("div");a.style.width=b.clientWidth+"px";a.style.height=b.clientHeight+"px";a.style.overflow="hidden";a.style.position="absolute";b.appendChild(a);this.element_=a;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}var i=H.prototype;i.clearRect=function(){this.element_.innerHTML=""};i.beginPath=function(){this.currentPath_=[]};i.moveTo=function(b,a){var c=this.getCoords_(b,a);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};i.lineTo=function(b,a){var c=this.getCoords_(b,a);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};i.bezierCurveTo=function(b,a,c,d,f,h){var g=this.getCoords_(f,h),l=this.getCoords_(b,a),e=this.getCoords_(c,d);Q(this,l,e,g)};function Q(b,a,c,d){b.currentPath_.push({type:"bezierCurveTo",cp1x:a.x,cp1y:a.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y});b.currentX_=d.x;b.currentY_=d.y}i.quadraticCurveTo=function(b,a,c,d){var f=this.getCoords_(b,a),h=this.getCoords_(c,d),g={x:this.currentX_+
0.6666666666666666*(f.x-this.currentX_),y:this.currentY_+0.6666666666666666*(f.y-this.currentY_)};Q(this,g,{x:g.x+(h.x-this.currentX_)/3,y:g.y+(h.y-this.currentY_)/3},h)};i.arc=function(b,a,c,d,f,h){c*=k;var g=h?"at":"wa",l=b+G(d)*c-v,e=a+F(d)*c-v,m=b+G(f)*c-v,r=a+F(f)*c-v;if(l==m&&!h)l+=0.125;var n=this.getCoords_(b,a),o=this.getCoords_(l,e),q=this.getCoords_(m,r);this.currentPath_.push({type:g,x:n.x,y:n.y,radius:c,xStart:o.x,yStart:o.y,xEnd:q.x,yEnd:q.y})};i.rect=function(b,a,c,d){this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath()};i.strokeRect=function(b,a,c,d){var f=this.currentPath_;this.beginPath();this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath();this.stroke();this.currentPath_=f};i.fillRect=function(b,a,c,d){var f=this.currentPath_;this.beginPath();this.moveTo(b,a);this.lineTo(b+c,a);this.lineTo(b+c,a+d);this.lineTo(b,a+d);this.closePath();this.fill();this.currentPath_=f};i.createLinearGradient=function(b,a,c,d){var f=new D("gradient");f.x0_=b;f.y0_=a;f.x1_=c;f.y1_=d;return f};i.createRadialGradient=function(b,a,c,d,f,h){var g=new D("gradientradial");g.x0_=b;g.y0_=a;g.r0_=c;g.x1_=d;g.y1_=f;g.r1_=h;return g};i.drawImage=function(b){var a,c,d,f,h,g,l,e,m=b.runtimeStyle.width,r=b.runtimeStyle.height;b.runtimeStyle.width="auto";b.runtimeStyle.height="auto";var n=b.width,o=b.height;b.runtimeStyle.width=m;b.runtimeStyle.height=r;if(arguments.length==3){a=arguments[1];c=arguments[2];h=g=0;l=d=n;e=f=o}else if(arguments.length==5){a=arguments[1];c=arguments[2];d=arguments[3];f=arguments[4];h=g=0;l=n;e=o}else if(arguments.length==9){h=arguments[1];g=arguments[2];l=arguments[3];e=arguments[4];a=arguments[5];c=arguments[6];d=arguments[7];f=arguments[8]}else throw Error("Invalid number of arguments");var q=this.getCoords_(a,c),t=[];t.push(" <g_vml_:group",' coordsize="',k*10,",",k*10,'"',' coordorigin="0,0"',' style="width:',10,"px;height:",10,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var E=[];E.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",j(q.x/k),",","Dy=",j(q.y/k),"");var p=q,z=this.getCoords_(a+d,c),w=this.getCoords_(a,c+f),x=this.getCoords_(a+d,c+f);p.x=s.max(p.x,z.x,w.x,x.x);p.y=s.max(p.y,z.y,w.y,x.y);t.push("padding:0 ",j(p.x/k),"px ",j(p.y/k),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",E.join(""),", sizingmethod='clip');")}else t.push("top:",j(q.y/k),"px;left:",j(q.x/k),"px;");t.push(' ">','<g_vml_:image src="',b.src,'"',' style="width:',k*d,"px;"," height:",k*f,'px;"',' cropleft="',h/n,'"',' croptop="',g/o,'"',' cropright="',(n-h-l)/n,'"',' cropbottom="',(o-g-e)/o,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};i.stroke=function(b){var a=[],c=P(b?this.fillStyle:this.strokeStyle),d=c.color,f=c.alpha*this.globalAlpha;a.push("<g_vml_:shape",' filled="',!!b,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0 0" coordsize="',k*10," ",k*10,'"',' stroked="',!b,'"',' path="');var h={x:null,y:null},g={x:null,y:null},l=0;for(;l<this.currentPath_.length;l++){var e=this.currentPath_[l];switch(e.type){case"moveTo":a.push(" m ",j(e.x),",",j(e.y));break;case"lineTo":a.push(" l ",j(e.x),",",j(e.y));break;case"close":a.push(" x ");e=null;break;case"bezierCurveTo":a.push(" c ",j(e.cp1x),",",j(e.cp1y),",",j(e.cp2x),",",j(e.cp2y),",",j(e.x),",",j(e.y));break;case"at":case"wa":a.push(" ",e.type," ",j(e.x-this.arcScaleX_*e.radius),",",j(e.y-this.arcScaleY_*e.radius)," ",j(e.x+this.arcScaleX_*e.radius),",",j(e.y+this.arcScaleY_*e.radius)," ",j(e.xStart),",",j(e.yStart)," ",j(e.xEnd),",",j(e.yEnd));break}if(e){if(h.x==null||e.x<h.x)h.x=e.x;if(g.x==null||e.x>g.x)g.x=e.x;if(h.y==null||e.y<h.y)h.y=e.y;if(g.y==null||e.y>g.y)g.y=e.y}}a.push(' ">');if(b)if(typeof this.fillStyle=="object"){var m=this.fillStyle,r=0,n={x:0,y:0},o=0,q=1;if(m.type_=="gradient"){var t=m.x1_/this.arcScaleX_,E=m.y1_/this.arcScaleY_,p=this.getCoords_(m.x0_/this.arcScaleX_,m.y0_/this.arcScaleY_),z=this.getCoords_(t,E);r=Math.atan2(z.x-p.x,z.y-p.y)*180/Math.PI;if(r<0)r+=360;if(r<1.0E-6)r=0}else{var p=this.getCoords_(m.x0_,m.y0_),w=g.x-h.x,x=g.y-h.y;n={x:(p.x-h.x)/w,y:(p.y-h.y)/x};w/=this.arcScaleX_*k;x/=this.arcScaleY_*k;var R=s.max(w,x);o=2*m.r0_/R;q=2*m.r1_/R-o}var u=m.colors_;u.sort(function(ba,ca){return ba.offset-ca.offset});var J=u.length,da=u[0].color,ea=u[J-1].color,fa=u[0].alpha*this.globalAlpha,ga=u[J-1].alpha*this.globalAlpha,S=[],l=0;for(;l<J;l++){var T=u[l];S.push(T.offset*q+
o+" "+T.color)}a.push('<g_vml_:fill type="',m.type_,'"',' method="none" focus="100%"',' color="',da,'"',' color2="',ea,'"',' colors="',S.join(","),'"',' opacity="',ga,'"',' g_o_:opacity2="',fa,'"',' angle="',r,'"',' focusposition="',n.x,",",n.y,'" />')}else a.push('<g_vml_:fill color="',d,'" opacity="',f,'" />');else{var K=this.lineScale_*this.lineWidth;if(K<1)f*=K;a.push("<g_vml_:stroke",' opacity="',f,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',aa(this.lineCap),'"',' weight="',K,'px"',' color="',d,'" />')}a.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",a.join(""))};i.fill=function(){this.stroke(true)};i.closePath=function(){this.currentPath_.push({type:"close"})};i.getCoords_=function(b,a){var c=this.m_;return{x:k*(b*c[0][0]+a*c[1][0]+c[2][0])-v,y:k*(b*c[0][1]+a*c[1][1]+c[2][1])-v}};i.save=function(){var b={};O(this,b);this.aStack_.push(b);this.mStack_.push(this.m_);this.m_=y(I(),this.m_)};i.restore=function(){O(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b[a][c])||isNaN(b[a][c]))return false}return true}function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][1]-a[0][1]*a[1][0]))}}i.translate=function(b,a){A(this,y([[1,0,0],[0,1,0],[b,a,1]],this.m_),false)};i.rotate=function(b){var a=G(b),c=F(b);A(this,y([[a,c,0],[-c,a,0],[0,0,1]],this.m_),false)};i.scale=function(b,a){this.arcScaleX_*=b;this.arcScaleY_*=a;A(this,y([[b,0,0],[0,a,0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager=M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})();
