(function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context);},_jQuery=window.jQuery,_$=window.$,document=window.document,rootjQuery,quickExpr=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rtrim=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,indexOf=Array.prototype.indexOf;jQuery.fn=jQuery.prototype={init:function(selector,context){var match,elem,ret,doc;if(!selector){return this;}if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}if(selector==="body"&&!context){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this;}if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true);}else{selector=[doc.createElement(ret[1])];}}else{ret=buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes;}return jQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem){if(elem.id!==match[2]){return rootjQuery.find(selector);}this.length=1;this[0]=elem;}this.context=document;this.selector=selector;return this;}}else if(!context&&/^\w+$/.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector);}else if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return jQuery(context).find(selector);}}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector);}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;}return jQuery.makeArray(selector,this);},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length;},toArray:function(){return slice.call(this,0);},get:function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num]);},pushStack:function(elems,name,selector){var ret=jQuery();if(jQuery.isArray(elems)){push.apply(ret,elems);}else{jQuery.merge(ret,elems);}ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector;}else if(name){ret.selector=this.selector+"."+name+"("+selector+")";}return ret;},each:function(callback,args){return jQuery.each(this,callback,args);},ready:function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery);}else if(readyList){readyList.push(fn);}return this;},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1);},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},end:function(){return this.prevObject||jQuery(null);},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options,name,src,copy;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={};}if(length===i){target=this;--i;}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue;}if(deep&&copy&&(jQuery.isPlainObject(copy)||jQuery.isArray(copy))){var clone=src&&(jQuery.isPlainObject(src)||jQuery.isArray(src))?src:jQuery.isArray(copy)?[]:{};target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}return target;};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery;}return jQuery;},isReady:false,ready:function(){if(!jQuery.isReady){if(!document.body){return setTimeout(jQuery.ready,13);}jQuery.isReady=true;if(readyList){var fn,i=0;while((fn=readyList[i++])){fn.call(document,jQuery);}readyList=null;}if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");}}},bindReady:function(){if(readyBound){return;}readyBound=true;if(document.readyState==="complete"){return jQuery.ready();}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null;}catch(e){}if(document.documentElement.doScroll&&toplevel){doScrollCheck();}}},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isPlainObject:function(obj){if(!obj||toString.call(obj)!=="[object Object]"||obj.nodeType||obj.setInterval){return false;}if(obj.constructor&&!hasOwnProperty.call(obj,"constructor")&&!hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false;}var key;for(key in obj){}return key===undefined||hasOwnProperty.call(obj,key);},isEmptyObject:function(obj){for(var name in obj){return false;}return true;},error:function(msg){throw msg;},parseJSON:function(data){if(typeof data!=="string"||!data){return null;}data=jQuery.trim(data);if(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))();}else if(/new Date\(/.test(data)){try{return(new Function("return "+data))();}catch(ex){jQuery.error("Invalid JSON: "+data);}}else{jQuery.error("Invalid JSON: "+data);}},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data));}else{script.text=data;}head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break;}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break;}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break;}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object;},trim:function(text){return(text||"").replace(rtrim,"");},makeArray:function(array,results){var ret=results||[];if(array!=null){if(array.length==null||typeof array==="string"||jQuery.isFunction(array)||(typeof array!=="function"&&array.setInterval)){push.call(ret,array);}else{jQuery.merge(ret,array);}}return ret;},inArray:function(elem,array){if(array.indexOf){return array.indexOf(elem);}for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i;}}return-1;},merge:function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j];}}else{while(second[j]!==undefined){first[i++]=second[j++];}}first.length=i;return first;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!==!callback(elems[i],i)){ret.push(elems[i]);}}return ret;},map:function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value;}}return ret.concat.apply([],ret);},guid:1,proxy:function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined;}else if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined;}}if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments);};}if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++;}return proxy;},uaMatch:function(ua){ua=ua.toLowerCase();var match=/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};},browser:{}});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version;}if(jQuery.browser.webkit){jQuery.browser.safari=true;}if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem);};}rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready();};}else if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready();}};}function doScrollCheck(){if(jQuery.isReady){return;}try{document.documentElement.doScroll("left");}catch(error){setTimeout(doScrollCheck,1);return;}jQuery.ready();}function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");}if(elem.parentNode){elem.parentNode.removeChild(elem);}}function access(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){access(elems,k,key[k],exec,fn,value);}return elems;}if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass);}return elems;}return length?fn(elems[0],key):undefined;}function now(){return(new Date).getTime();}(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+now();div.style.display="none";div.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:document.createElement("select").appendChild(document.createElement("option")).selected,parentNode:div.removeChild(div.appendChild(document.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}try{delete script.test;}catch(e){jQuery.support.deleteExpando=false;}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click);});div.cloneNode(true).fireEvent("onclick");}div=document.createElement("div");div.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);jQuery.support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';div=null;});var eventSupported=function(eventName){var el=document.createElement("div");eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function";}el=null;return isSupported;};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null;})();jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},expando:expando,noData:{"embed":true,"object":true,"applet":true},data:function(elem,name,data){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return;}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache;if(!id&&typeof name==="string"&&data===undefined){return null;}if(!id){id=++uuid;}if(typeof name==="object"){elem[expando]=id;thisCache=cache[id]=jQuery.extend(true,{},name);}else if(!cache[id]){elem[expando]=id;cache[id]={};}thisCache=cache[id];if(data!==undefined){thisCache[name]=data;}return typeof name==="string"?thisCache[name]:thisCache;},removeData:function(elem,name){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return;}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache=cache[id];if(name){if(thisCache){delete thisCache[name];if(jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem);}}}else{if(jQuery.support.deleteExpando){delete elem[jQuery.expando];}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}delete cache[id];}}});jQuery.fn.extend({data:function(key,value){if(typeof key==="undefined"&&this.length){return jQuery.data(this[0]);}else if(typeof key==="object"){return this.each(function(){jQuery.data(this,key);});}var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key);}return data===undefined&&parts[1]?this.data(parts[0]):data;}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});}});jQuery.extend({queue:function(elem,type,data){if(!elem){return;}type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[];}if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data));}else{q.push(data);}return q;},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift();}if(fn){if(type==="fx"){queue.unshift("inprogress");}fn.call(elem,function(){jQuery.dequeue(elem,type);});}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}if(data===undefined){return jQuery.queue(this[0],type);}return this.each(function(i,elem){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type);},time);});},clearQueue:function(type){return this.queue(type||"fx",[]);}});var rclass=/[\n\t]/g,rspace=/\s+/,rreturn=/\r/g,rspecialurl=/href|src|style/,rtype=/(button|input)/i,rfocusable=/(button|input|object|select|textarea)/i,rclickable=/^(a|area)$/i,rradiocheck=/radio|checkbox/;jQuery.fn.extend({attr:function(name,value){return access(this,name,value,true,jQuery.attr);},removeAttr:function(name,fn){return this.each(function(){try{jQuery.attr(this,name,"");}catch(ex){;}if(this.nodeType===1){this.removeAttribute(name);}});},addClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")));});}if(value&&typeof value==="string"){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value;}else{var className=" "+elem.className+" ",setClass=elem.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c];}}elem.className=jQuery.trim(setClass);}}}}return this;},removeClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")));});}if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ");}elem.className=jQuery.trim(className);}else{elem.className="";}}}}return this;},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal);});}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className);}}else if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className);}this.className=this.className||value===false?"":jQuery.data(this,"__className__")||"";}});},hasClass:function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true;}}return false;},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text;}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null;}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value;}values.push(value);}}return values;}if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value;}return(elem.value||"").replace(rreturn,"");}return undefined;}var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return;}if(isFunction){val=value.call(this,i,self.val());}if(typeof val==="number"){val+="";}if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0;}else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);var index=-1;jQuery("option",this).each(function(i){var selected=jQuery.inArray(jQuery(this).val(),values)>=0;this.selected=selected;if(selected){index=i;}});if(index<0){this.selectedIndex=index;}}else{this.value=val;}});}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value);}var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.nodeType===1){var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}if(name in elem&&notxml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed");}elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;}if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined;}return elem[name];}if(!jQuery.support.style&&notxml&&name==="style"){if(set){elem.style.cssText=""+value;}return elem.style.cssText;}if(set){elem.setAttribute(name,""+value);}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}return jQuery.style(elem,name,value);}});var rnamespaces=/\.(.*)$/,fcleanup=function(nm){return nm.replace(/[^\w\s\.\|`]/g,function(ch){return"\\"+ch;});};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return;}if(elem.setInterval&&(elem!==window&&!elem.frameElement)){elem=window;}var handleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;}if(!handler.guid){handler.guid=jQuery.guid++;}var elemData=jQuery.data(elem);if(!elemData){return;}var events=elemData.events=elemData.events||{},eventHandle=elemData.handle,eventHandle;if(!eventHandle){elemData.handle=eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined;};}eventHandle.elem=elem;types=types.split(" ");var type,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".");}else{namespaces=[];handleObj.namespace="";}handleObj.type=type;handleObj.guid=handler.guid;var handlers=events[type],special=jQuery.event.special[type]||{};if(!handlers){handlers=events[type]=[];if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false);}else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle);}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}handlers.push(handleObj);jQuery.event.global[type]=true;}elem=null;},global:{},remove:function(elem,types,handler,pos){if(elem.nodeType===3||elem.nodeType===8){return;}var ret,type,fn,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,elemData=jQuery.data(elem),events=elemData&&elemData.events;if(!elemData||!events){return;}if(types&&types.type){handler=types.handler;types=types.type;}if(!types||typeof types==="string"&&types.charAt(0)==="."){types=types||"";for(type in events){jQuery.event.remove(elem,type+types);}return;}types=types.split(" ");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")<0;namespaces=[];if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+jQuery.map(namespaces.slice(0).sort(),fcleanup).join("\\.(?:.*\\.)?")+"(\\.|$)")}eventType=events[type];if(!eventType){continue;}if(!handler){for(var j=0;j<eventType.length;j++){handleObj=eventType[j];if(all||namespace.test(handleObj.namespace)){jQuery.event.remove(elem,origType,handleObj.handler,j);eventType.splice(j--,1);}}continue;}special=jQuery.event.special[type]||{};for(var j=pos||0;j<eventType.length;j++){handleObj=eventType[j];if(handler.guid===handleObj.guid){if(all||namespace.test(handleObj.namespace)){if(pos==null){eventType.splice(j--,1);}if(special.remove){special.remove.call(elem,handleObj);}}if(pos!=null){break;}}}if(eventType.length===0||pos!=null&&eventType.length===1){if(!special.teardown||special.teardown.call(elem,namespaces)===false){removeEvent(elem,type,elemData.handle);}ret=null;delete events[type];}}if(jQuery.isEmptyObject(events)){var handle=elemData.handle;if(handle){handle.elem=null;}delete elemData.events;delete elemData.handle;if(jQuery.isEmptyObject(elemData)){jQuery.removeData(elem);}}},trigger:function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}if(!elem){event.stopPropagation();if(jQuery.event.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem);}});}}if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data);}var parent=elem.parentNode||elem.ownerDocument;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){if(elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false;}}}catch(e){}if(!event.isPropagationStopped()&&parent){jQuery.event.trigger(event,data,parent,true);}else if(!event.isDefaultPrevented()){var target=event.target,old,isClick=jQuery.nodeName(target,"a")&&type==="click",special=jQuery.event.special[type]||{};if((!special._default||special._default.call(elem,event)===false)&&!isClick&&!(target&&target.nodeName&&jQuery.noData[target.nodeName.toLowerCase()])){try{if(target[type]){old=target["on"+type];if(old){target["on"+type]=null;}jQuery.event.triggered=true;target[type]();}}catch(e){}if(old){target["on"+type]=old;}jQuery.event.triggered=false;}}},handle:function(event){var all,handlers,namespaces,namespace,events;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;all=event.type.indexOf(".")<0&&!event.exclusive;if(!all){namespaces=event.type.split(".");event.type=namespaces.shift();namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");}var events=jQuery.data(this,"events"),handlers=events[event.type];if(events&&handlers){handlers=handlers.slice(0);for(var j=0,l=handlers.length;j<l;j++){var handleObj=handlers[j];if(all||namespace.test(handleObj.namespace)){event.handler=handleObj.handler;event.data=handleObj.data;event.handleObj=handleObj;var ret=handleObj.handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}if(event.isImmediatePropagationStopped()){break;}}}}return event.result;},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event;}var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}if(!event.target){event.target=event.srcElement||document;}if(event.target.nodeType===3){event.target=event.target.parentNode;}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement;}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;}if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));}return event;},guid:1E8,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add:function(handleObj){jQuery.event.add(this,handleObj.origType,jQuery.extend({},handleObj,{handler:liveHandler}));},remove:function(handleObj){var remove=true,type=handleObj.origType.replace(rnamespaces,"");jQuery.each(jQuery.data(this,"events").live||[],function(){if(type===this.origType.replace(rnamespaces,"")){remove=false;return false;}});if(remove){jQuery.event.remove(this,handleObj.origType,liveHandler);}}},beforeunload:{setup:function(data,namespaces,eventHandle){if(this.setInterval){this.onbeforeunload=eventHandle;}return false;},teardown:function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null;}}}}};var removeEvent=document.removeEventListener?function(elem,type,handle){elem.removeEventListener(type,handle,false);}:function(elem,type,handle){elem.detachEvent("on"+type,handle);};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src);}if(src&&src.type){this.originalEvent=src;this.type=src.type;}else{this.type=src;}this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}function returnTrue(){return true;}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return;}if(e.preventDefault){e.preventDefault();}e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return;}if(e.stopPropagation){e.stopPropagation();}e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;try{while(parent&&parent!==this){parent=parent.parentNode;}if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}}catch(e){}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments);};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={setup:function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig);},teardown:function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement);}};});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(data,namespaces){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){return trigger("submit",this,arguments);}});jQuery.event.add(this,"keypress.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){return trigger("submit",this,arguments);}});}else{return false;}},teardown:function(namespaces){jQuery.event.remove(this,".specialSubmit");}};}if(!jQuery.support.changeBubbles){var formElems=/textarea|input|select/i,changeFilters,getVal=function(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked;}else if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options,function(elem){return elem.selected;}).join("-"):"";}else if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex;}return val;},testChange=function testChange(e){var elem=e.target,data,val;if(!formElems.test(elem.nodeName)||elem.readOnly){return;}data=jQuery.data(elem,"_change_data");val=getVal(elem);if(e.type!=="focusout"||elem.type!=="radio"){jQuery.data(elem,"_change_data",val);}if(data===undefined||val===data){return;}if(data!=null||val){e.type="change";return jQuery.event.trigger(e,arguments[1],elem);}};jQuery.event.special.change={filters:{focusout:testChange,click:function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e);}},keydown:function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return testChange.call(this,e);}},beforeactivate:function(e){var elem=e.target;jQuery.data(elem,"_change_data",getVal(elem));}},setup:function(data,namespaces){if(this.type==="file"){return false;}for(var type in changeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type]);}return formElems.test(this.nodeName);},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");return formElems.test(this.nodeName);}};changeFilters=jQuery.event.special.change.filters;}function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args);}if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){jQuery.event.special[fix]={setup:function(){this.addEventListener(orig,handler,true);},teardown:function(){this.removeEventListener(orig,handler,true);}};function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.handle.call(this,e);}});}jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn);}return this;}if(jQuery.isFunction(data)){fn=data;data=undefined;}var handler=name==="one"?jQuery.proxy(fn,function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments);}):fn;if(type==="unload"&&name!=="one"){this.one(type,data,fn);}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.add(this[i],type,handler,data);}}return this;};});jQuery.fn.extend({unbind:function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key]);}}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.remove(this[i],type,fn);}}return this;},delegate:function(selector,types,data,fn){return this.live(types,data,fn,selector);},undelegate:function(selector,types,fn){if(arguments.length===0){return this.unbind("live");}else{return this.die(types,null,fn,selector);}},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++]);}return this.click(jQuery.proxy(fn,function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});var liveMap={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};jQuery.each(["live","die"],function(i,name){jQuery.fn[name]=function(types,data,fn,origSelector){var type,i=0,match,namespaces,preType,selector=origSelector||this.selector,context=origSelector?this:jQuery(this.context);if(jQuery.isFunction(data)){fn=data;data=undefined;}types=(types||"").split(" ");while((type=types[i++])!=null){match=rnamespaces.exec(type);namespaces="";if(match){namespaces=match[0];type=type.replace(rnamespaces,"");}if(type==="hover"){types.push("mouseenter"+namespaces,"mouseleave"+namespaces);continue;}preType=type;if(type==="focus"||type==="blur"){types.push(liveMap[type]+namespaces);type=type+namespaces;}else{type=(liveMap[type]||type)+namespaces;}if(name==="live"){context.each(function(){jQuery.event.add(this,liveConvert(type,selector),{data:data,selector:selector,handler:fn,origType:type,origHandler:fn,preType:preType});});}else{context.unbind(liveConvert(type,selector),fn);}}return this;}});function liveHandler(event){var stop,elems=[],selectors=[],args=arguments,related,match,handleObj,elem,j,i,l,data,events=jQuery.data(this,"events");if(event.liveFired===this||!events||!events.live||event.button&&event.type==="click"){return;}event.liveFired=this;var live=events.live.slice(0);for(j=0;j<live.length;j++){handleObj=live[j];if(handleObj.origType.replace(rnamespaces,"")===event.type){selectors.push(handleObj.selector);}else{live.splice(j--,1);}}match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){for(j=0;j<live.length;j++){handleObj=live[j];if(match[i].selector===handleObj.selector){elem=match[i].elem;related=null;if(handleObj.preType==="mouseenter"||handleObj.preType==="mouseleave"){related=jQuery(event.relatedTarget).closest(handleObj.selector)[0];}if(!related||related!==elem){elems.push({elem:elem,handleObj:handleObj});}}}}for(i=0,l=elems.length;i<l;i++){match=elems[i];event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;if(match.handleObj.origHandler.apply(match.elem,args)===false){stop=false;break;}}return stop;}function liveConvert(type,selector){return"live."+(type&&type!=="*"?type+".":"")+selector.replace(/\./g,"`").replace(/ /g,"&");}jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error").split(" "),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};if(jQuery.attrFn){jQuery.attrFn[name]=true;}});if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload",function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem);}catch(e){}}}});}(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0;});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[];}if(!selector||typeof selector!=="string"){return results;}var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break;}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift();}set=posProcess(selector,set);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}if(pop==null){pop=context;}Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}if(!checkSet){checkSet=set;}if(!checkSet){Sizzle.error(cur||selector);}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}if(!set){set=context.getElementsByTagName("*");}return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue;}if(curLoop===result){result=[];}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}if(found!==undefined){if(!inplace){curLoop=result;}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}break;}}}if(expr===old){if(anyFound==null){Sizzle.error(expr);}else{break;}}old=expr;}return curLoop;};Sizzle.error=function(msg){throw"Syntax error, unrecognized expression: "+msg;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase();}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part;}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck;}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem);}}else if(inplace){curLoop[i]=false;}}}return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){return match[1].toLowerCase();},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}if(match[2]==="~="){match[4]=" "+match[4]+" ";}return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0===i;},eq:function(elem,i,match){return match[3]-0===i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}return true;}else{Sizzle.error("Syntax error, unrecognized expression: "+name);}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while((node=node.previousSibling)){if(node.nodeType===1){return false;}}if(type==="first"){return true;}node=elem;case'last':while((node=node.nextSibling)){if(node.nodeType===1){return false;}}return true;case'nth':var first=match[2],last=match[3];if(first===1&&last===0){return true;}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}parent.sizcache=doneName;}var diff=elem.nodeIndex-last;if(first===0){return diff===0;}else{return(diff%first===0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute&&elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,function(all,num){return"\\"+(num-0+1);}));}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results;}return array;};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}return ret;};}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true;}return a.compareDocumentPosition?-1:1;}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true;}return a.sourceIndex?-1:1;}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}return ret;};}else if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true;}return a.ownerDocument?-1:1;}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}return ret;};}function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue;}else if(elem.nodeType!==8){ret+=getText(elem.childNodes);}}return ret;}(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}results=tmp;}return results;};}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}div=null;})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}div=null;})();}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return;}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return;}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}if(elem.nodeName.toLowerCase()===cur){match=elem;break;}elem=elem[dir];}checkSet[i]=match;}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}elem=elem[dir];}checkSet[i]=match;}}}var contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16);}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.text=getText;jQuery.isXMLDoc=isXML;jQuery.contains=contains;return;window.Sizzle=Sizzle;})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,slice=Array.prototype.slice;var winnow=function(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)===keep;});}else if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep;});}else if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1;});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep);}else{qualifier=jQuery.filter(qualifier,filtered);}}return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep;});};jQuery.fn.extend({find:function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break;}}}}}return ret;},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector);},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector);},is:function(selector){return!!selector&&jQuery.filter(selector,this).length>0;},closest:function(selectors,context){if(jQuery.isArray(selectors)){var ret=[],cur=this[0],match,matches={},selector;if(cur&&selectors.length){for(var i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector;}}while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur});delete matches[selector];}}cur=cur.parentNode;}}return ret.length>1?jQuery.unique(ret):ret;}var pos=jQuery.expr.match.POS.test(selectors)?jQuery(selectors,context||this.context):null;return this.map(function(i,cur){while(cur&&cur.ownerDocument&&cur!==context){if(pos?pos.index(cur)>-1:jQuery(cur).is(selectors)){return cur;}cur=cur.parentNode;}return null;});},index:function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children());}return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all));},andSelf:function(){return this.add(this.prevObject);}});function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11;}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return jQuery.dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until);},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until);},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until;}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);}ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse();}return this.pushStack(ret,name,slice.call(arguments).join(","));};});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";}return jQuery.find.matches(expr,elems);},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur);}cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break;}}return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}}return r;}});var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/(<([\w:]+)[^>]*?)\/>/g,rselfClosing=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnocache=/<script|<object|<embed|<option|<style/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,fcloseTag=function(all,front,tag){return rselfClosing.test(tag)?all:front+"></"+tag+">";},wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"];}jQuery.fn.extend({text:function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()));});}if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));}return jQuery.text(this);},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});}if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild;}return elem;}).append(this);}return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild);}});},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});}else if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments);}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});}else if(arguments.length){var set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery(arguments[0]).toArray());return set;}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem]);}if(elem.parentNode){elem.parentNode.removeChild(elem);}}}return this;},empty:function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));}while(elem.firstChild){elem.removeChild(elem.firstChild);}}return this;},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}return jQuery.clean([html.replace(rinlinejQuery,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(rleadingWhitespace,"")],ownerDocument)[0];}else{return this.cloneNode(true);}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"));}return ret;},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null;}else if(typeof value==="string"&&!rnocache.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,fcloseTag);try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value;}}}catch(e){this.empty().append(value);}}else if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this),old=self.html();self.empty().append(function(){return value.call(this,i,old);});});}else{this.empty().append(value);}return this;},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();self.replaceWith(value.call(this,i,old));});}if(typeof value!=="string"){value=jQuery(value).detach();}return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value);}else{jQuery(parent).append(value);}});}else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value);}},detach:function(selector){return this.remove(selector,true);},domManip:function(args,table,callback){var results,first,value=args[0],scripts=[],fragment,parent;if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true);});}if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback);});}if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent};}else{results=buildFragment(args,this,scripts);}fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild;}else{first=fragment.firstChild;}if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],i>0||results.cacheable||this.length>1?fragment.cloneNode(true):fragment);}}if(scripts.length){jQuery.each(scripts,evalScript);}}return this;function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}});function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return;}var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}}});}function buildFragment(args,nodes,scripts){var fragment,cacheable,cacheresults,doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&doc===document&&!rnocache.test(args[0])&&(jQuery.support.checkClone||!rchecked.test(args[0]))){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults;}}}if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts);}if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1;}return{fragment:fragment,cacheable:cacheable};}jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this;}else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}return this.pushStack(ret,name,insert.selector);}};});jQuery.extend({clean:function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;}var ret=[];for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+="";}if(!elem){continue;}if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem);}else if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,fcloseTag);var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild;}if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild);}elem=div.childNodes;}if(elem.nodeType){ret.push(elem);}else{ret=jQuery.merge(ret,elem);}}if(fragment){for(var i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));}fragment.appendChild(ret[i]);}}}return ret;},cleanData:function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){id=elem[jQuery.expando];if(id){data=cache[id];if(data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{removeEvent(elem,type,data.handle);}}}if(deleteExpando){delete elem[jQuery.expando];}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}delete cache[id];}}}});var rexclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,ralpha=/alpha\([^)]*\)/,ropacity=/opacity=([^)]*)/,rfloat=/float/i,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle,styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat",fcamelCase=function(all,letter){return letter.toUpperCase();};jQuery.fn.css=function(name,value){return access(this,name,value,true,function(elem,name,value){if(value===undefined){return jQuery.curCSS(elem,name);}if(typeof value==="number"&&!rexclude.test(name)){value+="px";}jQuery.style(elem,name,value);});};jQuery.extend({style:function(elem,name,value){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined;}if((name==="width"||name==="height")&&parseFloat(value)<0){value=undefined;}var style=elem.style||elem,set=value!==undefined;if(!jQuery.support.opacity&&name==="opacity"){if(set){style.zoom=1;var opacity=parseInt(value,10)+""==="NaN"?"":"alpha(opacity="+value*100+")";var filter=style.filter||jQuery.curCSS(elem,"filter")||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):opacity;if(style.filter==="alpha(opacity=100)"){style.removeAttribute('filter');if(elem&&elem.currentStyle&&elem.currentStyle.filter){style.filter="alpha(opacity=100)";}}}return style.filter&&style.filter.indexOf("opacity=")>=0?(parseFloat(ropacity.exec(style.filter)[1])/100)+"":"";}if(rfloat.test(name)){name=styleFloat;}name=name.replace(rdashAlpha,fcamelCase);if(set){style[name]=value;}return style[name];},css:function(elem,name,force,extra){if(name==="width"||name==="height"){var val,props=cssShow,which=name==="width"?cssWidth:cssHeight;function getWH(){val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return;}jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;}});}if(elem.offsetWidth!==0){getWH();}else{jQuery.swap(elem,props,getWH);}return Math.max(0,Math.round(val));}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style,filter;if(!jQuery.support.opacity&&name==="opacity"&&elem.currentStyle){ret=ropacity.test(elem.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret;}if(rfloat.test(name)){name=styleFloat;}if(!force&&style&&style[name]){ret=style[name];}else if(getComputedStyle){if(rfloat.test(name)){name="float";}name=name.replace(rupper,"-$1").toLowerCase();var defaultView=elem.ownerDocument.defaultView;if(!defaultView){return null;}var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name);}if(name==="opacity"&&ret===""){ret="1";}}else if(elem.currentStyle){var camelCase=name.replace(rdashAlpha,fcamelCase);ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!rnumpx.test(ret)&&rnum.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=camelCase==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options){elem.style[name]=old[name];}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight,skip=elem.nodeName.toLowerCase()==="tr";return width===0&&height===0&&!skip?true:width>0&&height>0&&!skip?false:jQuery.curCSS(elem,"display")==="none";};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem);};}var jsc=now(),rscript=/<script(.|\s)*?\/script>/gi,rselectTextarea=/select|textarea/i,rinput=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,jsre=/=\?(&|$)/,rquery=/\?/,rts=/(\?|&)_=.*?(&|$)/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g,_load=jQuery.fn.load;jQuery.fn.extend({load:function(url,params,callback){if(typeof url!=="string"){return _load.call(this,url);}else if(!this.length){return this;}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST";}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status==="success"||status==="notmodified"){self.html(selector?jQuery("<div />").append(res.responseText.replace(rscript,"")).find(selector):res.responseText);}if(callback){self.each(callback,[res.responseText,status,res]);}}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:window.XMLHttpRequest&&(window.location.protocol!=="file:"||!window.ActiveXObject)?function(){return new window.XMLHttpRequest();}:function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP");}catch(e){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);var jsonp,status,data,callbackContext=origSettings&&origSettings.context||s,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?";}}else if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";}s.dataType="json";}if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=window[jsonp]||function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head){head.removeChild(script);}};}if(s.dataType==="script"&&s.cache===null){s.cache=false;}if(s.cache===false&&type==="GET"){var ts=now();var ret=s.url.replace(rts,"$1_="+ts+"$2");s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"");}if(s.data&&type==="GET"){s.url+=(rquery.test(s.url)?"&":"?")+s.data;}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart");}var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset;}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script);}}};}head.insertBefore(script,head.firstChild);return undefined;}var requestDone=false;var xhr=s.xhr();if(!xhr){return;}if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);}else{xhr.open(type,s.url,s.async);}try{if(s.data||origSettings&&origSettings.contentType){xhr.setRequestHeader("Content-Type",s.contentType);}if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]);}if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url]);}}if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");}xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend.call(callbackContext,xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}xhr.abort();return false;}if(s.global){trigger("ajaxSend",[xhr,s]);}var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0||isTimeout==="abort"){if(!requestDone){complete();}requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop;}}else if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";var errMsg;if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(err){status="parsererror";errMsg=err;}}if(status==="success"||status==="notmodified"){if(!jsonp){success();}}else{jQuery.handleError(s,xhr,status,errMsg);}complete();if(isTimeout==="timeout"){xhr.abort();}if(s.async){xhr=null;}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){oldAbort.call(xhr);}onreadystatechange("abort");};}catch(e){}if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout");}},s.timeout);}try{xhr.send(type==="POST"||type==="PUT"||type==="DELETE"?s.data:null);}catch(e){jQuery.handleError(s,xhr,null,e);complete();}if(!s.async){onreadystatechange();}function success(){if(s.success){s.success.call(callbackContext,data,status,xhr);}if(s.global){trigger("ajaxSuccess",[xhr,s]);}}function complete(){if(s.complete){s.complete.call(callbackContext,xhr,status);}if(s.global){trigger("ajaxComplete",[xhr,s]);}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}}function trigger(type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args);}return xhr;},handleError:function(s,xhr,status,e){if(s.error){s.error.call(s.context||s,xhr,status,e);}if(s.global){(s.context?jQuery(s.context):jQuery.event).trigger("ajaxError",[xhr,s,e]);}},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol==="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0;}catch(e){}return false;},httpNotModified:function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified;}if(etag){jQuery.etag[url]=etag;}return xhr.status===304||xhr.status===0;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){jQuery.error("parsererror");}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=jQuery.parseJSON(data);}else if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data);}}return data;},param:function(a,traditional){var s=[];if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional;}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value);});}else{for(var prefix in a){buildParams(prefix,a[prefix]);}}return s.join("&").replace(r20,"+");function buildParams(prefix,obj){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||/\[\]$/.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v);}});}else if(!traditional&&obj!=null&&typeof obj==="object"){jQuery.each(obj,function(k,v){buildParams(prefix+"["+k+"]",v);});}else{add(prefix,obj);}}function add(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);}}});var elemdisplay={},rfxtypes=/toggle|show|hide/,rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show:function(speed,callback){if(speed||speed===0){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var nodeName=this[i].nodeName,display;if(elemdisplay[nodeName]){display=elemdisplay[nodeName];}else{var elem=jQuery("<"+nodeName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block";}elem.remove();elemdisplay[nodeName]=display;}jQuery.data(this[i],"olddisplay",display);}}for(var j=0,k=this.length;j<k;j++){this[j].style.display=jQuery.data(this[j],"olddisplay")||"";}return this;}},hide:function(speed,callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}}for(var j=0,k=this.length;j<k;j++){this[j].style.display="none";}return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments);}else if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();});}else{this.animate(genFx("toggle",3),fn,fn2);}return this;},fadeTo:function(speed,to,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete);}return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType===1&&jQuery(this).is(":hidden"),self=this;for(p in prop){var name=p.replace(rdashAlpha,fcamelCase);if(p!==name){prop[name]=prop[p];delete prop[p];p=name;}if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this);}if((p==="height"||p==="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0];}}if(opt.overflow!=null){this.style.overflow="hidden";}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop);}else{var parts=rfxnum.exec(val),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start;}e.custom(start,end,unit);}else{e.custom(start,val,"");}}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([]);}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true);}timers.splice(i,1);}}});if(!gotoEnd){this.dequeue();}return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue();}if(jQuery.isFunction(opt.old)){opt.old.call(this);}};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={};}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block";}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop];}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(jQuery.fx.tick,13);}},show:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var old=jQuery.data(this.elem,"olddisplay");this.elem.style.display=old?old:this.options.display;if(jQuery.css(this.elem,"display")==="none"){this.elem.style.display="block";}}if(this.options.hide){jQuery(this.elem).hide();}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p]);}}this.options.complete.call(this.elem);}return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{tick:function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1);}}if(!timers.length){jQuery.fx.stop();}},stop:function(){clearInterval(timerId);timerId=null;},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit;}else{fx.elem[fx.prop]=fx.now;}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};}function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}if("getBoundingClientRect"in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}if(!elem||!elem.ownerDocument){return null;}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}var box=elem.getBoundingClientRect(),doc=elem.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};}else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i);});}if(!elem||!elem.ownerDocument){return null;}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem);}jQuery.offset.initialize();var offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break;}computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;}prevComputedStyle=computedStyle;}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft;}if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft);}return{top:top,left:left};};}jQuery.offset={initialize:function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.curCSS(body,"marginTop",true))||0,html="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed",checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden",innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);body=container=innerDiv=checkDiv=table=td=null;jQuery.offset.initialize=jQuery.noop;},bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.curCSS(body,"marginTop",true))||0;left+=parseFloat(jQuery.curCSS(body,"marginLeft",true))||0;}return{top:top,left:left};},setOffset:function(elem,options,i){if(/static/.test(jQuery.curCSS(elem,"position"))){elem.style.position="relative";}var curElem=jQuery(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery.curCSS(elem,"left",true),10)||0;if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset);}var props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using"in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({position:function(){if(!this[0]){return null;}var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.curCSS(elem,"marginTop",true))||0;offset.left-=parseFloat(jQuery.curCSS(elem,"marginLeft",true))||0;parentOffset.top+=parseFloat(jQuery.curCSS(offsetParent[0],"borderTopWidth",true))||0;parentOffset.left+=parseFloat(jQuery.curCSS(offsetParent[0],"borderLeftWidth",true))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent;}return offsetParent;});}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem=this[0],win;if(!elem){return null;}if(val!==undefined){return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop());}else{this[method]=val;}});}else{win=getWindow(elem);return win?("pageXOffset"in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method];}};});function getWindow(elem){return("scrollTo"in elem&&elem.document)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;}jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],type,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],type,false,margin?"margin":"border"):null;};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this;}if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()));});}return("scrollTo"in elem&&elem.document)?elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name]:(elem.nodeType===9)?Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]):size===undefined?jQuery.css(elem,type):this.css(type,typeof size==="string"?size:size+"px");};});window.jQuery=window.$=jQuery;})(window);
(function($){var flashMinVersion=[8,0,0];var flashMaxVersion=[9,999,999];var flashDetectedVersion=[0,0,0];var swfpath;var debugging;var flashdetect=function(minVersion,maxVersion){var d=null;var minVersionOk=false;var maxVersionOk=false;if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]=="object"){d=navigator.plugins["Shockwave Flash"].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");flashDetectedVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);flashDetectedVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);if(/r/.test(d)){flashDetectedVersion[2]=parseInt(d.replace(/^.*r(.*)$/,"$1"),10);}else{flashDetectedVersion[2]=0;}if(flashDetectedVersion[0]>minVersion[0]||(flashDetectedVersion[0]==minVersion[0]&&flashDetectedVersion[1]>minVersion[1])||(flashDetectedVersion[0]==minVersion[0]&&flashDetectedVersion[1]==minVersion[1]&&flashDetectedVersion[2]>=minVersion[2])){minVersionOk=true;}if(flashDetectedVersion[0]<maxVersion[0]||(flashDetectedVersion[0]==maxVersion[0]&&flashDetectedVersion[1]<maxVersion[1])||(flashDetectedVersion[0]==maxVersion[0]&&flashDetectedVersion[1]==maxVersion[1]&&flashDetectedVersion[2]<=maxVersion[2])){maxVersionOk=true;}if(minVersionOk&&maxVersionOk){return true;}return false;}}return false;};var iecopydetect=function(){if(typeof window.clipboardData!="undefined"){return true;}};var debug=function(string){if(debugging&&typeof console!="undefined"&&typeof console.log=="function"){console.log(string);}};var swfready=function(){if($.clipboardReady.done){return false;}if(typeof $.clipboardReady.counter=='undefined'){$.clipboardReady.counter=0;}$.clipboardReady.counter++;if($.clipboardReady.counter>599){clearInterval($.clipboardReady.timer);debug("Waited "+$.clipboardReady.counter/10+" seconds for Flash object to load, terminating.");return false;}if(($.clipboardReady.counter%100)==0){debug("Waited "+$.clipboardReady.counter/10+" seconds for Flash object to load so far...");}var swf=$("#jquery_clipboard_swf:first");var swfdom=$(swf).get(0);if(typeof swfdom.jqueryClipboardCopy=="function"&&swfdom.jqueryClipboardAvailable){clearInterval($.clipboardReady.timer);$.clipboardReady.timer=null;$.clipboard.method='flash';for(var i=0;i<$.clipboardReady.ready.length;i++){$.clipboardReady.ready[i]();}$.clipboardReady.ready=null;$.clipboardReady.done=true;debug("jQuery.clipboard: OK. Initialized and ready to copy using Flash method.");}};$.clipboardReady=function(f,options){options=jQuery.extend({swfpath:"jquery.clipboard.swf",debug:false},options);swfpath=options.swfpath;debugging=options.debug;if(iecopydetect()){$.clipboard.method='ie';debug("jQuery.clipboard: OK. Initialized and ready to copy using native IE method.");return f();}if($.clipboardReady.done){return f();}if($.clipboardReady.timer){$.clipboardReady.ready.push(f);}else{if(flashdetect(flashMinVersion,flashMaxVersion)){$("#jquery_clipboard_swf").remove();$("#jquery_clipboard_div").remove();var div;div=$("<div/>").attr("id","jquery_clipboard_div").css("width","0").css("height","0").appendTo("body").html("");var swf;swf=$('<embed id="jquery_clipboard_swf" name="jquery_clipboard_swf" src="'+swfpath+'" type="application/x-shockwave-flash"></embed>');$(swf).css("width","0").css("height","0").appendTo(div);$.clipboardReady.ready=[f];$.clipboardReady.timer=setInterval(swfready,100);debug("jQuery.clipboard: INFO. Waiting for Flash object to become ready. Detected Flash version: "+flashDetectedVersion[0]+"."+flashDetectedVersion[1]+"."+flashDetectedVersion[2]);}else if(flashDetectedVersion[0]===0){debug("jQuery.clipboard: ERROR. Flash plugin not detected.");return false;}else{debug("jQuery.clipboard: ERROR. Flash version not supported. Minimum: "+flashMinVersion[0]+"."+flashMinVersion[1]+"."+flashMinVersion[2]+" Maximum: "+flashMaxVersion[0]+"."+flashMaxVersion[1]+"."+flashMaxVersion[2]+" Detected: "+flashDetectedVersion[0]+"."+flashDetectedVersion[1]+"."+flashDetectedVersion[2]);return false;}}};$.clipboard=function(text){if(arguments.length<1||typeof text!="string"){debug("jQuery.clipboard: ERROR. Nothing to copy. You must specify a string as the first parameter.");return false;}if($.clipboard.method=='ie'){try{window.clipboardData.setData("Text",text);debug("jQuery.clipboard: OK. Copied "+text.length+" bytes to clipboard using native IE method.");return true;}catch(e){debug("jQuery.clipboard: ERROR. Tried to copy using native IE method but an unknown error occurred.");return false;}}if($.clipboard.method=='flash'){var swf=$("#jquery_clipboard_swf:first");var swfdom=$(swf).get(0);if(swfdom.jqueryClipboardCopy(text)){debug("jQuery.clipboard: OK. Copied "+text.length+" bytes to clipboard using Flash method.");return true;}else{debug("jQuery.clipboard: ERROR. Tried to copy using Flash method but an unknown error occurred.");return false;}}debug("jQuery.clipboard: ERROR. You must use $.clipboardReady() in conjunction with $.clipboard().");return false;};})(jQuery);
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};
var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",ON_READY_STATE_CHANGE="onreadystatechange",win=window,doc=document,nav=navigator,plugin=false,domLoadFnArr=[main],regObjArr=[],objIdArr=[],listenersArr=[],storedAltContent,storedAltContentId,storedCallbackFn,storedCallbackObj,isDomLoaded=false,isExpressInstallActive=false,dynamicStylesheet,dynamicStylesheetMedia,autoHideShow=true,ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=!+"\v1",playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){plugin=true;ie=false;d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/[a-zA-Z]/.test(d)?parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else if(typeof win.ActiveXObject!=UNDEF){try{var a=new ActiveXObject(SHOCKWAVE_FLASH_AX);if(a){d=a.GetVariable("$version");if(d){ie=true;d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}}}catch(e){}}return{w3:w3cdom,pv:playerVersion,wk:webkit,ie:ie,win:windows,mac:mac};}(),onDomLoad=function(){if(!ua.w3){return;}if((typeof doc.readyState!=UNDEF&&doc.readyState=="complete")||(typeof doc.readyState==UNDEF&&(doc.getElementsByTagName("body")[0]||doc.body))){callDomLoadFunctions();}if(!isDomLoaded){if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,false);}if(ua.ie&&ua.win){doc.attachEvent(ON_READY_STATE_CHANGE,function(){if(doc.readyState=="complete"){doc.detachEvent(ON_READY_STATE_CHANGE,arguments.callee);callDomLoadFunctions();}});if(win==top){(function(){if(isDomLoaded){return;}try{doc.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,0);return;}callDomLoadFunctions();})();}}if(ua.wk){(function(){if(isDomLoaded){return;}if(!/loaded|complete/.test(doc.readyState)){setTimeout(arguments.callee,0);return;}callDomLoadFunctions();})();}addLoadEvent(callDomLoadFunctions);}}();function callDomLoadFunctions(){if(isDomLoaded){return;}try{var t=doc.getElementsByTagName("body")[0].appendChild(createElement("span"));t.parentNode.removeChild(t);}catch(e){return;}isDomLoaded=true;var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]();}}function addDomLoadEvent(fn){if(isDomLoaded){fn();}else{domLoadFnArr[domLoadFnArr.length]=fn;}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false);}else if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false);}else if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn);}else if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn();};}else{win.onload=fn;}}function main(){if(plugin){testPlayerVersion();}else{matchVersions();}}function testPlayerVersion(){var b=doc.getElementsByTagName("body")[0];var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);var t=b.appendChild(o);if(t){var counter=0;(function(){if(typeof t.GetVariable!=UNDEF){var d=t.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");ua.pv=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)];}}else if(counter<10){counter++;setTimeout(arguments.callee,10);return;}b.removeChild(o);t=null;matchVersions();})();}else{matchVersions();}}function matchVersions(){var rl=regObjArr.length;if(rl>0){for(var i=0;i<rl;i++){var id=regObjArr[i].id;var cb=regObjArr[i].callbackFn;var cbObj={success:false,id:id};if(ua.pv[0]>0){var obj=getElementById(id);if(obj){if(hasPlayerVersion(regObjArr[i].swfVersion)&&!(ua.wk&&ua.wk<312)){setVisibility(id,true);if(cb){cbObj.success=true;cbObj.ref=getObjectById(id);cb(cbObj);}}else if(regObjArr[i].expressInstall&&canExpressInstall()){var att={};att.data=regObjArr[i].expressInstall;att.width=obj.getAttribute("width")||"0";att.height=obj.getAttribute("height")||"0";if(obj.getAttribute("class")){att.styleclass=obj.getAttribute("class");}if(obj.getAttribute("align")){att.align=obj.getAttribute("align");}var par={};var p=obj.getElementsByTagName("param");var pl=p.length;for(var j=0;j<pl;j++){if(p[j].getAttribute("name").toLowerCase()!="movie"){par[p[j].getAttribute("name")]=p[j].getAttribute("value");}}showExpressInstall(att,par,id,cb);}else{displayAltContent(obj);if(cb){cb(cbObj);}}}}else{setVisibility(id,true);if(cb){var o=getObjectById(id);if(o&&typeof o.SetVariable!=UNDEF){cbObj.success=true;cbObj.ref=o;}cb(cbObj);}}}}}function getObjectById(objectIdStr){var r=null;var o=getElementById(objectIdStr);if(o&&o.nodeName=="OBJECT"){if(typeof o.SetVariable!=UNDEF){r=o;}else{var n=o.getElementsByTagName(OBJECT)[0];if(n){r=n;}}}return r;}function canExpressInstall(){return!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)&&!(ua.wk&&ua.wk<312);}function showExpressInstall(att,par,replaceElemIdStr,callbackFn,jObj){isExpressInstallActive=true;storedCallbackFn=callbackFn||null;storedCallbackObj={success:false,id:replaceElemIdStr};var obj=getElementById(replaceElemIdStr);if(obj){if(obj.nodeName=="OBJECT"){storedAltContent=abstractAltContent(obj);storedAltContentId=null;}else{storedAltContent=obj;storedAltContentId=replaceElemIdStr;}att.id=EXPRESS_INSTALL_ID;if(typeof att.width==UNDEF||(!/%$/.test(att.width)&&parseInt(att.width,10)<310)){att.width="310";}if(typeof att.height==UNDEF||(!/%$/.test(att.height)&&parseInt(att.height,10)<137)){att.height="137";}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",fv="MMredirectURL="+win.location.toString().replace(/&/g,"%26")+"&MMplayerType="+pt+"&MMdoctitle="+doc.title;if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+fv;}else{par.flashvars=fv;}if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceElemIdStr+="SWFObjectNew";newObj.setAttribute("id",replaceElemIdStr);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";(function(){if(obj.readyState==4){obj.parentNode.removeChild(obj);}else{setTimeout(arguments.callee,10);}})();}createSWF(att,par,replaceElemIdStr,jObj);}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";(function(){if(obj.readyState==4){obj.parentNode.removeChild(obj);}else{setTimeout(arguments.callee,10);}})();}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj);}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML;}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true));}}}}}return ac;}function createSWF(attObj,parObj,id,jObj){var r,el=jObj||getElementById(id);if(ua.wk&&ua.wk<312){return r;}if(el){if(typeof attObj.id==UNDEF){attObj.id=id;}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i];}else if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"';}else if(i.toLowerCase()!="classid"){att+=' '+i+'="'+attObj[i]+'"';}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />';}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+'>'+par+'</object>';objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id);}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m]);}else if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m]);}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n]);}}el.parentNode.replaceChild(o,el);r=o;}}return r;}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p);}function removeSWF(id){var obj=getElementById(id);if(obj&&obj.nodeName=="OBJECT"){if(ua.ie&&ua.win){obj.style.display="none";(function(){if(obj.readyState==4){removeObjectInIE(id);}else{setTimeout(arguments.callee,10);}})();}else{obj.parentNode.removeChild(obj);}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null;}}obj.parentNode.removeChild(obj);}}function getElementById(id){var el=null;try{el=doc.getElementById(id);}catch(e){}return el;}function createElement(el){return doc.createElement(el);}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn];}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false;}function createCSS(sel,decl,media,newStyle){if(ua.ie&&ua.mac){return;}var h=doc.getElementsByTagName("head")[0];if(!h){return;}var m=(media&&typeof media=="string")?media:"screen";if(newStyle){dynamicStylesheet=null;dynamicStylesheetMedia=null;}if(!dynamicStylesheet||dynamicStylesheetMedia!=m){var s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media",m);dynamicStylesheet=h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){dynamicStylesheet=doc.styleSheets[doc.styleSheets.length-1];}dynamicStylesheetMedia=m;}if(ua.ie&&ua.win){if(dynamicStylesheet&&typeof dynamicStylesheet.addRule==OBJECT){dynamicStylesheet.addRule(sel,decl);}}else{if(dynamicStylesheet&&typeof doc.createTextNode!=UNDEF){dynamicStylesheet.appendChild(doc.createTextNode(sel+" {"+decl+"}"));}}}function setVisibility(id,isVisible){if(!autoHideShow){return;}var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v;}else{createCSS("#"+id,"visibility:"+v);}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars&&typeof encodeURIComponent!=UNDEF?encodeURIComponent(s):s;}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2]);}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j]);}for(var k in ua){ua[k]=null;}ua=null;for(var l in swfobject){swfobject[l]=null;}swfobject=null;});}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr,callbackFn){if(ua.w3&&objectIdStr&&swfVersionStr){var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr;regObj.callbackFn=callbackFn;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false);}else if(callbackFn){callbackFn({success:false,id:objectIdStr});}},getObjectById:function(objectIdStr){if(ua.w3){return getObjectById(objectIdStr);}},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj,callbackFn,jObj,alternateHtml){var callbackObj={success:false,id:replaceElemIdStr};if(ua.w3&&!(ua.wk&&ua.wk<312)&&swfUrlStr&&replaceElemIdStr&&widthStr&&heightStr&&swfVersionStr){setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){widthStr+="";heightStr+="";var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){att[i]=attObj[i];}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){par[j]=parObj[j];}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k];}else{par.flashvars=k+"="+flashvarsObj[k];}}}if(hasPlayerVersion(swfVersionStr)){var obj=createSWF(att,par,replaceElemIdStr,jObj);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true);}callbackObj.success=true;callbackObj.ref=obj;}else if(xiSwfUrlStr&&canExpressInstall()){att.data=xiSwfUrlStr;showExpressInstall(att,par,replaceElemIdStr,callbackFn);return;}else if(alternateHtml){var el=jObj||getElementById(id);if(el){el.parentNode.innerHTML=alternateHtml;}}else{att=att||{};att.codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';var obj=createSWF(att,par,replaceElemIdStr,jObj);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true);}callbackObj.success=true;callbackObj.ref=obj;}if(callbackFn){callbackFn(callbackObj);}});}else if(callbackFn){callbackFn(callbackObj);}},switchOffAutoHideShow:function(){autoHideShow=false;},ua:ua,getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]};},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr,jObj){if(ua.w3){return createSWF(attObj,parObj,replaceElemIdStr,jObj);}else{return undefined;}},showExpressInstall:function(att,par,replaceElemIdStr,callbackFn){if(ua.w3&&canExpressInstall()){showExpressInstall(att,par,replaceElemIdStr,callbackFn);}},removeSWF:function(objElemIdStr){if(ua.w3){removeSWF(objElemIdStr);}},createCSS:function(selStr,declStr,mediaStr,newStyleBoolean){if(ua.w3){createCSS(selStr,declStr,mediaStr,newStyleBoolean);}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(q){if(/\?/.test(q)){q=q.split("?")[1];}if(param==null){return urlEncodeIfNecessary(q);}var pairs=q.split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)));}}}return"";},expressInstallCallback:function(){if(isExpressInstallActive){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj&&storedAltContent){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block";}}if(storedCallbackFn){storedCallbackFn(storedCallbackObj);}}isExpressInstallActive=false;}}};}();if(!swfobject.ua||!swfobject.ua.pv||!swfobject.ua.pv.length||swfobject.ua.pv[0]==0){window._jwscript=false;$.ajax({url:'/Shared/js2/j/jwplayer.min.js',dataType:'script',success:function(){window._jwscript===true;}});}$.fn.embedswf=function(options,reload){return this.each(function(i){var el=$(this);if(reload){el.removeswf();}if(el.children('object').length==0){var movie,width,height,version,flashvars,attributes;var params={allowfullscreen:true,allowscriptaccess:'sameDomain',wmode:'transparent',pluginspage:'http://www.macromedia.com/go/getflashplayer'};if(options){if(options.nocache){movie=$.getAjaxUrl(options.swf,{RND:Math.random()});}else{movie=options.swf;}width=options.width;height=options.height;flashvars={};if(options.params){for(var p in options.params){if(p=='flashvars'){flashvars=options.params[p];}else{params[p]=options.params[p];}}}if(!options.id){options.id=('Player'+Math.random()).replace('.','');}attributes={};attributes.id=options.id;attributes.name=options.id;}else{var movie=el.attr('_movie'),w=$.curCSS(el[0],'width');width=el.attr('_width')||$.toInt(w)||el.width(),height=el.attr('_height')||$.toInt($.curCSS(el[0],'height'))||el.height(),loop=$.toBool(el.attr('_loop')),vars=el.attr('_flashvars'),id=el.attr('_id'),version=el.attr('_version');if(w==='auto'){if(!width){width=el.parent().width();}height=(width/16*9)+$.toInt(el.attr('_skin'));}if(!movie||!width||!height){return;}if($.toBool(el.attr('_nocache'))){movie=$.getAjaxUrl(movie,{RND:Math.random()});}if(!id){id=('Player'+Math.random()).replace('.','');}attributes={};attributes.id=id;attributes.name=id;params.loop=loop.toString();if(el.attr('_wmode')=='opaque'){params.wmode='opaque';}var flashvars={};if(vars){try{var v=vars.replace(/&(?:amp;)+/g,'&').split('&');for(var i=0;i<v.length;i++){var pair=v[i].split('=');flashvars[pair[0]]=pair[1];}}catch(ex){flashvars={};}}}if(movie&&width&&height){el.attr('_id',attributes.id);var control=('FlashSWF'+Math.random()).replace('.',''),alternate=el.children("[_alternate]").attr('_alternate');if(alternate){alternate=$.decode(alternate);}else if(!el.is('.icobalt')){alternate=$.cleanHtml($.trim(el.html()||""));}el.html('<div id="'+control+'"></div>');if(movie.endsWith('/longtail/player.swf')||movie.endsWith('/lt/player.swf')){if($.toBool($.getQueryString('bandwidth'))){if(flashvars.plugins){flashvars.plugins+=',qualitymonitor';}else{flashvars.plugins='qualitymonitor';}}var jwoptions=$.extend({flashplayer:movie,width:width,height:height},flashvars);var levels=null;if(levels=el.attr('_levels')){try{levels=eval('('+levels+')');}catch(ex){levels=null;}}if(levels){flashvars.levels=$.encode("[[JSON]]"+el.attr('_levels'));jwoptions.levels=levels;if(levels.length>=3){jwoptions.file=levels[2].file;}}if(jwoptions.streamer){delete jwoptions.streamer;if(typeof jwoptions.file==='string'){jwoptions.file=jwoptions.file.replace(/^\d+/,'');}if($.isArray(jwoptions.levels)){for(var i=0;i<jwoptions.levels.length;i++){jwoptions.levels[i].file=jwoptions.levels[i].file.replace(/^\d+/,'');}}}if(jwoptions.skin){jwoptions.skin=jwoptions.skin.replace(/\/(\w+).zip/,'/$1/$1.xml');}if(typeof jwplayer!=='undefined'){if(!jwoptions["controlbar.position"]){jwoptions["controlbar.position"]="bottom";}jwplayer(control).setup(jwoptions);return;}else if(window._jwscript===false){var fn=function(_control,_options){return function(){if(typeof jwplayer!=='undefined'){jwplayer(_control).setup(_options);}_control=null;_options=null;};}(control,jwoptions);setTimeout(fn,100);return;}else if(levels&&levels.length>1){}}if(alternate){el.data('alternate',alternate);}else{el.removeData('alternate');}swfobject.embedSWF(movie,control,width,height,version||'9.0.0',"Shared/js/expressInstall.swf",flashvars,params,attributes,null,el[0].childNodes[0],alternate);}}});};$.fn.removeswf=function(){this.find('object').each(function(i){var id=$(this).attr('id');if(id){swfobject.removeSWF(id);}});return this;};$.cobalt=$.cobalt||{};$.cobalt.swfUploader=function(el,url,options){if(!el||!url)return;var btn=el.find('span.swfu_button');if(!btn.length)return;var id=('swfub_'+Math.random()).replace(/\./g,'');btn.attr('id',id);var o=options||{};var swfu=new SWFUpload({upload_url:url,post_params:{"ASPSESSID":$(document.body).attr('_session'),"AUTHID":$(document.body).attr('_auth')},file_size_limit:o.size||"256 KB",file_types:o.types||"*.jpg;*.jpeg;*.jpe;*.gif;*.png",file_types_description:o.typeDescription||"Images",file_upload_limit:o.limit||"1",file_queue_error_handler:function(file,errorCode,message){switch(errorCode){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:alert('File too large, maximum size is '+(o.limit||"256 KB"));break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:if((o.limit||"1")=="1")alert('Please upload one file at a time.');else alert('Too many files.');break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:alert('The selected file is empty.');break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:alert('Invalid file type.');break;default:alert(message||'The file could not be uploaded.  Tech services has been notified.');break;}},file_dialog_complete_handler:function(numFilesSelected,numFilesQueued){try{if(numFilesQueued>0){this.startUpload();}}catch(ex){this.debug(ex);}},upload_progress_handler:function(file,bytesLoaded){if(!this.customSettings.progress_bar){this.customSettings.progress_bar=this.customSettings.upload_target.children('div.progressBar');this.customSettings.progress_status=this.customSettings.upload_target.children('div.progressStatus');}var w=parseInt(bytesLoaded/file.size)*250;this.customSettings.progress_bar.css({width:w});this.customSettings.progress_status.html('Uploading - '+$.kbFormat(bytesLoaded)+' out of '+$.kbFormat(file.size));},upload_error_handler:function(file,errorCode,message){switch(errorCode){case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:default:alert(message);break;}},upload_success_handler:function(file,serverData){if(!this.customSettings.progress_status)this.customSettings.progress_status=this.customSettings.upload_target.children('div.progressStatus');this.customSettings.progress_status.html('Success - '+$.kbFormat(file.size));},upload_complete_handler:function(file){if(this.getStats().files_queued>0){this.startUpload();}else if($.isFunction(o.oncomplete)){file.name=file.name.replace(/%20/g,'-').replace(/ /g,'-');o.oncomplete(this,file);}},button_image_url:o.uploadBtn||"Shared/js/swfupload/uploadbtn.gif",button_placeholder_id:id,button_width:79,button_height:18,button_text_top_padding:0,button_text_left_padding:0,flash_url:"Shared/js/swfupload/swfupload.swf",custom_settings:{container:el,upload_target:el.find('div.progressContainer')},debug:false});el.data('swfu',swfu);};function playerReady(p){var swf=window.document[p.id];if(swf){var div=$(swf).parent('div');div.data('swf',swf);if(swf.sendEvent){$.log('playerReady - '+p.id);div.data('swfready',true);div.trigger('swfready');}}else{$.log('player could not be found');$.log(p);}}function playerFire(p,evt){var swf=window.document[p.id];if(swf){$.log('playerFire - '+p.id+' - '+evt);var div=$(swf).parent('div');var args=Array.prototype.slice.call(arguments);args.shift();args.shift();$.log(args);div.trigger(evt,args);}}function fteReady(p){var swf=window.document[p.id];if(swf){var div=$(swf).parent('div');div.data('swf',swf);if(!div.data('swfready')){$.log('fteReady - '+p.id);div.data('swfready',true);div.trigger('swfready');}}else{$.log('fte could not be found');$.log(p);}}function fteChanged(p){var swf=window.document[p.id];if(swf){var div=$(swf).parent('div');div.trigger('swfchange');}}function fteSave(p){var swf=window.document[p.id];if(swf){var div=$(swf).parent('div');div.trigger('swfsave');}}$.fn.swfready=function(fn){return this.each(function(i){var div=$(this);if(div.data('swfready')){div.trigger('swfready');}else{div.bind('swfready',fn);}});}
;(function($){$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}if(typeof options=='function')options={success:options};var url=$.trim(this.attr('action'));if(url){url=(url.match(/^([^#]+)/)||[])[1];}url=url||window.location.href||'';options=$.extend({url:url,type:this.attr('method')||'GET',iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])a.push({name:n,value:options.data[n][k]});}else a.push({name:n,value:options.data[n]});}}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}else options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(oldSuccess,arguments);});}else if(options.success)callbacks.push(options.success);options.success=function(data,status,xhr){for(var i=0,max=callbacks.length;i<max;i++)callbacks[i].apply(options,[data,status,xhr||$form,$form]);};var files=$('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)if(files[j])found=true;var multipart=false;if((files.length&&options.iframe!==false)||options.iframe||found||multipart){if(options.closeKeepAlive)$.get(options.closeKeepAlive,fileUpload);else fileUpload();}else $.ajax(options);this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(){var form=$form[0];if($(':input[name=submit]',form).length){alert('Error: Form elements must not be named "submit".');return;}var opts=$.extend({},$.ajaxSettings,options);var s=$.extend(true,{},$.extend(true,{},$.ajaxSettings),opts);var id='jqFormIO'+(new Date().getTime());var $io=$('<iframe id="'+id+'" name="'+id+'" src="'+opts.iframeSrc+'" onload="(jQuery(this).data(\'form-plugin-onload\'))()" />');var io=$io[0];$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src',opts.iframeSrc);}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&$.active--;return;}if(xhr.aborted)return;var cbInvoked=false;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){opts.extraData=opts.extraData||{};opts.extraData[n]=sub.value;if(sub.type=="image"){opts.extraData[n+'.x']=form.clk_x;opts.extraData[n+'.y']=form.clk_y;}}}function doSubmit(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST')form.setAttribute('method','POST');if(form.getAttribute('action')!=opts.url)form.setAttribute('action',opts.url);if(!opts.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}if(opts.timeout)setTimeout(function(){timedOut=true;cb();},opts.timeout);var extraInputs=[];try{if(opts.extraData)for(var n in opts.extraData)extraInputs.push($('<input type="hidden" name="'+n+'" value="'+opts.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo('body');$io.data('form-plugin-onload',cb);form.submit();}finally{form.setAttribute('action',a);t?form.setAttribute('target',t):$form.removeAttr('target');$(extraInputs).remove();}};if(opts.forceSync)doSubmit();else setTimeout(doSubmit,10);var domCheckCount=100;function cb(){if(cbInvoked)return;var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;var isXml=opts.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&(doc.body==null||doc.body.innerHTML=='')){if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return;}log('Could not access iframe DOM after 100 tries.');return;}log('response detected');cbInvoked=true;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header];};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];if(ta)xhr.responseText=ta.value;else{var pre=doc.getElementsByTagName('pre')[0];if(pre)xhr.responseText=pre.innerHTML;}}else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}data=$.httpData(xhr,opts.dataType);}catch(e){log('error caught:',e);ok=false;xhr.error=e;$.handleError(opts,xhr,'error',e);}if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts]);}if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.removeData('form-plugin-onload');$io.remove();xhr.responseXML=null;},100);};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}else doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null;};};};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(e){e.preventDefault();$(this).ajaxSubmit(options);}).bind('click.form-plugin',function(e){var target=e.target;var $el=$(target);if(!($el.is(":submit,input:image"))){var t=$el.closest(':submit');if(t.length==0)return;target=t[0];}var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);});};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin');};$.fn.formToArray=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(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}continue;}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)a.push({name:n,value:v[j]});}else if(v!==null&&typeof v!='undefined')a.push({name:n,value:v});}if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0],n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);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 $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))continue;v.constructor==Array?$.merge(val,v):val.push(v);}return val;};$.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=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-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.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v)v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;if(one)return v;a.push(v);}}return a;}return el.value;};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.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;});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))this.reset();});};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select==undefined)select=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')this.checked=select;else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}this.selected=select;}});};function log(){if($.fn.ajaxSubmit.debug){var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log)window.console.log(msg);else if(window.opera&&window.opera.postError)window.opera.postError(msg);}};})(jQuery);
;jQuery.ui||(function($){$.ui={version:"1.8",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESC:27,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120}};$.fn.extend({_focus:$.fn.focus,focus:function(delay,fn){return typeof delay==='number'?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();(fn&&fn.call(elem));},delay);}):this._focus.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;},zIndex:function(zIndex){if(zIndex!==undefined){return this.css('zIndex',zIndex);}if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css('position');if(position=='absolute'||position=='relative'||position=='fixed'){value=parseInt(elem.css('zIndex'));if(!isNaN(value)&&value!=0){return value;}}elem=elem.parent();}}return 0;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});})(jQuery);
(function($){var _remove=$.fn.remove;$.fn.remove=function(selector,keepData){return this.each(function(){if(!keepData){if(!selector||$.filter(selector,[this]).length){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});}}return _remove.call($(this),selector,keepData);});};$.widget=function(name,base,prototype){var namespace=name.split(".")[0],fullName;name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}$.expr[":"][fullName]=function(elem){return!!$.data(elem,name);};$[namespace]=$[namespace]||{};$[namespace][name]=function(options,element){if(arguments.length){this._createWidget(options,element);}};var basePrototype=new base();basePrototype.options=$.extend({},basePrototype.options);for(var p in basePrototype.options){var obj=basePrototype.options[p];if($.isPlainObject(obj)){basePrototype.options[p]=$.extend({},obj);}else if($.isArray(obj)){if(prototype.options&&prototype.options[p]){basePrototype.options[p]=[];}else{basePrototype.options[p]=obj.slice(0);}}}$[namespace][name].prototype=$.extend(true,basePrototype,{namespace:namespace,widgetName:name,widgetEventPrefix:$[namespace][name].prototype.widgetEventPrefix||name,widgetBaseClass:fullName},prototype);if(!basePrototype.options.nobridge){$.widget.bridge(name,$[namespace][name]);}};$.widget.bridge=function(name,object){$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.substring(0,1)==="_"){return returnValue;}if(isMethodCall){this.each(function(){var instance=$.data(this,name),methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false;}});}else{this.each(function(){var instance=$.data(this,name);if(instance){if(options){instance.option(options);}instance._init();}else{$.data(this,name,new object(options,this));}});}return returnValue;};};$.Widget=function(options,element){if(arguments.length){this._createWidget(options,element);}};$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(options,element){this.element=$(element).data(this.widgetName,this);this.options=$.extend(true,{},this.options,$.metadata&&$.metadata.get(element)[this.widgetName],options);var self=this;this.element.bind("remove."+this.widgetName,function(){self.destroy();});this._create();this._init();},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled");},widget:function(){return this.element;},option:function(key,value){var options=key,self=this;if(arguments.length===0){return $.extend({},self.options);}if(typeof key==="string"){if(value===undefined){return this.options[key];}options={};options[key]=value;}$.each(options,function(key,value){self._setOption(key,value);});return self;},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget()[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+this.namespace+"-state-disabled").attr("aria-disabled",value);}return this;},enable:function(){return this._setOption("disabled",false);},disable:function(){return this._setOption("disabled",true);},_trigger:function(type,event,data){var callback=this.options[type];event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();data=data||{};if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data,this)===false||event.isDefaultPrevented());}};})(jQuery);
(function($){$.widget("ui.mouse",{options:{cancel:':input,option',distance:1,delay:0},_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return;}(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button&&$.browser.version<8){return this._mouseUp(event);}if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}});})(jQuery);(function($){var types=['DOMMouseScroll','mousewheel'];$.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var i=types.length;i;)this.addEventListener(types[--i],handler,false);else this.onmousewheel=handler;},teardown:function(){if(this.removeEventListener)for(var i=types.length;i;)this.removeEventListener(types[--i],handler,false);else this.onmousewheel=null;}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});function handler(event){var args=[].slice.call(arguments,1),delta=0,returnValue=true;var e=event||window.event;if(!e){var doc=this.ownerDocument;var wn=doc.parentWindow||doc.defaultView;e=wn.event;}e=$.event.fix(e||{});e.type="mousewheel";if(e.wheelDelta)e.delta=e.wheelDelta/120;if(e.detail)e.delta=-e.detail/3;args.unshift(e,delta);return $.event.handle.apply(this,args);}})(jQuery);
(function($){$.ui=$.ui||{};var horizontalPositions=/left|center|right/,horizontalDefault="center",verticalPositions=/top|center|bottom/,verticalDefault="center",_position=$.fn.position,_offset=$.fn.offset;$.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments);}options=$.extend({},options);var target=$(options.of),collision=(options.collision||"flip").split(" "),offset=options.offset?options.offset.split(" "):[0,0],targetWidth,targetHeight,basePosition;if(options.of.nodeType===9){targetWidth=target.width();targetHeight=target.height();basePosition={top:0,left:0};}else if(options.of.scrollTo&&options.of.document){targetWidth=target.width();targetHeight=target.height();basePosition={top:target.scrollTop(),left:target.scrollLeft()};}else if(options.of.preventDefault){options.at="left top";targetWidth=targetHeight=0;basePosition={top:options.of.pageY,left:options.of.pageX};}else{targetWidth=target.outerWidth();targetHeight=target.outerHeight();basePosition=target.offset();}$.each(["my","at"],function(){var pos=(options[this]||"").split(" ");if(pos.length===1){pos=horizontalPositions.test(pos[0])?pos.concat([verticalDefault]):verticalPositions.test(pos[0])?[horizontalDefault].concat(pos):[horizontalDefault,verticalDefault];}pos[0]=horizontalPositions.test(pos[0])?pos[0]:horizontalDefault;pos[1]=verticalPositions.test(pos[1])?pos[1]:verticalDefault;options[this]=pos;});if(collision.length===1){collision[1]=collision[0];}offset[0]=parseInt(offset[0],10)||0;if(offset.length===1){offset[1]=offset[0];}offset[1]=parseInt(offset[1],10)||0;if(options.at[0]==="right"){basePosition.left+=targetWidth;}else if(options.at[0]===horizontalDefault){basePosition.left+=targetWidth/2;}if(options.at[1]==="bottom"){basePosition.top+=targetHeight;}else if(options.at[1]===verticalDefault){basePosition.top+=targetHeight/2;}basePosition.left+=offset[0];basePosition.top+=offset[1];return this.each(function(){var elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),position=$.extend({},basePosition);if(options.my[0]==="right"){position.left-=elemWidth;}else if(options.my[0]===horizontalDefault){position.left-=elemWidth/2;}if(options.my[1]==="bottom"){position.top-=elemHeight;}else if(options.my[1]===verticalDefault){position.top-=elemHeight/2;}$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,offset:offset,my:options.my,at:options.at});}});if($.fn.bgiframe){elem.bgiframe();}elem.offset($.extend(position,{using:options.using}));});};$.ui.position={fit:{left:function(position,data){var win=$(window),over=position.left+data.elemWidth-win.width()-win.scrollLeft();position.left=over>0?position.left-over:Math.max(0,position.left);},top:function(position,data){var win=$(window),over=position.top+data.elemHeight-win.height()-win.scrollTop();position.top=over>0?position.top-over:Math.max(0,position.top);}},flip:{left:function(position,data){if(data.at[0]==="center"){return;}var win=$(window),over=position.left+data.elemWidth-win.width()-win.scrollLeft(),myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,offset=-2*data.offset[0];position.left+=position.left<0?myOffset+data.targetWidth+offset:over>0?myOffset-data.targetWidth+offset:0;},top:function(position,data){if(data.at[1]==="center"){return;}var win=$(window),over=position.top+data.elemHeight-win.height()-win.scrollTop(),myOffset=data.my[1]==="top"?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:-data.targetHeight,offset=-2*data.offset[1];position.top+=position.top<0?myOffset+data.targetHeight+offset:over>0?myOffset+atOffset+offset:0;}}};if(!$.offset.setOffset){$.offset.setOffset=function(elem,options){if(/static/.test($.curCSS(elem,"position"))){elem.style.position="relative";}var curElem=$(elem),curOffset=curElem.offset(),curTop=parseInt($.curCSS(elem,"top",true),10)||0,curLeft=parseInt($.curCSS(elem,"left",true),10)||0,props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if('using'in options){options.using.call(elem,props);}else{curElem.css(props);}};$.fn.offset=function(options){var elem=this[0];if(!elem||!elem.ownerDocument){return null;}if(options){return this.each(function(){$.offset.setOffset(this,options);});}return _offset.call(this);};}}(jQuery));
(function($){var lastActive,baseClasses="ui-button ui-widget ui-state-default ui-corner-all",otherClasses="ui-state-hover ui-state-active "+"ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon ui-button-text-only",formResetHandler=function(event){$(":ui-button",event.target.form).each(function(){var inst=$(this).data("button");setTimeout(function(){inst.refresh();},1);});},radioGroup=function(radio){var name=radio.name,form=radio.form,radios=$([]);if(name){if(form){radios=$(form).find("[name='"+name+"']");}else{radios=$("[name='"+name+"']",radio.ownerDocument).filter(function(){return!this.form;});}}return radios;};$.widget("ui.button",{options:{text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",formResetHandler);this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var self=this,options=this.options,toggleButton=this.type==="checkbox"||this.type==="radio",hoverClass="ui-state-hover"+(!toggleButton?" ui-state-active":""),focusClass="ui-state-focus";if(options.label===null){options.label=this.buttonElement.html();}if(this.element.is(":disabled")){options.disabled=true;}this.buttonElement.addClass(baseClasses).attr("role","button").bind("mouseenter.button",function(){if(options.disabled){return;}$(this).addClass("ui-state-hover");if(this===lastActive){$(this).addClass("ui-state-active");}}).bind("mouseleave.button",function(){if(options.disabled){return;}$(this).removeClass(hoverClass);}).bind("focus.button",function(){$(this).addClass(focusClass);}).bind("blur.button",function(){$(this).removeClass(focusClass);});if(toggleButton){this.element.bind("change.button",function(){self.refresh();});}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(options.disabled){return false;}$(this).toggleClass("ui-state-active");self.buttonElement.attr("aria-pressed",self.element[0].checked);});}else if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(options.disabled){return false;}$(this).addClass("ui-state-active");self.buttonElement.attr("aria-pressed",true);var radio=self.element[0];radioGroup(radio).not(radio).map(function(){return $(this).button("widget")[0];}).removeClass("ui-state-active").attr("aria-pressed",false);});}else{this.buttonElement.bind("mousedown.button",function(){if(options.disabled){return false;}$(this).addClass("ui-state-active");lastActive=this;$(document).one("mouseup",function(){lastActive=null;});}).bind("mouseup.button",function(){if(options.disabled){return false;}$(this).removeClass("ui-state-active");}).bind("keydown.button",function(event){if(options.disabled){return false;}if(event.keyCode==$.ui.keyCode.SPACE||event.keyCode==$.ui.keyCode.ENTER){$(this).addClass("ui-state-active");}}).bind("keyup.button",function(){$(this).removeClass("ui-state-active");});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(event){if(event.keyCode===$.ui.keyCode.SPACE){$(this).click();}});}}this._setOption("disabled",options.disabled);},_determineButtonType:function(){if(this.element.is(":checkbox")){this.type="checkbox";}else{if(this.element.is(":radio")){this.type="radio";}else{if(this.element.is("input")){this.type="input";}else{this.type="button";}}}if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var checked=this.element.is(":checked");if(checked){this.buttonElement.addClass("ui-state-active");}this.buttonElement.attr("aria-pressed",checked);}else{this.buttonElement=this.element;}},widget:function(){return this.buttonElement;},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(baseClasses+" "+otherClasses).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title");}$.Widget.prototype.destroy.call(this);},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key==="disabled"){if(value){this.element.attr("disabled",true);}else{this.element.removeAttr("disabled");}}this._resetButton();},refresh:function(){var isDisabled=this.element.is(":disabled");if(isDisabled!==this.options.disabled){this._setOption("disabled",isDisabled);}if(this.type==="radio"){radioGroup(this.element[0]).each(function(){if($(this).is(":checked")){$(this).button("widget").addClass("ui-state-active").attr("aria-pressed",true);}else{$(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false);}});}else if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true);}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false);}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label);}return;}var buttonElement=this.buttonElement,buttonText=$("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(buttonElement.empty()).text(),icons=this.options.icons,multipleIcons=icons.primary&&icons.secondary;if(icons.primary||icons.secondary){buttonElement.addClass("ui-button-text-icon"+(multipleIcons?"s":""));if(icons.primary){buttonElement.prepend("<span class='ui-button-icon-primary ui-icon "+icons.primary+"'></span>");}if(icons.secondary){buttonElement.append("<span class='ui-button-icon-secondary ui-icon "+icons.secondary+"'></span>");}if(!this.options.text){buttonElement.addClass(multipleIcons?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon");if(!this.hasTitle){buttonElement.attr("title",buttonText);}}}else{buttonElement.addClass("ui-button-text-only");}}});$.widget("ui.buttonset",{_create:function(){this.element.addClass("ui-buttonset");this._init();},_init:function(){this.refresh();},_setOption:function(key,value){if(key==="disabled"){this.buttons.button("option",key,value);}$.Widget.prototype._setOption.apply(this,arguments);},refresh:function(){this.buttons=this.element.find(":button, :submit, :reset, :checkbox, :radio, a, :data(button)").filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return $(this).button("widget")[0];}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end();},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return $(this).button("widget")[0];}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");$.Widget.prototype.destroy.call(this);}});}(jQuery));
(function($){$.widget("ui.draggable",$.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack: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.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit();},destroy:function(){if(!this.element.data('draggable'))return;this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"+" ui-draggable-dragging"+" ui-draggable-disabled");this._mouseDestroy();return this;},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is('.ui-resizable-handle'))return false;this.handle=this._getHandle(event);if(!this.handle)return false;return true;},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager)$.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));if(o.containment)this._setContainment();if(this._trigger("start",event)===false){this._clear();return false;}this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,event);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true;},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger('drag',event,ui)===false){this._mouseUp({});return false;}this.position=ui.position;}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+'px';if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);return false;},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)dropped=$.ui.ddmanager.drop(this,event);if(this.dropped){dropped=this.dropped;this.dropped=false;}if(!this.element[0]||!this.element[0].parentNode)return false;if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(self._trigger("stop",event)!==false){self._clear();}});}else{if(this._trigger("stop",event)!==false){this._clear();}}return false;},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({});}else{this._clear();}return this;},_getHandle:function(event){if($.isFunction(this.options.handle)){return this.options.handle.apply(this,arguments);}var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target)handle=true;});return handle;},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=='clone'?this.element.clone():this.element);if(!helper.parents('body').length)helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position")))helper.css("position","absolute");return helper;},_adjustOffsetFromHelper:function(obj){if(typeof obj=='string'){obj=obj.split(' ');}if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};}if('left'in obj){this.offset.click.left=obj.left+this.margins.left;}if('right'in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;}if('top'in obj){this.offset.click.top=obj.top+this.margins.top;}if('bottom'in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var $ce=$(o.containment);var ce=$ce[0];if(!ce)return;var co=$ce.offset();var over=!o.nooverflow&&($ce.css("overflow")!='hidden');var dim={border:{top:parseInt($ce.css('borderTopWidth'),10)||0,right:parseInt($ce.css('borderRightWidth'),10)||0,bottom:parseInt($ce.css('borderBottomWidth'),10)||0,left:parseInt($ce.css('borderLeftWidth'),10)||0},padding:{top:parseInt($ce.css('paddingTop'),10)||0,right:parseInt($ce.css('paddingRight'),10)||0,bottom:parseInt($ce.css('paddingBottom'),10)||0,left:parseInt($ce.css('paddingLeft'),10)||0},margin:{top:this.margins.top,left:this.margins.left},helper:{width:this.helperProportions.width,height:this.helperProportions.height}};$.each(["Width","Height"],function(i,name){var prop=name.toLowerCase();if(over){dim[prop]=Math.max(ce['scroll'+name],ce['offset'+name]);}else{dim[prop]=Math.min(ce['scroll'+name],ce['offset'+name]);if(!dim[prop]){dim[prop]=ce['offset'+name];}}});this.containment=[co.left+dim.border.left+dim.padding.left,co.top+dim.border.top+dim.padding.top,co.left+dim.width-dim.padding.right-dim.helper.width,co.top+dim.height-dim.padding.bottom-dim.helper.height];}else if(o.containment.constructor==Array){this.containment=o.containment;}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-($.browser.safari&&$.browser.version<526&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-($.browser.safari&&$.browser.version<526&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}return{top:(pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+($.browser.safari&&$.browser.version<526&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+($.browser.safari&&$.browser.version<526&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type=="drag")this.positionAbs=this._convertPositionTo("absolute");return $.Widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(event){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs};}});$.extend($.ui.draggable,{version:"1.8"});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,'sortable');if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui){var inst=$(this).data("draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper=='original')this.instance.currentItem.css({top:'auto',left:'auto'});}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var helperTop=this.positionAbs.top,helperLeft=this.positionAbs.left;var itemHeight=o.height,itemWidth=o.width;var itemTop=o.top,itemLeft=o.left;return $.ui.isOver(helperTop+dyClick,helperLeft+dxClick,itemTop,itemLeft,itemHeight,itemWidth);};$.each(inst.sortables,function(i){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0];};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst;}if(this.instance.currentItem)this.instance._mouseDrag(event);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger('out',event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._trigger("fromSortable",event);inst.dropped=false;}};});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui){var t=$('body'),o=$(this).data('draggable').options;if(t.css("cursor"))o._cursor=t.css("cursor");t.css("cursor",o.cursor);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._cursor)$('body').css("cursor",o._cursor);}});$.ui.plugin.add("draggable","iframeFix",{start:function(event,ui){var o=$(this).data('draggable').options;$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");});},stop:function(event,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this);});}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data('draggable').options;if(t.css("opacity"))o._opacity=t.css("opacity");t.css('opacity',o.opacity);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._opacity)$(ui.helper).css('opacity',o._opacity);}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML')i.overflowOffset=i.scrollParent.offset();},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML'){if(!o.axis||o.axis!='x'){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity)i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed;}if(!o.axis||o.axis!='y'){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity)i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(!o.axis||o.axis!='x'){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}if(!o.axis||o.axis!='y'){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(i,event);}});$.ui.plugin.add("draggable","snap",{start:function(event,ui){var i=$(this).data("draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!=String?(o.snap.items||':data(draggable)'):o.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=i.element[0])i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(event,ui){var inst=$(this).data("draggable"),o=inst.options;var d=o.snapTolerance;var x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping)(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue;}if(o.snapMode!='inner'){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left;}var first=(ts||bs||ls||rs);if(o.snapMode!='outer'){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left;}if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first);};}});$.ui.plugin.add("draggable","stack",{start:function(event,ui){var o=$(this).data("draggable").options;var group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0);});if(!group.length){return;}var min=parseInt(group[0].style.zIndex)||0;$(group).each(function(i){this.style.zIndex=min+i;});this[0].style.zIndex=min+group.length;}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("zIndex"))o._zIndex=t.css("zIndex");t.css('zIndex',o.zIndex);},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._zIndex)$(ui.helper).css('zIndex',o._zIndex);}});})(jQuery);
(function($){var numPages=5;$.widget("ui.slider",$.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:'horizontal',range:false,step:1,value:0,values:null},_create:function(){var self=this,o=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all");if(o.disabled){this.element.addClass('ui-slider-disabled ui-disabled');}this.range=$([]);if(o.range){if(o.range===true){this.range=$('<div></div>');if(!o.values)o.values=[this._valueMin(),this._valueMin()];if(o.values.length&&o.values.length!=2){o.values=[o.values[0],o.values[0]];}}else{this.range=$('<div></div>');}this.range.appendTo(this.element).addClass("ui-slider-range");if(o.range=="min"||o.range=="max"){this.range.addClass("ui-slider-range-"+o.range);}this.range.addClass("ui-widget-header");}if($(".ui-slider-handle",this.element).length==0)$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length<o.values.length)$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle");}this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default"+" ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(event){event.preventDefault();}).hover(function(){if(!o.disabled){$(this).addClass('ui-state-hover');}},function(){$(this).removeClass('ui-state-hover');}).focus(function(){if(!o.disabled){$(".ui-slider .ui-state-focus").removeClass('ui-state-focus');$(this).addClass('ui-state-focus');}else{$(this).blur();}}).blur(function(){$(this).removeClass('ui-state-focus');});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i);});this.handles.keydown(function(event){var ret=true;var index=$(this).data("index.ui-slider-handle");if(self.options.disabled)return;switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:ret=false;if(!self._keySliding){self._keySliding=true;$(this).addClass("ui-state-active");self._start(event,index);}break;}var curVal,newVal,step=self._step();if(self.options.values&&self.options.values.length){curVal=newVal=self.values(index);}else{curVal=newVal=self.value();}switch(event.keyCode){case $.ui.keyCode.HOME:newVal=self._valueMin();break;case $.ui.keyCode.END:newVal=self._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=curVal+((self._valueMax()-self._valueMin())/numPages);break;case $.ui.keyCode.PAGE_DOWN:newVal=curVal-((self._valueMax()-self._valueMin())/numPages);break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal==self._valueMax())return;newVal=curVal+step;break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal==self._valueMin())return;newVal=curVal-step;break;}self._slide(event,index,newVal);return ret;}).keyup(function(event){var index=$(this).data("index.ui-slider-handle");if(self._keySliding){self._keySliding=false;self._stop(event,index);self._change(event,index);$(this).removeClass("ui-state-active");}});this._refreshValue();this._animateOff=false;},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-slider-disabled"+" ui-widget"+" ui-widget-content"+" ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this;},_mouseCapture:function(event){var o=this.options;if(o.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);var distance=this._valueMax()-this._valueMin()+1,closestHandle;var self=this,index;this.handles.each(function(i){var thisDistance=Math.abs(normValue-self.values(i));if(distance>thisDistance){distance=thisDistance;closestHandle=$(this);index=i;}});if(o.range==true&&this.values(1)==o.min){closestHandle=$(this.handles[++index]);}this._start(event,index);this._mouseSliding=true;self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();var offset=closestHandle.offset();var mouseOverHandle=!$(event.target).parents().andSelf().is('.ui-slider-handle');this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top-(closestHandle.height()/2)-(parseInt(closestHandle.css('borderTopWidth'),10)||0)-(parseInt(closestHandle.css('borderBottomWidth'),10)||0)+(parseInt(closestHandle.css('marginTop'),10)||0)};normValue=this._normValueFromMouse(position);this._slide(event,index,normValue);this._animateOff=true;return true;},_mouseStart:function(event){return true;},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false;},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false;},_detectOrientation:function(){this.orientation=this.options.orientation=='vertical'?'vertical':'horizontal';},_normValueFromMouse:function(position){var pixelTotal,pixelMouse;if('horizontal'==this.orientation){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);}var percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1)percentMouse=1;if(percentMouse<0)percentMouse=0;if('vertical'==this.orientation)percentMouse=1-percentMouse;var valueTotal=this._valueMax()-this._valueMin(),valueMouse=percentMouse*valueTotal,valueMouseModStep=valueMouse%this.options.step,normValue=this._valueMin()+valueMouse-valueMouseModStep;if(valueMouseModStep>(this.options.step/2))normValue+=this.options.step;return parseFloat(normValue.toFixed(5));},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}this._trigger("start",event,uiHash);},_slide:function(event,index,newVal){var handle=this.handles[index];if(this.options.values&&this.options.values.length){var otherVal=this.values(index?0:1);if((this.options.values.length==2&&this.options.range===true)&&((index==0&&newVal>otherVal)||(index==1&&newVal<otherVal))){newVal=otherVal;}if(newVal!=this.values(index)){var newValues=this.values();newValues[index]=newVal;var allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal,values:newValues});var otherVal=this.values(index?0:1);if(allowed!==false){this.values(index,newVal,true);}}}else{if(newVal!=this.value()){var allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal});if(allowed!==false){this.value(newVal);}}}},_stop:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}this._trigger("stop",event,uiHash);},_change:function(event,index){if(!this._keySliding&&!this._mouseSliding){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();}this._trigger("change",event,uiHash);}},value:function(newValue){if(arguments.length){this.options.value=this._trimValue(newValue);this._refreshValue();this._change(null,0);}return this._value();},values:function(index,newValue){if(arguments.length>1){this.options.values[index]=this._trimValue(newValue);this._refreshValue();this._change(null,index);}if(arguments.length){if($.isArray(arguments[0])){var vals=this.options.values,newValues=arguments[0];for(var i=0,l=vals.length;i<l;i++){vals[i]=this._trimValue(newValues[i]);this._change(null,i);}this._refreshValue();}else{if(this.options.values&&this.options.values.length){return this._values(index);}else{return this.value();}}}else{return this._values();}},_setOption:function(key,value){var i,valsLength=0;if(jQuery.isArray(this.options.values)){valsLength=this.options.values.length;};$.Widget.prototype._setOption.apply(this,arguments);switch(key){case'disabled':if(value){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled");}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled");}case'orientation':this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case'value':this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case'values':this._animateOff=true;this._refreshValue();for(i=0;i<valsLength;i++){this._change(null,i);}this._animateOff=false;break;}},_step:function(){var step=this.options.step;return step;},_value:function(){var val=this.options.value;val=this._trimValue(val);return val;},_values:function(index){if(arguments.length){var val=this.options.values[index];val=this._trimValue(val);return val;}else{var vals=this.options.values.slice();for(var i=0,l=vals.length;i<l;i++){vals[i]=this._trimValue(vals[i]);}return vals;}},_trimValue:function(val){if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;},_valueMin:function(){var valueMin=this.options.min;return valueMin;},_valueMax:function(){var valueMax=this.options.max;return valueMax;},_refreshValue:function(){var oRange=this.options.range,o=this.options,self=this;var animate=(!this._animateOff)?o.animate:false;if(this.options.values&&this.options.values.length){var vp0,vp1;this.handles.each(function(i,j){var valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'%';$(this).stop(1,1)[animate?'animate':'css'](_set,o.animate);if(self.options.range===true){if(self.orientation=='horizontal'){(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({left:valPercent+'%'},o.animate);(i==1)&&self.range[animate?'animate':'css']({width:(valPercent-lastValPercent)+'%'},{queue:false,duration:o.animate});}else{(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({bottom:(valPercent)+'%'},o.animate);(i==1)&&self.range[animate?'animate':'css']({height:(valPercent-lastValPercent)+'%'},{queue:false,duration:o.animate});}}lastValPercent=valPercent;});}else{var value=this.value(),valueMin=this._valueMin(),valueMax=this._valueMax(),valPercent=valueMax!=valueMin?(value-valueMin)/(valueMax-valueMin)*100:0;var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'%';this.handle.stop(1,1)[animate?'animate':'css'](_set,o.animate);(oRange=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[animate?'animate':'css']({width:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="horizontal")&&this.range[animate?'animate':'css']({width:(100-valPercent)+'%'},{queue:false,duration:o.animate});(oRange=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[animate?'animate':'css']({height:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="vertical")&&this.range[animate?'animate':'css']({height:(100-valPercent)+'%'},{queue:false,duration:o.animate});}}});$.extend($.ui.slider,{version:"1.8"});})(jQuery);
(function($){$.widget("ui.resizable",$.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var self=this,o=this.options;this.element.addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||'ui-resizable-helper':null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css('position'))&&$.browser.opera)this.element.css({position:'relative',top:'auto',left:'auto'});this.element.wrap($('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.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'));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css('resize');this.originalElement.css('resize','none');this._proportionallyResizeElements.push(this.originalElement.css({position:'static',zoom:1,display:'block'}));this.originalElement.css({margin:this.originalElement.css('margin')});this._proportionallyResize();}this.handles=o.handles||(!$('.ui-resizable-handle',this.element).length?"e,s,se":{n:'.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-resizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'});if(this.handles.constructor==String){if(this.handles=='all')this.handles='n,e,s,w,se,sw,ne,nw';var n=this.handles.split(",");this.handles={};for(var i=0;i<n.length;i++){var handle=$.trim(n[i]),hname='ui-resizable-'+handle;var axis=$('<div class="ui-resizable-handle '+hname+'"></div>');if(/sw|se|ne|nw/.test(handle))axis.css({zIndex:++o.zIndex});if('se'==handle){axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');};this.handles[handle]='.ui-resizable-'+handle;this.element.append(axis);}}this._renderAxis=function(target){target=target||this.element;for(var i in this.handles){if(this.handles[i].constructor==String)this.handles[i]=$(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var axis=$(this.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");target.css(padPos,padWrapper);this._proportionallyResize();}if(!$(this.handles[i]).length)continue;}};this._renderAxis(this.element);this._handles=$('.ui-resizable-handle',this.element).disableSelection();this._handles.mouseover(function(){if(!self.resizing){if(this.className)var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=axis&&axis[1]?axis[1]:'se';}});if(o.autoHide){this._handles.hide();$(this.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");self._handles.show();},function(){if(!self.resizing){$(this).addClass("ui-resizable-autohide");self._handles.hide();}});}this._mouseInit();},destroy:function(){this._mouseDestroy();var _destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();};if(this.elementIsWrapper){_destroy(this.element);var wrapper=this.element;wrapper.after(this.originalElement.css({position:wrapper.css('position'),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css('top'),left:wrapper.css('left')})).remove();}this.originalElement.css('resize',this.originalResizeStyle);_destroy(this.originalElement);return this;},_mouseCapture:function(event){var handle=false;for(var i in this.handles){if($(this.handles[i])[0]==event.target){handle=true;}}return!this.options.disabled&&handle;},_mouseStart:function(event){var o=this.options,iniPos=this.element.position(),el=this.element;this.resizing=true;this.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){el.css({position:'absolute',top:iniPos.top,left:iniPos.left});}if($.browser.opera&&(/relative/).test(el.css('position')))el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var curleft=num(this.helper.css('left')),curtop=num(this.helper.css('top'));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;}this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var cursor=$('.ui-resizable-'+this.axis).css('cursor');$('body').css('cursor',cursor=='auto'?this.axis+'-resize':cursor);el.addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger)return false;var data=trigger.apply(this,[event,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(this._aspectRatio||event.shiftKey)data=this._updateRatio(data,event);data=this._respectSize(data,event);this._propagate("resize",event);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length)this._proportionallyResize();this._updateCache(data);this._trigger('resize',event,this.ui());return false;},_mouseStop:function(event){this.resizing=false;var o=this.options,self=this;if(this._helper){var pr=this._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate)this.element.css($.extend(s,{top:top,left:left}));self.helper.height(self.size.height);self.helper.width(self.size.width);if(this._helper&&!o.animate)this._proportionallyResize();}$('body').css('cursor','auto');this.element.removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper)this.helper.remove();return false;},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(isNumber(data.left))this.position.left=data.left;if(isNumber(data.top))this.position.top=data.top;if(isNumber(data.height))this.size.height=data.height;if(isNumber(data.width))this.size.width=data.width;},_updateRatio:function(data,event){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height*this.aspectRatio);else if(data.width)data.height=(csize.width/this.aspectRatio);if(a=='sw'){data.left=cpos.left+(csize.width-data.width);data.top=null;}if(a=='nw'){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);}return data;},_respectSize:function(data,event){var el=this.helper,o=this.options,pRatio=this._aspectRatio||event.shiftKey,a=this.axis,ismaxw=isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height);if(isminw)data.width=o.minWidth;if(isminh)data.height=o.minHeight;if(ismaxw)data.width=o.maxWidth;if(ismaxh)data.height=o.maxHeight;var dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw)data.left=dw-o.minWidth;if(ismaxw&&cw)data.left=dw-o.maxWidth;if(isminh&&ch)data.top=dh-o.minHeight;if(ismaxh&&ch)data.top=dh-o.maxHeight;var isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top)data.top=null;else if(isNotwh&&!data.top&&data.left)data.left=null;return data;},_proportionallyResize:function(){var o=this.options;if(!this._proportionallyResizeElements.length)return;var element=this.helper||this.element;for(var i=0;i<this._proportionallyResizeElements.length;i++){var prel=this._proportionallyResizeElements[i];if(!this.borderDif){var b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth'),prel.css('borderLeftWidth')],p=[prel.css('paddingTop'),prel.css('paddingRight'),prel.css('paddingBottom'),prel.css('paddingLeft')];this.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding;});}if($.browser.msie&&!(!($(element).is(':hidden')||$(element).parents(':hidden').length)))continue;prel.css({height:(element.height()-this.borderDif[0]-this.borderDif[2])||0,width:(element.width()-this.borderDif[1]-this.borderDif[3])||0});};},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$('<div style="overflow:hidden;"></div>');var ie6=$.browser.msie&&$.browser.version<7,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+pxyoffset,height:this.element.outerHeight()+pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.elementOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx,dy){return{width:this.originalSize.width+dx};},w:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!="resize"&&this._trigger(n,event,this.ui()));},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}});$.extend($.ui.resizable,{version:"1.8"});$.ui.plugin.add("resizable","alsoResize",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options;var _store=function(exp){$(exp).each(function(){$(this).data("resizable-alsoresize",{width:parseInt($(this).width(),10),height:parseInt($(this).height(),10),left:parseInt($(this).css('left'),10),top:parseInt($(this).css('top'),10)});});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.parentNode){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize);}else{$.each(o.alsoResize,function(exp,c){_store(exp);});}}else{_store(o.alsoResize);}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,os=self.originalSize,op=self.originalPosition;var delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top:(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("resizable-alsoresize"),style={},css=c&&c.length?c:['width','height','top','left'];$.each(css||['width','height','top','left'],function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0)style[prop]=sum||null;});if(/relative/.test(el.css('position'))&&$.browser.opera){self._revertToRelativePosition=true;el.css({position:'absolute',top:'auto',left:'auto'});}el.css(style);});};if(typeof(o.alsoResize)=='object'&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(event,ui){var self=$(this).data("resizable");if(self._revertToRelativePosition&&$.browser.opera){self._revertToRelativePosition=false;el.css({position:'relative'});}$(this).removeData("resizable-alsoresize-start");}});$.ui.plugin.add("resizable","animate",{stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;var pr=self._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&$.ui.hasScroll(pr[0],'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(self.element.css('width'),10),height:parseInt(self.element.css('height'),10),top:parseInt(self.element.css('top'),10),left:parseInt(self.element.css('left'),10)};if(pr&&pr.length)$(pr[0]).css({width:data.width,height:data.height});self._updateCache(data);self._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,el=self.element;var oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce)return;self.containerElement=$(ce);if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};self.containerPosition={left:0,top:0};self.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}else{var element=$(ce),p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=num(element.css("padding"+name));});self.containerOffset=element.offset();self.containerPosition=element.position();self.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};var co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=self._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(ce[0]!=document&&(/static/).test(ce.css('position')))cop=co;if(cp.left<(self._helper?co.left:0)){self.size.width=self.size.width+(self._helper?(self.position.left-co.left):(self.position.left-cop.left));if(pRatio)self.size.height=self.size.width/o.aspectRatio;self.position.left=o.helper?co.left:0;}if(cp.top<(self._helper?co.top:0)){self.size.height=self.size.height+(self._helper?(self.position.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height*o.aspectRatio;self.position.top=self._helper?co.top:0;}self.offset.left=self.parentData.left+self.position.left;self.offset.top=self.parentData.top+self.position.top;var woset=Math.abs((self._helper?self.offset.left-cop.left:(self.offset.left-cop.left))+self.sizeDiff.width),hoset=Math.abs((self._helper?self.offset.top-cop.top:(self.offset.top-co.top))+self.sizeDiff.height);var isParent=self.containerElement.get(0)==self.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(self.containerElement.css('position'));if(isParent&&isOffsetRelative)woset-=self.parentData.left;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width/self.aspectRatio;}if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio)self.size.width=self.size.height*self.aspectRatio;}},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options,cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var helper=$(self.helper),ho=helper.offset(),w=helper.outerWidth()-self.sizeDiff.width,h=helper.outerHeight()-self.sizeDiff.height;if(self._helper&&!o.animate&&(/relative/).test(ce.css('position')))$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});if(self._helper&&!o.animate&&(/static/).test(ce.css('position')))$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}});$.ui.plugin.add("resizable","ghost",{start:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size;self.ghost=self.originalElement.clone();self.ghost.css({opacity:.25,display:'block',position:'relative',height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof o.ghost=='string'?o.ghost:'');self.ghost.appendTo(self.helper);},resize:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost)self.ghost.css({position:'relative',height:self.size.height,width:self.size.width});},stop:function(event,ui){var self=$(this).data("resizable"),o=self.options;if(self.ghost&&self.helper)self.helper.get(0).removeChild(self.ghost.get(0));}});$.ui.plugin.add("resizable","grid",{resize:function(event,ui){var self=$(this).data("resizable"),o=self.options,cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||event.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var ox=Math.round((cs.width-os.width)/ (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) /(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;}else if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;}else if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox;}else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;self.position.left=op.left-ox;}}});var num=function(v){return parseInt(v,10)||0;};var isNumber=function(value){return!isNaN(parseInt(value,10));};})(jQuery);
(function($){var uiDialogClasses='ui-dialog '+'ui-widget '+'ui-widget-content '+'ui-corner-all ';$.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,selectOnEnter:false,saveOnEnter:false,closeText:'<span class="ui-dialog-close-btn png"></span>',dialogClass:'',draggable:true,hide:null,height:'auto',maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:'center',resizable:false,show:null,stack:true,title:'',width:300,zIndex:1000,shadow:true},_create:function(){this.originalTitle=this.element.attr('title');var self=this,options=self.options,title=options.title||self.originalTitle||'&#160;',titleId=$.ui.dialog.getTitleId(self.element),uiDialog=(self.uiDialog=$('<div></div>')).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({zIndex:options.zIndex}).attr('tabIndex',-1).css('outline',0).attr({role:'dialog','aria-labelledby':titleId}).mousedown(function(event){self.moveToTop(false,event);}),uiDialogContent=self.element.show().removeAttr('title').addClass('ui-dialog-content '+'ui-widget-content').appendTo(uiDialog),uiDialogTitlebar=(self.uiDialogTitlebar=$('<div></div>')).addClass('ui-dialog-titlebar '+'ui-widget-header '+'ui-corner-all '+'ui-helper-clearfix').prependTo(uiDialog),uiDialogTitlebarClose=$('<a href="javascript:void(0)"></a>').addClass('ui-dialog-titlebar-close '+'ui-corner-all').attr('role','button').hover(function(){uiDialogTitlebarClose.addClass('ui-state-hover');},function(){uiDialogTitlebarClose.removeClass('ui-state-hover');}).focus(function(){uiDialogTitlebarClose.addClass('ui-state-focus');}).blur(function(){uiDialogTitlebarClose.removeClass('ui-state-focus');}).click(function(event){return self._cancel(event);}).appendTo(uiDialogTitlebar),uiDialogTitlebarCloseText=(self.uiDialogTitlebarCloseText=$('<span></span>')).addClass('ui-icon '+'ui-icon-closethick').html(options.closeText).appendTo(uiDialogTitlebarClose),uiDialogTitle=$('<span></span>').addClass('ui-dialog-title').attr('id',titleId).html(title).prependTo(uiDialogTitlebar);if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose)){options.beforeClose=options.beforeclose;}uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();if(options.draggable&&$.fn.draggable){self._makeDraggable();}if(options.resizable&&$.fn.resizable){self._makeResizable();}self._createButtons(options.buttons);self._isOpen=false;if($.fn.bgiframe){uiDialog.bgiframe();}},_init:function(){if(this.options.autoOpen){this.open();}},destroy:function(){var self=this;if(self.overlay){self.overlay.destroy();}self.uiDialog.hide();self.element.unbind('.dialog').removeData('dialog').removeClass('ui-dialog-content ui-widget-content').hide().appendTo('body');self.uiDialog.remove();if(self.originalTitle){self.element.attr('title',self.originalTitle);}return self;},widget:function(){return this.uiDialog;},_cancel:function(event){this.close(event);event.stopImmediatePropagation();event.preventDefault();return false;},_save:function(event){return this._cancel(event);},close:function(event){var self=this,maxZ;if(false===self._trigger('beforeClose',event)){return;}if(self.overlay){self.overlay.destroy();self.overlay=null;}self.uiDialog.unbind('keypress.ui-dialog');if(self._quit){$(document).unbindkey('ESC',self._quit);}if(self._sselect){$(document).unbindkey('ENTER',self._sselect);}if(self._nav){$(document).unbind('keydown',self._nav);}self._isOpen=false;if(self.options.hide){self.uiDialog.hide(self.options.hide,function(){self._trigger('close',event);});}else if(self.options.single){self.uiDialog.css({left:-999,top:-999});self._trigger('close',event);}else{self.uiDialog.hide();self._trigger('close',event);}$.ui.dialog.overlay.resize();if(self.options.modal){maxZ=0;$('.ui-dialog').each(function(){if(this!==self.uiDialog[0]){maxZ=Math.max(maxZ,$(this).css('z-index'));}});$.ui.dialog.maxZ=maxZ;}return self;},isOpen:function(){return this._isOpen;},moveToTop:function(force,event){var self=this,options=self.options,saveScroll;if((options.modal&&!force)||(!options.stack&&!options.modal)){return self._trigger('focus',event);}if(options.zIndex>$.ui.dialog.maxZ){$.ui.dialog.maxZ=options.zIndex;}if(self.overlay){$.ui.dialog.maxZ+=1;self.overlay.$el.css('z-index',$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ);}saveScroll={scrollTop:self.element.attr('scrollTop'),scrollLeft:self.element.attr('scrollLeft')};$.ui.dialog.maxZ+=1;self.uiDialog.css('z-index',$.ui.dialog.maxZ);self.element.attr(saveScroll);self._trigger('focus',event);return self;},open:function(){if(this._isOpen){return;}var self=this,options=self.options,uiDialog=self.uiDialog;self.overlay=options.modal?new $.ui.dialog.overlay(self):null;if(uiDialog.next().length&&!self.options.single){uiDialog.appendTo('body');}self._size();self._position(options.position);uiDialog.show(options.show);self.moveToTop(true);if(options.modal){uiDialog.bind('keypress.ui-dialog',function(event){if(event.keyCode!==$.ui.keyCode.TAB){return;}var tabbables=$(':tabbable',this),first=tabbables.filter(':first'),last=tabbables.filter(':last');if(event.target===last[0]&&!event.shiftKey){first.focus(1);return false;}else if(event.target===first[0]&&event.shiftKey){last.focus(1);return false;}});}if(self.options.closeOnEscape){if(!self._quit){self._quit=function(){return this._cancel.apply(this,arguments);};}$(document).bindkey('ESC',$.proxy(self._quit,self));}if(!self._sselect){self._sselect=function(e){if(e&&e.target){var el=$(e.target);if(el.is('input:text')){el.blur();}e.stopPropagation();e.stopImmediatePropagation();}if(this.options.saveOnEnter){return this._save.apply(this,arguments);}else if(this.options.selectOnEnter){return this._navigate.apply(this,arguments);}return false;};}$(document).bindkey('ENTER',$.proxy(self._sselect,self));self._trigger('open');self._isOpen=true;if(self.options.shadow&&$.fn.shadow){uiDialog.shadow(self.options.shadow);}return self;},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=$('<div><div></div></div>').addClass('ui-dialog-buttonpane '+'ui-widget-content '+'ui-helper-clearfix'),uiDialogChild=uiDialogButtonPane.children('div').addClass('ui-dialog-buttonchild');self.uiDialog.find('.ui-dialog-buttonpane').remove();if(typeof buttons==='object'&&buttons!==null){$.each(buttons,function(){return!(hasButtons=true);});}if(hasButtons){$.each(buttons,function(name,fn){if(fn===false){return;}var button=$('<a href="javascript:void(\''+name+'\')"></a>').text(name).click(function(e){fn.apply(self.element[0],[e,self]);e.preventDefault();}).appendTo(uiDialogChild);if($.fn.button){button.button();}});uiDialogButtonPane.appendTo(self.uiDialog);uiDialogChild.children(':first').addClass('active');}},_navigate:function(e){switch(e.which){case $.ui.keyCode.ENTER:if(e&&e.target&&$(e.target).is('textarea:not(.noenter)')){return;}else{this.uiDialog.find('a.ui-button.active').click();if(e&&e.preventDefault){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();}return false;}case $.ui.keyCode.LEFT:case $.ui.keyCode.RIGHT: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');}break;}},_makeDraggable:function(){var self=this,options=self.options,doc=$(document),heightBeforeDrag;function filteredUi(ui){return{position:ui.position,offset:ui.offset};}self.uiDialog.draggable({cancel:'.ui-dialog-content, .ui-dialog-titlebar-close',handle:'.ui-dialog-titlebar',distance:4,containment:'document',start:function(event,ui){heightBeforeDrag=options.height==="auto"?"auto":$(this).height();$(this).height($(this).height()).addClass("ui-dialog-dragging");self._trigger('dragStart',event,filteredUi(ui));},drag:function(event,ui){self._trigger('drag',event,filteredUi(ui));},stop:function(event,ui){options.position=[ui.offset.left,ui.offset.top];$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);self._trigger('dragStop',event,filteredUi(ui));$.ui.dialog.overlay.resize();}});},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=self.options,position=self.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};}self.uiDialog.resizable({cancel:'.ui-dialog-content',containment:'document',alsoResize:self.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:self._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");self._trigger('resizeStart',event,filteredUi(ui));},resize:function(event,ui){self._trigger('resize',event,filteredUi(ui));},stop:function(event,ui){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();self._trigger('resizeStop',event,filteredUi(ui));$.ui.dialog.overlay.resize();}}).css('position',position).find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');},_minHeight:function(){var options=this.options;if(options.height==='auto'){return options.minHeight;}else{return Math.min(options.minHeight,options.height);}},_position:function(position){var myAt=[],offset=[0,0],isVisible;position=position||$.ui.dialog.prototype.options.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;}});}else if(typeof position==='object'){if('left'in position){myAt[0]='left';offset[0]=position.left;}else if('right'in position){myAt[0]='right';offset[0]=-position.right;}if('top'in position){myAt[1]='top';offset[1]=position.top;}else if('bottom'in position){myAt[1]='bottom';offset[1]=-position.bottom;}}isVisible=this.uiDialog.is(':visible');if(!isVisible){this.uiDialog.show();}this.uiDialog.css({top:0,left:0}).position({my:myAt.join(' '),at:myAt.join(' '),offset:offset.join(' '),of:window,collision:'fit',using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0){$(this).css('top',pos.top-topOffset);}}});if(!isVisible){this.uiDialog.hide();}},_setOption:function(key,value){var self=this,uiDialog=self.uiDialog,isResizable=uiDialog.is(':data(resizable)'),resize=false;switch(key){case"beforeclose":key="beforeClose";break;case"buttons":self._createButtons(value);break;case"closeText":self.uiDialogTitlebarCloseText.text(""+value);break;case"dialogClass":uiDialog.removeClass(self.options.dialogClass).addClass(uiDialogClasses+value);break;case"disabled":if(value){uiDialog.addClass('ui-dialog-disabled');}else{uiDialog.removeClass('ui-dialog-disabled');}break;case"draggable":if(value){self._makeDraggable();}else{uiDialog.draggable('destroy');}break;case"height":resize=true;break;case"maxHeight":if(isResizable){uiDialog.resizable('option','maxHeight',value);}resize=true;break;case"maxWidth":if(isResizable){uiDialog.resizable('option','maxWidth',value);}resize=true;break;case"minHeight":if(isResizable){uiDialog.resizable('option','minHeight',value);}resize=true;break;case"minWidth":if(isResizable){uiDialog.resizable('option','minWidth',value);}resize=true;break;case"position":self._position(value);break;case"resizable":if(isResizable&&!value){uiDialog.resizable('destroy');}if(isResizable&&typeof value==='string'){uiDialog.resizable('option','handles',value);}if(!isResizable&&value!==false){self._makeResizable(value);}break;case"title":$(".ui-dialog-title",self.uiDialogTitlebar).html(""+(value||'&#160;'));break;case"width":resize=true;break;}$.Widget.prototype._setOption.apply(self,arguments);if(resize){self._size();}},_size:function(){var options=this.options,nonContentHeight;this.element.css('width','auto').hide();nonContentHeight=this.uiDialog.css({height:'auto',width:options.width}).height();this.element.css(options.height==='auto'?{minHeight:Math.max(options.minHeight-nonContentHeight,0),height:'auto'}:{minHeight:0,height:Math.max(options.height-nonContentHeight,0)}).show();if(this.uiDialog.is(':data(resizable)')){this.uiDialog.resizable('option','minHeight',this._minHeight());}}});$.extend($.ui.dialog,{version:"1.8",uuid:0,maxZ:0,getTitleId:function($el){var id=$el.attr('id');if(!id){this.uuid+=1;id=this.uuid;}return'ui-dialog-title-'+id;},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog);}});$.extend($.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),function(event){return event+'.dialog-overlay';}).join(' '),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length){$(document).bind($.ui.dialog.overlay.events,function(event){return($(event.target).zIndex()>=$.ui.dialog.overlay.maxZ);});}},1);$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize);}var $el=this.oldInstances.pop();if(!$el||$el.css('opacity')||$el.css('filter')){var fixed=!$.browser.msie||$.browser.version>6;if($el){$el.removeAttr('style');}else{$el=$('<div></div>').addClass('ui-widget-overlay');}$el.css({display:'none',position:fixed?'fixed':'absolute',left:0,top:0});}var css={display:'block',width:this.width(),height:this.height()};if(dialog&&dialog.options&&dialog.options.modal&&dialog.options.modal!==true){$.extend(css,dialog.options.modal);}$el.appendTo(document.body).css(css);if($.fn.bgiframe){$el.bgiframe();}this.instances.push($el);return $el;},destroy:function($el){this.oldInstances.push(this.instances.splice($.inArray($el,this.instances),1)[0]);if(this.instances.length===0){$([document,window]).unbind('.dialog-overlay');}$el.css({display:'none'}).remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css('z-index'));});this.maxZ=maxZ;},height:function(){var scrollHeight,offsetHeight;if($.browser.msie6){scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight<offsetHeight){return $(window).height()+'px';}else{return scrollHeight+'px';}}else{return'100%';}},width:function(){var scrollWidth,offsetWidth;if($.browser.msie6){scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);offsetWidth=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(scrollWidth<offsetWidth){return $(window).width()+'px';}else{return scrollWidth+'px';}}else{return'100%';}},resize:function(){var $overlays=$([]);$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this);});$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()});}});$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el);}});}(jQuery));(function($){$.fn.bgiframe=($.browser.msie6?function(s){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s);var html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($(this).children('iframe.bgiframe').length===0)this.insertBefore(document.createElement(html),this.firstChild);});}:function(){return this;});$.fn.bgIframe=$.fn.bgiframe;function prop(n){return n&&n.constructor===Number?n+'px':n;}})(jQuery);
;jQuery.effects||(function($){$.effects={};$.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){$.fx.step[attr]=function(fx){if(!fx.colorInit){fx.start=getColor(fx.elem,attr);fx.end=$.effects.getRGB(fx.end);fx.colorInit=true;}fx.elem.style[attr]='rgb('+Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0],10),255),0)+','+Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1],10),255),0)+','+Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2],10),255),0)+')';};});$.effects.getRGB=function(color){var result;if(color&&color.constructor==Array&&color.length==3)return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))return[parseInt(result[1],10),parseInt(result[2],10),parseInt(result[3],10)];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];if(result=/rgba\(0, 0, 0, 0\)/.exec(color))return $.effects.colors['transparent'];return $.effects.colors[$.trim(color).toLowerCase()];};function getColor(elem,attr){var color;do{color=$.curCSS(elem,attr);if(color!=''&&color!='transparent'||$.nodeName(elem,"body"))break;attr="backgroundColor";}while(elem=elem.parentNode);return $.effects.getRGB(color);};$.effects.colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var classAnimationActions=['add','remove','toggle'],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function getElementStyles(){var style=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,newStyle={},key,camelCase;if(style&&style.length&&style[0]&&style[style[0]]){var len=style.length;while(len--){key=style[len];if(typeof style[key]=='string'){camelCase=key.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});newStyle[camelCase]=style[key];}}}else{for(key in style){if(typeof style[key]==='string'){newStyle[key]=style[key];}}}return newStyle;}function filterStyles(styles){var name,value;for(name in styles){value=styles[name];if(value==null||$.isFunction(value)||name in shorthandStyles||(/scrollbar/).test(name)||(!(/color/i).test(name)&&isNaN(parseFloat(value)))){delete styles[name];}}return styles;}function styleDifference(oldStyle,newStyle){var diff={_:0},name;for(name in newStyle){if(oldStyle[name]!=newStyle[name]){diff[name]=newStyle[name];}}return diff;}$.effects.animateClass=function(value,duration,easing,callback){if($.isFunction(easing)){callback=easing;easing=null;}return this.each(function(){var that=$(this),originalStyleAttr=that.attr('style')||' ',originalStyle=filterStyles(getElementStyles.call(this)),newStyle,className=that.attr('className');$.each(classAnimationActions,function(i,action){if(value[action]){that[action+'Class'](value[action]);}});newStyle=filterStyles(getElementStyles.call(this));that.attr('className',className);that.animate(styleDifference(originalStyle,newStyle),duration,easing,function(){$.each(classAnimationActions,function(i,action){if(value[action]){that[action+'Class'](value[action]);}});if(typeof that.attr('style')=='object'){that.attr('style').cssText='';that.attr('style').cssText=originalStyleAttr;}else{that.attr('style',originalStyleAttr);}if(callback){callback.apply(this,arguments);}});});};$.fn.extend({_addClass:$.fn.addClass,addClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{add:classNames},speed,easing,callback]):this._addClass(classNames);},_removeClass:$.fn.removeClass,removeClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{remove:classNames},speed,easing,callback]):this._removeClass(classNames);},_toggleClass:$.fn.toggleClass,toggleClass:function(classNames,force,speed,easing,callback){if(typeof force=="boolean"||force===undefined){if(!speed){return this._toggleClass(classNames,force);}else{return $.effects.animateClass.apply(this,[(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);}}else{return $.effects.animateClass.apply(this,[{toggle:classNames},force,speed,easing]);}},switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.apply(this,[{add:add,remove:remove},speed,easing,callback]);}});$.extend($.effects,{version:"1.8",save:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null)element.data("ec.storage."+set[i],element[0].style[set[i]]);}},restore:function(element,set){for(var i=0;i<set.length;i++){if(set[i]!==null)element.css(set[i],element.data("ec.storage."+set[i]));}},setMode:function(el,mode){if(mode=='toggle')mode=el.is(':hidden')?'show':'hide';return mode;},getBaseline:function(origin,original){var y,x;switch(origin[0]){case'top':y=0;break;case'middle':y=0.5;break;case'bottom':y=1;break;default:y=origin[0]/original.height;};switch(origin[1]){case'left':x=0;break;case'center':x=0.5;break;case'right':x=1;break;default:x=origin[1]/original.width;};return{x:x,y:y};},createWrapper:function(element){if(element.parent().is('.ui-effects-wrapper')){return element.parent();}var props={width:element.outerWidth(true),height:element.outerHeight(true),'float':element.css('float')},wrapper=$('<div></div>').addClass('ui-effects-wrapper').css({fontSize:'100%',background:'transparent',border:'none',margin:0,padding:0});element.wrap(wrapper);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});}return wrapper.css(props).show();},removeWrapper:function(element){if(element.parent().is('.ui-effects-wrapper'))return element.parent().replaceWith(element);return element;},setTransition:function(element,list,factor,value){value=value||{};$.each(list,function(i,x){unit=element.cssUnit(x);if(unit[0]>0)value[x]=unit[0]*factor+unit[1];});return value;}});function _normalizeArguments(effect,options,speed,callback){if(typeof effect=='object'){callback=options;speed=null;options=effect;effect=options.effect;}if($.isFunction(options)){callback=options;speed=null;options={};}if($.isFunction(speed)){callback=speed;speed=null;}if(typeof options=='number'||$.fx.speeds[options]){callback=speed;speed=options;options={};}options=options||{};speed=speed||options.duration;speed=$.fx.off?0:typeof speed=='number'?speed:$.fx.speeds[speed]||$.fx.speeds._default;callback=callback||options.complete;return[effect,options,speed,callback];}$.fn.extend({effect:function(effect,options,speed,callback){var args=_normalizeArguments.apply(this,arguments),args2={options:args[1],duration:args[2],callback:args[3]},effectMethod=$.effects[effect];return effectMethod&&!$.fx.off?effectMethod.call(this,args2):this;},_show:$.fn.show,show:function(speed){if(!speed||typeof speed=='number'||$.fx.speeds[speed]){return this._show.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args[1].mode='show';return this.effect.apply(this,args);}},_hide:$.fn.hide,hide:function(speed){if(!speed||typeof speed=='number'||$.fx.speeds[speed]){return this._hide.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args[1].mode='hide';return this.effect.apply(this,args);}},__toggle:$.fn.toggle,toggle:function(speed){if(!speed||typeof speed=='number'||$.fx.speeds[speed]||typeof speed=='boolean'||$.isFunction(speed)){return this.__toggle.apply(this,arguments);}else{var args=_normalizeArguments.apply(this,arguments);args[1].mode='toggle';return this.effect.apply(this,args);}},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;}});$.easing.jswing=$.easing.swing;$.extend($.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d * (Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d * (Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2 * (Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI) * Math.asin (c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI) * Math.asin (c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI) * Math.asin (c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-$.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d) < (1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return $.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return $.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});})(jQuery);
(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}};$.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<window.$onImagesLoaded.length;i++){if($.isFunction(window.$onImagesLoaded[i]))window.$onImagesLoaded[i]();}window.$onImagesLoaded=null;};$.getAjaxUrl=function(url,params){if(!url){return'';}else if($.isFunction(url)){var args=Array.prototype.slice.call(arguments);args.shift();return url.apply(this,args);}else{var url=url.split('#').shift();if(params){url=url.split('?');var query={};if(url.length>1){var parts=url[1].split('&');for(var i=0;i<parts.length;i++){var pair=parts[i].split('=');query[pair[0]]=pair.length?pair[1]:'';}}for(var p1 in params){var existing=false;for(var p2 in query){if(p1.toLowerCase()==p2.toLowerCase()){query[p2]=params[p1]==null?null:$.encode(params[p1]);existing=true;break;}}if(!existing){query[p1]=params[p1]==null?null:$.encode(params[p1]);}}var sb=[];for(var p in query){var val=query[p];if(val===null||val===''||val===undefined){continue;}else{sb.push(p+'='+val);}}url=url[0]+'?'+sb.join('&');}return url;}};$.fn.outerHtml=function(){if(this.length){if(this[0].outerHTML){return $.trim(this[0].outerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""));}else{var div=document.createElement('div'),clone=this[0].cloneNode(false),html=this[0].innerHTML;div.appendChild(clone);if(html){clone.innerHTML=html;}return $(div).html();}}else{return null;}};$.fn.hoverClass=function(overClass){return this.each(function(i){this._overclass=overClass;}).hover($.overClass,$.outClass);};$.overClass=function(e){if(this._overclass){$(this).addClass(this._overclass);}};$.outClass=function(e){if(this._overclass){$(this).removeClass(this._overclass);}};$.fn.toggleValue=function(){return this.each(function(i){var el=$(this);var orig=el.attr('_origvalue');if(orig!==undefined){this.origValue=orig;}else{this.origValue=this.value;}}).bind('focus',$.clearValue).bind('blur',$.restoreValue);};$.clearValue=function(e){if(this.origValue===undefined){this.origValue=this.value;}if(this.origValue&&this.origValue===this.value){this.value='';}};$.restoreValue=function(e){if(typeof this.value!='undefined'&&!this.value&&this.origValue)this.value=this.origValue;};$.fn.hoverImage=function(swap){return this.each(function(i){this.$self=$(this);var img=swap?(swap.push?(swap.length>i?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);}};$.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 img=(Math.round(Math.random()*100000)%4)+1;var biff;switch(Math.round(Math.random()*100000)%8){case 0:biff="That's about as funny as a screen door on a battleship.";break;case 1:biff="Must be rough bein' named after a complete butthead.";break;case 2:biff="Hello? Hello? Anybody home?";break;case 3:biff="I don't know what liquor smells like, cuz I'm too young to drink it.";break;case 4:biff="Noon? I do my killin' before breakfast! Seven o'clock!";break;case 5:biff="I'll hunt you and shoot you down like a duck.";break;case 6:biff="Oh, McFly, your shoe's untied.";break;case 7:biff="What are you looking at butthead?";break;default:biff="Manure! I hate manure!";break;}message=["<img style='float:right;width:120px;height:156px;margin:0px 0px 10px 15px' src='/Admin/images2/wizard/biff",img,".jpg'>",message,"<br><br><em>",biff,"</em><div style='clear:both;height:1px'></div>"].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={"Marty":options.buttons.Yes,"Biff":options.buttons.No};delete options.buttons;options.buttons=buttons;}}var $el=$('<div class="ui-alert"></div>').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-buttonchild>a:first").focus().blur();},close:function(e,data,widget){if(e&&e.preventDefault){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();}if(options&&$.isFunction(options.onclose)){options.onclose();}$(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||'');$el.dialog('widget').place({my:'center',at:'center',of:window,collision:'fit'});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;if(typeof e==="number")return{which:e,ctrlKey:false,altKey:false,shiftKey:false};else if(typeof e=="string"){var parts=e.split('-');var key=parts.pop();var which=key==='ENTER'?13:$.ui.keyCode[key];if(!which&&key.length==1)which=key.charCodeAt(0);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<handlers.length;j++){var h=handlers[j];if(e.which===h.key.which&&e.ctrlKey===h.key.ctrlKey&&e.altKey===h.key.altKey&&e.shiftKey===h.key.shiftKey){if(h.handler.apply(this,arguments)===false){result=false;}if(e.isImmediatePropagationStopped()){break;}}}return result;};$.fn.bindkey=function(which,handler){var key=$.getKey(which);if(key&&handler){if(!handler.guid){handler.guid=jQuery.guid++;}var item={key:key,handler:handler};for(var i=0;i<this.length;i++){var elemData=jQuery.data(this[i]);var events=elemData&&elemData.events;var handlers=events&&events['keydown'];var fn=null;if(handlers){for(var j=0;j<handlers.length;j++){if(handlers[j].namespace==='bindkey'){fn=handlers[j];break;}}}if(fn){fn.data.unshift(item);}else{fn=function(e){$.handleBoundKey.apply(this,arguments);};this.eq(i).bind('keydown.bindkey',[item],fn);}}}return this;};$.fn.unbindkey=function(which,handler){var key=$.getKey(which);if(key&&handler&&handler.guid){for(var i=0;i<this.length;i++){var elemData=jQuery.data(this[i]);var events=elemData&&elemData.events;var handlers=events&&events['keydown'];var fn=null;if(handlers){for(var j=0;j<handlers.length;j++){if(handlers[j].namespace==='bindkey'){fn=handlers[j];break;}}}if(fn&&fn.data){for(var j=fn.data.length-1;j>=0;j--){var item=fn.data[j];if(handler.guid===item.handler.guid&&key.which===item.key.which&&key.ctrlKey===item.key.ctrlKey&&key.altKey===item.key.altKey&&key.shiftKey===item.key.shiftKey){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');}};$.fn.flipevent=function(event,handler){var name=event.split('.').shift();var guid=handler.guid;return this.each(function(i){var elemData=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: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($.curCSS(p,'overflow')+$.curCSS(p,'overflowX')+$.curCSS(p,'overflowY'))){return $(p);}p=p.parentNode;}return null;};$.placement=function($el,options){if(!options||!options.of)return null;var of=$(options.of);if(!of.length)return null;var dim1=$el.dimensions();var dim2=of.dimensions();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($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(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-=parseInt(dim1.width/2);break;case'right':css.left-=dim1.width;break;}switch(my[1]){case'center':css.top-=parseInt(dim1.height/2);break;case'bottom':css.top-=dim1.height;break;}switch(at[0]){case'center':css.left+=parseInt(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+=parseInt(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;};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=$('<div class="ui-scroller"><div class="ui-scroller-handle"></div></div>').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($.curCSS(p.firstChild,'marginTop'));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:parseInt(ratio*offset),newtop:parseInt(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(y<dim.top){this.element[0].scrollTop-=this.element[0].offsetHeight;}else{return;}var scroll=this._getScroll();this.elements.handle.css({top:scroll.newtop});return false;}},_handleWheel:function(e){var p=this.element[0];if(p.scrollHeight>p.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+parseInt(scroll);},_drop:function(e,ui){ui.helper.position.parent=null;ui.helper.position=null;}});$.widget("cms.loading",{options:{timeout:20000,message:'&nbsp;',color:'#000000',opacity:0.10,relativeto:null,zIndex:null},overlay:null,oldOverlay:null,_create:function(){if(!this.overlay){if(!this.element.is(':visible')){return;}this.overlay=(this.oldOverlay||$('<div></div>')).addClass('ui-widget-overlay').prependTo(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')));z=Math.max(z,$.ui.dialog.maxZ+1,$.ui.dialog.overlay.maxZ+1);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||'#000000';css.opacity=this.options.opacity||.25;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){shadow=true;this.message=$('<div><div></div></div>').addClass('ui-widget-loading').css({position:'absolute'}).children('div').addClass('ui-widget-loading2').html(this.options.message).end().insertBefore(this.overlay);}var w=this.message.width();var h=this.message.height();var css={left:overlay.left+parseInt((overlay.width-w)/2),top:overlay.top+parseInt((overlay.height-h)/2),zIndex:$.toInt(this.overlay.css('z-index'))+1};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);if($.fx.step['boxShadow']===undefined){$.fx.step['boxShadow']=function(fx){var prop=$.cms.shadow.property();if(!fx.shadowInit){var start=$.cms.shadow.parse($.curCSS(fx.elem,prop));if(start){fx.start=start;fx.parsed=true;fx.end=$.cms.shadow.parse(fx.end+fx.unit);}fx.shadowInit=true;}if(fx.parsed){var h=parseInt((fx.pos*(fx.end.h-fx.start.h))+fx.start.h,10);var v=parseInt((fx.pos*(fx.end.v-fx.start.v))+fx.start.v,10);var b=parseInt((fx.pos*(fx.end.b-fx.start.b))+fx.start.b,10);var o=Math.max(Math.min((fx.pos*(fx.end.o-fx.start.o))+fx.start.o,1),0);fx.elem.style[prop]=$.cms.shadow.css(h,v,b,o);}}}}},_msieShadow:function(){if($.browser.version>6&&this.element.is('div')&&this.element.css('position')!='static'){this.shadow=[$('<div class="ui-shadow-right"></div>').css({position:'absolute'}).appendTo(this.element),$('<div class="ui-shadow-corner"></div>').css({position:'absolute'}).appendTo(this.element),$('<div class="ui-shadow-bottom"></div>').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($.curCSS(this.shadow[0][0],'width'));var h=$.toInt($.curCSS(this.shadow[2][0],'height'));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=$('<div class="'+cls+'"><div><span></span></div></div>').css({position:'absolute',display:'none'});var p;if(this.options.out&&(p=this.element.overflowParent())){this.tooltip.insertBefore(p);}else{this.tooltip.insertBefore(this.element);}if($.browser.msie){this.tooltip.addClass('ie');}this.update();if(!$.browser.msie){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('.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('.image')){this._configureImage(btns);}else if(this.element.is('.document')){this._configureDocument(btns);}else if(this.element.is('.flash')){this._configureFlash(btns);}else if(this.element.is('.video')){this._configureVideo(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);}if(btns.length){this._buttons=$(btns);this.element.attr('spellcheck',false).css({verticalAlign:'middle'});var w=$.toInt($.curCSS(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=$('<img src="/Shared/images/spacer.gif" class="itr itr_color" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" >').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)){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_system" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').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){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_system itr_locked" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectAdminPage,this)).attr('title','Select Admin Page');btns.push(btn[0]);}var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_page" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectPage,this)).attr('title','Select Page');btns.push(btn[0]);}},_configureAdminPage:function(btns){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_system itr_locked" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').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'),cls=all?'itr_link':'itr_page',btn=$('<img src="/Shared/images/spacer.gif" class="itr '+cls+'" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectLink,this)).attr('title',all?'Select Link':'Select Page');btns.push(btn[0]);if(all){btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_page" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectPage,this)).attr('title','Select Page');btns.push(btn[0]);}},_configureImage:function(btns){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_picture" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectImage,this)).attr('title','Select Image');btns.push(btn[0]);},_configureDocument:function(btns){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_document" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectDocument,this)).attr('title','Select Document');btns.push(btn[0]);},_configureFlash:function(btns){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_flash" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectFlash,this)).attr('title','Select Flash');btns.push(btn[0]);},_configureVideo:function(btns){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_video" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').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=$('<img src="/Shared/images/spacer.gif" class="itr '+cls+'" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" >').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=$('<img src="/Shared/images/spacer.gif" class="itr itr_document" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectDataSource,this)).attr('title','Select DataSource');btns.push(btn[0]);}},_configureMultiplePages:function(btns){var btn=$('<img src="/Shared/images/spacer.gif" class="itr itr_page" style="vertical-align:middle;cursor:pointer;margin:1px 1px 0px 0px;" />').insertAfter(this.element).bind('click',$.proxy(this._selectMultiplePages,this)).attr('title','Select Pages');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,highlight: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);},_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.prevUntil('input:hidden').eq(0).prev('input:hidden');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<pages.length;i++){sb.push(pages[i].PageID);}input.val(sb.join(','));}};},_saveFile:function(input){return function(files){if(files){var file=$.isArray(files)?files[0]:files;if(file&&file.Path){input.val(file.Path).trigger('update',[file]).trigger('change',[file]);}}input=null;};},_selectLink:function(e){var link=this.element.data('link'),href=this.element.val(),wz=this.element.is('.all')?$.cms.linkmanager:$.cms.pagebrowser;wz.prototype.activate({link:link,href:href&&$.cms.page?$.cms.page.CleanUrl(href):href,onsave:this._savePage(this.element),sub:this.element.is('.sub'),notext:this.element.is('.notext'),showcustom:!this.element.is('.nocustom')});},_selectImage:function(e){var options={path:this.element.val(),onsave:this._saveFile(this.element),sub:this.element.is('.sub')};if(this.element.is('.shared')){options.tfiles='shared';}else if(this.element.is('.tfiles')){options.tfiles='true';}else if($.cms.filebrowser.prototype.options.tfiles==='mobile'){options.tfiles='mobile';}else{options.tfiles=null;}if(this.element.is('.shared.vpics')){options.tree={fields:'/Shared/videos/vpics'};$.cms.imagebrowser.prototype.activate(options);}else if(this.element.is('.shared')){options.tree={fields:'/Shared/images2'};$.cms.imagebrowser.prototype.activate(options);}else if(this.element.is('.vpics')){options.tree={fields:'/media/vpics'};$.cms.videobrowser.prototype.activate(options);}else{$.cms.imagebrowser.prototype.activate(options);}},_selectDocument:function(e){$.cms.documentbrowser.prototype.activate({path:this.element.val(),onsave:this._saveFile(this.element),sub:this.element.is('.sub'),tfiles:this.element.is('.tfiles')?'true':null});},_selectFlash:function(e){$.cms.flashbrowser.prototype.activate({path:this.element.val(),onsave:this._saveFile(this.element),sub:this.element.is('.sub'),tfiles:this.element.is('.tfiles')?'true':null});},_selectVideo:function(e){var options={path:this.element.val(),onsave:this._saveFile(this.element),sub:this.element.is('.sub'),tfiles:this.element.is('.shared')?'shared':(this.element.is('.tfiles')?'true':null)};if(this.element.is('.spotlight')){options.tree={fields:'/media/spotlight'};}else if(this.element.is('.shared')){options.tree={fields:'/Shared/videos'};}else if(!options.path&&this.element.is('.hd')){options.path='/media/HD/';}$.cms.videobrowser.prototype.activate(options);},_createCheckBox:function(){var hover=$.proxy(this._checkHover,this);this.element.hide().bind('update',$.proxy(this.update,this));this.checkbox=$('<img class="ui-check-style" src="/Shared/images/spacer.gif">').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');}if(this.disabled()){this.checkbox.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');this.element.removeAttr('checked');}else{this.checkbox.addClass('checked');this.element.attr('checked','checked');}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=$('<img class="ui-radio-style" src="/Shared/images/spacer.gif">').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');}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');this.checkbox.addClass('checked');$("input:radio[name='"+this.checkbox.attr('name')+"']").removeAttr('checked');this.element.attr('checked','checked').trigger('change');}},disable:function(){this.element.attr('disabled','disabled');this.checkbox.addClass('disabled');},enable:function(){this.element.removeAttr('disabled');this.checkbox.removeClass('disabled');},disabled:function(){return this.element.attr('disabled')?true:false;},update:function(e){if(this.element.is(':checked')){this.checkbox.addClass('checked');}else{this.checkbox.removeClass('checked');}if(this.element.is(':disabled')){this.checkbox.addClass('disabled');}else{this.checkbox.removeClass('disabled');}},scroll:function(){this.checkbox.scrollIntoView();},_checkHover:function(e){switch(e.type){case'mouseover':this.checkbox.addClass('over');break;case'mouseout':this.checkbox.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));this.thumbnail=tr.find('img.ui-thumb');}},_selectThumbnail:function(e){var options={path:this.element.val()||this.element.attr('_default')||null,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('.shared')){options.tree={fields:'/Shared/images2'};}else if(this.element.is('.tfiles.flash')){options.tree={fields:'/files/flash'};}else if(this.element.is('.vpics')){options.tree={fields:'/media/vpics'};}$.cms.imagebrowser.prototype.activate(options);},_saveThumbnail:function(files){if(files){var file=$.isArray(files)?files[0]:files;if(file&&file.Path){if(this.thumbnail.length){var src=this.thumbnail.attr('src').replace(/([&\?]I=)[^&]*/i,'$1'+$.encode(file.Path));this.thumbnail.attr('src',src)}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){var src=this.thumbnail.attr('src').replace(/([&\?]I=)[^&]*/i,'$1'+$.encode(def));this.thumbnail.attr('src',src)}this.element.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<cls.length;i++){switch(cls[i]){case'color':case'link':case'page':case'adminpage':case'image':case'document':case'flash':case'video':case'date':case'time':case'thumbnail':return true;}}return this.getAttribute&&this.getAttribute('title')?true:false;};$.fn.unselect=function(){return this.each(function(i){var doc=this.ownerDocument;if(doc.selection&&doc.selection.createRange){var range=doc.selection.createRange();if(range.text){doc.selection.empty();}}else{var wn=doc.defaultView||doc.parentWindow;if(wn.getSelection){wn.getSelection().removeAllRanges();}}if(this.blur){this.blur();}});};$.widget("cms.sitesearch",{options:{},_create:function(){this.options.path=this.element.attr('_path')||this.options.path;this.options.limit=this.element.attr('_limit')||this.options.limit;this.options.exclude=this.element.attr('_exclude')||this.options.exclude;this.options.key=this.element.attr('_key')||this.options.key;this.options.autosuggest=$.toBool(this.element.attr('_autosuggest')||this.options.autosuggest);var fn=$.proxy(this._search,this);this.elements={input:this.element.is('input:text')?this.element:this.element.find('input:text:first')};this.elements.input.toggleValue().bindkey('ENTER',fn);var button=this.element.find("input:button,input:submit,input:image,a[href*='__doPostBack']:not([onclick]),a[href*='WebForm_DoPostBackWithOptions']");if(!button.length){button=this.element.find('img:last');}button.bind('click',fn);var onresults=this.element.attr('_onresults');if(onresults){try{this.options.onresults=eval('('+onresults+')');}catch(ex){;}}if(this.options.autosuggest){this.elements.input.combobox({ajaxUrl:$.getAjaxUrl(window.location.href,{AutoSuggest:this.element.attr('id')}),style:{panel:this.element.attr('_panel')||'combo-box'},minchars:$.toInt(this.element.attr('_minchars'))||3,maxHeight:null,textField:this.element.attr('_textfield'),onbuild:function(wz){return function(results,combo){if(wz.options.onresults&&wz.options.onresults(results,combo,wz)===false){return false;}};}(this),onselect:function(wz){return function(e,selected){var text=selected.getRow()[this.options.textField];this.element.val(text||"");if(text){wz._search(e);}return false;}}(this)});}},_search:function(e){var params={};params[this.options.key||'C']=this.elements.input.val();if(this.options.limit){params.L=this.options.limit;}if(this.options.exclude){params.X=this.options.exclude;}e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();window.location.href=$.getAjaxUrl(this.options.path,params);return false;}});$.widget("cms.lightbox",{options:{width:550,height:400},_html:'<div>	<div class="cms-lightbox">		<div class="cms-lightbox-image">			<div class="cms-lightbox-image1"></div>			<div class="cms-lightbox-image2"></div>		</div>		<div class="cms-lightbox-description"></div>		<div class="cms-lightbox-images"><div></div></div>		<div class="cms-lightbox-nav" _nav="-1"><div>&lt; Prev</div></div>		<div class="cms-lightbox-nav next" _nav="1"><div>Next &gt;</div></div>		<div class="cms-lightbox-panel" _panel="-1"><div>&laquo;</div></div>		<div class="cms-lightbox-panel next" _panel="1"><div>&raquo;</div></div>	</div></div>',_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<this.images.length;i++){var url=this._getImageUrl(this.images[i].src,50,50);sb.push('<div style="background-image:url('+url+')" _index="'+i+'"></div>');}this.elements.images.html(sb.join(''));}this._setImage();this._markThumbnail();$(document).bind('keydown',$.proxy(this._navigate,this));},_closeLightbox:function(e,data,popup){$(document).unbind('keydown',this._navigate);},_setImage:function(){var image=this.images[this.index];this.elements.image1.css({backgroundImage:image.css,opacity:1});this.elements.image2.css({backgroundImage:'none'});this.elements.title.html(image.title||"");this.elements.description.html(image.description||"");},_markThumbnail:function(){var page=Math.floor(this.index/this.paging.perpage);if(page!=this.paging.page){this.paging.page=page;var left=(0-page)*this.paging.perpage*57;this.elements.images.stop().animate({marginLeft:left});}this.elements.images.children().filter('.active').removeClass('active').end().eq(this.index).addClass('active');},_showNav:function(e){var nav=$(e.target).closest('div.cms-lightbox-nav').children('div').stop();if(e.type==='mouseenter'){nav.animate(this.options.nav,300,'linear');}else{nav.animate(this.options.bg,300,'linear');}},_navigate:function(e){var amount;if(e.type==='keydown'){switch(e.which){case 39:this._advance(this.index+1);break;case 37:this._advance(this.index-1);break;default:return;}}else if(e.type==='click'){var el=$(e.target),p=el.parent(),index=el.attr('_index'),panel=$.toInt(el.attr('_panel')||p.attr('_panel')),nav=$.toInt(el.attr('_nav')||p.attr('_nav'));if(index){this._advance($.toInt(index));}else if(nav){this._advance(this.index+nav);}else if(panel){this._advance((this.paging.page+panel)*this.paging.perpage);}}},_advance:function(index){if(index<0){index=this.images.length-1;}else if(index>=this.images.length){index=0;}this.prev=this.index;this.index=index;this.elements.title.html("");this.elements.description.html("");this._markThumbnail();this.elements.image1 .stop().css({opacity:1}).css({backgroundImage:this.images[this.prev].css}).animate({opacity:0},300,'linear');this.elements.image2 .stop().css({opacity:0}).css({backgroundImage:this.images[this.index].css}).animate({opacity:1},300,'linear',$.proxy(this._setImage,this));},_getImageUrl:function(src,w,h){if(src){return'/images/thumbnail.aspx?I='+$.encode(src)+'&W='+(w||this.options.width)+'&H='+(h||this.options.height)+'&B1=FFFFFF';}else{return null;}},destroy:function(){if(this.popup){this.popup.remove();}$.Widget.prototype.destroy.apply(this,arguments);}});$.cms.lightbox.r_img=/\.(?:gif|bmp|png|jpg|jpe|jpeg|tif|tiff)$/i;$.widget("cms.popup",$.ui.dialog,{options:{single:false,nobridge:true,modal:true,random:false,noscroll:false,submit:false,submitName:'SAVE',buttons:{"CLOSE":function(e,widget){widget.close.apply(widget,[e]);}},open:function(e,data,widget){widget._open.apply(widget,[e,data]);}},_html:'	<div>		<div class="ui-dialog-main">			<iframe class="ui-dialog-iframe" src="/Shared/blank.html" frameborder=0 marginheight=0 marginwidth=0 {scroll}></iframe>		</div>	</div>',_create:function(){if(typeof this.options.width==='number'){this.options.width+=2;}if(typeof this.options.height==='number'){this.options.height+=76;}if(this.options.submit){this.options.buttons={};this.options.buttons[this.options.submitName||'SAVE']=function(e,widget){widget._submit.apply(widget,[e]);};this.options.buttons["CANCEL"]=function(e,widget){widget.close.apply(widget,[e]);};}$.ui.dialog.prototype._create.apply(this,arguments);var wn=$(window).dimensions();if(!$.browser.msie6&&wn.width-this.options.width>80&&wn.height-this.options.height>80){this.uiDialog.css({position:'fixed'});}else{this.uiDialog.css({position:'absolute'});}this.elements={main:this.uiDialog.find('div.ui-dialog-content'),iframe:this.element.find('iframe')};if(this.options.noscroll){this.elements.iframe.css({overflow:'hidden',overflowY:'hidden',overflowX:'hidden'});}this.uiDialog.captureScroll();if(!$.cms.popup.list){$.cms.popup.list=[];}$.cms.popup.list.addItem(this);},_open:function(){var url=this.options.random?$.getAjaxUrl(this.options.url,{RND:Math.random()}):this.options.url;this.elements.iframe.css({width:this.elements.main.width(),height:this.elements.main.height()}).attr('src',url);},_submit:function(){if($.isFunction(this.options.onsubmit)){if(this.options.onsubmit.apply(this,arguments)===false){return false;}}},close:function(){if($.isFunction(this.options.onclose)){if(this.options.onclose.apply(this,arguments)===false){return false;}}this.elements.iframe.unbind().attr('src','/Shared/blank.html');if($.cms.popup.list){$.cms.popup.list.removeItem(this);}this.element.remove();},destroy:function(){return $.ui.dialog.prototype.destroy.apply(this,arguments);}});$.popup=function(options){var html=$.cms.popup.prototype._html.replace('{scroll}',options&&options.noscroll?'scrolling=no':'');var el=$(html);var instance=new $.cms.popup(options,el[0]);$.data(el[0],'popup',instance);return instance;};}$.fn.cursorat=function(){if(!this.length){return null;}var input=this[0];if(input.setSelectionRange){return[input.selectionStart,input.selectionEnd];return pos;}else if(input.createTextRange){input.focus();var r1=input.ownerDocument.selection.createRange();var len=r1.text.length;var r2=input.createTextRange();r2.setEndPoint("EndToStart",r1);return[r2.text.length,r2.text.length+len];}else{return null;}};$.fn.selecttext=function(start,end){return this.each(function(i){if(this.focus){this.focus();}if(start===undefined){start=0;}else if(start===-1){start=this.value.length;}if(end===undefined){end=this.value.length;}if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.createTextRange){var range=this.createTextRange();range.collapse(true);range.moveStart("character",start);range.moveEnd("character",end-start);range.select();}else{var doc=this.ownerDocument;var wn=doc.defaultView||doc.parentWindow;if(doc&&doc.body&&doc.body.createTextRange){var range=doc.body.createTextRange();range.moveToElementText(this);range.select();}else if(doc&&doc.createRange&&wn&&wn.getSelection){var range=doc.createRange();range.selectNodeContents(this);var selection=wn.getSelection();selection.removeAllRanges();selection.addRange(range);}}});};$.fn.insertAtCursor=function(text){return this.each(function(i){if(typeof this.value===undefined||!text){return;}if(this.setSelectionRange){var start=this.selectionStart,end=this.selectionEnd,top=this.scrollTop;this.value=this.value.substring(0,start)+text+this.value.substring(end,this.value.length);this.selectionStart=start+text.length;this.selectionEnd=start+text.length;this.scrollTop=top;}else{var doc=this.ownerDocument;var wn=this.defaultView||doc.parentWindow;if(doc&&doc.selection&&doc.selection.createRange){var range=doc.selection.createRange();range.text=text;range.collapse(true);}}});};$.fn.scrollIntoView=function(speed,top){return this.each(function(i){var $el=$(this);var parent=$el.parents().filter(function(){return/auto|scroll|hidden/.test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);if(parent.length){if(parent[0].scrollHeight>parent[0].offsetHeight){var t=$el.offset().top-parent.offset().top+parent[0].scrollTop;var h1=$el.outerHeight(true);var h2=parent[0].clientHeight;var scrollTo=null;if(top){scrollTo=Math.max(t-10,0);}else if(t+h1>parent[0].scrollTop+h2-10){scrollTo=t+h1+10-h2;}else if(t<parent[0].scrollTop+10){scrollTo=Math.max(t-10,0);}if(scrollTo){if(speed){parent.animate({scrollTop:scrollTo},speed);}else{parent[0].scrollTop=scrollTo;}}}}else{var t=$el.offset().top-$.toInt($(document.body).css('paddingTop'))-10;if(speed){$('html,body').animate({scrollTop:t});}else{document.documentElement.scrollTop=t;document.body.scrollTop=t;}}});};$.fn.unselectable=function(){if($.browser.webkit){this.css('-webkit-user-select','none');}else if($.browser.mozilla){this.css('-moz-user-select','none');}else{this.css('user-select','none').attr('unselectable','on');}return this.bind('selectstart.ui',function(){return false;});;};$.fn.removeStyle=function(name){if(!name){return this;}else if(name.toLowerCase){name=[name.toLowerCase()];}else if($.isArray(name)){for(var i=0;i<name.length;i++)name[i]=(''+name[i]).toLowerCase();}else{return this;}return this.each(function(i){var el=$(this);var styles=(el.attr('style')||'').split(';');for(var i=styles.length-1;i>=0;i--){var style=$.trim(styles[i].split(':')[0]).toLowerCase();for(var j=0;j<name.length;j++){if(style===name[j]||style.indexOf(name[j]+'-')===0){if(i==0){styles.shift();}else if(i==styles.length-1){styles.pop();}else{styles.splice(i,1);}break;}}}var newstyles=$.trim(styles.join(';'));if(newstyles){el.attr('style',newstyles);}else{el.removeAttr('style');}});};$.fn.selfsubmit=function(){var btn=this.find("input:submit,input:image,a[href*='__doPostBack']:not([onclick]),a[href*='WebForm_DoPostBackWithOptions']").filter(':last');if(btn.length){if(this.is("[icobalt='CobaltControls.Controls.SearchGrid']")){this.find("a[href^='javascript:void'][href*='Clear']").data('submitbtn',btn).click(function(e){var btn=$(this).prev(':input').val("").trigger("change").end().data('submitbtn');if(btn&&btn.length){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();if(btn[0].click){btn[0].click();}else if(btn.is("a[href^='javascript:']")){window.location.href=btn.attr('href');}else{btn.click();}return false;}});}this.find('input:text,input:password').data('submitbtn',btn).bind('keypress',function(e){if(e.which!==13){return;}var btn=$(this).data('submitbtn');if(btn&&btn.length){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();if(btn[0].click){btn[0].click();}else if(btn.is("a[href^='javascript:']")){window.location.href=btn.attr('href');}else{btn.click();}return false;}});}return this;};$.fn.autoNumber=function(){var inputs=$(this).find('input:text');var total=inputs.length;inputs.each(function(i){this._index=i;this._last=total-1;$(this).bind('keydown',$.autoNumber);});return this;};$.autoNumber=function(e){var input=$(this);if((e.which>=48&&e.which<=57)||(e.which>=96&&e.which<=105)){if(e.shiftKey){return false;}else if(this._index<this._last){var max=$.toInt(input.attr('maxlength'));if(this.value&&this.value.length===max-1){var next=input.closest('table').find('input:text').eq(this._index+1);if(next.length){var fn=function(input){return function(){input.focus();input=null;};}(next[0]);setTimeout(fn,1);}}}}else if(e.which===9){if(!e.shiftKey&&!this.value&&this._index>0&&this._index<3){var prev=input.closest('table').find('input:text').eq(this._index-1);if(prev.val()){return false;}}}else{switch(e.which){case 8:case 27:case 35:case 36:case 37:case 39:case 46:return true;default:return false;}}};$.fn.nopaste=function(){return this.bind('keydown contextmenu',function(e){var cancel=false;switch(e.type){case'keydown':if((e.ctrlKey||e.cmdKey)&&e.which===86){cancel=true;}break;case'contextmenu':cancel=true;break;}if(cancel){if(e.preventDefault){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();}return false;}});};$.fn.getRow=function(attr){if(!this.length)return{};var row=this[0].$row;if(!row){try{row=eval('('+this.attr(attr||'_row')+')')}catch(ex){row={};}this[0].$row=row=row||{};}return row;};$.preload=function(img){var preloader=$('#hidden_preloader');if(!preloader.length){preloader=$('<div id="hidden_preloader" style="display:none;"></div>').appendTo(document.body);}var imgs=$.makeArray(img);for(var i=0;i<imgs.length;i++){var img=imgs[i];if(preloader.find("img[src$='"+img+"']").length==0)preloader.append('<img src="'+img+'">');}};$.specRegex=/['"\(\)]/g;$.encode=function(val){if(val===undefined||val===null){return'';}else{return encodeURIComponent(val+"").replace($.specRegex,function(m){switch(m){case"'":return'%27';case'"':return'%22';case'(':return'%28';case')':return'%29';default:return m;}});}};$.decode=function(val){if(!val){return"";}else{try{return decodeURIComponent(val);}catch(ex){return val||"";}}};$.encodeUri=function(val){if(!val){return'';}else{return val.replace(/[?& =]/g,function(m){switch(m){case'?':return'%3F';case'&':return'%26';case' ':return'%20';case'=':return'%3D';default:return m;}});}};$.bookmark=function(obj,title,url){if(window.sidebar&&window.sidebar.addPanel){window.sidebar.addPanel(title,url,"");return false;}else if(window.external&&'addFavorite'in window.external){window.external.AddFavorite(url,title);}else if(window.opera&&window.print){obj.setAttribute('href',url);obj.setAttribute('title',title);obj.setAttribute('rel','sidebar');obj.click();return false;}else{window.location.href=url;return false;}};$.log=function(obj){if(typeof firebug!='undefined')firebug.d&&firebug.d.console&&firebug.d.console.cmd&&firebug.d.console.cmd.log(obj);else if(typeof console!='undefined')console&&console.log&&console.log(obj);};$.trace=function(){if(typeof firebug!='undefined')firebug.d&&firebug.d.console&&firebug.d.console.cmd&&firebug.d.console.cmd.trace();else if(typeof console!='undefined')console&&console.trace&&console.trace();};$.inspect=function(el){if(el&&el.jquery)el=el.length?el[0]:null;if(!el)return;if(typeof firebug!='undefined')firebug.inspect&&firebug.inspect(el);};$.fn.captureScroll=function(){return this.bind('mousewheel',$.containScrolling);};$._r_scrolling=/^(?:auto|scroll)$/;$.containScrolling=function(e){var p=e.target;if(e.target.nodeName.toLowerCase()==='select'){return;}do{if($._r_scrolling.test($.curCSS(p,'overflow'))||$._r_scrolling.test($.curCSS(p,'overflow-y'))){var top=p.scrollTop;p.scrollTop-=(e.delta*70);if(e.target.nodeName.toLowerCase()==='textarea'&&top===p.scrollTop){continue;}else{return false;}}}while(p!=this&&(p=p.parentNode));return false;};$.comet=function(id,onupdate,onerror){if(id&&onupdate===false){if(window._cometunload){window._cometunload[id]=false;}$.ajax({url:$.getAjaxUrl('/CobaltComet.ashx',{ID:id,Cancel:'true',RND:Math.random()})});return;}if(!id||!$.isFunction(onupdate)){return;}if(!window._cometunload){window._cometunload={};$(window).unload($.cometunload);}window._cometunload[id]=true;$.ajax({url:$.getAjaxUrl('/CobaltComet.ashx',{ID:id,RND:Math.random()}),dataType:'json',success:function(data){if(data&&data!=='TIMEOUT'){onupdate(data);}if(data&&data!=='INVALID'){$.comet(id,onupdate,onerror);}else{window._cometunload[id]=false;}},error:function(xhr){if($.isFunction(onerror)){if(onerror(xhr)===false){return;}}$.comet(ds,onupdate,onerror);}});};$.cometunload=function(){if(window._cometunload){for(var p in window._cometunload){if(window._cometunload[p]){$.comet(p,false);}}}};$.trimLeft=function(value,character){if(!value)return'';value=''+value;var pos=0;if(!character)character=" ";while(pos<value.length&&value.charAt(pos)===character){pos++;}return value.substring(pos);};$.toInt=function(amount){if(!amount){return 0;}else if(typeof amount==='number'){return Math.round(amount);}else if(typeof(amount)=='string'){amount=$.trimLeft(amount.replace(/[^\d.-]/g,''),'0');}var val=parseInt(amount);if(isNaN(val)){return 0;}else{return val;}};$.toFloat=function(amount){if(!amount){return 0.00;}var factor=1.00;if(typeof amount==='number'){return amount;}else if(typeof amount==='string'){if(/%\s*$/.test(amount)){factor=0.01;}amount=amount.replace(/[^\d.-]/g,'');}var val=parseFloat(amount)*factor;if(isNaN(val)){return 0.00;}else{return val;}};$.toBool=function(val){if(val===undefined||!val)return false;if(val===true)return true;if(val===false)return false;switch((''+val).toUpperCase()){case"1":case"ON":case"TRUE":case"YES":case"SUCCESS":return true;default:return false;}};$.toIntArray=function(val){if(!val){return[];}if(typeof val==='string'){if(val.indexOf('|')>=0){val=val.split('|');}else if(val.indexOf('^')>=0){val=val.split('^');}else{val=val.split(',');}}else if(!$.isArray(val)){val=$.makeArray(val);}for(var i=0;i<val.length;i++){val[i]=$.toInt(val[i]);}return val;};$.toHex=function(color){if(!color||!$.isArray(color)||color.length!=3||typeof color[0]!='number'){return"000000";}try{var hex=(color[0]<16?'0':'')+color[0].toString(16)+(color[1]<16?'0':'')+color[1].toString(16)+(color[2]<16?'0':'')+color[2].toString(16);return hex.toUpperCase();}catch(ex){return"000000";}};$.RGBtoHSV=function(rgb){if(!rgb||!$.isArray(rgb)||rgb.length!=3||typeof rgb[0]!='number'){return[0,0,0];}var red=rgb[0];var green=rgb[1];var blue=rgb[2];var minRGB=Math.min(Math.min(red,green),blue);var maxRGB=Math.max(Math.max(red,green),blue);var delta=maxRGB-minRGB;var h=0.0;var v=maxRGB/255;var s=maxRGB==0?0:delta/maxRGB;if(s!=0){if(maxRGB==red){h=(green-blue)/delta;}else if(maxRGB==green){h=2+(blue-red)/delta;}else{h=4+(red-green)/delta;}}else{h=0;}h=h*60;if(h<0){h+=360;}return[h,s,v];};$.HSVtoRGB=function(hsv){if(!hsv||!$.isArray(hsv)||hsv.length!=3||typeof hsv[0]!='number'){return[0,0,0];}var hue=hsv[0];var saturation=hsv[1];var value=hsv[2];if(saturation===0){value=parseInt(value*255);return[value,value,value];}else{hue=hue/60;var i=Math.floor(hue);var f=hue-i;var p=value*(1-saturation);var q=value*(1-saturation*f);var t=value*(1-saturation*(1-f));var r,g,b;switch(i){case 0:r=value;g=t;b=p;break;case 1:r=q;g=value;b=p;break;case 2:r=p;g=value;b=t;break;case 3:r=p;g=q;b=value;break;case 4:r=t;g=p;b=value;break;default:r=value;g=p;b=q;break;}}return[parseInt(r*255),parseInt(g*255),parseInt(b*255)];};$.currencyFormat=function(amount){var i=$.toFloat(amount);if(isNaN(i)){i=0.00;}var minus='';if(i<0){minus='-';}i=Math.abs(i);i=parseInt((i+.005)*100);i=i/100;s=new String(i);if(s.indexOf('.')<0){s+='.00';}if(s.indexOf('.')==(s.length-2)){s+='0';}s=minus+s;var delimiter=",";var a=s.split('.',2);var d=a[1];var i=parseInt(a[0]);if(isNaN(i)){return'';}var minus='';if(i<0){minus='-';}i=Math.abs(i);var n=new String(i);var a=[];while(n.length>3){var nn=n.substr(n.length-3);a.unshift(nn);n=n.substr(0,n.length-3);}if(n.length>0){a.unshift(n);}n=a.join(delimiter);if(d.length<1){amount=n;}else{amount=n+'.'+d;}amount=minus+amount;return'$'+amount;};$.numberFormat=function(amount,digits){amount=$.toFloat(amount);digits=$.toInt(digits);var sb=[];var scale=Math.floor(Math.log(amount)/ Math.LN10 /3);while(scale>0){var factor=Math.pow(10,scale*3);sb.push(Math.floor(amount/factor));amount=amount%factor;scale--;}if(digits>0){var factor=Math.pow(10,digits);var number;if(amount<1){number=(''+Math.floor((10+amount)*factor)).substr(1);}else{number=''+Math.floor(amount*factor);}sb.push(number.substr(0,number.length-digits)+'.'+number.substr(number.length-digits));}else{if(amount<100&&sb.length>0){sb.push((''+Math.floor(1000+amount)).substr(1));}else{sb.push(Math.floor(amount));}}return sb.join(',');};$.percentFormat=function(amount,digits){amount=$.toFloat(amount)*100;return $.numberFormat(amount,digits)+'%';};$.kbFormat=function(bytes,upper){bytes=$.toInt(bytes);if(bytes<1024)return bytes+(upper?' B':'b');else if(bytes<(1024*1024))return(Math.round(bytes/1024*10)/10)+(upper?' KB':'kb');else return(Math.round(bytes/1024/1024*10)/10)+(upper?' MB':'mb');};$.datetime={pattern:/(d+)|(h+)|(H+)|(m+)|(M+)|(s+)|(t+)|(T+)|(y+)|(rr)|(RR)/g,leadingZero:function(val){if(val<10)return'0'+val;else return val;},format:function(date,format){if(!date)return'';if(!format)format='d-MMM-yyyy';return format.replace($.datetime.pattern,function(){return $.datetime.process(date,Array.prototype.slice.call(arguments,1));});},process:function(dateTime,args){for(var i=0;i<args.length;i++){var key=args[i];if(!key)continue;switch(i){case 0:switch(key.length){case 1:return dateTime.getDate();case 2:return $.datetime.leadingZero(dateTime.getDate());case 3:switch(dateTime.getDay()){case 0:return'Sun';case 1:return'Mon';case 2:return'Tue';case 3:return'Wed';case 4:return'Thu';case 5:return'Fri';case 6:return'Sat';default:return'';}default:switch(dateTime.getDay()){case 0:return'Sunday';case 1:return'Monday';case 2:return'Tuesday';case 3:return'Wednesday';case 4:return'Thursday';case 5:return'Friday';case 6:return'Saturday';default:return'';}}case 1:var hours=dateTime.getHours();if(hours>12)hours-=12;return key.length==1?hours||12:$.datetime.leadingZero(hours||12);case 2:return key.length==1?dateTime.getHours():$.datetime.leadingZero(dateTime.getHours());case 3:return key.length==1?dateTime.getMinutes():$.datetime.leadingZero(dateTime.getMinutes());case 4:switch(key.length){case 1:return dateTime.getMonth()+1;case 2:return $.datetime.leadingZero(dateTime.getMonth()+1);case 3:switch(dateTime.getMonth()+1){case 1:return"Jan";case 2:return"Feb";case 3:return"Mar";case 4:return"Apr";case 5:return"May";case 6:return"Jun";case 7:return"Jul";case 8:return"Aug";case 9:return"Sep";case 10:return"Oct";case 11:return"Nov";case 12:return"Dec";default:return'';}default:switch(dateTime.getMonth()+1){case 1:return"January";case 2:return"February";case 3:return"March";case 4:return"April";case 5:return"May";case 6:return"June";case 7:return"July";case 8:return"August";case 9:return"September";case 10:return"October";case 11:return"November";case 12:return"December";default:return'';}}case 5:return key.length==1?dateTime.getSeconds():$.datetime.leadingZero(dateTime.getSeconds());case 6:return(dateTime.getHours()<12?'a':'p')+(key.length==1?'':'m');case 7:return(dateTime.getHours()<12?'A':'P')+(key.length==1?'':'M');case 8:return key.length==2?dateTime.getFullYear().toString().substr(2):dateTime.getFullYear();case 9:var d=dateTime.getDate();switch(date.Day){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}case 10:var d=dateTime.getDate();switch(date.Day){case 1:case 21:case 31:return"ST";case 2:case 22:return"ND";case 3:case 23:return"RD";default:return"TH";}}}},_patterns:[/^(\d\d?)[ -\/\\]+([a-zA-Z]{3,9})[- \/\\]+(\d{2}|\d{4})$/,/^(\d{4})(\d{2})(\d{2})$/,/^(\d\d?)[ -\/\\]+([a-zA-Z]{3,9})[- \/\\]+(\d{2}|\d{4})\s+(\d{1,2}):(\d{2})(A|P)M?$/i,/^(\d{1,2}):(\d{2}):?(A|P)M?$/i],_months:{jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},parse:function(val){if(!val){return null;}else if(val.constructor===Date){return val;}else if(typeof val==='number'){return new Date(val);}else{val=$.trim((""+val)).replace(/(\d)([AP]M)\b/i,'$1:$2');var date=new Date(val);if(isNaN(date)){var p=$.datetime._patterns,r,index=-1,day,month,year,hours,mins,date=null;for(var i=0;i<p.length;i++){r=p[i].exec(val);if(r){index=i;break;}}switch(index){case 0:day=r[1]-0;year=(r[3].length==2?'20'+r[3]:r[3])-0;month=$.datetime._months[r[2].substr(0,3).toLowerCase()]||0;date=new Date(year,month,day);break;case 1:date=new Date(parseInt(r[1]),parseInt(r[2])-1,parseInt(r[3]));break;case 2:day=r[1]-0;year=(r[3].length==2?'20'+r[3]:r[3])-0;month=$.datetime._months[r[2].substr(0,3).toLowerCase()]||0;date=new Date(year,month,day);hours=$.toInt(r[4])+(r[6].toUpperCase()=='P'?12:0);date.setHours(hours);date.setMinutes($.toInt(r[5]));date.setSeconds(0);break;case 3:date=new Date(1900,0,1);hours=$.toInt(r[1]);if(hours==12)hours=0;hours+=(r[3].toUpperCase()=='P'?12:0);date.setHours(hours);date.setMinutes($.toInt(r[2]));date.setSeconds(0);break;}}return date;}}};$.phoneFormat=function(data){if(!data){return null;}else{var phone=(""+data).replace(/\D+/g,"");var start="";if(phone.substr(0,1)==="1"){start="1";phone=phone.substr(1);}if(phone.length>=10){return start+"("+phone.substr(0,3)+") "+phone.substr(3,3)+"-"+phone.substr(6,4)+(phone.length===10?"":" x"+phone.substr(10));}else if(phone.length>=3){return start+phone;}else{return data;}}};$.isDate=function(val){return val&&val.constructor===Date?true:false;};$.escapeCodes={};$.escapeCodes[String.fromCharCode(8364)]='&euro;';$.escapeCodes[String.fromCharCode(162)]='&cent;';$.escapeCodes[String.fromCharCode(163)]='&pound;';$.escapeCodes[String.fromCharCode(165)]='&yen;';$.escapeCodes[String.fromCharCode(164)]='&curren;';$.escapeCodes[String.fromCharCode(169)]='&copy;';$.escapeCodes[String.fromCharCode(174)]='&reg;';$.escapeCodes[String.fromCharCode(8482)]='&trade;';$.escapeCodes[String.fromCharCode(177)]='&plusmn;';$.escapeCodes[String.fromCharCode(8800)]='&ne;';$.escapeCodes[String.fromCharCode(8776)]='&asymp;';$.escapeCodes[String.fromCharCode(8804)]='&le;';$.escapeCodes[String.fromCharCode(8805)]='&ge;';$.escapeCodes[String.fromCharCode(247)]='&divide;';$.escapeCodes[String.fromCharCode(215)]='&times;';$.escapeCodes[String.fromCharCode(8734)]='&infin;';$.escapeCodes[String.fromCharCode(189)]='&frac12;';$.escapeCodes[String.fromCharCode(188)]='&frac14;';$.escapeCodes[String.fromCharCode(190)]='&frac34;';$.escapeCodes[String.fromCharCode(178)]='&sup2;';$.escapeCodes[String.fromCharCode(179)]='&sup3;';$.escapeCodes[String.fromCharCode(8240)]='&permil;';$.escapeCodes[String.fromCharCode(182)]='&para;';$.escapeCodes[String.fromCharCode(167)]='&sect;';$.escapeCodes[String.fromCharCode(945)]='&alpha;';$.escapeCodes[String.fromCharCode(946)]='&beta;';$.escapeCodes[String.fromCharCode(947)]='&gamma;';$.escapeCodes[String.fromCharCode(916)]='&Delta;';$.escapeCodes[String.fromCharCode(181)]='&micro;';$.escapeCodes[String.fromCharCode(937)]='&omega;';$.escapeCodes[String.fromCharCode(8721)]='&sum;';$.escapeCodes[String.fromCharCode(216)]='&Oslash;';$.escapeCodes[String.fromCharCode(8736)]='&ang;';$.escapeCodes[String.fromCharCode(186)]='&deg;';$.escapeCodes[String.fromCharCode(171)]='&laquo;';$.escapeCodes[String.fromCharCode(187)]='&raquo;';$.escapeCodes[String.fromCharCode(183)]='&middot;';$.escapeCodes[String.fromCharCode(8226)]='&bull;';$.escapeCodes[String.fromCharCode(8224)]='&dagger;';$.escapeCodes[String.fromCharCode(8225)]='&Dagger;';$.escapeCodes2={};$.escapeCodes2[String.fromCharCode(8216)]='&lsquo;';$.escapeCodes2[String.fromCharCode(8217)]='&rsquo;';$.escapeCodes2[String.fromCharCode(8220)]='&ldquo;';$.escapeCodes2[String.fromCharCode(8221)]='&rdquo;';$.cleanHtml=function(html,indent,strict){if(!html)return'';if(!$.escapeRegex){var sb=[];for(var p in $.escapeCodes){sb.push(p);}for(var p in $.escapeCodes2){sb.push(p);}$.escapeRegex=new RegExp("["+sb.join("")+"]",'g');}var rclean1=new RegExp('\\s+(?:jQuery\\d+|sizcache|sizset)\\s*=\\s*"[^"]*"','g');var rclean1b=new RegExp('<div [^>]*?_firebugConsole\\b[^>]*>[^<]*</div>','gi');var rclean2=new RegExp('</?\\w+\\b','g');var rclean3a=new RegExp('<\\w[^>]*?>','g');var rclean3b=new RegExp('([\\w-\\$]+)\\s*=\\s*(?:([\'""])([\\s\\S]*?)\\2|([^\\s\'"">]+))','g');var rclean4=new RegExp('"','g');var rclean5=new RegExp(' style\\s*=\\s*"([^"]*)"','gi');var rclean5a=new RegExp('<base\\b[^>]+?\\bhref\\b[^>]+>\\s+','i');var rclean5c=new RegExp('<span[^>]*?\\bscaytid\\b[^>]*>([^<]*)</span>','gi');var rclean5d=new RegExp('(<div [^>]*?class="[^>"]*?\\bbuildflash\\b[^>]*>[^<]*?)<object\\b[\\s\\S]*?</object>\\s*','gi');var rclean6=new RegExp('\\b([\\w-]+)\\s*:\\s*([^;]+)','g');var rclean6a=new RegExp('\\burl\\(([^\\)]*)\\)','g');var rclean7=new RegExp('^[^<]*','g');var rclean8=new RegExp('(</?)(\\w+\\b|\\!)([^>]*>)([^<]*)','g');var rclean9=new RegExp('^\s+');var rclean9a=new RegExp('(<script\\b[^>]*?>)([\\s\\S]+?)(</script>)','gi');var rclean9b=new RegExp('\\{Replace\\-Script\\-Code\\d+\\}','g');var rchars=[String.fromCharCode(162),String.fromCharCode(167),String.fromCharCode(169),String.fromCharCode(171),String.fromCharCode(174),String.fromCharCode(176),String.fromCharCode(187)];var rspecial=new RegExp('['+rchars.join("")+']','g');var rspecialfix=["&cent;","&sect;","&copy;","&#171;","&reg;","&deg;","&raquo;"];html=html.replace(rclean1,'').replace(rclean1b,'').replace(rclean2,function(m){return m.toLowerCase();}).replace(rclean3a,function(m){return m.replace(rclean3b,function(m,m1,m2,m3,m4){var val=(m3||m4||'').replace(rclean4,'');if($.cms&&$.cms.page){switch(m1){case"src":case"background":case"_overimg":val=$.cms.page.CleanUrl(val);break;case"href":val=$.cms.page.CleanUrl(val)||"/";break;}}return m1+'="'+val+'"';});}).replace(rclean5,function(m,m1){if($.cms.csseditor){var style=$.cms.csseditor.collapse(m1,true);return style?' style="'+style+'"':"";}return m.replace(rclean6,function(m,m1,m2){if($.cms&&$.cms.page){return m1.toLowerCase()+':'+m2.replace(rclean6a,function(m3,m4){return'url('+$.cms.page.CleanUrl(m4)+')';});}else{return m1.toLowerCase()+':'+m2;}});}).replace(rclean5a,'').replace(rclean5c,'$1').replace(rclean5d,'$1').replace($.escapeRegex,function(m){return $.escapeCodes[m]||$.escapeCodes2[m]||m;}).replace(rspecial,function(m){for(var i=0;i<rchars.length;i++){if(m===rchars[i]){return rspecialfix[i];}}return m;});if(indent){var script={};var sindex=0;html=html.replace(rclean9a,function(m,m1,m2,m3){sindex++;var key='{Replace-Script-Code'+sindex+'}';script[key]=m2;return m1+key+m3;});var nochild=function(tag,parent){switch(tag){case'html':return true;case'li':return parent.tag==='li';default:return false;}};var selfclosing=function(item){if(!item)return false;if(item.html.endsWith('/>')){return true;}else{switch(item.tag){case'area':case'base':case'br':case'embed':case'hr':case'img':case'input':case'link':case'meta':case'param':return true;default:return false;}}};var page={};page.items=[];var m=rclean7.exec(html);if(m){var start=m[0].replace(/^\s+/,'').replace(/\s+$/,' ');if(start){page.items.push({text:start});}}var literal=null;var parent=page;while(m=rclean8.exec(html)){if(m[2]==='tbody'){continue;}var close=m[1]==='</'||(m[2]==='!'&&m[3].endsWith('-->'));var pop=null;if(close){var p=parent;while(p&&p.tag!==m[2]){p=p.parent;}if(!p){if(!parent.items){parent.items=[];}parent.items.push({text:m[0]});}else{p.closing=m[1]+m[2]+m[3];if(m[4]){p.closingText=m[4];}parent=p.parent;}}else{var item={tag:m[2],html:m[1]+m[2]+m[3],text:m[4]};if(item.tag==='li'){item.closing='</li>';}if(parent.parent&&nochild(item.tag,parent)){parent=item.parent=parent.parent;}if(!parent.items){parent.items=[];}if(parent.items.length){item.prev=parent.items[parent.items.length-1];}item.parent=parent;parent.items.push(item);if(selfclosing(item)){item.self=true;}else{parent=item;}}}var nesting=function(parent){if(!parent||!parent.items||!parent.items.length){return false;}switch(parent.tag){case'html':case'head':case'body':return true;case'i':case'b':case'em':case'u':case'strong':case'sub':case'sup':return false;case'td':case'li':case'a':case'p':case'span':case'font':case'if':case'h1':case'h2':case'h3':case'h4':return parent.items.length>1||parent.items[0].tag==='div';default:return true;}};var inline=function(parent){switch(parent&&parent.tag){case'i':case'b':case'em':case'u':case'strong':case'a':case'span':case'font':case'sub':case'sup':return true;default:return false;}};var renesting=function(parent){if(!parent){return false;}switch(parent.tag){case'td':case'tr':return true;default:return false;}};var cleanstyle=function(text,indent){text=$.trim(text);if(!text)return'';var r_comments=/\/\*[\s\S]*?\*\//g;var r_style=/([\w:\.#,\*\-\\\s]+)\{([^\}]*)\}/g;var r_rgb=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i;var r_selector=/(^| |,)(\w+)(\.\w+)?/g;var sheet=text.replace(r_comments,'');var css=[];var m;while(m=r_style.exec(sheet)){var s=$.trim(m[1]).replace(/\s+/,' ');css.push({s:s,v:$.trim(m[2])});}var sb=['\n'];for(var i=0;i<css.length;i++){var name=$.trim(css[i].s.replace(r_selector,function(m,m1,m2,m3){return m1+m2.toLowerCase()+(m3||'');}));if(indent){sb.push(indent);}if(i===0){sb.push('\t');}sb.push(name);sb.push(' {\n');var styles=css[i].v.split(';');for(var j=0;j<styles.length;j++){var style=styles[j].split(':');if(style.length===2){if(r_rgb.test(style[1])){style[1]=style[1].replace(r_rgb,function(m,m1,m2,m3){var c={};c.r=parseInt(m1);c.g=parseInt(m2);c.b=parseInt(m3);var hex=(c.r<16?'0':'')+c.r.toString(16)+(c.g<16?'0':'')+c.g.toString(16)+(c.b<16?'0':'')+c.b.toString(16);return'#'+hex;});}if(indent)sb.push(indent);sb.push('        ');sb.push($.trim(style[0].toLowerCase()));sb.push(': ');sb.push($.trim(style[1]));sb.push(';\n');}}if(indent){sb.push(indent);}sb.push('\t');sb.push('}\n');if(indent){sb.push(indent);}}return sb.join('');};var clean=function(text){return(''+text).replace(/\s+/g,' ');};var trimcontent=function(text,parent,indent){if(!parent||!parent.parent||!text||parent.tag==='pre'){return text;}if(parent.tag==='style'){return cleanstyle(text,indent);}else if(parent.tag==='head'||parent.parent.tag==='head'){return $.trim(clean(text));}else{return clean(text).replace(/^\s+/,'');}};var trimend=function(text,parent){if(!parent||!parent.parent||!text){return text;}if(parent.tag==='head'||parent.parent.tag==='head'||parent.tag==='td'||parent.tag==='tr'){return $.trim(clean(text));}else{if(parent.parent.items[parent.parent.items.length-1]===parent){return clean(text).replace(/\s+$/,'');}else{return clean(text);}}};var render=function(parent,sb,level,nest){if(parent){switch(parent.tag){case'html':if(level>0)level-=1;break;case'head':case'body':level-=1;break;}var tabs=[];for(var i=0;i<level;i++){tabs.push('\t');}var indent=tabs.join('');if(parent.html){if(nest&&sb[sb.length-1]==='\n'){sb.push(indent);}sb.push(parent.html);}if(parent.self){if(nest)sb.push('\n');}else{if(!nesting(parent)){nest=false;}else if(parent.tag){if(parent.tag!=='p'){sb.push('\n');}nest=true;}}parent.nest=nest;if(parent.text){var text=trimcontent(parent.text,parent,indent);if(text){if(nest&&sb.length&&sb[sb.length-1]==='\n'){sb.push(indent);if(parent.tag!=='br')sb.push('\t');}sb.push(text);}}if(parent.items&&parent.items.length){for(var i=0;i<parent.items.length;i++){var item=parent.items[i],next=parent.items[i+1];if(nest&&item.tag==='br'&&sb.length>0&&sb[sb.length-1]!=='\n'){sb.push('\n');}render(item,sb,level+1,nest);var end=sb[sb.length-1];end=end&&end[end.length-1];if(item.closing&&nest&&end!=='\n'){if(!next||end===' '||!inline(next)){sb.push('\n');}}}}if(parent.closing){if(nest&&sb[sb.length-1]==='\n'){sb.push(indent);}sb.push(parent.closing);}var text=null;if(parent.closingText){text=trimend(parent.closingText,parent);if(text){if((parent.tag==='p'||parent.tag==='div')&&sb[sb.length-1]!=='\n'&&!/^[\r\n]/.test(text)&&$.trim(text).length){sb.push('\n');if(indent){sb.push(indent);}text=text.replace(/^\s+/,'');}sb.push(text);}}}};var sb=[];render(page,sb,-1,true);html=sb.join('').replace(rclean9b,function(m){return script[m];});}return html;};$.fn.cleanHtml=function(indent,absolute){return $.cleanHtml(this.outerHtml(),indent,absolute);};$.printify=function(html){if(!html){return html;}else{return html.replace(/>([^<]+)</g,function(m,m1){return'>'+m1.replace(/(\w\.) +(\w)/g,function(m,m1,m2){return m1+'&nbsp; '+m2;})+'<';}).replace(/(\w+) +(\S{1,20}<\/p>)/gi,function(m,m1,m2){return m1+'&nbsp;'+m2;}).replace(/ - /g,' &mdash; ');}};$.fn.formVal=function(){var val=null;var check=false;if(this.is('img')){return undefined;}else if(this.is('table')){val=[];this.find(':input').each(function(i){var input=$(this);if(input.is(':checked')){val.push(input.val());check=true;}else if(input.is(':text')){val.push(input.val());}});if(!val.length){val=null;}else if(check){val=val.join(",");}else{val=val.join("");}}else if(this.is(':checkbox')){val=this.is(':checked')?true:"";}else if(this.is(':radio')){val=this.is(':checked')?this.val():undefined;}else if(this.is('textarea')){var editor=this.parent('div').data('editor');if(editor){return editor.getData();}else{return this.val();}}else{val=this.val();}return val;};$.getQuery=function(){var query={};var items=window.location.href.split('?').pop().split('&');for(var i=0;i<items.length;i++){var pair=items[i].split('=');if(pair.length==2){query[pair[0].toLowerCase()]=pair[1];}}return query;};$.getQueryString=function(field){if(field){field=field.toLowerCase();}return $.getQuery()[field];};$.getLinkTarget=function(e){if(!e||!e.target||!e.target.parentNode){return null;}if((e.target.nodeName||"").toLowerCase()==='a'){return $(e.target);}else if((e.target.parentNode.nodeName||"").toLowerCase()==='a'){return $(e.target.parentNode);}else if((e.target.parentNode.parentNode.nodeName||"").toLowerCase()==='a'){return $(e.target.parentNode.parentNode);}else{return null;}};$.getLinkAction=function(e){var link=$.getLinkTarget(e),href=link&&link.attr('href'),m=href&&/^javascript:(\w+)\('([^']+)'/i.exec(href),fn=m&&m[1],action=m&&m[2];return{link:link,href:href,fn:fn,action:action};};Array.prototype.addItem=function(item){if(item===undefined){return;}for(var i=0;i<this.length;i++){var el=this[i];if(el==item){return this;}}this.push(item);return this;};Array.prototype.removeItem=function(item){if(item===undefined){return;}for(var i=0;i<this.length;i++){var el=this[i];if(el==item){if(i==0){this.shift();}else if(i==this.length-1){this.pop();}else{this.splice(i,1);}return this;}}return this;};Array.prototype.indexOf=function(item){if(item===undefined){return;}for(var i=0;i<this.length;i++){var el=this[i];if(el==item){return i;}}return-1;};Array.prototype.sum=function(){for(var i=0,L=this.length,sum=0;i<L;sum+=this[i++]);return sum;};$.sort={swap:function(array,a,b){var tmp=array[a];array[a]=array[b];array[b]=tmp;},partition:function(array,begin,end,pivot,fn){var piv=array[pivot];$.sort.swap(array,pivot,end-1);var store=begin;var ix;for(ix=begin;ix<end-1;++ix){if(fn?fn(array[ix],piv)<=0:array[ix]<=piv){$.sort.swap(array,store,ix);++store;}}$.sort.swap(array,end-1,store);return store;},quick:function(array,begin,end,fn){if(end-1>begin){var pivot=begin+Math.floor(Math.random()*(end-begin));pivot=$.sort.partition(array,begin,end,pivot,fn);$.sort.quick(array,begin,pivot,fn);$.sort.quick(array,pivot+1,end,fn);}}};Array.prototype.quickSort=function(fn){$.sort.quick(this,0,this.length,fn);};String.prototype.startsWith=function(data){if(!data){return false;}var data2=(''+data).toLowerCase();return this.toLowerCase().indexOf(data2)==0;};String.prototype.endsWith=function(data){if(!data){return false;}var data2=(''+data).toLowerCase();var pos=this.toLowerCase().indexOf(data2);return pos>=0&&pos==this.length-data2.length;};String.prototype.contains=function(data){if(!data){return false;}var data2=(''+data).toLowerCase();return this.toLowerCase().indexOf(data2)>=0;};Date.prototype.stdTimezoneOffset=function(){var jan=new Date(this.getFullYear(),0,1);var jul=new Date(this.getFullYear(),6,1);return Math.max(jan.getTimezoneOffset(),jul.getTimezoneOffset());};})(jQuery);
(function($){$.widget("cms.flyout",{options:{item:'.ifly',panel:'div.iflylist',hover:'iflyOver',right:'iflyRight',loading:'iflyLoading',url:'/CobaltAjax.ashx?M=GetPage',fit:'none none',collision:'flip fit',maxitems:16},_create:function(){;this.element[0]._start=true;this.elements={};if(this.options.mobile){this.elements.panel=this.element.find('div.imenupanel');this.elements.top=this.elements.panel.children(':first');this._mobilePosition(this.elements.top[0]);this._stack=[];}this._createItems(this.element);this.element.bind('mouseover mouseleave',$.proxy(this._fly,this));if(this.options.mobile){if(!this._handleClick){this._handleClick=$.proxy(this._click,this);}$(document).bind('click',this._handleClick);}},_createItems:function(start){var flyout=this;var fn=function(i){this._p=0;var p=this;while(p&&!p._item&&!p._start&&p.parentNode){this._p--;p=p.parentNode;}this._top=p&&p._start;this._item=true;if(this._top){this._my=flyout.options.my||this.getAttribute('_my')||'left top';this._at=flyout.options.at||this.getAttribute('_at')||'left bottom';var offset=this.getAttribute('_offset');if(offset){try{this._offset=eval('('+offset+')');}catch(ex){this._offset={};}}else{this._offset={};}}if(typeof flyout.options.panel==='string'){for(var i=0;i<this.childNodes.length;i++){var child=$(this.childNodes[i]);if((flyout.options.mobile&&child[0]===flyout.elements.panel[0])||child.is(flyout.options.panel)){this._child=i;this.childNodes[i]._panel=true;if(flyout.options.mobile){child.css({display:'none'});}else{this._opacity=$.toFloat(child.css('opacity'))||1;child.css({opacity:0});}return;}}if(this._child===undefined){var child=$.toInt(this.getAttribute('_childpages'));if(child>0){this._child='ajax';}}}};if(start.find(this.options.item).each(fn).length===0){this._loadChildren(start[0]);}},_fly:function(e){if(e.type==='mouseleave'){this._killfade=false;if(this.options.mobile){this._over=false;}else{this._flyOut();}return;}else if($.cms.flyout.disabled){return;}var item=e.target;while(item&&!item._item){if(item._start){return;}item=item.parentNode;}if(!item){return;}if(this.options.mobile){this._over=true;this._event=[e,item];}else{this._flyOver(e,item);}},_click:function(e){var link=$.getLinkTarget(e),href=link&&link.attr('href'),m=href&&/^javascript:(\w+)\('([^']+)'/i.exec(href),action=m&&m[2];if((this._on&&!this._over)||(this._on&&action==='Start')){this._killfade=false;this._flyOut();return false;}else if(this._over&&this._on&&(action==='Back'||(e&&e.target&&/\bileft\b/.test(e.target.className)))){if(this._events){this._events.pop();this._event=this._events[this._events.length-1];}if(this._event){this._flyOver.apply(this,this._event);}return false;}else if(href&&action!=='Start'){return;}else if(this._over&&this._event){if(!this._events){this._events=[];}this._events.push(this._event);this._flyOver.apply(this,this._event);return false;}},_getParent:function(item){switch(item._p){case 0:return item;case-1:return item.parentNode;case-2:return item.parentNode.parentNode;case-3:return item.parentNode.parentNode.parentNode;case-4:return item.parentNode.parentNode.parentNode.parentNode;default:return null;}},_getChildNodes:function(parent){var depth=parent._depth,nodes=parent.childNodes,pos;if(depth){while((pos=depth.shift())!==undefined){nodes=nodes[pos].childNodes;}}return nodes;},_getActive:function(parent){if(parent&&parent._active&&$.isArray(parent._active)){var el=parent;for(var i=0;i<parent._active.length;i++){var pos=parent._active[i];el=el.childNodes[pos];}return el===parent?null:el;}else{return null;}},_getChildPosition:function(item,parent){var active=[];do{for(var i=0;i<item.parentNode.childNodes.length;i++){if(item.parentNode.childNodes[i]===item){active.unshift(i);break;}}item=item.parentNode;}while(item&&item.parentNode&&item!=parent);return active;},_flyOver:function(e,item){var parent=this._getParent(item);if(!parent)return;var active=this._getActive(parent);if(parent._timeout){clearTimeout(parent._timeout);parent._timeout=null;}this._killfade=true;if(active){if(active===item){if(!e.target._panel){this._hideChildren(e,this._getActive(item));}return;}else{if(!item._top){var dim=$(item).dimensions();var distance=(dim.left+dim.width)-e.clientX;if(distance>=0&&distance<50){var fn=function(flyout,item){return function(){var parent=flyout._getParent(item);var active=flyout._getActive(parent);flyout._showItem(null,item,parent,active);item=null;parent=null;};}(this,item);parent._timeout=setTimeout(fn,250);return;}}this._showItem(e,item,parent,active);}}else{this._showItem(e,item,parent);}},_hideChildren:function(e,item){if(item){this._hideChildren(e,this._getActive(item));this._hideItem(e,item);}},_showItem:function(e,item,parent,active){if(!parent){parent=this._getParent(item);if(!parent)return;active=this._getActive(parent);}if(parent._timeout){clearTimeout(parent._timeout);parent._timeout=null;}if(active&&active!=item){this._hideChildren(e,active);}if(this.options.hover){$(item).addClass(this.options.hover).children('a').addClass(this.options.hover);}if(this.options.onhover){if(this.options.onhover.apply(this,[{type:'mouseover'},null,item,parent])===false){return false;}}parent._active=this._getChildPosition(item,parent);if(item._child!==undefined){if(item._child==='ajax'){if(item._killajax){item._killajax=null;}else{this._loadChildren(item);}}else{var child;if(this.options.mobile&&item._top){child=$(item.childNodes[item._child].childNodes[0]);}else{child=$(item.childNodes[item._child]);}var fading;if(this.options.mobile){var left=$.toFloat(child.css('left'));fading=left>0||left<320;}else{var opacity=$.toFloat(child.css('opacity'));fading=(opacity>0.00&&opacity<item._opacity);}if(item._top&&!fading){var fn=function(flyout,item,child){return function(){flyout._showChild(item,child);flyout=null;item=null;child=null;};}(this,item,child);item._timeout=setTimeout(fn,100);return;}this._showChild(item,child);}}if(item.parentNode&&item.parentNode!==this.element[0]&&item.parentNode.parentNode._item){this._showItem(e,item.parentNode.parentNode);}},_loadChildren:function(item){var pageid=$.toInt(item.getAttribute('_pageid'));if(pageid>0){var el=$(item);el.addClass(this.options.loading);$.cms.flyout.ajax.load(this,item,pageid);}},_renderChildren:function(item,results){var el=$(item);el.removeClass(this.options.loading);if(results&&results.ChildPages&&results.ChildPages.length){var cls=this.options.panel.split('.').pop();var sb=['<div class="'+cls+'">'];cls=this.options.item.split('.').pop();if(this.options.mobile){sb.push('<div class="');sb.push(cls);sb.push(' ileft"><a href="javascript:void(\'Back\');"><span>Back</span></a></div>');}for(var i=0;i<results.ChildPages.length;i++){var page=results.ChildPages[i];var children=page.ChildPages.length;sb.push('<div class="');sb.push(cls);if(children>0){sb.push(' ');sb.push(this.options.right);}sb.push('" _pageid="');sb.push(page.PageID);if(children>0){sb.push('" _childpages="');sb.push(children);}sb.push('"><a href="');sb.push(page.URL||page.Path);if(page.URLProperties&&page.URLProperties.indexOf('target,_blank')>=0){sb.push('" target="_blank');}sb.push('">');sb.push(page.PageName);sb.push('</a></div>');}sb.push('</div>');var child=$(sb.join("")).appendTo(el);item._child=item.childNodes.length-1;if(this.options.mobile){this._mobilePosition(child[0]);}else{item._opacity=$.toFloat(child.css('opacity'))||1;child.css({opacity:0});}this._createItems(el);if(item._killajax){item._killajax=null;}else{var child=$(item.childNodes[item._child]);this._showChild(item,child);}}},_mobilePosition:function(menu){var w=320-$.toInt($.curCSS(menu,'borderLeftWidth'))-$.toInt($.curCSS(menu,'borderRightWidth'))-$.toInt($.curCSS(menu,'paddingLeft'))-$.toInt($.curCSS(menu,'paddingRight'));menu.style.display='none';menu.style.top='0px';menu.style.left='320px';menu.style.width=w+'px';},_showChild:function(item,child){var w,h,doc,dim,css;if(this.options.mobile){this._on=true;this.elements.panel[0].style.display='block';child[0].style.display='block';if(this._stack.length&&this._stack.indexOf(child[0])>=0){return;}dim=this.element.dimensions();doc=$(document.body).dimensions();h=Math.max(doc.height-dim.top-dim.height,child.height(),this._stack.length?$(this._stack[this._stack.length-1]).height():0);w=$(window).width()-$.toInt($(document.body).css('marginRight'));css={top:dim.top+dim.height,left:(w>320?Math.floor((w-320)/2):0),height:h};this.elements.panel.css(css);}else{css=$.placement(child.css({display:'block'}),{my:item._my,at:item._at,of:item,offset:item._offset||this.options.offset||{top:-2},collision:item._top?'none none':this.options.collision});}if(css&&child.length){if(!this.options.mobile&&$.browser.msie&&$.browser.version<=7){var w=child[0]._width;if(!w){child[0]._width=w=child.width();}css.width=w;}if(this.options.mobile){this._stack.push(child[0]);var left=(1-this._stack.length)*320;this.elements.top.stop().animate({left:left},600);}else{var opacity=$.toFloat(child.css('opacity'));if(opacity===0.00){css.opacity=0.01;}child.stop().css(css).animate({opacity:item._opacity},150);}}if(!child[0]._scroll){var items;if(this.options.maxitems>0&&(items=child.children()).length>this.options.maxitems){items.slice(this.options.maxitems,items.length).hide();child[0]._scroll=true;}if(child[0]._scroll){var w=child.width();child.css({width:w}).bind('mousewheel',this._scrollChild);$('<div class="ui-more-items"><img class="more-up" src="/Shared/images/spacer.gif"><img class="more-down" src="/Shared/images/spacer.gif"></div>').appendTo(child).bind('mouseover mouseout',this._scrollTimer);}}},_scrollChild:function(e){var items=$(this).children(':not(div.ui-more-items)');var first=items.index(items.filter(':visible:first'));var last=items.index(items.filter(':visible:last'));var delta=e.delta;while(delta<0&&last<items.length-1){items.eq(first++).hide();items.eq(++last).show();delta++;}while(delta>0&&first>0){items.eq(last--).hide();items.eq(--first).show();delta--;}return false;},_scrollTimer:function(e){if(this._interval){clearInterval(this._interval);this._interval=null;}if(e.type==='mouseout'){return;}var el=$(e.target);var direction;if(el.is('img.more-up')){direction=1;}else if(el.is('img.more-down')){direction=-1;}else{return;}var fn=function(el,delta){return function(){$.cms.flyout.prototype._scrollChild.apply(el,[{delta:delta}]);};}(this.parentNode,direction);this._interval=setInterval(fn,75);fn();},_flyOut:function(speed){if(this._killfade){this._killfade=false;return;}var elem=null,active=this._getActive(this.element[0]);while(active){elem=active;active=this._getActive(elem);}if(elem){var fn=function(flyout){return function(speed){flyout._flyOut(speed);flyout=null;};}(this);this._hideItem(null,elem,true,fn,speed||(this.options.mobile?600:800));}else if(this.options.mobile){this.elements.panel.css({display:'none'});this._on=false;this._stack=[];if(this._events&&this._events.length){this._event=this._events[0];}else{this._event=null;}this._events=null;}},_hideItem:function(e,item,fade,callback,speed){if(item._timeout){clearTimeout(item._timeout);item._timeout=null;}var parent=this._getParent(item);if(parent){parent._active=null;}var fn=function(item,cls,callback){return function(speed){if(cls){$(item).removeClass(cls).children('a').removeClass(cls);}if(callback){callback(speed);callback=null;}item=null;};}(item,this.options.hover,callback);if(this.options.onhover){if(this.options.onhover.apply(this,[{type:'mouseout'},speed,item,parent])===false){return false;}}if(item._ajaxip){item._killajax=true;}else if(typeof item._child!=='number'){fn();return;}var child;if(this.options.mobile&&item._top){child=$(item.childNodes[item._child].childNodes[0]);}else{child=$(item.childNodes[item._child]);}if(this.options.mobile){if(this._stack.indexOf(child[0])>=0){this._stack.removeItem(child[0]);}else{child[0].style.display='none';}var finished=function(_child){return function(){_child.style.display='none';_child=null;};}(child[0]);this.elements.top.stop().animate({left:(1-this._stack.length)*320},300,'linear',finished);setTimeout(fn,300);}else{if(fade&&$.toFloat(child.css('opacity'))===item._opacity){var txt=$(item).children('a').text();var opacity=$.toFloat(child.css('opacity'));if(opacity===1.00){child.css({opacity:0.99});}child.stop().animate({opacity:0},speed||150,'linear',function(e){$(this).css({display:'none'});fn(300);});}else{child.stop().css({display:'none',opacity:0});fn();}}},destroy:function(){this.element.unbind('mouseover mouseleave');$.Widget.prototype.destroy.apply(this,arguments);}});$.extend($.cms.flyout,{disabled:false,setParent:function(){var el=$(this);if(el.is('a')){var p=el.parent(),direction=el.attr('_direction'),corner=el.attr('_corner'),icobalt=el.attr('icobalt');p.addClass('ifly').attr('icobalt',icobalt||'').attr('_pageid',el.attr('_pageid')||'').attr('_childpages',el.attr('_childpages')||'').attr('_exclude',el.attr('_exclude')||'').attr('_maxpages',el.attr('_maxpages')||'').attr('_offset',el.attr('_offset')||'').attr('_maxlevels',el.attr('_maxlevels')||'');if(direction==='Right'||corner==='{top:true,left:false}'){p.attr('_my','left top');p.attr('_at','right top');}el.removeAttr('icobalt').removeAttr('_pageid').removeAttr('_childpages').removeAttr('_exclude').removeAttr('_corner').removeAttr('_direction').removeAttr('_maxitems').removeAttr('_maxpages').removeAttr('_offset').removeAttr('_maxlevels');}else{el.addClass('ifly');}},ajax:{ip:false,stack:[],load:function(flyout,item,pageid){if(item._ajaxip){return;}else{item._ajaxip=true;}if(!this.ip){this._load(flyout,item,pageid);}else{var fn=function(fo,i,p){return function(){$.cms.flyout.ajax._load(fo,i,p);fo=null;i=null;p=null;};}(flyout,item,pageid);this.stack.push(fn);}},_load:function(flyout,item,pageid){this.ip=true;var url=$.getAjaxUrl(flyout.options.url,{P:pageid});var fn=function(fo,i){return function(results){$.cms.flyout.ajax._render(fo,i,results);fo=null;i=null;};}(flyout,item);$.ajax({url:url,dataType:'json',success:fn,error:fn});},_render:function(flyout,item,results){if(this.stack.length){this.stack.shift()();}item._ajaxip=null;this.ip=false;flyout._renderChildren(item,results);}}});})(jQuery);
(function($){$.widget("cms.combobox",{options:{toggleValue:false,ajaxUrl:null,style:{main:'ui-select-style',panel:'ui-select-panel',option:'ui-select-option',hover:'ui-option-hover'},minchars:3,valueField:'PageID',textField:'PageName',pathField:'Path',place:{my:'left top',at:'left bottom',collision:'none none'},maxHeight:300},_create:function(){this._onClick=function(){return this._handleClick.apply(this,arguments);};this._onKey=function(){return this._handleKey.apply(this,arguments);};this.elements={panel:$('<div></div>').attr('class',this.options.style.panel).css({position:'absolute',display:'none'}).bind('mouseover mouseleave',$.proxy(this._hoverPanel,this)).captureScroll()};if(this.element.is('select')){this._type='select';this._initSelect();}else if(this.element.is('input:text')){this._type='input';this._initAjax();}else{this._type=null;}},_initSelect:function(){var padding=$.toInt(this.element.css('paddingLeft'))+$.toInt(this.element.css('paddingRight'));var w=$.toInt($.curCSS(this.element[0],'width'))-21;var w2=this.element.width()-3;this.element.css({position:'absolute',opacity:0,display:'block',height:1,width:1,overflow:'hidden'}).bind('update',$.proxy(this._buildFromSelect,this)).bind('focus',$.proxy(this._activate,this)).bind('change',$.proxy(this._update,this)).bind('blur',$.proxy(function(e){this._deactivate();},this)).bind('keydown',$.proxy(function(e){if(e.which===$.ui.keyCode.TAB){e.stopPropagation();}else{e.preventDefault();}},this));this.elements.combo=$('<div><span></span></div>').insertAfter(this.element).attr('class',this.options.style.main).children('span').attr('class',this.options.style.main).end().bind('click',$.proxy(this._onCombo,this));if(w>10){this.elements.combo.css({width:w+padding,display:'inline-block'});}else if($.browser.msie&&$.browser.version<8){this.elements.combo.css({width:Math.max(w2+padding+14,50)});}else{this.elements.combo.css({minWidth:Math.max(w2+padding,50)});}var title=this.element.attr('title');if(title){this.elements.combo.attr('title',title);this.element.removeAttr('title');}this.elements.label=this.elements.combo.children('span');this._buildFromSelect();},_initAjax:function(){this.elements.combo=this.element.parent();this.element.bind('focus.combobox blur.combobox',$.proxy(this._focusInput,this)).bind('keydown.combobox',$.proxy(this._inputKey,this));},_buildFromSelect:function(){var id=this.options.valueField;var txt=this.options.textField;var results=[];this.element.children('option').each(function(i){var option=$(this);var name=option.text();var val=option.attr('value');if(val===undefined){val=name;}var row=[];row[id]=val;row[txt]=name;results.push(row);});this._buildItems(results);},_buildItems:function(results){if($.isFunction(this.options.onbuild)){if(this.options.onbuild.apply(this,[results,this])===false){return false;}}if(!results){return;}this.elements.panel.empty();var id=this.options.valueField;var txt=this.options.textField;var cls=this.options.style.option||'';for(var i=0;i<results.length;i++){var row=results[i];var name=row[txt];if(!name){continue;}else{name=name.replace(/</g,'&lt;').replace(/>/g,'&gt;');}var val=row[id]||'';$('<label class="'+cls+'" _value="'+val+'"><span>'+name+'</span></label>').appendTo(this.elements.panel)[0].$row=row;}this.elements.items=this.elements.panel.children("."+this.options.style.option);if(this._type==='select'){this._update();}},_update:function(e,select){if(!this.elements.items){return;}var val=this.element.val();var item=this.elements.items.filter("[_value='"+(val||'')+"']");if(!item.length){item=this.elements.items.eq(0);}if(val===null){this.element.val(item.attr('_value'));}if(select){if(this._selected){this._selected.removeClass(this.options.style.hover);}this._selected=item.addClass(this.options.style.hover);}if(this.elements.label){this.elements.label.html($.trim(item.html())||'');}},_hoverPanel:function(e){if(e.type==='mouseleave'){return;}var item=$(e.target).closest('.'+this.options.style.option);if(this._selected&&this._selected.length&&item.length&&this._selected[0]===item[0]){return;}else if(item.length){this._selected&&this._selected.removeClass(this.options.style.hover);this._selected=item.addClass(this.options.style.hover);}},_activate:function(e){if(!this._active){var parent=this.element.offsetParent();if(parent.is('div.ui-dialog-main')){parent=parent.closest('div.ui-dialog');}else if(parent.is('html')){parent=$(document.body);}this.elements.panel.appendTo(parent);if(this._type==='select'){this.elements.combo.addClass('ui-select-active');}this._active=true;$(document).bind('mousedown',$.proxy(this._onClick,this));$(document).bind('keydown',$.proxy(this._onKey,this)).flipevent('keydown',this._onKey);}},_onCombo:function(e){if(this.elements.panel.is(':visible')){this.elements.panel.css({display:'none'});}else{this._showPanel(e);}return false;},_showPanel:function(e){if(!this._active){this._activate();}if(e&&e.type==='click'&&this.elements.panel.is(':visible')){this.elements.panel.css({display:'none'});return false;}this._term='';var w=this.options.width;var minWidth=this.options.minWidth;if(!minWidth){minWidth=this.elements.combo.outerWidth()-$.toInt(this.elements.panel.css('paddingLeft'))-$.toInt(this.elements.panel.css('paddingRight'))-$.toInt(this.elements.panel.css('borderLeftWidth'))-$.toInt(this.elements.panel.css('borderRightWidth'));if($.browser.msie&&$.browser.version==8){minWidth-=17;}}var place;if(this._type==='select'){place=$.extend(this.options.place,{of:this.elements.combo});}else{place=$.extend(this.options.place,{of:this.element});}var six=$.browser.msie6;this.elements.panel.css({width:this.options.width||(six?w||minWidth:'auto'),minWidth:six?minWidth:w||minWidth}).place(place);if(this.options.maxHeight&&this.elements.panel.height()>this.options.maxHeight){this._scroll=true;this.elements.panel.css({height:this.options.maxHeight,overflow:'auto',overflowX:'hidden',overflowY:'auto'});}else if(/(auto|scroll)/.test($.curCSS(this.elements.panel[0],'overflow',1)+$.curCSS(this.elements.panel[0],'overflow-y',1)+$.curCSS(this.elements.panel[0],'overflow-x',1))){this._scroll=true;}else{this._scroll=false;}if($.browser.msie&&$.browser.version<8&&this.elements.panel[0].style.width==='auto'){this.elements.panel.css({width:this.elements.panel.width()});}if(this._type==='select'){this._update(e,true);}if(this._selected&&this._scroll){this._selected.scrollIntoView();}return false;},_focusInput:function(e){if(this.options.toggleValue){var action=e.type==='focus'?'clearValue':'restoreValue';$[action].apply(e.target,arguments);}if(e.type==='focus'&&this.elements.panel.children().length){this._showPanel();}},_inputKey:function(e){if(this._searchTimeout){clearTimeout(this._searchTimeout);}this._searchTimeout=setTimeout($.proxy(this._handleSearch,this),500);},_handleSearch:function(e){if(this._searchTimeout){clearTimeout(this._searchTimeout);this._searchTimeout=null;}var text=this.element.val();if(!text){this.elements.panel.css({display:'none'});}else if(text.length>=this.options.minchars&&text!=this._lastText){this._lastText=text;var url=$.getAjaxUrl(this.options.ajaxUrl,{TERMS:text});if(url){this._showPanel();if(!this.options.noloading){this.elements.panel.loading();}$.ajax({url:url,dataType:'json',success:function(combo){return function(results){combo.elements.panel.loading('done');combo._buildItems.apply(combo,arguments);};}(this),error:function(combo){return function(){combo.elements.panel.loading('done');combo.elements.panel.css({display:'none'});$.alert('There was a problem with the system, tech services has been notified.');};}(this)});}}},_handleClick:function(e){var elem=e.target;do{if(elem===this.elements.combo[0]){return;}else if(elem===this.elements.panel[0]){if(elem.scrollHeight>elem.offsetHeight){var doc=elem.ownerDocument;var x=e.clientX+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);var dim=this.elements.panel.dimensions();if(x>dim.left+dim.width-20){return;}}if(this._selected&&this._selected.length){this._selectActive(e);}return;}}while(elem=elem.parentNode);this._deactivate();},_handleKey:function(e){if(e.ctrlKey||e.altKey){return;}if(e.shiftKey){if(e.which===$.ui.keyCode.TAB&&this._type==='select'){if(this._active){this.element.focus().trigger(e);}return;}return;}switch(e.which){case $.ui.keyCode.DOWN:this._move(1);return false;case $.ui.keyCode.UP:this._move(-1);return false;case $.ui.keyCode.PAGE_DOWN:this._move(10);return false;case $.ui.keyCode.PAGE_UP:this._move(-10);return false;case $.ui.keyCode.END:this._move(999);return false;case $.ui.keyCode.HOME:this._move(-999);return false;case $.ui.keyCode.ENTER:this._selectActive(e);return false;case $.ui.keyCode.TAB:if(this._active&&this._type==='select'){this.element.focus().trigger(e);setTimeout($.proxy(this._deactivate,this),1);}return;case $.ui.keyCode.ESCAPE:if(this.elements.panel.is(':visible')){this.elements.panel.css({display:'none'});e.stopImmediatePropagation();return false;}else{this._deactivate();}break;default:if(this._type==='select'){if(this.elements.panel.is(':hidden')){this._showPanel();}if(e.which>=32&&e.which<=160){this._term+=String.fromCharCode(e.which);return this._search();}}break;}},_move:function(amount){if(!this._active){return;}amount=$.toInt(amount);if(!amount){return;}if(!this.elements.panel.is(':visible')){this._showPanel();return;}var items=this.elements.items;if(!this._selected||!this._selected.length){this._selected=items.eq(0);if(!this._selected.length){return;}else if(amount===1){this._setItem(this._selected);return;}}var index=items.index(this._selected)+amount;if(index<0){index=0;}else if(index>=items.length){index=items.length-1;}this._setItem(items.eq(index));this._term='';},_search:function(){if(!this._term||!this.elements.items){return;}var items=this.elements.items;if(!this._selected||!this._selected.length){this._selected=items.eq(0);if(!this._selected.length){return;}}var index=items.index(this._selected);var start=index;var item=this._selected;while(item&&!item.children('span').text().startsWith(this._term)){index++;item=index<items.length?items.eq(index):null;}if(!item&&start>0&&this._term.length===1){index=0;item=items.eq(0);while(index<start&&item&&!item.children('span').text().startsWith(this._term)){index++;item=index<items.length?items.eq(index):null;}}this._setItem(item);if(this._termTimeout){clearTimeout(this._termTimeout);}this._termTimeout=setTimeout($.proxy(this._clearTerm,this),500);},_clearTerm:function(){this._term='';this._termTimeout=null;},_setItem:function(item){if(!item||!item.length){return;}if(this._selected){this._selected.removeClass(this.options.style.hover);}this._selected=item.addClass(this.options.style.hover);if(this._scroll){item.scrollIntoView();}},_selectActive:function(e){if(this._selected&&this._selected.length){if($.isFunction(this.options.onselect)){if(this.options.onselect.apply(this,[e,this._selected])===false){return false;}}var val=this._selected.attr('_value');var name=this._selected.children('span').text();if(this.elements.label){this.elements.label.html(name||'');}this.element.val(val||'').trigger('change');this.elements.panel.css({display:'none'});}else{this._deactivate();}},_deactivate:function(e){if(this._active){this.elements.combo.removeClass('ui-select-active');this.elements.panel.css({display:'none'});if(this.elements.label){this.elements.label.unselect();}this._active=false;this._over=false;$(document).unbind('mousedown',this._onClick);$(document).unbind('keydown',this._onKey);}},show:function(){this.elements&&this.elements.combo?this.elements.combo.show():this.element.show();},hide:function(){this.elements&&this.elements.combo?this.elements.combo.hide():this.element.hide();},destroy:function(){$.Widget.prototype.destroy.apply(this,arguments);}});$.extend($.cms.combobox,{});})(jQuery);
(function($){$.widget("cms.datepicker",$.ui.dialog,{options:{single:true,title:null,modal:false,width:400,height:'auto',open:function(e,data,widget){widget._open.apply(widget,[e,data]);},buttons:{"Save":function(e,widget){widget._save.apply(widget,[e]);widget.close.apply(widget,[e]);},"Cancel":function(e,widget){widget._cancel.apply(widget,[e]);}},showdate:true,showtime:false,pattern:'M/d/yyyy'},_html:'<div class="ui-datepicker">	<div class="ui-date">		<div class="ui-title">Year</div>		<div class="ui-years">			<div class="ui-list">&lt;<div class="ui-pop left"></div></div>			<div class="ui-year" _year="2010">2010</div>			<div class="ui-year" _year="2011">2011</div>			<div class="ui-year" _year="2012">2012</div>			<div class="ui-list">&gt;<div class="ui-pop right"></div></div>		</div>		<div class="ui-title">Month</div>		<div class="ui-months">			<div class="ui-month" _month="0">Jan</div>			<div class="ui-month" _month="1">Feb</div>			<div class="ui-month" _month="2">Mar</div>			<div class="ui-month" _month="3">Apr</div>			<div class="ui-month" _month="4">May</div>			<div class="ui-month" _month="5">Jun</div>			<div class="ui-month" _month="6">Jul</div>			<div class="ui-month" _month="7">Aug</div>			<div class="ui-month" _month="8">Sep</div>			<div class="ui-month" _month="9">Oct</div>			<div class="ui-month" _month="10">Nov</div>			<div class="ui-month" _month="11">Dec</div>		</div>		<div class="ui-title">Day</div>		<div class="ui-weeks">			<div class="ui-week">Sun</div>			<div class="ui-week">Mon</div>			<div class="ui-week">Tue</div>			<div class="ui-week">Wed</div>			<div class="ui-week">Thu</div>			<div class="ui-week">Fri</div>			<div class="ui-week">Sat</div>		</div>		<div class="ui-days"></div>		<div class="ui-title"><a href="javascript:void(0)" class="ui-today">Today</a></div>	</div>	<div class="ui-time">		<div class="ui-ampm">			<div class="ui-title">&nbsp;</div>			<div class="ui-plus" _plus="0">AM</div>			<div class="ui-plus" _plus="12">PM</div>		</div>		<div class="ui-minutes">			<div class="ui-title">Min</div>			<div class="ui-minute" _minute="0">:00</div>			<div class="ui-minute" _minute="5">:05</div>			<div class="ui-minute" _minute="10">:10</div>			<div class="ui-minute" _minute="15">:15</div>			<div class="ui-minute" _minute="20">:20</div>			<div class="ui-minute" _minute="25">:25</div>			<div class="ui-minute" _minute="30">:30</div>			<div class="ui-minute" _minute="35">:35</div>			<div class="ui-minute" _minute="40">:40</div>			<div class="ui-minute" _minute="45">:45</div>			<div class="ui-minute" _minute="50">:50</div>			<div class="ui-minute" _minute="55">:55</div>		</div>		<div class="ui-hours">			<div class="ui-title">Hour</div>			<div class="ui-hour" _hour="0">12</div>			<div class="ui-hour" _hour="1">1</div>			<div class="ui-hour" _hour="2">2</div>			<div class="ui-hour" _hour="3">3</div>			<div class="ui-hour" _hour="4">4</div>			<div class="ui-hour" _hour="5">5</div>			<div class="ui-hour" _hour="6">6</div>			<div class="ui-hour" _hour="7">7</div>			<div class="ui-hour" _hour="8">8</div>			<div class="ui-hour" _hour="9">9</div>			<div class="ui-hour" _hour="10">10</div>			<div class="ui-hour" _hour="11">11</div>		</div>	</div>	<div style="clear:both;"></div></div>',activate:function(options){if(!$.cms.datepicker.active){return this._activate.apply(this,arguments);}else if(options&&options.input&&$.cms.datepicker.active===options.input[0]){return false;}else{$.extend($.cms.datepicker.current.options,options);if($.cms.datepicker.current.isOpen()){$.cms.datepicker.current._start();}else{$.cms.datepicker.current._open();}}},deactivate:function(){var wz=$[this.namespace][this.widgetName];if(wz._single){var instance=$.data(wz._single[0],this.widgetName);if(instance&&instance.isOpen()){instance.close();return true;}}},_activate:function(options){if(options&&options.showdate===false&&options.showtime===false){return false;}var wz=$[this.namespace][this.widgetName];var el=wz._single;if(!el){wz._single=el=$(this._html);}var instance=$.data(el[0],this.widgetName);if(instance){if(instance.isOpen()){return;}else{var options=$.extend({},wz.prototype.options,options);if(instance.options.sizeChildren){options.sizeChildren=instance.options.sizeChildren;}instance.options=options;}instance.open();}else{instance=new wz(options,el[0]);$.data(el[0],this.widgetName,instance);}return el;},_create:function(){$.ui.dialog.prototype._create.apply(this,arguments);this.element.unselectable();this.uiDialog.find('div.ui-dialog-titlebar').children('span').remove().end().css({height:18});this.uiDialog.addClass('cms-datepicker');this.elements={date:this.element.children('div.ui-date'),time:this.element.children('div.ui-time'),years:this.element.find('div.ui-year'),months:this.element.find('div.ui-month'),days:this.element.find('div.ui-days'),hours:this.element.find('div.ui-hour'),minutes:this.element.find('div.ui-minute'),ampm:this.element.find('div.ui-plus'),pop:this.element.find('div.ui-pop')};},_open:function(){$.cms.datepicker.current=this;$.cms.datepicker.active=true;this._start();$(document).bind('mousedown',$.proxy(this._handleClick,this));},_start:function(){this.elements.pop.hide();this.element.removeClass('mask');this._mask=false;this._origvalue=undefined;var width=0;if(this.options.showdate){this.elements.date.show();width=238;}else{this.elements.date.hide();}if(this.options.showtime){this.elements.time.show();if(width>0){width=400;this.elements.date.css({float:'left'});this.elements.time.css({float:'right'});}else{width=165;this.elements.date.css({float:'none'});this.elements.time.css({float:'none'});}}else{this.elements.time.hide();}this.uiDialog.css({width:width});var date=this.options.date;if(this.options.input&&this.options.input.is('input:text,input:hidden')){$.cms.datepicker.active=this.options.input[0];var text=this.options.input.is('input:text');if(text){this.uiDialog.place({my:'left top',at:'left bottom',collision:'fit flip',of:this.options.input,offset:{left:-1,top:2},margin:{top:0,right:10,bottom:10,left:0}});}this._origvalue=date=this.options.input.val();if(text){this.options.input[0].focus();}}this._date=$.datetime.parse(date)||new Date();if(this.options.showdate){this._updateYear();}if(this.options.showtime){this._updateTime();}},_handleClick:function(e){var input=this.options.input&&this.options.input.length&&this.options.input[0],el;if(e.target===input){return;}else if($(e.target).closest('.cms-datepicker').length>0){var cls=(e.target.className||"").split(' ')[0];if(this._mask){if(cls==='ui-pop'){return;}this.elements.pop.hide();this.element.removeClass('mask');this._mask=false;}switch(cls){case'ui-year':case'ui-year2':var year=parseInt(e.target.getAttribute('_year'));if(year!==this._date.getFullYear()){var month=this._date.getMonth();this._date.setYear(year);if(month!==this._date.getMonth()){this._setLastDay(year,month);}if(cls==='ui-year2'){this._updateYear();}else{this.elements.years.removeClass('selected');$(e.target).addClass('selected');this._updateMonth(true);}this._save();}break;case'ui-month':var month=parseInt(e.target.getAttribute('_month'));if(month!==this._date.getMonth()){this._date.setMonth(month);if(month!==this._date.getMonth()){this._setLastDay(this._date.getFullYear(),month);}this._updateMonth();this._save();}break;case'ui-day':var date=parseInt(e.target.getAttribute('_day'));if(date!==this._date.getDate()){this._date.setDate(date);this.elements.days.children('.selected').removeClass('selected');this.elements.days.children("[_day='"+date+"']").addClass('selected');this._save();}else if(!this.options.showtime){this._save();}if(!this.options.showtime){this.close();}break;case'ui-hour':case'ui-plus':var hour=$.toInt(e.target.getAttribute('_hour')||this.elements.hours.filter('.selected').attr('_hour'))+$.toInt(e.target.getAttribute('_plus')||this.elements.ampm.filter('.selected').attr('_plus'));if(hour!==this._date.getHours()){this._date.setHours(hour);this._updateTime();this._save();}break;case'ui-minute':var minute=parseInt(e.target.getAttribute('_minute'));if(minute!==this._date.getMinutes()){this._date.setMinutes(minute);this._updateTime();this._save();}break;case'ui-list':$(e.target).children('.ui-pop').show();this.element.addClass('mask');this._mask=true;break;case'ui-today':this._date=new Date();this._updateYear();this._save();break;}}else{this.close();}},_setLastDay:function(year,month){var hours,minutes;if(this.options.showtime){hours=this._date.getHours();minutes=this._date.getMinutes();if(hours>=12){plus=12;hours-=12;}}this._date=new Date(year,month+1,0);if(this.options.showtime){this._date.setHours(hours);this._date.setMinutes(minutes);}},_updateYear:function(){var year=this._date.getFullYear();this.elements.years.removeClass('selected').eq(0).html(year-1).attr('_year',year-1).end().eq(1).html(year).attr('_year',year).addClass('selected').end().eq(2).html(year+1).attr('_year',year+1);var start=year-1,sb=[];while(start-->=1900){sb.push('<div class="ui-year2" _year="');sb.push(start);sb.push('">');sb.push(start);sb.push('</div>');}this.elements.pop.eq(0).html(sb.join(""));start=year+1;sb=[];while(start++<=2040){sb.push('<div class="ui-year2" _year="');sb.push(start);sb.push('">');sb.push(start);sb.push('</div>');}this.elements.pop.eq(1).html(sb.join(""));this._updateMonth(true);},_updateMonth:function(change){var month=""+this._date.getMonth(),selected=this.elements.months.filter('.selected');if(selected.attr('_month')===month&&!change){return;}else{selected.removeClass('selected');this.elements.months.filter("[_month='"+month+"']").addClass('selected');}this._updateDays();},_updateDays:function(){var day=""+this._date.getDate(),sb=[],year=this._date.getFullYear(),month=this._date.getMonth(),date=this._date.getDate(),firstDay=new Date(year,month,1),lastDay=new Date(year,month+1,0),firstDayOfWeek=firstDay.getDay(),lastDayOfWeek=lastDay.getDay(),daysInMonth=lastDay.getDate(),current,day;if(firstDayOfWeek===0){firstDayOfWeek=7;}for(var i=0;i<42;i++){current=new Date(year,month,1-firstDayOfWeek+i);if(current.getMonth()!==month){sb.push('<div class="disabled" _day="">&nbsp;</div>');}else{day=current.getDate();sb.push('<div class="ui-day');if(date===day){sb.push(' selected');}sb.push('" _day="');sb.push(day);sb.push('">');sb.push(day);sb.push('</div>');}}this.elements.days.html(sb.join(""));},_updateTime:function(){var hours=this._date.getHours(),plus=0,minutes=Math.floor(this._date.getMinutes()/5)*5,shours=this.elements.hours.filter('.selected'),sminutes=this.elements.minutes.filter('.selected'),splus=this.elements.ampm.filter('.selected');if(hours>=12){plus=12;hours-=12;}if(shours.attr('_hour')!==(""+hours)){shours.removeClass('selected');this.elements.hours.filter("[_hour='"+hours+"']").addClass('selected');}if(sminutes.attr('_minute')!==(""+minutes)){sminutes.removeClass('selected');this.elements.minutes.filter("[_minute='"+minutes+"']").addClass('selected');}if(splus.attr('_plus')!==(""+hours)){splus.removeClass('selected');this.elements.ampm.filter("[_plus='"+plus+"']").addClass('selected');}if(minutes!==this._date.getMinutes()||this._date.getSeconds()!==0){this._date.setMinutes(minutes);this._date.setSeconds(0);this._date.setMilliseconds(0);}},_save:function(e){var date=$.datetime.format(this._date,this.options.pattern);if(this.options.input&&this.options.input.is('input:text,input:hidden')){this.options.input.blur().val(date);}},_cancel:function(){if(this._origvalue!==undefined){this.options.input.val(this._origvalue||"");}if(this.options.input&&this.options.input.is(':text:visible')){this.options.input[0].focus();}$.ui.dialog.prototype._cancel.apply(this,arguments);},close:function(){if(this._origvalue!==undefined&&this._origvalue!==this.options.input.val()){this.options.input.trigger('change');}if($.browser.msie){setTimeout(function(){if($.cms.datepicker.active&&$.cms.datepicker.current&&$.cms.datepicker.current.options&&$.cms.datepicker.current.options.input&&$.cms.datepicker.active===$.cms.datepicker.current.options.input[0]){$.cms.datepicker.active=null;}},1);}else{$.cms.datepicker.active=null;}$(document).unbind('mousedown',this._handleClick);return $.ui.dialog.prototype.close.apply(this,arguments);}});})(jQuery);
$(document).ready(InitCobalt);function InitCobalt(){if(window._flyout){$('[icobalt=CobaltControls.Controls.SideMenu][_flyout=true]').each(function(i){var menu=$(this),maxlevels=$.toInt(menu.attr('_maxlevels')),my=menu.attr('_my')||'left top',at=menu.attr('_at')||'right top';menu.find('[_pageid]').each($.cms.flyout.setParent).end().flyout({my:my,at:at,maxlevels:maxlevels});});$('[icobalt=CobaltControls.Controls.TopMenu][_flyout=true]').each(function(i){var menu=$(this),maxlevels=$.toInt(menu.attr('_maxlevels')),my=menu.attr('_my')||'left top',at=menu.attr('_at')||'left bottom';menu.find('[_pageid]').each($.cms.flyout.setParent).end().flyout({my:my,at:at,maxlevels:maxlevels});});}$.onImagesLoaded(SetupFlashMovies,10);var m;if(!/TimeZone/.test(document.cookie)){var offset=new Date().stdTimezoneOffset()/60,tz;switch(offset){case 10:tz="Hawaiian Standard Time";break;case 9:tz="Alaskan Standard Time";break;case 8:tz="Pacific Standard Time";break;case 7:tz="Mountain Standard Time";break;case 6:tz="Central Standard Time";break;case 5:tz="Eastern Standard Time";break;default:tz="0";break;}document.cookie=['Cobalt.TimeZone=',tz,'; path=/; domain=',encodeURIComponent(window.location.host)].join("");}if(window._fortran){$("input:hidden[id$='_FFD6']").val(new Date().getTime());}}$.cms.urlFriendly=function(name){if(!name){return"";}else{return(""+name).replace(/'+/g,'').replace(/\W+/g,'-');}};function SetupFlashMovies(){if(window._noflash){return;}else{$('.ihover').hoverImage();if(window._spotlight){$("div[icobalt='CobaltControls.Controls.Spotlight']").each(function(i){var div=$(this);var noplay=$.toBool(div.attr('_noplay'));if(!noplay)div.appendTo(document.body).css('display','block').embedswf();});}var swf=$('form div.buildflash');var flyouts=window._flyout&&$('[icobalt=CobaltControls.Controls.Flyout]');if(window._nocontentflash){var nocontent=function(i){return $(this).parent().closest("[icobalt='CobaltControls.Controls.Content']").length===0;};swf.filter(nocontent).embedswf();flyouts=flyouts&&flyouts.filter(nocontent).each($.cms.flyout.setParent).parent();}else{swf.embedswf();flyouts=flyouts&&flyouts.each($.cms.flyout.setParent).parent();}if(flyouts){flyouts.filter('div').parent().flyout();$.unique(flyouts.filter(':not(div)').closest('div,table')).flyout();}if(window._mobilemenu){$('[icobalt=CobaltControls.Controls.MobileMenu]').each($.cms.flyout.setParent).parent().removeClass('ifly').addClass('imenuitem').parent().flyout({item:'.imenuitem',panel:'div.imenu',hover:'iover',right:'iright',loading:'iloading',my:'right top',at:'right bottom',mobile:true});}if(window._sitesearch){$('[icobalt=CobaltControls.Controls.SiteSearch]').sitesearch();}if(window._lightbox){$('.ilightbox').lightbox();}if(window._scroller&&$.fn.scroller){$("div[icobalt='CobaltControls.Controls.ScrollingList']").scroller();}if(window._quicklinks){$('[icobalt=CobaltControls.Controls.QuickLinks]').each(function(i){var el=$(this);if(!el.is('select')){el=el.find('select');}el.bind('change',function(e){var href=$(this).val();if(href){if(!href.startsWith('http')&&!href.startsWith('/')){href="/"+href;}window.location.href=href;if(e&&e.preventDefault){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();}return false;}});});}if(window._popup){$("a[icobalt='CobaltControls.Controls.Popup']").click(function(e){var link=$(this);$.popup({title:link.attr('_title')||null,url:$.getAjaxUrl(link.attr('href'),{Popup:true}),width:$.toInt(link.attr('_width'))||600,height:$.toInt(link.attr('_height'))||400,noscroll:$.toBool(link.attr('_noscroll'))});e.preventDefault();e.stopPropagation();e.stopImmediatePropagation();return false;});}if(window._videovault&&$.cms.videopopup){$("a[icobalt='CobaltControls.Controls.VideoVault']").click(function(e){var link=$(this),categories=link.attr('_categories'),video=link.attr('_video'),options={categories:$.toIntArray(categories),video:$.toInt(video)},theme=link.attr('_theme');if(theme){options.theme=theme;}$.cms.videopopup.prototype.activate(options);return false;});}if(window._ajaxupload&&$.cms.ajaxupload){$("div[icobalt='Cobalt.Controls.FileUpload']").ajaxupload();}}}function cleanupFlash(){__flash__removeCallback=function(instance,name){if(instance!=null&&name!=null)instance[name]=null;};}$.cms.popupvideo=function(file,streamer,autostart,width,height){var id=('Player'+Math.random()).replace('.','');$('<div></div>').dialog({modal:true,dialogClass:'simple',width:width?width+20:443,height:height<30?height+10:'auto',close:function(){$(this).remove();}}).append('<div></div>').children().css({width:width||423,height:height||245,margin:0,padding:0}).embedswf({swf:'/Shared/videovault/lt/player.swf',id:id,width:width||423,height:height||245,params:{flashvars:{streamer:streamer,file:file,autostart:autostart,skin:height<30?null:"/Shared/videovault/lt/skins/glow.zip",'controlbar.position':height<30?'bottom':'over'}}});};$.fn.cascade=function(){return this.each(function(i){var input=$(this);var cascade=input.attr('_cascade');if(cascade){var child=$("form select[id$='_"+cascade+"']");var items=[];child.children('option').each(function(i){var option=$(this);items.push({parent:option.attr('_parent'),value:option.attr('value'),label:option.html()});});child.data('items',items);input.data('cascade',child).bind('change',function(e){var input=$(this);var child=input.data('cascade');var items=child.data('items');var parent=input.val();var sb=[];for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent||item.parent==parent){sb.push('<option value="');sb.push(item.value);sb.push('">');sb.push(item.label);sb.push('</option>');}}var val=child.val();child.html(sb.join('')).val(val||'');}).trigger('change');}});};$.widget("cms.videotutorials",$.ui.dialog,{options:{nobridge:true,modal:true,width:860,height:590,title:'Video Tutorial: ',buttons:{"Close":function(e,widget){widget.close();}},open:function(e,data,widget){widget._open.apply(widget,[e,data]);},videos:[],videoid:0},activate:function(options){if(options&&options.controls&&(!options.videos||!options.videos.length)){options.videos=[];options.controls.each(function(i){options.videos.push($(this).getRow());});options.controls=null;delete options.controls;}if(!options||!options.videos||!options.videos.length){$.alert('There are no video tutorials available here.');return null;}var el=$('<div class="tt-main">	<div class="tt-player">		<div></div>	</div>	<a href="/Admin/Training.aspx" class="cms-btn-select right" style="float:right"><span>More Videos</span></a>	<div class="tt-videos">		<a class="tt-left" href="javascript:void(\'Prev\');">&nbsp;</a>		<span class="tt-start">Related Videos:</span>		<div class="tt-panel">			<div class="tt-scroller"></div>		</div>		<a class="tt-right" href="javascript:void(\'Next\');">&nbsp;</a>	</div></div>');var wz=$[this.namespace][this.widgetName];var instance=new wz(options,el[0]);return el;},_create:function(){$.ui.dialog.prototype._create.apply(this,arguments);this.elements={main:this.uiDialog.find('div.ui-dialog-main'),titlebar:this.uiDialog.find('div.ui-dialog-titlebar'),player:this.element.find('div.tt-player>div'),data:{title:this.element.find('div.tt-summary>h1'),summary:this.element.find('div.tt-summary>div')},videos:{left:this.element.find('a.tt-left'),panel:this.element.find('div.tt-panel'),scroller:this.element.find('div.tt-scroller'),right:this.element.find('a.tt-right')}};this.element.find('div.tt-videos').click($.proxy(this._handleClick,this));var start=this._getStart();this.elements.titlebar.children('span').html('Video Tutorial: '+start.Title);this._createVideos();},_open:function(){var children=this.elements.videos.scroller.children();var panel=this.elements.videos.panel.width();var scroll=this.elements.videos.scroller.offset();var pos=children.eq(children.length-1).dimensions();this._overflow=pos.left+pos.width-scroll.left>panel;var start=this._getStart();this._select((start&&start.Index)||0);},_getStart:function(){if(this.options.videoid){for(var i=0;i<this.options.videos.length;i++){var video=this.options.videos[i];if(video.VideoID===this.options.videoid){return video;}}}return this.options.videos[0];},_createVideos:function(){var category=this.options.videos[0].CategoryName;var sb=[];for(var i=0;i<this.options.videos.length;i++){var video=this.options.videos[i];sb.push('<a class="tt-video" href="javascript:void(\'Play\');" _index="');sb.push(i);sb.push('">');sb.push(video.Title);sb.push('</a>');}this.elements.videos.scroller.html(sb.join(""));this._vposition=0;},_handleClick:function(e){var link=$.getLinkTarget(e),href=link&&link.attr('href'),m=href&&/^javascript:(\w+)\('([^']+)'/i.exec(href),fn=m&&m[1],action=m&&m[2];switch(action){case'Next':this._advanceVideos(1);break;case'Prev':this._advanceVideos(-1);break;case'Play':var index=link.attr('_index');if(index){this._select($.toInt(index),true);}break;default:return;}return false;},_select:function(index,play){var video=this.options.videos[index];this.elements.data.title.html(video.Title);this.elements.data.summary.html(video.Summary.replace(/\n/g,'<br>'));this.elements.videos.scroller.children().removeClass('active').eq(index).addClass('active');this.elements.player.embedswf({swf:'/Shared/videovault/lt/player.swf',id:('Player'+Math.random()).replace(".",""),width:800,height:450,params:{flashvars:{file:video.Video,image:video.Thumbnail,skin:"/Shared/videovault/lt/skins/glow.zip","controlbar.position":"over",plugins:'hd',"hd.file":video.HDVideo,"hd.state":false,"hd.fullscreen":true,dock:false,autostart:play&&!video.Thumbnail?true:false}}},true);this._vid=index;this._ensureVideos();},_advanceVideos:function(amount,play){var videos=this.elements.videos.scroller.children();var index=(this._vid||0)+amount;if(index<0){index=videos.length-1;}else if(index>videos.length-1){index=0;}this._select(index,play);},_ensureVideos:function(){if(!this._overflow){return;}var videos=this.elements.videos.scroller.children();var vid=videos.filter('.active');if(!videos.length||!vid.length){return;}var first=videos.eq(this._vposition).offset().left;var index=videos.index(vid);var panel=this.elements.videos.panel.width();var pos=vid.dimensions();var shift=0;while(pos.left+pos.width-first>panel){shift++;first=videos.eq(this._vposition+shift).offset().left;}while(pos.left<first){shift--;first=videos.eq(this._vposition+shift).offset().left;}if(shift!=0){this._shiftVideos(shift);}},_shiftVideos:function(amount){var videos=this.elements.videos.scroller.children();if(!videos.length){return;}this._vposition+=amount;if(this._vposition>=videos.length){this._vposition=0;}else if(this._vposition<0){this._vposition=videos.length-1;}var vid=videos.eq(this._vposition);var parent=this.elements.videos.scroller.offset();var pos=vid.offset();var left=parent.left-pos.left;this.elements.videos.scroller.stop().animate({marginLeft:left},400,$.proxy(this._ensureVideos,this));},close:function(){$.ui.dialog.prototype.close.apply(this,arguments);this.element.removeswf().remove();}});$.fn.onenter=function(){return this;};
