Está en la página 1de 90

String.prototype.ucFirst=function(){return this.substr(0,1).toUpperCase()+this.s ubstr(1);};String.prototype.camelize=function(){var a=this.split("_");s=[];for(i =0;i<a.length;i++){s.push(a[i].charAt(0).toUpperCase()+a[i].substring(1));} s=s.join("");return s;};String.prototype.isSQLDate=function(){return/^\d{4}-\d{2 }-\d{2}$/.test(this);};String.prototype.isSQLEmptyDate=function(){return this==" 0000-00-00";};String.prototype.isSqlInfinityDate=function(){return this=="9999-1 2-31";};String.prototype.sqlDateToUsDate=function(){var dates=this.split("-");re turn dates[1]+"/"+dates[2]+"/"+dates[0];};String.prototype.

ltrim=function(){retu rn this.replace(/\s*((\S+\s*)*)/,"");};String.prototype.rtrim=function(){return this.replace(/\s*((\S+\s*)*)/,"");};String.prototype.trim=function(){return this .replace(/^\s+|\s+$/g,"");};String.prototype.empty=function(){return(null===this ||""===this);};String.prototype.camelize=function() {var propWords=this.split("_");var camelCased="";for(var i=0;i<propWords.length; i++){camelCased+=propWords[i].ucFirst();} return camelCased;};String.prototype.between=function(prefix,suffix){s=this.toUp perCase();prefix=prefix.toUpperCase();suffix=suffix.toUpperCase();var i=s.indexO f(prefix);if(i>=0){s=s.substring(i+prefix.length);} else{return'';} if(suffix){i=s.indexOf(suffix);if(i>=0){s=s.substring(0,i);} else{return'';}} return s;};Date.prototype.toUsDate=function(){return isNaN(this)?'NaN':[this.get Month()>8?this.getMonth()+1:'0'+(this.getMonth()+1),this.getDate()>9?this.getDat e():'0'+this.getDate(),this.getFullYear()].join('/');};Date.prototype.addDays=fu nction(days){var dateOffset=(24*60*60*1000)*days;this.setTime(this.getTime()+dat eOffset);return this;};function formatCurrency(number,round,showDollarSign) {var dblValue;var blnSign;var intCents;var strCents;var dollarSign=showDollarSig n!==false?'$':'';number=number.toString().replace(/\$|\,/g,'');dblValue=parseFlo at(number);blnSign=(dblValue==(dblValue=Math.abs(dblValue)));dblValue=Math.floor (dblValue*100+0.50000000001);intCents=dblValue%100;strCents=intCents.toString(); dblValue=Math.floor(dblValue/100).toString();if(intCents<10){strCents="0"+strCen ts;} for(var i=0;i<Math.floor((dblValue.length-(1+i))/3);i++){dblValue=dblValue.subst ring(0,dblValue.length-(4*i+3))+','+ dblValue.substring(dblValue.length-(4*i+3));} value=(((blnSign)?'':'-')+dollarSign+dblValue+'.'+strCents);return round?value.s plit(".")[0]:value;}

(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a .parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return fal se;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|bu tton|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return! c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")=== "hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c .extend(c.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:18 8,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:3 5,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DEC IMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT: 109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WI NDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:f unction(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeo ut(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)} ,scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.c ss("position"))||/absolute/.test(this.css("position"))?this.parents().filter(fun ction(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(a

uto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.cu rCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto |scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCS S(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.len gth?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(th is.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position" );if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10) ;if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function( ){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disabl eSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){f unction d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,t rue))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=p arseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left ","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,inne rHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight };c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return thi s.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g) {if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(functi on(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:functi on(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr (a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);ret urn(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=docu ment.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",pad ding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.select start="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui, {plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a. plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugin s[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[ e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumen tPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:functi on(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollL eft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){r eturn c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);;(function(b, j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[ c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn. remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filt er(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerH andler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a, c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b .expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h, g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{} ,c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEv entPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget. bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeo f d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b .extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;e?this .each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g; if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g ?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=func tion(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetN ame:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:functio n(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(tr ue,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("rem ove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("cre ate");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.g et(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},de stroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widget Name);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").remo

veClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){r eturn this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a ];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=thi s;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a, c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"] (this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);ret urn this},enable:function(){return this._setOption("disabled",false)},disable:fu nction(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e =this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEv entPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;fo r(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c ,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPre vented())}}})(jQuery);;(function(b){var d=false;b(document).mouseup(function(){d =false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0 },_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetNam e,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c) {if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.ta rget,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return fals e}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+ this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseU p(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel =="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:fa lse;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.option s.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mou seDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDe layMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted ){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preve ntClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this ._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=fu nction(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,th is._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a. preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&!(doc ument.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted) {this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this ._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)! ==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp :function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDele gate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseSta rted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.t arget,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false },_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pa geX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distanc e},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){} ,_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);;(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top| center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b .of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.co llision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.node Type===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.wi dth();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDe fault){b.at="left top";h=k=0;j={top:b.of.pageY,left:b.of.pageX}}else{h=a.outerWi dth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this ]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0 ])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1] =o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt( e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="ri ght")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.to p+=k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this. each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.cu

rCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0, v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS( this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l ;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b .my[1]==="center")i.top-=m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r ={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g [s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHei ght:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at :b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c .ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left +a.collisionWidth-d.width()-d.scrollLeft();b.left=d>0?b.left-d:Math.max(b.left-a .collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collision Position.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.m ax(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!== "center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth :0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=a.co llisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="cente r"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scr ollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e =a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collis ionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffs et=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="rela tive";var d=c(b),g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseIn t(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"usi ng"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a| |!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffse t(this,b)});return u.call(this)}}})(jQuery);;(function(d){d.widget("ui.draggable ",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent ",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:fa lse,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refr eshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,s crollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,s tack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&& !/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position= "relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.o ptions.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit( )},destroy:function(){if(this.element.data("draggable")){this.element.removeData ("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-draggi ng ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:func tion(a){var b=this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resiz able-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function() {d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({ width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",op acity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true} ,_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);th is._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this. _cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=t his.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();thi s.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margin s.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-t his.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset( )});this.originalPosition=this.position=this._generatePosition(a);this.originalP ageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper (b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)== =false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager &&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass(" ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.d ragStart(this,a);return true},_mouseDrag:function(a,b){this.position=this._gener

atePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=thi s._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false }this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.hel per[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.ax is!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddm anager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddm anager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.droppe d){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].pare ntNode)&&this.options.helper=="original")return false;if(this.options.revert=="i nvalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFu nction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=thi s;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDurat ion,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger ("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.option s.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentN ode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d .ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui -draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:fu nction(a){var b=!this.options.handle||!d(this.options.handle,this.element).lengt h?true:false;d(this.options.handle,this.element).find("*").andSelf().each(functi on(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.o ptions;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper= ="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").le ngth||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0 ]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position ","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string ")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this. offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left =this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset .click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.hel perProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){thi s.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(th is.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.s crollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.t op+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.o ffsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.br owser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("bo rderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWi dth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){v ar a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),1 0)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left "),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMarg ins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0 ,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.c ss("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0 }},_cacheHelperProportions:function(){this.helperProportions={width:this.helper. outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a =this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode ;if(a.containment=="document"||a.containment=="window")this.containment=[a.conta inment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offse t.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.rela tive.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLef t())+d(a.containment=="document"?document:window).width()-this.helperProportions .width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d( a.containment=="document"?document:window).height()||document.body.parentNode.sc rollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|wind ow|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.contai nment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!="hidden";this.con tainment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("padd ingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).cs

s("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight") ,10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Ma th.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("border TopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperPropor tions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}el se if(a.containment.constructor==Array)this.containment=a.containment},_convertP ositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cs sPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scro llParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html| body)/i.test(c[0].tagName);return{top:b.top+ this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser .version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrol lParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left* a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPo sition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0 :c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cs sPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scro llParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html| body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;i f(this.containment){if(this.relative_container){g=this.relative_container.offset ();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g .left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset. click.left<g[0])e=g[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<g [1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+t his.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.c lick.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPa geY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]| |h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b .grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/b.gr id[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this. offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[ 0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.pa rent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:t his.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left: e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.br owser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPositio n=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function (){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element [0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cance lHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.c all(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolut e");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:func tion(){return{helper:this.helper,position:this.position,originalPosition:this.or iginalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8 .16"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sort ables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if (h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.rev ert});h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortable s,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemov al=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instan ce.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper= this.instance.options._helper;c.options.helper=="original"&&this.instance.curren tItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false ;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).d ata("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs= c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance. offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.conta

inerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.curre ntItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sorta ble-item",true);this.instance.options._helper=this.instance.options.helper;this. instance.options.helper=function(){return b.helper[0]};a.target=this.instance.cu rrentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,tru e,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.c lick.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent. left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset. parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped= this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.i nstance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){t his.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.optio ns.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instan ce));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance .options._helper;this.instance.currentItem.remove();this.instance.placeholder&&t his.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}} )}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d( this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.c ss("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a ._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opac ity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a .css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:fun ction(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opac ity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a =d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tag Name!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d( this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.sc rollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b .scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scro llTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffs et.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrol lTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollPare nt[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.s crollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c. scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c. scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.sc rollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);e lse if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity) f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axi s!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scr ollLeft(d(document).scrollLeft()c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.sc rollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed) }f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a) }});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("dra ggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items ||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a. element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHe ight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("dra ggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.w idth,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>= 0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements [i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e &&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&&o<m+e){if(f.sna pMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=M ath.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.hel perProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertP ositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._c onvertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.mar gins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).l

eft-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q =Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._c onvertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.to p=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top -c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left: j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{to p:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i] .snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.eleme nt,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i]. snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&& c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapEle ments[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggabl e","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArr ay(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(pa rseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zInde x)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.len gth}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper); b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex") ;a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").option s;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);;(function(d){d.wi dget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:fa lse,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"int ersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.iso ut=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions= {width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddm anager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager .droppables[a.scope].push(this);a.addClasses&&this.element.addClass("ui-droppabl e")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope], b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppa ble ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:func tion(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_ac tivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.e lement.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui( b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeCla ss&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactiv ate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.c urrentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0], b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.o ptions.hoverClass);this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d .ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))i f(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hover Class&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,t his.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.curre ntItem||c.element)[0]==this.element[0])return false;var e=false;this.element.fin d(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=d.data (this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c. options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.inters ect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;retur n false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem|| c.element)){this.options.activeClass&&this.element.removeClass(this.options.acti veClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverCla ss);this._trigger("drop",a,this.ui(c));return this.element}return false},ui:func tion(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.pos ition,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.16"});d.ui. intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.posi tion.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.a bsolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.wi dth,j=b.offset.top,l=j+b.proportions.height;switch(c){case"fit":return i<=e&&g<= k&&j<=f&&h<=l;case"intersect":return i<e+a.helperProportions.width/2&&g-a.helper

Proportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.h eight/2<l;case"pointer":return d.ui.isOver((a.positionAbs||a.position.absolute). top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).lef t+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.wi dth);case"touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=i&&e<=k||g>=i&&g< =k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"d efault":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.optio ns.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable )").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].acc ept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++) if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f] .element.css("display")!="none";if(c[f].visible){e=="mousedown"&&c[f]._activate. call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].elem ent[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){va r c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(th is.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this. options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this. visible&&this.accept.call(this.element[0],a.currentItem||a.element)){this.isout= 1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a ,b){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.op tions.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b) {a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddma nager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||thi s.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.toleranc e);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(thi s.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.leng th){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover") {e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout "]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e .isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parents(":not (body,html)").unbind("scroll.droppable");a.options.refreshPositions||d.ui.ddmana ger.prepareOffsets(a,b)}}})(jQuery);;(function(e){e.widget("ui.resizable",e.ui.m ouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animate Duration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containme nt:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,max Width:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a= this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:! !a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportio nallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resiza ble-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|sele ct|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera &&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wr ap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:t his.element.css("position"),width:this.element.outerWidth(),height:this.element. outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this. element=this.element.parent().data("resizable",this.element.data("resizable"));t his.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css( "marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.o riginalElement.css("marginRight"),marginBottom:this.originalElement.css("marginB ottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,margi nBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.ori ginalElement.css("resize","none");this._proportionallyResizeElements.push(this.o riginalElement.css({position:"static",zoom:1,display:"block"}));this.originalEle ment.css({margin:this.originalElement.css("margin")});this._proportionallyResize ()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s, se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizabl e-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-r esizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this. handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for( var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle

'+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zInde x});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f] =".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||th is.element;for(var i in this.handles){if(this.handles[i].constructor==String)thi s.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&th is.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(t his.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.o uterWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$ /.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(thi s.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-ha ndle",this.element).disableSelection();this._handles.mouseover(function(){if(!b. resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|n w|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e( this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled) {e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if( !a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles .hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=func tion(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizi ng").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").r emove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(th is.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a .outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElem ent.css("resize",this.originalResizeStyle);b(this.originalElement);return this}, _mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handle s[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function( b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=tru e;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft() };if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:" absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("positi on"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c =m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+ =e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset =this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width :d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this .originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width: d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= {width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.original MousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio== "number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(" .ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.a xis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b); return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePositi on,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left ||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspect Ratio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propag ate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",w idth:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._pr oportionallyResizeElements.length&&this._proportionallyResize();this._updateCach e(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){th is.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proport ionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasS croll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper. width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.po sition.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),1 0)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.e xtend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.wi dth);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("curso r","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("st op",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries :function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,max

Width:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,m axHeight:k(a.maxHeight)?a.maxHeight:Infinity};if(this._aspectRatio||b){b=a.minHe ight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRat io;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a .minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._v Boundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.l eft))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height ))this.size.height=b.height;if(k(b.width))this.size.width=b.width},_updateRatio: function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b .height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if (d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c. height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function (b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.w idth,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&& a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width =a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.ma xHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position .top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a .minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top= j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&! b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._pr oportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this ._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeEleme nts[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidt h"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"), c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDi f=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})} e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({hei ght:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borde rDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this .elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e ('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version <7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.o uterWidth()+ a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffse t.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper. appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:fu nction(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left :this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c ){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:f unction(b,a,c){return{height:this.originalSize.height+ c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this ._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change .s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c) {return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this, [b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,argument s),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.ca ll(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},u i:function(){return{originalElement:this.originalElement,element:this.element,he lper:this.helper,position:this.position,size:this.size,originalSize:this.origina lSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{versio n:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e( this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this) ;d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.h eight(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),positi on:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parent Node)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e .each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a) {var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPo sition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.p

osition.topf.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){va r l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parent s(a.originalElement[0]).length?["width","height"]:["width","height","top","left" ];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.br owser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=tru e;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoR esize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j) }):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options, c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizab le-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativ ePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.a lsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsor esize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this) .data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/te xtarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.heigh t;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseIn t(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||nul l;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDurati on,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("w idth"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.cs s("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({ width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}}) ;e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data( "resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/p arent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c )||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top :0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),hei ght:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a) ,f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("paddin g"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.contain erSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffs et;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left ")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a, left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data ("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.s hiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.te st(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helpe r?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/ c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a. size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.s ize.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parent Data.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.ab s((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math .abs((a._helper?a.offset.top-g.top:a.offset.topd.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0) ;g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.par entData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.wi dth-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parent Data.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height *a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b .containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.of fset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._ helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left -d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("po sition"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plu gin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a= b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,d isplay:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0

,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghos t:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizabl e");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size. width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.he lper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{r esize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.origin alSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.gr id]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=M ath.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.tes t(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){ b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/ ^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.wid th=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.l eft-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN (parseInt(b,10))}})(jQuery);;(function(e){e.widget("ui.selectable",e.ui.mouse,{o ptions:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch" },_create:function(){var c=this;this.element.addClass("ui-selectable");this.drag ged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.eac h(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:t his,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d. outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d .hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.ref resh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e( "<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.r emoveClass("ui-selectee").removeData("selectable-item");this.element.removeClass ("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selec table");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;thi s.opos=[c.pageX,c.pageY];if(!this.options.disabled){var d=this.options;this.sele ctees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append( this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d. autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function( ){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$el ement.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unsele cting");b.unselecting=true;f._trigger("unselecting",c,{unselecting:b.element})}} );e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectableitem");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.re moveClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unsele cting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{ selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options .disabled){var d=this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY; if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width: h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-it em");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!( a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b& &a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("uiselected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselec ting");a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting"); a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.sele cting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.se lecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element .removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.ad dClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselect ing:a.element})}if(a.selected)if(!c.metaKey&&!a.startselected){a.$element.remove Class("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.un selecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return f alse}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting", this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element .removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trig ger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).

each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("uiselecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startsel ected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop", c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.1 6"})})(jQuery);;(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefi x:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:fal se,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forc eHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity: false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpee d:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a= this.options;this.containerCache={};this.element.addClass("ui-sortable");this.re fresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.ite ms[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("displ ay")):false;this.offset=this.element.offset();this._mouseInit()},destroy:functio n(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sor table").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a >=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:f unction(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"re moveClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(thi s,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this .options.disabled||this.options.type=="static")return false;this._refreshItems(a );var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortab le-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c =d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.o ptions.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true}); if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return tru e},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=t his;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperP roportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();t his.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margi ns.top,left:this.offset.left-this.margins.left};this.helper.css("position","abso lute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click: {left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getPare ntOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._gene ratePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt &&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentIt em.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentIt em[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._se tContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("bod y").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper. css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("o pacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex= this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParen t[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.sc rollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelper Proportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1 ;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddma nager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanag er.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-h elper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=thi s._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(! this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scrol l){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollPare nt[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHei ght-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollPare nt[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSe nsitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scro llSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.s crollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLe ft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)th

is.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}el se{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTo p(d(document).scrollTop()b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.sc rollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);i f(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft( d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(doc ument).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).sc rollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddma nager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute" );if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.p osition.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].s tyle.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items [b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem [0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placehold er[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):t rue)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this ._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change", a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanag er.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this .positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this. options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c =this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.l eft-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body? 0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.to p+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseI nt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);r eturn false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({targ et:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS). removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.contain ers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(t his));if(this.containers[b].containerCache.over){this.containers[b]._trigger("ou t",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.plac eholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeCh ild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.help er[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false ,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.pr ev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem) }return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected) ,c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id" )||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+( a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.j oin("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[]; a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")}); return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helpe rProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a. left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.clic k.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||th is.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.he lperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height" ]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+ this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersect sWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset. click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.cl ick.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._g etDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right "||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui .isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height );a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/ 2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirec

tion();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c= ="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this .lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection :function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&( a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPosit ions();return this},_connectWith:function(){var a=this.options;return a.connectW ith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:functio n(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(v ar f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this& &!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call( h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sort able-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.ite ms.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.o ptions.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placehol der"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});re turn d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(" :data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[ c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){thi s.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options .items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(thi s.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.leng th-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortab le");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i .options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i. element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f ][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({ite m:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){i f(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for( var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.cu rrentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=th is.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a ){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.t op=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.opt ions.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>= 0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.l eft=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].contai nerCache.width=this.containers[b].element.outerWidth();this.containers[b].contai nerCache.height=this.containers[b].element.outerHeight()}return this},_createPla ceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder. constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f =d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[ 0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if (!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forceP laceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.cur rentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0 ,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css(" paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.pla ceholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.af ter(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:fun ction(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.cont ains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith( this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].ele ment[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].con tainerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.c ontainers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.cont ainers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCach e.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.lengt h-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0 ])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-

f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.curr entContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange (a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash() );this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeh older.update(this.currentContainer,this.placeholder);this.containers[c]._trigger ("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_creat eHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply (this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone ():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo: this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0 ])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem [0].style.height,position:this.currentItem.css("position"),top:this.currentItem. css("top"),left:this.currentItem.css("left")};if(a[0].style.width==""||b.forceHe lperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelp erSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:fun ction(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top: +a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("righ t"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins. left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)t his.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_g etParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=thi s.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=d ocument&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this. scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetPar ent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagNam e.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parse Int(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.o ffsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(th is.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-( parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.lef t-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this .currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginT op"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:t his.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:funct ion(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0] .parentNode;if(a.containment=="document"||a.containment=="window")this.containme nt=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.t op-this.offset.parent.top,d(a.containment=="document"?document:window).width()-t his.helperProportions.width-this.margins.left,(d(a.containment=="document"?docum ent:window).height()||document.body.parentNode.scrollHeight)-this.helperProporti ons.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment )){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflo w")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10) ||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt (d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-thi s.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(pa rseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10 )||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollH eight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)|| 0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-thi s.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="ab solute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=documen t&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:t his.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offse t.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition==" fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollT op())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.br owser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrol lParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var

b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document& &d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:thi s.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relativ e"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0] ))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this .originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.c ontainment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offse t.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a .pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.off set.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.conta inment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((gthis.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.clic k.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-th is.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.origin alPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containmen t?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this. containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+ b.grid[0]:f}}return{top:gthis.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser .safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParen t.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relat ive.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0: this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}}, _rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].p arentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.it em[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this. counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_ clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.curre ntItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalS ort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if (this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]=""; this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else thi s.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("rec eive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition .prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.p arent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("updat e",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b ||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.conta iners.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.curr entItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,th is._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return fun ction(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e ]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return funct ion(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers [e]));if(this.containers[e].containerCache.over){c.push(function(f){return funct ion(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));t his.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("curs or",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._sto redOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex==" auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if (!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].ca ll(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger( "beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.p laceholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.he lper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a ,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widge t.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:funct ion(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),pos ition:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b .currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.16

"})})(jQuery);;(function(c){c.widget("ui.accordion",{options:{active:0,animated: "slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpa ce:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-tri angle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFil ter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_c reate:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accor dion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disab led||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function() {b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",func tion(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",fu nction(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().ad dClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" );if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if (d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest (".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).add Class("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleCla ss("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._c reateIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role"," tab").bind("keydown.accordion",function(f){return a._keydown(f)}).next().attr("r ole","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria -selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"a ria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("t abIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a .headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a. _clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a =this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header) .prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.he ader).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-ic ons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this .element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.option s;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr( "role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-ac cordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded") .removeAttr("aria-selected").removeAttr("tabIndex");this.headers.find("a").remov eAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display"," ").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-b ottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled uistate-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widge t.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._set Option.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._ destroyIcons();b&&this._createIcons()}if(a=="disabled")this.headers.add(this.hea ders.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disable d")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;swit ch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT :case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._click Handler({target:a.target},a.target);a.preventDefault()}if(f){c(a.target).attr("t abIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize :function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.e lement.parent().css("overflow");this.element.parent().css("overflow","hidden")}b =this.element.parent().height();c.browser.msie&&this.element.parent().css("overf low",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers .next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.heade rs.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)} return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0] ;this._clickHandler({target:a},a);return this},_findActive:function(a){return a?

typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.head ers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:functio n(a,b){var d=this.options;if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b= a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(! (this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.ne xt();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newCo ntent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.activ e[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.r emoveClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner -all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons .header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-sta te-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addCl ass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}e lse if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").a ddClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.ico ns.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-acco rdion-content-active");var g=this.active.next(),e={options:d,newHeader:c([]),old Header:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle( j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide= b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trig ger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.ani mated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeig ht:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e. autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuratio n)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e .proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxi edDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k] &&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration :i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j (true)}b.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex :0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.ru nning){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",over flow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide. length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this. _trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16", animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if (a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={ },e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseI nt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css(" borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each([" height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.to Show[0],i)).match(/^([\d+-.]+)(.*)$/);f[i]={value:j[1],unit:j[2]||"px"}});a.toSh ow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.co mplete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="heigh t")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.pro p]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complet e:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overf low:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide",p addingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",p addingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"ea seOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);;(function(d){var e =0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:30 0,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source: null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g; this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({ role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown .autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly "))){g=false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previo usPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move(

"previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDe fault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preven tDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESC APE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.s earching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a .search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",functi on(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){i f(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("b lur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching); a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSourc e();this.response=function(){return a._response.apply(a,arguments)};this.menu=d( "<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body ",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".uimenu-item").length||setTimeout(function(){d(document).one("mousedown",function(h ){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()}) },1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c ,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/ ^key/.test(c.originalEvent.type)&&a.element.val(f.value)},selected:function(c,f) {var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeE lement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.sele ctedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a .term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.elemen t.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this .element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this .menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autoco mplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-au tocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.pro totype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOptio n.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this. menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabl ed"&&b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.i sArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d .ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string "){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d. ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){t his.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e &&f([])}})}}else this.source=this.options.source},search:function(a,b){a=a!=null ?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minL ength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search", b)!==false)return this._search(a)},_search:function(a){this.pending++;this.eleme nt.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_res ponse:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);t his._suggest(a);this._trigger("open")}else this.close();this.pending--;this.pend ing||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clea rTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hi de();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this. previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem} )},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d. map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend ({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a );this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.posit ion(d.extend({of:this.element},this.options.position));this.options.autoFocus&&t his.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu. element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth() ))},_renderMenu:function(a,b){var g=this;d.each(b,function(c,f){g._renderItem(a, f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b ).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.me nu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.l ast()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else

this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.ele ment}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.auto complete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label|| c.value||c)})}})})(jQuery);(function(d){d.widget("ui.menu",{_create:function(){v ar e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-a ll").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(f unction(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault(); e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.childr en("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuite m").children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(funct ion(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})}, activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().t op-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height(); if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.hei ght())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","u i-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function (){if(this.active){this.active.children("a").removeClass("ui-state-hover").remov eAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move( "next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu -item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-m enu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui -menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"] (".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element .children(a))}else this.activate(b,this.element.children(a))},nextPage:function( e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element .children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.ele ment.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d (this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this. element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e, this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first" :":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.f irst())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=t his.active.offset().top,b=this.element.height();result=this.element.children(".u i-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height(); return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item :first"));this.activate(e,result)}else this.activate(e,this.element.children(".u i-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:fu nction(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scr ollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}} )})(jQuery);;(function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-butto n");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e= a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDo cument).filter(function(){return!this.form});return f};b.widget("ui.button",{opt ions:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_c reate:function(){this.element.closest("form").unbind("reset.button").bind("reset .button",l);if(typeof this.options.disabled!=="boolean")this.options.disabled=th is.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this .buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"| |this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label=== null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disable d=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corn er-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disable d){b(this).addClass("ui-state-hover");this===h&&b(this).addClass("ui-state-activ e")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}). bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediat ePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.ad dClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeC lass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a .refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabl

ed){g=false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disab led)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonEl ement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggl eClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].check ed)});else if(this.type==="radio")this.buttonElement.bind("click.button",functio n(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonEl ement.attr("aria-pressed","true");var d=a.element[0];k(d).not(d).map(function(){ return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-p ressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if (c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document). one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabl ed)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",f unction(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||d.keyCod e==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button", function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&& this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).cli ck()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineBut tonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.elemen t.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type=== "checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),c= "label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(c);if(!this .buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.butt onElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c) }this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":check ed"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("a ria-pressed",a)}else this.buttonElement=this.element},widget:function(){return t his.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden -accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-defau lt ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-buttonicon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-s econdary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").htm l(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonE lement.removeAttr("title");b.Widget.prototype.destroy.call(this)},_setOption:fun ction(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled" )c?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false );else this._resetButton()},refresh:function(){var a=this.element.is(":disabled" );a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio ")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widg et").addClass("ui-state-active").attr("aria-pressed","true"):b(this).button("wid get").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this .type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-s tate-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-sta te-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type== ="input")this.options.label&&this.element.val(this.options.label);else{var a=thi s.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-buttontext-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-t ext-only"),c=b("<span></span>").addClass("ui-button-text").html(this.options.lab el).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[ ];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+( f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='uibutton-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<spa n class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.op tions.text){d.push(f?"ui-button-icons-only":"ui-button-icon-only");this.hasTitle ||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))} }});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox , :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-button set")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"& &this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,argu ments)},refresh:function(){var a=this.element.css("direction")==="ltr";this.butt ons=this.element.find(this.options.items).filter(":ui-button").button("refresh")

