

/*
 * jQuery 1.2.3 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-02-06 00:21:25 -0500 (Wed, 06 Feb 2008) $
 * $Rev: 4663 $
 */
(function(){if(window.jQuery)var _jQuery=window.jQuery;var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context);};if(window.$)var _$=window.$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}else 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)if(elem.id!=match[3])return jQuery().find(selector);else{this[0]=elem;this.length=1;return this;}else
selector=[];}}else
return new jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector]);},jquery:"1.2.3",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;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){var ret=-1;this.each(function(i){if(this==elem)ret=i;});return ret;},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],name)||undefined;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])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).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,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});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,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));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!selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]));},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];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.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/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=value.constructor==Array?value:[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.length?this[0].innerHTML: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));},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);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length)data=jQuery.data(this[0],key);return data==null&&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);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.prototype.init.prototype=jQuery.prototype;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);}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==1){target=this;i=0;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){if(target===options[name])continue;if(deep&&options[name]&&typeof options[name]=="object"&&target[name]&&!options[name].nodeType)target[name]=jQuery.extend(target[name],options[name]);else if(options[name]!=undefined)target[name]=options[name];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,windowData={};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.appendChild(script);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},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];}},each:function(object,callback,args){if(args){if(object.length==undefined){for(var name in object)if(callback.apply(object[name],args)===false)break;}else
for(var i=0,length=object.length;i<length;i++)if(callback.apply(object[i],args)===false)break;}else{if(object.length==undefined){for(var name in object)if(callback.call(object[name],name,object[name])===false)break;}else
for(var i=0,length=object.length,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 value&&value.constructor==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 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){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;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&elem.style&&elem.style[name])ret=elem.style[name];else if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem))ret=getComputedStyle.getPropertyValue(name);else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(var i=0;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(getComputedStyle&&getComputedStyle.getPropertyValue(name))||"";for(var i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}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 style=elem.style.left,runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem=elem.toString();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=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");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.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?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(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]];}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method"))return elem.getAttributeNode(name).nodeValue;else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,""+value);}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name);}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(value!=undefined)elem[name]=value;return elem[name];}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(typeof array!="array")for(var i=0,length=array.length;i<length;i++)ret.push(array[i]);else
ret=array.slice(0);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){if(jQuery.browser.msie){for(var i=0;second[i];i++)if(second[i].nodeType!=8)first.push(second[i]);}else
for(var i=0;second[i];i++)first.push(second[i]);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)||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&&value!=undefined){if(value.constructor!=Array)value=[value];ret=ret.concat(value);}}return ret;}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength",selectedIndex:"selectedIndex",defaultValue:"defaultValue",tagName:"tagName",nodeName:"nodeName"}});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));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});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){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.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).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},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;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval!=undefined)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments);};handler.data=data;handler.guid=fn.guid;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===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 parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===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(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event)data.unshift(this.fix({type:type,target:elem}));data[0].type=type;if(exclusive)data[0].exclusive=true;if(jQuery.isFunction(jQuery.data(elem,"handle")))val=jQuery.data(elem,"handle").apply(elem,data);if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val;},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=originalEvent.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;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};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){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments);},fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){if(this[0])return jQuery.event.trigger(type,data,this[0],false,fn);return undefined;},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false;});},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){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,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);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{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);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?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=(new Date).getTime();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:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,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){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="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&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){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();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
jQuery.handleError(s,xml,status);complete();if(s.async)xml=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xml.send(s.data);}catch(e){jQuery.handleError(s,xml,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s]);}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xml;},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e]);},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined;}catch(e){}return false;},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined;}catch(e){}return false;},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},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(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){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;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},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;}});var queue=function(elem,type,array){if(!elem)return undefined;type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(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:[],timerId:null,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.apply(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.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&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=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.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(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";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=(new Date()).getTime();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)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(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.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&jQuery.css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0;}return results;};})();

(function($){$.ui=$.ui||{};$.extend($.ui,{plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},call:function(instance,name,arguments){var set=instance.plugins[name];if(!set)return;for(var i=0;i<set.length;i++){if(instance.options[set[i][0]])set[i][1].apply(instance.element,arguments)}}},cssCache:{},css:function(name){if($.ui.cssCache[name])return $.ui.cssCache[name];var tmp=$('<div class="ui-resizable-gen">').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!(((/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0))}catch(e){}return $.ui.cssCache[name]},disableSelection:function(e){if(!e)return;e.unselectable="on";e.onselectstart=function(){return false};if(e.style)e.style.MozUserSelect="none"},enableSelection:function(e){if(!e)return;e.unselectable="off";e.onselectstart=function(){return true};if(e.style)e.style.MozUserSelect=""}});$.fn.extend({mouseInteraction:function(o){return this.each(function(){new $.ui.mouseInteraction(this,o)})},removeMouseInteraction:function(o){return this.each(function(){if($.data(this,"ui-mouse"))$.data(this,"ui-mouse").destroy()})}});$.ui.mouseInteraction=function(element,options){var self=this;this.element=element;$.data(this.element,"ui-mouse",this);this.options=$.extend({},options);$(element).bind('mousedown.draggable',function(){return self.click.apply(self,arguments)});if($.browser.msie)$(element).attr('unselectable','on')};$.extend($.ui.mouseInteraction.prototype,{destroy:function(){$(this.element).unbind('mousedown.draggable')},trigger:function(){return this.click.apply(this,arguments)},click:function(e){if(e.which!=1||$.inArray(e.target.nodeName.toLowerCase(),this.options.dragPrevention)!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[e,this.element])))return true;var self=this;var initialize=function(){self._MP={left:e.pageX,top:e.pageY};$(document).bind('mouseup.draggable',function(){return self.stop.apply(self,arguments)});$(document).bind('mousemove.draggable',function(){return self.drag.apply(self,arguments)})};if(this.options.delay){if(this.timer)clearInterval(this.timer);this.timer=setTimeout(initialize,this.options.delay)}else{initialize()}return false},stop:function(e){var o=this.options;if(!this.initialized)return $(document).unbind('mouseup.draggable').unbind('mousemove.draggable');if(this.options.stop)this.options.stop.call(this.options.executor||this,e,this.element);$(document).unbind('mouseup.draggable').unbind('mousemove.draggable');this.initialized=false;return false},drag:function(e){var o=this.options;if($.browser.msie&&!e.button)return this.stop.apply(this,[e]);if(!this.initialized&&(Math.abs(this._MP.left-e.pageX)>=o.distance||Math.abs(this._MP.top-e.pageY)>=o.distance)){if(this.options.start)this.options.start.call(this.options.executor||this,e,this.element);this.initialized=true}else{if(!this.initialized)return false}if(o.drag)o.drag.call(this.options.executor||this,e,this.element);return false}})})(jQuery);(function($){$.fn.resizable=function(options){return this.each(function(){var args=Array.prototype.slice.call(arguments,1);if(typeof options=="string"){var resize=$.data(this,"ui-resizable");resize[options].apply(resize,args)}else if(!$(this).is(".ui-resizable"))new $.ui.resizable(this,options)})};$.ui.resizable=function(element,options){var self=this;this.element=$(element);$.data(element,"ui-resizable",this);this.element.addClass("ui-resizable");this.options=$.extend({preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autohide:false},options);this.options._aspectRatio=!!(this.options.aspectRatio);$(element).bind("setData.resizable",function(event,key,value){self.options[key]=value}).bind("getData.resizable",function(event,key){return self.options[key]});var o=this.options;var aBorder='1px solid #DEDEDE';o.defaultTheme={'ui-resizable':{display:'block'},'ui-resizable-handle':{position:'absolute',background:'#F5F5F5'},'ui-resizable-n':{cursor:'n-resize',height:'4px',left:'0px',right:'0px',borderTop:aBorder},'ui-resizable-s':{cursor:'s-resize',height:'4px',left:'0px',right:'0px',borderBottom:aBorder},'ui-resizable-e':{cursor:'e-resize',width:'4px',top:'0px',bottom:'0px',borderRight:aBorder},'ui-resizable-w':{cursor:'w-resize',width:'4px',top:'0px',bottom:'0px',borderLeft:aBorder},'ui-resizable-se':{cursor:'se-resize',width:'4px',height:'4px',borderRight:aBorder,borderBottom:aBorder},'ui-resizable-sw':{cursor:'sw-resize',width:'4px',height:'4px',borderBottom:aBorder,borderLeft:aBorder},'ui-resizable-ne':{cursor:'ne-resize',width:'4px',height:'4px',borderRight:aBorder,borderTop:aBorder},'ui-resizable-nw':{cursor:'nw-resize',width:'4px',height:'4px',borderLeft:aBorder,borderTop:aBorder}};if(!o.proxy&&(this.element.css('position')=='static'||this.element.css('position')==''))this.element.css('position','relative');var nodeName=element.nodeName;if(nodeName.match(/textarea|input|select|button|img/i)){this.element.wrap('<div class="ui-wrapper"  style="overflow: hidden; position: relative; width: '+this.element.outerWidth()+'px; height: '+this.element.outerHeight()+';"></div>');var oel=this.element;element=element.parentNode;this.element=$(element);this.element.css({marginLeft:oel.css("marginLeft"),marginTop:oel.css("marginTop"),marginRight:oel.css("marginRight"),marginBottom:oel.css("marginBottom")});oel.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if($.browser.safari&&o.preventDefault)oel.css('resize','none');o.proportionallyResize=oel.css('position','static');this._proportionallyResize()}if(!o.handles)o.handles=!$('.ui-resizable-handle',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(o.handles.constructor==String){if(o.handles=='all')o.handles='n,e,s,w,se,sw,ne,nw';var n=o.handles.split(",");o.handles={};o.zIndex=o.zIndex||1000;var insertions={handle:'overflow:hidden; position:absolute;',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 i=0;i<n.length;i++){var d=jQuery.trim(n[i]),t=o.defaultTheme,hname='ui-resizable-'+d;var rcss=$.extend(t[hname],t['ui-resizable-handle']),axis=$(["<div class=\"",hname," ui-resizable-handle\" style=\"",insertions[d],insertions.handle,"\"></div>"].join("")).css(/sw|se|ne|nw/.test(d)?{zIndex:++o.zIndex}:{});o.handles[d]='.ui-resizable-'+d;this.element.append(axis.css(!$.ui.css(hname)?rcss:{}))}}this._renderAxis=function(target){target=target||this.element;for(var i in o.handles){if(o.handles[i].constructor==String)o.handles[i]=$(o.handles[i],element).show();if(o.transparent)o.handles[i].css({opacity:0});if(this.element.is('.ui-wrapper')&&nodeName.match(/textarea|input|select|button/i)){var axis=$(o.handles[i],element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");if(!o.transparent)target.css(padPos,padWrapper)}if(!$(o.handles[i]).length)continue}};this._renderAxis(this.element);var handlers=$('.ui-resizable-handle',self.element);if(o.disableSelection)handlers.each(function(i,e){$.ui.disableSelection(e)});handlers.mouseover(function(){if(!o.resizing){if(this.className)var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);o.axis=axis&&axis[1]?axis[1]:'se'}});if(o.autohide){var tLoaded=$.ui.css('ui-resizable-s')||$.ui.css('ui-resizable-e');if(!tLoaded)handlers.hide();$(self.element).addClass("ui-resizable-autohide").hover(function(){if(!tLoaded)handlers.show();$(this).removeClass("ui-resizable-autohide")},function(){if(!o.resizing){if(!tLoaded)handlers.hide();$(this).addClass("ui-resizable-autohide")}})}this.element.mouseInteraction({executor:this,delay:0,distance:0,dragPrevention:['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag,condition:function(e){if(this.disabled)return false;for(var i in this.options.handles){if($(this.options.handles[i])[0]==e.target)return true}return false}})};$.extend($.ui.resizable.prototype,{plugins:{},ui:function(){return{instance:this,axis:this.options.axis,options:this.options}},_proportionallyResize:function(){var o=this.options;if(!o.proportionallyResize)return;var prel=o.proportionallyResize;var b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth'),prel.css('borderLeftWidth')];var p=[prel.css('paddingTop'),prel.css('paddingRight'),prel.css('paddingBottom'),prel.css('paddingLeft')];o.borderDif=o.borderDif||$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding});prel.css({display:'block',height:(this.element.height()-o.borderDif[0]-o.borderDif[2])+"px",width:(this.element.width()-o.borderDif[1]-o.borderDif[3])+"px"})},_renderProxy:function(){var el=this.element,o=this.options;this.offset=el.offset();if(o.proxy){this.helper=this.helper||$('<div style="overflow:hidden;"></div>');var ie6offset=($.browser.msie&&$.browser.version<7?3:0);this.helper.addClass(o.proxy).css({width:el.outerWidth(),height:el.outerHeight(),position:'absolute',left:this.offset.left-ie6offset+'px',top:this.offset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body");if(o.disableSelection)$.ui.disableSelection(this.helper.get(0))}else{this.helper=el}},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="resize"?n:"resize"+n,[e,this.ui()],this.options[n])},destroy:function(){this.element.removeClass("ui-resizable ui-resizable-disabled").removeMouseInteraction().removeData("ui-resizable").unbind(".resizable")},enable:function(){this.element.removeClass("ui-resizable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-resizable-disabled");this.disabled=true},start:function(e){var o=this.options,iniPos=this.element.position(),el=this.element;o.resizing=true;o.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){var sOffset=$.browser.msie&&!o.containment&&(/absolute/).test(el.css('position'))&&!(/relative/).test(el.parent().css('position'));var dscrollt=sOffset?o.documentScroll.top:0,dscrolll=sOffset?o.documentScroll.left:0;el.css({position:'absolute',top:(iniPos.top+dscrollt),left:(iniPos.left+dscrolll)})}if(/relative/.test(el.css('position'))&&$.browser.opera)el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var curleft=parseInt(this.helper.css('left'),10)||0,curtop=parseInt(this.helper.css('top'),10)||0;$.extend(o,{currentSize:{width:el.outerWidth(),height:el.outerHeight()},currentSizeDiff:{width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()},startMousePosition:{left:e.pageX,top:e.pageY},startPosition:{left:curleft,top:curtop},currentPosition:{left:curleft,top:curtop}});var iswlt=o.currentSize.width<o.currentSize.height;o.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:Math.pow(o.currentSize.width/o.currentSize.height,iswlt?1:-1);o.aspectRatioTarget=iswlt?"width":"height";if(o.preserveCursor)$('body').css('cursor',o.axis+'-resize');if(o.containment){var oc=o.containment,ce=(oc instanceof jQuery)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):null;if(ce){var scroll=function(e,a){var scroll=/top/.test(a||"top")?'scrollTop':'scrollLeft',has=false;if(e[scroll]>0)return true;e[scroll]=1;has=e[scroll]>0?true:false;e[scroll]=0;return has};var co=$(ce).offset(),ch=$(ce).innerHeight(),cw=$(ce).innerWidth();o.cdata={e:ce,l:co.left,t:co.top,w:(scroll(ce,"left")?ce.scrollWidth:cw),h:(scroll(ce)?ce.scrollHeight:ch)}}if(/document/.test(oc)||oc==document)o.cdata={e:document,l:0,t:0,w:$(document).width(),h:$(document).height()}}this.propagate("start",e);return false},stop:function(e){this.options.resizing=false;var o=this.options;if(o.proxy){var style={width:(this.helper.width()-o.currentSizeDiff.width)+"px",height:(this.helper.height()-o.currentSizeDiff.height)+"px",top:((parseInt(this.element.css('top'),10)||0)+((parseInt(this.helper.css('top'),10)-this.offset.top)||0)),left:((parseInt(this.element.css('left'),10)||0)+((parseInt(this.helper.css('left'),10)-this.offset.left)||0))};this.element.css(style);if(o.proxy)this._proportionallyResize();this.helper.remove()}if(o.preserveCursor)$('body').css('cursor','auto');this.propagate("stop",e);return false},drag:function(e){var el=this.helper,o=this.options,props={},self=this,pRatio=o._aspectRatio||e.shiftKey;var change=function(a,b){var isth=(a=="top"||a=="height"),ishw=(a=="width"||a=="height"),defAxis=(o.axis=="se"||o.axis=="s"||o.axis=="e");var mod=(e[isth?'pageY':'pageX']-o.startMousePosition[isth?'top':'left'])*(b?-1:1);var val=o[ishw?'currentSize':'startPosition'][a]-mod-(!o.proxy&&defAxis?o.currentSizeDiff.width:0);if(pRatio){var v=val*Math.pow(o.aspectRatio,(isth?-1:1)*(o.aspectRatioTarget=='height'?1:-1)),locked=false;if(isth&&v>=o.maxWidth||!isth&&v>=o.maxHeight)locked=true;if(isth&&v<=o.minWidth||!isth&&v<=o.minHeight)locked=true;if(ishw&&!locked)el.css(isth?"width":"height",v);if(a=="top"&&(o.axis=="ne"||o.axis=="nw")){return}}el.css(a,val)};var a=o.axis,tminval=0,tmaxval;if(a=="n"||a=="ne"||a=="nw")change("height");if(a=="s"||a=="se"||a=="sw")change("height",1);var curheight=parseInt(el.css('height'),10)||0;if(o.minHeight&&curheight<=o.minHeight)el.css('height',o.minHeight);if(o.maxHeight&&curheight>=o.maxHeight)el.css('height',o.maxHeight);if(a=="n"||a=="ne"||a=="nw")change("top",1);var curtop=parseInt(el.css('top'),10)||0;tminval=(o.startPosition.top+(o.currentSize.height-o.minHeight));tmaxval=(o.startPosition.top+(o.currentSize.height-o.maxHeight));if(o.minHeight&&curtop>=tminval)el.css('top',tminval);if(o.maxHeight&&curtop<=tmaxval)el.css('top',tmaxval);if(a=="e"||a=="se"||a=="ne")change("width",1);if(a=="sw"||a=="w"||a=="nw")change("width");var curwidth=parseInt(el.css('width'),10)||0;if(o.minWidth&&curwidth<=o.minWidth)el.css('width',o.minWidth);if(o.maxWidth&&curwidth>=o.maxWidth)el.css('width',o.maxWidth);if(a=="sw"||a=="w"||a=="nw")change("left",1);var curleft=parseInt(el.css('left'),10)||0;tminval=(o.startPosition.left+(o.currentSize.width-o.minWidth));tmaxval=(o.startPosition.left+(o.currentSize.width-o.maxWidth));if(o.minWidth&&curleft>=tminval)el.css('left',tminval);if(o.maxWidth&&curleft<=tmaxval)el.css('left',tmaxval);if(o.containment&&o.cdata.e){if(curleft<0){el.css('left',0);el.css('width',curwidth+curleft)}if(curtop<0){el.css('top',0);el.css('height',curheight+curtop)}if(curwidth+o.currentSizeDiff.width+curleft>=o.cdata.w)el.css('width',o.cdata.w-o.currentSizeDiff.width-(curleft<0?0:curleft));if(curheight+o.currentSizeDiff.height+curtop>=o.cdata.h)el.css('height',o.cdata.h-o.currentSizeDiff.height-(curtop<0?0:curtop))}o.currentPosition={left:curleft,top:curtop};if(!o.proxy)this._proportionallyResize();this.propagate("resize",e);return false}})})(jQuery);(function($){$.fn.extend({draggable:function(options){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var drag=$.data(this,"ui-draggable");drag[options].apply(drag,args)}else if(!$.data(this,"ui-draggable"))new $.ui.draggable(this,options)})}});$.ui.draggable=function(element,options){var self=this;this.element=$(element);$.data(element,"ui-draggable",this);this.element.addClass("ui-draggable");this.options=$.extend({},options);var o=this.options;$.extend(o,{helper:o.ghosting==true?'clone':(o.helper||'original'),handle:o.handle?($(o.handle,element)[0]?$(o.handle,element):this.element):this.element,appendTo:o.appendTo||'parent'});$(element).bind("setData.draggable",function(event,key,value){self.options[key]=value}).bind("getData.draggable",function(event,key){return self.options[key]});$(o.handle).mouseInteraction({executor:this,delay:o.delay,distance:o.distance||0,dragPrevention:o.prevention?o.prevention.toLowerCase().split(','):['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag,condition:function(e){return!(e.target.className.indexOf("ui-resizable-handle")!=-1||this.disabled)}});if(o.helper=='original'&&(this.element.css('position')=='static'||this.element.css('position')==''))this.element.css('position','relative')};$.extend($.ui.draggable.prototype,{plugins:{},ui:function(e){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,instance:this,options:this.options}},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);return this.element.triggerHandler(n=="drag"?n:"drag"+n,[e,this.ui()],this.options[n])},destroy:function(){this.handle.removeMouseInteraction();this.element.removeClass("ui-draggable ui-draggable-disabled").removeData("ui-draggable").unbind(".draggable")},enable:function(){this.element.removeClass("ui-draggable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-draggable-disabled");this.disabled=true},recallOffset:function(e){var elementPosition={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};var r=this.helper.css('position')=='relative';this.originalPosition={left:(r?parseInt(this.helper.css('left'),10)||0:elementPosition.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(r?parseInt(this.helper.css('top'),10)||0:elementPosition.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:this._pageX-this.originalPosition.left,top:this._pageY-this.originalPosition.top}},start:function(e){var o=this.options;if($.ui.ddmanager)$.ui.ddmanager.current=this;this.helper=typeof o.helper=='function'?$(o.helper.apply(this.element[0],[e])):(o.helper=='clone'?this.element.clone().appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo)):this.element);if(this.helper[0]!=this.element[0])this.helper.css('position','absolute');if(!this.helper.parents('body').length)this.helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));this.offsetParent=(function(cp){while(cp){if(cp.style&&(/(absolute|relative|fixed)/).test($.css(cp,'position')))return $(cp);cp=cp.parentNode?cp.parentNode:null};return $("body")})(this.helper[0].parentNode);this.elementOffset=this.element.offset();this.offsetParentOffset=this.offsetParent.offset();var elementPosition={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};this._pageX=e.pageX;this._pageY=e.pageY;this.clickOffset={left:e.pageX-this.elementOffset.left,top:e.pageY-this.elementOffset.top};var r=this.helper.css('position')=='relative';this.originalPosition={left:(r?parseInt(this.helper.css('left'),10)||0:elementPosition.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(r?parseInt(this.helper.css('top'),10)||0:elementPosition.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};if(this.element.css('position')=='fixed'){this.originalPosition.top-=this.offsetParent[0]==document.body?$(document).scrollTop():this.offsetParent[0].scrollTop;this.originalPosition.left-=this.offsetParent[0]==document.body?$(document).scrollLeft():this.offsetParent[0].scrollLeft}this.offset={left:e.pageX-this.originalPosition.left,top:e.pageY-this.originalPosition.top};this.propagate("start",e);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,e);if(o.cursorAt){if(o.cursorAt.top!=undefined||o.cursorAt.bottom!=undefined){this.offset.top-=this.clickOffset.top-(o.cursorAt.top!=undefined?o.cursorAt.top:(this.helperProportions.height-o.cursorAt.bottom));this.clickOffset.top=(o.cursorAt.top!=undefined?o.cursorAt.top:(this.helperProportions.height-o.cursorAt.bottom))}if(o.cursorAt.left!=undefined||o.cursorAt.right!=undefined){this.offset.left-=this.clickOffset.left-(o.cursorAt.left!=undefined?o.cursorAt.left:(this.helperProportions.width-o.cursorAt.right));this.clickOffset.left=(o.cursorAt.left!=undefined?o.cursorAt.left:(this.helperProportions.width-o.cursorAt.right))}}return false},clear:function(){if($.ui.ddmanager)$.ui.ddmanager.current=null;this.helper=null},stop:function(e){if($.ui.ddmanager&&!this.options.dropBehaviour)$.ui.ddmanager.drop(this,e);this.propagate("stop",e);if(this.cancelHelperRemoval)return false;if(this.options.helper!='original')this.helper.remove();this.clear();return false},drag:function(e){this.position={top:e.pageY-this.offset.top,left:e.pageX-this.offset.left};this.positionAbs={left:e.pageX-this.clickOffset.left,top:e.pageY-this.clickOffset.top};this.position=this.propagate("drag",e)||this.position;this.helper.css({left:this.position.left+'px',top:this.position.top+'px'});if($.ui.ddmanager)$.ui.ddmanager.drag(this,e);return false}})})(jQuery);(function($){$.ui.plugin.add("draggable","cursor",{start:function(e,ui){var t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor)},stop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor)}});$.ui.plugin.add("draggable","zIndex",{start:function(e,ui){var t=$(ui.helper);if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex)},stop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex)}});$.ui.plugin.add("draggable","opacity",{start:function(e,ui){var t=$(ui.helper);if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',ui.options.opacity)},stop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opacity',ui.options._opacity)}});$.ui.plugin.add("draggable","revert",{stop:function(e,ui){var self=ui.instance;self.cancelHelperRemoval=true;$(ui.helper).animate({left:self.originalPosition.left,top:self.originalPosition.top},parseInt(ui.options.revert,10)||500,function(){if(ui.options.helper!='original')self.helper.remove();self.clear()})}});$.ui.plugin.add("draggable","iframeFix",{start:function(e,ui){var o=ui.options;if(ui.instance.slowMode)return;if(o.iframeFix.constructor==Array){for(var i=0;i<o.iframeFix.length;i++){var co=$(o.iframeFix[i]).offset({border:false});$('<div class="DragDropIframeFix"" style="background: #fff;"></div>').css("width",$(o.iframeFix[i])[0].offsetWidth+"px").css("height",$(o.iframeFix[i])[0].offsetHeight+"px").css("position","absolute").css("opacity","0.001").css("z-index","1000").css("top",co.top+"px").css("left",co.left+"px").appendTo("body")}}else{$("iframe").each(function(){var co=$(this).offset({border:false});$('<div class="DragDropIframeFix" style="background: #fff;"></div>').css("width",this.offsetWidth+"px").css("height",this.offsetHeight+"px").css("position","absolute").css("opacity","0.001").css("z-index","1000").css("top",co.top+"px").css("left",co.left+"px").appendTo("body")})}},stop:function(e,ui){if(ui.options.iframeFix)$("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});$.ui.plugin.add("draggable","containment",{start:function(e,ui){var o=ui.options;if((o.containment.left!=undefined||o.containment.constructor==Array)&&!o._containment)return;if(!o._containment)o._containment=o.containment;if(o._containment=='parent')o._containment=this[0].parentNode;if(o._containment=='document'){o.containment=[0,0,$(document).width(),($(document).height()||document.body.parentNode.scrollHeight)]}else{var ce=$(o._containment)[0];var co=$(o._containment).offset();o.containment=[co.left,co.top,co.left+(ce.offsetWidth||ce.scrollWidth),co.top+(ce.offsetHeight||ce.scrollHeight)]}},drag:function(e,ui){var o=ui.options;var h=ui.helper;var c=o.containment;var self=ui.instance;if(c.constructor==Array){if((ui.absolutePosition.left<c[0]))self.position.left=c[0]-(self.offset.left-self.clickOffset.left);if((ui.absolutePosition.top<c[1]))self.position.top=c[1]-(self.offset.top-self.clickOffset.top);if(ui.absolutePosition.left-c[2]+self.helperProportions.width>=0)self.position.left=c[2]-(self.offset.left-self.clickOffset.left)-self.helperProportions.width;if(ui.absolutePosition.top-c[3]+self.helperProportions.height>=0)self.position.top=c[3]-(self.offset.top-self.clickOffset.top)-self.helperProportions.height}else{if((ui.position.left<c.left))self.position.left=c.left;if((ui.position.top<c.top))self.position.top=c.top;if(ui.position.left-self.offsetParent.innerWidth()+self.helperProportions.width+c.right+(parseInt(self.offsetParent.css("borderLeftWidth"),10)||0)+(parseInt(self.offsetParent.css("borderRightWidth"),10)||0)>=0)self.position.left=self.offsetParent.innerWidth()-self.helperProportions.width-c.right-(parseInt(self.offsetParent.css("borderLeftWidth"),10)||0)-(parseInt(self.offsetParent.css("borderRightWidth"),10)||0);if(ui.position.top-self.offsetParent.innerHeight()+self.helperProportions.height+c.bottom+(parseInt(self.offsetParent.css("borderTopWidth"),10)||0)+(parseInt(self.offsetParent.css("borderBottomWidth"),10)||0)>=0)self.position.top=self.offsetParent.innerHeight()-self.helperProportions.height-c.bottom-(parseInt(self.offsetParent.css("borderTopWidth"),10)||0)-(parseInt(self.offsetParent.css("borderBottomWidth"),10)||0)}}});$.ui.plugin.add("draggable","grid",{drag:function(e,ui){var o=ui.options;ui.instance.position.left=ui.instance.originalPosition.left+Math.round((e.pageX-ui.instance._pageX)/o.grid[0])*o.grid[0];ui.instance.position.top=ui.instance.originalPosition.top+Math.round((e.pageY-ui.instance._pageY)/o.grid[1])*o.grid[1]}});$.ui.plugin.add("draggable","axis",{drag:function(e,ui){var o=ui.options;if(o.constraint)o.axis=o.constraint;o.axis=='x'?ui.instance.position.top=ui.instance.originalPosition.top:ui.instance.position.left=ui.instance.originalPosition.left}});$.ui.plugin.add("draggable","scroll",{start:function(e,ui){var o=ui.options;o.scrollSensitivity=o.scrollSensitivity||20;o.scrollSpeed=o.scrollSpeed||20;ui.instance.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this);ui.instance.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this)},drag:function(e,ui){var o=ui.options;var i=ui.instance;if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if(i.overflowY[0].offsetHeight-(ui.position.top-i.overflowY[0].scrollTop+i.clickOffset.top)<o.scrollSensitivity)i.overflowY[0].scrollTop=i.overflowY[0].scrollTop+o.scrollSpeed;if((ui.position.top-i.overflowY[0].scrollTop+i.clickOffset.top)<o.scrollSensitivity)i.overflowY[0].scrollTop=i.overflowY[0].scrollTop-o.scrollSpeed}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if(i.overflowX[0].offsetWidth-(ui.position.left-i.overflowX[0].scrollLeft+i.clickOffset.left)<o.scrollSensitivity)i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft+o.scrollSpeed;if((ui.position.top-i.overflowX[0].scrollLeft+i.clickOffset.left)<o.scrollSensitivity)i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft-o.scrollSpeed}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}ui.instance.recallOffset(e)}});$.ui.plugin.add("draggable","snap",{start:function(e,ui){ui.instance.snapElements=[];$(ui.options.snap===true?'.ui-draggable':ui.options.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=ui.instance.element[0])ui.instance.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})})},drag:function(e,ui){var d=ui.options.snapTolerance||20;var x1=ui.absolutePosition.left,x2=x1+ui.instance.helperProportions.width,y1=ui.absolutePosition.top,y2=y1+ui.instance.helperProportions.height;for(var i=ui.instance.snapElements.length-1;i>=0;i--){var l=ui.instance.snapElements[i].left,r=l+ui.instance.snapElements[i].width,t=ui.instance.snapElements[i].top,b=t+ui.instance.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d)))continue;if(ui.options.snapMode!='inner'){var ts=Math.abs(t-y2)<=20;var bs=Math.abs(b-y1)<=20;var ls=Math.abs(l-x2)<=20;var rs=Math.abs(r-x1)<=20;if(ts)ui.position.top=t-ui.instance.offset.top+ui.instance.clickOffset.top-ui.instance.helperProportions.height;if(bs)ui.position.top=b-ui.instance.offset.top+ui.instance.clickOffset.top;if(ls)ui.position.left=l-ui.instance.offset.left+ui.instance.clickOffset.left-ui.instance.helperProportions.width;if(rs)ui.position.left=r-ui.instance.offset.left+ui.instance.clickOffset.left}if(ui.options.snapMode!='outer'){var ts=Math.abs(t-y1)<=20;var bs=Math.abs(b-y2)<=20;var ls=Math.abs(l-x1)<=20;var rs=Math.abs(r-x2)<=20;if(ts)ui.position.top=t-ui.instance.offset.top+ui.instance.clickOffset.top;if(bs)ui.position.top=b-ui.instance.offset.top+ui.instance.clickOffset.top-ui.instance.helperProportions.height;if(ls)ui.position.left=l-ui.instance.offset.left+ui.instance.clickOffset.left;if(rs)ui.position.left=r-ui.instance.offset.left+ui.instance.clickOffset.left-ui.instance.helperProportions.width}}}})})(jQuery);(function($){$.fn.extend({droppable:function(options){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var drop=$.data(this,"ui-droppable");drop[options].apply(drop,args)}else if(!$.data(this,"ui-droppable"))new $.ui.droppable(this,options)})}});$.ui.droppable=function(element,options){this.element=$(element);$.data(element,"ui-droppable",this);this.element.addClass("ui-droppable");this.options=$.extend({},options);var o=this.options;var accept=o.accept;$.extend(o,{accept:o.accept&&o.accept.constructor==Function?o.accept:function(d){return $(d).is(accept)},tolerance:o.tolerance||'intersect'});$(element).bind("setData.draggable",function(event,key,value){o[key]=value}).bind("getData.draggable",function(event,key){return o[key]});this.proportions={width:this.element.outerWidth(),height:this.element.outerHeight()};$.ui.ddmanager.droppables.push({item:this,over:0,out:1})};$.extend($.ui.droppable.prototype,{plugins:{},ui:function(c){return{instance:this,draggable:c.element,helper:c.helper,position:c.position,absolutePosition:c.positionAbs,options:this.options}},destroy:function(){var drop=$.ui.ddmanager.droppables;for(var i=0;i<drop.length;i++)if(drop[i].item==this)drop.splice(i,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("ui-droppable").unbind(".droppable")},enable:function(){this.element.removeClass("ui-droppable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-droppable-disabled");this.disabled=true},over:function(e){var draggable=$.ui.ddmanager.current;if(!draggable||draggable.element[0]==this.element[0])return;if(this.options.accept.call(this.element,draggable.element)){$.ui.plugin.call(this,'over',[e,this.ui(draggable)]);this.element.triggerHandler("dropover",[e,this.ui(draggable)],this.options.over)}},out:function(e){var draggable=$.ui.ddmanager.current;if(!draggable||draggable.element[0]==this.element[0])return;if(this.options.accept.call(this.element,draggable.element)){$.ui.plugin.call(this,'out',[e,this.ui(draggable)]);this.element.triggerHandler("dropout",[e,this.ui(draggable)],this.options.out)}},drop:function(e){var draggable=$.ui.ddmanager.current;if(!draggable||draggable.element[0]==this.element[0])return;if(this.options.accept.call(this.element,draggable.element)){$.ui.plugin.call(this,'drop',[e,this.ui(draggable)]);this.element.triggerHandler("drop",[e,this.ui(draggable)],this.options.drop)}},activate:function(e){var draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'activate',[e,this.ui(draggable)]);if(draggable)this.element.triggerHandler("dropactivate",[e,this.ui(draggable)],this.options.activate)},deactivate:function(e){var draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'deactivate',[e,this.ui(draggable)]);if(draggable)this.element.triggerHandler("dropdeactivate",[e,this.ui(draggable)],this.options.deactivate)}});$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset)return false;var x1=draggable.positionAbs.left,x2=x1+draggable.helperProportions.width,y1=draggable.positionAbs.top,y2=y1+draggable.helperProportions.height;var l=droppable.offset.left,r=l+droppable.item.proportions.width,t=droppable.offset.top,b=t+droppable.item.proportions.height;switch(toleranceMode){case'fit':return(l<x1&&x2<r&&t<y1&&y2<b);break;case'intersect':return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);break;case'pointer':return(l<(draggable.positionAbs.left+draggable.clickOffset.left)&&(draggable.positionAbs.left+draggable.clickOffset.left)<r&&t<(draggable.positionAbs.top+draggable.clickOffset.top)&&(draggable.positionAbs.top+draggable.clickOffset.top)<b);break;case'touch':return((l<x1&&x1<r&&t<y1&&y1<b)||(l<x1&&x1<r&&t<y2&&y2<b)||(l<x2&&x2<r&&t<y1&&y1<b)||(l<x2&&x2<r&&t<y2&&y2<b));break;default:return false;break}};$.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(t,e){var m=$.ui.ddmanager.droppables;for(var i=0;i<m.length;i++){if(m[i].item.disabled||(t&&!m[i].item.options.accept.call(m[i].item.element,t.element)))continue;m[i].offset=$(m[i].item.element).offset();if(t)m[i].item.activate.call(m[i].item,e)}},drop:function(draggable,e){$.each($.ui.ddmanager.droppables,function(){if(!this.item.disabled&&$.ui.intersect(draggable,this,this.item.options.tolerance))this.item.drop.call(this.item,e);if(!this.item.disabled&&this.item.options.accept.call(this.item.element,draggable.element)){this.out=1;this.over=0;this.item.deactivate.call(this.item,e)}})},drag:function(draggable,e){if(draggable.options.refreshPositions)$.ui.ddmanager.prepareOffsets();$.each($.ui.ddmanager.droppables,function(){if(this.item.disabled)return false;var intersects=$.ui.intersect(draggable,this,this.item.options.tolerance);var c=!intersects&&this.over==1?'out':(intersects&&this.over==0?'over':null);if(!c)return;this[c]=1;this[c=='out'?'over':'out']=0;this.item[c].call(this.item,e)})}}})(jQuery);(function($){$.ui.plugin.add("droppable","activeClass",{activate:function(e,ui){$(this).addClass(ui.options.activeClass)},deactivate:function(e,ui){$(this).removeClass(ui.options.activeClass)},drop:function(e,ui){$(this).removeClass(ui.options.activeClass)}});$.ui.plugin.add("droppable","hoverClass",{over:function(e,ui){$(this).addClass(ui.options.hoverClass)},out:function(e,ui){$(this).removeClass(ui.options.hoverClass)},drop:function(e,ui){$(this).removeClass(ui.options.hoverClass)}})})(jQuery);(function($){if(window.Node&&Node.prototype&&!Node.prototype.contains){Node.prototype.contains=function(arg){return!!(this.compareDocumentPosition(arg)&16)}}$.fn.extend({sortable:function(options){var args=Array.prototype.slice.call(arguments,1);if(options=="serialize")return $.data(this[0],"ui-sortable").serialize(arguments[1]);return this.each(function(){if(typeof options=="string"){var sort=$.data(this,"ui-sortable");sort[options].apply(sort,args)}else if(!$.data(this,"ui-sortable"))new $.ui.sortable(this,options)})}});$.ui.sortable=function(element,options){var self=this;this.element=$(element);$.data(element,"ui-sortable",this);this.element.addClass("ui-sortable");this.options=$.extend({},options);var o=this.options;$.extend(o,{items:this.options.items||'> *',zIndex:this.options.zIndex||1000,startCondition:function(){return!self.disabled}});$(element).bind("setData.sortable",function(event,key,value){self.options[key]=value}).bind("getData.sortable",function(event,key){return self.options[key]});this.refresh();this.floating=/left|right/.test(this.items[0].item.css('float'));if(!(/(relative|absolute|fixed)/).test(this.element.css('position')))this.element.css('position','relative');this.offset=this.element.offset({border:false});this.element.mouseInteraction({executor:this,delay:o.delay,distance:o.distance||0,dragPrevention:o.prevention?o.prevention.toLowerCase().split(','):['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag,condition:function(e){if(this.disabled)return false;var currentItem=null,nodes=$(e.target).parents().andSelf().each(function(){if($.data(this,'ui-sortable-item'))currentItem=$(this)});if(currentItem&&(!this.options.handle||$(e.target).parents().andSelf().is(this.options.handle))){this.currentItem=currentItem;return true}else return false}})};$.extend($.ui.sortable.prototype,{plugins:{},ui:function(){return{helper:this.helper,placeholder:this.placeholder||$([]),position:this.position,absolutePosition:this.positionAbs,instance:this,options:this.options}},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="sort"?n:"sort"+n,[e,this.ui()],this.options[n])},serialize:function(o){var items=$(this.options.items,this.element).not('.ui-sortable-helper');var str=[];o=o||{};items.each(function(){var res=(this.getAttribute(o.attribute||'id')||'').match(o.expression||(/(.+)[-=_](.+)/));if(res)str.push((o.key||res[1])+'[]='+(o.key?res[1]:res[2]))});return str.join('&')},intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b)},refresh:function(){this.items=[];var items=this.items;var queries=[$(this.options.items,this.element)];if(this.options.connectWith){for(var i=this.options.connectWith.length-1;i>=0;i--){var inst=$.data($(this.options.connectWith[i])[0],'ui-sortable');if(inst&&!inst.disabled)queries.push($(inst.options.items,inst.element))}}for(var i=queries.length-1;i>=0;i--){queries[i].each(function(){$.data(this,'ui-sortable-item',true);items.push({item:$(this),width:0,height:0,left:0,top:0})})}},refreshPositions:function(fast){for(var i=this.items.length-1;i>=0;i--){if(!fast)this.items[i].width=this.items[i].item.outerWidth();if(!fast)this.items[i].height=this.items[i].item.outerHeight();var p=this.items[i].item.offset();this.items[i].left=p.left;this.items[i].top=p.top}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("ui-sortable").unbind(".sortable").removeMouseInteraction();for(var i=this.items.length-1;i>=0;i--)this.items[i].item.removeData("ui-sortable-item")},enable:function(){this.element.removeClass("ui-sortable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-sortable-disabled");this.disabled=true},createPlaceholder:function(){this.placeholderElement=this.options.placeholderElement?$(this.options.placeholderElement,this.currentItem):this.currentItem;this.placeholder=$('<div></div>').addClass(this.options.placeholder).appendTo('body').css({position:'absolute'}).css(this.placeholderElement.offset()).css({width:this.placeholderElement.outerWidth(),height:this.placeholderElement.outerHeight()})},recallOffset:function(e){var elementPosition={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};var r=this.helper.css('position')=='relative';this.originalPosition={left:(r?parseInt(this.helper.css('left'),10)||0:elementPosition.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(r?parseInt(this.helper.css('top'),10)||0:elementPosition.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:this._pageX-this.originalPosition.left+(parseInt(this.currentItem.css('marginLeft'),10)||0),top:this._pageY-this.originalPosition.top+(parseInt(this.currentItem.css('marginTop'),10)||0)}},start:function(e){var o=this.options;this.refresh();this.refreshPositions();this.helper=typeof o.helper=='function'?$(o.helper.apply(this.element[0],[e,this.currentItem])):this.currentItem.clone();this.helper.appendTo(this.currentItem[0].parentNode).css({position:'absolute',clear:'both'}).addClass('ui-sortable-helper');this.offsetParent=(function(cp){while(cp){if(cp.style&&(/(absolute|relative|fixed)/).test($.css(cp,'position')))return $(cp);cp=cp.parentNode?cp.parentNode:null};return $("body")})(this.helper[0].parentNode);this.elementOffset=this.currentItem.offset();this.offsetParentOffset=this.offsetParent.offset();var elementPosition={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};this._pageX=e.pageX;this._pageY=e.pageY;this.clickOffset={left:e.pageX-this.elementOffset.left,top:e.pageY-this.elementOffset.top};var r=this.helper.css('position')=='relative';this.originalPosition={left:(r?parseInt(this.helper.css('left'),10)||0:elementPosition.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(r?parseInt(this.helper.css('top'),10)||0:elementPosition.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:e.pageX-this.originalPosition.left+(parseInt(this.currentItem.css('marginLeft'),10)||0),top:e.pageY-this.originalPosition.top+(parseInt(this.currentItem.css('marginTop'),10)||0)};this.position={top:e.pageY-this.offset.top,left:e.pageX-this.offset.left};this.positionAbs={left:e.pageX-this.clickOffset.left,top:e.pageY-this.clickOffset.top};this.positionDOM=this.currentItem.prev()[0];if(o.placeholder)this.createPlaceholder();this.propagate("start",e);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};$(this.currentItem).css('visibility','hidden');return false},stop:function(e){this.propagate("stop",e);if(this.positionDOM!=this.currentItem.prev()[0])this.propagate("update",e);if(this.cancelHelperRemoval)return false;$(this.currentItem).css('visibility','');if(this.placeholder)this.placeholder.remove();this.helper.remove();return false},drag:function(e){this.direction=(this.floating&&this.positionAbs.left>e.pageX-this.clickOffset.left)||(this.positionAbs.top>e.pageY-this.clickOffset.top)?'down':'up';this.position={top:e.pageY-this.offset.top,left:e.pageX-this.offset.left};this.positionAbs={left:e.pageX-this.clickOffset.left,top:e.pageY-this.clickOffset.top};for(var i=this.items.length-1;i>=0;i--){if(this.intersectsWith(this.items[i])&&this.items[i].item[0]!=this.currentItem[0]&&(this.options.tree?!this.currentItem[0].contains(this.items[i].item[0]):true)){this.items[i].item[this.direction=='down'?'before':'after'](this.currentItem);this.refreshPositions(true);if(this.placeholderElement)this.placeholder.css(this.placeholderElement.offset());this.propagate("change",e);break}}this.propagate("sort",e);this.helper.css({left:this.position.left+'px',top:this.position.top+'px'});return false}})})(jQuery);(function($){$.ui.plugin.add("sortable","cursor",{start:function(e,ui){var t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor)},stop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor)}});$.ui.plugin.add("sortable","zIndex",{start:function(e,ui){var t=ui.helper;if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex)},stop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex)}});$.ui.plugin.add("sortable","opacity",{start:function(e,ui){var t=ui.helper;if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',ui.options.opacity)},stop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opacity',ui.options._opacity)}});$.ui.plugin.add("sortable","revert",{stop:function(e,ui){var self=ui.instance;self.cancelHelperRemoval=true;var cur=self.currentItem.offset();if(ui.instance.options.zIndex)ui.helper.css('zIndex',ui.instance.options.zIndex);if(ui.instance.placeholder)ui.instance.placeholder.animate({opacity:'hide'},parseInt(ui.options.revert,10)||500);ui.helper.animate({left:cur.left-self.offsetParentOffset.left-(parseInt(self.currentItem.css('marginLeft'),10)||0),top:cur.top-self.offsetParentOffset.top-(parseInt(self.currentItem.css('marginTop'),10)||0)},parseInt(ui.options.revert,10)||500,function(){self.currentItem.css('visibility','visible');window.setTimeout(function(){if(self.placeholder)self.placeholder.remove();self.helper.remove();if(ui.options._zIndex)ui.helper.css('zIndex',ui.options._zIndex)},50)})}});$.ui.plugin.add("sortable","containment",{start:function(e,ui){var o=ui.options;if((o.containment.left!=undefined||o.containment.constructor==Array)&&!o._containment)return;if(!o._containment)o._containment=o.containment;if(o._containment=='parent')o._containment=this[0].parentNode;if(o._containment=='document'){o.containment=[0,0,$(document).width(),($(document).height()||document.body.parentNode.scrollHeight)]}else{var ce=$(o._containment)[0];var co=$(o._containment).offset();o.containment=[co.left,co.top,co.left+(ce.offsetWidth||ce.scrollWidth),co.top+(ce.offsetHeight||ce.scrollHeight)]}},sort:function(e,ui){var o=ui.options;var h=ui.helper;var c=o.containment;var self=ui.instance;if(c.constructor==Array){if((ui.absolutePosition.left<c[0]))self.position.left=c[0]-(self.offset.left-self.clickOffset.left);if((ui.absolutePosition.top<c[1]))self.position.top=c[1]-(self.offset.top-self.clickOffset.top);if(ui.absolutePosition.left-c[2]+self.helperProportions.width>=0)self.position.left=c[2]-(self.offset.left-self.clickOffset.left)-self.helperProportions.width;if(ui.absolutePosition.top-c[3]+self.helperProportions.height>=0)self.position.top=c[3]-(self.offset.top-self.clickOffset.top)-self.helperProportions.height}else{if((ui.position.left<c.left))self.position.left=c.left;if((ui.position.top<c.top))self.position.top=c.top;if(ui.position.left-self.offsetParent.innerWidth()+self.helperProportions.width+c.right+(parseInt(self.offsetParent.css("borderLeftWidth"),10)||0)+(parseInt(self.offsetParent.css("borderRightWidth"),10)||0)>=0)self.position.left=self.offsetParent.innerWidth()-self.helperProportions.width-c.right-(parseInt(self.offsetParent.css("borderLeftWidth"),10)||0)-(parseInt(self.offsetParent.css("borderRightWidth"),10)||0);if(ui.position.top-self.offsetParent.innerHeight()+self.helperProportions.height+c.bottom+(parseInt(self.offsetParent.css("borderTopWidth"),10)||0)+(parseInt(self.offsetParent.css("borderBottomWidth"),10)||0)>=0)self.position.top=self.offsetParent.innerHeight()-self.helperProportions.height-c.bottom-(parseInt(self.offsetParent.css("borderTopWidth"),10)||0)-(parseInt(self.offsetParent.css("borderBottomWidth"),10)||0)}}});$.ui.plugin.add("sortable","axis",{sort:function(e,ui){var o=ui.options;if(o.constraint)o.axis=o.constraint;o.axis=='x'?ui.instance.position.top=ui.instance.originalPosition.top:ui.instance.position.left=ui.instance.originalPosition.left}});$.ui.plugin.add("sortable","scroll",{start:function(e,ui){var o=ui.options;o.scrollSensitivity=o.scrollSensitivity||20;o.scrollSpeed=o.scrollSpeed||20;ui.instance.overflowY=function(el){do{if((/auto|scroll/).test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this);ui.instance.overflowX=function(el){do{if((/auto|scroll/).test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this)},sort:function(e,ui){var o=ui.options;var i=ui.instance;if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if(i.overflowY[0].offsetHeight-(ui.position.top-i.overflowY[0].scrollTop+i.clickOffset.top)<o.scrollSensitivity)i.overflowY[0].scrollTop=i.overflowY[0].scrollTop+o.scrollSpeed;if((ui.position.top-i.overflowY[0].scrollTop+i.clickOffset.top)<o.scrollSensitivity)i.overflowY[0].scrollTop=i.overflowY[0].scrollTop-o.scrollSpeed}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if(i.overflowX[0].offsetWidth-(ui.position.left-i.overflowX[0].scrollLeft+i.clickOffset.left)<o.scrollSensitivity)i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft+o.scrollSpeed;if((ui.position.top-i.overflowX[0].scrollLeft+i.clickOffset.left)<o.scrollSensitivity)i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft-o.scrollSpeed}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}ui.instance.recallOffset(e)}})})(jQuery);(function($){$.ui=$.ui||{};$.fn.extend({selectable:function(options){return this.each(function(){if(typeof options=="string"){var select=$.data(this,"ui-selectable");select[options].apply(select,args)}else if(!$.data(this,"ui-selectable"))new $.ui.selectable(this,options)})}});$.ui.selectable=function(element,options){var instance=this;this.element=$(element);$.data(this.element,"ui-selectable",this);this.element.addClass("ui-selectable");this.options=$.extend({appendTo:'body',autoRefresh:true,filter:'*',tolerance:'touch'},options);$(element).bind("setData.selectable",function(event,key,value){instance.options[key]=value}).bind("getData.selectable",function(event,key){return instance.options[key]});this.dragged=false;var selectees;this.refresh=function(){selectees=$(instance.options.filter,instance.element[0]);selectees.each(function(){var $this=$(this);var pos=$this.offset();$.data(this,"ui-selectee",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.width(),bottom:pos.top+$this.height(),startselected:false,selected:$this.hasClass('ui-selected'),selecting:$this.hasClass('ui-selecting'),unselecting:$this.hasClass('ui-unselecting')})})};this.refresh();this.selectees=selectees.addClass("ui-selectee");this.element.mouseInteraction({executor:this,appendTo:'body',delay:0,distance:0,dragPrevention:['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag});this.helper=$(document.createElement('div')).css({border:'1px dotted black'})};$.extend($.ui.selectable.prototype,{toggle:function(){if(this.disabled){this.enable()}else{this.disable()}},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("ui-selectable").unbind(".selectable");this.removeMouseInteraction()},enable:function(){this.element.removeClass("ui-selectable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-selectable-disabled");this.disabled=true},start:function(ev,element){this.opos=[ev.pageX,ev.pageY];if(this.disabled)return;var options=this.options;this.selectees=$(options.filter,element);this.element.triggerHandler("selectablestart",[ev,{"selectable":element,"options":options}],options.start);$('body').append(this.helper);this.helper.css({"z-index":100,"position":"absolute","left":ev.clientX,"top":ev.clientY,"width":0,"height":0});if(options.autoRefresh){this.refresh()}this.selectees.filter('.ui-selected').each(function(){var selectee=$.data(this,"ui-selectee");selectee.startselected=true;if(!ev.ctrlKey){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;$(this.element).triggerHandler("selectableunselecting",[ev,{selectable:element,unselecting:selectee.element,options:options}],options.unselecting)}})},drag:function(ev,element){this.dragged=true;if(this.disabled)return;var options=this.options;var x1=this.opos[0],y1=this.opos[1],x2=ev.pageX,y2=ev.pageY;if(x1>x2){var tmp=x2;x2=x1;x1=tmp}if(y1>y2){var tmp=y2;y2=y1;y1=tmp}this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"ui-selectee");if(selectee.element==element)return;var hit=false;if(options.tolerance=='touch'){hit=(!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1))}else if(options.tolerance=='fit'){hit=(selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2)}if(hit){if(selectee.selected){selectee.$element.removeClass('ui-selected');selectee.selected=false}if(selectee.unselecting){selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false}if(!selectee.selecting){selectee.$element.addClass('ui-selecting');selectee.selecting=true;$(this.element).triggerHandler("selectableselecting",[ev,{selectable:element,selecting:selectee.element,options:options}],options.selecting)}}else{if(selectee.selecting){if(ev.ctrlKey&&selectee.startselected){selectee.$element.removeClass('ui-selecting');selectee.selecting=false;selectee.$element.addClass('ui-selected');selectee.selected=true}else{selectee.$element.removeClass('ui-selecting');selectee.selecting=false;if(selectee.startselected){selectee.$element.addClass('ui-unselecting');selectee.unselecting=true}$(this.element).triggerHandler("selectableunselecting",[ev,{selectable:element,unselecting:selectee.element,options:options}],options.unselecting)}}if(selectee.selected){if(!ev.ctrlKey&&!selectee.startselected){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;$(this.element).triggerHandler("selectableunselecting",[ev,{selectable:element,unselecting:selectee.element,options:options}],options.unselecting)}}}})},stop:function(ev,element){this.dragged=false;var options=this.options;$('.ui-unselecting',this.element).each(function(){var selectee=$.data(this,"ui-selectee");selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false;selectee.startselected=false;$(this.element).triggerHandler("selectableunselected",[ev,{selectable:element,unselected:selectee.element,options:options}],options.unselected)});$('.ui-selecting',this.element).each(function(){var selectee=$.data(this,"ui-selectee");selectee.$element.removeClass('ui-selecting').addClass('ui-selected');selectee.selecting=false;selectee.selected=true;selectee.startselected=true;$(this.element).triggerHandler("selectableselected",[ev,{selectable:element,selected:selectee.element,options:options}],options.selected)});$(this.element).triggerHandler("selectablestop",[ev,{selectable:element,options:this.options}],this.options.stop);this.helper.remove()}})})(jQuery);(function($){$.ui=$.ui||{};$.fn.extend({accordion:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var accordion=$.data(this,"ui-accordion");accordion[options].apply(accordion,args)}else if(!$(this).is(".ui-accordion"))$.data(this,"ui-accordion",new $.ui.accordion(this,options))})},activate:function(index){return this.accordion("activate",index)}});$.ui.accordion=function(container,options){this.options=options=$.extend({},$.ui.accordion.defaults,options);this.element=container;$(container).addClass("ui-accordion");if(options.navigation){var current=$(container).find("a").filter(options.navigationFilter);if(current.length){if(current.filter(options.header).length){options.active=current}else{options.active=current.parent().parent().prev();current.addClass("current")}}}options.headers=$(container).find(options.header);options.active=findActive(options.headers,options.active);if(options.fillSpace){var maxHeight=$(container).parent().height();options.headers.each(function(){maxHeight-=$(this).outerHeight()});var maxPadding=0;options.headers.next().each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height())}).height(maxHeight-maxPadding)}else if(options.autoheight){var maxHeight=0;options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight())}).height(maxHeight)}options.headers.not(options.active||"").next().hide();options.active.parent().andSelf().addClass(options.selectedClass);if(options.event)$(container).bind((options.event||"")+".ui-accordion",clickHandler)};$.ui.accordion.prototype={activate:function(index){clickHandler.call(this.element,{target:findActive(this.options.headers,index)[0]})},enable:function(){this.options.disabled=false},disable:function(){this.options.disabled=true},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoheight){this.options.headers.next().css("height","")}$.removeData(this.element,"ui-accordion");$(this.element).removeClass("ui-accordion").unbind(".ui-accordion")}};function scopeCallback(callback,scope){return function(){return callback.apply(scope,arguments)}};function completed(cancel){if(!$.data(this,"ui-accordion"))return;var instance=$.data(this,"ui-accordion");var options=instance.options;options.running=cancel?0:--options.running;if(options.running)return;if(options.clearStyle){options.toShow.add(options.toHide).css({height:"",overflow:""})}$(this).triggerHandler("change.ui-accordion",[options.data],options.change)}function toggle(toShow,toHide,data,clickedActive,down){var options=$.data(this,"ui-accordion").options;options.toShow=toShow;options.toHide=toHide;options.data=data;var complete=scopeCallback(completed,this);options.running=toHide.size()==0?toShow.size():toHide.size();if(options.animated){if(!options.alwaysOpen&&clickedActive){$.ui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoheight:options.autoheight})}else{$.ui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoheight:options.autoheight})}}else{if(!options.alwaysOpen&&clickedActive){toShow.toggle()}else{toHide.hide();toShow.show()}complete(true)}}function clickHandler(event){var options=$.data(this,"ui-accordion").options;if(options.disabled)return false;if(!event.target&&!options.alwaysOpen){options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide=options.active.next(),data={instance:this,options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=options.active=$([]);toggle.call(this,toShow,toHide,data);return false}var clicked=$(event.target);if(clicked.parents(options.header).length)while(!clicked.is(options.header))clicked=clicked.parent();var clickedActive=clicked[0]==options.active[0];if(options.running||(options.alwaysOpen&&clickedActive))return false;if(!clicked.is(options.header))return;options.active.parent().andSelf().toggleClass(options.selectedClass);if(!clickedActive){clicked.parent().andSelf().addClass(options.selectedClass)}var toShow=clicked.next(),toHide=options.active.next(),data={instance:this,options:options,newHeader:clicked,oldHeader:options.active,newContent:toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);options.active=clickedActive?$([]):clicked;toggle.call(this,toShow,toHide,data,clickedActive,down);return false};function findActive(headers,selector){return selector!=undefined?typeof selector=="number"?headers.filter(":eq("+selector+")"):headers.not(headers.not(selector)):selector===false?$([]):headers.filter(":eq(0)")}$.extend($.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(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return}var hideHeight=options.toHide.height(),showHeight=options.toShow.height(),difference=showHeight/hideHeight;options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(now){var current=(hideHeight-now)*difference;if($.browser.msie||$.browser.opera){current=Math.ceil(current)}options.toShow.height(current)},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoheight){options.toShow.css("height","auto")}options.complete()}})},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?1000:200})},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700})}}})})(jQuery);(function($){$.ui=$.ui||{};$.fn.extend({dialog:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof options=="string"){var dialog=$.data(this,"ui-dialog")||$.data($(this).parents(".ui-dialog:first").find(".ui-dialog-content")[0],"ui-dialog");dialog[options].apply(dialog,args)}else if(!$(this).is(".ui-dialog-content"))new $.ui.dialog(this,options)})}});$.ui.dialog=function(el,options){this.options=options=$.extend({},$.ui.dialog.defaults,options&&options.modal?{resizable:false}:{},options);this.element=el;var self=this;$.data(this.element,"ui-dialog",this);$(el).bind("setData.dialog",function(event,key,value){options[key]=value}).bind("getData.dialog",function(event,key){return options[key]});var uiDialogContent=$(el).addClass('ui-dialog-content');if(!uiDialogContent.parent().length){uiDialogContent.appendTo('body')}uiDialogContent.wrap(document.createElement('div')).wrap(document.createElement('div'));var uiDialogContainer=uiDialogContent.parent().addClass('ui-dialog-container').css({position:'relative'});var uiDialog=this.uiDialog=uiDialogContainer.parent().hide().addClass('ui-dialog').css({position:'absolute',width:options.width,height:options.height,overflow:'hidden'});var classNames=uiDialogContent.attr('className').split(' ');$.each(classNames,function(i,className){if(className!='ui-dialog-content')uiDialog.addClass(className)});if(options.resizable&&$.fn.resizable){uiDialog.append('<div class="ui-resizable-n ui-resizable-handle"></div>').append('<div class="ui-resizable-s ui-resizable-handle"></div>').append('<div class="ui-resizable-e ui-resizable-handle"></div>').append('<div class="ui-resizable-w ui-resizable-handle"></div>').append('<div class="ui-resizable-ne ui-resizable-handle"></div>').append('<div class="ui-resizable-se ui-resizable-handle"></div>').append('<div class="ui-resizable-sw ui-resizable-handle"></div>').append('<div class="ui-resizable-nw ui-resizable-handle"></div>');uiDialog.resizable({maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight})}uiDialogContainer.prepend('<div class="ui-dialog-titlebar"></div>');var uiDialogTitlebar=$('.ui-dialog-titlebar',uiDialogContainer);var title=(options.title)?options.title:(uiDialogContent.attr('title'))?uiDialogContent.attr('title'):'';uiDialogTitlebar.append('<span class="ui-dialog-title">'+title+'</span>');uiDialogTitlebar.append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>');this.uiDialogTitlebarClose=$('.ui-dialog-titlebar-close',uiDialogTitlebar).hover(function(){$(this).addClass('ui-dialog-titlebar-close-hover')},function(){$(this).removeClass('ui-dialog-titlebar-close-hover')}).mousedown(function(ev){ev.stopPropagation()}).click(function(){self.close();return false}).keydown(function(ev){var ESC=27;ev.keyCode&&ev.keyCode==ESC&&self.close()});var l=0;$.each(options.buttons,function(){l=1;return false});if(l==1){uiDialog.append('<div class="ui-dialog-buttonpane"></div>');var uiDialogButtonPane=$('.ui-dialog-buttonpane',uiDialog);$.each(options.buttons,function(name,value){var btn=$(document.createElement('button')).text(name).click(value);uiDialogButtonPane.append(btn)})}if(options.draggable&&$.fn.draggable){uiDialog.draggable({handle:'.ui-dialog-titlebar',start:function(){self.activate()}})}uiDialog.mousedown(function(){self.activate()});uiDialogTitlebar.click(function(){self.activate()});options.bgiframe&&$.fn.bgiframe&&uiDialog.bgiframe();this.open=function(){options.modal&&overlay.show(self,options.overlay);uiDialog.appendTo('body');var wnd=$(window),doc=$(document),top=doc.scrollTop(),left=doc.scrollLeft();if(options.position.constructor==Array){top+=options.position[1];left+=options.position[0]}else{switch(options.position){case'center':top+=(wnd.height()/2)-(uiDialog.height()/2);left+=(wnd.width()/2)-(uiDialog.width()/2);break;case'top':top+=0;left+=(wnd.width()/2)-(uiDialog.width()/2);break;case'right':top+=(wnd.height()/2)-(uiDialog.height()/2);left+=(wnd.width())-(uiDialog.width());break;case'bottom':top+=(wnd.height())-(uiDialog.height());left+=(wnd.width()/2)-(uiDialog.width()/2);break;case'left':top+=(wnd.height()/2)-(uiDialog.height()/2);left+=0;break;default:top+=(wnd.height()/2)-(uiDialog.height()/2);left+=(wnd.width()/2)-(uiDialog.width()/2)}}top=top<doc.scrollTop()?doc.scrollTop():top;uiDialog.css({top:top,left:left});uiDialog.show();self.activate();var openEV=null;var openUI={options:options};this.uiDialogTitlebarClose.focus();$(this.element).triggerHandler("dialogopen",[openEV,openUI],options.open)};this.activate=function(){var maxZ=initZ=0;$('.ui-dialog:visible').each(function(){maxZ=Math.max(maxZ,parseInt($(this).css("z-index"),10)||initZ)});overlay.$el&&overlay.$el.css('z-index',++maxZ);uiDialog.css("z-index",++maxZ)};this.close=function(){options.modal&&overlay.hide();uiDialog.hide();var closeEV=null;var closeUI={options:options};$(this.element).triggerHandler("dialogclose",[closeEV,closeUI],options.close)};if(options.autoOpen)this.open()};$.extend($.ui.dialog,{defaults:{autoOpen:true,bgiframe:false,buttons:[],draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:'center',resizable:true,width:300}});var overlay={$el:null,events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),function(e){return e+'.ui-dialog-overlay'}).join(' '),show:function(dialog,css){if(this.$el)return;this.dialog=dialog;this.selects=this.ie6&&$('select:visible').css('visibility','hidden');var width=this.width();var height=this.height();this.$el=$('<div/>').appendTo(document.body).addClass('ui-dialog-overlay').css($.extend({borderWidth:0,margin:0,padding:0,position:'absolute',top:0,left:0,width:width,height:height},css));$('a, :input').bind(this.events,function(){if($(this).parents('.ui-dialog').length==0){dialog.uiDialogTitlebarClose.focus();return false}});$(document).bind('keydown.ui-dialog-overlay',function(e){var ESC=27;e.keyCode&&e.keyCode==ESC&&dialog.close()});$overlay=this.$el;function resize(){$overlay.css({width:width,height:height}).css({width:overlay.width(),height:overlay.height()})};$(window).bind('resize.ui-dialog-overlay',resize);dialog.uiDialog.is('.ui-draggable')&&dialog.uiDialog.data('stop.draggable',resize);dialog.uiDialog.is('.ui-resizable')&&dialog.uiDialog.data('stop.resizable',resize)},hide:function(){$('a, :input').add([document,window]).unbind('.ui-dialog-overlay');this.ie6&&this.selects.css('visibility','visible');this.$el=null;$('.ui-dialog-overlay').remove()},height:function(){var height;if(this.ie6&&($(document.body).height()<$(window).height())&&!(document.documentElement.scrollTop||(this.dialog.uiDialog.offset().top+this.dialog.uiDialog.height())>$(window).height())){height=$(window).height()}else{height=$(document).height()}return height+'px'},width:function(){var width;if(this.ie6&&($(document.body).width()<$(window).width())&&!(document.documentElement.scrollLeft||(this.dialog.uiDialog.offset().left+this.dialog.uiDialog.width())>$(window).width())){width=$(window).width()}else{width=$(document).width()}return width+'px'},ie6:$.browser.msie&&$.browser.version<7,selects:null}})(jQuery);(function($){$.fn.extend({slider:function(options){var args=Array.prototype.slice.call(arguments,1);if(options=="value")return $.data(this[0],"ui-slider").value(arguments[1]);return this.each(function(){if(typeof options=="string"){var slider=$.data(this,"ui-slider");slider[options].apply(slider,args)}else if(!$.data(this,"ui-slider"))new $.ui.slider(this,options)})}});$.ui.slider=function(element,options){var self=this;this.element=$(element);$.data(element,"ui-slider",this);this.element.addClass("ui-slider");this.options=$.extend({},options);var o=this.options;$.extend(o,{axis:o.axis||(element.offsetWidth<element.offsetHeight?'vertical':'horizontal'),maxValue:!isNaN(parseInt(o.maxValue,10))?parseInt(o.maxValue,10):100,minValue:parseInt(o.minValue,10)||0,startValue:parseInt(o.startValue,10)||'none'});o.realMaxValue=o.maxValue-o.minValue;o.stepping=parseInt(o.stepping,10)||(o.steps?o.realMaxValue/o.steps:0);$(element).bind("setData.slider",function(event,key,value){self.options[key]=value}).bind("getData.slider",function(event,key){return self.options[key]});this.handle=o.handle?$(o.handle,element):$('> *',element);$(this.handle).mouseInteraction({executor:this,delay:o.delay,distance:o.distance||0,dragPrevention:o.prevention?o.prevention.toLowerCase().split(','):['input','textarea','button','select','option'],start:this.start,stop:this.stop,drag:this.drag,condition:function(e,handle){if(!this.disabled){if(this.currentHandle)this.blur(this.currentHandle);this.focus(handle,1);return!this.disabled}}}).wrap('<a href="javascript:void(0)"></a>').parent().bind('focus',function(e){self.focus(this.firstChild)}).bind('blur',function(e){self.blur(this.firstChild)}).bind('keydown',function(e){if(/(37|39)/.test(e.keyCode))self.moveTo((e.keyCode==37?'-':'+')+'='+(self.options.stepping?self.options.stepping:(self.options.realMaxValue/self.size)*5),this.firstChild)});if(o.helper=='original'&&(this.element.css('position')=='static'||this.element.css('position')==''))this.element.css('position','relative');if(o.axis=='horizontal'){this.size=this.element.outerWidth();this.properties=['left','width']}else{this.size=this.element.outerHeight();this.properties=['top','height']}this.element.bind('click',function(e){self.click.apply(self,[e])});if(!isNaN(o.startValue))this.moveTo(o.startValue,0);if(this.handle.length==1)this.previousHandle=this.handle;if(this.handle.length==2&&o.range)this.createRange()};$.extend($.ui.slider.prototype,{plugins:{},createRange:function(){this.rangeElement=$('<div></div>').addClass('ui-slider-range').css({position:'absolute'}).css(this.properties[0],parseInt($(this.handle[0]).css(this.properties[0]),10)+this.handleSize(0)/2).css(this.properties[1],parseInt($(this.handle[1]).css(this.properties[0]),10)-parseInt($(this.handle[0]).css(this.properties[0]),10)).appendTo(this.element)},updateRange:function(){this.rangeElement.css(this.properties[0],parseInt($(this.handle[0]).css(this.properties[0]),10)+this.handleSize(0)/2);this.rangeElement.css(this.properties[1],parseInt($(this.handle[1]).css(this.properties[0]),10)-parseInt($(this.handle[0]).css(this.properties[0]),10))},getRange:function(){return this.rangeElement?this.convertValue(parseInt(this.rangeElement.css(this.properties[1]),10)):null},ui:function(e){return{instance:this,options:this.options,handle:this.currentHandle,value:this.value(),range:this.getRange()}},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="slide"?n:"slide"+n,[e,this.ui()],this.options[n])},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("ul-slider").unbind(".slider");this.handles.removeMouseInteraction()},enable:function(){this.element.removeClass("ui-slider-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-slider-disabled");this.disabled=true},focus:function(handle,hard){this.currentHandle=$(handle).addClass('ui-slider-handle-active');if(hard)this.currentHandle.parent()[0].focus()},blur:function(handle){$(handle).removeClass('ui-slider-handle-active');if(this.currentHandle&&this.currentHandle[0]==handle){this.previousHandle=this.currentHandle;this.currentHandle=null}},value:function(handle){if(this.handle.length==1)this.currentHandle=this.handle;return((parseInt($(handle!=undefined?this.handle[handle]||handle:this.currentHandle).css(this.properties[0]),10)/(this.size-this.handleSize()))*this.options.realMaxValue)+this.options.minValue},convertValue:function(value){return(value/(this.size-this.handleSize()))*this.options.realMaxValue},translateValue:function(value){return((value-this.options.minValue)/this.options.realMaxValue)*(this.size-this.handleSize())},handleSize:function(handle){return $(handle!=undefined?this.handle[handle]:this.currentHandle)['outer'+this.properties[1].substr(0,1).toUpperCase()+this.properties[1].substr(1)]()},click:function(e){var pointer=[e.pageX,e.pageY];var clickedHandle=false;this.handle.each(function(){if(this==e.target)clickedHandle=true});if(clickedHandle||this.disabled||!(this.currentHandle||this.previousHandle))return;if(this.previousHandle)this.focus(this.previousHandle,1);this.offset=this.element.offset();this.moveTo(this.convertValue(e[this.properties[0]=='top'?'pageY':'pageX']-this.offset[this.properties[0]]-this.handleSize()/2))},start:function(e,handle){var o=this.options;this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:e.pageY-this.handleOffset.top,left:e.pageX-this.handleOffset.left};this.firstValue=this.value();this.propagate('start',e);return false},stop:function(e){this.propagate('stop',e);if(this.firstValue!=this.value())this.propagate('change',e);return false},drag:function(e,handle){var o=this.options;var position={top:e.pageY-this.offset.top-this.clickOffset.top,left:e.pageX-this.offset.left-this.clickOffset.left};var modifier=position[this.properties[0]];if(modifier>=this.size-this.handleSize())modifier=this.size-this.handleSize();if(modifier<=0)modifier=0;if(o.stepping){var value=this.convertValue(modifier);value=Math.round(value/o.stepping)*o.stepping;modifier=this.translateValue(value)}if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&modifier>=this.translateValue(this.value(1)))modifier=this.translateValue(this.value(1));if(this.currentHandle[0]==this.handle[1]&&modifier<=this.translateValue(this.value(0)))modifier=this.translateValue(this.value(0))}this.currentHandle.css(this.properties[0],modifier);if(this.rangeElement)this.updateRange();this.propagate('slide',e);return false},moveTo:function(value,handle){var o=this.options;if(handle==undefined&&!this.currentHandle&&this.handle.length!=1)return false;if(handle==undefined&&!this.currentHandle)handle=0;if(handle!=undefined)this.currentHandle=this.previousHandle=$(this.handle[handle]||handle);if(value.constructor==String)value=/\-\=/.test(value)?this.value()-parseInt(value.replace('-=',''),10):this.value()+parseInt(value.replace('+=',''),10);if(o.stepping)value=Math.round(value/o.stepping)*o.stepping;value=this.translateValue(value);if(value>=this.size-this.handleSize())value=this.size-this.handleSize();if(value<=0)value=0;if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&value>=this.translateValue(this.value(1)))value=this.translateValue(this.value(1));if(this.currentHandle[0]==this.handle[1]&&value<=this.translateValue(this.value(0)))value=this.translateValue(this.value(0))}this.currentHandle.css(this.properties[0],value);if(this.rangeElement)this.updateRange();this.propagate('start',null);this.propagate('stop',null);this.propagate('change',null)}})})(jQuery);(function($){$.ui=$.ui||{};$.fn.tabs=function(){var method=typeof arguments[0]=='string'&&arguments[0];var args=method&&Array.prototype.slice.call(arguments,1)||arguments;return this.each(function(){if(method){var tabs=$.data(this,'ui-tabs');tabs[method].apply(tabs,args)}else new $.ui.tabs(this,args[0]||{})})};$.ui.tabs=function(el,options){var self=this;this.element=el;this.options=$.extend({selected:0,unselect:options.selected===null,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'},options);this.options.event+='.ui-tabs';this.options.cookie=$.cookie&&$.cookie.constructor==Function&&this.options.cookie;$(el).bind('setData.ui-tabs',function(event,key,value){self.options[key]=value;this.tabify()}).bind('getData.ui-tabs',function(event,key){return self.options[key]});$.data(el,'ui-tabs',this);this.tabify(true)};$.extend($.ui.tabs.prototype,{tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a)},ui:function(tab,panel){return{instance:this,options:this.options,tab:tab,panel:panel}},tabify:function(init){this.$lis=$('li:has(a[href])',this.element);this.$tabs=this.$lis.map(function(){return $('a',this)[0]});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#',''))self.$panels=self.$panels.add(a.hash);else if($(a).attr('href')!='#'){$.data(a,'href.ui-tabs',a.href);$.data(a,'load.ui-tabs',a.href);var id=self.tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data('destroy.ui-tabs',true)}self.$panels=self.$panels.add($panel)}else o.disabled.push(i+1)});if(init){$(this.element).hasClass(o.navClass)||$(this.element).addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.hasClass(o.panelClass)||$this.addClass(o.panelClass)});for(var i=0,index;index=o.disabled[i];i++)this.disable(index);this.$tabs.each(function(i,a){if(location.hash){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId)},500)}scrollTo(0,0);return false}}else if(o.cookie){var index=parseInt($.cookie('ui-tabs'+$.data(self.element)),10);if(index&&self.$tabs[index]){o.selected=index;return false}}else if(self.$lis.eq(i).hasClass(o.selectedClass)){o.selected=i;return false}});var n=this.$lis.length;while(this.$lis.eq(o.selected).hasClass(o.disabledClass)&&n){o.selected=++o.selected<this.$lis.length?o.selected:0;n--}if(!n)o.unselect=true;this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(!o.unselect){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass)}var href=!o.unselect&&$.data(this.$tabs[o.selected],'load.ui-tabs');if(href)this.load(o.selected,href);if(!(/^click/).test(o.event))this.$tabs.bind('click',function(e){e.preventDefault()})}var hideFx,showFx,baseFx={'min-width':0,duration:1},baseDuration='normal';if(o.fx&&o.fx.constructor==Array)hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx;else hideFx=showFx=o.fx||baseFx;var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie)resetCSS.opacity='';function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity)$hide[0].style.filter='';if($show)showTab(clicked,$show,$hide)})}function showTab(clicked,$show,$hide){if(showFx===baseFx)$show.css('display','block');$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity)$show[0].style.filter='';$(self.element).triggerHandler("show.ui-tabs",[self.ui(clicked,$show[0])])})}function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show)}this.$tabs.unbind(o.event).bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(self.element).triggerHandler("select.ui-tabs",[self.ui(this,$show[0])])===false){this.blur();return false}self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false}else if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show)});this.blur();return false}}if(o.cookie)$.cookie('ui-tabs'+$.data(self.element),self.options.selected,o.cookie);self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),function(){switchTab(a,$li,$hide,$show)})}else throw'jQuery UI Tabs: Mismatching fragment identifier.';if($.browser.msie)this.blur();return false})},add:function(url,label,index){if(url&&label){index=index||this.$tabs.length;var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/,url).replace(/#\{label\}/,label));$li.data('destroy.ui-tabs',true);var id=url.indexOf('#')==0?url.replace('#',''):this.tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).addClass(o.hideClass);$panel.data('destroy.ui-tabs',true)}if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element.parentNode)}else{$li.insertBefore(this.$lis[index]);$panel.insertBefore(this.$panels[index])}this.tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'load.ui-tabs');if(href)this.load(index,href)}$(this.element).triggerHandler("add.ui-tabs",[this.ui(this.$tabs[index],this.$panels[index])])}else throw'jQuery UI Tabs: Not enough arguments to add tab.';},remove:function(index){if(index&&index.constructor==Number){var o=this.options,$li=this.$lis.eq(index).remove(),$panel=this.$panels.eq(index).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1)this.click(index+(index<this.$tabs.length?1:-1));this.tabify();$(this.element).triggerHandler("remove.ui-tabs",[this.ui($li.find('a')[0],$panel[0])])}},enable:function(index){var self=this,o=this.options,$li=this.$lis.eq(index);$li.removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block')},0)}o.disabled=$.map(this.$lis.filter('.'+o.disabledClass),function(n,i){return self.$lis.index(n)});$(this.element).triggerHandler("enable.ui-tabs",[this.ui(this.$tabs[index],this.$panels[index])])},disable:function(index){var self=this,o=this.options;this.$lis.eq(index).addClass(o.disabledClass);o.disabled=$.map(this.$lis.filter('.'+o.disabledClass),function(n,i){return self.$lis.index(n)});$(this.element).triggerHandler("disable.ui-tabs",[this.ui(this.$tabs[index],this.$panels[index])])},select:function(index){if(typeof index=='string')index=this.$tabs.index(this.$tabs.filter('[href$='+index+']')[0]);this.$tabs.eq(index).trigger(this.options.event)},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0];var url=$a.data('load.ui-tabs');if(!url){typeof callback=='function'&&callback();return}if(o.spinner){var $span=$('span',a),label=$span.html();$span.html('<em>'+o.spinner+'</em>')}var finish=function(){self.$tabs.filter('.'+o.loadingClass).each(function(){$(this).removeClass(o.loadingClass);if(o.spinner)$('span',this).html(label)});self.xhr=null};var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);finish();typeof callback=='function'&&callback();if(o.cache)$.removeData(a,'load.ui-tabs');$(self.element).triggerHandler("load.ui-tabs",[self.ui(self.$tabs[index],self.$panels[index])]);o.ajaxOptions.success&&o.ajaxOptions.success(r,s)}});if(this.xhr){this.xhr.abort();finish()}$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions)},0)},url:function(index,url){this.$tabs.eq(index).data('load.ui-tabs',url)},destroy:function(){var o=this.options;$(this.element).unbind('.ui-tabs').removeClass(o.navClass).removeData('ui-tabs');this.$tabs.each(function(){var href=$.data(this,'href.ui-tabs');if(href)this.href=href;$(this).unbind('.ui-tabs').removeData('href.ui-tabs').removeData('load.ui-tabs')});this.$lis.add(this.$panels).each(function(){if($.data(this,'destroy.ui-tabs'))$(this).remove();else $(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(' '))})}})})(jQuery);(function($){$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms){var self=this;function stop(e){if(e.clientX){clearInterval(self.rotation)}}if(ms){var t=this.options.selected;this.rotation=setInterval(function(){t=++t<self.$tabs.length?t:0;self.click(t)},ms);this.$tabs.bind(this.options.event,stop)}else{clearInterval(this.rotation);this.$tabs.unbind(this.options.event,stop)}}})})(jQuery);

(function($){$.dimensions={version:'@VERSION'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr)};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0)}});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name]}});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'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;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent)}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0}})(jQuery);

