﻿/*
 * jQuery JavaScript Library v1.4.1
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * Date: Mon Jan 25 19:43:33 2010 -0500
 */
(function(ae,aF){var G=function(aV,aU){return new G.fn.init(aV,aU)},y=ae.jQuery,P=ae.$,aO=ae.document,ap,aI=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,aH=/^.[^:#\[\.,]*$/,M=/\S/,ad=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,o=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,ag=navigator.userAgent,am,aP=false,I=[],aG,aa=Object.prototype.toString,O=Object.prototype.hasOwnProperty,ac=Array.prototype.push,T=Array.prototype.slice,U=Array.prototype.indexOf;G.fn=G.prototype={init:function(aX,aW){var aU,aV,aZ,aY;if(!aX){return this}if(aX.nodeType){this.context=this[0]=aX;this.length=1;return this}if(typeof aX==="string"){aU=aI.exec(aX);if(aU&&(aU[1]||!aW)){if(aU[1]){aY=(aW?aW.ownerDocument||aW:aO);aZ=o.exec(aX);if(aZ){if(G.isPlainObject(aW)){aX=[aO.createElement(aZ[1])];G.fn.attr.call(aX,aW,true)}else{aX=[aY.createElement(aZ[1])]}}else{aZ=d([aU[1]],[aY]);aX=(aZ.cacheable?aZ.fragment.cloneNode(true):aZ.fragment).childNodes}}else{aV=aO.getElementById(aU[2]);if(aV){if(aV.id!==aU[2]){return ap.find(aX)}this.length=1;this[0]=aV}this.context=aO;this.selector=aX;return this}}else{if(!aW&&/^\w+$/.test(aX)){this.selector=aX;this.context=aO;aX=aO.getElementsByTagName(aX)}else{if(!aW||aW.jquery){return(aW||ap).find(aX)}else{return G(aW).find(aX)}}}}else{if(G.isFunction(aX)){return ap.ready(aX)}}if(aX.selector!==aF){this.selector=aX.selector;this.context=aX.context}return G.isArray(aX)?this.setArray(aX):G.makeArray(aX,this)},selector:"",jquery:"1.4.1",length:0,size:function(){return this.length},toArray:function(){return T.call(this,0)},get:function(aU){return aU==null?this.toArray():(aU<0?this.slice(aU)[0]:this[aU])},pushStack:function(aX,aU,aW){var aV=G(aX||null);aV.prevObject=this;aV.context=this.context;if(aU==="find"){aV.selector=this.selector+(this.selector?" ":"")+aW}else{if(aU){aV.selector=this.selector+"."+aU+"("+aW+")"}}return aV},setArray:function(aU){this.length=0;ac.apply(this,aU);return this},each:function(aV,aU){return G.each(this,aV,aU)},ready:function(aU){G.bindReady();if(G.isReady){aU.call(aO,G)}else{if(I){I.push(aU)}}return this},eq:function(aU){return aU===-1?this.slice(aU):this.slice(aU,+aU+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(T.apply(this,arguments),"slice",T.call(arguments).join(","))},map:function(aU){return this.pushStack(G.map(this,function(aV,aW){return aU.call(aV,aW,aV)}))},end:function(){return this.prevObject||G(null)},push:ac,sort:[].sort,splice:[].splice};G.fn.init.prototype=G.fn;G.extend=G.fn.extend=function(){var a0=arguments[0]||{},aY=1,aZ=arguments.length,aW=false,aU,aV,a2,aX;if(typeof a0==="boolean"){aW=a0;a0=arguments[1]||{};aY=2}if(typeof a0!=="object"&&!G.isFunction(a0)){a0={}}if(aZ===aY){a0=this;--aY}for(;aY<aZ;aY++){if((aU=arguments[aY])!=null){for(aV in aU){a2=a0[aV];aX=aU[aV];if(a0===aX){continue}if(aW&&aX&&(G.isPlainObject(aX)||G.isArray(aX))){var a1=a2&&(G.isPlainObject(a2)||G.isArray(a2))?a2:G.isArray(aX)?[]:{};a0[aV]=G.extend(aW,a1,aX)}else{if(aX!==aF){a0[aV]=aX}}}}}return a0};G.extend({noConflict:function(aU){ae.$=P;if(aU){ae.jQuery=y}return G},isReady:false,ready:function(){if(!G.isReady){if(!aO.body){return setTimeout(G.ready,13)}G.isReady=true;if(I){var aU,aV=0;while((aU=I[aV++])){aU.call(aO,G)}I=null}if(G.fn.triggerHandler){G(aO).triggerHandler("ready")}}},bindReady:function(){if(aP){return}aP=true;if(aO.readyState==="complete"){return G.ready()}if(aO.addEventListener){aO.addEventListener("DOMContentLoaded",aG,false);ae.addEventListener("load",G.ready,false)}else{if(aO.attachEvent){aO.attachEvent("onreadystatechange",aG);ae.attachEvent("onload",G.ready);var aU=false;try{aU=ae.frameElement==null}catch(aV){}if(aO.documentElement.doScroll&&aU){A()}}}},isFunction:function(aU){return aa.call(aU)==="[object Function]"},isArray:function(aU){return aa.call(aU)==="[object Array]"},isPlainObject:function(aV){if(!aV||aa.call(aV)!=="[object Object]"||aV.nodeType||aV.setInterval){return false}if(aV.constructor&&!O.call(aV,"constructor")&&!O.call(aV.constructor.prototype,"isPrototypeOf")){return false}var aU;for(aU in aV){}return aU===aF||O.call(aV,aU)},isEmptyObject:function(aV){for(var aU in aV){return false}return true},error:function(aU){throw aU},parseJSON:function(aU){if(typeof aU!=="string"||!aU){return null}if(/^[\],:{}\s]*$/.test(aU.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return ae.JSON&&ae.JSON.parse?ae.JSON.parse(aU):(new Function("return "+aU))()}else{G.error("Invalid JSON: "+aU)}},noop:function(){},globalEval:function(aW){if(aW&&M.test(aW)){var aU=aO.getElementsByTagName("head")[0]||aO.documentElement,aV=aO.createElement("script");aV.type="text/javascript";if(G.support.scriptEval){aV.appendChild(aO.createTextNode(aW))}else{aV.text=aW}aU.insertBefore(aV,aU.firstChild);aU.removeChild(aV)}},nodeName:function(aV,aU){return aV.nodeName&&aV.nodeName.toUpperCase()===aU.toUpperCase()},each:function(aW,a1,aY){var aX,aU=0,aZ=aW.length,a0=aZ===aF||G.isFunction(aW);if(aY){if(a0){for(aX in aW){if(a1.apply(aW[aX],aY)===false){break}}}else{for(;aU<aZ;){if(a1.apply(aW[aU++],aY)===false){break}}}}else{if(a0){for(aX in aW){if(a1.call(aW[aX],aX,aW[aX])===false){break}}}else{for(var aV=aW[0];aU<aZ&&a1.call(aV,aU,aV)!==false;aV=aW[++aU]){}}}return aW},trim:function(aU){return(aU||"").replace(ad,"")},makeArray:function(aV,aU){var aW=aU||[];if(aV!=null){if(aV.length==null||typeof aV==="string"||G.isFunction(aV)||(typeof aV!=="function"&&aV.setInterval)){ac.call(aW,aV)}else{G.merge(aW,aV)}}return aW},inArray:function(aV,aX){if(aX.indexOf){return aX.indexOf(aV)}for(var aW=0,aU=aX.length;aW<aU;aW++){if(aX[aW]===aV){return aW}}return -1},merge:function(aU,aV){var aW=aU.length,aX=0;if(typeof aV.length==="number"){for(var aY=aV.length;aX<aY;aX++){aU[aW++]=aV[aX]}}else{while(aV[aX]!==aF){aU[aW++]=aV[aX++]}}aU.length=aW;return aU},grep:function(aZ,aU,aV){var aW=[];for(var aX=0,aY=aZ.length;aX<aY;aX++){if(!aV!==!aU(aZ[aX],aX)){aW.push(aZ[aX])}}return aW},map:function(a0,aU,aY){var aW=[],aV;for(var aX=0,aZ=a0.length;aX<aZ;aX++){aV=aU(a0[aX],aX,aY);if(aV!=null){aW[aW.length]=aV}}return aW.concat.apply([],aW)},guid:1,proxy:function(aU,aW,aV){if(arguments.length===2){if(typeof aW==="string"){aV=aU;aU=aV[aW];aW=aF}else{if(aW&&!G.isFunction(aW)){aV=aW;aW=aF}}}if(!aW&&aU){aW=function(){return aU.apply(aV||this,arguments)}}if(aU){aW.guid=aU.guid=aU.guid||aW.guid||G.guid++}return aW},uaMatch:function(aV){aV=aV.toLowerCase();var aU=/(webkit)[ \/]([\w.]+)/.exec(aV)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(aV)||/(msie) ([\w.]+)/.exec(aV)||!/compatible/.test(aV)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(aV)||[];return{browser:aU[1]||"",version:aU[2]||"0"}},browser:{}});am=G.uaMatch(ag);if(am.browser){G.browser[am.browser]=true;G.browser.version=am.version}if(G.browser.webkit){G.browser.safari=true}if(U){G.inArray=function(aU,aV){return U.call(aV,aU)}}ap=G(aO);if(aO.addEventListener){aG=function(){aO.removeEventListener("DOMContentLoaded",aG,false);G.ready()}}else{if(aO.attachEvent){aG=function(){if(aO.readyState==="complete"){aO.detachEvent("onreadystatechange",aG);G.ready()}}}}function A(){if(G.isReady){return}try{aO.documentElement.doScroll("left")}catch(aU){setTimeout(A,1);return}G.ready()}function F(aV,aU){if(aU.src){G.ajax({url:aU.src,async:false,dataType:"script"})}else{G.globalEval(aU.text||aU.textContent||aU.innerHTML||"")}if(aU.parentNode){aU.parentNode.removeChild(aU)}}function J(aY,aW,aX,aZ,a2,a1){var a0=aY.length;if(typeof aW==="object"){for(var aV in aW){J(aY,aV,aW[aV],aZ,a2,aX)}return aY}if(aX!==aF){aZ=!a1&&aZ&&G.isFunction(aX);for(var aU=0;aU<a0;aU++){a2(aY[aU],aW,aZ?aX.call(aY[aU],aU,a2(aY[aU],aW)):aX,a1)}return aY}return a0?a2(aY[0],aW):null}function x(){return(new Date).getTime()}(function(){G.support={};var aX=aO.documentElement,aZ=aO.createElement("script"),a3=aO.createElement("div"),aU="script"+x();a3.style.display="none";a3.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var a0=a3.getElementsByTagName("*"),aW=a3.getElementsByTagName("a")[0];if(!a0||!a0.length||!aW){return}G.support={leadingWhitespace:a3.firstChild.nodeType===3,tbody:!a3.getElementsByTagName("tbody").length,htmlSerialize:!!a3.getElementsByTagName("link").length,style:/red/.test(aW.getAttribute("style")),hrefNormalized:aW.getAttribute("href")==="/a",opacity:/^0.55$/.test(aW.style.opacity),cssFloat:!!aW.style.cssFloat,checkOn:a3.getElementsByTagName("input")[0].value==="on",optSelected:aO.createElement("select").appendChild(aO.createElement("option")).selected,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};aZ.type="text/javascript";try{aZ.appendChild(aO.createTextNode("window."+aU+"=1;"))}catch(aY){}aX.insertBefore(aZ,aX.firstChild);if(ae[aU]){G.support.scriptEval=true;delete ae[aU]}aX.removeChild(aZ);if(a3.attachEvent&&a3.fireEvent){a3.attachEvent("onclick",function a2(){G.support.noCloneEvent=false;a3.detachEvent("onclick",a2)});a3.cloneNode(true).fireEvent("onclick")}a3=aO.createElement("div");a3.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var aV=aO.createDocumentFragment();aV.appendChild(a3.firstChild);G.support.checkClone=aV.cloneNode(true).cloneNode(true).lastChild.checked;G(function(){var a4=aO.createElement("div");a4.style.width=a4.style.paddingLeft="1px";aO.body.appendChild(a4);G.boxModel=G.support.boxModel=a4.offsetWidth===2;aO.body.removeChild(a4).style.display="none";a4=null});var a1=function(a5){var a4=aO.createElement("div");a5="on"+a5;var a6=(a5 in a4);if(!a6){a4.setAttribute(a5,"return;");a6=typeof a4[a5]==="function"}a4=null;return a6};G.support.submitBubbles=a1("submit");G.support.changeBubbles=a1("change");aX=aZ=a3=a0=aW=null})();G.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var u="jQuery"+x(),z=0,Z={};var ab={};G.extend({cache:{},expando:u,noData:{embed:true,object:true,applet:true},data:function(aW,aV,aZ){if(aW.nodeName&&G.noData[aW.nodeName.toLowerCase()]){return}aW=aW==ae?Z:aW;var aX=aW[u],aY=G.cache,aU;if(!aV&&!aX){return null}if(!aX){aX=++z}if(typeof aV==="object"){aW[u]=aX;aU=aY[aX]=G.extend(true,{},aV)}else{if(aY[aX]){aU=aY[aX]}else{if(typeof aZ==="undefined"){aU=ab}else{aU=aY[aX]={}}}}if(aZ!==aF){aW[u]=aX;aU[aV]=aZ}return typeof aV==="string"?aU[aV]:aU},removeData:function(aW,aV){if(aW.nodeName&&G.noData[aW.nodeName.toLowerCase()]){return}aW=aW==ae?Z:aW;var aY=aW[u],aZ=G.cache,aU=aZ[aY];if(aV){if(aU){delete aU[aV];if(G.isEmptyObject(aU)){G.removeData(aW)}}}else{try{delete aW[u]}catch(aX){if(aW.removeAttribute){aW.removeAttribute(u)}}delete aZ[aY]}}});G.fn.extend({data:function(aV,aU){if(typeof aV==="undefined"&&this.length){return G.data(this[0])}else{if(typeof aV==="object"){return this.each(function(){G.data(this,aV)})}}var aW=aV.split(".");aW[1]=aW[1]?"."+aW[1]:"";if(aU===aF){var aX=this.triggerHandler("getData"+aW[1]+"!",[aW[0]]);if(aX===aF&&this.length){aX=G.data(this[0],aV)}return aX===aF&&aW[1]?this.data(aW[0]):aX}else{return this.trigger("setData"+aW[1]+"!",[aW[0],aU]).each(function(){G.data(this,aV,aU)})}},removeData:function(aU){return this.each(function(){G.removeData(this,aU)})}});G.extend({queue:function(aU,aV,aX){if(!aU){return}aV=(aV||"fx")+"queue";var aW=G.data(aU,aV);if(!aX){return aW||[]}if(!aW||G.isArray(aX)){aW=G.data(aU,aV,G.makeArray(aX))}else{aW.push(aX)}return aW},dequeue:function(aV,aW){aW=aW||"fx";var aX=G.queue(aV,aW),aU=aX.shift();if(aU==="inprogress"){aU=aX.shift()}if(aU){if(aW==="fx"){aX.unshift("inprogress")}aU.call(aV,function(){G.dequeue(aV,aW)})}}});G.fn.extend({queue:function(aU,aV){if(typeof aU!=="string"){aV=aU;aU="fx"}if(aV===aF){return G.queue(this[0],aU)}return this.each(function(aY,aX){var aW=G.queue(this,aU,aV);if(aU==="fx"&&aW[0]!=="inprogress"){G.dequeue(this,aU)}})},dequeue:function(aU){return this.each(function(){G.dequeue(this,aU)})},delay:function(aV,aU){aV=G.fx?G.fx.speeds[aV]||aV:aV;aU=aU||"fx";return this.queue(aU,function(){var aW=this;setTimeout(function(){G.dequeue(aW,aU)},aV)})},clearQueue:function(aU){return this.queue(aU||"fx",[])}});var c=/[\n\t]/g,ax=/\s+/,aE=/\r/g,w=/href|src|style/,f=/(button|input)/i,aw=/(button|input|object|select|textarea)/i,av=/^(a|area)$/i,ao=/radio|checkbox/;G.fn.extend({attr:function(aU,aV){return J(this,aU,aV,true,G.attr)},removeAttr:function(aV,aU){return this.each(function(){G.attr(this,aV,"");if(this.nodeType===1){this.removeAttribute(aV)}})},addClass:function(aX){if(G.isFunction(aX)){return this.each(function(a3){var a2=G(this);a2.addClass(aX.call(this,a3,a2.attr("class")))})}if(aX&&typeof aX==="string"){var aV=(aX||"").split(ax);for(var aU=0,aW=this.length;aU<aW;aU++){var a0=this[aU];if(a0.nodeType===1){if(!a0.className){a0.className=aX}else{var a1=" "+a0.className+" ";for(var aZ=0,aY=aV.length;aZ<aY;aZ++){if(a1.indexOf(" "+aV[aZ]+" ")<0){a0.className+=" "+aV[aZ]}}}}}}return this},removeClass:function(aX){if(G.isFunction(aX)){return this.each(function(a3){var a2=G(this);a2.removeClass(aX.call(this,a3,a2.attr("class")))})}if((aX&&typeof aX==="string")||aX===aF){var aV=(aX||"").split(ax);for(var aU=0,aW=this.length;aU<aW;aU++){var a0=this[aU];if(a0.nodeType===1&&a0.className){if(aX){var a1=(" "+a0.className+" ").replace(c," ");for(var aZ=0,aY=aV.length;aZ<aY;aZ++){a1=a1.replace(" "+aV[aZ]+" "," ")}a0.className=a1.substring(1,a1.length-1)}else{a0.className=""}}}}return this},toggleClass:function(aU,aV){var aW=typeof aU,aX=typeof aV==="boolean";if(G.isFunction(aU)){return this.each(function(aZ){var aY=G(this);aY.toggleClass(aU.call(this,aZ,aY.attr("class"),aV),aV)})}return this.each(function(){if(aW==="string"){var aZ,a1=0,a0=G(this),aY=aV,a2=aU.split(ax);while((aZ=a2[a1++])){aY=aX?aY:!a0.hasClass(aZ);a0[aY?"addClass":"removeClass"](aZ)}}else{if(aW==="undefined"||aW==="boolean"){if(this.className){G.data(this,"__className__",this.className)}this.className=this.className||aU===false?"":G.data(this,"__className__")||""}}})},hasClass:function(aV){var aU=" "+aV+" ";for(var aW=0,aX=this.length;aW<aX;aW++){if((" "+this[aW].className+" ").replace(c," ").indexOf(aU)>-1){return true}}return false},val:function(aW){if(aW===aF){var a2=this[0];if(a2){if(G.nodeName(a2,"option")){return(a2.attributes.value||{}).specified?a2.value:a2.text}if(G.nodeName(a2,"select")){var aX=a2.selectedIndex,aY=[],aU=a2.options,a1=a2.type==="select-one";if(aX<0){return null}for(var a0=a1?aX:0,a3=a1?aX+1:aU.length;a0<a3;a0++){var aZ=aU[a0];if(aZ.selected){aW=G(aZ).val();if(a1){return aW}aY.push(aW)}}return aY}if(ao.test(a2.type)&&!G.support.checkOn){return a2.getAttribute("value")===null?"on":a2.value}return(a2.value||"").replace(aE,"")}return aF}var aV=G.isFunction(aW);return this.each(function(a5){var a4=G(this),a6=aW;if(this.nodeType!==1){return}if(aV){a6=aW.call(this,a5,a4.val())}if(typeof a6==="number"){a6+=""}if(G.isArray(a6)&&ao.test(this.type)){this.checked=G.inArray(a4.val(),a6)>=0}else{if(G.nodeName(this,"select")){var a7=G.makeArray(a6);G("option",this).each(function(){this.selected=G.inArray(G(this).val(),a7)>=0});if(!a7.length){this.selectedIndex=-1}}else{this.value=a6}}})}});G.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(aZ,aV,aX,aU){if(!aZ||aZ.nodeType===3||aZ.nodeType===8){return aF}if(aU&&aV in G.attrFn){return G(aZ)[aV](aX)}var a3=aZ.nodeType!==1||!G.isXMLDoc(aZ),aW=aX!==aF;aV=a3&&G.props[aV]||aV;if(aZ.nodeType===1){var a2=w.test(aV);if(aV==="selected"&&!G.support.optSelected){var a1=aZ.parentNode;if(a1){a1.selectedIndex;if(a1.parentNode){a1.parentNode.selectedIndex}}}if(aV in aZ&&a3&&!a2){if(aW){if(aV==="type"&&f.test(aZ.nodeName)&&aZ.parentNode){G.error("type property can't be changed")}aZ[aV]=aX}if(G.nodeName(aZ,"form")&&aZ.getAttributeNode(aV)){return aZ.getAttributeNode(aV).nodeValue}if(aV==="tabIndex"){var a0=aZ.getAttributeNode("tabIndex");return a0&&a0.specified?a0.value:aw.test(aZ.nodeName)||av.test(aZ.nodeName)&&aZ.href?0:aF}return aZ[aV]}if(!G.support.style&&a3&&aV==="style"){if(aW){aZ.style.cssText=""+aX}return aZ.style.cssText}if(aW){aZ.setAttribute(aV,""+aX)}var aY=!G.support.hrefNormalized&&a3&&a2?aZ.getAttribute(aV,2):aZ.getAttribute(aV);return aY===null?aF:aY}return G.style(aZ,aV,aX)}});var ah=function(aU){return aU.replace(/[^\w\s\.\|`]/g,function(aV){return"\\"+aV})};G.event={add:function(a6,aW,a7,a0){if(a6.nodeType===3||a6.nodeType===8){return}if(a6.setInterval&&(a6!==ae&&!a6.frameElement)){a6=ae}if(!a7.guid){a7.guid=G.guid++}if(a0!==aF){var aY=a7;a7=G.proxy(aY);a7.data=a0}var aZ=G.data(a6,"events")||G.data(a6,"events",{}),a2=G.data(a6,"handle"),a5;if(!a2){a5=function(){return typeof G!=="undefined"&&!G.event.triggered?G.event.handle.apply(a5.elem,arguments):aF};a2=G.data(a6,"handle",a5)}if(!a2){return}a2.elem=a6;aW=aW.split(/\s+/);var aV,aU=0;while((aV=aW[aU++])){var a3=aV.split(".");aV=a3.shift();if(aU>1){a7=G.proxy(a7);if(a0!==aF){a7.data=a0}}a7.type=a3.slice(0).sort().join(".");var a4=aZ[aV],aX=this.special[aV]||{};if(!a4){a4=aZ[aV]={};if(!aX.setup||aX.setup.call(a6,a0,a3,a7)===false){if(a6.addEventListener){a6.addEventListener(aV,a2,false)}else{if(a6.attachEvent){a6.attachEvent("on"+aV,a2)}}}}if(aX.add){var a1=aX.add.call(a6,a7,a0,a3,a4);if(a1&&G.isFunction(a1)){a1.guid=a1.guid||a7.guid;a1.data=a1.data||a7.data;a1.type=a1.type||a7.type;a7=a1}}a4[a7.guid]=a7;this.global[aV]=true}a6=null},global:{},remove:function(a6,aY,a7){if(a6.nodeType===3||a6.nodeType===8){return}var a1=G.data(a6,"events"),aX,aV,a0;if(a1){if(aY===aF||(typeof aY==="string"&&aY.charAt(0)===".")){for(aV in a1){this.remove(a6,aV+(aY||""))}}else{if(aY.type){a7=aY.handler;aY=aY.type}aY=aY.split(/\s+/);var aU=0;while((aV=aY[aU++])){var a4=aV.split(".");aV=a4.shift();var a5=!a4.length,a2=G.map(a4.slice(0).sort(),ah),aW=new RegExp("(^|\\.)"+a2.join("\\.(?:.*\\.)?")+"(\\.|$)"),aZ=this.special[aV]||{};if(a1[aV]){if(a7){a0=a1[aV][a7.guid];delete a1[aV][a7.guid]}else{for(var a3 in a1[aV]){if(a5||aW.test(a1[aV][a3].type)){delete a1[aV][a3]}}}if(aZ.remove){aZ.remove.call(a6,a4,a0)}for(aX in a1[aV]){break}if(!aX){if(!aZ.teardown||aZ.teardown.call(a6,a4)===false){if(a6.removeEventListener){a6.removeEventListener(aV,G.data(a6,"handle"),false)}else{if(a6.detachEvent){a6.detachEvent("on"+aV,G.data(a6,"handle"))}}}aX=null;delete a1[aV]}}}}for(aX in a1){break}if(!aX){var a3=G.data(a6,"handle");if(a3){a3.elem=null}G.removeData(a6,"events");G.removeData(a6,"handle")}}},trigger:function(aX,aY,a3){var aW=aX.type||aX,aZ=arguments[3];if(!aZ){aX=typeof aX==="object"?aX[u]?aX:G.extend(G.Event(aW),aX):G.Event(aW);if(aW.indexOf("!")>=0){aX.type=aW=aW.slice(0,-1);aX.exclusive=true}if(!a3){aX.stopPropagation();if(this.global[aW]){G.each(G.cache,function(){if(this.events&&this.events[aW]){G.event.trigger(aX,aY,this.handle.elem)}})}}if(!a3||a3.nodeType===3||a3.nodeType===8){return aF}aX.result=aF;aX.target=a3;aY=G.makeArray(aY);aY.unshift(aX)}aX.currentTarget=a3;var a1=G.data(a3,"handle");if(a1){a1.apply(a3,aY)}var a2=a3.parentNode||a3.ownerDocument;try{if(!(a3&&a3.nodeName&&G.noData[a3.nodeName.toLowerCase()])){if(a3["on"+aW]&&a3["on"+aW].apply(a3,aY)===false){aX.result=false}}}catch(a0){}if(!aX.isPropagationStopped()&&a2){G.event.trigger(aX,aY,a2,true)}else{if(!aX.isDefaultPrevented()){var aU=aX.target,aV,a4=G.nodeName(aU,"a")&&aW==="click";if(!a4&&!(aU&&aU.nodeName&&G.noData[aU.nodeName.toLowerCase()])){try{if(aU[aW]){aV=aU["on"+aW];if(aV){aU["on"+aW]=null}this.triggered=true;aU[aW]()}}catch(a0){}if(aV){aU["on"+aW]=aV}this.triggered=false}}}},handle:function(aX){var a0,aZ;aX=arguments[0]=G.event.fix(aX||ae.event);aX.currentTarget=this;var aY=aX.type.split(".");aX.type=aY.shift();a0=!aY.length&&!aX.exclusive;var aV=new RegExp("(^|\\.)"+aY.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");aZ=(G.data(this,"events")||{})[aX.type];for(var aU in aZ){var a1=aZ[aU];if(a0||aV.test(a1.type)){aX.handler=a1;aX.data=a1.data;var aW=a1.apply(this,arguments);if(aW!==aF){aX.result=aW;if(aW===false){aX.preventDefault();aX.stopPropagation()}}if(aX.isImmediatePropagationStopped()){break}}}return aX.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(aX){if(aX[u]){return aX}var aW=aX;aX=G.Event(aW);for(var aY=this.props.length,aZ;aY;){aZ=this.props[--aY];aX[aZ]=aW[aZ]}if(!aX.target){aX.target=aX.srcElement||aO}if(aX.target.nodeType===3){aX.target=aX.target.parentNode}if(!aX.relatedTarget&&aX.fromElement){aX.relatedTarget=aX.fromElement===aX.target?aX.toElement:aX.fromElement}if(aX.pageX==null&&aX.clientX!=null){var aV=aO.documentElement,aU=aO.body;aX.pageX=aX.clientX+(aV&&aV.scrollLeft||aU&&aU.scrollLeft||0)-(aV&&aV.clientLeft||aU&&aU.clientLeft||0);aX.pageY=aX.clientY+(aV&&aV.scrollTop||aU&&aU.scrollTop||0)-(aV&&aV.clientTop||aU&&aU.clientTop||0)}if(!aX.which&&((aX.charCode||aX.charCode===0)?aX.charCode:aX.keyCode)){aX.which=aX.charCode||aX.keyCode}if(!aX.metaKey&&aX.ctrlKey){aX.metaKey=aX.ctrlKey}if(!aX.which&&aX.button!==aF){aX.which=(aX.button&1?1:(aX.button&2?3:(aX.button&4?2:0)))}return aX},guid:100000000,proxy:G.proxy,special:{ready:{setup:G.bindReady,teardown:G.noop},live:{add:function(aU,aX,aV,aW){G.extend(aU,aX||{});aU.guid+=aX.selector+aX.live;aX.liveProxy=aU;G.event.add(this,aX.live,ak,aX)},remove:function(aU){if(aU.length){var aW=0,aV=new RegExp("(^|\\.)"+aU[0]+"(\\.|$)");G.each((G.data(this,"events").live||{}),function(){if(aV.test(this.type)){aW++}});if(aW<1){G.event.remove(this,aU[0],ak)}}},special:{}},beforeunload:{setup:function(aW,aU,aV){if(this.setInterval){this.onbeforeunload=aV}return false},teardown:function(aU,aV){if(this.onbeforeunload===aV){this.onbeforeunload=null}}}}};G.Event=function(aU){if(!this.preventDefault){return new G.Event(aU)}if(aU&&aU.type){this.originalEvent=aU;this.type=aU.type}else{this.type=aU}this.timeStamp=x();this[u]=true};function aA(){return false}function W(){return true}G.Event.prototype={preventDefault:function(){this.isDefaultPrevented=W;var aU=this.originalEvent;if(!aU){return}if(aU.preventDefault){aU.preventDefault()}aU.returnValue=false},stopPropagation:function(){this.isPropagationStopped=W;var aU=this.originalEvent;if(!aU){return}if(aU.stopPropagation){aU.stopPropagation()}aU.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=W;this.stopPropagation()},isDefaultPrevented:aA,isPropagationStopped:aA,isImmediatePropagationStopped:aA};var L=function(aV){var aU=aV.relatedTarget;while(aU&&aU!==this){try{aU=aU.parentNode}catch(aW){break}}if(aU!==this){aV.type=aV.data;G.event.handle.apply(this,arguments)}},aR=function(aU){aU.type=aU.data;G.event.handle.apply(this,arguments)};G.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(aV,aU){G.event.special[aV]={setup:function(aW){G.event.add(this,aU,aW&&aW.selector?aR:L,aV)},teardown:function(aW){G.event.remove(this,aU,aW&&aW.selector?aR:L)}}});if(!G.support.submitBubbles){G.event.special.submit={setup:function(aW,aU,aV){if(this.nodeName.toLowerCase()!=="form"){G.event.add(this,"click.specialSubmit."+aV.guid,function(aZ){var aX=aZ.target,aY=aX.type;if((aY==="submit"||aY==="image")&&G(aX).closest("form").length){return C("submit",this,arguments)}});G.event.add(this,"keypress.specialSubmit."+aV.guid,function(aZ){var aX=aZ.target,aY=aX.type;if((aY==="text"||aY==="password")&&G(aX).closest("form").length&&aZ.keyCode===13){return C("submit",this,arguments)}})}else{return false}},remove:function(aU,aV){G.event.remove(this,"click.specialSubmit"+(aV?"."+aV.guid:""));G.event.remove(this,"keypress.specialSubmit"+(aV?"."+aV.guid:""))}}}if(!G.support.changeBubbles){var aM=/textarea|input|select/i;function g(aU){var aV=aU.type,aW=aU.value;if(aV==="radio"||aV==="checkbox"){aW=aU.checked}else{if(aV==="select-multiple"){aW=aU.selectedIndex>-1?G.map(aU.options,function(aX){return aX.selected}).join("-"):""}else{if(aU.nodeName.toLowerCase()==="select"){aW=aU.selectedIndex}}}return aW}function aT(aV){var aU=aV.target,aX,aW;if(!aM.test(aU.nodeName)||aU.readOnly){return}aX=G.data(aU,"_change_data");aW=g(aU);if(aV.type!=="focusout"||aU.type!=="radio"){G.data(aU,"_change_data",aW)}if(aX===aF||aW===aX){return}if(aX!=null||aW){aV.type="change";return G.event.trigger(aV,arguments[1],aU)}}G.event.special.change={filters:{focusout:aT,click:function(aW){var aU=aW.target,aV=aU.type;if(aV==="radio"||aV==="checkbox"||aU.nodeName.toLowerCase()==="select"){return aT.call(this,aW)}},keydown:function(aW){var aU=aW.target,aV=aU.type;if((aW.keyCode===13&&aU.nodeName.toLowerCase()!=="textarea")||(aW.keyCode===32&&(aV==="checkbox"||aV==="radio"))||aV==="select-multiple"){return aT.call(this,aW)}},beforeactivate:function(aV){var aU=aV.target;if(aU.nodeName.toLowerCase()==="input"&&aU.type==="radio"){G.data(aU,"_change_data",g(aU))}}},setup:function(aX,aU,aW){for(var aV in aS){G.event.add(this,aV+".specialChange."+aW.guid,aS[aV])}return aM.test(this.nodeName)},remove:function(aU,aW){for(var aV in aS){G.event.remove(this,aV+".specialChange"+(aW?"."+aW.guid:""),aS[aV])}return aM.test(this.nodeName)}};var aS=G.event.special.change.filters}function C(aW,aV,aU){aU[0].type=aW;return G.event.handle.apply(aV,aU)}if(aO.addEventListener){G.each({focus:"focusin",blur:"focusout"},function(aV,aU){G.event.special[aU]={setup:function(){this.addEventListener(aV,aW,true)},teardown:function(){this.removeEventListener(aV,aW,true)}};function aW(aX){aX=G.event.fix(aX);aX.type=aU;return G.event.handle.call(this,aX)}})}G.each(["bind","one"],function(aV,aU){G.fn[aU]=function(aZ,a0,aW){if(typeof aZ==="object"){for(var aX in aZ){this[aU](aX,a0,aZ[aX],aW)}return this}if(G.isFunction(a0)){aW=a0;a0=aF}var aY=aU==="one"?G.proxy(aW,function(a1){G(this).unbind(a1,aY);return aW.apply(this,arguments)}):aW;return aZ==="unload"&&aU!=="one"?this.one(aZ,a0,aW):this.each(function(){G.event.add(this,aZ,aY,a0)})}});G.fn.extend({unbind:function(aW,aU){if(typeof aW==="object"&&!aW.preventDefault){for(var aV in aW){this.unbind(aV,aW[aV])}return this}return this.each(function(){G.event.remove(this,aW,aU)})},trigger:function(aU,aV){return this.each(function(){G.event.trigger(aU,aV,this)})},triggerHandler:function(aV,aW){if(this[0]){var aU=G.Event(aV);aU.preventDefault();aU.stopPropagation();G.event.trigger(aU,aW,this[0]);return aU.result}},toggle:function(aU){var aV=arguments,aW=1;while(aW<aV.length){G.proxy(aU,aV[aW++])}return this.click(G.proxy(aU,function(aY){var aX=(G.data(this,"lastToggle"+aU.guid)||0)%aW;G.data(this,"lastToggle"+aU.guid,aX+1);aY.preventDefault();return aV[aX].apply(this,arguments)||false}))},hover:function(aV,aU){return this.mouseenter(aV).mouseleave(aU||aV)}});G.each(["live","die"],function(aV,aU){G.fn[aU]=function(aY,a0,aW){var aX,aZ=0;if(G.isFunction(a0)){aW=a0;a0=aF}aY=(aY||"").split(/\s+/);while((aX=aY[aZ++])!=null){aX=aX==="focus"?"focusin":aX==="blur"?"focusout":aX==="hover"?aY.push("mouseleave")&&"mouseenter":aX;if(aU==="live"){G(this.context).bind(aN(aX,this.selector),{data:a0,selector:this.selector,live:aX},aW)}else{G(this.context).unbind(aN(aX,this.selector),aW?{guid:aW.guid+this.selector+aX}:null)}}return this}});function ak(aZ){var aV,a0=[],a2=[],a1=arguments,a6,a3,aY,a5,a4,aU,aW,aX,a7=G.extend({},G.data(this,"events").live);if(aZ.button&&aZ.type==="click"){return}for(a4 in a7){aY=a7[a4];if(aY.live===aZ.type||aY.altLive&&G.inArray(aZ.type,aY.altLive)>-1){aX=aY.data;if(!(aX.beforeFilter&&aX.beforeFilter[aZ.type]&&!aX.beforeFilter[aZ.type](aZ))){a2.push(aY.selector)}}else{delete a7[a4]}}a3=G(aZ.target).closest(a2,aZ.currentTarget);for(aU=0,aW=a3.length;aU<aW;aU++){for(a4 in a7){aY=a7[a4];a5=a3[aU].elem;a6=null;if(a3[aU].selector===aY.selector){if(aY.live==="mouseenter"||aY.live==="mouseleave"){a6=G(aZ.relatedTarget).closest(aY.selector)[0]}if(!a6||a6!==a5){a0.push({elem:a5,fn:aY})}}}}for(aU=0,aW=a0.length;aU<aW;aU++){a3=a0[aU];aZ.currentTarget=a3.elem;aZ.data=a3.fn.data;if(a3.fn.apply(a3.elem,a1)===false){aV=false;break}}return aV}function aN(aU,aV){return"live."+(aU?aU+".":"")+aV.replace(/\./g,"`").replace(/ /g,"&")}G.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(aV,aU){G.fn[aU]=function(aW){return aW?this.bind(aU,aW):this.trigger(aU)};if(G.attrFn){G.attrFn[aU]=true}});if(ae.attachEvent&&!ae.addEventListener){ae.attachEvent("onunload",function(){for(var aV in G.cache){if(G.cache[aV].handle){try{G.event.remove(G.cache[aV].handle.elem)}catch(aU){}}}});
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  More information: http://sizzlejs.com/
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
}(function(){var a9=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,aW=0,aX=Object.prototype.toString,a5=false,a6=true;[0,0].sort(function(){a6=false;return 0});var aV=function(bo,br,bd,be){bd=bd||[];var bp=br=br||aO;if(br.nodeType!==1&&br.nodeType!==9){return[]}if(!bo||typeof bo!=="string"){return bd}var bn=[],bj,bm,bq,bi,bg=true,bs=aY(br),bk=bo;while((a9.exec(""),bj=a9.exec(bk))!==null){bk=bj[3];bn.push(bj[1]);if(bj[2]){bi=bj[3];break}}if(bn.length>1&&a8.exec(bo)){if(bn.length===2&&a0.relative[bn[0]]){bm=a1(bn[0]+bn[1],br)}else{bm=a0.relative[bn[0]]?[br]:aV(bn.shift(),br);while(bn.length){bo=bn.shift();if(a0.relative[bo]){bo+=bn.shift()}bm=a1(bo,bm)}}}else{if(!be&&bn.length>1&&br.nodeType===9&&!bs&&a0.match.ID.test(bn[0])&&!a0.match.ID.test(bn[bn.length-1])){var bf=aV.find(bn.shift(),br,bs);br=bf.expr?aV.filter(bf.expr,bf.set)[0]:bf.set[0]}if(br){var bf=be?{expr:bn.pop(),set:a7(be)}:aV.find(bn.pop(),bn.length===1&&(bn[0]==="~"||bn[0]==="+")&&br.parentNode?br.parentNode:br,bs);bm=bf.expr?aV.filter(bf.expr,bf.set):bf.set;if(bn.length>0){bq=a7(bm)}else{bg=false}while(bn.length){var bc=bn.pop(),bl=bc;if(!a0.relative[bc]){bc=""}else{bl=bn.pop()}if(bl==null){bl=br}a0.relative[bc](bq,bl,bs)}}else{bq=bn=[]}}if(!bq){bq=bm}if(!bq){aV.error(bc||bo)}if(aX.call(bq)==="[object Array]"){if(!bg){bd.push.apply(bd,bq)}else{if(br&&br.nodeType===1){for(var bh=0;bq[bh]!=null;bh++){if(bq[bh]&&(bq[bh]===true||bq[bh].nodeType===1&&a3(br,bq[bh]))){bd.push(bm[bh])}}}else{for(var bh=0;bq[bh]!=null;bh++){if(bq[bh]&&bq[bh].nodeType===1){bd.push(bm[bh])}}}}}else{a7(bq,bd)}if(bi){aV(bi,bp,bd,be);aV.uniqueSort(bd)}return bd};aV.uniqueSort=function(bd){if(aZ){a5=a6;bd.sort(aZ);if(a5){for(var bc=1;bc<bd.length;bc++){if(bd[bc]===bd[bc-1]){bd.splice(bc--,1)}}}}return bd};aV.matches=function(bd,bc){return aV(bd,null,null,bc)};aV.find=function(bk,bj,bh){var bf,bi;if(!bk){return[]}for(var bc=0,be=a0.order.length;bc<be;bc++){var bg=a0.order[bc],bi;if((bi=a0.leftMatch[bg].exec(bk))){var bd=bi[1];bi.splice(1,1);if(bd.substr(bd.length-1)!=="\\"){bi[1]=(bi[1]||"").replace(/\\/g,"");bf=a0.find[bg](bi,bj,bh);if(bf!=null){bk=bk.replace(a0.match[bg],"");break}}}}if(!bf){bf=bj.getElementsByTagName("*")}return{set:bf,expr:bk}};aV.filter=function(be,bg,bp,bf){var bk=be,bl=[],bc=bg,bn,bq,bh=bg&&bg[0]&&aY(bg[0]);while(be&&bg.length){for(var bd in a0.filter){if((bn=a0.leftMatch[bd].exec(be))!=null&&bn[2]){var bm=a0.filter[bd],bi,bo,bs=bn[1];bq=false;bn.splice(1,1);if(bs.substr(bs.length-1)==="\\"){continue}if(bc===bl){bl=[]}if(a0.preFilter[bd]){bn=a0.preFilter[bd](bn,bc,bp,bl,bf,bh);if(!bn){bq=bi=true}else{if(bn===true){continue}}}if(bn){for(var bj=0;(bo=bc[bj])!=null;bj++){if(bo){bi=bm(bo,bn,bj,bc);var br=bf^!!bi;if(bp&&bi!=null){if(br){bq=true}else{bc[bj]=false}}else{if(br){bl.push(bo);bq=true}}}}}if(bi!==aF){if(!bp){bc=bl}be=be.replace(a0.match[bd],"");if(!bq){return[]}break}}}if(be===bk){if(bq==null){aV.error(be)}else{break}}bk=be}return bc};aV.error=function(bc){throw"Syntax error, unrecognized expression: "+bc};var a0=aV.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(bc){return bc.getAttribute("href")}},relative:{"+":function(bj,bf){var bg=typeof bf==="string",bh=bg&&!/\W/.test(bf),bd=bg&&!bh;if(bh){bf=bf.toLowerCase()}for(var bc=0,be=bj.length,bi;bc<be;bc++){if((bi=bj[bc])){while((bi=bi.previousSibling)&&bi.nodeType!==1){}bj[bc]=bd||bi&&bi.nodeName.toLowerCase()===bf?bi||false:bi===bf}}if(bd){aV.filter(bf,bj,true)}},">":function(bf,bg){var bh=typeof bg==="string";if(bh&&!/\W/.test(bg)){bg=bg.toLowerCase();for(var bd=0,bi=bf.length;bd<bi;bd++){var be=bf[bd];if(be){var bc=be.parentNode;bf[bd]=bc.nodeName.toLowerCase()===bg?bc:false}}}else{for(var bd=0,bi=bf.length;bd<bi;bd++){var be=bf[bd];if(be){bf[bd]=bh?be.parentNode:be.parentNode===bg}}if(bh){aV.filter(bg,bf,true)}}},"":function(be,bf,bh){var bd=aW++,bc=a4;if(typeof bf==="string"&&!/\W/.test(bf)){var bg=bf=bf.toLowerCase();bc=ba}bc("parentNode",bf,bd,be,bg,bh)},"~":function(be,bf,bh){var bd=aW++,bc=a4;if(typeof bf==="string"&&!/\W/.test(bf)){var bg=bf=bf.toLowerCase();bc=ba}bc("previousSibling",bf,bd,be,bg,bh)}},find:{ID:function(bd,bf,bc){if(typeof bf.getElementById!=="undefined"&&!bc){var be=bf.getElementById(bd[1]);return be?[be]:[]}},NAME:function(bc,bg){if(typeof bg.getElementsByName!=="undefined"){var bh=[],bf=bg.getElementsByName(bc[1]);for(var be=0,bd=bf.length;be<bd;be++){if(bf[be].getAttribute("name")===bc[1]){bh.push(bf[be])}}return bh.length===0?null:bh}},TAG:function(bc,bd){return bd.getElementsByTagName(bc[1])}},preFilter:{CLASS:function(bh,bj,be,bd,bf,bg){bh=" "+bh[1].replace(/\\/g,"")+" ";if(bg){return bh}for(var bc=0,bi;(bi=bj[bc])!=null;bc++){if(bi){if(bf^(bi.className&&(" "+bi.className+" ").replace(/[\t\n]/g," ").indexOf(bh)>=0)){if(!be){bd.push(bi)}}else{if(be){bj[bc]=false}}}}return false},ID:function(bc){return bc[1].replace(/\\/g,"")},TAG:function(bc,bd){return bc[1].toLowerCase()},CHILD:function(bc){if(bc[1]==="nth"){var bd=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(bc[2]==="even"&&"2n"||bc[2]==="odd"&&"2n+1"||!/\D/.test(bc[2])&&"0n+"+bc[2]||bc[2]);bc[2]=(bd[1]+(bd[2]||1))-0;bc[3]=bd[3]-0}bc[0]=aW++;return bc},ATTR:function(bf,bg,bi,be,bd,bc){var bh=bf[1].replace(/\\/g,"");if(!bc&&a0.attrMap[bh]){bf[1]=a0.attrMap[bh]}if(bf[2]==="~="){bf[4]=" "+bf[4]+" "}return bf},PSEUDO:function(be,bf,bg,bd,bc){if(be[1]==="not"){if((a9.exec(be[3])||"").length>1||/^\w/.test(be[3])){be[3]=aV(be[3],null,null,bf)}else{var bh=aV.filter(be[3],bf,bg,true^bc);if(!bg){bd.push.apply(bd,bh)}return false}}else{if(a0.match.POS.test(be[0])||a0.match.CHILD.test(be[0])){return true}}return be},POS:function(bc){bc.unshift(true);return bc}},filters:{enabled:function(bc){return bc.disabled===false&&bc.type!=="hidden"},disabled:function(bc){return bc.disabled===true},checked:function(bc){return bc.checked===true},selected:function(bc){bc.parentNode.selectedIndex;return bc.selected===true},parent:function(bc){return !!bc.firstChild},empty:function(bc){return !bc.firstChild},has:function(bd,be,bc){return !!aV(bc[3],bd).length},header:function(bc){return/h\d/i.test(bc.nodeName)},text:function(bc){return"text"===bc.type},radio:function(bc){return"radio"===bc.type},checkbox:function(bc){return"checkbox"===bc.type},file:function(bc){return"file"===bc.type},password:function(bc){return"password"===bc.type},submit:function(bc){return"submit"===bc.type},image:function(bc){return"image"===bc.type},reset:function(bc){return"reset"===bc.type},button:function(bc){return"button"===bc.type||bc.nodeName.toLowerCase()==="button"},input:function(bc){return/input|select|textarea|button/i.test(bc.nodeName)}},setFilters:{first:function(bc,bd){return bd===0},last:function(bd,be,bc,bf){return be===bf.length-1},even:function(bc,bd){return bd%2===0},odd:function(bc,bd){return bd%2===1},lt:function(bd,be,bc){return be<bc[3]-0},gt:function(bd,be,bc){return be>bc[3]-0},nth:function(bd,be,bc){return bc[3]-0===be},eq:function(bd,be,bc){return bc[3]-0===be}},filter:{PSEUDO:function(bi,bh,bc,bg){var bf=bh[1],bd=a0.filters[bf];if(bd){return bd(bi,bc,bh,bg)}else{if(bf==="contains"){return(bi.textContent||bi.innerText||bb([bi])||"").indexOf(bh[3])>=0}else{if(bf==="not"){var be=bh[3];for(var bc=0,bj=be.length;bc<bj;bc++){if(be[bc]===bi){return false}}return true}else{aV.error("Syntax error, unrecognized expression: "+bf)}}}},CHILD:function(bj,bh){var bd=bh[1],bc=bj;switch(bd){case"only":case"first":while((bc=bc.previousSibling)){if(bc.nodeType===1){return false}}if(bd==="first"){return true}bc=bj;case"last":while((bc=bc.nextSibling)){if(bc.nodeType===1){return false}}return true;case"nth":var bl=bh[2],bi=bh[3];if(bl===1&&bi===0){return true}var bg=bh[0],bf=bj.parentNode;if(bf&&(bf.sizcache!==bg||!bj.nodeIndex)){var bk=0;for(bc=bf.firstChild;bc;bc=bc.nextSibling){if(bc.nodeType===1){bc.nodeIndex=++bk}}bf.sizcache=bg}var be=bj.nodeIndex-bi;if(bl===0){return be===0}else{return(be%bl===0&&be/bl>=0)}}},ID:function(bd,bc){return bd.nodeType===1&&bd.getAttribute("id")===bc},TAG:function(bd,bc){return(bc==="*"&&bd.nodeType===1)||bd.nodeName.toLowerCase()===bc},CLASS:function(bd,bc){return(" "+(bd.className||bd.getAttribute("class"))+" ").indexOf(bc)>-1},ATTR:function(be,bc){var bh=bc[1],bd=a0.attrHandle[bh]?a0.attrHandle[bh](be):be[bh]!=null?be[bh]:be.getAttribute(bh),bi=bd+"",bf=bc[2],bg=bc[4];return bd==null?bf==="!=":bf==="="?bi===bg:bf==="*="?bi.indexOf(bg)>=0:bf==="~="?(" "+bi+" ").indexOf(bg)>=0:!bg?bi&&bd!==false:bf==="!="?bi!==bg:bf==="^="?bi.indexOf(bg)===0:bf==="$="?bi.substr(bi.length-bg.length)===bg:bf==="|="?bi===bg||bi.substr(0,bg.length+1)===bg+"-":false},POS:function(be,bc,bf,bh){var bd=bc[2],bg=a0.setFilters[bd];if(bg){return bg(be,bf,bc,bh)}}}};var a8=a0.match.POS;for(var aU in a0.match){a0.match[aU]=new RegExp(a0.match[aU].source+/(?![^\[]*\])(?![^\(]*\))/.source);a0.leftMatch[aU]=new RegExp(/(^(?:.|\r|\n)*?)/.source+a0.match[aU].source.replace(/\\(\d+)/g,function(bc,bd){return"\\"+(bd-0+1)}))}var a7=function(bd,bc){bd=Array.prototype.slice.call(bd,0);if(bc){bc.push.apply(bc,bd);return bc}return bd};try{Array.prototype.slice.call(aO.documentElement.childNodes,0)}catch(a2){a7=function(bf,be){var bg=be||[];if(aX.call(bf)==="[object Array]"){Array.prototype.push.apply(bg,bf)}else{if(typeof bf.length==="number"){for(var bd=0,bc=bf.length;bd<bc;bd++){bg.push(bf[bd])}}else{for(var bd=0;bf[bd];bd++){bg.push(bf[bd])}}}return bg}}var aZ;if(aO.documentElement.compareDocumentPosition){aZ=function(bc,bd){if(!bc.compareDocumentPosition||!bd.compareDocumentPosition){if(bc==bd){a5=true}return bc.compareDocumentPosition?-1:1}var be=bc.compareDocumentPosition(bd)&4?-1:bc===bd?0:1;if(be===0){a5=true}return be}}else{if("sourceIndex" in aO.documentElement){aZ=function(bc,bd){if(!bc.sourceIndex||!bd.sourceIndex){if(bc==bd){a5=true}return bc.sourceIndex?-1:1}var be=bc.sourceIndex-bd.sourceIndex;if(be===0){a5=true}return be}}else{if(aO.createRange){aZ=function(bd,be){if(!bd.ownerDocument||!be.ownerDocument){if(bd==be){a5=true}return bd.ownerDocument?-1:1}var bf=bd.ownerDocument.createRange(),bc=be.ownerDocument.createRange();bf.setStart(bd,0);bf.setEnd(bd,0);bc.setStart(be,0);bc.setEnd(be,0);var bg=bf.compareBoundaryPoints(Range.START_TO_END,bc);if(bg===0){a5=true}return bg}}}}function bb(bf){var bd="",bc;for(var be=0;bf[be];be++){bc=bf[be];if(bc.nodeType===3||bc.nodeType===4){bd+=bc.nodeValue}else{if(bc.nodeType!==8){bd+=bb(bc.childNodes)}}}return bd}(function(){var bd=aO.createElement("div"),be="script"+(new Date).getTime();bd.innerHTML="<a name='"+be+"'/>";var bc=aO.documentElement;bc.insertBefore(bd,bc.firstChild);if(aO.getElementById(be)){a0.find.ID=function(bg,bi,bf){if(typeof bi.getElementById!=="undefined"&&!bf){var bh=bi.getElementById(bg[1]);return bh?bh.id===bg[1]||typeof bh.getAttributeNode!=="undefined"&&bh.getAttributeNode("id").nodeValue===bg[1]?[bh]:aF:[]}};a0.filter.ID=function(bg,bf){var bh=typeof bg.getAttributeNode!=="undefined"&&bg.getAttributeNode("id");return bg.nodeType===1&&bh&&bh.nodeValue===bf}}bc.removeChild(bd);bc=bd=null})();(function(){var bc=aO.createElement("div");bc.appendChild(aO.createComment(""));if(bc.getElementsByTagName("*").length>0){a0.find.TAG=function(be,bh){var bg=bh.getElementsByTagName(be[1]);if(be[1]==="*"){var bf=[];for(var bd=0;bg[bd];bd++){if(bg[bd].nodeType===1){bf.push(bg[bd])}}bg=bf}return bg}}bc.innerHTML="<a href='#'></a>";if(bc.firstChild&&typeof bc.firstChild.getAttribute!=="undefined"&&bc.firstChild.getAttribute("href")!=="#"){a0.attrHandle.href=function(bd){return bd.getAttribute("href",2)}}bc=null})();if(aO.querySelectorAll){(function(){var bc=aV,bd=aO.createElement("div");bd.innerHTML="<p class='TEST'></p>";if(bd.querySelectorAll&&bd.querySelectorAll(".TEST").length===0){return}aV=function(bh,bf,bj,bg){bf=bf||aO;if(!bg&&bf.nodeType===9&&!aY(bf)){try{return a7(bf.querySelectorAll(bh),bj)}catch(bi){}}return bc(bh,bf,bj,bg)};for(var be in bc){aV[be]=bc[be]}bd=null})()}(function(){var bc=aO.createElement("div");bc.innerHTML="<div class='test e'></div><div class='test'></div>";if(!bc.getElementsByClassName||bc.getElementsByClassName("e").length===0){return}bc.lastChild.className="e";if(bc.getElementsByClassName("e").length===1){return}a0.order.splice(1,0,"CLASS");a0.find.CLASS=function(be,bf,bd){if(typeof bf.getElementsByClassName!=="undefined"&&!bd){return bf.getElementsByClassName(be[1])}};bc=null})();function ba(be,bg,bi,bl,bj,bh){for(var bc=0,bd=bl.length;bc<bd;bc++){var bk=bl[bc];if(bk){bk=bk[be];var bf=false;while(bk){if(bk.sizcache===bi){bf=bl[bk.sizset];break}if(bk.nodeType===1&&!bh){bk.sizcache=bi;bk.sizset=bc}if(bk.nodeName.toLowerCase()===bg){bf=bk;break}bk=bk[be]}bl[bc]=bf}}}function a4(be,bg,bi,bl,bj,bh){for(var bc=0,bd=bl.length;bc<bd;bc++){var bk=bl[bc];if(bk){bk=bk[be];var bf=false;while(bk){if(bk.sizcache===bi){bf=bl[bk.sizset];break}if(bk.nodeType===1){if(!bh){bk.sizcache=bi;bk.sizset=bc}if(typeof bg!=="string"){if(bk===bg){bf=true;break}}else{if(aV.filter(bg,[bk]).length>0){bf=bk;break}}}bk=bk[be]}bl[bc]=bf}}}var a3=aO.compareDocumentPosition?function(bc,bd){return bc.compareDocumentPosition(bd)&16}:function(bc,bd){return bc!==bd&&(bc.contains?bc.contains(bd):true)};var aY=function(bd){var bc=(bd?bd.ownerDocument||bd:0).documentElement;return bc?bc.nodeName!=="HTML":false};var a1=function(bg,bj){var bf=[],bh="",bi,bd=bj.nodeType?[bj]:bj;while((bi=a0.match.PSEUDO.exec(bg))){bh+=bi[0];bg=bg.replace(a0.match.PSEUDO,"")}bg=a0.relative[bg]?bg+"*":bg;for(var bc=0,be=bd.length;bc<be;bc++){aV(bg,bd[bc],bf)}return aV.filter(bh,bf)};G.find=aV;G.expr=aV.selectors;G.expr[":"]=G.expr.filters;G.unique=aV.uniqueSort;G.getText=bb;G.isXMLDoc=aY;G.contains=a3;return;ae.Sizzle=aV})();var af=/Until$/,l=/^(?:parents|prevUntil|prevAll)/,aB=/,/,T=Array.prototype.slice;var E=function(aV,aW,aX){if(G.isFunction(aW)){return G.grep(aV,function(aY,aZ){return !!aW.call(aY,aZ,aY)===aX})}else{if(aW.nodeType){return G.grep(aV,function(aY,aZ){return(aY===aW)===aX})}else{if(typeof aW==="string"){var aU=G.grep(aV,function(aY){return aY.nodeType===1});if(aH.test(aW)){return G.filter(aW,aU,!aX)}else{aW=G.filter(aW,aU)}}}}return G.grep(aV,function(aY,aZ){return(G.inArray(aY,aW)>=0)===aX})};G.fn.extend({find:function(aX){var a0=this.pushStack("","find",aX),aZ=0;for(var aY=0,aW=this.length;aY<aW;aY++){aZ=a0.length;G.find(aX,this[aY],a0);if(aY>0){for(var aV=aZ;aV<a0.length;aV++){for(var aU=0;aU<aZ;aU++){if(a0[aU]===a0[aV]){a0.splice(aV--,1);break}}}}}return a0},has:function(aV){var aU=G(aV);return this.filter(function(){for(var aW=0,aX=aU.length;aW<aX;aW++){if(G.contains(this,aU[aW])){return true}}})},not:function(aU){return this.pushStack(E(this,aU,false),"not",aU)},filter:function(aU){return this.pushStack(E(this,aU,true),"filter",aU)},is:function(aU){return !!aU&&G.filter(aU,this).length>0},closest:function(a0,a2){if(G.isArray(a0)){var aV=[],aZ=this[0],a1,aU={},aW;if(aZ&&a0.length){for(var aX=0,a3=a0.length;aX<a3;aX++){aW=a0[aX];if(!aU[aW]){aU[aW]=G.expr.match.POS.test(aW)?G(aW,a2||this.context):aW}}while(aZ&&aZ.ownerDocument&&aZ!==a2){for(aW in aU){a1=aU[aW];if(a1.jquery?a1.index(aZ)>-1:G(aZ).is(a1)){aV.push({selector:aW,elem:aZ});delete aU[aW]}}aZ=aZ.parentNode}}return aV}var aY=G.expr.match.POS.test(a0)?G(a0,a2||this.context):null;return this.map(function(a4,a5){while(a5&&a5.ownerDocument&&a5!==a2){if(aY?aY.index(a5)>-1:G(a5).is(a0)){return a5}a5=a5.parentNode}return null})},index:function(aU){if(!aU||typeof aU==="string"){return G.inArray(this[0],aU?G(aU):this.parent().children())}return G.inArray(aU.jquery?aU[0]:aU,this)},add:function(aW,aV){var aU=typeof aW==="string"?G(aW,aV||this.context):G.makeArray(aW),aX=G.merge(this.get(),aU);return this.pushStack(ay(aU[0])||ay(aX[0])?aX:G.unique(aX))},andSelf:function(){return this.add(this.prevObject)}});function ay(aU){return !aU||!aU.parentNode||aU.parentNode.nodeType===11}G.each({parent:function(aV){var aU=aV.parentNode;return aU&&aU.nodeType!==11?aU:null},parents:function(aU){return G.dir(aU,"parentNode")},parentsUntil:function(aV,aW,aU){return G.dir(aV,"parentNode",aU)},next:function(aU){return G.nth(aU,2,"nextSibling")},prev:function(aU){return G.nth(aU,2,"previousSibling")},nextAll:function(aU){return G.dir(aU,"nextSibling")},prevAll:function(aU){return G.dir(aU,"previousSibling")},nextUntil:function(aV,aW,aU){return G.dir(aV,"nextSibling",aU)},prevUntil:function(aV,aW,aU){return G.dir(aV,"previousSibling",aU)},siblings:function(aU){return G.sibling(aU.parentNode.firstChild,aU)},children:function(aU){return G.sibling(aU.firstChild)},contents:function(aU){return G.nodeName(aU,"iframe")?aU.contentDocument||aU.contentWindow.document:G.makeArray(aU.childNodes)}},function(aV,aU){G.fn[aV]=function(aW,aX){var aY=G.map(this,aU,aW);if(!af.test(aV)){aX=aW}if(aX&&typeof aX==="string"){aY=G.filter(aX,aY)}aY=this.length>1?G.unique(aY):aY;if((this.length>1||aB.test(aX))&&l.test(aV)){aY=aY.reverse()}return this.pushStack(aY,aV,T.call(arguments).join(","))}});G.extend({filter:function(aV,aW,aU){if(aU){aV=":not("+aV+")"}return G.find.matches(aV,aW)},dir:function(aW,aU,aV){var aX=[],aY=aW[aU];while(aY&&aY.nodeType!==9&&(aV===aF||aY.nodeType!==1||!G(aY).is(aV))){if(aY.nodeType===1){aX.push(aY)}aY=aY[aU]}return aX},nth:function(aX,aV,aU,aW){aV=aV||1;var aY=0;for(;aX;aX=aX[aU]){if(aX.nodeType===1&&++aY===aV){break}}return aX},sibling:function(aV,aW){var aU=[];for(;aV;aV=aV.nextSibling){if(aV.nodeType===1&&aV!==aW){aU.push(aV)}}return aU}});var aq=/ jQuery\d+="(?:\d+|null)"/g,az=/^\s+/,S=/(<([\w:]+)[^>]*?)\/>/g,N=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,al=/<([\w:]+)/,h=/<tbody/i,i=/<|&\w+;/,Y=/checked\s*(?:[^=]|=\s*.checked.)/i,B=function(aV,aW,aU){return N.test(aU)?aV:aW+"></"+aU+">"},X={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,"",""]};X.optgroup=X.option;X.tbody=X.tfoot=X.colgroup=X.caption=X.thead;X.th=X.td;if(!G.support.htmlSerialize){X._default=[1,"div<div>","</div>"]}G.fn.extend({text:function(aU){if(G.isFunction(aU)){return this.each(function(aW){var aV=G(this);aV.text(aU.call(this,aW,aV.text()))})}if(typeof aU!=="object"&&aU!==aF){return this.empty().append((this[0]&&this[0].ownerDocument||aO).createTextNode(aU))}return G.getText(this)},wrapAll:function(aU){if(G.isFunction(aU)){return this.each(function(aW){G(this).wrapAll(aU.call(this,aW))})}if(this[0]){var aV=G(aU,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){aV.insertBefore(this[0])}aV.map(function(){var aW=this;while(aW.firstChild&&aW.firstChild.nodeType===1){aW=aW.firstChild}return aW}).append(this)}return this},wrapInner:function(aU){if(G.isFunction(aU)){return this.each(function(aV){G(this).wrapInner(aU.call(this,aV))})}return this.each(function(){var aV=G(this),aW=aV.contents();if(aW.length){aW.wrapAll(aU)}else{aV.append(aU)}})},wrap:function(aU){return this.each(function(){G(this).wrapAll(aU)})},unwrap:function(){return this.parent().each(function(){if(!G.nodeName(this,"body")){G(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(aU){if(this.nodeType===1){this.appendChild(aU)}})},prepend:function(){return this.domManip(arguments,true,function(aU){if(this.nodeType===1){this.insertBefore(aU,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aV){this.parentNode.insertBefore(aV,this)})}else{if(arguments.length){var aU=G(arguments[0]);aU.push.apply(aU,this.toArray());return this.pushStack(aU,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aV){this.parentNode.insertBefore(aV,this.nextSibling)})}else{if(arguments.length){var aU=this.pushStack(this,"after",arguments);aU.push.apply(aU,G(arguments[0]).toArray());return aU}}},clone:function(aU){var aV=this.map(function(){if(!G.support.noCloneEvent&&!G.isXMLDoc(this)){var aY=this.outerHTML,aX=this.ownerDocument;if(!aY){var aW=aX.createElement("div");aW.appendChild(this.cloneNode(true));aY=aW.innerHTML}return G.clean([aY.replace(aq,"").replace(az,"")],aX)[0]}else{return this.cloneNode(true)}});if(aU===true){D(this,aV);D(this.find("*"),aV.find("*"))}return aV},html:function(aU){if(aU===aF){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(aq,""):null}else{if(typeof aU==="string"&&!/<script/i.test(aU)&&(G.support.leadingWhitespace||!az.test(aU))&&!X[(al.exec(aU)||["",""])[1].toLowerCase()]){aU=aU.replace(S,B);try{for(var aV=0,aX=this.length;aV<aX;aV++){if(this[aV].nodeType===1){G.cleanData(this[aV].getElementsByTagName("*"));this[aV].innerHTML=aU}}}catch(aW){this.empty().append(aU)}}else{if(G.isFunction(aU)){this.each(function(a0){var aZ=G(this),aY=aZ.html();aZ.empty().append(function(){return aU.call(this,a0,aY)})})}else{this.empty().append(aU)}}}return this},replaceWith:function(aU){if(this[0]&&this[0].parentNode){if(!G.isFunction(aU)){aU=G(aU).detach()}else{return this.each(function(aX){var aW=G(this),aV=aW.html();aW.replaceWith(aU.call(this,aX,aV))})}return this.each(function(){var aW=this.nextSibling,aV=this.parentNode;G(this).remove();if(aW){G(aW).before(aU)}else{G(aV).append(aU)}})}else{return this.pushStack(G(G.isFunction(aU)?aU():aU),"replaceWith",aU)}},detach:function(aU){return this.remove(aU,true)},domManip:function(a0,aU,a3){var aZ,a1,aX=a0[0],aY=[];if(!G.support.checkClone&&arguments.length===3&&typeof aX==="string"&&Y.test(aX)){return this.each(function(){G(this).domManip(a0,aU,a3,true)})}if(G.isFunction(aX)){return this.each(function(a5){var a4=G(this);a0[0]=aX.call(this,a5,aU?a4.html():aF);a4.domManip(a0,aU,a3)})}if(this[0]){if(a0[0]&&a0[0].parentNode&&a0[0].parentNode.nodeType===11){aZ={fragment:a0[0].parentNode}}else{aZ=d(a0,this,aY)}a1=aZ.fragment.firstChild;if(a1){aU=aU&&G.nodeName(a1,"tr");for(var a2=0,aW=this.length;a2<aW;a2++){a3.call(aU?aV(this[a2],a1):this[a2],aZ.cacheable||this.length>1||a2>0?aZ.fragment.cloneNode(true):aZ.fragment)}}if(aY){G.each(aY,F)}}return this;function aV(a4,a5){return G.nodeName(a4,"table")?(a4.getElementsByTagName("tbody")[0]||a4.appendChild(a4.ownerDocument.createElement("tbody"))):a4}}});function D(aU,aW){var aV=0;aW.each(function(){if(this.nodeName!==(aU[aV]&&aU[aV].nodeName)){return}var aX=G.data(aU[aV++]),a1=G.data(this,aX),aZ=aX&&aX.events;if(aZ){delete a1.handle;a1.events={};for(var a0 in aZ){for(var aY in aZ[a0]){G.event.add(this,a0,aZ[a0][aY],aZ[a0][aY].data)}}}})}function d(aV,aX,aY){var a0,aU,aW,aZ;if(aV.length===1&&typeof aV[0]==="string"&&aV[0].length<512&&aV[0].indexOf("<option")<0&&(G.support.checkClone||!Y.test(aV[0]))){aU=true;aW=G.fragments[aV[0]];if(aW){if(aW!==1){a0=aW}}}if(!a0){aZ=(aX&&aX[0]?aX[0].ownerDocument||aX[0]:aO);a0=aZ.createDocumentFragment();G.clean(aV,aZ,a0,aY)}if(aU){G.fragments[aV[0]]=aW?a0:1}return{fragment:a0,cacheable:aU}}G.fragments={};G.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(aV,aU){G.fn[aV]=function(aY){var a1=[],aX=G(aY);for(var aZ=0,aW=aX.length;aZ<aW;aZ++){var a0=(aZ>0?this.clone(true):this).get();G.fn[aU].apply(G(aX[aZ]),a0);a1=a1.concat(a0)}return this.pushStack(a1,aV,aX.selector)}});G.each({remove:function(aV,aU){if(!aV||G.filter(aV,[this]).length){if(!aU&&this.nodeType===1){G.cleanData(this.getElementsByTagName("*"));G.cleanData([this])}if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){if(this.nodeType===1){G.cleanData(this.getElementsByTagName("*"))}while(this.firstChild){this.removeChild(this.firstChild)}}},function(aV,aU){G.fn[aV]=function(){return this.each(aU,arguments)}});G.extend({clean:function(aZ,aU,aY,aV){aU=aU||aO;if(typeof aU.createElement==="undefined"){aU=aU.ownerDocument||aU[0]&&aU[0].ownerDocument||aO}var aW=[];G.each(aZ,function(a0,a7){if(typeof a7==="number"){a7+=""}if(!a7){return}if(typeof a7==="string"&&!i.test(a7)){a7=aU.createTextNode(a7)}else{if(typeof a7==="string"){a7=a7.replace(S,B);var a6=(al.exec(a7)||["",""])[1].toLowerCase(),a3=X[a6]||X._default,a2=a3[0],a4=aU.createElement("div");a4.innerHTML=a3[1]+a7+a3[2];while(a2--){a4=a4.lastChild}if(!G.support.tbody){var a8=h.test(a7),a5=a6==="table"&&!a8?a4.firstChild&&a4.firstChild.childNodes:a3[1]==="<table>"&&!a8?a4.childNodes:[];for(var a1=a5.length-1;a1>=0;--a1){if(G.nodeName(a5[a1],"tbody")&&!a5[a1].childNodes.length){a5[a1].parentNode.removeChild(a5[a1])}}}if(!G.support.leadingWhitespace&&az.test(a7)){a4.insertBefore(aU.createTextNode(az.exec(a7)[0]),a4.firstChild)}a7=G.makeArray(a4.childNodes)}}if(a7.nodeType){aW.push(a7)}else{aW=G.merge(aW,a7)}});if(aY){for(var aX=0;aW[aX];aX++){if(aV&&G.nodeName(aW[aX],"script")&&(!aW[aX].type||aW[aX].type.toLowerCase()==="text/javascript")){aV.push(aW[aX].parentNode?aW[aX].parentNode.removeChild(aW[aX]):aW[aX])}else{if(aW[aX].nodeType===1){aW.splice.apply(aW,[aX+1,0].concat(G.makeArray(aW[aX].getElementsByTagName("script"))))}aY.appendChild(aW[aX])}}}return aW},cleanData:function(aX){for(var aV=0,aU,aW;(aU=aX[aV])!=null;aV++){G.event.remove(aU);G.removeData(aU)}}});var n=/z-?index|font-?weight|opacity|zoom|line-?height/i,aL=/alpha\([^)]*\)/,b=/opacity=([^)]*)/,v=/float/i,aj=/-([a-z])/ig,ai=/([A-Z])/g,K=/^-?\d+(?:px)?$/i,s=/^-?\d/,aJ={position:"absolute",visibility:"hidden",display:"block"},an=["Left","Right"],k=["Top","Bottom"],t=aO.defaultView&&aO.defaultView.getComputedStyle,Q=G.support.cssFloat?"cssFloat":"styleFloat",p=function(aV,aU){return aU.toUpperCase()};G.fn.css=function(aU,aV){return J(this,aU,aV,true,function(aX,aW,aY){if(aY===aF){return G.curCSS(aX,aW)}if(typeof aY==="number"&&!n.test(aW)){aY+="px"}G.style(aX,aW,aY)})};G.extend({style:function(aX,aV,a0){if(!aX||aX.nodeType===3||aX.nodeType===8){return aF}if((aV==="width"||aV==="height")&&parseFloat(a0)<0){a0=aF}var aW=aX.style||aX,aU=a0!==aF;if(!G.support.opacity&&aV==="opacity"){if(aU){aW.zoom=1;var aY=parseInt(a0,10)+""==="NaN"?"":"alpha(opacity="+a0*100+")";var aZ=aW.filter||G.curCSS(aX,"filter")||"";aW.filter=aL.test(aZ)?aZ.replace(aL,aY):aY}return aW.filter&&aW.filter.indexOf("opacity=")>=0?(parseFloat(b.exec(aW.filter)[1])/100)+"":""}if(v.test(aV)){aV=Q}aV=aV.replace(aj,p);if(aU){aW[aV]=a0}return aW[aV]},css:function(aZ,aY,a1,a0){if(aY==="width"||aY==="height"){var aX,aW=aJ,aV=aY==="width"?an:k;function aU(){aX=aY==="width"?aZ.offsetWidth:aZ.offsetHeight;if(a0==="border"){return}G.each(aV,function(){if(!a0){aX-=parseFloat(G.curCSS(aZ,"padding"+this,true))||0}if(a0==="margin"){aX+=parseFloat(G.curCSS(aZ,"margin"+this,true))||0}else{aX-=parseFloat(G.curCSS(aZ,"border"+this+"Width",true))||0}})}if(aZ.offsetWidth!==0){aU()}else{G.swap(aZ,aW,aU)}return Math.max(0,Math.round(aX))}return G.curCSS(aZ,aY,a1)},curCSS:function(a2,aX,a4){var aU,a3=a2.style,aW;if(!G.support.opacity&&aX==="opacity"&&a2.currentStyle){aU=b.test(a2.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return aU===""?"1":aU}if(v.test(aX)){aX=Q}if(!a4&&a3&&a3[aX]){aU=a3[aX]}else{if(t){if(v.test(aX)){aX="float"}aX=aX.replace(ai,"-$1").toLowerCase();var aZ=a2.ownerDocument.defaultView;if(!aZ){return null}var a1=aZ.getComputedStyle(a2,null);if(a1){aU=a1.getPropertyValue(aX)}if(aX==="opacity"&&aU===""){aU="1"}}else{if(a2.currentStyle){var aY=aX.replace(aj,p);aU=a2.currentStyle[aX]||a2.currentStyle[aY];if(!K.test(aU)&&s.test(aU)){var aV=a3.left,a0=a2.runtimeStyle.left;a2.runtimeStyle.left=a2.currentStyle.left;a3.left=aY==="fontSize"?"1em":(aU||0);aU=a3.pixelLeft+"px";a3.left=aV;a2.runtimeStyle.left=a0}}}}return aU},swap:function(aW,aX,aY){var aU={};for(var aV in aX){aU[aV]=aW.style[aV];aW.style[aV]=aX[aV]}aY.call(aW);for(var aV in aX){aW.style[aV]=aU[aV]}}});if(G.expr&&G.expr.filters){G.expr.filters.hidden=function(aW){var aV=aW.offsetWidth,aU=aW.offsetHeight,aX=aW.nodeName.toLowerCase()==="tr";return aV===0&&aU===0&&!aX?true:aV>0&&aU>0&&!aX?false:G.curCSS(aW,"display")==="none"};G.expr.filters.visible=function(aU){return !G.expr.filters.hidden(aU)}}var H=x(),q=/<script(.|\s)*?\/script>/gi,e=/select|textarea/i,at=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,aQ=/=\?(&|$)/,au=/\?/,V=/(\?|&)_=.*?(&|$)/,m=/^(\w+:)?\/\/([^\/?#]+)/,r=/%20/g;G.fn.extend({_load:G.fn.load,load:function(aX,aU,a0){if(typeof aX!=="string"){return this._load(aX)}else{if(!this.length){return this}}var aV=aX.indexOf(" ");if(aV>=0){var aY=aX.slice(aV,aX.length);aX=aX.slice(0,aV)}var aW="GET";if(aU){if(G.isFunction(aU)){a0=aU;aU=null}else{if(typeof aU==="object"){aU=G.param(aU,G.ajaxSettings.traditional);aW="POST"}}}var aZ=this;G.ajax({url:aX,type:aW,dataType:"html",data:aU,complete:function(a2,a1){if(a1==="success"||a1==="notmodified"){aZ.html(aY?G("<div />").append(a2.responseText.replace(q,"")).find(aY):a2.responseText)}if(a0){aZ.each(a0,[a2.responseText,a1,a2])}}});return this},serialize:function(){return G.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?G.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||e.test(this.nodeName)||at.test(this.type))}).map(function(aV,aU){var aW=G(this).val();return aW==null?null:G.isArray(aW)?G.map(aW,function(aY,aX){return{name:aU.name,value:aY}}):{name:aU.name,value:aW}}).get()}});G.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(aV,aU){G.fn[aU]=function(aW){return this.bind(aU,aW)}});G.extend({get:function(aW,aX,aU,aV){if(G.isFunction(aX)){aV=aV||aU;aU=aX;aX=null}return G.ajax({type:"GET",url:aW,data:aX,success:aU,dataType:aV})},getScript:function(aU,aV){return G.get(aU,null,aV,"script")},getJSON:function(aV,aW,aU){return G.get(aV,aW,aU,"json")},post:function(aW,aX,aU,aV){if(G.isFunction(aX)){aV=aV||aU;aU=aX;aX={}}return G.ajax({type:"POST",url:aW,data:aX,success:aU,dataType:aV})},ajaxSetup:function(aU){G.extend(G.ajaxSettings,aU)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:ae.XMLHttpRequest&&(ae.location.protocol!=="file:"||!ae.ActiveXObject)?function(){return new ae.XMLHttpRequest()}:function(){try{return new ae.ActiveXObject("Microsoft.XMLHTTP")}catch(aU){}},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(a3){var aZ=G.extend(true,{},G.ajaxSettings,a3);var aV,a1,a2,bd=a3&&a3.context||aZ,aW=aZ.type.toUpperCase();if(aZ.data&&aZ.processData&&typeof aZ.data!=="string"){aZ.data=G.param(aZ.data,aZ.traditional)}if(aZ.dataType==="jsonp"){if(aW==="GET"){if(!aQ.test(aZ.url)){aZ.url+=(au.test(aZ.url)?"&":"?")+(aZ.jsonp||"callback")+"=?"}}else{if(!aZ.data||!aQ.test(aZ.data)){aZ.data=(aZ.data?aZ.data+"&":"")+(aZ.jsonp||"callback")+"=?"}}aZ.dataType="json"}if(aZ.dataType==="json"&&(aZ.data&&aQ.test(aZ.data)||aQ.test(aZ.url))){aV=aZ.jsonpCallback||("jsonp"+H++);if(aZ.data){aZ.data=(aZ.data+"").replace(aQ,"="+aV+"$1")}aZ.url=aZ.url.replace(aQ,"="+aV+"$1");aZ.dataType="script";ae[aV]=ae[aV]||function(bg){a2=bg;a4();a9();ae[aV]=aF;try{delete ae[aV]}catch(bh){}if(bf){bf.removeChild(bc)}}}if(aZ.dataType==="script"&&aZ.cache===null){aZ.cache=false}if(aZ.cache===false&&aW==="GET"){var aU=x();var aY=aZ.url.replace(V,"$1_="+aU+"$2");aZ.url=aY+((aY===aZ.url)?(au.test(aZ.url)?"&":"?")+"_="+aU:"")}if(aZ.data&&aW==="GET"){aZ.url+=(au.test(aZ.url)?"&":"?")+aZ.data}if(aZ.global&&!G.active++){G.event.trigger("ajaxStart")}var be=m.exec(aZ.url),a0=be&&(be[1]&&be[1]!==location.protocol||be[2]!==location.host);if(aZ.dataType==="script"&&aW==="GET"&&a0){var bf=aO.getElementsByTagName("head")[0]||aO.documentElement;var bc=aO.createElement("script");bc.src=aZ.url;if(aZ.scriptCharset){bc.charset=aZ.scriptCharset}if(!aV){var aX=false;bc.onload=bc.onreadystatechange=function(){if(!aX&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){aX=true;a4();a9();bc.onload=bc.onreadystatechange=null;if(bf&&bc.parentNode){bf.removeChild(bc)}}}}bf.insertBefore(bc,bf.firstChild);return aF}var ba=false;var a6=aZ.xhr();if(!a6){return}if(aZ.username){a6.open(aW,aZ.url,aZ.async,aZ.username,aZ.password)}else{a6.open(aW,aZ.url,aZ.async)}try{if(aZ.data||a3&&a3.contentType){a6.setRequestHeader("Content-Type",aZ.contentType)}if(aZ.ifModified){if(G.lastModified[aZ.url]){a6.setRequestHeader("If-Modified-Since",G.lastModified[aZ.url])}if(G.etag[aZ.url]){a6.setRequestHeader("If-None-Match",G.etag[aZ.url])}}if(!a0){a6.setRequestHeader("X-Requested-With","XMLHttpRequest")}a6.setRequestHeader("Accept",aZ.dataType&&aZ.accepts[aZ.dataType]?aZ.accepts[aZ.dataType]+", */*":aZ.accepts._default)}catch(a5){}if(aZ.beforeSend&&aZ.beforeSend.call(bd,a6,aZ)===false){if(aZ.global&&!--G.active){G.event.trigger("ajaxStop")}a6.abort();return false}if(aZ.global){a7("ajaxSend",[a6,aZ])}var a8=a6.onreadystatechange=function(bg){if(!a6||a6.readyState===0||bg==="abort"){if(!ba){a9()}ba=true;if(a6){a6.onreadystatechange=G.noop}}else{if(!ba&&a6&&(a6.readyState===4||bg==="timeout")){ba=true;a6.onreadystatechange=G.noop;a1=bg==="timeout"?"timeout":!G.httpSuccess(a6)?"error":aZ.ifModified&&G.httpNotModified(a6,aZ.url)?"notmodified":"success";var bi;if(a1==="success"){try{a2=G.httpData(a6,aZ.dataType,aZ)}catch(bh){a1="parsererror";bi=bh}}if(a1==="success"||a1==="notmodified"){if(!aV){a4()}}else{G.handleError(aZ,a6,a1,bi)}a9();if(bg==="timeout"){a6.abort()}if(aZ.async){a6=null}}}};try{var bb=a6.abort;a6.abort=function(){if(a6){bb.call(a6)}a8("abort")}}catch(a5){}if(aZ.async&&aZ.timeout>0){setTimeout(function(){if(a6&&!ba){a8("timeout")}},aZ.timeout)}try{a6.send(aW==="POST"||aW==="PUT"||aW==="DELETE"?aZ.data:null)}catch(a5){G.handleError(aZ,a6,null,a5);a9()}if(!aZ.async){a8()}function a4(){if(aZ.success){aZ.success.call(bd,a2,a1,a6)}if(aZ.global){a7("ajaxSuccess",[a6,aZ])}}function a9(){if(aZ.complete){aZ.complete.call(bd,a6,a1)}if(aZ.global){a7("ajaxComplete",[a6,aZ])}if(aZ.global&&!--G.active){G.event.trigger("ajaxStop")}}function a7(bh,bg){(aZ.context?G(aZ.context):G.event).trigger(bh,bg)}return a6},handleError:function(aU,aX,aV,aW){if(aU.error){aU.error.call(aU.context||aU,aX,aV,aW)}if(aU.global){(aU.context?G(aU.context):G.event).trigger("ajaxError",[aX,aU,aW])}},active:0,httpSuccess:function(aV){try{return !aV.status&&location.protocol==="file:"||(aV.status>=200&&aV.status<300)||aV.status===304||aV.status===1223||aV.status===0}catch(aU){}return false},httpNotModified:function(aX,aV){var aW=aX.getResponseHeader("Last-Modified"),aU=aX.getResponseHeader("Etag");if(aW){G.lastModified[aV]=aW}if(aU){G.etag[aV]=aU}return aX.status===304||aX.status===0},httpData:function(aY,aW,aU){var aX=aY.getResponseHeader("content-type")||"",aV=aW==="xml"||!aW&&aX.indexOf("xml")>=0,aZ=aV?aY.responseXML:aY.responseText;if(aV&&aZ.documentElement.nodeName==="parsererror"){G.error("parsererror")}if(aU&&aU.dataFilter){aZ=aU.dataFilter(aZ,aW)}if(typeof aZ==="string"){if(aW==="json"||!aW&&aX.indexOf("json")>=0){aZ=G.parseJSON(aZ)}else{if(aW==="script"||!aW&&aX.indexOf("javascript")>=0){G.globalEval(aZ)}}}return aZ},param:function(aX,aZ){var aV=[];if(aZ===aF){aZ=G.ajaxSettings.traditional}if(G.isArray(aX)||aX.jquery){G.each(aX,function(){aW(this.name,this.value)})}else{for(var aY in aX){aU(aY,aX[aY])}}return aV.join("&").replace(r,"+");function aU(a0,a1){if(G.isArray(a1)){G.each(a1,function(a3,a2){if(aZ){aW(a0,a2)}else{aU(a0+"["+(typeof a2==="object"||G.isArray(a2)?a3:"")+"]",a2)}})}else{if(!aZ&&a1!=null&&typeof a1==="object"){G.each(a1,function(a3,a2){aU(a0+"["+a3+"]",a2)})}else{aW(a0,a1)}}}function aW(a1,a0){a0=G.isFunction(a0)?a0():a0;aV[aV.length]=encodeURIComponent(a1)+"="+encodeURIComponent(a0)}}});var aK={},aD=/toggle|show|hide/,aC=/^([+-]=)?([\d+-.]+)(.*)$/,ar,R=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];G.fn.extend({show:function(aY,a3){if(aY||aY===0){return this.animate(a("show",3),aY,a3)}else{for(var aU=0,aX=this.length;aU<aX;aU++){var aZ=G.data(this[aU],"olddisplay");this[aU].style.display=aZ||"";if(G.css(this[aU],"display")==="none"){var a2=this[aU].nodeName,a0;if(aK[a2]){a0=aK[a2]}else{var a1=G("<"+a2+" />").appendTo("body");a0=a1.css("display");if(a0==="none"){a0="block"}a1.remove();aK[a2]=a0}G.data(this[aU],"olddisplay",a0)}}for(var aV=0,aW=this.length;aV<aW;aV++){this[aV].style.display=G.data(this[aV],"olddisplay")||""}return this}},hide:function(aV,a0){if(aV||aV===0){return this.animate(a("hide",3),aV,a0)}else{for(var aX=0,aW=this.length;aX<aW;aX++){var aU=G.data(this[aX],"olddisplay");if(!aU&&aU!=="none"){G.data(this[aX],"olddisplay",G.css(this[aX],"display"))}}for(var aY=0,aZ=this.length;aY<aZ;aY++){this[aY].style.display="none"}return this}},_toggle:G.fn.toggle,toggle:function(aU,aV){var aW=typeof aU==="boolean";if(G.isFunction(aU)&&G.isFunction(aV)){this._toggle.apply(this,arguments)}else{if(aU==null||aW){this.each(function(){var aX=aW?aU:G(this).is(":hidden");G(this)[aX?"show":"hide"]()})}else{this.animate(a("toggle",3),aU,aV)}}return this},fadeTo:function(aV,aU,aW){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:aU},aV,aW)},animate:function(aY,aW,aU,aV){var aX=G.speed(aW,aU,aV);if(G.isEmptyObject(aY)){return this.each(aX.complete)}return this[aX.queue===false?"each":"queue"](function(){var a3=G.extend({},aX),a2,a0=this.nodeType===1&&G(this).is(":hidden"),a1=this;for(a2 in aY){var aZ=a2.replace(aj,p);if(a2!==aZ){aY[aZ]=aY[a2];delete aY[a2];a2=aZ}if(aY[a2]==="hide"&&a0||aY[a2]==="show"&&!a0){return a3.complete.call(this)}if((a2==="height"||a2==="width")&&this.style){a3.display=G.css(this,"display");a3.overflow=this.style.overflow}if(G.isArray(aY[a2])){(a3.specialEasing=a3.specialEasing||{})[a2]=aY[a2][1];aY[a2]=aY[a2][0]}}if(a3.overflow!=null){this.style.overflow="hidden"}a3.curAnim=G.extend({},aY);G.each(aY,function(a4,ba){var a9=new G.fx(a1,a3,a4);if(aD.test(ba)){a9[ba==="toggle"?a0?"show":"hide":ba](aY)}else{var a8=aC.exec(ba),a6=a9.cur(true)||0;if(a8){var a7=parseFloat(a8[2]),a5=a8[3]||"px";if(a5!=="px"){a1.style[a4]=(a7||1)+a5;a6=((a7||1)/a9.cur(true))*a6;a1.style[a4]=a6+a5}if(a8[1]){a7=((a8[1]==="-="?-1:1)*a7)+a6}a9.custom(a6,a7,a5)}else{a9.custom(a6,ba,"")}}});return true})},stop:function(aU,aW){var aV=G.timers;if(aU){this.queue([])}this.each(function(){for(var aX=aV.length-1;aX>=0;aX--){if(aV[aX].elem===this){if(aW){aV[aX](true)}aV.splice(aX,1)}}});if(!aW){this.dequeue()}return this}});G.each({slideDown:a("show",1),slideUp:a("hide",1),slideToggle:a("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(aV,aU){G.fn[aV]=function(aW,aX){return this.animate(aU,aW,aX)}});G.extend({speed:function(aW,aV,aU){var aX=aW&&typeof aW==="object"?aW:{complete:aU||!aU&&aV||G.isFunction(aW)&&aW,duration:aW,easing:aU&&aV||aV&&!G.isFunction(aV)&&aV};aX.duration=G.fx.off?0:typeof aX.duration==="number"?aX.duration:G.fx.speeds[aX.duration]||G.fx.speeds._default;aX.old=aX.complete;aX.complete=function(){if(aX.queue!==false){G(this).dequeue()}if(G.isFunction(aX.old)){aX.old.call(this)}};return aX},easing:{linear:function(aW,aU,aX,aV){return aX+aV*aW},swing:function(aW,aU,aX,aV){return((-Math.cos(aW*Math.PI)/2)+0.5)*aV+aX}},timers:[],fx:function(aU,aV,aW){this.options=aV;this.elem=aU;this.prop=aW;if(!aV.orig){aV.orig={}}}});G.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(G.fx.step[this.prop]||G.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(aV){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var aU=parseFloat(G.css(this.elem,this.prop,aV));return aU&&aU>-10000?aU:parseFloat(G.curCSS(this.elem,this.prop))||0},custom:function(aU,aV,aW){this.startTime=x();this.start=aU;this.end=aV;this.unit=aW||this.unit||"px";this.now=this.start;this.pos=this.state=0;var aX=this;function aY(aZ){return aX.step(aZ)}aY.elem=this.elem;if(aY()&&G.timers.push(aY)&&!ar){ar=setInterval(G.fx.tick,13)}},show:function(){this.options.orig[this.prop]=G.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());G(this.elem).show()},hide:function(){this.options.orig[this.prop]=G.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(aV){var a1=x(),a2=true;if(aV||a1>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var aU in this.options.curAnim){if(this.options.curAnim[aU]!==true){a2=false}}if(a2){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var aW=G.data(this.elem,"olddisplay");this.elem.style.display=aW?aW:this.options.display;if(G.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){G(this.elem).hide()}if(this.options.hide||this.options.show){for(var a0 in this.options.curAnim){G.style(this.elem,a0,this.options.orig[a0])}}this.options.complete.call(this.elem)}return false}else{var aX=a1-this.startTime;this.state=aX/this.options.duration;var aZ=this.options.specialEasing&&this.options.specialEasing[this.prop];var aY=this.options.easing||(G.easing.swing?"swing":"linear");this.pos=G.easing[aZ||aY](this.state,aX,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};G.extend(G.fx,{tick:function(){var aU=G.timers;for(var aV=0;aV<aU.length;aV++){if(!aU[aV]()){aU.splice(aV--,1)}}if(!aU.length){G.fx.stop()}},stop:function(){clearInterval(ar);ar=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(aU){G.style(aU.elem,"opacity",aU.now)},_default:function(aU){if(aU.elem.style&&aU.elem.style[aU.prop]!=null){aU.elem.style[aU.prop]=(aU.prop==="width"||aU.prop==="height"?Math.max(0,aU.now):aU.now)+aU.unit}else{aU.elem[aU.prop]=aU.now}}}});if(G.expr&&G.expr.filters){G.expr.filters.animated=function(aU){return G.grep(G.timers,function(aV){return aU===aV.elem}).length}}function a(aV,aW){var aU={};G.each(R.concat.apply([],R.slice(0,aW)),function(){aU[this]=aV});return aU}if("getBoundingClientRect" in aO.documentElement){G.fn.offset=function(aU){var a3=this[0];if(aU){return this.each(function(a4){G.offset.setOffset(this,aU,a4)})}if(!a3||!a3.ownerDocument){return null}if(a3===a3.ownerDocument.body){return G.offset.bodyOffset(a3)}var aX=a3.getBoundingClientRect(),aZ=a3.ownerDocument,a2=aZ.body,a0=aZ.documentElement,a1=a0.clientTop||a2.clientTop||0,aV=a0.clientLeft||a2.clientLeft||0,aW=aX.top+(self.pageYOffset||G.support.boxModel&&a0.scrollTop||a2.scrollTop)-a1,aY=aX.left+(self.pageXOffset||G.support.boxModel&&a0.scrollLeft||a2.scrollLeft)-aV;return{top:aW,left:aY}}}else{G.fn.offset=function(aU){var a5=this[0];if(aU){return this.each(function(a6){G.offset.setOffset(this,aU,a6)})}if(!a5||!a5.ownerDocument){return null}if(a5===a5.ownerDocument.body){return G.offset.bodyOffset(a5)}G.offset.initialize();var a4=a5.offsetParent,aV=a5,a1=a5.ownerDocument,aY,a2=a1.documentElement,a3=a1.body,aZ=a1.defaultView,a0=aZ?aZ.getComputedStyle(a5,null):a5.currentStyle,aW=a5.offsetTop,aX=a5.offsetLeft;while((a5=a5.parentNode)&&a5!==a3&&a5!==a2){if(G.offset.supportsFixedPosition&&a0.position==="fixed"){break}aY=aZ?aZ.getComputedStyle(a5,null):a5.currentStyle;aW-=a5.scrollTop;aX-=a5.scrollLeft;if(a5===a4){aW+=a5.offsetTop;aX+=a5.offsetLeft;if(G.offset.doesNotAddBorder&&!(G.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(a5.nodeName))){aW+=parseFloat(aY.borderTopWidth)||0;aX+=parseFloat(aY.borderLeftWidth)||0}aV=a4,a4=a5.offsetParent}if(G.offset.subtractsBorderForOverflowNotVisible&&aY.overflow!=="visible"){aW+=parseFloat(aY.borderTopWidth)||0;aX+=parseFloat(aY.borderLeftWidth)||0}a0=aY}if(a0.position==="relative"||a0.position==="static"){aW+=a3.offsetTop;aX+=a3.offsetLeft}if(G.offset.supportsFixedPosition&&a0.position==="fixed"){aW+=Math.max(a2.scrollTop,a3.scrollTop);aX+=Math.max(a2.scrollLeft,a3.scrollLeft)}return{top:aW,left:aX}}}G.offset={initialize:function(){var aZ=aO.body,aW=aO.createElement("div"),a1,aY,aU,a0,aV=parseFloat(G.curCSS(aZ,"marginTop",true))||0,aX="<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>";G.extend(aW.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});aW.innerHTML=aX;aZ.insertBefore(aW,aZ.firstChild);a1=aW.firstChild;aY=a1.firstChild;a0=a1.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(aY.offsetTop!==5);this.doesAddBorderForTableAndCells=(a0.offsetTop===5);aY.style.position="fixed",aY.style.top="20px";this.supportsFixedPosition=(aY.offsetTop===20||aY.offsetTop===15);aY.style.position=aY.style.top="";a1.style.overflow="hidden",a1.style.position="relative";this.subtractsBorderForOverflowNotVisible=(aY.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(aZ.offsetTop!==aV);aZ.removeChild(aW);aZ=aW=a1=aY=aU=a0=null;G.offset.initialize=G.noop},bodyOffset:function(aU){var aV=aU.offsetTop,aW=aU.offsetLeft;G.offset.initialize();if(G.offset.doesNotIncludeMarginInBodyOffset){aV+=parseFloat(G.curCSS(aU,"marginTop",true))||0;aW+=parseFloat(G.curCSS(aU,"marginLeft",true))||0}return{top:aV,left:aW}},setOffset:function(a1,aU,a0){if(/static/.test(G.curCSS(a1,"position"))){a1.style.position="relative"}var aY=G(a1),aZ=aY.offset(),aX=parseInt(G.curCSS(a1,"top",true),10)||0,aW=parseInt(G.curCSS(a1,"left",true),10)||0;if(G.isFunction(aU)){aU=aU.call(a1,a0,aZ)}var aV={top:(aU.top-aZ.top)+aX,left:(aU.left-aZ.left)+aW};if("using" in aU){aU.using.call(a1,aV)}else{aY.css(aV)}}};G.fn.extend({position:function(){if(!this[0]){return null}var aV=this[0],aX=this.offsetParent(),aW=this.offset(),aU=/^body|html$/i.test(aX[0].nodeName)?{top:0,left:0}:aX.offset();aW.top-=parseFloat(G.curCSS(aV,"marginTop",true))||0;aW.left-=parseFloat(G.curCSS(aV,"marginLeft",true))||0;aU.top+=parseFloat(G.curCSS(aX[0],"borderTopWidth",true))||0;aU.left+=parseFloat(G.curCSS(aX[0],"borderLeftWidth",true))||0;return{top:aW.top-aU.top,left:aW.left-aU.left}},offsetParent:function(){return this.map(function(){var aU=this.offsetParent||aO.body;while(aU&&(!/^body|html$/i.test(aU.nodeName)&&G.css(aU,"position")==="static")){aU=aU.offsetParent}return aU})}});G.each(["Left","Top"],function(aW,aU){var aV="scroll"+aU;G.fn[aV]=function(aZ){var aX=this[0],aY;if(!aX){return null}if(aZ!==aF){return this.each(function(){aY=j(this);if(aY){aY.scrollTo(!aW?aZ:G(aY).scrollLeft(),aW?aZ:G(aY).scrollTop())}else{this[aV]=aZ}})}else{aY=j(aX);return aY?("pageXOffset" in aY)?aY[aW?"pageYOffset":"pageXOffset"]:G.support.boxModel&&aY.document.documentElement[aV]||aY.document.body[aV]:aX[aV]}}});function j(aU){return("scrollTo" in aU&&aU.document)?aU:aU.nodeType===9?aU.defaultView||aU.parentWindow:false}G.each(["Height","Width"],function(aW,aU){var aV=aU.toLowerCase();G.fn["inner"+aU]=function(){return this[0]?G.css(this[0],aV,false,"padding"):null};G.fn["outer"+aU]=function(aX){return this[0]?G.css(this[0],aV,false,aX?"margin":"border"):null};G.fn[aV]=function(aX){var aY=this[0];if(!aY){return aX==null?null:this}if(G.isFunction(aX)){return this.each(function(a0){var aZ=G(this);aZ[aV](aX.call(this,a0,aZ[aV]()))})}return("scrollTo" in aY&&aY.document)?aY.document.compatMode==="CSS1Compat"&&aY.document.documentElement["client"+aU]||aY.document.body["client"+aU]:(aY.nodeType===9)?Math.max(aY.documentElement["client"+aU],aY.body["scroll"+aU],aY.documentElement["scroll"+aU],aY.body["offset"+aU],aY.documentElement["offset"+aU]):aX===aF?G.css(aY,aV):this.css(aV,typeof aX==="string"?aX:aX+"px")}});ae.jQuery=ae.$=G})(window);var qq=qq||{};qq.FileUploader=function(a){this._options={element:null,action:"/server/upload",params:{},allowedExtensions:[],sizeLimit:0,onSubmit:function(d,c){},onComplete:function(e,d,c){},template:'<div class="qq-uploader"><div class="qq-upload-drop-area"><span>Drop files here to upload</span></div><div class="qq-upload-button">Upload a file</div><ul class="qq-upload-list"></ul></div>',fileTemplate:'<li><span class="qq-upload-file"></span><span class="qq-upload-spinner"></span><span class="qq-upload-size"></span><a class="qq-upload-cancel" href="#">Cancel</a><span class="qq-upload-failed-text">Failed</span></li>',classes:{button:"qq-upload-button",drop:"qq-upload-drop-area",dropActive:"qq-upload-drop-area-active",list:"qq-upload-list",file:"qq-upload-file",spinner:"qq-upload-spinner",size:"qq-upload-size",cancel:"qq-upload-cancel",success:"qq-upload-success",fail:"qq-upload-fail"},messages:{typeError:"{file} has invalid extension. Only {extensions} are allowed.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",emptyError:"{file} is empty, please select files again without it."},showMessage:function(c){alert(c)}};qq.extend(this._options,a);this._element=this._options.element;if(this._element.nodeType!=1){throw new Error("element param of FileUploader should be dom node")}this._element.innerHTML=this._options.template;this._filesInProgress=0;this._classes=this._options.classes;this._handler=this._createUploadHandler();this._bindCancelEvent();var b=this;this._button=new qq.UploadButton({element:this._getElement("button"),multiple:qq.UploadHandlerXhr.isSupported(),onChange:function(c){b._onInputChange(c)}});this._setupDragDrop()};qq.FileUploader.prototype={setParams:function(a){this._options.params=a},isUploading:function(){return !!this._filesInProgress},_getElement:function(a,b){if(typeof a=="string"){b=a;a=this._element}var c=qq.getByClass(a,this._options.classes[b])[0];if(!c){throw new Error("element not found "+b)}return c},_error:function(a,b){var c=this._options.messages[a];c=c.replace("{file}",this._formatFileName(b));c=c.replace("{extensions}",this._options.allowedExtensions.join(", "));c=c.replace("{sizeLimit}",this._formatSize(this._options.sizeLimit));this._options.showMessage(c)},_formatFileName:function(a){if(a.length>33){a=a.slice(0,19)+"..."+a.slice(-13)}return a},_isAllowedExtension:function(a){var d=(-1!==a.indexOf("."))?a.replace(/.*[.]/,"").toLowerCase():"";var c=this._options.allowedExtensions;if(!c.length){return true}for(var b=0;b<c.length;b++){if(c[b].toLowerCase()==d){return true}}return false},_setupDragDrop:function(){function c(h){var g=h.dataTransfer,f=navigator.userAgent.indexOf("AppleWebKit")>-1;return g&&g.effectAllowed!="none"&&(g.files||(!f&&g.types.contains&&g.types.contains("Files")))}var b=this,a=this._getElement("drop");a.style.display="none";var d;qq.attach(document,"dragenter",function(f){f.preventDefault()});qq.attach(document,"dragover",function(f){if(c(f)){if(d){clearTimeout(d)}if(a==f.target||qq.contains(a,f.target)){var g=f.dataTransfer.effectAllowed;if(g=="move"||g=="linkMove"){f.dataTransfer.dropEffect="move"}else{f.dataTransfer.dropEffect="copy"}qq.addClass(a,b._classes.dropActive);f.stopPropagation()}else{a.style.display="block";f.dataTransfer.dropEffect="none"}f.preventDefault()}});qq.attach(document,"dragleave",function(f){if(c(f)){if(a==f.target||qq.contains(a,f.target)){qq.removeClass(a,b._classes.dropActive);f.stopPropagation()}else{if(d){clearTimeout(d)}d=setTimeout(function(){a.style.display="none"},77)}}});qq.attach(a,"drop",function(f){a.style.display="none";b._uploadFileList(f.dataTransfer.files);f.preventDefault()})},_createUploadHandler:function(){var c=this,a;if(qq.UploadHandlerXhr.isSupported()){a="UploadHandlerXhr"}else{a="UploadHandlerForm"}var b=new qq[a]({action:this._options.action,onProgress:function(g,e,f,d){c._updateProgress(g,f,d)},onComplete:function(g,f,e){c._filesInProgress--;var d=c._getItemByFileId(g);qq.remove(c._getElement(d,"cancel"));qq.remove(c._getElement(d,"spinner"));if(e.success){qq.addClass(d,c._classes.success)}else{qq.addClass(d,c._classes.fail);if(e.error){c._options.showMessage(e.error)}}c._options.onComplete(g,f,e)}});return b},_onInputChange:function(a){if(this._handler instanceof qq.UploadHandlerXhr){this._uploadFileList(a.files)}else{if(this._validateFile(a)){this._uploadFile(a)}}this._button.reset()},_uploadFileList:function(a){var c=true;var b=a.length;while(b--){if(!this._validateFile(a[b])){c=false;break}}if(c){var b=a.length;while(b--){this._uploadFile(a[b])}}},_uploadFile:function(c){var b=this._handler.add(c);var a=this._handler.getName(b);this._options.onSubmit(b,a);this._addToList(b,a);this._handler.upload(b,this._options.params)},_validateFile:function(c){var b,a;if(c.value){b=c.value.replace(/.*(\/|\\)/,"")}else{b=c.fileName!=null?c.fileName:c.name;a=c.fileSize!=null?c.fileSize:c.size}if(!this._isAllowedExtension(b)){this._error("typeError",b);return false}else{if(a===0){this._error("emptyError",b);return false}else{if(a&&this._options.sizeLimit&&a>this._options.sizeLimit){this._error("sizeError",b);return false}}}return true},_addToList:function(d,c){var a=qq.toElement(this._options.fileTemplate);a.qqFileId=d;var b=this._getElement(a,"file");qq.setText(b,this._formatFileName(c));this._getElement(a,"size").style.display="none";this._getElement("list").appendChild(a);this._filesInProgress++},_updateProgress:function(e,d,a){var b=this._getItemByFileId(e);var c=this._getElement(b,"size");c.style.display="inline";var f;if(d!=a){f=Math.round(d/a*100)+"% from "+this._formatSize(a)}else{f=this._formatSize(a)}qq.setText(c,f)},_formatSize:function(b){var a=-1;do{b=b/1024;a++}while(b>99);return Math.max(b,0.1).toFixed(1)+["kB","MB","GB","TB","PB","EB"][a]},_getItemByFileId:function(b){var a=this._getElement("list").firstChild;while(a){if(a.qqFileId==b){return a}a=a.nextSibling}},_bindCancelEvent:function(){var b=this,a=this._getElement("list");qq.attach(a,"click",function(f){f=f||window.event;var d=f.target||f.srcElement;if(qq.hasClass(d,b._classes.cancel)){qq.preventDefault(f);var c=d.parentNode;b._handler.cancel(c.qqFileId);qq.remove(c)}})}};qq.UploadButton=function(a){this._options={element:null,multiple:false,name:"file",onChange:function(b){},hoverClass:"qq-upload-button-hover",focusClass:"qq-upload-button-focus"};qq.extend(this._options,a);this._element=this._options.element;qq.css(this._element,{position:"relative",overflow:"hidden",direction:"ltr"});this._input=this._createInput()};qq.UploadButton.prototype={getInput:function(){return this._input},reset:function(){if(this._input.parentNode){qq.remove(this._input)}qq.removeClass(this._element,this._options.focusClass);this._input=this._createInput()},_createInput:function(){var a=document.createElement("input");if(this._options.multiple){a.setAttribute("multiple","multiple")}a.setAttribute("type","file");a.setAttribute("name",this._options.name);qq.css(a,{position:"absolute",right:0,top:0,zIndex:1,fontSize:"460px",margin:0,padding:0,cursor:"pointer",opacity:0});this._element.appendChild(a);var b=this;qq.attach(a,"change",function(){b._options.onChange(a)});qq.attach(a,"mouseover",function(){qq.addClass(b._element,b._options.hoverClass)});qq.attach(a,"mouseout",function(){qq.removeClass(b._element,b._options.hoverClass)});qq.attach(a,"focus",function(){qq.addClass(b._element,b._options.focusClass)});qq.attach(a,"blur",function(){qq.removeClass(b._element,b._options.focusClass)});if(window.attachEvent){a.setAttribute("tabIndex","-1")}return a}};qq.UploadHandlerForm=function(a){this._options={action:"/upload",onComplete:function(d,c,b){}};qq.extend(this._options,a);this._inputs={}};qq.UploadHandlerForm.prototype={add:function(a){a.setAttribute("name","qqfile");var b="qq-upload-handler-iframe"+qq.getUniqueId();this._inputs[b]=a;if(a.parentNode){qq.remove(a)}return b},upload:function(g,a){var c=this._inputs[g];if(!c){throw new Error("file with passed id was not added, or already uploaded or cancelled")}var d=this.getName(g);var b=this._createIframe(g);var e=this._createForm(b,a);e.appendChild(c);var f=this;this._attachLoadEvent(b,function(){f._options.onComplete(g,d,f._getIframeContentJSON(b));delete f._inputs[g];setTimeout(function(){qq.remove(b)},1)});e.submit();qq.remove(e);return g},cancel:function(b){if(b in this._inputs){delete this._inputs[b]}var a=document.getElementById(b);if(a){a.setAttribute("src","javascript:false;");qq.remove(a)}},getName:function(a){return this._inputs[a].value.replace(/.*(\/|\\)/,"")},_attachLoadEvent:function(a,b){qq.attach(a,"load",function(){if(!a.parentNode){return}if(a.contentDocument&&a.contentDocument.body&&a.contentDocument.body.innerHTML=="false"){return}b()})},_getIframeContentJSON:function(iframe){var doc=iframe.contentDocument?iframe.contentDocument:iframe.contentWindow.document,response;try{response=eval("("+doc.body.innerHTML+")")}catch(err){response={}}return response},_createIframe:function(b){var a=qq.toElement('<iframe src="javascript:false;" name="'+b+'" />');a.setAttribute("id",b);a.style.display="none";document.body.appendChild(a);return a},_createForm:function(c,a){var d=qq.toElement('<form method="post" enctype="multipart/form-data"></form>');var e="?";for(var b in a){e+="&"+b+"="+encodeURIComponent(a[b])}d.setAttribute("action",this._options.action+e);d.setAttribute("target",c.name);d.style.display="none";document.body.appendChild(d);return d}};qq.UploadHandlerXhr=function(a){this._options={action:"/upload",onProgress:function(e,c,d,b){},onComplete:function(d,c,b){}};qq.extend(this._options,a);this._files=[];this._xhrs=[]};qq.UploadHandlerXhr.isSupported=function(){return typeof File!="undefined"&&typeof(new XMLHttpRequest()).upload!="undefined"};qq.UploadHandlerXhr.prototype={add:function(a){return this._files.push(a)-1},upload:function(id,params){var file=this._files[id],name=this.getName(id),size=this.getSize(id);if(!file){throw new Error("file with passed id was not added, or already uploaded or cancelled")}var xhr=this._xhrs[id]=new XMLHttpRequest();var self=this;xhr.upload.onprogress=function(e){if(e.lengthComputable){self._options.onProgress(id,name,e.loaded,e.total)}};xhr.onreadystatechange=function(){if(!self._files[id]){return}if(xhr.readyState==4){self._options.onProgress(id,name,size,size);if(xhr.status==200){var response;try{response=eval("("+xhr.responseText+")")}catch(err){response={}}self._options.onComplete(id,name,response)}else{self._options.onComplete(id,name,{})}self._files[id]=null;self._xhrs[id]=null}};var queryString="?qqfile="+encodeURIComponent(name);for(var key in params){queryString+="&"+key+"="+encodeURIComponent(params[key])}xhr.open("POST",this._options.action+queryString,true);xhr.send(file)},cancel:function(a){this._files[a]=null;if(this._xhrs[a]){this._xhrs[a].abort();this._xhrs[a]=null}},getName:function(a){var b=this._files[a];return b.fileName!=null?b.fileName:b.name},getSize:function(a){var b=this._files[a];return b.fileSize!=null?b.fileSize:b.size}};var qq=qq||{};qq.extend=function(b,a){for(var c in a){b[c]=a[c]}};qq.getUniqueId=(function(){var a=0;return function(){return a++}})();qq.attach=function(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c.attachEvent("on"+b,a)}}};qq.detach=function(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false)}else{if(c.attachEvent){c.detachEvent("on"+b,a)}}};qq.preventDefault=function(a){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}};qq.insertBefore=function(c,d){d.parentNode.insertBefore(c,d)};qq.remove=function(a){a.parentNode.removeChild(a)};qq.contains=function(a,b){if(a.contains){return a.contains(b)}else{return !!(b.compareDocumentPosition(a)&8)}};qq.toElement=(function(){var a=document.createElement("div");return function(b){a.innerHTML=b;var c=a.firstChild;a.removeChild(c);return c}})();qq.css=function(b,a){if(a.opacity!=null){if(typeof b.style.opacity!="string"&&typeof(b.filters)!="undefined"){a.filter="alpha(opacity="+Math.round(100*a.opacity)+")"}}qq.extend(b.style,a)};qq.hasClass=function(b,a){var c=new RegExp("(^| )"+a+"( |$)");return c.test(b.className)};qq.addClass=function(b,a){if(!qq.hasClass(b,a)){b.className+=" "+a}};qq.removeClass=function(b,a){var c=new RegExp("(^| )"+a+"( |$)");b.className=b.className.replace(c," ").replace(/^\s+|\s+$/g,"")};qq.setText=function(a,b){a.innerText=b;a.textContent=b};qq.children=function(c){var a=[],b=c.firstChild;while(b){if(b.nodeType==1){a.push(b)}b=b.nextSibling}return a};qq.getByClass=function(e,c){if(e.querySelectorAll){return e.querySelectorAll("."+c)}var b=[];var f=e.getElementsByTagName("*");var a=f.length;for(var d=0;d<a;d++){if(qq.hasClass(f[d],c)){b.push(f[d])}}return b};/*
 * Froogaloop Microframework.
 * Copyright 2010 Vimeo, LLC.
 * @author: Joseph Schmitt
 *
 * Froogaloop is a small Javascript utility framework to help with the complexities
 * involved in dealing with using the Javascript API through window.postMessage
 * for controlling Vimeo's Moogaloop video player. This framework provides a simple
 * API to call functions and add event listeners to Moogaloop when it is embedded
 * using an <iframe>.
 *
 * USAGE:
 * The Froogaloop framework automatically searches the document for all iframes that
 * are embeds of Vimeo videos. It then adds two new functions to the iframe HTMLElement:
 * api and addEvent. To call a function that acts upon the player (such as play, pause,
 * or seek), use the api method. To add an event listener that listens for player
 * events, use the addEvent method.
 *
 * NOTES:
 * 1. To gain JavaScript api access to the Vimeo player, you must pass in a value of 1
 *    for the js_api url parameter to the iframe.
 * 2. If you have more than one iframe per page, each iframe must have a unique id attribute
 *    set and that id must be passed to the iframe via the js_swf_id query parameter.
 *
 *
 * EXAMPLE:
 * var iframe = document.getElementById("myIframe");
 * iframe.api("api_play");
 * iframe.api("api_seekTo", 30);
 * iframe.api("api_setVolume", 80);
 *
 * iframe.addEvent("onPlay", function(player_id){
 *    // Handle onPlay event
 * });
 *
 * iframe.addEvent("onSeek", function(time, player_id){
 *    // Handle onSeek event
 * });
 */
var Froogaloop=new function(){this.init=function(j){cur_frame=j;is_embed_iframe=e.iframe_pattern.test(cur_frame.getAttribute("src"));if(is_embed_iframe){cur_frame.api=i.api;cur_frame.addEvent=i.addEvent}};var e={hasWindowEvent:false,PLAYER_DOMAIN:"",eventCallbacks:{},iframe_pattern:/player\.(([a-zA-Z0-9_\.]+)\.)?vimeo(ws)?\.com\/video\/([0-9]+)/i},d=function(){var n=document.getElementsByTagName("iframe"),k,l=0,m=n.length,j;for(l;l<m;l++){k=n[l];j=e.iframe_pattern.test(k.getAttribute("src"));if(j){k.api=i.api;k.addEvent=i.addEvent}}},i={api:function(k,j){a(k,j,this)},addEvent:function(k,l){var j=this.id!=""?this.id:null;h(k,l,j);if(k!="onLoad"){a("api_addEventListener",[k,l.name],this)}if(e.hasWindowEvent){return false}e.PLAYER_DOMAIN=g.getDomainFromUrl(this.getAttribute("src"));if(window.addEventListener){window.addEventListener("message",f,false)}else{window.attachEvent("onmessage",f,false)}e.hasWindowEvent=true}},a=function(k,j,l){if(!l.contentWindow.postMessage){return false}if(j===undefined||j===null){j=""}var m=l.getAttribute("src").split("?")[0],n=g.serialize({method:k,params:j,id:l.getAttribute("id")});l.contentWindow.postMessage(n,m)},h=function(k,l,j){if(j){if(!e.eventCallbacks[j]){e.eventCallbacks[j]={}}e.eventCallbacks[j][k]=l}else{e.eventCallbacks[k]=l}},b=function(k,j){if(j){return e.eventCallbacks[j][k]}else{return e.eventCallbacks[k]}},f=function(j){if(j.origin!=e.PLAYER_DOMAIN){return false}c(g.unserialize(j.data))},c=function(n){var j=n.params?n.params.split('"').join("").split(","):"",m=n.method,l=j[j.length-1];if(l==""){l=null}var k=b(m,l);if(!k){return false}if(j.length>0){k.apply(null,j)}else{k.call()}},g={r20:/%20/g,isArray:function(j){return Object.prototype.toString.call(j)==="[object Array]"},isFunction:function(j){return Object.prototype.toString.call(j)==="[object Function]"},unserialize:function(m){if(!m){return false}var l={},k=m.split("&"),o,j,n=0;for(n;n<k.length;n++){o=unescape(k[n].split("=")[0]);j=unescape(k[n].split("=")[1]);if(j.indexOf("=")>-1){j=g.unserialize(j)}l[o]=j}return l},s:false,serialize:function(j){g.s=[];for(var k in j){g.buildParams(k,j[k])}return g.s.join("&").replace(g.r20,"+")},buildParams:function(l,o){var j,m=0,n=0;if(g.isArray(o)){for(m;m<o.length;m++){o[m]=encodeURIComponent(o[m])}g.addToParam(encodeURIComponent(l),o.join(","))}else{g.addToParam(encodeURIComponent(l),encodeURIComponent(o))}},addToParam:function(k,j){j=g.isFunction(j)?j():j;g.s[g.s.length]=k+"="+j},getDomainFromUrl:function(k){var m=k.split("/"),j="",l=0;for(l;l<m.length;l++){if(l<3){j+=m[l]}else{break}if(l<2){j+="/"}}return j}};d()};/*@cc_on(function(p,e){var q=e.createElement("div");q.innerHTML="<z>i</z>";q.childNodes.length!==1&&function(){function r(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=s[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;r(a,b)}}function t(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h<a.length;){b=a[h].media||b;t(a[h].imports,b);r(b,a[h].cssText.replace(c,d))}}for(var s=e.documentElement,i=e.createDocumentFragment(),g={},m="abbr article aside audio canvas details figcaption figure footer header hgroup mark meter nav output progress section summary time video".replace(/ /g, '|'),
n=m.split("|"),f=[],o=-1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforeprint",function(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=-1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=new RegExp("^\\s*<"+d+"(.*)\\/"+d+">\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");c=i.childNodes[0];c.className+=" iepp_"+
d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}t(e.styleSheets,"all")});p.attachEvent("onafterprint",function(){for(var a=-1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1]);for(b in g)s[l].removeChild(g[b]);g={};f=[]})}()})(this,document);@*/
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,e,f,g,h){return jQuery.easing[jQuery.easing.def](a,e,f,g,h)},easeInQuad:function(a,e,f,g,h){return g*(e/=h)*e+f},easeOutQuad:function(a,e,f,g,h){return -g*(e/=h)*(e-2)+f},easeInOutQuad:function(a,e,f,g,h){if((e/=h/2)<1){return g/2*e*e+f}return -g/2*((--e)*(e-2)-1)+f},easeInCubic:function(a,e,f,g,h){return g*(e/=h)*e*e+f},easeOutCubic:function(a,e,f,g,h){return g*((e=e/h-1)*e*e+1)+f},easeInOutCubic:function(a,e,f,g,h){if((e/=h/2)<1){return g/2*e*e*e+f}return g/2*((e-=2)*e*e+2)+f},easeInQuart:function(a,e,f,g,h){return g*(e/=h)*e*e*e+f},easeOutQuart:function(a,e,f,g,h){return -g*((e=e/h-1)*e*e*e-1)+f},easeInOutQuart:function(a,e,f,g,h){if((e/=h/2)<1){return g/2*e*e*e*e+f}return -g/2*((e-=2)*e*e*e-2)+f},easeInQuint:function(a,e,f,g,h){return g*(e/=h)*e*e*e*e+f},easeOutQuint:function(a,e,f,g,h){return g*((e=e/h-1)*e*e*e*e+1)+f},easeInOutQuint:function(a,e,f,g,h){if((e/=h/2)<1){return g/2*e*e*e*e*e+f}return g/2*((e-=2)*e*e*e*e+2)+f},easeInSine:function(a,e,f,g,h){return -g*Math.cos(e/h*(Math.PI/2))+g+f},easeOutSine:function(a,e,f,g,h){return g*Math.sin(e/h*(Math.PI/2))+f},easeInOutSine:function(a,e,f,g,h){return -g/2*(Math.cos(Math.PI*e/h)-1)+f},easeInExpo:function(a,e,f,g,h){return(e==0)?f:g*Math.pow(2,10*(e/h-1))+f},easeOutExpo:function(a,e,f,g,h){return(e==h)?f+g:g*(-Math.pow(2,-10*e/h)+1)+f},easeInOutExpo:function(a,e,f,g,h){if(e==0){return f}if(e==h){return f+g}if((e/=h/2)<1){return g/2*Math.pow(2,10*(e-1))+f}return g/2*(-Math.pow(2,-10*--e)+2)+f},easeInCirc:function(a,e,f,g,h){return -g*(Math.sqrt(1-(e/=h)*e)-1)+f},easeOutCirc:function(a,e,f,g,h){return g*Math.sqrt(1-(e=e/h-1)*e)+f},easeInOutCirc:function(a,e,f,g,h){if((e/=h/2)<1){return -g/2*(Math.sqrt(1-e*e)-1)+f}return g/2*(Math.sqrt(1-(e-=2)*e)+1)+f},easeInElastic:function(e,l,g,h,i){var k=1.70158;var j=0;var f=h;if(l==0){return g}if((l/=i)==1){return g+h}if(!j){j=i*0.3}if(f<Math.abs(h)){f=h;var k=j/4}else{var k=j/(2*Math.PI)*Math.asin(h/f)}return -(f*Math.pow(2,10*(l-=1))*Math.sin((l*i-k)*(2*Math.PI)/j))+g},easeOutElastic:function(e,l,g,h,i){var k=1.70158;var j=0;var f=h;if(l==0){return g}if((l/=i)==1){return g+h}if(!j){j=i*0.3}if(f<Math.abs(h)){f=h;var k=j/4}else{var k=j/(2*Math.PI)*Math.asin(h/f)}return f*Math.pow(2,-10*l)*Math.sin((l*i-k)*(2*Math.PI)/j)+h+g},easeInOutElastic:function(e,l,g,h,i){var k=1.70158;var j=0;var f=h;if(l==0){return g}if((l/=i/2)==2){return g+h}if(!j){j=i*(0.3*1.5)}if(f<Math.abs(h)){f=h;var k=j/4}else{var k=j/(2*Math.PI)*Math.asin(h/f)}if(l<1){return -0.5*(f*Math.pow(2,10*(l-=1))*Math.sin((l*i-k)*(2*Math.PI)/j))+g}return f*Math.pow(2,-10*(l-=1))*Math.sin((l*i-k)*(2*Math.PI)/j)*0.5+h+g},easeInBack:function(a,e,f,g,h,i){if(i==undefined){i=1.70158}return g*(e/=h)*e*((i+1)*e-i)+f},easeOutBack:function(a,e,f,g,h,i){if(i==undefined){i=1.70158}return g*((e=e/h-1)*e*((i+1)*e+i)+1)+f},easeInOutBack:function(a,e,f,g,h,i){if(i==undefined){i=1.70158}if((e/=h/2)<1){return g/2*(e*e*(((i*=(1.525))+1)*e-i))+f}return g/2*((e-=2)*e*(((i*=(1.525))+1)*e+i)+2)+f},easeInBounce:function(a,e,f,g,h){return g-jQuery.easing.easeOutBounce(a,h-e,0,g,h)+f},easeOutBounce:function(a,e,f,g,h){if((e/=h)<(1/2.75)){return g*(7.5625*e*e)+f}else{if(e<(2/2.75)){return g*(7.5625*(e-=(1.5/2.75))*e+0.75)+f}else{if(e<(2.5/2.75)){return g*(7.5625*(e-=(2.25/2.75))*e+0.9375)+f}else{return g*(7.5625*(e-=(2.625/2.75))*e+0.984375)+f}}}},easeInOutBounce:function(a,e,f,g,h){if(e<h/2){return jQuery.easing.easeInBounce(a,e*2,0,g,h)*0.5+f}return jQuery.easing.easeOutBounce(a,e*2-h,0,g,h)*0.5+g*0.5+f}});/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 *
 * Version: 3.0.2
 * 
 * Requires: 1.2.2+
 */
(function(b){var c=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=c.length;d;){this.addEventListener(c[--d],a,false)}}else{this.onmousewheel=a}},teardown:function(){if(this.removeEventListener){for(var d=c.length;d;){this.removeEventListener(c[--d],a,false)}}else{this.onmousewheel=null}}};b.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function a(f){var e=[].slice.call(arguments,1),g=0,d=true;f=b.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}e.unshift(f,g);return b.event.handle.apply(this,e)}})(jQuery);(function(c){var d=window.console?window.console:{log:c.noop,error:function(e){c.error(e)}};var b=(("prop" in c.fn)&&("removeProp" in c.fn));function a(){this.controls={bold:{groupIndex:0,visible:true,tags:["b","strong"],css:{fontWeight:"bold"},tooltip:"Bold",hotkey:{ctrl:1,key:66}},copy:{groupIndex:8,visible:false,tooltip:"Copy"},createLink:{groupIndex:6,visible:true,exec:function(){var e=this;if(c.wysiwyg.controls&&c.wysiwyg.controls.link){c.wysiwyg.controls.link.init(this)}else{if(c.wysiwyg.autoload){c.wysiwyg.autoload.control("wysiwyg.link.js",function(){e.controls.createLink.exec.apply(e)})}else{d.error("$.wysiwyg.controls.link not defined. You need to include wysiwyg.link.js file")}}},tags:["a"],tooltip:"Create link"},cut:{groupIndex:8,visible:false,tooltip:"Cut"},decreaseFontSize:{groupIndex:9,visible:false,tags:["small"],tooltip:"Decrease font size",exec:function(){this.decreaseFontSize()}},h1:{groupIndex:7,visible:true,className:"h1",command:(c.browser.msie||c.browser.safari)?"FormatBlock":"heading","arguments":(c.browser.msie||c.browser.safari)?"<h1>":"h1",tags:["h1"],tooltip:"Header 1"},h2:{groupIndex:7,visible:true,className:"h2",command:(c.browser.msie||c.browser.safari)?"FormatBlock":"heading","arguments":(c.browser.msie||c.browser.safari)?"<h2>":"h2",tags:["h2"],tooltip:"Header 2"},h3:{groupIndex:7,visible:true,className:"h3",command:(c.browser.msie||c.browser.safari)?"FormatBlock":"heading","arguments":(c.browser.msie||c.browser.safari)?"<h3>":"h3",tags:["h3"],tooltip:"Header 3"},highlight:{tooltip:"Highlight",className:"highlight",groupIndex:1,visible:false,css:{backgroundColor:"rgb(255, 255, 102)"},exec:function(){var e,h,g,f;if(c.browser.msie||c.browser.safari){e="backcolor"}else{e="hilitecolor"}if(c.browser.msie){h=this.getInternalRange().parentElement()}else{g=this.getInternalSelection();h=g.extentNode||g.focusNode;while(h.style===undefined){h=h.parentNode;if(h.tagName&&h.tagName.toLowerCase()==="body"){return}}}if(h.style.backgroundColor==="rgb(255, 255, 102)"||h.style.backgroundColor==="#ffff66"){f="#ffffff"}else{f="#ffff66"}this.editorDoc.execCommand(e,false,f)}},html:{groupIndex:10,visible:false,exec:function(){var e;if(this.options.resizeOptions&&c.fn.resizable){e=this.element.height()}if(this.viewHTML){this.setContent(this.original.value);c(this.original).hide();this.editor.show();if(this.options.resizeOptions&&c.fn.resizable){if(e===this.element.height()){this.element.height(e+this.editor.height())}this.element.resizable(c.extend(true,{alsoResize:this.editor},this.options.resizeOptions))}this.ui.toolbar.find("li").each(function(){var f=c(this);if(f.hasClass("html")){f.removeClass("active")}else{f.removeClass("disabled")}})}else{this.saveContent();c(this.original).css({width:this.element.outerWidth()-6,height:this.element.height()-this.ui.toolbar.height()-6,resize:"none"}).show();this.editor.hide();if(this.options.resizeOptions&&c.fn.resizable){if(e===this.element.height()){this.element.height(this.ui.toolbar.height())}this.element.resizable("destroy")}this.ui.toolbar.find("li").each(function(){var f=c(this);if(f.hasClass("html")){f.addClass("active")}else{if(false===f.hasClass("fullscreen")){f.removeClass("active").addClass("disabled")}}})}this.viewHTML=!(this.viewHTML)},tooltip:"View source code"},increaseFontSize:{groupIndex:9,visible:false,tags:["big"],tooltip:"Increase font size",exec:function(){this.increaseFontSize()}},indent:{groupIndex:2,visible:true,tooltip:"Indent"},insertHorizontalRule:{groupIndex:6,visible:true,tags:["hr"],tooltip:"Insert Horizontal Rule"},insertImage:{groupIndex:6,visible:true,exec:function(){var e=this;if(c.wysiwyg.controls&&c.wysiwyg.controls.image){c.wysiwyg.controls.image.init(this)}else{if(c.wysiwyg.autoload){c.wysiwyg.autoload.control("wysiwyg.image.js",function(){e.controls.insertImage.exec.apply(e)})}else{d.error("$.wysiwyg.controls.image not defined. You need to include wysiwyg.image.js file")}}},tags:["img"],tooltip:"Insert image"},insertOrderedList:{groupIndex:5,visible:true,tags:["ol"],tooltip:"Insert Ordered List"},insertTable:{groupIndex:6,visible:true,exec:function(){var e=this;if(c.wysiwyg.controls&&c.wysiwyg.controls.table){c.wysiwyg.controls.table(this)}else{if(c.wysiwyg.autoload){c.wysiwyg.autoload.control("wysiwyg.table.js",function(){e.controls.insertTable.exec.apply(e)})}else{d.error("$.wysiwyg.controls.table not defined. You need to include wysiwyg.table.js file")}}},tags:["table"],tooltip:"Insert table"},insertUnorderedList:{groupIndex:5,visible:true,tags:["ul"],tooltip:"Insert Unordered List"},italic:{groupIndex:0,visible:true,tags:["i","em"],css:{fontStyle:"italic"},tooltip:"Italic",hotkey:{ctrl:1,key:73}},justifyCenter:{groupIndex:1,visible:true,tags:["center"],css:{textAlign:"center"},tooltip:"Justify Center"},justifyFull:{groupIndex:1,visible:true,css:{textAlign:"justify"},tooltip:"Justify Full"},justifyLeft:{visible:true,groupIndex:1,css:{textAlign:"left"},tooltip:"Justify Left"},justifyRight:{groupIndex:1,visible:true,css:{textAlign:"right"},tooltip:"Justify Right"},ltr:{groupIndex:10,visible:false,exec:function(){var e=this.dom.getElement("p");if(!e){return false}c(e).attr("dir","ltr");return true},tooltip:"Left to Right"},outdent:{groupIndex:2,visible:true,tooltip:"Outdent"},paragraph:{groupIndex:7,visible:false,className:"paragraph",command:"FormatBlock","arguments":(c.browser.msie||c.browser.safari)?"<p>":"p",tags:["p"],tooltip:"Paragraph"},paste:{groupIndex:8,visible:false,tooltip:"Paste"},redo:{groupIndex:4,visible:true,tooltip:"Redo"},removeFormat:{groupIndex:10,visible:true,exec:function(){this.removeFormat()},tooltip:"Remove formatting"},rtl:{groupIndex:10,visible:false,exec:function(){var e=this.dom.getElement("p");if(!e){return false}c(e).attr("dir","rtl");return true},tooltip:"Right to Left"},strikeThrough:{groupIndex:0,visible:true,tags:["s","strike"],css:{textDecoration:"line-through"},tooltip:"Strike-through"},subscript:{groupIndex:3,visible:true,tags:["sub"],tooltip:"Subscript"},superscript:{groupIndex:3,visible:true,tags:["sup"],tooltip:"Superscript"},underline:{groupIndex:0,visible:true,tags:["u"],css:{textDecoration:"underline"},tooltip:"Underline",hotkey:{ctrl:1,key:85}},undo:{groupIndex:4,visible:true,tooltip:"Undo"},code:{visible:true,groupIndex:6,tooltip:"Code snippet",exec:function(){var e=this.getInternalRange(),f=c(e.commonAncestorContainer),g=e.commonAncestorContainer.nodeName.toLowerCase();if(f.parent("code").length){f.unwrap()}else{if(g!=="body"){f.wrap("<code/>")}}}},cssWrap:{visible:false,groupIndex:6,tooltip:"CSS Wrapper",exec:function(){c.wysiwyg.controls.cssWrap.init(this)}}};this.defaults={html:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" style="margin:0"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body style="margin:0;">INITIAL_CONTENT</body></html>',debug:false,controls:{},css:{},events:{},autoGrow:false,autoSave:true,brIE:true,formHeight:270,formWidth:440,iFrameClass:null,initialContent:"<p>Initial content</p>",maxHeight:10000,maxLength:0,messages:{nonSelection:"Select the text you wish to link"},toolbarHtml:'<ul role="menu" class="toolbar"></ul>',removeHeadings:false,replaceDivWithP:false,resizeOptions:false,rmUnusedControls:false,rmUnwantedBr:true,tableFiller:"Lorem ipsum",initialMinHeight:null,controlImage:{forceRelativeUrls:false},controlLink:{forceRelativeUrls:false},plugins:{autoload:false,i18n:false,rmFormat:{rmMsWordMarkup:false}},dialog:"default"};this.availableControlProperties=["arguments","callback","className","command","css","custom","exec","groupIndex","hotkey","icon","tags","tooltip","visible"];this.editor=null;this.editorDoc=null;this.element=null;this.options={};this.original=null;this.savedRange=null;this.timers=[];this.validKeyCodes=[8,9,13,16,17,18,19,20,27,33,34,35,36,37,38,39,40,45,46];this.isDestroyed=false;this.dom={ie:{parent:null},w3c:{parent:null}};this.dom.parent=this;this.dom.ie.parent=this.dom;this.dom.w3c.parent=this.dom;this.ui={};this.ui.self=this;this.ui.toolbar=null;this.ui.initialHeight=null;this.dom.getAncestor=function(f,e){e=e.toLowerCase();while(f&&typeof f.tagName!="undefined"&&"body"!==f.tagName.toLowerCase()){if(e===f.tagName.toLowerCase()){return f}f=f.parentNode}if(!f.tagName&&(f.previousSibling||f.nextSibling)){if(f.previousSibling){if(f.previousSibling.tagName.toLowerCase()==e){return f.previousSibling}}if(f.nextSibling){if(f.nextSibling.tagName.toLowerCase()==e){return f.nextSibling}}}return null};this.dom.getElement=function(e){var f=this;e=e.toLowerCase();if(window.getSelection){return f.w3c.getElement(e)}else{return f.ie.getElement(e)}};this.dom.ie.getElement=function(f){var h=this.parent,g=h.parent.getInternalSelection(),e=g.createRange(),i;if("Control"===g.type){if(1===e.length){i=e.item(0)}else{return null}}else{i=e.parentElement()}return h.getAncestor(i,f)};this.dom.w3c.getElement=function(f){var g=this.parent,e=g.parent.getInternalRange(),h;if(!e){return null}h=e.commonAncestorContainer;if(3===h.nodeType){h=h.parentNode}if(h===e.startContainer){h=h.childNodes[e.startOffset]}if(!h.tagName&&(h.previousSibiling||h.nextSibling)){if(h.previousSibiling){if(h.previousSibiling.tagName.toLowerCase()==f){return h.previousSibiling}}if(h.nextSibling){if(h.nextSibling.tagName.toLowerCase()==f){return h.nextSibling}}}return g.getAncestor(h,f)};this.ui.addHoverClass=function(){c(this).addClass("wysiwyg-button-hover")};this.ui.appendControls=function(){var j=this,m=this.self,k=m.parseControls(),n=true,l=[],f={},e,h,g=function(o,i){if(i.groupIndex&&h!==i.groupIndex){h=i.groupIndex;n=false}if(!i.visible){return}if(!n){j.appendItemSeparator();n=true}if(i.custom){j.appendItemCustom(o,i)}else{j.appendItem(o,i)}};c.each(k,function(i,o){var p="empty";if(undefined!==o.groupIndex){if(""===o.groupIndex){p="empty"}else{p=o.groupIndex}}if(undefined===f[p]){l.push(p);f[p]={}}f[p][i]=o});l.sort(function(i,o){if("number"===typeof(i)&&typeof(i)===typeof(o)){return(i-o)}else{i=i.toString();o=o.toString();if(i>o){return 1}if(i===o){return 0}return -1}});if(0<l.length){h=l[0]}for(e=0;e<l.length;e+=1){c.each(f[l[e]],g)}};this.ui.appendItem=function(e,f){var i=this.self,h=f.className||f.command||e||"empty",g=f.tooltip||f.command||e||"";return c('<li role="menuitem" unselectable="on">'+(h)+"</li>").addClass(h).attr("title",g).hover(this.addHoverClass,this.removeHoverClass).click(function(){if(c(this).hasClass("disabled")){return false}i.triggerControl.apply(i,[e,f]);this.blur();i.ui.returnRange();i.ui.focus();return true}).appendTo(i.ui.toolbar)};this.ui.appendItemCustom=function(e,f){var h=this.self,g=f.tooltip||f.command||e||"";if(f.callback){c(window).bind("trigger-"+e+".wysiwyg",f.callback)}return c('<li role="menuitem" unselectable="on" style="background: url(\''+f.icon+"') no-repeat;\"></li>").addClass("custom-command-"+e).addClass("wysiwyg-custom-command").addClass(e).attr("title",g).hover(this.addHoverClass,this.removeHoverClass).click(function(){if(c(this).hasClass("disabled")){return false}h.triggerControl.apply(h,[e,f]);this.blur();h.ui.returnRange();h.ui.focus();h.triggerControlCallback(e);return true}).appendTo(h.ui.toolbar)};this.ui.appendItemSeparator=function(){var e=this.self;return c('<li role="separator" class="separator"></li>').appendTo(e.ui.toolbar)};this.autoSaveFunction=function(){this.saveContent()};this.ui.checkTargets=function(f){var e=this.self;c.each(e.options.controls,function(g,h){var i=h.className||h.command||g||"empty",n,m,k,j,l=function(o,p){var q;if("function"===typeof(p)){q=p;if(q(j.css(o).toString().toLowerCase(),e)){e.ui.toolbar.find("."+i).addClass("active")}}else{if(j.css(o).toString().toLowerCase()===p){e.ui.toolbar.find("."+i).addClass("active")}}};if("fullscreen"!==i){e.ui.toolbar.find("."+i).removeClass("active")}if(h.tags||(h.options&&h.options.tags)){n=h.tags||(h.options&&h.options.tags);m=f;while(m){if(m.nodeType!==1){break}if(c.inArray(m.tagName.toLowerCase(),n)!==-1){e.ui.toolbar.find("."+i).addClass("active")}m=m.parentNode}}if(h.css||(h.options&&h.options.css)){k=h.css||(h.options&&h.options.css);j=c(f);while(j){if(j[0].nodeType!==1){break}c.each(k,l);j=j.parent()}}})};this.ui.designMode=function(){var e=3,g=this.self,f;f=function(h){if("on"===g.editorDoc.designMode){if(g.timers.designMode){window.clearTimeout(g.timers.designMode)}if(g.innerDocument()!==g.editorDoc){g.ui.initFrame()}return}try{g.editorDoc.designMode="on"}catch(i){}h-=1;if(h>0){g.timers.designMode=window.setTimeout(function(){f(h)},100)}};f(e)};this.destroy=function(){this.isDestroyed=true;var f,e=this.element.closest("form");for(f=0;f<this.timers.length;f+=1){window.clearTimeout(this.timers[f])}e.unbind(".wysiwyg");this.element.remove();c.removeData(this.original,"wysiwyg");c(this.original).show();return this};this.getRangeText=function(){var e=this.getInternalRange();if(e.toString){e=e.toString()}else{if(e.text){e=e.text}}return e};this.execute=function(e,f){if(typeof(f)==="undefined"){f=null}this.editorDoc.execCommand(e,false,f)};this.extendOptions=function(e){var f={};if("object"===typeof e.controls){f=e.controls;delete e.controls}e=c.extend(true,{},this.defaults,e);e.controls=c.extend(true,{},f,this.controls,f);if(e.rmUnusedControls){c.each(e.controls,function(g){if(!f[g]){delete e.controls[g]}})}return e};this.ui.focus=function(){var e=this.self;e.editor.get(0).contentWindow.focus();return e};this.ui.returnRange=function(){var f=this.self,h;if(f.savedRange!==null){if(window.getSelection){h=window.getSelection();if(h.rangeCount>0){h.removeAllRanges()}try{h.addRange(f.savedRange)}catch(g){d.error(g)}}else{if(window.document.createRange){window.getSelection().addRange(f.savedRange)}else{if(window.document.selection){f.savedRange.select()}}}f.savedRange=null}};this.increaseFontSize=function(){if(c.browser.mozilla||c.browser.opera){this.editorDoc.execCommand("increaseFontSize",false,null)}else{if(c.browser.safari){var i=this.getInternalRange(),h=this.getInternalSelection(),j=this.editorDoc.createElement("big");if(true===i.collapsed&&3===i.commonAncestorContainer.nodeType){var e=i.commonAncestorContainer.nodeValue.toString(),g=e.lastIndexOf(" ",i.startOffset)+1,f=(-1===e.indexOf(" ",i.startOffset))?e:e.indexOf(" ",i.startOffset);i.setStart(i.commonAncestorContainer,g);i.setEnd(i.commonAncestorContainer,f);i.surroundContents(j);h.addRange(i)}else{i.surroundContents(j);h.removeAllRanges();h.addRange(i)}}else{d.error("Internet Explorer?")}}};this.decreaseFontSize=function(){if(c.browser.mozilla||c.browser.opera){this.editorDoc.execCommand("decreaseFontSize",false,null)}else{if(c.browser.safari){var i=this.getInternalRange(),h=this.getInternalSelection(),j=this.editorDoc.createElement("small");if(true===i.collapsed&&3===i.commonAncestorContainer.nodeType){var e=i.commonAncestorContainer.nodeValue.toString(),g=e.lastIndexOf(" ",i.startOffset)+1,f=(-1===e.indexOf(" ",i.startOffset))?e:e.indexOf(" ",i.startOffset);i.setStart(i.commonAncestorContainer,g);i.setEnd(i.commonAncestorContainer,f);i.surroundContents(j);h.addRange(i)}else{i.surroundContents(j);h.removeAllRanges();h.addRange(i)}}else{d.error("Internet Explorer?")}}};this.getContent=function(){if(this.viewHTML){this.setContent(this.original.value)}return this.events.filter("getContent",this.editorDoc.body.innerHTML)};this.events={_events:{},bind:function(e,f){if(typeof(this._events.eventName)!=="object"){this._events[e]=[]}this._events[e].push(f)},trigger:function(f,e){if(typeof(this._events.eventName)==="object"){var g=this.editor;c.each(this._events[f],function(i,h){if(typeof(h)==="function"){h.apply(g,e)}})}},filter:function(g,f){if(typeof(this._events[g])==="object"){var h=this.editor,e=Array.prototype.slice.call(arguments,1);c.each(this._events[g],function(j,i){if(typeof(i)==="function"){f=i.apply(h,e)}})}return f}};this.getElementByAttributeValue=function(k,f,g){var j,e,h=this.editorDoc.getElementsByTagName(k);for(j=0;j<h.length;j+=1){e=h[j].getAttribute(f);if(c.browser.msie){e=e.substr(e.length-g.length)}if(e===g){return h[j]}}return false};this.getInternalRange=function(){var e=this.getInternalSelection();if(!e){return null}if(e.rangeCount&&e.rangeCount>0){return e.getRangeAt(0)}else{if(e.createRange){return e.createRange()}}return null};this.getInternalSelection=function(){if(this.editor.get(0).contentWindow){if(this.editor.get(0).contentWindow.getSelection){return this.editor.get(0).contentWindow.getSelection()}if(this.editor.get(0).contentWindow.selection){return this.editor.get(0).contentWindow.selection}}if(this.editorDoc.getSelection){return this.editorDoc.getSelection()}if(this.editorDoc.selection){return this.editorDoc.selection}return null};this.getRange=function(){var e=this.getSelection();if(!e){return null}if(e.rangeCount&&e.rangeCount>0){e.getRangeAt(0)}else{if(e.createRange){return e.createRange()}}return null};this.getSelection=function(){return(window.getSelection)?window.getSelection():window.document.selection};this.ui.grow=function(){var i=this.self,f=c(i.editorDoc.body),g=c.browser.msie?f[0].scrollHeight:f.height()+2+20,h=i.ui.initialHeight,e=Math.max(g,h);e=Math.min(e,i.options.maxHeight);i.editor.attr("scrolling",e<i.options.maxHeight?"no":"auto");f.css("overflow",e<i.options.maxHeight?"hidden":"");i.editor.get(0).height=e;return i};this.init=function(i,j){var h=this,f=c(i).closest("form"),e=i.width||i.clientWidth||0,g=i.height||i.clientHeight||0;this.options=this.extendOptions(j);this.original=i;this.ui.toolbar=c(this.options.toolbarHtml);if(c.browser.msie&&parseInt(c.browser.version,10)<8){this.options.autoGrow=false}if(e===0&&i.cols){e=(i.cols*8)+21}if(g===0&&i.rows){g=(i.rows*16)+16}this.editor=c(window.location.protocol==="https:"?'<iframe src="javascript:false;"></iframe>':"<iframe></iframe>").attr("frameborder","0");if(this.options.iFrameClass){this.editor.addClass(this.options.iFrameClass)}else{this.editor.css({minHeight:(g-6).toString()+"px",width:(e>50)?(e-8).toString()+"px":""});if(c.browser.msie&&parseInt(c.browser.version,10)<7){this.editor.css("height",g.toString()+"px")}}this.editor.attr("tabindex",c(i).attr("tabindex"));this.element=c("<div/>").addClass("wysiwyg");if(!this.options.iFrameClass){this.element.css({width:(e>0)?e.toString()+"px":"100%"})}c(i).hide().before(this.element);this.viewHTML=false;this.initialContent=c(i).val();this.ui.initFrame();if(this.options.resizeOptions&&c.fn.resizable){this.element.resizable(c.extend(true,{alsoResize:this.editor},this.options.resizeOptions))}if(this.options.autoSave){f.bind("submit.wysiwyg",function(){h.autoSaveFunction()})}f.bind("reset.wysiwyg",function(){h.resetFunction()})};this.ui.initFrame=function(){var i=this.self,f,h,g;i.ui.appendControls();i.element.append(i.ui.toolbar).append(c("<div><!-- --></div>").css({clear:"both"})).append(i.editor);i.editorDoc=i.innerDocument();if(i.isDestroyed){return null}i.ui.designMode();i.editorDoc.open();i.editorDoc.write(i.options.html.replace(/INITIAL_CONTENT/,function(){return i.wrapInitialContent()}));i.editorDoc.close();c.wysiwyg.plugin.bind(i);c(i.editorDoc).trigger("initFrame.wysiwyg");c(i.editorDoc).bind("click.wysiwyg",function(j){i.ui.checkTargets(j.target?j.target:j.srcElement)});c(i.original).focus(function(){if(c(this).filter(":visible").length===0){return}i.ui.focus()});c(i.editorDoc).keydown(function(j){var k;if(j.keyCode===8){k=/^<([\w]+)[^>]*>(<br\/?>)?<\/\1>$/;if(k.test(i.getContent())){j.stopPropagation();return false}}return true});if(!c.browser.msie){c(i.editorDoc).keydown(function(j){var k;if(j.ctrlKey||j.metaKey){for(k in i.controls){if(i.controls[k].hotkey&&i.controls[k].hotkey.ctrl){if(j.keyCode===i.controls[k].hotkey.key){i.triggerControl.apply(i,[k,i.controls[k]]);return false}}}}return true})}else{if(i.options.brIE){c(i.editorDoc).keydown(function(j){if(j.keyCode===13){var k=i.getRange();k.pasteHTML("<br/>");k.collapse(false);k.select();return false}return true})}}if(i.options.plugins.rmFormat.rmMsWordMarkup){c(i.editorDoc).bind("keyup.wysiwyg",function(j){if(j.ctrlKey||j.metaKey){if(86===j.keyCode){if(c.wysiwyg.rmFormat){if("object"===typeof(i.options.plugins.rmFormat.rmMsWordMarkup)){c.wysiwyg.rmFormat.run(i,{rules:{msWordMarkup:i.options.plugins.rmFormat.rmMsWordMarkup}})}else{c.wysiwyg.rmFormat.run(i,{rules:{msWordMarkup:{enabled:true}}})}}}}})}if(i.options.autoSave){c(i.editorDoc).keydown(function(){i.autoSaveFunction()}).keyup(function(){i.autoSaveFunction()}).mousedown(function(){i.autoSaveFunction()}).bind(c.support.noCloneEvent?"input.wysiwyg":"paste.wysiwyg",function(){i.autoSaveFunction()})}if(i.options.autoGrow){if(i.options.initialMinHeight!==null){i.ui.initialHeight=i.options.initialMinHeight}else{i.ui.initialHeight=c(i.editorDoc).height()}c(i.editorDoc.body).css("border","1px solid white");h=function(){i.ui.grow()};c(i.editorDoc).keyup(h);c(i.editorDoc).bind("editorRefresh.wysiwyg",h);i.ui.grow()}if(i.options.css){if(String===i.options.css.constructor){if(c.browser.msie){f=i.editorDoc.createStyleSheet(i.options.css);c(f).attr({media:"all"})}else{f=c("<link/>").attr({href:i.options.css,media:"all",rel:"stylesheet",type:"text/css"});c(i.editorDoc).find("head").append(f)}}else{i.timers.initFrame_Css=window.setTimeout(function(){c(i.editorDoc.body).css(i.options.css)},0)}}if(i.initialContent.length===0){if("function"===typeof(i.options.initialContent)){i.setContent(i.options.initialContent())}else{i.setContent(i.options.initialContent)}}if(i.options.maxLength>0){c(i.editorDoc).keydown(function(j){if(c(i.editorDoc).text().length>=i.options.maxLength&&c.inArray(j.which,i.validKeyCodes)===-1){j.preventDefault()}})}c.each(i.options.events,function(j,k){c(i.editorDoc).bind(j+".wysiwyg",function(l){k.apply(i.editorDoc,[l,i])})});if(c.browser.msie){c(i.editorDoc).bind("beforedeactivate.wysiwyg",function(){i.savedRange=i.getInternalRange()})}else{c(i.editorDoc).bind("blur.wysiwyg",function(){i.savedRange=i.getInternalRange()})}c(i.editorDoc.body).addClass("wysiwyg");if(i.options.events&&i.options.events.save){g=i.options.events.save;c(i.editorDoc).bind("keyup.wysiwyg",g);c(i.editorDoc).bind("change.wysiwyg",g);if(c.support.noCloneEvent){c(i.editorDoc).bind("input.wysiwyg",g)}else{c(i.editorDoc).bind("paste.wysiwyg",g);c(i.editorDoc).bind("cut.wysiwyg",g)}}if(i.options.xhtml5&&i.options.unicode){var e={ne:8800,le:8804,para:182,xi:958,darr:8595,nu:957,oacute:243,Uacute:218,omega:969,prime:8242,pound:163,igrave:236,thorn:254,forall:8704,emsp:8195,lowast:8727,brvbar:166,alefsym:8501,nbsp:160,delta:948,clubs:9827,lArr:8656,Omega:937,Auml:196,cedil:184,and:8743,plusmn:177,ge:8805,raquo:187,uml:168,equiv:8801,laquo:171,rdquo:8221,Epsilon:917,divide:247,fnof:402,chi:967,Dagger:8225,iacute:237,rceil:8969,sigma:963,Oslash:216,acute:180,frac34:190,lrm:8206,upsih:978,Scaron:352,part:8706,exist:8707,nabla:8711,image:8465,prop:8733,zwj:8205,omicron:959,aacute:225,Yuml:376,Yacute:221,weierp:8472,rsquo:8217,otimes:8855,kappa:954,thetasym:977,harr:8596,Ouml:214,Iota:921,ograve:242,sdot:8901,copy:169,oplus:8853,acirc:226,sup:8835,zeta:950,Iacute:205,Oacute:211,crarr:8629,Nu:925,bdquo:8222,lsquo:8216,apos:39,Beta:914,eacute:233,egrave:232,lceil:8968,Kappa:922,piv:982,Ccedil:199,ldquo:8220,Xi:926,cent:162,uarr:8593,hellip:8230,Aacute:193,ensp:8194,sect:167,Ugrave:217,aelig:230,ordf:170,curren:164,sbquo:8218,macr:175,Phi:934,Eta:919,rho:961,Omicron:927,sup2:178,euro:8364,aring:229,Theta:920,mdash:8212,uuml:252,otilde:245,eta:951,uacute:250,rArr:8658,nsub:8836,agrave:224,notin:8713,ndash:8211,Psi:936,Ocirc:212,sube:8838,szlig:223,micro:181,not:172,sup1:185,middot:183,iota:953,ecirc:234,lsaquo:8249,thinsp:8201,sum:8721,ntilde:241,scaron:353,cap:8745,atilde:227,lang:10216,__replacement:65533,isin:8712,gamma:947,Euml:203,ang:8736,upsilon:965,Ntilde:209,hearts:9829,Alpha:913,Tau:932,spades:9824,dagger:8224,THORN:222,"int":8747,lambda:955,Eacute:201,Uuml:220,infin:8734,rlm:8207,Aring:197,ugrave:249,Egrave:200,Acirc:194,rsaquo:8250,ETH:208,oslash:248,alpha:945,Ograve:210,Prime:8243,mu:956,ni:8715,real:8476,bull:8226,beta:946,icirc:238,eth:240,prod:8719,larr:8592,ordm:186,perp:8869,Gamma:915,reg:174,ucirc:251,Pi:928,psi:968,tilde:732,asymp:8776,zwnj:8204,Agrave:192,deg:176,AElig:198,times:215,Delta:916,sim:8764,Otilde:213,Mu:924,uArr:8657,circ:710,theta:952,Rho:929,sup3:179,diams:9830,tau:964,Chi:935,frac14:188,oelig:339,shy:173,or:8744,dArr:8659,phi:966,iuml:239,Lambda:923,rfloor:8971,iexcl:161,cong:8773,ccedil:231,Icirc:206,frac12:189,loz:9674,rarr:8594,cup:8746,radic:8730,frasl:8260,euml:235,OElig:338,hArr:8660,Atilde:195,Upsilon:933,there4:8756,ouml:246,oline:8254,Ecirc:202,yacute:253,auml:228,permil:8240,sigmaf:962,iquest:191,empty:8709,pi:960,Ucirc:219,supe:8839,Igrave:204,yen:165,rang:10217,trade:8482,lfloor:8970,minus:8722,Zeta:918,sub:8834,epsilon:949,yuml:255,Sigma:931,Iuml:207,ocirc:244};i.events.bind("getContent",function(j){return j.replace(/&(?:amp;)?(?!amp|lt|gt|quot)([a-z][a-z0-9]*);/gi,function(k,l){if(!e[l]){l=l.toLowerCase();if(!e[l]){l="__replacement"}}var m=e[l];return String.fromCharCode(m)})})}c(i.original).trigger("ready.jwysiwyg",[i.editorDoc,i])};this.innerDocument=function(){var e=this.editor.get(0);if(e.nodeName.toLowerCase()==="iframe"){if(e.contentDocument){return e.contentDocument}else{if(e.contentWindow){return e.contentWindow.document}}if(this.isDestroyed){return null}d.error("Unexpected error in innerDocument")}return e};this.insertHtml=function(g){var f,e;if(!g||g.length===0){return this}if(c.browser.msie){this.ui.focus();this.editorDoc.execCommand("insertImage",false,"#jwysiwyg#");f=this.getElementByAttributeValue("img","src","#jwysiwyg#");if(f){c(f).replaceWith(g)}}else{if(c.browser.mozilla){if(1===c(g).length){e=this.getInternalRange();e.deleteContents();e.insertNode(c(g).get(0))}else{this.editorDoc.execCommand("insertHTML",false,g)}}else{if(!this.editorDoc.execCommand("insertHTML",false,g)){this.editor.focus();this.editorDoc.execCommand("insertHTML",false,g)}}}this.saveContent();return this};this.parseControls=function(){var e=this;c.each(this.options.controls,function(g,f){c.each(f,function(h){if(-1===c.inArray(h,e.availableControlProperties)){throw g+'["'+h+'"]: property "'+h+'" not exists in Wysiwyg.availableControlProperties'}})});if(this.options.parseControls){return this.options.parseControls.call(this)}return this.options.controls};this.removeFormat=function(){if(c.browser.msie){this.ui.focus()}if(this.options.removeHeadings){this.editorDoc.execCommand("formatBlock",false,"<p>")}this.editorDoc.execCommand("removeFormat",false,null);this.editorDoc.execCommand("unlink",false,null);if(c.wysiwyg.rmFormat&&c.wysiwyg.rmFormat.enabled){if("object"===typeof(this.options.plugins.rmFormat.rmMsWordMarkup)){c.wysiwyg.rmFormat.run(this,{rules:{msWordMarkup:this.options.plugins.rmFormat.rmMsWordMarkup}})}else{c.wysiwyg.rmFormat.run(this,{rules:{msWordMarkup:{enabled:true}}})}}return this};this.ui.removeHoverClass=function(){c(this).removeClass("wysiwyg-button-hover")};this.resetFunction=function(){this.setContent(this.initialContent)};this.saveContent=function(){if(this.viewHTML){return}if(this.original){var e,f;e=this.getContent();if(this.options.rmUnwantedBr){e=e.replace(/<br\/?>$/,"")}if(this.options.replaceDivWithP){f=c("<div/>").addClass("temp").append(e);f.children("div").each(function(){var h=c(this),j=h.find("p"),g;if(0===j.length){j=c("<p></p>");if(this.attributes.length>0){for(g=0;g<this.attributes.length;g+=1){j.attr(this.attributes[g].name,h.attr(this.attributes[g].name))}}j.append(h.html());h.replaceWith(j)}});e=f.html()}c(this.original).val(e);if(this.options.events&&this.options.events.save){this.options.events.save.call(this)}}return this};this.setContent=function(e){this.editorDoc.body.innerHTML=e;this.saveContent();return this};this.triggerControl=function(f,h){var i=h.command||f,g=h["arguments"]||[];if(h.exec){h.exec.apply(this)}else{this.ui.focus();this.ui.withoutCss();try{this.editorDoc.execCommand(i,false,g)}catch(j){d.error(j)}}if(this.options.autoSave){this.autoSaveFunction()}};this.triggerControlCallback=function(e){c(window).trigger("trigger-"+e+".wysiwyg",[this])};this.ui.withoutCss=function(){var g=this.self;if(c.browser.mozilla){try{g.editorDoc.execCommand("styleWithCSS",false,false)}catch(h){try{g.editorDoc.execCommand("useCSS",false,true)}catch(f){}}}return g};this.wrapInitialContent=function(){var f=this.initialContent,e=f.match(/<\/?p>/gi);if(!e){return"<p>"+f+"</p>"}else{}return f}}c.wysiwyg={messages:{noObject:"Something goes wrong, check object"},addControl:function(g,e,f){return g.each(function(){var j=c(this).data("wysiwyg"),i={},h;if(!j){return this}i[e]=c.extend(true,{visible:true,custom:true},f);c.extend(true,j.options.controls,i);h=c(j.options.toolbarHtml);j.ui.toolbar.replaceWith(h);j.ui.toolbar=h;j.ui.appendControls()})},clear:function(e){return e.each(function(){var f=c(this).data("wysiwyg");if(!f){return this}f.setContent("")})},console:d,destroy:function(e){return e.each(function(){var f=c(this).data("wysiwyg");if(!f){return this}f.destroy()})},document:function(e){var f=e.data("wysiwyg");if(!f){return undefined}return c(f.editorDoc)},getContent:function(e){var f=e.data("wysiwyg");if(!f){return undefined}return f.getContent()},init:function(e,f){return e.each(function(){var g=c.extend(true,{},f),h;if(("textarea"!==this.nodeName.toLowerCase())||c(this).data("wysiwyg")){return}h=new a();h.init(this,g);c.data(this,"wysiwyg",h);c(h.editorDoc).trigger("afterInit.wysiwyg")})},insertHtml:function(e,f){return e.each(function(){var g=c(this).data("wysiwyg");if(!g){return this}g.insertHtml(f)})},plugin:{listeners:{},bind:function(e){var f=this;c.each(this.listeners,function(g,k){var j,h;for(j=0;j<k.length;j+=1){h=f.parseName(k[j]);c(e.editorDoc).bind(g+".wysiwyg",{plugin:h},function(i){c.wysiwyg[i.data.plugin.name][i.data.plugin.method].apply(c.wysiwyg[i.data.plugin.name],[e])})}})},exists:function(e){var f;if("string"!==typeof(e)){return false}f=this.parseName(e);if(!c.wysiwyg[f.name]||!c.wysiwyg[f.name][f.method]){return false}return true},listen:function(e,g){var f;f=this.parseName(g);if(!c.wysiwyg[f.name]||!c.wysiwyg[f.name][f.method]){return false}if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(g);return true},parseName:function(e){var f;if("string"!==typeof(e)){return false}f=e.split(".");if(2>f.length){return false}return{name:f[0],method:f[1]}},register:function(e){if(!e.name){d.error("Plugin name missing")}c.each(c.wysiwyg,function(f){if(f===e.name){d.error("Plugin with name '"+e.name+"' was already registered")}});c.wysiwyg[e.name]=e;return true}},removeFormat:function(e){return e.each(function(){var f=c(this).data("wysiwyg");if(!f){return this}f.removeFormat()})},save:function(e){return e.each(function(){var f=c(this).data("wysiwyg");if(!f){return this}f.saveContent()})},selectAll:function(g){var h=g.data("wysiwyg"),e,f,i;if(!h){return this}e=h.editorDoc.body;if(window.getSelection){i=h.getInternalSelection();i.selectAllChildren(e)}else{f=e.createTextRange();f.moveToElementText(e);f.select()}},setContent:function(f,e){return f.each(function(){var g=c(this).data("wysiwyg");if(!g){return this}g.setContent(e)})},triggerControl:function(e,f){return e.each(function(){var g=c(this).data("wysiwyg");if(!g){return this}if(!g.controls[f]){d.error("Control '"+f+"' not exists")}g.triggerControl.apply(g,[f,g.controls[f]])})},support:{prop:b},utils:{extraSafeEntities:[["<",">","'",'"'," "],[32]],encodeEntities:function(f){var g=this,h,e=[];if(this.extraSafeEntities[1].length===0){c.each(this.extraSafeEntities[0],function(j,k){g.extraSafeEntities[1].push(k.charCodeAt(0))})}h=f.split("");c.each(h,function(j){var k=h[j].charCodeAt(0);if(c.inArray(k,g.extraSafeEntities[1])&&(k<65||k>127||(k>90&&k<97))){e.push("&#"+k+";")}else{e.push(h[j])}});return e.join("")}}};c.wysiwyg.dialog=function(j,e){var i=(j&&j.options&&j.options.dialog)?j.options.dialog:(e.theme?e.theme:"default"),f=new c.wysiwyg.dialog.createDialog(i),h=this,g=c(h);this.options={modal:true,draggable:true,title:"Title",content:"Content",width:"auto",height:"auto",open:false,close:false};this.isOpen=false;c.extend(this.options,e);this.object=f;this.open=function(){this.isOpen=true;f.init.apply(h,[]);var k=f.show.apply(h,[]);g.trigger("afterOpen",[k])};this.show=function(){this.isOpen=true;g.trigger("beforeShow");var k=f.show.apply(h,[]);g.trigger("afterShow")};this.hide=function(){this.isOpen=false;g.trigger("beforeHide");var k=f.hide.apply(h,[]);g.trigger("afterHide",[k])};this.close=function(){this.isOpen=false;var k=f.hide.apply(h,[]);g.trigger("beforeClose",[k]);f.destroy.apply(h,[]);g.trigger("afterClose",[k])};if(this.options.open){g.bind("afterOpen",this.options.open)}if(this.options.close){g.bind("afterClose",this.options.close)}return this};c.extend(true,c.wysiwyg.dialog,{_themes:{},_theme:"",register:function(e,f){c.wysiwyg.dialog._themes[e]=f},deregister:function(e){delete c.wysiwyg.dialog._themes[e]},createDialog:function(e){return new (c.wysiwyg.dialog._themes[e])}});c(function(){if(jQuery.ui){c.wysiwyg.dialog.register("jqueryui",function(){var e=this;this._$dialog=null;this.init=function(){var f=this,h=this.options.content;if(typeof h==="object"){if(typeof h.html==="function"){h=h.html()}else{if(typeof h.toString==="function"){h=h.toString()}}}e._$dialog=c("<div></div>").attr("title",this.options.title).html(h);var g=this.options.height=="auto"?300:this.options.height,i=this.options.width=="auto"?450:this.options.width;e._$dialog.dialog({modal:this.options.modal,draggable:this.options.draggable,height:g,width:i});return e._$dialog};this.show=function(){e._$dialog.dialog("open");return e._$dialog};this.hide=function(){e._$dialog.dialog("close");return e._$dialog};this.destroy=function(){e._$dialog.dialog("destroy");return e._$dialog}})}c.wysiwyg.dialog.register("default",function(){var e=this;this._$dialog=null;this.init=function(){var f=this,j=this.options.content;if(typeof j==="object"){if(typeof j.html==="function"){j=j.html()}else{if(typeof j.toString==="function"){j=j.toString()}}}e._$dialog=c('<div class="wysiwyg-dialog"></div>');var i=c('<div class="wysiwyg-dialog-topbar"><div class="wysiwyg-dialog-close-wrapper"></div><div class="wysiwyg-dialog-title">'+this.options.title+"</div></div>");var h=c('<a href="#" class="wysiwyg-dialog-close-button">X</a>');h.click(function(){f.close()});i.find(".wysiwyg-dialog-close-wrapper").prepend(h);var k=c('<div class="wysiwyg-dialog-content">'+j+"</div>");e._$dialog.append(i).append(k);var g=this.options.height=="auto"?300:this.options.height,l=this.options.width=="auto"?450:this.options.width;e._$dialog.hide().css({width:l,height:g,left:((c(window).width()-l)/2),top:((c(window).height()-g)/3)});c("body").append(e._$dialog);return e._$dialog};this.show=function(){if(this.options.modal){e._$dialog.wrap('<div class="wysiwyg-dialog-modal-div"></div>')}if(this.options.draggable){var f=false;e._$dialog.find("div.wysiwyg-dialog-topbar").bind("mousedown",function(j){j.preventDefault();c(this).css({cursor:"move"});var i=c(this),h=c(this).parents(".wysiwyg-dialog"),k=(j.pageX-parseInt(h.css("left"),10)),g=(j.pageY-parseInt(h.css("top"),10));f=true;c(this).css({cursor:"move"});c(document).bind("mousemove",function(l){l.preventDefault();if(f){h.css({top:(l.pageY-g),left:(l.pageX-k)})}}).bind("mouseup",function(l){l.preventDefault();f=false;i.css({cursor:"auto"});c(document).unbind("mousemove").unbind("mouseup")})})}e._$dialog.show();return e._$dialog};this.hide=function(){e._$dialog.hide();return e._$dialog};this.destroy=function(){if(this.options.modal){e._$dialog.unwrap()}if(this.options.draggable){e._$dialog.find("div.wysiwyg-dialog-topbar").unbind("mousedown")}e._$dialog.remove();return e._$dialog}})});c.fn.wysiwyg=function(e){var f=arguments,g;if("undefined"!==typeof c.wysiwyg[e]){f=Array.prototype.concat.call([f[0]],[this],Array.prototype.slice.call(f,1));return c.wysiwyg[e].apply(c.wysiwyg,Array.prototype.slice.call(f,1))}else{if("object"===typeof e||!e){Array.prototype.unshift.call(f,this);return c.wysiwyg.init.apply(c.wysiwyg,f)}else{if(c.wysiwyg.plugin.exists(e)){g=c.wysiwyg.plugin.parseName(e);f=Array.prototype.concat.call([f[0]],[this],Array.prototype.slice.call(f,1));return c.wysiwyg[g.name][g.method].apply(c.wysiwyg[g.name],Array.prototype.slice.call(f,1))}else{d.error("Method '"+e+"' does not exist on jQuery.wysiwyg.\nTry to include some extra controls or plugins")}}}};c.fn.getWysiwyg=function(){return c.data(this,"wysiwyg")}})(jQuery);/*!
 * jQuery UI 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_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)},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!==j)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"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":
"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,
outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,
"tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{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,h,i){return c.ui.isOverAxis(a,d,h)&&
c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
 * jQuery UI Widget 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=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(){try{b(this).triggerHandler("remove")}catch(d){}});return l.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(true,{},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.charAt(0)==="_")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!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():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){b.data(c,this.widgetName,this);this.element=b(c);this.options=
b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_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;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_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);
;/*!
 * jQuery UI Mouse 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.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}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
!(document.documentMode>=9)&&!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){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);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);
;/*
 * jQuery UI Sortable 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Sortables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(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(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");
this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):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({target:null});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}}}if(this.placeholder){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]))});!c.length&&a.key&&c.push(a.key+"=");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];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var 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.parent().length&&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.16"})})(jQuery);
;(function(a){if(undefined===a.wysiwyg){throw"wysiwyg.link.js depends on $.wysiwyg"}if(!a.wysiwyg.controls){a.wysiwyg.controls={}}a.wysiwyg.controls.link={init:function(b){var o=this,f,p,g,h,d,m,n,l,j,i,c,e;n={legend:"Insert Link",url:"Link URL",title:"Link Title",target:"Link Target",submit:"Insert Link",reset:"Cancel"};m='<form class="wysiwyg"><fieldset><legend>{legend}</legend><label>{url}: <input type="text" name="linkhref" value=""/></label><label>{title}: <input type="text" name="linktitle" value=""/></label><label>{target}: <input type="text" name="linktarget" value=""/></label><input type="submit" class="button" value="{submit}"/> <input type="reset" value="{reset}"/></fieldset></form>';for(l in n){if(a.wysiwyg.i18n){j=a.wysiwyg.i18n.t(n[l],"dialogs.link");if(j===n[l]){j=a.wysiwyg.i18n.t(n[l],"dialogs")}n[l]=j}i=new RegExp("{"+l+"}","g");m=m.replace(i,n[l])}h={self:b.dom.getElement("a"),href:"http://",title:"",target:""};if(h.self){h.href=h.self.href?h.self.href:h.href;h.title=h.self.title?h.self.title:"";h.target=h.self.target?h.self.target:""}if(a.fn.dialog){f=a(m);f.find("input[name=linkhref]").val(h.href);f.find("input[name=linktitle]").val(h.title);f.find("input[name=linktarget]").val(h.target);if(a.browser.msie){try{p=f.appendTo(b.editorDoc.body)}catch(k){p=f.appendTo("body")}}else{p=f.appendTo("body")}p.dialog({modal:true,open:function(q,r){a("input:submit",p).click(function(w){w.preventDefault();var v=a('input[name="linkhref"]',p).val(),s=a('input[name="linktitle"]',p).val(),x=a('input[name="linktarget"]',p).val(),t,u;if(b.options.controlLink.forceRelativeUrls){t=window.location.protocol+"//"+window.location.hostname;if(0===v.indexOf(t)){v=v.substr(t.length)}}if(h.self){if("string"===typeof(v)){if(v.length>0){a(h.self).attr("href",v).attr("title",s).attr("target",x)}else{a(h.self).replaceWith(h.self.innerHTML)}}}else{if(a.browser.msie){b.ui.returnRange()}d=b.getRangeText();u=b.dom.getElement("img");if((d&&d.length>0)||u){if(a.browser.msie){b.ui.focus()}if("string"===typeof(v)){if(v.length>0){b.editorDoc.execCommand("createLink",false,v)}else{b.editorDoc.execCommand("unlink",false,null)}}h.self=b.dom.getElement("a");a(h.self).attr("href",v).attr("title",s);a(h.self).attr("target",x)}else{if(b.options.messages.nonSelection){window.alert(b.options.messages.nonSelection)}}}b.saveContent();a(p).dialog("close")});a("input:reset",p).click(function(s){s.preventDefault();a(p).dialog("close")})},close:function(q,r){p.dialog("destroy");p.remove()}})}else{if(h.self){g=window.prompt("URL",h.href);if(b.options.controlLink.forceRelativeUrls){c=window.location.protocol+"//"+window.location.hostname;if(0===g.indexOf(c)){g=g.substr(c.length)}}if("string"===typeof(g)){if(g.length>0){a(h.self).attr("href",g)}else{a(h.self).replaceWith(h.self.innerHTML)}}}else{d=b.getRangeText();e=b.dom.getElement("img");if((d&&d.length>0)||e){if(a.browser.msie){b.ui.focus();b.editorDoc.execCommand("createLink",true,null)}else{g=window.prompt(n.url,h.href);if(b.options.controlLink.forceRelativeUrls){c=window.location.protocol+"//"+window.location.hostname;if(0===g.indexOf(c)){g=g.substr(c.length)}}if("string"===typeof(g)){if(g.length>0){b.editorDoc.execCommand("createLink",false,g)}else{b.editorDoc.execCommand("unlink",false,null)}}}}else{if(b.options.messages.nonSelection){window.alert(b.options.messages.nonSelection)}}}b.saveContent()}a(b.editorDoc).trigger("editorRefresh.wysiwyg")}};a.wysiwyg.createLink=function(c,b){return c.each(function(){var e=a(this).data("wysiwyg"),d;if(!e){return this}if(!b||b.length===0){return this}d=e.getRangeText();if(d&&d.length>0){if(a.browser.msie){e.ui.focus()}e.editorDoc.execCommand("unlink",false,null);e.editorDoc.execCommand("createLink",false,b)}else{if(e.options.messages.nonSelection){window.alert(e.options.messages.nonSelection)}}return this})}})(jQuery);var ur=ur||{};ur.MenuSystem=function(e,d){var a=new xnjs.GameComponent(e);var b=system.Class.inherit(a);function c(){a.updateOrder.set(3)}a.initialize=function(){var k=d.find("ul");d.addClass("menu-system");for(var j=k.length-1;j>=0;j--){var g=$(k[j]);var h=new ur.Menu(e,g);h.initialize();var f=g.parent().parent().parent().parent();f.hover(h.show,h.hide);d.click(h.hide)}};c();return a};if(!Array.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a}}return -1}};var system=system||{};system.Class=function(){};system.Class.inherit=function(c){var a={};for(var b in c){a[b]=c[b]}return a};var system=system||{};system.Event=function(){var a=new Array();this.subscribe=function(b){a.push(b)};this.unsubscribe=function(b){var c=a.indexOf(b);if(c>=0){a.splice(c,1)}else{console.log("Unsubscribing unknown delegate")}};this.raise=function(b,d){for(var c=0;c<a.length;c++){a[c](b,d)}}};var xnjs=xnjs||{};xnjs.Game=function(){var a=this;var g;var c;var e;var f;function d(){g=new xnjs.GameHost(a);c=new xnjs.GameComponentCollection();c.componentAdded.subscribe(b);e=new xnjs.GameServiceContainer()}this.window=function(){return g.window()};this.components=function(){return c};this.services=function(){return e};this.run=function(){g.initialize();a.initialize();window.setTimeout(a.update,500)};this.initialize=function(){for(var h=0;h<c.length;h++){c[h].initialize()}f=true};this.update=function(){for(var h=0;h<c.length;h++){if(c[h].enabled()){c[h].update()}}};function b(h,i){if(f){i.gameComponent.initialize()}}d()};var xnjs=xnjs||{};xnjs.GameComponent=function(e){var a=this;var b=true;var c=0;function d(){}this.game=function(){return e};this.enabled=function(){return b};this.enabled.set=function(f){b=f};this.updateOrder=function(){return c};this.updateOrder.set=function(f){c=f};this.initialize=function(){};this.update=function(){};d()};var xnjs=xnjs||{};xnjs.GameComponentCollection=function(){var a=new Array();a.componentAdded=new system.Event();a.componentRemoved=new system.Event();function b(){}a.add=function(c){a.push(c);a.sort(function(d,e){return d.updateOrder()-e.updateOrder()});a.componentAdded.raise(a,{gameComponent:c})};a.remove=function(c){var d=a.indexOf(c);a.splice(d);a.componentRemoved.raise(a,{gameComponent:c})};b();return a};var xnjs=xnjs||{};xnjs.GameHost=function(c){var a;function b(){a=new xnjs.GameWindow()}this.initialize=function(){a.initialize()};this.window=function(){return a};b()};var xnjs=xnjs||{};xnjs.GameServiceContainer=function(){var a=this;var b={};function c(){}this.addService=function(d,e){b[d]=e};this.removeService=function(d){b[d]=undefined};this.getService=function(d){return b[d]};c();return a};var xnjs=xnjs||{};xnjs.GameWindow=function(){this.clientSizeChanged=new system.Event();var a=this;var b;function e(){b=xnjs.Rectangle.empty();$(window).resize(function(){d()})}this.clientBounds=function(){return b};this.initialize=function(){c()};function d(){c();a.clientSizeChanged.raise(a,{})}function c(){b.width=$(window).width();b.height=$(window).height()}e()};var xnjs=xnjs||{};xnjs.Point=function(a,b){this.x=null;this.y=null;var c=this;function d(){c.x=a;c.y=b}this.equals=function(e){return e&&e.x==c.x&&e.y==c.y};this.toString=function(){return"Point {  X="+this.x+", Y="+this.y+"  }"};d()};xnjs.Point.zero=function(){return new xnjs.Point(0,0)};var xnjs=xnjs||{};xnjs.Rectangle=function(b,c,d,e){this.x=null;this.y=null;this.width=null;this.height=null;var f=this;function a(){f.x=b;f.y=c;f.width=d;f.height=e}this.left=function(){return f.x};this.right=function(){return f.x+f.width};this.top=function(){return f.y};this.bottom=function(){return f.y+f.height};this.location=function(){return new xnjs.Point(f.x,f.y)};this.location.set=function(g){f.x=g.x;f.y=g.y};this.center=function(){return new xnjs.Point(f.x+f.width/2,f.y+f.height/2)};this.isEmpty=function(){return f.x==0&&f.y==0&&f.width==0&f.height==0};this.equals=function(g){return g&&g.x==f.x&&g.y==f.y&&g.width==f.width&&g.height==f.height};this.toString=function(){return"Rectangle {  X="+this.x+", Y="+this.y+", Width="+this.width+", Height="+this.height+"  }"};a()};xnjs.Rectangle.empty=function(){return new xnjs.Rectangle(0,0,0,0)};var ae=ae||{};ae.Countdown=function(f,a){var b=this;var e=0;function d(){if(a){e=a}}b.increase=function(){e++};b.start=function(){c()};b.decrease=function(){e--;c()};function c(){if(e==0){f()}}d()};var ur=ur||{};ur.Background=function(g){var d=new xnjs.GameComponent(g);var c=system.Class.inherit(d);var h;var a=[];var f=0;var b=false;function e(){d.updateOrder.set(-1);g.services().addService("Background",d)}d.sectionsCount=function(){return a.length};d.section=function(i){return a[i]};d.currentIndex=function(){return f};d.currentSection=function(){return a[f]};d.scrolling=function(){return b};d.initialize=function(){$("body").prepend("<div id='background'><div id='background-container'><div id='left-gutter' class='gutter'></div><div id='right-gutter' class='gutter'></div><div id='background-content'><div id='background-frame'></div></div></div></div>");h=$("#background-frame")};d.addSection=function(i){var j=a.length;a.push(i);h.append("<div id='background-section-"+j+"' class='section'></div>");i.backgroundElement.set($("#background-section-"+j));if(j<2){i.initialize()}};d.scrollToSection=function(k){if(f==k){return}f=k;for(var j=Math.max(0,f-1);j<Math.min(f+2,a.length);j++){if(!a[j].initialized()){a[j].initialize()}}if(b){h.stop()}b=true;h.animate({top:-f*100+"%"},"medium","easeInOutSine",function(){b=false})};e();return d};var ur=ur||{};ur.BackgroundImage=function(i,d,g){var c=new xnjs.GameComponent(i);var f=system.Class.inherit(c);c.loaded=new system.Event();var j;var a;function e(){j=i.services().getService("Images")}c.initialize=function(){i.window().clientSizeChanged.subscribe(h);h(c,{});ur.ImagesService.preload(a,b)};c.update=function(){};c.dispose=function(){d.css("background-image","");i.window().clientSizeChanged.unsubscribe(h)};c.resize=function(){h(c,{})};function b(){c.loaded.raise(c,{})}function h(m,p){var n=d.width();var q=d.height();var l=j.getZoomHeight(g,n,q);a=j.getImagePath(g,l);d.css("background-image","url('"+a+"')");var o=g.width*l/ur.UrbanRoof.baseHeight;var k=g.height*l/ur.UrbanRoof.baseHeight;var r=(n-o)*g.focusHorizontal;var s=(q-k)*g.focusVertical;d.css("background-position",r+"px "+s+"px")}e();return c};var ur=ur||{};ur.Facebook=function(k){var c=new xnjs.GameComponent(k);var d=system.Class.inherit(c);var i;var b;var e;var h=true;function g(){k.window().clientSizeChanged.subscribe(j)}c.initialize=function(){i=$("#facebook-login");b=$("#facebook-user");var l=b.find("fb:profile-pic");l.attr("uid","12345");e=k.services().getService("Facebook");if(e.userID()){a(c,{})}e.userLoggedIn.subscribe(a);e.userLoggedOut.subscribe(f);j(c,{})};c.update=function(){};function j(l,n){var m=200*ur.UrbanRoof.pageZoom}function a(l,m){$("#facebook-user-picture").html("<img src='https://graph.facebook.com/"+e.userID()+"/picture'//>");i.hide();b.show()}function f(l,m){i.show();b.hide()}g();return c};var ur=ur||{};ur.ForegroundImage=function(i,d,f){var c=new xnjs.GameComponent(i);var e=system.Class.inherit(c);c.loaded=new system.Event();var j;var a;function g(){j=i.services().getService("Images")}c.initialize=function(){i.window().clientSizeChanged.subscribe(h);h(c,{});d.addClass("foreground-image");ur.ImagesService.preload(a,b)};c.update=function(){};c.dispose=function(){d.find("img").remove();i.window().clientSizeChanged.unsubscribe(h)};c.resize=function(){h(c,{})};function b(){c.loaded.raise(c,{})}function h(n,p){var s=d.width();var r=d.height();var m=j.getSafeZoomHeight(f,s,r);a=j.getImagePath(f,m);d.find("img").remove();var l=f.width*m/ur.UrbanRoof.baseHeight;var q=f.height*m/ur.UrbanRoof.baseHeight;var k=(s-l)*0.5;var o=(r-q)*0.5;d.append("<img src='"+a+"' style='left:"+k+"px; top:"+o+"px;'/>")}g();return c};var ur=ur||{};ur.Gallery=function(k){var t=new xnjs.GameComponent(k);var h=system.Class.inherit(t);t.hiding=new system.Event();var s;var c;var b;var q=[];var i;var o;var u;var l;var j;var a=0;function f(){t.updateOrder.set(1);k.window().clientSizeChanged.subscribe(m);k.services().addService("Gallery",t);u=new ur.GalleryBrowser(k);k.components().add(u);j=new ur.Tooltip(k,"gallery-tooltip");k.components().add(j)}t.tooltip=function(){return j};t.initialize=function(){o=k.services().getService("Background");$(document).keydown(d);c=$("<div id='gallery'><div id='gallery-container'><div id='gallery-frame'></div></div></div>");$("body").append(c);var v=$("#gallery-frame");v.append("<div id='gallery-buttons'/>");l=$("<div id='gallery-close' class='gallery-button'><img class='cross'/><div class='bottom'/></div>");$("#gallery-buttons").append(l);l.click(g);l.hover(function(){j.show(ur.Strings.Controls.GalleryClose,l,ur.Tooltip.Direction.Right)},j.hide);var w=new ur.Image(k,l.find(".cross"),ur.Image.close);w.scale.set(0.7);w.initialize();exit=$("<div id='gallery-exit'/>");v.append(exit);exit.click(g);c.hide();b=$("<div id='gallery-contents'/>");v.append(b);s=$("#main-content").add("#background-frame")};t.update=function(){if(k.isIE()){$("#gallery-tooltip").css("z-index","auto")}};t.show=function(y,x){$("#loading").show();i=false;_gaq.push(["_trackEvent","Gallery","Gallery-Show",y[x].description]);u.showBrowser(y,x);c.show();var v=function(){e();if(i){r()}else{j.pulse(ur.Strings.Controls.GalleryClose,l,ur.Tooltip.Direction.Right)}$("#loading").hide()};for(var z=0;z<y.length;z++){var w=$("<div id='gallery-item-"+z+"' class='item' style='left:"+z+"00%;' />");b.append(w);var A=y[z];var B;switch(A.mediaType){case"Image":B=new ur.ForegroundImage(k,w,A);break;case"Video":B=new ur.Video(k,w,A);if(x==z){B.autoplay.set(true);B.loaded.subscribe(v);i=true}B.playing.subscribe(r);B.paused.subscribe(p);break}B.initialize();q.push(B)}a=x;m();if(!i){v()}};t.goToIndex=function(w){a=w;var v=$("#gallery-frame").width();b.stop().animate({left:-a*v+"px"},1000,"easeInOutCirc")};function r(){$("#viewport").add("#gallery-buttons").fadeOut("slow");$("#gallery-exit").hide()}function p(){$("#viewport").add("#gallery-buttons").fadeIn("fast");$("#gallery-exit").show();j.pulse(ur.Strings.Controls.GalleryClose,l,ur.Tooltip.Direction.Right)}function e(){k.services().getService("Scrolling").enabled.set(false);k.window().clientSizeChanged.raise(t,{});s.stop().hide()}function g(){n();var v=new ae.Countdown(function(){for(var x=0;x<q.length;x++){q[x].dispose()}q=[];b.html("");c.hide()},s.length);u.hideBrowser();s.show();for(var w=0;w<s.length;w++){v.decrease()}k.window().clientSizeChanged.raise(t,{});k.services().getService("Scrolling").enabled.set(true)}function n(){t.hiding.raise(t,{finalIndex:a})}function d(v){switch(v.keyCode){case 27:g();break}}function m(v,x){var w=$("#gallery-frame").width();b.stop().css("left",-a*w+"px")}f();return t};var ur=ur||{};ur.GalleryBrowser=function(p){var B=new xnjs.GameComponent(p);var m=system.Class.inherit(B);var a={Hidden:0,FadingIn:1,Showing:2,Visible:3,WaitingToHide:4,Hiding:5,FadingOut:6};var f=a.Hidden;var t;var z;var d;var u;var r;var i;var n;var l;var o;var h;var j;var w;var c;function v(){B.updateOrder.set(2);p.window().clientSizeChanged.subscribe(s)}B.initialize=function(){l=p.services().getService("Gallery");o=l.tooltip();$("#viewport").append("<div id='gallery-browser'></div>");z=$("#gallery-browser");z.append("<div id='gallery-browser-all'/><div id='gallery-browser-index'><span id='gallery-browser-index-value'>1/1</span><div class='bottom'/></div>");u=$("#gallery-browser-all");r=$("#gallery-browser-index");n=r.find(".bottom");i=r.find("#gallery-browser-index-value");d=$("#background-content").add("#viewport").add("#main-content").add("#gallery");galleryDiv=$("#gallery-buttons");h=$("<div id='gallery-browser-previous' class='gallery-button'><div class='arrow'/><div class='bottom'/></div>");galleryDiv.append(h);j=$("<div id='gallery-browser-next' class='gallery-button'><div class='arrow'/><div class='bottom'/></div>");galleryDiv.append(j);h.click(function(){o.hide();b()});j.click(function(){o.hide();e()});h.hover(function(){o.show(ur.Strings.Controls.GalleryPrevious,h,ur.Tooltip.Direction.Down,1000)},o.hide);j.hover(function(){o.show(ur.Strings.Controls.GalleryNext,j,ur.Tooltip.Direction.Down,1000)},o.hide);$("#gallery").mousewheel(function(C,D){if(D>0){b()}else{e()}});$(document).keydown(q);s(B,{});if(!p.isIE()){z.css("opacity",0)}z.hide()};B.showBrowser=function(D,C){w=D;c=C;x();z.show();if(!p.isIE()){z.fadeTo("slow",1)}if(C==0){h.hide()}else{h.show()}if(C==w.length-1){j.hide()}else{j.show()}};B.hideBrowser=function(){if(p.isIE()){u.html("");z.hide()}else{z.fadeTo("slow",0,function(){u.html("");z.hide()})}};B.show=function(){switch(f){case a.Hidden:A();break;case a.FadingIn:case a.Showing:case a.Visible:break;case a.WaitingToHide:clearTimeout(t);case a.Hiding:d.stop();k();break;case a.FadingOut:n.stop(true,false);A();break}};B.hide=function(){switch(f){case a.FadingIn:n.stop(true,false);g();break;case a.Showing:d.stop();y();break;case a.Visible:f=a.WaitingToHide;t=setTimeout(y,1000);break;case a.WaitingToHide:case a.Hiding:case a.FadingOut:case a.Hidden:break}};function e(){if(c<w.length-1){if(c==0){h.show()}c++;x();if(c==w.length-1){j.hide()}l.goToIndex(c)}}function b(){if(c>0){if(c==w.length-1){j.show()}c--;x();if(c==0){h.hide()}l.goToIndex(c)}}function x(){i.text((c+1)+"/"+w.length)}function A(){f=a.FadingIn;n.fadeTo("slow",1,function(){k()})}function k(){f=a.Showing;var C=new ae.Countdown(function(){f=a.Visible},d.length);d.animate({top:"10em"},"slow",C.decrease)}function y(){f=a.Hiding;var C=new ae.Countdown(g,d.length);d.animate({top:"0"},"slow",C.decrease)}function g(){f=a.FadingOut;n.fadeTo("slow",0.2,function(){f=a.Hidden})}function q(C){switch(C.keyCode){case 37:b();break;case 39:e();break}}function s(C,G){var D=p.window().clientBounds();var E=$("#background-content").width();z.width(E);var F=$("#background-content").offset().left;z.css("left",F+"px")}v();return B};var ur=ur||{};ur.Image=function(k,c,f){var b=new xnjs.GameComponent(k);var h=system.Class.inherit(b);var d=1;var e=false;var j=false;var l;function i(){k.window().clientSizeChanged.subscribe(a);l=k.services().getService("Images")}b.scale=function(){return d};b.scale.set=function(m){d=m;a(b,{})};b.safe=function(){return e};b.safe.set=function(m){e=m;a(b,{})};b.em=function(){return j};b.em.set=function(m){j=m;a(b,{})};b.width=function(){return Math.floor(g()/ur.UrbanRoof.baseHeight*f.width)};b.height=function(){return Math.floor(g()/ur.UrbanRoof.baseHeight*f.height)};b.initialize=function(){a(b,{})};b.update=function(){};b.dispose=function(){c.attr("src","");k.window().clientSizeChanged.unsubscribe(a)};b.resize=function(){a(b,{})};function a(m,o){var n=l.getImagePath(f,g());c.attr("src",n);c.width(b.width());c.height(b.height())}function g(){if(j){return k.getEmZoomHeight(d)}else{if(e){return k.getSafeZoomHeight(d)}else{return k.getZoomHeight(d)}}}i();return b};ur.Image.close={id:118,mediaType:"Image",description:"Design/Close.png",filename:"Close.png",directory:"Design/",width:50,height:50,focusHorizontal:0.5,focusVertical:0.5};ur.Image.event={id:122,mediaType:"Image",description:"Design/Event.png",filename:"Event.png",directory:"Design/",width:85,height:85,focusHorizontal:0.5,focusVertical:0.5};var ur=ur||{};ur.Language=function(e){var a=new xnjs.GameComponent(e);var c=system.Class.inherit(a);var d;function b(){}a.initialize=function(){var g=$("#language a");var h=g.text();g.text(h.substring(0,2));var f=e.services().getService("Sidebar").tooltip();g.hover(function(){f.show(h,g,ur.Tooltip.Direction.Up)},function(){f.hide()})};b();return a};var ur=ur||{};ur.LogoPanel=function(k){var c=new xnjs.GameComponent(k);var d=system.Class.inherit(c);var e=0.37;var i=2;var h=false;var j;var g;var f;function a(){k.window().clientSizeChanged.subscribe(b)}c.initialize=function(){j=$("body header").first();g=j.find("h1");g.html("<a href='/'><img id='urban-roof-logo'/></a>");f=new ur.Image(k,$("#urban-roof-logo"),ur.LogoPanel.logoImage);f.em.set(true);f.scale.set(1.12);f.initialize();b(c,{})};c.show=function(m){var l="-"+j.width()/2+"px";j.animate({left:l},1000,"easeOutBack",function(){j.css("left","0px");i=1;b();m()})};c.dispose=function(){f.dispose()};function b(l,m){}a();return c};ur.LogoPanel.logoImage=null;var ur=ur||{};ur.Menu=function(n,l){var c=new xnjs.GameComponent(n);var j=system.Class.inherit(c);var d;var k;var i;var g;var a={Hidden:0,WaitingToShow:1,Showing:2,Visible:3,WaitingToHide:4,Hiding:5};var f=a.Hidden;var b=null;function h(){c.updateOrder.set(3)}c.initialize=function(){var o="";o+="<div class='menu'>";o+="<div class='menu-panel'>";o+="<div class='content'></div>";o+="<div class='shadow'></div>";o+="<div class='arrow'></div>";o+="</div>";o+="</div>";l.wrap(o);d=l.parent().parent();k=d.find(".arrow");i=d.find(".content");if(!n.isIE()){d.css("opacity",0)}d.hide()};c.show=function(){waitTime=100;switch(f){case a.Hidden:f=a.WaitingToShow;b=setTimeout(m,waitTime);break;case a.WaitingToShow:break;case a.Showing:break;case a.Visible:break;case a.WaitingToHide:f=a.Visible;clearTimeout(b);break;case a.Hiding:m();break}};c.hide=function(){switch(f){case a.WaitingToShow:clearTimeout(b);f=a.Hidden;break;case a.Showing:e();break;case a.Visible:f=a.WaitingToHide;b=setTimeout(e,100);break;case a.WaitingToHide:case a.Hiding:case a.Hidden:break}};function m(){if(n.isIE()){d.stop().show();f=a.Visible}else{f=a.Showing;d.stop(true,true).show().fadeTo("fast",1,function(){f=a.Visible})}}function e(){if(n.isIE()){d.stop().hide();f=a.Hidden}else{f=a.Hiding;d.stop(true,true).fadeTo("slow",0,function(){d.hide();f=a.Hidden})}}h();return c};var ur=ur||{};ur.Partners=function(q){var s=new xnjs.GameComponent(q);var n=system.Class.inherit(s);var a={Hidden:0,FadingIn:1,Showing:2,Visible:3,WaitingToHide:4,Hiding:5,FadingOut:6};var d=a.Hidden;var u;var h;var A;var l;var B;var j;var r;var i=[];var z;var c;var v;var A;var o;var p;function m(){s.updateOrder.set(1);q.window().clientSizeChanged.subscribe(t);p=new ur.Tooltip(q,"partners-tooltip");q.components().add(p)}s.initialize=function(){$("#partners").remove();$("#viewport").append("<div id='partners'></div>");z=$("#partners");z.append("<div id='partners-featured'><img id='partners-featured-image' /><div class='border'></div><div class='bottom'></div><div class='shadow'></div></div><div id='partners-all'></div>");v=$("#partners-all");A=$("#partners-featured");l=$("#partners-featured-image");o=A.find(".bottom");c=$("#background-content").add("#viewport").add("#main-content").add("#gallery");t(s,{});for(var D=0;D<ur.Partners.initial.length;D++){var G=ur.Partners.initial[D];v.append("<a href='http://"+G.link+'\' target=\'_blank\' onclick=\'_gaq.push(["_trackEvent", "Partners", "Partners-Click-Link", "'+G.name+"\"]);'><span id='partner"+D+"' class='partner "+G.name.toLowerCase().replace(/\s/gi,"-")+"'><img class='color'/></span></a>");var C=$("#partner"+D);var F=new ur.Image(q,$("#partner"+D+" .color"),G.logo);F.safe.set(true);F.initialize();C.hover(function(I,H){return function(){if(d==a.Visible||d==a.WaitingToHide){p.show(I.link,H,ur.Tooltip.Direction.Up)}}}(G,C),p.hide);for(var E=0;E<G.featureWeight;E++){i.push(D)}}e();z.hover(s.show,s.hide);z.hide()};s.update=function(){window.setTimeout(function(){z.fadeIn(1000)},1000)};s.show=function(){switch(d){case a.Hidden:x();break;case a.FadingIn:case a.Showing:case a.Visible:break;case a.WaitingToHide:clearTimeout(u);case a.Hiding:c.stop();k();break;case a.FadingOut:o.stop(true,false);x();break}};s.hide=function(){switch(d){case a.FadingIn:o.stop(true,false);f();break;case a.Showing:c.stop();y();break;case a.Visible:d=a.WaitingToHide;u=setTimeout(y,1000);break;case a.WaitingToHide:case a.Hiding:case a.FadingOut:case a.Hidden:break}};function x(){d=a.FadingIn;o.fadeTo("fast",1,function(){k()});clearTimeout(h);h=null;w(function(){A.addClass("love");g(ur.Partners.love)})}function k(){d=a.Showing;var C=new ae.Countdown(function(){d=a.Visible;_gaq.push(["_trackEvent","Partners","Partners-Show"])},c.length);c.animate({top:-100*ur.UrbanRoof.pageZoom-20*ur.UrbanRoof.emZoom+"px"},"slow",C.decrease)}function y(){d=a.Hiding;var C=new ae.Countdown(f,c.length);c.animate({top:"0"},"slow",C.decrease)}function f(){d=a.FadingOut;o.fadeTo("slow",0.2,function(){d=a.Hidden});e()}function e(){if(r){w(b)}else{b()}h=setTimeout(e,15000)}function w(C){l.stop(true,true).animate({width:0},"slow",function(){r.dispose();r=null;j=null;A.removeClass("love");C()})}function b(){do{var D=Math.floor(Math.random()*i.length);var C=i[D]}while(C==B);B=C;j=ur.Partners.initial[B];g(j.blackAndWhiteLogo)}function g(D){r=new ur.Image(q,l,D);if(!A.hasClass("love")){r.scale.set(0.8)}r.initialize();t(s,{});var C=l.width();l.width(0);l.animate({width:C},"slow")}function t(F,H){var I=q.window().clientBounds();var D=$("#background-content").width();z.width(D);var E=$("#background-content").offset().left;z.css("left",E+"px");if(r){var C={};var D;var G;if(A.hasClass("love")){D=(120*ur.UrbanRoof.pageZoom);G=(20*ur.UrbanRoof.pageZoom)}else{G=r.height();D=r.width()}var J=(A.outerWidth()-A.width())/2;C.marginLeft=-D/2-J+"px";C.top=-G-J*2+"px";C.width=D+"px";C.height=G+"px";A.stop(true,true).animate(C,"slow")}}m();return s};ur.Partners.initial=[];ur.Partners.love=null;ur.Partners.video=null;var ur=ur||{};ur.QuickNavigation=function(l){var c=new xnjs.GameComponent(l);var a=system.Class.inherit(c);var d;var j=[];var f=[];var i=[];var h;var e=false;var g=false;function k(){l.window().clientSizeChanged.subscribe(b);c.updateOrder.set(200);l.services().addService("Quick Navigation",c)}c.initialize=function(){d=$("#quick-navigation");var m=0;h=l.services().getService("Sidebar").tooltip();d.find("a").each(function(){var o=$(this);var n=o.text();o.text("");o.append("<div class='quick-link'></div>");j.push(o);f.push(false);i.push(n);m++;o.hover(function(){h.show(n,o)},function(){h.hide()})});if(j.length>0){j[0].css("top","0");f[0]=true;for(m=1;m<j.length;m++){j[m].css("bottom",(j.length-1-m)*1.3+"em")}}b(c,{})};c.update=function(){g=true};c.scrollToSection=function(r){for(var q=0;q<j.length;q++){var p=null;if(q<=r){if(!f[q]){var o=j[q].position().top;j[q].css("bottom","auto").css("top",o+"px");p={top:q*1.3+"em"};f[q]=true}}else{if(f[q]){var n=d.height()-j[q].position().top-j[q].height();j[q].css("top","auto").css("bottom",n+"px");p={bottom:(j.length-1-q)*1.3+"em"};f[q]=false}}if(p){var m=null;if((q==r+1||q==r)&&g){m=function(s){return function(){h.pulse(i[s],j[s])}}(r)}j[q].stop().animate(p,1000,m)}}};function b(m,o){var n=$("#sidebar").height()-d.position().top-d.width();d.css("height",n+"px")}k();return c};var ur=ur||{};ur.Scrolling=function(h){var r=new xnjs.GameComponent(h);var e=system.Class.inherit(r);var m;var o;var k=true;var l;var b=[];var d=[];var p=0;var q=0;var j;var f;var a=0;function i(){r.updateOrder.set(100);h.services().addService("Scrolling",r)}r.enabled=function(){return k};r.enabled.set=function(s){k=s;if(k){scrollTo(0,p)}};r.initialize=function(){m=h.services().getService("Background");o=h.services().getService("Quick Navigation");l=$("#background");h.window().clientSizeChanged.subscribe(g);c();$(window).scroll(n);n();j=true};r.addSection=function(s){b.push(s);d.push({start:0,end:0,transitionToNext:0})};function g(s,t){c();n()}function c(){var s;var z=h.window().clientBounds();for(s=0;s<b.length;s++){var v=b[s];var u=v.element();var A=u.offset();var x=d[s];x.start=A.top;x.end=A.top+u.outerHeight()-z.height}if(b.length>0&&b[0].element().attr("id")=="frontpage"){d[0].start=0;d[0].end=0}for(s=0;s<b.length-1;s++){var y=b[s].bottomTransition();var t=b[s].topTransition();var w=0.3;if(y!=undefined){w=y}else{if(t!=undefined){w=t}}d[s].transitionToNext=d[s].end*(1-w)+d[s+1].start*w}if(b.length>0){d[b.length-1].transitionToNext=d[b.length-1].end}}function n(){if(!k){return}if(j&&!f){$("#background-section-0 .scroll-hint ").fadeOut(function(){$(this).remove()});f=true}q=p;p=$(window).scrollTop();var t=0;while(t<b.length-1&&p>d[t].transitionToNext){t++}if(t!=a){a=t;m.scrollToSection(t);if(j){var u=b[t];var s=u.title();_gaq.push(["_trackEvent","Content","Section-Visited",s])}}}i();return r};var ur=ur||{};ur.Sidebar=function(j){var k=new xnjs.GameComponent(j);var g=system.Class.inherit(k);var n;var s;var b;var a;var i;var l;var o;var p;var h=true;var q=false;var d=[];function e(){j.window().clientSizeChanged.subscribe(m);j.components().add(new ur.Language(j));i=new ur.Tooltip(j,"sidebar-tooltip");j.components().add(i);j.services().addService("Sidebar",k)}k.tooltip=function(){return i};k.initialize=function(){m(k,{})};k.update=function(){};k.show=function(){h=false;m(k,{});b.show();s.hide();n.find(".the-button").show()};k.addSection=function(t){d.push(t)};function r(t){switch(t.keyCode){case 192:f();break}}function c(){}function f(){if(!q){var t=j.window().clientBounds();var v=n.width();var x;var w;var u;var y;if(h){x=(t.width-v)/2;w=0.7;u=0.8;y="easeOutBack"}else{x=-v+Math.max(15,30*ur.UrbanRoof.emZoom);w=0.3;u=0.2;y="easeInBack"}h=!h;q=true;n.animate({left:x},1000,y,function(){q=false});n.find(".bottom").fadeTo(500,w);n.find(".shadow").fadeTo(500,u);b.toggle(500);s.toggle(500);n.find(".the-button").toggle(500)}}function m(t,w){var u=j.window().clientBounds();var v=$("#background-container").offset().left;$("header").css("left",v+"px");$("aside").css("left",v+"px")}e();return k};var ur=ur||{};ur.Slideshow=function(j,i,o){var t=new xnjs.GameComponent(j);var h=system.Class.inherit(t);t.loaded=new system.Event();var p=[];var b;var q;var a;var m;var l=false;var f=false;var r;function c(){t.updateOrder.set(400);i.addClass("slideshow");g();m.loaded.subscribe(d);if(o.length>1){s()}else{b=q;a=m}}t.initialize=function(){a.initialize();a.element().addClass("current");if(o.length>1){m.initialize();m.element().addClass("next")}};t.activate=function(){f=false;if(!l){l=true;if(o.length>1){k()}}};t.deactivate=function(){f=true};t.goToIndex=function(u){a.dispose();b=u;a=new ur.SlideshowImage(j,i,o[u]);a.initialize();a.element().addClass("current")};function d(){t.loaded.raise(t,{})}function g(x){if(p.length==0){for(var w=0;w<o.length;w++){p.push(w)}}var v;var u;do{u=Math.floor(Math.random()*p.length);v=p[u]}while(v==q);p.splice(u,1);q=v;m=new ur.SlideshowImage(j,i,o[q])}function k(){if(f){f=false;l=false;return}window.setTimeout(e,5000)}function e(){a.element().fadeOut(1000,function(){n()})}function n(){a.dispose();m.element().removeClass("next").addClass("current");s();m.initialize();m.element().addClass("next");k()}function s(){b=q;a=m;g()}c();return t};var ur=ur||{};ur.SlideshowImage=function(k,a,i){var d=new xnjs.GameComponent(k);var e=system.Class.inherit(d);d.loaded=new system.Event();var g;var l;var f;var c;function b(){k.window().clientSizeChanged.subscribe(j);l=k.services().getService("Images")}d.element=function(){return c};d.width=function(){return Math.floor(g/ur.UrbanRoof.baseHeight*i.width)};d.height=function(){return Math.floor(g/ur.UrbanRoof.baseHeight*i.height)};d.initialize=function(){c=$("<img class='slideshow-image' />");c.appendTo(a);j(d,{});ur.ImagesService.preload(f,h)};d.update=function(){};d.dispose=function(){c.remove();k.window().clientSizeChanged.unsubscribe(j)};function h(){d.loaded.raise(d,{})}function j(n,q){var o=a.width();var r=a.height();g=l.getZoomHeight(i,o,r);f=l.getImagePath(i,g);c.attr("src",f);c.width(d.width());c.height(d.height());var p=i.width*g/ur.UrbanRoof.baseHeight;var m=i.height*g/ur.UrbanRoof.baseHeight;var s=(o-p)*i.focusHorizontal;var t=(r-m)*i.focusVertical;c.css({left:s+"px ",top:t+"px"})}b();return d};var ur=ur||{};ur.Tooltip=function(l,m){var q=new xnjs.GameComponent(l);var i=system.Class.inherit(q);var j;var p;var c;var g;var a={Hidden:0,WaitingToShow:1,Showing:2,Visible:3,WaitingToHide:4,Hiding:5};var d=a.Hidden;var n=null;function k(){q.updateOrder.set(3)}q.initialize=function(){var t="";t+="<div id='"+m+"' class='tooltip'>";t+="<div class='content'></div>";t+="<div class='shadow'></div>";t+="<div class='arrow'></div>";t+="</div>";$("body").append(t);j=$("#"+m);p=j.find(".arrow");c=j.find(".content");if(!l.isIE()){j.css("opacity",0)}j.hide()};q.pulse=function(v,u,t){if(!t){t=ur.Tooltip.Direction.Right}e(t);c.text(v);f(u);switch(d){case a.Hidden:case a.WaitingToShow:case a.Showing:r();break;case a.Visible:case a.WaitingToHide:case a.Hiding:r();break}};q.show=function(w,u,t,v){if(!t){t=ur.Tooltip.Direction.Right}if(!v){v=100}e(t);c.text(w);switch(d){case a.Hidden:d=a.WaitingToShow;n=setTimeout(s,v);f(u);break;case a.WaitingToShow:f(u);break;case a.Showing:b(u);break;case a.Visible:b(u);break;case a.WaitingToHide:b(u);d=a.Visible;clearTimeout(n);break;case a.Hiding:f(u);s();break}};q.hide=function(){switch(d){case a.WaitingToShow:clearTimeout(n);d=a.Hidden;break;case a.Showing:h();break;case a.Visible:d=a.WaitingToHide;n=setTimeout(h,100);break;case a.WaitingToHide:case a.Hiding:case a.Hidden:break}};function s(){if(l.isIE()){j.stop().show();d=a.Visible}else{d=a.Showing;j.stop(true,true).show().fadeTo("fast",1,function(){d=a.Visible})}}function h(){if(l.isIE()){j.stop().hide();d=a.Hidden}else{d=a.Hiding;j.stop(true,true).fadeTo("slow",0,function(){j.hide();d=a.Hidden})}}function r(){d=a.Showing;j.stop(true,true).show().fadeTo("fast",1,function(){d=a.Visible;setTimeout(h,500)})}function f(t){j.css(o(t))}function b(t){j.stop().animate(o(t),"fast")}function o(t){var u=t.offset();switch(g){case ur.Tooltip.Direction.Right:return{left:u.left+t.width()+30*ur.UrbanRoof.emZoom+"px",top:u.top-$(window).scrollTop()+t.height()/2-40*ur.UrbanRoof.emZoom+"px"};case ur.Tooltip.Direction.Up:return{top:u.top-120*ur.UrbanRoof.emZoom-$(window).scrollTop()+"px",left:u.left+t.width()/2-(c.text().length+5)*5.8*ur.UrbanRoof.emZoom+"px"};case ur.Tooltip.Direction.Down:return{top:u.top+t.height()+30*ur.UrbanRoof.emZoom-$(window).scrollTop()+"px",left:u.left+t.width()/2-(c.text().length+5)*5.8*ur.UrbanRoof.emZoom+"px"}}}function e(t){if(g){j.removeClass(g)}g=t;j.addClass(g)}k();return q};ur.Tooltip.Direction={Right:"right",Up:"up",Down:"down"};var ur=ur||{};ur.Video=function(l,d,f){var r=new xnjs.GameComponent(l);var j=system.Class.inherit(r);r.loaded=new system.Event();r.playing=new system.Event();r.paused=new system.Event();var p=false;function h(){}r.autoplay=function(){return p};r.autoplay.set=function(s){p=s};r.initialize=function(){switch(f.type){case"Vimeo":c();break;case"Flash":e();break;case"YouTube":m();break;case"Custom":a();break}};r.update=function(){};r.dispose=function(){d.html("")};function e(){var t="video-"+f.id;var s="";s+='<object id="'+t+'" class="media Flash" width="100%" height="100%" type="application/x-shockwave-flash" data="'+f.source+'">';s+='<param name="wmode" value="opaque" />';s+='<param name="allowfullscreen" value="true" />';s+='<param name="allowscriptaccess" value="always" />';s+='<param name="movie" value="'+f.source+'"/>';s+="</object>";d.append(s)}function c(){var t="video-"+f.id;var s="js_api=1&js_swf_id="+t;if(p){s+="&autoplay=1"}o(t,f.source,s)}function q(v,u,s){var t="";t+='<object id="'+v+'" class="media Vimeo" width="100%" height="100%" type="application/x-shockwave-flash" data="http://www.vimeo.com/moogaloop.swf">';t+='<param name="allowfullscreen" value="true" />';t+='<param name="allowscriptaccess" value="always" />';t+='<param name="wmode" value="opaque" />';t+='<param name="swliveconnect" value="true" />';t+='<param name="movie" value="http://www.vimeo.com/moogaloop.swf" />';t+='<param name="flashvars" value="clip_id='+f.source+"&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=b0d154&amp;fullscreen=1&amp;"+s+"&amp;js_onLoad=vimeoLoaded"+u+'" />';t+="</object>";d.append(t);window["vimeoLoaded"+u]=function(){var w=$("#"+v).get(0);w.api_addEventListener("onFinish","onPause"+u);w.api_addEventListener("onPlay","onPlay"+u);w.api_addEventListener("onPause","onPause"+u);b()};window["onPause"+u]=i;window["onPlay"+u]=g}function o(t,s){d.append("<iframe id='"+t+"' src='http://player.vimeo.com/video/"+f.source+"?"+s+"' width='100%' height='100%' frameborder='0'></iframe>")}function m(){var s="video-"+f.id;d.append("<iframe id='"+s+"' src='http://www.youtube.com/embed/"+f.source+"?rel=0&amp;hd=1' frameborder='0' width='100%' height='100%' allowfullscreen></iframe>")}function a(){var s="video-"+f.id;d.append(f.source)}function k(s){Froogaloop.init(s);s.addEvent("onLoad",function(){s.addEvent("onPlay",g);s.addEvent("onPause",i);b()})}function g(){r.playing.raise(r,{})}function i(){r.paused.raise(r,{})}function b(){r.loaded.raise(r,{})}function n(s,t){}h();return r};var ur=ur||{};ur.Viewport=function(d){var a=new xnjs.GameComponent(d);var c=system.Class.inherit(a);function b(){a.updateOrder.set(-1)}a.initialize=function(){$("body").append("<div id='viewport'></div>");view=$("#viewport")};b();return a};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.Center=function(game){var that=new ur.Page(game);var base=system.Class.inherit(that);var frontpage;var div;function center(){}that.initialize=function(){base.initialize();var backgroundImages=that.section(1).backgroundImages();if(backgroundImages.length>0){var imageSet=eval(backgroundImages[0].gallerySet)}};that.update=function(){};center();return that};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageCenter=function(g,f,e){var b=new ur.pages.frontpage.FrontpageFeature(g,f,e);var d=system.Class.inherit(b);function a(){b.updateOrder.set(2);g.window().clientSizeChanged.subscribe(c)}b.initialize=function(){f.addClass("center");b.hidable=false;d.initialize()};function c(h,i){}a();return b};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageFacebookEvent=function(g,e,d){var a=new ur.pages.frontpage.FrontpageFeature(g,e,d);var c=system.Class.inherit(a);function f(){a.updateOrder.set(2);g.window().clientSizeChanged.subscribe(b)}a.initialize=function(){e.addClass("facebook-event");c.initialize()};function b(h,i){}f();return a};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageFacebookNote=function(g,f,e){var a=new ur.pages.frontpage.FrontpageFeature(g,f,e);var c=system.Class.inherit(a);function b(){a.updateOrder.set(2);g.window().clientSizeChanged.subscribe(d)}a.initialize=function(){f.addClass("facebook-note");c.initialize()};function d(h,i){}b();return a};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageFeature=function(g,f,e){var a=new xnjs.GameComponent(g);var c=system.Class.inherit(a);function d(){a.updateOrder.set(300);g.window().clientSizeChanged.subscribe(b)}a.initialize=function(){};function b(h,i){}d();return a};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageGallery=function(game,element,feature){var that=new ur.pages.frontpage.FrontpageFeature(game,element,feature);var base=system.Class.inherit(that);var gallery;var galleryEntered;function frontpageGallery(){that.updateOrder.set(2);game.window().clientSizeChanged.subscribe(resize);gallery=game.services().getService("Gallery")}that.initialize=function(){base.initialize();element.find("img").each(function(){var id=this.id;var imageData=eval(this.id);var img=$(this);var imageSet=eval(imageData.gallerySet);var image=imageSet[imageData.index];img.parent().replaceWith("<span id='"+id+"' class='"+this.className+" gallery-entrance'></span>");new ur.BackgroundImage(game,$("#"+id),image).initialize();$("#"+id).click(function(){gallery.show(imageSet,imageData.index)})})};that.update=function(){base.update()};that.dispose=function(){partnerLogo.dispose();base.dispose()};function showInGallery(){_gaq.push(["_trackEvent","Frontpage","Frontpage-Gallery"]);galleryEntered=true;gallery.show(feature.images,0)}function galleryHiding(sender,e){if(!galleryEntered){return}galleryEntered=false;if(e.finalIndex>0){that.slideshow().goToIndex(e.finalIndex)}}function resize(sender,e){}frontpageGallery();return that};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageLink=function(g,f,e){var b=new ur.pages.frontpage.FrontpageFeature(g,f,e);var d=system.Class.inherit(b);function a(){b.updateOrder.set(2);g.window().clientSizeChanged.subscribe(c)}b.initialize=function(){f.addClass("link");d.initialize()};function c(h,i){}a();return b};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageMessage=function(g,f,e){var b=new ur.pages.frontpage.FrontpageFeature(g,f,e);var d=system.Class.inherit(b);function a(){b.updateOrder.set(2);g.window().clientSizeChanged.subscribe(c)}b.initialize=function(){f.addClass("message");b.hidable=false;d.initialize()};function c(h,i){}a();return b};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageScene=function(g,e,d){var a=new ur.pages.frontpage.FrontpageFeature(g,e,d);var c=system.Class.inherit(a);function f(){a.updateOrder.set(2);g.window().clientSizeChanged.subscribe(b)}a.initialize=function(){e.addClass("scene");c.initialize()};function b(h,i){}f();return a};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.frontpage=ur.pages.frontpage||{};ur.pages.frontpage.FrontpageVideo=function(m,d,c){var e=new ur.pages.frontpage.FrontpageFeature(m,d,c);var i=system.Class.inherit(e);var b;var k;var j;var g;var l;var a;function h(){e.updateOrder.set(2);m.window().clientSizeChanged.subscribe(f)}e.initialize=function(){i.initialize()};function f(n,o){}h();return e};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.Frontpage=function(j,k,f){var p=new ur.PageSection(j,k);var h=system.Class.inherit(p);var m;var c;var d;var o=[];var g=[];var b=[];var r=false;var i=false;function f(){j.window().clientSizeChanged.subscribe(n);j.services().addService("Frontpage",p);d=ur.pages.Frontpage.contents;p.bottomTransition.set(0)}p.initialize=function(){h.initialize();n(p,{})};p.update=function(){e()};p.lock=function(){i=true;for(var s=0;s<d.length;s++){o[s].darkenInactive()}};p.unlock=function(){i=false;for(var s=0;s<d.length;s++){o[s].dimInactive()}};p.addScrollHint=function(s){var t=$("<a class='scroll-hint' href='#"+s+"'><span class='text'>"+ur.Strings.ScrollDown+"</span><span class='arrow'/></a>");p.backgroundElement().append(t);t.hide();setTimeout(function(){t.show().animate({bottom:0},3000,"easeOutElastic")},8000)};p.dispose=function(){j.components().remove(c);for(var s=0;s<d.length;s++){j.components().remove(o[s]);o[s].dispose()}};function q(s,t){b.push(s);if(!r){e()}}function e(){if(b.length>0){r=true;var s=b.shift();s.show(function(){});window.setTimeout(e,1000)}else{r=false}}function a(t){if(i){return}for(var s=0;s<d.length;s++){if(s==t){o[s].activate()}else{o[s].dim()}}}function l(){if(i){return}for(var s=0;s<d.length;s++){o[s].neutralize()}}function n(w,y){var z=j.window().clientBounds();var v=[0,Math.floor(z.width/3),Math.floor(z.width*2/3)];var u=[0,Math.floor(z.height/4),Math.floor(z.height*5/8)];var t=[];t[1]=[v[1],v[2]-v[1],z.width-v[2]];t[2]=[v[2],z.width-v[1]];t[3]=[z.width];var x=[];x[1]=[u[1],u[2]-u[1],z.height-u[2]];x[2]=[u[2],z.height-u[1]];x[3]=[z.height];for(var s=0;s<d.length;s++){var A=d[s];var B=$("#frontpage-content-"+s);B.css({left:v[A.column]+"px",top:u[A.row]+"px",width:t[A.width][A.column]+"px",height:x[A.height][A.row]+"px"})}$("#main-content").css("margin-top",z.height+"px")}f();return p};ur.pages.Frontpage.contents=[];ur.pages.Frontpage.overlayColor=null;var ur=ur||{};ur.pages=ur.pages||{};ur.pages.News=function(g){var b=new ur.Page(g);var d=system.Class.inherit(b);var f;var a;var c;function e(){a=$("#news-section");f=new ur.pages.News.controllerClass(g,a,ur.pages.News.feature)}b.initialize=function(){d.initialize();f.initialize()};b.update=function(){};e();return b};ur.pages.News.controllerClass=null;ur.pages.News.feature=null;var ur=ur||{};ur.Page=function(g){var d=new xnjs.GameComponent(g);var c=system.Class.inherit(d);var i;var b;var e;var f;var a=[];function h(){i=g.services().getService("Background");b=g.services().getService("Scrolling");e=g.services().getService("Sidebar");f=g.services().getService("Gallery")}d.gallery=function(){return f};d.section=function(j){return a[j]};d.sectionCount=function(){return a.length};d.addSection=function(j){a.push(j);i.addSection(j);b.addSection(j)};h();return d};var ur=ur||{};ur.PageSection=function(game,element){var that=new xnjs.GameComponent(game);var base=system.Class.inherit(that);var title="";var topTransition;var bottomTransition;var initialized;var backgroundImages=[];var backgroundElement;var gallery;var scrollHint;function pageSection(){that.updateOrder.set(200);title=element.find("a:first").attr("name")}that.title=function(){return title};that.title.set=function(value){title=value};that.topTransition=function(){return topTransition};that.topTransition.set=function(value){topTransition=value};that.bottomTransition=function(){return bottomTransition};that.bottomTransition.set=function(value){bottomTransition=value};that.backgroundImages=function(){return backgroundImages.slice(0)};that.initialized=function(){return initialized};that.element=function(){return element};that.backgroundElement=function(){return backgroundElement};that.backgroundElement.set=function(value){backgroundElement=value};that.hash=function(){var link=element.find("a:first");return link.attr("name")};that.initialize=function(){gallery=game.services().getService("Gallery");if(backgroundImages.length==1){var imageData=backgroundImages[0];var imageSet=eval(imageData.gallerySet);var image=imageSet[imageData.index];var backgroundImage=new ur.BackgroundImage(game,backgroundElement,image);backgroundImage.initialize();var entrance=$("<div class='background gallery-entrance'/>");element.append(entrance);entrance.click(function(){gallery.show(imageSet,imageData.index)})}else{if(backgroundImages.length>1){}}initialized=true};that.addBackgroundImage=function(image){backgroundImages.push(image)};that.addScrollHint=function(link){element.find(".frame").after("<a class='scroll-hint' href='#"+link+"'><span class='arrow'/></a>")};pageSection();return that};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.Events=function(game){var that=new ur.Page(game);var base=system.Class.inherit(that);var controller;var div;var content;function events(){}that.initialize=function(){base.initialize();$("#events").find("img").each(function(){var id=this.id;var image=eval(this.id);var img=$(this);var imgParent=img.parent();imgParent.html("");new ur.BackgroundImage(game,imgParent,image).initialize()})};that.update=function(){};events();return that};var ur=ur||{};ur.pages=ur.pages||{};ur.pages.Report=function(game){var that=new ur.Page(game);var base=system.Class.inherit(that);var frontpage;var div;function news(){}that.initialize=function(){$("#report-gallery-link").click(function(){that.gallery().show(articleGallery,0);return false});$("article section").each(function(){var it=$(this);var firstParagraph=it.find("p:not(.no-caps)");if(firstParagraph.length>0){firstParagraph=firstParagraph.first();var text=firstParagraph.first().html();var caps=text.substring(0,1);var illegalChars=/\W/;if(!illegalChars.test(caps)){text="<span class='drop-caps'>"+text.substring(0,1)+"</span>"+text.substring(1);firstParagraph.html(text)}}it.wrapInner("<div class='frame'><div class='content'></div></div>");it.append("<div class='frame-end'></div>");it.find(".frame").append("<div class='background'></div><div class='shadow'></div>");var section=new ur.PageSection(game,it);it.find("img.background").each(function(){var imageData=eval(this.id);section.addBackgroundImage(imageData);var img=$(this);img.parent().remove()});it.find("img").each(function(){var id=this.id;var imageData=eval(this.id);var img=$(this);if(img.hasClass("gallery-image")){var imageSet=eval(imageData.gallerySet);var image=imageSet[imageData.index];img.parent().replaceWith("<span id='"+id+"' class='"+this.className+" gallery-entrance'></span>");new ur.BackgroundImage(game,$("#"+id),image).initialize();$("#"+id).click(function(){that.gallery().show(imageSet,imageData.index)})}else{new ur.Image(game,$("#"+id),imageData).initialize()}});that.addSection(section);it.find(".video.background").each(function(){$(this).appendTo(section.backgroundElement())})});for(var i=0;i<that.sectionCount-1;i++){sections[i].addScrollHint(sections[i+1].hash())}};news();return that};var ur=ur||{};ur.FacebookService=function(){this.userLoggedIn=new system.Event();this.userLoggedOut=new system.Event();var b=this;var f=null;function e(){}this.userID=function(){return f?f.id:null};this.initialize=function(){FB.init({appId:"102808976443345",status:true,cookie:true,xfbml:true,oauth:true});FB.getLoginStatus(a);FB.Event.subscribe("auth.statusChange",a)};this.login=function(){FB.login(a)};function a(g){if(g.authResponse){FB.api("/me",function(h){if(h){f=h;c()}})}else{d()}}function c(){b.userLoggedIn.raise(b,{})}function d(){b.userLoggedOut.raise(b,{})}e()};var ur=ur||{};ur.ImagesService=function(){var b="http://www.urbanroof.si/Content/Images/";function a(){}this.getZoomHeight=function(i,d,h){var e=ur.UrbanRoof.zoomHeights.length;do{e--;var g=ur.UrbanRoof.zoomHeights[e];var f=g/ur.UrbanRoof.baseHeight;var c=i.width*f;var j=i.height*f}while((c<d||j<h)&&e>0);return g};this.getSafeZoomHeight=function(i,d,h){var e=0;do{e++;var g=ur.UrbanRoof.zoomHeights[e];var f=g/ur.UrbanRoof.baseHeight;var c=i.width*f;var j=i.height*f}while((c>d||j>h)&&e<ur.UrbanRoof.zoomHeights.length-1);return g};this.getImagePath=function(e,d){var c=e.directory+e.filename;var f=c.lastIndexOf(".");return b+c.substring(0,f)+d+c.substring(f)};a()};ur.ImagesService.preload=function(c,a){var b=$("<img />").attr("src",c);if(webpage.isIE()){if(a){setTimeout(a,0)}}else{b.error(function(){if(a){a()}});b.load(function(){if(a){a()}})}};var ur=ur||{};ur.UrbanRoof=function(){var b=new xnjs.Game();var c=system.Class.inherit(b);var e;var a;var d;function f(){b.window().clientSizeChanged.subscribe(g);d=new ur.FacebookService();b.services().addService("Facebook",d);b.services().addService("Images",new ur.ImagesService());b.components().add(new ur.Viewport(b));b.components().add(new ur.Sidebar(b));b.components().add(new ur.LogoPanel(b));b.components().add(new ur.Background(b));b.components().add(new ur.Scrolling(b));b.components().add(new ur.Gallery(b));b.components().add(new ur.Partners(b));var h=navigator.userAgent.toLowerCase();e=h.indexOf("iphone")!=-1;a=$.browser.msie}b.isIPhone=function(){return e};b.isIE=function(){return a};b.initialize=function(){$("body script").remove();g(this,{});for(var h=0;h<ur.UrbanRoof.loadComponents.length;h++){b.components().add(new ur.UrbanRoof.loadComponents[h](b))}d.initialize();c.initialize()};b.getZoomHeight=function(l){var h=b.window().clientBounds().height*l;var j=ur.UrbanRoof.zoomHeights[ur.UrbanRoof.zoomHeights.length-1];for(var k=0;k<ur.UrbanRoof.zoomHeights.length-1;k++){if(ur.UrbanRoof.zoomHeights[k+1]<h){j=ur.UrbanRoof.zoomHeights[k];break}}return j};b.getSafeZoomHeight=function(l){var h=b.window().clientBounds().height*l;var j=ur.UrbanRoof.zoomHeights[ur.UrbanRoof.zoomHeights.length-1];for(var k=0;k<ur.UrbanRoof.zoomHeights.length;k++){if(ur.UrbanRoof.zoomHeights[k]<=h){j=ur.UrbanRoof.zoomHeights[k];break}}return j};b.getEmZoomHeight=function(m){var h=b.window().clientBounds().height*m;var k=ur.UrbanRoof.zoomHeights[ur.UrbanRoof.zoomHeights.length-1];for(var l=0;l<ur.UrbanRoof.zoomHeights.length;l++){var j=ur.UrbanRoof.zoomHeights[l]/ur.UrbanRoof.baseHeight;if(j>0.6*m){continue}if(ur.UrbanRoof.zoomHeights[l]<=h||j<0.5*m){k=ur.UrbanRoof.zoomHeights[l];break}}return k};function g(h,j){ur.UrbanRoof.pageZoomHeight=b.getZoomHeight(1);ur.UrbanRoof.safePageZoomHeight=b.getSafeZoomHeight(1);ur.UrbanRoof.pageZoom=ur.UrbanRoof.pageZoomHeight/ur.UrbanRoof.baseHeight;ur.UrbanRoof.safePageZoom=ur.UrbanRoof.safePageZoomHeight/ur.UrbanRoof.baseHeight;ur.UrbanRoof.emZoom=Math.min(Math.max(ur.UrbanRoof.pageZoom,0.5),0.6);var i=Math.round(62.5*2*ur.UrbanRoof.emZoom);$("body").css("font-size",i+"%")}f();return b};ur.UrbanRoof.loadComponents=[];ur.UrbanRoof.baseHeight=1600;ur.UrbanRoof.zoomHeights=[1600,1400,1200,1000,900,800,700,600,550,500,450,400,350,300,250,200];var webpage=new ur.UrbanRoof();$(webpage.run);