.end().not(":ui-button").button().end().map(function(){return b(this).button("wi dget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(" :first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").ad dClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){thi s.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this) .button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().butto n("destroy");b.Widget.prototype.destroy.call(this)}})})(jQuery);;(function(c,l){ var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minW idth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:tr ue},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,heig ht:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,but tons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide: null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,mod al:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true, show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.orig inalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")thi s.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),g=(a .uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog u i-widget ui-widget-content ui-corner-all "+ b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydo wn(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode ===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","ar ia-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show() .removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g) ;var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-wid get-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('<a href="#"></a> ').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hove r(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-ho ver")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.remove Class("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f );(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-clo sethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-t itle").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFu nction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSele ction();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resiza ble&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgifram e&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:fu nction(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.u nbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-c ontent").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&&a.element. attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog}, close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overl ay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false; if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a )});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if (b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e =c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e =d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e. zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ +=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={sc rollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.max Z+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("fo cus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.u iDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position( b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog ",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.fil ter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);re

turn false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}});c(a. element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable") .get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("u i-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").ad dClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane ").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)}) ;if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<but ton type="button"></button>').click(function(){h.click.apply(b.element[0],argume nts)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j ,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function (){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.opti ons,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog -titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:funct ion(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).heig ht()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:functi on(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.lef t-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dr agging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}}) },_makeResizable:function(a){function b(f){return{originalPosition:f.originalPos ition,originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this. options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-c ontent",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeigh t:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:funct ion(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h)) },resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,h){c(this).r emoveClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width ();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position ",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_min Height:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.m in(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(type of a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1] ];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]) {d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.ex tend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.o ptions.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDi alog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide ()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._se tOption(g,f);if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.i s(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function( a,b){var d=this,e=d.uiDialog;switch(a){case"beforeclose":a="beforeClose";break;c ase"buttons":d._createButtons(b);break;case"closeText":d.uiDialogTitlebarCloseTe xt.text(""+b);break;case"dialogClass":e.removeClass(d.options.dialogClass).addCl ass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case"disable d":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");break; case"draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g& &b&&d._makeDraggable();break;case"position":d._position(b);break;case"resizable" :(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string" &&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;cas e"title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||"&#160;"));break}c .Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.opt ions,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",mi nHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.cs s({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.heigh t==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"}); else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.u iDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math. max(a.heightb,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","mi

nHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,max Z:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return "ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a) }});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.m ap("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){retur n a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length=== 0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind( c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overl ay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d) {if(a.options.closeOnEscape&&!d.isDefaultPrevented()&&d.keyCode&&d.keyCode===c.u i.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog -overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></ div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.wi dth(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b); return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldI nstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([docum ent,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances, function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){va r a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElemen t.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.o ffsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px "}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.m sie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth); b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);retur n a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize :function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=a.add( this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height: c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destro y:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;(function(d){d. widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false, distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,val ues:null},_create:function(){var a=this,b=this.options,c=this.element.find(".uislider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values. length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;t his._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.a ddClass("ui-slider ui-slider-"+ this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-s lider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true) {if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b .values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>" ).appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range=== "min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j +=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'> </a>");this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.ha ndles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.prevent Default()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},fun ction(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d (this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus") ;d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-s tate-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handl e",g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-sli der-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.H OME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN: case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.ke yCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-st ate-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.opti ons.values&&a.options.values.length?(h=a.values(l)):(h=a.value());switch(g.keyCo de){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valu eMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._v alueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueM

ax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i== =a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(im);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index .ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change (g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._anima teOff=false},destroy:function(){this.handles.remove();this.range.remove();this.e lement.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-sliderdisabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind (".slider");this._mouseDestroy();return this},_mouseCapture:function(a){var b=th is.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.ele ment.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.ele ment.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax ()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.va lues(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min) {g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false;this._mouseS liding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset(); this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left :0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parse Int(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0) +(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")|| this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return t rue},_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY} );this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.h andles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this ._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleI ndex=null;return this._animateOff=false},_detectOrientation:function(){this.orie ntation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValu eFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=this.elementS ize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.lef t:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOff set?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation===" vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue( this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value: this.value()};if(this.options.values&&this.options.values.length){c.value=this.v alues(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:functi on(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.value s(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c >f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigge r("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==fa lse&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a, {handle:this.handles[b],value:c});a!==false&&this.value(c)}},_stop:function(a,b) {var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this. options.values.length){c.value=this.values(b);c.values=this.values()}this._trigg er("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding) {var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this. options.values.length){c.value=this.values(b);c.values=this.values()}this._trigg er("change",a,c)}},value:function(a){if(arguments.length){this.options.value=thi s._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this. _value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.val ues[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if (arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[ 0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e) }this._refreshValue()}else return this.options.values&&this.options.values.lengt h?this._values(a):this.value();else return this._values()},_setOption:function(a ,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.W idget.prototype._setOption.apply(this,arguments);switch(a){case"disabled":if(b){ this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state -hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabl ed")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-d

isabled")}break;case"orientation":this._detectOrientation();this.element.removeC lass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orien tation);this._refreshValue();break;case"value":this._animateOff=true;this._refre shValue();this._change(null,0);this._animateOff=false;break;case"values":this._a nimateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._ animateOff=false;break}},_value:function(){var a=this.options.value;return a=thi s._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.op tions.values[a];return b=this._trimAlignValue(b)}else{b=this.options.values.slic e();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlig nValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._va lueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c =(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat( a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function( ){return this.options.max},_refreshValue:function(){var a=this.options.range,b=t his.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.op tions.values&&this.options.values.length)this.handles.each(function(h){e=(c.valu es(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizo ntal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);i f(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop( 1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"cs s"]({width:eg+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"anim ate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({heigh t:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._v alueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizo ntal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animat e);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate ":"css"]({width:e+"%"},b.animate);if(a==="max"&&this.orientation==="horizontal") this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate} );if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":" css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this .range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}} });d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery);;(function(d,p){function u (){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add :null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,di sabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelT emplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#82 30;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_c reate:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")t his.options.collapsible&&e==this.options.selected||this.select(e);else{this.opti ons[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s /g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitize Selector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this .cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie. apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,p anel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-st ate-processing").removeClass("ui-state-processing").find("span:data(label.tabs)" ).each(function(){var b=d(this);b.html(b.data("label.tabs")).removeData("label.t abs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opac ity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h =/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href] )",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this. panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split(" #")[0],q;if(l&&(l===location.toString().split("#")[0]||(q=d("base")[0])&&l===q.h ref)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._san itizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.ta bs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if( !f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-c ontent ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tab s",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.a

ddClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all") ;this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-ta bs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&& this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return fa lse}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie() ,10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").lengt h)c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.s elected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.select ed=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled =d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function (g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.dis abled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-h ide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(c.selected>=0& &this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].h ash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-sele cted ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null, a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selec ted].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.li s.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected =this.lis.index(this.lis.filter(".ui-tabs-selected"));this.element[c.collapsible ?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selec ted,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&& !d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled" );c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.ancho rs).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui -state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui -state-"+ g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind ("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs", function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",func tion(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m= c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClas s("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").anima te(o,o.duration||"normal",function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]) )})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active ");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?func tion(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs -selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue( "tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f .addClass("ui-tabs-hide");a.element.dequeue("tabs")};this.anchors.bind(c.event+" .tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-ta bs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabsselected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-stat e-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a. _ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(thi s);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=-1;c .cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i) }).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cook ie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anch ors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cooki e);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.q ueue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";d.browser.msie&&this.blur()});this.an chors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(type of b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tab s").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-colla psible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset u i-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){

var e=d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d. each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis. unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(t his).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-select ed ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null ,b.cookie);return this},add:function(b,e,a){if(a===p)a=this.anchors.length;var c =this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label \}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass ("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.fin d("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true)) ;j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if( a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}el se{e.insertBefore(this.lis[a]);j.insertBefore(this.panels[a])}h.disabled=d.map(h .disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length= =1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("u i-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui( c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this .anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b) ;var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(a. hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anch ors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),f unction(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-s tate-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._tri gger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disab le:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis .eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._ trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},se lect:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this. options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b) .trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIn dex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs") ;this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs "))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processin g");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner )}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.eleme nt.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,"cac he.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.aja xOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("l oad",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catc h(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element .queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.q ueue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._c leanup();return this},url:function(b,e){this.anchors.eq(b).removeData("cache.tab s").data("load.tabs",e);return this},length:function(){return this.anchors.lengt h}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotati on:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=f unction(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.sel ected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrot ate||(a._unrotate=!e?function(j){j.clientX&&a.rotate(null)}:function(){t=c.selec ted;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs ",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.an chors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);;(function(d,C){function M(){this.debug=false;this._curInst=n ull;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepicker Showing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepick er-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datep icker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-d

atepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._c urrentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-c ell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",n extText:"Next",currentText:"Today",monthNames:["January","February","March","Apr il","May","June","July","August","September","October","November","December"],mo nthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov" ,"Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","S aturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",first Day:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn :"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonT ext:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigation AsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRang e:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calcu lateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,durati on:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:nul l,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12 ,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:fal se,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<d iv id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content uihelper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout", function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-n ext, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-d atepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b =d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-date picker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent ()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").re moveClass("ui-state-hover");b.addClass("ui-state-hover");b.hasClass("ui-datepick er-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next ")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for( var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{ version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerCla ssName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("" ,arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:functio n(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c= null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{}; try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="sp an";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.set tings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f &&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace( /([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear :0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._ inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-co rner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]) ;b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c. addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPres s).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]= h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSi ze(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}} ,_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL ");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClas s+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showD atepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"|| c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b ,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonI mageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}): d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d ("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trig ger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a [0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return fal

se})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Da te(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f) {for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i };b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.set Date(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.i nput.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b) {var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassNam e).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).b ind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepic ker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b); this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv .css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogIn st;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this. uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'); this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a =this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(th is._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date? this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX ,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-1 00+(document.documentElement.scrollLeft||document.body.scrollLeft),document.docu mentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.bod y.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this. _pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this ._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(t his.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDate picker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.marker ClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="i nput"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName). unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("k eypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="s pan")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a) {var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("butto n").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0" ,cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b. children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(th is._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:functio n(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){va r e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("bu tton").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0. 5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inline Class);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-m onth, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInpu ts=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInp uts[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)ret urn false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[ b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepi cker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatep icker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b==" string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.ex tend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={}; f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepic ker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.se ttings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._ formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate= this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate( e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:func tion(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=thi s._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a

=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlte rnate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&thi s._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){ var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl"); b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.d atepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOve rClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._sele ctDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"on Select")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}e lse d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepi cker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._ get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.d atepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+ d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.d atepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey ||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ct rlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.c trlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"), "M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7, "D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._ adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKe y)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonth s"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKe y)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default :c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);els e c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a) {var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")) {b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.f romCharCode(a.charCode==C?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target) ;if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a," dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.dat epicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._upda teDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:funct ion(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNo de)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){ var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!= b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._c urInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"b eforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null ;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._in Dialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos (a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(functio n(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.date picker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=docume nt.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[ 1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",disp lay:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._ch eckOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static ":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.in line){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h= function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d .datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outer Width(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datep icker._datepickerShowing=true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicke r._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.inpu t.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curIns t=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBord ers(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.fin

d("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dp Div.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverCl ass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("u i-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1 &&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0 ]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get (a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curIn st&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.i s(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearsht ml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDi v.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml =null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thi ck:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css ("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth() ,f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.oute rHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=do cument.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a, "isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft() :0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Mat h.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top +f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(th is._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidd en(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.t op]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.inp ut?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){va r b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShow ing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.date picker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a ,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fa deIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this. _datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInp ut.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI(); d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.d pDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExt ernalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepi cker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d .datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepic ker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hide Datepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(! this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e," showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d( a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.sele ctedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.sel ectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMont h=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._n otifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Mo nth":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e );this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClas s(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f [0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b ;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentD ay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst( a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]) ;b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a );var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{t his._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a. input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._ge t(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),

e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(fun ction(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6," "]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.g etDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math .round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"In valid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="strin g"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:nu ll)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames ,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames: null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a .length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D=o(p);p=new RegExp( "^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).mat ch(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt( p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort( function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x) {w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.leng th;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;} ,s=function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position " +q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s( );else switch(a.charAt(A)){case"d":l=m("d");break;case"D":n("D",f,h);break;case" o":u=m("o");break;case"m":j=m("m");break;case"M":j=n("M",i,g);break;case"y":c=m( "y");break;case"@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v .getDate();break;case"!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullY ear();j=v.getMonth()+ 1;l=v.getDate();break;case"'":if(o("'"))s();else k=true;break;default:s()}if(q<b .length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1 )c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date) .getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l ));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date"; return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(7186 85+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate :function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.d ayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesSho rt:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults .monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o}, g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o ,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u )if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k )){case"d":l+=g("d",b.getDate(),2);break;case"D":l+=j("D",b.getDay(),e,f);break; case"o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate()) ).getTime()(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case"m":l+=g("m",b.ge tMonth()+1,2);break;case"M":l+=j("M",b.getMonth(),h,c);break;case"y":l+=i("y")?b .getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":l+=b.ge tTime();break;case"!":l+=b.getTime()*1E4+this._ticksTo1970;break;case"'":if(i("' "))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:func tion(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f ++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b +=a.charAt(f);else switch(a.charAt(f)){case"d":case"m":case"y":case"@":b+="01234 56789";break;case"D":case"M":return null;case"'":if(e("'"))b+="'";else c=true;br eak;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C ?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val ()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val() :null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this. parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.dr awMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a

.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.ge tFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this. _restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_ determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDa te()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._ get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLow erCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(), l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u .exec(h);k;){switch(k[2]||"d"){case"d":case"D":g+=parseInt(k[1],10);break;case"w ":case"W":g+=parseInt(k[1],10)*7;break;case"m":case"M":l+=parseInt(k[1],10);g=Ma th.min(g,d.datepicker._getDaysInMonth(j,l));break;case"y":case"Y":j+=parseInt(k[ 1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="nu mber"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){ b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._ daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.s etHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determin eDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.select edMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.ge tFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a) ;this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getD ate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._dayl ightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generate HTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullY ear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showB uttonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFo rmat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._ge t(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._ getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.dr awYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFu llYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightS avingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear =m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust (new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?' <a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker. _adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon uiicon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datep icker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon u i-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nex tText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,g+j,1)),t his._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepick er-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+ "', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-cornerall ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangl e-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a, "gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfi g(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-def ault ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hid eDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-da tepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-seconda ry ui-corner-all" onclick="DP_jQuery_'+ B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>": "";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek ");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"day NamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._ get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOth

erMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x =0;x<i[0];x++){var O="";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._dayli ghtSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='< div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-gr oup-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepick er-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepick er-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widg et-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&x==0?c?f:n:"")+(/all|r ight/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A ,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class ="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++ ){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'>< span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._ getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math. min(a.selectedDay,z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7 );this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust( new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-dat epicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||! I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"" )+(F?" ui-datepicker-other-month":"")+(r.getTime()==P.getTime()&&g==a.selectedMo nth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._d ayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?" ":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b. getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"") +(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth ()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span cl ass="ui-state-default">'+ r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" u i-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" uipriority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.ge tDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+= "</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row -break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.versi on,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return w},_generateMonthYearHe ader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"c hangeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-tit le">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{ i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepi cker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', t his, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMont h()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</opt ion>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.years html="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this. _get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q. match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10 ):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Ma th.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+=' <select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectM onthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b +'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>" ;k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&& l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a. drawYear+(c=="Y"?b:0),f=a.drawMonth+ (c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e= this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDa y=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear =e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:functi on(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b

<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChang eMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMont h+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a ==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return thi s._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){re turn 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMo nth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b ,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,e +(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.get Month()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getM inMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getT ime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this. _get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+pa rseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort") ,dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort") ,monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.c urrentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedY ear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._d aylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.da tepicker=function(a){if(!this.length)return this;if(!d.datepicker.initialized){d (document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.dat epicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(ar guments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))r eturn d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));i f(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datep icker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.ea ch(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepi cker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=ne w M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.date picker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery);;(function(b,d){b.wid get("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.el ement.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr( {role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"a ria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=t his._value();this._refreshValue()},destroy:function(){this.element.removeClass(" ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").re moveAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow" );this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value :function(a){if(a===d)return this._value();this._setOption("value",a);return thi s},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshVa lue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.proto type._setOption.apply(this,arguments)},_value:function(){var a=this.options.valu e;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min, a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshV alue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){th is.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleCla ss("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element. attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuer y);;jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array &&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9 ]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],1 0)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([ 0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2] )*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9 ]{2})/.exec(c))return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)];if( a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],1 6),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c ))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;d

o{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="back groundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defau ltView?document.defaultView.getComputedStyle(this,null):this.currentStyle,a={},b ,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]= ="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b ]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){va r a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a )||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){ var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if (typeof c=="object"){d=a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a= {}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b =null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds ?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l( c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string" &&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor", "borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borde rColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.col orInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb ("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0) +","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255), 0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255 ),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],blac k:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],d arkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,18 3,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0] ,darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[ 148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130 ],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen :[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255, 255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],oliv e:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[1 28,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255 ,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBot tom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin: 1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b= null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.cal l(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r =p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easi ng:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(ty peof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssTe xt=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};f.f n.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects. animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.re moveClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(th is,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggl eClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animate Class.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects. animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){ret urn f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.ef fects,{version:"1.8.16",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==nul l&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b= 0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:fu nction(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline :function(c,a){var b;switch(c[0]){case"top":b=0;break;case"middle":b=0.5;break;c ase"bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case"left":c=0;break; case"center":c=0.5;break;case"right":c=1;break;default:c=c[1]/a.width}return{x:c ,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c. css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"1 00%",background:"transparent",border:"none",margin:0,padding:0}),d=document.acti

veElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if (c.css("position")=="static"){b.css({position:"relative"});c.css({position:"rela tive"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f. each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseI nt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto", bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=docume nt.activeElement;if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWi th(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransit ion:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0 ]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k .apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options. mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback): this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)}, _show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments) ;else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(th is,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,ar guments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect. apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boo lean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.a pply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUn it:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){ if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swi ng;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easin g[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b}, easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function( c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubi c:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){re turn d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)ret urn d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){ret urn d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a -1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;ret urn-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a* a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeIn OutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a -=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI /2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b}, easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeIn Expo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:f unction(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:f unction(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2* Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:functio n(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d, e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/ =e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b },easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a /=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI) *Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b },easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if(( a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI )*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},e aseInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a /=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Ma th.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c) *2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0. 5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+ 1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if( (a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.52 5)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounc e(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625

*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/ 2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:funct ion(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f .easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);;(function(b){b.eff ects.blind=function(c){return this.queue(function(){var a=b(this),g=["position", "top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c .options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.crea teWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="ver tical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e. animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.r estore(a,g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],argumen ts);a.dequeue()})})}})(jQuery);;(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right" ],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c= b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h )&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options. distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/3 );if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="h ide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate( g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?" -=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animat e(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=( d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.eff ects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,a rguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=") +c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e .effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(th is,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);; (function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(thi s),i=["position","top","bottom","left","right","height","width"],f=b.effects.set Mode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save( a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].t agName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertic al"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.siz e,0);d.css(g.position,c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="sh ow"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,c omplete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWr apper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery );;(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c( this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode (a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.s how();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up" ||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margi n:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f, b=="pos"?-g:g);var i={opacity:e=="show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=": b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.opti ons.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effe cts.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}}) })}})(jQuery);;(function(j){j.effects.explode=function(a){return this.queue(func tion(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.opti ons.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mo de=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).s how().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop") ,10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true) ,i=b.outerHeight(true),e=0;e<c;e++)for(var f=0;f<d;f++)b.clone().appendTo("body" ).wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d ),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute ",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="s how"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-M

ath.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.le ft+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.m ode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b .css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a. callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duratio n||500)})}})(jQuery);;(function(b){b.effects.fade=function(a){return this.queue( function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate ({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:f unction(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuer y);;(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c (this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.opti ons.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.d uration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.cr eateWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:[" height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9] +)%/.exec(g);if(i)g=parseInt(i[1],10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h? {height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1] ]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing, function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b) ;a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);;(funct ion(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this ),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.opti ons.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.op acity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor :c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing: c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e); d=="show"&&!b.support.opacity&&this.style.removeAttribute("filter");c.callback&& c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);;(function(d){d.eff ects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects. setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.dura tion?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0; if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c= ="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},d uration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo },duration,a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.call back.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}} )(jQuery);;(function(c){c.effects.puff=function(b){return this.queue(function(){ var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options .percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.optio ns,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h ,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue( )})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c. extend(true,{},b.options),g=c.effects.setMode(a,b.options.mode||"effect"),h=pars eInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100 ),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||[ "middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b .options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i !="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options. fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity =1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration ,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(functio n(){var a=c(this),e=["position","top","bottom","left","right","width","height"," overflow","opacity"],g=["position","top","bottom","left","right","overflow","opa city"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borde rBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWid th","paddingLeft","paddingRight"],p=c.effects.setMode(a,b.options.mode||"effect" ),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={hei ght:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if (l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.

left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j .width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.wi dth},to:{y:a.to.height/j.height,x:a.to.width/j.width}};if(m=="box"||m=="both"){i f(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a. from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.con cat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTra nsition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.co ncat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTr ansition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapp er(a);a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.con cat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRigh t"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n& &c.effects.save(child,h);var o={height:child.height(),width:child.width()};child .from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.heigh t*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTran sition(child,f,d.from.y,child.from);child.to=c.effects.setTransition(child,f,d.t o.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d. from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}chi ld.css(child.from);child.animate(child.to,b.duration,b.options.easing,function() {n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.durati on,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity" ,a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,n?e:g);c.effects.remove Wrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQue ry);;(function(d){d.effects.shake=function(a){return this.queue(function(){var b =d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.opti ons.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l =a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b. show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up "||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h= ="pos"?"+=":"-=")+e*2;k[g]=(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easi ng);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing );b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.ef fects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this, arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);;(fu nction(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this) ,h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mo de||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects .createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left" ;b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHei ght({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?is NaN(e)?"-"+e:-e:e);var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+= ")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,comple te:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper (a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);;(f unction(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(t his),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeigh t(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer" ></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,l eft:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).ani mate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback. apply(b[0],arguments);b.dequeue()})})}})(jQuery);;

jQuery.fn.ajaxSubmit=function(options){if(typeof options=='function') options={success:options};options=jQuery.extend({url:this.attr('action')||'',met

hod:this.attr('method')||'GET'},options||{});options.success=options.success||op tions.after;options.beforeSubmit=options.beforeSubmit||options.before;options.ty pe=options.type||options.method;var a=this.formToArray(options.semantic);if(opti ons.beforeSubmit&&options.beforeSubmit(a,this,options)===false)return;var q=jQue ry.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.inde xOf('?')>=0?'&':'?')+q;options.data=null;} else options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(f unction(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$f orm.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options. success||function(){};callbacks.push(function(data,status){jQuery(options.target ).html(data).evalScripts().each(oldSuccess,[data,status]);});} else if(options.success) callbacks.push(options.success);options.success=function(data,status){for(var i= 0,max=callbacks.length;i<max;i++) callbacks[i](data,status);};jQuery.ajax(options);return this;};jQuery.fn.ajaxFor m=function(options){return this.each(function(){jQuery("input:submit,input:image ,button:submit",this).click(function(ev){var $form=this.form;$form.clk=this;if(t his.type=='image'){if(ev.offsetX!=undefined){$form.clk_x=ev.offsetX;$form.clk_y= ev.offsetY;}else if(typeof jQuery.fn.offset=='function'){var offset=jQuery(this) .offset();$form.clk_x=ev.pageX-offset.left;$form.clk_y=ev.pageY-offset.top;}else {$form.clk_x=ev.pageX-this.offsetLeft;$form.clk_y=ev.pageY-this.offsetTop;}} setTimeout(function(){$form.clk=$form.clk_x=$form.clk_y=null;},10);})}).submit(f unction(e){jQuery(this).ajaxSubmit(options);return false;});};jQuery.fn.formToAr ray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(v ar i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(s emantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el) a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});continue;} var v=jQuery.fieldValue(el,true);if(v===null)continue;if(v.constructor==Array){f or(var j=0,jmax=v.length;j<jmax;j++) a.push({name:n,value:v[j]});} else a.push({name:n,value:v});} if(!semantic&&form.clk){var inputs=form.getElementsByTagName("input");for(var i= 0,max=inputs.length;i<max;i++){var input=inputs[i];var n=input.name;if(n&&!input .disabled&&input.type=="image"&&form.clk==input) a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}} return a;};jQuery.fn.formSerialize=function(semantic){return jQuery.param(this.f ormToArray(semantic));};jQuery.fn.fieldSerialize=function(successful){var a=[];t his.each(function(){var n=this.name;if(!n)return;var v=jQuery.fieldValue(this,su ccessful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++) a.push({name:n,value:v[i]});} else if(v!==null&&typeof v!='undefined') a.push({name:this.name,value:v});});return jQuery.param(a);};jQuery.fn.fieldValu e=function(successful){var cbVal,cbName;for(var i=0,max=this.length;i<max;i++){v ar el=this[i];var v=jQuery.fieldValue(el,successful);if(v===null||typeof v=='und efined'||(v.constructor==Array&&!v.length)) continue;if(el.type!='checkbox')return v;cbName=cbName||el.name;if(cbName!=el.na me) return cbVal;cbVal=cbVal||[];cbVal.push(v);} return cbVal;};jQuery.fieldValue=function(el,successful){var n=el.name,t=el.type ,tag=el.tagName.toLowerCase();if(typeof successful=='undefined')successful=true; if(successful&&(!n||el.disabled||t=='reset'||(t=='checkbox'||t=='radio')&&!el.ch ecked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.se lectedIndex==-1)) return null;if(tag=='select'){var index=el.selectedIndex;if(index<0)return null; var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.lengt h);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=jQuery .browser.msie&&!(op.attributes['value'].specified)?op.text:op.value;if(one)retur

n v;a.push(v);}} return a;} return el.value;};jQuery.fn.clearForm=function(){return this.each(function(){jQu ery('input,select,textarea',this).clearFields();});};jQuery.fn.clearFields=jQuer y.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this .tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea') this.value='';else if(t=='checkbox'||t=='radio') this.checked=false;else if(tag=='select') this.selectedIndex=-1;});};jQuery.fn.resetForm=function(){return this.each(funct ion(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.rese t.nodeType)) this.reset();});};

(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({. *})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this .defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defa ults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data (elem,settings.single);if(data)return data;data="{}";var getData=function(data){ if(typeof data!="string")return data;if(data.indexOf('{')<0){data=eval("("+data+ ")");}} var getObject=function(data){if(typeof data!="string")return data;data=eval("("+ data+")");return data;} if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/))name=name.replace(/^data-/,'');else r eturn true;object[name]=getObject(this.nodeValue);});}else{if(settings.type=="cl ass"){var m=settings.cre.exec(elem.className);if(m) data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;v ar e=elem.getElementsByTagName(settings.name);if(e.length) data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem .getAttribute(settings.name);if(attr) data=attr;} object=getObject(data.indexOf("{")<0?"{"+data+"}":data);} $.data(elem,settings.single,object);return object;}}});$.fn.metadata=function(op ts){return $.metadata.get(this[0],opts);};})(jQuery);