;(function($){var $scrollTo=$.scrollTo=function(target,duration,settings){$scrollTo.window().scrollTo(target,duration,settings)};$scrollTo.defaults={axis:'y',duration:1};$scrollTo.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(target,duration,settings){if(typeof duration=='object'){settings=duration;duration=0}settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.speed||settings.duration;settings.queue=settings.queue&&settings.axis.length>1;if(settings.queue)duration/=2;settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){var elem=this,$elem=$(elem),t=target,toff,attr={},win=$elem.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=both(t);break}t=$(t,this);case'object':if(t.is||t.style)toff=(t=$(t)).offset()}$.each(settings.axis.split(''),function(i,axis){var Pos=axis=='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,act=elem[key],Dim=axis=='x'?'Width':'Height',dim=Dim.toLowerCase();if(toff){attr[key]=toff[pos]+(win?0:act-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(t.css('margin'+Pos))||0;attr[key]-=parseInt(t.css('border'+Pos+'Width'))||0}attr[key]+=settings.offset[pos]||0;if(settings.over[pos])attr[key]+=t[dim]()*settings.over[pos]}else attr[key]=t[pos];if(/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max(Dim));if(!i&&settings.queue){if(act!=attr[key])animate(settings.onAfterFirst);delete attr[key]}});animate(settings.onAfter);function animate(callback){$elem.animate(attr,duration,settings.easing,callback&&function(){callback.call(this,target)})};function max(Dim){var el=win?$.browser.opera?document.body:document.documentElement:elem;return el['scroll'+Dim]-el['client'+Dim]}})};function both(val){return typeof val=='object'?val:{top:val,left:val}}})(jQuery);

;(function($){var URI=location.href.replace(/#.*/,'');var $localScroll=$.localScroll=function(settings){$('body').localScroll(settings)};//@see http://www.freewebs.com/flesler/jQuery.ScrollTo/
$localScroll.defaults={duration:1000,axis:'y',event:'click',stop:true};$localScroll.hash=function(settings){settings=$.extend({},$localScroll.defaults,settings);settings.hash=false;if(location.hash)setTimeout(function(){scroll(0,location,settings)},0)};$.fn.localScroll=function(settings){settings=$.extend({},$localScroll.defaults,settings);return(settings.persistent||settings.lazy)?this.bind(settings.event,function(e){var a=$([e.target,e.target.parentNode]).filter(filter)[0];a&&scroll(e,a,settings)}):this.find('a').filter(filter).bind(settings.event,function(e){scroll(e,this,settings)}).end().end();function filter(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==URI&&(!settings.filter||$(this).is(settings.filter))}};function scroll(e,link,settings){var id=link.hash.slice(1),elem=document.getElementById(id)||document.getElementsByName(id)[0];if(elem){e&&e.preventDefault();var $target=$(settings.target||$.scrollTo.window());if(settings.lock&&$target.is(':animated')||settings.onBefore&&settings.onBefore.call(link,e,elem,$target)===false)return;if(settings.stop)$target.queue('fx',[]).stop();$target.scrollTo(elem,settings).trigger('notify.serialScroll',[elem]);if(settings.hash)$target.queue(function(){location=link.hash})}}})(jQuery);

(function($){function Datepicker(){this.debug=false;this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;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',defaultDate:null,appendText:'',buttonText:'...',buttonImage:'',buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:'-10:+10',changeFirstDay:true,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:'+10',showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,speed:'medium',beforeShowDay:null,beforeShow:null,onSelect:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:' - '};$.extend(this._defaults,this.regional['']);this._datepickerDiv=$('<div id="datepicker_div"></div>')}$.extend(Datepicker.prototype,{markerClassName:'hasDatepicker',log:function(){if(this.debug){console.log.apply('',arguments)}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id},_getInst:function(id){return this._inst[id]||id},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_doKeyDown:function(e){var inst=$.datepicker._getInst(this._calId);if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker.hideDatepicker('');break;case 13:$.datepicker._selectDay(inst,inst._selectedMonth,inst._selectedYear,$('td.datepicker_daysCellOver',inst._datepickerDiv)[0]);return false;break;case 27:$.datepicker.hideDatepicker(inst._get('speed'));break;case 33:$.datepicker._adjustDate(inst,(e.ctrlKey?-1:-inst._get('stepMonths')),(e.ctrlKey?'Y':'M'));break;case 34:$.datepicker._adjustDate(inst,(e.ctrlKey?+1:+inst._get('stepMonths')),(e.ctrlKey?'Y':'M'));break;case 35:if(e.ctrlKey)$.datepicker._clearDate(inst);break;case 36:if(e.ctrlKey)$.datepicker._gotoToday(inst);break;case 37:if(e.ctrlKey)$.datepicker._adjustDate(inst,-1,'D');break;case 38:if(e.ctrlKey)$.datepicker._adjustDate(inst,-7,'D');break;case 39:if(e.ctrlKey)$.datepicker._adjustDate(inst,+1,'D');break;case 40:if(e.ctrlKey)$.datepicker._adjustDate(inst,+7,'D');break}}else if(e.keyCode==36&&e.ctrlKey){$.datepicker.showFor(this)}},_doKeyPress:function(e){var inst=$.datepicker._getInst(this._calId);var chars=$.datepicker._possibleChars(inst._get('dateFormat'));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return(chr<' '||!chars||chars.indexOf(chr)>-1)},_connectDatepicker:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return}var appendText=inst._get('appendText');var isRTL=inst._get('isRTL');if(appendText){if(isRTL){input.before('<span class="datepicker_append">'+appendText+'</span>')}else{input.after('<span class="datepicker_append">'+appendText+'</span>')}}var showOn=inst._get('showOn');if(showOn=='focus'||showOn=='both'){input.focus(this.showFor)}if(showOn=='button'||showOn=='both'){var buttonText=inst._get('buttonText');var buttonImage=inst._get('buttonImage');var buttonImageOnly=inst._get('buttonImageOnly');var trigger=$(buttonImageOnly?'<img class="datepicker_trigger" src="'+buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':'<button type="button" class="datepicker_trigger">'+(buttonImage!=''?'<img src="'+buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':buttonText)+'</button>');input.wrap('<span class="datepicker_wrap"></span>');if(isRTL){input.before(trigger)}else{input.after(trigger)}trigger.click(this.showFor)}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress);input.bind("setData.datepicker",function(event,key,value){inst._settings[key]=value}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id},_inlineDatepicker:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return}input.addClass(this.markerClassName).append(inst._datepickerDiv);input.bind("setData.datepicker",function(event,key,value){inst._settings[key]=value}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id;this._updateDatepicker(inst)},_inlineShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$('.datepicker',inst._datepickerDiv[0]).width())},_hasClass:function(element,className){var classes=element.attr('class');return(classes&&classes.indexOf(className)>-1)},dialogDatepicker:function(dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){inst=this._dialogInst=new DatepickerInstance({},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=inst._id}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._datepickerDiv.addClass('datepicker_dialog');this.showFor(this._dialogInput[0]);if($.blockUI){$.blockUI(this._datepickerDiv)}return this},showFor:function(control){control=(control.jquery?control[0]:(typeof control=='string'?$(control)[0]:control));var input=(control.nodeName&&control.nodeName.toLowerCase()=='input'?control:this);if(input.nodeName.toLowerCase()!='input'){input=$('input',input.parentNode)[0]}if($.datepicker._lastInput==input){return}if($(input).isDisabledDatepicker()){return}var inst=$.datepicker._getInst(input._calId);var beforeShow=inst._get('beforeShow');extendRemove(inst._settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker.hideDatepicker('');$.datepicker._lastInput=input;inst._setDateFromField(input);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'});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}inst._datepickerDiv.css('position',($.datepicker._inDialog&&$.blockUI?'static':(isFixed?'fixed':'absolute'))).css('left',$.datepicker._pos[0]+'px').css('top',$.datepicker._pos[1]+'px');$.datepicker._pos=null;$.datepicker._showDatepicker(inst);return this},_showDatepicker:function(id){var inst=this._getInst(id);inst._rangeStart=null;this._updateDatepicker(inst);if(!inst._inline){var speed=inst._get('speed');var postProcess=function(){$.datepicker._datepickerShowing=true;$.datepicker._afterShow(inst)};var showAnim=inst._get('showAnim')||'show';inst._datepickerDiv[showAnim](speed,postProcess);if(speed==''){postProcess()}if(inst._input[0].type!='hidden'){inst._input[0].focus()}this._curInst=inst}},_updateDatepicker:function(inst){inst._datepickerDiv.empty().append(inst._generateDatepicker());var numMonths=inst._getNumberOfMonths();if(numMonths[0]!=1||numMonths[1]!=1){inst._datepickerDiv.addClass('datepicker_multi')}else{inst._datepickerDiv.removeClass('datepicker_multi')}if(inst._get('isRTL')){inst._datepickerDiv.addClass('datepicker_rtl')}else{inst._datepickerDiv.removeClass('datepicker_rtl')}if(inst._input&&inst._input[0].type!='hidden'){inst._input[0].focus()}},_afterShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$('.datepicker',inst._datepickerDiv[0]).width());if($.browser.msie&&parseInt($.browser.version)<7){$('#datepicker_cover').css({width:inst._datepickerDiv.width()+4,height:inst._datepickerDiv.height()+4})}var isFixed=inst._datepickerDiv.css('position')=='fixed';var pos=inst._input?$.datepicker._findPos(inst._input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=(isFixed?0:document.documentElement.scrollLeft||document.body.scrollLeft);var scrollY=(isFixed?0:document.documentElement.scrollTop||document.body.scrollTop);if((inst._datepickerDiv.offset().left+inst._datepickerDiv.width()-(isFixed&&$.browser.msie?document.documentElement.scrollLeft:0))>(browserWidth+scrollX)){inst._datepickerDiv.css('left',Math.max(scrollX,pos[0]+(inst._input?$(inst._input[0]).width():null)-inst._datepickerDiv.width()-(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0))+'px')}if((inst._datepickerDiv.offset().top+inst._datepickerDiv.height()-(isFixed&&$.browser.msie?document.documentElement.scrollTop:0))>(browserHeight+scrollY)){inst._datepickerDiv.css('top',Math.max(scrollY,pos[1]-(this._inDialog?0:inst._datepickerDiv.height())-(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))+'px')}},_findPos:function(obj){while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj.nextSibling}var curleft=curtop=0;if(obj&&obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){var origcurleft=curleft;curleft+=obj.offsetLeft;if(curleft<0){curleft=origcurleft}curtop+=obj.offsetTop}}return[curleft,curtop]},hideDatepicker:function(speed){var inst=this._curInst;if(!inst){return}var rangeSelect=inst._get('rangeSelect');if(rangeSelect&&this._stayOpen){this._selectDate(inst,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear))}this._stayOpen=false;if(this._datepickerShowing){speed=(speed!=null?speed:inst._get('speed'));inst._datepickerDiv.hide(speed,function(){$.datepicker._tidyDialog(inst)});if(speed==''){this._tidyDialog(inst)}this._datepickerShowing=false;this._lastInput=null;inst._settings.prompt=null;if(this._inDialog){this._dialogInput.css('position','absolute').css('left','0px').css('top','-100px');if($.blockUI){$.unblockUI();$('body').append(this._datepickerDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst._datepickerDiv.removeClass('datepicker_dialog').unbind(".datepicker");$('.datepicker_prompt',inst._datepickerDiv).remove()},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var target=$(event.target);if((target.parents("#datepicker_div").length==0)&&(target.attr('class')!='datepicker_trigger')&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker.hideDatepicker('')}},_adjustDate:function(id,offset,period){var inst=this._getInst(id);inst._adjustDate(offset,period);this._updateDatepicker(inst)},_gotoToday:function(id){var date=new Date();var inst=this._getInst(id);inst._selectedDay=date.getDate();inst._selectedMonth=date.getMonth();inst._selectedYear=date.getFullYear();this._adjustDate(inst)},_selectMonthYear:function(id,select,period){var inst=this._getInst(id);inst._selectingMonthYear=false;inst[period=='M'?'_selectedMonth':'_selectedYear']=select.options[select.selectedIndex].value-0;this._adjustDate(inst)},_clickMonthYear:function(id){var inst=this._getInst(id);if(inst._input&&inst._selectingMonthYear&&!$.browser.msie){inst._input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_changeFirstDay:function(id,day){var inst=this._getInst(id);inst._settings.firstDay=day;this._updateDatepicker(inst)},_selectDay:function(id,month,year,td){if(this._hasClass($(td),'datepicker_unselectable')){return}var inst=this._getInst(id);var rangeSelect=inst._get('rangeSelect');if(rangeSelect){if(!this._stayOpen){$('.datepicker td').removeClass('datepicker_currentDay');$(td).addClass('datepicker_currentDay')}this._stayOpen=!this._stayOpen}inst._currentDay=$('a',td).html();inst._currentMonth=month;inst._currentYear=year;this._selectDate(id,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear));if(this._stayOpen){inst._endDay=inst._endMonth=inst._endYear=null;inst._rangeStart=new Date(inst._currentYear,inst._currentMonth,inst._currentDay);this._updateDatepicker(inst)}else if(rangeSelect){inst._endDay=inst._currentDay;inst._endMonth=inst._currentMonth;inst._endYear=inst._currentYear;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 inst=this._getInst(id);this._stayOpen=false;inst._endDay=inst._endMonth=inst._endYear=inst._rangeStart=null;this._selectDate(inst,'')},_selectDate:function(id,dateStr){var inst=this._getInst(id);dateStr=(dateStr!=null?dateStr:inst._formatDate());if(inst._rangeStart){dateStr=inst._formatDate(inst._rangeStart)+inst._get('rangeSeparator')+dateStr}if(inst._input){inst._input.val(dateStr)}var onSelect=inst._get('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(inst._get('speed'));this._lastInput=inst._input[0];if(typeof(inst._input[0])!='object'){inst._input[0].focus()}this._lastInput=null}}},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());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(inst._get('dateStatus'),date,inst._getFormatConfig())},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 size=(match=='y'?4:2);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==(match=='y'?4:2)){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'\'':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},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'\'':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':chars+='0123456789';break;case'D':case'M':return null;case'\'':if(lookAhead('\'')){chars+='\''}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars}});function DatepickerInstance(settings,inline){this._id=$.datepicker._register(this);this._selectedDay=0;this._selectedMonth=0;this._selectedYear=0;this._input=null;this._inline=inline;this._datepickerDiv=(!inline?$.datepicker._datepickerDiv:$('<div id="datepicker_div_'+this._id+'" class="datepicker_inline"></div>'));this._settings=extendRemove({},settings||{});if(inline){this._setDate(this._getDefaultDate())}}$.extend(DatepickerInstance.prototype,{_get:function(name){return(this._settings[name]!=null?this._settings[name]:$.datepicker._defaults[name])},_setDateFromField:function(input){this._input=$(input);var dateFormat=this._get('dateFormat');var dates=this._input?this._input.val().split(this._get('rangeSeparator')):null;this._endDay=this._endMonth=this._endYear=null;var date=defaultDate=this._getDefaultDate();if(dates.length>0){var settings=this._getFormatConfig();if(dates.length>1){date=$.datepicker.parseDate(dateFormat,dates[1],settings)||defaultDate;this._endDay=date.getDate();this._endMonth=date.getMonth();this._endYear=date.getFullYear()}try{date=$.datepicker.parseDate(dateFormat,dates[0],settings)||defaultDate}catch(e){$.datepicker.log(e);date=defaultDate}}this._selectedDay=this._currentDay=date.getDate();this._selectedMonth=this._currentMonth=date.getMonth();this._selectedYear=this._currentYear=date.getFullYear();this._adjustDate()},_getDefaultDate:function(){return this._determineDate('defaultDate',new Date())},_determineDate:function(name,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var matches=/^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset);if(matches){var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();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}date=new Date(year,month,day)}return date};var date=this._get(name);return(date==null?defaultDate:(typeof date=='string'?offsetString(date,this._getDaysInMonth):(typeof date=='number'?offsetNumeric(date):date)))},_setDate:function(date,endDate){this._selectedDay=this._currentDay=date.getDate();this._selectedMonth=this._currentMonth=date.getMonth();this._selectedYear=this._currentYear=date.getFullYear();if(this._get('rangeSelect')){if(endDate){this._endDay=endDate.getDate();this._endMonth=endDate.getMonth();this._endYear=endDate.getFullYear()}else{this._endDay=this._currentDay;this._endMonth=this._currentMonth;this._endYear=this._currentYear}}this._adjustDate()},_getDate:function(){var startDate=(!this._currentYear||(this._input&&this._input.val()=='')?null:new Date(this._currentYear,this._currentMonth,this._currentDay));if(this._get('rangeSelect')){return[startDate,(!this._endYear?null:new Date(this._endYear,this._endMonth,this._endDay))]}else{return startDate}},_generateDatepicker:function(){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var showStatus=this._get('showStatus');var isRTL=this._get('isRTL');var clear=(this._get('mandatory')?'':'<div class="datepicker_clear"><a onclick="jQuery.datepicker._clearDate('+this._id+');"'+(showStatus?this._addStatus(this._get('clearStatus')||'&#xa0;'):'')+'>'+this._get('clearText')+'</a></div>');var controls='<div class="datepicker_control">'+(isRTL?'':clear)+'<div class="datepicker_close"><a onclick="jQuery.datepicker.hideDatepicker();"'+(showStatus?this._addStatus(this._get('closeStatus')||'&#xa0;'):'')+'>'+this._get('closeText')+'</a></div>'+(isRTL?clear:'')+'</div>';var prompt=this._get('prompt');var closeAtTop=this._get('closeAtTop');var hideIfNoPrevNext=this._get('hideIfNoPrevNext');var numMonths=this._getNumberOfMonths();var stepMonths=this._get('stepMonths');var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var minDate=this._getMinMaxDate('min',true);var maxDate=this._getMinMaxDate('max');var drawMonth=this._selectedMonth;var drawYear=this._selectedYear;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 prev='<div class="datepicker_prev">'+(this._canAdjustMonth(-1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+', -'+stepMonths+', \'M\');"'+(showStatus?this._addStatus(this._get('prevStatus')||'&#xa0;'):'')+'>'+this._get('prevText')+'</a>':(hideIfNoPrevNext?'':'<label>'+this._get('prevText')+'</label>'))+'</div>';var next='<div class="datepicker_next">'+(this._canAdjustMonth(+1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+', +'+stepMonths+', \'M\');"'+(showStatus?this._addStatus(this._get('nextStatus')||'&#xa0;'):'')+'>'+this._get('nextText')+'</a>':(hideIfNoPrevNext?'>':'<label>'+this._get('nextText')+'</label>'))+'</div>';var html=(prompt?'<div class="datepicker_prompt">'+prompt+'</div>':'')+(closeAtTop&&!this._inline?controls:'')+'<div class="datepicker_links">'+(isRTL?next:prev)+(this._isInRange(today)?'<div class="datepicker_current">'+'<a onclick="jQuery.datepicker._gotoToday('+this._id+');"'+(showStatus?this._addStatus(this._get('currentStatus')||'&#xa0;'):'')+'>'+this._get('currentText')+'</a></div>':'')+(isRTL?prev:next)+'</div>';var showWeeks=this._get('showWeeks');for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,this._selectedDay);html+='<div class="datepicker_oneMonth'+(col==0?' datepicker_newRow':'')+'">'+this._generateMonthYearHeader(drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0)+'<table class="datepicker" cellpadding="0" cellspacing="0"><thead>'+'<tr class="datepicker_titleRow">'+(showWeeks?'<td>'+this._get('weekHeader')+'</td>':'');var firstDay=this._get('firstDay');var changeFirstDay=this._get('changeFirstDay');var dayNames=this._get('dayNames');var dayNamesShort=this._get('dayNamesShort');var dayNamesMin=this._get('dayNamesMin');for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var status=this._get('dayStatus')||'&#xa0;';status=(status.indexOf('DD')>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+='<td'+((dow+firstDay+6)%7>=5?' class="datepicker_weekEndCell"':'')+'>'+(!changeFirstDay?'<span':'<a onclick="jQuery.datepicker._changeFirstDay('+this._id+', '+day+');"')+(showStatus?this._addStatus(status):'')+' title="'+dayNames[day]+'">'+dayNamesMin[day]+(changeFirstDay?'</a>':'</span>')+'</td>'}html+='</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==this._selectedYear&&drawMonth==this._selectedMonth){this._selectedDay=Math.min(this._selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var currentDate=new Date(this._currentYear,this._currentMonth,this._currentDay);var endDate=this._endDay?new Date(this._endYear,this._endMonth,this._endDay):currentDate;var printDate=new Date(drawYear,drawMonth,1-leadDays);var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var beforeShowDay=this._get('beforeShowDay');var showOtherMonths=this._get('showOtherMonths');var calculateWeek=this._get('calculateWeek')||$.datepicker.iso8601Week;var dateStatus=this._get('statusForDate')||$.datepicker.dateStatus;for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="datepicker_daysRow">'+(showWeeks?'<td class="datepicker_weekCol">'+calculateWeek(printDate)+'</td>':'');for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((this._input?this._input[0]:null),[printDate]):[true,'']);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="datepicker_daysCell'+((dow+firstDay+6)%7>=5?' datepicker_weekEndCell':'')+(otherMonth?' datepicker_otherMonth':'')+(printDate.getTime()==selectedDate.getTime()&&drawMonth==this._selectedMonth?' datepicker_daysCellOver':'')+(unselectable?' datepicker_unselectable':'')+(otherMonth&&!showOtherMonths?'':' '+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?' datepicker_currentDay':(printDate.getTime()==today.getTime()?' datepicker_today':'')))+'"'+(unselectable?'':' onmouseover="jQuery(this).addClass(\'datepicker_daysCellOver\');'+(!showStatus||(otherMonth&&!showOtherMonths)?'':'jQuery(\'#datepicker_status_'+this._id+'\').html(\''+(dateStatus.apply((this._input?this._input[0]:null),[printDate,this])||'&#xa0;')+'\');')+'"'+' onmouseout="jQuery(this).removeClass(\'datepicker_daysCellOver\');'+(!showStatus||(otherMonth&&!showOtherMonths)?'':'jQuery(\'#datepicker_status_'+this._id+'\').html(\'&#xa0;\');')+'" onclick="jQuery.datepicker._selectDay('+this._id+','+drawMonth+','+drawYear+', this);"')+'>'+(otherMonth?(showOtherMonths?printDate.getDate():'&#xa0;'):(unselectable?printDate.getDate():'<a>'+printDate.getDate()+'</a>'))+'</td>';printDate.setDate(printDate.getDate()+1)}html+='</tr>'}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}html+='</tbody></table></div>'}}html+=(showStatus?'<div id="datepicker_status_'+this._id+'" class="datepicker_status">'+(this._get('initStatus')||'&#xa0;')+'</div>':'')+(!closeAtTop&&!this._inline?controls:'')+'<div style="clear: both;"></div>'+($.browser.msie&&parseInt($.browser.version)<7&&!this._inline?'<iframe src="javascript:false;" class="datepicker_cover"></iframe>':'');return html},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var showStatus=this._get('showStatus');var html='<div class="datepicker_header">';var monthNames=this._get('monthNames');if(secondary||!this._get('changeMonth')){html+=monthNames[drawMonth]+'&#xa0;'}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);html+='<select class="datepicker_newMonth" '+'onchange="jQuery.datepicker._selectMonthYear('+this._id+', this, \'M\');" '+'onclick="jQuery.datepicker._clickMonthYear('+this._id+');"'+(showStatus?this._addStatus(this._get('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('changeYear')){html+=drawYear}else{var years=this._get('yearRange').split(':');var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else if(years[0].charAt(0)=='+'||years[0].charAt(0)=='-'){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="datepicker_newYear" '+'onchange="jQuery.datepicker._selectMonthYear('+this._id+', this, \'Y\');" '+'onclick="jQuery.datepicker._clickMonthYear('+this._id+');"'+(showStatus?this._addStatus(this._get('yearStatus')||'&#xa0;'):'')+'>';for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':'')+'>'+year+'</option>'}html+='</select>'}html+='</div>';return html},_addStatus:function(text){return' onmouseover="jQuery(\'#datepicker_status_'+this._id+'\').html(\''+text+'\');" '+'onmouseout="jQuery(\'#datepicker_status_'+this._id+'\').html(\'&#xa0;\');"'},_adjustDate:function(offset,period){var year=this._selectedYear+(period=='Y'?offset:0);var month=this._selectedMonth+(period=='M'?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+(period=='D'?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate('min',true);var maxDate=this._getMinMaxDate('max');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);this._selectedDay=date.getDate();this._selectedMonth=date.getMonth();this._selectedYear=date.getFullYear()},_getNumberOfMonths:function(){var numMonths=this._get('numberOfMonths');return(numMonths==null?[1,1]:(typeof numMonths=='number'?[1,numMonths]:numMonths))},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+'Date',null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return date||(checkRange?this._rangeStart:null)},_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(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();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(date)},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart<newMinDate?this._rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate('min');var maxDate=this._getMinMaxDate('max');return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(){var shortYearCutoff=this._get('shortYearCutoff');shortYearCutoff=(typeof shortYearCutoff!='string'?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get('dayNamesShort'),dayNames:this._get('dayNames'),monthNamesShort:this._get('monthNamesShort'),monthNames:this._get('monthNames')}},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear}var date=(day?(typeof day=='object'?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get('dateFormat'),date,this._getFormatConfig())}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null}}return target};$.fn.datepicker=function(options){var args=Array.prototype.slice.call(arguments,1);return typeof options=="string"?this[options+"Datepicker"].apply(this,args):this.attachDatepicker(options)};$.fn.attachDatepicker=function(settings){return this.each(function(){var inlineSettings=null;for(attrName in $.datepicker._defaults){var attrValue=this.getAttribute('date:'+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 DatepickerInstance(instSettings,false));$.datepicker._connectDatepicker(this,inst)}else if(nodeName=='div'||nodeName=='span'){var instSettings=$.extend($.extend({},settings||{}),inlineSettings||{});var inst=new DatepickerInstance(instSettings,true);$.datepicker._inlineDatepicker(this,inst)}})};$.fn.removeDatepicker=function(){var jq=this.each(function(){var $this=$(this);var nodeName=this.nodeName.toLowerCase();var calId=this._calId;this._calId=null;if(nodeName=='input'){$this.siblings('.datepicker_append').replaceWith('');$this.siblings('.datepicker_trigger').replaceWith('');$this.removeClass($.datepicker.markerClassName).unbind('focus',$.datepicker.showFor).unbind('keydown',$.datepicker._doKeyDown).unbind('keypress',$.datepicker._doKeyPress);var wrapper=$this.parents('.datepicker_wrap');if(wrapper){wrapper.replaceWith(wrapper.html())}}else if(nodeName=='div'||nodeName=='span'){$this.removeClass($.datepicker.markerClassName).empty()}if($('input[_calId='+calId+']').length==0){$.datepicker._inst[calId]=null}});if($('input.hasDatepicker').length==0){$.datepicker._datepickerDiv.replaceWith('')}return jq};$.fn.enableDatepicker=function(){return this.each(function(){this.disabled=false;$(this).siblings('button.datepicker_trigger').each(function(){this.disabled=false});$(this).siblings('img.datepicker_trigger').css({opacity:'1.0',cursor:''});var $this=this;$.datepicker._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==$this?null:value)})})};$.fn.disableDatepicker=function(){return this.each(function(){this.disabled=true;$(this).siblings('button.datepicker_trigger').each(function(){this.disabled=true});$(this).siblings('img.datepicker_trigger').css({opacity:'0.5',cursor:'default'});var $this=this;$.datepicker._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==$this?null:value)});$.datepicker._disabledInputs[$.datepicker._disabledInputs.length]=this})};$.fn.isDisabledDatepicker=function(){if(this.length==0){return false}for(var i=0;i<$.datepicker._disabledInputs.length;i++){if($.datepicker._disabledInputs[i]==this[0]){return true}}return false};$.fn.changeDatepicker=function(name,value){var settings=name||{};if(typeof name=='string'){settings={};settings[name]=value}return this.each(function(){var inst=$.datepicker._getInst(this._calId);if(inst){extendRemove(inst._settings,settings);$.datepicker._updateDatepicker(inst)}})};$.fn.showDatepicker=function(){$.datepicker.showFor(this);return this};$.fn.setDatepickerDate=function(date,endDate){return this.each(function(){var inst=$.datepicker._getInst(this._calId);if(inst){inst._setDate(date,endDate);$.datepicker._updateDatepicker(inst)}})};$.fn.getDatepickerDate=function(){var inst=(this.length>0?$.datepicker._getInst(this[0]._calId):null);return(inst?inst._getDate():null)};$(document).ready(function(){$.datepicker=new Datepicker();$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick)})})(jQuery);

jQuery(function($){$.datepicker.regional['fr']={clearText:'Effacer',clearStatus:'',closeText:'Fermer',closeStatus:'',prevText:'&lt;Préc',prevStatus:'',nextText:'Proch&gt;',nextStatus:'',currentText:'En cours',currentStatus:'',monthNames:['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'],monthNamesShort:['Jan','Fév','Mar','Avr','Mai','Jun','Jul','Aoû','Sep','Oct','Nov','Déc'],monthStatus:'',yearStatus:'',weekHeader:'Sm',weekStatus:'',dayNames:['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],dayNamesShort:['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],dayNamesMin:['Di','Lu','Ma','Me','Je','Ve','Sa'],dayStatus:'DD',dateStatus:'D, M d',dateFormat:'dd/mm/yy',firstDay:0,initStatus:'',isRTL:false};$.datepicker.setDefaults($.datepicker.regional['fr'])});

// HTML Truncator for jQuery
// by Henrik Nyh <http://henrik.nyh.se> 2008-02-28.
// Free to modify and redistribute with credit.

(function($) {

  var trailing_whitespace = true;

  $.fn.truncate = function(options) {

    var opts = $.extend({}, $.fn.truncate.defaults, options);
    
    $(this).each(function() {

      var content_length = $.trim(squeeze($(this).text())).length;
      if (content_length <= opts.max_length)
        return;  // bail early if not overlong

      var actual_max_length = opts.max_length - opts.more.length - 3;  // 3 for " ()"    
      var truncated_node = recursivelyTruncate(this, actual_max_length);
      var full_node = $(this);

      truncated_node.insertAfter(full_node);
      // This is an ugly approximation for getting the last block tag:
      // we just pick the last <p> or else the container itself.
      truncated_node.find('p:last').add(truncated_node).eq(0).
        append('... <br /><br />(<a href="#show more content">'+opts.more+'</a>)');

      full_node.hide();

      truncated_node.find('a:last').click(function() {
        truncated_node.hide(); full_node.fadeIn("slow"); return false;
      });
      full_node.find('a:last').click(function() {
        truncated_node.show(); full_node.fadeOut("slow"); return false;
      });

    });
  }

  // Note that the "more" link and its wrapping counts towards the max length:
  // so "more" and a max length of 10 might give "123 (more)"
  $.fn.truncate.defaults = {
    max_length: 100,
    more: 'more',
    less: 'less'
  };

  function recursivelyTruncate(node, max_length) {
    return (node.nodeType == 3) ? truncateText(node, max_length) : truncateNode(node, max_length);
  }

  function truncateNode(node, max_length) {
    var node = $(node);
    var new_node = node.clone().html("");
    node.contents().each(function() {
      var remaining_length = max_length - new_node.text().length;
      if (remaining_length == 0) return;
      new_node.append(recursivelyTruncate(this, remaining_length));
    });
    return new_node;
  }

  function truncateText(node, max_length) {
    var text = squeeze(node.data);
    if (trailing_whitespace)  // remove initial whitespace if last text
      text = text.replace(/^ /, '');  // node had trailing whitespace.
    trailing_whitespace = !!text.match(/ $/);
    return text.slice(0, max_length);
  }

  // Collapses a sequence of whitespace into a single space.
  function squeeze(string) {
    return string.replace(/\s+/g, ' ');
  }

})(jQuery);

/*
 * FancyBox - simple jQuery plugin for fancy image zooming
 * Examples and documentation at: http://fancy.klade.lv/
 * Version: 0.1b (22/03/2008)
 * Copyright (c) 2008 Janis Skarnelis
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 * Requires: jQuery v1.2.1 or later
*/
$.fn.fancybox = function(settings) {
	settings = $.extend({}, $.fn.fancybox.defaults, settings);

	var clickedElem;
	var currentElem;
	var imgThumb;

	function getPageSize() {
		var d = document.documentElement;
		var w = window.innerWidth	|| self.innerWidth	|| (d && d.clientWidth)		|| document.body.clientWidth;
		var h = window.innerHeight	|| self.innerHeight	|| (d && d.clientHeight)	|| document.body.clientHeight;

		return [w,h];
	}

	function getPosition(el) {
		var pos = el.offset();

		pos.top		+= parseFloat(el.css('paddingTop'));
		pos.left	+= parseFloat(el.css('paddingLeft'));

		pos.top		+= parseFloat(el.css('borderTopWidth'));
		pos.left	+= parseFloat(el.css('borderLeftWidth'));

		return pos;
	}

	function getImageSize(maxWidth, maxHeight, imageWidth, imageHeight) {
		if (imageWidth > maxWidth) {
			imageHeight	= imageHeight * (maxWidth / imageWidth);
			imageWidth	= maxWidth;

			if (imageHeight > maxHeight) {
				imageWidth = imageWidth * (maxHeight / imageHeight);
				imageHeight = maxHeight;
			}

		} else if (imageHeight > maxHeight) {
			imageWidth	= imageWidth * (maxHeight / imageHeight);
			imageHeight	= maxHeight;

			if (imageWidth > maxWidth) {
				imageHeight = imageHeight * (maxWidth / imageWidth);
				imageWidth = maxWidth;
			}
		}

		return [Math.round(imageWidth), Math.round(imageHeight)];
	}

	function createTransparentDiv(attr, file, w, h, pos) {
		var z = arguments[5] !== undefined ? arguments[5]  : 90;
		var s = arguments[6] !== undefined ? arguments[6]  : '';
		var t = arguments[7] !== undefined ? arguments[7]  : '';

		var el = '';

		el += '<div ' + attr + ' style="z-index:' + z + ';position:absolute;' + pos + ';' + (h ? 'height:' + h  + 'px;' : '') + 'width:' + w + 'px;' + s + ';';

		el += $.browser.msie ? 'FILTER:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src=\'' + file + '\');' : 'background:transparent url(\'' + file + '\') ' + (w && h ? 'repeat-' + (w > h ? 'x' : 'y') : '') + ';';

		el += '">' + t + '</div>';

		return el;
	}

	var removeFancy = function() {
		$(document).unbind("keydown");

		$("#fancy_close,#fancy_img").unbind("click");
        $("#fancy_block").stop();

		if (arguments[0] !== undefined && arguments[0] == true) {
			$("#fancy_wrap").remove();

		} else {
			$('#fancy_close,#btnLeft,#btnRight,div.fancy_shadow,#fancy_title').remove();

			if (settings.fancy) {
				imgThumb = currentElem.children("img:first");

				var pos = getPosition(imgThumb);
				var w	= imgThumb.width();
				var h	= imgThumb.height();

				var params = {
					left:		pos.left	+ "px",
					top:		pos.top		+ "px",
					height:		h,
					width:		w
				}

				if (settings.opacity) {
					params.opacity = 'hide';
				}

				$('#fancy_block').animate(params, settings.speed, "swing", function() {
					$("#fancy_wrap").remove();
				});

			} else {
				$('#fancy_block').fadeOut(settings.speed, function() {
					$("#fancy_wrap").remove();
				});
			}
		}
	}

	var showFancy = function() {
	    currentElem = clickedElem;

		var pageSize	= getPageSize();
		var imageSize	= getImageSize(pageSize[0] - 70, pageSize[1] - 70, imgPreloader.width,  imgPreloader.height);

		var m_left	= Math.round(pageSize[0] / 2)  - Math.round(imageSize[0] / 2);
		var m_top	= Math.round(pageSize[1] / 2)  - Math.round(imageSize[1] / 2);

		m_top	+= typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement.scrollTop;
		m_left	+= typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement.scrollLeft;

        $("#fancy_loading").remove();

		if ($("#fancy_wrap").is('*')) {
			removeFancy(true);
		}

		$('<div id="fancy_wrap"	style="z-index:90;position:absolute;top:0px;left:0px;"></div>').prependTo("body");

		$('<div id="fancy_block" style="position:absolute;top:' + m_top + 'px;left:' + m_left + 'px;width:' + imageSize[0] + 'px;height:' + imageSize[1] + 'px;display:none;"></div>').appendTo("#fancy_wrap");

		$('<img id="fancy_img" style="width:100%;height:100%;position:absolute;z-index:93;" src="' + imgPreloader.src + '" />').appendTo("#fancy_block");

		var currentElemId		= currentElem.attr('id');
		var currentElemRel		= currentElem.attr('rel');
		var currentElemTitle	= currentElem.attr('title');

		var nextElem = false, prevElem = false, foundElem = false;

		if (currentElemRel !== undefined) {
			var arr_rel	= $("a[@rel=" + currentElemRel + "]").get();

			for (var i = 0; ((i < arr_rel.length) && (nextElem === false)); i++) {
				if (!(arr_rel[i].id == currentElemId)) {
					foundElem ? nextElem = arr_rel[i].id : prevElem = arr_rel[i].id;

				} else {
					foundElem = true;
				}
			}
		}

        $(document).keydown(function(event) {
            if (event.keyCode == 27) {
                removeFancy();

            } else if(event.keyCode == 37 && prevElem) {
				$("#" + prevElem).click();

			} else if(event.keyCode == 39 && nextElem) {
				$("#" + nextElem).click();
			}
        });

        $('#fancy_block').fadeIn("normal", function() {
			$( createTransparentDiv('id="fancy_close"', settings.path + 'fancy_closebox.png', 30, 30, 'top:-10px;left:-15px', 94) ).appendTo("#fancy_block");

			if (currentElemRel !== undefined || currentElemTitle !== undefined) {
				var titlePadding = nextElem || prevElem ? 50 : 15;
				currentElemTitle = currentElemTitle === undefined ? '&nbsp;' : currentElemTitle;

				$("#fancy_block").append(createTransparentDiv('id="fancy_title"', settings.path + 'fancy_title.png', (imageSize[0] - titlePadding), false, 'bottom:0px;left:0px', 94, 'color:#FFF;padding:12px 0 7px ' + titlePadding + 'px;font:' + settings.font,  currentElemTitle));
			}

			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow1.png', (imageSize[0] - 28), 25, 'top:-7px;left:14px') );
			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow2.png', 27, 25, 'top:-7px;right:-13px') );
			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow3.png', 27, (imageSize[1] - 26), 'top:18px;right:-13px') );
			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow4.png', 27, 26, 'bottom:-18px;right:-13px;') );
			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow5.png', (imageSize[0] - 28), 26, 'bottom:-18px;left:14px;') );
			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow6.png', 27, 26, 'bottom:-18px;left:-13px;') );
			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow7.png', 27, (imageSize[1] - 26), 'top:18px;left:-13px;') );
			$("#fancy_block").append( createTransparentDiv('class="fancy_shadow"', settings.path + 'fancy_shadow8.png', 27, 25, 'top:-7px;left:-13px;') );

			if (prevElem) {
				$("#fancy_block").append( createTransparentDiv('id="btnLeft"', settings.path + 'fancy_left.png',24,24,'bottom:6px;left:14px',94, 'cursor:pointer;') );
				$("#btnLeft").click(function() {
					$("#" + prevElem).click();
				});

			} else if (nextElem) {
				$("#fancy_block").append( createTransparentDiv('id="btnLeft"', settings.path + 'fancy_left_off.png',24,24,'bottom:6px;left:14px',94) );
			}

			if (nextElem) {
				$("#fancy_block").append( createTransparentDiv('id="btnRight"', settings.path + 'fancy_right.png',24,24,'bottom:6px;right:14px',94,'cursor:pointer;') );
				$("#btnRight").click(function() {
					$("#" + nextElem).click();
				});

			} else if (prevElem) {
				$("#fancy_block").append( createTransparentDiv('id="btnRight"', settings.path + 'fancy_right_off.png',24,24,'bottom:6px;right:14px',94) );
			}

			$("#fancy_close,#fancy_img").click( function() {
				removeFancy();
			});
		});
	}

	var loadFancy = function(el) {
	    clickedElem = el;

		imgThumb = clickedElem.children("img:first");
		imgThumb.css("z-index", "80");

		var pos = getPosition(imgThumb);
		var w	= imgThumb.width();
		var h	= imgThumb.height();

		$("#fancy_loading").remove();

		if ($("#fancy_wrap").is('*')) {
			removeFancy(true);
		}

        imgPreloader = new Image();
		imgPreloader.src = clickedElem.attr('href');

		if (imgPreloader.complete) {
			showFancy();
			return;
		}

		$('<div id="fancy_loading" style="position:absolute;z-index: 90;top:' + pos.top + 'px;left:' +  pos.left + 'px; width:' + w + 'px;height:' + h + 'px;background: #FFF url(\'' + settings.path + 'fancy_loader.gif\') no-repeat center center;"></div>').prependTo("body");

		$("#fancy_loading").css("opacity", 0.5);

		$("#fancy_loading").click(function() {
			imgPreloader.onload = null;
			$(this).remove();
		});

		imgPreloader.onload = function() {
			showFancy();
		}
	}

	return this.each(function() {
		var $this = $(this);

		$this.click(function(e) {
			loadFancy($this);
			return false;
		});
	});
};

$.fn.fancybox.defaults = {
	fancy:		true,
	opacity:	true,
	speed:		500,
	font:		'normal 12px/18px Verdana,Helvetica;letter-spacing:1px;',
	path:		'/'
}

$.fn.fancybox.defaults.path = "/medias/images/";

$(document).ready(function() {
	$(".tool_tips").toolTips();
	
    $(".truncate").truncate({
    	max_length: 250,
    	more: "Voir la suite"
    });
	
	$(".date_picker").attachDatepicker(
		$.extend({
			showStatus: true
		}, $.datepicker.regional['fr'])
	);
	
	$("a.extern_link").click(function() {
		window.open($(this).attr('href'));
	})

	$(".remooz").fancybox();

	$.randomLogo();
	$.randomQuote.start();
	
	$.slideFieldset.check();
	
	$.localScroll();
	
	if (location.hash) {
		$.scrollTo($(location.hash));
		
		if (location.hash.substr(1, 6) == "replik") {
			$(location.hash).colorQuote();
		}
	}
});

$.fn.changeVersionQuote = function(type, form) {
	var bloc = this;
	var form = form || false;
	var list_tabs = bloc.parent().parent();
	var bloc_quote = list_tabs.nextAll("div." + type);
	
	list_tabs.nextAll("div.quote").each(function() {
		$(this).css("display", "none");
		
		if (form) {
			$(this).children().attr("id", "");
		}
	});
	
	list_tabs.find("li a").each(function() {
		$(this).removeClass("movies_descriptions_tabs_current");
	});
	
	bloc.addClass("movies_descriptions_tabs_current");
	bloc_quote.css("display", "");
	
	if (form) {
		bloc_quote.children().attr("id", "quote");
	}
}

$.fn.changeAllVersionQuote = function() {
	var element = this;
	var element_text = this.find('span');
	var change;
	var bloc_quote_fr = $('#movies_quotes_sort div.fr');
	var list_tabs = bloc_quote_fr.parent();
	
	if (element_text.text() == 'Originale') {
		element_text.text('Française');
		change = 'vo';
	} else {
		element_text.text('Originale');
		change = 'fr';
	}
	
	$('#movies_quotes_sort div.fr').not('.one').each(function() {
		$(this).css("display", "none");
	});
	
	$('#movies_quotes_sort div.vo').not('.one').each(function() {
		$(this).css("display", "none");
	});
	
	list_tabs.find('li a').not('.one').each(function() {
		$(this).removeClass("movies_descriptions_tabs_current");
	});
	
	list_tabs.find('li.' + change + ' a').not('.one').addClass('movies_descriptions_tabs_current');
	$('#movies_quotes_sort div.' + change).not('.one').css('display', '');
}

$.fn.colorQuote = function() {
	if (!this) {
		return;
	}
	
	this.parent().find(".select_quote").removeClass("select_quote");

	this.addClass("select_quote");
}

$.submitQuote = function(element, id_movie) {
	var bloc = $(element);
	var quote_wait = bloc.parent().next("fieldset");
	var quote_wait_num = quote_wait.find(".num_quote_validation");
	var quote_wait_label = quote_wait.find(".label_quote_validation");
	var quote_wait_list = quote_wait.find("ul");
	var quote_wait_class;
	var inputs = [];
	
	$.scrollTo("#content");
	
	bloc.find(":input").each(function() {
		var name = this.name;
		var value = $(this).val();
	
		if ($(this).is(":checkbox")) {
			if ($(this).is(":checked")) {
				value = "on";
			} else {
				value = "off";
			}
		}
		
		inputs.push(name + "=" + value);
	});
	
	inputs.pop();
	
	var load_id = $.message.loading(bloc.parent());
	
	bloc.find("[type='submit']").attr("disabled", "disabled");
	bloc.attr("onsubmit", "return false;");
	
	$.ajax({
		type: "post",
		url: "/ajax.php?action=add_quote&id_movie=" + id_movie,
		data: inputs.join("&"),
		dataType: "json",
		success: function(data) {
			bloc.attr("onsubmit", "$.submitQuote(this, " + id_movie + "); return false;");
			bloc.find("[type='submit']").removeAttr("disabled");
		
			$.refreshCaptcha();
		
			if (data.type == "errors") {
				$.message.hide(load_id, true);
				
				$.message.multiple(bloc.parent(), data.text.split("[]"));
				
				return;
			}
		
			bloc.find(":input").each(function() {
				if ($(this).attr("type") != "submit") {
					if ($(this).attr("type") == "checkbox") {
						$(this).removeAttr("checked");
					} else {
						$(this).val("");
					}
				}
			});
		
			$("#slide_wait_quote").parent("fieldset").css("display", "");
		
			if ($("#slide_wait_quote").is(":hidden")) {
				$("#slide_wait_quote").parent("fieldset").removeClass("no_slide");
			
				$.slideFieldset.toggle("#slide_wait_quote");
			}
		
			var num_quote = parseInt(quote_wait_num.text()) + 1;
			
			if (quote_wait_label.text() != "ss") {
				if (num_quote > 1) {
					quote_wait_label.fadeOut("slow", function() {
						quote_wait_label.text("s");
						
						quote_wait_label.fadeIn("slow");
					});
				}
			}
			
			quote_wait_num.fadeOut("slow", function() {
				quote_wait_num.text(num_quote);
				
				quote_wait_num.fadeIn("slow");
			});
		
			$.ajax({
				type: "get",
				url: "/ajax.php?action=get_last_quote",
				success: function(data_bis) {
					$.message.hide(load_id, true);
				
					$.message.show(bloc.parent(), {
						text: data.text,
						type: data.type
					});
					
					if (quote_wait_list.find("li:first").hasClass("line_color_1")) {
						quote_wait_class = "line_color_2";
					} else {
						quote_wait_class = "line_color_1";
					}
					
					$(data_bis).attr("class", quote_wait_class).css("display", "none").prependTo(quote_wait_list).fadeIn("slow");
				}
			});
		}
	});
	
	quote_wait_list.find(".tool_tips").toolTips();
}

$.favourites = {
	add: function(element, type, id) {
		var bloc = $(element);
		var img = "";
		var load_id;
		
		if (type == "movie") {
			img = "_big";
			load_id = $.message.loading(bloc.parent().parent());
		} else {
			load_id = $.message.loading(bloc.parent().parent().parent());
		}
		
		$.ajax({
			type: "get",
			url: "/ajax.php?action=favourites",
			dataType: "json",
			data: {
				type: type,
				id: id
			},
			success: function(data) {
				var bloc_message;
				
				$.message.hide(load_id, true);
				
				if (type == "quote") {
					bloc_message = bloc.parent().parent().parent();
				} else {
					bloc_message = bloc.parent().parent();
				}
			
				$.message.show(bloc_message, data);
				
				if (data.type != "errors") {
					bloc.fadeOut("slow", function() {
						bloc.find(".favourite").attr("src", "/medias/images/admin/favoris" + img + "_ok.png");
						
						bloc.removeAttr("onclick");
						bloc.fadeIn("slow");
					});
				}
			}
		});
	},
	
	del: function(element, id) {
		var bloc = $(element).parent().parent();
		var legend = $(element).parent().parent().parent().prev("legend");
		var count_favorite = legend.find(".count_favourite").text();
		var message = "Êtes-vous sûr de vouloir supprimé ce favoris ?";
		
		if (confirm(message)) {
			$.ajax({
				type: "get",
				url: "/ajax.php?action=delete_favourite",
				data: "id=" + id,
				dataType: "json",
				success: function(data) {
					bloc.fadeOut("slow", function() {
						bloc.html(data.text);
						
						bloc.fadeIn("slow");
					})
					
					if (data.type != "errors") {
						legend.find(".count_favourite").fadeOut("slow", function() {
							legend.find(".count_favourite").text(count_favorite - 1);
							
							if (count_favorite - 1 <= 1) {
								legend.find(".label_favourite").fadeOut("slow");
							}
							
							legend.find(".count_favourite").fadeIn("slow");
						});
					}
				}
			});
		}
	}
}

$.vote = {
	request: function(type, id) {
		var bloc = $("#replik_" + id);
		var load_id = $.message.loading(bloc);
	
		$.ajax({
			type: "get",
			url: "/ajax.php?action=vote",
			dataType: "json",
			data: {
				data: type,
				id: id
			},
			success: function(data) {
				$.message.hide(load_id, true);
			
				$.message.show(bloc, data);
				
				if (data.type != "errors") {
					$.vote.inactivated(bloc, id);
				}
			}
		});
	},
	
	inactivated: function(bloc, id) {
		var bloc_moins = bloc.find(".movies_fiche_vote_moins");
		var bloc_plus = bloc.find(".movies_fiche_vote_plus");
		var bloc_vote = bloc.find(".replik_vote");
		var bloc_num_vote = bloc.find(".replik_vote_nb");
	
		$.ajax({
			type: "get",
			url: "/ajax.php?action=get_vote",
			dataType: "json",
			data: {
				id: id
			},
			success: function(data) {
				bloc_moins.fadeOut("slow");
				bloc_plus.fadeOut("slow");
				
				bloc_vote.fadeOut("slow", function() {
					bloc_vote.text(data.vote);
					bloc_vote.fadeIn("slow");
				});
				bloc_num_vote.fadeOut("slow", function() {
					bloc_num_vote.text(data.num);
					bloc_num_vote.fadeIn("slow");
				});
			}
		});
	}
};

$.fn.spoiler = function() {
	var bloc = this;
	
	if (bloc.find("span").text() == "Masquer le spoiler") {
		bloc.next(".bloc_content").fadeOut("slow", function() {
			bloc.find("span").text("Afficher le spoiler");
			bloc.css("border-bottom", "none");
		});
	} else {
		bloc.css("border-bottom", "1px dotted #000");
		
		bloc.next(".bloc_content").fadeIn("slow", function() {
			bloc.find("span").text("Masquer le spoiler");
		});
	}
}

$.refreshCaptcha = function() {
	var captcha = $(".captcha_loading");

	$.ajax({
		type: "get",
		url: "/ajax.php?action=captcha",
		success: function(data) {
			captcha.fadeOut("slow", function() {
				captcha.find("img").attr("src", "/captcha.php?" + data);
				
				captcha.fadeIn("slow");
			});
		}
	});
}

$.randomQuote = {
	start: function() {
		$('.random_quote_start').text("Stop");
		$('.random_quote_start').removeAttr("onclick");
	
		var timer_id = $.timer.add(20000, function(timer) {
			$.randomQuote.next();
		});
		
		$('.random_quote_start, .random_quote_next, .random_quote_previous').click(function() {
			$('.random_quote_start').text("Jouer");
			$('.random_quote_start').attr("onclick", "$.randomQuote.start();");
		
			$.timer.stop(timer_id);
		});
	},
	
	next: function() {
		var num_quote = this.getNumQuote();
		
		this.setQuote(num_quote, "next");
	},
	
	previous: function() {
		var num_quote = this.getNumQuote();
		
		this.setQuote(num_quote, "previous");
	},
	
	setQuote: function(num_quote, type) {
		var num_quote_list;
		var max_quote = 9;
		
		if (type == "next") {
			num_quote_list = num_quote + 1;
			
			if (num_quote_list > max_quote) {
				num_quote_list = 0;
			}
		} else {
			num_quote_list = num_quote - 1;
			
			if (num_quote_list < 0) {
				num_quote_list = max_quote;
			}
		}
		
		$('.random_quote_next').removeAttr("onclick");
		$('.random_quote_previous').removeAttr("onclick");
	
		$("#replik_random_content_" + num_quote).animate({
			left: "+=30px",
			opacity: 0
		}, "slow", function() {
			$("#replik_random_content_" + num_quote).css("display", "none");
			$("#replik_random_content_" + num_quote_list).css("opacity", 0).css("display", "");
			
			$("#replik_random_content_" + num_quote_list).animate({
				left: "-=30px",
				opacity: 1
			}, "slow", function() {
				$("#replik_random span.replik_random").text(num_quote_list);
				
				$('.random_quote_next').attr("onclick", "$.randomQuote.next();");
				$('.random_quote_previous').attr("onclick", "$.randomQuote.previous();");
			});	
		});
	},
	
	getNumQuote: function() {
		var num_quote = parseInt($("#replik_random span.replik_random").text());
		
		return num_quote;
	}
}

$.slideFieldset = {
	toggle: function(element) {
		var slide = $(element);
		
		this.generateVar(slide);
		
		this.fieldset.removeAttr("style");
			
		slide.slideToggle("slow", function() {
			if (slide.is(":hidden")) {
				$.cookie(element, null);
				
				$.slideFieldset.hide(slide);
			} else {
				$.cookie(element, "ok");
				
				$.slideFieldset.show();
			}
		});
	},
	
	hide: function(slide) {
		slide.css("display", "none");
	
		this.link.text("[+]");
		this.fieldset.css("border", "none").css("border-top", "1px solid #000").css("background", "none");
	},
	
	show: function(display) {
		if (!this.fieldset.hasClass("no_slide")) {
			this.link.text("[-]");
			this.fieldset.removeAttr("style");
		}
	},
	
	check: function() {
		$("[id^='slide_']").each(function(i) {
			var element = "#" + $(this).attr("id");			
			var slide = $(element);
			
			$.slideFieldset.generateVar(slide);
			
			if ($.cookie(element) == "ok") {
				$.slideFieldset.show();
			} else {
				$.slideFieldset.hide(slide);
			}
		});
	},
	
	generateVar: function(slide) {
		this.link = slide.prevAll("legend").find("span.help");
		this.fieldset = slide.parent("fieldset");
	}
}

$.randomLogo = function() {
	var header = $("#header img");

	$.ajax({
		type: "get",
		url: "/ajax.php?action=random_logo",
		success: function(data) {
			var num_logo = data;
			var last_logo = Math.floor(Math.random() * num_logo) + 1;
			var random_logo = last_logo;
			
			header.attr("src", "/medias/images/bannieres/" + random_logo + ".jpg");
			
			$.timer.add(25000, function() {
				while (random_logo == last_logo) {
					random_logo = Math.floor(Math.random() * num_logo) + 1;
				}
			
				header.fadeOut("slow", function() {
					header.attr("src", "/medias/images/bannieres/" + random_logo + ".jpg");
					
					header.fadeIn("slow");
				});
				
				last_logo = random_logo;
			});
		}
	});
}

$.fn.toolTips = function() {
	this.each(function(i) {
		var tool_tip = $("#tool_tip");
		var tool_tip_text = tool_tip.find(".tool-text");
		var bloc = $(this);
		var content = bloc.attr("title");
		
		if (content == "") {
			return;
		}

		tool_tip_text.empty();
		bloc.attr("title", "");
		
		bloc.hover(function(e) {
			var posx = 0;
			var posy = 0;
			var tool_tip_posx = 0;
			var tool_tip_posy = 0;
			var top = 0;
			var left = 0;

			if (tool_tip) {
				tool_tip.hide();
			}
			
			if (content.substr(0, 5) == "AJAX:") {
				$.ajax({
					type: "get",
					url: content.substr(5),
					beforeSend: function() {
						tool_tip.find(".tool-loading-false").addClass("tool-loading");
					},
					success: function(data) {
						tool_tip.find(".tool-loading-false").removeClass("tool-loading");
						tool_tip_text.html(data);
					}
				});
			} else {
				tool_tip_text.html(content);
			}

			if (e.pageX || e.pageY) {
				posx = e.pageX;
				posy = e.pageY;
			} else if (e.clientX || e.clientY) {
				posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
				posy = e.clientY + document.body.scrollTop  + document.documentElement.scrollTop;
			}
			
			tool_tip_posx = tool_tip.width() + posx;
			tool_tip_posy = tool_tip.height() + e.clientY;

			if (tool_tip_posx > document.documentElement.clientWidth) {
				left = posx - 10 - tool_tip.width();
			} else {
				left = posx + 10;
			}
			
			if (tool_tip_posy > document.documentElement.clientHeight) {
				top = posy - 10 - tool_tip.height();
			} else {
				top = posy + 10;
			}

			tool_tip.css("left", left);
			tool_tip.css("top", top);
			tool_tip.css("opacity", 0.9);
			
			tool_tip.show();
		}, function() {
			tool_tip.hide();
			tool_tip_text.empty();
		});
	});	
}

$.message = {
	show: function(bloc, data, loading) {
		var class_message = "message_javascript ";
		var message_id = "message_" + Math.round(Math.random() * 100);
		var button_close = 	"	<span class=\"admin_bar\" style=\"float: right;\">" +
							"		<a href=\"#1\" onclick=\"$.message.hide(this);\"><img src=\"/medias/images/admin/del.png\" alt=\"\" /></a>" +
							"	</span>";
		
		if (loading) {
			class_message = "";
			button_close = "";
		}
		
		var message = 	"<p id=\"" + message_id + "\" class=\"" + class_message + data.type +"\" style=\"display: none;\">" +
						button_close +
						"	" + data.text +
						"</p>";
						
		bloc.before(message);
		
		$("#" + message_id).fadeIn("slow");
		
		$("#" + message_id).toolTips();
		
		$.message.hide($("#" + message_id).prev(".message_javascript"), true)
		
		return "#" + message_id;
	},
	
	loading: function(bloc) {
		return $.message.show(bloc, {
			text: "Chargement...",
			type: "infos"
		}, true);
	},
	
	multiple: function(bloc, data) {
		var message_id = "multiple_" + Math.round(Math.random() * 100);
		var count_data = data.length;
		var message = 	"<div class=\"message_javascript errors\"><span class=\"admin_bar\" style=\"float: right;\"><a href=\"#1\" onclick=\"$.message.hide(this);\"><img src=\"/medias/images/admin/del.png\" class=\"tool_tips\" title=\"Fermer\" alt=\"\" /></a></span>" +
						"	<p>Le formulaire contient " + count_data + " erreur";
		
		if (count_data > 1) {
			message += "s";
		}
		
		message += 	"	</p>" +
					"	<ul>" +
					"		<li>" +
					data.join("</li><li>") +
					"		</li>" +
					"	</ul>" +
					"</div>";
					
		bloc.before(message);
		
		$("#" + message_id).fadeIn("slow");
		
		$("#" + message_id).toolTips();
		
		return "#" + message_id;
	},
	
	hide: function(bloc, auto) {
		var auto = auto || false;
		var bloc;
		
		if (auto) {
			bloc = $(bloc);
		} else {
			bloc = $(bloc).parent().parent();
		}
		
		bloc.fadeOut("slow", function() {
			bloc.remove();
		});
	}
}

$.blocQuote = {
	add: function(bloc_quote, limit, admin) {
		var limit = limit || 20;
		var admin = admin || false;
		
		if (admin) {
			tinyMCE.execCommand("mceRemoveControl", false, "quote_content_1");
			tinyMCE.execCommand("mceRemoveControl", false, "quote_vo_content_1");
		}
		
		var count_bloc_quote = parseInt($(bloc_quote + ":last legend span.number").text()) + 1;
		var clone_bloc_quote = $(bloc_quote + ":first");
		var new_bloc_quote = clone_bloc_quote.clone();
		
		new_bloc_quote.find("legend").prepend("<span class=\"admin_bar\"><a href=\"#1\" class=\"toggle\" onclick=\"$.blocQuote.remove(" + count_bloc_quote + ")\"><img src=\"/medias/images/admin/del.png\" alt=\"\" /></a></span> | ");
		new_bloc_quote.attr("id", "bloc_quote_" + count_bloc_quote);
		new_bloc_quote.find("legend span.number").text(count_bloc_quote);
		new_bloc_quote.find("legend input").attr("id", "spoiler_" + count_bloc_quote);
		new_bloc_quote.find("legend label").attr("for", "spoiler_" + count_bloc_quote);
		
		if (admin) {
			new_bloc_quote.find("div.fr textarea").attr("id", "quote_content_" + count_bloc_quote);
			new_bloc_quote.find("div.vo textarea").attr("id", "quote_vo_content_" + count_bloc_quote);
		
			new_bloc_quote.find("div.author input").attr("id", "author_" + count_bloc_quote);
			new_bloc_quote.find("div.author label").attr("for", "author_" + count_bloc_quote);
		}
		
		new_bloc_quote.css("display", "none");
		
		new_bloc_quote.insertAfter(bloc_quote + ":last").fadeIn("slow");
		
		if (count_bloc_quote >= limit) {
			$("#add_bloc_quote").attr("disabled", "disabled");
		}
		
		if (admin) {
			tinyMCE.execCommand("mceAddControl", false, "quote_content_" + count_bloc_quote);
			tinyMCE.execCommand("mceAddControl", false, "quote_vo_content_" + count_bloc_quote);
		
			tinyMCE.execCommand("mceAddControl", false, "quote_content_1");
			tinyMCE.execCommand("mceAddControl", false, "quote_vo_content_1");
		}
		
		//new_bloc_quote.find("a.movies_descriptions_tabs_current").changeVersionQuote("fr");
	},
	
	remove: function(num_bloc_quote) {
		var bloc_quote = $("#bloc_quote_" + num_bloc_quote);
		
		bloc_quote.fadeOut("slow", function() {
			bloc_quote.remove();
			
			$("#add_bloc_quote").attr("disabled", "");
		});
	}
}

$.timer = {
	add: function(interval, callback) {
		var interval = interval || 100;
		
		if (!callback) {
			return false;
		}
		
		this.internalCallback = function() {
			callback(self);
		};
		
		this.interval = interval;
		this.id = setInterval(this.internalCallback, this.interval);
		
		return this.id;
	},
	
	stop: function(id) {
		var id = id || this.id;
	
		clearInterval(id);
	},
	
	reset: function(val, id) {
		var id = id || this.id;
	
		if (id) {
			clearInterval(id);
		}
		
		var val = val || 100;
		
		this.id = setInterval(this.internalCallback, val);
	}
}

$.sleep = function(timeout) { 
	var loop = true;
	var current = new Date(); 
	var now;
	var cTimestamp = current.getTime();
	 
	while (loop) {
		now = new Date();
		nTimestamp = now.getTime();
		
		if (nTimestamp - cTimestamp > timeout) {
			loop = false;
		}
	}
}

$.cookie = function(name, value, options) {
    if (typeof value != 'undefined') {
        options = options || {};
        
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        
        var expires = '';
        
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            
            expires = '; expires=' + date.toUTCString();
        }
		
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
    	var secure = options.secure ? '; secure' : '';
    	
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else {
        var cookieValue = null;
        
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    
                    break;
                }
            }
        }
        
        return cookieValue;
    }
};
