").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane);this._createButtons();},_createButtons:function(){var that=this,buttons=this.options.buttons;this.uiDialogButtonPane.remove();this.uiButtonSet.empty();if($.isEmptyObject(buttons)||($.isArray(buttons)&&!buttons.length)){this.uiDialog.removeClass("ui-dialog-buttons");return;}$.each(buttons,function(name,props){if(props===false){return;}var click,buttonOptions;props=$.isFunction(props)?{click:props,text:name}:props;props=$.extend({type:"button"},props);click=props.click;props.click=function(e){click.apply(that.element[0],[e,that]);};buttonOptions={icons:props.icons,text:props.showText};delete props.icons;delete props.showText;$('
').on('click',props.click).button(buttonOptions).appendTo(that.uiButtonSet);});this.uiDialog.addClass("ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog);this.uiButtonSet.children(":first").addClass('active');},_makeDraggable:function(){var that=this,options=this.options;function filteredUi(ui){return{position:ui.position,offset:ui.offset};}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",distance:4,containment:"document",start:function(event,ui){$(this).addClass("ui-dialog-dragging");that._blockFrames();that._trigger("dragStart",event,filteredUi(ui));},drag:function(event,ui){that._trigger("drag",event,filteredUi(ui));},stop:function(event,ui){options.position=[ui.position.left-that.document.scrollLeft(),ui.position.top-that.document.scrollTop()];$(this).removeClass("ui-dialog-dragging");that._unblockFrames();that._trigger("dragStop",event,filteredUi(ui));}});},_makeResizable:function(){var that=this,options=this.options,handles=options.resizable,position=this.uiDialog.css("position"),resizeHandles=typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw";function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size};}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");that._blockFrames();that._trigger("resizeStart",event,filteredUi(ui));},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui));},stop:function(event,ui){options.height=$(this).height();options.width=$(this).width();$(this).removeClass("ui-dialog-resizing");that._unblockFrames();that._trigger("resizeStop",event,filteredUi(ui));}}).css("position",position);},_minHeight:function(){var options=this.options;return options.height==="auto"?options.minHeight:Math.min(options.minHeight,options.height);},_position:function(){var isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show();}this.uiDialog.position(this.options.position);if(!isVisible){this.uiDialog.hide();}},_setOptions:function(options){var that=this,resize=false,resizableOptions={};$.each(options,function(key,value){that._setOption(key,value);if(key in sizeRelatedOptions){resize=true;}if(key in resizableRelatedOptions){resizableOptions[key]=value;}});if(resize){this._size();this._position();}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",resizableOptions);}},_setOption:function(key,value){var isDraggable,isResizable,uiDialog=this.uiDialog;if(key==="dialogClass"){uiDialog.removeClass(this.options.dialogClass).addClass(value);}if(key==="disabled"){return;}$.Widget.prototype._setOption.apply(this,arguments);if(key==="appendTo"){this.uiDialog.appendTo(this._appendTo());}if(key==="buttons"){this._createButtons();}if(key==="closeText"){this.uiDialogTitlebarClose.button({label:""+value});}if(key==="draggable"){isDraggable=uiDialog.is(":data(ui-draggable)");if(isDraggable&&!value){uiDialog.draggable("destroy");}if(!isDraggable&&value){this._makeDraggable();}}if(key==="position"){this._position();}if(key==="resizable"){isResizable=uiDialog.is(":data(ui-resizable)");if(isResizable&&!value){uiDialog.resizable("destroy");}if(isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value);}if(!isResizable&&value!==false){this._makeResizable();}}if(key==="title"){this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));}},_size:function(){var nonContentHeight,minContentHeight,maxContentHeight,options=this.options;this.element.hide().css({width:"auto",minHeight:0,maxHeight:"none",height:0});if(options.minWidth>options.width){options.width=options.minWidth;}nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).outerHeight();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);maxContentHeight=typeof options.maxHeight==="number"?Math.max(0,options.maxHeight-nonContentHeight):"none";this.element.show();if(options.height==="auto"){this.element.css({minHeight:minContentHeight,maxHeight:maxContentHeight,height:"auto"});}else{this.element.height(Math.max(0,options.height-nonContentHeight));}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight());}},_handleKeyDown:function(e){var result=undefined;if(!e.ctrlKey&&!e.shiftKey&&!e.altKey){var el=e&&e.target&&$(e.target);switch(e.which){case $.ui.keyCode.ESC:if(this.options.closeOnEscape){result=this._cancel.apply(this,arguments);}break;case $.ui.keyCode.ENTER:if(el&&!el.is('textarea:not(.noenter)')){if(el.is('input:text,textarea')){var evt=$.Event("keydown");evt.which=e.which;evt.target=e.target;var fn=function(self,_evt){return function(){try{_evt.target.blur();}catch(ex){;}self._handleEnterKey.apply(self,[_evt]);self=null;_evt=null;};}(this,evt);setTimeout(fn,1);}else{result=this._handleEnterKey.apply(this,arguments);}}e.stopPropagation();break;case $.ui.keyCode.LEFT:case $.ui.keyCode.RIGHT:if(el&&this.options.selectOnEnter&&!el.is('input:text,textarea')){var buttons=this.uiDialog.find('div.ui-dialog-buttonpane a.ui-button');var active=buttons.filter('.active');var index=buttons.index(active);var pos=Math.min(Math.max(0,index+(e.which===$.ui.keyCode.RIGHT?1:-1)),buttons.length-1);if(index!=pos){active.removeClass('active');buttons.eq(pos).addClass('active');}e.stopPropagation();}break;}}if(this.options.modal){e.stopImmediatePropagation();}return result;},_handleEnterKey:function(e){if(this.options.saveOnEnter){return this._save.apply(this,arguments);}else if(this.options.selectOnEnter){this.uiDialog.find('div.ui-dialog-buttonpane a.ui-button.active').click();e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();}return false;},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("
").css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(iframe.parent()).offset(iframe.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_allowInteraction:function(event){if($(event.target).closest(".ui-dialog").length){return true;}return!!$(event.target).closest(".ui-datepicker").length;},_createOverlay:function(){if(!this.options.modal){return;}var that=this,widgetFullName=this.widgetFullName;this.overlay=$("
").addClass("ui-widget-overlay2 ui-front").insertBefore(this.uiDialog);if($.isPlainObject(this.options.modal)){this.overlay.css(this.options.modal);}$.ui.dialog.overlayInstances++;},_destroyOverlay:function(){if(!this.options.modal){return;}if(this.overlay){$.ui.dialog.overlayInstances--;if(!$.ui.dialog.overlayInstances){this.document.unbind("focusin.dialog");}this.overlay.remove();this.overlay=null;}}});$.ui.dialog.overlayInstances=0;if($.uiBackCompat!==false){$.widget("ui.dialog",$.ui.dialog,{_position:function(){var position=this.options.position,myAt=[],offset=[0,0],isVisible;if(position){if(typeof position==="string"||(typeof position==="object"&&"0"in position)){myAt=position.split?position.split(" "):[position[0],position[1]];if(myAt.length===1){myAt[1]=myAt[0];}$.each(["left","top"],function(i,offsetPosition){if(+myAt[i]===myAt[i]){offset[i]=myAt[i];myAt[i]=offsetPosition;}});position={my:myAt[0]+(offset[0]<0?offset[0]:"+"+offset[0])+" "+myAt[1]+(offset[1]<0?offset[1]:"+"+offset[1]),at:myAt.join(" ")};}position=$.extend({},$.ui.dialog.prototype.options.position,position);}else{position=$.ui.dialog.prototype.options.position;}isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show();}this.uiDialog.position(position);if(!isVisible){this.uiDialog.hide();}}});}}(jQuery));
(function($,undefined){var dataSpace="ui-effects-";$.effects={effect:{}};(function(jQuery,undefined){var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]];}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1]*2.55,execResult[2]*2.55,execResult[3]*2.55,execResult[4]];}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16)];}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16)];}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,execResult[4]];}}],color=jQuery.Color=function(color,green,blue,alpha){return new jQuery.Color.fn.parse(color,green,blue,alpha);},spaces={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},propTypes={"byte":{floor:true,max:255},"percent":{max:1},"degrees":{mod:360,floor:true}},support=color.support={},supportElem=jQuery("
")[0],colors,each=jQuery.each;supportElem.style.cssText="background-color:rgba(1,1,1,.5)";support.rgba=supportElem.style.backgroundColor.indexOf("rgba")>-1;each(spaces,function(spaceName,space){space.cache="_"+spaceName;space.props.alpha={idx:3,type:"percent",def:1};});function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};if(value==null){return(allowEmpty||!prop.def)?null:prop.def;}value=type.floor?~~value:parseFloat(value);if(isNaN(value)){return prop.def;}if(type.mod){return(value+type.mod)%type.mod;}return 0>value?0:type.maxtype.mod/2){startValue+=type.mod;}else if(startValue-endValue>type.mod/2){startValue-=type.mod;}}result[index]=clamp((endValue-startValue)*distance+startValue,prop);}});return this[spaceName](result);},blend:function(opaque){if(this._rgba[3]===1){return this;}var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,function(v,i){return(1-a)*blend[i]+a*v;}));},toRgbaString:function(){var prefix="rgba(",rgba=jQuery.map(this._rgba,function(v,i){return v==null?(i>2?1:0):v;});if(rgba[3]===1){rgba.pop();prefix="rgb(";}return prefix+rgba.join()+")";},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){if(v==null){v=i>2?1:0;}if(i&&i<3){v=Math.round(v*100)+"%";}return v;});if(hsla[3]===1){hsla.pop();prefix="hsl(";}return prefix+hsla.join()+")";},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();if(includeAlpha){rgba.push(~~(alpha*255));}return"#"+jQuery.map(rgba,function(v){v=(v||0).toString(16);return v.length===1?"0"+v:v;}).join("");},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString();}});color.fn.parse.prototype=color.fn;function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*((2/3)-h)*6;}return p;}spaces.hsla.to=function(rgba){if(rgba[0]==null||rgba[1]==null||rgba[2]==null){return[null,null,null,rgba[3]];}var r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,a=rgba[3],max=Math.max(r,g,b),min=Math.min(r,g,b),diff=max-min,add=max+min,l=add*0.5,h,s;if(min===max){h=0;}else if(r===max){h=(60*(g-b)/diff)+360;}else if(g===max){h=(60*(b-r)/diff)+120;}else{h=(60*(r-g)/diff)+240;}if(diff===0){s=0;}else if(l<=0.5){s=diff/add;}else{s=diff/(2-add);}return[Math.round(h)%360,s,l,a==null?1:a];};spaces.hsla.from=function(hsla){if(hsla[0]==null||hsla[1]==null||hsla[2]==null){return[null,null,null,hsla[3]];}var h=hsla[0]/360,s=hsla[1],l=hsla[2],a=hsla[3],q=l<=0.5?l*(1+s):l+s-l*s,p=2*l-q;return[Math.round(hue2rgb(p,q,h+(1/3))*255),Math.round(hue2rgb(p,q,h)*255),Math.round(hue2rgb(p,q,h-(1/3))*255),a];};each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]){this[cache]=to(this._rgba);}if(value===undefined){return this[cache].slice();}var ret,type=jQuery.type(value),arr=(type==="array"||type==="object")?value:arguments,local=this[cache].slice();each(props,function(key,prop){var val=arr[type==="object"?key:prop.idx];if(val==null){val=local[prop.idx];}local[prop.idx]=clamp(val,prop);});if(from){ret=color(from(local));ret[cache]=local;return ret;}else{return color(local);}};each(props,function(key,prop){if(color.fn[key]){return;}color.fn[key]=function(value){var vtype=jQuery.type(value),fn=(key==="alpha"?(this._hsla?"hsla":"rgba"):spaceName),local=this[fn](),cur=local[prop.idx],match;if(vtype==="undefined"){return cur;}if(vtype==="function"){value=value.call(this,cur);vtype=jQuery.type(value);}if(value==null&&prop.empty){return this;}if(vtype==="string"){match=rplusequals.exec(value);if(match){value=cur+parseFloat(match[2])*(match[1]==="+"?1:-1);}}local[prop.idx]=value;return this[fn](local);};});});color.hook=function(hook){var hooks=hook.split(" ");each(hooks,function(i,hook){jQuery.cssHooks[hook]={set:function(elem,value){var parsed,curElem,backgroundColor="";if(value!=="transparent"&&(jQuery.type(value)!=="string"||(parsed=stringParse(value)))){value=color(parsed||value);if(!support.rgba&&value._rgba[3]!==1){curElem=hook==="backgroundColor"?elem.parentNode:elem;while((backgroundColor===""||backgroundColor==="transparent")&&curElem&&curElem.style){try{backgroundColor=jQuery.css(curElem,"backgroundColor");curElem=curElem.parentNode;}catch(e){}}value=value.blend(backgroundColor&&backgroundColor!=="transparent"?backgroundColor:"_default");}value=value.toRgbaString();}try{elem.style[hook]=value;}catch(e){}}};jQuery.fx.step[hook]=function(fx){if(!fx.colorInit){fx.start=color(fx.elem,hook);fx.end=color(fx.end);fx.colorInit=true;}jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos));};});};color.hook(stepHooks);jQuery.cssHooks.borderColor={expand:function(value){var expanded={};each(["Top","Right","Bottom","Left"],function(i,part){expanded["border"+part+"Color"]=value;});return expanded;}};colors=jQuery.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"};})(jQuery);(function(){var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop){$.fx.step[prop]=function(fx){if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){jQuery.style(fx.elem,prop,fx.end);fx.setAttr=true;}};});function getElementStyles(elem){var key,len,style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]]){len=style.length;while(len--){key=style[len];if(typeof style[key]==="string"){styles[$.camelCase(key)]=style[key];}}}else{for(key in style){if(typeof style[key]==="string"){styles[key]=style[key];}}}return styles;}function styleDifference(oldStyle,newStyle){var diff={},name,value;for(name in newStyle){value=newStyle[name];if(oldStyle[name]!==value){if(!shorthandStyles[name]){if($.fx.step[name]||!isNaN(parseFloat(value))){diff[name]=value;}}}}return diff;}if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};}$.effects.animateClass=function(value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(){var animated=$(this),baseClass=animated.attr("class")||"",applyClassChange,allAnimations=o.children?animated.find("*").addBack():animated;allAnimations=allAnimations.map(function(){var el=$(this);return{el:el,start:getElementStyles(this)};});applyClassChange=function(){$.each(classAnimationActions,function(i,action){if(value[action]){animated[action+"Class"](value[action]);}});};applyClassChange();allAnimations=allAnimations.map(function(){this.end=getElementStyles(this.el[0]);this.diff=styleDifference(this.start,this.end);return this;});animated.attr("class",baseClass);allAnimations=allAnimations.map(function(){var styleInfo=this,dfd=$.Deferred(),opts=$.extend({},o,{queue:false,complete:function(){dfd.resolve(styleInfo);}});this.el.animate(this.diff,opts);return dfd.promise();});$.when.apply($,allAnimations.get()).done(function(){applyClassChange();$.each(arguments,function(){var el=this.el;$.each(this.diff,function(key){el.css(key,"");});});o.complete.call(animated[0]);});});};$.fn.extend({addClass:(function(orig){return function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{add:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.addClass),removeClass:(function(orig){return function(classNames,speed,easing,callback){return arguments.length>1?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback):orig.apply(this,arguments);};})($.fn.removeClass),toggleClass:(function(orig){return function(classNames,force,speed,easing,callback){if(typeof force==="boolean"||force===undefined){if(!speed){return orig.apply(this,arguments);}else{return $.effects.animateClass.call(this,(force?{add:classNames}:{remove:classNames}),speed,easing,callback);}}else{return $.effects.animateClass.call(this,{toggle:classNames},force,speed,easing);}};})($.fn.toggleClass),switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,callback);}});})();(function(){$.extend($.effects,{version:"1.10.3",save:function(element,set){for(var i=0;i
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id;}catch(e){active=document.body;}element.wrap(wrapper);if(element[0]===active||$.contains(element[0],active)){$(active).focus();}wrapper=element.parent();if(element.css("position")==="static"){wrapper.css({position:"relative"});element.css({position:"relative"});}else{$.extend(props,{position:element.css("position"),zIndex:element.css("z-index")});$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos);if(isNaN(parseInt(props[pos],10))){props[pos]="auto";}});element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"});}element.css(size);return wrapper.css(props).show();},removeWrapper:function(element){var active=document.activeElement;if(element.parent().is(".ui-effects-wrapper")){element.parent().replaceWith(element);if(element[0]===active||$.contains(element[0],active)){$(active).focus();}}return element;},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){var unit=element.cssUnit(x);if(unit[0]>0){value[x]=unit[0]*factor+unit[1];}});return value;}});function _normalizeArguments(effect,options,speed,callback){if($.isPlainObject(effect)){options=effect;effect=effect.effect;}effect={effect:effect};if(options==null){options={};}if($.isFunction(options)){callback=options;speed=null;options={};}if(typeof options==="number"||$.fx.speeds[options]){callback=speed;speed=options;options={};}if($.isFunction(speed)){callback=speed;speed=null;}if(options){$.extend(effect,options);}speed=speed||options.duration;effect.duration=$.fx.off?0:typeof speed==="number"?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect;}function standardAnimationOption(option){if(!option||typeof option==="number"||$.fx.speeds[option]){return true;}if(typeof option==="string"&&!$.effects.effect[option]){return true;}if($.isFunction(option)){return true;}if(typeof option==="object"&&!option.effect){return true;}return false;}$.fn.extend({effect:function(){var args=_normalizeArguments.apply(this,arguments),mode=args.mode,queue=args.queue,effectMethod=$.effects.effect[args.effect];if($.fx.off||!effectMethod){if(mode){return this[mode](args.duration,args.complete);}else{return this.each(function(){if(args.complete){args.complete.call(this);}});}}function run(next){var elem=$(this),complete=args.complete,mode=args.mode;function done(){if($.isFunction(complete)){complete.call(elem[0]);}if($.isFunction(next)){next();}}if(elem.is(":hidden")?mode==="hide":mode==="show"){elem[mode]();done();}else{effectMethod.call(elem[0],args,done);}}return queue===false?this.each(run):this.queue(queue||"fx",run);},show:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="show";return this.effect.call(this,args);}};})($.fn.show),hide:(function(orig){return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="hide";return this.effect.call(this,args);}};})($.fn.hide),toggle:(function(orig){return function(option){if(standardAnimationOption(option)||typeof option==="boolean"){return orig.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args.mode="toggle";return this.effect.call(this,args);}};})($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];$.each(["em","px","%","pt"],function(i,unit){if(style.indexOf(unit)>0){val=[parseFloat(style),unit];}});return val;}});})();(function(){var baseEasings={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,name){baseEasings[name]=function(p){return Math.pow(p,i+2);};});$.extend(baseEasings,{Sine:function(p){return 1-Math.cos(p*Math.PI/2);},Circ:function(p){return 1-Math.sqrt(1-p*p);},Elastic:function(p){return p===0||p===1?p:-Math.pow(2,8*(p-1))*Math.sin(((p-1)*80-7.5)*Math.PI/15);},Back:function(p){return p*p*(3*p-2);},Bounce:function(p){var pow2,bounce=4;while(p<((pow2=Math.pow(2,--bounce))-1)/11){}return 1/ Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) /22-p,2);}});$.each(baseEasings,function(name,easeIn){$.easing["easeIn"+name]=easeIn;$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p);};$.easing["easeInOut"+name]=function(p){return p<0.5?easeIn(p*2)/2:1-easeIn(p*-2+2)/2;};});})();$.effects.getRGB=function(clr){return $.Color(clr)._rgba.slice(0,3);};$.effects.getRGBA=function(clr){return $.Color(clr)._rgba;};})(jQuery);
jQuery(function($,undefined){function isRGBACapable(){var $script=$('script:first'),color=$script.css('color'),result=false;if(/^rgba/.test(color)){result=true;}else{try{result=(color!=$script.css('color','rgba(0, 0, 0, 0.5)').css('color'));$script.css('color',color);}catch(e){}}return result;}$.extend(true,$,{support:{'rgba':isRGBACapable()}});var styles=$('html').prop('style');var boxShadowProperty;$.each(['boxShadow','MozBoxShadow','WebkitBoxShadow'],function(i,property){var val=styles[property];if(typeof val!=='undefined'){boxShadowProperty=property;return false;}});if(boxShadowProperty){$.Tween.propHooks['boxShadow']={get:function(tween){return $(tween.elem).css(boxShadowProperty);},set:function(tween){var style=tween.elem.style;var p_begin=parseShadow($(tween.elem).get(0).style[boxShadowProperty]||$(tween.elem).css(boxShadowProperty));var p_end=$.extend({},p_begin,parseShadow(tween.end));if(p_begin.color==undefined){p_begin.color=p_end.color||[0,0,0];}tween.run=function(progress){style[boxShadowProperty]=calculateShadow(p_begin,p_end,progress);}}}}function calculateShadow(begin,end,pos){var parts=[];if(begin.inset){parts.push('inset');}if(typeof end.left!='undefined'){parts.push(parseInt(begin.left+pos*(end.left-begin.left),10)+'px '+parseInt(begin.top+pos*(end.top-begin.top),10)+'px');}if(typeof end.blur!='undefined'){parts.push(parseInt(begin.blur+pos*(end.blur-begin.blur),10)+'px');}if(typeof end.spread!='undefined'){parts.push(parseInt(begin.spread+pos*(end.spread-begin.spread),10)+'px');}if(typeof end.color!='undefined'){var color='rgb'+($.support['rgba']?'a':'')+'('+parseInt((begin.color[0]+pos*(end.color[0]-begin.color[0])),10)+','+parseInt((begin.color[1]+pos*(end.color[1]-begin.color[1])),10)+','+parseInt((begin.color[2]+pos*(end.color[2]-begin.color[2])),10);if($.support['rgba']){color+=','+parseFloat(begin.color[3]+pos*(end.color[3]-begin.color[3]));}color+=')';parts.push(color);}return parts.join(' ');}function parseShadow(shadow){var match,color,parsedShadow={};if(match=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(shadow)){color=[parseInt(match[1],16),parseInt(match[2],16),parseInt(match[3],16),1];}else if(match=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(shadow)){color=[parseInt(match[1],16)*17,parseInt(match[2],16)*17,parseInt(match[3],16)*17,1];}else if(match=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(shadow)){color=[parseInt(match[1],10),parseInt(match[2],10),parseInt(match[3],10),1];}else if(match=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(shadow)){color=[parseInt(match[1],10),parseInt(match[2],10),parseInt(match[3],10),parseFloat(match[4])];}if(match=/(-?[0-9]+)(?:px)?\s+(-?[0-9]+)(?:px)?(?:\s+(-?[0-9]+)(?:px)?)?(?:\s+(-?[0-9]+)(?:px)?)?/.exec(shadow)){parsedShadow={left:parseInt(match[1],10),top:parseInt(match[2],10),blur:match[3]?parseInt(match[3],10):0,spread:match[4]?parseInt(match[4],10):0};}else{parsedShadow={left:0,top:0,blur:0,spread:0};}parsedShadow.inset=/inset/.test(shadow);parsedShadow.color=color;return parsedShadow;}});
(function($){$._DIR={_UPPER_RIGHT:{top:true,left:false},_UPPER_LEFT:{top:true,left:true},_LOWER_RIGHT:{top:false,left:false},_LOWER_LEFT:{top:false,left:true},_CENTER:{center:true}};if(!$.browser){$.uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};};var matched=$.uaMatch(navigator.userAgent);var browser={};if(matched.browser){browser[matched.browser]=true;browser.version=matched.version;}if(browser.chrome){browser.webkit=true;}else if(browser.webkit){browser.safari=true;}jQuery.browser=browser;}$.browser.msie6=$.browser.msie&&/MSIE 6\.0/i.test(window.navigator.userAgent)&&!/MSIE 7\.0/i.test(window.navigator.userAgent);$.browser.msie9=$.browser.msie&&$.browser.version==9;$.onImagesLoaded=function(fn,tolerance){if(!$.isFunction(fn))return;var images=$('img').filter(function(el,i){return!this.complete;});if(images.length>tolerance){window.$loadedImageCount=images.length;window.$imagesLoadedTolerance=$.toInt(tolerance);if(!window.$onImagesLoaded)window.$onImagesLoaded=[];window.$onImagesLoaded.push(fn);images.one('load',$.imageHasLoaded);setTimeout($.fireImagesLoaded,20000);}else fn();};$.imageHasLoaded=function(){if(!window.$onImagesLoaded)return;try{window.$loadedImageCount--;}catch(ex){}if((window.$loadedImageCount||0)<=(window.$imagesLoadedTolerance||0)){$.fireImagesLoaded();}};$.fireImagesLoaded=function(){if(!window.$onImagesLoaded)return;for(var i=0;i
1){var parts=url[1].split('&');for(var i=0;ii?swap[i]:null):swap):this.$self.attr('_overimg');var cls=this.$self.attr('_overclass');if(!img&&!cls){return;}var href=null;var root=null;if($.toBool(this.$self.attr('_sticky'))&&!window._noflash){var base=$(document.body).attr('_base');var top=$.toBool(this.$self.attr('_top'));var link=this.$self.closest('a');if(!link.length){link=this.$self.children('a');}href=(link.attr('href')||"").split('?').shift().toLowerCase();root=window.location.href.substring(base.length).split('?').shift().toLowerCase();if(href){if(href.startsWith(base)){href=href.substring(base.length);}else if(href.startsWith('/')){href=href.substring(1);}}switch(root){case'index.aspx':case'home.aspx':root="";break;}}if(href!=null&&(href==root||(!top&&href&&root.startsWith(href.split('.').shift()+'/')))){if(cls){this.$self.addClass(cls);return;}else{this.$self.attr('src',img);}}else{if(cls){this.$self.hoverClass(cls);}else{this._outimg=this.$self.attr('src');this._overimg=img;this.$self.hover($.overImage,$.outImage);$.preload(img);}}});};$.overImage=function(e){if(this._overimg){$(this).attr('src',this._overimg);}};$.outImage=function(e){if(this._outimg){$(this).attr('src',this._outimg);}};$.biff=[{image:'biff',images:4,buttons:["Marty","Biff"],messages:["That's about as funny as a screen door on a battleship.","Must be rough bein' named after a complete butthead.","Hello? Hello? Anybody home?","I don't know what liquor smells like, cuz I'm too young to drink it.","Noon? I do my killin' before breakfast! Seven o'clock!","I'll hunt you and shoot you down like a duck.","Oh, McFly, your shoe's untied.","What are you looking at butthead?","Manure! I hate manure!"]},{image:'doc',images:4,buttons:["Marty","Biff"],messages:["When this baby hits 88 miles per hour... you're gonna see some serious shit.","Roads? Where we're going, we don't need roads.","Who do you think? The Libyans!","1.21 gigawatts! 1.21 gigawatts. Great Scott!","I finally invent something that works!","Next Saturday night, we're sending you back to the future!","Is there a problem with the Earth's gravitational pull?","One minute into the future to be exact.","Great Scott!"]},{image:'marty',images:4,buttons:["Marty","Biff"],messages:["Are you telling me that you built a time machine... out of a DeLorean?","Are you trying to tell me that my mother has got the hots for me?","Are you telling me that this sucker is nuclear?","Are you telling me that it's 8:25?","What-what the hell is a gigawatt?"]},{image:'short',images:4,buttons:["Marty","Biff"],messages:["Hey, lady! You call him Dr. Jones!","Hang on lady, we going for a ride!","I keep telling you, you listen to me more, you live longer!","Feels like I step on fortune cookie!","I step where you step! I touch nothing!","I'm very little! You cheat very big!","Wow! Holy Smoke! Crash Landing!"]},{image:'chunk',images:4,buttons:["Marty","Biff"],messages:["Everything. OK! I'll talk! In third grade, I cheated on my history exam.","Listen, okay? You guys'll never believe me. There was two cop cars, okay?","Michael Jackson didn't come over to my house to use the bathroom. But his sister did.","Mikey, this ain't the kind of place you want to go to the bathroom in.","Notice that the statue's penis is missing.","Hello, Sheriff's Office? I'd like to report a murder!","I'm not all alone in the dark. I like the dark. I love the dark."]},{image:'five',images:4,buttons:["Marty","Biff"],messages:["With excitement like this, who is needing enemas?","I am standing here beside myself.","Hey, laser lips, your mama was a snow blower.","Number 5 is alive.","Malfunction. Need input.","Number 5 stupid name... want to be Kevin or Dave!","Whatever God wants, he keeps!","Looks like you have created another Frankfurter's monster.","Beautiful stars. Better see!"]}];$.alert=function(title,message,options){if(title&&message===undefined){message=title;title='Alert!';}if(options&&typeof options==='number'){options={width:options};}if(message&&message.indexOf('<')<0&&$.cms.page&&Math.random()<0.05&&$.cms.page.PPM(1)){var biff=$.biff[(Math.round(Math.random()*100000)%$.biff.length)],img=biff.image+((Math.round(Math.random()*100000)%biff.images)+1),msg=biff.messages[(Math.round(Math.random()*100000)%biff.messages.length)];message=["",message,"
",msg,""].join("");if(!options){options={width:350};}else if(!options.width||options.width>350){options.width=350;}if(options.buttons&&options.buttons.Yes&&options.buttons.No){var buttons={};buttons[biff.buttons[0]]=options.buttons.Yes;buttons[biff.buttons[1]]=options.buttons.No;delete options.buttons;options.buttons=buttons;}}var $el=$('').dialog($.extend({title:title||'',closeOnEscape:true,selectOnEnter:true,width:'auto',minHeight:75,modal:true,buttons:{"OK":function(e,widget){widget.close();}},open:function(e,data,widget){widget.uiDialog.find("div.ui-dialog-buttonpane a:first").focus().blur();},cancel:function(e,data,widget){if(options&&$.isFunction(options.oncancel)){return options.oncancel(widget);}},close:function(e,data,widget){if(e&&e.preventDefault){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();}if(options&&$.isFunction(options.onclose)){options.onclose(widget);}$(this).remove();return false;}},options||{}));if(message&&(!options||!options.width)){var box=$el.dialog('widget');var w=300;if(title){var bar=box.children('div.ui-dialog-titlebar');w=0;bar.children().each(function(i){w+=$(this).outerWidth(true);});w+=($.toInt(bar.css('paddingLeft'))+$.toInt(bar.css('paddingRight')));}box.css({width:Math.max(w,300)});}$el.html(message||'');if(options&&options.overflow){$el.css({overflow:'auto'}).captureScroll();}$el.dialog('widget').place({my:'center',at:'center',of:window,collision:'fit',offset:options&&options.offset});return $el;};$.confirm=function(title,message,options,yes,no){options=$.extend({closeText:'',buttons:{}},options||{});options.buttons[yes||"Yes"]=function(e,widget){if($.isFunction(widget.options.onconfirm)){widget.options.onconfirm.apply(widget,[e,true]);}return widget.close(e);};options.buttons[no||"No"]=function(e,widget){if($.isFunction(widget.options.oncancel)){widget.options.oncancel.apply(widget,[e,false]);}return widget.close(e);};return $.alert(title,message,options);};$.fn.handleConfirm=function(yes,no,cls){return this.each(function(i){var link=$(this);var m=/return confirm\(['"](.+?)["']\);?/.exec(""+link.attr('onclick'));var h=/^javascript:(.+)/.exec(link.attr('href'));var message=m&&m[1];var href=h&&h[1];if(message&&href){link.attr('href','javascript:void(0);');link.removeAttr('onclick');link.unbind('click').click(function(e){var fn=function(_href,_action){return function(){if(_action){_action(_href);}else{$(document.body).loading({message:null});eval(_href);}_href=null;_action=null;}}(href,link.data('action'));var m=/new WebForm_PostBackOptions\([^\)]+\)/.exec(href),options=m&&eval(m[0]);if(options&&options.validation&&typeof(Page_ClientValidate)=='function'&&!Page_ClientValidate(options.validationGroup)){eval(href);return false;}$.confirm('CONFIRM',message,{onconfirm:fn,dialogClass:cls},yes,no);e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();return false;});}});};$.getKey=function(e){if(!e){return null;}else if(e===true){return true;}else if(typeof e==="number"){return{which:e,ctrlKey:false,altKey:false,shiftKey:false};}else if(typeof e=="string"){if(e==='ALL'){return true;}var parts=e.split('-');var key=parts.pop();var which=key==='ENTER'?13:$.ui.keyCode[key];if(!which&&key.length==1){switch(key){case"`":case"~":which=192;break;default:which=key.charCodeAt(0);break;}}if(!which)return null;else e={which:which,ctrlKey:false,altKey:false,shiftKey:false};while(key=parts.pop()){switch(key){case'CTRL':e.ctrlKey=true;break;case'ALT':e.altKey=true;break;case'SHIFT':e.shiftKey=true;break;default:return null;}}return e;}else if(e.which){return{which:e.which,ctrlKey:e.ctrlKey?true:false,altKey:e.altKey?true:false,shiftKey:e.shiftKey?true:false};}else{return null;}};$.handleBoundKey=function(e){var handlers=e.data.slice(0);var result=null;for(var j=0;j=0;j--){var item=fn.data[j];if(handler.guid!==item.handler.guid||(key===true&&item.key!==true)||(key!==true&&item.key===true)||key.which!==item.key.which||key.ctrlKey!==item.key.ctrlKey||key.shiftKey!==item.key.shiftKey){continue;}if(j===fn.data.length-1){fn.data.pop();}else if(j===0){fn.data.shift();}else{fn.data.splice(j,1);}}if(fn.data.length===0){this.unbind('keydown.bindkey');}}}}else if(which===undefined){this.unbind('keydown.bindkey');}return this;};$.fn.flipevent=function(event,handler){var name=event.split('.').shift();var guid=handler.guid;return this.each(function(i){var elemData=(jQuery._data||jQuery.data)(this);var events=elemData&&elemData.events;var handlers=events&&events[name];if(handlers&&handlers.length>1&&handlers[handlers.length-1].guid===guid){handlers.unshift(handlers.pop());}});};$.fn.dimensions=function(){if(!this.length)return null;var elem=this[0];var o;if("scrollTo"in elem&&elem.document){var doc=elem.document;o={left:Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),top:Math.max(doc.documentElement.scrollTop,doc.body.scrollTop),width:this.width(),height:elem.innerHeight||this.height()};}else if(elem.body){o={left:0,top:0,width:this.width(),height:this.height()};}else if(elem.nodeName&&elem.nodeName.toLowerCase()==='body'){var doc=elem.ownerDocument;o={left:0,top:0,width:this.width()+$.toInt(this.css('marginLeft'))+$.toInt(this.css('marginRight')),height:Math.max(this.height()+$.toInt(this.css('paddingTop'))+$.toInt(this.css('paddingBottom')),$(doc.defaultView||doc.parentWindow).height())};}else if(elem.nodeName&&elem.nodeName.toLowerCase()==='tr'&&elem.childNodes.length){var first=elem.firstChild;while(first&&first.nodeType!==1&&first.nextSibling){first=first.nextSibling;}if(!first||first.nodeType!==1){var o=$(elem).offset();o.width=elem.offsetWidth||elem.scrollWidth;o.height=elem.offsetHeight||elem.scrollHeight;}else{var last=elem.lastChild;while(last&&last.nodeType!==1&&last.previousSibling){last=last.previousSibling;}if(!last||last.nodeType!==1){last=first;}o=$(first).offset();var left=last.offsetLeft-first.offsetLeft;o.width=left+(last.offsetWidth||last.scrollWidth);o.height=Math.max(first.offsetHeight,last.offsetHeight)||Math.max(first.scrollHeight,last.scrollHeight);}}else{var w,h;if(elem.nodeName.toLowerCase()==='a'&&elem.childNodes.length===1&&elem.childNodes[0].nodeName.toLowerCase()==='img'){o=$(elem.childNodes[0]).offset();w=Math.max(elem.offsetWidth,elem.childNodes[0].offsetWidth);h=Math.max(elem.offsetHeight,elem.childNodes[0].offsetHeight);}else{o=this.offset();w=elem.offsetWidth;h=elem.offsetHeight;}if(w+h===0){w=elem.scrollWidth;h=elem.scrollHeight;}o.width=w;o.height=h;}return o;};$.fn.place=function(options){return this.each(function(i){$el=$(this);var style=$el.attr('style');var css={display:'block'};if(/static|relative/.test($el.css('position'))){css.position='absolute';}$el.css(css);css=$.placement($el,options);if(css){$el.css(css);}else{if(style){$el.attr('style',style);}else{$el.removeAttr('style');}}});};$.fn.isParent=function(of){if(!of){return false;}var parent=this.length?this[0]:null;var p=of.jquery?(of.length?of[0].parentNode:null):of.parentNode;while(p){if(p===parent){return true;}else{try{p=p.parentNode;}catch(ex){p=null;}}}return false;};$.fn.overflowParent=function(){var p=this.length?this[0].parentNode:null,_r1=/^(?:body|html)/i,_r2=/hidden|scroll|auto/i;while(p){if(!p.nodeName||_r1.test(p.nodeName)){return null;}else if(_r2.test($.css(p,'overflow')+$.css(p,'overflowX')+$.css(p,'overflowY'))){return $(p);}p=p.parentNode;}return null;};$.fn.positionParent=function(){if(!this.length){return null;}var p=this[0].parentNode||document.body;while(p){if(p===document||p===document.body){return $(document.body);}else if(!p.parentNode){return null;}else if($.css(p,'position',true)==='static'){p=p.parentNode;}else{return $(p);}}return null;};$.placement=function($el,options){if(!options||!options.of)return null;if(!options.of){return null;}var dim1=$el.dimensions();var of;var dim2;if(options.of.pageX){of=null;dim2={left:options.of.pageX,top:options.of.pageY,width:1,height:1};}else{of=$(options.of);dim2=of.dimensions();if(!of.length){return null;}}var op=$el.offsetParent();var parent,scroll;if(op.is('body,html')){parent={left:0,top:0};scroll={left:0,top:0};}else{parent=op.offset();scroll={left:op[0].scrollLeft||0,top:op[0].scrollTop||0};}var offset=options.offset||{};var margin=options.margin||{};dim1.height+=((margin.top||0)+(margin.bottom||0));dim1.width+=((margin.left||0)+(margin.right||0));var border;if(of&&of.length&&$el[0].parentNode===of[0]){border={top:$.toInt(of.css('borderTopWidth')),right:$.toInt(of.css('borderRightWidth')),bottom:$.toInt(of.css('borderBottomWidth')),left:$.toInt(of.css('borderLeftWidth'))};}else if(of&&op.isParent(of)){border={top:$.toInt(op.css('borderTopWidth')),right:$.toInt(op.css('borderRightWidth')),bottom:$.toInt(op.css('borderBottomWidth')),left:$.toInt(op.css('borderLeftWidth'))};}else{border={top:0,right:0,bottom:0,left:0};}var my=(options.my||'left top').split(' ');var at=(options.at||'right top').split(' ');var collision=(options.collision||'fit fit').split(' ');if(my.length===1&&my[0]==='center')my[1]=my[0];if(at.length===1&&at[0]==='center')at[1]=at[0];if(collision.length===1)collision[1]=collision[0];var css={left:0,top:0};switch(my[0]){case'center':css.left-=Math.round(dim1.width/2);break;case'right':css.left-=dim1.width;break;}switch(my[1]){case'center':css.top-=Math.round(dim1.height/2);break;case'bottom':css.top-=dim1.height;break;}switch(at[0]){case'center':css.left+=Math.round(dim2.width/2);break;case'right':css.left+=dim2.width-border.right;break;case'left':css.left-=border.left;break;}switch(at[1]){case'center':css.top+=Math.round(dim2.height/2);break;case'bottom':css.top+=dim2.height-border.bottom;break;default:css.top-=border.top;break;}css.left+=(dim2.left-parent.left+(offset.left||0)+scroll.left);css.top+=(dim2.top-parent.top+(offset.top||0)+scroll.top);var container;if(options.containment==='parent'){container=op;}else if(options.containment){if(options.containment.jquery){container=options.containment;}else if(typeof options.containment==='string'){container=$el.closest(options.containment);}}if(container){wn=container.offset();wn.width=container[0].clientWidth;wn.height=container[0].clientHeight;}else{wn=$(window).dimensions();}var over,under;switch(collision[0]){case'fit':over=css.left+dim1.width+parent.left-wn.left-wn.width;if(options.containment){css.left=css.left-Math.max(0,over);}else{css.left=over>0?Math.max(0,css.left-over):Math.max(0,css.left);}break;case'flip':over=css.left+dim1.width+parent.left-wn.left-wn.width;under=css.left+parent.left-wn.left;if(under<0){if(my[0]==='right'){css.left+=dim1.width;switch(at[0]){case'left':css.left+=dim2.width;break;case'right':css.left-=dim2.width;break;}}}else if(over>0){if(my[0]==='left'){css.left-=dim1.width;switch(at[0]){case'right':css.left-=dim2.width;break;case'left':css.left+=dim2.width;break;}}}break;}switch(collision[1]){case'fit':over=css.top+dim1.height+parent.top-wn.top-wn.height;css.top=over>0?Math.max(0,css.top-over):Math.max(0,css.top);break;case'flip':over=css.top+dim1.height+parent.top-wn.top-wn.height;under=css.top+parent.top-wn.top;if(under<0){if(my[1]==='bottom'){css.top+=dim1.height;switch(at[1]){case'top':css.top+=dim2.height;break;case'bottom':css.top-=dim2.height;break;}}}else if(over>0){if(my[1]==='top'){css.top-=dim1.height;switch(at[1]){case'bottom':css.top-=dim2.height;break;case'top':css.top+=dim2.height;break;}}}break;}css.left+=(margin.left||0);css.top+=(margin.top||0);if($el.css('position')==='fixed'){css.top-=Math.max(document.documentElement.scrollTop,document.body.scrollTop);css.left-=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);}return css;};$.fn.onidle=function(){var args,index,wait,fn,proxy,timer=null;args=Array.prototype.slice.call(arguments);index=args.length;while(index--){if(typeof args[index]==='number'){wait=args.splice(index,1);break;}}if(wait){index=args.length;while(index--){if($.isFunction(args[index])){fn=args[index];break;}}}if(fn){proxy=function(){var context=this,args=Array.prototype.slice.call(arguments);if(timer){clearTimeout(timer);}timer=setTimeout(function(){timer=null;fn.apply(context,args);},wait);};if(fn.guid){proxy.guid=fn.guid;}args[index]=proxy;}this.on.apply(this,args);if(proxy&&proxy.guid&&!fn.guid){fn.guid=proxy.guid;}return this;};if($.widget){$.widget("cms.cssScroller",{options:{},_create:function(){this.element.css({overflow:'hidden',overflowX:'hidden',overflowY:'hidden'}).bind('mousewheel',$.proxy(this._handleWheel,this));this.elements={};this.elements.scrollbar=$('').insertAfter(this.element).css({position:'absolute',top:0,right:0,height:'100%'}).bind('mousewheel',$.proxy(this._handleWheel,this)).bind('click',$.proxy(this._handleClick,this));this.elements.handle=this.elements.scrollbar.children('div.ui-scroller-handle').draggable({axis:'y',containment:'parent',start:$.proxy(this._drag,this),drag:this._dragging,stop:this._drop});this.resize();$(window).bind('resize',$.proxy(this.resize,this));},_getScroll:function(){var p=this.element[0];var offset=p.offsetHeight;var top=p.scrollTop;var scroll;if($.browser.msie&&$.browser.version<=7&&p.childNodes.length){var first=p.firstChild.offsetTop-$.toInt($.css(p.firstChild,'marginTop',true));var last=p.lastChild.offsetTop+p.lastChild.offsetHeight;scroll=last-first;}else{scroll=p.scrollHeight;}var ratio=(scroll&&offset)?(1.000*offset/scroll):1.000;return{offset:offset,scroll:scroll,ratio:ratio,top:top,newheight:Math.round(ratio*offset),newtop:Math.round(ratio*top)};},resize:function(){var scroll=this._getScroll();var css;if(scroll.ratio>=1){css={display:'none'};}else{var css={display:'block',height:scroll.newheight,top:scroll.newtop||0};}this.elements.handle.css(css);},_handleClick:function(e){if(e.target===this.elements.handle[0]){return;}else if(e.target===this.elements.scrollbar[0]&&this.elements.handle.is(':visible')){var y=e.clientY+document.documentElement.scrollTop;var dim=this.elements.handle.dimensions();if(y>dim.top+dim.height){this.element[0].scrollTop+=this.element[0].offsetHeight;}else if(yp.offsetHeight){var offset=0-(e.delta*70);p.scrollTop+=offset;var scroll=this._getScroll();this.elements.handle.css({top:scroll.newtop});return false;}},_drag:function(e,ui){ui.helper.position=this._getScroll();ui.helper.position.parent=this.element[0];},_dragging:function(e,ui){var scroll=(ui.position.top-ui.originalPosition.top)/ui.helper.position.ratio;ui.helper.position.parent.scrollTop=ui.helper.position.top+Math.round(scroll);},_drop:function(e,ui){ui.helper.position.parent=null;ui.helper.position=null;}});$.widget("cms.loading",{options:{timeout:20000,message:' ',relativeto:null,zIndex:null},defaults:{color:'#000000',opacity:0.10},overlay:null,oldOverlay:null,_create:function(){if(!this.overlay){if(!this.element.is(':visible')){return;}switch(this.options.style){case 2:if(this.options.color===undefined){this.options.color='#ffffff';}if(this.options.opacity===undefined){this.options.opacity=0.25;}break;}this.overlay=(this.oldOverlay||$('')).addClass('ui-widget-overlay').appendTo(this.attach()).css(this._overlayCss());if(this.options.zIndex){this.overlay.css({zIndex:this.options.zIndex});}else{var z=$.toInt(this.element.css('z-index'))+1;var node=this._node();switch(node){case'window':case'document':case'body':z=Math.max(z,$.toInt(this.overlay.css('z-index')));$(document.body).children().each(function(){var z2=$.toInt($(this).css('z-index'));if(z2>z){z=z2;}});break;default:z=Math.max(z,99);break;}this.overlay.css({zIndex:z});}this.oldOverlay=null;this._setMessage();if($.fn.bgiframe){this.overlay.bgiframe();}if(this.options.timeout){this._timeout=setTimeout($.proxy(this._kill,this),this.options.timeout);}}},_node:function(){var elem=this.element.length&&this.element[0];if(!elem)return null;if("scrollTo"in elem&&elem.document)return'window';else if(elem.nodeType===9)return'document';else return elem.nodeName&&elem.nodeName.toLowerCase();},_attach:null,attach:function(){var $el=this._attach;if(!$el){var node=this._node();switch(node){case'window':$el=$(this.element[0].document.body);break;case'document':$el=$(this.element[0].body);break;case'table':case'tbody':case'tr':$el=this.element.find('td:visible:first');if(!$el.length){$el=this.element.closest('table').parent();}break;case'body':case'td':$el=this.element;break;case'div':if(/auto|scroll|hidden/.test(this.element.css('overflow'))){$el=this.element.parent();}else{$el=this.element;}break;default:$el=this.element.parents().filter('div,td,body').filter(':visible').eq(0);break;}this._attach=$el;}return $el;},relative:function(){if(this.options.relativeto){return this.options.relativeto;}else{var node=this._node();switch(node){case'window':case'document':case'body':return $(window);default:return this.element;}}},_overlayCss:function(relative){var $el=(relative||this.element);var css=$el.dimensions();css.backgroundColor=this.options.color||this.defaults.color||'#000000';css.opacity=this.options.opacity===undefined?(this.defaults.opacity||.25):this.options.opacity;if(!this.attach().is('body')){var op=this.attach().css('position')==='static'?this.attach().offsetParent():this.attach();var o=op.offset();css.left-=o.left;css.top-=o.top;}return css;},_setMessage:function(){if(this.options.message){var overlay=this._overlayCss(this.relative());var shadow=false;if(!this.message){var code,cls,shadow;if(!$.browser.msie||$.browser.version>9){cls='css3';shadow=false;}else{cls='css2';shadow=true;this.options.style=0;}switch(this.options.style){case 1:'';break;case 2:code='';break;default:code='';break;}this.message=$(code).addClass(cls).insertBefore(this.overlay);if(shadow){this.message.shadow();}}var w=this.message.width();var h=this.message.height();var css={left:overlay.left+Math.round((overlay.width-w)/2),top:overlay.top+Math.round((overlay.height-h)/2),zIndex:$.toInt(this.overlay.css('z-index'))+1};if(this.options.offset){css.left+=(this.options.offset.left||0);css.top+=(this.options.offset.top||0);}this.message.css(css);if(shadow){this.message.shadow();}}else{this.message=null;}},_kill:function(){if(this.element.is(':visible')){var options=this.attach[0]===document.body?{modal:false}:null;$.alert('Time Out','The process could not be completed',options);}this.destroy();},update:function(){this.overlay.css(this._overlayCss());this._setMessage();},done:function(){this.destroy();},destroy:function(){this._attach=null;if(this._timeout){clearTimeout(this._timeout);this._timeout=null;}if(this.message){this.message.remove();this.message=null;}if(this.overlay){this.oldOverlay=this.overlay;this.overlay.remove();this.overlay=null;}$.Widget.prototype.destroy.apply(this,arguments);}});$.fn.doneLoading=function(){return this.loading('done');};$.widget("cms.shadow",{options:{hide:false,width:4,opacity:0.25},_create:function(){if($.browser.msie){this._msieShadow();}else{var w=this.options.width;var o=this.options.hide?0:this.options.opacity;var prop=$.cms.shadow.property();var val=$.cms.shadow.css(w-1,w-1,w,o);this.element.css(prop,val);}},_msieShadow:function(){if($.browser.version>6&&this.element.is('div')&&this.element.css('position')!='static'){this.shadow=[$('').css({position:'absolute'}).appendTo(this.element),$('').css({position:'absolute'}).appendTo(this.element),$('').css({position:'absolute'}).appendTo(this.element)];if(this.options.hide){this.shadow[0].css({display:'none'});this.shadow[1].css({display:'none'});this.shadow[2].css({display:'none'});}var dim=this.element.dimensions();var border={top:$.toInt(this.element.css('borderTopWidth')),left:$.toInt(this.element.css('borderLeftWidth'))};var w=$.toInt($.css(this.shadow[0][0],'width',true));var h=$.toInt($.css(this.shadow[2][0],'height',true));this.shadow[0].css({top:border.top,height:'100%',right:0-(w+border.left)});this.shadow[1].css({right:0-(w+border.left),bottom:0-(h+border.top)});this.shadow[2].css({width:'100%',left:border.left,bottom:0-(h+border.top)});}},getCSS:function(opacity){var w=this.options.width;var o=typeof opacity==='number'?opacity:this.options.opacity;return $.cms.shadow.css(w-1,w-1,w,o);},show:function(){if($.browser.msie){this.shadow[0].css({display:'block'});this.shadow[1].css({display:'block'});this.shadow[2].css({display:'block'});}else{var css={};css[$.cms.shadow.property()]=this.getCSS();this.element.css(css);}},hide:function(){if($.browser.msie){this.shadow[0].css({display:'none'});this.shadow[1].css({display:'none'});this.shadow[2].css({display:'none'});}else{var css={};css[$.cms.shadow.property()]=this.getCSS(0);this.element.css(css);}},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);}});$.extend($.cms.shadow,{property:function(){if($.browser.webkit){return'-webkit-box-shadow';}else if($.browser.mozilla){return'-moz-box-shadow';}else{return'box-shadow';}},css:function(horizontal,vertical,blur,opacity){var val=[];val.push(horizontal);val.push('px ');val.push(vertical);val.push('px ');val.push(blur);val.push('px rgba(0, 0, 0, ');val.push(opacity);val.push(')');return val.join('');},r_shadow:/(?:\b(\d+)px|rgba\(\d+,\s*\d+,\s*\d+,\s*([\d\.]+)\s*\))/gi,parse:function(val){if(!val){return null;}var opacity=0.00;var shadow=[];var m;while(m=$.cms.shadow.r_shadow.exec(val)){if(m[1]){shadow.push(parseInt(m[1],10));}else if(m[2]){opacity=parseFloat(m[2],10);}}if(shadow.length){return{h:shadow[0],v:shadow.length>0?shadow[1]:shadow[0],b:shadow.length>1?shadow[2]:shadow[0],o:opacity};}else{return null;}}});$.widget("cms.tooltip",{options:{out:false,place:{my:'left top',at:'left bottom',collision:'none none',offset:null}},_create:function(){var cls=this.options.custom||'ui-tooltip';this.tooltip=$('').css({position:'absolute',display:'none'});var p;if(this.options.out&&(p=this.element.overflowParent())){this.tooltip.insertBefore(p);}else if(this.element.parent().is('a')){this.tooltip.insertBefore(this.element.parent());}else{this.tooltip.insertBefore(this.element);}if(!Modernizr.boxshadow){this.tooltip.addClass('ie');}this.update();if(!Modernizr.boxshadow){this.tooltip.css({opacity:0});}var fn=$.proxy(this._setTooltip,this);this.element.bind('mouseover mouseout focus blur',fn);if(this.options.label){this.options.label.bind('mouseover mouseout',fn);}},update:function(title){if(title===undefined){title=this.element.attr('title');}else{this.element.attr('title',title);}this.title=title;if(this.title){this.tooltip.find('span').html(this.title);this.element.removeAttr('title');if(this.tooltip.is(':visible')){this.show();}}},_setTooltip:function(e){if(!$.browser.msie){this.tooltip.stop();}if(this._timeout){clearTimeout(this._timeout);this._timeout=null;}switch(e.type){case'mouseover':if(!$.cms.tooltip.focused){this.show();}return;case'focus':if(this.element.is('input:text')){$.cms.tooltip.focused=this;this.show();}return;case'mouseout':if($.cms.tooltip.focused!==this){var fn=function(tooltip){return function(){tooltip.hide();tooltip=null;};}(this);this._timeout=setTimeout(fn,100);}return;case'blur':if(this.element.is('input:text')){$.cms.tooltip.focused=null;this.hide();}return;}},show:function(){if(!this.title){return;}this.tooltip.place({my:this.options.place.my,at:this.options.place.at,of:this.options.place.of||this.element,offset:this.options.place.offset,collision:this.options.place.collision});if(!$.browser.msie){this.tooltip.animate({opacity:0.85},75);}},hide:function(){if(!$.browser.msie){this.tooltip.animate({opacity:0},150,function(e){$(this).hide();});}else{this.tooltip.hide();}},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);}});$.widget("cms.inputStyle",{options:{tooltip:true},_create:function(){if(this.element.is('input:text,input:password')){this._createTextBox();}else if(this.element.is('input:checkbox')){this._createCheckBox();}else if(this.element.is('input:radio')){this._createRadio();}else if(this.element.is('input:hidden.thumbnail')){this._createThumbnail();}else if(this.element.is('textarea')){this._createTextArea();this._createTextBox();}},_createTextBox:function(){var btns=[];if(this.element.is('.video')){this._configureVideo(btns);}if(this.element.is('.flash')){this._configureFlash(btns);}if(this.element.is('.image')){this._configureImage(btns);}if(this.element.is('.document')){this._configureDocument(btns);}if(this.element.is('.color')){this._configureColor(btns);}else if(this.element.is('.link')){this._configureLink(btns);}else if(this.element.is('.page')){this._configurePage(btns);}else if(this.element.is('.adminpage')){this._configureAdminPage(btns);}else if(this.element.is('.date,.time')){this._configureDate(btns);}else if(this.element.is('.ds')){this._configureDataSource(btns);}else if(this.element.is('.pages')){this._configureMultiplePages(btns);}else if(this.element.is('.icon')){this._configureIcon(btns);}if(btns.length){this._buttons=$(btns);this.element.attr('spellcheck',false).css({verticalAlign:'middle'});var w=$.toInt(($.curCSS||$.css)(this.element[0],'width'))-(23*btns.length);if(w>5){this.element.css({width:w});}}if(this.options.tooltip&&this.element.attr('title')){this.element.tooltip({place:{offset:{left:-5,top:1}}});}},_configureColor:function(btns){var fn=$.proxy(this._chooseColor,this);var btn=$('').insertAfter(this.element).bind('click',fn).attr('title','Select Color');btns.push(btn[0]);this.element.bind('focus.color keydown.color blur.color',fn);},_configurePage:function(btns){if($.cms.page.PPM(1,2)&&!this.element.is('.simple')){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectSystemPage,this)).attr('title','Select System Page');btns.push(btn[0]);}if(!this.element.is('.system')){if($.cms.page.AdminTemplateID()>0&&!this.element.is('.simple')){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectAdminPage,this)).attr('title','Select Admin Page');btns.push(btn[0]);}var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectPage,this)).attr('title','Select Page');btns.push(btn[0]);}},_configureAdminPage:function(btns){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectAdminPage,this)).attr('title','Select Admin Page');btns.push(btn[0]);},_configureLink:function(btns){var all=this.element.is('.all'),btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectLink,this)).attr('title',all?'Select Link':'Select Page');btns.push(btn[0]);if(all){btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectPage,this)).attr('title','Select Page');btns.push(btn[0]);}},_configureImage:function(btns){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectImage,this)).attr('title','Select Image');btns.push(btn[0]);},_configureDocument:function(btns){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectDocument,this)).attr('title','Select Document');btns.push(btn[0]);},_configureFlash:function(btns){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectFlash,this)).attr('title','Select Flash');btns.push(btn[0]);},_configureVideo:function(btns){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectVideo,this)).attr('title','Select Video');btns.push(btn[0]);},_configureDate:function(btns){var fn=$.proxy(this._chooseDate,this),cls=this.element.is('.date')?'itr_calendar':'itr_clock';var btn=$('').insertAfter(this.element).bind('click',fn).attr('title','Select Date');btns.push(btn[0]);this.element.bind('focus.date keydown.date blur.date',fn);this._date=this.element.is('.date');this._time=this.element.is('.time');this._pattern=this.element.attr('_pattern');if(!this._pattern){if(this._date&&this._time){this._pattern="M/d/yyyy h:mmtt";}else if(this._time){this._pattern="h:mmtt";}else{this._pattern="M/d/yyyy";}}},_configureDataSource:function(btns){if($.cms.datasources){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectDataSource,this)).attr('title','Select DataSource');btns.push(btn[0]);}},_configureMultiplePages:function(btns){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectMultiplePages,this)).attr('title','Select Pages');btns.push(btn[0]);},_configureIcon:function(btns){var btn=$('').insertAfter(this.element).bind('click',$.proxy(this._selectIcon,this)).attr('title','Select Icon');btns.push(btn[0]);},_chooseColor:function(e){switch(e.type){case'keydown':if($.cms.colorpicker.active){$.cms.colorpicker.prototype.deactivate();}break;case'focus':case'click':$.cms.colorpicker.prototype.activate({hash:!this.element.is('.nohash'),input:this.element});break;case'blur':var x=1;break;}},_chooseDate:function(e){switch(e.type){case'keydown':if($.cms.datepicker.active){$.cms.datepicker.prototype.deactivate();if(e.which===27){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();return false;}}break;case'focus':case'click':$.cms.datepicker.prototype.activate({input:this.element,showdate:this._date,showtime:this._time,pattern:this._pattern});break;case'blur':var x=1;break;}},_selectPage:function(e){var href=this.element.val()||window.location.href.split('?').shift();$.cms.pagebrowser.prototype.activate({href:href&&$.cms.page?$.cms.page.CleanUrl(href):href,onsave:this._savePage(this.element),sub:this.element.is('.sub')});},_selectAdminPage:function(e){var href=this.element.val()||window.location.href.split('?').shift();$.cms.adminpagebrowser.prototype.activate({href:href&&$.cms.page?$.cms.page.CleanUrl(href):href,onsave:this._savePage(this.element),sub:this.element.is('.sub')});},_selectSystemPage:function(e){var system=$.toInt(this.element.attr('_system'));$.cms.systempagebrowser.prototype.activate({href:this.element.val(),onsave:this._savePage(this.element),sub:this.element.is('.sub'),tree:{fields:system,expandall:system>0}});},_selectMultiplePages:function(e){var pages=$.toIntArray(this.element.val());$.cms.pagebrowser.prototype.activate({tree:{pages:pages.length>1?pages:null,multiple:true,clickonoff:true},onsave:this._savePages(this.element),sub:this.element.is('.sub')});},_selectDataSource:function(e){$.cms.datasources.prototype.activate({href:this.element.val(),onsave:$.proxy(this._saveDataSource,this)});},_saveDataSource:function(e,ds,params,wz){this.element.val(ds.Path);},_selectIcon:function(e){$.cms.icons.prototype.activate({viewcode:false,icon:this.element.val(),onsave:$.proxy(this._saveIcon,this)});},_saveIcon:function(e,icon,html){this.element.val(icon).trigger('change');},_savePage:function(input){return function(e,page){if(page){if(page.href){input.val(page.href).trigger('change',[page]);}else{if(input.is('.pageid')){var hidden=input.prevAll('input:hidden:first');if(hidden.length){hidden.val(page.AdminPageID||page.PageID||page.SystemPageID);}else{input.data('pageid',page.AdminPageID||page.PageID||page.SystemPageID);}}input.val(page.Path).trigger('change',[page]);}}input=null;};},_savePages:function(input){return function(e,pages){if(pages){var sb=[];for(var i=0;i').insertAfter(this.element).bind('click',$.proxy(this._check,this)).bind('mouseover mouseout',hover);if(this.element.is('.red')||this.element.parent('span.red').length){this.checkbox.addClass('red');}if(this.element.is(':checked')){this.checkbox.addClass('checked').parent('td').addClass('checked').parent('tr').addClass('checked');}if(this.disabled()){this.checkbox.addClass('disabled').parent('td').addClass('disabled').parent('tr').addClass('disabled');}var title=this.element.attr('title');if(!title){title=this.element.parent('span').attr('title');if(title){this.element.parent('span').removeAttr('title');}}if(title){this.origTitle=title;this.checkbox.attr('title',title);this.element.removeAttr('title');}var id=this.element.attr('id');if(id){this.checkbox.attr('for',id);this.label=this.element.parent().parent().find("label[for='"+id+"']");this.label.addClass('ui-check-style').unselectable().bind('click',$.proxy(this._check,this)).bind('mouseover mouseout',hover);}if(this.options.tooltip){var place;if(this.element.is('.toolbottom')){place={my:'left top',at:'left bottom',offset:{left:-1,top:-1}};}else if(this.element.is('.toolleft')){place={my:'right center',at:'left center',offset:{left:-1,top:-1}};}else if(this.element.is('.toolright')){place={my:'left center',at:'right center',offset:{left:-1,top:-1}};}else if(this.label&&this.label.length){place={my:'left top',at:'right bottom',of:this.label,offset:{left:-1,top:-20}};}else{place={my:'right top',at:'right bottom',offset:{left:5,top:-2}};}this.checkbox.tooltip({place:$.extend(place,this.options.tooltip.place),label:this.label,out:this.element.is('.out')});}},_check:function(e){if(this.disabled()){return false;}if(this.checkbox.is('.checked')){this.checkbox.removeClass('checked').parent('td').removeClass('checked').parent('tr').removeClass('checked');this.element.prop('checked',false);}else{this.checkbox.addClass('checked').parent('td').addClass('checked').parent('tr').addClass('checked');this.element.prop('checked',true);}var evt={type:'change',ctrlKey:e.ctrlKey,originalEvent:e};this.element.trigger(evt);e.preventDefault();},_createRadio:function(){var hover=$.proxy(this._checkHover,this);var radio=$.proxy(this._radio,this);this.element.hide().bind('update',$.proxy(this.update,this)).bind('click',radio);this.checkbox=$('').insertAfter(this.element).attr('name',this.element.attr('name')||"").bind('click',radio).bind('mouseover mouseout',hover);if(this.element.is(':checked')){this.checkbox.addClass('checked').parent('td').addClass('checked').parent('tr').addClass('checked');}var title=this.element.attr('title');if(title){this.checkbox.attr('title',title);this.element.removeAttr('title');}var id=this.element.attr('id');if(id){this.checkbox.attr('for',id);this.label=this.element.parent().parent().find("label[for='"+id+"']");this.label.addClass('ui-check-style').unselectable().bind('click',$.proxy(this._radio,this)).bind('mouseover mouseout',hover);}if(this.options.tooltip){this.checkbox.tooltip({place:{my:'left top',at:'left bottom',offset:{left:0,top:-3}},label:this.label});}},_radio:function(e){if(e&&e.target===this.checkbox[0]){e.preventDefault();}if(!this.checkbox.is('.checked')){$("img[name='"+this.checkbox.attr('name')+"']").removeClass('checked').parent('td').removeClass('checked').parent('tr').removeClass('checked');this.checkbox.addClass('checked').parent('td').addClass('checked').parent('tr').addClass('checked');$("input:radio[name='"+this.checkbox.attr('name')+"']").prop('checked',false);this.element.prop('checked',true).trigger('change');}},disable:function(){this.element.attr('disabled','disabled');this.checkbox.addClass('disabled').parent('td').addClass('disabled').parent('tr').addClass('disabled');},enable:function(){this.element.removeAttr('disabled');this.checkbox.removeClass('disabled').parent('td').removeClass('disabled').parent('tr').removeClass('disabled');},disabled:function(){return this.element.attr('disabled')?true:false;},update:function(e){if(this.element.is(':checked')){this.checkbox.addClass('checked').parent('td').addClass('checked').parent('tr').addClass('checked');}else{this.checkbox.removeClass('checked').parent('td').removeClass('checked').parent('tr').removeClass('checked');}if(this.element.is(':disabled')){this.checkbox.addClass('disabled').parent('td').addClass('disabled').parent('tr').addClass('disabled');}else{this.checkbox.removeClass('disabled').parent('td').removeClass('disabled').parent('tr').removeClass('disabled');}},scroll:function(){this.checkbox.scrollIntoView();},_checkHover:function(e){switch(e.type){case'mouseover':this.checkbox.addClass('over').parent('td').addClass('over').parent('tr').addClass('over');break;case'mouseout':this.checkbox.removeClass('over').parent('td').removeClass('over').parent('tr').removeClass('over');break;}},_createThumbnail:function(e){var tr=this.element.closest('tr');if(!tr.length){tr=this.element.parent().closest('div');}if(tr.length){this.select=tr.find('.ui-select').bind('click',$.proxy(this._selectThumbnail,this));this.cancel=tr.find('.ui-cancel').bind('click',$.proxy(this._cancelThumbnail,this));if(this.element.is('.video')){this.element2=tr.find('input:hidden.ui-image');this.thumbnail=tr.find('[icobalt="CobaltControls.Controls.VideoPlayer"]');}else{this.thumbnail=tr.find('img.ui-thumb');}}},_selectThumbnail:function(e){var link=$.getLinkTarget(e);var path=this.element.val(),def=this.element.attr('_default');var options={path:path||def||null,force:!path&&def?true:false,onsave:$.proxy(this._saveThumbnail,this),sub:this.element.is('.sub'),tfiles:this.element.is('.shared')?'shared':(this.element.is('.tfiles')?'true':null)};if(this.element.is('.video')){if(link&&link.is('.snapshot')&&this.element2){if(def&&options.path===def){options.path=null;}if(!options.path){$.alert('Please select a video first.');}else{$.cms.snapshot.prototype.activate({video:options.path,thumbnail:this.element2.val(),onsave:$.proxy(this._saveSnapshot,this)});}return;}else if(link&&link.is('.image')&&this.element2){path=this.element2.val();def=this.element2.attr('_default');options.path=path||def||null;options.force=!path&&def?true:false;}else{if(def&&options.path===def&&$wz.isolate&&!def.startsWith('/media/'+$wz.isolate+'/')){options.path=def.replace(/^\/media\//i,'/media/'+$wz.isolate+'/');}$.cms.videobrowser.prototype.activate(options);return;}}if(this.element.is('.shared')){options.tree={fields:'/Shared/images2'};}else if(this.element.is('.tfiles.flash')){options.tree={fields:'/files/flash'};}else if(this.element.is('.vpics')){if(def&&options.path===def&&$wz.isolate&&!def.startsWith('/media/'+$wz.isolate+'/')){options.path=def.replace(/^\/media\//i,'/media/'+$wz.isolate+'/');}options.tree={fields:'/media/vpics'};}else if(this.element.is('.media')){if(def&&options.path===def&&$wz.isolate&&!def.startsWith('/media/'+$wz.isolate+'/')){options.path=def.replace(/^\/media\//i,'/media/'+$wz.isolate+'/');}options.tree={fields:'/media'};}$.cms.imagebrowser.prototype.activate(options);},_saveSnapshot:function(image){if(this.thumbnail.length){var video=this.element.val(),player=this.thumbnail.data('swf');if(player&&video){var data={image:image||null,file:video};if(player.play){player.stop();player.load(data);}else if(player.sendEvent){try{player.sendEvent('STOP');player.sendEvent('LOAD',data);}catch(e){;}}}}this.element2.val(image).trigger('update',[{Path:image}]).trigger('change');},_saveThumbnail:function(files,options,wz){if(files){var file=$.isArray(files)?files[0]:files;if(file&&file.Path){if(this.thumbnail.length){if(this.element.is('.video')){var video,image,player=this.thumbnail.data('swf');if(wz&&wz.widgetName==='imagebrowser'){video=this.element.val();image=file.Path;}else{video=file.Path;image=this.element2.val();}if(player&&video){var data={image:image||null,file:video};if(player.play){player.stop();player.load(data);}else if(player.sendEvent){try{player.sendEvent('STOP');player.sendEvent('LOAD',data);}catch(e){;}}}}else{var src=this.thumbnail.attr('src').replace(/([&\?]I=)[^&]*/i,'$1'+$.encode(file.Path));this.thumbnail.attr('src',src);}}if(this.element2&&wz&&wz.widgetName==='imagebrowser'){this.element2.val(file.Path).trigger('update',[file]).trigger('change');}else{this.element.val(file.Path).trigger('update',[file]).trigger('change');}}}},_cancelThumbnail:function(e){var img=$(e.target),def=img.attr('_default')||'/Shared/images/spacer.gif';if(this.thumbnail.length){if(this.element.is('.video')){var player=this.thumbnail.data('swf');if(player){var data={image:def,file:def};if(player.play){player.stop();player.load(data);}else if(player.sendEvent){try{player.sendEvent('STOP');player.sendEvent('LOAD',data);}catch(e){;}}}}else{var src=this.thumbnail.attr('src').replace(/([&\?]I=)[^&]*/i,'$1'+$.encode(def));this.thumbnail.attr('src',src);}}this.element.val('').trigger('update',[{}]).trigger('change');if(this.element2){this.element2.val('').trigger('update',[{}]).trigger('change');}},_createTextArea:function(){this.element.bind('keydown',function(e){if(e.which===9){if(!e.shiftKey){$(this).insertAtCursor('\t');}e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();return false;}});},show:function(){var el;if(this._buttons){el=this._buttons;}else if(this.element.is('input:checkbox')){el=this.checkbox;}if(el){el.show();}},hide:function(){var el;if(this._buttons){el=this._buttons;}else if(this.element.is('input:checkbox')){el=this.checkbox;}if(el){el.hide();}},tooltip:function(title){var el;if(this.element.is('input:text')){el=this.element;}else if(this.element.is('input:checkbox')){el=this.checkbox;}if(!el){el=this.element;}el.attr('title',title||this.origTitle||"");if(this.options.tooltip){el.tooltip('update');}}});$.cms.inputStyle.filter=function(i){var cls=(this.className||"").split(' ');for(var i=0;i ',_create:function(){var base=$(document.body).attr('_base'),images=[],preload=[],lightbox=this,w=$.toInt(this.element.attr('_lightwidth')),h=$.toInt(this.element.attr('_lightheight'));if(w&&h){this.options.width=w;this.options.height=h;}this.element.find("a[href]").filter(function(e){var link=$(this);var href=link.attr('href').replace(base,"/");if($.cms.lightbox.r_img.test(href)){link.data('index',images.length);var thumb=lightbox._getImageUrl(href),image={src:href,thumb:thumb,css:'url('+thumb+')',title:link.attr('_title'),description:link.attr('_description')};if(image.description){lightbox.description=true;}images.push(image);preload.push(thumb);return true;}else{return false;}}).click($.proxy(this._open,this));$.preload(preload);this.images=images;},_open:function(e){var link=$(e.target).closest('a');this.index=link.data('index');var padding=60;if(this.description){padding+=41;}if(!this.popup){this.popup=$(this._html).children('div.cms-lightbox').css({width:this.options.width,height:this.options.height+padding}).end().dialog({modal:true,width:this.options.width+122,height:'auto',open:$.proxy(this._openLightbox,this),beforeClose:$.proxy(this._closeLightbox,this)});}else{this.popup.dialog('open');}return false;},_openLightbox:function(e,data,popup){if(!this.elements){var css={width:this.options.width,height:this.options.height};this.elements={main:popup.uiDialog.find('div.cms-lightbox').click($.proxy(this._navigate,this)),image:popup.uiDialog.find('div.cms-lightbox-image').css(css),image1:popup.uiDialog.find('div.cms-lightbox-image1').css(css),image2:popup.uiDialog.find('div.cms-lightbox-image2').css(css),title:popup.uiDialog.find('div.ui-dialog-titlebar>span'),description:popup.uiDialog.find('div.cms-lightbox-description'),images:popup.uiDialog.find('div.cms-lightbox-images').css({width:this.options.width+71}).children('div'),nav:popup.uiDialog.find('div.cms-lightbox-nav').bind('mouseenter mouseleave',$.proxy(this._showNav,this)).unselectable(),panel:popup.uiDialog.find('div.cms-lightbox-panel')};if(this.options.height!=400){var padding=((this.options.height-400)/2)+150;this.elements.nav.css({paddingTop:padding,paddingBottom:padding});}if(!this.options.nav){var nav=this.elements.nav.children().eq(0);this.options.nav={color:nav.css('color'),backgroundColor:nav.css('backgroundColor'),borderLeftColor:nav.css('borderLeftColor'),borderRightColor:nav.css('borderRightColor'),borderBottomColor:nav.css('borderBottomColor'),borderTopColor:nav.css('borderTopColor')};}if(!this.options.bg){var bg=this.elements.main.css('backgroundColor');this.options.bg={color:bg,backgroundColor:bg,borderLeftColor:bg,borderRightColor:bg,borderBottomColor:bg,borderTopColor:bg};}this.elements.nav.children().css(this.options.bg).css({display:'block'});if(!this.description){this.elements.description.hide();}this.paging={perpage:Math.max(Math.floor((this.options.width+78)/57),1),page:0};if(this.paging.perpage>this.images.length){this.elements.panel.hide();}var sb=[];for(var i=0;i