(function($){$.extend($.fn,{validate:function(options){if(options.rules){for(ind ex in options.rules){htmlId=cakeDataToHtmlId(index);if(options.rules[index].requ ired){$label=$("label[for="+htmlId+"]");if($label.length&&$label.html().indexOf( "*")<0){$label.html($label.html()+"*");}} if(options.rules[index].maxlength){$("#"+htmlId).attr({maxlength:options.rules[i ndex].maxlength});} if(options.rules[index].rangelength){$("#"+htmlId).attr({maxlength:options.rules [index].rangelength[1]});}}} if(!this.length){options&&options.debug&&window.console&&console.warn("nothing s elected, can't validate, returning nothing");return;} var validator=$.data(this[0],'validator');if(validator){return validator;} validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator) ;if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").cl

ick(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandle r){this.find("input, button").filter(":submit").click(function(){validator.submi tButton=this;});} this.submit(function(event){if(validator.settings.debug) event.preventDefault();function handle(){if(validator.settings.submitHandler){if (validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",vali dator.submitButton.name).val(validator.submitButton.value).appendTo(validator.cu rrentForm);} validator.settings.submitHandler.call(validator,validator.currentForm);if(valida tor.submitButton){hidden.remove();} return false;} return true;} if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();} if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;r eturn false;} return handle();}else{validator.focusInvalid();return false;}});} return validator;},valid:function(){if($(this[0]).is('form')){return this.valida te().form();}else{var valid=true;var validator=$(this[0].form).validate();this.e ach(function(){valid&=validator.element(this);});return valid;}},removeAttrs:fun ction(attributes){var result={},$element=this;$.each(attributes.split(/\s/),func tion(index,value){result[value]=$element.attr(value);$element.removeAttr(value); });return result;},rules:function(command,argument){var element=this[0];if(comma nd){var settings=$.data(element.form,'validator').settings;var staticRules=setti ngs.rules;var existingRules=$.validator.staticRules(element);switch(command){cas e"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[e lement.name]=existingRules;if(argument.messages) settings.messages[element.name]=$.extend(settings.messages[element.name],argumen t.messages);break;case"remove":if(!argument){delete staticRules[element.name];re turn existingRules;} var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[meth od]=existingRules[method];delete existingRules[method];});return filtered;}} var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(elemen t),$.validator.classRules(element),$.validator.attributeRules(element),$.validat or.staticRules(element)),element);if(data.required){var param=data.required;dele te data.required;data=$.extend({required:param},data);} return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(a.value);} ,filled:function(a){return!!$.trim(a.value);},unchecked:function(a){return!a.che cked;}});$.validator=function(options,form){this.settings=$.extend({},$.validato r.defaults,options);this.currentForm=form;this.init();};$.validator.format=funct ion(source,params){if(arguments.length==1) return function(){var args=$.makeArray(arguments);args.unshift(source);return $. validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=A rray){params=$.makeArray(arguments).slice(1);} if(params.constructor!=Array){params=[params];} $.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"), n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rule s:{},errorClass:"form-error",validClass:"valid",errorElement:"label",focusInvali d:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ig noreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.sett ings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.sett ings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validC lass);this.errorsFor(element).hide();}},onfocusout:function(element){if(autocomp leteInProgress()){return;} if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(ele ment))){this.element(element);}},onkeyup:function(element){if(element.name in th is.submitted||element==this.lastElement){this.element(element);}},onclick:functi on(element){if(element.name in this.submitted) this.element(element);},highlight:function(element,errorClass,validClass){$(elem ent).addClass(errorClass).removeClass(validClass);},unhighlight:function(element ,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);

}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},mess ages:{required:"Please enter a value.",remote:"Please fix this field.",email:"Pl ease enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte ge ben Sie ein gltiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bi tte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Pl ease enter a valid credit card number.",equalTo:"Please enter the same value aga in.",accept:"Please enter a value with a valid extension.",maxlength:$.validator .format("Please enter a value no longer then {0} characters."),minlength:$.valid ator.format("Please enter a value of at least {0} characters."),rangelength:$.va lidator.format("Please enter a value between {0} and {1} characters long."),rang e:$.validator.format("Please enter a value between {0} and {1}."),max:$.validato r.format("Please enter a value less than or equal to {0}."),min:$.validator.form at("Please enter a value greater than or equal to {0}."),rangeValue:$.validator. format("Please enter a value between {0} and {1}."),maxValue:$.validator.format( "Please enter a value less than or equal to {0}."),minValue:$.validator.format(" Please enter a value greater than or equal to {0}."),integer:"Please enter a val id number",positiveInteger:"Please enter a valid positive number",negativeIntege r:"Please enter a valid negitive number",alphaStrict:"Please enter only letters. ",alphaNumericStrict:"Please enter only letters and numbers.",alphaNumericLoose: "Please enter only letters, numbers and punctuation.",zipcode:"Please enter a va lid zipcode.",usState:"Please enter a valid US State abbreviation ( NY, NJ, CT, etc ).",regMatch:$.validator.format("Invalid input. Please enter {1}"),regNoMatc h:$.validator.format("Invalid input. Please enter {1}"),usCurrency:"Please enter a valid currency amount",confirm:"Please re-enter. This field does not match yo ur other entry",noMatch:"Please re-enter. This field can not match your other en try",usDate:"Please enter a valid date in the format mm/dd/yyyy",noWhiteSpace:"P lease remove the spaces from this field",userUnique:"Please choose a value that is not already in use.",phone:"Please enter a valid phone number.<br> ###-###-## ## x123",usDateAfter:$.validator.format("Please enter a date after {0}"),usDateB efore:$.validator.format("Please enter a date before {0}"),time:"Please enter ti me in the format HH:MM PM or HH:MM AM"},autoCreateRanges:false,prototype:{init:f unction(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorCon text=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.c ontainers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer) ;this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this .invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups ,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]= key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[k ey]=$.validator.normalizeRule(value);});function delegate(event){var validator=$ .data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.s ettings["on"+event.type].call(validator,this[0]);} $(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(th is.settings.invalidHandler) $(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);} ,form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.in valid=$.extend({},this.errorMap);if(!this.valid()) $(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();retu rn this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=( this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);} return this.valid();},element:function(element){element=this.clean(element);this .lastElement=element;this.prepareElement(element);this.currentElements=$(element );var result=this.check(element);if(result){delete this.invalid[element.name];}e lse{this.invalid[element.name]=true;} if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);} this.showErrors();return result;},showErrors:function(errors){if(errors){$.exten d(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList .push({message:errors[name],element:this.findByName(name)[0]});} this.successList=$.grep(this.successList,function(element){return!(element.name

in errors);});} this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.e rrorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm) $(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideEr rors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids: function(){return this.objectLength(this.invalid);},objectLength:function(obj){v ar count=0;for(var i in obj) count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide() ;},valid:function(){return this.size()==0;},size:function(){return this.errorLis t.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.fin dLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":vi sible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.last Active;return lastActive&&$.grep(this.errorList,function(n){return n.element.nam e==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator= this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input"). not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(func tion(){!this.name&&validator.settings.debug&&window.console&&console.error("%o h as no name assigned",this);if(this.name in rulesCache||!validator.objectLength($ (this).rules())) return false;rulesCache[this.name]=true;return true;});},clean:function(selector ){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+ "."+this.settings.errorClass,this.errorContext);},reset:function(){this.successL ist=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);th is.formSubmitted=false;this.currentElements=$([]);},prepareForm:function(){this. reset();this.toHide=this.errors().add(this.containers);},prepareElement:function (element){this.reset();this.toHide=this.errorsFor(element);},check:function(elem ent){element=this.clean(element);if(this.checkable(element)){element=this.findBy Name(element.name)[0];} var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){v ar rule={method:method,parameters:rules[method]};try{var result=$.validator.meth ods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);i f(result=="dependency-mismatch"){dependencyMismatch=true;continue;} dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this. errorsFor(element));return;} if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.setting s.debug&&window.console&&console.log("exception occured when checking element "+ element.id +", check the '"+rule.method+"' method");throw e;}} if(dependencyMismatch) return;if(this.objectLength(rules)) this.successList.push(element);return true;},customMetaMessage:function(element, method){if(!$.metadata) return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(e lement).metadata();return meta&&meta.messages&&meta.messages[method];},customMes sage:function(name,method){var m=this.settings.messages[name];return m&&(m.const ructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.len gth;i++){if(arguments[i]!==undefined) return arguments[i];} return undefined;},defaultMessage:function(element,method){return this.findDefin ed(this.customMessage(element.name,method),this.customMetaMessage(element,method ),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[meth od],"<strong>Warning: No message defined for "+element.name+"</strong>");},forma tAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.meth od);if(typeof message=="function") message=message.call(this,rule.parameters,element);this.errorList.push({message: message,element:element});this.errorMap[element.name]=message;this.submitted[ele ment.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper) toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;}, defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.e rrorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.ele

ment,this.settings.errorClass,this.settings.validClass);this.showLabel(error.ele ment,error.message);} if(this.errorList.length){this.toShow=this.toShow.add(this.containers);} if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(th is.successList[i]);}} if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements [i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClas s,this.settings.validClass);}} this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this. toShow).show();},validElements:function(){return this.currentElements.not(this.i nvalidElements());},invalidElements:function(){return $(this.errorList).map(func tion(){return this.element;});},showLabel:function(element,message){var label=th is.errorsFor(element);if(label.length){label.removeClass().addClass(this.setting s.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+thi s.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true} ).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper) {label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();} if(!this.labelContainer.append(label).length) this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):labe l.insertAfter(element);} if(!message&&this.settings.success){label.text("");typeof this.settings.success= ="string"?label.addClass(this.settings.success):this.settings.success(label);} this.toShow=this.toShow.add(label);},errorsFor:function(element){return this.err ors().filter("[for='"+this.idOrName(element)+"']");},idOrName:function(element){ return this.groups[element.name]||(this.checkable(element)?element.name:element. id||element.name);},checkable:function(element){return/radio|checkbox/i.test(ele ment.type);},findByName:function(name){var form=this.currentForm;return $(docume nt.getElementsByName(name)).map(function(index,element){return element.form==for m&&element.name==name&&element||null;});},getLength:function(value,element){swit ch(element.nodeName.toLowerCase()){case'select':return $("option:selected",eleme nt).length;case'input':if(this.checkable(element)) return this.findByName(element.name).filter(':checked').length;} return value.length;},depend:function(param,element){return this.dependTypes[typ eof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"bo olean":function(param,element){return param;},"string":function(param,element){r eturn!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required .call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest: function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pen ding[element.name]=true;}},stopRequest:function(element,valid){this.pendingReque st--;if(this.pendingRequest<0) this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRe quest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();}else if (!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).trigger Handler("invalid-form",[this]);}},previousValue:function(element){return $.data( element,"previousValue")||$.data(element,"previousValue",previous={old:null,vali d:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{req uired:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO :{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:tru e},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(cla ssName,rules){className.constructor==String?this.classRuleSettings[className]=ru les:$.extend(this.classRuleSettings,className);},classRules:function(element){va r rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validat or.classRuleSettings[this]);}});return rules;},attributeRules:function(element){ var rules={};var $element=$(element);for(method in $.validator.methods){var valu e=$element.attr(method);if(value){rules[method]=value;}} if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.m axlength;} return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=

$.data(element.form,'validator').settings.meta;return meta?$(element).metadata() [meta]:$(element).metadata();},staticRules:function(element){var rules={};var va lidator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.va lidator.normalizeRule(validator.settings.rules[element.name])||{};} return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop ,val){if(val===false){delete rules[prop];return;} if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"str ing":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule =val.depends.call(element,element);break;} if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules [prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(param eter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max '],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['range length','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]), Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules .max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;} if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.ma xlength];delete rules.minlength;delete rules.maxlength;}} if(rules.messages){delete rules.messages} return rules;},normalizeRule:function(data){if(typeof data=="string"){var transf ormed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=trans formed;} return data;},addMethod:function(name,method,message){$.validator.methods[name]= method;$.validator.messages[name]=message||$.validator.messages[name];if(method. length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},met hods:{required:function(value,element,param){if(!this.depend(param,element)) return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select': var options=$("option:selected",element);return options.length>0&&(element.type= ="select-multiple"||($.browser.msie&&!(options[0].attributes['value'].specified) ?options[0].text:options[0].value).length>0);case'input':if(this.checkable(eleme nt)) return this.getLength(value,element)>0;default:return $.trim(value).length>0;}}, remote:function(value,element,param){if(this.optional(element)) return"dependency-mismatch";var previous=this.previousValue(element);if(!this.se ttings.messages[element.name]) this.settings.messages[element.name]={};this.settings.messages[element.name].rem ote=typeof previous.message=="function"?previous.message(value):previous.message ;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previ ous.old=value;var validator=this;this.startRequest(element);var data={};data[ele ment.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+el ement.name,dataType:"json",data:data,success:function(response){var valid=respon se===true;if(valid){var submitted=validator.formSubmitted;validator.prepareEleme nt(element);validator.formSubmitted=submitted;validator.successList.push(element );validator.showErrors();}else{var errors={};errors[element.name]=previous.messa ge=response||validator.defaultMessage(element,"remote");validator.showErrors(err ors);} previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pend ing";}else if(this.pending[element.name]){return"pending";} return previous.valid;},minlength:function(value,element,param){return this.opti onal(element)||this.getLength($.trim(value),element)>=param;},maxlength:function (value,element,param){return this.optional(element)||this.getLength($.trim(value ),element)<=param;},rangelength:function(value,element,param){var length=this.ge tLength($.trim(value),element);return this.optional(element)||(length>=param[0]& &length<=param[1]);},min:function(value,element,param){return this.optional(elem ent)||value>=param;},max:function(value,element,param){return this.optional(elem ent)||value<=param;},range:function(value,element,param){return this.optional(el ement)||(value>=param[0]&&value<=param[1]);},email:function(value,element){retur n this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\u D7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u0 0A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x

20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00 A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\ uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x 22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF \uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z ]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF \uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a -z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:functio n(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d| -|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+ ,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[ 0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])) |((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7F F\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF 0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u 00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF 0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[ \u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[ \u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+ (\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})| [!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDC F\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)? (\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2}) |[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element) {return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:f unction(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d {1,2}$/.test(value);},dateDE:function(value,element){return this.optional(elemen t)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){re turn this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(val ue);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+ |\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){re turn this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,ele ment){if(this.optional(element)) return"dependency-mismatch";if(/[^0-9-]+/.test(value)) return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for (n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigi t,10);if(bEven){if((nDigit*=2)>9) nDigit-=9;} nCheck+=nDigit;bEven=!bEven;} return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param== "string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)|| value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,pa ram){return value==$(param).val();}}});$.format=$.validator.format;})(jQuery);;( function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){set tings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings. port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port]. abort();} return(pendingRequests[port]=ajax.apply(this,arguments));} return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focu sin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:functio n(){if($.browser.msie)return false;this.addEventListener(original,$.event.specia l[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.r emoveEventListener(original,$.event.special[fix].handler,true);},handler:functio n(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.app ly(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler) {return this.bind(type,function(event){var target=$(event.target);if(target.is(d elegate)){return handler.apply(target,arguments);}});},triggerEvent:function(typ e,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target} )]);}})})(jQuery);jQuery.validator.addMethod("alphaStrict",function(value,elemen

t,param){if(value.length==0)return true;return!/[^A-Za-z\s]/i.test(value);},""); jQuery.validator.addMethod("alphaNumericStrict",function(value,element,param){if (value.length==0)return true;return!/[^A-Za-z0-9\s]/i.test(value);},"");jQuery.v alidator.addMethod("zipcode",function(value,element,param){if(value.length==0)re turn true;return/^\d{5}([\-]\d{4})?$/.test(value);},"");jQuery.validator.addMeth od("usState",function(value,element,param){if(value.length==0)return true;return /^(AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS |MT|NB|NC|ND|NH|NJ|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VA|VT|WA|WI|WV|WY)$/i. test(value);},"");jQuery.validator.addMethod("regMatch",function(value,element,p aram){if(value.length==0)return true;re=new RegExp(param[0],param[1]);return re. test(value);},"");jQuery.validator.addMethod("regNoMatch",function(value,element ,param){if(value.length==0)return true;re=new RegExp(param[0],param[1]);return!r e.test(value);},"");jQuery.validator.addMethod("integer",function(value,element, param){return value.length==0||/^\s*-?\s*((\d+)|(\d{1,3}(\,\d{3})+))\s*$/.test(v alue)},"");jQuery.validator.addMethod("positiveInteger",function(value,element,p aram){return value.length==0||/^\s*((\d+)|(\d{1,3}(\,\d{3})+))\s*$/.test(value)} ,"");jQuery.validator.addMethod("negativeInteger",function(value,element,param){ return value.length==0||/^\s*-((\d+)|(\d{1,3}(\,\d{3})+))\s*$/.test(value)},""); jQuery.validator.addMethod("phone",function(value,element,param){return value.le ngth==0||/^(\d{3}-\d{3}-\d{4})(\s(x\d+)?){0,1}$/.test(value)},"");jQuery.validat or.addMethod("usCurrency",function(value,element,param){if(value.length==0)retur n true;return/^\s*[$]?\s*((\d+)|(\d{1,3}(\,\d{3})+))(\.\d{2})?\s*$/i.test(value) },"");jQuery.validator.addMethod("confirm",function(value,element,param){confirm Field=document.getElementById(param);if(!confirmField) return false return confirmField.value==value;},"");jQuery.validator.addMethod("noMatch",func tion(value,element,param){confirmField=document.getElementById(param);if(!confir mField) return false if(confirmField.value.length+value.length==0) return true return confirmField.value!=value;},"");jQuery.validator.addMethod("usDate",funct ion(value,element,param){if(value.length==0)return true;return isDate(value,1900 ,2100);},"");jQuery.validator.addMethod("usDateBefore",function(value,element,pa ram){if(value.length==0)return true;if(!isDate(value,1,9999))return false;return daysBetween(value,param)<0;},"");jQuery.validator.addMethod("usDateAfter",funct ion(value,element,param){if(value.length==0)return true;if(!isDate(value,1,9999) )return false;return daysBetween(value,param)>0;},"");jQuery.validator.addMethod ("noWhiteSpace",function(value,element,param){return value.length==0||!/\s/.test (value);},"");jQuery.validator.addMethod("unique",function(value,element,param){ return true;},"");jQuery.validator.addMethod("userUnique",function(value,element ,param){return true;},"");jQuery.validator.addMethod("alphaNumericLoose",functio n(value,element,param){if(value.length==0)return true;return!/[^A-Za-z0-9\s,;:'\ ".!?_-]/i.test(value);},"");jQuery.validator.addMethod("minValue",function(value ,element,param){if(value.length==0)return true;return value>=param;},"");jQuery. validator.addMethod("maxValue",function(value,element,param){if(value.length==0) return true;return value<=param;},"");jQuery.validator.addMethod("rangeValue",fu nction(value,element,param){value=value.replace(/[^\d.]/g,"");if(value.length==0 )return true;return(value>=param[0]&&value<=param[1]);},"");jQuery.validator.add Method("rangeLength",function(value,element,param){if(value.length==0)return tru e;return(length>=param[0]&&length<=param[1]);},"");jQuery.validator.addMethod("r angeLength",function(value,element,param){if(value.length==0)return true;return( length>=param[0]&&length<=param[1]);},"");jQuery.validator.addMethod("time",func tion(value,element,param){if(value.length==0)return true;if(value.indexOf(":")<0 ){return/(1|2|3|4|5|6|7|8|9|10|11|12)\s?(am|pm)/i.test(value);} else{t=value.split(":");if(!(t[0]<=12&&t[0]>0))return false;return/([0-5][0-9])\ s?[aApP][mM]/i.test(t[1]);};},"");function isInteger(s){var i;for(i=0;i<s.length ;i++){var c=s.charAt(i);if(((c<"0")||(c>"9")))return false;} return true;} function stripCharsInBag(s,bag){var i;var returnString="";for(i=0;i<s.length;i++

){var c=s.charAt(i);if(bag.indexOf(c)==-1)returnString+=c;} return returnString;} function daysInFebruary(year){return(((year%4==0)&&((!(year%100==0))||(year%400= =0)))?29:28);} function DaysArray(n){for(var i=1;i<=n;i++){this[i]=31 if(i==4||i==6||i==9||i==11){this[i]=30} if(i==2){this[i]=29}} return this} function isDate(dtStr,minYear,maxYear){dtCh="/";var daysInMonth=DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strMonth=dtStr.substring(0,pos1) var strDay=dtStr.substring(pos1+1,pos2) var strYear=dtStr.substring(pos2+1) strYr=strYear if(strDay.charAt(0)=="0"&&strDay.length>1)strDay=strDay.substring(1) if(strMonth.charAt(0)=="0"&&strMonth.length>1)strMonth=strMonth.substring(1) for(var i=1;i<=3;i++){if(strYr.charAt(0)=="0"&&strYr.length>1)strYr=strYr.substr ing(1)} month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if(pos1==-1||pos2==-1) return false if(strMonth.length<1||month<1||month>12) return false if(strDay.length<1||day<1||day>31||(month==2&&day>daysInFebruary(year))||day>day sInMonth[month]) return false if(strYear.length!=4||year==0||year<minYear||year>maxYear) return false if(dtStr.indexOf(dtCh,pos2+1)!=-1||isInteger(stripCharsInBag(dtStr,dtCh))==false ) return false return true} function daysBetween(date1,date2) {if(!isDate(date1)||!isDate(date2)) return null;var sDate=new Date(date1);var eDate=new Date(date2);return Math.roun d((sDate-eDate)/86400000);}

(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this .defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sor tInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,t extExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},he aders:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFor mat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date(). getTime()-d.getTime())+"ms");} this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}} function buildParserCache(table,$headers){if(table.config.debug){var parsersDebu g="";} var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=ro ws[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;try{if($.metadata&&( $($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($(

$headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config. headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);} if(!p){p=detectParserForColumn(table,cells[i]);}}catch(e){p=getParserById("text" );} if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";} list.push(p);}} if(table.config.debug){log(parsersDebug);} return list;};function detectParserForColumn(table,node){var l=parsers.length;fo r(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),ta ble,node)){return parsers[i];}} return parsers[0];} function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parser s[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}} return false;} function buildCache(table){if(table.config.debug){var cacheTime=new Date();} var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(ta ble.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table. config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=t able.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++ j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.c ells[j]));} cols.push(i);cache.normalized.push(cols);cols=null;};if(table.config.debug){benc hmark("Building cache for "+totalRows+" rows:",cacheTime);} return cache;};function getElementText(config,node){if(!node)return"";var t="";i f(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].has ChildNodes()){t=node.childNodes[0].innerHTML;}else{t=node.innerHTML;}}else{if(ty peof(config.textExtraction)=="function"){t=config.textExtraction(node);}else{t=$ (node).text();}} return t;} function appendToTable(table,cache){if(table.config.debug){var appendTime=new Da te()} var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1), tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n [i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.len gth;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j]);}}} if(table.config.appender){table.config.appender(table,rows);} rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);} applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};func tion buildHeaders(table){if(table.config.debug){var time=new Date();} var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.r ows.length;i++){tableHeadersRows[i]=0;};$tableHeaders=$("thead th",table);$table Headers.each(function(index){this.count=0;this.column=index;this.order=formatSor tingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHead erOptions(table,index))this.sortDisabled=true;if(!this.sortDisabled){$(this).add Class(table.config.cssHeader);} table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built h eaders:",time);log($tableHeaders);} return $tableHeaders;};function checkCellColSpan(table,rows,row){var arr=[],r=ta ble.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell. colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(tabl e.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}} return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metada ta().sorter===false)){return true;};return false;} function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config .headers[i].sorter===false)){return true;};return false;} function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i= 0;i<l;i++){getWidgetById(c[i]).format(table);}} function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widget s[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function format SortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0;}else{i=

(v==(0||1))?v:0;} return i;} function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){ return true;}} return false;} function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).rem oveClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){ h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]]. addClass(css[list[i][1]]);}} function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgr oup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup );};} function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.len gth;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.c ount++;}} function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();} var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0 ;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType (table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order ==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+" (a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="e lse { ";} var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol +"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";} dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sor t(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString( )+" and dir "+order+" time:",sortTime);} return cache;};function sortText(a,b){return((a<b)?-1:((a>b)?1:0));};function so rtTextDesc(a,b){return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(pars ers,i){return parsers[i].type;};this.construct=function(settings){var pos=0 var noSortCount=0;var cssHeaderSettings={};var sortOn=false;$("thead:eq(0) th",t his).each(function(){if($(this).is(".noSort")){cssHeaderSettings[pos]={sorter:fa lse} noSortCount++;} if($(this).is(".sortOn")){sortOn=pos;} pos++;});if(!settings.headers&&noSortCount){settings.headers=cssHeaderSettings;} if(!settings.sortList&&sortOn){settings.sortList=[[sortOn,0]]} return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$docu ment,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend( this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders (this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this );var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click (function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$thi s[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$( this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey] ){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j =0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}} config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)) {for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.hea derList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.s ortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$he aders,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config. sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSele ction){this.onselectstart=function(){return false};return false;}});$this.bind(" update",function(){this.config.parsers=buildParserCache(this,$headers);cache=bui ldCache(this);}).bind("sorton",function(e,list){if(config.noRowsShow){$(config.n oRowsShow).hide();$(this).show();}

if($("tr",this).length>1){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this ,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));} $this.trigger("noRowShowCheck");}).bind("resort",function(e,defaultSortOrder){$( "tr.letterBarRow",$this).remove();$this.trigger("update").trigger("sorton",[conf ig.sortList]).trigger("applyWidgets").trigger("noRowShowCheck");}).bind("appendC ache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id ){getWidgetById(id).format(this);}).bind("noRowShowCheck",function(e,id){$(confi g.noRowsShow).hide();if($("tbody tr:visible",this).length==0&&config.noRowsShow) {$(this).fadeOut('fast',function(){$(config.noRowsShow).fadeIn();});};}).bind("a pplyWidgets",function(){applyWidget(this);$this.trigger("noRowShowCheck");});if( $.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$ (this).metadata().sortlist;} if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);} applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=tr ue;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()) {a=false;}} if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widg et);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};th is.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=f unction(s,config){var DECIMAL='\\'+config.decimal;var exp='/(^[+]?0('+DECIMAL+'0 +)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)'+DECIMAL+'(0*[1-9][0-9]*) ))$)|(^[-+]?[1-9]+[0-9]*'+DECIMAL+'0+$)/';return RegExp(exp).test($.trim(s));};t his.clearTableBody=function(table){if($.browser.msie){function empty(){while(thi s.firstChild)this.removeChild(this.firstChild);} empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.ex tend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({i d:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLower Case());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=tabl e.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tableso rter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s ){return/^[ $ ?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.r w RegExp(/[^0-9.]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:fun ction(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:fun ction(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];i f(item.length==2){r+="0"+item;}else{r+=item;}} return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is :function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){retur n jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"} );ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2 }$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Da te(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addPars er({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s) {return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeri c"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A -Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([01]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.for matFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"sortDate",i s:function(s){return false;},format:function(s){return $(s).html();},type:"numer ic"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/ \-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\ -/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4 })/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2 })[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="d d-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");} return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.ad dParser({id:"sortStamp",is:function(s){return s.indexOf("sortStamp")>0;},format: function(s){s=s.replace(/'/g,"");s=s.replace(/"/g,"");return s.between('<span cl ass=sortStamp>','</span>');},type:"numeric"});ts.addParser({id:"time",is:functio n(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test

(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 " +s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){ret urn false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadat aName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"num eric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){v ar time=new Date();} count=0;$("tr:visible",table.tBodies[0]).each(function(){if($(":visible",this).l ength){$(this).removeClass("firstDataRow");if(count==0){$(this).addClass("firstD ataRow");} $(this).removeClass(table.config.widgetZebra.css[1]);$(this).removeClass(table.c onfig.widgetZebra.css[0]);if(count++%2==0){$(this).addClass(table.config.widgetZ ebra.css[0]);}else{$(this).addClass(table.config.widgetZebra.css[1]);}}});if(tab le.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});ts.a ddWidget({id:"liveCount",format:function(table){count=0 $("tbody tr.livecount:visible",table).each(function(){count+=$(":visible",this). length?1:0});$(table).prev('h4').find('.headerBarCount').html(count)}});ts.addWi dget({id:"letter",format:function(table){if(letterSort++==0) return;sortCol=parseInt(table.config.sortList[0][0]);$('.letterBarRow').remove() ;lastLetter=-1 lettersUsed=Array();var rowTotal=0;var rowNumber=0;var lastRowtotalHtml;var hidd enCols=0;$("thead tr",table).find("th").each(function(){if($(this).is(":hidden") ){hiddenCols++;} else if($(this).is(":visible")==false){hiddenCols++;}});$("tbody tr:visible",tab le).each(function() {rowTotal++;rowNumber++;try{if($("td",this)[sortCol]) {cell=$("td",this)[sortCol];var firstLetter=jQuery.trim($(cell).text());if(!(tab le.config.letterOptions&&table.config.letterOptions[sortCol]&&table.config.lette rOptions[sortCol].useWord)){firstLetter=firstLetter.substring(0,1);}} else firstLetter="";hideLetterBar=table.config.letterOptions&&table.config.letterOpti ons[sortCol]&&table.config.letterOptions[sortCol].noLetterBar===true if(!hideLetterBar&&firstLetter!=undefined&&firstLetter!=""&&firstLetter!=lastLet ter) {html="";if(sortCol>1){sortCol=sortCol-hiddenCols;html+="<tr class='thead letter BarRow'><td class='letterBar' colspan="+sortCol+" >&nbsp;</td><td class='letterB ar letterBarLetter'><a name='"+firstLetter+"'></a>"+firstLetter+"</td><td class= 'letterBar letterBarLast' colspan=99><a href='#letterTop' class='top'>Top</a></t d></tr>";} else{html+="<tr class='thead letterBarRow'><td class='letterBar letterBarLetter' ><a name='"+firstLetter+"'></a>&nbsp;"+firstLetter+"</td><td class='letterBar le tterBarLast' colspan=99><a href='#top' class='letterTop'>Top</a>&nbsp;</td></tr> ";} $(this).before(html);lastLetter=firstLetter;lettersUsed[firstLetter]=1;rowTotal= 0;}}catch(e){console.debug(e)}});var getTotalRow=function(sortCol,rowTotal){if(s ortCol>1&&false){totalHtml="<tr class='thead letterBarRow'><td class='totalBar' colspan="+sortCol+" >&nbsp;</td><td class='totalBar'>Total: "+rowTotal+"</td><td class='totalBar' colspan=99>&nbsp;</td></tr>";} else{totalHtml="<tr class='thead letterBarRow'><td class='totalBar' colspan='99' >Total: "+rowTotal+"</td></tr>";} return totalHtml;};if(table.config.letterOptions&&table.config.letterOptions[sor tCol]&&table.config.letterOptions[sortCol].useWord){var rowCount=0;var rowTotal= 0;var lastTr=null;var totalHtml="";$("tbody tr:visible",table).each(function() {rowCount++;if(rowCount>=2) {totalHtml="";if($(this).hasClass("letterBarRow")){$(this).before(getTotalRow(so rtCol,rowTotal));rowTotal=0;} else{rowTotal++;}} lastTr=this;});$(lastTr).after(getTotalRow(sortCol,rowTotal));} letterLinks="<a name='letterTop'></a>";for($i=65;$i<=90;$i++) {letter=String.fromCharCode($i);if(lettersUsed[String.fromCharCode($i)]>0) letterLinks+="<a href='#"+letter+"' class='letter linkLetter'>"+letter+"</a>";el

se letterLinks+="<span class='letter noLinkLetter'>"+letter+"</span>";} $("#letterList").html(letterLinks);if(this.filterEventsCreated!=true) {$(".filter").change(function(){if($(this).val()===""){$("#filter").val("");} filterFunc();});$("#filter").keyup(function(){if(this.tableSorterTimeOut){clearT imeout(this.tableSorterTimeOut);} this.tableSorterTimeOut=setTimeout(filterFunc,750);});this.filterEventsCreated=t rue;}}});})(jQuery);letterSort=0;var filterFunc=function(){var filterString=$("# filter").val();$(".filter").each(function(){if(this.value){filterString+=" "+thi s.value;}});$.uiTableFilter($(".tablesorter"),filterString,null,function(){});$( ".tablesorter").trigger("resort");};

