/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return this}if(typeof selector==="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)}else{var elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3]){return jQuery().find(selector)}var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret}}else{return jQuery(context).find(selector)}}else{if(jQuery.isFunction(selector)){return jQuery(document).ready(selector)}}if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context}return this.setArray(jQuery.isArray(selector)?selector:jQuery.makeArray(selector))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(num){return num===undefined?Array.prototype.slice.call(this):this[num]},pushStack:function(elems,name,selector){var ret=jQuery(elems);ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector}else{if(name){ret.selector=this.selector+"."+name+"("+selector+")"}}return ret},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)},attr:function(name,value,type){var options=name;if(typeof name==="string"){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)}else{options={};options[name]=value}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))}})},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined}return this.attr(key,value,"curCSS")},text:function(text){if(typeof text!=="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])}})});return ret},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(function(){var elem=this;while(elem.firstChild){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},push:[].push,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem)})),"find",selector)}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;if(!html){var div=this.ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML}return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(events===true){var orig=this.find("*").andSelf(),i=0;ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName){return }var events=jQuery.data(orig[i],"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)}}i++})}return ret},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1})),"filter",selector)},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null,closer=0;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);return cur}cur=cur.parentNode;closer++}})},not:function(selector){if(typeof selector==="string"){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector)}else{selector=jQuery.multiFilter(selector,this)}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector})},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))))},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0},hasClass:function(selector){return !!selector&&this.is("."+selector)},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value}values.push(value)}}return values}return(elem.value||"").replace(/\r/g,"")}return undefined}if(typeof value==="number"){value+=""}return this.each(function(){if(this.nodeType!=1){return }if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)});if(!values.length){this.selectedIndex=-1}}else{this.value=value}}})},html:function(value){return value===undefined?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(value)},replaceWith:function(value){return this.after(value).remove()},eq:function(i){return this.slice(i,+i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild;if(first){for(var i=0,l=this.length;i<l;i++){callback.call(root(this[i],first),this.length>1||i>0?fragment.cloneNode(true):fragment)}}if(scripts){jQuery.each(scripts,evalScript)}}return this;function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem}}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}function now(){return +new Date}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}}if(length==i){target=this;--i}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];if(target===copy){continue}if(deep&&copy&&typeof copy==="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy)}else{if(copy!==undefined){target[name]=copy}}}}}return target};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isFunction:function(obj){return toString.call(obj)==="[object Function]"},isArray:function(obj){return toString.call(obj)==="[object Array]"},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument)},globalEval:function(data){if(data&&/\S/.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data))}else{script.text=data}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length===undefined){for(name in object){if(callback.apply(object[name],args)===false){break}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}}else{if(length===undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)}return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className}})},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className)}).join(" "):""}},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}},css:function(elem,name,force,extra){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return }jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0}})}if(elem.offsetWidth!==0){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,Math.round(val))}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret}if(name.match(/float/i)){name=styleFloat}if(!force&&style&&style[name]){ret=style[name]}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name)}if(name=="opacity"&&ret==""){ret="1"}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}}}return ret},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);if(match){return[context.createElement(match[1])]}}var ret=[],scripts=[],div=context.createElement("div");jQuery.each(elems,function(i,elem){if(typeof elem==="number"){elem+=""}if(!elem){return }if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"});var tags=elem.replace(/^\s+/,"").substring(0,10).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild}if(!jQuery.support.tbody){var hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}}if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)}elem=jQuery.makeArray(div.childNodes)}if(elem.nodeType){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))))}fragment.appendChild(ret[i])}}return scripts}return ret},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode){elem.parentNode.selectedIndex}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"}elem[name]=value}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined}return elem[name]}if(!jQuery.support.style&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)}if(set){elem.setAttribute(name,""+value)}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()});if(set){elem[name]=value}return elem[name]},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval){ret[0]=array}else{while(i){ret[--i]=array[i]}}}return ret},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return -1},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null){if(elem.nodeType!=8){first[pos++]=elem}}}else{while((elem=second[i++])!=null){first[pos++]=elem}}return first},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i])}}}catch(e){ret=array}return ret},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i])}}return ret},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null){ret[ret.length]=value}}return ret.concat.apply([],ret)}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode},parents:function(elem){return jQuery.dir(elem,"parentNode")},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)}return this.pushStack(jQuery.unique(ret),name,selector)}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems)}return this.pushStack(ret,name,selector)}});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name)}},addClass:function(classNames){jQuery.className.add(this,classNames)},removeClass:function(classNames){jQuery.className.remove(this,classNames)},toggleClass:function(classNames,state){if(typeof state!=="boolean"){state=!jQuery.className.has(this,classNames)}jQuery.className[state?"add":"remove"](this,classNames)},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){jQuery(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0}var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id){id=elem[expando]=++uuid}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}}if(data!==undefined){jQuery.cache[id][name]=data}return name?jQuery.cache[id][name]:id},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id]){break}if(!name){jQuery.removeData(elem)}}}else{try{delete elem[expando]}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)}}delete jQuery.cache[id]}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data))}else{if(data){q.push(data)}}}return q},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx"){fn=queue[0]}if(fn!==undefined){fn.call(elem)}}});jQuery.fn.extend({data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key)}return data===undefined&&parts[1]?this.data(parts[0]):data}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx"}if(data===undefined){return jQuery.queue(this[0],type)}return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1){queue[0].call(this)}})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,isXML(context))}}if(!checkSet){checkSet=set}if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else{if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,context,results,seed);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else{if(match===true){continue}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else{if(pass){result.push(item);anyFound=true}}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr}else{break}}old=expr}return curLoop};var Expr=Sizzle.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\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[]}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace){result.push(elem)}}else{if(inplace){curLoop[i]=false}}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase()},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else{if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return !!elem.firstChild},empty:function(elem){return !elem.firstChild},has:function(elem,i,match){return !!Sizzle(match[3],elem).length},header:function(elem){return/h\d/i.test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON"},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0==i},eq:function(elem,i,match){return match[3]-0==i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else{if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0}else{if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false}}return true}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while(node=node.previousSibling){if(node.nodeType===1){return false}}if(type=="first"){return true}node=elem;case"last":while(node=node.nextSibling){if(node.nodeType===1){return false}}return true;case"nth":var first=match[2],last=match[3];if(first==1&&last==0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first==0){return diff==0}else{return(diff%first==0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i])}}else{for(var i=0;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else{if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}return ret}}}}(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form)})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return }Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)}catch(e){}}return oldSizzle(query,context,extra,seed)};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0){return }div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return }Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}}})()}function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i}elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i}elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;break}}}elem=elem[dir]}checkSet[i]=match}}}var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument)};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet)}return Sizzle.filter(later,tmpSet)};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")"}return Sizzle.matches(expr,elems)};jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)}cur=cur[dir]}return matched};jQuery.nth=function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break}}return cur};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)}}return r};return ;window.Sizzle=Sizzle})();jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return }if(elem.setInterval&&elem!=window){elem=window}if(!handler.guid){handler.guid=this.guid++}if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type]){jQuery.event.specialAll[type].setup.call(elem,data,namespaces)}if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)}}}}handlers[handler.guid]=handler;jQuery.event.global[type]=true});elem=null},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return }var events=jQuery.data(elem,"events"),ret,index;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))}}else{if(types.type){handler=types.handler;types=types.type}jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler){delete events[type][handler.guid]}else{for(var handle in events[type]){if(namespace.test(events[type][handle].type)){delete events[type][handle]}}}if(jQuery.event.specialAll[type]){jQuery.event.specialAll[type].teardown.call(elem,namespaces)}for(ret in events[type]){break}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}}}ret=null;delete events[type]}}})}for(ret in events){break}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true}if(!elem){event.stopPropagation();if(this.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem)}})}}if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined}event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event)}event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data)}if((!elem[type]||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false}if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;try{elem[type]()}catch(e){}}this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent){jQuery.event.trigger(event,data,parent,true)}}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation()}}if(event.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event}var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop]}if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType==3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments)};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler)},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type)){remove++}});if(remove<1){jQuery.event.remove(this,namespaces[0],liveHandler)}}}}}};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src)}if(src&&src.type){this.originalEvent=src;this.type=src.type}else{this.type=src}this.timeStamp=now();this[expando]=true};function returnFalse(){return false}function returnTrue(){return true}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return }if(e.preventDefault){e.preventDefault()}e.returnValue=false},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return }if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation()},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this){try{parent=parent.parentNode}catch(e){parent=this}}if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments)}};jQuery.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix)},teardown:function(){jQuery.event.remove(this,orig,withinElement)}}});jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)})},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments)});return this.each(function(){jQuery.event.add(this,type,one,fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.event.proxy(fn,args[i++])}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut)},ready:function(fn){bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{jQuery.readyList.push(fn)}return this},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem){elems.push({elem:elem,fn:fn})}}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest")});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false){return(stop=false)}});return stop}function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".")}jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery)});jQuery.readyList=null}jQuery(document).triggerHandler("ready")}}});var readyBound=false;function bindReady(){if(readyBound){return }readyBound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(jQuery.isReady){return }try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return }jQuery.ready()})()}}}jQuery.event.add(window,"load",jQuery.ready)}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)}});jQuery(window).bind("unload",function(){for(var id in jQuery.cache){if(id!=1&&jQuery.cache[id].handle){jQuery.event.remove(jQuery.cache[id].handle.elem)}}});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return }jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"))}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id]}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee)});div.cloneNode(true).fireEvent("onclick")}jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display="none"})})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string"){return this._load(url)}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{if(typeof params==="object"){params=jQuery.param(params);type="POST"}}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)}if(callback){self.each(callback,[res.responseText,status,res])}}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data)}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType=="script"&&s.cache==null){s.cache=false}if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;head.removeChild(script)}}}head.appendChild(script);return undefined}var requestDone=false;var xhr=s.xhr();if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}xhr.abort();return false}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])}var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}}else{if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s)}catch(e){status="parsererror"}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes}if(!jsonp){success()}}else{jQuery.handleError(s,xhr,status)}complete();if(isTimeout){xhr.abort()}if(s.async){xhr=null}}}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout")}},s.timeout)}}try{xhr.send(s.data)}catch(e){jQuery.handleError(s,xhr,null,e)}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success(data,status)}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])}}function complete(){if(s.complete){s.complete(xhr,status)}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}return xhr},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223}catch(e){}return false},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]}catch(e){}return false},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"}if(s&&s.dataFilter){data=s.dataFilter(data,type)}if(typeof data==="string"){if(type=="script"){jQuery.globalEval(data)}if(type=="json"){data=window["eval"]("("+data+")")}}return data},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value)})}else{for(var j in a){if(jQuery.isArray(a[j])){jQuery.each(a[j],function(){add(j,this)})}else{add(j,jQuery.isFunction(a[j])?a[j]():a[j])}}}return s.join("&").replace(/%20/g,"+")}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type});return obj}jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName]}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block"}elem.remove();elemdisplay[tagName]=display}jQuery.data(this[i],"olddisplay",display)}}for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||""}return this}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"))}}for(var i=0,l=this.length;i<l;i++){this[i].style.display="none"}return this}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]()}):this.animate(genFx("toggle",3),fn,fn2)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)}if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback)}});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.call(this)}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){clearInterval(timerId);timerId=undefined}},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){jQuery(this.elem).hide()}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])}}this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=fx.now+fx.unit}else{fx.elem[fx.prop]=fx.now}}}});if(document.documentElement.getBoundingClientRect){jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0])}var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left}}}else{jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0])}jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName))){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0}prevComputedStyle=computedStyle}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop,left+=body.offsetLeft}if(prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft)}return{top:top,left:left}}}jQuery.offset={initialize:function(){if(this.initialized){return }var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<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>';rules={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(prop in rules){container.style[prop]=rules[prop]}container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow="hidden",innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseInt(jQuery.curCSS(body,"marginTop",true),10)||0,left+=parseInt(jQuery.curCSS(body,"marginLeft",true),10)||0}return{top:top,left:left}}};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent}return jQuery(offsetParent)}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){if(!this[0]){return null}return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]}});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px")}})})();(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return }for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},cssCache:{},css:function(D){if(C.ui.cssCache[D]){return C.ui.cssCache[D]}var E=C('<div class="ui-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{init:function(){var B=this.options;if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.element.addClass("ui-draggable");(B.disabled&&this.element.addClass("ui-draggable-disabled"));this.mouseInit()},mouseStart:function(F){var H=this.options;if(this.helper||H.disabled||A(F.target).is(".ui-resizable-handle")){return false}var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){C=true}});if(!C){return false}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(H.helper)?A(H.helper.apply(this.element[0],[F])):(H.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((H.appendTo=="parent"?this.element[0].parentNode:H.appendTo))}if(this.helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(this.helper.css("position"))){this.helper.css("position","absolute")}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){B={top:0,left:0}}this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var E=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:E.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:E.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(H.cursorAt){if(H.cursorAt.left!=undefined){this.offset.click.left=H.cursorAt.left+this.margins.left}if(H.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-H.cursorAt.right+this.margins.left}if(H.cursorAt.top!=undefined){this.offset.click.top=H.cursorAt.top+this.margins.top}if(H.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-H.cursorAt.bottom+this.margins.top}}if(H.containment){if(H.containment=="parent"){H.containment=this.helper[0].parentNode}if(H.containment=="document"||H.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(H.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(H.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(H.containment)){var D=A(H.containment)[0];var G=A(H.containment).offset();this.containment=[G.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,G.top+(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,G.left+Math.max(D.scrollWidth,D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),G.top+Math.max(D.scrollHeight,D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!H.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}this.helper.addClass("ui-draggable-dragging");this.mouseDrag(F);return true},convertPositionTo:function(C,D){if(!D){D=this.position}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)*B+(this.cssPosition=="fixed"?A(document).scrollTop():0)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)*B+(this.cssPosition=="fixed"?A(document).scrollLeft():0)*B+this.margins.left*B)}},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?A(document).scrollTop():0)),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?A(document).scrollLeft():0))};if(!this.originalPosition){return B}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0]}if(B.top<this.containment[1]){B.top=this.containment[1]}if(B.left>this.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(D<this.containment[1]||D>this.containment[3])?D:(!(D<this.containment[1])?D-F.grid[1]:D+F.grid[1])):D;var C=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/F.grid[0])*F.grid[0];B.left=this.containment?(!(C<this.containment[0]||C>this.containment[2])?C:(!(C<this.containment[0])?C-F.grid[0]:C+F.grid[0])):C}return B},mouseDrag:function(B){this.position=this.generatePosition(B);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",B)||this.position;if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C)}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){B.propagate("stop",C);B.clear()})}else{this.propagate("stop",C);this.clear()}return false},clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.options.helper!="original"&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.uiHash()]);if(C=="drag"){this.positionAbs=this.convertPositionTo("absolute")}return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.uiHash()],this.options[C])},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable");this.mouseDestroy()}}));A.extend(A.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(C,B){A(B.options.iframeFix===true?"iframe":B.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset()}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset()}},drag:function(D,C){var E=C.options;var B=A(this).data("draggable");if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if((B.overflowYOffset.top+B.overflowY[0].offsetHeight)-D.pageY<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed}if(D.pageY-B.overflowYOffset.top<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed)}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed)}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if((B.overflowXOffset.left+B.overflowX[0].offsetWidth)-D.pageX<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed}if(D.pageX-B.overflowXOffset.left<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed)}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed)}}}});A.ui.plugin.add("draggable","snap",{start:function(D,C){var B=A(this).data("draggable");B.snapElements=[];A(C.options.snap===true?".ui-draggable":C.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(J,N){var I=A(this).data("draggable");var L=N.options.snapTolerance||20;var D=N.absolutePosition.left,C=D+I.helperProportions.width,P=N.absolutePosition.top,O=P+I.helperProportions.height;for(var H=I.snapElements.length-1;H>=0;H--){var E=I.snapElements[H].left,B=E+I.snapElements[H].width,R=I.snapElements[H].top,M=R+I.snapElements[H].height;if(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<O&&O<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<O&&O<M+L))){continue}if(N.options.snapMode!="inner"){var K=Math.abs(R-O)<=20;var Q=Math.abs(M-P)<=20;var G=Math.abs(E-C)<=20;var F=Math.abs(B-D)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R-I.helperProportions.height,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E-I.helperProportions.width}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B}).left}}if(N.options.snapMode!="outer"){var K=Math.abs(R-P)<=20;var Q=Math.abs(M-O)<=20;var G=Math.abs(E-D)<=20;var F=Math.abs(B-C)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M-I.helperProportions.height,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B-I.helperProportions.width}).left}}}}});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,C){var B=A(this).data("draggable");B.sortables=[];A(C.options.connectToSortable).each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");B.sortables.push({instance:E,shouldRevert:E.options.revert});E.refreshItems();E.propagate("activate",D,B)}})},stop:function(D,C){var B=A(this).data("draggable");A.each(B.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;B.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance.mouseStop(D);this.instance.element.triggerHandler("sortreceive",[D,A.extend(this.instance.ui(),{sender:B.element})],this.instance.options.receive);this.instance.options.helper=this.instance.options._helper}else{this.instance.propagate("deactivate",D,B)}})},drag:function(F,E){var D=A(this).data("draggable"),B=this;var C=function(K){var H=K.left,J=H+K.width,I=K.top,G=I+K.height;return(H<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<J&&I<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<G)};A.each(D.sortables,function(G){if(C.call(D,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return E.helper[0]};F.target=this.instance.currentItem[0];this.instance.mouseCapture(F,true);this.instance.mouseStart(F,true,true);this.instance.offset.click.top=D.offset.click.top;this.instance.offset.click.left=D.offset.click.left;this.instance.offset.parent.left-=D.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=D.offset.parent.top-this.instance.offset.parent.top;D.propagate("toSortable",F)}if(this.instance.currentItem){this.instance.mouseDrag(F)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance.mouseStop(F,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}D.propagate("fromSortable",F)}}})}});A.ui.plugin.add("draggable","stack",{start:function(D,B){var C=A.makeArray(A(B.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||B.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||B.options.stack.min)});A(C).each(function(E){this.style.zIndex=B.options.stack.min+E});this[0].style.zIndex=B.options.stack.min+C.length}})})(jQuery);(function(A){A.widget("ui.droppable",{init:function(){this.element.addClass("ui-droppable");this.isover=0;this.isout=1;var C=this.options,B=C.accept;C=A.extend(C,{accept:C.accept&&C.accept.constructor==Function?C.accept:function(D){return A(D).is(B)}});this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};A.ui.ddmanager.droppables.push(this)},plugins:{},ui:function(B){return{draggable:(B.currentItem||B.element),helper:B.helper,position:B.position,absolutePosition:B.positionAbs,options:this.options,element:this.element}},destroy:function(){var B=A.ui.ddmanager.droppables;for(var C=0;C<B.length;C++){if(B[C]==this){B.splice(C,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},over:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"over",[C,this.ui(B)]);this.element.triggerHandler("dropover",[C,this.ui(B)],this.options.over)}},out:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"out",[C,this.ui(B)]);this.element.triggerHandler("dropout",[C,this.ui(B)],this.options.out)}},drop:function(D,C){var B=C||A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return false}var E=false;this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function(){var F=A.data(this,"droppable");if(F.options.greedy&&A.ui.intersect(B,A.extend(F,{offset:F.element.offset()}),F.options.tolerance)){E=true;return false}});if(E){return false}if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"drop",[D,this.ui(B)]);this.element.triggerHandler("drop",[D,this.ui(B)],this.options.drop);return true}return false},activate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"activate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropactivate",[C,this.ui(B)],this.options.activate)}},deactivate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"deactivate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropdeactivate",[C,this.ui(B)],this.options.deactivate)}}});A.extend(A.ui.droppable,{defaults:{disabled:false,tolerance:"intersect"}});A.ui.intersect=function(L,F,J){if(!F.offset){return false}var D=(L.positionAbs||L.position.absolute).left,C=D+L.helperProportions.width,I=(L.positionAbs||L.position.absolute).top,H=I+L.helperProportions.height;var E=F.offset.left,B=E+F.proportions.width,K=F.offset.top,G=K+F.proportions.height;switch(J){case"fit":return(E<D&&C<B&&K<I&&H<G);break;case"intersect":return(E<D+(L.helperProportions.width/2)&&C-(L.helperProportions.width/2)<B&&K<I+(L.helperProportions.height/2)&&H-(L.helperProportions.height/2)<G);break;case"pointer":return(E<((L.positionAbs||L.position.absolute).left+(L.clickOffset||L.offset.click).left)&&((L.positionAbs||L.position.absolute).left+(L.clickOffset||L.offset.click).left)<B&&K<((L.positionAbs||L.position.absolute).top+(L.clickOffset||L.offset.click).top)&&((L.positionAbs||L.position.absolute).top+(L.clickOffset||L.offset.click).top)<G);break;case"touch":return((I>=K&&I<=G)||(H>=K&&H<=G)||(I<K&&H>G))&&((D>=E&&D<=B)||(C>=E&&C<=B)||(D<E&&C>B));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(D,F){var B=A.ui.ddmanager.droppables;var E=F?F.type:null;for(var C=0;C<B.length;C++){if(B[C].options.disabled||(D&&!B[C].options.accept.call(B[C].element,(D.currentItem||D.element)))){continue}B[C].visible=B[C].element.css("display")!="none";if(!B[C].visible){continue}B[C].offset=B[C].element.offset();B[C].proportions={width:B[C].element[0].offsetWidth,height:B[C].element[0].offsetHeight};if(E=="dragstart"||E=="sortactivate"){B[C].activate.call(B[C],F)}}},drop:function(B,C){var D=false;A.each(A.ui.ddmanager.droppables,function(){if(!this.options){return }if(!this.options.disabled&&this.visible&&A.ui.intersect(B,this,this.options.tolerance)){D=this.drop.call(this,C)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,(B.currentItem||B.element))){this.isout=1;this.isover=0;this.deactivate.call(this,C)}});return D},drag:function(B,C){if(B.options.refreshPositions){A.ui.ddmanager.prepareOffsets(B,C)}A.each(A.ui.ddmanager.droppables,function(){if(this.options.disabled||this.greedyChild||!this.visible){return }var E=A.ui.intersect(B,this,this.options.tolerance);var G=!E&&this.isover==1?"isout":(E&&this.isover==0?"isover":null);if(!G){return }var F;if(this.options.greedy){var D=this.element.parents(".ui-droppable:eq(0)");if(D.length){F=A.data(D[0],"droppable");F.greedyChild=(G=="isover"?1:0)}}if(F&&G=="isover"){F.isover=0;F.isout=1;F.out.call(F,C)}this[G]=1;this[G=="isout"?"isover":"isout"]=0;this[G=="isover"?"over":"out"].call(this,C);if(F&&G=="isout"){F.isout=0;F.isover=1;F.over.call(F,C)}})}};A.ui.plugin.add("droppable","activeClass",{activate:function(C,B){A(this).addClass(B.options.activeClass)},deactivate:function(C,B){A(this).removeClass(B.options.activeClass)},drop:function(C,B){A(this).removeClass(B.options.activeClass)}});A.ui.plugin.add("droppable","hoverClass",{over:function(C,B){A(this).addClass(B.options.hoverClass)},out:function(C,B){A(this).removeClass(B.options.hoverClass)},drop:function(C,B){A(this).removeClass(B.options.hoverClass)}})})(jQuery);(function(A){A.widget("ui.resizable",A.extend({},A.ui.mouse,{init:function(){var M=this,N=this.options;var Q=this.element.css("position");this.originalElement=this.element;this.element.addClass("ui-resizable").css({position:/static/.test(Q)?"relative":Q});A.extend(N,{_aspectRatio:!!(N.aspectRatio),helper:N.helper||N.ghost||N.animate?N.helper||"proxy":null,knobHandles:N.knobHandles===true?"ui-resizable-knob-handle":N.knobHandles});var H="1px solid #DEDEDE";N.defaultTheme={"ui-resizable":{display:"block"},"ui-resizable-handle":{position:"absolute",background:"#F2F2F2",fontSize:"0.1px"},"ui-resizable-n":{cursor:"n-resize",height:"4px",left:"0px",right:"0px",borderTop:H},"ui-resizable-s":{cursor:"s-resize",height:"4px",left:"0px",right:"0px",borderBottom:H},"ui-resizable-e":{cursor:"e-resize",width:"4px",top:"0px",bottom:"0px",borderRight:H},"ui-resizable-w":{cursor:"w-resize",width:"4px",top:"0px",bottom:"0px",borderLeft:H},"ui-resizable-se":{cursor:"se-resize",width:"4px",height:"4px",borderRight:H,borderBottom:H},"ui-resizable-sw":{cursor:"sw-resize",width:"4px",height:"4px",borderBottom:H,borderLeft:H},"ui-resizable-ne":{cursor:"ne-resize",width:"4px",height:"4px",borderRight:H,borderTop:H},"ui-resizable-nw":{cursor:"nw-resize",width:"4px",height:"4px",borderLeft:H,borderTop:H}};N.knobTheme={"ui-resizable-handle":{background:"#F2F2F2",border:"1px solid #808080",height:"8px",width:"8px"},"ui-resizable-n":{cursor:"n-resize",top:"0px",left:"45%"},"ui-resizable-s":{cursor:"s-resize",bottom:"0px",left:"45%"},"ui-resizable-e":{cursor:"e-resize",right:"0px",top:"45%"},"ui-resizable-w":{cursor:"w-resize",left:"0px",top:"45%"},"ui-resizable-se":{cursor:"se-resize",right:"0px",bottom:"0px"},"ui-resizable-sw":{cursor:"sw-resize",left:"0px",bottom:"0px"},"ui-resizable-nw":{cursor:"nw-resize",left:"0px",top:"0px"},"ui-resizable-ne":{cursor:"ne-resize",right:"0px",top:"0px"}};N._nodeName=this.element[0].nodeName;if(N._nodeName.match(/canvas|textarea|input|select|button|img/i)){var B=this.element;if(/relative/.test(B.css("position"))&&A.browser.opera){B.css({position:"relative",top:"auto",left:"auto"})}B.wrap(A('<div class="ui-wrapper"	style="overflow: hidden;"></div>').css({position:B.css("position"),width:B.outerWidth(),height:B.outerHeight(),top:B.css("top"),left:B.css("left")}));var J=this.element;this.element=this.element.parent();this.element.data("resizable",this);this.element.css({marginLeft:J.css("marginLeft"),marginTop:J.css("marginTop"),marginRight:J.css("marginRight"),marginBottom:J.css("marginBottom")});J.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if(A.browser.safari&&N.preventDefault){J.css("resize","none")}N.proportionallyResize=J.css({position:"static",zoom:1,display:"block"});this.element.css({margin:J.css("margin")});this._proportionallyResize()}if(!N.handles){N.handles=!A(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}}if(N.handles.constructor==String){N.zIndex=N.zIndex||1000;if(N.handles=="all"){N.handles="n,e,s,w,se,sw,ne,nw"}var O=N.handles.split(",");N.handles={};var G={handle:"position: absolute; display: none; overflow:hidden;",n:"top: 0pt; width:100%;",e:"right: 0pt; height:100%;",s:"bottom: 0pt; width:100%;",w:"left: 0pt; height:100%;",se:"bottom: 0pt; right: 0px;",sw:"bottom: 0pt; left: 0px;",ne:"top: 0pt; right: 0px;",nw:"top: 0pt; left: 0px;"};for(var R=0;R<O.length;R++){var S=A.trim(O[R]),L=N.defaultTheme,F="ui-resizable-"+S,C=!A.ui.css(F)&&!N.knobHandles,P=A.ui.css("ui-resizable-knob-handle"),T=A.extend(L[F],L["ui-resizable-handle"]),D=A.extend(N.knobTheme[F],!P?N.knobTheme["ui-resizable-handle"]:{});var K=/sw|se|ne|nw/.test(S)?{zIndex:++N.zIndex}:{};var I=(C?G[S]:""),E=A(['<div class="ui-resizable-handle ',F,'" style="',I,G.handle,'"></div>'].join("")).css(K);N.handles[S]=".ui-resizable-"+S;this.element.append(E.css(C?T:{}).css(N.knobHandles?D:{}).addClass(N.knobHandles?"ui-resizable-knob-handle":"").addClass(N.knobHandles))}if(N.knobHandles){this.element.addClass("ui-resizable-knob").css(!A.ui.css("ui-resizable-knob")?{}:{})}}this._renderAxis=function(Y){Y=Y||this.element;for(var V in N.handles){if(N.handles[V].constructor==String){N.handles[V]=A(N.handles[V],this.element).show()}if(N.transparent){N.handles[V].css({opacity:0})}if(this.element.is(".ui-wrapper")&&N._nodeName.match(/textarea|input|select|button/i)){var W=A(N.handles[V],this.element),X=0;X=/sw|ne|nw|se|n|s/.test(V)?W.outerHeight():W.outerWidth();var U=["padding",/ne|nw|n/.test(V)?"Top":/se|sw|s/.test(V)?"Bottom":/^e$/.test(V)?"Right":"Left"].join("");if(!N.transparent){Y.css(U,X)}this._proportionallyResize()}if(!A(N.handles[V]).length){continue}}};this._renderAxis(this.element);N._handles=A(".ui-resizable-handle",M.element);if(N.disableSelection){N._handles.each(function(U,V){A.ui.disableSelection(V)})}N._handles.mouseover(function(){if(!N.resizing){if(this.className){var U=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}M.axis=N.axis=U&&U[1]?U[1]:"se"}});if(N.autoHide){N._handles.hide();A(M.element).addClass("ui-resizable-autohide").hover(function(){A(this).removeClass("ui-resizable-autohide");N._handles.show()},function(){if(!N.resizing){A(this).addClass("ui-resizable-autohide");N._handles.hide()}})}this.mouseInit()},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,options:this.options,originalSize:this.originalSize,originalPosition:this.originalPosition}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);if(C!="resize"){this.element.triggerHandler(["resize",C].join(""),[B,this.ui()],this.options[C])}},destroy:function(){var D=this.element,C=D.children(".ui-resizable").get(0);this.mouseDestroy();var B=function(E){A(E).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};B(D);if(D.is(".ui-wrapper")&&C){D.parent().append(A(C).css({position:D.css("position"),width:D.outerWidth(),height:D.outerHeight(),top:D.css("top"),left:D.css("left")})).end().remove();B(C)}},mouseStart:function(K){if(this.options.disabled){return false}var J=false;for(var H in this.options.handles){if(A(this.options.handles[H])[0]==K.target){J=true}}if(!J){return false}var C=this.options,B=this.element.position(),D=this.element,I=function(O){return parseInt(O,10)||0},G=A.browser.msie&&A.browser.version<7;C.resizing=true;C.documentScroll={top:A(document).scrollTop(),left:A(document).scrollLeft()};if(D.is(".ui-draggable")||(/absolute/).test(D.css("position"))){var M=A.browser.msie&&!C.containment&&(/absolute/).test(D.css("position"))&&!(/relative/).test(D.parent().css("position"));var L=M?C.documentScroll.top:0,F=M?C.documentScroll.left:0;D.css({position:"absolute",top:(B.top+L),left:(B.left+F)})}if(A.browser.opera&&/relative/.test(D.css("position"))){D.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var N=I(this.helper.css("left")),E=I(this.helper.css("top"));if(C.containment){N+=A(C.containment).scrollLeft()||0;E+=A(C.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:N,top:E};this.size=C.helper||G?{width:D.outerWidth(),height:D.outerHeight()}:{width:D.width(),height:D.height()};this.originalSize=C.helper||G?{width:D.outerWidth(),height:D.outerHeight()}:{width:D.width(),height:D.height()};this.originalPosition={left:N,top:E};this.sizeDiff={width:D.outerWidth()-D.width(),height:D.outerHeight()-D.height()};this.originalMousePosition={left:K.pageX,top:K.pageY};C.aspectRatio=(typeof C.aspectRatio=="number")?C.aspectRatio:((this.originalSize.height/this.originalSize.width)||1);if(C.preserveCursor){A("body").css("cursor",this.axis+"-resize")}this.propagate("start",K);return true},mouseDrag:function(I){var D=this.helper,C=this.options,J={},M=this,F=this.originalMousePosition,K=this.axis;var N=(I.pageX-F.left)||0,L=(I.pageY-F.top)||0;var E=this._change[K];if(!E){return false}var H=E.apply(this,[I,N,L]),G=A.browser.msie&&A.browser.version<7,B=this.sizeDiff;if(C._aspectRatio||I.shiftKey){H=this._updateRatio(H,I)}H=this._respectSize(H,I);this.propagate("resize",I);D.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!C.helper&&C.proportionallyResize){this._proportionallyResize()}this._updateCache(H);this.element.triggerHandler("resize",[I,this.ui()],this.options.resize);return false},mouseStop:function(I){this.options.resizing=false;var E=this.options,H=function(M){return parseInt(M,10)||0},K=this;if(E.helper){var D=E.proportionallyResize,B=D&&(/textarea/i).test(D.get(0).nodeName),C=B&&A.ui.hasScroll(D.get(0),"left")?0:K.sizeDiff.height,G=B?0:K.sizeDiff.width;var L={width:(K.size.width-G),height:(K.size.height-C)},F=(parseInt(K.element.css("left"),10)+(K.position.left-K.originalPosition.left))||null,J=(parseInt(K.element.css("top"),10)+(K.position.top-K.originalPosition.top))||null;if(!E.animate){this.element.css(A.extend(L,{top:J,left:F}))}if(E.helper&&!E.animate){this._proportionallyResize()}}if(E.preserveCursor){A("body").css("cursor","auto")}this.propagate("stop",I);if(E.helper){this.helper.remove()}return false},_updateCache:function(B){var C=this.options;this.offset=this.helper.offset();if(B.left){this.position.left=B.left}if(B.top){this.position.top=B.top}if(B.height){this.size.height=B.height}if(B.width){this.size.width=B.width}},_updateRatio:function(D,E){var F=this.options,G=this.position,C=this.size,B=this.axis;if(D.height){D.width=(C.height/F.aspectRatio)}else{if(D.width){D.height=(C.width*F.aspectRatio)}}if(B=="sw"){D.left=G.left+(C.width-D.width);D.top=null}if(B=="nw"){D.top=G.top+(C.height-D.height);D.left=G.left+(C.width-D.width)}return D},_respectSize:function(H,I){var F=this.helper,E=this.options,N=E._aspectRatio||I.shiftKey,M=this.axis,P=H.width&&E.maxWidth&&E.maxWidth<H.width,J=H.height&&E.maxHeight&&E.maxHeight<H.height,D=H.width&&E.minWidth&&E.minWidth>H.width,O=H.height&&E.minHeight&&E.minHeight>H.height;if(D){H.width=E.minWidth}if(O){H.height=E.minHeight}if(P){H.width=E.maxWidth}if(J){H.height=E.maxHeight}var C=this.originalPosition.left+this.originalSize.width,L=this.position.top+this.size.height;var G=/sw|nw|w/.test(M),B=/nw|ne|n/.test(M);if(D&&G){H.left=C-E.minWidth}if(P&&G){H.left=C-E.maxWidth}if(O&&B){H.top=L-E.minHeight}if(J&&B){H.top=L-E.maxHeight}var K=!H.width&&!H.height;if(K&&!H.left&&H.top){H.top=null}else{if(K&&!H.top&&H.left){H.left=null}}return H},_proportionallyResize:function(){var F=this.options;if(!F.proportionallyResize){return }var D=F.proportionallyResize,C=this.helper||this.element;if(!F.borderDif){var B=[D.css("borderTopWidth"),D.css("borderRightWidth"),D.css("borderBottomWidth"),D.css("borderLeftWidth")],E=[D.css("paddingTop"),D.css("paddingRight"),D.css("paddingBottom"),D.css("paddingLeft")];F.borderDif=A.map(B,function(G,I){var H=parseInt(G,10)||0,J=parseInt(E[I],10)||0;return H+J})}D.css({height:(C.height()-F.borderDif[0]-F.borderDif[2])+"px",width:(C.width()-F.borderDif[1]-F.borderDif[3])+"px"})},_renderProxy:function(){var C=this.element,F=this.options;this.elementOffset=C.offset();if(F.helper){this.helper=this.helper||A('<div style="overflow:hidden;"></div>');var B=A.browser.msie&&A.browser.version<7,D=(B?1:0),E=(B?2:-1);this.helper.addClass(F.helper).css({width:C.outerWidth()+E,height:C.outerHeight()+E,position:"absolute",left:this.elementOffset.left-D+"px",top:this.elementOffset.top-D+"px",zIndex:++F.zIndex});this.helper.appendTo("body");if(F.disableSelection){A.ui.disableSelection(this.helper.get(0))}}else{this.helper=C}},_change:{e:function(D,C,B){return{width:this.originalSize.width+C}},w:function(F,C,B){var G=this.options,D=this.originalSize,E=this.originalPosition;return{left:E.left+C,width:D.width-C}},n:function(F,C,B){var G=this.options,D=this.originalSize,E=this.originalPosition;return{top:E.top+B,height:D.height-B}},s:function(D,C,B){return{height:this.originalSize.height+B}},se:function(D,C,B){return A.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[D,C,B]))},sw:function(D,C,B){return A.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[D,C,B]))},ne:function(D,C,B){return A.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[D,C,B]))},nw:function(D,C,B){return A.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[D,C,B]))}}}));A.extend(A.ui.resizable,{defaults:{cancel:":input",distance:1,delay:0,preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autoHide:false,knobHandles:false}});A.ui.plugin.add("resizable","containment",{start:function(I,K){var E=K.options,M=A(this).data("resizable"),G=M.element;var C=E.containment,F=(C instanceof A)?C.get(0):(/parent/.test(C))?G.parent().get(0):C;if(!F){return }M.containerElement=A(F);if(/document/.test(C)||C==document){M.containerOffset={left:0,top:0};M.containerPosition={left:0,top:0};M.parentData={element:A(document),left:0,top:0,width:A(document).width(),height:A(document).height()||document.body.parentNode.scrollHeight}}else{M.containerOffset=A(F).offset();M.containerPosition=A(F).position();M.containerSize={height:A(F).innerHeight(),width:A(F).innerWidth()};var J=M.containerOffset,B=M.containerSize.height,H=M.containerSize.width,D=(A.ui.hasScroll(F,"left")?F.scrollWidth:H),L=(A.ui.hasScroll(F)?F.scrollHeight:B);M.parentData={element:F,left:J.left,top:J.top,width:D,height:L}}},resize:function(H,K){var E=K.options,N=A(this).data("resizable"),C=N.containerSize,J=N.containerOffset,G=N.size,I=N.position,L=E._aspectRatio||H.shiftKey,B={top:0,left:0},D=N.containerElement;if(D[0]!=document&&/static/.test(D.css("position"))){B=N.containerPosition}if(I.left<(E.helper?J.left:B.left)){N.size.width=N.size.width+(E.helper?(N.position.left-J.left):(N.position.left-B.left));if(L){N.size.height=N.size.width*E.aspectRatio}N.position.left=E.helper?J.left:B.left}if(I.top<(E.helper?J.top:0)){N.size.height=N.size.height+(E.helper?(N.position.top-J.top):N.position.top);if(L){N.size.width=N.size.height/E.aspectRatio}N.position.top=E.helper?J.top:0}var F=(E.helper?N.offset.left-J.left:(N.position.left-B.left))+N.sizeDiff.width,M=(E.helper?N.offset.top-J.top:N.position.top)+N.sizeDiff.height;if(F+N.size.width>=N.parentData.width){N.size.width=N.parentData.width-F;if(L){N.size.height=N.size.width*E.aspectRatio}}if(M+N.size.height>=N.parentData.height){N.size.height=N.parentData.height-M;if(L){N.size.width=N.size.height/E.aspectRatio}}},stop:function(G,J){var C=J.options,L=A(this).data("resizable"),H=L.position,I=L.containerOffset,B=L.containerPosition,D=L.containerElement;var E=A(L.helper),M=E.offset(),K=E.innerWidth(),F=E.innerHeight();if(C.helper&&!C.animate&&/relative/.test(D.css("position"))){A(this).css({left:(M.left-I.left),top:(M.top-I.top),width:K,height:F})}if(C.helper&&!C.animate&&/static/.test(D.css("position"))){A(this).css({left:B.left+(M.left-I.left),top:B.top+(M.top-I.top),width:K,height:F})}}});A.ui.plugin.add("resizable","grid",{resize:function(H,J){var D=J.options,L=A(this).data("resizable"),G=L.size,E=L.originalSize,F=L.originalPosition,K=L.axis,I=D._aspectRatio||H.shiftKey;D.grid=typeof D.grid=="number"?[D.grid,D.grid]:D.grid;var C=Math.round((G.width-E.width)/(D.grid[0]||1))*(D.grid[0]||1),B=Math.round((G.height-E.height)/(D.grid[1]||1))*(D.grid[1]||1);if(/^(se|s|e)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B}else{if(/^(ne)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B;L.position.top=F.top-B}else{if(/^(sw)$/.test(K)){L.size.width=E.width+C;L.size.height=E.height+B;L.position.left=F.left-C}else{L.size.width=E.width+C;L.size.height=E.height+B;L.position.top=F.top-B;L.position.left=F.left-C}}}}});A.ui.plugin.add("resizable","animate",{stop:function(I,K){var F=K.options,L=A(this).data("resizable");var E=F.proportionallyResize,B=E&&(/textarea/i).test(E.get(0).nodeName),C=B&&A.ui.hasScroll(E.get(0),"left")?0:L.sizeDiff.height,H=B?0:L.sizeDiff.width;var D={width:(L.size.width-H),height:(L.size.height-C)},G=(parseInt(L.element.css("left"),10)+(L.position.left-L.originalPosition.left))||null,J=(parseInt(L.element.css("top"),10)+(L.position.top-L.originalPosition.top))||null;L.element.animate(A.extend(D,J&&G?{top:J,left:G}:{}),{duration:F.animateDuration||"slow",easing:F.animateEasing||"swing",step:function(){var M={width:parseInt(L.element.css("width"),10),height:parseInt(L.element.css("height"),10),top:parseInt(L.element.css("top"),10),left:parseInt(L.element.css("left"),10)};if(E){E.css({width:M.width,height:M.height})}L._updateCache(M);L.propagate("animate",I)}})}});A.ui.plugin.add("resizable","ghost",{start:function(E,D){var F=D.options,B=A(this).data("resizable"),G=F.proportionallyResize,C=B.size;if(!G){B.ghost=B.element.clone()}else{B.ghost=G.clone()}B.ghost.css({opacity:0.25,display:"block",position:"relative",height:C.height,width:C.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof F.ghost=="string"?F.ghost:"");B.ghost.appendTo(B.helper)},resize:function(D,C){var E=C.options,B=A(this).data("resizable"),F=E.proportionallyResize;if(B.ghost){B.ghost.css({position:"relative",height:B.size.height,width:B.size.width})}},stop:function(D,C){var E=C.options,B=A(this).data("resizable"),F=E.proportionallyResize;if(B.ghost&&B.helper){B.helper.get(0).removeChild(B.ghost.get(0))}}});A.ui.plugin.add("resizable","alsoResize",{start:function(E,C){var F=C.options,B=A(this).data("resizable"),D=function(G){A(G).each(function(){A(this).data("resizable-alsoresize",{width:parseInt(A(this).width(),10),height:parseInt(A(this).height(),10),left:parseInt(A(this).css("left"),10),top:parseInt(A(this).css("top"),10)})})};if(typeof (F.alsoResize)=="object"){if(F.alsoResize.length){F.alsoResize=F.alsoResize[0];D(F.alsoResize)}else{A.each(F.alsoResize,function(G,H){D(G)})}}else{D(F.alsoResize)}},resize:function(F,E){var G=E.options,C=A(this).data("resizable"),D=C.originalSize,I=C.originalPosition;var H={height:(C.size.height-D.height)||0,width:(C.size.width-D.width)||0,top:(C.position.top-I.top)||0,left:(C.position.left-I.left)||0},B=function(J,K){A(J).each(function(){var N=A(this).data("resizable-alsoresize"),M={},L=K&&K.length?K:["width","height","top","left"];A.each(L||["width","height","top","left"],function(O,Q){var P=(N[Q]||0)+(H[Q]||0);if(P&&P>=0){M[Q]=P||null}});A(this).css(M)})};if(typeof (G.alsoResize)=="object"){A.each(G.alsoResize,function(J,K){B(J,K)})}else{B(G.alsoResize)}},stop:function(C,B){A(this).removeData("resizable-alsoresize-start")}})})(jQuery);(function(A){A.widget("ui.selectable",A.extend({},A.ui.mouse,{init:function(){var B=this;this.element.addClass("ui-selectable");this.dragged=false;var C;this.refresh=function(){C=A(B.options.filter,B.element[0]);C.each(function(){var D=A(this);var E=D.offset();A.data(this,"selectable-item",{element:this,$element:D,left:E.left,top:E.top,right:E.left+D.width(),bottom:E.top+D.height(),startselected:false,selected:D.hasClass("ui-selected"),selecting:D.hasClass("ui-selecting"),unselecting:D.hasClass("ui-unselecting")})})};this.refresh();this.selectees=C.addClass("ui-selectee");this.mouseInit();this.helper=A(document.createElement("div")).css({border:"1px dotted black"})},toggle:function(){if(this.options.disabled){this.enable()}else{this.disable()}},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this.mouseDestroy()},mouseStart:function(E){var C=this;this.opos=[E.pageX,E.pageY];if(this.options.disabled){return }var D=this.options;this.selectees=A(D.filter,this.element[0]);this.element.triggerHandler("selectablestart",[E,{selectable:this.element[0],options:D}],D.start);A("body").append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:E.clientX,top:E.clientY,width:0,height:0});if(D.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var F=A.data(this,"selectable-item");F.startselected=true;if(!E.ctrlKey){F.$element.removeClass("ui-selected");F.selected=false;F.$element.addClass("ui-unselecting");F.unselecting=true;C.element.triggerHandler("selectableunselecting",[E,{selectable:C.element[0],unselecting:F.element,options:D}],D.unselecting)}});var B=false;A(E.target).parents().andSelf().each(function(){if(A.data(this,"selectable-item")){B=true}});return this.options.keyboard?!B:true},mouseDrag:function(I){var C=this;this.dragged=true;if(this.options.disabled){return }var E=this.options;var D=this.opos[0],H=this.opos[1],B=I.pageX,G=I.pageY;if(D>B){var F=B;B=D;D=F}if(H>G){var F=G;G=H;H=F}this.helper.css({left:D,top:H,width:B-D,height:G-H});this.selectees.each(function(){var J=A.data(this,"selectable-item");if(!J||J.element==C.element[0]){return }var K=false;if(E.tolerance=="touch"){K=(!(J.left>B||J.right<D||J.top>G||J.bottom<H))}else{if(E.tolerance=="fit"){K=(J.left>D&&J.right<B&&J.top>H&&J.bottom<G)}}if(K){if(J.selected){J.$element.removeClass("ui-selected");J.selected=false}if(J.unselecting){J.$element.removeClass("ui-unselecting");J.unselecting=false}if(!J.selecting){J.$element.addClass("ui-selecting");J.selecting=true;C.element.triggerHandler("selectableselecting",[I,{selectable:C.element[0],selecting:J.element,options:E}],E.selecting)}}else{if(J.selecting){if(I.ctrlKey&&J.startselected){J.$element.removeClass("ui-selecting");J.selecting=false;J.$element.addClass("ui-selected");J.selected=true}else{J.$element.removeClass("ui-selecting");J.selecting=false;if(J.startselected){J.$element.addClass("ui-unselecting");J.unselecting=true}C.element.triggerHandler("selectableunselecting",[I,{selectable:C.element[0],unselecting:J.element,options:E}],E.unselecting)}}if(J.selected){if(!I.ctrlKey&&!J.startselected){J.$element.removeClass("ui-selected");J.selected=false;J.$element.addClass("ui-unselecting");J.unselecting=true;C.element.triggerHandler("selectableunselecting",[I,{selectable:C.element[0],unselecting:J.element,options:E}],E.unselecting)}}}});return false},mouseStop:function(D){var B=this;this.dragged=false;var C=this.options;A(".ui-unselecting",this.element[0]).each(function(){var E=A.data(this,"selectable-item");E.$element.removeClass("ui-unselecting");E.unselecting=false;E.startselected=false;B.element.triggerHandler("selectableunselected",[D,{selectable:B.element[0],unselected:E.element,options:C}],C.unselected)});A(".ui-selecting",this.element[0]).each(function(){var E=A.data(this,"selectable-item");E.$element.removeClass("ui-selecting").addClass("ui-selected");E.selecting=false;E.selected=true;E.startselected=true;B.element.triggerHandler("selectableselected",[D,{selectable:B.element[0],selected:E.element,options:C}],C.selected)});this.element.triggerHandler("selectablestop",[D,{selectable:B.element[0],options:this.options}],this.options.stop);this.helper.remove();return false}}));A.extend(A.ui.selectable,{defaults:{distance:1,delay:0,cancel:":input",appendTo:"body",autoRefresh:true,filter:"*",tolerance:"touch"}})})(jQuery);(function(B){function A(E,D){var C=B.browser.safari&&B.browser.version<522;if(E.contains&&!C){return E.contains(D)}if(E.compareDocumentPosition){return !!(E.compareDocumentPosition(D)&16)}while(D=D.parentNode){if(D==E){return true}}return false}B.widget("ui.sortable",B.extend({},B.ui.mouse,{init:function(){var C=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;if(!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.offset=this.element.offset();this.mouseInit()},plugins:{},ui:function(C){return{helper:(C||this)["helper"],placeholder:(C||this)["placeholder"]||B([]),position:(C||this)["position"],absolutePosition:(C||this)["positionAbs"],options:this.options,element:this.element,item:(C||this)["currentItem"],sender:C?C.element:null}},propagate:function(F,E,C,D){B.ui.plugin.call(this,F,[E,this.ui(C)]);if(!D){this.element.triggerHandler(F=="sort"?F:"sort"+F,[E,this.ui(C)],this.options[F])}},serialize:function(E){var C=(B.isFunction(this.options.items)?this.options.items.call(this.element):B(this.options.items,this.element)).not(".ui-sortable-helper");var D=[];E=E||{};C.each(function(){var F=(B(this).attr(E.attribute||"id")||"").match(E.expression||(/(.+)[-=_](.+)/));if(F){D.push((E.key||F[1])+"[]="+(E.key&&E.expression?F[1]:F[2]))}});return D.join("&")},toArray:function(C){var D=(B.isFunction(this.options.items)?this.options.items.call(this.element):B(this.options.items,this.element)).not(".ui-sortable-helper");var E=[];D.each(function(){E.push(B(this).attr(C||"id"))});return E},intersectsWith:function(J){var E=this.positionAbs.left,D=E+this.helperProportions.width,I=this.positionAbs.top,H=I+this.helperProportions.height;var F=J.left,C=F+J.width,K=J.top,G=K+J.height;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?"width":"height"]>J[this.floating?"width":"height"])){return(I+this.offset.click.top>K&&I+this.offset.click.top<G&&E+this.offset.click.left>F&&E+this.offset.click.left<C)}else{return(F<E+(this.helperProportions.width/2)&&D-(this.helperProportions.width/2)<C&&K<I+(this.helperProportions.height/2)&&H-(this.helperProportions.height/2)<G)}},intersectsWithEdge:function(J){var E=this.positionAbs.left,D=E+this.helperProportions.width,I=this.positionAbs.top,H=I+this.helperProportions.height;var F=J.left,C=F+J.width,K=J.top,G=K+J.height;if(this.options.tolerance=="pointer"||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?"width":"height"]>J[this.floating?"width":"height"])){if(!(I+this.offset.click.top>K&&I+this.offset.click.top<G&&E+this.offset.click.left>F&&E+this.offset.click.left<C)){return false}if(this.floating){if(E+this.offset.click.left>F&&E+this.offset.click.left<F+J.width/2){return 2}if(E+this.offset.click.left>F+J.width/2&&E+this.offset.click.left<C){return 1}}else{if(I+this.offset.click.top>K&&I+this.offset.click.top<K+J.height/2){return 2}if(I+this.offset.click.top>K+J.height/2&&I+this.offset.click.top<G){return 1}}}else{if(!(F<E+(this.helperProportions.width/2)&&D-(this.helperProportions.width/2)<C&&K<I+(this.helperProportions.height/2)&&H-(this.helperProportions.height/2)<G)){return false}if(this.floating){if(D>F&&E<F){return 2}if(E<C&&D>C){return 1}}else{if(H>K&&I<K){return 1}if(I<G&&H>G){return 2}}}return false},refresh:function(){this.refreshItems();this.refreshPositions()},refreshItems:function(){this.items=[];this.containers=[this];var D=this.items;var C=this;var F=[[B.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):B(this.options.items,this.element),this]];if(this.options.connectWith){for(var G=this.options.connectWith.length-1;G>=0;G--){var I=B(this.options.connectWith[G]);for(var E=I.length-1;E>=0;E--){var H=B.data(I[E],"sortable");if(H&&!H.options.disabled){F.push([B.isFunction(H.options.items)?H.options.items.call(H.element):B(H.options.items,H.element),H]);this.containers.push(H)}}}}for(var G=F.length-1;G>=0;G--){F[G][0].each(function(){B.data(this,"sortable-item",F[G][1]);D.push({item:B(this),instance:F[G][1],width:0,height:0,left:0,top:0})})}},refreshPositions:function(D){if(this.offsetParent){var C=this.offsetParent.offset();this.offset.parent={top:C.top+this.offsetParentBorders.top,left:C.left+this.offsetParentBorders.left}}for(var F=this.items.length-1;F>=0;F--){if(this.items[F].instance!=this.currentContainer&&this.currentContainer&&this.items[F].item[0]!=this.currentItem[0]){continue}var E=this.options.toleranceElement?B(this.options.toleranceElement,this.items[F].item):this.items[F].item;if(!D){this.items[F].width=E[0].offsetWidth;this.items[F].height=E[0].offsetHeight}var G=E.offset();this.items[F].left=G.left;this.items[F].top=G.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var F=this.containers.length-1;F>=0;F--){var G=this.containers[F].element.offset();this.containers[F].containerCache.left=G.left;this.containers[F].containerCache.top=G.top;this.containers[F].containerCache.width=this.containers[F].element.outerWidth();this.containers[F].containerCache.height=this.containers[F].element.outerHeight()}}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this.mouseDestroy();for(var C=this.items.length-1;C>=0;C--){this.items[C].item.removeData("sortable-item")}},createPlaceholder:function(E){var C=E||this,F=C.options;if(F.placeholder.constructor==String){var D=F.placeholder;F.placeholder={element:function(){return B("<div></div>").addClass(D)[0]},update:function(G,H){H.css(G.offset()).css({width:G.outerWidth(),height:G.outerHeight()})}}}C.placeholder=B(F.placeholder.element.call(C.element,C.currentItem)).appendTo("body").css({position:"absolute"});F.placeholder.update.call(C.element,C.currentItem,C.placeholder)},contactContainers:function(F){for(var D=this.containers.length-1;D>=0;D--){if(this.intersectsWith(this.containers[D].containerCache)){if(!this.containers[D].containerCache.over){if(this.currentContainer!=this.containers[D]){var I=10000;var H=null;var E=this.positionAbs[this.containers[D].floating?"left":"top"];for(var C=this.items.length-1;C>=0;C--){if(!A(this.containers[D].element[0],this.items[C].item[0])){continue}var G=this.items[C][this.containers[D].floating?"left":"top"];if(Math.abs(G-E)<I){I=Math.abs(G-E);H=this.items[C]}}if(!H&&!this.options.dropOnEmpty){continue}if(this.placeholder){this.placeholder.remove()}if(this.containers[D].options.placeholder){this.containers[D].createPlaceholder(this)}else{this.placeholder=null}this.currentContainer=this.containers[D];H?this.rearrange(F,H,null,true):this.rearrange(F,null,this.containers[D].element,true);this.propagate("change",F);this.containers[D].propagate("change",F,this)}this.containers[D].propagate("over",F,this);this.containers[D].containerCache.over=1}}else{if(this.containers[D].containerCache.over){this.containers[D].propagate("out",F,this);this.containers[D].containerCache.over=0}}}},mouseCapture:function(G,F){if(this.options.disabled||this.options.type=="static"){return false}this.refreshItems();var E=null,D=this,C=B(G.target).parents().each(function(){if(B.data(this,"sortable-item")==D){E=B(this);return false}});if(B.data(G.target,"sortable-item")==D){E=B(G.target)}if(!E){return false}if(this.options.handle&&!F){var H=false;B(this.options.handle,E).find("*").andSelf().each(function(){if(this==G.target){H=true}});if(!H){return false}}this.currentItem=E;return true},mouseStart:function(H,F,C){var J=this.options;this.currentContainer=this;this.refreshPositions();this.helper=typeof J.helper=="function"?B(J.helper.apply(this.element[0],[H,this.currentItem])):this.currentItem.clone();if(!this.helper.parents("body").length){B(J.appendTo!="parent"?J.appendTo:this.currentItem[0].parentNode)[0].appendChild(this.helper[0])}this.helper.css({position:"absolute",clear:"both"}).addClass("ui-sortable-helper");this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:H.pageX-this.offset.left,top:H.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var D=this.offsetParent.offset();this.offsetParentBorders={top:(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};this.offset.parent={top:D.top+this.offsetParentBorders.top,left:D.left+this.offsetParentBorders.left};this.originalPosition=this.generatePosition(H);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(J.placeholder){this.createPlaceholder()}this.propagate("start",H);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(J.cursorAt){if(J.cursorAt.left!=undefined){this.offset.click.left=J.cursorAt.left}if(J.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-J.cursorAt.right}if(J.cursorAt.top!=undefined){this.offset.click.top=J.cursorAt.top}if(J.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-J.cursorAt.bottom}}if(J.containment){if(J.containment=="parent"){J.containment=this.helper[0].parentNode}if(J.containment=="document"||J.containment=="window"){this.containment=[0-this.offset.parent.left,0-this.offset.parent.top,B(J.containment=="document"?document:window).width()-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(B(J.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(J.containment)){var G=B(J.containment)[0];var I=B(J.containment).offset();this.containment=[I.left+(parseInt(B(G).css("borderLeftWidth"),10)||0)-this.offset.parent.left,I.top+(parseInt(B(G).css("borderTopWidth"),10)||0)-this.offset.parent.top,I.left+Math.max(G.scrollWidth,G.offsetWidth)-(parseInt(B(G).css("borderLeftWidth"),10)||0)-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.currentItem.css("marginRight"),10)||0),I.top+Math.max(G.scrollHeight,G.offsetHeight)-(parseInt(B(G).css("borderTopWidth"),10)||0)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.currentItem.css("marginBottom"),10)||0)]}}if(this.options.placeholder!="clone"){this.currentItem.css("visibility","hidden")}if(!C){for(var E=this.containers.length-1;E>=0;E--){this.containers[E].propagate("activate",H,this)}}if(B.ui.ddmanager){B.ui.ddmanager.current=this}if(B.ui.ddmanager&&!J.dropBehaviour){B.ui.ddmanager.prepareOffsets(this,H)}this.dragging=true;this.mouseDrag(H);return true},convertPositionTo:function(D,E){if(!E){E=this.position}var C=D=="absolute"?1:-1;return{top:(E.top+this.offset.parent.top*C-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*C+this.margins.top*C),left:(E.left+this.offset.parent.left*C-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*C+this.margins.left*C)}},generatePosition:function(F){var G=this.options;var C={top:(F.pageY-this.offset.click.top-this.offset.parent.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)),left:(F.pageX-this.offset.click.left-this.offset.parent.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition){return C}if(this.containment){if(C.left<this.containment[0]){C.left=this.containment[0]}if(C.top<this.containment[1]){C.top=this.containment[1]}if(C.left>this.containment[2]){C.left=this.containment[2]}if(C.top>this.containment[3]){C.top=this.containment[3]}}if(G.grid){var E=this.originalPosition.top+Math.round((C.top-this.originalPosition.top)/G.grid[1])*G.grid[1];C.top=this.containment?(!(E<this.containment[1]||E>this.containment[3])?E:(!(E<this.containment[1])?E-G.grid[1]:E+G.grid[1])):E;var D=this.originalPosition.left+Math.round((C.left-this.originalPosition.left)/G.grid[0])*G.grid[0];C.left=this.containment?(!(D<this.containment[0]||D>this.containment[2])?D:(!(D<this.containment[0])?D-G.grid[0]:D+G.grid[0])):D}return C},mouseDrag:function(D){this.position=this.generatePosition(D);this.positionAbs=this.convertPositionTo("absolute");B.ui.plugin.call(this,"sort",[D,this.ui()]);this.positionAbs=this.convertPositionTo("absolute");this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";for(var C=this.items.length-1;C>=0;C--){var E=this.intersectsWithEdge(this.items[C]);if(!E){continue}if(this.items[C].item[0]!=this.currentItem[0]&&this.currentItem[E==1?"next":"prev"]()[0]!=this.items[C].item[0]&&!A(this.currentItem[0],this.items[C].item[0])&&(this.options.type=="semi-dynamic"?!A(this.element[0],this.items[C].item[0]):true)){this.direction=E==1?"down":"up";this.rearrange(D,this.items[C]);this.propagate("change",D);break}}this.contactContainers(D);if(B.ui.ddmanager){B.ui.ddmanager.drag(this,D)}this.element.triggerHandler("sort",[D,this.ui()],this.options.sort);return false},rearrange:function(H,G,D,F){D?D[0].appendChild(this.currentItem[0]):G.item[0].parentNode.insertBefore(this.currentItem[0],(this.direction=="down"?G.item[0]:G.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var E=this,C=this.counter;window.setTimeout(function(){if(C==E.counter){E.refreshPositions(!F)}},0);if(this.options.placeholder){this.options.placeholder.update.call(this.element,this.currentItem,this.placeholder)}},mouseStop:function(E,D){if(B.ui.ddmanager&&!this.options.dropBehaviour){B.ui.ddmanager.drop(this,E)}if(this.options.revert){var C=this;var F=C.currentItem.offset();if(C.placeholder){C.placeholder.animate({opacity:"hide"},(parseInt(this.options.revert,10)||500)-50)}B(this.helper).animate({left:F.left-this.offset.parent.left-C.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:F.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(E)})}else{this.clear(E,D)}return false},clear:function(E,D){if(this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0]){this.propagate("update",E,null,D)}if(!A(this.element[0],this.currentItem[0])){this.propagate("remove",E,null,D);for(var C=this.containers.length-1;C>=0;C--){if(A(this.containers[C].element[0],this.currentItem[0])){this.containers[C].propagate("update",E,this,D);this.containers[C].propagate("receive",E,this,D)}}}for(var C=this.containers.length-1;C>=0;C--){this.containers[C].propagate("deactivate",E,this,D);if(this.containers[C].containerCache.over){this.containers[C].propagate("out",E,this);this.containers[C].containerCache.over=0}}this.dragging=false;if(this.cancelHelperRemoval){this.propagate("stop",E,null,D);return false}B(this.currentItem).css("visibility","");if(this.placeholder){this.placeholder.remove()}this.helper.remove();this.helper=null;this.propagate("stop",E,null,D);return true}}));B.extend(B.ui.sortable,{getter:"serialize toArray",defaults:{helper:"clone",tolerance:"guess",distance:1,delay:0,scroll:true,scrollSensitivity:20,scrollSpeed:20,cancel:":input",items:"> *",zIndex:1000,dropOnEmpty:true,appendTo:"parent"}});B.ui.plugin.add("sortable","cursor",{start:function(E,D){var C=B("body");if(C.css("cursor")){D.options._cursor=C.css("cursor")}C.css("cursor",D.options.cursor)},stop:function(D,C){if(C.options._cursor){B("body").css("cursor",C.options._cursor)}}});B.ui.plugin.add("sortable","zIndex",{start:function(E,D){var C=D.helper;if(C.css("zIndex")){D.options._zIndex=C.css("zIndex")}C.css("zIndex",D.options.zIndex)},stop:function(D,C){if(C.options._zIndex){B(C.helper).css("zIndex",C.options._zIndex)}}});B.ui.plugin.add("sortable","opacity",{start:function(E,D){var C=D.helper;if(C.css("opacity")){D.options._opacity=C.css("opacity")}C.css("opacity",D.options.opacity)},stop:function(D,C){if(C.options._opacity){B(C.helper).css("opacity",C.options._opacity)}}});B.ui.plugin.add("sortable","scroll",{start:function(E,D){var F=D.options;var C=B(this).data("sortable");C.overflowY=function(G){do{if(/auto|scroll/.test(G.css("overflow"))||(/auto|scroll/).test(G.css("overflow-y"))){return G}G=G.parent()}while(G[0].parentNode);return B(document)}(C.currentItem);C.overflowX=function(G){do{if(/auto|scroll/.test(G.css("overflow"))||(/auto|scroll/).test(G.css("overflow-x"))){return G}G=G.parent()}while(G[0].parentNode);return B(document)}(C.currentItem);if(C.overflowY[0]!=document&&C.overflowY[0].tagName!="HTML"){C.overflowYOffset=C.overflowY.offset()}if(C.overflowX[0]!=document&&C.overflowX[0].tagName!="HTML"){C.overflowXOffset=C.overflowX.offset()}},sort:function(E,D){var F=D.options;var C=B(this).data("sortable");if(C.overflowY[0]!=document&&C.overflowY[0].tagName!="HTML"){if((C.overflowYOffset.top+C.overflowY[0].offsetHeight)-E.pageY<F.scrollSensitivity){C.overflowY[0].scrollTop=C.overflowY[0].scrollTop+F.scrollSpeed}if(E.pageY-C.overflowYOffset.top<F.scrollSensitivity){C.overflowY[0].scrollTop=C.overflowY[0].scrollTop-F.scrollSpeed}}else{if(E.pageY-B(document).scrollTop()<F.scrollSensitivity){B(document).scrollTop(B(document).scrollTop()-F.scrollSpeed)}if(B(window).height()-(E.pageY-B(document).scrollTop())<F.scrollSensitivity){B(document).scrollTop(B(document).scrollTop()+F.scrollSpeed)}}if(C.overflowX[0]!=document&&C.overflowX[0].tagName!="HTML"){if((C.overflowXOffset.left+C.overflowX[0].offsetWidth)-E.pageX<F.scrollSensitivity){C.overflowX[0].scrollLeft=C.overflowX[0].scrollLeft+F.scrollSpeed}if(E.pageX-C.overflowXOffset.left<F.scrollSensitivity){C.overflowX[0].scrollLeft=C.overflowX[0].scrollLeft-F.scrollSpeed}}else{if(E.pageX-B(document).scrollLeft()<F.scrollSensitivity){B(document).scrollLeft(B(document).scrollLeft()-F.scrollSpeed)}if(B(window).width()-(E.pageX-B(document).scrollLeft())<F.scrollSensitivity){B(document).scrollLeft(B(document).scrollLeft()+F.scrollSpeed)}}}});B.ui.plugin.add("sortable","axis",{sort:function(E,D){var C=B(this).data("sortable");if(D.options.axis=="y"){C.position.left=C.originalPosition.left}if(D.options.axis=="x"){C.position.top=C.originalPosition.top}}})})(jQuery);(function(C){C.effects=C.effects||{};C.extend(C.effects,{save:function(F,G){for(var E=0;E<G.length;E++){if(G[E]!==null){C.data(F[0],"ec.storage."+G[E],F[0].style[G[E]])}}},restore:function(F,G){for(var E=0;E<G.length;E++){if(G[E]!==null){F.css(G[E],C.data(F[0],"ec.storage."+G[E]))}}},setMode:function(E,F){if(F=="toggle"){F=E.is(":hidden")?"show":"hide"}return F},getBaseline:function(F,G){var H,E;switch(F[0]){case"top":H=0;break;case"middle":H=0.5;break;case"bottom":H=1;break;default:H=F[0]/G.height}switch(F[1]){case"left":E=0;break;case"center":E=0.5;break;case"right":E=1;break;default:E=F[1]/G.width}return{x:E,y:H}},createWrapper:function(F){if(F.parent().attr("id")=="fxWrapper"){return F}var E={width:F.outerWidth({margin:true}),height:F.outerHeight({margin:true}),"float":F.css("float")};F.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var I=F.parent();if(F.css("position")=="static"){I.css({position:"relative"});F.css({position:"relative"})}else{var H=F.css("top");if(isNaN(parseInt(H))){H="auto"}var G=F.css("left");if(isNaN(parseInt(G))){G="auto"}I.css({position:F.css("position"),top:H,left:G,zIndex:F.css("z-index")}).show();F.css({position:"relative",top:0,left:0})}I.css(E);return I},removeWrapper:function(E){if(E.parent().attr("id")=="fxWrapper"){return E.parent().replaceWith(E)}return E},setTransition:function(F,G,E,H){H=H||{};C.each(G,function(J,I){unit=F.cssUnit(I);if(unit[0]>0){H[I]=unit[0]*E+unit[1]}});return H},animateClass:function(G,H,J,I){var E=(typeof J=="function"?J:(I?I:null));var F=(typeof J=="object"?J:null);return this.each(function(){var O={};var M=C(this);var N=M.attr("style")||"";if(typeof N=="object"){N=N.cssText}if(G.toggle){M.hasClass(G.toggle)?G.remove=G.toggle:G.add=G.toggle}var K=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.addClass(G.add)}if(G.remove){M.removeClass(G.remove)}var L=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.removeClass(G.add)}if(G.remove){M.addClass(G.remove)}for(var P in L){if(typeof L[P]!="function"&&L[P]&&P.indexOf("Moz")==-1&&P.indexOf("length")==-1&&L[P]!=K[P]&&(P.match(/color/i)||(!P.match(/color/i)&&!isNaN(parseInt(L[P],10))))&&(K.position!="static"||(K.position=="static"&&!P.match(/left|top|bottom|right/)))){O[P]=L[P]}}M.animate(O,H,F,function(){if(typeof C(this).attr("style")=="object"){C(this).attr("style")["cssText"]="";C(this).attr("style")["cssText"]=N}else{C(this).attr("style",N)}if(G.add){C(this).addClass(G.add)}if(G.remove){C(this).removeClass(G.remove)}if(E){E.apply(this,arguments)}})})}});C.fn.extend({_show:C.fn.show,_hide:C.fn.hide,__toggle:C.fn.toggle,_addClass:C.fn.addClass,_removeClass:C.fn.removeClass,_toggleClass:C.fn.toggleClass,effect:function(E,G,F,H){return C.effects[E]?C.effects[E].call(this,{method:E,options:G||{},duration:F,callback:H}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))){return this._show.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="show";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))){return this._hide.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="hide";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="toggle";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},addClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{add:F},E,H,G]):this._addClass(F)},removeClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{remove:F},E,H,G]):this._removeClass(F)},toggleClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{toggle:F},E,H,G]):this._toggleClass(F)},morph:function(E,G,F,I,H){return C.effects.animateClass.apply(this,[{add:G,remove:E},F,I,H])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(E){var F=this.css(E),G=[];C.each(["em","px","%","pt"],function(H,I){if(F.indexOf(I)>0){G=[parseFloat(F),I]}});return G}});jQuery.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(F,E){jQuery.fx.step[E]=function(G){if(G.state==0){G.start=D(G.elem,E);G.end=B(G.end)}G.elem.style[E]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2]),255),0)].join(",")+")"}});function B(F){var E;if(F&&F.constructor==Array&&F.length==3){return F}if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return[parseInt(E[1]),parseInt(E[2]),parseInt(E[3])]}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return[parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55]}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return[parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16)]}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return[parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16)]}if(E=/rgba\(0, 0, 0, 0\)/.exec(F)){return A.transparent}return A[jQuery.trim(F).toLowerCase()]}function D(G,E){var F;do{F=jQuery.curCSS(G,E);if(F!=""&&F!="transparent"||jQuery.nodeName(G,"body")){break}E="backgroundColor"}while(G=G.parentNode);return B(F)}var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(F,G,E,I,H){return jQuery.easing[jQuery.easing.def](F,G,E,I,H)},easeInQuad:function(F,G,E,I,H){return I*(G/=H)*G+E},easeOutQuad:function(F,G,E,I,H){return -I*(G/=H)*(G-2)+E},easeInOutQuad:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G+E}return -I/2*((--G)*(G-2)-1)+E},easeInCubic:function(F,G,E,I,H){return I*(G/=H)*G*G+E},easeOutCubic:function(F,G,E,I,H){return I*((G=G/H-1)*G*G+1)+E},easeInOutCubic:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G+E}return I/2*((G-=2)*G*G+2)+E},easeInQuart:function(F,G,E,I,H){return I*(G/=H)*G*G*G+E},easeOutQuart:function(F,G,E,I,H){return -I*((G=G/H-1)*G*G*G-1)+E},easeInOutQuart:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G+E}return -I/2*((G-=2)*G*G*G-2)+E},easeInQuint:function(F,G,E,I,H){return I*(G/=H)*G*G*G*G+E},easeOutQuint:function(F,G,E,I,H){return I*((G=G/H-1)*G*G*G*G+1)+E},easeInOutQuint:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G*G+E}return I/2*((G-=2)*G*G*G*G+2)+E},easeInSine:function(F,G,E,I,H){return -I*Math.cos(G/H*(Math.PI/2))+I+E},easeOutSine:function(F,G,E,I,H){return I*Math.sin(G/H*(Math.PI/2))+E},easeInOutSine:function(F,G,E,I,H){return -I/2*(Math.cos(Math.PI*G/H)-1)+E},easeInExpo:function(F,G,E,I,H){return(G==0)?E:I*Math.pow(2,10*(G/H-1))+E},easeOutExpo:function(F,G,E,I,H){return(G==H)?E+I:I*(-Math.pow(2,-10*G/H)+1)+E},easeInOutExpo:function(F,G,E,I,H){if(G==0){return E}if(G==H){return E+I}if((G/=H/2)<1){return I/2*Math.pow(2,10*(G-1))+E}return I/2*(-Math.pow(2,-10*--G)+2)+E},easeInCirc:function(F,G,E,I,H){return -I*(Math.sqrt(1-(G/=H)*G)-1)+E},easeOutCirc:function(F,G,E,I,H){return I*Math.sqrt(1-(G=G/H-1)*G)+E},easeInOutCirc:function(F,G,E,I,H){if((G/=H/2)<1){return -I/2*(Math.sqrt(1-G*G)-1)+E}return I/2*(Math.sqrt(1-(G-=2)*G)+1)+E},easeInElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return -(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E},easeOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return G*Math.pow(2,-10*H)*Math.sin((H*K-I)*(2*Math.PI)/J)+L+E},easeInOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K/2)==2){return E+L}if(!J){J=K*(0.3*1.5)}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}if(H<1){return -0.5*(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E}return G*Math.pow(2,-10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J)*0.5+L+E},easeInBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*(G/=I)*G*((H+1)*G-H)+E},easeOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*((G=G/I-1)*G*((H+1)*G+H)+1)+E},easeInOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}if((G/=I/2)<1){return J/2*(G*G*(((H*=(1.525))+1)*G-H))+E}return J/2*((G-=2)*G*(((H*=(1.525))+1)*G+H)+2)+E},easeInBounce:function(F,G,E,I,H){return I-jQuery.easing.easeOutBounce(F,H-G,0,I,H)+E},easeOutBounce:function(F,G,E,I,H){if((G/=H)<(1/2.75)){return I*(7.5625*G*G)+E}else{if(G<(2/2.75)){return I*(7.5625*(G-=(1.5/2.75))*G+0.75)+E}else{if(G<(2.5/2.75)){return I*(7.5625*(G-=(2.25/2.75))*G+0.9375)+E}else{return I*(7.5625*(G-=(2.625/2.75))*G+0.984375)+E}}}},easeInOutBounce:function(F,G,E,I,H){if(G<H/2){return jQuery.easing.easeInBounce(F,G*2,0,I,H)*0.5+E}return jQuery.easing.easeOutBounce(F,G*2-H,0,I,H)*0.5+I*0.5+E}})})(jQuery);(function(A){A.effects.blind=function(B){return this.queue(function(){var D=A(this),C=["position","top","left"];var H=A.effects.setMode(D,B.options.mode||"hide");var G=B.options.direction||"vertical";A.effects.save(D,C);D.show();var J=A.effects.createWrapper(D).css({overflow:"hidden"});var E=(G=="vertical")?"height":"width";var I=(G=="vertical")?J.height():J.width();if(H=="show"){J.css(E,0)}var F={};F[E]=H=="show"?I:0;J.animate(F,B.duration,B.options.easing,function(){if(H=="hide"){D.hide()}A.effects.restore(D,C);A.effects.removeWrapper(D);if(B.callback){B.callback.apply(D[0],arguments)}D.dequeue()})})}})(jQuery);(function(A){A.effects.bounce=function(B){return this.queue(function(){var E=A(this),K=["position","top","left"];var J=A.effects.setMode(E,B.options.mode||"effect");var M=B.options.direction||"up";var C=B.options.distance||20;var D=B.options.times||5;var G=B.duration||250;if(/show|hide/.test(J)){K.push("opacity")}A.effects.save(E,K);E.show();A.effects.createWrapper(E);var F=(M=="up"||M=="down")?"top":"left";var O=(M=="up"||M=="left")?"pos":"neg";var C=B.options.distance||(F=="top"?E.outerHeight({margin:true})/3:E.outerWidth({margin:true})/3);if(J=="show"){E.css("opacity",0).css(F,O=="pos"?-C:C)}if(J=="hide"){C=C/(D*2)}if(J!="hide"){D--}if(J=="show"){var H={opacity:1};H[F]=(O=="pos"?"+=":"-=")+C;E.animate(H,G/2,B.options.easing);C=C/2;D--}for(var I=0;I<D;I++){var N={},L={};N[F]=(O=="pos"?"-=":"+=")+C;L[F]=(O=="pos"?"+=":"-=")+C;E.animate(N,G/2,B.options.easing).animate(L,G/2,B.options.easing);C=(J=="hide")?C*2:C/2}if(J=="hide"){var H={opacity:0};H[F]=(O=="pos"?"-=":"+=")+C;E.animate(H,G/2,B.options.easing,function(){E.hide();A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}})}else{var N={},L={};N[F]=(O=="pos"?"-=":"+=")+C;L[F]=(O=="pos"?"+=":"-=")+C;E.animate(N,G/2,B.options.easing).animate(L,G/2,B.options.easing,function(){A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}})}E.queue("fx",function(){E.dequeue()});E.dequeue()})}})(jQuery);(function(A){A.effects.clip=function(B){return this.queue(function(){var F=A(this),J=["position","top","left","height","width"];var I=A.effects.setMode(F,B.options.mode||"hide");var K=B.options.direction||"vertical";A.effects.save(F,J);F.show();var C=A.effects.createWrapper(F).css({overflow:"hidden"});var E=F[0].tagName=="IMG"?C:F;var G={size:(K=="vertical")?"height":"width",position:(K=="vertical")?"top":"left"};var D=(K=="vertical")?E.height():E.width();if(I=="show"){E.css(G.size,0);E.css(G.position,D/2)}var H={};H[G.size]=I=="show"?D:0;H[G.position]=I=="show"?0:D/2;E.animate(H,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(I=="hide"){F.hide()}A.effects.restore(F,J);A.effects.removeWrapper(F);if(B.callback){B.callback.apply(F[0],arguments)}F.dequeue()}})})}})(jQuery);(function(A){A.effects.drop=function(B){return this.queue(function(){var E=A(this),D=["position","top","left","opacity"];var I=A.effects.setMode(E,B.options.mode||"hide");var H=B.options.direction||"left";A.effects.save(E,D);E.show();A.effects.createWrapper(E);var F=(H=="up"||H=="down")?"top":"left";var C=(H=="up"||H=="left")?"pos":"neg";var J=B.options.distance||(F=="top"?E.outerHeight({margin:true})/2:E.outerWidth({margin:true})/2);if(I=="show"){E.css("opacity",0).css(F,C=="pos"?-J:J)}var G={opacity:I=="show"?1:0};G[F]=(I=="show"?(C=="pos"?"+=":"-="):(C=="pos"?"-=":"+="))+J;E.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(I=="hide"){E.hide()}A.effects.restore(E,D);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}E.dequeue()}})})}})(jQuery);(function(A){A.effects.explode=function(B){return this.queue(function(){var I=B.options.pieces?Math.round(Math.sqrt(B.options.pieces)):3;var E=B.options.pieces?Math.round(Math.sqrt(B.options.pieces)):3;B.options.mode=B.options.mode=="toggle"?(A(this).is(":visible")?"hide":"show"):B.options.mode;var H=A(this).show().css("visibility","hidden");var J=H.offset();J.top-=parseInt(H.css("marginTop"))||0;J.left-=parseInt(H.css("marginLeft"))||0;var G=H.outerWidth(true);var C=H.outerHeight(true);for(var F=0;F<I;F++){for(var D=0;D<E;D++){H.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-D*(G/E),top:-F*(C/I)}).parent().addClass("effects-explode").css({position:"absolute",overflow:"hidden",width:G/E,height:C/I,left:J.left+D*(G/E)+(B.options.mode=="show"?(D-Math.floor(E/2))*(G/E):0),top:J.top+F*(C/I)+(B.options.mode=="show"?(F-Math.floor(I/2))*(C/I):0),opacity:B.options.mode=="show"?0:1}).animate({left:J.left+D*(G/E)+(B.options.mode=="show"?0:(D-Math.floor(E/2))*(G/E)),top:J.top+F*(C/I)+(B.options.mode=="show"?0:(F-Math.floor(I/2))*(C/I)),opacity:B.options.mode=="show"?1:0},B.duration||500)}}setTimeout(function(){B.options.mode=="show"?H.css({visibility:"visible"}):H.css({visibility:"visible"}).hide();if(B.callback){B.callback.apply(H[0])}H.dequeue();A(".effects-explode").remove()},B.duration||500)})}})(jQuery);(function(A){A.effects.fold=function(B){return this.queue(function(){var E=A(this),J=["position","top","left"];var G=A.effects.setMode(E,B.options.mode||"hide");var N=B.options.size||15;var M=!(!B.options.horizFirst);A.effects.save(E,J);E.show();var D=A.effects.createWrapper(E).css({overflow:"hidden"});var H=((G=="show")!=M);var F=H?["width","height"]:["height","width"];var C=H?[D.width(),D.height()]:[D.height(),D.width()];var I=/([0-9]+)%/.exec(N);if(I){N=parseInt(I[1])/100*C[G=="hide"?0:1]}if(G=="show"){D.css(M?{height:0,width:N}:{height:N,width:0})}var L={},K={};L[F[0]]=G=="show"?C[0]:N;K[F[1]]=G=="show"?C[1]:0;D.animate(L,B.duration/2,B.options.easing).animate(K,B.duration/2,B.options.easing,function(){if(G=="hide"){E.hide()}A.effects.restore(E,J);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(E[0],arguments)}E.dequeue()})})}})(jQuery);(function(A){A.effects.highlight=function(B){return this.queue(function(){var E=A(this),D=["backgroundImage","backgroundColor","opacity"];var H=A.effects.setMode(E,B.options.mode||"show");var C=B.options.color||"#ffff99";var G=E.css("backgroundColor");A.effects.save(E,D);E.show();E.css({backgroundImage:"none",backgroundColor:C});var F={backgroundColor:G};if(H=="hide"){F.opacity=0}E.animate(F,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(H=="hide"){E.hide()}A.effects.restore(E,D);if(H=="show"&&jQuery.browser.msie){this.style.removeAttribute("filter")}if(B.callback){B.callback.apply(this,arguments)}E.dequeue()}})})}})(jQuery);(function(A){A.effects.pulsate=function(B){return this.queue(function(){var D=A(this);var F=A.effects.setMode(D,B.options.mode||"show");var E=B.options.times||5;if(F=="hide"){E--}if(D.is(":hidden")){D.css("opacity",0);D.show();D.animate({opacity:1},B.duration/2,B.options.easing);E=E-2}for(var C=0;C<E;C++){D.animate({opacity:0},B.duration/2,B.options.easing).animate({opacity:1},B.duration/2,B.options.easing)}if(F=="hide"){D.animate({opacity:0},B.duration/2,B.options.easing,function(){D.hide();if(B.callback){B.callback.apply(this,arguments)}})}else{D.animate({opacity:0},B.duration/2,B.options.easing).animate({opacity:1},B.duration/2,B.options.easing,function(){if(B.callback){B.callback.apply(this,arguments)}})}D.queue("fx",function(){D.dequeue()});D.dequeue()})}})(jQuery);(function(A){A.effects.puff=function(B){return this.queue(function(){var F=A(this);var C=A.extend(true,{},B.options);var H=A.effects.setMode(F,B.options.mode||"hide");var G=parseInt(B.options.percent)||150;C.fade=true;var E={height:F.height(),width:F.width()};var D=G/100;F.from=(H=="hide")?E:{height:E.height*D,width:E.width*D};C.from=F.from;C.percent=(H=="hide")?G:100;C.mode=H;F.effect("scale",C,B.duration,B.callback);F.dequeue()})};A.effects.scale=function(B){return this.queue(function(){var G=A(this);var D=A.extend(true,{},B.options);var J=A.effects.setMode(G,B.options.mode||"effect");var H=parseInt(B.options.percent)||(parseInt(B.options.percent)==0?0:(J=="hide"?0:100));var I=B.options.direction||"both";var C=B.options.origin;if(J!="effect"){D.origin=C||["middle","center"];D.restore=true}var F={height:G.height(),width:G.width()};G.from=B.options.from||(J=="show"?{height:0,width:0}:F);var E={y:I!="horizontal"?(H/100):1,x:I!="vertical"?(H/100):1};G.to={height:F.height*E.y,width:F.width*E.x};if(B.options.fade){if(J=="show"){G.from.opacity=0;G.to.opacity=1}if(J=="hide"){G.from.opacity=1;G.to.opacity=0}}D.from=G.from;D.to=G.to;D.mode=J;G.effect("size",D,B.duration,B.callback);G.dequeue()})};A.effects.size=function(B){return this.queue(function(){var C=A(this),N=["position","top","left","width","height","overflow","opacity"];var M=["position","top","left","overflow","opacity"];var J=["width","height","overflow"];var P=["fontSize"];var K=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var F=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var G=A.effects.setMode(C,B.options.mode||"effect");var I=B.options.restore||false;var E=B.options.scale||"both";var O=B.options.origin;var D={height:C.height(),width:C.width()};C.from=B.options.from||D;C.to=B.options.to||D;if(O){var H=A.effects.getBaseline(O,D);C.from.top=(D.height-C.from.height)*H.y;C.from.left=(D.width-C.from.width)*H.x;C.to.top=(D.height-C.to.height)*H.y;C.to.left=(D.width-C.to.width)*H.x}var L={from:{y:C.from.height/D.height,x:C.from.width/D.width},to:{y:C.to.height/D.height,x:C.to.width/D.width}};if(E=="box"||E=="both"){if(L.from.y!=L.to.y){N=N.concat(K);C.from=A.effects.setTransition(C,K,L.from.y,C.from);C.to=A.effects.setTransition(C,K,L.to.y,C.to)}if(L.from.x!=L.to.x){N=N.concat(F);C.from=A.effects.setTransition(C,F,L.from.x,C.from);C.to=A.effects.setTransition(C,F,L.to.x,C.to)}}if(E=="content"||E=="both"){if(L.from.y!=L.to.y){N=N.concat(P);C.from=A.effects.setTransition(C,P,L.from.y,C.from);C.to=A.effects.setTransition(C,P,L.to.y,C.to)}}A.effects.save(C,I?N:M);C.show();A.effects.createWrapper(C);C.css("overflow","hidden").css(C.from);if(E=="content"||E=="both"){K=K.concat(["marginTop","marginBottom"]).concat(P);F=F.concat(["marginLeft","marginRight"]);J=N.concat(K).concat(F);C.find("*[width]").each(function(){child=A(this);if(I){A.effects.save(child,J)}var Q={height:child.height(),width:child.width()};child.from={height:Q.height*L.from.y,width:Q.width*L.from.x};child.to={height:Q.height*L.to.y,width:Q.width*L.to.x};if(L.from.y!=L.to.y){child.from=A.effects.setTransition(child,K,L.from.y,child.from);child.to=A.effects.setTransition(child,K,L.to.y,child.to)}if(L.from.x!=L.to.x){child.from=A.effects.setTransition(child,F,L.from.x,child.from);child.to=A.effects.setTransition(child,F,L.to.x,child.to)}child.css(child.from);child.animate(child.to,B.duration,B.options.easing,function(){if(I){A.effects.restore(child,J)}})})}C.animate(C.to,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(G=="hide"){C.hide()}A.effects.restore(C,I?N:M);A.effects.removeWrapper(C);if(B.callback){B.callback.apply(this,arguments)}C.dequeue()}})})}})(jQuery);(function(A){A.effects.shake=function(B){return this.queue(function(){var E=A(this),K=["position","top","left"];var J=A.effects.setMode(E,B.options.mode||"effect");var M=B.options.direction||"left";var C=B.options.distance||20;var D=B.options.times||3;var G=B.duration||B.options.duration||140;A.effects.save(E,K);E.show();A.effects.createWrapper(E);var F=(M=="up"||M=="down")?"top":"left";var O=(M=="up"||M=="left")?"pos":"neg";var H={},N={},L={};H[F]=(O=="pos"?"-=":"+=")+C;N[F]=(O=="pos"?"+=":"-=")+C*2;L[F]=(O=="pos"?"-=":"+=")+C*2;E.animate(H,G,B.options.easing);for(var I=1;I<D;I++){E.animate(N,G,B.options.easing).animate(L,G,B.options.easing)}E.animate(N,G,B.options.easing).animate(H,G/2,B.options.easing,function(){A.effects.restore(E,K);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}});E.queue("fx",function(){E.dequeue()});E.dequeue()})}})(jQuery);(function(A){A.effects.slide=function(B){return this.queue(function(){var E=A(this),D=["position","top","left"];var I=A.effects.setMode(E,B.options.mode||"show");var H=B.options.direction||"left";A.effects.save(E,D);E.show();A.effects.createWrapper(E).css({overflow:"hidden"});var F=(H=="up"||H=="down")?"top":"left";var C=(H=="up"||H=="left")?"pos":"neg";var J=B.options.distance||(F=="top"?E.outerHeight({margin:true}):E.outerWidth({margin:true}));if(I=="show"){E.css(F,C=="pos"?-J:J)}var G={};G[F]=(I=="show"?(C=="pos"?"+=":"-="):(C=="pos"?"-=":"+="))+J;E.animate(G,{queue:false,duration:B.duration,easing:B.options.easing,complete:function(){if(I=="hide"){E.hide()}A.effects.restore(E,D);A.effects.removeWrapper(E);if(B.callback){B.callback.apply(this,arguments)}E.dequeue()}})})}})(jQuery);(function(A){A.effects.transfer=function(B){return this.queue(function(){var E=A(this);var G=A.effects.setMode(E,B.options.mode||"effect");var F=A(B.options.to);var C=E.offset();var D=A('<div class="ui-effects-transfer"></div>').appendTo(document.body);if(B.options.className){D.addClass(B.options.className)}D.addClass(B.options.className);D.css({top:C.top,left:C.left,height:E.outerHeight()-parseInt(D.css("borderTopWidth"))-parseInt(D.css("borderBottomWidth")),width:E.outerWidth()-parseInt(D.css("borderLeftWidth"))-parseInt(D.css("borderRightWidth")),position:"absolute"});C=F.offset();animation={top:C.top,left:C.left,height:F.outerHeight()-parseInt(D.css("borderTopWidth"))-parseInt(D.css("borderBottomWidth")),width:F.outerWidth()-parseInt(D.css("borderLeftWidth"))-parseInt(D.css("borderRightWidth"))};D.animate(animation,B.duration,B.options.easing,function(){D.remove();if(B.callback){B.callback.apply(E[0],arguments)}E.dequeue()})})}})(jQuery);(function(E){E.widget("ui.accordion",{init:function(){var G=this.options;if(G.navigation){var J=this.element.find("a").filter(G.navigationFilter);if(J.length){if(J.filter(G.header).length){G.active=J}else{G.active=J.parent().parent().prev();J.addClass("current")}}}G.headers=this.element.find(G.header);G.active=C(G.headers,G.active);if(E.browser.msie){this.element.find("a").css("zoom","1")}if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");E("<span class='ui-accordion-left'/>").insertBefore(G.headers);E("<span class='ui-accordion-right'/>").appendTo(G.headers);G.headers.addClass("ui-accordion-header").attr("tabindex","0")}var I;if(G.fillSpace){I=this.element.parent().height();G.headers.each(function(){I-=E(this).outerHeight()});var H=0;G.headers.next().each(function(){H=Math.max(H,E(this).innerHeight()-E(this).height())}).height(I-H)}else{if(G.autoHeight){I=0;G.headers.next().each(function(){I=Math.max(I,E(this).outerHeight())}).height(I)}}G.headers.not(G.active||"").next().hide();G.active.parent().andSelf().addClass(G.selectedClass);if(G.event){this.element.bind((G.event)+".accordion",F)}},activate:function(G){F.call(this.element[0],{target:C(this.options.headers,G)[0]})},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","")}E.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion")}});function B(H,G){return function(){return H.apply(G,arguments)}}function D(I){if(!E.data(this,"accordion")){return }var G=E.data(this,"accordion");var H=G.options;H.running=I?0:--H.running;if(H.running){return }if(H.clearStyle){H.toShow.add(H.toHide).css({height:"",overflow:""})}E(this).triggerHandler("accordionchange",[E.event.fix({type:"accordionchange",target:G.element[0]}),H.data],H.change)}function A(G,K,L,J,M){var I=E.data(this,"accordion").options;I.toShow=G;I.toHide=K;I.data=L;var H=B(D,this);I.running=K.size()===0?G.size():K.size();if(I.animated){if(!I.alwaysOpen&&J){E.ui.accordion.animations[I.animated]({toShow:jQuery([]),toHide:K,complete:H,down:M,autoHeight:I.autoHeight})}else{E.ui.accordion.animations[I.animated]({toShow:G,toHide:K,complete:H,down:M,autoHeight:I.autoHeight})}}else{if(!I.alwaysOpen&&J){G.toggle()}else{K.hide();G.show()}H(true)}}function F(L){var J=E.data(this,"accordion").options;if(J.disabled){return false}if(!L.target&&!J.alwaysOpen){J.active.parent().andSelf().toggleClass(J.selectedClass);var I=J.active.next(),M={options:J,newHeader:jQuery([]),oldHeader:J.active,newContent:jQuery([]),oldContent:I},G=(J.active=E([]));A.call(this,G,I,M);return false}var K=E(L.target);K=E(K.parents(J.header)[0]||K);var H=K[0]==J.active[0];if(J.running||(J.alwaysOpen&&H)){return false}if(!K.is(J.header)){return }J.active.parent().andSelf().toggleClass(J.selectedClass);if(!H){K.parent().andSelf().addClass(J.selectedClass)}var G=K.next(),I=J.active.next(),M={options:J,newHeader:K,oldHeader:J.active,newContent:G,oldContent:I},N=J.headers.index(J.active[0])>J.headers.index(K[0]);J.active=H?E([]):K;A.call(this,G,I,M,H,N);return false}function C(H,G){return G!=undefined?typeof G=="number"?H.filter(":eq("+G+")"):H.not(H.not(G)):G===false?E([]):H.filter(":eq(0)")}E.extend(E.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:"slide",event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(G,I){G=E.extend({easing:"swing",duration:300},G,I);if(!G.toHide.size()){G.toShow.animate({height:"show"},G);return }var H=G.toHide.height(),J=G.toShow.height(),K=J/H;G.toShow.css({height:0,overflow:"hidden"}).show();G.toHide.filter(":hidden").each(G.complete).end().filter(":visible").animate({height:"hide"},{step:function(L){var M=(H-L)*K;if(E.browser.msie||E.browser.opera){M=Math.ceil(M)}G.toShow.height(M)},duration:G.duration,easing:G.easing,complete:function(){if(!G.autoHeight){G.toShow.css("height","auto")}G.complete()}})},bounceslide:function(G){this.slide(G,{easing:G.down?"bounceout":"swing",duration:G.down?1000:200})},easeslide:function(G){this.slide(G,{easing:"easeinout",duration:700})}}});E.fn.activate=function(G){return this.accordion("activate",G)}})(jQuery);(function($){var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._promptClass="ui-datepicker-prompt";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",closeText:"Close",closeStatus:"Close without change",prevText:"&#x3c;Prev",prevStatus:"Show the previous month",nextText:"Next&#x3e;",nextStatus:"Show the next month",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"mm/dd/yy",firstDay:0,initStatus:"Select a date",isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",changeFirstDay:true,highlightWeek:false,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:" - ",altField:"",altFormat:""};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" style="display: none;"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+new Date().getTime()}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){return{id:target[0].id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="ui-datepicker-inline"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName)){return }var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){input[isRTL?"before":"after"]('<span class="'+this._appendClass+'">'+appendText+"</span>")}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");var trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](trigger);trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName)){return }input.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst)},_inlineShow:function(inst){var numMonths=this._getNumberOfMonths(inst);inst.dpDiv.width(numMonths[1]*$(".ui-datepicker",inst.dpDiv[0]).width())},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+new Date().getTime();this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var nodeName=target.nodeName.toLowerCase();var $target=$(target);$.removeData(target,PROP_NAME);if(nodeName=="input"){$target.siblings("."+this._appendClass).remove().end().siblings("."+this._triggerClass).remove().end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){target.disabled=false;$(target).siblings("button."+this._triggerClass).each(function(){this.disabled=false}).end().siblings("img."+this._triggerClass).css({opacity:"1.0",cursor:""});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){target.disabled=true;$(target).siblings("button."+this._triggerClass).each(function(){this.disabled=true}).end().siblings("img."+this._triggerClass).css({opacity:"0.5",cursor:"default"});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_changeDatepicker:function(target,name,value){var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst=$.data(target,PROP_NAME)){extendRemove(inst.settings,settings);this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=$.data(target,PROP_NAME);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst)}},_getDateDatepicker:function(target){var inst=$.data(target,PROP_NAME);if(inst){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(e){var inst=$.data(e.target,PROP_NAME);var handled=true;if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:$.datepicker._selectDay(e.target,inst.selectedMonth,inst.selectedYear,$("td.ui-datepicker-days-cell-over",inst.dpDiv)[0]);return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(e.target,(e.ctrlKey?-1:-$.datepicker._get(inst,"stepMonths")),(e.ctrlKey?"Y":"M"));break;case 34:$.datepicker._adjustDate(e.target,(e.ctrlKey?+1:+$.datepicker._get(inst,"stepMonths")),(e.ctrlKey?"Y":"M"));break;case 35:if(e.ctrlKey){$.datepicker._clearDate(e.target)}break;case 36:if(e.ctrlKey){$.datepicker._gotoToday(e.target)}break;case 37:if(e.ctrlKey){$.datepicker._adjustDate(e.target,-1,"D")}break;case 38:if(e.ctrlKey){$.datepicker._adjustDate(e.target,-7,"D")}break;case 39:if(e.ctrlKey){$.datepicker._adjustDate(e.target,+1,"D")}break;case 40:if(e.ctrlKey){$.datepicker._adjustDate(e.target,+7,"D")}break;default:handled=false}}else{if(e.keyCode==36&&e.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){e.preventDefault();e.stopPropagation()}},_doKeyPress:function(e){var inst=$.data(e.target,PROP_NAME);var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return }var inst=$.data(input,PROP_NAME);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);inst.dpDiv.width($.datepicker._getNumberOfMonths(inst)[1]*$(".ui-datepicker",inst.dpDiv[0])[0].offsetWidth);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};inst.dpDiv.empty().append(this._generateDatepicker(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height});var numMonths=this._getNumberOfMonths(inst);inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var pos=inst.input?this._findPos(inst.input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;if(this._get(inst,"isRTL")||(offset.left+inst.dpDiv.width()-scrollX)>browserWidth){offset.left=Math.max((isFixed?0:scrollX),pos[0]+(inst.input?inst.input.width():0)-(isFixed?scrollX:0)-inst.dpDiv.width()-(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0))}else{offset.left-=(isFixed?scrollX:0)}if((offset.top+inst.dpDiv.height()-scrollY)>browserHeight){offset.top=Math.max((isFixed?0:scrollY),pos[1]-(isFixed?scrollY:0)-(this._inDialog?0:inst.dpDiv.height())-(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))}else{offset.top-=(isFixed?scrollY:0)}return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst){return }var rangeSelect=this._get(inst,"rangeSelect");if(rangeSelect&&this._stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}this._stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[this._getDate(inst),inst])}this._datepickerShowing=false;this._lastInput=null;inst.settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker");$("."+this._promptClass,inst.dpDiv).remove()},_checkExternalClick:function(event){if(!$.datepicker._curInst){return }var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=$.data(target[0],PROP_NAME);this._adjustInstDate(inst,offset,period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=$.data(target[0],PROP_NAME);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._adjustDate(target);this._notifyChange(inst)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=$.data(target[0],PROP_NAME);inst._selectingMonthYear=false;inst[period=="M"?"drawMonth":"drawYear"]=select.options[select.selectedIndex].value-0;this._adjustDate(target);this._notifyChange(inst)},_clickMonthYear:function(id){var target=$(id);var inst=$.data(target[0],PROP_NAME);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_changeFirstDay:function(id,day){var target=$(id);var inst=$.data(target[0],PROP_NAME);inst.settings.firstDay=day;this._updateDatepicker(inst)},_selectDay:function(id,month,year,td){if($(td).hasClass(this._unselectableClass)){return }var target=$(id);var inst=$.data(target[0],PROP_NAME);var rangeSelect=this._get(inst,"rangeSelect");if(rangeSelect){this._stayOpen=!this._stayOpen;if(this._stayOpen){$(".ui-datepicker td").removeClass(this._currentClass);$(td).addClass(this._currentClass)}}inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(this._stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}else{if(rangeSelect){inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear}}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(this._stayOpen){inst.rangeStart=new Date(inst.currentYear,inst.currentMonth,inst.currentDay);this._updateDatepicker(inst)}else{if(rangeSelect){inst.selectedDay=inst.currentDay=inst.rangeStart.getDate();inst.selectedMonth=inst.currentMonth=inst.rangeStart.getMonth();inst.selectedYear=inst.currentYear=inst.rangeStart.getFullYear();inst.rangeStart=null;if(inst.inline){this._updateDatepicker(inst)}}}},_clearDate:function(id){var target=$(id);var inst=$.data(target[0],PROP_NAME);if(this._get(inst,"mandatory")){return }this._stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=$.data(target[0],PROP_NAME);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(this._get(inst,"rangeSelect")&&dateStr){dateStr=(inst.rangeStart?this._formatDate(inst,inst.rangeStart):dateStr)+this._get(inst,"rangeSeparator")+dateStr}if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!this._stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof (inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat");var date=this._getDate(inst);dateStr=(isArray(date)?(!date[0]&&!date[1]?"":this.formatDate(altFormat,date[0],this._getFormatConfig(inst))+this._get(inst,"rangeSeparator")+this.formatDate(altFormat,date[1]||date[0],this._getFormatConfig(inst))):this.formatDate(altFormat,date,this._getFormatConfig(inst)));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate(),(date.getTimezoneOffset()/-60));var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){checkDate.setDate(checkDate.getDate()+3);return $.datepicker.iso8601Week(checkDate)}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},dateStatus:function(date,inst){return $.datepicker.formatDate($.datepicker._get(inst,"dateStatus"),date,$.datepicker._getFormatConfig(inst))},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:2));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+(value.charAt(iValue++)-0);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}var date=new Date(year,month-1,day);if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value){return(lookAhead(match)&&value<10?"0":"")+value};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate());break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"m":output+=formatNumber("m",date.getMonth()+1);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val().split(this._get(inst,"rangeSeparator")):null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);if(dates.length>0){var settings=this._getFormatConfig(inst);if(dates.length>1){date=this.parseDate(dateFormat,dates[1],settings)||defaultDate;inst.endDay=date.getDate();inst.endMonth=date.getMonth();inst.endYear=date.getFullYear()}try{date=this.parseDate(dateFormat,dates[0],settings)||defaultDate}catch(e){this.log(e);date=defaultDate}}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates[0]?date.getDate():0);inst.currentMonth=(dates[0]?date.getMonth():0);inst.currentYear=(dates[0]?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setUTCDate(date.getUTCDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=(matches[1]-0);break;case"w":case"W":day+=(matches[1]*7);break;case"m":case"M":month+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};return(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?offsetNumeric(date):date)))},_setDate:function(inst,date,endDate){var clear=!(date);date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(this._get(inst,"rangeSelect")){if(endDate){endDate=this._determineDate(endDate,null);inst.endDay=endDate.getDate();inst.endMonth=endDate.getMonth();inst.endYear=endDate.getFullYear()}else{inst.endDay=inst.currentDay;inst.endMonth=inst.currentMonth;inst.endYear=inst.currentYear}}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst)+(!this._get(inst,"rangeSelect")?"":this._get(inst,"rangeSeparator")+this._formatDate(inst,inst.endDay,inst.endMonth,inst.endYear)))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:new Date(inst.currentYear,inst.currentMonth,inst.currentDay));if(this._get(inst,"rangeSelect")){return[inst.rangeStart||startDate,(!inst.endYear?null:new Date(inst.endYear,inst.endMonth,inst.endDay))]}else{return startDate}},_generateDatepicker:function(inst){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var showStatus=this._get(inst,"showStatus");var isRTL=this._get(inst,"isRTL");var clear=(this._get(inst,"mandatory")?"":'<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(\'#'+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"clearStatus")||"&#xa0;"):"")+">"+this._get(inst,"clearText")+"</a></div>");var controls='<div class="ui-datepicker-control">'+(isRTL?"":clear)+'<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"'+(showStatus?this._addStatus(inst,this._get(inst,"closeStatus")||"&#xa0;"):"")+">"+this._get(inst,"closeText")+"</a></div>"+(isRTL?clear:"")+"</div>";var prompt=this._get(inst,"prompt");var closeAtTop=this._get(inst,"closeAtTop");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var stepMonths=this._get(inst,"stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=(!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth;var drawYear=inst.drawYear;if(maxDate){var maxDraw=new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate());maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(new Date(drawYear,drawMonth,1)>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,new Date(drawYear,drawMonth-stepMonths,1),this._getFormatConfig(inst)));var prev='<div class="ui-datepicker-prev">'+(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', -"+stepMonths+", 'M');\""+(showStatus?this._addStatus(inst,this._get(inst,"prevStatus")||"&#xa0;"):"")+">"+prevText+"</a>":(hideIfNoPrevNext?"":"<label>"+prevText+"</label>"))+"</div>";var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,new Date(drawYear,drawMonth+stepMonths,1),this._getFormatConfig(inst)));var next='<div class="ui-datepicker-next">'+(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?"<a onclick=\"jQuery.datepicker._adjustDate('#"+inst.id+"', +"+stepMonths+", 'M');\""+(showStatus?this._addStatus(inst,this._get(inst,"nextStatus")||"&#xa0;"):"")+">"+nextText+"</a>":(hideIfNoPrevNext?"":"<label>"+nextText+"</label>"))+"</div>";var currentText=this._get(inst,"currentText");currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,today,this._getFormatConfig(inst)));var html=(prompt?'<div class="'+this._promptClass+'">'+prompt+"</div>":"")+(closeAtTop&&!inst.inline?controls:"")+'<div class="ui-datepicker-links">'+(isRTL?next:prev)+(this._isInRange(inst,(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today))?'<div class="ui-datepicker-current"><a onclick="jQuery.datepicker._gotoToday(\'#'+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"currentStatus")||"&#xa0;"):"")+">"+currentText+"</a></div>":"")+(isRTL?prev:next)+"</div>";var firstDay=this._get(inst,"firstDay");var changeFirstDay=this._get(inst,"changeFirstDay");var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var beforeShowDay=this._get(inst,"beforeShowDay");var highlightWeek=this._get(inst,"highlightWeek");var showOtherMonths=this._get(inst,"showOtherMonths");var showWeeks=this._get(inst,"showWeeks");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var status=(showStatus?this._get(inst,"dayStatus")||"&#xa0;":"");var dateStatus=this._get(inst,"statusForDate")||this.dateStatus;var endDate=inst.endDay?new Date(inst.endYear,inst.endMonth,inst.endDay):currentDate;for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,inst.selectedDay);html+='<div class="ui-datepicker-one-month'+(col==0?" ui-datepicker-new-row":"")+'">'+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,showStatus,monthNames)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead><tr class="ui-datepicker-title-row">'+(showWeeks?"<td>"+this._get(inst,"weekHeader")+"</td>":"");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var dayStatus=(status.indexOf("DD")>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+="<td"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end-cell"':"")+">"+(!changeFirstDay?"<span":"<a onclick=\"jQuery.datepicker._changeFirstDay('#"+inst.id+"', "+day+');"')+(showStatus?this._addStatus(inst,dayStatus):"")+' title="'+dayNames[day]+'">'+dayNamesMin[day]+(changeFirstDay?"</a>":"</span>")+"</td>"}html+="</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var printDate=new Date(drawYear,drawMonth,1-leadDays);var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="ui-datepicker-days-row">'+(showWeeks?'<td class="ui-datepicker-week-col">'+calculateWeek(printDate)+"</td>":"");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="ui-datepicker-days-cell'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end-cell":"")+(otherMonth?" ui-datepicker-otherMonth":"")+(printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth?" ui-datepicker-days-cell-over":"")+(unselectable?" "+this._unselectableClass:"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?(highlightWeek?" onmouseover=\"jQuery(this).parent().addClass('ui-datepicker-week-over');\" onmouseout=\"jQuery(this).parent().removeClass('ui-datepicker-week-over');\"":""):" onmouseover=\"jQuery(this).addClass('ui-datepicker-days-cell-over')"+(highlightWeek?".parent().addClass('ui-datepicker-week-over')":"")+";"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+inst.id+"').html('"+(dateStatus.apply((inst.input?inst.input[0]:null),[printDate,inst])||"&#xa0;")+"');")+"\" onmouseout=\"jQuery(this).removeClass('ui-datepicker-days-cell-over')"+(highlightWeek?".parent().removeClass('ui-datepicker-week-over')":"")+";"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+inst.id+"').html('&#xa0;');")+'" onclick="jQuery.datepicker._selectDay(\'#'+inst.id+"',"+drawMonth+","+drawYear+', this);"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?printDate.getDate():"<a>"+printDate.getDate()+"</a>"))+"</td>";printDate.setUTCDate(printDate.getUTCDate()+1)}html+="</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}html+="</tbody></table></div>"}}html+=(showStatus?'<div style="clear: both;"></div><div id="ui-datepicker-status-'+inst.id+'" class="ui-datepicker-status">'+(this._get(inst,"initStatus")||"&#xa0;")+"</div>":"")+(!closeAtTop&&!inst.inline?controls:"")+'<div style="clear: both;"></div>'+($.browser.msie&&parseInt($.browser.version)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>':"");return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,showStatus,monthNames){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var html='<div class="ui-datepicker-header">';if(secondary||!this._get(inst,"changeMonth")){html+=monthNames[drawMonth]+"&#xa0;"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);html+='<select class="ui-datepicker-new-month" onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"monthStatus")||"&#xa0;"):"")+">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNames[month]+"</option>"}}html+="</select>"}if(secondary||!this._get(inst,"changeYear")){html+=drawYear}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=endYear=new Date().getFullYear();year+=parseInt(years[0],10);endYear+=parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-new-year" onchange="jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear('#"+inst.id+"');\""+(showStatus?this._addStatus(inst,this._get(inst,"yearStatus")||"&#xa0;"):"")+">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}html+="</div>";return html},_addStatus:function(inst,text){return" onmouseover=\"jQuery('#ui-datepicker-status-"+inst.id+"').html('"+text+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+inst.id+"').html('&#xa0;');\""},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[new Date(inst.selectedYear,inst.selectedMonth,1),inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(inst.currentYear,inst.currentMonth,inst.currentDay));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$(document).ready(function(){$(document.body).append($.datepicker.dpDiv).mousedown($.datepicker._checkExternalClick)})})(jQuery);(function(B){var A={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};B.widget("ui.dialog",{init:function(){var J=this,K=this.options,D=typeof K.resizable=="string"?K.resizable:"n,e,s,w,se,sw,ne,nw",E=this.element.addClass("ui-dialog-content").wrap("<div/>").wrap("<div/>"),G=(this.uiDialogContainer=E.parent().addClass("ui-dialog-container").css({position:"relative",width:"100%",height:"100%"})),H=K.title||E.attr("title")||"",C=(this.uiDialogTitlebar=B('<div class="ui-dialog-titlebar"/>')).append('<span class="ui-dialog-title">'+H+"</span>").append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(G),I=(this.uiDialog=G.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(K.dialogClass).addClass(E.attr("className")).removeClass("ui-dialog-content").css({position:"absolute",width:K.width,height:K.height,overflow:"hidden",zIndex:K.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(L){if(K.closeOnEscape){var M=27;(L.keyCode&&L.keyCode==M&&J.close())}}).mousedown(function(){J.moveToTop()}),F=(this.uiDialogButtonPane=B("<div/>")).addClass("ui-dialog-buttonpane").css({position:"absolute",bottom:0}).appendTo(I);this.uiDialogTitlebarClose=B(".ui-dialog-titlebar-close",C).hover(function(){B(this).addClass("ui-dialog-titlebar-close-hover")},function(){B(this).removeClass("ui-dialog-titlebar-close-hover")}).mousedown(function(L){L.stopPropagation()}).click(function(){J.close();return false});this.uiDialogTitlebar.find("*").add(this.uiDialogTitlebar).each(function(){B.ui.disableSelection(this)});if(B.fn.draggable){I.draggable({cancel:".ui-dialog-content",helper:K.dragHelper,handle:".ui-dialog-titlebar",start:function(M,L){J.moveToTop();(K.dragStart&&K.dragStart.apply(J.element[0],arguments))},drag:function(M,L){(K.drag&&K.drag.apply(J.element[0],arguments))},stop:function(M,L){(K.dragStop&&K.dragStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize()}});(K.draggable||I.draggable("disable"))}if(B.fn.resizable){I.resizable({cancel:".ui-dialog-content",helper:K.resizeHelper,maxWidth:K.maxWidth,maxHeight:K.maxHeight,minWidth:K.minWidth,minHeight:K.minHeight,start:function(){(K.resizeStart&&K.resizeStart.apply(J.element[0],arguments))},resize:function(M,L){(K.autoResize&&J.size.apply(J));(K.resize&&K.resize.apply(J.element[0],arguments))},handles:D,stop:function(M,L){(K.autoResize&&J.size.apply(J));(K.resizeStop&&K.resizeStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize()}});(K.resizable||I.resizable("disable"))}this.createButtons(K.buttons);this.isOpen=false;(K.bgiframe&&B.fn.bgiframe&&I.bgiframe());(K.autoOpen&&this.open())},setData:function(C,D){(A[C]&&this.uiDialog.data(A[C],D));switch(C){case"buttons":this.createButtons(D);break;case"draggable":this.uiDialog.draggable(D?"enable":"disable");break;case"height":this.uiDialog.height(D);break;case"position":this.position(D);break;case"resizable":(typeof D=="string"&&this.uiDialog.data("handles.resizable",D));this.uiDialog.resizable(D?"enable":"disable");break;case"title":B(".ui-dialog-title",this.uiDialogTitlebar).text(D);break;case"width":this.uiDialog.width(D);break}B.widget.prototype.setData.apply(this,arguments)},position:function(H){var D=B(window),E=B(document),F=E.scrollTop(),C=E.scrollLeft(),G=F;if(B.inArray(H,["center","top","right","bottom","left"])>=0){H=[H=="right"||H=="left"?H:"center",H=="top"||H=="bottom"?H:"middle"]}if(H.constructor!=Array){H=["center","middle"]}if(H[0].constructor==Number){C+=H[0]}else{switch(H[0]){case"left":C+=0;break;case"right":C+=D.width()-this.uiDialog.width();break;default:case"center":C+=(D.width()-this.uiDialog.width())/2}}if(H[1].constructor==Number){F+=H[1]}else{switch(H[1]){case"top":F+=0;break;case"bottom":F+=D.height()-this.uiDialog.height();break;default:case"middle":F+=(D.height()-this.uiDialog.height())/2}}F=Math.max(F,G);this.uiDialog.css({top:F,left:C})},size:function(){var D=this.uiDialogContainer,G=this.uiDialogTitlebar,E=this.element,F=parseInt(E.css("margin-top"),10)+parseInt(E.css("margin-bottom"),10),C=parseInt(E.css("margin-left"),10)+parseInt(E.css("margin-right"),10);E.height(D.height()-G.outerHeight()-F);E.width(D.width()-C)},open:function(){if(this.isOpen){return }this.overlay=this.options.modal?new B.ui.dialog.overlay(this):null;(this.uiDialog.next().length>0)&&this.uiDialog.appendTo("body");this.position(this.options.position);this.uiDialog.show(this.options.show);this.options.autoResize&&this.size();this.moveToTop(true);var C=null;var D={options:this.options};this.uiDialogTitlebarClose.focus();this.element.triggerHandler("dialogopen",[C,D],this.options.open);this.isOpen=true},moveToTop:function(E){if((this.options.modal&&!E)||(!this.options.stack&&!this.options.modal)){return this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus)}var D=this.options.zIndex,C=this.options;B(".ui-dialog:visible").each(function(){D=Math.max(D,parseInt(B(this).css("z-index"),10)||C.zIndex)});(this.overlay&&this.overlay.$el.css("z-index",++D));this.uiDialog.css("z-index",++D);this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus)},close:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide);var D=null;var C={options:this.options};this.element.triggerHandler("dialogclose",[D,C],this.options.close);B.ui.dialog.overlay.resize();this.isOpen=false},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body");this.uiDialog.remove()},createButtons:function(F){var E=this,C=false,D=this.uiDialogButtonPane;D.empty().hide();B.each(F,function(){return !(C=true)});if(C){D.show();B.each(F,function(G,H){B("<button/>").text(G).click(function(){H.apply(E.element[0],arguments)}).appendTo(D)})}}});B.extend(B.ui.dialog,{defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:"center",resizable:true,stack:true,width:300,zIndex:1000},overlay:function(C){this.$el=B.ui.dialog.overlay.create(C)}});B.extend(B.ui.dialog.overlay,{instances:[],events:B.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(C){return C+".dialog-overlay"}).join(" "),create:function(D){if(this.instances.length===0){setTimeout(function(){B("a, :input").bind(B.ui.dialog.overlay.events,function(){var F=false;var H=B(this).parents(".ui-dialog");if(H.length){var E=B(".ui-dialog-overlay");if(E.length){var G=parseInt(E.css("z-index"),10);E.each(function(){G=Math.max(G,parseInt(B(this).css("z-index"),10))});F=parseInt(H.css("z-index"),10)>G}else{F=true}}return F})},1);B(document).bind("keydown.dialog-overlay",function(E){var F=27;(E.keyCode&&E.keyCode==F&&D.close())});B(window).bind("resize.dialog-overlay",B.ui.dialog.overlay.resize)}var C=B("<div/>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({borderWidth:0,margin:0,padding:0,position:"absolute",top:0,left:0,width:this.width(),height:this.height()},D.options.overlay));(D.options.bgiframe&&B.fn.bgiframe&&C.bgiframe());this.instances.push(C);return C},destroy:function(C){this.instances.splice(B.inArray(this.instances,C),1);if(this.instances.length===0){B("a, :input").add([document,window]).unbind(".dialog-overlay")}C.remove()},height:function(){if(B.browser.msie&&B.browser.version<7){var D=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var C=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(D<C){return B(window).height()+"px"}else{return D+"px"}}else{return B(document).height()+"px"}},width:function(){if(B.browser.msie&&B.browser.version<7){var C=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var D=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(C<D){return B(window).width()+"px"}else{return C+"px"}}else{return B(document).width()+"px"}},resize:function(){var C=B([]);B.each(B.ui.dialog.overlay.instances,function(){C=C.add(this)});C.css({width:0,height:0}).css({width:B.ui.dialog.overlay.width(),height:B.ui.dialog.overlay.height()})}});B.extend(B.ui.dialog.overlay.prototype,{destroy:function(){B.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(A){A.fn.unwrap=A.fn.unwrap||function(B){return this.each(function(){A(this).parents(B).eq(0).after(this).remove()})};A.widget("ui.slider",{plugins:{},ui:function(B){return{options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?Math.round(this.value(null,this.options.axis=="vertical"?"y":"x")):{x:Math.round(this.value(null,"x")),y:Math.round(this.value(null,"y"))},range:this.getRange()}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="slide"?C:"slide"+C,[B,this.ui()],this.options[C])},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");if(this.handle&&this.handle.length){this.handle.unwrap("a");this.handle.each(function(){A(this).data("mouse").mouseDestroy()})}this.generated&&this.generated.remove()},setData:function(B,C){A.widget.prototype.setData.apply(this,arguments);if(/min|max|steps/.test(B)){this.initBoundaries()}if(B=="range"){C?this.handle.length==2&&this.createRange():this.removeRange()}},init:function(){var B=this;this.element.addClass("ui-slider");this.initBoundaries();this.handle=A(this.options.handle,this.element);if(!this.handle.length){B.handle=B.generated=A(B.options.handles||[0]).map(function(){var D=A("<div/>").addClass("ui-slider-handle").appendTo(B.element);if(this.id){D.attr("id",this.id)}return D[0]})}var C=function(D){this.element=A(D);this.element.data("mouse",this);this.options=B.options;this.element.bind("mousedown",function(){if(B.currentHandle){this.blur(B.currentHandle)}B.focus(this,1)});this.mouseInit()};A.extend(C.prototype,A.ui.mouse,{mouseStart:function(D){return B.start.call(B,D,this.element[0])},mouseStop:function(D){return B.stop.call(B,D,this.element[0])},mouseDrag:function(D){return B.drag.call(B,D,this.element[0])},mouseCapture:function(){return true},trigger:function(D){this.mouseDown(D)}});A(this.handle).each(function(){new C(this)}).wrap('<a href="javascript:void(0)" style="outline:none;border:none;"></a>').parent().bind("focus",function(D){B.focus(this.firstChild)}).bind("blur",function(D){B.blur(this.firstChild)}).bind("keydown",function(D){if(!B.options.noKeyboard){B.keydown(D.keyCode,this.firstChild)}});this.element.bind("mousedown.slider",function(D){B.click.apply(B,[D]);B.currentHandle.data("mouse").trigger(D);B.firstValue=B.firstValue+1});A.each(this.options.handles||[],function(D,E){B.moveTo(E.start,D,true)});if(!isNaN(this.options.startValue)){this.moveTo(this.options.startValue,0,true)}this.previousHandle=A(this.handle[0]);if(this.handle.length==2&&this.options.range){this.createRange()}},initBoundaries:function(){var B=this.element[0],C=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};A.extend(C,{axis:C.axis||(B.offsetWidth<B.offsetHeight?"vertical":"horizontal"),max:!isNaN(parseInt(C.max,10))?{x:parseInt(C.max,10),y:parseInt(C.max,10)}:({x:C.max&&C.max.x||100,y:C.max&&C.max.y||100}),min:!isNaN(parseInt(C.min,10))?{x:parseInt(C.min,10),y:parseInt(C.min,10)}:({x:C.min&&C.min.x||0,y:C.min&&C.min.y||0})});C.realMax={x:C.max.x-C.min.x,y:C.max.y-C.min.y};C.stepping={x:C.stepping&&C.stepping.x||parseInt(C.stepping,10)||(C.steps?C.realMax.x/(C.steps.x||parseInt(C.steps,10)||C.realMax.x):0),y:C.stepping&&C.stepping.y||parseInt(C.stepping,10)||(C.steps?C.realMax.y/(C.steps.y||parseInt(C.steps,10)||C.realMax.y):0)}},keydown:function(C,B){if(/(37|38|39|40)/.test(C)){this.moveTo({x:/(37|39)/.test(C)?(C==37?"-":"+")+"="+this.oneStep("x"):0,y:/(38|40)/.test(C)?(C==38?"-":"+")+"="+this.oneStep("y"):0},B)}},focus:function(B,C){this.currentHandle=A(B).addClass("ui-slider-handle-active");if(C){this.currentHandle.parent()[0].focus()}},blur:function(B){A(B).removeClass("ui-slider-handle-active");if(this.currentHandle&&this.currentHandle[0]==B){this.previousHandle=this.currentHandle;this.currentHandle=null}},click:function(C){var D=[C.pageX,C.pageY];var B=false;this.handle.each(function(){if(this==C.target){B=true}});if(B||this.options.disabled||!(this.currentHandle||this.previousHandle)){return }if(!this.currentHandle&&this.previousHandle){this.focus(this.previousHandle,true)}this.offset=this.element.offset();this.moveTo({y:this.convertValue(C.pageY-this.offset.top-this.currentHandle[0].offsetHeight/2,"y"),x:this.convertValue(C.pageX-this.offset.left-this.currentHandle[0].offsetWidth/2,"x")},null,!this.options.distance)},createRange:function(){if(this.rangeElement){return }this.rangeElement=A("<div></div>").addClass("ui-slider-range").css({position:"absolute"}).appendTo(this.element);this.updateRange()},removeRange:function(){this.rangeElement.remove();this.rangeElement=null},updateRange:function(){var C=this.options.axis=="vertical"?"top":"left";var B=this.options.axis=="vertical"?"height":"width";this.rangeElement.css(C,(parseInt(A(this.handle[0]).css(C),10)||0)+this.handleSize(0,this.options.axis=="vertical"?"y":"x")/2);this.rangeElement.css(B,(parseInt(A(this.handle[1]).css(C),10)||0)-(parseInt(A(this.handle[0]).css(C),10)||0))},getRange:function(){return this.rangeElement?this.convertValue(parseInt(this.rangeElement.css(this.options.axis=="vertical"?"height":"width"),10),this.options.axis=="vertical"?"y":"x"):null},handleIndex:function(){return this.handle.index(this.currentHandle[0])},value:function(D,B){if(this.handle.length==1){this.currentHandle=this.handle}if(!B){B=this.options.axis=="vertical"?"y":"x"}var C=A(D!=undefined&&D!==null?this.handle[D]||D:this.currentHandle);if(C.data("mouse").sliderValue){return parseInt(C.data("mouse").sliderValue[B],10)}else{return parseInt(((parseInt(C.css(B=="x"?"left":"top"),10)/(this.actualSize[B=="x"?"width":"height"]-this.handleSize(D,B)))*this.options.realMax[B])+this.options.min[B],10)}},convertValue:function(C,B){return this.options.min[B]+(C/(this.actualSize[B=="x"?"width":"height"]-this.handleSize(null,B)))*this.options.realMax[B]},translateValue:function(C,B){return((C-this.options.min[B])/this.options.realMax[B])*(this.actualSize[B=="x"?"width":"height"]-this.handleSize(null,B))},translateRange:function(D,B){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&D>=this.translateValue(this.value(1),B)){D=this.translateValue(this.value(1,B)-this.oneStep(B),B)}if(this.currentHandle[0]==this.handle[1]&&D<=this.translateValue(this.value(0),B)){D=this.translateValue(this.value(0,B)+this.oneStep(B),B)}}if(this.options.handles){var C=this.options.handles[this.handleIndex()];if(D<this.translateValue(C.min,B)){D=this.translateValue(C.min,B)}else{if(D>this.translateValue(C.max,B)){D=this.translateValue(C.max,B)}}}return D},translateLimits:function(C,B){if(C>=this.actualSize[B=="x"?"width":"height"]-this.handleSize(null,B)){C=this.actualSize[B=="x"?"width":"height"]-this.handleSize(null,B)}if(C<=0){C=0}return C},handleSize:function(C,B){return A(C!=undefined&&C!==null?this.handle[C]:this.currentHandle)[0]["offset"+(B=="x"?"Width":"Height")]},oneStep:function(B){return this.options.stepping[B]||1},start:function(C,B){var D=this.options;if(D.disabled){return false}this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(!this.currentHandle){this.focus(this.previousHandle,true)}this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:C.pageY-this.handleOffset.top,left:C.pageX-this.handleOffset.left};this.firstValue=this.value();this.propagate("start",C);this.drag(C,B);return true},stop:function(B){this.propagate("stop",B);if(this.firstValue!=this.value()){this.propagate("change",B)}this.focus(this.currentHandle,true);return false},drag:function(E,D){var F=this.options;var B={top:E.pageY-this.offset.top-this.clickOffset.top,left:E.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle){this.focus(this.previousHandle,true)}B.left=this.translateLimits(B.left,"x");B.top=this.translateLimits(B.top,"y");if(F.stepping.x){var C=this.convertValue(B.left,"x");C=Math.round(C/F.stepping.x)*F.stepping.x;B.left=this.translateValue(C,"x")}if(F.stepping.y){var C=this.convertValue(B.top,"y");C=Math.round(C/F.stepping.y)*F.stepping.y;B.top=this.translateValue(C,"y")}B.left=this.translateRange(B.left,"x");B.top=this.translateRange(B.top,"y");if(F.axis!="vertical"){this.currentHandle.css({left:B.left})}if(F.axis!="horizontal"){this.currentHandle.css({top:B.top})}this.currentHandle.data("mouse").sliderValue={x:Math.round(this.convertValue(B.left,"x"))||0,y:Math.round(this.convertValue(B.top,"y"))||0};if(this.rangeElement){this.updateRange()}this.propagate("slide",E);return false},moveTo:function(F,E,G){var H=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(E==undefined&&!this.currentHandle&&this.handle.length!=1){return false}if(E==undefined&&!this.currentHandle){E=0}if(E!=undefined){this.currentHandle=this.previousHandle=A(this.handle[E]||E)}if(F.x!==undefined&&F.y!==undefined){var B=F.x,I=F.y}else{var B=F,I=F}if(B!==undefined&&B.constructor!=Number){var D=/^\-\=/.test(B),C=/^\+\=/.test(B);if(D||C){B=this.value(null,"x")+parseInt(B.replace(D?"=":"+=",""),10)}else{B=isNaN(parseInt(B,10))?undefined:parseInt(B,10)}}if(I!==undefined&&I.constructor!=Number){var D=/^\-\=/.test(I),C=/^\+\=/.test(I);if(D||C){I=this.value(null,"y")+parseInt(I.replace(D?"=":"+=",""),10)}else{I=isNaN(parseInt(I,10))?undefined:parseInt(I,10)}}if(H.axis!="vertical"&&B!==undefined){if(H.stepping.x){B=Math.round(B/H.stepping.x)*H.stepping.x}B=this.translateValue(B,"x");B=this.translateLimits(B,"x");B=this.translateRange(B,"x");H.animate?this.currentHandle.stop().animate({left:B},(Math.abs(parseInt(this.currentHandle.css("left"))-B))*(!isNaN(parseInt(H.animate))?H.animate:5)):this.currentHandle.css({left:B})}if(H.axis!="horizontal"&&I!==undefined){if(H.stepping.y){I=Math.round(I/H.stepping.y)*H.stepping.y}I=this.translateValue(I,"y");I=this.translateLimits(I,"y");I=this.translateRange(I,"y");H.animate?this.currentHandle.stop().animate({top:I},(Math.abs(parseInt(this.currentHandle.css("top"))-I))*(!isNaN(parseInt(H.animate))?H.animate:5)):this.currentHandle.css({top:I})}if(this.rangeElement){this.updateRange()}this.currentHandle.data("mouse").sliderValue={x:Math.round(this.convertValue(B,"x"))||0,y:Math.round(this.convertValue(I,"y"))||0};if(!G){this.propagate("start",null);this.propagate("stop",null);this.propagate("change",null);this.propagate("slide",null)}}});A.ui.slider.getter="value";A.ui.slider.defaults={handle:".ui-slider-handle",distance:1,animate:false}})(jQuery);(function(A){A.widget("ui.tabs",{init:function(){this.options.event+=".tabs";this.tabify(true)},setData:function(B,C){if((/^selected/).test(B)){this.select(C)}else{this.options[B]=C;this.tabify()}},length:function(){return this.$tabs.length},tabId:function(B){return B.title&&B.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+A.data(B)},ui:function(C,B){return{options:this.options,tab:C,panel:B,index:this.$tabs.index(C)}},tabify:function(O){this.$lis=A("li:has(a[href])",this.element);this.$tabs=this.$lis.map(function(){return A("a",this)[0]});this.$panels=A([]);var P=this,D=this.options;this.$tabs.each(function(R,Q){if(Q.hash&&Q.hash.replace("#","")){P.$panels=P.$panels.add(Q.hash)}else{if(A(Q).attr("href")!="#"){A.data(Q,"href.tabs",Q.href);A.data(Q,"load.tabs",Q.href);var T=P.tabId(Q);Q.href="#"+T;var S=A("#"+T);if(!S.length){S=A(D.panelTemplate).attr("id",T).addClass(D.panelClass).insertAfter(P.$panels[R-1]||P.element);S.data("destroy.tabs",true)}P.$panels=P.$panels.add(S)}else{D.disabled.push(R+1)}}});if(O){this.element.addClass(D.navClass);this.$panels.each(function(){var Q=A(this);Q.addClass(D.panelClass)});if(D.selected===undefined){if(location.hash){this.$tabs.each(function(S,Q){if(Q.hash==location.hash){D.selected=S;if(A.browser.msie||A.browser.opera){var R=A(location.hash),T=R.attr("id");R.attr("id","");setTimeout(function(){R.attr("id",T)},500)}scrollTo(0,0);return false}})}else{if(D.cookie){var J=parseInt(A.cookie("ui-tabs"+A.data(P.element)),10);if(J&&P.$tabs[J]){D.selected=J}}else{if(P.$lis.filter("."+D.selectedClass).length){D.selected=P.$lis.index(P.$lis.filter("."+D.selectedClass)[0])}}}}D.selected=D.selected===null||D.selected!==undefined?D.selected:0;D.disabled=A.unique(D.disabled.concat(A.map(this.$lis.filter("."+D.disabledClass),function(R,Q){return P.$lis.index(R)}))).sort();if(A.inArray(D.selected,D.disabled)!=-1){D.disabled.splice(A.inArray(D.selected,D.disabled),1)}this.$panels.addClass(D.hideClass);this.$lis.removeClass(D.selectedClass);if(D.selected!==null){this.$panels.eq(D.selected).show().removeClass(D.hideClass);this.$lis.eq(D.selected).addClass(D.selectedClass);var K=function(){A(P.element).triggerHandler("tabsshow",[P.fakeEvent("tabsshow"),P.ui(P.$tabs[D.selected],P.$panels[D.selected])],D.show)};if(A.data(this.$tabs[D.selected],"load.tabs")){this.load(D.selected,K)}else{K()}}A(window).bind("unload",function(){P.$tabs.unbind(".tabs");P.$lis=P.$tabs=P.$panels=null})}for(var G=0,N;N=this.$lis[G];G++){A(N)[A.inArray(G,D.disabled)!=-1&&!A(N).hasClass(D.selectedClass)?"addClass":"removeClass"](D.disabledClass)}if(D.cache===false){this.$tabs.removeData("cache.tabs")}var C,I,B={"min-width":0,duration:1},E="normal";if(D.fx&&D.fx.constructor==Array){C=D.fx[0]||B,I=D.fx[1]||B}else{C=I=D.fx||B}var H={display:"",overflow:"",height:""};if(!A.browser.msie){H.opacity=""}function M(R,Q,S){Q.animate(C,C.duration||E,function(){Q.addClass(D.hideClass).css(H);if(A.browser.msie&&C.opacity){Q[0].style.filter=""}if(S){L(R,S,Q)}})}function L(R,S,Q){if(I===B){S.css("display","block")}S.animate(I,I.duration||E,function(){S.removeClass(D.hideClass).css(H);if(A.browser.msie&&I.opacity){S[0].style.filter=""}A(P.element).triggerHandler("tabsshow",[P.fakeEvent("tabsshow"),P.ui(R,S[0])],D.show)})}function F(R,T,Q,S){T.addClass(D.selectedClass).siblings().removeClass(D.selectedClass);M(R,Q,S)}this.$tabs.unbind(".tabs").bind(D.event,function(){var T=A(this).parents("li:eq(0)"),Q=P.$panels.filter(":visible"),S=A(this.hash);if((T.hasClass(D.selectedClass)&&!D.unselect)||T.hasClass(D.disabledClass)||A(this).hasClass(D.loadingClass)||A(P.element).triggerHandler("tabsselect",[P.fakeEvent("tabsselect"),P.ui(this,S[0])],D.select)===false){this.blur();return false}P.options.selected=P.$tabs.index(this);if(D.unselect){if(T.hasClass(D.selectedClass)){P.options.selected=null;T.removeClass(D.selectedClass);P.$panels.stop();M(this,Q);this.blur();return false}else{if(!Q.length){P.$panels.stop();var R=this;P.load(P.$tabs.index(this),function(){T.addClass(D.selectedClass).addClass(D.unselectClass);L(R,S)});this.blur();return false}}}if(D.cookie){A.cookie("ui-tabs"+A.data(P.element),P.options.selected,D.cookie)}P.$panels.stop();if(S.length){var R=this;P.load(P.$tabs.index(this),Q.length?function(){F(R,T,Q,S)}:function(){T.addClass(D.selectedClass);L(R,S)})}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(A.browser.msie){this.blur()}return false});if(!(/^click/).test(D.event)){this.$tabs.bind("click.tabs",function(){return false})}},add:function(E,D,C){if(C==undefined){C=this.$tabs.length}var G=this.options;var I=A(G.tabTemplate.replace(/#\{href\}/g,E).replace(/#\{label\}/g,D));I.data("destroy.tabs",true);var H=E.indexOf("#")==0?E.replace("#",""):this.tabId(A("a:first-child",I)[0]);var F=A("#"+H);if(!F.length){F=A(G.panelTemplate).attr("id",H).addClass(G.hideClass).data("destroy.tabs",true)}F.addClass(G.panelClass);if(C>=this.$lis.length){I.appendTo(this.element);F.appendTo(this.element[0].parentNode)}else{I.insertBefore(this.$lis[C]);F.insertBefore(this.$panels[C])}G.disabled=A.map(G.disabled,function(K,J){return K>=C?++K:K});this.tabify();if(this.$tabs.length==1){I.addClass(G.selectedClass);F.removeClass(G.hideClass);var B=A.data(this.$tabs[0],"load.tabs");if(B){this.load(C,B)}}this.element.triggerHandler("tabsadd",[this.fakeEvent("tabsadd"),this.ui(this.$tabs[C],this.$panels[C])],G.add)},remove:function(B){var D=this.options,E=this.$lis.eq(B).remove(),C=this.$panels.eq(B).remove();if(E.hasClass(D.selectedClass)&&this.$tabs.length>1){this.select(B+(B+1<this.$tabs.length?1:-1))}D.disabled=A.map(A.grep(D.disabled,function(G,F){return G!=B}),function(G,F){return G>=B?--G:G});this.tabify();this.element.triggerHandler("tabsremove",[this.fakeEvent("tabsremove"),this.ui(E.find("a")[0],C[0])],D.remove)},enable:function(B){var C=this.options;if(A.inArray(B,C.disabled)==-1){return }var D=this.$lis.eq(B).removeClass(C.disabledClass);if(A.browser.safari){D.css("display","inline-block");setTimeout(function(){D.css("display","block")},0)}C.disabled=A.grep(C.disabled,function(F,E){return F!=B});this.element.triggerHandler("tabsenable",[this.fakeEvent("tabsenable"),this.ui(this.$tabs[B],this.$panels[B])],C.enable)},disable:function(C){var B=this,D=this.options;if(C!=D.selected){this.$lis.eq(C).addClass(D.disabledClass);D.disabled.push(C);D.disabled.sort();this.element.triggerHandler("tabsdisable",[this.fakeEvent("tabsdisable"),this.ui(this.$tabs[C],this.$panels[C])],D.disable)}},select:function(B){if(typeof B=="string"){B=this.$tabs.index(this.$tabs.filter("[href$="+B+"]")[0])}this.$tabs.eq(B).trigger(this.options.event)},load:function(G,K){var L=this,D=this.options,E=this.$tabs.eq(G),J=E[0],H=K==undefined||K===false,B=E.data("load.tabs");K=K||function(){};if(!B||!H&&A.data(J,"cache.tabs")){K();return }var M=function(N){var O=A(N),P=O.find("*:last");return P.length&&P.is(":not(img)")&&P||O};var C=function(){L.$tabs.filter("."+D.loadingClass).removeClass(D.loadingClass).each(function(){if(D.spinner){M(this).parent().html(M(this).data("label.tabs"))}});L.xhr=null};if(D.spinner){var I=M(J).html();M(J).wrapInner("<em></em>").find("em").data("label.tabs",I).html(D.spinner)}var F=A.extend({},D.ajaxOptions,{url:B,success:function(O,N){A(J.hash).html(O);C();if(D.cache){A.data(J,"cache.tabs",true)}A(L.element).triggerHandler("tabsload",[L.fakeEvent("tabsload"),L.ui(L.$tabs[G],L.$panels[G])],D.load);D.ajaxOptions.success&&D.ajaxOptions.success(O,N);K()}});if(this.xhr){this.xhr.abort();C()}E.addClass(D.loadingClass);setTimeout(function(){L.xhr=A.ajax(F)},0)},url:function(C,B){this.$tabs.eq(C).removeData("cache.tabs").data("load.tabs",B)},destroy:function(){var B=this.options;this.element.unbind(".tabs").removeClass(B.navClass).removeData("tabs");this.$tabs.each(function(){var C=A.data(this,"href.tabs");if(C){this.href=C}var D=A(this).unbind(".tabs");A.each(["href","load","cache"],function(E,F){D.removeData(F+".tabs")})});this.$lis.add(this.$panels).each(function(){if(A.data(this,"destroy.tabs")){A(this).remove()}else{A(this).removeClass([B.selectedClass,B.unselectClass,B.disabledClass,B.panelClass,B.hideClass].join(" "))}})},fakeEvent:function(B){return A.event.fix({type:B,target:this.element[0]})}});A.ui.tabs.defaults={unselect:false,event:"click",disabled:[],cookie:null,spinner:"Loading&#8230;",cache:false,idPrefix:"ui-tabs-",ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:"<div></div>",navClass:"ui-tabs-nav",selectedClass:"ui-tabs-selected",unselectClass:"ui-tabs-unselect",disabledClass:"ui-tabs-disabled",panelClass:"ui-tabs-panel",hideClass:"ui-tabs-hide",loadingClass:"ui-tabs-loading"};A.ui.tabs.getter="length";A.extend(A.ui.tabs.prototype,{rotation:null,rotate:function(C,F){F=F||false;var B=this,E=this.options.selected;function G(){B.rotation=setInterval(function(){E=++E<B.$tabs.length?E:0;B.select(E)},C)}function D(H){if(!H||H.clientX){clearInterval(B.rotation)}}if(C){G();if(!F){this.$tabs.bind(this.options.event,D)}else{this.$tabs.bind(this.options.event,function(){D();E=B.options.selected;G()})}}else{D();this.$tabs.unbind(this.options.event,D)}}})})(jQuery);(function(A){A().ajaxSend(function(B,D,C){D.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*")})})(jQuery);(function(A){A.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};A.fn.enable=function(){return this.each(function(){this.disabled=false})};A.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function(A){A.extend({fieldEvent:function(B,E){var D=B[0]||B,C="change";if(D.type=="radio"||D.type=="checkbox"){C="click"}else{if(E&&D.type=="text"||D.type=="textarea"){C="keyup"}}return C}});A.fn.extend({delayedObserver:function(B,E){var C=A(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(F){observed=window.delayedObserverStack[F];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:C,timer:null,delay:B,oldVal:C.formVal(),callback:E});var D=window.delayedObserverStack.length-1;if(C[0].tagName=="FORM"){A(":input",C).each(function(){var F=A(this);F.bind(A.fieldEvent(F,B),function(){observed=window.delayedObserverStack[D];if(observed.obj.formVal()==observed.obj.oldVal){return }else{window.delayedObserverCallback(D)}})})}else{C.bind(A.fieldEvent(C,B),function(){observed=window.delayedObserverStack[D];if(observed.obj.formVal()==observed.obj.oldVal){return }else{window.delayedObserverCallback(D)}})}},formVal:function(){var B=this[0];if(B.tagName=="FORM"){return this.serialize()}if(B.type=="checkbox"||self.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o){e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"()")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);(function(){jQuery.fn.clockpick=function(options,callback){var settings={starthour:8,endhour:18,showminutes:true,minutedivisions:4,military:false,event:"click",layout:"vertical",valuefield:null,useBgiframe:false};if(options){jQuery.extend(settings,options)}var callback=callback||function(){},v=(settings.layout=="vertical");errorcheck();jQuery(this)[settings.event](function(e){var self=this;if(!settings.valuefield){jQuery(this).bind("keydown",keyhandler)}jQuery("#CP_hourcont").remove();jQuery("#CP_minutecont").remove();$hourcont=jQuery("<div id='CP_hourcont' class='CP' />");jQuery("body").append($hourcont);binder($hourcont);$hourcol1=jQuery("<div class='CP_hourcol' id='hourcol1' />");jQuery("body").append($hourcol1);$hourcol2=jQuery("<div class='CP_hourcol' id='hourcol2' />");jQuery("body").append($hourcol2);if(settings.showminutes){$mc=jQuery("<div id='CP_minutecont' class='CP' />");jQuery("body").append($mc);binder($mc)}if(!v){$hourcont.css("width","auto");$mc.css("width","auto")}else{$hourcol1.addClass("floatleft");$hourcol2.addClass("floatleft")}renderhours();putcontainer();function renderhours(){var c=1;for(h=settings.starthour;h<=settings.endhour;h++){if(h==12){c=1}displayhours=((!settings.military&&h>12)?h-12:h)+set_tt(h);if(!settings.military&&h==0){displayhours="12"+set_tt(h)}$hd=jQuery("<div class='CP_hour' id='hr_"+h+"_"+c+"'>"+displayhours+"</div>");if(settings.military){$hd.width(20)}binder($hd);if(!v){$hd.css("float","left")}(h<12)?$hourcol1.append($hd):$hourcol2.append($hd);c++}$hourcont.append($hourcol1);!v?$hourcont.append("<div style='clear:left' />"):"";$hourcont.append($hourcol2)}function renderminutes(h){realhours=h;displayhours=(!settings.military&&h>12)?h-12:h;if(!settings.military&&h==0){displayhours="12"}$mc.empty();var n=60/settings.minutedivisions,tt=set_tt(realhours),counter=1;for(m=0;m<60;m=m+n){$md=jQuery("<div class='CP_minute' id='"+realhours+"_"+m+"'>"+displayhours+":"+((m<10)?"0":"")+m+tt+"</div>");if(!v){$md.css("float","left");if(settings.minutedivisions>6&&counter==settings.minutedivisions/2+1){$mc.append("<div style='clear:left' />")}}$mc.append($md);binder($md);counter++}}function set_tt(realhours){if(!settings.military){return(realhours>=12)?" PM":" AM"}else{return""}}function putcontainer(){if(!jQuery.browser.safari){$hourcont.css("left",e.pageX-5).css("top",e.pageY-(Math.floor($hourcont.height()/2)));rectify($hourcont)}else{jQuery(self).after($hourcont)}$hourcont.show();if(settings.useBgiframe){bgi($hourcont)}}function rectify($obj){var ph=document.documentElement.clientHeight;var pw=document.documentElement.clientWidth;if(!jQuery.browser.safari){var t=parseInt($obj.css("top"));var l=parseInt($obj.css("left"))}else{var t=$obj[0].offsetTop;var l=$obj[0].offsetLeft}var st=document.documentElement.scrollTop;if(t<=st&&!$obj.is("#CP_minutecont")){$obj.css("top",st+10+"px")}else{if(t+$obj.height()-st>ph){$obj.css("top",st+ph-$obj.height()-10)}}}function bgi(ob){if(typeof jQuery.fn.bgIframe=="function"){ob.bgIframe()}else{alert("bgIframe plugin not loaded.")}}function binder($obj){if($obj.attr("id")=="CP_hourcont"){$obj.mouseout(function(e){hourcont_out(e)})}else{if($obj.attr("id")=="CP_minutecont"){$obj.mouseout(function(e){minutecont_out(e)})}else{if($obj.attr("class")=="CP_hour"){$obj.mouseover(function(e){hourdiv_over($obj,e)});$obj.mouseout(function(){hourdiv_out($obj)});$obj.click(function(){hourdiv_click($obj)})}else{if($obj.attr("class")=="CP_minute"){$obj.mouseover(function(){minutediv_over($obj)});$obj.mouseout(function(){minutediv_out($obj)});$obj.click(function(){minutediv_click($obj)})}}}}}function hourcont_out(e){try{t=(e.toElement)?e.toElement:e.relatedTarget;if(!(jQuery(t).is("div[@class^=CP], iframe"))){if(!jQuery.browser.safari){cleardivs()}}}catch(e){cleardivs()}}function minutecont_out(e){try{t=(e.toElement)?e.toElement:e.relatedTarget;if(!(jQuery(t).is("div[@class^=CP], iframe"))){if(!jQuery.browser.safari){cleardivs()}}}catch(e){cleardivs()}}function hourdiv_over($obj,e){var h=$obj.attr("id").split("_")[1],i=$obj.attr("id").split("_")[2];$obj.addClass("CP_over");if(settings.showminutes){$mc.hide();renderminutes(h);if(v){t=(e.type=="mouseover")?e.pageY-10:parseInt($hourcont.css("top"))+2+($obj.height()*i);if(h<12){if(!jQuery.browser.safari){l=parseInt($hourcont.css("left"))-$mc.width()}else{l=$hourcont[0].offsetLeft-$mc.width()}}else{if(!jQuery.browser.safari){l=parseInt($hourcont.css("left"))+$hourcont.width()}else{l=$hourcont[0].offsetLeft+$hourcont.width()}}}else{l=(e.type=="mouseover")?e.pageX-10:parseInt($hourcont.css("left"))+($obj.width()-5)*i;if(h<12){if(!jQuery.browser.safari){t=parseInt($hourcont.css("top"))-$mc.height()}else{t=$hourcont[0].offsetTop-$mc.height()}}else{if(!jQuery.browser.safari){t=parseInt($hourcont.css("top"))+$hourcont.height()}else{t=$hourcont[0].offsetTop+$hourcont.height()}}}$mc.css("left",l).css("top",t);rectify($mc);$mc.show();if(settings.useBgiframe){bgi($mc)}}return false}function hourdiv_out($obj){$obj.removeClass("CP_over");return false}function hourdiv_click($obj){h=$obj.attr("id").split("_")[1];tt=set_tt(h);str=$obj.text();if(str.indexOf(" ")!=-1){cleanstr=str.substring(0,str.indexOf(" "))}else{cleanstr=str}$obj.text(cleanstr+":00"+tt);setval($obj);cleardivs()}function minutediv_over($obj){$obj.addClass("CP_over");return false}function minutediv_out($obj){$obj.removeClass("CP_over");return false}function minutediv_click($obj){setval($obj);cleardivs()}function setval($obj){if(!settings.valuefield){self.value=$obj.text()}else{jQuery("input[@name="+settings.valuefield+"]").val($obj.text())}callback.apply(jQuery(self));jQuery(self).unbind("keydown",keyhandler)}function cleardivs(){if(settings.showminutes){$mc.remove()}$hourcont.remove();jQuery(self).unbind("keydown",keyhandler)}function keyhandler(e){var $obj=$("div.CP_over").size()?$("div.CP_over"):$("div.CP_hour:first"),divtype=$obj.is(".CP_hour")?"hour":"minute",hi=(divtype=="hour")?$obj[0].id.split("_")[2]:0,h=(divtype=="minute")?$obj[0].id.split("_")[0]:$obj[0].id.split("_")[1];if(divtype=="minute"){var curloc=h<12?"m1":"m2"}else{var curloc=h<12?"h1":"h2"}function divprev($obj){if($obj.prev().size()){eval(divtype+"div_out($obj)");eval(divtype+"div_over($obj.prev(), e)")}else{return false}}function divnext($obj){if($obj.next().size()){eval(divtype+"div_out($obj)");eval(divtype+"div_over($obj.next(), e)")}else{return false}}function hourtohour($obj){var ctx=h>=12?"#hourcol1":"#hourcol2";$newobj=jQuery(".CP_hour[@id$=_"+hi+"]",ctx);if($newobj.size()){hourdiv_out($obj);hourdiv_over($newobj,e)}else{return false}}function hourtominute($obj){hourdiv_out($obj);minutediv_over($(".CP_minute:first"))}function minutetohour($obj){minutediv_out($obj);var ctx=h>=12?"#hourcol2":"#hourcol1";var $newobj=jQuery(".CP_hour[@id^=hr_"+h+"]",ctx);hourdiv_over($newobj,e)}switch(e.keyCode){case 37:if(v){switch(curloc){case"m1":return false;break;case"m2":minutetohour($obj);break;case"h1":hourtominute($obj);break;case"h2":hourtohour($obj);break}}else{divprev($obj)}break;case 38:if(v){divprev($obj)}else{switch(curloc){case"m1":return false;break;case"m2":minutetohour($obj);break;case"h1":hourtominute($obj);break;case"h2":hourtohour($obj);break}}break;case 39:if(v){switch(curloc){case"m1":minutetohour($obj);break;case"m2":return false;break;case"h1":hourtohour($obj);break;case"h2":hourtominute($obj);break}}else{divnext($obj)}break;case 40:if(v){divnext($obj)}else{switch(curloc){case"m1":minutetohour($obj);break;case"m2":return false;break;case"h1":hourtohour($obj);break;case"h2":hourtominute($obj);break}}break;case 13:eval(divtype+"div_click($obj)");break}return false}return false});function errorcheck(){if(settings.starthour>=settings.endhour){alert("Error - start hour must be less than end hour.");return false}else{if(60%settings.minutedivisions!=0){alert("Error - param minutedivisions must divide evenly into 60.");return false}}}return(this)}})();if(jQuery){(function(A){A.fn.rating=function(E){E=jQuery.extend({},{cancel:"Cancel Rating"},E||{});var C={};var D=null;var B=null;var G=null;var F={fill:function(L,K,J){var H=A(C[L].valueElem).siblings(".star");var I=H.index(K)+1;A(H).children("a").css("width","100%").end().removeClass("star_hover").removeClass("star_on").slice(0,I).addClass(J||"star_hover").end()},drain:function(I){var H=A(C[I].valueElem).siblings(".star");A(H).filter(".star_on").removeClass("star_on").end().filter(".star_hover").removeClass("star_hover").end()},reset:function(I){var H=A(C[I].valueElem).siblings(".star");A(H).slice(0,C[I].currentValue).addClass("star_on").end()}};this.each(function(H){var J=this.name;if(!C[J]){C[J]={count:0,currentValue:0}}C[J].count+=1;H=C[J].count-1;if(H==0){C[J].valueElem=A('<input type="hidden" name="'+this.name+'" value="" >');A(this).before(C[J].valueElem);var I=A('<div class="cancel"><a href="#" title="'+E.cancel+'">'+E.cancel+"</a></div>");D=I;A(this).before(D);A(I).mouseover(function(){F.drain(J);A(this).addClass("star_on")}).mouseout(function(){F.reset(J);A(this).removeClass("star_on")}).click(function(){C[J].currentValue=0;A(C[J].valueElem).val(C[J].currentValue);F.drain(J);return false})}preElemTemp=A('<div class="star"><a href="javascript:;" title="'+this.value+'">'+this.value+"</a></div>");A(D).after(preElemTemp);A(preElemTemp).mouseover(function(){F.drain(J);F.fill(J,this);return false}).mouseout(function(){F.drain(J);F.reset(J);return false}).click(function(){C[J].currentValue=A(this).children("a").attr("title");A(C[J].valueElem).val(C[J].currentValue);F.drain(J);if(E.callback){E.callback.apply(A(C[J].valueElem)[0],[C[J].currentValue,this])}F.fill(J,this)});if(this.checked){C[J].initial=preElemTemp}D=preElemTemp;preElemTemp=null;A(this).remove();if(H+1==this.length){F.reset(J)}});for(n in C){if(C[n].initial){A(C[n].initial).each(function(){F.fill(n,this,"star_on");C[n].currentValue=A(this).children("a").attr("title");A(C[n].valueElem).val(C[n].currentValue)})}}return this}})(jQuery)}(function(C){var A=C.scrollTo=function(F,E,D){C(window).scrollTo(F,E,D)};A.defaults={axis:"y",duration:1};A.window=function(D){return C(window).scrollable()};C.fn.scrollable=function(){return this.map(function(){var G=this.parentWindow||this.defaultView,E=this.nodeName=="#document"?G.frameElement||G:this,F=E.contentDocument||(E.contentWindow||E).document,D=E.setInterval;return E.nodeName=="IFRAME"||D&&C.browser.safari?F.body:D?F.documentElement:this})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this.scrollable().each(function(){var M=this,K=C(M),L=F,J,H={},N=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(px)?$/.test(L)){L=B(L);break}L=C(L,this);case"object":if(L.is||L.style){J=(L=C(L)).offset()}}C.each(D.axis.split(""),function(R,S){var T=S=="x"?"Left":"Top",V=T.toLowerCase(),Q="scroll"+T,O=M[Q],P=S=="x"?"Width":"Height",U=P.toLowerCase();if(J){H[Q]=J[V]+(N?0:O-K.offset()[V]);if(D.margin){H[Q]-=parseInt(L.css("margin"+T))||0;H[Q]-=parseInt(L.css("border"+T+"Width"))||0}H[Q]+=D.offset[V]||0;if(D.over[V]){H[Q]+=L[U]()*D.over[V]}}else{H[Q]=L[V]}if(/^\d+$/.test(H[Q])){H[Q]=H[Q]<=0?0:Math.min(H[Q],G(P))}if(!R&&D.queue){if(O!=H[Q]){I(D.onAfterFirst)}delete H[Q]}});I(D.onAfter);function I(O){K.animate(H,E,D.easing,O&&function(){O.call(this,F,D)})}function G(P){var O="scroll"+P,Q=M.ownerDocument;return N?Math.max(Q.documentElement[O],Q.body[O]):M[O]}}).end()};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);(function(B){B.fn.caret=function(E,C){if(this.length==0){return }if(typeof E=="number"){C=(typeof C=="number")?C:E;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(E,C)}else{if(this.createTextRange){var F=this.createTextRange();F.collapse(true);F.moveEnd("character",C);F.moveStart("character",E);F.select()}}})}else{if(this[0].setSelectionRange){E=this[0].selectionStart;C=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var D=document.selection.createRange();E=0-D.duplicate().moveStart("character",-100000);C=E+D.text.length}}return{begin:E,end:C}}};var A={"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"};B.mask={addPlaceholder:function(D,C){A[D]=C}};B.fn.unmask=function(){return this.trigger("unmask")};B.fn.mask=function(C,E){E=B.extend({placeholder:"_",completed:null},E);var D=new RegExp("^"+B.map(C.split(""),function(G,F){return A[G]||((/[A-Za-z0-9]/.test(G)?"":"\\")+G)}).join("")+"$");return this.each(function(){var O=B(this);var I=new Array(C.length);var J=new Array(C.length);var F=false;var N=false;var Q=null;B.each(C.split(""),function(S,T){J[S]=(A[T]==null);I[S]=J[S]?T:E.placeholder;if(!J[S]&&Q==null){Q=S}});function P(){H();L();setTimeout(function(){B(O[0]).caret(F?C.length:Q)},0)}function K(T){var U=B(this).caret();var S=T.keyCode;N=(S<16||(S>16&&S<32)||(S>32&&S<41));if((U.begin-U.end)!=0&&(!N||S==8||S==46)){G(U.begin,U.end)}if(S==8){while(U.begin-->=0){if(!J[U.begin]){I[U.begin]=E.placeholder;if(B.browser.opera){s=L();O.val(s.substring(0,U.begin)+" "+s.substring(U.begin));B(this).caret(U.begin+1)}else{L();B(this).caret(Math.max(Q,U.begin))}return false}}}else{if(S==46){G(U.begin,U.begin+1);L();B(this).caret(Math.max(Q,U.begin));return false}else{if(S==27){G(0,C.length);L();B(this).caret(Q);return false}}}}function R(V){if(N){N=false;return(V.keyCode==8)?false:null}V=V||window.event;var S=V.charCode||V.keyCode||V.which;var W=B(this).caret();if(V.ctrlKey||V.altKey){return true}else{if((S>=41&&S<=122)||S==32||S>186){var U=M(W.begin-1);if(U<C.length){if(new RegExp(A[C.charAt(U)]).test(String.fromCharCode(S))){I[U]=String.fromCharCode(S);L();var T=M(U);B(this).caret(T);if(E.completed&&T==C.length){E.completed.call(O)}}}}}return false}function G(U,S){for(var T=U;T<S&&T<C.length;T++){if(!J[T]){I[T]=E.placeholder}}}function L(){return O.val(I.join("")).val()}function H(){var W=O.val();var V=Q;for(var T=0;T<C.length;T++){if(!J[T]){I[T]=E.placeholder;while(V++<W.length){var S=new RegExp(A[C.charAt(T)]);if(W.charAt(V-1).match(S)){I[T]=W.charAt(V-1);break}}}}var U=L();if(!U.match(D)){O.val("");G(0,C.length);F=false}else{F=true}}function M(S){while(++S<C.length){if(!J[S]){return S}}return C.length}O.one("unmask",function(){O.unbind("focus",P);O.unbind("blur",H);O.unbind("keydown",K);O.unbind("keypress",R);if(B.browser.msie){this.onpaste=null}else{if(B.browser.mozilla){this.removeEventListener("input",H,false)}}});O.bind("focus",P);O.bind("blur",H);O.bind("keydown",K);O.bind("keypress",R);if(B.browser.msie){this.onpaste=function(){setTimeout(H,0)}}else{if(B.browser.mozilla){this.addEventListener("input",H,false)}}H()})}})(jQuery);(function(A){A.ajaxHistory=new function(){var K="historyReset";var C=location.hash;var J=null;var H;this.update=function(){};var G=function(){A(".remote-output").empty()};A(document).bind(K,G);if(A.browser.msie){var I,D=false;A(function(){I=A('<iframe style="display: none;"></iframe>').appendTo(document.body).get(0);var M=I.contentWindow.document;M.open();M.close();if(C&&C!="#"){M.location.hash=C.replace("#","")}});this.update=function(N){C=N;var M=I.contentWindow.document;M.open();M.close();M.location.hash=N.replace("#","")};H=function(){var N=I.contentWindow.document;var M=N.location.hash;if(M!=C){C=M;if(M&&M!="#"){A('a[href$="'+M+'"]').click();location.hash=M}else{if(D){location.hash="";A(document).trigger(K)}}}D=true}}else{if(A.browser.mozilla||A.browser.opera){this.update=function(M){C=M};H=function(){if(location.hash){if(C!=location.hash){C=location.hash;A('a[href$="'+C.replace("#","")+'"]').click()}}else{if(C){C="";A(document).trigger(K)}}}}else{if(A.browser.safari){var L,B,F;A(function(){L=[];L.length=history.length;B=[]});var E=false,D=false;F=function(M){L.push(M);B.length=0;E=false};this.update=function(M){C=M;F(C)};H=function(){var M=history.length-L.length;if(M){E=false;if(M<0){for(var N=0;N<Math.abs(M);N++){B.unshift(L.pop())}}else{for(var N=0;N<M;N++){L.push(B.shift())}}var O=L[L.length-1];A('a[href$="'+O+'"]').click();C=location.hash}else{if(L[L.length-1]==undefined&&!E){if(document.URL.indexOf("#")>=0){A('a[href$="#'+document.URL.split("#")[1]+'"]').click()}else{if(D){A(document).trigger(K)}}E=true}}D=true}}}}this.initialize=function(M){if(typeof M=="function"){A(document).unbind(K,G).bind(K,M)}if(location.hash&&typeof F=="undefined"){A('a[href$="'+location.hash+'"]').trigger("click")}if(H&&J==null){J=setInterval(H,200)}}};A.fn.remote=function(B,C,E){E=E||function(){};if(typeof C=="function"){E=C}C=A.extend({hashPrefix:"remote-"},C||{});var D=A(B).size()&&A(B)||A("<div></div>").appendTo("body");D.addClass("remote-output");return this.each(function(H){var G=this.href,I="#"+(this.title&&this.title.replace(/\s/g,"_")||C.hashPrefix+(H+1)),F=this;this.href=I;A(this).click(function(J){if(!D.locked){if(J.clientX){A.ajaxHistory.update(I)}D.load(G,function(){D.locked=null;E.apply(F)})}})})};A.fn.history=function(B){return this.click(function(C){if(C.clientX){if(this.pathname==location.hash){return false}else{A.ajaxHistory.update(location.hash);location.hash=this.pathname}}if(typeof B=="function"){B.call(this)}return false})}})(jQuery);(function(A){jQuery.fn.rte=function(C,B){if(document.designMode||document.contentEditable){A(this).each(function(){var K=A(this);E(K)})}function F(L,N,K){L.contentWindow.focus();try{L.contentWindow.document.execCommand(N,false,K)}catch(M){console.log(M)}L.contentWindow.focus()}function I(L,M,N){try{L.contentWindow.document.open();L.contentWindow.document.write(M);L.contentWindow.document.close()}catch(K){console.log(K)}if(document.contentEditable){L.contentWindow.document.designMode="On";N();return true}else{if(document.designMode!=null){try{L.contentWindow.document.designMode="on";N();return true}catch(K){console.log(K)}}}setTimeout(function(){I(L,M,N)},250);return false}function E(K){var M=document.createElement("iframe");M.frameBorder=0;M.frameMargin=0;M.framePadding=0;M.height=200;if(K.attr("class")){M.className=K.attr("class")}if(K.attr("id")){M.id=K.attr("id")}if(K.attr("name")){M.title=K.attr("name")}K.after(M);var L="";if(C){var L="<link type='text/css' rel='stylesheet' href='"+C+"' />"}var N=K.val();if(A.trim(N)==""){N="<br>"}var O="<html><head>"+L+"</head><body class='frameBody'>"+N+"</body></html>";I(M,O,function(){A("#toolbar-"+M.title).remove();A(M).before(H(M));K.remove()})}function G(L,N){var M=L.contentWindow.document.getElementsByTagName("body")[0].innerHTML;if(N==true){var K=A('<input type="hidden" />')}else{var K=A('<textarea cols="40" rows="10"></textarea>')}K.val(M);t=K.get(0);if(L.className){t.className=L.className}if(L.id){t.id=L.id}if(L.title){t.name=L.title}A(L).before(K);if(N!=true){A(L).remove()}return K}function H(M){var L=A("<div class='rte-toolbar' id='toolbar-"+M.title+"'><div>            <ul>                <li>                    <select>                        <option value=''>Bloc style</option>                        <option value='p'>Paragraph</option>                        <option value='h3'>Title</option>                    </select>                </li>                <li><a href='#' class='bold'><img src='"+B+"bold.gif' alt='bold' /></a></li>                <li><a href='#' class='italic'><img src='"+B+"italic.gif' alt='italic' /></a></li>                <li><a href='#' class='unorderedlist'><img src='"+B+"unordered.gif' alt='unordered list' /></a></li>                <li><a href='#' class='link'><img src='"+B+"link.png' alt='link' /></a></li>                <li><a href='#' class='image'><img src='"+B+"image.png' alt='image' /></a></li>                <li><a href='#' class='disable'><img src='"+B+"close.gif' alt='close rte' /></a></li>            </ul>            </div></div>");A("select",L).change(function(){var O=this.selectedIndex;if(O!=0){var P=this.options[O].value;F(M,"formatblock","<"+P+">")}});A(".bold",L).click(function(){F(M,"bold");return false});A(".italic",L).click(function(){F(M,"italic");return false});A(".unorderedlist",L).click(function(){F(M,"insertunorderedlist");return false});A(".link",L).click(function(){var O=prompt("URL:");if(O){F(M,"CreateLink",O)}return false});A(".image",L).click(function(){var O=prompt("image URL:");if(O){F(M,"InsertImage",O)}return false});A(".disable",L).click(function(){var O=G(M);var P=A('<a href="#">Enable design mode</a>');L.empty().append(P);P.click(function(){L.remove();E(O);return false});return false});A(M).parents("form").submit(function(){G(M,true)});var N=A(M.contentWindow.document);var K=A("select",L)[0];N.mouseup(function(){J(D(M),K);return true});N.keyup(function(){J(D(M),K);var O=A("body",N);if(O.scrollTop()>0){M.height=Math.min(350,parseInt(M.height)+O.scrollTop())}return true});return L}function J(N,L){while(N.parentNode){var K=N.nodeName.toLowerCase();for(var M=0;M<L.options.length;M++){if(K==L.options[M].value){L.selectedIndex=M;return true}}N=N.parentNode}L.selectedIndex=0;return true}function D(K){if(K.contentWindow.document.selection){selection=K.contentWindow.document.selection;range=selection.createRange();try{node=range.parentElement()}catch(L){return false}}else{try{selection=K.contentWindow.getSelection();range=selection.getRangeAt(0)}catch(L){return false}node=range.commonAncestorContainer}return node}}})(jQuery);(function(A){A.fn.upload=function(B){B=A.extend({name:"file",enctype:"multipart/form-data",action:"",autoSubmit:true,onSubmit:function(){},onComplete:function(){},onSelect:function(){},params:{}},B);return new A.ocupload(this,B)},A.ocupload=function(F,E){var D=this;var I=new Date().getTime().toString().substr(8);var G=A('<iframe id="iframe'+I+'" name="iframe'+I+'"></iframe>').css({display:"none"});var H=A('<form method="post" enctype="'+E.enctype+'" action="'+E.action+'" target="iframe'+I+'"></form>').css({margin:0,padding:0});var C=A('<input name="'+E.name+'" type="file" />').css({position:"relative",display:"block",marginLeft:-175+"px",opacity:0});F.wrap("<div></div>");H.append(C);F.after(H);F.after(G);var B=F.parent().css({position:"relative",height:F.outerHeight()+"px",width:F.outerWidth()+"px",overflow:"hidden",cursor:"pointer",margin:0,padding:0});C.css("marginTop",-B.height()-10+"px");B.mousemove(function(J){C.css({top:J.pageY-B.offset().top+"px",left:J.pageX-B.offset().left+"px"})});C.change(function(){D.onSelect();if(D.autoSubmit){D.submit()}});A.extend(this,{autoSubmit:true,onSubmit:E.onSubmit,onComplete:E.onComplete,onSelect:E.onSelect,filename:function(){return C.attr("value")},params:function(J){var J=J?J:false;if(J){E.params=A.extend(E.params,J)}else{return E.params}},name:function(J){var J=J?J:false;if(J){C.attr("name",value)}else{return C.attr("name")}},action:function(J){var J=J?J:false;if(J){H.attr("action",J)}else{return H.attr("action")}},enctype:function(J){var J=J?J:false;if(J){H.attr("enctype",J)}else{return H.attr("enctype")}},set:function(L,K){var K=K?K:false;function J(N,M){switch(N){default:throw new Error("[jQuery.ocupload.set] '"+N+"' is an invalid option.");break;case"name":D.name(M);break;case"action":D.action(M);break;case"enctype":D.enctype(M);break;case"params":D.params(M);break;case"autoSubmit":D.autoSubmit=M;break;case"onSubmit":D.onSubmit=M;break;case"onComplete":D.onComplete=M;break;case"onSelect":D.onSelect=M;break}}if(K){J(L,K)}else{A.each(L,function(M,N){J(M,N)})}},submit:function(){this.onSubmit();A.each(E.params,function(J,K){H.append(A('<input type="hidden" name="'+J+'" value="'+K+'" />'))});H.submit();G.unbind().load(function(){var K=document.getElementById(G.attr("name"));var J=A(K.contentWindow.document.body).text();D.onComplete(J)})}})}})(jQuery);$.Jcrop=function(C,S){var C=C,S=S;if(typeof (C)!=="object"){C=$(C)[0]}if(typeof (S)!=="object"){S={}}if(!("trackDocument" in S)){S.trackDocument=$.browser.msie?false:true}if(!("keySupport" in S)){S.keySupport=$.browser.msie?false:true}var u={trackDocument:false,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:0.6,borderOpacity:0.4,handleOpacity:0.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,watchShift:false,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var a=u;R(S);var AH=$(C).css({position:"absolute"});r(AH,a.boxWidth,a.boxHeight);var o=AH.width(),j=AH.height(),y=$("<div />").width(o).height(j).addClass(U("holder")).css({position:"relative",backgroundColor:a.bgColor});if(a.addClass){y.addClass(a.addClass)}AH.wrap(y);var b=$("<img />").attr("src",AH.attr("src")).css("position","absolute").width(o).height(j);var G=$("<div />").width(d(100)).height(d(100)).css({zIndex:310,position:"absolute",overflow:"hidden"}).append(b);var f=$("<div />").width(d(100)).height(d(100)).css({zIndex:320});var Q=$("<div />").css({position:"absolute",zIndex:300}).insertBefore(AH).append(G,f);var N=a.boundary;var A=$("<div />").addClass(U("tracker")).width(o+(N*2)).height(j+(N*2)).css({position:"absolute",top:H(-N),left:H(-N),zIndex:290,opacity:0}).mousedown(AB);var g,D;var AC=W(C),L,V,AJ,AI,T,AA;if("trueSize" in a){g=a.trueSize[0]/o;D=a.trueSize[1]/j}var z=function(){var AM=0,AX=0,AL=0,AW=0,AP,AN;function AR(Aa){var Aa=AO(Aa);AL=AM=Aa[0];AW=AX=Aa[1]}function AQ(Aa){var Aa=AO(Aa);AP=Aa[0]-AL;AN=Aa[1]-AW;AL=Aa[0];AW=Aa[1]}function AZ(){return[AP,AN]}function AK(Ac){var Ab=Ac[0],Aa=Ac[1];if(0>AM+Ab){Ab-=Ab+AM}if(0>AX+Aa){Aa-=Aa+AX}if(j<AW+Aa){Aa+=j-(AW+Aa)}if(o<AL+Ab){Ab+=o-(AL+Ab)}AM+=Ab;AL+=Ab;AX+=Aa;AW+=Aa}function AS(Aa){var Ab=AY();switch(Aa){case"ne":return[Ab.x2,Ab.y];case"nw":return[Ab.x,Ab.y];case"se":return[Ab.x2,Ab.y2];case"sw":return[Ab.x,Ab.y2]}}function AY(){if(!a.aspectRatio&&!V){return AV()}var Ab=a.aspectRatio?a.aspectRatio:V,Af=a.minSize,Ai=a.maxSize,Ac=AL-AM,Aj=AW-AX,Ad=Math.abs(Ac),Ae=Math.abs(Aj),Ag=Ad/Ae,Aa,Ah;if(Ag<Ab){Ah=AW;w=Ae*Ab;Aa=Ac<0?AM-w:w+AM;if(Aa<0){Aa=0;h=Math.abs((Aa-AM)/Ab);Ah=Aj<0?AX-h:h+AX}else{if(Aa>o){Aa=o;h=Math.abs((Aa-AM)/Ab);Ah=Aj<0?AX-h:h+AX}}}else{Aa=AL;h=Ad/Ab;Ah=Aj<0?AX-h:AX+h;if(Ah<0){Ah=0;w=Math.abs((Ah-AX)*Ab);Aa=Ac<0?AM-w:w+AM}else{if(Ah>j){Ah=j;w=Math.abs(Ah-AX)*Ab;Aa=Ac<0?AM-w:w+AM}}}return last=AU(AT(AM,AX,Aa,Ah))}function AO(Aa){if(Aa[0]<0){Aa[0]=0}if(Aa[1]<0){Aa[1]=0}if(Aa[0]>o){Aa[0]=o}if(Aa[1]>j){Aa[1]=j}return[Aa[0],Aa[1]]}function AT(Ad,Af,Ac,Ae){var Ah=Ad,Ag=Ac,Ab=Af,Aa=Ae;if(Ac<Ad){Ah=Ac;Ag=Ad}if(Ae<Af){Ab=Ae;Aa=Af}return[Math.round(Ah),Math.round(Ab),Math.round(Ag),Math.round(Aa)]}function AV(){var Ab=AL-AM;var Aa=AW-AX;if(P&&(Math.abs(Ab)>P)){AL=(Ab>0)?(AM+P):(AM-P)}if(AE&&(Math.abs(Aa)>AE)){AW=(Aa>0)?(AX+AE):(AX-AE)}if(q&&(Math.abs(Aa)<q)){AW=(Aa>0)?(AX+q):(AX-q)}if(I&&(Math.abs(Ab)<I)){AL=(Ab>0)?(AM+I):(AM-I)}if(AM<0){AL-=AM;AM-=AM}if(AX<0){AW-=AX;AX-=AX}if(AL<0){AM-=AL;AL-=AL}if(AW<0){AX-=AW;AW-=AW}if(AL>o){var Ac=AL-o;AM-=Ac;AL-=Ac}if(AW>j){var Ac=AW-j;AX-=Ac;AW-=Ac}if(AM>o){var Ac=AM-j;AW-=Ac;AX-=Ac}if(AX>j){var Ac=AX-j;AW-=Ac;AX-=Ac}return AU(AT(AM,AX,AL,AW))}function AU(Aa){return{x:Aa[0],y:Aa[1],x2:Aa[2],y2:Aa[3],w:Aa[2]-Aa[0],h:Aa[3]-Aa[1]}}return{flipCoords:AT,setPressed:AR,setCurrent:AQ,getOffset:AZ,moveOffset:AK,getCorner:AS,getFixed:AY}}();var v=function(){var AP,AM,AW,AV,Ae=370;var AO={};var Ai={};var AL=false;var AU=a.handleOffset;if(a.drawBorders){AO={top:AQ("hline").css("top",$.browser.msie?H(-1):H(0)),bottom:AQ("hline"),left:AQ("vline"),right:AQ("vline")}}if(a.dragEdges){Ai.t=Ad("n");Ai.b=Ad("s");Ai.r=Ad("e");Ai.l=Ad("w")}a.sideHandles&&AZ(["n","s","e","w"]);a.cornerHandles&&AZ(["sw","nw","ne","se"]);function AQ(Al){var Am=$("<div />").css({position:"absolute",opacity:a.borderOpacity}).addClass(U(Al));G.append(Am);return Am}function AK(Al,Am){var An=$("<div />").mousedown(B(Al)).css({cursor:Al+"-resize",position:"absolute",zIndex:Am});f.append(An);return An}function AX(Al){return AK(Al,Ae++).css({top:H(-AU+1),left:H(-AU+1),opacity:a.handleOpacity}).addClass(U("handle"))}function Ad(An){var Aq=a.handleSize,Ar=AU,Ap=Aq,Am=Aq,Ao=Ar,Al=Ar;switch(An){case"n":case"s":Am=d(100);break;case"e":case"w":Ap=d(100);break}return AK(An,Ae++).width(Am).height(Ap).css({top:H(-Ao+1),left:H(-Al+1)})}function AZ(Al){for(i in Al){Ai[Al[i]]=AX(Al[i])}}function Ab(As){var An=Math.round((As.h/2)-AU),Am=Math.round((As.w/2)-AU),Aq=west=-AU+1,Ap=As.w-AU,Ao=As.h-AU,Al,Ar;"e" in Ai&&Ai.e.css({top:H(An),left:H(Ap)})&&Ai.w.css({top:H(An)})&&Ai.s.css({top:H(Ao),left:H(Am)})&&Ai.n.css({left:H(Am)});"ne" in Ai&&Ai.ne.css({left:H(Ap)})&&Ai.se.css({top:H(Ao),left:H(Ap)})&&Ai.sw.css({top:H(Ao)});"b" in Ai&&Ai.b.css({top:H(Ao)})&&Ai.r.css({left:H(Ap)})}function AS(Al,Am){b.css({top:H(-Am),left:H(-Al)});Q.css({top:H(Am),left:H(Al)})}function Ak(Al,Am){Q.width(Al).height(Am)}function AN(){var Al=z.getFixed();z.setPressed([Al.x,Al.y]);z.setCurrent([Al.x2,Al.y2])}function Ah(){if(AV){return AR()}}function AR(){var Al=z.getFixed();Ak(Al.w,Al.h);AS(Al.x,Al.y);a.drawBorders&&AO.right.css({left:H(Al.w-1)})&&AO.bottom.css({top:H(Al.h-1)});AL&&Ab(Al);AV||Aj();a.onChange(x(Al))}function Aj(){Q.show();AH.css("opacity",a.bgOpacity);AV=true}function Af(){Ag();Q.hide();AH.css("opacity",1);AV=false}function AT(){Af();AH.css("opacity",1);AV=false}function Aa(){AL=true;Ab(z.getFixed());f.show()}function Ag(){AL=false;f.hide()}function Ac(Al){(T=Al)?Ag():Aa()}function AY(){var Al=z.getFixed();Ac(false);AN()}Ag();G.append($("<div />").addClass(U("tracker")).mousedown(B("move")).css({cursor:"move",position:"absolute",zIndex:360,opacity:0}));return{updateVisible:Ah,update:AR,release:Af,show:Aj,hide:AT,enableHandles:Aa,disableHandles:Ag,animMode:Ac,done:AY}}();var k=function(){var AL=function(){},AN=function(){},AM=a.trackDocument;if(!AM){A.mousemove(AK).mouseup(AO).mouseout(AO)}function AS(){if(AM){$(document).mousemove(AK).mouseup(AO)}A.css({zIndex:450})}function AR(){if(AM){$(document).unbind("mousemove",AK).unbind("mouseup",AO)}A.css({zIndex:290})}function AK(AT){AL(Y(AT))}function AO(AT){AT.preventDefault();AT.stopPropagation();if(L){L=false;AN(Y(AT));a.onSelect(x(z.getFixed()));AR();AL=function(){};AN=function(){}}return false}function AP(AU,AT){L=true;AL=AU;AN=AT;AS();return false}function AQ(AT){A.css("cursor",AT)}AH.before(A);return{activateHandlers:AP,setCursor:AQ}}();var AG=function(){var AN=$('<input type="radio" />').css({position:"absolute",left:"-30px"}).keydown(AK).keyup(AO).blur(AP),AQ=$("<div />").css({position:"absolute",overflow:"hidden"}).append(AN);function AL(){if(a.keySupport){AN.show();AN.focus()}}function AP(AR){AN.hide()}function AO(AS){if(!a.watchShift){return }var AT=AA,AR;AA=AS.shiftKey?true:false;if(AT!=AA){if(AA&&L){AR=z.getFixed();V=AR.w/AR.h}else{V=0}v.update()}AS.stopPropagation();AS.preventDefault();return false}function AM(AS,AR,AT){z.moveOffset([AR,AT]);v.updateVisible();AS.preventDefault();AS.stopPropagation()}function AK(AS){if(AS.ctrlKey){return true}AO(AS);var AR=AA?10:1;switch(AS.keyCode){case 37:AM(AS,-AR,0);break;case 39:AM(AS,AR,0);break;case 38:AM(AS,0,-AR);break;case 40:AM(AS,0,AR);break;case 27:v.release();break;case 9:return true}return false}if(a.keySupport){AQ.insertBefore(AH)}return{watchKeys:AL}}();function H(AK){return""+parseInt(AK)+"px"}function d(AK){return""+parseInt(AK)+"%"}function U(AK){return a.baseClass+"-"+AK}function W(AK){var AL=$(AK).offset();return[AL.left,AL.top]}function Y(AK){return[(AK.pageX-AC[0]),(AK.pageY-AC[1])]}function X(AK){if(AK!=AJ){k.setCursor(AK);AJ=AK}}function E(AL,AM){AC=W(C);k.setCursor(AL=="move"?AL:AL+"-resize");if(AL=="move"){return k.activateHandlers(p(AM),J)}var AK=z.getFixed();z.setPressed(z.getCorner(K(AL)));k.activateHandlers(Z(AL,AK),J)}function Z(AL,AK){return function(AM){if(!a.aspectRatio&&!V){switch(AL){case"e":AM[1]=AK.y2;break;case"w":AM[1]=AK.y2;break;case"n":AM[0]=AK.x2;break;case"s":AM[0]=AK.x2;break}}else{switch(AL){case"e":AM[1]=AK.y+1;break;case"w":AM[1]=AK.y+1;break;case"n":AM[0]=AK.x+1;break;case"s":AM[0]=AK.x+1;break}}z.setCurrent(AM);v.update()}}function p(AL){var AK=AL;AG.watchKeys();return function(AM){z.moveOffset([AM[0]-AK[0],AM[1]-AK[1]]);AK=AM;v.update()}}function K(AK){switch(AK){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function B(AK){return function(AL){L=true;E(AK,Y(AL));AL.stopPropagation();AL.preventDefault();return false}}function r(AO,AL,AN){var AK=AO.width(),AM=AO.height();if((AK>AL)&&AL>0){AK=AL;AM=(AL/AO.width())*AO.height()}if((AM>AN)&&AN>0){AM=AN;AK=(AN/AO.height())*AO.width()}g=AO.width()/AK;D=AO.height()/AM;AO.width(AK).height(AM)}function x(AK){return{x:parseInt(AK.x*g),y:parseInt(AK.y*D),x2:parseInt(AK.x2*g),y2:parseInt(AK.y2*D),w:parseInt(AK.w*g),h:parseInt(AK.h*D)}}function J(AL){var AK=z.getFixed();if(AK.w>a.minSelect[0]&&AK.h>a.minSelect[1]){v.enableHandles();v.done()}else{v.release()}k.setCursor("crosshair")}function AB(AK){L=true;AC=W(C);v.release();v.disableHandles();X("crosshair");z.setPressed(Y(AK));k.activateHandlers(AF,J);AG.watchKeys();AK.stopPropagation();AK.preventDefault();return false}function AF(AK){z.setCurrent(AK);v.update()}function M(Ab){var AW=Ab[0],AL=Ab[1],AV=Ab[2],AK=Ab[3];if(T){return }var AU=z.flipCoords(AW,AL,AV,AK);var AZ=z.getFixed();var AN=initcr=[AZ.x,AZ.y,AZ.x2,AZ.y2];var AM=a.animationDelay;var AS=AN[0];var AR=AN[1];var AV=AN[2];var AK=AN[3];var AY=AU[0]-initcr[0];var AP=AU[1]-initcr[1];var AX=AU[2]-initcr[2];var AO=AU[3]-initcr[3];var AT=0;var AQ=a.swingSpeed;v.animMode(true);var Aa=function(){return function(){AT+=(100-AT)/AQ;AN[0]=AS+((AT/100)*AY);AN[1]=AR+((AT/100)*AP);AN[2]=AV+((AT/100)*AX);AN[3]=AK+((AT/100)*AO);if(AT<100){Ac()}else{v.done()}if(AT>=99.8){AT=100}c(AN)}}();function Ac(){window.setTimeout(Aa,AM)}Ac()}function c(AK){z.setPressed([AK[0],AK[1]]);z.setCurrent([AK[2],AK[3]]);v.update()}function R(AK){if(typeof (AK)!="object"){AK={}}a=$.extend(a,AK);if(typeof (a.onChange)!=="function"){a.onChange=function(){}}if(typeof (a.onSelect)!=="function"){a.onSelect=function(){}}}function F(){return x(z.getFixed())}function AD(){return z.getFixed()}function O(AK){R(AK);if("setSelect" in AK){c(AK.setSelect);v.done()}}if(typeof (S)!="object"){S={}}if("setSelect" in S){c(S.setSelect);v.done()}var P=a.maxSize[0]||0;var AE=a.maxSize[1]||0;var I=a.minSize[0]||0;var q=a.minSize[1]||0;k.setCursor("crosshair");return{animateTo:M,setSelect:c,setOptions:O,tellSelect:F,tellScaled:AD}};$.fn.Jcrop=function(B){function A(E){var D=B.useImg||E.src;var C=new Image();var E=E;C.onload=function(){$(E).hide().after(C);E.Jcrop=$.Jcrop(C,B)};C.src=D}if(typeof (B)!=="object"){B={}}this.each(function(){if("Jcrop" in this){if(B=="api"){return this.Jcrop}else{this.Jcrop.setOptions(B)}}else{A(this)}});return this};function get_css(E,D,B){if(!document.styleSheets){return false}E=E.toLowerCase();D=D||0;for(var C=D;C<document.styleSheets.length;C++){var F=document.styleSheets[C];css_rules=document.styleSheets[C].cssRules||document.styleSheets[C].rules;if(!css_rules){continue}var A=0;do{if(css_rules.length&&A>css_rules.length+5){return false}if(css_rules[A].selectorText&&css_rules[A].selectorText.toLowerCase()==E){if(B==true){if(document.styleSheets[C].removeRule){document.styleSheets[C].removeRule(A)}if(document.styleSheets[C].deleteRule){document.styleSheets[C].deleteRule(A)}return true}else{return css_rules[A]}}}while(css_rules[++A])}return false}function add_css(B,A){B=B.toLowerCase();A=A||0;if(!document.styleSheets||get_css(B,A)){return false}(document.styleSheets[A].insertRule)?document.styleSheets[A].insertRule(B+" { }",0):document.styleSheets[A].addRule(B,null,0);return get_css(B,A)}function get_sheet_num(B){if(!document.styleSheets){return false}for(var A=0;A<document.styleSheets.length;A++){if(document.styleSheets[A].href&&document.styleSheets[A].href.toString().match(B)){return A}}return false}function remove_css(B,A){return get_css(B,A,true)}function add_sheet(C,G,B){var A=true;$("link").each(function(){var H=$(this).attr("href");if(H.match(C)){A&=false}});var F=B||false;if(A){var E='<link rel="stylesheet" type="text/css"';var D=G||"all";E+=' media="'+D+'"';E+=' href="'+C+'" />';if(F){$("head").prepend(E)}else{$("head").append(E)}}}(function(B){B.fn.tree=function(C){return this.each(function(){var D=B.extend({},C);if(A.inst&&A.inst[B(this).attr("id")]){A.inst[B(this).attr("id")].destroy()}if(D!==false){new A().init(this,D)}})};B.tree_create=function(){return new A()};B.tree_focused=function(){return A.inst[A.focused]};B.tree_reference=function(C){return A.inst[C]||null};B.tree_rollback=function(F){for(var E in F){var D=A.inst[E];var C=!D.locked;if(C){D.lock(true)}if(D.inp){D.inp.val("").blur()}D.context.append=false;D.container.html(F[E].html).find(".dragged").removeClass("dragged").end().find("div.context").remove();if(F[E].selected){D.selected=B("#"+F[E].selected);D.selected_arr=[];D.container.find("a.clicked").each(function(){D.selected_arr.push(D.get_node(this))})}if(C){D.lock(false)}delete C;delete D}};function A(){if(typeof A.inst=="undefined"){A.cntr=0;A.inst={};A.drag_drop={isdown:false,drag_node:false,drag_help:false,init_x:false,init_y:false,moving:false,origin_tree:false,marker:false,move_type:false,ref_node:false,appended:false,foreign:false,droppable:[],open_time:false,scroll_time:false};A.mousedown=function(D){var C=B(D.target);if(A.drag_drop.droppable.length&&C.is("."+A.drag_drop.droppable.join(", ."))){A.drag_drop.drag_help=B("<li id='dragged' class='dragged foreign "+D.target.className+"'><a href='#'>"+C.text()+"</a></li>");A.drag_drop.drag_node=A.drag_drop.drag_help;A.drag_drop.isdown=true;A.drag_drop.foreign=C;C.blur();D.preventDefault();D.stopPropagation();return false}D.stopPropagation();return true};A.mouseup=function(E){var D=A.drag_drop;if(D.open_time){clearTimeout(D.open_time)}if(D.scroll_time){clearTimeout(D.scroll_time)}if(D.foreign===false&&D.drag_node&&D.drag_node.size()){D.drag_help.remove();if(D.move_type){var C=A.inst[D.ref_node.parents(".tree:eq(0)").attr("id")];if(C){C.moved(D.origin_tree.container.find("li.dragged"),D.ref_node,D.move_type,false,(D.origin_tree.settings.rules.drag_copy=="on"||(D.origin_tree.settings.rules.drag_copy=="ctrl"&&E.ctrlKey)))}}D.move_type=false;D.ref_node=false}if(D.drag_node&&D.foreign!==false){D.drag_help.remove();if(D.move_type){var C=A.inst[D.ref_node.parents(".tree:eq(0)").attr("id")];if(C){C.settings.callback.ondrop.call(null,D.foreign.get(0),C.get_node(D.ref_node).get(0),D.move_type,C)}}D.foreign=false;D.move_type=false;D.ref_node=false}A.drag_drop.marker.hide();D.drag_help=false;D.drag_node=false;D.isdown=false;D.init_x=false;D.init_y=false;D.moving=false;D.appended=false;if(D.origin_tree){D.origin_tree.container.find("li.dragged").removeClass("dragged")}D.origin_tree=false;E.preventDefault();E.stopPropagation();return false};A.mousemove=function(C){var I=A.drag_drop;if(I.isdown){if(!I.moving&&Math.abs(I.init_x-C.pageX)<5&&Math.abs(I.init_y-C.pageY)<5){C.preventDefault();C.stopPropagation();return false}else{A.drag_drop.moving=true}if(I.open_time){clearTimeout(I.open_time)}if(!I.appended){if(I.foreign!==false){I.origin_tree=B.tree_focused()}I.origin_tree.container.children("ul:eq(0)").append(I.drag_help);var O=B(I.drag_help).offsetParent();if(O.is("html")){O=B("body")}I.po=O.offset();I.po.top-=(O.is("body"))?0:O.scrollTop();I.po.left-=(O.is("body"))?0:O.scrollLeft();I.w=I.drag_help.width();I.appended=true}I.drag_help.css({left:(C.pageX-I.po.left-(I.origin_tree.settings.ui.rtl?I.w:-5)),top:(C.pageY-I.po.top+15)});if(C.target.tagName=="IMG"&&C.target.id=="marker"){return false}var G=B(C.target).parents(".tree:eq(0)");if(G.size()==0){if(I.scroll_time){clearTimeout(I.scroll_time)}if(I.drag_help.children("IMG").size()==0){I.drag_help.append("<img style='position:absolute; "+(I.origin_tree.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+I.origin_tree.settings.ui.theme_path+"remove.png' />")}I.move_type=false;I.ref_node=false;A.drag_drop.marker.hide();return false}var M=A.inst[G.attr("id")];M.off_height();if(I.foreign===false&&I.origin_tree.container.get(0)!=M.container.get(0)&&(!I.origin_tree.settings.rules.multitree||!M.settings.rules.multitree)){if(I.drag_help.children("IMG").size()==0){I.drag_help.append("<img style='position:absolute; "+(I.origin_tree.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+I.origin_tree.settings.ui.theme_path+"remove.png' />")}I.move_type=false;I.ref_node=false;A.drag_drop.marker.hide();return false}if(I.scroll_time){clearTimeout(I.scroll_time)}I.scroll_time=setTimeout(function(){M.scrollCheck(C.pageX,C.pageY)},50);var P=false;var Q=G.scrollTop();var L=B(C.target);if(C.target.tagName=="A"){if(L.is("#dragged")){return false}if(M.get_node(C.target).hasClass("closed")){I.open_time=setTimeout(function(){M.open_branch(L)},500)}var D=0;var N=parseInt(B.curCSS(M.container.get(0),"borderTopWidth",true),10);if(N){D+=N}var F=parseInt(B.curCSS(M.container.get(0),"paddingTop",true),10);if(F){D+=F}var H=L.offset();var E={x:(H.left-1),y:(C.pageY-H.top)};if(G.hasClass("rtl")){E.x+=L.width()-8}var J=[];if(E.y<M.li_height/3+1){J=["before","inside","after"]}else{if(E.y>M.li_height*2/3-1){J=["after","inside","before"]}else{if(E.y<M.li_height/2){J=["inside","before","after"]}else{J=["inside","after","before"]}}}var K=false;B.each(J,function(R,S){if(M.checkMove(I.origin_tree.container.find("li.dragged"),L,S)){P=S;K=true;return false}});if(K){switch(P){case"before":E.y=H.top-2;if(G.hasClass("rtl")){A.drag_drop.marker.attr("src",M.settings.ui.theme_path+"marker_rtl.gif").width(40)}else{A.drag_drop.marker.attr("src",M.settings.ui.theme_path+"marker.gif").width(40)}break;case"after":E.y=H.top-2+M.li_height;if(G.hasClass("rtl")){A.drag_drop.marker.attr("src",M.settings.ui.theme_path+"marker_rtl.gif").width(40)}else{A.drag_drop.marker.attr("src",M.settings.ui.theme_path+"marker.gif").width(40)}break;case"inside":E.x-=2;if(G.hasClass("rtl")){E.x+=36}E.y=H.top-2+M.li_height/2;A.drag_drop.marker.attr("src",M.settings.ui.theme_path+"plus.gif").width(11);break}I.move_type=P;I.ref_node=B(C.target);I.drag_help.children("IMG").remove();A.drag_drop.marker.css({left:E.x,top:E.y}).show()}}if(C.target.tagName!="A"||!K){if(I.drag_help.children("IMG").size()==0){I.drag_help.append("<img style='position:absolute; "+(I.origin_tree.settings.ui.rtl?"right":"left")+":4px; top:0px; background:white; padding:2px;' src='"+I.origin_tree.settings.ui.theme_path+"remove.png' />")}I.move_type=false;I.ref_node=false;A.drag_drop.marker.hide()}C.preventDefault();C.stopPropagation();return false}return true}}return{cntr:++A.cntr,settings:{data:{type:"predefined",method:"GET",async:false,async_data:function(C){return{id:B(C).attr("id")||0}},url:false,json:false,xml:false},selected:false,opened:[],languages:[],path:false,cookies:false,ui:{dots:true,rtl:false,animation:0,hover_mode:true,scroll_spd:4,theme_path:false,theme_name:"default",context:[{id:"create",label:"Create",icon:"create.png",visible:function(C,D){if(C.length!=1){return false}return D.check("creatable",C)},action:function(C,D){D.create(false,D.get_node(C))}},"separator",{id:"rename",label:"Rename",icon:"rename.png",visible:function(C,D){if(C.length!=1){return false}return D.check("renameable",C)},action:function(C,D){D.rename(C)}},{id:"delete",label:"Delete",icon:"remove.png",visible:function(C,D){var E=true;B.each(C,function(){if(D.check("deletable",this)==false){E=false}return false});return E},action:function(C,D){B.each(C,function(){D.remove(this)})}}]},rules:{multiple:false,metadata:false,type_attr:"rel",multitree:false,createat:"bottom",use_inline:false,clickable:"all",renameable:"all",deletable:"all",creatable:"all",draggable:"none",dragrules:"all",drag_copy:false,droppable:[],drag_button:"left"},lang:{new_node:"New folder",loading:"Loading ..."},callback:{beforechange:function(C,D){return true},beforeopen:function(C,D){return true},beforeclose:function(C,D){return true},beforemove:function(C,E,F,D){return true},beforecreate:function(C,E,F,D){return true},beforerename:function(C,E,D){return true},beforedelete:function(C,D){return true},onselect:function(C,D){},ondeselect:function(C,D){},onchange:function(C,D){},onrename:function(C,E,D,F){},onmove:function(C,E,G,D,F){},oncopy:function(C,E,G,D,F){},oncreate:function(C,E,G,D,F){},ondelete:function(C,D,E){},onopen:function(C,D){},onopen_all:function(C){},onclose:function(C,D){},error:function(D,C){},ondblclk:function(C,D){D.toggle_branch.call(D,C);D.select_branch.call(D,C)},onrgtclk:function(C,D,E){},onload:function(C){},onfocus:function(C){},ondrop:function(C,E,F,D){}}},init:function(G,F){var I=this;this.container=B(G);if(this.container.size==0){alert("Invalid container node!");return }A.inst[this.cntr]=this;if(!this.container.attr("id")){this.container.attr("id","jstree_"+this.cntr)}A.inst[this.container.attr("id")]=A.inst[this.cntr];A.focused=this.cntr;if(F&&F.cookies){this.settings.cookies=B.extend({},this.settings.cookies,F.cookies);delete F.cookies;if(!this.settings.cookies.opts){this.settings.cookies.opts={}}}if(F&&F.callback){this.settings.callback=B.extend({},this.settings.callback,F.callback);delete F.callback}if(F&&F.data){this.settings.data=B.extend({},this.settings.data,F.data);delete F.data}if(F&&F.ui){this.settings.ui=B.extend({},this.settings.ui,F.ui);delete F.ui}if(F&&F.rules){this.settings.rules=B.extend({},this.settings.rules,F.rules);delete F.rules}if(F&&F.lang){this.settings.lang=B.extend({},this.settings.lang,F.lang);delete F.lang}this.settings=B.extend({},this.settings,F);if(this.settings.path==false){this.path="";B("script").each(function(){if(this.src.toString().match(/tree_component.*?js$/)){I.path=this.src.toString().replace(/tree_component.*?js$/,"")}})}else{this.path=this.settings.path}this.current_lang=this.settings.languages&&this.settings.languages.length?this.settings.languages[0]:false;if(this.settings.languages&&this.settings.languages.length){this.sn=get_sheet_num("tree_component.css");if(this.sn===false&&document.styleSheets.length){this.sn=document.styleSheets.length}var C=false;var H=this.container.attr("id")?"#"+this.container.attr("id"):".tree";for(var E=0;E<this.settings.languages.length;E++){C=add_css(H+" ."+this.settings.languages[E],this.sn);if(C!==false){if(this.settings.languages[E]==this.current_lang){C.style.display=""}else{C.style.display="none"}}}}if(this.settings.rules.droppable.length){for(var D in this.settings.rules.droppable){A.drag_drop.droppable.push(this.settings.rules.droppable[D])}A.drag_drop.droppable=B.unique(A.drag_drop.droppable)}if(this.settings.ui.theme_path===false){this.settings.ui.theme_path=this.path+"themes/"}this.theme=this.settings.ui.theme_path;if(I.settings.ui.theme_name){this.theme+=I.settings.ui.theme_name+"/";if(I.settings.ui.theme_name!="themeroller"&&!A.def_style){add_sheet(I.settings.ui.theme_path+"default/style.css","all",true);A.def_style=true}add_sheet(I.theme+"style.css")}this.container.addClass("tree");if(this.settings.ui.theme_name=="themeroller"){this.container.addClass("ui-widget ui-widget-content")}if(this.settings.ui.rtl){this.container.addClass("rtl")}if(this.settings.rules.multiple){this.selected_arr=[]}this.offset=false;if(this.settings.ui.dots==false){this.container.addClass("no_dots")}this.context_menu();this.hovered=false;this.locked=false;if(this.settings.rules.draggable!="none"&&A.drag_drop.marker===false){var I=this;A.drag_drop.marker=B("<img>").attr({id:"marker",src:I.settings.ui.theme_path+"marker.gif"}).css({height:"5px",width:"40px",display:"block",position:"absolute",left:"30px",top:"30px",zIndex:"1000"}).hide().appendTo("body")}this.refresh();this.attachEvents();this.focus()},off_height:function(){if(this.offset===false){this.container.css({position:"relative"});this.offset=this.container.offset();var C=0;C=parseInt(B.curCSS(this.container.get(0),"paddingTop",true),10);if(C){this.offset.top+=C}C=parseInt(B.curCSS(this.container.get(0),"borderTopWidth",true),10);if(C){this.offset.top+=C}this.container.css({position:""})}if(!this.li_height){var C=this.container.find("ul li.closed, ul li.leaf").eq(0);this.li_height=C.height();if(C.children("ul:eq(0)").size()){this.li_height-=C.children("ul:eq(0)").height()}if(!this.li_height){this.li_height=18}}},context_menu:function(){this.context=false;if(this.settings.ui.context!=false){var E='<div class="tree-default-context tree-'+this.settings.ui.theme_name+'-context">';for(var C in this.settings.ui.context){if(this.settings.ui.context[C]=="separator"){E+="<span class='separator'>&nbsp;</span>";continue}var D="";if(this.settings.ui.context[C].icon){D="background-image:url('"+(this.settings.ui.context[C].icon.indexOf("/")==-1?this.theme+this.settings.ui.context[C].icon:this.settings.ui.context[C].icon)+"');"}E+='<a rel="'+this.settings.ui.context[C].id+'" href="#" style="'+D+'">'+this.settings.ui.context[C].label+"</a>"}E+="</div>";this.context=B(E);this.context.hide();this.context.append=false}},refresh:function(G){if(this.locked){return this.error("LOCKED")}var I=this;this.opened=Array();if(this.settings.cookies&&B.cookie(this.settings.cookies.prefix+"_open")){var H=B.cookie(this.settings.cookies.prefix+"_open");var F=H.split(",");B.each(F,function(){I.opened.push("#"+this.replace(/^#/,""))});this.settings.opened=false}else{if(this.settings.opened!=false){B.each(this.settings.opened,function(J,K){I.opened.push("#"+this.replace(/^#/,""))});this.settings.opened=false}else{this.container.find("li.open").each(function(J){I.opened.push("#"+this.id)})}}if(this.selected){this.settings.selected=Array();if(this.selected_arr){B.each(this.selected_arr,function(){if(this.attr("id")){I.settings.selected.push("#"+this.attr("id"))}})}else{if(this.selected.attr("id")){this.settings.selected.push("#"+this.selected.attr("id"))}}}else{if(this.settings.cookies&&B.cookie(this.settings.cookies.prefix+"_selected")){this.settings.selected=Array();var H=B.cookie(this.settings.cookies.prefix+"_selected");var F=H.split(",");B.each(F,function(){I.settings.selected.push("#"+this.replace(/^#/,""))})}else{if(this.settings.selected!==false){var F=Array();if((typeof this.settings.selected).toLowerCase()=="object"){B.each(this.settings.selected,function(){if(this.replace(/^#/,"").length>0){F.push("#"+this.replace(/^#/,""))}})}else{if(this.settings.selected.replace(/^#/,"").length>0){F.push("#"+this.settings.selected.replace(/^#/,""))}}this.settings.selected=F}}}if(G&&this.settings.data.async){this.opened=Array();G=this.get_node(G);G.find("li.open").each(function(J){I.opened.push("#"+this.id)});if(G.hasClass("open")){this.close_branch(G,true)}if(G.hasClass("leaf")){G.removeClass("leaf")}G.children("ul:eq(0)").html("");return this.open_branch(G,true,function(){I.reselect.apply(I)})}var C="tree-default";if(this.settings.ui.theme_name!="default"){C+=" tree-"+I.settings.ui.theme_name}if(this.settings.ui.theme_name=="themeroller"){C="tree-themeroller"}if(this.settings.data.type=="xml_flat"||this.settings.data.type=="xml_nested"){this.scrtop=this.container.get(0).scrollTop;var E=(this.settings.data.type=="xml_flat")?"flat.xsl":"nested.xsl";if(this.settings.data.xml){this.container.getTransform(this.path+E,this.settings.data.xml,{params:{theme_name:C,theme_path:I.theme},meth:I.settings.data.method,dat:I.settings.data.async_data.apply(I,[G]),callback:function(){I.context_menu.apply(I);I.reselect.apply(I)}})}else{this.container.getTransform(this.path+E,this.settings.data.url,{params:{theme_name:C,theme_path:I.theme},meth:I.settings.data.method,dat:I.settings.data.async_data.apply(I,[G]),callback:function(){I.context_menu.apply(I);I.reselect.apply(I)}})}return }else{if(this.settings.data.type=="json"){if(this.settings.data.json){var H="";if(this.settings.data.json.length){for(var D=0;D<this.settings.data.json.length;D++){H+=this.parseJSON(this.settings.data.json[D])}}else{H=this.parseJSON(this.settings.data.json)}this.container.html("<ul class='"+C+"'>"+H+"</ul>");this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");this.container.find("li").not(".open").not(".closed").addClass("leaf");this.context_menu();this.reselect()}else{var I=this;B.ajax({type:this.settings.data.method,url:this.settings.data.url,data:this.settings.data.async_data(false),dataType:"json",success:function(K){var L="";if(K.length){for(var J=0;J<K.length;J++){L+=I.parseJSON(K[J])}}else{L=I.parseJSON(K)}I.container.html("<ul class='"+C+"'>"+L+"</ul>");I.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");I.container.find("li").not(".open").not(".closed").addClass("leaf");I.context_menu.apply(I);I.reselect.apply(I)},error:function(K,L,J){I.error(J+" "+L)}})}}else{this.container.children("ul:eq(0)").attr("class",C);this.container.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");this.container.find("li").not(".open").not(".closed").addClass("leaf");this.reselect()}}},parseJSON:function(G){if(!G||!G.data){return""}var I="";I+="<li ";var D=false;if(G.attributes){for(var F in G.attributes){if(F=="class"){I+=" class='"+G.attributes[F]+" ";if(G.state=="closed"||G.state=="open"){I+=" "+G.state+" "}I+="' ";D=true}else{I+=" "+F+"='"+G.attributes[F]+"' "}}}if(!D&&(G.state=="closed"||G.state=="open")){I+=" class='"+G.state+"' "}I+=">";if(this.settings.languages.length){for(var F=0;F<this.settings.languages.length;F++){var C={};C.href="#";C.style="";C["class"]=this.settings.languages[F];if(G.data[this.settings.languages[F]]&&(typeof G.data[this.settings.languages[F]].attributes).toLowerCase()!="undefined"){for(var E in G.data[this.settings.languages[F]].attributes){if(E=="style"||E=="class"){C[E]+=" "+G.data[this.settings.languages[F]].attributes[E]}else{C[E]=G.data[this.settings.languages[F]].attributes[E]}}}if(G.data[this.settings.languages[F]]&&G.data[this.settings.languages[F]].icon&&this.settings.theme_name!="themeroller"){var H=G.data[this.settings.languages[F]].icon.indexOf("/")==-1?this.theme+G.data[this.settings.languages[F]].icon:G.data[this.settings.languages[F]].icon;C.style+=" ; background-image:url('"+H+"'); "}I+="<a";for(var E in C){I+=" "+E+'="'+C[E]+'" '}I+=">";if(G.data[this.settings.languages[F]]&&G.data[this.settings.languages[F]].icon&&this.settings.theme_name=="themeroller"){I+="<ins class='ui-icon "+G.data[this.settings.languages[F]].icon+"'>&nbsp;</ins>"}I+=((typeof G.data[this.settings.languages[F]].title).toLowerCase()!="undefined"?G.data[this.settings.languages[F]].title:G.data[this.settings.languages[F]])+"</a>"}}else{var C={};C.href="#";C.style="";C["class"]="";if((typeof G.data.attributes).toLowerCase()!="undefined"){for(var F in G.data.attributes){if(F=="style"||F=="class"){C[F]+=" "+G.data.attributes[F]}else{C[F]=G.data.attributes[F]}}}if(G.data.icon&&this.settings.ui.theme_name!="themeroller"){var H=G.data.icon.indexOf("/")==-1?this.theme+G.data.icon:G.data.icon;C.style+=" ; background-image:url('"+H+"');"}I+="<a";for(var F in C){I+=" "+F+'="'+C[F]+'" '}I+=">";if(G.data.icon&&this.settings.ui.theme_name=="themeroller"){I+="<ins class='ui-icon "+G.data.icon+"'>&nbsp;</ins>"}I+=((typeof G.data.title).toLowerCase()!="undefined"?G.data.title:G.data)+"</a>"}if(G.children&&G.children.length){I+="<ul>";for(var F=0;F<G.children.length;F++){I+=this.parseJSON(G.children[F])}I+="</ul>"}I+="</li>";return I},getJSON:function(O,J,L,C){var K=this;if(!O||B(O).size()==0){O=this.container.children("ul").children("li")}else{O=B(O)}if(O.size()>1){var I=[];O.each(function(){I.push(K.getJSON(this,J,L,C))});return I}if(!J){J=["id","rel","class"]}if(!L){L=[]}var G={attributes:{},data:false};for(var H in J){var D=(J[H]=="class")?O.attr(J[H]).replace("last","").replace("leaf","").replace("closed","").replace("open",""):O.attr(J[H]);if(typeof D!="undefined"&&D.replace(" ","").length>0){G.attributes[J[H]]=D}delete D}if(this.settings.languages.length){G.data={};for(var H in this.settings.languages){var M=O.children("a."+this.settings.languages[H]);if(C||L.length||M.get(0).style.backgroundImage.toString().length){G.data[this.settings.languages[H]]={};G.data[this.settings.languages[H]].title=M.text();if(M.get(0).style.backgroundImage.length){G.data[this.settings.languages[H]].icon=M.get(0).style.backgroundImage.replace("url(","").replace(")","")}if(this.settings.ui.theme_name=="themeroller"&&M.children("ins").size()){var F=M.children("ins").attr("class");var N=false;B.each(F.split(" "),function(P,Q){if(Q.indexOf("ui-icon-")==0){N=Q;return false}});if(N){G.data[this.settings.languages[H]].icon=N}}if(L.length){G.data[this.settings.languages[H]].attributes={};for(var E in L){var D=M.attr(L[E]);if(typeof D!="undefined"&&D.replace(" ","").length>0){G.data[this.settings.languages[H]].attributes[L[E]]=D}delete D}}}else{G.data[this.settings.languages[H]]=M.text()}}}else{var M=O.children("a");if(C||L.length||M.get(0).style.backgroundImage.toString().length){G.data={};G.data.title=M.text();if(M.get(0).style.backgroundImage.length){G.data.icon=M.get(0).style.backgroundImage.replace("url(","").replace(")","")}if(this.settings.ui.theme_name=="themeroller"&&M.children("ins").size()){var F=M.children("ins").attr("class");var N=false;B.each(F.split(" "),function(P,Q){if(Q.indexOf("ui-icon-")==0){N=Q;return false}});if(N){G.data[this.settings.languages[H]].icon=N}}if(L.length){G.data.attributes={};for(var E in L){var D=M.attr(L[E]);if(typeof D!="undefined"&&D.replace(" ","").length>0){G.data.attributes[L[E]]=D}delete D}}}else{G.data=M.text()}}if(O.children("ul").size()>0){G.children=[];O.children("ul").children("li").each(function(){G.children.push(K.getJSON(this,J,L,C))})}return G},getXML:function(N,P,I,K,D){var J=this;if(N!="flat"){N="nested"}if(!P||B(P).size()==0){P=this.container.children("ul").children("li")}else{P=B(P)}if(P.size()>1){var H="<root>";P.each(function(){H+=J.getXML(N,this,I,K,true)});H+="</root>";return H}if(!I){I=["id","rel","class"]}if(!K){K=[]}var H="";if(!D){H="<root>"}H+="<item ";if(N=="flat"){var L=P.parents("li:eq(0)").size()?P.parents("li:eq(0)").attr("id"):0;H+=' parent_id="'+L+'" ';delete L}for(var G in I){var C=(I[G]=="class")?P.attr(I[G]).replace("last","").replace("leaf","").replace("closed","").replace("open",""):P.attr(I[G]);if(typeof C!="undefined"&&C.replace(" ","").length>0){H+=" "+I[G]+'="'+C+'" '}delete C}H+=">";H+="<content>";if(this.settings.languages.length){for(var G in this.settings.languages){var M=P.children("a."+this.settings.languages[G]);H+="<name ";if(K.length||M.get(0).style.backgroundImage.toString().length||this.settings.ui.theme_name=="themeroller"){if(M.get(0).style.backgroundImage.length){H+=' icon="'+M.get(0).style.backgroundImage.replace("url(","").replace(")","")+'" '}if(this.settings.ui.theme_name=="themeroller"&&M.children("ins").size()){var F=M.children("ins").attr("class");var O=false;B.each(F.split(" "),function(Q,R){if(R.indexOf("ui-icon-")==0){O=R;return false}});if(O){H+=' icon="'+O+'" '}}if(K.length){for(var E in K){var C=M.attr(K[E]);if(typeof C!="undefined"&&C.replace(" ","").length>0){H+=" "+K[E]+'="'+C+'" '}delete C}}}H+="><![CDATA["+M.text()+"]]></name>"}}else{var M=P.children("a");H+="<name ";if(K.length||M.get(0).style.backgroundImage.toString().length||this.settings.ui.theme_name=="themeroller"){if(M.get(0).style.backgroundImage.length){H+=' icon="'+M.get(0).style.backgroundImage.replace("url(","").replace(")","")+'" '}if(this.settings.ui.theme_name=="themeroller"&&M.children("ins").size()){var F=M.children("ins").attr("class");var O=false;B.each(F.split(" "),function(Q,R){if(R.indexOf("ui-icon-")==0){O=R;return false}});if(O){H+=' icon="'+O+'" '}}if(K.length){for(var E in K){var C=M.attr(K[E]);if(typeof C!="undefined"&&C.replace(" ","").length>0){H+=" "+K[E]+'="'+C+'" '}delete C}}}H+="><![CDATA["+M.text()+"]]></name>"}H+="</content>";if(N=="flat"){H+="</item>"}if(P.children("ul").size()>0){P.children("ul").children("li").each(function(){H+=J.getXML(N,this,I,K,true)})}if(N=="nested"){H+="</item>"}if(!D){H+="</root>"}return H},focus:function(){if(this.locked){return false}if(A.focused!=this.cntr){A.focused=this.cntr;this.settings.callback.onfocus.call(null,this)}},show_context:function(E,C,F){var D=this.context.show().offsetParent();if(D.is("html")){D=B("body")}D=D.offset();this.context.css({left:(C-D.left-(this.settings.ui.rtl?B(this.context).width():0)),top:(F-D.top+(B.browser.opera?this.container.scrollTop():0)+0)})},hide_context:function(){if(this.context.remove&&this.context.apply_to){this.context.apply_to.children("a").removeClass("clicked")}this.context.apply_to=false;this.context.hide()},attachEvents:function(){var C=this;this.container.bind("mousedown",function(D){if(A.drag_drop.isdown){A.drag_drop.move_type=false;D.preventDefault();D.stopPropagation();D.stopImmediatePropagation();return false}}).bind("mouseup",function(D){setTimeout(function(){C.focus.apply(C)},5)}).bind("click",function(D){return true});B("#"+this.container.attr("id")+" li").live("click",function(D){if(D.target.tagName!="LI"){return true}C.off_height();if(D.pageY-B(D.target).offset().top>C.li_height){return true}C.toggle_branch.apply(C,[D.target]);D.stopPropagation();return false});B("#"+this.container.attr("id")+" li a").live("click",function(D){if(D.which&&D.which==3){return true}if(C.locked){D.preventDefault();D.target.blur();return C.error("LOCKED")}C.select_branch.apply(C,[D.target,D.ctrlKey||C.settings.rules.multiple=="on"]);if(C.inp){C.inp.blur()}D.preventDefault();D.target.blur();return false}).live("dblclick",function(D){if(C.locked){D.preventDefault();D.stopPropagation();D.target.blur();return C.error("LOCKED")}C.settings.callback.ondblclk.call(null,C.get_node(D.target).get(0),C);D.preventDefault();D.stopPropagation();D.target.blur()}).live("contextmenu",function(F){if(C.locked){F.target.blur();return C.error("LOCKED")}var I=C.settings.callback.onrgtclk.call(null,C.get_node(F.target).get(0),C,F);if(C.context){if(C.context.append==false){B("body").append(C.context);C.context.append=true;for(var D in C.settings.ui.context){if(C.settings.ui.context[D]=="separator"){continue}(function(){var J=C.settings.ui.context[D].action;C.context.children("[rel="+C.settings.ui.context[D].id+"]").bind("click",function(K){if(!B(this).hasClass("disabled")){J.call(null,C.context.apply_to||null,C);C.hide_context()}K.stopPropagation();K.preventDefault();return false}).bind("mouseup",function(K){this.blur();if(B(this).hasClass("disabled")){K.stopPropagation();K.preventDefault();return false}}).bind("mousedown",function(K){K.stopPropagation();K.preventDefault()})})()}}var H=C.get_node(F.target);if(C.inp){C.inp.blur()}if(H){if(!H.children("a:eq(0)").hasClass("clicked")){C.context.apply_to=H;C.context.remove=true;C.context.apply_to.children("a").addClass("clicked");F.target.blur()}else{C.context.remove=false;C.context.apply_to=C.selected_arr||C.selected}C.context.children("a").removeClass("disabled").show();var E=false;for(var D in C.settings.ui.context){if(C.settings.ui.context[D]=="separator"){continue}var G=C.settings.ui.context[D].visible.call(null,C.context.apply_to,C);if(G===false){C.context.children("[rel="+C.settings.ui.context[D].id+"]").addClass("disabled")}if(G===-1){C.context.children("[rel="+C.settings.ui.context[D].id+"]").hide()}else{E=true}}if(E==true){C.show_context(H,F.pageX,F.pageY)}F.preventDefault();F.stopPropagation();return false}}return I}).live("mouseover",function(D){if(C.locked){D.preventDefault();D.stopPropagation();return C.error("LOCKED")}if((C.settings.ui.hover_mode||C.settings.ui.theme_name=="themeroller")&&C.hovered!==false&&D.target.tagName=="A"){C.hovered.children("a").removeClass("hover ui-state-hover");C.hovered=false}if(C.settings.ui.theme_name=="themeroller"){C.hover_branch.apply(C,[D.target])}});if(C.settings.ui.theme_name=="themeroller"){B("#"+this.container.attr("id")+" li a").live("mouseout",function(D){if(C.hovered){C.hovered.children("a").removeClass("hover ui-state-hover")}})}if(this.settings.rules.draggable!="none"){B("#"+this.container.attr("id")+" li a").live("mousedown",function(F){if(C.settings.rules.drag_button=="left"&&F.which&&F.which!=1){return false}if(C.settings.rules.drag_button=="right"&&F.which&&F.which!=3){return false}C.focus.apply(C);if(C.locked){return C.error("LOCKED")}var G=C.get_node(F.target);if(C.settings.rules.multiple!=false&&C.selected_arr.length>1&&G.children("a:eq(0)").hasClass("clicked")){var D=0;for(var E in C.selected_arr){if(C.check("draggable",C.selected_arr[E])){C.selected_arr[E].addClass("dragged");A.drag_drop.origin_tree=C;D++}}if(D>0){if(C.check("draggable",G)){A.drag_drop.drag_node=G}else{A.drag_drop.drag_node=C.container.find("li.dragged:eq(0)")}A.drag_drop.isdown=true;A.drag_drop.drag_help=B(A.drag_drop.drag_node.get(0).cloneNode(true));A.drag_drop.drag_help.attr("id","dragged");A.drag_drop.drag_help.children("a").html("Multiple selection").end().children("ul").remove()}}else{if(C.check("draggable",G)){A.drag_drop.drag_node=G;A.drag_drop.drag_help=B(G.get(0).cloneNode(true));A.drag_drop.drag_help.attr("id","dragged");A.drag_drop.isdown=true;A.drag_drop.foreign=false;A.drag_drop.origin_tree=C;G.addClass("dragged")}}A.drag_drop.init_x=F.pageX;A.drag_drop.init_y=F.pageY;G.blur();F.preventDefault();F.stopPropagation();return false});B(document).bind("mousedown",A.mousedown).bind("mouseup",A.mouseup).bind("mousemove",A.mousemove)}if(C.context){B(document).bind("mousedown",function(){C.hide_context()})}},checkMove:function(L,D,J){if(this.locked){return this.error("LOCKED")}var I=this;if(D.parents("li.dragged").size()>0||D.is(".dragged")){return this.error("MOVE: NODE OVER SELF")}if(L.size()==1){var E=L.eq(0);if(A.drag_drop.foreign){if(this.settings.rules.droppable.length==0){return false}if(!E.is("."+this.settings.rules.droppable.join(", ."))){return false}var K=false;for(var H in this.settings.rules.droppable){if(E.is("."+this.settings.rules.droppable[H])){if(this.settings.rules.metadata){B.metadata.setType("attr",this.settings.rules.metadata);E.attr(this.settings.rules.metadata,"type: '"+this.settings.rules.droppable[H]+"'")}else{E.attr(this.settings.rules.type_attr,this.settings.rules.droppable[H])}K=true;break}}if(!K){return false}}if(!this.check("dragrules",[E,J,D.parents("li:eq(0)")])){return this.error("MOVE: AGAINST DRAG RULES")}}else{var K=true;L.each(function(N){if(K==false){return false}var O=D;var M=J;if(!I.check.apply(I,["dragrules",[B(this),M,O]])){K=false}});if(K==false){return this.error("MOVE: AGAINST DRAG RULES")}}if(this.settings.rules.use_inline&&this.settings.rules.metadata){var F=false;if(J=="inside"){F=D.parents("li:eq(0)")}else{F=D.parents("li:eq(1)")}if(F.size()){if(typeof F.metadata()["valid_children"]!="undefined"){var G=F.metadata()["valid_children"];var K=true;L.each(function(M){if(K==false){return false}if(B.inArray(I.get_type(this),G)==-1){K=false}});if(K==false){return this.error("MOVE: NOT A VALID CHILD")}}if(typeof F.metadata()["max_children"]!="undefined"){if((F.children("ul:eq(0)").children("li").not(".dragged").size()+L.size())>F.metadata().max_children){return this.error("MOVE: MAX CHILDREN REACHED")}}var C=0;L.each(function(M){var O=1;var N=B(this);while(O<100){N=N.children("ul").children("li");if(N.size()==0){break}O++}C=Math.max(O,C)});var K=true;if((typeof B(F).metadata().max_depth).toLowerCase()!="undefined"&&B(F).metadata().max_depth<C){K=false}else{F.parents("li").each(function(M){if(K==false){return false}if((typeof B(this).metadata().max_depth).toLowerCase()!="undefined"){if((M+C)>=B(this).metadata().max_depth){K=false}}})}if(K==false){return this.error("MOVE: MAX_DEPTH REACHED")}}}return true},reselect:function(){var F=this;if(this.opened&&this.opened.length){var E=false;for(var C=0;C<this.opened.length;C++){if(this.settings.data.async){if(this.get_node(this.opened[C]).size()>0){E=true;var D=this.opened[C];delete this.opened[C];this.open_branch(D,true,function(){F.reselect.apply(F)})}}else{this.open_branch(this.opened[C],true)}}if(this.settings.data.async&&E){return }delete this.opened}if(this.scrtop){this.container.scrollTop(F.scrtop);delete this.scrtop}if(this.settings.selected!==false){B.each(this.settings.selected,function(G){F.select_branch(B(F.settings.selected[G],F.container),(F.settings.rules.multiple!==false&&G>0))});this.settings.selected=false}if(this.settings.ui.theme_name=="themeroller"){this.container.find("a").addClass("ui-state-default")}this.settings.callback.onload.call(null,F)},get_node:function(C){var C=B(C);return C.is("li")?C:C.parents("li:eq(0)")},get_type:function(D){D=!D?this.selected:this.get_node(D);if(!D){return }if(this.settings.rules.metadata){B.metadata.setType("attr",this.settings.rules.metadata);var C=D.metadata().type;if(C){return C}}return D.attr(this.settings.rules.type_attr)},scrollCheck:function(D,J){var I=this;var F=I.container;var H=I.container.offset();var E=F.scrollTop();var C=F.scrollLeft();var G=(F.get(0).scrollWidth>F.width())?40:20;if(J-H.top<20){F.scrollTop(Math.max((E-I.settings.ui.scroll_spd),0))}if(F.height()-(J-H.top)<G){F.scrollTop(E+I.settings.ui.scroll_spd)}if(D-H.left<20){F.scrollLeft(Math.max((C-I.settings.ui.scroll_spd),0))}if(F.width()-(D-H.left)<40){F.scrollLeft(C+I.settings.ui.scroll_spd)}if(F.scrollLeft()!=C||F.scrollTop()!=E){I.moveType=false;I.moveRef=false;A.drag_drop.marker.hide()}A.drag_drop.scroll_time=setTimeout(function(){I.scrollCheck(D,J)},50)},check:function(I,C){if(this.locked){return this.error("LOCKED")}if(I!="dragrules"&&this.settings.rules.use_inline&&this.settings.rules.metadata){B.metadata.setType("attr",this.settings.rules.metadata);if(typeof this.get_node(C).metadata()[I]!="undefined"){return this.get_node(C).metadata()[I]}}if(!this.settings.rules[I]){return false}if(this.settings.rules[I]=="none"){return false}if(this.settings.rules[I]=="all"){return true}if(I=="dragrules"){var H=new Array();H[0]=this.get_type(C[0]);H[1]=C[1];H[2]=this.get_type(C[2]);for(var F=0;F<this.settings.rules.dragrules.length;F++){var G=this.settings.rules.dragrules[F];var J=(G.indexOf("!")===0)?false:true;if(!J){G=G.replace("!","")}var E=G.split(" ");for(var D=0;D<3;D++){if(E[D]==H[D]||E[D]=="*"){E[D]=true}}if(E[0]===true&&E[1]===true&&E[2]===true){return J}}return false}else{return(B.inArray(this.get_type(C),this.settings.rules[I])!=-1)?true:false}},hover_branch:function(G){if(this.locked){return this.error("LOCKED")}if(this.settings.ui.hover_mode==false&&this.settings.theme_name!="themeroller"){return this.select_branch(G)}var H=this;var G=H.get_node(G);if(!G.size()){return this.error("HOVER: NOT A VALID NODE")}if(!H.check("clickable",G)){return this.error("SELECT: NODE NOT SELECTABLE")}if(this.hovered){this.hovered.children("A").removeClass("hover ui-state-hover")}this.hovered=G;this.hovered.children("a").removeClass("hover ui-state-hover").addClass(this.settings.ui.theme_name=="themeroller"?"hover ui-state-hover":"hover");var D=this.hovered.offset().top;var C=this.container.offset().top;var E=C+this.container.height();var F=(this.container.get(0).scrollWidth>this.container.width())?40:20;if(D+5<C){this.container.scrollTop(this.container.scrollTop()-(C-D+5))}if(D+F>E){this.container.scrollTop(this.container.scrollTop()+(D+F-E))}},select_branch:function(I,C){if(this.locked){return this.error("LOCKED")}if(!I&&this.hovered!==false){I=this.hovered}var J=this;I=J.get_node(I);if(!I.size()){return this.error("SELECT: NOT A VALID NODE")}I.children("a").removeClass("hover ui-state-hover");if(!J.check("clickable",I)){return this.error("SELECT: NODE NOT SELECTABLE")}if(J.settings.callback.beforechange.call(null,I.get(0),J)===false){return this.error("SELECT: STOPPED BY USER")}if(this.settings.rules.multiple!=false&&C&&I.children("a.clicked").size()>0){return this.deselect_branch(I)}if(this.settings.rules.multiple!=false&&C){this.selected_arr.push(I)}if(this.settings.rules.multiple!=false&&!C){for(var G in this.selected_arr){this.selected_arr[G].children("A").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,this.selected_arr[G].get(0),J)}this.selected_arr=[];this.selected_arr.push(I);if(this.selected&&this.selected.children("A").hasClass("clicked")){this.selected.children("A").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,this.selected.get(0),J)}}if(!this.settings.rules.multiple){if(this.selected){this.selected.children("A").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,this.selected.get(0),J)}}this.selected=I;if((this.settings.ui.hover_mode||this.settings.ui.theme_name=="themeroller")&&this.hovered!==false){this.hovered.children("A").removeClass("hover ui-state-hover");this.hovered=I}this.selected.children("a").removeClass("clicked ui-state-active").addClass(this.settings.ui.theme_name=="themeroller"?"clicked ui-state-active":"clicked").end().parents("li.closed").each(function(){J.open_branch(this,true)});var E=this.selected.offset().top;var D=this.container.offset().top;var F=D+this.container.height();var H=(this.container.get(0).scrollWidth>this.container.width())?40:20;if(E+5<D){this.container.scrollTop(this.container.scrollTop()-(D-E+5))}if(E+H>F){this.container.scrollTop(this.container.scrollTop()+(E+H-F))}this.set_cookie("selected");this.settings.callback.onselect.call(null,this.selected.get(0),J);this.settings.callback.onchange.call(null,this.selected.get(0),J)},deselect_branch:function(C){if(this.locked){return this.error("LOCKED")}var D=this;var C=this.get_node(C);C.children("a").removeClass("clicked ui-state-active");this.settings.callback.ondeselect.call(null,C.get(0),D);if(this.settings.rules.multiple!=false&&this.selected_arr.length>1){this.selected_arr=[];this.container.find("a.clicked").filter(":first-child").parent().each(function(){D.selected_arr.push(B(this))});if(C.get(0)==this.selected.get(0)){this.selected=this.selected_arr[0];this.set_cookie("selected")}}else{if(this.settings.rules.multiple!=false){this.selected_arr=[]}this.selected=false;this.set_cookie("selected")}if(this.selected){this.settings.callback.onchange.call(null,this.selected.get(0),D)}else{this.settings.callback.onchange.call(null,false,D)}},toggle_branch:function(C){if(this.locked){return this.error("LOCKED")}var C=this.get_node(C);if(C.hasClass("closed")){return this.open_branch(C)}if(C.hasClass("open")){return this.close_branch(C)}},open_branch:function(E,C,G){if(this.locked){return this.error("LOCKED")}var E=this.get_node(E);if(!E.size()){return this.error("OPEN: NO SUCH NODE")}if(E.hasClass("leaf")){return this.error("OPEN: OPENING LEAF NODE")}if(this.settings.data.async&&E.find("li").size()==0){if(this.settings.callback.beforeopen.call(null,E.get(0),this)===false){return this.error("OPEN: STOPPED BY USER")}var F=this;E.children("ul:eq(0)").remove().end().append("<ul><li class='last'><a class='loading' href='#'>"+(F.settings.lang.loading||"Loading ...")+"</a></li></ul>");E.removeClass("closed").addClass("open");if(this.settings.data.type=="xml_flat"||this.settings.data.type=="xml_nested"){var D=(this.settings.data.type=="xml_flat")?"flat.xsl":"nested.xsl";E.children("ul:eq(0)").getTransform(this.path+D,this.settings.data.url,{params:{theme_path:F.theme},meth:this.settings.data.method,dat:this.settings.data.async_data(E),repl:true,callback:function(I,H){if(I.length<15){E.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove();if(G){G.call()}return }F.open_branch.apply(F,[E]);if(G){G.call()}}})}else{B.ajax({type:this.settings.data.method,url:this.settings.data.url,data:this.settings.data.async_data(E),dataType:"json",success:function(I,K){if(!I||I.length==0){E.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove();if(G){G.call()}return }var J="";if(I.length){for(var H=0;H<I.length;H++){J+=F.parseJSON(I[H])}}else{J=F.parseJSON(I)}if(J.length>0){E.children("ul:eq(0)").replaceWith("<ul>"+J+"</ul>");E.find("li:last-child").addClass("last").end().find("li:has(ul)").not(".open").addClass("closed");E.find("li").not(".open").not(".closed").addClass("leaf");F.open_branch.apply(F,[E])}else{E.removeClass("closed").removeClass("open").addClass("leaf").children("ul").remove()}if(G){G.call()}}})}return true}else{if(!this.settings.data.async){if(this.settings.callback.beforeopen.call(null,E.get(0),this)===false){return this.error("OPEN: STOPPED BY USER")}}if(this.settings.ui.theme_name=="themeroller"){E.find("a").not(".ui-state-default").addClass("ui-state-default")}if(parseInt(this.settings.ui.animation)>0&&!C){E.children("ul:eq(0)").css("display","none");E.removeClass("closed").addClass("open");E.children("ul:eq(0)").slideDown(parseInt(this.settings.ui.animation),function(){B(this).css("display","");if(G){G.call()}})}else{E.removeClass("closed").addClass("open");if(G){G.call()}}this.set_cookie("open");this.settings.callback.onopen.call(null,E.get(0),this);return true}},close_branch:function(D,C){if(this.locked){return this.error("LOCKED")}var E=this;var D=this.get_node(D);if(!D.size()){return this.error("CLOSE: NO SUCH NODE")}if(E.settings.callback.beforeclose.call(null,D.get(0),E)===false){return this.error("CLOSE: STOPPED BY USER")}if(parseInt(this.settings.ui.animation)>0&&!C&&D.children("ul:eq(0)").size()==1){D.children("ul:eq(0)").slideUp(parseInt(this.settings.ui.animation),function(){if(D.hasClass("open")){D.removeClass("open").addClass("closed")}E.set_cookie("open");B(this).css("display","")})}else{if(D.hasClass("open")){D.removeClass("open").addClass("closed")}this.set_cookie("open")}if(this.selected&&D.children("ul:eq(0)").find("a.clicked").size()>0){D.find("li:has(a.clicked)").each(function(){E.deselect_branch(this)});if(D.children("a.clicked").size()==0){this.select_branch(D,(this.settings.rules.multiple!=false&&this.selected_arr.length>0))}}this.settings.callback.onclose.call(null,D.get(0),this)},open_all:function(D,F){if(this.locked){return this.error("LOCKED")}var E=this;D=D?B(D):this.container;var C=D.find("li.closed").size();if(!F){this.cl_count=0}else{this.cl_count--}if(C>0){this.cl_count+=C;D.find("li.closed").each(function(){var G=this;E.open_branch.apply(E,[this,true,function(){E.open_all.apply(E,[G,true])}])})}else{if(this.cl_count==0){this.settings.callback.onopen_all.call(null,this)}}},close_all:function(){if(this.locked){return this.error("LOCKED")}var C=this;this.container.find("li.open").each(function(){C.close_branch(this,true)})},show_lang:function(D){if(this.locked){return this.error("LOCKED")}if(this.settings.languages[D]==this.current_lang){return true}var C=false;var E=this.container.attr("id")?"#"+this.container.attr("id"):".tree";C=get_css(E+" ."+this.current_lang,this.sn);if(C!==false){C.style.display="none"}C=get_css(E+" ."+this.settings.languages[D],this.sn);if(C!==false){C.style.display=""}this.current_lang=this.settings.languages[D];return true},cycle_lang:function(){if(this.locked){return this.error("LOCKED")}var C=B.inArray(this.current_lang,this.settings.languages);C++;if(C>this.settings.languages.length-1){C=0}this.show_lang(C)},create:function(C,H,F){if(this.locked){return this.error("LOCKED")}var L=false;if(H==-1){L=true;H=this.container}else{H=H?this.get_node(H):this.selected}if(!L&&(!H||!H.size())){return this.error("CREATE: NO NODE SELECTED")}var D=H;if(F=="before"){F=H.parent().children().index(H);H=H.parents("li:eq(0)")}if(F=="after"){F=H.parent().children().index(H)+1;H=H.parents("li:eq(0)")}if(!L&&H.size()==0){L=true;H=this.container}if(!L){if(!this.check("creatable",H)){return this.error("CREATE: CANNOT CREATE IN NODE")}if(H.hasClass("closed")){if(this.settings.data.async&&H.children("ul").size()==0){var G=this;return this.open_branch(H,true,function(){G.create.apply(G,[C,H,F])})}else{this.open_branch(H,true)}}}var I=false;if(!C){C={}}if(!C.attributes){C.attributes={}}if(this.settings.rules.metadata){if(!C.attributes[this.settings.rules.metadata]){C.attributes[this.settings.rules.metadata]='{ "type" : "'+(this.get_type(D)||"")+'" }'}}else{if(!C.attributes[this.settings.rules.type_attr]){C.attributes[this.settings.rules.type_attr]=this.get_type(D)||""}}if(this.settings.languages.length){if(!C.data){C.data={};I=true}for(var E=0;E<this.settings.languages.length;E++){if(!C.data[this.settings.languages[E]]){C.data[this.settings.languages[E]]=((typeof this.settings.lang.new_node).toLowerCase()!="string"&&this.settings.lang.new_node[E])?this.settings.lang.new_node[E]:this.settings.lang.new_node}}}else{if(!C.data){C.data=this.settings.lang.new_node;I=true}}var J=B(this.parseJSON(C));J.addClass("leaf");if(!L&&this.settings.rules.use_inline&&this.settings.rules.metadata){var N=this.get_type(J)||"";B.metadata.setType("attr",this.settings.rules.metadata);if(typeof H.metadata()["valid_children"]!="undefined"){if(B.inArray(N,H.metadata()["valid_children"])==-1){return this.error("CREATE: NODE NOT A VALID CHILD")}}if(typeof H.metadata()["max_children"]!="undefined"){if((H.children("ul:eq(0)").children("li").size()+1)>H.metadata().max_children){return this.error("CREATE: MAX_CHILDREN REACHED")}}var K=true;if((typeof B(H).metadata().max_depth).toLowerCase()!="undefined"&&B(H).metadata().max_depth===0){K=false}else{H.parents("li").each(function(O){if(B(this).metadata().max_depth){if((O+1)>=B(this).metadata().max_depth){K=false;return false}}})}if(!K){return this.error("CREATE: MAX_DEPTH REACHED")}}if((typeof F).toLowerCase()=="undefined"||F=="inside"){F=(this.settings.rules.createat=="top")?0:H.children("ul:eq(0)").children("li").size()}if(H.children("ul").size()==0||(L==true&&H.children("ul").children("li").size()==0)){if(!L){var M=this.moved(J,H.children("a:eq(0)"),"inside",true)}else{var M=this.moved(J,this.container.children("ul:eq(0)"),"inside",true)}}else{if(H.children("ul:eq(0)").children("li:nth-child("+(F+1)+")").size()){var M=this.moved(J,H.children("ul:eq(0)").children("li:nth-child("+(F+1)+")").children("a:eq(0)"),"before",true)}else{var M=this.moved(J,H.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after",true)}}if(M===false){return this.error("CREATE: ABORTED")}this.select_branch(J.children("a:eq(0)"));if(I){this.rename()}return J},rename:function(E){if(this.locked){return this.error("LOCKED")}E=E?this.get_node(E):this.selected;var F=this;if(!E||!E.size()){return this.error("RENAME: NO NODE SELECTED")}if(!this.check("renameable",E)){return this.error("RENAME: NODE NOT RENAMABLE")}if(!this.settings.callback.beforerename.call(null,E.get(0),F.current_lang,F)){return this.error("RENAME: STOPPED BY USER")}E.parents("li.closed").each(function(){F.open_branch(this)});if(this.current_lang){E=E.find("a."+this.current_lang).get(0)}else{E=E.find("a:first").get(0)}last_value=E.innerHTML;F.inp=B("<input type='text' autocomplete='off' />");F.inp.val(last_value.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")).bind("mousedown",function(G){G.stopPropagation()}).bind("mouseup",function(G){G.stopPropagation()}).bind("click",function(G){G.stopPropagation()}).bind("keyup",function(H){var G=H.keyCode||H.which;if(G==27){this.value=last_value;this.blur();return }if(G==13){this.blur();return }});var D={};D[this.container.attr("id")]=this.get_rollback();F.inp.blur(function(G){if(this.value==""){this.value=last_value}B(E).text(B(E).parent().find("input").eq(0).attr("value")).get(0).style.display="";B(E).prevAll("span").remove();F.settings.callback.onrename.call(null,F.get_node(E).get(0),F.current_lang,F,D);F.inp=false});var C=B("<span />").addClass(E.className).append(F.inp);C.attr("style",B(E).attr("style"));E.style.display="none";B(E).parent().prepend(C);F.inp.get(0).focus();F.inp.get(0).select()},remove:function(F){if(this.locked){return this.error("LOCKED")}var E={};E[this.container.attr("id")]=this.get_rollback();if(F&&(!this.selected||this.get_node(F).get(0)!=this.selected.get(0))){F=this.get_node(F);if(F.size()){if(!this.check("deletable",F)){return this.error("DELETE: NODE NOT DELETABLE")}if(!this.settings.callback.beforedelete.call(null,F.get(0),G)){return this.error("DELETE: STOPPED BY USER")}$parent=F.parent();F=F.remove();$parent.children("li:last").addClass("last");if($parent.children("li").size()==0){$li=$parent.parents("li:eq(0)");$li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();this.set_cookie("open")}this.settings.callback.ondelete.call(null,F.get(0),this,E)}}else{if(this.selected){if(!this.check("deletable",this.selected)){return this.error("DELETE: NODE NOT DELETABLE")}if(!this.settings.callback.beforedelete.call(null,this.selected.get(0),G)){return this.error("DELETE: STOPPED BY USER")}$parent=this.selected.parent();var F=this.selected;if(this.settings.rules.multiple==false||this.selected_arr.length==1){var D=true;var C=(this.selected.prev("li:eq(0)").size())?this.selected.prev("li:eq(0)"):this.selected.parents("li:eq(0)")}F=F.remove();$parent.children("li:last").addClass("last");if($parent.children("li").size()==0){$li=$parent.parents("li:eq(0)");$li.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();this.set_cookie("open")}this.settings.callback.ondelete.call(null,F.get(0),this,E);if(D&&C){this.select_branch(C)}if(this.settings.rules.multiple!=false&&!D){var G=this;this.selected_arr=[];this.container.find("a.clicked").filter(":first-child").parent().each(function(){G.selected_arr.push(B(this))});if(this.selected_arr.length>0){this.selected=this.selected_arr[0];this.remove()}}}else{return this.error("DELETE: NO NODE SELECTED")}}},get_next:function(C){var D=this.hovered||this.selected;if(D){if(D.hasClass("open")){return C?this.select_branch(D.find("li:eq(0)")):this.hover_branch(D.find("li:eq(0)"))}else{if(B(D).nextAll("li").size()>0){return C?this.select_branch(D.nextAll("li:eq(0)")):this.hover_branch(D.nextAll("li:eq(0)"))}else{return C?this.select_branch(D.parents("li").next("li").eq(0)):this.hover_branch(D.parents("li").next("li").eq(0))}}}},get_prev:function(C){var D=this.hovered||this.selected;if(D){if(D.prev("li").size()){var D=D.prev("li").eq(0);while(D.hasClass("open")){D=D.children("ul:eq(0)").children("li:last")}return C?this.select_branch(D):this.hover_branch(D)}else{return C?this.select_branch(D.parents("li:eq(0)")):this.hover_branch(D.parents("li:eq(0)"))}}},get_left:function(C,E){if(this.settings.ui.rtl&&!E){return this.get_right(C,true)}var D=this.hovered||this.selected;if(D){if(D.hasClass("open")){this.close_branch(D)}else{return C?this.select_branch(D.parents("li:eq(0)")):this.hover_branch(D.parents("li:eq(0)"))}}},get_right:function(C,E){if(this.settings.ui.rtl&&!E){return this.get_left(C,true)}var D=this.hovered||this.selected;if(D){if(D.hasClass("closed")){this.open_branch(D)}else{return C?this.select_branch(D.find("li:eq(0)")):this.hover_branch(D.find("li:eq(0)"))}}},toggleDots:function(){this.container.toggleClass("no_dots")},set_cookie:function(C){if(this.settings.cookies===false){return false}if(this.settings.cookies[C]===false){return false}switch(C){case"selected":if(this.settings.rules.multiple!=false&&this.selected_arr.length>1){var E=Array();B.each(this.selected_arr,function(){E.push(this.attr("id"))});E=E.join(",")}else{var E=this.selected?this.selected.attr("id"):false}B.cookie(this.settings.cookies.prefix+"_selected",E,this.settings.cookies.opts);break;case"open":var D="";this.container.find("li.open").each(function(F){D+=this.id+","});B.cookie(this.settings.cookies.prefix+"_open",D.replace(/,$/ig,""),this.settings.cookies.opts);break}},get_rollback:function(){var C={};if(this.context.remove&&this.context.apply_to){this.context.apply_to.children("a").removeClass("clicked")}C.html=this.container.html();if(this.context.remove&&this.context.apply_to){this.context.apply_to.children("a").addClass("clicked")}C.selected=this.selected?this.selected.attr("id"):false;return C},moved:function(N,J,O,C,P,D){var N=B(N);var F=B(N).parents("ul:eq(0)");var G=B(J);if(!D){var D={};D[this.container.attr("id")]=this.get_rollback();if(!C){var I=N.size()>1?N.eq(0).parents(".tree:eq(0)"):N.parents(".tree:eq(0)");if(I.get(0)!=this.container.get(0)){I=A.inst[I.attr("id")];D[I.container.attr("id")]=I.get_rollback()}delete I}}if(O=="inside"&&this.settings.data.async&&this.get_node(G).hasClass("closed")){var K=this;return this.open_branch(this.get_node(G),true,function(){K.moved.apply(K,[N,J,O,C,P,D])})}if(N.size()>1){var K=this;var I=this.moved(N.eq(0),J,O,false,P,D);N.each(function(Q){if(Q==0){return }if(I){I=K.moved(this,I.children("a:eq(0)"),"after",false,P,D)}});return }if(P){_what=N.clone();_what.each(function(Q){this.id=this.id+"_copy";B(this).find("li").each(function(){this.id=this.id+"_copy"});B(this).removeClass("dragged").find("a.clicked").removeClass("clicked ui-state-active").end().find("li.dragged").removeClass("dragged")})}else{_what=N}if(C){if(!this.settings.callback.beforecreate.call(null,this.get_node(N).get(0),this.get_node(J).get(0),O,this)){return false}}else{if(!this.settings.callback.beforemove.call(null,this.get_node(N).get(0),this.get_node(J).get(0),O,this)){return false}}if(!C){var I=N.parents(".tree:eq(0)");if(I.get(0)!=this.container.get(0)){I=A.inst[I.attr("id")];if(I.settings.languages.length){var L=[];if(this.settings.languages.length==0){L.push("."+I.current_lang)}else{for(var H in this.settings.languages){for(var E in I.settings.languages){if(this.settings.languages[H]==I.settings.languages[E]){L.push("."+this.settings.languages[H])}}}}if(L.length==0){return this.error("MOVE: NO COMMON LANGUAGES")}N.find("a").not(L.join(",")).remove()}N.find("a.clicked").removeClass("clicked ui-state-active")}}N=_what;switch(O){case"before":G.parents("ul:eq(0)").children("li.last").removeClass("last");G.parent().before(N.removeClass("last"));G.parents("ul:eq(0)").children("li:last").addClass("last");break;case"after":G.parents("ul:eq(0)").children("li.last").removeClass("last");G.parent().after(N.removeClass("last"));G.parents("ul:eq(0)").children("li:last").addClass("last");break;case"inside":if(G.parent().children("ul:first").size()){if(this.settings.rules.createat=="top"){G.parent().children("ul:first").prepend(N.removeClass("last")).children("li:last").addClass("last")}else{G.parent().children("ul:first").children(".last").removeClass("last").end().append(N.removeClass("last")).children("li:last").addClass("last")}}else{N.addClass("last");G.parent().append("<ul/>").removeClass("leaf").addClass("closed");G.parent().children("ul:first").prepend(N)}if(G.parent().hasClass("closed")){this.open_branch(G)}break;default:break}if(F.find("li").size()==0){var M=F.parent();M.removeClass("open").removeClass("closed").addClass("leaf").children("ul").remove();M.parents("ul:eq(0)").children("li.last").removeClass("last").end().children("li:last").addClass("last");this.set_cookie("open")}else{F.children("li.last").removeClass("last");F.children("li:last").addClass("last")}if(P){this.settings.callback.oncopy.call(null,this.get_node(N).get(0),this.get_node(J).get(0),O,this,D)}else{if(C){this.settings.callback.oncreate.call(null,this.get_node(N).get(0),(G.is("ul")?-1:this.get_node(J).get(0)),O,this,D)}else{this.settings.callback.onmove.call(null,this.get_node(N).get(0),this.get_node(J).get(0),O,this,D)}}return N},error:function(C){this.settings.callback.error.call(null,C,this);return false},lock:function(C){this.locked=C;if(this.locked){this.container.addClass("locked")}else{this.container.removeClass("locked")}},cut:function(C){if(this.locked){return this.error("LOCKED")}C=C?this.get_node(C):this.container.find("a.clicked").filter(":first-child").parent();if(!C||!C.size()){return this.error("CUT: NO NODE SELECTED")}this.copy_nodes=false;this.cut_nodes=C},copy:function(C){if(this.locked){return this.error("LOCKED")}C=C?this.get_node(C):this.container.find("a.clicked").filter(":first-child").parent();if(!C||!C.size()){return this.error("COPY: NO NODE SELECTED")}this.copy_nodes=C;this.cut_nodes=false},paste:function(F,C){if(this.locked){return this.error("LOCKED")}F=F?this.get_node(F):this.selected;if(!F||!F.size()){return this.error("PASTE: NO NODE SELECTED")}if(!this.copy_nodes&&!this.cut_nodes){return this.error("PASTE: NOTHING TO DO")}var G=this;if(C=="before"){C=ref_node.parent().children().index(F);F=F.parents("li:eq(0)")}else{if(C=="after"){C=F.parent().children().index(F)+1;F=F.parents("li:eq(0)")}else{if((typeof C).toLowerCase()=="undefined"||C=="inside"){C=(this.settings.rules.createat=="top")?0:F.children("ul:eq(0)").children("li").size()}}}if(this.copy_nodes&&this.copy_nodes.size()){var E=true;F.parents().andSelf().each(function(){if(G.copy_nodes.index(this)!=-1){E=false;return false}});if(!E){return this.error("Invalid paste")}if(!this.checkMove(this.copy_nodes,F.children("a:eq(0)"),"inside")){return false}if(F.children("ul").size()==0){var D=this.moved(this.copy_nodes,F.children("a:eq(0)"),"inside",false,true)}else{if(F.children("ul:eq(0)").children("li:nth-child("+(C+1)+")").size()){var D=this.moved(this.copy_nodes,F.children("ul:eq(0)").children("li:nth-child("+(C+1)+")").children("a:eq(0)"),"before",false,true)}else{var D=this.moved(this.copy_nodes,F.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after",false,true)}}this.copy_nodes=false}if(this.cut_nodes&&this.cut_nodes.size()){var E=true;F.parents().andSelf().each(function(){if(G.cut_nodes.index(this)!=-1){E=false;return false}});if(!E){return this.error("Invalid paste")}if(!this.checkMove(this.cut_nodes,F.children("a:eq(0)"),"inside")){return false}if(F.children("ul").size()==0){var D=this.moved(this.cut_nodes,F.children("a:eq(0)"),"inside")}else{if(F.children("ul:eq(0)").children("li:nth-child("+(C+1)+")").size()){var D=this.moved(this.cut_nodes,F.children("ul:eq(0)").children("li:nth-child("+(C+1)+")").children("a:eq(0)"),"before")}else{var D=this.moved(this.cut_nodes,F.children("ul:eq(0)").children("li:last").children("a:eq(0)"),"after")}}this.cut_nodes=false}},search:function(G){var I=this;if(!G||(this.srch&&G!=this.srch)){this.srch="";this.srch_opn=false;this.container.find("a.search").removeClass("search ui-state-highlight")}this.srch=G;if(!G){return }if(this.settings.data.async){if(!this.srch_opn){var D=B.extend({search:G},this.settings.data.async_data(false));B.ajax({type:this.settings.data.method,url:this.settings.data.url,data:D,dataType:"text",success:function(J){I.srch_opn=B.unique(J.split(","));I.search.apply(I,[G])}})}else{if(this.srch_opn.length){if(this.srch_opn&&this.srch_opn.length){var H=false;for(var E=0;E<this.srch_opn.length;E++){if(this.get_node("#"+this.srch_opn[E]).size()>0){H=true;var F="#"+this.srch_opn[E];delete this.srch_opn[E];this.open_branch(F,true,function(){I.search.apply(I,[G])})}}if(!H){this.srch_opn=[];I.search.apply(I,[G])}}}else{var C="a";if(this.settings.languages.length){C+="."+this.current_lang}this.container.find(C+":contains('"+G+"')").addClass(this.settings.ui.theme_name=="themeroller"?"search ui-state-highlight":"search");this.srch_opn=false}}}else{var C="a";if(this.settings.languages.length){C+="."+this.current_lang}this.container.find(C+":contains('"+G+"')").addClass(this.settings.ui.theme_name=="themeroller"?"search ui-state-highlight":"search").parents("li.closed").each(function(){I.open_branch(this,true)})}},destroy:function(){this.container.unbind().find("li").die().find("a").die();this.container.removeClass("tree ui-widget ui-widget-content").children("ul").removeClass("tree-"+this.settings.ui.theme_name).find("li").removeClass("leaf").removeClass("open").removeClass("closed").removeClass("last").children("a").removeClass("clicked hover search ui-state-active ui-state-hover ui-state-highlight ui-state-default");if(this.cntr==A.focused){for(var C in A.inst){if(C!=this.cntr&&C!=this.container.attr("id")){A.inst[C].focus();break}}}delete A.inst[this.cntr];delete A.inst[this.container.attr("id")];A.cntr--}}}})(jQuery);function PopUpCal(){this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._popUpShowing=false;this._inDialog=false;this.regional=[];this.regional[""]={clearText:"Clear",closeText:"Close",prevText:"&lt;Prev",nextText:"Next&gt;",currentText:"Today",dayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dateFormat:"DMY/"};this._defaults={autoPopUp:"focus",defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,closeAtTop:true,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",firstDay:0,changeFirstDay:true,showOtherMonths:false,minDate:null,maxDate:null,speed:"medium",customDate:null,fieldSettings:null,onSelect:null};$.extend(this._defaults,this.regional[""]);this._calendarDiv=$('<div id="calendar_div"></div>');$(document.body).append(this._calendarDiv);$(document.body).mousedown(this._checkExternalClick)}$.extend(PopUpCal.prototype,{markerClassName:"hasCalendar",_register:function(A){var B=this._nextId++;this._inst[B]=A;return B},_getInst:function(A){return this._inst[A]||A},setDefaults:function(A){extendRemove(this._defaults,A||{})},_doKeyDown:function(B){var A=popUpCal._getInst(this._calId);if(popUpCal._popUpShowing){switch(B.keyCode){case 9:popUpCal.hideCalendar(A,"");break;case 13:popUpCal._selectDate(A);break;case 27:popUpCal.hideCalendar(A,A._get("speed"));break;case 33:popUpCal._adjustDate(A,-1,(B.ctrlKey?"Y":"M"));break;case 34:popUpCal._adjustDate(A,+1,(B.ctrlKey?"Y":"M"));break;case 35:if(B.ctrlKey){popUpCal._clearDate(A)}break;case 36:if(B.ctrlKey){popUpCal._gotoToday(A)}break;case 37:if(B.ctrlKey){popUpCal._adjustDate(A,-1,"D")}break;case 38:if(B.ctrlKey){popUpCal._adjustDate(A,-7,"D")}break;case 39:if(B.ctrlKey){popUpCal._adjustDate(A,+1,"D")}break;case 40:if(B.ctrlKey){popUpCal._adjustDate(A,+7,"D")}break}}else{if(B.keyCode==36&&B.ctrlKey){popUpCal.showFor(this)}}},_doKeyPress:function(C){var B=popUpCal._getInst(this._calId);var A=String.fromCharCode(C.charCode==undefined?C.keyCode:C.charCode);return(A<" "||A==B._get("dateFormat").charAt(3)||(A>="0"&&A<="9"))},_connectCalendar:function(E,D){var F=$(E);if(this._hasClass(F,this.markerClassName)){return }var C=D._get("appendText");if(C){F.after('<span class="calendar_append">'+C+"</span>")}var H=D._get("autoPopUp");if(H=="focus"||H=="both"){F.focus(this.showFor)}if(H=="button"||H=="both"){var G=D._get("buttonText");var I=D._get("buttonImage");var B=D._get("buttonImageOnly");var A=$(B?'<img class="calendar_trigger" src="'+I+'" alt="'+G+'" title="'+G+'"/>':'<button type="button" class="calendar_trigger">'+(I!=""?'<img src="'+I+'" alt="'+G+'" title="'+G+'"/>':G)+"</button>");F.wrap('<span class="calendar_wrap"></span>').after(A);A.click(this.showFor)}F.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress);F[0]._calId=D._id},_inlineCalendar:function(C,B){var A=$(C);if(this._hasClass(A,this.markerClassName)){return }A.addClass(this.markerClassName).append(B._calendarDiv);A[0]._calId=B._id},_hasClass:function(B,C){var A=B.attr("class");return(A&&A.indexOf(C)>-1)},dialogCalendar:function(D,A,B,E){var C=this._dialogInst;if(!C){C=this._dialogInst=new PopUpCalInstance({},false);this._dialogInput=$('<input type="text" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);this._dialogInput[0]._calId=C._id}extendRemove(C._settings,B||{});this._dialogInput.val(D);if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else{if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}}}this._pos=E||[(windowWidth/2)-100,(windowHeight/2)-100];this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");C._settings.onSelect=A;this._inDialog=true;this._calendarDiv.addClass("calendar_dialog");this.showFor(this._dialogInput[0]);if($.blockUI){$.blockUI(this._calendarDiv)}},enableFor:function(A){A=(A.jquery?A:$(A));A.each(function(){this.disabled=false;$("../button.calendar_trigger",this).each(function(){this.disabled=false});$("../img.calendar_trigger",this).css({opacity:"1.0",cursor:""});var B=this;popUpCal._disabledInputs=$.map(popUpCal._disabledInputs,function(C){return(C==B?null:C)})})},disableFor:function(A){A=(A.jquery?A:$(A));A.each(function(){this.disabled=true;$("../button.calendar_trigger",this).each(function(){this.disabled=true});$("../img.calendar_trigger",this).css({opacity:"0.5",cursor:"default"});var B=this;popUpCal._disabledInputs=$.map(popUpCal._disabledInputs,function(C){return(C==B?null:C)});popUpCal._disabledInputs[popUpCal._disabledInputs.length]=this})},reconfigureFor:function(C,A){C=(typeof C=="string"?$(C)[0]:C);var B=this._getInst(C._calId);if(B){extendRemove(B._settings,A||{});this._updateCalendar(B)}},setDateFor:function(C,A){var B=this._getInst(C._calId);if(B){B._setDate(A)}},getDateFor:function(B){var A=this._getInst(B._calId);return(A?A._getDate():null)},showFor:function(E){var A=(E.nodeName&&E.nodeName.toLowerCase()=="input"?E:this);if(A.nodeName.toLowerCase()!="input"){A=$("input",A.parentNode)[0]}if(popUpCal._lastInput==A){return }for(var B=0;B<popUpCal._disabledInputs.length;B++){if(popUpCal._disabledInputs[B]==A){return }}var D=popUpCal._getInst(A._calId);var C=D._get("fieldSettings");extendRemove(D._settings,(C?C(A):{}));popUpCal.hideCalendar(D,"");popUpCal._lastInput=A;D._setDateFromField(A);if(popUpCal._inDialog){A.value=""}if(!popUpCal._pos){popUpCal._pos=popUpCal._findPos(A);popUpCal._pos[1]+=A.offsetHeight}D._calendarDiv.css("position",(popUpCal._inDialog&&$.blockUI?"static":"absolute")).css("left",popUpCal._pos[0]+"px").css("top",popUpCal._pos[1]+"px");popUpCal._pos=null;popUpCal._showCalendar(D)},_showCalendar:function(C){var B=this._getInst(C);popUpCal._updateCalendar(B);if(!B._inline){var A=B._get("speed");B._calendarDiv.show(A,function(){popUpCal._popUpShowing=true;popUpCal._afterShow(B)});if(A==""){popUpCal._popUpShowing=true;popUpCal._afterShow(B)}if(B._input[0].type!="hidden"){B._input[0].focus()}this._curInst=B}},_updateCalendar:function(A){A._calendarDiv.empty().append(A._generateCalendar());if(A._input&&A._input[0].type!="hidden"){A._input[0].focus()}},_afterShow:function(B){if($.browser.msie){$("#calendar_cover").css({width:B._calendarDiv[0].offsetWidth+4,height:B._calendarDiv[0].offsetHeight+4})}var A=B._calendarDiv[0];var C=popUpCal._findPos(B._input[0]);if(typeof (window.innerWidth)=="number"){browserWidth=window.innerWidth}else{browserWidth=document.documentElement.clientWidth}if(document.documentElement&&(document.documentElement.scrollLeft)){browserX=document.documentElement.scrollLeft}else{browserX=document.body.scrollLeft}if((A.offsetLeft+A.offsetWidth)>(browserWidth+browserX)){B._calendarDiv.css("left",(C[0]+B._input[0].offsetWidth-A.offsetWidth)+"px")}if(typeof (window.innerHeight)=="number"){browserHeight=window.innerHeight}else{browserHeight=document.documentElement.clientHeight}if(document.documentElement&&(document.documentElement.scrollTop)){browserTopY=document.documentElement.scrollTop}else{browserTopY=document.body.scrollTop}if((A.offsetTop+A.offsetHeight)>(browserTopY+browserHeight)){B._calendarDiv.css("top",(C[1]-A.offsetHeight)+"px")}},hideCalendar:function(C,B){var A=this._getInst(C);if(popUpCal._popUpShowing){B=(B!=null?B:A._get("speed"));A._calendarDiv.hide(B,function(){popUpCal._tidyDialog(A)});if(B==""){popUpCal._tidyDialog(A)}popUpCal._popUpShowing=false;popUpCal._lastInput=null;A._settings.prompt=null;if(popUpCal._inDialog){popUpCal._dialogInput.css("position","absolute").css("left","0px").css("top","-100px");if($.blockUI){$.unblockUI();$("body").append(this._calendarDiv)}}popUpCal._inDialog=false}popUpCal._curInst=null},_tidyDialog:function(A){A._calendarDiv.removeClass("calendar_dialog");$(".calendar_prompt",A._calendarDiv).remove()},_checkExternalClick:function(A){if(!popUpCal._curInst){return }var B=$(A.target);if((B.parents("#calendar_div").length==0)&&(B.attr("class")!="calendar_trigger")&&popUpCal._popUpShowing&&!(popUpCal._inDialog&&$.blockUI)){popUpCal.hideCalendar(popUpCal._curInst,"")}},_adjustDate:function(D,C,B){var A=this._getInst(D);A._adjustDate(C,B);this._updateCalendar(A)},_gotoToday:function(C){var A=new Date();var B=this._getInst(C);B._selectedDay=A.getDate();B._selectedMonth=A.getMonth();B._selectedYear=A.getFullYear();this._adjustDate(B)},_selectMonthYear:function(D,A,C){var B=this._getInst(D);B._selectingMonthYear=false;B[C=="M"?"_selectedMonth":"_selectedYear"]=A.options[A.selectedIndex].value-0;this._adjustDate(B)},_clickMonthYear:function(B){var A=this._getInst(B);if(A._input&&A._selectingMonthYear&&!$.browser.msie){A._input[0].focus()}A._selectingMonthYear=!A._selectingMonthYear},_changeFirstDay:function(F,A){var D=this._getInst(F);var E=D._get("dayNames");var C=A.firstChild.nodeValue;for(var B=0;B<7;B++){if(E[B]==C){D._settings.firstDay=B;break}}this._updateCalendar(D)},_selectDay:function(C,B){var A=this._getInst(C);A._selectedDay=$("a",B).html();this._selectDate(C)},_clearDate:function(A){this._selectDate(A,"")},_selectDate:function(D,A){var C=this._getInst(D);A=(A!=null?A:C._formatDate());if(C._input){C._input.val(A)}var B=C._get("onSelect");if(B){B(A,C)}else{C._input.trigger("change")}if(C._inline){this._updateCalendar(C)}else{this.hideCalendar(C,C._get("speed"))}},noWeekends:function(B){var A=B.getDay();return[(A>0&&A<6),""]},_findPos:function(A){while(A&&(A.type=="hidden"||A.nodeType!=1)){A=A.nextSibling}var C=curtop=0;if(A&&A.offsetParent){C=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){var B=C;C+=A.offsetLeft;if(C<0){C=B}curtop+=A.offsetTop}}return[C,curtop]}});function PopUpCalInstance(A,B){this._id=popUpCal._register(this);this._selectedDay=0;this._selectedMonth=0;this._selectedYear=0;this._input=null;this._inline=B;this._calendarDiv=(!B?popUpCal._calendarDiv:$('<div id="calendar_div_'+this._id+'" class="calendar_inline"></div>'));this._settings=extendRemove({},A||{});if(B){this._setDate(this._getDefaultDate())}}$.extend(PopUpCalInstance.prototype,{_get:function(A){return(this._settings[A]!=null?this._settings[A]:popUpCal._defaults[A])},_setDateFromField:function(C){this._input=$(C);var A=this._get("dateFormat");var B=this._input.val().split(A.charAt(3));if(B.length==3){this._currentDay=parseInt(B[A.indexOf("D")],10);this._currentMonth=parseInt(B[A.indexOf("M")],10)-1;this._currentYear=parseInt(B[A.indexOf("Y")],10)}else{var D=this._getDefaultDate();this._currentDay=D.getDate();this._currentMonth=D.getMonth();this._currentYear=D.getFullYear()}this._selectedDay=this._currentDay;this._selectedMonth=this._currentMonth;this._selectedYear=this._currentYear;this._adjustDate()},_getDefaultDate:function(){var A=function(D){var C=new Date();C.setDate(C.getDate()+D);return C};var B=this._get("defaultDate");return(B==null?new Date():(typeof B=="number"?A(B):B))},_setDate:function(A){this._selectedDay=this._currentDay=A.getDate();this._selectedMonth=this._currentMonth=A.getMonth();this._selectedYear=this._currentYear=A.getFullYear();this._adjustDate()},_getDate:function(){return new Date(this._currentYear,this._currentMonth,this._currentDay)},_generateCalendar:function(){var a=new Date();a=new Date(a.getFullYear(),a.getMonth(),a.getDate());var S='<div class="calendar_control"><a class="calendar_clear" onclick="popUpCal._clearDate('+this._id+');">'+this._get("clearText")+'</a><a class="calendar_close" onclick="popUpCal.hideCalendar('+this._id+');">'+this._get("closeText")+"</a></div>";var U=this._get("prompt");var Q=this._get("closeAtTop");var G=this._get("hideIfNoPrevNext");var M=(U?'<div class="calendar_prompt">'+U+"</div>":"")+(Q&&!this._inline?S:"")+'<div class="calendar_links">'+(this._canAdjustMonth(-1)?'<a class="calendar_prev" onclick="popUpCal._adjustDate('+this._id+", -1, 'M');\">"+this._get("prevText")+"</a>":(G?"":'<label class="calendar_prev">'+this._get("prevText")+"</label>"))+(this._isInRange(a)?'<a class="calendar_current" onclick="popUpCal._gotoToday('+this._id+');">'+this._get("currentText")+"</a>":"")+(this._canAdjustMonth(+1)?'<a class="calendar_next" onclick="popUpCal._adjustDate('+this._id+", +1, 'M');\">"+this._get("nextText")+"</a>":(G?"":'<label class="calendar_next">'+this._get("nextText")+"</label>"))+'</div><div class="calendar_header">';var I=this._get("minDate");var N=this._get("maxDate");var L=this._get("monthNames");if(!this._get("changeMonth")){M+=L[this._selectedMonth]+"&nbsp;"}else{var c=(I&&I.getFullYear()==this._selectedYear);var C=(N&&N.getFullYear()==this._selectedYear);M+='<select class="calendar_newMonth" onchange="popUpCal._selectMonthYear('+this._id+", this, 'M');\" onclick=\"popUpCal._clickMonthYear("+this._id+');">';for(var d=0;d<12;d++){if((!c||d>=I.getMonth())&&(!C||d<=N.getMonth())){M+='<option value="'+d+'"'+(d==this._selectedMonth?' selected="selected"':"")+">"+L[d]+"</option>"}}M+="</select>"}if(!this._get("changeYear")){M+=this._selectedYear}else{var X=this._get("yearRange").split(":");var P=0;var K=0;if(X.length!=2){P=this._selectedYear-10;K=this._selectedYear+10}else{if(X[0].charAt(0)=="+"||X[0].charAt(0)=="-"){P=this._selectedYear+parseInt(X[0],10);K=this._selectedYear+parseInt(X[1],10)}else{P=parseInt(X[0],10);K=parseInt(X[1],10)}}P=(I?Math.max(P,I.getFullYear()):P);K=(N?Math.min(K,N.getFullYear()):K);M+='<select class="calendar_newYear" onchange="popUpCal._selectMonthYear('+this._id+", this, 'Y');\" onclick=\"popUpCal._clickMonthYear("+this._id+');">';for(;P<=K;P++){M+='<option value="'+P+'"'+(P==this._selectedYear?' selected="selected"':"")+">"+P+"</option>"}M+="</select>"}M+='</div><table class="calendar" cellpadding="0" cellspacing="0"><thead><tr class="calendar_titleRow">';var O=this._get("firstDay");var D=this._get("changeFirstDay");var b=this._get("dayNames");for(var T=0;T<7;T++){M+="<td>"+(!D?"":'<a onclick="popUpCal._changeFirstDay('+this._id+', this);">')+b[(T+O)%7]+(D?"</a>":"")+"</td>"}M+="</tr></thead><tbody>";var B=this._getDaysInMonth(this._selectedYear,this._selectedMonth);this._selectedDay=Math.min(this._selectedDay,B);var f=(this._getFirstDayOfMonth(this._selectedYear,this._selectedMonth)-O+7)%7;var J=new Date(this._currentYear,this._currentMonth,this._currentDay);var A=new Date(this._selectedYear,this._selectedMonth,this._selectedDay);var F=new Date(this._selectedYear,this._selectedMonth,1-f);var E=Math.ceil((f+B)/7);var W=this._get("customDate");var Y=this._get("showOtherMonths");for(var H=0;H<E;H++){M+='<tr class="calendar_daysRow">';for(var T=0;T<7;T++){var R=(W?W(F):[true,""]);var Z=(F.getMonth()!=this._selectedMonth);var V=Z||!R[0]||(I&&F<I)||(N&&F>N);M+='<td class="calendar_daysCell'+((T+O+6)%7>=5?" calendar_weekEndCell":"")+(Z?" calendar_otherMonth":"")+(F.getTime()==A.getTime()?" calendar_daysCellOver":"")+(V?" calendar_unselectable":"")+(Z&&!Y?"":" "+R[1]+(F.getTime()==J.getTime()?" calendar_currentDay":(F.getTime()==a.getTime()?" calendar_today":"")))+'"'+(V?"":' onmouseover="$(this).addClass(\'calendar_daysCellOver\');" onmouseout="$(this).removeClass(\'calendar_daysCellOver\');" onclick="popUpCal._selectDay('+this._id+', this);"')+">"+(Z?(Y?F.getDate():"&nbsp;"):(V?F.getDate():"<a>"+F.getDate()+"</a>"))+"</td>";F.setDate(F.getDate()+1)}M+="</tr>"}M+="</tbody></table>"+(!Q&&!this._inline?S:"")+'<div style="clear: both;"></div>'+(!$.browser.msie?"":'<!--[if lte IE 6.5]><iframe src="javascript:false;" class="calendar_cover"></iframe><![endif]-->');return M},_adjustDate:function(E,D){var A=new Date(this._selectedYear+(D=="Y"?E:0),this._selectedMonth+(D=="M"?E:0),this._selectedDay+(D=="D"?E:0));var B=this._get("minDate");var C=this._get("maxDate");A=(B&&A<B?B:A);A=(C&&A>C?C:A);this._selectedDay=A.getDate();this._selectedMonth=A.getMonth();this._selectedYear=A.getFullYear()},_getDaysInMonth:function(A,B){return 32-new Date(A,B,32).getDate()},_getFirstDayOfMonth:function(A,B){return new Date(A,B,1).getDay()},_canAdjustMonth:function(B){var A=new Date(this._selectedYear,this._selectedMonth+B,1);if(B<0){A.setDate(this._getDaysInMonth(A.getFullYear(),A.getMonth()))}return this._isInRange(A)},_isInRange:function(A){var B=this._get("minDate");var C=this._get("maxDate");return((!B||A>=B)&&(!C||A<=C))},_formatDate:function(){var B=this._currentDay=this._selectedDay;var F=this._currentMonth=this._selectedMonth;var D=this._currentYear=this._selectedYear;F++;var A=this._get("dateFormat");var E="";for(var C=0;C<3;C++){E+=A.charAt(3)+(A.charAt(C)=="D"?(B<10?"0":"")+B:(A.charAt(C)=="M"?(F<10?"0":"")+F:(A.charAt(C)=="Y"?D:"?")))}return E.substring(A.charAt(3)?1:0)}});function extendRemove(C,B){$.extend(C,B);for(var A in B){if(B[A]==null){C[A]=null}}return C}$.fn.calendar=function(settings){return this.each(function(){var inlineSettings=null;for(attrName in popUpCal._defaults){var attrValue=this.getAttribute("cal:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=this.nodeName.toLowerCase();if(nodeName=="input"){var instSettings=(inlineSettings?$.extend($.extend({},settings||{}),inlineSettings||{}):settings);var inst=(inst&&!inlineSettings?inst:new PopUpCalInstance(instSettings,false));popUpCal._connectCalendar(this,inst)}else{if(nodeName=="div"||nodeName=="span"){var instSettings=$.extend($.extend({},settings||{}),inlineSettings||{});var inst=new PopUpCalInstance(instSettings,true);popUpCal._inlineCalendar(this,inst)}}})};$(document).ready(function(){popUpCal=new PopUpCal()});(function(){var Y=new Array();var H=new Array();var Z=false;var T=false;function a(){$(".status_message, .error_message, .success_message").each(function(){var d=$(this);var f=function(){d.fadeOut("slow")};setTimeout(f,2000)})}function O(f){f=jQuery.extend({parentElem:"",elemClass:".btn",elem:null},f);var d=f.elem;if(f.elem==null){d=$(f.parentElem+" "+f.elemClass)}d.each(function(){var o=$(this);var j=o.attr("href");var k=o.parents("form");var p="";var x=o.attr("onclick");var r=j==null?"form_input":"link";var q=o.text()||o.val();var u="";if(r=="form_input"){var g=o.attr("name");var v=o.attr("value");u='<input type="hidden" name="'+g+'" value = "'+v+'" />'}if($(":submit,:button",this)){p=$('<a class="new_button '+r+'"></a>');p.insertAfter(o).addClass(o.attr("class")).attr("id",o.attr("id"));o.remove()}if(r=="link"){p.attr("href",j).attr("onclick",x)}p.css("cursor","pointer").prepend("<i></i>").append($("<span></span>").text(q).append("<i></i><span></span>")).click(function(){if(r=="form_input"){k.submit();return false}}).after(u)});$("input[type='password'], input[type='text']").each(function(){var g=$("form");$(this).keypress(function(k){var j=k.which?k.which:k.keyCode;if(j==13){g.submit()}})})}function C(){if($("#info_dialog").size()==0){$("#info_menu").wrap('<div id="info_menu_wrapper"></div>');$("#info_menu").before('<div id="info_dialog"></div>')}if($("#admin_panel_wrapper").size()==0){$("#admin_button").after('<div id="admin_panel_wrapper"></div>')}}function F(){$(".rte-zone").rte("/stylesheets/rte.css","/images/rte/");if($(".upload_img_section").size()==0){$(".rte-toolbar").append('<div class="upload_img_section"></div>')}var d=$(".upload_img_section");var f=$("#asset_url").val();$(".rte-toolbar .image").upload({name:"file",method:"post",enctype:"multipart/form-data",action:f,onSubmit:function(){d.append('<span class="loading">Uploading...Please Wait</span>')},onComplete:function(g){d.text("Done!");alert(g)}});$(".rte-toolbar .image").parent().css({top:0,clear:"none",height:"auto"})}function W(){if($("#delete_popup").size()==0){$("#content_column").after('<div id="delete_popup" class="admin_popup" title="Warning"></div>');$("#delete_popup").addClass("salsaDialog")}$(".delete").click(function(){var f=$(this);var d=f.attr("href");$("#delete_popup").dialog({width:"260px",height:"auto"}).html('<span class="loading">Loading...Please Wait</span>').dialog("open");$(".loading").show();$.ajax({url:d,type:"GET",dataType:"html",data:"ajax=true",success:function(g){$("#delete_popup").html(g).css("display","block");O({parentElem:"#delete_popup"});if($("#admin_content").css("display")=="block"){B({elem:$(".yes")})}$(".move_category").click(function(){$(".category_select").removeAttr("disabled")});$(".delete_category").click(function(){$(".category_select").attr("disabled","disabled")});$(".cancel").click(function(){$("#delete_popup").dialog("close");return false})}});return false})}function K(){$(".date").datepicker({dateFormat:"mm/dd/yy",yearRange:"-50:+10"});$(".time").salsaClockPick()}function N(){if($(".gallery_end").size()>1){$(".next_image").hide()}if($(".gallery_begin").size()>1){$(".previous_image").hide()}$(".main_random_images").each(function(){if(!$(this).hasClass("ajaxified")){var f=$(".previous_image").addClass("ajaxified");var d=$(".next_image").addClass("ajaxified");var j=$(".carousel_slot");var g="home/get_carousel_image";d.click(function(){var k=d.attr("href").split("=")[1];if(!Z){ajax=function(){$.ajax({url:g,type:"GET",dataType:"html",data:"direction=next&offset="+k,success:function(q){j.html(q);callback=function(){Z=false};j.show("slide",{direction:"right"},"normal",callback);var r=$(".gallery_end").size()>0;var u=$(".gallery_begin").size()>1;if(!u&&f.css("display")=="none"){f.appear()}var o=d.attr("href").replace(k,parseInt(k)+3);var p=f.attr("href").replace(k,parseInt(k)+3);if(r){d.hide("normal")}else{d.attr("href",o)}f.attr("href",p)}})};j.hide("slide",{direction:"left"},"normal",ajax)}Z=true;return false});f.click(function(){var k=f.attr("href").split("=")[1];if(!Z){ajax=function(){$.ajax({url:g,type:"GET",dataType:"html",data:"direction=previous&offset="+k,success:function(q){j.html(q);callback=function(){Z=false};j.show("slide",{direction:"left"},"normal",callback);var r=$(".gallery_end").size()>1;var u=$(".gallery_begin").size()>0;if(!r&&d.css("display")=="none"){d.appear()}var o=d.attr("href").replace(k,parseInt(k)-3);var p=f.attr("href").replace(k,parseInt(k)-3);d.attr("href",o);if(u){f.hide("normal")}else{f.attr("href",p)}}})};j.hide("slide",{direction:"right"},"normal",ajax)}Z=true;return false})}})}function A(){$(".phone").mask("(999) 999-9999")}function I(){var j=$(window).width()*0.9;var d=$(window).height()*0.9-20;var g=50;var k=($(window).width()-j)/2;var j=$("#content_column").width();var k=$("#content_column").offset().left;var f=$("#info_dialog");$(".ajax_nav").each(function(){var o=$(this);var p=o.hasClass("logged_out");if(!o.hasClass("ajaxified")){o.click(function(){f.css("top",0).css("left",0);var q=$(this).attr("href");var r=function(){$.ajax({url:q,type:"GET",dataType:"html",data:"ajax=true&main=true",success:function(v){$(".info_dialog_loading").hide();$(".info_dialog_content").html(v);var u=f.find(".title_bar");var x=u.attr("class").replace("title_bar ","")+"_dialog";f.removeClass(f.attr("class"));f.addClass(x);f.show();$("#info_menu_wrapper").slideDown("normal",function(){$.salsa.ajaxify()});X();o.addClass("hilited")},error:function(x,u,v){$(".info_dialog_content").html(x.responseText)}})};if(f.css("display")!="none"&&!o.hasClass("hilited")){$("#info_menu_wrapper").slideUp("normal",function(){$(".ajax_nav").removeClass("hilited");r()})}else{if(!o.hasClass("hilited")){f.html('<span class="info_dialog_loading">Loading...</span><div class="info_dialog_content"></div>');r()}else{$("#info_menu_wrapper").slideUp("normal",function(){f.html("").hide();$(".ajax_nav").removeClass("hilited");f.parent().slideDown("normal")})}}return false}).addClass("ajaxified")}});$(".ajax_sub_nav").each(function(){var o=$(this);var p=o.css("background-image").replace('url("',"").replace('")',"");var q=$(".title_bar").text();if(!o.hasClass("ajaxified")){o.click(function(){var x=$(this);var r=x.parent();var u=$(this).attr("href");var y=$("#admin_content");var v=q.toLowerCase().replace(" ","_")+"_selected";$("."+v).removeClass(v);r.addClass(v);y.html('<span class="loading big_loading">Loading...Please Wait</span>');$(".loading").appear();$.ajax({url:u,type:"GET",dataType:"html",data:"ajax=true&no_layout=true",success:function(z){y.html(z);$.salsa.ajaxify();y.appear()},error:function(AB,z,AA){y.html(AB.responseText);y.appear()}});return false});o.addClass("ajaxified")}})}function J(){$(".admin_nav").each(function(){var d=$(this);if(!d.hasClass("ajaxified")){d.history(function(){if(!T){T=true;var j=$(window).width();var k=$(".admin_nav").height();var x=$(window).height()-k-10;var g=$("#admin_panel_wrapper");var f=$(this).attr("href");var r=function(){$.ajax({url:f,type:"GET",dataType:"html",data:"ajax=true&main=true",success:function(y){$(".admin_panel_loading").fadeOut("normal",function(){$(".admin_panel_content").html(y).appear();var z=$("#admin_popup_navigation").height();$("#scrollable_viewport").height(q-z);X({container:g,onclick:function(AA){$(".admin_panel_content").html("");g.animate({height:0},AA);d.removeClass("hilited")}});d.addClass("hilited");$(this).remove();$.salsa.ajaxify();T=false})},error:function(AA,y,z){$(".admin_panel_content").html(AA.responseText);T=false}})};if(g.height()!=0&&!d.hasClass("hilited")){g.animate({height:0},"normal","swing",function(){$(".ajax_nav").removeClass("hilited");r()})}else{if(!d.hasClass("hilited")){g.html('<div id="admin_bar"></div><div class="admin_panel_content_wrapper"><div class="admin_panel_loading loading big_loading">Loading...</div><div class="admin_panel_content"></div></div>');$(".admin_panel_content").hide();var o=$(".admin_panel_content_wrapper");var p=$("#admin_bar");var v=p.css("height").replace("px","")*1+p.css("padding-top").replace("px","")*2;var q=x-v-o.css("top").replace("px","")*2;var u=q/1.1;o.height(q);o.css("lineHeight",u+"px");g.animate({height:x+"px"},"normal","swing",function(){r()})}else{g.animate({height:0},"normal","swing",function(){$(".admin_panel_content").html("");g.html("").hide();d.removeClass("hilited");T=false})}}}return false}).addClass("ajaxified")}})}function M(){if($.browser.msie&&$.browser.version=="6.0"){$("#admin_panel").hide();if($(".browser_error_message").size()==0){$("#content_column .content").prepend('<p class="browser_error_message">To access more advanced capabilities, please upgrade your browser</p>')}return false}else{return true}}function X(d){var d=jQuery.extend({container:$("#info_dialog"),additionalContainers:[],onclick:function(g){var f=function(){g();d.container.parent().slideDown("normal")};$("#info_dialog").parent().slideUp("normal",f)},append:true},d);if($(".close_dialog").size()==0){closer='<div class="closer_container"><a href="#" class="close_dialog">Close</a></div>';if(d.append){d.container.append(closer)}else{d.container.prepend(closer)}$(".close_dialog").click(function(){callback=function(){d.container.html("").hide()};d.onclick(callback);$.each(d.additionalContainers,function(f){d.additionalContainers[f].hide()});$(".ajax_nav").removeClass("hilited");if($(".admin_popup").css("display")!="none"){$(".admin_popup").dialog("open")}return false})}}function B(d){var d=jQuery.extend({topLevel:$("#admin_content"),elem:$("#admin_content").find("a"),loadHtml:'<span class="loading bigLoading">Loading...Please Wait</span>'},d);d.elem.click(function(){if($(this).hasClass("yes")){$("#delete_popup").dialog("open")}if(!$(this).hasClass("form_input")){link=$(this).attr("href");if(!link.match("mailto:")&&!$(this).hasClass("delete")){d.topLevel.html(d.loadHtml);$(".loading").appear();$.ajax({url:link,type:"GET",dataType:"html",data:"ajax=true&no_layout=true",success:function(f){d.topLevel.html(f).css("display","none");$.salsa.ajaxify();d.topLevel.appear(function(){$.salsa.afterLoad()})},error:function(j,f,g){d.topLevel.html(j.responseText);d.topLevel.appear()}});return false}}})}function E(d){d=jQuery.extend({topLevel:$("#admin_content"),form:$("#admin_content").find("form")},d);d.form.submit(function(){if(!$(this).hasClass("in_place")){var g=$(this);var f=g.attr("action");var j=$.param(g.serializeArray());d.topLevel.html('<span class="loading bigLoading">Loading...Please Wait</span>');$(".loading").appear();$.ajax({url:f,type:"POST",dataType:"html",data:j+"&ajax=true",processData:false,success:function(k){d.topLevel.html(k).css("display","none");$.salsa.ajaxify();d.topLevel.appear()},error:function(p,k,o){d.topLevel.html(p.responseText);d.topLevel.appear()}})}return false})}function Q(d){d=$.extend({elem:$(".date_header")},d);if($("#edit_date_popup").size()==0){$("#admin_content").after('<div id="edit_date_popup" class="admin_popup" title="edit date"></div>')}if($("#add_date_popup").size()==0){$("#admin_content").after('<div id="add_date_popup" class="admin_popup" title="add date"></div>')}$("#edit_date_popup").addClass("salsaDialog");$("#add_date_popup").addClass("salsaDialog");d.elem.each(function(){var j=$(this);var g=j.find(".editable_item");var f=j.find(".delete_link");f.css("display","none");g.each(function(){var k=g.text();var q=g.attr("href").split(/\&|\?/);var p=f.attr("href").split(/\&|\?/);var o={html:"",popupID:"edit_date_popup",elemID:j.attr("id"),editUrl:q.shift(),editParams:q,deleteUrl:p.shift(),deleteButton:'<input type="submit" class="inputButton destroy_link" name="delete" value="delete" />',callback:function(u,r){S(u,r)}};g.mousedown(function(){g.text("Loading...")}).mouseup(function(){$("#edit_date_popup").dialog({width:"270px",height:"100px"}).html('<span class="loading">Loading...Please Wait</span>').dialog("open");$(".loading").show();g.text(k);$.ajax({url:o.editUrl,type:"GET",dataType:"html",data:o.editParams.join("&")+"&ajax=true",success:function(r){o.html=r;G(o)},error:function(v,r,u){alert(v.responseText)}});return false})})});$(".add_date_link").each(function(){var g=$(this);var f=g.text();var k=g.attr("href").split(/\&|\?/);var j={html:"",popupID:"add_date_popup",addUrl:k.shift(),callback:function(p,o){R(p,o)}};g.mousedown(function(){g.text("Loading...")}).mouseup(function(){$("#add_date_popup").dialog({width:"230px",height:"100px"}).html('<span class="loading">Loading...Please Wait</span>').dialog("open");$(".loading").show();g.text(f);$.ajax({url:j.addUrl,type:"GET",dataType:"html",data:k.join("&")+"&ajax=true",success:function(o){j.html=o;G(j)},error:function(q,o,p){alert(q.responseText)}});return false})})}function G(d){var f=$("#"+d.popupID);f.html(d.html).css("display","block");$(".back_link").css("display","none");d.callback(f,d)}function R(f,d){$(".add_link").click(function(){$(".admin_popup").hide("normal");var j=f.find("#worksheet_id").val();var g=f.find("#date").val();$.ajax({url:d.addUrl.replace("new","add"),type:"POST",dataType:"html",data:"date="+g+"&worksheet="+j+"&ajax=true",success:function(k){$("#admin_shifts").html(k).css("display","none").appear();f.css("display","none");$.salsa.ajaxify()},error:function(p,k,o){$("#admin_shifts").html(p.responseText)}});$("#admin_shifts").html('<span class="loading bigLoading">Reloading...Please Wait</span>');$(".loading").appear();return false})}function S(g,d){g.find(".inputButton").after(d.deleteButton);var f=$("#admin_shifts");$(".destroy_link").click(function(){var k=g.find("#worksheet_id").val();var j=g.find("#old_date").val();$(".admin_popup").hide("normal");$.ajax({url:d.deleteUrl,type:"POST",dataType:"html",data:"date="+j+"&worksheet="+k+"&ajax=true",success:function(o){f.html(o).css("display","none").appear();$.salsa.ajaxify()},error:function(q,o,p){f.html(q.responseText)}});f.html('<span class="loading bigLoading">Reloading...Please Wait</span>');$(".loading").appear();return false});$(".edit_link").click(function(){$(".admin_popup").hide("normal");var o=g.find("#worksheet_id").val();var j=g.find("#old_date").val();var k=g.find("#date").val();$.ajax({url:d.editUrl.replace("edit","update"),type:"POST",dataType:"html",data:"date="+k+"&old_date="+j+"&worksheet="+o+"&ajax=true",success:function(p){$("#"+d.elemID).find(".editable_item").text(p).attr("href",d.editUrl+"?worksheet_id="+o+"&date="+k).parent("th").Highlight()},error:function(r,p,q){alert(r.responseText)}});return false})}function b(){$(".image_rating_block").each(function(){var p=$(this);var f=p.find("form");var d=f.attr("action").split("/").pop();var q=parseFloat($("#total_rating_"+d).val());var r=parseFloat($("#votes_"+d).val());var k=0;if(r>0){k=parseFloat(q)/parseFloat(r)}var o=parseInt(k);var u=(k*10)%10;o=u>5?o+1:o;u=u!=5?0:u;var j=o+"."+u+"star.gif";p.append('<img src="/images/rating/'+j+'" class="rating_img" />');f.find("div").addClass("hidden_form");var g=$(".rating_img");g.mouseover(function(){$(this).hide();f.find("div").removeClass("hidden_form");return false});$(".javascript_wrapper, .gallery_divider").mouseover(function(){$(".rating_img").show();f.find("div").addClass("hidden_form");return false})})}function U(){if($(".javascript_wrapper").size()==0){$(".gallery_image_content .wrapper").wrap('<div class="javascript_wrapper"></div>')}$(".gallery_image_content .previous_image, .gallery_image_content .next_image").history(function(){var k=$(this);if(!k.hasClass("ajaxified")){var g=$("#gallery_image_and_comments");var r=$(".gallery_image_content .wrapper");var q=$("#image_comments");var p=$(".image_nav");var j=$(this).attr("href");var o=k.hasClass("next_image")?"left":"right";k.addClass("ajaxified");r.hide("slide",{direction:o},"normal");p.hide();$.ajax({url:j,type:"GET",dataType:"html",data:"&ajax=true",success:function(u){o=k.hasClass("next_image")?"right":"left";r.html(u);r.show("slide",{direction:o},"normal");$.salsa.ajaxify();$.ajax({url:j.replace("show","comments"),type:"GET",dataType:"html",success:function(v){q.html(v)}});$.ajax({url:j.replace("show","image_nav"),type:"GET",dataType:"html",success:function(v){p.html(v).appear();$.salsa.ajaxify()}})},error:function(u,x,v){o=k.hasClass("next_image")?"left":"right";r.show("slide",{direction:o},"normal");p.appear();$("#admin_content").prepend('<p class="error_message">Failed to load image.  Try again</p>');$.salsa.fadeMessage()}});return false}});var d=$("#image_comments");var f=$("#comments_wrapper");if(f.size()==0){d.wrap('<div id="comments_wrapper"></div>');f=$("#comments_wrapper")}$("#image_comments form").submit(function(){var g=$(this).attr("action");var j=$.param($(this).serializeArray());$.ajax({url:g,type:"POST",dataType:"html",data:j+"&ajax=true",success:function(k){f.html(k);$.salsa.ajaxify()},error:function(p,k,o){alert("Oops!  There was an error!  Site administrator has been contacted!")}});return false});$("input[@type=radio].star").rating({callback:function(j,g){this.form.submit()}});$(".rating_submit").hide()}function P(){$(".gallery_image_edit").each(function(){var y=$(this);var x=$(".gallery_image_wrapper");var AA=$('<div class="image_edit_box"><div class="box_wrapper"></div></div>');var AG=y.find(".edit");var AO=AG.attr("href");var u=y.find(".delete");var AF=u.attr("href");var k=y.find(".rotate_left");var v=k.attr("href");var AC=y.find(".rotate_right");var p=AC.attr("href");var d=x.find(".inplace_edit");var AB=x.find(".inplace_delete");var AL=x.find(".inplace_rotate_left");var AK=x.find(".inplace_rotate_right");var z=x.find(".image_edit_box");if(z.size()==0){x.append(AA);AA=$(".image_edit_box");var r=$(".box_wrapper");var f=$('<div class="hovering_edit"><a href="'+AO+'" class="inplace_edit form_input">Edit</a></div>');var AM=$('<div class="hovering_delete"><a href="'+AF+'" class="inplace_delete form_input">Delete</a></div>');var AE=$('<div class="hovering_rotate_left"><a href="'+v+'" class="inplace_rleft form_input">Rotate Left</a></div>');var o=$('<div class="hovering_rotate_right"><a href="'+p+'" class="inplace_rright form_input">Rotate Right</a></div>');y.hide();if(k.size()>0){r.append(o).append(AE)}r.append(f).append(AM);i=0;x.bind("mouseenter",function(AP){AA.show()}).bind("mouseleave",function(AP){AA.hide()});var AN=x.find("img");var AH=AN.width();var AD=AN.height();var q=AN.position();AA.width(AH);var AI=AA.height();var g=r.css("width").replace("px","")*1;var AJ=AA.css("paddingTop").replace("px","")*2;var j=q.left;AA.css("left",q.left+"px");AA.css("top",q.top+AD-AI-AJ+1+"px");r.css("left",(AH-g)/2+"px")}})}function L(){$(".gallery_video_edit").each(function(){var r=$(this);var q=$(".gallery_video_wrapper");var v=$('<div class="video_edit_box"><div class="box_wrapper"></div></div>');var AA=r.find(".edit");var AF=AA.attr("href");var p=r.find(".delete");var z=p.attr("href");var d=q.find(".inplace_edit");var x=q.find(".inplace_delete");var u=q.find(".video_edit_box");if(u.size()==0){q.append(v);v=$(".video_edit_box");var o=$(".box_wrapper");var f=$('<div class="hovering_edit"><a href="'+AF+'" class="inplace_edit form_input">Edit</a></div>');var AE=$('<div class="hovering_delete"><a href="'+z+'" class="inplace_delete form_input">Delete</a></div>');r.hide();o.append(f).append(AE);i=0;q.bind("mouseenter",function(AG){v.show()}).bind("mouseleave",function(AG){v.hide()});var AD=q.find("embed");var AB=AD.width();var y=AD.height();var k=AD.position();v.width(AB);var AC=v.height();var g=o.css("width").replace("px","")*1;var j=k.left;v.css("left",k.left+"px");v.css("top",k.top+"px");o.css("left",(AB-g)/2+"px")}})}function c(){if($(".inplace_image_parent").html()!=null){$(".editable_image").each(function(){var p=$(this);var f=p.parent();var o;while(!f.hasClass("inplace_image_parent")){f=f.parent()}o=f;while(!o.hasClass("inplace_parent")){o=o.parent()}var j=f.parent().find(".hideable").find(".edit");var g=j.attr("href");var k=f.find(".inplace_image_edit");var d=$('<div class="hovering_edit"><a href="'+g+'" class="inplace_image_edit">Change Image</a></div>');if(k.size()==0){f.append(d);d.hide();f.bind("mouseenter",function(q){d.show();return false}).bind("mouseleave",function(q){d.hide();return false});k=d.find(".inplace_image_edit");k.click(function(){$.ajax({url:g,type:"POST",dataType:"html",data:"in_place=true&image_edit=true",success:function(q){o.html(q).slideDown("normal",function(){$.scrollTo(f,{offset:-200,duration:500})});V(o);f.find(".cancel").addClass("form_input");$.salsa.ajaxify()}});return false})}})}}function D(){$(".detached_hideable").each(function(){$(this).hide()});$(".hideable").each(function(){var o=$(this);var q=o.parent();while(!q.hasClass("inplace_parent")){q=q.parent()}var p=o.find(".edit");var j=p.attr("href");var u=o.find(".delete");var r=u.attr("href");var d=q.find(".inplace_edit");var g=q.find(".inplace_delete");if(d.size()==0){var k=$('<div class="hovering_edit"><a href="'+j+'" class="inplace_edit form_input">Edit</a></div>');var f=$('<div class="hovering_delete"><a href="'+r+'" class="inplace_delete form_input">Delete</a></div>');o.hide();q.append(k);if(r){q.append(f)}i=0;q.bind("mouseenter",function(v){k.show();f.show()}).bind("mouseleave",function(v){k.hide();f.hide()});d=k.find(".inplace_edit");g=f.find(".inplace_delete");d.click(function(){$.ajax({url:j,type:"POST",dataType:"html",data:"in_place=true",success:function(v){q.html(v).slideDown("normal",function(){$.scrollTo(q,{offset:-200,duration:500})});V(q);q.find(".cancel").addClass("form_input");$.salsa.ajaxify()}});return false});g.click(function(){$.ajax({url:r,type:"POST",dataType:"html",data:"in_place=true",success:function(v){q.html(v).slideDown("normal",function(){$.scrollTo(q,{offset:-200,duration:500})});q.find(".cancel").addClass("form_input");$.salsa.ajaxify();V(q)}});return false})}})}function V(f){var j=f.find(".in_place");var k=$(".yes");var g=f.find(".cancel");var d=$("#img_uploaded_data");g.click(function(){link=g.attr("href");$.get(link,{in_place:"true"},function(o){f.slideUp("normal",function(){f.html(o);f.removeClass("editing");$.salsa.ajaxify();f.slideDown()})});return false});k.click(function(){link=k.attr("href");if(!link.match("go_back")){$.post(link,{in_place:"true"},function(o){f.removeClass("editing");f.slideUp("normal",function(){f.remove()})});return false}});if(d.size()==0){j.submit(function(){link=j.attr("action");data=$.param(j.serializeArray());$.ajax({url:link,type:"POST",dataType:"html",data:data+"&in_place=true",success:function(o){f.slideUp("normal",function(){f.html(o);f.removeClass("editing");$.salsa.ajaxify();f.slideDown()})}});return false})}}jQuery.salsa=jQuery.salsa||{};jQuery.salsa.addAjaxMethod=function(d){Y.push(d)};jQuery.salsa.addAfterMethod=function(d){H.push(d)};jQuery.salsa.ajaxify=function(){if(M()){jQuery.each(Y,function(){this()})}};jQuery.salsa.afterLoad=function(){if(M()){jQuery.each(H,function(){this()})}};jQuery.salsa.ajaxifyForms=function(){E()};jQuery.salsa.ajaxifyInPlaceForms=function(d){V(d)};jQuery.salsa.fadeMessage=function(){a()};jQuery.fn.changeButtons=function(){O({elem:$(this)});return this};jQuery.fn.ajaxifyDateHeaders=function(){Q({elem:$(this)});return this};jQuery.fn.addCloseButton=function(d){var d=jQuery.extend({additionalContainers:new Array(),onclick:function(f){f()},append:true},d);X({container:$(this),additionalContainers:d.additionalContainers,onclick:d.onclick,append:d.append});return this};jQuery.fn.slideUpFade=function(d,f){elem=$(this).css("position","absolute");elem.hide({method:"drop",direction:"up"},d,f);return this};$.salsa.addAjaxMethod(C);$.salsa.addAjaxMethod(W);$.salsa.addAjaxMethod(K);$.salsa.addAjaxMethod(N);$.salsa.addAjaxMethod(I);$.salsa.addAjaxMethod(J);$.salsa.addAjaxMethod(B);$.salsa.addAjaxMethod(E);$.salsa.addAjaxMethod(U);$.salsa.addAjaxMethod(a);$.salsa.addAjaxMethod(D);$.salsa.addAjaxMethod(c);$.salsa.addAjaxMethod(A);$.salsa.addAjaxMethod(P);$.salsa.addAjaxMethod(L);$.salsa.addAjaxMethod(b);$.salsa.addAjaxMethod(F);$(window).bind("load",function(){$.salsa.ajaxify();$.ajaxHistory.initialize();if(location.pathname.match(/images|admin/)){location.hash=location.pathname}})})();String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")};String.prototype.escape_html=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};(function(){var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var E=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var N=[31,28,31,30,31,30,31,31,30,31,30,31];var I="<fieldset></fieldset>";var R={Daily:0,Weekly:1,Monthly:2,Yearly:3};function U(){var f=$(".google_doc_view");if(f.size()>0){var d=$("#scrollable_viewport").width()-25;var a=$("#scrollable_viewport").height();var j=$("#admin_content");var c=j.find("h1");var b=j.find("h2");var g=c.height()+parseInt(c.css("padding-top").replace("px",""))+parseInt(c.css("padding-bottom").replace("px",""))+b.height()+parseInt(b.css("padding-top").replace("px",""))+parseInt(b.css("padding-bottom").replace("px",""));f.width(d);f.height(a-g-25)}}function A(){if(!$(".committee_users_list, .committee_positions_list, .permissions_user_list").hasClass("is_initialized")){$(".committee_users_list, .committee_positions_list, .permissions_user_list").addClass("is_initialized").hide()}$(".committee_header, .role_header").click(function(c){var b=$(this);var d=b.siblings(".committee_users_list, .committee_positions_list, .permissions_user_list");var a=b.parent();if(c.target.tagName!="A"){if(a.hasClass("hidden_list")){d.blindDown(300);a.removeClass("hidden_list")}else{d.blindUp(300);a.addClass("hidden_list")}return false}})}function J(){var a=$(".committee_list").sortable({opacity:0.8,cursor:"move"}).sortable("enable");if($(".hide_all").size()==0){$(".committee_edit").append('<a href="#" class="hide_all btn"><span>Show All</span></a>');$(".hide_all").click(function(){var d=$(this);var c=$(".committee_header");var b=d.html();if(b.match("Hide All")){d.html(b.replace("Hide","Show"));a.sortable("enable");a.css("cursor","move");c.each(function(){if(!$(this).parent().hasClass("hidden_list")){$(this).click()}})}else{d.html(b.replace("Show","Hide"));a.sortable("disable");a.css("cursor","default");c.each(function(){if($(this).parent().hasClass("hidden_list")){$(this).click()}})}})}}function W(){M();var d=$("#img_uploaded_data");if(d.size()>0){var f=d.parent();var a=f.parent();var j=a.parent();var g=a.find(".buttons");var c=j.attr("action").replace(/create|update/,"background_image_upload");var b=$('<div><div class="one_click_upload">Upload image</div></div>');if($("#continue_to_next").size()==0){g.prepend('<button id="continue_to_next" name="commit" type="submit"><span>Continue to next step</span></button>')}}}function M(){var b=$(".event_form_steps");if(b.children().size()<=2){var a=b.find(".currentlast, .last");b.append('<li class="third"><span class="step3">Crop Main Image</span></li>');b.append('<li class="last"><span class="step4">Crop Thumbnail</span></li>');if(a.hasClass("currentlast")){a.removeClass("currentlast").addClass("current")}else{a.removeClass("last")}a.addClass("second")}}function V(){var b=$("#continue_image_crop");var a=$("#finish_crop");b.attr("disabled","disabled").addClass("disabled");a.attr("disabled","disabled").addClass("disabled");$("#image_to_crop").Jcrop({aspectRatio:3/1,onSelect:function(f){var d=$("#image_to_crop");d.after('<input type="hidden" name="main_crop[x]" value="'+f.x+'" />');d.after('<input type="hidden" name="main_crop[y]" value="'+f.y+'" />');d.after('<input type="hidden" name="main_crop[width]" value="'+f.w+'" />');d.after('<input type="hidden" name="main_crop[height]" value="'+f.h+'" />');b.removeAttr("disabled").removeClass("disabled")}});$("#thumbnail_to_crop").Jcrop({aspectRatio:3/4,onSelect:function(f){var d=$("#thumbnail_to_crop");d.after('<input type="hidden" name="thumb_crop[x]" value="'+f.x+'" />');d.after('<input type="hidden" name="thumb_crop[y]" value="'+f.y+'" />');d.after('<input type="hidden" name="thumb_crop[width]" value="'+f.w+'" />');d.after('<input type="hidden" name="thumb_crop[height]" value="'+f.h+'" />');a.removeAttr("disabled").removeClass("disabled")}});$("#member_image_to_crop").Jcrop({aspectRatio:3/4,onSelect:function(f){var d=$("#member_image_to_crop");d.after('<input type="hidden" name="main_crop[x]" value="'+f.x+'" />');d.after('<input type="hidden" name="main_crop[y]" value="'+f.y+'" />');d.after('<input type="hidden" name="main_crop[width]" value="'+f.w+'" />');d.after('<input type="hidden" name="main_crop[height]" value="'+f.h+'" />')}});$("#member_thumbnail_to_crop").Jcrop({aspectRatio:1/1,onSelect:function(f){var d=$("#member_thumbnail_to_crop");d.after('<input type="hidden" name="thumb_crop[x]" value="'+f.x+'" />');d.after('<input type="hidden" name="thumb_crop[y]" value="'+f.y+'" />');d.after('<input type="hidden" name="thumb_crop[width]" value="'+f.w+'" />');d.after('<input type="hidden" name="thumb_crop[height]" value="'+f.h+'" />')}})}function O(){$(".folders_list").wrap('<div id="doc_tree"></div>');var a=$("#doc_tree");a.tree({ui:{theme_path:"/stylesheets/themes/",theme_name:"apple",context:[{id:"edit",label:"Edit",icon:"/stylesheets/themes/default/create.png",visible:function(c,b){if(c.length!=1){return false}return b.check("creatable",c)},action:function(c,b){}},"separator",{id:"rename",label:"Rename",icon:"/stylesheets/themes/default/rename.png",visible:function(c,b){if(c.length!=1){return false}return b.check("renameable",c)},action:function(c,b){b.rename(c)}},{id:"delete",label:"Delete",icon:"/stylesheets/themes/default/remove.png",visible:function(d,c){var b=true;$.each(d,function(){if(c.check("deletable",this)==false){b=false}return false});return b},action:function(c,b){$.each(c,function(){b.remove(this)})}}]},rules:{draggable:["leaf"],dragrules:["leaf inside folder"]},callback:{error:function(c,b){},onrename:function(f,c,g,o){g.lock(true);var b=$(f).attr("id");var k=$(f).find("a:first").text();var j=b.match(/folder/)?"google_folders":"google_docs";var d=b.match(/folder/)?"folder":"document";var p="/admin/"+j+"/update";b=b.replace(/folder\_|doc\_/,"");$.ajax({url:p,type:"POST",dataType:"html",data:"id="+b+"&background=true&"+d+"[name]="+k,success:function(r){var u='<div class="success_message">'+r+"</div>";var q=$("#admin_content");q.prepend(u);$.salsa.fadeMessage()},error:function(v,r,u){$.tree_rollback(o);var x='<div class="error_message">'+u+"</div>";var q=$("#admin_content");q.prepend(x);$.salsa.fadeMessage()},complete:function(r,q){g.lock(false)}})},ondelete:function(g,f,b){var k=$(g).attr("id");var c=k.match(/folder/)?"google_folders":"google_docs";var j=k.match(/folder/)?"folder":"document";var d="/admin/"+c+"/destroy";k=k.replace(/folder\_|doc\_/,"");$.ajax({url:d,type:"POST",dataType:"html",data:"id="+k+"&background=true&",success:function(p){var q='<div class="success_message">'+p+"</div>";var o=$("#admin_content");o.prepend(q);fadeMessage()},error:function(r,p,q){$.tree_rollback(b);var u='<div class="error_message">'+q+"</div>";var o=$("#admin_content");o.prepend(u);$.salsa.fadeMessage()},complete:function(p,o){}})}}})}function T(){var c=$(".end_date");var b=["Does not repeat","Daily","Every weekday (Mon-Fri)","Every Mon, Wed, and Fri","Every Tue, and Thu","Weekly","Monthly","Yearly"];var a='<div><label>Repeats</label><select id="recurrence">';$.each(b,function(d,f){a+="<option>"+f+"</option>"});a+='</select></div><div id="recur_div"></div>';c.after(a);select=$("#recurrence");select.change(F);G()}function G(){$("#hidden_recurrence").each(function(){var a=$(this);$("#old_recur_freq").each(function(){var c=$(this).val();var b=$("#recurrence");$("#recurrence option").each(function(){var d=$(this);if(d.text().toLowerCase().match(c)){d.attr("selected",true);b.change()}else{d.attr("selected",false)}})});$("#old_recur_interval").each(function(){var c=$(this).val();var b=$("#repeats");$("#repeats option").each(function(){var d=$(this);if(d.text()==c){d.attr("selected",true);b.change()}})});$("#old_recur_until").each(function(){var b=$(this).val();$("#recur_ends_until").attr("checked",true);$("#recur_end_date").val(b).show();$("#repeats").change()});$("#old_recur_byday").each(function(){var d=$(this).val().split(",");var c=$("#recur_by_day");var b=$(".repeat_on");if(c.size()>0){c.attr("checked",true);$("#repeats").change()}else{if(b.size()>0){$.each(d,function(g,j){var f=$("#recur_repeats_on_"+j.toUpperCase());f.attr("checked",true);$("#repeats").change()})}}})})}function F(){var b=$("#recurrence option:selected");var a=$("#recur_div");b.each(function(){var c=$(this).text();var d=$("#recur_div fieldset");if(d.size()==0){a.append(I);d=$("#recur_div fieldset")}a.show();switch(c){case"Daily":Y(d);break;case"Every weekday (Mon-Fri)":C("Weekly on weekdays",d,["MO","TU","WE","TH","FR"]);break;case"Every Mon, Wed, and Fri":C("Weekly on Monday, Wednesday, Friday",d,["MO","WE","FR"]);break;case"Every Tue, and Thu":C("Weekly on Tuesday, Thursday",d,["TU","TH"]);break;case"Weekly":X(d);break;case"Monthly":Z(d);break;case"Yearly":D(d);break;default:a.hide();break}});$(".date").change(function(){$("#repeats").change()})}function C(a,c,b){var a='<span class="message">'+a+"</span>";c.empty();c.append(a);L(c);c.append('<input type="hidden" name="recur[freq]" value="WEEKLY" />');$.each(b,function(){c.append('<input type="hidden" name="recur[byday][]" value="'+this+'" />')})}function Y(b){var a='<span class="message">Daily</span>';b.empty();b.append(a);P(b,"Daily","days",R.Daily);L(b);b.append('<input type="hidden" name="recur[freq]" value="DAILY" />')}function X(b){var a='<span class="message">Weekly</span>';b.empty();b.append(a);P(b,"Weekly","weeks",R.Weekly);K(b);L(b);b.append('<input type="hidden" name="recur[freq]" value="WEEKLY" />');$("#repeats").change()}function Z(b){var a='<span class="message">Monthly</span>';b.empty();b.append(a);P(b,"Monthly","months",R.Monthly);Q(b);L(b);b.append('<input type="hidden" name="recur[freq]" value="MONTHLY" />');$("#repeats").change()}function D(b){var a='<span class="message">Annually</span>';b.empty();b.append(a);P(b,"Annually","years",R.Yearly);L(b);b.append('<input type="hidden" name="recur[freq]" value="YEARLY" />');$("#repeats").change()}function P(c,g,b,f){var j=30;var d=["first","second","third","fourth","fifth","sixth"];var a=[];a.push('<label>Repeats every</label><select id="repeats"  name="recur[interval]">');for(ndx=1;ndx<=j;ndx++){a.push("<option>"+ndx+"</option>")}a.push("</select>");c.append(a.join(""));$("#repeats").change(function(){$(this).find("option:selected").each(function(){var AH=$(this).text();var k=$(".message");var y="";if(AH>1){y="Every "+AH+" "+b}else{y=g}var AE=$("#start_date").val().split("/");var AF=parseInt(AE[0])-1;var AD=parseInt(AE[1].replace(/^0/,""));var x=parseInt(AE[2]);var AG=$("#recur_ends_until");if(f!=R.Daily){y+=" on ";if(f==R.Yearly){y+=H[AF]+" "+AD}else{if(f==R.Monthly){if($("#recur_by_day").attr("checked")){var u=new Date(x,AF,1);var AB=u.getDay();var z=N[AF];var o=new Date(x,AF,AD);var q=o.getDay();var r=1;var AC=0;var AA=false;for(var p=0;p<9&&!AA;p++){for(var v=0;v<7&&!AA;v++){if(r==AD){AC=p;AA=true;break}if(r<=z&&(p>0||v>=AB)){r++}}}y+="the "+d[AC]+" "+E[q];$("#repeat_by").each(function(){var AI=$(this);AI.attr("name","recur[byday]");AI.val("+"+(AC+1)+E[q].substring(0,2).toUpperCase())})}else{y+="day "+AD;$("#repeat_by").each(function(){var AI=$(this);AI.attr("name","recur[bymonthday]");AI.val(AD)})}}else{dayStr=[];$(".repeat_on input").each(function(){var AI=$(this);if(AI.attr("checked")){dayStr.push(AI.attr("id").replace("recur_repeats_on_",""))}});if(dayStr.length==0){dt=new Date(x,AF,AD);y+=$.datepicker.formatDate("DD",dt)}else{y+=dayStr.length<7?dayStr.join(", "):"all days"}}}}y+=B();k.text(y)})})}function B(){var g=$("#recur_end_date");var a="";if($("#recur_ends_until").attr("checked")&&g.val()){var c=g.val().split("/");var f=H[parseInt(c[0])-1];var b=parseInt(c[1].replace(/^0/,""));var d=parseInt(c[2]);a=", until "+f+" "+b+", "+d}return a}function K(j){var c=[];c.push("<div><label>Repeat on</label><div>");var b=$("#start_date").val().split("/");var k=parseInt(b[0],10)-1;var a=parseInt(b[1].replace(/^0/,""));var f=parseInt(b[2]);var g=new Date(f,k,a);var d=$.datepicker.formatDate("D",g).substring(0,2).toUpperCase();$.each(E,function(){var p=this.substring(0,2).toUpperCase();var o=p==d?' checked="checked" ':"";c.push('<label class="repeat_on" for="recur_repeats_on_'+p+'">');c.push('<input type="checkbox" id="recur_repeats_on_'+p+'" name="recur[byday][]" value="'+p+'"'+o+"/>");c.push(this.charAt(0)+"</label>")});c.push("</div></div>");j.append(c.join(""));$(".repeat_on input").click(function(){$("#repeats").change()})}function Q(b){var a=[];a.push('<div><label>Repeat by</label><div class="range_options">');a.push('<label class="labelRadio" for="recur_by_month_day">');a.push('<input id="recur_by_month_day" type="radio" name="recur_month_type" value="by_month_day" checked="checked" />day of the month</label>');a.push('<label class="labelRadio" for="recur_by_day">');a.push('<input id="recur_by_day" type="radio" name="recur_month_type" value="by_day" />day of the week</label>');a.push("</div></div>");a.push('<input type="hidden" id="repeat_by" name="recur[bymonthday]" value="" />');b.append(a.join(""));$("#recur_by_month_day, #recur_by_day").click(function(){$("#repeats").change()})}function L(c){var b=[];b.push('<div><label>Ends</label><div class="range_options">');b.push('<label class="labelRadio" for="recur_ends_never">');b.push('<input id="recur_ends_never" type="radio" name="recur_ends" value="never" checked="checked" />Never</label>');b.push('<label class="labelRadio" for="recur_ends_until">');b.push('<input id="recur_ends_until" type="radio" name="recur_ends" value="until"/>Until');b.push('<input id="recur_end_date" name="recur[until]" type="text" class="date" value=""/></label>');b.push("</div></div>");c.append(b.join(""));var d=$("#recur_end_date");var a=$("#repeats");d.css("display","none").datepicker({dateFormat:"mm/dd/yy"}).change(function(){if(a.size()>0){a.change()}else{var g=$(".message");var f=g.text().replace(/, until.*$/,"")+B();g.text(f)}});$("#recur_ends_never").click(function(){d.css("display","none");if(a.size()>0){a.change()}else{var g=$(".message");var f=g.text().replace(/, until.*$/,"");g.text(f)}});$("#recur_ends_until").click(function(){d.css("display","block");if(!d.val()){d.val($("#end_date").val())}d.focus();if(a.size()>0){a.change()}else{var g=$(".message");var f=g.text().replace(/, until.*$/,"")+B();g.text(f)}})}function S(){var b=$("#attachment_div");b.after('<div class="add_more_link"><a id="add_more" href="#">Add more</a></div>');var a=$("#add_more");a.click(function(){var f=$(".remove_img_link").size();if(f<9){var g=$(this);var d='<div class="remove_img_link"><label for="image_filename">File</label><input name="attachment_data[]" size="16" type="file" /><a id="remove" href="#">Remove</a></div>';b.after(d);var c=$("#remove");c.click(function(){c.parent().remove()})}else{alert("Can't add more than 10 images at a time!!")}})}$.salsa.addAjaxMethod(A);$.salsa.addAjaxMethod(J);$.salsa.addAjaxMethod(S);$.salsa.addAjaxMethod(T);$.salsa.addAjaxMethod(W);$.salsa.addAjaxMethod(V);$.salsa.addAjaxMethod(O);$.salsa.addAfterMethod(U);$.salsa.addAfterMethod(W)})();(function(){jQuery.fn.salsaClockPick=function(){var B=$(this);B.clockpick({starthour:0,endhour:23}).click(function(){var C=$(this);var D=new Array();D.push($("#CP_minutecont"));$("#CP_hourcont").addCloseButton({container:C,additionalContainers:D,onclick:function(E){E()},append:false}).each(function(){var E=$(".closer_container");E.append('<a href="#" class="clear">Clear</a>');$(".clear").click(function(){C.val("")})});A()})};function A(){$("#CP_hourcont").unbind("mouseout");$("#CP_minutecont").unbind("mouseout")}})();