jQuery.uiTableFilter=function(jq,phrase,column,ifHidden){var new_hidden=false;if (this.last_phrase===phrase){return false;} var phrase_length=phrase.length;var words=phrase.toLowerCase().split(" ");var su ccess=function(elem){elem.show();};var failure=function(elem){elem.hide();};var search_text=null;if(column){var index=null;jq.find("thead > tr:last > th").each( function(i){if($(this).text()==column){index=i;return false;}});var iselector="t d:eq("+index+")";search_text=function(){var elem=jQuery(this);if(jQuery.uiTableF ilter.has_words(jQuery(elem.find(iselector)).text(),words)){success(elem);} else{failure(elem);}};} else{search_text=function(){var elem=jQuery(this);if(jQuery.uiTableFilter.has_wo rds(elem.text(),words)){elem.show().addClass("visible");} else{elem.hide().removeClass("visible");}};} if((words.size>1)&&(phrase.substr(0,phrase_length-1)===this.last_phrase)){if(phr ase[-1]===" "){this.last_phrase=phrase;return false;} success=function(elem){elem.hide();new_hidden=true;};failure=function(elem){};wo rds=words[-1];jq.find("tbody tr:visible").each(search_text);} else{new_hidden=true;jq.find("tbody > tr").each(search_text);} last_phrase=phrase;if(new_hidden){ifHidden();} return jq;};jQuery.uiTableFilter.last_phrase="";jQuery.uiTableFilter.has_words=f unction(str,words,caseSensitive) {var text=caseSensitive?str:str.toLowerCase();for(var i=0;i<words.length;i++){if (text.indexOf(words[i])===-1){return false;}} return true;};

(function($){$.widget("ui.combobox",{options:{allowAnyValue:false,id:'',name:''} ,_create:function(){var self=this,select=this.element.hide(),selected=select.chi ldren(":selected"),value=selected.val()?selected.text():"";this.options.restoreV alue=selected.val();this.options.restoreText=value;var input=this.input=$("<inpu t>").insertAfter(select).val(value).autocomplete({delay:0,minLength:0,source:fun ction(request,response){var matcher=new RegExp($.ui.autocomplete.escapeRegex(req uest.term),"i");response(select.children("option").map(function(){var text=$(thi s).text();if(this.value&&(!request.term||matcher.test(text))) return{label:text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+ $.ui.autocomplete.escapeRegex(request.term)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<st rong>$1</strong>"),value:text,option:this};}));},select:function(event,ui){selec t.val($(ui.item.option).val());ui.item.option.selected=true;self._trigger("selec

ted",event,{item:ui.item.option});},change:function(event,ui){if(!ui.item){var m atcher=new RegExp("^"+$.ui.autocomplete.escapeRegex($(this).val())+"$","i"),vali d=false;select.children("option").each(function(){if($(this).text().match(matche r)){this.selected=valid=true;return false;}});if(!valid){if(self.options.allowAn yValue){select.val('');console.debug(select);return true;}else{$(this).val(self. options.restoreText);select.val(self.options.restoreValue);input.data("autocompl ete").term="";return true;}}}}}).addClass("ui-widget ui-widget-content ui-corner -left").attr('id',self.options.id).attr('name',self.options.name);input.data("au tocomplete")._renderItem=function(ul,item){return $("<li></li>").data("item.auto complete",item).append("<a>"+item.label+"</a>").appendTo(ul);};this.button=$("<b utton type='button'>&nbsp;</button>").attr("tabIndex",-1).attr("title","Show All Items").insertAfter(input).button({icons:{primary:"ui-icon-triangle-1-s"},text: false}).removeClass("ui-corner-all").addClass("ui-corner-right ui-button-icon"). click(function(){self.button.removeClass('ui-state-focus');if(input.autocomplete ("widget").is(":visible")){input.autocomplete("close");return;} input.autocomplete("search","");input.focus();});},destroy:function(){this.input .remove();this.button.remove();this.element.show();$.Widget.prototype.destroy.ca ll(this);}});})(jQuery);

(function($){$.widget("ui.selectmenu",{getter:"value",version:"1.9",eventPrefix: "selectmenu",options:{transferClasses:true,typeAhead:1000,style:'dropdown',posit ionOptions:{my:"left top",at:"left bottom",offset:null},width:null,menuWidth:nul l,handleWidth:26,maxHeight:null,icons:null,format:null,bgImage:function(){},wrap perElement:"<div />"},_create:function(){var self=this,o=this.options;var select menuId=(this.element.attr('id')||'ui-selectmenu-'+Math.random().toString(16).sli ce(2,10)).replace(':','\\:');this.ids=[selectmenuId,selectmenuId+'-button',selec tmenuId+'-menu'];this._safemouseup=true;this.isOpen=false;this.newelement=$('<a />',{'class':this.widgetBaseClass+' ui-widget ui-state-default ui-corner-all','i d':this.ids[1],'role':'button','href':'#nogo','tabindex':this.element.attr('disa bled')?1:0,'aria-haspopup':true,'aria-owns':this.ids[2]});this.newelementWrap=$( o.wrapperElement).append(this.newelement).insertAfter(this.element);var tabindex =this.element.attr('tabindex');if(tabindex){this.newelement.attr('tabindex',tabi ndex);} this.newelement.data('selectelement',this.element);this.selectmenuIcon=$('<span class="'+this.widgetBaseClass+'-icon ui-icon"></span>').prependTo(this.newelemen t);this.newelement.prepend('<span class="'+self.widgetBaseClass+'-status" />');t his.element.bind({'click.selectmenu':function(event){self.newelement.focus();eve nt.preventDefault();}});this.newelement.bind('mousedown.selectmenu',function(eve nt){self._toggle(event,true);if(o.style=="popup"){self._safemouseup=false;setTim eout(function(){self._safemouseup=true;},300);} return false;}).bind('click.selectmenu',function(){return false;}).bind("keydown .selectmenu",function(event){var ret=false;switch(event.keyCode){case $.ui.keyCo de.ENTER:ret=true;break;case $.ui.keyCode.SPACE:self._toggle(event);break;case $ .ui.keyCode.UP:if(event.altKey){self.open(event);}else{self._moveSelection(-1);} break;case $.ui.keyCode.DOWN:if(event.altKey){self.open(event);}else{self._moveS election(1);} break;case $.ui.keyCode.LEFT:self._moveSelection(-1);break;case $.ui.keyCode.RIG HT:self._moveSelection(1);break;case $.ui.keyCode.TAB:ret=true;break;case $.ui.k eyCode.HOME:self.index(0);break;default:ret=true;} return ret;}).bind('keypress.selectmenu',function(event){if(event.which>0){self. _typeAhead(event.which,'mouseup');} return true;}).bind('mouseover.selectmenu focus.selectmenu',function(){if(!o.dis abled){$(this).addClass(self.widgetBaseClass+'-focus ui-state-hover');}}).bind(' mouseout.selectmenu blur.selectmenu',function(){if(!o.disabled){$(this).removeCl

ass(self.widgetBaseClass+'-focus ui-state-hover');}});$(document).bind("mousedow n.selectmenu-"+this.ids[0],function(event){if(self.isOpen){self.close(event);}}) ;this.element.bind("click.selectmenu",function(){self._refreshValue();}).bind("f ocus.selectmenu",function(){if(self.newelement){self.newelement[0].focus();}});i f(!o.width){o.width=this.element.outerWidth();} var width=$(this.element).attr("data-width");this.newelement.width(width?width:" auto");this.element.hide();this.list=$('<ul />',{'class':'ui-widget ui-widget-co ntent','aria-hidden':true,'role':'listbox','aria-labelledby':this.ids[1],'id':th is.ids[2]});this.listWrap=$(o.wrapperElement).addClass(self.widgetBaseClass+'-me nu').append(this.list).appendTo('body');this.list.bind("keydown.selectmenu",func tion(event){var ret=false;switch(event.keyCode){case $.ui.keyCode.UP:if(event.al tKey){self.close(event,true);}else{self._moveFocus(-1);} break;case $.ui.keyCode.DOWN:if(event.altKey){self.close(event,true);}else{self. _moveFocus(1);} break;case $.ui.keyCode.LEFT:self._moveFocus(-1);break;case $.ui.keyCode.RIGHT:s elf._moveFocus(1);break;case $.ui.keyCode.HOME:self._moveFocus(':first');break;c ase $.ui.keyCode.PAGE_UP:self._scrollPage('up');break;case $.ui.keyCode.PAGE_DOW N:self._scrollPage('down');break;case $.ui.keyCode.END:self._moveFocus(':last'); break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:self.close(event,true);$(e vent.target).parents('li:eq(0)').trigger('mouseup');break;case $.ui.keyCode.TAB: ret=true;self.close(event,true);$(event.target).parents('li:eq(0)').trigger('mou seup');break;case $.ui.keyCode.ESCAPE:self.close(event,true);break;default:ret=t rue;} return ret;}).bind('keypress.selectmenu',function(event){if(event.which>0){self. _typeAhead(event.which,'focus');} return true;}).bind('mousedown.selectmenu mouseup.selectmenu',function(){return false;});$(window).bind("resize.selectmenu-"+this.ids[0],$.proxy(self.close,this ));},_init:function(){var self=this,o=this.options;var selectOptionData=[];this. element.find('option').each(function(){var opt=$(this);selectOptionData.push({va lue:opt.attr('value'),text:self._formatText(opt.text()),selected:opt.attr('selec ted'),disabled:opt.attr('disabled'),classes:opt.attr('class'),typeahead:opt.attr ('typeahead'),parentOptGroup:opt.parent('optgroup'),bgImage:o.bgImage.call(opt)} );});var activeClass=(self.options.style=="popup")?" ui-state-active":"";this.li st.html("");if(selectOptionData.length){for(var i=0;i<selectOptionData.length;i+ +){var thisLiAttr={role:'presentation'};if(selectOptionData[i].disabled){thisLiA ttr['class']=this.namespace+'-state-disabled';} var thisAAttr={html:selectOptionData[i].text,href:'#nogo',tabindex:-1,role:'opti on','aria-selected':false};if(selectOptionData[i].disabled){thisAAttr['aria-disa bled']=selectOptionData[i].disabled;} if(selectOptionData[i].typeahead){thisAAttr['typeahead']=selectOptionData[i].typ eahead;} var thisA=$('<a/>',thisAAttr);var thisLi=$('<li/>',thisLiAttr).append(thisA).dat a('index',i).addClass(selectOptionData[i].classes).data('optionClasses',selectOp tionData[i].classes||'').bind("mouseup.selectmenu",function(event){if(self._safe mouseup&&!self._disabled(event.currentTarget)&&!self._disabled($(event.currentTa rget).parents("ul>li."+self.widgetBaseClass+"-group "))){var changed=$(this).dat a('index')!=self._selectedIndex();self.index($(this).data('index'));self.select( event);if(changed){self.change(event);} self.close(event,true);} return false;}).bind("click.selectmenu",function(){return false;}).bind('mouseov er.selectmenu focus.selectmenu',function(e){if(!$(e.currentTarget).hasClass(self .namespace+'-state-disabled')&&!$(e.currentTarget).parent("ul").parent("li").has Class(self.namespace+'-state-disabled')){self._selectedOptionLi().addClass(activ eClass);self._focusedOptionLi().removeClass(self.widgetBaseClass+'-item-focus ui -state-hover');$(this).removeClass('ui-state-active').addClass(self.widgetBaseCl ass+'-item-focus ui-state-hover');}}).bind('mouseout.selectmenu blur.selectmenu' ,function(){if($(this).is(self._selectedOptionLi().selector)){$(this).addClass(a ctiveClass);} $(this).removeClass(self.widgetBaseClass+'-item-focus ui-state-hover');});if(sel ectOptionData[i].parentOptGroup.length){var optGroupName=self.widgetBaseClass+'-

group-'+this.element.find('optgroup').index(selectOptionData[i].parentOptGroup); if(this.list.find('li.'+optGroupName).length){this.list.find('li.'+optGroupName+ ':last ul').append(thisLi);}else{$(' <li role="presentation" class="'+self.widge tBaseClass+'-group '+optGroupName+(selectOptionData[i].parentOptGroup.attr("disa bled")?' '+this.namespace+'-state-disabled" aria-disabled="true"':'"')+'><span c lass="'+self.widgetBaseClass+'-group-label">'+selectOptionData[i].parentOptGroup .attr('label')+'</span><ul></ul></li> ').appendTo(this.list).find('ul').append(t hisLi);}}else{thisLi.appendTo(this.list);} if(o.icons){for(var j in o.icons){if(thisLi.is(o.icons[j].find)){thisLi.data('op tionClasses',selectOptionData[i].classes+' '+self.widgetBaseClass+'-hasIcon').ad dClass(self.widgetBaseClass+'-hasIcon');var iconClass=o.icons[j].icon||"";thisLi .find('a:eq(0)').prepend('<span class="'+self.widgetBaseClass+'-item-icon ui-ico n '+iconClass+'"></span>');if(selectOptionData[i].bgImage){thisLi.find('span').c ss('background-image',selectOptionData[i].bgImage);}}}}}}else{$('<li role="prese ntation"><a href="#nogo" tabindex="-1" role="option"></a></li>').appendTo(this.l ist);} var isDropDown=(o.style=='dropdown');this.newelement.toggleClass(self.widgetBase Class+'-dropdown',isDropDown).toggleClass(self.widgetBaseClass+'-popup',!isDropD own);this.list.toggleClass(self.widgetBaseClass+'-menu-dropdown ui-corner-bottom ',isDropDown).toggleClass(self.widgetBaseClass+'-menu-popup ui-corner-all',!isDr opDown).find('li:first').toggleClass('ui-corner-top',!isDropDown).end().find('li :last').addClass('ui-corner-bottom');this.selectmenuIcon.toggleClass('ui-icon-tr iangle-1-s',isDropDown).toggleClass('ui-icon-triangle-2-n-s',!isDropDown);if(o.t ransferClasses){var transferClasses=this.element.attr('class')||'';this.neweleme nt.add(this.list).addClass(transferClasses);} if(o.style=='dropdown'){this.list.width(o.menuWidth?o.menuWidth:o.width);}else{t his.list.width(o.menuWidth?o.menuWidth:o.width-o.handleWidth);} this.list.css('height','auto');var listH=this.listWrap.height();if(o.maxHeight&& o.maxHeight<listH){this.list.height(o.maxHeight);}else{var winH=$(window).height ()/3;if(winH<listH)this.list.height(winH);} this._optionLis=this.list.find('li:not(.'+self.widgetBaseClass+'-group)');if(thi s.element.attr('disabled')){this.disable();}else{this.enable();} this.index(this._selectedIndex());window.setTimeout(function(){self._refreshPosi tion();},200);},destroy:function(){this.element.removeData(this.widgetName).remo veClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').r emoveAttr('aria-disabled').unbind(".selectmenu");$(window).unbind(".selectmenu-" +this.ids[0]);$(document).unbind(".selectmenu-"+this.ids[0]);this.newelementWrap .remove();this.listWrap.remove();this.element.unbind(".selectmenu").show();$.Wid get.prototype.destroy.apply(this,arguments);},_typeAhead:function(code,eventType ){var self=this,c=String.fromCharCode(code).toLowerCase(),items=this.list.find(' li a'),matchee=null,nextIndex=null;if(self._typeAhead_timer){window.clearTimeout (self._typeAhead_timer);self._typeAhead_timer=undefined;} self._typeAhead_chars=(self._typeAhead_chars===undefined?"":self._typeAhead_char s).concat(c);if(self._typeAhead_chars.length<2||(self._typeAhead_chars.substr(-2 ,1)===c&&self._typeAhead_cycling)){self._typeAhead_cycling=true;matchee=c;} else{self._typeAhead_cycling=false;matchee=self._typeAhead_chars;} var selectedIndex=(eventType!=='focus'?this._selectedOptionLi().data('index'):th is._focusedOptionLi().data('index'))||0;for(var i=0;i<items.length;i++){var this Text=items.eq(i).text().substr(0,matchee.length).toLowerCase();if(thisText===mat chee){if(self._typeAhead_cycling){if(nextIndex===null) nextIndex=i;if(i>selectedIndex){nextIndex=i;break;}}else{nextIndex=i;}}} if(nextIndex!==null){items.eq(nextIndex).trigger(eventType);} self._typeAhead_timer=window.setTimeout(function(){self._typeAhead_timer=undefin ed;self._typeAhead_chars=undefined;self._typeAhead_cycling=undefined;},self.opti ons.typeAhead);},_uiHash:function(){var index=this.index();return{index:index,op tion:$("option",this.element).get(index),value:this.element[0].value};},open:fun ction(event){var self=this,o=this.options;if(self.newelement.attr("aria-disabled ")!='true'){self._closeOthers(event);self.newelement.addClass('ui-state-active') ;self.listWrap.appendTo(o.appendTo);self.list.attr('aria-hidden',false);self.lis tWrap.addClass(self.widgetBaseClass+'-open');var selected=this._selectedOptionLi

();if(o.style=="dropdown"){self.newelement.removeClass('ui-corner-all').addClass ('ui-corner-top');}else{this.list.css("left",-5000).scrollTop(this.list.scrollTo p()+selected.position().top-this.list.outerHeight()/2+selected.outerHeight()/2). css("left","auto");} self._refreshPosition();var link=selected.find("a");if(link.length)link[0].focus ();self.isOpen=true;self._trigger("open",event,self._uiHash());}},close:function (event,retainFocus){if(this.newelement.is('.ui-state-active')){this.newelement.r emoveClass('ui-state-active');this.listWrap.removeClass(this.widgetBaseClass+'-o pen');this.list.attr('aria-hidden',true);if(this.options.style=="dropdown"){this .newelement.removeClass('ui-corner-top').addClass('ui-corner-all');} if(retainFocus){this.newelement.focus();} this.isOpen=false;this._trigger("close",event,this._uiHash());}},change:function (event){this.element.trigger("change");this._trigger("change",event,this._uiHash ());},select:function(event){if(this._disabled(event.currentTarget)){return fals e;} this._trigger("select",event,this._uiHash());},_closeOthers:function(event){$('. '+this.widgetBaseClass+'.ui-state-active').not(this.newelement).each(function(){ $(this).data('selectelement').selectmenu('close',event);});$('.'+this.widgetBase Class+'.ui-state-hover').trigger('mouseout');},_toggle:function(event,retainFocu s){if(this.isOpen){this.close(event,retainFocus);}else{this.open(event);}},_form atText:function(text){return(this.options.format?this.options.format(text):text) ;},_selectedIndex:function(){return this.element[0].selectedIndex;},_selectedOpt ionLi:function(){return this._optionLis.eq(this._selectedIndex());},_focusedOpti onLi:function(){return this.list.find('.'+this.widgetBaseClass+'-item-focus');}, _moveSelection:function(amt,recIndex){if(!this.options.disabled){var currIndex=p arseInt(this._selectedOptionLi().data('index')||0,10);var newIndex=currIndex+amt ;if(newIndex<0){newIndex=0;} if(newIndex>this._optionLis.size()-1){newIndex=this._optionLis.size()-1;} if(newIndex===recIndex){return false;} if(this._optionLis.eq(newIndex).hasClass(this.namespace+'-state-disabled')){(amt >0)?++amt:--amt;this._moveSelection(amt,newIndex);}else{return this._optionLis.e q(newIndex).trigger('mouseup');}}},_moveFocus:function(amt,recIndex){if(!isNaN(a mt)){var currIndex=parseInt(this._focusedOptionLi().data('index')||0,10);var new Index=currIndex+amt;}else{var newIndex=parseInt(this._optionLis.filter(amt).data ('index'),10);} if(newIndex<0){newIndex=0;} if(newIndex>this._optionLis.size()-1){newIndex=this._optionLis.size()-1;} if(newIndex===recIndex){return false;} var activeID=this.widgetBaseClass+'-item-'+Math.round(Math.random()*1000);this._ focusedOptionLi().find('a:eq(0)').attr('id','');if(this._optionLis.eq(newIndex). hasClass(this.namespace+'-state-disabled')){(amt>0)?++amt:--amt;this._moveFocus( amt,newIndex);}else{this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activ eID).focus();} this.list.attr('aria-activedescendant',activeID);},_scrollPage:function(directio n){var numPerPage=Math.floor(this.list.outerHeight()/this.list.find('li:first'). outerHeight());numPerPage=(direction=='up'?-numPerPage:numPerPage);this._moveFoc us(numPerPage);},_setOption:function(key,value){this.options[key]=value;if(key== 'disabled'){if(value)this.close();this.element.add(this.newelement).add(this.lis t)[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+ this.namespace+'-state-disabled').attr("aria-disabled",value);}},disable:functio n(index,type){if(typeof(index)=='undefined'){this._setOption('disabled',true);}e lse{if(type=="optgroup"){this._disableOptgroup(index);}else{this._disableOption( index);}}},enable:function(index,type){if(typeof(index)=='undefined'){this._setO ption('disabled',false);}else{if(type=="optgroup"){this._enableOptgroup(index);} else{this._enableOption(index);}}},_disabled:function(elem){return $(elem).hasCl ass(this.namespace+'-state-disabled');},_disableOption:function(index){var optio nElem=this._optionLis.eq(index);if(optionElem){optionElem.addClass(this.namespac e+'-state-disabled').find("a").attr("aria-disabled",true);this.element.find("opt ion").eq(index).attr("disabled","disabled");}},_enableOption:function(index){var optionElem=this._optionLis.eq(index);if(optionElem){optionElem.removeClass(this

.namespace+'-state-disabled').find("a").attr("aria-disabled",false);this.element .find("option").eq(index).removeAttr("disabled");}},_disableOptgroup:function(in dex){var optGroupElem=this.list.find('li.'+this.widgetBaseClass+'-group-'+index) ;if(optGroupElem){optGroupElem.addClass(this.namespace+'-state-disabled').attr(" aria-disabled",true);this.element.find("optgroup").eq(index).attr("disabled","di sabled");}},_enableOptgroup:function(index){var optGroupElem=this.list.find('li. '+this.widgetBaseClass+'-group-'+index);if(optGroupElem){optGroupElem.removeClas s(this.namespace+'-state-disabled').attr("aria-disabled",false);this.element.fin d("optgroup").eq(index).removeAttr("disabled");}},index:function(newValue){if(ar guments.length){if(!this._disabled($(this._optionLis[newValue]))){this.element[0 ].selectedIndex=newValue;this._refreshValue();}else{return false;}}else{return t his._selectedIndex();}},value:function(newValue){if(arguments.length){this.eleme nt[0].value=newValue;this._refreshValue();}else{return this.element[0].value;}}, _refreshValue:function(){var activeClass=(this.options.style=="popup")?" ui-stat e-active":"";var activeID=this.widgetBaseClass+'-item-'+Math.round(Math.random() *1000);this.list.find('.'+this.widgetBaseClass+'-item-selected').removeClass(thi s.widgetBaseClass+"-item-selected"+activeClass).find('a').attr('aria-selected',' false').attr('id','');this._selectedOptionLi().addClass(this.widgetBaseClass+"-i tem-selected"+activeClass).find('a').attr('aria-selected','true').attr('id',acti veID);var currentOptionClasses=(this.newelement.data('optionClasses')?this.newel ement.data('optionClasses'):"");var newOptionClasses=(this._selectedOptionLi().d ata('optionClasses')?this._selectedOptionLi().data('optionClasses'):"");this.new element.removeClass(currentOptionClasses).data('optionClasses',newOptionClasses) .addClass(newOptionClasses).find('.'+this.widgetBaseClass+'-status').html(this._ selectedOptionLi().find('a:eq(0)').html());this.list.attr('aria-activedescendant ',activeID);},_refreshPosition:function(){var o=this.options;if(o.style=="popup" &&!o.positionOptions.offset){var selected=this._selectedOptionLi();var _offset=" 0 "+(this.list.offset().top-selected.offset().top-(this.newelement.outerHeight() +selected.outerHeight())/2);} this.listWrap.zIndex(this.element.zIndex()+1).position({of:o.positionOptions.of| |this.newelement,my:o.positionOptions.my,at:o.positionOptions.at,offset:o.positi onOptions.offset||_offset,collision:o.positionOptions.collision||'flip'});}});}) (jQuery);

(function($,window,undefined){"use strict";var TRUE=true,FALSE=false,NULL=null,Q TIP,PLUGINS,MOUSE,usedIDs={},uitooltip='ui-tooltip',widget='ui-widget',disabled= 'ui-state-disabled',selector='div.qtip.'+uitooltip,defaultClass=uitooltip+'-defa ult',focusClass=uitooltip+'-focus',hoverClass=uitooltip+'-hover',fluidClass=uito oltip+'-fluid',hideOffset='-31000px',replaceSuffix='_replacedByqTip',oldtitle='o ldtitle',trackingBound;function log(){log.history=log.history||[];log.history.pu sh(arguments);if('object'===typeof console){var c=console[console.warn?'warn':'l og'],args=Array.prototype.slice.call(arguments),a;if(typeof arguments[0]==='stri ng'){args[0]='qTip2: '+args[0];} a=c.apply?c.apply(console,args):c(args);}} function sanitizeOptions(opts) {var content;if(!opts||'object'!==typeof opts){return FALSE;} if(opts.metadata===NULL||'object'!==typeof opts.metadata){opts.metadata={type:op ts.metadata};} if('content'in opts){if(opts.content===NULL||'object'!==typeof opts.content||opt s.content.jquery){opts.content={text:opts.content};} content=opts.content.text||FALSE;if(!$.isFunction(content)&&((!content&&!content .attr)||content.length<1||('object'===typeof content&&!content.jquery))){opts.co ntent.text=FALSE;} if('title'in opts.content){if(opts.content.title===NULL||'object'!==typeof opts.

content.title){opts.content.title={text:opts.content.title};} content=opts.content.title.text||FALSE;if(!$.isFunction(content)&&((!content&&!c ontent.attr)||content.length<1||('object'===typeof content&&!content.jquery))){o pts.content.title.text=FALSE;}}} if('position'in opts){if(opts.position===NULL||'object'!==typeof opts.position){ opts.position={my:opts.position,at:opts.position};}} if('show'in opts){if(opts.show===NULL||'object'!==typeof opts.show){if(opts.show .jquery){opts.show={target:opts.show};} else{opts.show={event:opts.show};}}} if('hide'in opts){if(opts.hide===NULL||'object'!==typeof opts.hide){if(opts.hide .jquery){opts.hide={target:opts.hide};} else{opts.hide={event:opts.hide};}}} if('style'in opts){if(opts.style===NULL||'object'!==typeof opts.style){opts.styl e={classes:opts.style};}} $.each(PLUGINS,function(){if(this.sanitize){this.sanitize(opts);}});return opts; } function QTip(target,options,id,attr) {var self=this,docBody=document.body,tooltipID=uitooltip+'-'+id,isPositioning=0, isDrawing=0,tooltip=$(),namespace='.qtip-'+id,elements,cache;self.id=id;self.ren dered=FALSE;self.elements=elements={target:target};self.timers={img:{}};self.opt ions=options;self.checks={};self.plugins={};self.cache=cache={event:{},target:$( ),disabled:FALSE,attr:attr};function convertNotation(notation) {var i=0,obj,option=options,levels=notation.split('.');while(option=option[level s[i++]]){if(i<levels.length){obj=option;}} return[obj||options,levels.pop()];} function setWidget(){var on=options.style.widget;tooltip.toggleClass(widget,on). toggleClass(defaultClass,options.style['default']&&!on);elements.content.toggleC lass(widget+'-content',on);if(elements.titlebar){elements.titlebar.toggleClass(w idget+'-header',on);} if(elements.button){elements.button.toggleClass(uitooltip+'-icon',!on);}} function removeTitle(reposition) {if(elements.title){elements.titlebar.remove();elements.titlebar=elements.title= elements.button=NULL;if(reposition!==FALSE){self.reposition();}}} function createButton() {var button=options.content.title.button,isString=typeof button==='string',close =isString?button:'Close tooltip';if(elements.button){elements.button.remove();} if(button.jquery){elements.button=button;} else{elements.button=$('<a />',{'class':'ui-state-default ui-tooltip-close '+(op tions.style.widget?'':uitooltip+'-icon'),'title':close,'aria-label':close}).prep end($('<span />',{'class':'ui-icon ui-icon-close','html':'&times;'}));} elements.button.appendTo(elements.titlebar).attr('role','button').click(function (event){if(!tooltip.hasClass(disabled)){self.hide(event);} return FALSE;});self.redraw();} function createTitle() {var id=tooltipID+'-title';if(elements.titlebar){removeTitle();} elements.titlebar=$('<div />',{'class':uitooltip+'-titlebar '+(options.style.wid get?'ui-widget-header':'')}).append(elements.title=$('<div />',{'id':id,'class': uitooltip+'-title','aria-atomic':TRUE})).insertBefore(elements.content).delegate ('.ui-tooltip-close','mousedown keydown mouseup keyup mouseout',function(event){ $(this).toggleClass('ui-state-active ui-state-focus',event.type.substr(-4)==='do wn');}).delegate('.ui-tooltip-close','mouseover mouseout',function(event){$(this ).toggleClass('ui-state-hover',event.type==='mouseover');});if(options.content.t itle.button){createButton();} else if(self.rendered){self.redraw();}} function updateButton(button) {var elem=elements.button,title=elements.title;if(!self.rendered){return FALSE;} if(!button){elem.remove();} else{if(!title){createTitle();} createButton();}} function updateTitle(content,reposition)

{var elem=elements.title;if(!self.rendered||!content){return FALSE;} if($.isFunction(content)){content=content.call(target,cache.event,self);} if(content===FALSE){return removeTitle(FALSE);} else if(content.jquery&&content.length>0){elem.empty().append(content.css({displ ay:'block'}));} else{elem.html(content);} self.redraw();if(reposition!==FALSE&&self.rendered&&tooltip.is(':visible')){self .reposition(cache.event);}} function updateContent(content,reposition) {var elem=elements.content;if(!self.rendered||!content){return FALSE;} if($.isFunction(content)){content=content.call(target,cache.event,self)||'';} if(content.jquery&&content.length>0){elem.empty().append(content.css({display:'b lock'}));} else{elem.html(content);} function detectImages(next){var images,srcs={};function imageLoad(image){if(imag e){delete srcs[image.src];clearTimeout(self.timers.img[image.src]);$(image).unbi nd(namespace);} if($.isEmptyObject(srcs)){self.redraw();if(reposition!==FALSE){self.reposition(c ache.event);} next();}} if((images=elem.find('img:not([height]):not([width])')).length===0){return image Load();} images.each(function(i,elem){if(srcs[elem.src]!==undefined){return;} var iterations=0,maxIterations=3;(function timer(){if(elem.height||elem.width||( iterations>maxIterations)){return imageLoad(elem);} iterations+=1;self.timers.img[elem.src]=setTimeout(timer,700);}());$(elem).bind( 'error'+namespace+' load'+namespace,function(){imageLoad(this);});srcs[elem.src] =elem;});} if(self.rendered<0){tooltip.queue('fx',detectImages);} else{isDrawing=0;detectImages($.noop);} return self;} function assignEvents() {var posOptions=options.position,targets={show:options.show.target,hide:options. hide.target,viewport:$(posOptions.viewport),document:$(document),body:$(document .body),window:$(window)},events={show:$.trim(''+options.show.event).split(' '),h ide:$.trim(''+options.hide.event).split(' ')},IE6=$.browser.msie&&parseInt($.bro wser.version,10)===6;function showMethod(event) {if(tooltip.hasClass(disabled)){return FALSE;} clearTimeout(self.timers.show);clearTimeout(self.timers.hide);var callback=funct ion(){self.toggle(TRUE,event);};if(options.show.delay>0){self.timers.show=setTim eout(callback,options.show.delay);} else{callback();}} function hideMethod(event) {if(tooltip.hasClass(disabled)||isPositioning||isDrawing){return FALSE;} var relatedTarget=$(event.relatedTarget||event.target),ontoTooltip=relatedTarget .closest(selector)[0]===tooltip[0],ontoTarget=relatedTarget[0]===targets.show[0] ;clearTimeout(self.timers.show);clearTimeout(self.timers.hide);if((posOptions.ta rget==='mouse'&&ontoTooltip)||(options.hide.fixed&&((/mouse(out|leave|move)/).te st(event.type)&&(ontoTooltip||ontoTarget)))){try{event.preventDefault();event.st opImmediatePropagation();}catch(e){}return;} if(options.hide.delay>0){self.timers.hide=setTimeout(function(){self.hide(event) ;},options.hide.delay);} else{self.hide(event);}} function inactiveMethod(event) {if(tooltip.hasClass(disabled)){return FALSE;} clearTimeout(self.timers.inactive);self.timers.inactive=setTimeout(function(){se lf.hide(event);},options.hide.inactive);} function repositionMethod(event){if(tooltip.is(':visible')){self.reposition(even t);}} tooltip.bind('mouseenter'+namespace+' mouseleave'+namespace,function(event){var

state=event.type==='mouseenter';if(state){self.focus(event);} tooltip.toggleClass(hoverClass,state);});if(options.hide.fixed){targets.hide=tar gets.hide.add(tooltip);tooltip.bind('mouseover'+namespace,function(){if(!tooltip .hasClass(disabled)){clearTimeout(self.timers.hide);}});} if(/mouse(out|leave)/i.test(options.hide.event)){if(options.hide.leave==='window '){targets.window.bind('mouseout'+namespace+' blur'+namespace,function(event){if (/select|option/.test(event.target)&&!event.relatedTarget){self.hide(event);}}); }} else if(/mouse(over|enter)/i.test(options.show.event)){targets.hide.bind('mousel eave'+namespace,function(event){clearTimeout(self.timers.show);});} if((''+options.hide.event).indexOf('unfocus')>-1){targets.body.bind('mousedown'+ namespace,function(event){var $target=$(event.target),enabled=!tooltip.hasClass( disabled)&&tooltip.is(':visible');if($target[0]!==tooltip[0]&&$target.parents(se lector).length===0&&$target.add(target).length>1&&!$target.attr('disabled')){sel f.hide(event);}});} if('number'===typeof options.hide.inactive){targets.show.bind('qtip-'+id+'-inact ive',inactiveMethod);$.each(QTIP.inactiveEvents,function(index,type){targets.hid e.add(elements.tooltip).bind(type+namespace+'-inactive',inactiveMethod);});} $.each(events.hide,function(index,type){var showIndex=$.inArray(type,events.show ),targetHide=$(targets.hide);if((showIndex>-1&&targetHide.add(targets.show).leng th===targetHide.length)||type==='unfocus') {targets.show.bind(type+namespace,function(event){if(tooltip.is(':visible')){hid eMethod(event);} else{showMethod(event);}});delete events.show[showIndex];} else{targets.hide.bind(type+namespace,hideMethod);}});$.each(events.show,functio n(index,type){targets.show.bind(type+namespace,showMethod);});if('number'===type of options.hide.distance){targets.show.add(tooltip).bind('mousemove'+namespace,f unction(event){var origin=cache.origin||{},limit=options.hide.distance,abs=Math. abs;if(abs(event.pageX-origin.pageX)>=limit||abs(event.pageY-origin.pageY)>=limi t){self.hide(event);}});} if(posOptions.target==='mouse'){targets.show.bind('mousemove'+namespace,function (event){MOUSE={pageX:event.pageX,pageY:event.pageY,type:'mousemove'};});if(posOp tions.adjust.mouse){if(options.hide.event){tooltip.bind('mouseleave'+namespace,f unction(event){if((event.relatedTarget||event.target)!==targets.show[0]){self.hi de(event);}});} targets.document.bind('mousemove'+namespace,function(event){if(!tooltip.hasClass (disabled)&&tooltip.is(':visible')){self.reposition(event||MOUSE);}});}} if(posOptions.adjust.resize||targets.viewport.length){($.event.special.resize?ta rgets.viewport:targets.window).bind('resize'+namespace,repositionMethod);} if(targets.viewport.length||(IE6&&tooltip.css('position')==='fixed')){targets.vi ewport.bind('scroll'+namespace,repositionMethod);}} function unassignEvents() {var targets=[options.show.target[0],options.hide.target[0],self.rendered&&eleme nts.tooltip[0],options.position.container[0],options.position.viewport[0],window ,document];if(self.rendered){$([]).pushStack($.grep(targets,function(i){return t ypeof i==='object';})).unbind(namespace);} else{options.show.target.unbind(namespace+'-create');}} self.checks.builtin={'^id$':function(obj,o,v){var id=v===TRUE?QTIP.nextid:v,tool tipID=uitooltip+'-'+id;if(id!==FALSE&&id.length>0&&!$('#'+tooltipID).length){too ltip[0].id=tooltipID;elements.content[0].id=tooltipID+'-content';elements.title[ 0].id=tooltipID+'-title';}},'^content.text$':function(obj,o,v){updateContent(v); },'^content.title.text$':function(obj,o,v){if(!v){return removeTitle();} if(!elements.title&&v){createTitle();} updateTitle(v);},'^content.title.button$':function(obj,o,v){updateButton(v);},'^ position.(my|at)$':function(obj,o,v){if('string'===typeof v){obj[o]=new PLUGINS. Corner(v);}},'^position.container$':function(obj,o,v){if(self.rendered){tooltip. appendTo(v);}},'^show.ready$':function(){if(!self.rendered){self.render(1);} else{self.toggle(TRUE);}},'^style.classes$':function(obj,o,v){tooltip.attr('clas s',uitooltip+' qtip ui-helper-reset '+v);},'^style.widget|content.title':setWidg et,'^events.(render|show|move|hide|focus|blur)$':function(obj,o,v){tooltip[($.is

Function(v)?'':'un')+'bind']('tooltip'+o,v);},'^(show|hide|position).(event|targ et|fixed|inactive|leave|distance|viewport|adjust)':function(){var posOptions=opt ions.position;tooltip.attr('tracking',posOptions.target==='mouse'&&posOptions.ad just.mouse);unassignEvents();assignEvents();}};$.extend(self,{render:function(sh ow) {if(self.rendered){return self;} var text=options.content.text,title=options.content.title.text,posOptions=option s.position,callback=$.Event('tooltiprender');$.attr(target[0],'aria-describedby' ,tooltipID);tooltip=elements.tooltip=$('<div/>',{'id':tooltipID,'class':uitoolti p+' qtip ui-helper-reset '+defaultClass+' '+options.style.classes+' '+uitooltip+ '-pos-'+options.position.my.abbrev(),'width':options.style.width||'','height':op tions.style.height||'','tracking':posOptions.target==='mouse'&&posOptions.adjust .mouse,'role':'alert','aria-live':'polite','aria-atomic':FALSE,'aria-describedby ':tooltipID+'-content','aria-hidden':TRUE}).toggleClass(disabled,cache.disabled) .data('qtip',self).appendTo(options.position.container).append(elements.content= $('<div />',{'class':uitooltip+'-content','id':tooltipID+'-content','aria-atomic ':TRUE}));self.rendered=-1;isDrawing=1;isPositioning=1;if(title){createTitle();i f(!$.isFunction(title)){updateTitle(title,FALSE);}} if(!$.isFunction(text)){updateContent(text,FALSE);} self.rendered=TRUE;setWidget();$.each(options.events,function(name,callback){if( $.isFunction(callback)){tooltip.bind(name==='toggle'?'tooltipshow tooltiphide':' tooltip'+name,callback);}});$.each(PLUGINS,function(){if(this.initialize==='rend er'){this(self);}});assignEvents();tooltip.queue('fx',function(next){callback.or iginalEvent=cache.event;tooltip.trigger(callback,[self]);isDrawing=0;isPositioni ng=0;self.redraw();if(options.show.ready||show){self.toggle(TRUE,cache.event,FAL SE);} next();});return self;},get:function(notation) {var result,o;switch(notation.toLowerCase()) {case'dimensions':result={height:tooltip.outerHeight(),width:tooltip.outerWidth( )};break;case'offset':result=PLUGINS.offset(tooltip,options.position.container); break;default:o=convertNotation(notation.toLowerCase());result=o[0][o[1]];result =result.precedance?result.string():result;break;} return result;},set:function(option,value) {var rmove=/^position\.(my|at|adjust|target|container)|style|content|show\.ready /i,rdraw=/^content\.(title|attr)|style/i,reposition=FALSE,redraw=FALSE,checks=se lf.checks,name;function callback(notation,args){var category,rule,match;for(cate gory in checks){for(rule in checks[category]){if(match=(new RegExp(rule,'i')).ex ec(notation)){args.push(match);checks[category][rule].apply(self,args);}}}} if('string'===typeof option){name=option;option={};option[name]=value;} else{option=$.extend(TRUE,{},option);} $.each(option,function(notation,value){var obj=convertNotation(notation.toLowerC ase()),previous;previous=obj[0][obj[1]];obj[0][obj[1]]='object'===typeof value&& value.nodeType?$(value):value;option[notation]=[obj[0],obj[1],value,previous];re position=rmove.test(notation)||reposition;redraw=rdraw.test(notation)||redraw;}) ;sanitizeOptions(options);isPositioning=isDrawing=1;$.each(option,callback);isPo sitioning=isDrawing=0;if(tooltip.is(':visible')&&self.rendered){if(reposition){s elf.reposition(options.position.target==='mouse'?NULL:cache.event);} if(redraw){self.redraw();}} return self;},toggle:function(state,event) {if(!self.rendered){return state?self.render(1):self;} var type=state?'show':'hide',opts=options[type],visible=tooltip.is(':visible'),s ameTarget=!event||options[type].target.length<2||cache.target[0]===event.target, posOptions=options.position,contentOptions=options.content,delay,callback;if((ty peof state).search('boolean|number')){state=!visible;} if(!tooltip.is(':animated')&&visible===state&&sameTarget){return self;} if(event){if((/over|enter/).test(event.type)&&(/out|leave/).test(cache.event.typ e)&&event.target===options.show.target[0]&&tooltip.has(event.relatedTarget).leng th){return self;} cache.event=$.extend({},event);} callback=$.Event('tooltip'+type);callback.originalEvent=event?cache.event:NULL;t

ooltip.trigger(callback,[self,90]);if(callback.isDefaultPrevented()){return self ;} $.attr(tooltip[0],'aria-hidden',!!!state);if(state){cache.origin=$.extend({},MOU SE);self.focus(event);if($.isFunction(contentOptions.text)){updateContent(conten tOptions.text,FALSE);} if($.isFunction(contentOptions.title.text)){updateTitle(contentOptions.title.tex t,FALSE);} if(!trackingBound&&posOptions.target==='mouse'&&posOptions.adjust.mouse){$(docum ent).bind('mousemove.qtip',function(event){MOUSE={pageX:event.pageX,pageY:event. pageY,type:'mousemove'};});trackingBound=TRUE;} self.reposition(event,arguments[2]);if((callback.solo=!!opts.solo)){$(selector,o pts.solo).not(tooltip).qtip('hide',callback);}} else{clearTimeout(self.timers.show);delete cache.origin;if(trackingBound&&!$(sel ector+'[tracking="true"]:visible',opts.solo).not(tooltip).length){$(document).un bind('mousemove.qtip');trackingBound=FALSE;} self.blur(event);} function after(){if(state){if($.browser.msie){tooltip[0].style.removeAttribute(' filter');} tooltip.css('overflow','');if('string'===typeof opts.autofocus){$(opts.autofocus ,tooltip).focus();} callback=$.Event('tooltipvisible');callback.originalEvent=event?cache.event:NULL ;tooltip.trigger(callback,[self]);opts.target.trigger('qtip-'+id+'-inactive');} else{tooltip.css({display:'',visibility:'',opacity:'',left:'',top:''});}} if(sameTarget){tooltip.stop(0,1);} if(opts.effect===FALSE){tooltip[type]();after.call(tooltip);} else if($.isFunction(opts.effect)){opts.effect.call(tooltip,self);tooltip.queue( 'fx',function(n){after();n();});} else{tooltip.fadeTo(90,state?1:0,after);} if(state){opts.target.trigger('qtip-'+id+'-inactive');} return self;},show:function(event){return self.toggle(TRUE,event);},hide:functio n(event){return self.toggle(FALSE,event);},focus:function(event) {if(!self.rendered){return self;} var qtips=$(selector),curIndex=parseInt(tooltip[0].style.zIndex,10),newIndex=QTI P.zindex+qtips.length,cachedEvent=$.extend({},event),focusedElem,callback;if(!to oltip.hasClass(focusClass)) {callback=$.Event('tooltipfocus');callback.originalEvent=cachedEvent;tooltip.tri gger(callback,[self,newIndex]);if(!callback.isDefaultPrevented()){if(curIndex!== newIndex){qtips.each(function(){if(this.style.zIndex>curIndex){this.style.zIndex =this.style.zIndex-1;}});qtips.filter('.'+focusClass).qtip('blur',cachedEvent);} tooltip.addClass(focusClass)[0].style.zIndex=newIndex;}} return self;},blur:function(event){var cachedEvent=$.extend({},event),callback;t ooltip.removeClass(focusClass);callback=$.Event('tooltipblur');callback.original Event=cachedEvent;tooltip.trigger(callback,[self]);return self;},reposition:func tion(event,effect) {if(!self.rendered||isPositioning){return self;} isPositioning=1;var target=options.position.target,posOptions=options.position,m y=posOptions.my,at=posOptions.at,adjust=posOptions.adjust,method=adjust.method.s plit(' '),elemWidth=tooltip.outerWidth(),elemHeight=tooltip.outerHeight(),target Width=0,targetHeight=0,callback=$.Event('tooltipmove'),fixed=tooltip.css('positi on')==='fixed',viewport=posOptions.viewport,position={left:0,top:0},container=po sOptions.container,flipoffset=FALSE,tip=self.plugins.tip,readjust={horizontal:me thod[0],vertical:(method[1]=method[1]||method[0]),enabled:viewport.jquery&&targe t[0]!==window&&target[0]!==docBody&&adjust.method!=='none',left:function(posLeft ){var isShift=readjust.horizontal==='shift',viewportScroll=-container.offset.lef t+viewport.offset.left+viewport.scrollLeft,myWidth=my.x==='left'?elemWidth:my.x= =='right'?-elemWidth:-elemWidth/2,atWidth=at.x==='left'?targetWidth:at.x==='righ t'?-targetWidth:-targetWidth/2,tipWidth=tip&&tip.size?tip.size.width||0:0,tipAdj ust=tip&&tip.corner&&tip.corner.precedance==='x'&&!isShift?tipWidth:0,overflowLe ft=viewportScroll-posLeft+tipAdjust,overflowRight=posLeft+elemWidth-viewport.wid th-viewportScroll+tipAdjust,offset=myWidth-(my.precedance==='x'||my.x===my.y?atW

idth:0),isCenter=my.x==='center';if(isShift){tipAdjust=tip&&tip.corner&&tip.corn er.precedance==='y'?tipWidth:0;offset=(my.x==='left'?1:-1)*myWidth-tipAdjust;pos ition.left+=overflowLeft>0?overflowLeft:overflowRight>0?-overflowRight:0;positio n.left=Math.max(-container.offset.left+viewport.offset.left+(tipAdjust&&tip.corn er.x==='center'?tip.offset:0),posLeft-offset,Math.min(Math.max(-container.offset .left+viewport.offset.left+viewport.width,posLeft+offset),position.left));} else{if(overflowLeft>0&&(my.x!=='left'||overflowRight>0)){position.left-=offset; } else if(overflowRight>0&&(my.x!=='right'||overflowLeft>0)){position.left-=isCent er?-offset:offset;} if(position.left!==posLeft&&isCenter){position.left-=adjust.x;} if(position.left<viewportScroll&&-position.left>overflowRight){position.left=pos Left;}} return position.left-posLeft;},top:function(posTop){var isShift=readjust.vertica l==='shift',viewportScroll=-container.offset.top+viewport.offset.top+viewport.sc rollTop,myHeight=my.y==='top'?elemHeight:my.y==='bottom'?-elemHeight:-elemHeight /2,atHeight=at.y==='top'?targetHeight:at.y==='bottom'?-targetHeight:-targetHeigh t/2,tipHeight=tip&&tip.size?tip.size.height||0:0,tipAdjust=tip&&tip.corner&&tip. corner.precedance==='y'&&!isShift?tipHeight:0,overflowTop=viewportScroll-posTop+ tipAdjust,overflowBottom=posTop+elemHeight-viewport.height-viewportScroll+tipAdj ust,offset=myHeight-(my.precedance==='y'||my.x===my.y?atHeight:0),isCenter=my.y= =='center';if(isShift){tipAdjust=tip&&tip.corner&&tip.corner.precedance==='x'?ti pHeight:0;offset=(my.y==='top'?1:-1)*myHeight-tipAdjust;position.top+=overflowTo p>0?overflowTop:overflowBottom>0?-overflowBottom:0;position.top=Math.max(-contai ner.offset.top+viewport.offset.top+(tipAdjust&&tip.corner.x==='center'?tip.offse t:0),posTop-offset,Math.min(Math.max(-container.offset.top+viewport.offset.top+v iewport.height,posTop+offset),position.top));} else{if(overflowTop>0&&(my.y!=='top'||overflowBottom>0)){position.top-=offset;} else if(overflowBottom>0&&(my.y!=='bottom'||overflowTop>0)){position.top-=isCent er?-offset:offset;} if(position.top!==posTop&&isCenter){position.top-=adjust.y;} if(position.top<0&&-position.top>overflowBottom){position.top=posTop;}} return position.top-posTop;}},win;if($.isArray(target)&&target.length===2){at={x :'left',y:'top'};position={left:target[0],top:target[1]};} else if(target==='mouse'&&((event&&event.pageX)||cache.event.pageX)){at={x:'left ',y:'top'};event=(event&&(event.type==='resize'||event.type==='scroll')?cache.ev ent:event&&event.pageX&&event.type==='mousemove'?event:MOUSE&&MOUSE.pageX&&(adju st.mouse||!event||!event.pageX)?{pageX:MOUSE.pageX,pageY:MOUSE.pageY}:!adjust.mo use&&cache.origin&&cache.origin.pageX?cache.origin:event)||event||cache.event||M OUSE||{};position={top:event.pageY,left:event.pageX};} else{if(target==='event'){if(event&&event.target&&event.type!=='scroll'&&event.t ype!=='resize'){target=cache.target=$(event.target);} else{target=cache.target;}} else{cache.target=$(target);} target=$(target).eq(0);if(target.length===0){return self;} else if(target[0]===document||target[0]===window){targetWidth=PLUGINS.iOS?window .innerWidth:target.width();targetHeight=PLUGINS.iOS?window.innerHeight:target.he ight();if(target[0]===window){position={top:fixed||PLUGINS.iOS?(viewport||target ).scrollTop():0,left:fixed||PLUGINS.iOS?(viewport||target).scrollLeft():0};}} else if(target.is('area')&&PLUGINS.imagemap){position=PLUGINS.imagemap(target,at ,readjust.enabled?method:FALSE);} else if(target[0].namespaceURI==='http://www.w3.org/2000/svg'&&PLUGINS.svg){posi tion=PLUGINS.svg(target,at);} else{targetWidth=target.outerWidth();targetHeight=target.outerHeight();position= PLUGINS.offset(target,container);} if(position.offset){targetWidth=position.width;targetHeight=position.height;flip offset=position.flipoffset;position=position.offset;} if((PLUGINS.iOS<4.1&&PLUGINS.iOS>3.1)||PLUGINS.iOS==4.3||(!PLUGINS.iOS&&fixed)){ win=$(window);position.left-=win.scrollLeft();position.top-=win.scrollTop();} position.left+=at.x==='right'?targetWidth:at.x==='center'?targetWidth/2:0;positi

on.top+=at.y==='bottom'?targetHeight:at.y==='center'?targetHeight/2:0;} position.left+=adjust.x+(my.x==='right'?-elemWidth:my.x==='center'?-elemWidth/2: 0);position.top+=adjust.y+(my.y==='bottom'?-elemHeight:my.y==='center'?-elemHeig ht/2:0);if(readjust.enabled){viewport={elem:viewport,height:viewport[(viewport[0 ]===window?'h':'outerH')+'eight'](),width:viewport[(viewport[0]===window?'w':'ou terW')+'idth'](),scrollLeft:fixed?0:viewport.scrollLeft(),scrollTop:fixed?0:view port.scrollTop(),offset:viewport.offset()||{left:0,top:0}};container={elem:conta iner,scrollLeft:container.scrollLeft(),scrollTop:container.scrollTop(),offset:co ntainer.offset()||{left:0,top:0}};position.adjusted={left:readjust.horizontal!== 'none'?readjust.left(position.left):0,top:readjust.vertical!=='none'?readjust.to p(position.top):0};if(position.adjusted.left+position.adjusted.top){tooltip.attr ('class',tooltip[0].className.replace(/ui-tooltip-pos-\w+/i,uitooltip+'-pos-'+my .abbrev()));} if(flipoffset&&position.adjusted.left){position.left+=flipoffset.left;} if(flipoffset&&position.adjusted.top){position.top+=flipoffset.top;}} else{position.adjusted={left:0,top:0};} callback.originalEvent=$.extend({},event);tooltip.trigger(callback,[self,positio n,viewport.elem||viewport]);if(callback.isDefaultPrevented()){return self;} delete position.adjusted;if(effect===FALSE||isNaN(position.left)||isNaN(position .top)||target==='mouse'||!$.isFunction(posOptions.effect)){tooltip.css(position) ;} else if($.isFunction(posOptions.effect)){posOptions.effect.call(tooltip,self,$.e xtend({},position));tooltip.queue(function(next){$(this).css({opacity:'',height: ''});if($.browser.msie){this.style.removeAttribute('filter');} next();});} isPositioning=0;return self;},redraw:function() {if(self.rendered<1||isDrawing){return self;} var container=options.position.container,perc,width,max,min;isDrawing=1;if(optio ns.style.height){tooltip.css('height',options.style.height);} if(options.style.width){tooltip.css('width',options.style.width);} else{tooltip.css('width','').addClass(fluidClass);width=tooltip.width()+1;max=to oltip.css('max-width')||'';min=tooltip.css('min-width')||'';perc=(max+min).index Of('%')>-1?container.width()/100:0;max=((max.indexOf('%')>-1?perc:1)*parseInt(ma x,10))||width;min=((min.indexOf('%')>-1?perc:1)*parseInt(min,10))||0;width=max+m in?Math.min(Math.max(width,min),max):width;tooltip.css('width',Math.round(width) ).removeClass(fluidClass);} isDrawing=0;return self;},disable:function(state) {if('boolean'!==typeof state){state=!(tooltip.hasClass(disabled)||cache.disabled );} if(self.rendered){tooltip.toggleClass(disabled,state);$.attr(tooltip[0],'aria-di sabled',state);} else{cache.disabled=!!state;} return self;},enable:function(){return self.disable(FALSE);},destroy:function() {var t=target[0],title=$.attr(t,oldtitle),elemAPI=target.data('qtip');if(self.re ndered){tooltip.remove();$.each(self.plugins,function(){if(this.destroy){this.de stroy();}});} clearTimeout(self.timers.show);clearTimeout(self.timers.hide);unassignEvents();i f(!elemAPI||self===elemAPI){$.removeData(t,'qtip');if(options.suppress&&title){$ .attr(t,'title',title);target.removeAttr(oldtitle);} target.removeAttr('aria-describedby');} target.unbind('.qtip-'+id);delete usedIDs[self.id];return target;}});} function init(id,opts) {var obj,posOptions,attr,config,title,elem=$(this),docBody=$(document.body),newT arget=this===document?docBody:elem,metadata=(elem.metadata)?elem.metadata(opts.m etadata):NULL,metadata5=opts.metadata.type==='html5'&&metadata?metadata[opts.met adata.name]:NULL,html5=elem.data(opts.metadata.name||'qtipopts');try{html5=typeo f html5==='string'?(new Function("return "+html5))():html5;} catch(e){log('Unable to parse HTML5 attribute data: '+html5);} config=$.extend(TRUE,{},QTIP.defaults,opts,typeof html5==='object'?sanitizeOptio ns(html5):NULL,sanitizeOptions(metadata5||metadata));posOptions=config.position;

config.id=id;if('boolean'===typeof config.content.text){attr=elem.attr(config.co ntent.attr);if(config.content.attr!==FALSE&&attr){config.content.text=attr;} else{log('Unable to locate content for tooltip! Aborting render of tooltip on el ement: ',elem);return FALSE;}} if(!posOptions.container.length){posOptions.container=docBody;} if(posOptions.target===FALSE){posOptions.target=newTarget;} if(config.show.target===FALSE){config.show.target=newTarget;} if(config.show.solo===TRUE){config.show.solo=docBody;} if(config.hide.target===FALSE){config.hide.target=newTarget;} if(config.position.viewport===TRUE){config.position.viewport=posOptions.containe r;} posOptions.at=new PLUGINS.Corner(posOptions.at);posOptions.my=new PLUGINS.Corner (posOptions.my);if($.data(this,'qtip')){if(config.overwrite){elem.qtip('destroy' );} else if(config.overwrite===FALSE){return FALSE;}} if(config.suppress&&(title=$.attr(this,'title'))){$(this).removeAttr('title').at tr(oldtitle,title);} obj=new QTip(elem,config,id,!!attr);$.data(this,'qtip',obj);elem.bind('remove.qt ip-'+id,function(){obj.destroy();});return obj;} QTIP=$.fn.qtip=function(options,notation,newValue) {var command=(''+options).toLowerCase(),returned=NULL,args=$.makeArray(arguments ).slice(1),event=args[args.length-1],opts=this[0]?$.data(this[0],'qtip'):NULL;if ((!arguments.length&&opts)||command==='api'){return opts;} else if('string'===typeof options) {this.each(function() {var api=$.data(this,'qtip');if(!api){return TRUE;} if(event&&event.timeStamp){api.cache.event=event;} if((command==='option'||command==='options')&&notation){if($.isPlainObject(notat ion)||newValue!==undefined){api.set(notation,newValue);} else{returned=api.get(notation);return FALSE;}} else if(api[command]){api[command].apply(api[command],args);}});return returned! ==NULL?returned:this;} else if('object'===typeof options||!arguments.length) {opts=sanitizeOptions($.extend(TRUE,{},options));return QTIP.bind.call(this,opts ,event);}};QTIP.bind=function(opts,event) {return this.each(function(i){var options,targets,events,namespace,api,id;id=$.i sArray(opts.id)?opts.id[i]:opts.id;id=!id||id===FALSE||id.length<1||usedIDs[id]? QTIP.nextid++:(usedIDs[id]=id);namespace='.qtip-'+id+'-create';api=init.call(thi s,id,opts);if(api===FALSE){return TRUE;} options=api.options;$.each(PLUGINS,function(){if(this.initialize==='initialize') {this(api);}});targets={show:options.show.target,hide:options.hide.target};event s={show:$.trim(''+options.show.event).replace(/ /g,namespace+' ')+namespace,hide :$.trim(''+options.hide.event).replace(/ /g,namespace+' ')+namespace};if(/mouse( over|enter)/i.test(events.show)&&!/mouse(out|leave)/i.test(events.hide)){events. hide+=' mouseleave'+namespace;} targets.show.bind('mousemove'+namespace,function(event){MOUSE={pageX:event.pageX ,pageY:event.pageY,type:'mousemove'};});function hoverIntent(event){function ren der(){api.render(typeof event==='object'||options.show.ready);targets.show.add(t argets.hide).unbind(namespace);} if(api.cache.disabled){return FALSE;} api.cache.event=$.extend({},event);api.cache.target=event?$(event.target):[undef ined];if(options.show.delay>0){clearTimeout(api.timers.show);api.timers.show=set Timeout(render,options.show.delay);if(events.show!==events.hide){targets.hide.bi nd(events.hide,function(){clearTimeout(api.timers.show);});}} else{render();}} targets.show.bind(events.show,hoverIntent);if(options.show.ready||options.preren der){hoverIntent(event);}});};PLUGINS=QTIP.plugins={Corner:function(corner){corn er=(''+corner).replace(/([A-Z])/,' $1').replace(/middle/gi,'center').toLowerCase ();this.x=(corner.match(/left|right/i)||corner.match(/center/)||['inherit'])[0]. toLowerCase();this.y=(corner.match(/top|bottom|center/i)||['inherit'])[0].toLowe

rCase();var f=corner.charAt(0);this.precedance=(f==='t'||f==='b'?'y':'x');this.s tring=function(){return this.precedance==='y'?this.y+this.x:this.x+this.y;};this .abbrev=function(){var x=this.x.substr(0,1),y=this.y.substr(0,1);return x===y?x: (x==='c'||(x!=='c'&&y!=='c'))?y+x:x+y;};this.clone=function(){return{x:this.x,y: this.y,precedance:this.precedance,string:this.string,abbrev:this.abbrev,clone:th is.clone};};},offset:function(elem,container){var pos=elem.offset(),parent=conta iner,deep=0,docBody=document.body,coffset,overflow;function scroll(e,i){pos.left +=i*e.scrollLeft();pos.top+=i*e.scrollTop();} if(parent){do{if(parent.css('position')!=='static'){coffset=parent[0]===docBody? {left:parseInt(parent.css('left'),10)||0,top:parseInt(parent.css('top'),10)||0}: parent.position();pos.left-=coffset.left+(parseInt(parent.css('borderLeftWidth') ,10)||0)+(parseInt(parent.css('marginLeft'),10)||0);pos.top-=coffset.top+(parseI nt(parent.css('borderTopWidth'),10)||0);overflow=parent.css('overflow');if(overf low==='scroll'||overflow==='auto'){deep++;}} if(parent[0]===docBody){break;}} while(parent=parent.offsetParent());if(container[0]!==docBody&&deep){scroll(cont ainer,1);}} return pos;},iOS:parseFloat((''+(/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit. *Mobile/i.exec(navigator.userAgent)||[0,''])[1]).replace('undefined','3_2').repl ace('_','.'))||FALSE,fn:{attr:function(attr,val){if(this.length){var self=this[0 ],title='title',api=$.data(self,'qtip');if(attr===title&&api&&'object'===typeof api&&api.options.suppress){if(arguments.length<2){return $.attr(self,oldtitle);} else{if(api&&api.options.content.attr===title&&api.cache.attr){api.set('content. text',val);} return this.attr(oldtitle,val);}}} return $.fn['attr'+replaceSuffix].apply(this,arguments);},clone:function(keepDat a){var titles=$([]),title='title',elems=$.fn['clone'+replaceSuffix].apply(this,a rguments);if(!keepData){elems.filter('['+oldtitle+']').attr('title',function(){r eturn $.attr(this,oldtitle);}).removeAttr(oldtitle);} return elems;},remove:$.ui?NULL:function(selector,keepData){if($.ui){return;} $(this).each(function(){if(!keepData){if(!selector||$.filter(selector,[this]).le ngth){$('*',this).add(this).each(function(){$(this).triggerHandler('remove');}); }}});}}};$.each(PLUGINS.fn,function(name,func){if(!func||$.fn[name+replaceSuffix ]){return TRUE;} var old=$.fn[name+replaceSuffix]=$.fn[name];$.fn[name]=function(){return func.ap ply(this,arguments)||old.apply(this,arguments);};});QTIP.version='nightly';QTIP. nextid=0;QTIP.inactiveEvents='click dblclick mousedown mouseup mousemove mousele ave mouseenter'.split(' ');QTIP.zindex=15000;QTIP.defaults={prerender:FALSE,id:F ALSE,overwrite:TRUE,suppress:TRUE,content:{text:TRUE,attr:'title',title:{text:FA LSE,button:FALSE}},position:{my:'top left',at:'bottom right',target:FALSE,contai ner:FALSE,viewport:FALSE,adjust:{x:0,y:0,mouse:TRUE,resize:TRUE,method:'flip fli p'},effect:function(api,pos,viewport){$(this).animate(pos,{duration:200,queue:FA LSE});}},show:{target:FALSE,event:'mouseenter',effect:TRUE,delay:90,solo:FALSE,r eady:FALSE,autofocus:FALSE},hide:{target:FALSE,event:'mouseleave',effect:TRUE,de lay:0,fixed:FALSE,inactive:FALSE,leave:'window',distance:FALSE},style:{classes:' ',widget:FALSE,width:FALSE,height:FALSE,'default':TRUE},events:{render:NULL,move :NULL,show:NULL,hide:NULL,toggle:NULL,visible:NULL,focus:NULL,blur:NULL}};functi on Ajax(api) {var self=this,tooltip=api.elements.tooltip,opts=api.options.content.ajax,namesp ace='.qtip-ajax',rscript=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,f irst=TRUE;api.checks.ajax={'^content.ajax':function(obj,name,v){if(name==='ajax' ){opts=v;} if(name==='once'){self.init();} else if(opts&&opts.url){self.load();} else{tooltip.unbind(namespace);}}};$.extend(self,{init:function(){if(opts&&opts. url){tooltip.unbind(namespace)[opts.once?'one':'bind']('tooltipshow'+namespace,s elf.load);} return self;},load:function(event,first){var hasSelector=opts.url.indexOf(' '),u rl=opts.url,selector,hideFirst=opts.once&&!opts.loading&&first;if(hideFirst){try {event.preventDefault();}catch(e){}}

else if(event&&event.isDefaultPrevented()){return self;} if(hasSelector>-1){selector=url.substr(hasSelector);url=url.substr(0,hasSelector );} function after(){if(hideFirst){api.show(event.originalEvent);first=FALSE;} if($.isFunction(opts.complete)){opts.complete.apply(this,arguments);}} function successHandler(content){if(selector){content=$('<div/>').append(content .replace(rscript,"")).find(selector);} api.set('content.text',content);} function errorHandler(xh,status,error){if(xh.status===0){return;} api.set('content.text',status+': '+error);} $.ajax($.extend({success:successHandler,error:errorHandler,context:api},opts,{ur l:url,complete:after}));}});self.init();} PLUGINS.ajax=function(api) {var self=api.plugins.ajax;return'object'===typeof self?self:(api.plugins.ajax=n ew Ajax(api));};PLUGINS.ajax.initialize='render';PLUGINS.ajax.sanitize=function( options) {var content=options.content,opts;if(content&&'ajax'in content){opts=content.aja x;if(typeof opts!=='object'){opts=options.content.ajax={url:opts};} if('boolean'!==typeof opts.once&&opts.once){opts.once=!!opts.once;}}};$.extend(T RUE,QTIP.defaults,{content:{ajax:{loading:TRUE,once:TRUE}}});PLUGINS.imagemap=fu nction(area,corner,flip) {if(!area.jquery){area=$(area);} var shape=(area[0].shape||area.attr('shape')).toLowerCase(),baseCoords=(area[0]. coords||area.attr('coords')).split(','),coords=[],image=$('img[usemap="#'+area.p arent('map').attr('name')+'"]'),imageOffset=image.offset(),result={width:0,heigh t:0,offset:{top:1e10,right:0,bottom:0,left:1e10}},i=0,next=0,dimensions;function polyCoordinates(result,coords,corner) {var i=0,compareX=1,compareY=1,realX=0,realY=0,newWidth=result.width,newHeight=r esult.height;while(newWidth>0&&newHeight>0&&compareX>0&&compareY>0) {newWidth=Math.floor(newWidth/2);newHeight=Math.floor(newHeight/2);if(corner.x== ='left'){compareX=newWidth;} else if(corner.x==='right'){compareX=result.width-newWidth;} else{compareX+=Math.floor(newWidth/2);} if(corner.y==='top'){compareY=newHeight;} else if(corner.y==='bottom'){compareY=result.height-newHeight;} else{compareY+=Math.floor(newHeight/2);} i=coords.length;while(i--) {if(coords.length<2){break;} realX=coords[i][0]-result.offset.left;realY=coords[i][1]-result.offset.top;if((c orner.x==='left'&&realX>=compareX)||(corner.x==='right'&&realX<=compareX)||(corn er.x==='center'&&(realX<compareX||realX>(result.width-compareX)))||(corner.y===' top'&&realY>=compareY)||(corner.y==='bottom'&&realY<=compareY)||(corner.y==='cen ter'&&(realY<compareY||realY>(result.height-compareY)))){coords.splice(i,1);}}} return{left:coords[0][0],top:coords[0][1]};} imageOffset.left+=Math.ceil((image.outerWidth()-image.width())/2);imageOffset.to p+=Math.ceil((image.outerHeight()-image.height())/2);if(shape==='poly'){i=baseCo ords.length;while(i--) {next=[parseInt(baseCoords[--i],10),parseInt(baseCoords[i+1],10)];if(next[0]>res ult.offset.right){result.offset.right=next[0];} if(next[0]<result.offset.left){result.offset.left=next[0];} if(next[1]>result.offset.bottom){result.offset.bottom=next[1];} if(next[1]<result.offset.top){result.offset.top=next[1];} coords.push(next);}} else{coords=$.map(baseCoords,function(coord){return parseInt(coord,10);});} switch(shape) {case'rect':result={width:Math.abs(coords[2]-coords[0]),height:Math.abs(coords[3 ]-coords[1]),offset:{left:Math.min(coords[0],coords[2]),top:Math.min(coords[1],c oords[3])}};break;case'circle':result={width:coords[2]+2,height:coords[2]+2,offs et:{left:coords[0],top:coords[1]}};break;case'poly':$.extend(result,{width:Math. abs(result.offset.right-result.offset.left),height:Math.abs(result.offset.bottom

-result.offset.top)});if(corner.string()==='centercenter'){result.offset={left:r esult.offset.left+(result.width/2),top:result.offset.top+(result.height/2)};} else{result.offset=polyCoordinates(result,coords.slice(),corner);if(flip&&(flip[ 0]==='flip'||flip[1]==='flip')){result.flipoffset=polyCoordinates(result,coords. slice(),{x:corner.x==='left'?'right':corner.x==='right'?'left':'center',y:corner .y==='top'?'bottom':corner.y==='bottom'?'top':'center'});result.flipoffset.left=result.offset.left;result.flipoffset.top-=result.offset.top;}} result.width=result.height=0;break;} result.offset.left+=imageOffset.left;result.offset.top+=imageOffset.top;return r esult;};function calculateTip(corner,width,height) {var width2=Math.ceil(width/2),height2=Math.ceil(height/2),tips={bottomright:[[0 ,0],[width,height],[width,0]],bottomleft:[[0,0],[width,0],[0,height]],topright:[ [0,height],[width,0],[width,height]],topleft:[[0,0],[0,height],[width,height]],t opcenter:[[0,height],[width2,0],[width,height]],bottomcenter:[[0,0],[width,0],[w idth2,height]],rightcenter:[[0,0],[width,height2],[0,height]],leftcenter:[[width ,0],[width,height],[0,height2]]};tips.lefttop=tips.bottomright;tips.righttop=tip s.bottomleft;tips.leftbottom=tips.topright;tips.rightbottom=tips.topleft;return tips[corner.string()];} function Tip(qTip,command) {var self=this,opts=qTip.options.style.tip,elems=qTip.elements,tooltip=elems.too ltip,cache={top:0,left:0},size={width:opts.width,height:opts.height},color={},bo rder=opts.border||0,namespace='.qtip-tip',hasCanvas=!!($('<canvas />')[0]||{}).g etContext;self.corner=NULL;self.mimic=NULL;self.border=border;self.offset=opts.o ffset;self.size=size;qTip.checks.tip={'^position.my|style.tip.(corner|mimic|bord er)$':function(){if(!self.init()){self.destroy();} qTip.reposition();},'^style.tip.(height|width)$':function(){size={width:opts.wid th,height:opts.height};self.create();self.update();qTip.reposition();},'^content .title.text|style.(classes|widget)$':function(){if(elems.tip){self.update();}}}; function reposition(event,api,pos,viewport){if(!elems.tip){return;} var newCorner=self.corner.clone(),adjust=pos.adjusted,method=qTip.options.positi on.adjust.method.split(' '),horizontal=method[0],vertical=method[1]||method[0],s hift={left:FALSE,top:FALSE,x:0,y:0},offset,css={},props;if(self.corner.fixed!==T RUE){if(horizontal==='shift'&&newCorner.precedance==='x'&&adjust.left&&newCorner .y!=='center'){newCorner.precedance=newCorner.precedance==='x'?'y':'x';} else if(horizontal==='flip'&&adjust.left){newCorner.x=newCorner.x==='center'?(ad just.left>0?'left':'right'):(newCorner.x==='left'?'right':'left');} if(vertical==='shift'&&newCorner.precedance==='y'&&adjust.top&&newCorner.x!=='ce nter'){newCorner.precedance=newCorner.precedance==='y'?'x':'y';} else if(vertical==='flip'&&adjust.top){newCorner.y=newCorner.y==='center'?(adjus t.top>0?'top':'bottom'):(newCorner.y==='top'?'bottom':'top');} if(newCorner.string()!==cache.corner.string()&&(cache.top!==adjust.top||cache.le ft!==adjust.left)){self.update(newCorner,FALSE);}} offset=self.position(newCorner,adjust);if(offset.right!==undefined){offset.left= -offset.right;} if(offset.bottom!==undefined){offset.top=-offset.bottom;} offset.user=Math.max(0,opts.offset);if(shift.left=(horizontal==='shift'&&!!adjus t.left)){if(newCorner.x==='center'){css['margin-left']=shift.x=offset['margin-le ft']-adjust.left;} else{props=offset.right!==undefined?[adjust.left,-offset.left]:[-adjust.left,off set.left];if((shift.x=Math.max(props[0],props[1]))>props[0]){pos.left-=adjust.le ft;shift.left=FALSE;} css[offset.right!==undefined?'right':'left']=shift.x;}} if(shift.top=(vertical==='shift'&&!!adjust.top)){if(newCorner.y==='center'){css[ 'margin-top']=shift.y=offset['margin-top']-adjust.top;} else{props=offset.bottom!==undefined?[adjust.top,-offset.top]:[-adjust.top,offse t.top];if((shift.y=Math.max(props[0],props[1]))>props[0]){pos.top-=adjust.top;sh ift.top=FALSE;} css[offset.bottom!==undefined?'bottom':'top']=shift.y;}} elems.tip.css(css).toggle(!((shift.x&&shift.y)||(newCorner.x==='center'&&shift.y )||(newCorner.y==='center'&&shift.x)));pos.left-=offset.left.charAt?offset.user:

horizontal!=='shift'||shift.top||!shift.left&&!shift.top?offset.left:0;pos.top-= offset.top.charAt?offset.user:vertical!=='shift'||shift.left||!shift.left&&!shif t.top?offset.top:0;cache.left=adjust.left;cache.top=adjust.top;cache.corner=newC orner.clone();} function borderWidth(corner,side,backup){side=!side?corner[corner.precedance]:si de;var isFluid=tooltip.hasClass(fluidClass),isTitleTop=elems.titlebar&&corner.y= =='top',elem=isTitleTop?elems.titlebar:elems.content,css='border-'+side+'-width' ,val;tooltip.addClass(fluidClass);val=parseInt(elem.css(css),10);val=(backup?val ||parseInt(tooltip.css(css),10):val)||0;tooltip.toggleClass(fluidClass,isFluid); return val;} function borderRadius(corner){var isTitleTop=elems.titlebar&&corner.y==='top',el em=isTitleTop?elems.titlebar:elems.content,moz=$.browser.mozilla,prefix=moz?'-mo z-':$.browser.webkit?'-webkit-':'',side=corner.y+(moz?'':'-')+corner.x,css=prefi x+(moz?'border-radius-'+side:'border-'+side+'-radius');return parseInt(elem.css( css),10)||parseInt(tooltip.css(css),10)||0;} function calculateSize(corner){var y=corner.precedance==='y',width=size[y?'width ':'height'],height=size[y?'height':'width'],isCenter=corner.string().indexOf('ce nter')>-1,base=width*(isCenter?0.5:1),pow=Math.pow,round=Math.round,bigHyp,ratio ,result,smallHyp=Math.sqrt(pow(base,2)+pow(height,2)),hyp=[(border/base)*smallHy p,(border/height)*smallHyp];hyp[2]=Math.sqrt(pow(hyp[0],2)-pow(border,2));hyp[3] =Math.sqrt(pow(hyp[1],2)-pow(border,2));bigHyp=smallHyp+hyp[2]+hyp[3]+(isCenter? 0:hyp[0]);ratio=bigHyp/smallHyp;result=[round(ratio*height),round(ratio*width)]; return{height:result[y?0:1],width:result[y?1:0]};} $.extend(self,{init:function() {var enabled=self.detectCorner()&&(hasCanvas||$.browser.msie);if(enabled){self.c reate();self.update();tooltip.unbind(namespace).bind('tooltipmove'+namespace,rep osition);} return enabled;},detectCorner:function() {var corner=opts.corner,posOptions=qTip.options.position,at=posOptions.at,my=pos Options.my.string?posOptions.my.string():posOptions.my;if(corner===FALSE||(my=== FALSE&&at===FALSE)){return FALSE;} else{if(corner===TRUE){self.corner=new PLUGINS.Corner(my);} else if(!corner.string){self.corner=new PLUGINS.Corner(corner);self.corner.fixed =TRUE;}} return self.corner.string()!=='centercenter';},detectColours:function(actual){va r i,fill,border,tip=elems.tip.css('cssText',''),corner=actual||self.corner,prece dance=corner[corner.precedance],borderSide='border-'+precedance+'-color',borderS ideCamel='border'+precedance.charAt(0)+precedance.substr(1)+'Color',invalid=/rgb a?\(0, 0, 0(, 0)?\)|transparent|#123456/i,backgroundColor='background-color',tra nsparent='transparent',important=' !important',bodyBorder=$(document.body).css(' color'),contentColour=qTip.elements.content.css('color'),useTitle=elems.titlebar &&(corner.y==='top'||(corner.y==='center'&&tip.position().top+(size.height/2)+op ts.offset<elems.titlebar.outerHeight(1))),colorElem=useTitle?elems.titlebar:elem s.content;tooltip.addClass(fluidClass);color.fill=fill=tip.css(backgroundColor); color.border=border=tip[0].style[borderSideCamel]||tip.css(borderSide)||tooltip. css(borderSide);if(!fill||invalid.test(fill)){color.fill=colorElem.css(backgroun dColor)||transparent;if(invalid.test(color.fill)){color.fill=tooltip.css(backgro undColor)||fill;}} if(!border||invalid.test(border)||border===bodyBorder){color.border=colorElem.cs s(borderSide)||transparent;if(invalid.test(color.border)){color.border=border;}} $('*',tip).add(tip).css('cssText',backgroundColor+':'+transparent+important+';bo rder:0'+important+';');tooltip.removeClass(fluidClass);},create:function() {var width=size.width,height=size.height,vml;if(elems.tip){elems.tip.remove();} elems.tip=$('<div />',{'class':'ui-tooltip-tip'}).css({width:width,height:height }).prependTo(tooltip);if(hasCanvas){$('<canvas />').appendTo(elems.tip)[0].getCo ntext('2d').save();} else{vml='<vml:shape coordorigin="0,0" style="display:inline-block; position:abs olute; behavior:url(#default#VML);"></vml:shape>';elems.tip.html(vml+vml);$('*', elems.tip).bind('click mousedown',function(event){event.stopPropagation();});}}, update:function(corner,position)

{var tip=elems.tip,inner=tip.children(),width=size.width,height=size.height,regu lar='px solid ',transparent='px dashed transparent',mimic=opts.mimic,round=Math. round,precedance,context,coords,translate,newSize;if(!corner){corner=cache.corne r||self.corner;} if(mimic===FALSE){mimic=corner;} else{mimic=new PLUGINS.Corner(mimic);mimic.precedance=corner.precedance;if(mimic .x==='inherit'){mimic.x=corner.x;} else if(mimic.y==='inherit'){mimic.y=corner.y;} else if(mimic.x===mimic.y){mimic[corner.precedance]=corner[corner.precedance];}} precedance=mimic.precedance;self.detectColours(corner);if(color.border!=='transp arent'&&color.border!=='#123456'){border=borderWidth(corner,NULL,TRUE);if(opts.b order===0&&border>0){color.fill=color.border;} self.border=border=opts.border!==TRUE?opts.border:border;} else{self.border=border=0;} coords=calculateTip(mimic,width,height);self.size=newSize=calculateSize(corner); tip.css(newSize);if(corner.precedance==='y'){translate=[round(mimic.x==='left'?b order:mimic.x==='right'?newSize.width-width-border:(newSize.width-width)/2),roun d(mimic.y==='top'?newSize.height-height:0)];} else{translate=[round(mimic.x==='left'?newSize.width-width:0),round(mimic.y==='t op'?border:mimic.y==='bottom'?newSize.height-height-border:(newSize.height-heigh t)/2)];} if(hasCanvas){inner.attr(newSize);context=inner[0].getContext('2d');context.rest ore();context.save();context.clearRect(0,0,3000,3000);context.translate(translat e[0],translate[1]);context.beginPath();context.moveTo(coords[0][0],coords[0][1]) ;context.lineTo(coords[1][0],coords[1][1]);context.lineTo(coords[2][0],coords[2] [1]);context.closePath();context.fillStyle=color.fill;context.strokeStyle=color. border;context.lineWidth=border*2;context.lineJoin='miter';context.miterLimit=10 0;if(border){context.stroke();} context.fill();} else{coords='m'+coords[0][0]+','+coords[0][1]+' l'+coords[1][0]+','+coords[1][1] +' '+coords[2][0]+','+coords[2][1]+' xe';translate[2]=border&&/^(r|b)/i.test(cor ner.string())?parseFloat($.browser.version,10)===8?2:1:0;inner.css({antialias:'' +(mimic.string().indexOf('center')>-1),left:translate[0]-(translate[2]*Number(pr ecedance==='x')),top:translate[1]-(translate[2]*Number(precedance==='y')),width: width+border,height:height+border}).each(function(i){var $this=$(this);$this[$th is.prop?'prop':'attr']({coordsize:(width+border)+' '+(height+border),path:coords ,fillcolor:color.fill,filled:!!i,stroked:!!!i}).css({display:border||i?'block':' none'});if(!i&&$this.html()===''){$this.html('<vml:stroke weight="'+(border*2)+' px" color="'+color.border+'" miterlimit="1000" joinstyle="miter" '+' style="beha vior:url(#default#VML); display:inline-block;" />');}});} if(position!==FALSE){self.position(corner);}},position:function(corner) {var tip=elems.tip,position={},userOffset=Math.max(0,opts.offset),precedance,dim ensions,corners;if(opts.corner===FALSE||!tip){return FALSE;} corner=corner||self.corner;precedance=corner.precedance;dimensions=calculateSize (corner);corners=[corner.x,corner.y];if(precedance==='x'){corners.reverse();} $.each(corners,function(i,side){var b,br;if(side==='center'){b=precedance==='y'? 'left':'top';position[b]='50%';position['margin-'+b]=-Math.round(dimensions[prec edance==='y'?'width':'height']/2)+userOffset;} else{b=borderWidth(corner,side,TRUE);br=borderRadius(corner);position[side]=i?bo rder?borderWidth(corner,side):0:userOffset+(br>b?br:0);}});position[corner[prece dance]]-=dimensions[precedance==='x'?'width':'height'];tip.css({top:'',bottom:'' ,left:'',right:'',margin:''}).css(position);return position;},destroy:function() {if(elems.tip){elems.tip.remove();} tooltip.unbind(namespace);}});cache.corner=new PLUGINS.Corner(self.init());} PLUGINS.tip=function(api) {var self=api.plugins.tip;return'object'===typeof self?self:(api.plugins.tip=new Tip(api));};PLUGINS.tip.initialize='render';PLUGINS.tip.sanitize=function(optio ns) {var style=options.style,opts;if(style&&'tip'in style){opts=options.style.tip;if (typeof opts!=='object'){options.style.tip={corner:opts};}

if(!(/string|boolean/i).test(typeof opts.corner)){opts.corner=TRUE;} if(typeof opts.width!=='number'){delete opts.width;} if(typeof opts.height!=='number'){delete opts.height;} if(typeof opts.border!=='number'&&opts.border!==TRUE){delete opts.border;} if(typeof opts.offset!=='number'){delete opts.offset;}}};$.extend(TRUE,QTIP.defa ults,{style:{tip:{corner:TRUE,mimic:FALSE,width:6,height:6,border:TRUE,offset:0} }});PLUGINS.svg=function(svg,corner) {var doc=$(document),elem=svg[0],result={width:0,height:0,offset:{top:1e10,left: 1e10}},box,mtx,root,point,tPoint;if(elem.getBBox&&elem.parentNode){box=elem.getB Box();mtx=elem.getScreenCTM();root=elem.farthestViewportElement||elem;if(!root.c reateSVGPoint){return result;} point=root.createSVGPoint();point.x=box.x;point.y=box.y;tPoint=point.matrixTrans form(mtx);result.offset.left=tPoint.x;result.offset.top=tPoint.y;point.x+=box.wi dth;point.y+=box.height;tPoint=point.matrixTransform(mtx);result.width=tPoint.xresult.offset.left;result.height=tPoint.y-result.offset.top;result.offset.left+= doc.scrollLeft();result.offset.top+=doc.scrollTop();} return result;};function Modal(api) {var self=this,options=api.options.show.modal,elems=api.elements,tooltip=elems.t ooltip,overlaySelector='#qtip-overlay',globalNamespace='.qtipmodal',namespace=gl obalNamespace+api.id,attr='is-modal-qtip',docBody=$(document.body),overlay;api.c hecks.modal={'^show.modal.(on|blur)$':function(){self.init();elems.overlay.toggl e(tooltip.is(':visible'));}};$.extend(self,{init:function() {if(!options.on){return self;} overlay=self.create();tooltip.attr(attr,TRUE).css('z-index',PLUGINS.modal.zindex +$(selector+'['+attr+']').length).unbind(globalNamespace).unbind(namespace).bind ('tooltipshow'+globalNamespace+' tooltiphide'+globalNamespace,function(event,api ,duration){var oEvent=event.originalEvent;if(oEvent&&event.type==='tooltiphide'& &/mouse(leave|enter)/.test(oEvent.type)&&$(oEvent.relatedTarget).closest(overlay [0]).length){try{event.preventDefault();}catch(e){}} else if(!oEvent||(oEvent&&!oEvent.solo)){self[event.type.replace('tooltip','')]( event,duration);}}).bind('tooltipfocus'+globalNamespace,function(event){if(event .isDefaultPrevented()){return;} var qtips=$(selector).filter('['+attr+']'),newIndex=PLUGINS.modal.zindex+qtips.l ength,curIndex=parseInt(tooltip[0].style.zIndex,10);overlay[0].style.zIndex=newI ndex-1;qtips.each(function(){if(this.style.zIndex>curIndex){this.style.zIndex-=1 ;}});qtips.end().filter('.'+focusClass).qtip('blur',event.originalEvent);tooltip .addClass(focusClass)[0].style.zIndex=newIndex;try{event.preventDefault();}catch (e){}}).bind('tooltiphide'+globalNamespace,function(event){$('['+attr+']').filte r(':visible').not(tooltip).last().qtip('focus',event);});if(options.escape){$(wi ndow).unbind(namespace).bind('keydown'+namespace,function(event){if(event.keyCod e===27&&tooltip.hasClass(focusClass)){api.hide(event);}});} if(options.blur){elems.overlay.unbind(namespace).bind('click'+namespace,function (event){if(tooltip.hasClass(focusClass)){api.hide(event);}});} return self;},create:function() {var elem=$(overlaySelector);if(elem.length){return(elems.overlay=elem.insertAft er($(selector).last()));} overlay=elems.overlay=$('<div />',{id:overlaySelector.substr(1),html:'<div></div >',mousedown:function(){return FALSE;}}).insertAfter($(selector).last());functio n resize(){overlay.css({height:$(window).height(),width:$(window).width()});} $(window).unbind(globalNamespace).bind('resize'+globalNamespace,resize);resize() ;return overlay;},toggle:function(event,state,duration) {if(event&&event.isDefaultPrevented()){return self;} var effect=options.effect,type=state?'show':'hide',visible=overlay.is(':visible' ),modals=$('['+attr+']').filter(':visible').not(tooltip),zindex;if(!overlay){ove rlay=self.create();} if((overlay.is(':animated')&&visible===state)||(!state&&modals.length)){return s elf;} if(state){overlay.css({left:0,top:0});overlay.toggleClass('blurs',options.blur); docBody.bind('focusin'+namespace,function(event){var target=$(event.target),cont ainer=target.closest('.qtip'),targetOnTop=container.length<1?FALSE:(parseInt(con

tainer[0].style.zIndex,10)>parseInt(tooltip[0].style.zIndex,10));if(!targetOnTop &&($(event.target).closest(selector)[0]!==tooltip[0])){tooltip.find('input:visib le').filter(':first').focus();}});} else{docBody.undelegate('*','focusin'+namespace);} overlay.stop(TRUE,FALSE);if($.isFunction(effect)){effect.call(overlay,state);} else if(effect===FALSE){overlay[type]();} else{overlay.fadeTo(parseInt(duration,10)||90,state?1:0,function(){if(!state){$( this).hide();}});} if(!state){overlay.queue(function(next){overlay.css({left:'',top:''});next();}); } return self;},show:function(event,duration){return self.toggle(event,TRUE,durati on);},hide:function(event,duration){return self.toggle(event,FALSE,duration);},d estroy:function() {var delBlanket=overlay;if(delBlanket){delBlanket=$('['+attr+']').not(tooltip).l ength<1;if(delBlanket){elems.overlay.remove();$(window).unbind(globalNamespace); } else{elems.overlay.unbind(globalNamespace+api.id);} docBody.undelegate('*','focusin'+namespace);} return tooltip.removeAttr(attr).unbind(globalNamespace);}});self.init();} PLUGINS.modal=function(api){var self=api.plugins.modal;return'object'===typeof s elf?self:(api.plugins.modal=new Modal(api));};PLUGINS.modal.initialize='render'; PLUGINS.modal.sanitize=function(opts){if(opts.show){if(typeof opts.show.modal!== 'object'){opts.show.modal={on:!!opts.show.modal};} else if(typeof opts.show.modal.on==='undefined'){opts.show.modal.on=TRUE;}}};PLU GINS.modal.zindex=QTIP.zindex+1000;$.extend(TRUE,QTIP.defaults,{show:{modal:{on: FALSE,effect:TRUE,blur:TRUE,escape:TRUE}}});function BGIFrame(api) {var self=this,elems=api.elements,tooltip=elems.tooltip,namespace='.bgiframe-'+a pi.id;$.extend(self,{init:function() {elems.bgiframe=$('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex= "-1" src="javascript:\'\';" '+' style="display:block; position:absolute; z-index :-1; filter:alpha(opacity=0); '+'-ms-filter:"progid:DXImageTransform.Microsoft.A lpha(Opacity=0)";"></iframe>');elems.bgiframe.appendTo(tooltip);tooltip.bind('to oltipmove'+namespace,self.adjust);},adjust:function() {var dimensions=api.get('dimensions'),plugin=api.plugins.tip,tip=elems.tip,tipAd just,offset;offset=parseInt(tooltip.css('border-left-width'),10)||0;offset={left :-offset,top:-offset};if(plugin&&tip){tipAdjust=(plugin.corner.precedance==='x') ?['width','left']:['height','top'];offset[tipAdjust[1]]-=tip[tipAdjust[0]]();} elems.bgiframe.css(offset).css(dimensions);},destroy:function() {elems.bgiframe.remove();tooltip.unbind(namespace);}});self.init();} PLUGINS.bgiframe=function(api) {var browser=$.browser,self=api.plugins.bgiframe;if($('select, object').length<1 ||!(browser.msie&&(''+browser.version).charAt(0)==='6')){return FALSE;} return'object'===typeof self?self:(api.plugins.bgiframe=new BGIFrame(api));};PLU GINS.bgiframe.initialize='render';}(jQuery,window));

(function($) {$.fn.smoothScroll=function(settings){settings=jQuery.extend({pause:20,step:20,l eftMargin:0,topMargin:0},settings);ss={};scrollToCords=$(this[0]).offset();ss.x= scrollToCords.left-settings.leftMargin;ss.y=scrollToCords.top-settings.topMargin ;ss.xLeft=$(window).scrollLeft()>ss.x;ss.yUp=$(window).scrollTop()>ss.y;clearInt erval(ss.interval);ss.interval=setInterval(function(){var xMove=false;var yMove= false;var xScroll=$(window).scrollLeft();var yScroll=$(window).scrollTop();if(ss .xLeft===false){if(xScroll<ss.x) {xScroll+=settings.step;xMove=true;}}

else {if(xScroll>ss.x&&xScroll>0) {xScroll-=settings.step;xMove=true;}} if(ss.yUp===false){if(yScroll<ss.y) {yScroll+=settings.step;yMove=true;}} else {if(yScroll>ss.y&&yScroll>0) {yScroll-=settings.step;yMove=true;}} if(xMove||yMove){scroll(xScroll,yScroll);} else{clearInterval(ss.interval);}},settings.pause);};})(jQuery);

String.prototype.forceFloat=function(){var re=/^[0-9-'.'-',']*$/;if(!re.test(thi s)){return this.toString().replace(/[^0-9-'.'-',']/g,"");} return this;};String.prototype.forceInt=function(){var re=/^[0-9]*$/;if(!re.test (this)){return this.toString().replace(/[^0-9]/g,"");} return this;};jQuery.fn.forceFloat=function(options){this.each(function(){$(this ).keyup(function(){this.value=this.value.forceFloat();});});};String.prototype.f orcePositiveFloat=function(){return Math.abs(this.forceFloat());};

BH.contextMenu={timeout:500,closeTimer:null,activeLink:null,$menu:null,closedIco n:'ui-icon-triangle-1-e',openIcon:'ui-icon-triangle-1-s'};$.fn.contextMenu=funct ion(){$(this).each(function(){$(this).bind('click',contextMenuOpen).bind('mouseo ut',contextMenuTimerClose).html("<span class='text' style='float:left'>"+$(this) .html()+'</span><span class="ui-icon '+BH.contextMenu.closedIcon+'" style="float :left;"></span>');});if(!BH.contextMenu.$menu){$("body").append('<div id="contex tMenu" class="ui-corner-all ui-widget ui-widget-content"></div>');BH.contextMenu .$menu=$('#contextMenu');BH.contextMenu.$menu.bind('mouseover',contextMenuCancel Timer).bind('mouseout',contextMenuTimerClose);} return this;};function contextMenuOpen() {if($(BH.contextMenu.$menu).css("display")!="none"){return contextMenuClose();} contextMenuCancelTimer();$(".ui-icon",this).removeClass(BH.contextMenu.closedIco n).addClass(BH.contextMenu.openIcon);triangleOffset=$(".ui-icon",this).offset(); consoleHTML=$(this).next().html();width=BH.contextMenu.$menu.html(consoleHTML).w idth();BH.contextMenu.$menu.css({'top':triangleOffset.top+15,'left':triangleOffs et.left-width-5}).fadeIn();BH.contextMenu.activeLink=this;} function contextMenuClose(){if(BH.contextMenu.activeLink){$(".ui-icon",BH.contex tMenu.activeLink).addClass(BH.contextMenu.closedIcon).removeClass(BH.contextMenu .openIcon);BH.contextMenu.$menu.fadeOut();}} function contextMenuTimerClose(){BH.contextMenu.closeTimer=window.setTimeout(con textMenuClose,BH.contextMenu.timeout);} function contextMenuCancelTimer(){if(BH.contextMenu.closeTimer){window.clearTime out(BH.contextMenu.closeTimer);BH.contextMenu.closeTimer=null;}}

(function($){$.fn.backButton=function(options){};$.fn.backButton.waitForClick=fu nction(codeToRun){$.fn.backButton.currentHash="#bridehub";$.fn.backButton.callBa ck=codeToRun;window.location.hash="#bridehub";hashCheck=function(){currentHash=$ .fn.backButton.currentHash;if(window.location.hash!=currentHash){hashInfoObj={ol dHash:currentHash.substr(1,currentHash.length),newHash:window.location.hash.subs tr(1,currentHash.length)};$.fn.backButton.currentHash=window.location.hash;$(doc ument).trigger("BACK",hashInfoObj);if(typeof $.fn.backButton.callBack=='function '){$.fn.backButton.callBack();} clearTimeout($.fn.backButton.hashInterval);}};$.fn.backButton.hashInterval=setIn terval(hashCheck,500);};$.fn.backButton.clearWait=function(){clearTimeout($.fn.b ackButton.hashInterval);window.location.hash="";};})(jQuery);

function initRatingStars(root){$stars=root?$('input.hover-star',root):$('input.h over-star');$stars.rating({focus:function(value,link){var tip=$(this).parent("di v").find(".hover-star-title");tip.html(link.title);},blur:function(value,link){v ar tip=$(this).parent("div").find(".hover-star-title");$(tip).html('&nbsp;');},c allback:function(value,link){var tip=$(this).parent("div").find(".hover-star-val ue");tip.html(link.title);}});};if(window.jQuery)(function($){if($.browser.msie) try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};$.fn.rati ng=function(options){if(this.length==0)return this;if(typeof arguments[0]=='stri ng'){if(this.length>1){var args=arguments;return this.each(function(){$.fn.ratin g.apply($(this),args);});};$.fn.rating[arguments[0]].apply(this,$.makeArray(argu ments).slice(1)||[]);return this;};var options=$.extend({},$.fn.rating.options,o ptions||{});$.fn.rating.calls++;this.not('.star-rating-applied').addClass('starrating-applied').each(function(){var control,input=$(this);var eid=(this.name||' unnamed-rating').replace(/\[|\]/g,'_').replace(/^\_+|\_+$/g,'');var context=$(th is.form||document.body);var raters=context.data('rating');if(!raters||raters.cal l!=$.fn.rating.calls)raters={count:0,call:$.fn.rating.calls};var rater=raters[ei d];if(rater)control=rater.data('rating');if(rater&&control) control.count++;else{control=$.extend({},options||{},($.metadata?input.metadata( ):($.meta?input.data():null))||{},{count:0,stars:[],inputs:[]});control.serial=r aters.count++;rater=$('<span class="star-rating-control"/>');input.before(rater) ;rater.addClass('rating-to-be-drawn');if(input.attr('disabled'))control.readOnly =true;rater.append(control.cancel=$('<div class="rating-cancel"><a title="'+cont rol.cancel+'">'+control.cancelValue+'</a></div>').mouseover(function(){$(this).r ating('drain');$(this).addClass('star-rating-hover');}).mouseout(function(){$(th is).rating('draw');$(this).removeClass('star-rating-hover');}).click(function(){ $(this).rating('select');}).data('rating',control));};var star=$('<div class="st ar-rating rater-'+control.serial+'"><a title="'+(this.title||this.value)+'">'+th is.value+'</a></div>');rater.append(star);if(this.id)star.attr('id',this.id);if( this.className)star.addClass(this.className);if(control.half)control.split=2;if( typeof control.split=='number'&&control.split>0){var stw=($.fn.width?star.width( ):0)||control.starWidth;var spi=(control.count%control.split),spw=Math.floor(stw /control.split);star.width(spw).find('a').css({'margin-left':'-'+(spi*spw)+'px'} )};if(control.readOnly) star.addClass('star-rating-readonly');else star.addClass('star-rating-live').mouseover(function(){$(this).rating('fill');$( this).rating('focus');}).mouseout(function(){$(this).rating('draw');$(this).rati ng('blur');}).click(function(){$(this).rating('select');});if(this.checked)contr ol.current=star;input.hide();input.change(function(){$(this).rating('select');}) ;star.data('rating.input',input.data('rating.star',star));control.stars[control. stars.length]=star[0];control.inputs[control.inputs.length]=input[0];control.rat er=raters[eid]=rater;control.context=context;input.data('rating',control);rater.

data('rating',control);star.data('rating',control);context.data('rating',raters) ;});$('.rating-to-be-drawn').rating('draw').removeClass('rating-to-be-drawn');re turn this;};$.extend($.fn.rating,{calls:0,focus:function(){var control=this.data ('rating');if(!control)return this;if(!control.focus)return this;var input=$(thi s).data('rating.input')||$(this.tagName=='INPUT'?this:null);if(control.focus)con trol.focus.apply(input[0],[input.val(),$('a',input.data('rating.star'))[0]]);},b lur:function(){var control=this.data('rating');if(!control)return this;if(!contr ol.blur)return this;var input=$(this).data('rating.input')||$(this.tagName=='INP UT'?this:null);if(control.blur)control.blur.apply(input[0],[input.val(),$('a',in put.data('rating.star'))[0]]);},fill:function(){var control=this.data('rating'); if(!control)return this;if(control.readOnly)return;this.rating('drain');this.pre vAll().andSelf().filter('.rater-'+control.serial).addClass('star-rating-hover'); },drain:function(){var control=this.data('rating');if(!control)return this;if(co ntrol.readOnly)return;control.rater.children().filter('.rater-'+control.serial). removeClass('star-rating-on').removeClass('star-rating-hover');},draw:function() {var control=this.data('rating');if(!control)return this;this.rating('drain');if (control.current){control.current.data('rating.input').attr('checked','checked') ;control.current.prevAll().andSelf().filter('.rater-'+control.serial).addClass(' star-rating-on');} else $(control.inputs).removeAttr('checked');control.cancel[control.readOnly||control .required?'hide':'show']();this.siblings()[control.readOnly?'addClass':'removeCl ass']('star-rating-readonly');},select:function(value){var control=this.data('ra ting');if(!control)return this;if(control.readOnly)return;control.current=null;i f(typeof value!='undefined'){if(typeof value=='number') return $(control.stars[value]).rating('select');if(typeof value=='string') $.each(control.stars,function(){if($(this).data('rating.input').val()==value)$(t his).rating('select');});} else control.current=this[0].tagName=='INPUT'?this.data('rating.star'):(this.is('.rat er-'+control.serial)?this:null);this.data('rating',control);this.rating('draw'); var input=$(control.current?control.current.data('rating.input'):null);if(contro l.callback)control.callback.apply(input[0],[input.val(),$('a',control.current)[0 ]]);},readOnly:function(toggle,disable){var control=this.data('rating');if(!cont rol)return this;control.readOnly=toggle||toggle==undefined?true:false;if(disable )$(control.inputs).attr("disabled","disabled");else $(control.inputs).removeAttr ("disabled");this.data('rating',control);this.rating('draw');},disable:function( ){this.rating('readOnly',true,true);},enable:function(){this.rating('readOnly',f alse,false);}});$.fn.rating.options={cancel:'Cancel Rating',cancelValue:'',split :0,starWidth:16};$(function(){$('input[type=radio].star').rating();});})(jQuery) ;

jQuery.fn.hasClass=function(c){return this.is('.'+c);};jQuery.fn.exists=function (){return jQuery(this).length>0;};jQuery.fn.clearForm=function(){return this.eac h(function(){var type=this.type,tag=this.tagName.toLowerCase();if(tag=='form'){r eturn $(':input',this).clearForm();} if(type=='hidden'||type=='text'||type=='password'||tag=='textarea'){this.value=' ';} else if(type=='checkbox'||type=='radio'){this.checked=false;} else if(tag=='select'){this.selectedIndex=-1;}});};jQuery.fn.setActiveEdit=funct ion(){$(this).addClass('activeEdit');eval("jsonData = "+$("var",this).html());re turn jsonData;};jQuery.fn.removeActiveEdit=function(){$activeEdit=$(".activeEdit ",this);id=$activeEdit.attr("id");if($activeEdit.size()>0){$activeEdit.remove(); }

return id;};jQuery.fn.clearActiveEdit=function(){$(".activeEdit",this).removeCla ss('activeEdit');};jQuery.fn.pulse=function(time) {if(!time){time=2000;} this.fadeTo(time,0.30,function(){$(this).fadeTo(time,1);});return this;};jQuery. fn.drawAttention=function() {var me=this;this.addClass('attention').fadeOut(800).fadeIn(800).fadeOut(400).fa deIn(400).fadeOut(400,function(){$(me).removeClass('attention').fadeIn(400);});r eturn this;};jQuery.fn.equalHeight=function() {maxHeight=-1;$(this).each(function(){maxHeight=$(this).height()>maxHeight?$(thi s).height():maxHeight;});$(this).each(function(){$(this).height(maxHeight);});}; jQuery.fn.setDefaultText=function(title) {var me=this;console.debug(this);$(this).attr('title',title).focus(function(){de faultTextFocus(me)}).blur(function(){defaultTextBlur(me)}).blur();};jQuery.fn.ma pJsonToForm=function(jsonData,overrideMapping){if(!overrideMapping){overrideMapp ing=[];} for(model in jsonData){for(attribute in jsonData[model]){if(overrideMapping[mode l]&&overrideMapping[model][attribute]){selector=overrideMapping[model][attribute ];} else{selector=model+attribute.camelize();} $('#'+selector,this).val(jsonData[model][attribute]);}} return this;};

function initAddressValidator(scope,preDialogOpenFunc,postDialogCloseFunc){$scop e=scope==null?$("body"):$(scope);$scope.data('addressValidatorPreFunction',typeo f preDialogOpenFunc=='function'?preDialogOpenFunc:function(){});$scope.data('add ressValidatorPostFunction',typeof postDialogCloseFunc=='function'?postDialogClos eFunc:function(){});$inputs=$scope.find("input");$inputs.blur(function(){$scope. data('addressValidatorTimeout',setTimeout(function(){validateAddress(scope)},250 ));});$inputs.focus(function(){clearTimeout($scope.data('addressValidatorTimeout '))});$inputs.keyup(function(){$scope.removeClass("validated");});} function populateAddress(scope){$scope=$(scope);addr=$scope.data('lastAddress'); $scope.find(".address1").val(addr.street_unabbreviated);$scope.find(".city").val (addr.city);$scope.find(".state").val(addr.state);$scope.find(".zip").val(addr.z ipcode);$scope.addClass("validated");} function addressConfirm(text,scope){$scope=$(scope);$("#addressConfirmDialog").r emove();html='<div id="addressConfirmDialog" title="Address Validation">';html+= '<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;marg in-bottom:4em"></span>';html+='<span class="dialogText" style="no-wrap">'+text+' </span>';html+='</div>';$("body").append(html);$("#addressConfirmDialog").dialog ("destroy");callback=$scope.data('addressValidatorPostFunction');$("#addressConf irmDialog").dialog({resizable:false,width:550,modal:true,buttons:{"Use Our Sugge sted Address":function(){$(this).dialog("close");populateAddress(scope);$scope.d ata('addressValidatorPostFunction')();},"Cancel":function(){$(this).dialog("clos e");$scope.data('addressValidatorPostFunction')();}}});} function validateAddress(scope){$scope=$(scope);var address1=$scope.find(".addre ss1").val().trim();var address2=$scope.find(".address2").val().trim();var city=$ scope.find(".city").val().trim();var state=$scope.find(".state").val().trim();va r zip=$scope.find(".zip").val().trim();var EXACT_MATCH=5;var HOUSEHOLD_ACCURACY= 7;addressString=""+address1+address2+city+state+zip;addressString=addressString. toUpperCase();if(!address1.empty()&&!city.empty()&&!zip.empty()&&!autocompleteIn Progress()&&addressString!=$scope.data('lastAddressChecked')){$scope.data('addre ssValidatorPreFunction')();var data={'data[Address][address1]':address1,'data[Ad dress][address2]':address2,'data[Address][city]':city,'data[Address][state]':sta te,'data[Address][zip]':zip}

var url=toURL(BH.SITE_BASE,"Guests","validateAddress");$.post(url,data,function( data){eval("var json = "+data);if(json.error){showError("We could not validate y our address. Please make sure it is accurate and try again",'Address not found') ;$scope.data('addressValidatorPostFunction')();} else{var validatedAddress=json.validated_address;var resultAccuracy=validatedAdd ress.accuracy;var matchAccuracy=validatedAddress.match.accuracy;$scope.data('las tAddress',validatedAddress);if(resultAccuracy==HOUSEHOLD_ACCURACY){if(matchAccur acy<=2){addressConfirm("You Entered <br><b>"+validatedAddress.search+"</b><br> w as not successfully validated. Here is our best guess <br><b>"+validatedAddress. result+"</b>",scope);} else if(matchAccuracy<EXACT_MATCH){addressConfirm("Your Entered:<br> <b>"+valida tedAddress.search+"</b><br><br>We suggest using:<br><b>"+validatedAddress.result +"</b>",scope);} else{$scope.data('addressValidatorPostFunction')();}} else{showError("We could not validate your address. Please make sure the street and house number, city and state and zip are accurate and try again",'Address Er ror');$scope.data('addressValidatorPostFunction')();}}});$scope.data('lastAddres sChecked',addressString);};}

BH.unfinishedTasks={table:'',tbody:'',emptyTableShow:''};BH.finishedTasks={table :'',tbody:'',emptyTableShow:''};function unfinishedInit(t,b,e){BH.unfinishedTask s={table:t,tbody:b,emptyTableShow:e};initSort(BH.unfinishedTasks);} function finishedInit(t,b,e){BH.finishedTasks={table:t,tbody:b,emptyTableShow:e} ;initSort(BH.finishedTasks);} function initSort(settings){options={widgets:['zebra','liveCount']};if(settings. emptyTableShow){options.noRowsShow=$(settings.emptyTableShow);} $(settings.table).tablesorter(options);} function addTask(budgetItemCandidateID,callback,eventdate){if(eventdate==''||eve ntdate==null||typeof(eventdate)=="undefined") eventdate='';var uri=toURL(BH.SITE_BASE,'Tasks','add',"NULL","NULL",budgetItemCa ndidateID,eventdate);var sumbitSuccess=function(responseText){$(BH.unfinishedTas ks.table).addSoretedRow(responseText);if(typeof callback=='function'){callback() ;}};ajaxEditDialog("Add Task",uri,sumbitSuccess);} function ajax_create_poll(pollargs){if(pollargs==null||!pollargs||typeof(pollarg s)=="undefined"){return false;} var uri=toURL(BH.SITE_BASE,'Vendors','create_poll',pollargs);var resflag=false;$ .ajaxSetup({async:false});$.ajax({type:'POST',url:uri,data:{'data[pollargs]':pol largs},success:function(data){if(data.result=="success"){resflag=true;} else{showJSMessage(data.message);resflag=false;}},dataType:'json'});$.ajaxSetup( {async:true});return resflag;} function todo_polls(pollargs){if(pollargs==null||!pollargs||typeof(pollargs)=="u ndefined"){return false;} if(ajax_create_poll(pollargs)){var uri=toURL(BH.SITE_BASE,'Vendors','polls');var sumbitSuccess=function(){} ajaxEditDialog("Poll My Friends",uri,sumbitSuccess);}} function todo_poll_connect(pollargs){if(typeof(pollargs)=="undefined"||pollargs= =""||pollargs==null){alert("Missing Poll creation argument list.");return false; } if(ajax_create_poll(pollargs)){var uri=toURL(BH.SITE_BASE,'Vendors','poll_connec t',pollargs);var sumbitSuccess=function(){} ajaxEditDialog("Poll My Friends",uri,sumbitSuccess);}} function todo_edit(id,callback){var uri=toURL(BH.SITE_BASE,'Tasks','edit',id,fal se,false);var sumbitSuccess=function(responseText){$todoTr=$("#todo_"+id);$todoT r.remove();$table=$("input",$todoTr).attr("checked")?$(BH.finishedTasks.table):$

(BH.unfinishedTasks.table);$table.addSoretedRow(responseText);if(typeof callback =='function'){callback();}};ajaxEditDialog("Edit Task",uri,sumbitSuccess);} function todo_chart(filter,callback){filter=getFilter(filter);var uri=toURL(BH.S ITE_BASE,'Tasks','chart',filter.event,filter.section,filter.role,filter.date);aj axEditDialog("Task Chart",uri,callback);} function payment_chart(filter,callback){filter=getFilter(filter);var uri=toURL(B H.SITE_BASE,'Payments','chart',filter.event,filter.section,filter.role,filter.da te);ajaxEditDialog("Payment Chart",uri,callback);} function getFilter(filter){if(!filter){filter={};};eventDefault=$("#EventFilter" ).val();sectionDefault=$("#SectionFilter").val();roleDefault=$("#RolesFilter").v al();dateDefault=$("#DateFilter").val();filter.event=filter.event?filter.event:( eventDefault?eventDefault:"false");filter.section=filter.section?filter.section: (sectionDefault?sectionDefault:"false");filter.role=filter.role?filter.role:(rol eDefault?roleDefault:"false");filter.date=filter.date?filter.date:(dateDefault?d ateDefault:"false");return filter;} function todo_delete(txt,url,node,callback){ajaxDeleteRow(txt,url,node,{callback :callback});} function todo_toggle(dbID,callback) {isChecked=$("#todo_"+dbID+" input:checked").length==1;method=isChecked?'done':' undo';$updateTbody=isChecked?$(BH.finishedTasks.tbody):$(BH.unfinishedTasks.tbod y);$updateTable=isChecked?$(BH.finishedTasks.table):$(BH.unfinishedTasks.table); $.ajax({url:BH.SITE_BASE+'tasks/'+method+'/'+dbID,success:function(responseText) {$('#todo_'+dbID).fadeOut('slow',function(){$(this).remove()});$('tr.lastRowAdde d',$updateTable).removeClass('lastRowAdded');$updateTbody.append(responseText);$ (BH.finishedTasks.table).trigger("resort");$(BH.unfinishedTasks.table).trigger(" resort");$('tr.lastRowAdded',$updateTable).pulse(750);if(typeof callback=='funct ion'){callback();}}});} function calendarEdit(calendarEventID,callback){var uri=toURL(BH.SITE_BASE,'Cale ndarEvents','edit',calendarEventID);ajaxEditDialog("Edit Appointment",uri,callba ck);} function calendarAdd(budgetItemCandidateID,callback,eventdate){if(eventdate==nul l||eventdate==''||typeof(eventdate)=="undefined"){eventdate='';} var uri=toURL(BH.SITE_BASE,'CalendarEvents','add',budgetItemCandidateID,eventdat e);ajaxEditDialog("Add Appointment",uri,callback);} function paymentsAdd(callback,eventdate){if(eventdate==null||eventdate==''||type of(eventdate)=="undefined"){eventdate='null';} var uri=toURL(BH.SITE_BASE,'Payments','choose',eventdate);ajaxEditDialog("Add Pa yments",uri,callback,null,750);} function paymentsEdit(budgetItemCandidateID,callback){var uri=toURL(BH.SITE_BASE ,'Payments','edit',budgetItemCandidateID);ajaxEditDialog("Edit Payments",uri,cal lback,null,750);} function itemDelete(budgetItemCandidateID,callback){var uri=toURL(BH.SITE_BASE,' Items','productUnpurchaseReviewById',budgetItemCandidateID,false);ajaxEditDialog ("Delete Item",uri,callback);} function itemEditById(budgetItemCandidateID,callback){var uri=toURL(BH.SITE_BASE ,'Items','productPurchaseById',budgetItemCandidateID);ajaxEditDialog("Edit Item" ,uri,callback);} function taskTip(node){return;eval("d = "+$("var",node).html());console.debug(d) ;html="<table class='moduleTip'>";html+="<tr><td class='h'>Event:</td>"+d.Event. name+"</td></tr>";html+="<tr><td class='h'>Section:</td>"+d.EventSection.name+"< /td></tr>";if(d.Role.name){html+="<tr><td class='h'>Who:</td>"+d.Role.name+"</td ></tr>";} if(d.BudgetItemCandidate&&d.BudgetItemCandidate.Vendor.name){html+="<tr><td clas s='h'>Vendor:</td>"+d.BudgetItemCandidate.Vendor.name+"</td></tr>";} html+="</table>";toolTip(node,html,300);}

$(function(){try{$('#activeEvent').val(BH.ACTIVE_EVENT_ID).change(eventDropdownC hange).selectmenu({style:'dropdown'});}catch(e){} if(BH.IS_DIALOG&&top==window){top.location=BH.SITE_BASE+"Events";};initCatfish() ;if($("#filterBar").length){$('#EventFilter').val(BH.ACTIVE_EVENT_ID);$('#filter Bar select').selectmenu({style:'dropdown'}).change(filter);$('#filterBar').show( );$(window).load(function(){filter();});}});function initCatfish(){$catfish=$("# catfish");if($catfish.length!=1){return false;} $catfish.wrapInner('<div class="row totals" />');$catfish.wrapInner('<div class= "inside"/>');$catfish.prepend('<div class="header"><div class="left"/><div class ="right"/></div>');$catfish.addClass('catfish');$(window).resize(stickCatfish);s tickCatfish();} function stickCatfish(){$("div#catfish").toggleClass('fixed',($(window).height() <$(document).height()));} function lightNav(topNavID,subNavID){$("#nav_"+topNavID).addClass("active");if($ ("#nav_"+topNavID).parent().hasClass("mainNav")){$("#nav_"+topNavID).parent().ad dClass("active");} $("#subnav_"+subNavID).addClass("active");} var d=new Date();var curr_year=d.getFullYear();$.datepicker.setDefaults({showAni m:'slideDown',gotoCurrent:true,changeMonth:true,changeYear:true,showButtonPanel: false,yearRange:curr_year+':'+(curr_year+10)});allDatePickers=new Array();functi on datePickerInit(fieldId,forceValue,overlay){$textField=$('#'+fieldId);$calenda r=overlay?$textField:$('#cal'+fieldId);if(forceValue.length){$textField.val(forc eValue);} $textField.keyup(function(){if($(this).val().length==10){allDatePickers[fieldId] .datepicker('setDate',new Date($(this).val()));}});$calendar.datepicker({altFiel d:'#'+fieldId,defaultDate:new Date($textField.val()),constrainInput:false});allD atePickers[fieldId]=$calendar;} var bh_ajaxing=false;$(document).ajaxStop(function(){bh_ajaxing=false;});$(docum ent).ajaxStart(function(){bh_ajaxing=true;});function allAjaxComplete(){return!b h_ajaxing;} function ajaxInProgress(){return bh_ajaxing;} var lastRequest=new Date();$(document.body).ajaxSend(function(){var thisRequest= new Date();var difference=lastRequest.getTime()-thisRequest.getTime();if(Math.ab s(difference/1000/60)>20){document.location.href=BH.SITE_BASE+"index.php/users/l ogin";}});function eventDropdownChange(){selectedEventID=$('#activeEvent').val() ;if(selectedEventID>0){location.href=toURL(BH.SITE_BASE,'Events','dashboard',sel ectedEventID,1,1);}else{location.href=toURL(BH.SITE_BASE,'Events','index',0);}} function resetfilter(from){$("#EventFilter").val("");$("#SectionFilter").val("") ;$("#DateFilter").val("");$("#RolesFilter").val("").change();$("#EventFilter").n ext("a").find("span").html("All Events");$("#SectionFilter").next("a").find("spa n").html("All Sections");$("#DateFilter").next("a").find("span").html("All Dates ");$("#RolesFilter").next("a").find("span").html("Everybody");if(from!=undefined ){if(from=='vendor'||from=='items'){$("#BudgetFilter").val("");$("#BudgetFilter" ).next("div").find("a").find("span").html("Vendors I need");$("#EventFilter").ne xt("div").find("a").find("span").html("All Events");$("#SectionFilter").next("di v").find("a").find("span").html("All Sections");$("#DateFilter").next("div").fin d("a").find("span").html("All Dates");$("#RolesFilter").next("div").find("a").fi nd("span").html("Everybody");}} $("#RolesFilter").change();if(typeof filterCompleted=='function'){filterComplete d();}else if(typeof filterVendor=='function'){filterVendor(false);} else if(typeof filterItem=='function'){filterItem();}} function resetfilterAll(){$("#SearchFilter").val("");$("#filterBar select").val( "").each(function(){selectedText=$("option:selected",this).text();$(this).closes t("div").find("span").html(selectedText);});filter();} function deleyFilter(){if(window.deleyFilterTimer)window.clearTimeout(window.del eyFilterTimer);window.deleyFilterTimer=window.setTimeout(filter,500);} function isEmpty(v){return!v||v==="";} function filterClearCache(){$("table.tablesorter tbody tr").each(function(){$(th

is).data('filter',false);});} function filter(lazyload){document.body.style.cursor="wait";eventFilter=$("#Even tFilter").val();sectionFilter=$("#SectionFilter").val();dateFilter=$("#DateFilte r").val();roleFilter=$("#RolesFilter").val();relatedToFilter=$("#RelatedToFilter ").val();categoryFilter=$("#CategoryFilter").val();searchFilter=$("#SearchFilter ").val();searchFilter=searchFilter?searchFilter.toUpperCase().trim():"";typeFilt er=$("#TypeFilter").val();$("#filterBar select").each(function(){$selectMenu=$(t his).parent("div").find(".ui-selectmenu-status");$selectMenu.removeClass("filter ing");if($(this).val().length>0){$selectMenu.addClass("filtering");}});$defaultF ilter=isEmpty(eventFilter)&&isEmpty(sectionFilter)&&isEmpty(dateFilter)&&isEmpty (roleFilter)&&isEmpty(categoryFilter)&&isEmpty(searchFilter)&&isEmpty(typeFilter );if(lazyload===true&&$defaultFilter){$("#filterBarReset").hide();document.body. style.cursor="auto";return true;} hidden=show=rows=0;$("table.tablesorter tbody tr").each(function(){rows++ cache=$(this).data('filter');if($.isEmptyObject(cache)){cache={relatedVal:$("td. related",this).text().trim(),categoryVal:$("td.category",this).text().trim(),typ eVal:$("span.filterData",this).text(),searchVal:$(this).text().toUpperCase().rep lace(/\s/g,'')} $(this).data('filter',cache);} eventMatch=!eventFilter||eventFilter===""||$(this).is(".bh_e"+eventFilter);secti onMatch=!sectionFilter||sectionFilter===""||$(this).is(".bh_s"+sectionFilter);da teMatch=!dateFilter||dateFilter===""||$(this).is(".bh_d"+dateFilter);roleMatch=! roleFilter||roleFilter===""||$(this).is(".bh_r"+roleFilter);relatedMatch=!relate dToFilter||relatedToFilter===""||cache.relatedVal==relatedToFilter;categoryMatch =!categoryFilter||categoryFilter===""||cache.categoryVal==categoryFilter;typeMat ch=!typeFilter||typeFilter===""||cache.typeVal.indexOf(typeFilter)>=0;searchMatc h=!searchFilter||searchFilter===""||cache.searchVal.indexOf(searchFilter)>=0;if( eventMatch&&sectionMatch&&dateMatch&&roleMatch&&relatedMatch&&categoryMatch&&typ eMatch&&searchMatch){$(this).show();show++}else{$(this).hide();hidden++}});$("#f ilterBarReset").show();if(hidden==0){text="";$("#filterBarReset").hide();}else i f(hidden==0){text="1 row hidden";}else if(show==0){text="No matches";} else{text=hidden+" hidden";} $("#filterBarCount").html(text);$("table.tablesorter").add("#letterList").add("# catfish").toggle(show!=0);if($("table.tablesorter").length){$("#defaultFilterEmp ty").toggle(show==0&&rows==0);$(".filterNoMatchTemp").remove() $("table.tablesorter").each(function(i){if(!$(this).is(':visible')||$("tbody tr: visible",this).length==0){$(this).after($("#filterNoMatch").clone().removeAttr(" id").addClass("filterNoMatchTemp").show())}})} $("table").trigger("applyWidgets");stickCatfish();if($('#activeEvent').val()==ev entFilter){$("td.event, th.event").hide();}else{$("td.event, th.event").show();} document.body.style.cursor="auto";if(typeof filterCompleted=='function'){filterC ompleted();}} function autoCompleteCityZip(scope) {scope=scope==null?$("body"):$(scope);$(".autoCity",scope).autocomplete(BH.SITE_ BASE+'autocompletes/cityNames',{minChars:4,matchSubset:1,matchContains:1,cacheLe ngth:10,selectOnly:1,maxItemsToShow:10,onItemSelect:function(li) {if(li.extra) {$('.autoState',scope).val(li.extra[0]);if($(".autoZip",scope).val()<5){$('.auto Zip',scope).val(li.extra[1]);} if(li.extra[1].length<5){$('.autoZip',scope).focus();if(li.extra[1].length>2){$( ".autoZip",scope)[0].autocompleter.onChange();}}}},formatItem:function(row) {if(!row[0]){return"ERROR";} return row[0]+", "+row[1];}});$(".autoZip",scope).autocomplete(BH.SITE_BASE+'aut ocompletes/zips',{minChars:2,matchSubset:1,matchContains:1,cacheLength:10,select Only:1,maxItemsToShow:10,extraParams:{jq:'.autoState',jq1:'.autoCity'}});} function cakeDataToHtmlId(data){if(data.indexOf("data")<0){return data;} modelField=data.replace("data","");modelField=modelField.replace(/\[/g,"");mf=mo delField.split("]");return mf[0].camelize()+mf[1].camelize();} function getData(name,uniquieID) {$.meta.setType("elem","var");return $("#data"+name+uniquieID).data();}

function getSiblingData(id) {var $parent=$(id).parent();$.meta.setType("elem","var");return $("s",$parent).d ata();} function toURL() {var str="";for(i=0;i<arguments.length-1;i++){if(arguments[i]&&arguments[i].toSt ring().lastIndexOf(BH.DS)==arguments[i].length-1){str+=arguments[i];} else{str+=arguments[i]+BH.DS;}} var date=new Date();var noCache=date.getTime();return str+arguments[i]+BH.DS+"?" +noCache;} function reloadPage(){window.location.href=toURL(window.location.href.replace("# ",""));} function refreshPage(){document.body.style.cursor="wait";window.location.reload( );};$currentTip=null;function micochartTip(node,txtOrNodeID,from,params){if($cur rentTip&&$currentTip[0]==node){$currentTip.qtip('show');return;} else{hideTip();text=txtOrNodeID;$textNode=$(txtOrNodeID);if(txtOrNodeID[0]=="#") {if(!$textNode.exists()){return false;} text=$textNode.html();} var qTipParams={content:text,show:{delay:250,when:false,ready:true},hide:'unfocu s',position:{my:'top center',at:'bottom center',viewport:$(window)},style:{widge t:true}} var qTipClasses="";if(from&&from=="calendar"){qTipParams.events={visible:functio n(event,api){if(!api.__adujusted){var MaxHeight=250;if($(api.elements.target).of fset().top<=$(this).position().top){$(this).css("top",$(this).position().top-10) ;}else{$(this).css("top",$(this).position().top+10);if($(this).position().top<($ (this).position().top+($(this).height()-MaxHeight))){$(this).css("top",$(this).p osition().top+($(this).height()-MaxHeight));}} $(this).find(".ui-tooltip-content").css("max-height",MaxHeight+"px");$(this).fin d(".ui-tooltip-content").css("overflow-y","auto");if(!$(this).find(".ui-tooltipcontent").closest(".ui-tooltip").hasClass("nonPrintable")){qTipClasses=$(this).f ind(".ui-tooltip-content").closest(".ui-tooltip").attr('class');qTipClasses=qTip Classes+" nonPrintable";$(this).find(".ui-tooltip-content").closest(".ui-tooltip ").attr('class',qTipClasses);} api.__adujusted=true;}}}} else{qTipParams.events={visible:function(event){if(!$(this).find(".ui-tooltip-co ntent").closest(".ui-tooltip").hasClass("nonPrintable")){qTipClasses=$(this).fin d(".ui-tooltip-content").closest(".ui-tooltip").attr('class');qTipClasses=qTipCl asses+" nonPrintable";$(this).find(".ui-tooltip-content").closest(".ui-tooltip") .attr('class',qTipClasses);}}}} $.extend(qTipParams,params);$currentTip=$(node).qtip(qTipParams);}} function calToolTip(event,api){console.log(api,event,$(this).outerWidth(),$(this ).outerHeight())} function toolTip(node,txtOrNodeID,from,params){if(!params){params={hide:{event:' click mouseleave'}}} micochartTip(node,txtOrNodeID,from,params);return;} function hideTip(){if($currentTip){try{$currentTip.qtip("destroy");}catch(e){}} $currentTip=null;} function iframeInit(){$("#webpage").clone().appendTo("body");$("#siteContainer # webpage").remove();} function iframeInProduct(url){$('a.product').qtip("hide");$webpageDropDownHolder =$("#webpageDropdown");$webpageDropDownHolder.html("");$(document).backButton.wa itForClick(unframe);$("#webpage iframe").attr("src",url);$("#container").fadeOut ('slow',function(){scroll(0,0);});$("#webpage").fadeIn('slow');} function iframeIn(url,vendorID){$webpageDropDownHolder=$("#webpageDropdown");$we bpageDropDownHolder.html("");try{$("#vendor_"+vendorID+" select").clone().prepen dTo($webpageDropDownHolder);selectMenu("#webpageDropdown select");}catch(e){} $(document).backButton.waitForClick(unframe);$("#webpage iframe").attr("src","ht tp://"+url);$("#container").fadeOut('slow',function(){scroll(0,0);$("#webpage"). fadeIn('slow');});} function iframeInDetail(url){if(url==''||typeof(url)=="undefined"){return false; }

$webpageDropDownHolder=$("#webpageDropdown");$webpageDropDownHolder.html("");$(d ocument).backButton.waitForClick(unframe);$("body").addClass("bgWebpage");$("#we bpage iframe").attr("src",url);$("#siteContainer").fadeOut('slow',function(){scr oll(0,0);$("#webpage").fadeIn('slow');});} function unframe(){$(document).backButton.clearWait();$("#webpage").fadeOut('slo w',function(){scroll(0,0);$("#siteContainer").fadeIn('slow');$("#webpage iframe" ).attr("src",BH.BLANK_PAGE);$("body").removeClass("bgWebpage");});} function defaultTextClear(form){$("input.defaultTextActive",form).each(function( ){defaultTextFocus(this);});} function defaultTextFocus(field){$field=$(field);if($field.val()==$field[0].titl e){$field.css("color","");$field.val("");}} function defaultTextBlur(field){$field=$(field);if($field.val()==""||$field.val( )==$field[0].title){$field.css("color","#888");$field.val($field[0].title);}} function showJSMessage(strmsg){if(strmsg==''||strmsg==null||typeof(strmsg)=="und efined"){return false;} var msgHtml='';msgHtml='<div class="pageError ui-corner-all ui-state-error">';ms gHtml+='<div class="pageErrorLine firstChild">';msgHtml+=' <span class="pageErro rIcon ui-icon ui-icon-alert"></span>';msgHtml+='<span class="msg">'+strmsg+'</sp an>';msgHtml+='</div></div>';$("#mainBody").find(".pageMessageHolderDiv").find(" #pageMessages").html(msgHtml);setTimeout(function(){$("#mainBody").find(".pageMe ssageHolderDiv").find("#pageMessages").find(".pageError").fadeTo('slow').animate ({opacity:0.0},2000);},4000);setTimeout(function(){$("#mainBody").find(".pageMes sageHolderDiv").find("#pageMessages").find(".pageError").remove();},7000);} function autocompleteInProgress(){return $(".ui-autocomplete:visible").length>0} function setMaxHeight(){var maxHeight=0;var curHeight=0;if($("#itemList").find(" ul.products").length>0){maxHeight=Math.ceil($("#itemList").find("ul.products").f ind("li:first").height());$("#itemList").find("ul.products").find("li").each(fun ction(){curHeight=Math.ceil($(this).height());if(curHeight>=maxHeight){maxHeight =curHeight;}});$("#itemList").find("ul.products").find("li").each(function(){$(t his).css('min-height',maxHeight);});}}

var activeDialog;function ajaxDeleteRow(text,url,node,attribs) {if(!attribs){attribs={};} attribs.header=attribs.header||"Are You sure?";$("#confirmDeleteDialog").remove( );var html='<div id="confirmDeleteDialog" title="'+attribs.header+'">';html+='<s pan class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></spa n>';html+='<span class="dialogText" style="no-wrap">'+text+'</span>';html+='</di v>';$("body").append(html);$("#confirmDeleteDialog").dialog({draggable:false,mod al:true,resizable:false,width:500,buttons:{Yes:function(){$.get(url,function(){$ tableSorter=$(node).parents(".tablesorter");$(node).fadeOut("slow",function(){$( this).remove();$tableSorter.trigger("resort");filterChangeCount=0;filter();if(ty peof attribs.callback=='function'){attribs.callback();}});});$(this).dialog('clo se');},No:function(){$(this).dialog('close');}}});} jQuery.fn.addSoretedRow=function(rowHTML){if(this.is('.tablesorter')){$(this).sh ow() $("tr",this).addClass("oldrow");$(this).append(rowHTML).trigger("resort");$("tr. letterBarRow",this).addClass("oldrow");filter();$newrow=$("tr:not(.oldrow):visib le",this);if($newrow.length>0){$.scrollTo($newrow);setTimeout(function(){$newrow .effect("highlight",{},6000)},500);}else{txt="Would you like to rest the filter so you can see it?";confirmAction(txt,resetfilterAll,false,{'title':'Save succes sful but hidden by your current filter settings'});}} return this;};function initAjaxEditDialog(width){width=!width?500:width;$("#ajax EditDialog").dialog({draggable:false,modal:true,resizable:false,width:width,posi tion:["center",20],autoOpen:false});}

function setDialogTitle(title){document.dialogTitle=title;} function getLoaderBarContent(what){if(!what)what='';return'<div id="ajaxEditDial ogLoaderBar">Loading '+what+'<img style="margin-left:15px" src="'+BH.AJAX_LOADER _BAR+'" align="bottom"></div>';} function setDialogLoadingTitle(){title=getLoaderBarContent();window.parent.$("sp an.ui-dialog-title").html(title);} function ajaxEditDialogWidth(width) {$("#ajaxEditDialog").dialog('option','width',width);} function ajaxEditDialog(title,url,sumbitSuccessCallback,cancelCallback,width) {$dialog=$("#ajaxEditDialog");$ajaxIframe=$("#ajaxIframe");var dialogWidth=width ?width:540;if($dialog.data('created')!=true){initAjaxEditDialog(dialogWidth-20); $dialog.data('created',true);} hideTip();ajaxEditDialogWidth(dialogWidth);$dialog.data('sumbitSuccess',sumbitSu ccessCallback);$dialog.data('cancelCallback',cancelCallback);var dialogTitle=(ti tle===""?"Edit":title);dialogWidth=$dialog.dialog('option','width');$ajaxIframe. unbind('load').attr("src",url).width(dialogWidth-20).show().height(0).css("posit ion","absolute").css("left","-5000px").load(function(event){var $theFrame=$(this );dialogTitle=this.contentWindow.document.dialogTitle?this.contentWindow.documen t.dialogTitle:dialogTitle;$dialog.dialog('option','title',dialogTitle);$theFrame .height($(this.contentWindow.document).height());$theFrame.hide().css("position" ,"relative").css("left","0").fadeIn();});title=getLoaderBarContent();$dialog.dia log('option','title',title);$dialog.dialog('open');} function ajaxEditDialogCancel() {$ajaxEditDialog=parent.$("#ajaxEditDialog");$ajaxEditDialog.dialog('close');can celCallback=$ajaxEditDialog.data('cancelCallback');if(typeof cancelCallback=='fu nction'){cancelCallback();}} function ajaxConfirmUrl(text,url,ajaxComplete,yesClick) {confirmUrl(text,url,true,ajaxComplete,yesClick);} function confirmUrl(text,url,ajax,ajaxComplete,yesClick,noClick) {$("#confirmDialog").remove();html='<div id="confirmDialog" title="Are your sure ?">';html+='<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>';html+='<span class="dialogText" style="no-wrap">'+text+'</span >';html+='</div>';$("body").append(html);$("#confirmDialog").dialog({draggable:f alse,modal:true,resizable:false,width:400,buttons:{Yes:function(){if(ajax){$.get (url,ajaxComplete);} else{document.location.href=url;$("body").css("cursor","wait");} if(yesClick){yesClick();} $(this).dialog('close');},No:function(){$(this).dialog('close');if(noClick){noCl ick();}}}});} function confirmAction(text,yesClick,noClick,options,is_shared) {if(!is_shared){is_shared=0;} if(!options){options={};} $("#confirmDialog").remove();title=!options.title?'Are your sure?':options.title ;html='<div id="confirmDialog" title="'+title+'">';html+='<div>';html+='<span cl ass="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>';ht ml+='<span class="dialogText" style="no-wrap">'+text+'</span>';html+='</div>';if (is_shared){html+='<br/>';html+='<div id="confirmSharedbox">';html+='<p>Share th is on: ';html+=' <input type="checkbox" class="fbcheckbox styled" checked="check ed" />';html+='&nbsp;&nbsp;';html+='<input type="checkbox" class="twcheckbox sty led" onclick="if(this.checked) chkTWLoginSession();" />';html+='</p></div>';} html+='</div>';$("body").append(html);if(typeof Custom!='undefined'){Custom.init ('TW');Custom.init('FB');} buttonClicked=false;$("#confirmDialog").dialog({draggable:false,modal:true,resiz able:false,width:options.width?options.width:400,close:function(){if(noClick&&!b uttonClicked){noClick();}},buttons:{Yes:function(){if(yesClick){yesClick();} buttonClicked=true;$(this).dialog('close');},No:function(){$(this).dialog('close ');buttonClicked=true;if(noClick){noClick();}}}});} function showError(text,title){title=!title?'Are your sure?':title;$("#confirmDi alog").remove();html='<div id="confirmDialog" title="'+title+'">';html+='<span c lass="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>';h

tml+='<span class="dialogText" style="no-wrap">'+text+'</span>';html+='</div>';$ ("body").append(html);$("#confirmDialog").dialog({draggable:false,modal:true,res izable:false,width:400,buttons:{Ok:function(){$(this).dialog('close');}}});} function dialogIsOpen(){return $("div.ui-dialog:visible").length>0;} function getWindowDimensions(doc,win){var winW=0,winH=0;if(doc.body&&doc.body.of fsetWidth){console.log('in 1');winW=doc.body.offsetWidth;winH=doc.body.offsetHei ght;} if(doc.compatMode=='CSS1Compat'&&doc.documentElement&&doc.documentElement.offset Width){console.log('in 2');winW=doc.documentElement.offsetWidth;winH=doc.documen tElement.offsetHeight;} if(win.innerWidth&&win.innerHeight){console.log('in 3');winW=win.innerWidth;winH =win.innerHeight;} return{'height':winH,'width':winW};}

;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defa ults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){ return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(func tion(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','# document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document ||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body: e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j= 0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaul ts,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2; b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){ var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':c ase'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this); case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),functi on(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max( q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('ma rgin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;i f(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o. slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0 ?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}}); t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b) })}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(! d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ow nerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Ma th.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(j Query);

También podría gustarte