var sGoogleEndpoint="http://gdata.youtube.com/feeds/api/videos";var sAJAXURL="http://www.jooque.com";var DISPLAY_ERRORS=false;var LOG_ERRORS=true;var ROTATE_ADS=false;var ROOT_URL="http://www.jooque.com";var GOOGLE_ANALYTICS_CODE="UA-1611533-4";var SEARCH_RESULTS_COUNT=7;var iAdvertUpdateInterval=60*1000;var TIMER_INTERVAL=5000;var SMART_MODE_LIMIT=30*1000;var AJAX_SUCCESS=1;var AJAX_FAILURE=0;var VIDEO_SEARCH_TERM_TEXT="Search YouTube Videos";var PLAYLIST_SEARCH_TERM_TEXT="Search Jooque Playists";var IDENTIFY_ARTIST="Artist";var IDENTIFY_SONG="Song";var PLAYLIST_NAME_TEXT="Step 1: Name Your Playlist";var YOUTUBE_VIDEO_URL="http://www.youtube.com/watch?v=";var YOUTUBE_SEARCH_URL="http://gdata.youtube.com/feeds/api/videos?vq=";var AMAZON_CODE="kyuud-20";var FLASH_PLAYER_SMALL_WIDTH=180;var FLASH_PLAYER_SMALL_HEIGHT=135;var FLASH_PLAYER_LARGE_WIDTH=600;var FLASH_PLAYER_LARGE_HEIGHT=339;var FACEBOOK_API="2dbe56c304ca615acbdee40751e6cf60";var FACEBOOK_TEMPLATE_BUNDLE_NEW_PLAYLIST=43721603051;var FACEBOOK_ENABLED=false;function facebook_onload(A){if(!FACEBOOK_ENABLED){$(".fb_connect_code").hide();return }FB.ensureInit(function(){FB.Facebook.get_sessionState().waitUntilReady(function(C){var B=C?true:false;if(B&&!A){ctlLoginRegistrationForm.loginFacebookUser()}})})}function facebook_onlogin_ready(){alert("donkey");refresh_page()}function refresh_page(){window.location="/"}function facebook_prompt_permission(A){FB.ensureInit(function(){FB.Connect.showPermissionDialog(A)})}(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)}else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3]){return jQuery().find(selector)}return jQuery(elem)}selector=[]}}else{return jQuery(context).find(selector)}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector)}}return this.setArray(jQuery.makeArray(selector))},jquery:"1.2.6",size:function(){return this.length},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num]},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)},attr:function(name,value,type){var options=name;if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)}else{options={};options[name]=value}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))}})},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined}return this.attr(key,value,"curCSS")},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])}})});return ret},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)}})},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem)});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems)},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0]}else{return this.cloneNode(true)}});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null}});if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return }var events=jQuery.data(this,"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)}}})}return ret},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)})||jQuery.multiFilter(selector,this))},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true))}else{selector=jQuery.multiFilter(selector,this)}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector})},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))))},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0},hasClass:function(selector){return this.is("."+selector)},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one){return value}values.push(value)}}return values}else{return(this[0].value||"").replace(/\r/g,"")}}return undefined}if(value.constructor==Number){value+=""}return this.each(function(){if(this.nodeType!=1){return }if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)});if(!values.length){this.selectedIndex=-1}}else{this.value=value}}})},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value)},replaceWith:function(value){return this.after(value).remove()},eq:function(i){return this.slice(i,i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===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)})},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse){elems.reverse()}}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"))}var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem)}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove())}callback.call(obj,elem)}});scripts.each(evalScript)})}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}function now(){return +new Date}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2}if(typeof target!="object"&&typeof target!="function"){target={}}if(length==i){target=this;--i}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];if(target===copy){continue}if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy)}else{if(copy!==undefined){target[name]=copy}}}}}return target};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"")},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie){script.text=data}else{script.appendChild(document.createTextNode(data))}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id){id=elem[expando]=++uuid}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}}if(data!==undefined){jQuery.cache[id][name]=data}return name?jQuery.cache[id][name]:id},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id]){break}if(!name){jQuery.removeData(elem)}}}else{try{delete elem[expando]}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)}}delete jQuery.cache[id]}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className}})},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className)}).join(" "):""}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0});val-=Math.round(padding+border)}if(jQuery(elem).is(":visible")){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,val)}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari){return false}var ret=defaultView.getComputedStyle(elem,null);return !ret||ret.getPropertyValue("color")==""}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save}if(name.match(/float/i)){name=styleFloat}if(!force&&style&&style[name]){ret=style[name]}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name)}else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode){stack.unshift(a)}for(;i<stack.length;i++){if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block"}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++){if(swap[i]!=null){stack[i].style.display=swap[i]}}}if(name=="opacity"&&ret==""){ret="1"}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}}}return ret},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}jQuery.each(elems,function(i,elem){if(!elem){return }if(elem.constructor==Number){elem+=""}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)}}elem=jQuery.makeArray(div.childNodes)}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return }if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}});return ret},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"}elem[name]=value}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}return elem[name]}if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)}if(set){elem.setAttribute(name,""+value)}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()});if(set){elem[name]=value}return elem[name]},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call){ret[0]=array}else{while(i){ret[--i]=array[i]}}}return ret},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return -1},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem}}}else{while(elem=second[i++]){first[pos++]=elem}}return first},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i])}}}catch(e){ret=array}return ret},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i])}}return ret},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null){ret[ret.length]=value}}return ret.concat.apply([],ret)}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode},parents:function(elem){return jQuery.dir(elem,"parentNode")},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)}return this.pushStack(jQuery.unique(ret))}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++){jQuery(args[i])[original](this)}})}});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name)}},addClass:function(classNames){jQuery.className.add(this,classNames)},removeClass:function(classNames){jQuery.className.remove(this,classNames)},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames)},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){jQuery(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px")}});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2])},"#":function(a,i,m){return a.getAttribute("id")==m[2]},":":{lt:function(a,i,m){return i<m[3]-0},gt:function(a,i,m){return i>m[3]-0},nth:function(a,i,m){return m[3]-0==i},eq:function(a,i,m){return m[3]-0==i},first:function(a,i){return i==0},last:function(a,i,m,r){return i==r.length-1},even:function(a,i){return i%2==0},odd:function(a,i){return i%2},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling")},parent:function(a){return a.firstChild},empty:function(a){return !a.firstChild},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"},enabled:function(a){return !a.disabled},disabled:function(a){return a.disabled},checked:function(a){return a.checked},selected:function(a){return a.selected||jQuery.attr(a,"selected")},text:function(a){return"text"==a.type},radio:function(a){return"radio"==a.type},checkbox:function(a){return"checkbox"==a.type},file:function(a){return"file"==a.type},password:function(a){return"password"==a.type},submit:function(a){return"submit"==a.type},image:function(a){return"image"==a.type},reset:function(a){return"reset"==a.type},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button")},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},has:function(a,i,m){return jQuery.find(m[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r)}return cur},find:function(t,context){if(typeof t!="string"){return[t]}if(context&&context.nodeType!=1&&context.nodeType!=9){return[]}context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++){for(var c=ret[i].firstChild;c;c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c)}}}ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0){continue}foundToken=true}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id]){break}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true}r.push(n)}if(m=="+"){break}}}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length)}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]]}else{re2=quickClass;m=re2.exec(t)}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0]}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[]}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param"}r=jQuery.merge(r,ret[i].getElementsByTagName(tag))}if(m[1]=="."){r=jQuery.classFilter(r,m[2])}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break}}r=tmp}ret=r}t=t.replace(re2,"")}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t)}}if(t){ret=[]}if(ret&&context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);return done},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass){tmp.push(r[i])}}return tmp},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}}if(!m){break}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3])}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not)}else{if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||""}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a)}}r=tmp}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++}}merge[id]=true}var add=false;if(first==0){if(node.nodeIndex==last){add=true}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true}}if(add^not){tmp.push(node)}}r=tmp}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object"){fn=fn[m[2]]}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}")}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r)},not)}}}}}return{r:r,t:t}},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)}}return r}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return }if(jQuery.browser.msie&&elem.setInterval){elem=window}if(!handler.guid){handler.guid=this.guid++}if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments)});handler.data=data}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments)}});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)}}}}handlers[handler.guid]=handler;jQuery.event.global[type]=true});elem=null},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return }var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))}}else{if(types.type){handler=types.handler;types=types.type}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler){delete events[type][handler.guid]}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler]}}}for(ret in events[type]){break}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}}}ret=null;delete events[type]}}})}for(ret in events){break}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data)}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true}data[0].type=type;if(exclusive){data[0].exclusive=true}var handle=jQuery.data(elem,"handle");if(handle){val=handle.apply(elem,data)}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false}if(event){data.shift()}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined){val=ret}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;try{elem[type]()}catch(e){}}this.triggered=false}return val},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false){val=ret}if(ret===false){event.preventDefault();event.stopPropagation()}}}return val},fix:function(event){if(event[expando]==true){return event}var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--){event[props[i]]=originalEvent[props[i]]}event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault()}originalEvent.returnValue=false};event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation()}originalEvent.cancelBubble=true};event.timeStamp=event.timeStamp||now();if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType==3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy},special:{ready:{setup:function(){bindReady();return },teardown:function(){return }},mouseenter:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseenter";return jQuery.event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseleave";return jQuery.event.handle.apply(this,arguments)}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)})},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments)});return this.each(function(){jQuery.event.add(this,type,one,fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn)})},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn)},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.event.proxy(fn,args[i++])}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut)},ready:function(fn){bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{jQuery.readyList.push(function(){return fn.call(this,jQuery)})}return this}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document)});jQuery.readyList=null}jQuery(document).triggerHandler("ready")}}});var readyBound=false;function bindReady(){if(readyBound){return }readyBound=true;if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false)}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return }try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return }jQuery.ready()})()}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return }for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return }}jQuery.ready()},false)}if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady){return }if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return }if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return }jQuery.ready()})()}jQuery.event.add(window,"load",jQuery.ready)}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)}});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem){try{parent=parent.parentNode}catch(error){parent=elem}}return parent==elem};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind()});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url)}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}callback=callback||function(){};var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{params=jQuery.param(params);type="POST"}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)}self.each(callback,[res.responseText,status,res])}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data)}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType=="script"&&s.cache==null){s.cache=false}if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script)}}}head.appendChild(script);return undefined}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter)}catch(e){status="parsererror"}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes}if(!jsonp){success()}}else{jQuery.handleError(s,xhr,status)}complete();if(s.async){xhr=null}}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();if(!requestDone){onreadystatechange("timeout")}}},s.timeout)}}try{xhr.send(s.data)}catch(e){jQuery.handleError(s,xhr,null,e)}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success(data,status)}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])}}function complete(){if(s.complete){s.complete(xhr,status)}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}return xhr},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"}if(filter){data=filter(data,type)}if(type=="script"){jQuery.globalEval(data)}if(type=="json"){data=eval("("+data+")")}return data},param:function(a){var s=[];if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))})}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))})}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]))}}}return s.join("&").replace(/%20/g,"+")}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none"){this.style.display="block"}elem.remove()}}).end()},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none"}).end()},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]()})},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback)},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback)},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback)},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback)},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx"}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type)}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn)}else{queue(this,type).push(fn);if(queue(this,type).length==1){fn.call(this)}}})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array))}}return q};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length){q[0].call(this)}})};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;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:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.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.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px"}jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){this.elem.style.display="none"}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])}}}if(done){this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now},scrollTop:function(fx){fx.elem.scrollTop=fx.now},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop)}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent)}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop)}if(mozilla&&css(parent,"overflow")!="visible"){border(parent)}parent=parent.parentNode}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop)}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))}}results={top:top,left:left}}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true))}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0}return results};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent}return jQuery(offsetParent)}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){if(!this[0]){return }return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]}});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br)};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0)}})})();(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery);(function(A){A.fn.extend({mousewheel:function(B){if(!B.guid){B.guid=A.event.guid++}if(!A.event._mwCache){A.event._mwCache=[]}return this.each(function(){if(this._mwHandlers){return this._mwHandlers.push(B)}else{this._mwHandlers=[]}this._mwHandlers.push(B);var C=this;this._mwHandler=function(F){F=A.event.fix(F||window.event);A.extend(F,this._mwCursorPos||{});var G=0,E=true;if(F.wheelDelta){G=F.wheelDelta/120}if(F.detail){G=-F.detail/3}if(window.opera){G=-F.wheelDelta}for(var D=0;D<C._mwHandlers.length;D++){if(C._mwHandlers[D]){if(C._mwHandlers[D].call(C,F,G)===false){E=false;F.preventDefault();F.stopPropagation()}}}return E};if(A.browser.mozilla&&!this._mwFixCursorPos){this._mwFixCursorPos=function(D){this._mwCursorPos={pageX:D.pageX,pageY:D.pageY,clientX:D.clientX,clientY:D.clientY}};A(this).bind("mousemove",this._mwFixCursorPos)}if(this.addEventListener){if(A.browser.mozilla){this.addEventListener("DOMMouseScroll",this._mwHandler,false)}else{this.addEventListener("mousewheel",this._mwHandler,false)}}else{this.onmousewheel=this._mwHandler}A.event._mwCache.push(A(this))})},unmousewheel:function(B){return this.each(function(){if(B&&this._mwHandlers){for(var C=0;C<this._mwHandlers.length;C++){if(this._mwHandlers[C]&&this._mwHandlers[C].guid==B.guid){delete this._mwHandlers[C]}}}else{if(A.browser.mozilla&&!this._mwFixCursorPos){A(this).unbind("mousemove",this._mwFixCursorPos)}if(this.addEventListener){if(A.browser.mozilla){this.removeEventListener("DOMMouseScroll",this._mwHandler,false)}else{this.removeEventListener("mousewheel",this._mwHandler,false)}}else{this.onmousewheel=null}this._mwHandlers=this._mwHandler=this._mwFixCursorPos=this._mwCursorPos=null}})}});A(window).one("unload",function(){var C=A.event._mwCache||[];for(var B=0;B<C.length;B++){C[B].unmousewheel()}})})(jQuery);(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return }for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},cssCache:{},css:function(D){if(C.ui.cssCache[D]){return C.ui.cssCache[D]}var E=C('<div class="ui-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({},C.widget.defaults,C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{init:function(){var B=this.options;if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.element.addClass("ui-draggable");(B.disabled&&this.element.addClass("ui-draggable-disabled"));this.mouseInit()},mouseStart:function(F){var H=this.options;if(this.helper||H.disabled||A(F.target).is(".ui-resizable-handle")){return false}var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){C=true}});if(!C){return false}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(H.helper)?A(H.helper.apply(this.element[0],[F])):(H.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((H.appendTo=="parent"?this.element[0].parentNode:H.appendTo))}if(this.helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(this.helper.css("position"))){this.helper.css("position","absolute")}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){B={top:0,left:0}}this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var E=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:E.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:E.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(H.cursorAt){if(H.cursorAt.left!=undefined){this.offset.click.left=H.cursorAt.left+this.margins.left}if(H.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-H.cursorAt.right+this.margins.left}if(H.cursorAt.top!=undefined){this.offset.click.top=H.cursorAt.top+this.margins.top}if(H.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-H.cursorAt.bottom+this.margins.top}}if(H.containment){if(H.containment=="parent"){H.containment=this.helper[0].parentNode}if(H.containment=="document"||H.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(H.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(H.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(H.containment)){var D=A(H.containment)[0];var G=A(H.containment).offset();this.containment=[G.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,G.top+(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,G.left+Math.max(D.scrollWidth,D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),G.top+Math.max(D.scrollHeight,D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!H.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}this.helper.addClass("ui-draggable-dragging");this.mouseDrag(F);return true},convertPositionTo:function(C,D){if(!D){D=this.position}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)*B+(this.cssPosition=="fixed"?A(document).scrollTop():0)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)*B+(this.cssPosition=="fixed"?A(document).scrollLeft():0)*B+this.margins.left*B)}},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?A(document).scrollTop():0)),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?A(document).scrollLeft():0))};if(!this.originalPosition){return B}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0]}if(B.top<this.containment[1]){B.top=this.containment[1]}if(B.left>this.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(D<this.containment[1]||D>this.containment[3])?D:(!(D<this.containment[1])?D-F.grid[1]:D+F.grid[1])):D;var C=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/F.grid[0])*F.grid[0];B.left=this.containment?(!(C<this.containment[0]||C>this.containment[2])?C:(!(C<this.containment[0])?C-F.grid[0]:C+F.grid[0])):C}return B},mouseDrag:function(B){this.position=this.generatePosition(B);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",B)||this.position;if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C)}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){B.propagate("stop",C);B.clear()})}else{this.propagate("stop",C);this.clear()}return false},clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.options.helper!="original"&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.uiHash()]);if(C=="drag"){this.positionAbs=this.convertPositionTo("absolute")}return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.uiHash()],this.options[C])},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable");this.mouseDestroy()}}));A.extend(A.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(C,B){A(B.options.iframeFix===true?"iframe":B.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset()}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset()}},drag:function(D,C){var E=C.options;var B=A(this).data("draggable");if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if((B.overflowYOffset.top+B.overflowY[0].offsetHeight)-D.pageY<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed}if(D.pageY-B.overflowYOffset.top<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed)}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed)}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if((B.overflowXOffset.left+B.overflowX[0].offsetWidth)-D.pageX<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed}if(D.pageX-B.overflowXOffset.left<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed)}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed)}}}});A.ui.plugin.add("draggable","snap",{start:function(D,C){var B=A(this).data("draggable");B.snapElements=[];A(C.options.snap===true?".ui-draggable":C.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(J,N){var I=A(this).data("draggable");var L=N.options.snapTolerance||20;var D=N.absolutePosition.left,C=D+I.helperProportions.width,P=N.absolutePosition.top,O=P+I.helperProportions.height;for(var H=I.snapElements.length-1;H>=0;H--){var E=I.snapElements[H].left,B=E+I.snapElements[H].width,R=I.snapElements[H].top,M=R+I.snapElements[H].height;if(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<O&&O<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<O&&O<M+L))){continue}if(N.options.snapMode!="inner"){var K=Math.abs(R-O)<=20;var Q=Math.abs(M-P)<=20;var G=Math.abs(E-C)<=20;var F=Math.abs(B-D)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R-I.helperProportions.height,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E-I.helperProportions.width}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B}).left}}if(N.options.snapMode!="outer"){var K=Math.abs(R-P)<=20;var Q=Math.abs(M-O)<=20;var G=Math.abs(E-D)<=20;var F=Math.abs(B-C)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M-I.helperProportions.height,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B-I.helperProportions.width}).left}}}}});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,C){var B=A(this).data("draggable");B.sortables=[];A(C.options.connectToSortable).each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");B.sortables.push({instance:E,shouldRevert:E.options.revert});E.refreshItems();E.propagate("activate",D,B)}})},stop:function(D,C){var B=A(this).data("draggable");A.each(B.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;B.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance.mouseStop(D);this.instance.element.triggerHandler("sortreceive",[D,A.extend(this.instance.ui(),{sender:B.element})],this.instance.options.receive);this.instance.options.helper=this.instance.options._helper}else{this.instance.propagate("deactivate",D,B)}})},drag:function(F,E){var D=A(this).data("draggable"),B=this;var C=function(K){var H=K.left,J=H+K.width,I=K.top,G=I+K.height;return(H<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<J&&I<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<G)};A.each(D.sortables,function(G){if(C.call(D,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return E.helper[0]};F.target=this.instance.currentItem[0];this.instance.mouseCapture(F,true);this.instance.mouseStart(F,true,true);this.instance.offset.click.top=D.offset.click.top;this.instance.offset.click.left=D.offset.click.left;this.instance.offset.parent.left-=D.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=D.offset.parent.top-this.instance.offset.parent.top;D.propagate("toSortable",F)}if(this.instance.currentItem){this.instance.mouseDrag(F)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance.mouseStop(F,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}D.propagate("fromSortable",F)}}})}});A.ui.plugin.add("draggable","stack",{start:function(D,B){var C=A.makeArray(A(B.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||B.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||B.options.stack.min)});A(C).each(function(E){this.style.zIndex=B.options.stack.min+E});this[0].style.zIndex=B.options.stack.min+C.length}})})(jQuery);(function(B){function A(E,D){var C=B.browser.safari&&B.browser.version<522;if(E.contains&&!C){return E.contains(D)}if(E.compareDocumentPosition){return !!(E.compareDocumentPosition(D)&16)}while(D=D.parentNode){if(D==E){return true}}return false}B.widget("ui.sortable",B.extend({},B.ui.mouse,{init:function(){var C=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;if(!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.offset=this.element.offset();this.mouseInit()},plugins:{},ui:function(C){return{helper:(C||this)["helper"],placeholder:(C||this)["placeholder"]||B([]),position:(C||this)["position"],absolutePosition:(C||this)["positionAbs"],options:this.options,element:this.element,item:(C||this)["currentItem"],sender:C?C.element:null}},propagate:function(F,E,C,D){B.ui.plugin.call(this,F,[E,this.ui(C)]);if(!D){this.element.triggerHandler(F=="sort"?F:"sort"+F,[E,this.ui(C)],this.options[F])}},serialize:function(E){var C=(B.isFunction(this.options.items)?this.options.items.call(this.element):B(this.options.items,this.element)).not(".ui-sortable-helper");var D=[];E=E||{};C.each(function(){var F=(B(this).attr(E.attribute||"id")||"").match(E.expression||(/(.+)[-=_](.+)/));if(F){D.push((E.key||F[1])+"[]="+(E.key&&E.expression?F[1]:F[2]))}});return D.join("&")},toArray:function(C){var D=(B.isFunction(this.options.items)?this.options.items.call(this.element):B(this.options.items,this.element)).not(".ui-sortable-helper");var E=[];D.each(function(){E.push(B(this).attr(C||"id"))});return E},intersectsWith:function(J){var E=this.positionAbs.left,D=E+this.helperProportions.width,I=this.positionAbs.top,H=I+this.helperProportions.height;var F=J.left,C=F+J.width,K=J.top,G=K+J.height;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?"width":"height"]>J[this.floating?"width":"height"])){return(I+this.offset.click.top>K&&I+this.offset.click.top<G&&E+this.offset.click.left>F&&E+this.offset.click.left<C)}else{return(F<E+(this.helperProportions.width/2)&&D-(this.helperProportions.width/2)<C&&K<I+(this.helperProportions.height/2)&&H-(this.helperProportions.height/2)<G)}},intersectsWithEdge:function(J){var E=this.positionAbs.left,D=E+this.helperProportions.width,I=this.positionAbs.top,H=I+this.helperProportions.height;var F=J.left,C=F+J.width,K=J.top,G=K+J.height;if(this.options.tolerance=="pointer"||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?"width":"height"]>J[this.floating?"width":"height"])){if(!(I+this.offset.click.top>K&&I+this.offset.click.top<G&&E+this.offset.click.left>F&&E+this.offset.click.left<C)){return false}if(this.floating){if(E+this.offset.click.left>F&&E+this.offset.click.left<F+J.width/2){return 2}if(E+this.offset.click.left>F+J.width/2&&E+this.offset.click.left<C){return 1}}else{if(I+this.offset.click.top>K&&I+this.offset.click.top<K+J.height/2){return 2}if(I+this.offset.click.top>K+J.height/2&&I+this.offset.click.top<G){return 1}}}else{if(!(F<E+(this.helperProportions.width/2)&&D-(this.helperProportions.width/2)<C&&K<I+(this.helperProportions.height/2)&&H-(this.helperProportions.height/2)<G)){return false}if(this.floating){if(D>F&&E<F){return 2}if(E<C&&D>C){return 1}}else{if(H>K&&I<K){return 1}if(I<G&&H>G){return 2}}}return false},refresh:function(){this.refreshItems();this.refreshPositions()},refreshItems:function(){this.items=[];this.containers=[this];var D=this.items;var C=this;var F=[[B.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):B(this.options.items,this.element),this]];if(this.options.connectWith){for(var G=this.options.connectWith.length-1;G>=0;G--){var I=B(this.options.connectWith[G]);for(var E=I.length-1;E>=0;E--){var H=B.data(I[E],"sortable");if(H&&!H.options.disabled){F.push([B.isFunction(H.options.items)?H.options.items.call(H.element):B(H.options.items,H.element),H]);this.containers.push(H)}}}}for(var G=F.length-1;G>=0;G--){F[G][0].each(function(){B.data(this,"sortable-item",F[G][1]);D.push({item:B(this),instance:F[G][1],width:0,height:0,left:0,top:0})})}},refreshPositions:function(D){if(this.offsetParent){var C=this.offsetParent.offset();this.offset.parent={top:C.top+this.offsetParentBorders.top,left:C.left+this.offsetParentBorders.left}}for(var F=this.items.length-1;F>=0;F--){if(this.items[F].instance!=this.currentContainer&&this.currentContainer&&this.items[F].item[0]!=this.currentItem[0]){continue}var E=this.options.toleranceElement?B(this.options.toleranceElement,this.items[F].item):this.items[F].item;if(!D){this.items[F].width=E[0].offsetWidth;this.items[F].height=E[0].offsetHeight}var G=E.offset();this.items[F].left=G.left;this.items[F].top=G.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var F=this.containers.length-1;F>=0;F--){var G=this.containers[F].element.offset();this.containers[F].containerCache.left=G.left;this.containers[F].containerCache.top=G.top;this.containers[F].containerCache.width=this.containers[F].element.outerWidth();this.containers[F].containerCache.height=this.containers[F].element.outerHeight()}}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this.mouseDestroy();for(var C=this.items.length-1;C>=0;C--){this.items[C].item.removeData("sortable-item")}},createPlaceholder:function(E){var C=E||this,F=C.options;if(F.placeholder.constructor==String){var D=F.placeholder;F.placeholder={element:function(){return B("<div></div>").addClass(D)[0]},update:function(G,H){H.css(G.offset()).css({width:G.outerWidth(),height:G.outerHeight()})}}}C.placeholder=B(F.placeholder.element.call(C.element,C.currentItem)).appendTo("body").css({position:"absolute"});F.placeholder.update.call(C.element,C.currentItem,C.placeholder)},contactContainers:function(F){for(var D=this.containers.length-1;D>=0;D--){if(this.intersectsWith(this.containers[D].containerCache)){if(!this.containers[D].containerCache.over){if(this.currentContainer!=this.containers[D]){var I=10000;var H=null;var E=this.positionAbs[this.containers[D].floating?"left":"top"];for(var C=this.items.length-1;C>=0;C--){if(!A(this.containers[D].element[0],this.items[C].item[0])){continue}var G=this.items[C][this.containers[D].floating?"left":"top"];if(Math.abs(G-E)<I){I=Math.abs(G-E);H=this.items[C]}}if(!H&&!this.options.dropOnEmpty){continue}if(this.placeholder){this.placeholder.remove()}if(this.containers[D].options.placeholder){this.containers[D].createPlaceholder(this)}else{this.placeholder=null}this.currentContainer=this.containers[D];H?this.rearrange(F,H,null,true):this.rearrange(F,null,this.containers[D].element,true);this.propagate("change",F);this.containers[D].propagate("change",F,this)}this.containers[D].propagate("over",F,this);this.containers[D].containerCache.over=1}}else{if(this.containers[D].containerCache.over){this.containers[D].propagate("out",F,this);this.containers[D].containerCache.over=0}}}},mouseCapture:function(G,F){if(this.options.disabled||this.options.type=="static"){return false}this.refreshItems();var E=null,D=this,C=B(G.target).parents().each(function(){if(B.data(this,"sortable-item")==D){E=B(this);return false}});if(B.data(G.target,"sortable-item")==D){E=B(G.target)}if(!E){return false}if(this.options.handle&&!F){var H=false;B(this.options.handle,E).find("*").andSelf().each(function(){if(this==G.target){H=true}});if(!H){return false}}this.currentItem=E;return true},mouseStart:function(H,F,C){var J=this.options;this.currentContainer=this;this.refreshPositions();this.helper=typeof J.helper=="function"?B(J.helper.apply(this.element[0],[H,this.currentItem])):this.currentItem.clone();if(!this.helper.parents("body").length){B(J.appendTo!="parent"?J.appendTo:this.currentItem[0].parentNode)[0].appendChild(this.helper[0])}this.helper.css({position:"absolute",clear:"both"}).addClass("ui-sortable-helper");this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:H.pageX-this.offset.left,top:H.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var D=this.offsetParent.offset();this.offsetParentBorders={top:(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};this.offset.parent={top:D.top+this.offsetParentBorders.top,left:D.left+this.offsetParentBorders.left};this.originalPosition=this.generatePosition(H);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(J.placeholder){this.createPlaceholder()}this.propagate("start",H);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(J.cursorAt){if(J.cursorAt.left!=undefined){this.offset.click.left=J.cursorAt.left}if(J.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-J.cursorAt.right}if(J.cursorAt.top!=undefined){this.offset.click.top=J.cursorAt.top}if(J.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-J.cursorAt.bottom}}if(J.containment){if(J.containment=="parent"){J.containment=this.helper[0].parentNode}if(J.containment=="document"||J.containment=="window"){this.containment=[0-this.offset.parent.left,0-this.offset.parent.top,B(J.containment=="document"?document:window).width()-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(B(J.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(J.containment)){var G=B(J.containment)[0];var I=B(J.containment).offset();this.containment=[I.left+(parseInt(B(G).css("borderLeftWidth"),10)||0)-this.offset.parent.left,I.top+(parseInt(B(G).css("borderTopWidth"),10)||0)-this.offset.parent.top,I.left+Math.max(G.scrollWidth,G.offsetWidth)-(parseInt(B(G).css("borderLeftWidth"),10)||0)-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.currentItem.css("marginRight"),10)||0),I.top+Math.max(G.scrollHeight,G.offsetHeight)-(parseInt(B(G).css("borderTopWidth"),10)||0)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.currentItem.css("marginBottom"),10)||0)]}}if(this.options.placeholder!="clone"){this.currentItem.css("visibility","hidden")}if(!C){for(var E=this.containers.length-1;E>=0;E--){this.containers[E].propagate("activate",H,this)}}if(B.ui.ddmanager){B.ui.ddmanager.current=this}if(B.ui.ddmanager&&!J.dropBehaviour){B.ui.ddmanager.prepareOffsets(this,H)}this.dragging=true;this.mouseDrag(H);return true},convertPositionTo:function(D,E){if(!E){E=this.position}var C=D=="absolute"?1:-1;return{top:(E.top+this.offset.parent.top*C-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*C+this.margins.top*C),left:(E.left+this.offset.parent.left*C-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*C+this.margins.left*C)}},generatePosition:function(F){var G=this.options;var C={top:(F.pageY-this.offset.click.top-this.offset.parent.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)),left:(F.pageX-this.offset.click.left-this.offset.parent.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition){return C}if(this.containment){if(C.left<this.containment[0]){C.left=this.containment[0]}if(C.top<this.containment[1]){C.top=this.containment[1]}if(C.left>this.containment[2]){C.left=this.containment[2]}if(C.top>this.containment[3]){C.top=this.containment[3]}}if(G.grid){var E=this.originalPosition.top+Math.round((C.top-this.originalPosition.top)/G.grid[1])*G.grid[1];C.top=this.containment?(!(E<this.containment[1]||E>this.containment[3])?E:(!(E<this.containment[1])?E-G.grid[1]:E+G.grid[1])):E;var D=this.originalPosition.left+Math.round((C.left-this.originalPosition.left)/G.grid[0])*G.grid[0];C.left=this.containment?(!(D<this.containment[0]||D>this.containment[2])?D:(!(D<this.containment[0])?D-G.grid[0]:D+G.grid[0])):D}return C},mouseDrag:function(D){this.position=this.generatePosition(D);this.positionAbs=this.convertPositionTo("absolute");B.ui.plugin.call(this,"sort",[D,this.ui()]);this.positionAbs=this.convertPositionTo("absolute");this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";for(var C=this.items.length-1;C>=0;C--){var E=this.intersectsWithEdge(this.items[C]);if(!E){continue}if(this.items[C].item[0]!=this.currentItem[0]&&this.currentItem[E==1?"next":"prev"]()[0]!=this.items[C].item[0]&&!A(this.currentItem[0],this.items[C].item[0])&&(this.options.type=="semi-dynamic"?!A(this.element[0],this.items[C].item[0]):true)){this.direction=E==1?"down":"up";this.rearrange(D,this.items[C]);this.propagate("change",D);break}}this.contactContainers(D);if(B.ui.ddmanager){B.ui.ddmanager.drag(this,D)}this.element.triggerHandler("sort",[D,this.ui()],this.options.sort);return false},rearrange:function(H,G,D,F){D?D[0].appendChild(this.currentItem[0]):G.item[0].parentNode.insertBefore(this.currentItem[0],(this.direction=="down"?G.item[0]:G.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var E=this,C=this.counter;window.setTimeout(function(){if(C==E.counter){E.refreshPositions(!F)}},0);if(this.options.placeholder){this.options.placeholder.update.call(this.element,this.currentItem,this.placeholder)}},mouseStop:function(E,D){if(B.ui.ddmanager&&!this.options.dropBehaviour){B.ui.ddmanager.drop(this,E)}if(this.options.revert){var C=this;var F=C.currentItem.offset();if(C.placeholder){C.placeholder.animate({opacity:"hide"},(parseInt(this.options.revert,10)||500)-50)}B(this.helper).animate({left:F.left-this.offset.parent.left-C.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:F.top-this.offset.parent.top-C.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){C.clear(E)})}else{this.clear(E,D)}return false},clear:function(E,D){if(this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0]){this.propagate("update",E,null,D)}if(!A(this.element[0],this.currentItem[0])){this.propagate("remove",E,null,D);for(var C=this.containers.length-1;C>=0;C--){if(A(this.containers[C].element[0],this.currentItem[0])){this.containers[C].propagate("update",E,this,D);this.containers[C].propagate("receive",E,this,D)}}}for(var C=this.containers.length-1;C>=0;C--){this.containers[C].propagate("deactivate",E,this,D);if(this.containers[C].containerCache.over){this.containers[C].propagate("out",E,this);this.containers[C].containerCache.over=0}}this.dragging=false;if(this.cancelHelperRemoval){this.propagate("stop",E,null,D);return false}B(this.currentItem).css("visibility","");if(this.placeholder){this.placeholder.remove()}this.helper.remove();this.helper=null;this.propagate("stop",E,null,D);return true}}));B.extend(B.ui.sortable,{getter:"serialize toArray",defaults:{helper:"clone",tolerance:"guess",distance:1,delay:0,scroll:true,scrollSensitivity:20,scrollSpeed:20,cancel:":input",items:"> *",zIndex:1000,dropOnEmpty:true,appendTo:"parent"}});B.ui.plugin.add("sortable","cursor",{start:function(E,D){var C=B("body");if(C.css("cursor")){D.options._cursor=C.css("cursor")}C.css("cursor",D.options.cursor)},stop:function(D,C){if(C.options._cursor){B("body").css("cursor",C.options._cursor)}}});B.ui.plugin.add("sortable","zIndex",{start:function(E,D){var C=D.helper;if(C.css("zIndex")){D.options._zIndex=C.css("zIndex")}C.css("zIndex",D.options.zIndex)},stop:function(D,C){if(C.options._zIndex){B(C.helper).css("zIndex",C.options._zIndex)}}});B.ui.plugin.add("sortable","opacity",{start:function(E,D){var C=D.helper;if(C.css("opacity")){D.options._opacity=C.css("opacity")}C.css("opacity",D.options.opacity)},stop:function(D,C){if(C.options._opacity){B(C.helper).css("opacity",C.options._opacity)}}});B.ui.plugin.add("sortable","scroll",{start:function(E,D){var F=D.options;var C=B(this).data("sortable");C.overflowY=function(G){do{if(/auto|scroll/.test(G.css("overflow"))||(/auto|scroll/).test(G.css("overflow-y"))){return G}G=G.parent()}while(G[0].parentNode);return B(document)}(C.currentItem);C.overflowX=function(G){do{if(/auto|scroll/.test(G.css("overflow"))||(/auto|scroll/).test(G.css("overflow-x"))){return G}G=G.parent()}while(G[0].parentNode);return B(document)}(C.currentItem);if(C.overflowY[0]!=document&&C.overflowY[0].tagName!="HTML"){C.overflowYOffset=C.overflowY.offset()}if(C.overflowX[0]!=document&&C.overflowX[0].tagName!="HTML"){C.overflowXOffset=C.overflowX.offset()}},sort:function(E,D){var F=D.options;var C=B(this).data("sortable");if(C.overflowY[0]!=document&&C.overflowY[0].tagName!="HTML"){if((C.overflowYOffset.top+C.overflowY[0].offsetHeight)-E.pageY<F.scrollSensitivity){C.overflowY[0].scrollTop=C.overflowY[0].scrollTop+F.scrollSpeed}if(E.pageY-C.overflowYOffset.top<F.scrollSensitivity){C.overflowY[0].scrollTop=C.overflowY[0].scrollTop-F.scrollSpeed}}else{if(E.pageY-B(document).scrollTop()<F.scrollSensitivity){B(document).scrollTop(B(document).scrollTop()-F.scrollSpeed)}if(B(window).height()-(E.pageY-B(document).scrollTop())<F.scrollSensitivity){B(document).scrollTop(B(document).scrollTop()+F.scrollSpeed)}}if(C.overflowX[0]!=document&&C.overflowX[0].tagName!="HTML"){if((C.overflowXOffset.left+C.overflowX[0].offsetWidth)-E.pageX<F.scrollSensitivity){C.overflowX[0].scrollLeft=C.overflowX[0].scrollLeft+F.scrollSpeed}if(E.pageX-C.overflowXOffset.left<F.scrollSensitivity){C.overflowX[0].scrollLeft=C.overflowX[0].scrollLeft-F.scrollSpeed}}else{if(E.pageX-B(document).scrollLeft()<F.scrollSensitivity){B(document).scrollLeft(B(document).scrollLeft()-F.scrollSpeed)}if(B(window).width()-(E.pageX-B(document).scrollLeft())<F.scrollSensitivity){B(document).scrollLeft(B(document).scrollLeft()+F.scrollSpeed)}}}});B.ui.plugin.add("sortable","axis",{sort:function(E,D){var C=B(this).data("sortable");if(D.options.axis=="y"){C.position.left=C.originalPosition.left}if(D.options.axis=="x"){C.position.top=C.originalPosition.top}}})})(jQuery);(function(A){A.widget("ui.tabs",{init:function(){this.options.event+=".tabs";this.tabify(true)},setData:function(B,C){if((/^selected/).test(B)){this.select(C)}else{this.options[B]=C;this.tabify()}},length:function(){return this.$tabs.length},tabId:function(B){return B.title&&B.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+A.data(B)},ui:function(C,B){return{options:this.options,tab:C,panel:B,index:this.$tabs.index(C)}},tabify:function(O){this.$lis=A("li:has(a[href])",this.element);this.$tabs=this.$lis.map(function(){return A("a",this)[0]});this.$panels=A([]);var P=this,D=this.options;this.$tabs.each(function(R,Q){if(Q.hash&&Q.hash.replace("#","")){P.$panels=P.$panels.add(Q.hash)}else{if(A(Q).attr("href")!="#"){A.data(Q,"href.tabs",Q.href);A.data(Q,"load.tabs",Q.href);var T=P.tabId(Q);Q.href="#"+T;var S=A("#"+T);if(!S.length){S=A(D.panelTemplate).attr("id",T).addClass(D.panelClass).insertAfter(P.$panels[R-1]||P.element);S.data("destroy.tabs",true)}P.$panels=P.$panels.add(S)}else{D.disabled.push(R+1)}}});if(O){this.element.addClass(D.navClass);this.$panels.each(function(){var Q=A(this);Q.addClass(D.panelClass)});if(D.selected===undefined){if(location.hash){this.$tabs.each(function(S,Q){if(Q.hash==location.hash){D.selected=S;if(A.browser.msie||A.browser.opera){var R=A(location.hash),T=R.attr("id");R.attr("id","");setTimeout(function(){R.attr("id",T)},500)}scrollTo(0,0);return false}})}else{if(D.cookie){var J=parseInt(A.cookie("ui-tabs"+A.data(P.element)),10);if(J&&P.$tabs[J]){D.selected=J}}else{if(P.$lis.filter("."+D.selectedClass).length){D.selected=P.$lis.index(P.$lis.filter("."+D.selectedClass)[0])}}}}D.selected=D.selected===null||D.selected!==undefined?D.selected:0;D.disabled=A.unique(D.disabled.concat(A.map(this.$lis.filter("."+D.disabledClass),function(R,Q){return P.$lis.index(R)}))).sort();if(A.inArray(D.selected,D.disabled)!=-1){D.disabled.splice(A.inArray(D.selected,D.disabled),1)}this.$panels.addClass(D.hideClass);this.$lis.removeClass(D.selectedClass);if(D.selected!==null){this.$panels.eq(D.selected).show().removeClass(D.hideClass);this.$lis.eq(D.selected).addClass(D.selectedClass);var K=function(){A(P.element).triggerHandler("tabsshow",[P.fakeEvent("tabsshow"),P.ui(P.$tabs[D.selected],P.$panels[D.selected])],D.show)};if(A.data(this.$tabs[D.selected],"load.tabs")){this.load(D.selected,K)}else{K()}}A(window).bind("unload",function(){P.$tabs.unbind(".tabs");P.$lis=P.$tabs=P.$panels=null})}for(var G=0,N;N=this.$lis[G];G++){A(N)[A.inArray(G,D.disabled)!=-1&&!A(N).hasClass(D.selectedClass)?"addClass":"removeClass"](D.disabledClass)}if(D.cache===false){this.$tabs.removeData("cache.tabs")}var C,I,B={"min-width":0,duration:1},E="normal";if(D.fx&&D.fx.constructor==Array){C=D.fx[0]||B,I=D.fx[1]||B}else{C=I=D.fx||B}var H={display:"",overflow:"",height:""};if(!A.browser.msie){H.opacity=""}function M(R,Q,S){Q.animate(C,C.duration||E,function(){Q.addClass(D.hideClass).css(H);if(A.browser.msie&&C.opacity){Q[0].style.filter=""}if(S){L(R,S,Q)}})}function L(R,S,Q){if(I===B){S.css("display","block")}S.animate(I,I.duration||E,function(){S.removeClass(D.hideClass).css(H);if(A.browser.msie&&I.opacity){S[0].style.filter=""}A(P.element).triggerHandler("tabsshow",[P.fakeEvent("tabsshow"),P.ui(R,S[0])],D.show)})}function F(R,T,Q,S){T.addClass(D.selectedClass).siblings().removeClass(D.selectedClass);M(R,Q,S)}this.$tabs.unbind(".tabs").bind(D.event,function(){var T=A(this).parents("li:eq(0)"),Q=P.$panels.filter(":visible"),S=A(this.hash);if((T.hasClass(D.selectedClass)&&!D.unselect)||T.hasClass(D.disabledClass)||A(this).hasClass(D.loadingClass)||A(P.element).triggerHandler("tabsselect",[P.fakeEvent("tabsselect"),P.ui(this,S[0])],D.select)===false){this.blur();return false}P.options.selected=P.$tabs.index(this);if(D.unselect){if(T.hasClass(D.selectedClass)){P.options.selected=null;T.removeClass(D.selectedClass);P.$panels.stop();M(this,Q);this.blur();return false}else{if(!Q.length){P.$panels.stop();var R=this;P.load(P.$tabs.index(this),function(){T.addClass(D.selectedClass).addClass(D.unselectClass);L(R,S)});this.blur();return false}}}if(D.cookie){A.cookie("ui-tabs"+A.data(P.element),P.options.selected,D.cookie)}P.$panels.stop();if(S.length){var R=this;P.load(P.$tabs.index(this),Q.length?function(){F(R,T,Q,S)}:function(){T.addClass(D.selectedClass);L(R,S)})}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(A.browser.msie){this.blur()}return false});if(!(/^click/).test(D.event)){this.$tabs.bind("click.tabs",function(){return false})}},add:function(E,D,C){if(C==undefined){C=this.$tabs.length}var G=this.options;var I=A(G.tabTemplate.replace(/#\{href\}/g,E).replace(/#\{label\}/g,D));I.data("destroy.tabs",true);var H=E.indexOf("#")==0?E.replace("#",""):this.tabId(A("a:first-child",I)[0]);var F=A("#"+H);if(!F.length){F=A(G.panelTemplate).attr("id",H).addClass(G.hideClass).data("destroy.tabs",true)}F.addClass(G.panelClass);if(C>=this.$lis.length){I.appendTo(this.element);F.appendTo(this.element[0].parentNode)}else{I.insertBefore(this.$lis[C]);F.insertBefore(this.$panels[C])}G.disabled=A.map(G.disabled,function(K,J){return K>=C?++K:K});this.tabify();if(this.$tabs.length==1){I.addClass(G.selectedClass);F.removeClass(G.hideClass);var B=A.data(this.$tabs[0],"load.tabs");if(B){this.load(C,B)}}this.element.triggerHandler("tabsadd",[this.fakeEvent("tabsadd"),this.ui(this.$tabs[C],this.$panels[C])],G.add)},remove:function(B){var D=this.options,E=this.$lis.eq(B).remove(),C=this.$panels.eq(B).remove();if(E.hasClass(D.selectedClass)&&this.$tabs.length>1){this.select(B+(B+1<this.$tabs.length?1:-1))}D.disabled=A.map(A.grep(D.disabled,function(G,F){return G!=B}),function(G,F){return G>=B?--G:G});this.tabify();this.element.triggerHandler("tabsremove",[this.fakeEvent("tabsremove"),this.ui(E.find("a")[0],C[0])],D.remove)},enable:function(B){var C=this.options;if(A.inArray(B,C.disabled)==-1){return }var D=this.$lis.eq(B).removeClass(C.disabledClass);if(A.browser.safari){D.css("display","inline-block");setTimeout(function(){D.css("display","block")},0)}C.disabled=A.grep(C.disabled,function(F,E){return F!=B});this.element.triggerHandler("tabsenable",[this.fakeEvent("tabsenable"),this.ui(this.$tabs[B],this.$panels[B])],C.enable)},disable:function(C){var B=this,D=this.options;if(C!=D.selected){this.$lis.eq(C).addClass(D.disabledClass);D.disabled.push(C);D.disabled.sort();this.element.triggerHandler("tabsdisable",[this.fakeEvent("tabsdisable"),this.ui(this.$tabs[C],this.$panels[C])],D.disable)}},select:function(B){if(typeof B=="string"){B=this.$tabs.index(this.$tabs.filter("[href$="+B+"]")[0])}this.$tabs.eq(B).trigger(this.options.event)},load:function(G,K){var L=this,D=this.options,E=this.$tabs.eq(G),J=E[0],H=K==undefined||K===false,B=E.data("load.tabs");K=K||function(){};if(!B||!H&&A.data(J,"cache.tabs")){K();return }var M=function(N){var O=A(N),P=O.find("*:last");return P.length&&P.is(":not(img)")&&P||O};var C=function(){L.$tabs.filter("."+D.loadingClass).removeClass(D.loadingClass).each(function(){if(D.spinner){M(this).parent().html(M(this).data("label.tabs"))}});L.xhr=null};if(D.spinner){var I=M(J).html();M(J).wrapInner("<em></em>").find("em").data("label.tabs",I).html(D.spinner)}var F=A.extend({},D.ajaxOptions,{url:B,success:function(O,N){A(J.hash).html(O);C();if(D.cache){A.data(J,"cache.tabs",true)}A(L.element).triggerHandler("tabsload",[L.fakeEvent("tabsload"),L.ui(L.$tabs[G],L.$panels[G])],D.load);D.ajaxOptions.success&&D.ajaxOptions.success(O,N);K()}});if(this.xhr){this.xhr.abort();C()}E.addClass(D.loadingClass);setTimeout(function(){L.xhr=A.ajax(F)},0)},url:function(C,B){this.$tabs.eq(C).removeData("cache.tabs").data("load.tabs",B)},destroy:function(){var B=this.options;this.element.unbind(".tabs").removeClass(B.navClass).removeData("tabs");this.$tabs.each(function(){var C=A.data(this,"href.tabs");if(C){this.href=C}var D=A(this).unbind(".tabs");A.each(["href","load","cache"],function(E,F){D.removeData(F+".tabs")})});this.$lis.add(this.$panels).each(function(){if(A.data(this,"destroy.tabs")){A(this).remove()}else{A(this).removeClass([B.selectedClass,B.unselectClass,B.disabledClass,B.panelClass,B.hideClass].join(" "))}})},fakeEvent:function(B){return A.event.fix({type:B,target:this.element[0]})}});A.ui.tabs.defaults={unselect:false,event:"click",disabled:[],cookie:null,spinner:"Loading&#8230;",cache:false,idPrefix:"ui-tabs-",ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:"<div></div>",navClass:"ui-tabs-nav",selectedClass:"ui-tabs-selected",unselectClass:"ui-tabs-unselect",disabledClass:"ui-tabs-disabled",panelClass:"ui-tabs-panel",hideClass:"ui-tabs-hide",loadingClass:"ui-tabs-loading"};A.ui.tabs.getter="length";A.extend(A.ui.tabs.prototype,{rotation:null,rotate:function(C,F){F=F||false;var B=this,E=this.options.selected;function G(){B.rotation=setInterval(function(){E=++E<B.$tabs.length?E:0;B.select(E)},C)}function D(H){if(!H||H.clientX){clearInterval(B.rotation)}}if(C){G();if(!F){this.$tabs.bind(this.options.event,D)}else{this.$tabs.bind(this.options.event,function(){D();E=B.options.selected;G()})}}else{D();this.$tabs.unbind(this.options.event,D)}}})})(jQuery);(function(C){C.effects=C.effects||{};C.extend(C.effects,{save:function(F,G){for(var E=0;E<G.length;E++){if(G[E]!==null){C.data(F[0],"ec.storage."+G[E],F[0].style[G[E]])}}},restore:function(F,G){for(var E=0;E<G.length;E++){if(G[E]!==null){F.css(G[E],C.data(F[0],"ec.storage."+G[E]))}}},setMode:function(E,F){if(F=="toggle"){F=E.is(":hidden")?"show":"hide"}return F},getBaseline:function(F,G){var H,E;switch(F[0]){case"top":H=0;break;case"middle":H=0.5;break;case"bottom":H=1;break;default:H=F[0]/G.height}switch(F[1]){case"left":E=0;break;case"center":E=0.5;break;case"right":E=1;break;default:E=F[1]/G.width}return{x:E,y:H}},createWrapper:function(F){if(F.parent().attr("id")=="fxWrapper"){return F}var E={width:F.outerWidth({margin:true}),height:F.outerHeight({margin:true}),"float":F.css("float")};F.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var I=F.parent();if(F.css("position")=="static"){I.css({position:"relative"});F.css({position:"relative"})}else{var H=F.css("top");if(isNaN(parseInt(H))){H="auto"}var G=F.css("left");if(isNaN(parseInt(G))){G="auto"}I.css({position:F.css("position"),top:H,left:G,zIndex:F.css("z-index")}).show();F.css({position:"relative",top:0,left:0})}I.css(E);return I},removeWrapper:function(E){if(E.parent().attr("id")=="fxWrapper"){return E.parent().replaceWith(E)}return E},setTransition:function(F,G,E,H){H=H||{};C.each(G,function(J,I){unit=F.cssUnit(I);if(unit[0]>0){H[I]=unit[0]*E+unit[1]}});return H},animateClass:function(G,H,J,I){var E=(typeof J=="function"?J:(I?I:null));var F=(typeof J=="object"?J:null);return this.each(function(){var O={};var M=C(this);var N=M.attr("style")||"";if(typeof N=="object"){N=N.cssText}if(G.toggle){M.hasClass(G.toggle)?G.remove=G.toggle:G.add=G.toggle}var K=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.addClass(G.add)}if(G.remove){M.removeClass(G.remove)}var L=C.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(G.add){M.removeClass(G.add)}if(G.remove){M.addClass(G.remove)}for(var P in L){if(typeof L[P]!="function"&&L[P]&&P.indexOf("Moz")==-1&&P.indexOf("length")==-1&&L[P]!=K[P]&&(P.match(/color/i)||(!P.match(/color/i)&&!isNaN(parseInt(L[P],10))))&&(K.position!="static"||(K.position=="static"&&!P.match(/left|top|bottom|right/)))){O[P]=L[P]}}M.animate(O,H,F,function(){if(typeof C(this).attr("style")=="object"){C(this).attr("style")["cssText"]="";C(this).attr("style")["cssText"]=N}else{C(this).attr("style",N)}if(G.add){C(this).addClass(G.add)}if(G.remove){C(this).removeClass(G.remove)}if(E){E.apply(this,arguments)}})})}});C.fn.extend({_show:C.fn.show,_hide:C.fn.hide,__toggle:C.fn.toggle,_addClass:C.fn.addClass,_removeClass:C.fn.removeClass,_toggleClass:C.fn.toggleClass,effect:function(E,G,F,H){return C.effects[E]?C.effects[E].call(this,{method:E,options:G||{},duration:F,callback:H}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))){return this._show.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="show";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))){return this._hide.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="hide";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{var E=arguments[1]||{};E.mode="toggle";return this.effect.apply(this,[arguments[0],E,arguments[2]||E.duration,arguments[3]||E.callback])}},addClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{add:F},E,H,G]):this._addClass(F)},removeClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{remove:F},E,H,G]):this._removeClass(F)},toggleClass:function(F,E,H,G){return E?C.effects.animateClass.apply(this,[{toggle:F},E,H,G]):this._toggleClass(F)},morph:function(E,G,F,I,H){return C.effects.animateClass.apply(this,[{add:G,remove:E},F,I,H])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(E){var F=this.css(E),G=[];C.each(["em","px","%","pt"],function(H,I){if(F.indexOf(I)>0){G=[parseFloat(F),I]}});return G}});jQuery.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(F,E){jQuery.fx.step[E]=function(G){if(G.state==0){G.start=D(G.elem,E);G.end=B(G.end)}G.elem.style[E]="rgb("+[Math.max(Math.min(parseInt((G.pos*(G.end[0]-G.start[0]))+G.start[0]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[1]-G.start[1]))+G.start[1]),255),0),Math.max(Math.min(parseInt((G.pos*(G.end[2]-G.start[2]))+G.start[2]),255),0)].join(",")+")"}});function B(F){var E;if(F&&F.constructor==Array&&F.length==3){return F}if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return[parseInt(E[1]),parseInt(E[2]),parseInt(E[3])]}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return[parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55]}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return[parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16)]}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return[parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16)]}if(E=/rgba\(0, 0, 0, 0\)/.exec(F)){return A.transparent}return A[jQuery.trim(F).toLowerCase()]}function D(G,E){var F;do{F=jQuery.curCSS(G,E);if(F!=""&&F!="transparent"||jQuery.nodeName(G,"body")){break}E="backgroundColor"}while(G=G.parentNode);return B(F)}var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(F,G,E,I,H){return jQuery.easing[jQuery.easing.def](F,G,E,I,H)},easeInQuad:function(F,G,E,I,H){return I*(G/=H)*G+E},easeOutQuad:function(F,G,E,I,H){return -I*(G/=H)*(G-2)+E},easeInOutQuad:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G+E}return -I/2*((--G)*(G-2)-1)+E},easeInCubic:function(F,G,E,I,H){return I*(G/=H)*G*G+E},easeOutCubic:function(F,G,E,I,H){return I*((G=G/H-1)*G*G+1)+E},easeInOutCubic:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G+E}return I/2*((G-=2)*G*G+2)+E},easeInQuart:function(F,G,E,I,H){return I*(G/=H)*G*G*G+E},easeOutQuart:function(F,G,E,I,H){return -I*((G=G/H-1)*G*G*G-1)+E},easeInOutQuart:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G+E}return -I/2*((G-=2)*G*G*G-2)+E},easeInQuint:function(F,G,E,I,H){return I*(G/=H)*G*G*G*G+E},easeOutQuint:function(F,G,E,I,H){return I*((G=G/H-1)*G*G*G*G+1)+E},easeInOutQuint:function(F,G,E,I,H){if((G/=H/2)<1){return I/2*G*G*G*G*G+E}return I/2*((G-=2)*G*G*G*G+2)+E},easeInSine:function(F,G,E,I,H){return -I*Math.cos(G/H*(Math.PI/2))+I+E},easeOutSine:function(F,G,E,I,H){return I*Math.sin(G/H*(Math.PI/2))+E},easeInOutSine:function(F,G,E,I,H){return -I/2*(Math.cos(Math.PI*G/H)-1)+E},easeInExpo:function(F,G,E,I,H){return(G==0)?E:I*Math.pow(2,10*(G/H-1))+E},easeOutExpo:function(F,G,E,I,H){return(G==H)?E+I:I*(-Math.pow(2,-10*G/H)+1)+E},easeInOutExpo:function(F,G,E,I,H){if(G==0){return E}if(G==H){return E+I}if((G/=H/2)<1){return I/2*Math.pow(2,10*(G-1))+E}return I/2*(-Math.pow(2,-10*--G)+2)+E},easeInCirc:function(F,G,E,I,H){return -I*(Math.sqrt(1-(G/=H)*G)-1)+E},easeOutCirc:function(F,G,E,I,H){return I*Math.sqrt(1-(G=G/H-1)*G)+E},easeInOutCirc:function(F,G,E,I,H){if((G/=H/2)<1){return -I/2*(Math.sqrt(1-G*G)-1)+E}return I/2*(Math.sqrt(1-(G-=2)*G)+1)+E},easeInElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return -(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E},easeOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K)==1){return E+L}if(!J){J=K*0.3}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}return G*Math.pow(2,-10*H)*Math.sin((H*K-I)*(2*Math.PI)/J)+L+E},easeInOutElastic:function(F,H,E,L,K){var I=1.70158;var J=0;var G=L;if(H==0){return E}if((H/=K/2)==2){return E+L}if(!J){J=K*(0.3*1.5)}if(G<Math.abs(L)){G=L;var I=J/4}else{var I=J/(2*Math.PI)*Math.asin(L/G)}if(H<1){return -0.5*(G*Math.pow(2,10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J))+E}return G*Math.pow(2,-10*(H-=1))*Math.sin((H*K-I)*(2*Math.PI)/J)*0.5+L+E},easeInBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*(G/=I)*G*((H+1)*G-H)+E},easeOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}return J*((G=G/I-1)*G*((H+1)*G+H)+1)+E},easeInOutBack:function(F,G,E,J,I,H){if(H==undefined){H=1.70158}if((G/=I/2)<1){return J/2*(G*G*(((H*=(1.525))+1)*G-H))+E}return J/2*((G-=2)*G*(((H*=(1.525))+1)*G+H)+2)+E},easeInBounce:function(F,G,E,I,H){return I-jQuery.easing.easeOutBounce(F,H-G,0,I,H)+E},easeOutBounce:function(F,G,E,I,H){if((G/=H)<(1/2.75)){return I*(7.5625*G*G)+E}else{if(G<(2/2.75)){return I*(7.5625*(G-=(1.5/2.75))*G+0.75)+E}else{if(G<(2.5/2.75)){return I*(7.5625*(G-=(2.25/2.75))*G+0.9375)+E}else{return I*(7.5625*(G-=(2.625/2.75))*G+0.984375)+E}}}},easeInOutBounce:function(F,G,E,I,H){if(G<H/2){return jQuery.easing.easeInBounce(F,G*2,0,I,H)*0.5+E}return jQuery.easing.easeOutBounce(F,G*2-H,0,I,H)*0.5+I*0.5+E}})})(jQuery);jQuery.jScrollPane={active:[]};jQuery.fn.jScrollPane=function(A){A=jQuery.extend({scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false},A);return this.each(function(){var K=jQuery(this);if(jQuery(this).parent().is(".jScrollPaneContainer")){var AA=A.maintainPosition?K.offset({relativeTo:jQuery(this).parent()[0]}).top:0;var I=jQuery(this).parent();var Y=I.innerWidth();var AB=I.outerHeight();var J=AB;if(I.unmousewheel){I.unmousewheel()}jQuery(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",I).remove();K.css({top:0})}else{var AA=0;this.originalPadding=K.css("paddingTop")+" "+K.css("paddingRight")+" "+K.css("paddingBottom")+" "+K.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(K.css("paddingLeft"))||0)+(parseInt(K.css("paddingRight"))||0);var Y=K[0].offsetWidth;var AB=K[0].offsetHeight;var J=AB;K.parent().addClass("jScrollPaneContainer").css({height:AB+"px",width:Y+"px"});jQuery(document).bind("emchange",function(AC,AD,p){K.jScrollPane(A)})}var l=this.originalSidePaddingTotal;var h={height:"auto",width:Y-A.scrollbarWidth-A.scrollbarMargin-l+"px"};if(A.scrollbarOnLeft){h.paddingLeft=A.scrollbarMargin+A.scrollbarWidth+"px"}else{h.paddingRight=A.scrollbarMargin+"px"}K.css(h);var j=K.outerHeight();var d=AB/j;if(d<0.99){var E=K.parent();E.append(jQuery("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:A.scrollbarWidth+"px"}).append(jQuery("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:A.scrollbarWidth+"px"}),jQuery("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:A.scrollbarWidth+"px"}))));E.addClass("scrolling");var x=jQuery(">.jScrollPaneTrack",E);var L=jQuery(">.jScrollPaneTrack .jScrollPaneDrag",E);if(A.showArrows){var b;var z;var O;var n;var e=function(){if(n>4||n%4==0){w(s+z*W)}n++};var H=function(p){jQuery("html").unbind("mouseup",H);b.removeClass("jScrollActiveArrowButton");clearInterval(O)};var U=function(){jQuery("html").bind("mouseup",H);b.addClass("jScrollActiveArrowButton");n=0;e();O=setInterval(e,100)};E.append(jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:A.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){b=jQuery(this);z=-1;U();this.blur();return false}),jQuery("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:A.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){b=jQuery(this);z=1;U();this.blur();return false}));var M=jQuery(">.jScrollArrowUp",E);var G=jQuery(">.jScrollArrowDown",E);if(A.arrowSize){J=AB-A.arrowSize-A.arrowSize;x.css({height:J+"px",top:A.arrowSize+"px"})}else{var o=M.height();A.arrowSize=o;J=AB-o-G.height();x.css({height:J+"px",top:o+"px"})}}var u=jQuery(this).css({position:"absolute",overflow:"visible"});var B;var T;var W;var s=0;var R=d*AB/2;var V=function(AC,AE){var AD=AE=="X"?"Left":"Top";return AC["page"+AE]||(AC["client"+AE]+(document.documentElement["scroll"+AD]||document.body["scroll"+AD]))||0};var a=function(){return false};var t=function(){k();B=L.offset(false);B.top-=s;T=J-L[0].offsetHeight;W=2*A.wheelSpeed*T/j};var C=function(p){t();R=V(p,"Y")-s-B.top;jQuery("html").bind("mouseup",P).bind("mousemove",c);if(jQuery.browser.msie){jQuery("html").bind("dragstart",a).bind("selectstart",a)}return false};var P=function(){jQuery("html").unbind("mouseup",P).unbind("mousemove",c);R=d*AB/2;if(jQuery.browser.msie){jQuery("html").unbind("dragstart",a).unbind("selectstart",a)}};var w=function(AC){AC=AC<0?0:(AC>T?T:AC);s=AC;L.css({top:AC+"px"});var AD=AC/T;u.css({top:((AB-j)*AD)+"px"});K.trigger("scroll");if(A.showArrows){M[AC==0?"addClass":"removeClass"]("disabled");G[AC==T?"addClass":"removeClass"]("disabled")}};var c=function(p){w(V(p,"Y")-B.top-R)};var m=Math.max(Math.min(d*(AB-A.arrowSize*2),A.dragMaxHeight),A.dragMinHeight);L.css({height:m+"px"}).bind("mousedown",C);var g;var N;var F;var q=function(){if(N>8||N%4==0){w((s-((s-F)/2)))}N++};var y=function(){clearInterval(g);jQuery("html").unbind("mouseup",y).unbind("mousemove",Z)};var Z=function(p){F=V(p,"Y")-B.top-R};var Q=function(p){t();Z(p);N=0;jQuery("html").bind("mouseup",y).bind("mousemove",Z);g=setInterval(q,100);q()};x.bind("mousedown",Q);if(E.mousewheel){E.mousewheel(function(AC,AE){t();k();var AD=s;w(s-AE*W);var p=AD!=s;return !p},false)}var D;var S;function X(){var p=(D-s)/A.animateStep;if(p>1||p<-1){w(s+p)}else{w(D);k()}}var k=function(){if(S){clearInterval(S);delete D}};var v=function(AD,p){if(typeof AD=="string"){$e=jQuery(AD,this);if(!$e.length){return }AD=$e.offset().top-K.offset().top}k();var AC=-AD/(AB-j)*T;if(p||!A.animateTo){w(AC)}else{D=AC;S=setInterval(X,A.animateInterval)}};K[0].scrollTo=v;K[0].scrollBy=function(AC){var p=-parseInt(u.css("top"))||0;v(p+AC)};t();v(-AA,true);jQuery.jScrollPane.active.push(K[0])}else{K.css({height:AB+"px",width:Y-this.originalSidePaddingTotal+"px",padding:this.originalPadding});K.parent().removeClass("scrolling")}})};jQuery(window).bind("unload",function(){var B=jQuery.jScrollPane.active;for(var A=0;A<B.length;A++){B[A].scrollTo=B[A].scrollBy=null}});(function(A){A.widget("ui.stars",{init:function(){var C=this,E=this.options;E.isSelect=E.inputType=="select";this.$selec=E.isSelect?A("select",this.element):null;this.$rboxs=E.isSelect?A("option",this.$selec):A(":radio",this.element);this.$stars=this.$rboxs.map(function(H){if(H==0){E.split=typeof E.split!="number"?0:E.split;E.val2id=[];E.id2val=[];E.id2title=[];E.name=E.isSelect?C.$selec.get(0).name:this.name;E.disabled=E.disabled||(E.isSelect?A(C.$selec).attr("disabled"):A(this).attr("disabled"));E.items=0}E.items++;E.val2id[this.value]=H;E.id2val[H]=this.value;E.id2title[H]=(E.isSelect?this.text:this.title)||this.value;if(E.selected==H||(E.selected==-1&&(E.isSelect?this.defaultSelected:this.defaultChecked))){E.checked=H;E.value=E.id2val[H];E.title=E.id2title[H]}var G=A("<div/>").addClass(E.starClass);var F=A("<a/>").attr("title",E.showTitles?E.id2title[H]:"").text(this.value);if(E.split){var J=(H%E.split);var I=Math.floor(E.starWidth/E.split);G.width(I);F.css("margin-left","-"+(J*I)+"px")}return G.append(F).get(0)});this.$cancel=A("<div/>").addClass(E.cancelClass).append(A("<a/>").attr("title",E.showTitles?E.cancelTitle:"").text(E.cancelValue));this.$value=A('<input type="hidden" name="'+E.name+'" value="'+E.value+'" />');E.cancelShow&=!E.disabled&&!E.oneVoteOnly;if(E.cancelShow){this.element.append(this.$cancel)}this.element.append(this.$stars);this.element.append(this.$value);E.isSelect?this.$selec.remove():this.$rboxs.remove();if(E.checked===undefined){E.checked=-1;E.value=E.cancelValue;E.title="";if(E.cancelShow){this._disableCancel()}}else{B(E.checked,false)}if(E.disabled){this.disable()}A(window).bind("unload",function(){C.$cancel.unbind(".stars");C.$stars.unbind(".stars");C.$selec=C.$rboxs=C.$stars=C.$value=C.$cancel=null});function D(){C.$stars.removeClass([E.starOnClass,E.starHoverClass].join(" "));C._showCap("")}function B(G,F){if(G!=-1){var I=F?E.starHoverClass:E.starOnClass;var H=F?E.starOnClass:E.starHoverClass;C.$stars.eq(G).prevAll("."+E.starClass).andSelf().removeClass(H).addClass(I);C.$stars.eq(G).nextAll("."+E.starClass).removeClass([E.starHoverClass,E.starOnClass].join(" "));C._showCap(E.id2title[G])}else{D()}}this.$stars.bind("click.stars",function(){if(!E.forceSelect&&E.disabled){return false}var F=C.$stars.index(this);E.checked=F;E.value=E.id2val[F];E.title=E.id2title[F];C.$value.attr({disabled:E.disabled?"disabled":"",value:E.value});B(F,false);C._disableCancel();if(!E.forceSelect){C.callback("star")}}).bind("mouseover.stars",function(){if(E.disabled){return false}var F=C.$stars.index(this);B(F,true)}).bind("mouseout.stars",function(){if(E.disabled){return false}B(C.options.checked,false)});this.$cancel.bind("click.stars",function(){if(!E.forceSelect&&(E.disabled||(E.value==E.cancelValue))){return false}E.checked=-1;E.value=E.cancelValue;E.title="";C.$value.attr({value:E.value,disabled:"disabled"});D();C._disableCancel();if(!E.forceSelect){C.callback("cancel")}}).bind("mouseover.stars",function(){if(C._disableCancel()){return false}C.$cancel.addClass(E.cancelHoverClass);D();C._showCap(E.cancelTitle)}).bind("mouseout.stars",function(){if(C._disableCancel()){return false}C.$cancel.removeClass(E.cancelHoverClass);C.$stars.triggerHandler("mouseout.stars")})},select:function(B){var C=this.options;C.forceSelect=true;if(B==C.cancelValue){this.$cancel.triggerHandler("click.stars")}else{this.$stars.eq(C.val2id[B]).triggerHandler("click.stars")}C.forceSelect=false},selectID:function(B){var C=this.options;C.forceSelect=true;if(B==-1){this.$cancel.triggerHandler("click.stars")}else{this.$stars.eq(B).triggerHandler("click.stars")}C.forceSelect=false},enable:function(){this.options.disabled=false;this._disableAll()},disable:function(){this.options.disabled=true;this._disableAll()},_disableCancel:function(){var C=this.options,B=C.disabled||C.oneVoteOnly||(C.value==C.cancelValue);if(B){this.$cancel.removeClass(C.cancelHoverClass).addClass(C.cancelDisabledClass)}else{this.$cancel.removeClass(C.cancelDisabledClass)}this.$cancel.css("opacity",B?0.5:1);return B},_disableAll:function(){var B=this.options;this._disableCancel();if(B.disabled){this.$stars.filter("div").addClass(B.starDisabledClass)}else{this.$stars.filter("div").removeClass(B.starDisabledClass)}},_showCap:function(B){var C=this.options;if(C.captionEl){C.captionEl.text(B)}},destroy:function(){this.options.isSelect?this.$selec.appendTo(this.element):this.$rboxs.appendTo(this.element);this.$cancel.unbind(".stars").remove();this.$stars.unbind(".stars").remove();this.$value.remove();this.element.unbind(".stars").removeData("stars")},callback:function(B){var C=this.options;C.callback(this,B,C.value);if(C.oneVoteOnly&&!C.disabled){this.disable()}}});A.ui.stars.defaults={inputType:"radio",split:0,selected:-1,disabled:false,cancelTitle:"Cancel Rating",cancelValue:0,cancelShow:true,oneVoteOnly:false,showTitles:false,captionEl:null,callback:function(C,B,D){},starWidth:16,cancelClass:"ui-stars-cancel",starClass:"ui-stars-star",starOnClass:"ui-stars-star-on",starHoverClass:"ui-stars-star-hover",starDisabledClass:"ui-stars-star-disabled",cancelHoverClass:"ui-stars-cancel-hover",cancelDisabledClass:"ui-stars-cancel-disabled"}})(jQuery);if(!window.SI){var SI={}}SI.Files={htmlClass:"SI-FILES-STYLIZED",fileClass:"file",wrapClass:"file_wrapper",fini:false,able:false,init:function(){this.fini=true;var B=0;if((B&&B<5.5)||!document.getElementsByTagName){return }this.able=true;var A=document.getElementsByTagName("html")[0];A.className+=(A.className!=""?" ":"")+this.htmlClass},stylize:function(A){if(!this.fini){this.init()}if(!this.able){return }A.parentNode.file=A;A.parentNode.onmousemove=function(G){if(typeof G=="undefined"){G=window.event}if(typeof G.pageY=="undefined"&&typeof G.clientX=="number"&&document.documentElement){G.pageX=G.clientX+document.documentElement.scrollLeft;G.pageY=G.clientY+document.documentElement.scrollTop}var D=oy=0;var F=this;if(F.offsetParent){D=F.offsetLeft;oy=F.offsetTop;while(F=F.offsetParent){D+=F.offsetLeft;oy+=F.offsetTop}}var B=G.pageX-D;var H=G.pageY-oy;var C=this.file.offsetWidth;var E=this.file.offsetHeight;this.file.style.top=H-(E/2)+"px";this.file.style.left=B-(C-30)+"px"}},stylizeById:function(A){this.stylize(document.getElementById(A))},stylizeAll:function(){if(!this.fini){this.init()}if(!this.able){return }var A=document.getElementsByTagName("input");for(var C=0;C<A.length;C++){var B=A[C];if(B.type=="file"&&B.className.indexOf(this.fileClass)!=-1&&B.parentNode.className.indexOf(this.wrapClass)!=-1){this.stylize(B)}}}};var tb_pathToImage="images/loadingAnimation.gif";
/*!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader=new Image();imgLoader.src=tb_pathToImage});function tb_init(A){$(A).click(function(){var C=this.title||this.name||null;var B=this.href||this.alt;var D=this.rel||false;tb_show(C,B,D);this.blur();return false})}function tb_show(I,B,G){try{if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove)}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(tb_remove)}}if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack")}else{$("#TB_overlay").addClass("TB_overlayBG")}if(I===null){I=""}$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$("#TB_load").show();var C;if(B.indexOf("?")!==-1){C=B.substr(0,B.indexOf("?"))}else{C=B}var E=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var J=C.toLowerCase().match(E);if(J==".jpg"||J==".jpeg"||J==".png"||J==".gif"||J==".bmp"){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(G){TB_TempArray=$("a[@rel="+G+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var F=TB_TempArray[TB_Counter].href.toLowerCase().match(E);if(!(TB_TempArray[TB_Counter].href==B)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>"}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>"}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length)}}}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var N=tb_getPageSize();var L=N[0]-150;var Q=N[1]-150;var M=imgPreloader.width;var K=imgPreloader.height;if(M>L){K=K*(L/M);M=L;if(K>Q){M=M*(Q/K);K=Q}}else{if(K>Q){M=M*(Q/K);K=Q;if(M>L){K=K*(L/M);M=L}}}TB_WIDTH=M+30;TB_HEIGHT=K+60;$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+B+"' width='"+M+"' height='"+K+"' alt='"+I+"'/></a><div id='TB_caption'>"+I+"<div id='TB_secondLine'>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function P(){if($(document).unbind("click",P)){$(document).unbind("click",P)}$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,G);return false}$("#TB_prev").click(P)}if(!(TB_NextHTML==="")){function O(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,G);return false}$("#TB_next").click(O)}document.onkeydown=function(R){if(R==null){keycode=event.keyCode}else{keycode=R.which}if(keycode==27){tb_remove()}else{if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";O()}}else{if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";P()}}}}};tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(tb_remove);$("#TB_window").css({display:"block"})};imgPreloader.src=B}else{var A=B.replace(/^[^\?]+\??/,"");var D=tb_parseQuery(A);TB_WIDTH=(D.width*1)+30||630;TB_HEIGHT=(D.height*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(B.indexOf("TB_iframe")!=-1){urlNoQuery=B.split("TB_");$("#TB_iframeContent").remove();if(D.modal!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+I+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>")}else{$("#TB_overlay").unbind();$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>")}}else{if($("#TB_window").css("display")!="block"){if(D.modal!="true"){$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+I+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>")}else{$("#TB_overlay").unbind();$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>")}}else{$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";$("#TB_ajaxContent")[0].scrollTop=0;$("#TB_ajaxWindowTitle").html(I)}}$("#TB_closeWindowButton").click(tb_remove);if(B.indexOf("TB_inline")!=-1){$("#TB_ajaxContent").append($("#"+D.inlineId).children());$("#TB_window").unload(function(){$("#"+D.inlineId).append($("#TB_ajaxContent").children())});tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"})}else{if(B.indexOf("TB_iframe")!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({display:"block"})}}else{$("#TB_ajaxContent").load(B+="&random="+(new Date().getTime()),function(){tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display:"block"})})}}}if(!D.modal){document.onkeyup=function(K){if(K==null){keycode=event.keyCode}else{keycode=K.which}if(keycode==27){tb_remove()}}}}catch(H){}}function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"})}function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$("#TB_window,#TB_overlay,#TB_HideSelect").trigger("unload").unbind().remove()});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","")}document.onkeydown="";document.onkeyup="";return false}function tb_position(){$("#TB_window").css({marginLeft:"-"+parseInt((TB_WIDTH/2),10)+"px",width:TB_WIDTH+"px"});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$("#TB_window").css({marginTop:"-"+parseInt((TB_HEIGHT/2),10)+"px"})}}function tb_parseQuery(D){var E={};if(!D){return E}var A=D.split(/[;&]/);for(var C=0;C<A.length;C++){var G=A[C].split("=");if(!G||G.length!=2){continue}var B=unescape(G[0]);var F=unescape(G[1]);F=F.replace(/\+/g," ");E[B]=F}return E}function tb_getPageSize(){var C=document.documentElement;var A=window.innerWidth||self.innerWidth||(C&&C.clientWidth)||document.body.clientWidth;var B=window.innerHeight||self.innerHeight||(C&&C.clientHeight)||document.body.clientHeight;arrayPageSize=[A,B];return arrayPageSize}function tb_detectMacXFF(){var A=navigator.userAgent.toLowerCase();if(A.indexOf("mac")!=-1&&A.indexOf("firefox")!=-1){return true}}(function(){var A=false,B=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(G){var F=this.prototype;A=true;var E=new this();A=false;for(var D in G){E[D]=typeof G[D]=="function"&&typeof F[D]=="function"&&B.test(G[D])?(function(H,I){return function(){var K=this._super;this._super=F[H];var J=I.apply(this,arguments);this._super=K;return J}})(D,G[D]):G[D]}function C(){if(!A&&this.init){this.init.apply(this,arguments)}}C.prototype=E;C.constructor=C;C.extend=arguments.callee;return C}})();function publishException(e){try{var eSource=eval(e.toSource());if(LOG_ERRORS){var oRequest={cmd_log_exception:true,line:eSource.lineNumber,location:eSource.fileName,message:eSource.message};$.ajax({type:"GET",url:sAJAXURL+"/Exceptions.php",dataType:"json",data:oRequest})}if(DISPLAY_ERRORS){alert("Message: "+eSource.message+"\n\nFile: "+eSource.fileName+"\n\nLine Number: "+eSource.lineNumber)}}catch(e){}}function handleAjaxError(C,B,A){throw A}String.prototype.replaceAll=function(B,A){var C=this;while(C.match(B)){C=C.replace(B,A)}return C};String.prototype.formatNumber=function(){number=""+this;if(number.length>3){var B=number.length%3;var A=(B>0?(number.substring(0,B)):"");for(i=0;i<Math.floor(number.length/3);i++){if((B==0)&&(i==0)){A+=number.substring(B+3*i,B+3*i+3)}else{A+=","+number.substring(B+3*i,B+3*i+3)}}return(A)}else{return number}};String.prototype.charRefToUnicode=function(){return this.replace(/&#(([0-9]{1,7})|(x[0-9a-f]{1,6}));?/gi,function(A,F,D,C,E,B){return String.fromCharCode(D||("0"+C))})};String.prototype.urlEncode=function(){return encodeURIComponent(this)};String.prototype.htmlDecode=function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(B){var A=this.length;var C=Number(arguments[1])||0;C=(C<0)?Math.ceil(C):Math.floor(C);if(C<0){C+=A}for(;C<A;C++){if(C in this&&this[C]===B){return C}}return -1}}if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}if(!String.prototype.ltrim){String.prototype.ltrim=function(){return this.replace(/^\s+/,"")}}if(!String.prototype.rtrim){String.prototype.rtrim=function(){return this.replace(/\s+$/,"")}}function StringBuilder(A){this.strings=new Array("");this.append(A)}StringBuilder.prototype.append=function(A){if(A){this.strings.push(A)}};StringBuilder.prototype.clear=function(){this.strings.length=1};StringBuilder.prototype.toString=function(){return this.strings.join("")};Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};Date.getMonthNumberFromName=function(B){var E=Date.CultureInfo.monthNames,A=Date.CultureInfo.abbreviatedMonthNames,D=B.toLowerCase();for(var C=0;C<E.length;C++){if(E[C].toLowerCase()==D||A[C].toLowerCase()==D){return C}}return -1};Date.getDayNumberFromName=function(B){var F=Date.CultureInfo.dayNames,A=Date.CultureInfo.abbreviatedDayNames,E=Date.CultureInfo.shortestDayNames,D=B.toLowerCase();for(var C=0;C<F.length;C++){if(F[C].toLowerCase()==D||A[C].toLowerCase()==D){return C}}return -1};Date.isLeapYear=function(A){return(((A%4===0)&&(A%100!==0))||(A%400===0))};Date.getDaysInMonth=function(A,B){return[31,(Date.isLeapYear(A)?29:28),31,30,31,30,31,31,30,31,30,31][B]};Date.getTimezoneOffset=function(A,B){return(B||false)?Date.CultureInfo.abbreviatedTimeZoneDST[A.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[A.toUpperCase()]};Date.getTimezoneAbbreviation=function(B,D){var C=(D||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,A;for(A in C){if(C[A]===B){return A}}return null};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.compareTo=function(A){if(isNaN(this)){throw new Error(this)}if(A instanceof Date&&!isNaN(A)){return(this>A)?1:(this<A)?-1:0}else{throw new TypeError(A)}};Date.prototype.equals=function(A){return(this.compareTo(A)===0)};Date.prototype.between=function(C,A){var B=this.getTime();return B>=C.getTime()&&B<=A.getTime()};Date.prototype.addMilliseconds=function(A){this.setMilliseconds(this.getMilliseconds()+A);return this};Date.prototype.addSeconds=function(A){return this.addMilliseconds(A*1000)};Date.prototype.addMinutes=function(A){return this.addMilliseconds(A*60000)};Date.prototype.addHours=function(A){return this.addMilliseconds(A*3600000)};Date.prototype.addDays=function(A){return this.addMilliseconds(A*86400000)};Date.prototype.addWeeks=function(A){return this.addMilliseconds(A*604800000)};Date.prototype.addMonths=function(A){var B=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+A);this.setDate(Math.min(B,this.getDaysInMonth()));return this};Date.prototype.addYears=function(A){return this.addMonths(A*12)};Date.prototype.add=function(B){if(typeof B=="number"){this._orient=B;return this}var A=B;if(A.millisecond||A.milliseconds){this.addMilliseconds(A.millisecond||A.milliseconds)}if(A.second||A.seconds){this.addSeconds(A.second||A.seconds)}if(A.minute||A.minutes){this.addMinutes(A.minute||A.minutes)}if(A.hour||A.hours){this.addHours(A.hour||A.hours)}if(A.month||A.months){this.addMonths(A.month||A.months)}if(A.year||A.years){this.addYears(A.year||A.years)}if(A.day||A.days){this.addDays(A.day||A.days)}return this};Date._validate=function(D,C,A,B){if(typeof D!="number"){throw new TypeError(D+" is not a Number.")}else{if(D<C||D>A){throw new RangeError(D+" is not a valid value for "+B+".")}}return true};Date.validateMillisecond=function(A){return Date._validate(A,0,999,"milliseconds")};Date.validateSecond=function(A){return Date._validate(A,0,59,"seconds")};Date.validateMinute=function(A){return Date._validate(A,0,59,"minutes")};Date.validateHour=function(A){return Date._validate(A,0,23,"hours")};Date.validateDay=function(C,A,B){return Date._validate(C,1,Date.getDaysInMonth(A,B),"days")};Date.validateMonth=function(A){return Date._validate(A,0,11,"months")};Date.validateYear=function(A){return Date._validate(A,1,9999,"seconds")};Date.prototype.set=function(B){var A=B;if(!A.millisecond&&A.millisecond!==0){A.millisecond=-1}if(!A.second&&A.second!==0){A.second=-1}if(!A.minute&&A.minute!==0){A.minute=-1}if(!A.hour&&A.hour!==0){A.hour=-1}if(!A.day&&A.day!==0){A.day=-1}if(!A.month&&A.month!==0){A.month=-1}if(!A.year&&A.year!==0){A.year=-1}if(A.millisecond!=-1&&Date.validateMillisecond(A.millisecond)){this.addMilliseconds(A.millisecond-this.getMilliseconds())}if(A.second!=-1&&Date.validateSecond(A.second)){this.addSeconds(A.second-this.getSeconds())}if(A.minute!=-1&&Date.validateMinute(A.minute)){this.addMinutes(A.minute-this.getMinutes())}if(A.hour!=-1&&Date.validateHour(A.hour)){this.addHours(A.hour-this.getHours())}if(A.month!==-1&&Date.validateMonth(A.month)){this.addMonths(A.month-this.getMonth())}if(A.year!=-1&&Date.validateYear(A.year)){this.addYears(A.year-this.getFullYear())}if(A.day!=-1&&Date.validateDay(A.day,this.getFullYear(),this.getMonth())){this.addDays(A.day-this.getDate())}if(A.timezone){this.setTimezone(A.timezone)}if(A.timezoneOffset){this.setTimezoneOffset(A.timezoneOffset)}return this};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.isLeapYear=function(){var A=this.getFullYear();return(((A%4===0)&&(A%100!==0))||(A%400===0))};Date.prototype.isWeekday=function(){return !(this.is().sat()||this.is().sun())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1})};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};Date.prototype.moveToDayOfWeek=function(A,B){var C=(A-this.getDay()+7*(B||+1))%7;return this.addDays((C===0)?C+=7*(B||+1):C)};Date.prototype.moveToMonth=function(C,A){var B=(C-this.getMonth()+12*(A||+1))%12;return this.addMonths((B===0)?B+=12*(A||+1):B)};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000)};Date.prototype.getWeekOfYear=function(A){var G=this.getFullYear(),C=this.getMonth(),E=this.getDate();var I=A||Date.CultureInfo.firstDayOfWeek;var D=7+1-new Date(G,0,1).getDay();if(D==8){D=1}var B=((Date.UTC(G,C,E,0,0,0)-Date.UTC(G,0,1,0,0,0))/86400000)+1;var H=Math.floor((B-D+7)/7);if(H===I){G--;var F=7+1-new Date(G,0,1).getDay();if(F==2||F==8){H=53}else{H=52}}return H};Date.prototype.isDST=function(){console.log("isDST");return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};Date.prototype.setTimezoneOffset=function(B){var A=this.getTimezoneOffset(),C=Number(B)*-6/10;this.addMinutes(C-A);return this};Date.prototype.setTimezone=function(A){return this.setTimezoneOffset(Date.getTimezoneOffset(A))};Date.prototype.getUTCOffset=function(){var B=this.getTimezoneOffset()*-10/6,A;if(B<0){A=(B-10000).toString();return A[0]+A.substr(2)}else{A=(B+10000).toString();return"+"+A.substr(1)}};Date.prototype.getDayName=function(A){return A?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};Date.prototype.getMonthName=function(A){return A?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(C){var A=this;var B=function B(D){return(D.toString().length==1)?"0"+D:D};return C?C.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(D){switch(D){case"hh":return B(A.getHours()<13?A.getHours():(A.getHours()-12));case"h":return A.getHours()<13?A.getHours():(A.getHours()-12);case"HH":return B(A.getHours());case"H":return A.getHours();case"mm":return B(A.getMinutes());case"m":return A.getMinutes();case"ss":return B(A.getSeconds());case"s":return A.getSeconds();case"yyyy":return A.getFullYear();case"yy":return A.getFullYear().toString().substring(2,4);case"dddd":return A.getDayName();case"ddd":return A.getDayName(true);case"dd":return B(A.getDate());case"d":return A.getDate().toString();case"MMMM":return A.getMonthName();case"MMM":return A.getMonthName(true);case"MM":return B((A.getMonth()+1));case"M":return A.getMonth()+1;case"t":return A.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return A.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return""}}):this._toString()};Date.now=function(){return new Date()};Date.today=function(){return Date.now().clearTime()};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var A={};A[this._dateElement]=this;return Date.now().add(A)};Number.prototype.ago=function(){var A={};A[this._dateElement]=this*-1;return Date.now().add(A)};(function(){var G=Date.prototype,A=Number.prototype;var M=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),L=("january february march april may june july august september october november december").split(/\s/),K=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),J;var I=function(N){return function(){if(this._is){this._is=false;return this.getDay()==N}return this.moveToDayOfWeek(N,this._orient)}};for(var F=0;F<M.length;F++){G[M[F]]=G[M[F].substring(0,3)]=I(F)}var H=function(N){return function(){if(this._is){this._is=false;return this.getMonth()===N}return this.moveToMonth(N,this._orient)}};for(var D=0;D<L.length;D++){G[L[D]]=G[L[D].substring(0,3)]=H(D)}var E=function(N){return function(){if(N.substring(N.length-1)!="s"){N+="s"}return this["add"+N](this._orient)}};var B=function(N){return function(){this._dateElement=N;return this}};for(var C=0;C<K.length;C++){J=K[C].toLowerCase();G[J]=G[J+"s"]=E(K[C]);A[J]=A[J+"s"]=B(J)}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ")};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern)};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern)};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern)};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern)};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};(function(){Date.Parsing={Exception:function(I){this.message="Parse error at '"+I.substring(0,10)+" ...'"}};var A=Date.Parsing;var C=A.Operators={rtoken:function(I){return function(J){var K=J.match(I);if(K){return([K[0],J.substring(K[0].length)])}else{throw new A.Exception(J)}}},token:function(I){return function(J){return C.rtoken(new RegExp("^s*"+J+"s*"))(J)}},stoken:function(I){return C.rtoken(new RegExp("^"+I))},until:function(I){return function(J){var K=[],M=null;while(J.length){try{M=I.call(this,J)}catch(L){K.push(M[0]);J=M[1];continue}break}return[K,J]}},many:function(I){return function(J){var M=[],K=null;while(J.length){try{K=I.call(this,J)}catch(L){return[M,J]}M.push(K[0]);J=K[1]}return[M,J]}},optional:function(I){return function(J){var K=null;try{K=I.call(this,J)}catch(L){return[null,J]}return[K[0],K[1]]}},not:function(I){return function(J){try{I.call(this,J)}catch(K){return[null,J]}throw new A.Exception(J)}},ignore:function(I){return I?function(J){var K=null;K=I.call(this,J);return[null,K[1]]}:null},product:function(){var J=arguments[0],K=Array.prototype.slice.call(arguments,1),L=[];for(var I=0;I<J.length;I++){L.push(C.each(J[I],K))}return L},cache:function(K){var I={},J=null;return function(L){try{J=I[L]=(I[L]||K.call(this,L))}catch(M){J=I[L]=M}if(J instanceof A.Exception){throw J}else{return J}}},any:function(){var I=arguments;return function(K){var L=null;for(var J=0;J<I.length;J++){if(I[J]==null){continue}try{L=(I[J].call(this,K))}catch(M){L=null}if(L){return L}}throw new A.Exception(K)}},each:function(){var I=arguments;return function(K){var N=[],L=null;for(var J=0;J<I.length;J++){if(I[J]==null){continue}try{L=(I[J].call(this,K))}catch(M){throw new A.Exception(K)}N.push(L[0]);K=L[1]}return[N,K]}},all:function(){var J=arguments,I=I;return I.each(I.optional(J))},sequence:function(I,J,K){J=J||C.rtoken(/^\s*/);K=K||null;if(I.length==1){return I[0]}return function(O){var P=null,Q=null;var S=[];for(var N=0;N<I.length;N++){try{P=I[N].call(this,O)}catch(R){break}S.push(P[0]);try{Q=J.call(this,P[1])}catch(M){Q=null;break}O=Q[1]}if(!P){throw new A.Exception(O)}if(Q){throw new A.Exception(Q[1])}if(K){try{P=K.call(this,P[1])}catch(L){throw new A.Exception(P[1])}}return[S,(P?P[1]:O)]}},between:function(J,K,I){I=I||J;var L=C.each(C.ignore(J),K,C.ignore(I));return function(M){var N=L.call(this,M);return[[N[0][0],r[0][2]],N[1]]}},list:function(I,J,K){J=J||C.rtoken(/^\s*/);K=K||null;return(I instanceof Array?C.each(C.product(I.slice(0,-1),C.ignore(J)),I.slice(-1),C.ignore(K)):C.each(C.many(C.each(I,C.ignore(J))),px,C.ignore(K)))},set:function(I,J,K){J=J||C.rtoken(/^\s*/);K=K||null;return function(X){var L=null,N=null,M=null,O=null,P=[[],X],W=false;for(var R=0;R<I.length;R++){M=null;N=null;L=null;W=(I.length==1);try{L=I[R].call(this,X)}catch(U){continue}O=[[L[0]],L[1]];if(L[1].length>0&&!W){try{M=J.call(this,L[1])}catch(V){W=true}}else{W=true}if(!W&&M[1].length===0){W=true}if(!W){var S=[];for(var Q=0;Q<I.length;Q++){if(R!=Q){S.push(I[Q])}}N=C.set(S,J).call(this,M[1]);if(N[0].length>0){O[0]=O[0].concat(N[0]);O[1]=N[1]}}if(O[1].length<P[1].length){P=O}if(P[1].length===0){break}}if(P[0].length===0){return P}if(K){try{M=K.call(this,P[1])}catch(T){throw new A.Exception(P[1])}P[1]=M[1]}return P}},forward:function(I,J){return function(K){return I[J].call(this,K)}},replace:function(J,I){return function(K){var L=J.call(this,K);return[I,L[1]]}},process:function(J,I){return function(K){var L=J.call(this,K);return[I.call(this,L[0]),L[1]]}},min:function(I,J){return function(K){var L=J.call(this,K);if(L[0].length<I){throw new A.Exception(K)}return L}}};var H=function(I){return function(){var J=null,M=[];if(arguments.length>1){J=Array.prototype.slice.call(arguments)}else{if(arguments[0] instanceof Array){J=arguments[0]}}if(J){for(var L=0,K=J.shift();L<K.length;L++){J.unshift(K[L]);M.push(I.apply(null,J));J.shift();return M}}else{return I.apply(null,arguments)}}};var G="optional not ignore cache".split(/\s/);for(var D=0;D<G.length;D++){C[G[D]]=H(C[G[D]])}var F=function(I){return function(){if(arguments[0] instanceof Array){return I.apply(null,arguments[0])}else{return I.apply(null,arguments)}}};var E="each any all".split(/\s/);for(var B=0;B<E.length;B++){C[E[B]]=F(C[E[B]])}}());(function(){var F=function(J){var K=[];for(var I=0;I<J.length;I++){if(J[I] instanceof Array){K=K.concat(F(J[I]))}else{if(J[I]){K.push(J[I])}}}return K};Date.Grammar={};Date.Translator={hour:function(I){return function(){this.hour=Number(I)}},minute:function(I){return function(){this.minute=Number(I)}},second:function(I){return function(){this.second=Number(I)}},meridian:function(I){return function(){this.meridian=I.slice(0,1).toLowerCase()}},timezone:function(I){return function(){var J=I.replace(/[^\d\+\-]/g,"");if(J.length){this.timezoneOffset=Number(J)}else{this.timezone=I.toLowerCase()}}},day:function(I){var J=I[0];return function(){this.day=Number(J.match(/\d+/)[0])}},month:function(I){return function(){this.month=((I.length==3)?Date.getMonthNumberFromName(I):(Number(I)-1))}},year:function(I){return function(){var J=Number(I);this.year=((I.length>2)?J:(J+(((J+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)))}},rday:function(I){return function(){switch(I){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break}}},finishExact:function(I){I=(I instanceof Array)?I:[I];var J=new Date();this.year=J.getFullYear();this.month=J.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var K=0;K<I.length;K++){if(I[K]){I[K].call(this)}}this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.")}var L=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){L.set({timezone:this.timezone})}else{if(this.timezoneOffset){L.set({timezoneOffset:this.timezoneOffset})}}return L},finish:function(I){I=(I instanceof Array)?F(I):[I];if(I.length===0){return null}for(var M=0;M<I.length;M++){if(typeof I[M]=="function"){I[M].call(this)}}if(this.now){return new Date()}var J=Date.today();var P=null;var N=!!(this.days!=null||this.orient||this.operator);if(N){var O,L,K;K=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";O=(Date.getDayNumberFromName(this.weekday)-J.getDay());L=7;this.days=O?((O+(K*L))%L):(K*L)}if(this.month){this.unit="month";O=(this.month-J.getMonth());L=12;this.months=O?((O+(K*L))%L):(K*L);this.month=null}if(!this.unit){this.unit="day"}if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1}if(this.unit=="week"){this.unit="day";this.value=this.value*7}this[this.unit+"s"]=this.value*K}return J.add(this)}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour}if(this.weekday&&!this.day){this.day=(J.addDays((Date.getDayNumberFromName(this.weekday)-J.getDay()))).getDate()}if(this.month&&!this.day){this.day=1}return J.set(this)}}};var B=Date.Parsing.Operators,E=Date.Grammar,D=Date.Translator,H;E.datePartDelimiter=B.rtoken(/^([\s\-\.\,\/\x27]+)/);E.timePartDelimiter=B.stoken(":");E.whiteSpace=B.rtoken(/^\s*/);E.generalDelimiter=B.rtoken(/^(([\s\,]|at|on)+)/);var A={};E.ctoken=function(M){var L=A[M];if(!L){var N=Date.CultureInfo.regexPatterns;var K=M.split(/\s+/),J=[];for(var I=0;I<K.length;I++){J.push(B.replace(B.rtoken(N[K[I]]),K[I]))}L=A[M]=B.any.apply(null,J)}return L};E.ctoken2=function(I){return B.rtoken(Date.CultureInfo.regexPatterns[I])};E.h=B.cache(B.process(B.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),D.hour));E.hh=B.cache(B.process(B.rtoken(/^(0[0-9]|1[0-2])/),D.hour));E.H=B.cache(B.process(B.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),D.hour));E.HH=B.cache(B.process(B.rtoken(/^([0-1][0-9]|2[0-3])/),D.hour));E.m=B.cache(B.process(B.rtoken(/^([0-5][0-9]|[0-9])/),D.minute));E.mm=B.cache(B.process(B.rtoken(/^[0-5][0-9]/),D.minute));E.s=B.cache(B.process(B.rtoken(/^([0-5][0-9]|[0-9])/),D.second));E.ss=B.cache(B.process(B.rtoken(/^[0-5][0-9]/),D.second));E.hms=B.cache(B.sequence([E.H,E.mm,E.ss],E.timePartDelimiter));E.t=B.cache(B.process(E.ctoken2("shortMeridian"),D.meridian));E.tt=B.cache(B.process(E.ctoken2("longMeridian"),D.meridian));E.z=B.cache(B.process(B.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),D.timezone));E.zz=B.cache(B.process(B.rtoken(/^(\+|\-)\s*\d\d\d\d/),D.timezone));E.zzz=B.cache(B.process(E.ctoken2("timezone"),D.timezone));E.timeSuffix=B.each(B.ignore(E.whiteSpace),B.set([E.tt,E.zzz]));E.time=B.each(B.optional(B.ignore(B.stoken("T"))),E.hms,E.timeSuffix);E.d=B.cache(B.process(B.each(B.rtoken(/^([0-2]\d|3[0-1]|\d)/),B.optional(E.ctoken2("ordinalSuffix"))),D.day));E.dd=B.cache(B.process(B.each(B.rtoken(/^([0-2]\d|3[0-1])/),B.optional(E.ctoken2("ordinalSuffix"))),D.day));E.ddd=E.dddd=B.cache(B.process(E.ctoken("sun mon tue wed thu fri sat"),function(I){return function(){this.weekday=I}}));E.M=B.cache(B.process(B.rtoken(/^(1[0-2]|0\d|\d)/),D.month));E.MM=B.cache(B.process(B.rtoken(/^(1[0-2]|0\d)/),D.month));E.MMM=E.MMMM=B.cache(B.process(E.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),D.month));E.y=B.cache(B.process(B.rtoken(/^(\d\d?)/),D.year));E.yy=B.cache(B.process(B.rtoken(/^(\d\d)/),D.year));E.yyy=B.cache(B.process(B.rtoken(/^(\d\d?\d?\d?)/),D.year));E.yyyy=B.cache(B.process(B.rtoken(/^(\d\d\d\d)/),D.year));H=function(){return B.each(B.any.apply(null,arguments),B.not(E.ctoken2("timeContext")))};E.day=H(E.d,E.dd);E.month=H(E.M,E.MMM);E.year=H(E.yyyy,E.yy);E.orientation=B.process(E.ctoken("past future"),function(I){return function(){this.orient=I}});E.operator=B.process(E.ctoken("add subtract"),function(I){return function(){this.operator=I}});E.rday=B.process(E.ctoken("yesterday tomorrow today now"),D.rday);E.unit=B.process(E.ctoken("minute hour day week month year"),function(I){return function(){this.unit=I}});E.value=B.process(B.rtoken(/^\d\d?(st|nd|rd|th)?/),function(I){return function(){this.value=I.replace(/\D/g,"")}});E.expression=B.set([E.rday,E.operator,E.value,E.unit,E.orientation,E.ddd,E.MMM]);H=function(){return B.set(arguments,E.datePartDelimiter)};E.mdy=H(E.ddd,E.month,E.day,E.year);E.ymd=H(E.ddd,E.year,E.month,E.day);E.dmy=H(E.ddd,E.day,E.month,E.year);E.date=function(I){return((E[Date.CultureInfo.dateElementOrder]||E.mdy).call(this,I))};E.format=B.process(B.many(B.any(B.process(B.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(I){if(E[I]){return E[I]}else{throw Date.Parsing.Exception(I)}}),B.process(B.rtoken(/^[^dMyhHmstz]+/),function(I){return B.ignore(B.stoken(I))}))),function(I){return B.process(B.each.apply(null,I),D.finishExact)});var G={};var C=function(I){return G[I]=(G[I]||E.format(I)[0])};E.formats=function(J){if(J instanceof Array){var K=[];for(var I=0;I<J.length;I++){K.push(C(J[I]))}return B.any.apply(null,K)}else{return C(J)}};E._formats=E.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);E._start=B.process(B.set([E.date,E.time,E.expression],E.generalDelimiter,E.whiteSpace),D.finish);E.start=function(I){try{var J=E._formats.call({},I);if(J[1].length===0){return J}}catch(K){}return E._start.call({},I)}}());Date._parse=Date.parse;Date.parse=function(A){var B=null;if(!A){return null}try{B=Date.Grammar.start.call({},A)}catch(C){return null}return((B[1].length===0)?B[0]:null)};Date.getParseFunction=function(B){var A=Date.Grammar.formats(B);return function(C){var D=null;try{D=A.call({},C)}catch(E){return null}return((D[1].length===0)?D[0]:null)}};Date.parseExact=function(A,B){return Date.getParseFunction(B)(A)};function getYouTubeIdFromUrl(A){return A.substr(A.indexOf("=")+1)}function formatMinutes(B){try{if(isNaN(B)){return""}if(B<0){return"0:00"}var D=Math.floor(B/3600);var E=Math.floor((B-(D*3600))/60);var A=Math.round(B-(D*3600)-(E*60));var C=A+"s";if(E>0){C=E+"m "+C}if(D>0){C=D+"h "+C}return C}catch(F){publishException(F)}}function zerofill(B,A){try{while(B.length<A){B="0"+B}return B}catch(C){publishException(C)}}function arrayToUL(A){try{var C="<ul>";for(var B=0;B<A.length;B++){C+="<li>"+A[B]+"</li>"}C+="</ul>";return C}catch(D){throw D}}function displayMessages(E,B){try{var C="";for(var A=0;A<E.length;A++){C+=E[A]+"\n"}$("#"+B).hide();$("#"+B).html(C);$("#"+B).show("slow")}catch(D){publishException(D)}}function clearMessages(A){try{$("#"+A).empty();$("#"+A).hide()}catch(B){publishException(B)}}function createCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function eraseCookie(A){createCookie(A,"",-1)}function isUserLoggedIn(){return bUserLoggedIn}function formatYoutubeSearchUrl(B,C){try{var A=((C*SEARCH_RESULTS_COUNT)-SEARCH_RESULTS_COUNT)+1;return YOUTUBE_SEARCH_URL+B.urlEncode()+"&format=5&start-index="+A+"&max-results="+(SEARCH_RESULTS_COUNT+1)+"&alt=json-in-script&callback=?"}catch(D){publishException(D)}}function isValidUsername(A){try{var B=/^[A-Za-z0-9_]{1}[A-Za-z0-9_\s]{6,13}[A-Za-z0-9_]{1}$/;if(A.trim().match(B)==null){return false}else{return true}}catch(C){publishException(C)}}function isValidPassword(A){try{var B=/^[A-Za-z0-9@#$%^&+=_]{6,15}$/;if(A.trim().match(B)==null){return false}else{return true}}catch(C){publishException(C)}}function isValidEmailAddress(B){try{var R=/^(.+)@(.+)$/;var P='\\(\\)<>@,;:\\\\\\"\\.\\[\\]';var J="[^\\s"+P+"]";var D='("[^"]*")';var Q=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;var A=J+"+";var N="("+A+"|"+D+")";var K=new RegExp("^"+N+"(\\."+N+")*$");var F=new RegExp("^"+A+"(\\."+A+")*$");var C=B.match(R);if(C==null){return false}var S=C[1];var T=C[2];if(S.match(K)==null){return false}var I=T.match(Q);if(I!=null){for(var L=1;L<=4;L++){if(I[L]>255){return false}}return true}var G=T.match(F);if(G==null){return false}var H=new RegExp(A,"g");var E=T.match(H);var M=E.length;if(E[E.length-1].length<2||E[E.length-1].length>3){return false}if(M<2){return false}return true}catch(O){publishException(O)}}function getPasswordStrength(E){try{var B=0;var A=5;var C=8;E=E.trim();if(E==""){return -1}if(E.length<A){return 0}else{if(E.length<C){B=1}else{B=2}}if(/[0-9]{1}/.test(E)&&/[A-Za-z]{1}/.test(E)){B++}if(/\W{1}/.test(E)){B++}if(/[a-z]{1}/.test(E)&&/[A-Z]{1}/.test(E)){B++}return B}catch(D){publishException(D)}}function isValidURL(C){try{return true;var B=/^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){0,1}([\w]+)(.[\w]+){1,2}(\?[\w]*)?$/;return B.test(C)}catch(A){publishException(A)}}function sha1Hash(C){var F=[1518500249,1859775393,2400959708,3395469782];C+=String.fromCharCode(128);var Q=Math.ceil(C.length/4)+2;var D=Math.ceil(Q/16);var E=new Array(D);for(var S=0;S<D;S++){E[S]=new Array(16);for(var R=0;R<16;R++){E[S][R]=(C.charCodeAt(S*64+R*4)<<24)|(C.charCodeAt(S*64+R*4+1)<<16)|(C.charCodeAt(S*64+R*4+2)<<8)|(C.charCodeAt(S*64+R*4+3))}}E[D-1][14]=((C.length-1)*8)/Math.pow(2,32);E[D-1][14]=Math.floor(E[D-1][14]);E[D-1][15]=((C.length-1)*8)&4294967295;var L=1732584193;var J=4023233417;var I=2562383102;var H=271733878;var G=3285377520;var A=new Array(80);var Z,Y,X,V,U;for(var S=0;S<D;S++){for(var O=0;O<16;O++){A[O]=E[S][O]}for(var O=16;O<80;O++){A[O]=ROTL(A[O-3]^A[O-8]^A[O-14]^A[O-16],1)}Z=L;Y=J;X=I;V=H;U=G;for(var O=0;O<80;O++){var P=Math.floor(O/20);var B=(ROTL(Z,5)+f(P,Y,X,V)+U+F[P]+A[O])&4294967295;U=V;V=X;X=ROTL(Y,30);Y=Z;Z=B}L=(L+Z)&4294967295;J=(J+Y)&4294967295;I=(I+X)&4294967295;H=(H+V)&4294967295;G=(G+U)&4294967295}return L.toHexStr()+J.toHexStr()+I.toHexStr()+H.toHexStr()+G.toHexStr()}function f(B,A,D,C){switch(B){case 0:return(A&D)^(~A&C);case 1:return A^D^C;case 2:return(A&D)^(A&C)^(D&C);case 3:return A^D^C}}function ROTL(A,B){return(A<<B)|(A>>>(32-B))}Number.prototype.toHexStr=function(){var C="",A;for(var B=7;B>=0;B--){A=(this>>>(B*4))&15;C+=A.toString(16)}return C};var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(A){this.initSWFUpload(A)}}SWFUpload.prototype.initSWFUpload=function(B){try{this.customSettings={};this.settings=B;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(A){delete SWFUpload.instances[this.movieName];throw A}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 Beta 3";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(B,A){this.settings[B]=(this.settings[B]==undefined)?A:this.settings[B]};this.ensureDefault("upload_url","");this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+"?swfuploadrnd="+Math.floor(Math.random()*999999999)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){if(this.settings.button_placeholder_id!==""){this.replaceWithFlash()}else{this.appendFlash()}};SWFUpload.prototype.appendFlash=function(){var B,A;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}B=document.getElementsByTagName("body")[0];if(B==undefined){throw"Could not find the 'body' element."}A=document.createElement("div");A.style.width="1px";A.style.height="1px";A.style.overflow="hidden";B.appendChild(A);A.innerHTML=this.getFlashHTML();if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.replaceWithFlash=function(){var A,B;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}A=document.getElementById(this.settings.button_placeholder_id);if(A==undefined){throw"Could not find the placeholder element."}B=document.createElement("div");B.innerHTML=this.getFlashHTML();A.parentNode.replaceChild(B.firstChild,A);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var B=this.buildParamString();var A=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(A),"&amp;params=",encodeURIComponent(B),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var C=this.settings.post_params;var B=[];if(typeof (C)==="object"){for(var A in C){if(C.hasOwnProperty(A)){B.push(encodeURIComponent(A.toString())+"="+encodeURIComponent(C[A].toString()))}}}return B.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var A=null;A=this.getMovieElement();if(A){for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(D){}}try{A.parentNode.removeChild(A)}catch(B){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(D){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(B,C,A){if(C==undefined){return(this.settings[B]=A)}else{return(this.settings[B]=C)}};SWFUpload.prototype.getSetting=function(A){if(this.settings[A]!=undefined){return this.settings[A]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(A){this.callFlash("StartUpload",[A])};SWFUpload.prototype.cancelUpload=function(A,B){if(B!==false){B=true}this.callFlash("CancelUpload",[A,B])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(A){this.callFlash("SetStats",[A])};SWFUpload.prototype.getFile=function(A){if(typeof (A)==="number"){return this.callFlash("GetFileByIndex",[A])}else{return this.callFlash("GetFile",[A])}};SWFUpload.prototype.addFileParam=function(A,B,C){return this.callFlash("AddFileParam",[A,B,C])};SWFUpload.prototype.removeFileParam=function(A,B){this.callFlash("RemoveFileParam",[A,B])};SWFUpload.prototype.setUploadURL=function(A){this.settings.upload_url=A.toString();this.callFlash("SetUploadURL",[A])};SWFUpload.prototype.setPostParams=function(A){this.settings.post_params=A;this.callFlash("SetPostParams",[A])};SWFUpload.prototype.addPostParam=function(A,B){this.settings.post_params[A]=B;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(A){delete this.settings.post_params[A];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(A,B){this.settings.file_types=A;this.settings.file_types_description=B;this.callFlash("SetFileTypes",[A,B])};SWFUpload.prototype.setFileSizeLimit=function(A){this.settings.file_size_limit=A;this.callFlash("SetFileSizeLimit",[A])};SWFUpload.prototype.setFileUploadLimit=function(A){this.settings.file_upload_limit=A;this.callFlash("SetFileUploadLimit",[A])};SWFUpload.prototype.setFileQueueLimit=function(A){this.settings.file_queue_limit=A;this.callFlash("SetFileQueueLimit",[A])};SWFUpload.prototype.setFilePostName=function(A){this.settings.file_post_name=A;this.callFlash("SetFilePostName",[A])};SWFUpload.prototype.setUseQueryString=function(A){this.settings.use_query_string=A;this.callFlash("SetUseQueryString",[A])};SWFUpload.prototype.setRequeueOnError=function(A){this.settings.requeue_on_error=A;this.callFlash("SetRequeueOnError",[A])};SWFUpload.prototype.setHTTPSuccess=function(A){if(typeof A==="string"){A=A.replace(" ","").split(",")}this.settings.http_success=A;this.callFlash("SetHTTPSuccess",[A])};SWFUpload.prototype.setDebugEnabled=function(A){this.settings.debug_enabled=A;this.callFlash("SetDebugEnabled",[A])};SWFUpload.prototype.setButtonImageURL=function(A){if(A==undefined){A=""}this.settings.button_image_url=A;this.callFlash("SetButtonImageURL",[A])};SWFUpload.prototype.setButtonDimensions=function(C,A){this.settings.button_width=C;this.settings.button_height=A;var B=this.getMovieElement();if(B!=undefined){B.style.width=C+"px";B.style.height=A+"px"}this.callFlash("SetButtonDimensions",[C,A])};SWFUpload.prototype.setButtonText=function(A){this.settings.button_text=A;this.callFlash("SetButtonText",[A])};SWFUpload.prototype.setButtonTextPadding=function(B,A){this.settings.button_text_top_padding=A;this.settings.button_text_left_padding=B;this.callFlash("SetButtonTextPadding",[B,A])};SWFUpload.prototype.setButtonTextStyle=function(A){this.settings.button_text_style=A;this.callFlash("SetButtonTextStyle",[A])};SWFUpload.prototype.setButtonDisabled=function(A){this.settings.button_disabled=A;this.callFlash("SetButtonDisabled",[A])};SWFUpload.prototype.setButtonAction=function(A){this.settings.button_action=A;this.callFlash("SetButtonAction",[A])};SWFUpload.prototype.setButtonCursor=function(A){this.settings.button_cursor=A;this.callFlash("SetButtonCursor",[A])};SWFUpload.prototype.queueEvent=function(B,C){if(C==undefined){C=[]}else{if(!(C instanceof Array)){C=[C]}}var A=this;if(typeof this.settings[B]==="function"){this.eventQueue.push(function(){this.settings[B].apply(this,C)});setTimeout(function(){A.executeNextEvent()},0)}else{if(this.settings[B]!==null){throw"Event handler "+B+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var A=this.eventQueue?this.eventQueue.shift():null;if(typeof (A)==="function"){A.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(C){var E=/[$]([0-9a-f]{4})/i;var F={};var D;if(C!=undefined){for(var A in C.post){if(C.post.hasOwnProperty(A)){D=A;var B;while((B=E.exec(D))!==null){D=D.replace(B[0],String.fromCharCode(parseInt("0x"+B[1],16)))}F[D]=C.post[A]}}C.post=F}return C};SWFUpload.prototype.flashReady=function(){var A=this.getMovieElement();if(typeof (A.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(B){}}}this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("file_queued_handler",A)};SWFUpload.prototype.fileQueueError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("file_queue_error_handler",[A,C,B])};SWFUpload.prototype.fileDialogComplete=function(A,B){this.queueEvent("file_dialog_complete_handler",[A,B])};SWFUpload.prototype.uploadStart=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("return_upload_start_handler",A)};SWFUpload.prototype.returnUploadStart=function(A){var B;if(typeof this.settings.upload_start_handler==="function"){A=this.unescapeFilePostParams(A);B=this.settings.upload_start_handler.call(this,A)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(B===undefined){B=true}B=!!B;this.callFlash("ReturnUploadStart",[B])};SWFUpload.prototype.uploadProgress=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_progress_handler",[A,C,B])};SWFUpload.prototype.uploadError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_error_handler",[A,C,B])};SWFUpload.prototype.uploadSuccess=function(B,A){B=this.unescapeFilePostParams(B);this.queueEvent("upload_success_handler",[B,A])};SWFUpload.prototype.uploadComplete=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("upload_complete_handler",A)};SWFUpload.prototype.debug=function(A){this.queueEvent("debug_handler",A)};SWFUpload.prototype.debugMessage=function(C){if(this.settings.debug){var A,D=[];if(typeof C==="object"&&typeof C.name==="string"&&typeof C.message==="string"){for(var B in C){if(C.hasOwnProperty(B)){D.push(B+": "+C[B])}}A=D.join("\n")||"";D=A.split("\n");A="EXCEPTION: "+D.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(A)}else{SWFUpload.Console.writeLine(C)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(D){var B,A;try{B=document.getElementById("SWFUpload_Console");if(!B){A=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(A);B=document.createElement("textarea");B.id="SWFUpload_Console";B.style.fontFamily="monospace";B.setAttribute("wrap","off");B.wrap="off";B.style.overflow="auto";B.style.width="700px";B.style.height="350px";B.style.margin="5px";A.appendChild(B)}B.value+=D+"\n";B.scrollTop=B.scrollHeight-B.clientHeight}catch(C){alert("Exception: "+C.name+" Message: "+C.message)}};function FileProgress(C,A){this.fileProgressID=C.id;this.opacity=100;this.height=0;this.fileProgressWrapper=document.getElementById(this.fileProgressID);if(!this.fileProgressWrapper){this.fileProgressWrapper=document.createElement("div");this.fileProgressWrapper.className="progressWrapper";this.fileProgressWrapper.id=this.fileProgressID;this.fileProgressElement=document.createElement("div");this.fileProgressElement.className="progressContainer";var F=document.createElement("a");F.className="progressCancel";F.href="#";F.style.visibility="hidden";F.appendChild(document.createTextNode(" "));var B=document.createElement("div");B.className="progressName";B.appendChild(document.createTextNode(C.name));var E=document.createElement("div");E.className="progressBarInProgress";var D=document.createElement("div");D.className="progressBarStatus";D.innerHTML="&nbsp;";this.fileProgressElement.appendChild(F);this.fileProgressElement.appendChild(B);this.fileProgressElement.appendChild(D);this.fileProgressElement.appendChild(E);this.fileProgressWrapper.appendChild(this.fileProgressElement);document.getElementById(A).appendChild(this.fileProgressWrapper)}else{this.fileProgressElement=this.fileProgressWrapper.firstChild}this.height=this.fileProgressWrapper.offsetHeight}FileProgress.prototype.setProgress=function(A){this.fileProgressElement.className="progressContainer green";this.fileProgressElement.childNodes[3].className="progressBarInProgress";this.fileProgressElement.childNodes[3].style.width=A+"%"};FileProgress.prototype.setComplete=function(){this.fileProgressElement.className="progressContainer blue";this.fileProgressElement.childNodes[3].className="progressBarComplete";this.fileProgressElement.childNodes[3].style.width="";var A=this;setTimeout(function(){A.disappear()},10000)};FileProgress.prototype.setError=function(){this.fileProgressElement.className="progressContainer red";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var A=this;setTimeout(function(){A.disappear()},5000)};FileProgress.prototype.setCancelled=function(){this.fileProgressElement.className="progressContainer";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var A=this;setTimeout(function(){A.disappear()},2000)};FileProgress.prototype.setStatus=function(A){this.fileProgressElement.childNodes[2].innerHTML=A};FileProgress.prototype.toggleCancel=function(B,C){this.fileProgressElement.childNodes[0].style.visibility=B?"visible":"hidden";if(C){var A=this.fileProgressID;this.fileProgressElement.childNodes[0].onclick=function(){C.cancelUpload(A);return false}}};FileProgress.prototype.disappear=function(){var E=15;var C=4;var B=30;if(this.opacity>0){this.opacity-=E;if(this.opacity<0){this.opacity=0}if(this.fileProgressWrapper.filters){try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=this.opacity}catch(D){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+this.opacity+")"}}else{this.fileProgressWrapper.style.opacity=this.opacity/100}}if(this.height>0){this.height-=C;if(this.height<0){this.height=0}this.fileProgressWrapper.style.height=this.height+"px"}if(this.height>0||this.opacity>0){var A=this;setTimeout(function(){A.disappear()},B)}else{this.fileProgressWrapper.style.display="none"}};var SWFUpload;if(typeof (SWFUpload)==="function"){SWFUpload.queue={};SWFUpload.prototype.initSettings=(function(A){return function(){if(typeof (A)==="function"){A.call(this)}this.customSettings.queue_cancelled_flag=false;this.customSettings.queue_upload_count=0;this.settings.user_upload_complete_handler=this.settings.upload_complete_handler;this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler;this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}})(SWFUpload.prototype.initSettings);SWFUpload.prototype.startUpload=function(A){this.customSettings.queue_cancelled_flag=false;this.callFlash("StartUpload",false,[A])};SWFUpload.prototype.cancelQueue=function(){this.customSettings.queue_cancelled_flag=true;this.stopUpload();var A=this.getStats();while(A.files_queued>0){this.cancelUpload();A=this.getStats()}};SWFUpload.queue.uploadCompleteHandler=function(B){var C=this.settings.user_upload_complete_handler;var D;if(B.filestatus===SWFUpload.FILE_STATUS.COMPLETE){this.customSettings.queue_upload_count++}if(typeof (C)==="function"){D=(C.call(this,B)===false)?false:true}else{D=true}if(D){var A=this.getStats();if(A.files_queued>0&&this.customSettings.queue_cancelled_flag===false){this.startUpload()}else{if(this.customSettings.queue_cancelled_flag===false){this.queueEvent("queue_complete_handler",[this.customSettings.queue_upload_count]);this.customSettings.queue_upload_count=0}else{this.customSettings.queue_cancelled_flag=false;this.customSettings.queue_upload_count=0}}}}}function fileQueued(C){try{var A=new FileProgress(C,this.customSettings.progressTarget);A.setStatus("Pending...");A.toggleCancel(true,this)}catch(B){this.debug(B)}}function fileQueueError(C,E,D){try{if(E===SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){alert("You have attempted to queue too many files.\n"+(D===0?"You have reached the upload limit.":"You may select "+(D>1?"up to "+D+" files.":"one file.")));return }var A=new FileProgress(C,this.customSettings.progressTarget);A.setError();A.toggleCancel(false);switch(E){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:A.setStatus("File is too big.");this.debug("Error Code: File too big, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:A.setStatus("Cannot upload Zero Byte files.");this.debug("Error Code: Zero byte file, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:A.setStatus("Invalid File Type.");this.debug("Error Code: Invalid File Type, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;default:if(C!==null){A.setStatus("Unhandled Error")}this.debug("Error Code: "+E+", File name: "+C.name+", File size: "+C.size+", Message: "+D);break}}catch(B){this.debug(B)}}function fileDialogComplete(A,C){try{if(A>0){}this.startUpload()}catch(B){this.debug(B)}}function uploadStart(C){try{var A=new FileProgress(C,this.customSettings.progressTarget);A.setStatus("Uploading...");A.toggleCancel(true,this)}catch(B){}return true}function uploadProgress(C,F,E){try{var D=Math.ceil((F/E)*100);var A=new FileProgress(C,this.customSettings.progressTarget);A.setProgress(D);A.setStatus("Uploading...")}catch(B){this.debug(B)}}function uploadSuccess(D,B){try{var A=new FileProgress(D,this.customSettings.progressTarget);A.setComplete();A.setStatus("Complete.");A.toggleCancel(false)}catch(C){this.debug(C)}}function uploadError(C,E,D){try{var A=new FileProgress(C,this.customSettings.progressTarget);A.setError();A.toggleCancel(false);switch(E){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:A.setStatus("Upload Error: "+D);this.debug("Error Code: HTTP Error, File name: "+C.name+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:A.setStatus("Upload Failed.");this.debug("Error Code: Upload Failed, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:A.setStatus("Server (IO) Error");this.debug("Error Code: IO Error, File name: "+C.name+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:A.setStatus("Security Error");this.debug("Error Code: Security Error, File name: "+C.name+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:A.setStatus("Upload limit exceeded.");this.debug("Error Code: Upload Limit Exceeded, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:A.setStatus("Failed Validation.  Upload skipped.");this.debug("Error Code: File Validation Failed, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:if(this.getStats().files_queued===0){}A.setStatus("Cancelled");A.setCancelled();break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:A.setStatus("Stopped");break;default:A.setStatus("Unhandled Error: "+E);this.debug("Error Code: "+E+", File name: "+C.name+", File size: "+C.size+", Message: "+D);break}}catch(B){this.debug(B)}}function uploadComplete(A){if(this.getStats().files_queued===0){}}function queueComplete(B){var A=document.getElementById("divStatus");A.innerHTML=B+" file"+(B===1?"":"s")+" uploaded."}function swfUploadPreLoad(){alert("preload.")}function swfUploadLoadFailed(){alert("upload failed.")}var humanMsg={setup:function(B,A,C){humanMsg.msgID="humanMsg";humanMsg.logID="humanMsgLog";if(B==undefined){B="body"}if(A==undefined){A="Message Log"}humanMsg.msgOpacity=0.8;if(C!=undefined){humanMsg.msgOpacity=parseFloat(C)}jQuery(B).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><p></p><div class="round"></div></div> <div id="'+humanMsg.logID+'"><p>'+A+"</p><ul></ul></div>");jQuery("#"+humanMsg.logID+" p").click(function(){jQuery(this).siblings("ul").slideToggle()})},displayMsg:function(A){if(A==""){return }clearTimeout(humanMsg.t2);jQuery("#"+humanMsg.msgID+" p").html(A);jQuery("#"+humanMsg.msgID+"").show().animate({opacity:humanMsg.msgOpacity},200,function(){jQuery("#"+humanMsg.logID).show().children("ul").prepend("<li>"+A+"</li>").children("li:first").slideDown(200);if(jQuery("#"+humanMsg.logID+" ul").css("display")=="none"){}});humanMsg.t1=setTimeout("humanMsg.bindEvents()",700);humanMsg.t2=setTimeout("humanMsg.removeMsg()",5000)},bindEvents:function(){jQuery(window).mousemove(humanMsg.removeMsg).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},removeMsg:function(){jQuery(window).unbind("mousemove",humanMsg.removeMsg).unbind("click",humanMsg.removeMsg).unbind("keypress",humanMsg.removeMsg);if(jQuery("#"+humanMsg.msgID).css("opacity")==humanMsg.msgOpacity){jQuery("#"+humanMsg.msgID).animate({opacity:0},500,function(){jQuery(this).hide()})}}};jQuery(document).ready(function(){humanMsg.setup()});jQuery.imgAreaSelect=function(I,Z){var n=jQuery("<div></div>"),o=jQuery("<div></div>"),m=jQuery("<div></div>"),e=jQuery("<div></div>"),p=jQuery("<div></div>"),l=jQuery("<div></div>"),h=jQuery("<div></div>"),u,W,B,S=0,O=false,C,Y,X,J,G,b=10,U=[],E=0,N=1,s,a,R,Q,v,t,j,g,P={x1:0,y1:0,x2:0,y2:0,width:0,height:0};var M=n.add(o).add(m);var D=e.add(p).add(l).add(h);function c(){M.css({left:(P.x1+u.left)+"px",top:(P.y1+u.top)+"px",width:Math.max(P.width-Z.borderWidth*2,0)+"px",height:Math.max(P.height-Z.borderWidth*2,0)+"px"});e.css({left:u.left+"px",top:u.top+"px",width:P.x1+"px",height:B+"px"});p.css({left:u.left+P.x1+"px",top:u.top+"px",width:P.width+"px",height:P.y1+"px"});l.css({left:u.left+P.x2+"px",top:u.top+"px",width:W-P.x2+"px",height:B+"px"});h.css({left:u.left+P.x1+"px",top:u.top+P.y2+"px",width:P.width+"px",height:B-P.y2+"px"})}function T(H){j=H.pageX-P.x1-u.left;g=H.pageY-P.y1-u.top;U=[];if(Z.resizable){if(g<=b){U[E]="n"}else{if(g>=P.height-b){U[E]="s"}}if(j<=b){U[N]="w"}else{if(j>=P.width-b){U[N]="e"}}}m.css("cursor",U.length?U.join("")+"-resize":Z.movable?"move":"")}function L(H){if(H.which!=1){return false}if(Z.resizable&&U.length>0){jQuery("body").css("cursor",U.join("")+"-resize");R=(U[N]=="w"?P.x2:P.x1)+u.left;v=(U[E]=="n"?P.y2:P.y1)+u.top;jQuery(document).mousemove(k);m.unbind("mousemove",T);jQuery(document).one("mouseup",function(){U=[];jQuery("body").css("cursor","");if(Z.autoHide){M.add(D).hide()}Z.onSelectEnd(I,P);jQuery(document).unbind("mousemove",k);m.mousemove(T)})}else{if(Z.movable){J=P.x1+u.left;G=P.y1+u.top;Y=H.pageX;X=H.pageY;jQuery(document).mousemove(A).one("mouseup",function(){Z.onSelectEnd(I,P);jQuery(document).unbind("mousemove",A)})}else{jQuery(I).mousedown(H)}}return false}function K(){Q=Math.max(u.left,Math.min(u.left+W,R+Math.abs(t-v)*a*(Q>R?1:-1)));t=Math.round(Math.max(u.top,Math.min(u.top+B,v+Math.abs(Q-R)/a*(t>v?1:-1))));Q=Math.round(Q)}function q(){t=Math.max(u.top,Math.min(u.top+B,v+Math.abs(Q-R)/a*(t>v?1:-1)));Q=Math.round(Math.max(u.left,Math.min(u.left+W,R+Math.abs(t-v)*a*(Q>R?1:-1))));t=Math.round(t)}function k(H){Q=!U.length||U[N]||a?H.pageX:P.x2+u.left;t=!U.length||U[E]||a?H.pageY:P.y2+u.top;if(Z.minWidth&&Math.abs(Q-R)<Z.minWidth){Q=R-Z.minWidth*(Q<R?1:-1);if(Q<u.left){R=u.left+Z.minWidth}else{if(Q>u.left+W){R=u.left+W-Z.minWidth}}}if(Z.minHeight&&Math.abs(t-v)<Z.minHeight){t=v-Z.minHeight*(t<v?1:-1);if(t<u.top){v=u.top+Z.minHeight}else{if(t>u.top+B){v=u.top+B-Z.minHeight}}}Q=Math.max(u.left,Math.min(Q,u.left+W));t=Math.max(u.top,Math.min(t,u.top+B));if(a){if(Math.abs(Q-R)/a>Math.abs(t-v)){q()}else{K()}}if(Z.maxWidth&&Math.abs(Q-R)>Z.maxWidth){Q=R-Z.maxWidth*(Q<R?1:-1);if(a){q()}}if(Z.maxHeight&&Math.abs(t-v)>Z.maxHeight){t=v-Z.maxHeight*(t<v?1:-1);if(a){K()}}P.x1=Math.min(R,Q)-u.left;P.x2=Math.max(R,Q)-u.left;P.y1=Math.min(v,t)-u.top;P.y2=Math.max(v,t)-u.top;P.width=Math.abs(Q-R);P.height=Math.abs(t-v);c();Z.onSelectChange(I,P);return false}function A(H){R=Math.max(u.left,Math.min(J+H.pageX-Y,u.left+W-P.width));v=Math.max(u.top,Math.min(G+H.pageY-X,u.top+B-P.height));Q=R+P.width;t=v+P.height;P.x1=R-u.left;P.y1=v-u.top;P.x2=Q-u.left;P.y2=t-u.top;c();Z.onSelectChange(I,P);H.preventDefault();return false}function F(H){if(H.which!=1){return false}Y=R=H.pageX;X=v=H.pageY;P.x1=P.x2=R-u.left;P.y1=P.y2=v-u.top;P.width=0;P.height=0;U=[];c();M.add(D).show();jQuery(document).mousemove(k);m.unbind("mousemove",T);Z.onSelectStart(I,P);jQuery(document).one("mouseup",function(){if(Z.autoHide){M.add(D).hide()}Z.onSelectEnd(I,P);jQuery(document).unbind("mousemove",k);m.mousemove(T)});return false}this.setOptions=function(H){Z=jQuery.extend(Z,H);if(H.x1!=null){P.x1=H.x1;P.y1=H.y1;P.x2=H.x2;P.y2=H.y2;H.show=true}W=jQuery(I).width();B=jQuery(I).height();u=jQuery(I).offset();C=jQuery(I);while(C.length&&!C.is("body")){if(!isNaN(C.css("z-index"))&&C.css("z-index")>S){S=C.css("z-index")}if(C.css("position")=="fixed"){O=true}C=C.parent()}R=P.x1+u.left;v=P.y1+u.top;Q=P.x2+u.left;t=P.y2+u.top;P.width=Q-R;P.height=t-v;c();if(H.hide){M.add(D).hide()}else{if(H.show){M.add(D).show()}}M.css({borderWidth:Z.borderWidth+"px"});n.css({backgroundColor:Z.selectionColor,opacity:Z.selectionOpacity});o.css({borderStyle:"solid",borderColor:Z.borderColor1});m.css({borderStyle:"dashed",borderColor:Z.borderColor2});D.css({opacity:Z.outerOpacity,backgroundColor:Z.outerColor});a=Z.aspectRatio&&(s=Z.aspectRatio.split(/:/))?s[0]/s[1]:null;if(Z.disable||Z.enable===false){M.unbind("mousemove",T).unbind("mousedown",L);jQuery(I).add(D).unbind("mousedown",F)}else{if(Z.enable||Z.disable===false){if(Z.resizable||Z.movable){M.mousemove(T).mousedown(L)}jQuery(I).add(D).mousedown(F)}}Z.enable=Z.disable=undefined};if(jQuery.browser.msie){jQuery(I).attr("unselectable","on")}M.add(D).css({display:"none",position:O?"fixed":"absolute",overflow:"hidden",zIndex:S>0?S:null});n.css({borderStyle:"solid"});jQuery("body").append(D.add(M));initOptions={borderColor1:"#000",borderColor2:"#fff",borderWidth:1,movable:true,resizable:true,selectionColor:"#fff",selectionOpacity:0.2,outerColor:"#000",outerOpacity:0.2,onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}};Z=jQuery.extend(initOptions,Z);this.setOptions(Z)};jQuery.fn.imgAreaSelect=function(A){A=A||{};this.each(function(){if(jQuery(this).data("imgAreaSelect")){jQuery(this).data("imgAreaSelect").setOptions(A)}else{if(A.enable===undefined&&A.disable===undefined){A.enable=true}jQuery(this).data("imgAreaSelect",new jQuery.imgAreaSelect(this,A))}});return this};var mdlPlaylist=Class.extend({bIsDirty:false,bIsNew:true,iId:-1,sOwner:"",sName:"",sThumbnailUrl:"",iDuration:null,sDescription:"",sKeywords:"",aPlaylistItems:new Array(),bIsPublic:false,bPublishedToFacebook:false,getUrl:function(){try{return(ROOT_URL+"/"+readCookie("username").toLowerCase().replaceAll(/[^0-9A-Za-z_]/i,"_")+"/"+this.sName.toLowerCase().replaceAll(/[^0-9A-Za-z_]/i,"_")+"/"+this.iId+"/").replace("%20","_")}catch(A){publishException(A)}},getRelativeUrl:function(){try{return("/"+readCookie("username").toLowerCase().replaceAll(/[^0-9A-Za-z_]/i,"_")+"/"+this.sName.toLowerCase().replaceAll(/[^0-9A-Za-z_]/i,"_")+"/"+this.iId+"/").replace("%20","_")}catch(A){publishException(A)}}});var View=Class.extend({aChildren:new Array(),init:function(){this.aChildren=new Array()},addChild:function(A){this.aChildren.push(A)},render:function(){try{var D=this.aChildren.length;for(var B=0,A=D;B<A;++B){this.aChildren[B].render()}}catch(C){publishException(C)}},wireUp:function(){return false}});var Blog=View.extend({sTitle:"",sBody:"",dtDate:"",render:function(){try{var A=$('<div class="blog_post"><h3 class="blog_post_title"></h3><p class="blog_post_body"></p><p class="blog_post_date"></p></div>');$(".blog_post_title",A).html(this.sTitle);$(".blog_post_body",A).html(this.sBody);$(".blog_post_date",A).html(this.dtDate.toString("MMM d, yyyy"));$("#blog_posts").html(A)}catch(B){publishException(B)}},wireUp:function(){try{return false}catch(A){publishException(A)}}});var LoginRegistrationForm=View.extend({render:function(){try{var D=this.aChildren.length;for(var B=0,A=D;B<A;++B){this.aChildren[B].render()}this.wireUp()}catch(C){publishException(C)}},display:function(){try{$("#pwd_registration_password").val("");$("#txt_registration_email_address").val("");$("#txt_registration_username").val("");$("#txt_password_reminder_email_address").val("");$("#login-register-form-container").show();$("#reminder-form-container").hide();oPlayerContainer.hide()}catch(A){publishException(A)}},hide:function(){try{$("#current_content-login_register").hide()}catch(A){publishException(A)}},renderReminderForm:function(){try{$("#login-register-form-container").hide();$("#reminder-form-container").show()}catch(A){publishException(A)}},wireUp:function(){try{$("#cmd_display_password_reminder_form").click(ctlLoginRegistrationForm.displayReminderForm);$("#cmd_submit_registration").click(ctlLoginRegistrationForm.register);$("#cmd_submit_login").click(ctlLoginRegistrationForm.login);$(".cmd_cancel_login_registration").click(ctlLoginRegistrationForm.cancel);$("#cmd_send_password_reminder_email").click(ctlLoginRegistrationForm.sendPasswordReminder)}catch(A){publishException(A)}}});var Navigation=View.extend({render:function(){try{var D=this.aChildren.length;for(var B=0,A=D;B<A;++B){this.aChildren[B].render()}this.wireUp()}catch(C){publishException(C)}},wireUp:function(){try{var C=$("#jooque_browser-nagivation > ul"),B=C.find("a"),A=B.index(B.filter(".selected")[0]);C.tabs();C.tabs("select",iSelectedTab);$("a","#jooque_browser-nagivation > ul > li").eq(iSelectedTab).addClass("selected");C.bind("tabsselect",ctlNavigation.selectTab)}catch(D){publishException(D)}}});var Player=View.extend({MODE_SEARCH:1,MODE_PLAY:2,MODE_SMART:3,currentMode:3,smartState:2,smartTime:0,sYTVideoId:null,iPlaylistIndex:-1,bIsLoaded:false,currentState:"",sAutostart:"false",render:function(){try{var B=($("#identify_youtube_id").val()!="")?"&skin=/flash/test.swf&quality=true&autostart="+this.sAutostart+"&icons=true&file=http://www.youtube.com/watch%3Fv%3D"+$("#identify_youtube_id").val():"";var A=new SWFObject("/flash/player.swf","oSWFPlayer",FLASH_PLAYER_SMALL_WIDTH,FLASH_PLAYER_SMALL_HEIGHT,"9");A.addParam("allowfullscreen","true");A.addParam("allowscriptaccess","always");A.addParam("flashvars",B);A.write("player");this.wireUp();return true}catch(C){publishException(C)}},wireUp:function(){try{$("#cmd_goto_next_video").click(ctlPlaylistItem.gotoNextVideo);$("#cmd_goto_previous_video").click(ctlPlaylistItem.gotoPreviousVideo);return true}catch(A){publishException(A)}}});var Page=View.extend({oTimer:null,bReady:false,render:function(){try{this.oTimer=setInterval(ctlPage.checkTimer,TIMER_INTERVAL);this.bReady=true;if($("#identify_youtube_id").val().length>0){oPlayerIdentify.hide();oPlayerContainer.display()}else{oVideoLargeSearchForm.display()}$("#loading-layer").remove();this.wireUp();return false}catch(A){publishException(A)}},wireUp:function(){try{return false}catch(A){publishException(A)}}});var PasswordResetForm=View.extend({render:function(){try{this.wireUp()}catch(A){publishException(A)}},wireUp:function(){try{$("#cmd_submit_password_reset").click(ctlPasswordResetForm.submit)}catch(A){publishException(A)}}});var Photo=View.extend({iHeight:-1,iWidth:-1,iX:-1,iY:-1,sImageSrc:"",render:function(){try{$("#img_crop_image").attr("src",this.sImageSrc);$("#img_crop_image").load(function(){$("#frm_crop_image").show();$(this).imgAreaSelect({enable:true,aspectRatio:"1:1",show:true,x1:10,y1:10,x2:60,y2:60,borderColor1:"red",onSelectEnd:function(B,C){oPhoto.iHeight=C.height;oPhoto.iWidth=C.width;oPhoto.iX=C.x1;oPhoto.iY=C.y1;return true}});$("#frm_image_upload").hide();$("#cmd_crop_and_save_photo").show()});this.wireup();return false}catch(A){publishException(A)}},wireup:function(){try{$("#cmd_cancel_select_photo").click(ctlPhoto.cancel);$("#cmd_crop_and_save_photo").click(ctlPhoto.update);return false}catch(A){publishException(A)}},reset:function(){try{$("#frm_crop_image").hide();$("#frm_image_upload").show();$("#fsUploadProgress").html("");$("#spanButtonPlaceHolder").html("");$("#divStatus").html("");$("#img_crop_image").attr("src","");$("#img_crop_image").imgAreaSelect({hide:true});return false}catch(A){publishException(A)}}});var PlayerInformation=View.extend({sVideoTitle:"",sPlaylistName:"",sYoutubeId:"",sArtist:"",sSong:"",iVideoDataId:-1,bIsMusic:false,bIsConfirmed:false,iMediaTypeId:-1,init:function(){this.sVideoTitle="";this.sPlaylistName="";this.sYoutubeId="";this.sArtist="";this.sSong="";this.iVideoDataId=-1;this.bIsMusic=false;this.bIsConfirmed=false;this.iMediaTypeId=-1},render:function(){try{$("#current_playlist_name").text(this.sPlaylistName);$("#current_video_title").text(this.sVideoTitle);this.wireUp();return false}catch(A){publishException(A)}},wireUp:function(){try{return false}catch(A){publishException(A)}}});var PlayerPurchase=View.extend({bUnknown:false,render:function(){try{var B=oPlayerInformation.sArtist+", "+oPlayerInformation.sSong;if(this.bUnknown){var A="http://www.amazon.com/gp/search?ie=UTF8&keywords="+B.urlEncode()+"&tag="+AMAZON_CODE+"&index=music&linkCode=ur2&camp=1789&creative=9325"}else{var A="http://www.amazon.com/gp/search?ie=UTF8&keywords="+B.urlEncode()+"&tag="+AMAZON_CODE+"&index=digital-music&linkCode=ur2&camp=1789&creative=9325"}$("#cmd_puchase_amazon").attr("href",A);$("#player_identify").hide();$("#player_purchase").show();this.wireUp();return false}catch(C){publishException(C)}},wireUp:function(){try{return false}catch(A){publishException(A)}},hide:function(){try{$("#player_purchase").hide()}catch(A){publishException(A)}}});var PlayerContainer=View.extend({currentMode:2,smartState:2,MODE_PLAY:1,MODE_SEARCH:2,render:function(){try{var D=this.aChildren.length;for(var B=0,A=D;B<A;++B){this.aChildren[B].render()}$("#search_videos-mode > ul li").removeClass("selected");if(this.currentMode==1){$("#search_videos-mode > ul li").eq(1).addClass("selected")}else{if(this.currentMode==2){$("#search_videos-mode > ul li").eq(0).addClass("selected")}else{$("#search_videos-mode > ul li").eq(2).addClass("selected")}}this.wireUp();return false}catch(C){publishException(C)}},display:function(){try{oVideoLargeSearchForm.hide();$("#current_content-video").removeClass("hidden-left")}catch(A){publishException(A)}},hide:function(){try{$("#current_content-video").addClass("hidden-left")}catch(A){publishException(A)}},wireUp:function(){try{$("#cmd_goto_play_mode").click(ctlPlayerContainer.gotoPlayMode);$("#cmd_goto_search_mode").click(ctlPlayerContainer.gotoSearchMode);return false}catch(A){publishException(A)}}});var PlayerIdentify=View.extend({iStep:1,render:function(){try{if(oPlayerInformation.sYoutubeId.length>0){if(this.iStep==1){$("#player_identify_label").text('Is this "'+oPlayerInformation.sSong.replace("'","'")+'" by '+oPlayerInformation.sArtist.replace("'","'")+"?");$("#player_identify_label").show();$("#player_identify_answer").show();$("#player_identify_suggest").hide()}else{$("#txt_identify_song").val(IDENTIFY_SONG);$("#txt_identify_artist").val(IDENTIFY_ARTIST);$("#player_identify_answer").hide();$("#player_identify_suggest").show()}$("#player_purchase").hide();$("#player_identify").show();this.wireUp()}else{$("#player_identify").hide()}return false}catch(A){publishException(A)}},wireUp:function(){try{$("#cmd_identify_agree").click(ctlPlayerIdentify.confirm);$("#cmd_identify_disagree").click(ctlPlayerIdentify.reject);$(".cmd_identify_cancel").click(ctlPlayerIdentify.unknown);$("#cmd_identify_suggest").click(ctlPlayerIdentify.suggest);$("#txt_identify_song").blur(ctlPlayerIdentify.handleSongBlur);$("#txt_identify_artist").blur(ctlPlayerIdentify.handleArtistBlur);$("#txt_identify_song").focus(ctlPlayerIdentify.handleSongFocus);$("#txt_identify_artist").focus(ctlPlayerIdentify.handleArtistFocus);return false}catch(A){publishException(A)}},hide:function(){try{$("#player_identify").hide()}catch(A){publishException(A)}}});var EditPlaylist=View.extend({oPlaylist:null,iInstructionState:1,render:function(){try{if(this.oPlaylist.sName!=""){$("#txt_playlist_name").val(oPlaylist.sName)}else{$("#txt_playlist_name").val(PLAYLIST_NAME_TEXT)}$("#txt_playlist_description").val(this.oPlaylist.sDescription);$("#txt_playlist_keywords").val(this.oPlaylist.sKeywords);$("#chk_is_public").attr("checked",this.oPlaylist.bIsPublic);$("#ep_playlist").empty();var D=this.oPlaylist.aPlaylistItems.length;if(D>0){for(var B=0,A=D;B<A;++B){var E=new PlaylistItem();E.oPlaylistItem=this.oPlaylist.aPlaylistItems[B];$("#ep_playlist").append(E.render())}}else{$("#ep_playlist").append($(sPlaylistPlaceholderTemplate))}this.updateFacebookStatus();this.update();this.updateVisibility();this.updateInstructions();$("#jooque_browser-nagivation > ul").tabs("select",1);this.wireUp();return }catch(C){publishException(C)}},updateFacebookStatus:function(){try{FB.ensureInit(function(){FB.Connect.ifUserConnected(function(){if(oEditPlaylist.oPlaylist.bIsNew==false&&oEditPlaylist.oPlaylist.bIsPublic==true){$("#chk_publish_to_facebook").attr("checked",false);$("span","#published_to_facebook").text("Publish this playlist to Facebook.");$("#chk_publish_to_facebook").show();$("#published_to_facebook").show()}})})}catch(A){publishException(A)}},updateInstructions:function(){try{if(this.iInstructionState==1){var A="Search YouTube for music, movies, and more!"}else{if(this.iInstructionState==2){var A="Your search returned no results, please try again."}else{if(this.iInstructionState==3){var A="Drag and drop videos onto the playlist on the right."}else{if(this.iInstructionState==4&&!isUserLoggedIn()){var A='Want to save your plalist? <a href="#" class="cmd_display_login_registration_form">Login</a> or <a href="#" class="cmd_display_login_registration_form">Register</a> to get started.'}else{if(this.iInstructionState==4){var A="Give your playlist a name and it will save automatically!"}else{if(this.iInstructionState==5){var A='Your playlist is private. <a href="#" class="cmd_share_playlist">Click here</a> to share it.'}else{if(this.iInstructionState==6){var A="That's all there is! Your playlist is shared with the world."}else{var A="&nbsp;"}}}}}}}$("#edit-instructions").html(A);$(".cmd_display_login_registration_form").click(ctlLoginRegistrationForm.displayLoginRegistrationForm);if(this.iInstructionState==5){$(".cmd_share_playlist","#edit-instructions").click(function(){oEditPlaylist.iInstructionState=6;oEditPlaylist.oPlaylist.bIsPublic=true;oEditPlaylist.oPlaylist.bIsDirty=true;oEditPlaylist.updateVisibility();oEditPlaylist.updateInstructions();oEditPlaylist.update()})}}catch(B){publishException(B)}},update:function(){try{if(this.oPlaylist.bIsNew==true&&(this.oPlaylist.bIsDirty==false||$("#txt_playlist_name").val()==PLAYLIST_NAME_TEXT)){sMessage='<a href="#">Save List</a>';sImgSrc="/img/xhtmlized/led-red.png";$("#ep_controls").hide()}else{$("#ep_controls").show();if(this.oPlaylist.bIsDirty){sMessage="Saving!";sImgSrc="/img/xhtmlized/led-yellow.png"}else{sMessage="Saved";sImgSrc="/img/xhtmlized/led-green.png"}}$("span",".modified_indicator").eq(0).html(sMessage);$("img",".modified_indicator").attr("alt",sMessage);$("img",".modified_indicator").attr("src",sImgSrc)}catch(A){publishException(A)}},updateVisibility:function(){try{var A=$("li.visibility","#ep_controls").eq(0);if(this.oPlaylist.bIsPublic==true){$("span",A).text("Public Playlist");$("img",A).attr("src","/img/xhtmlized/ico-public.png");$("img",A).attr("alt","This is a public playlist")}else{$("span",A).text("Private Playlist");$("img",A).attr("src","/img/xhtmlized/ico-private.png");$("img",A).attr("alt","This is a private playlist")}}catch(B){publishException(B)}},wireUp:function(){try{$("div.play","ul#ep_playlist").click(ctlPlaylistItem.play);$("div.remove","ul#ep_playlist").click(ctlEditPlaylist.handleRemoveItemClick);$("li.video","ul#ep_playlist").hover(function(){$(".overlay").hide();$(".overlay",this).show()},function(){$(".overlay",this).hide()});$("#jooque_browser-search_videos div.section-playlists ul#ep_playlist").sortable({receive:ctlEditPlaylist.handleItemAdded,update:ctlEditPlaylist.handleListSorted});$("#ep_playlist").jScrollPane(jScrollPaneSetup);$("#txt_playlist_name").blur(ctlEditPlaylist.handlePlaylistNameBlur);$("#txt_playlist_name").focus(ctlEditPlaylist.handlePlaylistNameFocus);$("#chk_is_public").click(ctlEditPlaylist.handleIsPublicClick);$("#chk_publish_to_facebook").click(ctlEditPlaylist.handlePublishToFacebookClick);$("#txt_playlist_description").blur(ctlEditPlaylist.handlePlaylistDescriptionBlur);$("#txt_playlist_keywords").blur(ctlEditPlaylist.handlePlaylistKeywordsBlur);$(".cmd_toggle_ep_details").click(ctlEditPlaylist.displayPlaylistDetails);$("#cmd_new_playlist").click(ctlEditPlaylist.newPlaylist)}catch(A){publishException(A)}},moveForward:function(){try{alert("not yet implemented");return false}catch(A){publishException(A)}},getDuration:function(A){try{var D=A.length;var B=0;for(i=0;i<D;i++){B+=parseInt(A[i].oPlaylistItem.duration)}return B}catch(C){publishException(C)}},getDurationFromDOM:function(){try{var B=$(".video_duration_seconds","#playlist_item_container");var D=$(B).length;var A=0;for(i=0;i<D;i++){A+=parseInt($(B[i]).val())}return A}catch(C){publishException(C)}}});var CurrentPlaylist=View.extend({oPlaylist:null,render:function(){try{if(this.oPlaylist.sName!=""){$("#cp_playlist_name").text(this.oPlaylist.sName)}var D=this.aChildren.length;$("#cp_items").empty();for(var B=0,A=D;B<A;++B){$("#cp_items").append(this.aChildren[B].render())}this.wireUp();return }catch(C){publishException(C)}},wireUp:function(){try{$("#section-current_list").jScrollPane(jScrollPaneSetup);$("li","#section-current_list").eq(0).remove();$("div.play","#section-current_list").click(ctlPlaylistItem.play);$("li","#section-current_list").hover(function(){$(".overlay",this).show()},function(){$(".overlay",this).hide()});$("#txt_playlist_url").focus(function(){$(this).select()});$("#current-ratings-widget").each(function(){var C=parseFloat($(".playlist_list_item_rating",$(this)).eq(0).val());var B=Math.round(C);if(!isUserLoggedIn()){$(this).stars({selected:B-1,disabled:true,oneVoteOnly:true,cancelShow:false,callback:ctlPlaylistList.vote})}else{$(this).stars({selected:B-1,oneVoteOnly:true,cancelShow:false,callback:ctlPlaylistList.vote})}});$("#cmd_edit_current_playlist").click(function(){$("#img_ico_edit_playlist").attr("src","/img/loading_16.gif");ctlPlaylistList.loadPlaylist($("#hdn_current_playlist_id").val())})}catch(A){alert(iSelectedIndex);publishException(A)}}});var PlaylistItem=View.extend({oPlaylistItem:null,render:function(){try{if(this.oPlaylistItem){var A=$(sVideoTemplate);$(A).removeClass("template");$(A).addClass("draggable");$(A).attr("id","pli_"+this.oPlaylistItem.youtube_id);$(".title",A).text(this.oPlaylistItem.title);$(".duration",A).text(formatMinutes(this.oPlaylistItem.duration));$(".video_duration_seconds",A).val(this.oPlaylistItem.duration);$(".video_youtube_id",A).val(this.oPlaylistItem.youtube_id);$(".video_media_type_id",A).val(this.oPlaylistItem.media_type_id);$(".thumbnail img",A).attr("src",this.oPlaylistItem.thumbnail_url);$(".thumbnail img",A).attr("alt",this.oPlaylistItem.title);return $(A)}}catch(B){publishException(B)}}});var PlaylistList=View.extend({sElementId:"",oData:null,bIsDirty:false,render:function(){try{$(".listing","#"+this.sElementId).empty();var E=(this.oData)?this.oData.length:0;if(E>0){for(var B=0,A=E;B<E;++B){if(this.oData[B]){oPlaylistListItem=new PlaylistListItem();oPlaylistListItem.oPlaylist=this.oData[B];this.addChild(oPlaylistListItem)}}}$("#"+this.sElementId+"_list").append("<li></li>");var D=this.aChildren.length;for(var B=0,A=D;B<A;++B){$("#"+this.sElementId+"_list").append(this.aChildren[B].render())}this.wireUp()}catch(C){publishException(C)}},wireUp:function(){try{$("div.edit","#"+this.sElementId+"_list").click(function(){var B=$(this).parent().parent().attr("id").substr(9);ctlPlaylistList.loadPlaylist(B)});$("div.remove","#"+this.sElementId+"_list").click(ctlPlaylistList.deletePlaylist);$("div.play","#"+this.sElementId+"_list").click(ctlPlaylistList.selectPlaylist);$("#"+this.sElementId+"_list").children().eq(0).remove();$("li","#"+this.sElementId+"_list").hover(function(){$(".overlay",this).show()},function(){$(".overlay",this).hide()});$("#"+this.sElementId+"_list").jScrollPane(jScrollPaneSetup);$(".rating","#"+this.sElementId).each(function(){var C=parseFloat($(".rating_average",$(this)).eq(0).val());var B=Math.round(C);$(this).stars({selected:B-1})})}catch(A){publishException(A)}}});var PlaylistListItem=View.extend({oPlaylist:null,render:function(){try{var B=sPlaylistTemplate.replaceAll(/\[\[.*?]]/,"");var A=$(B);$(A).removeClass("template");$(".cmd_load_playlist",A).attr("href",this.oPlaylist.url);$(".title",A).text(this.oPlaylist.name);$(".thumbnail img",A).attr("src",this.oPlaylist.thumbnail_url);$(".thumbnail img",A).attr("alt",this.oPlaylist.name);$(".duration",A).text(formatMinutes(this.oPlaylist.duration));$(".vote_count",A).text(this.oPlaylist.vote_count);$(".view_count",A).text(this.oPlaylist.view_count);$(".rating_average",A).val(this.oPlaylist.rating);if(this.oPlaylist.is_public){$(".visibility",A).addClass("public")}else{$(".visibility",A).addClass("private")}$(".date_value",A).text(this.oPlaylist.date_entered.toString("MMM d, yyyy"));$(A).attr("id","playlist_"+this.oPlaylist.id);$(".playlist_list_item_item_count",A).text(this.oPlaylist.item_count);$(".playlist_list_item_owner_id",A).text(this.oPlaylist.user_id);$(".rating",A).attr("id","ratings-widget_"+this.oPlaylist.id);$(".rating_average",A).val(this.oPlaylist.rating);$("input[type=radio]",A).attr("name","newrate_"+this.oPlaylist.id);return $(A)}catch(C){publishException(C)}},wireUp:function(A){try{$("div.edit",A).click(ctlPlaylistList.loadPlaylist);$("div.remove",A).click(ctlPlaylistList.deletePlaylist);$("div.play",A).click(ctlPlaylistList.selectPlaylist);$(A).hover(function(){$(".overlay",this).show()},function(){$(".overlay",this).hide()});$(".rating",A).each(function(){var D=parseFloat($(".rating_average",$(this)).eq(0).val());var C=Math.round(D);$(this).stars({disabled:true})})}catch(B){publishException(B)}}});var PlaylistTable=View.extend({sElementId:"",oData:null,bIsDirty:false,render:function(){try{$(".playlist_list_container","#"+this.sElementId).empty();var E=(this.oData)?this.oData.length:0;if(E>0){for(var B=0,A=E;B<E;++B){if(this.oData[B]){oPlaylistTableItem=new PlaylistTableItem();oPlaylistTableItem.oPlaylist=this.oData[B];this.addChild(oPlaylistTableItem)}}}var D=this.aChildren.length;for(var B=0,A=D;B<A;++B){$(".playlist_list_container","#"+this.sElementId).append(this.aChildren[B].render())}this.wireUp();$("#"+this.sElementId).show()}catch(C){publishException(C)}},wireUp:function(){try{$(".playlist_item_control_select").click(ctlPlaylistList.selectPlaylist);$(".playlist_item_control_delete").click(ctlPlaylistList.deletePlaylist);$(".scrollable","#"+this.sElementId).jScrollPane();$(".rating","#"+this.sElementId).each(function(){var C=parseFloat($(".video_rating_average",$(this)).eq(0).val());var B=Math.round(C);$(this).stars({oneVoteOnly:true,selected:B-1})})}catch(A){publishException(A)}}});var PlaylistTableItem=View.extend({oPlaylist:null,render:function(){try{var A=$(sPlaylistTableTemplate);$(A).removeClass("template");$(A).attr("id","playlist_"+this.oPlaylist.id);$(".playlist_list_item_thumbnail",A).attr("src",this.oPlaylist.thumbnail_url);$(".playlist_list_item_thumbnail",A).attr("alt",this.oPlaylist.name);$(".playlist_list_item_name",A).text(this.oPlaylist.name);$(".playlist_list_item_item_count",A).text(this.oPlaylist.item_count);$(".playlist_list_item_duration",A).text(formatMinutes(this.oPlaylist.duration));$(".playlist_list_item_vote_count",A).text(this.oPlaylist.vote_count);$(".playlist_list_item_view_count",A).text(this.oPlaylist.view_count);$(".playlist_list_item_rating",A).text(this.oPlaylist.rating);$(".playlist_list_item_owner_id",A).text(this.oPlaylist.user_id);$(".ratings-widget",A).attr("id","ratings-widget_"+this.oPlaylist.id);$("input[type=radio]",A).attr("name","newrate_"+this.oPlaylist.id);return $(A)}catch(B){publishException(B)}}});var VideoSearchForm=View.extend({render:function(){try{$(".txt_video_search_term").val(VIDEO_SEARCH_TERM_TEXT);this.wireUp();return false}catch(A){publishException(A)}},wireUp:function(){try{$(".video_search_form").submit(ctlVideoSearchForm.handleSearchSubmit);$(".txt_video_search_term").blur(ctlVideoSearchForm.handleSearchTermBlur);$(".txt_video_search_term").focus(ctlVideoSearchForm.handleSearchTermFocus);$(".cmd_video_search_submit").click(function(){$(this).parent().parent().submit();return false});return false}catch(A){publishException(A)}}});var VideoLargeSearchForm=View.extend({render:function(){try{$(".txt_video_search_term","#current_content-search_form").val(VIDEO_SEARCH_TERM_TEXT);this.wireUp();return false}catch(A){publishException(A)}},display:function(){try{oPlayerContainer.hide();$(".video_search_form_small").parent().hide();$("#current_content-search_form").show()}catch(A){publishException(A)}},hide:function(){try{$("#current_content-search_form").hide()}catch(A){publishException(A)}},wireUp:function(){try{$(".video_search_form").submit(ctlVideoSearchForm.handleSearchSubmit);$(".txt_video_search_term","#current_content-search_form").blur(ctlVideoSearchForm.handleSearchTermBlur);$(".txt_video_search_term","#current_content-search_form").focus(ctlVideoSearchForm.handleSearchTermFocus);$(".cmd_video_search_submit","#current_content-search_form").click(function(){$(this).parent().parent().submit();return false});return false}catch(A){publishException(A)}}});var VideoSearchResults=View.extend({iPageNumber:1,sSearchTerm:"",oData:null,render:function(){try{var F=(this.oData.feed.entry)?this.oData.feed.entry.length:0;$("#video_search_results").empty();if(F>0){this.aChildren=new Array();for(var C=0,A=F;C<SEARCH_RESULTS_COUNT;++C){if(this.oData.feed.entry[C]){oVideoSearchResultsItem=new VideoSearchResultsItem();oVideoSearchResultsItem.oVideo=this.oData.feed.entry[C];this.addChild(oVideoSearchResultsItem)}}var E=this.aChildren.length;for(var C=0,A=E;C<A;++C){$("#video_search_results").append(this.aChildren[C].render())}if(F>SEARCH_RESULTS_COUNT||this.iPageNumber>1){var B=$('<li id="video_search_results_controls"></li>');$(B).append('<a href="#" id="cmd_video_search_results_next_page" class="disabled next"><img src="/img/next.png" /></a>');$(B).append('<a href="#" id="cmd_video_search_results_previous_page" class="disabled prev"><img src="/img/back.png" /></a>');$("#video_search_results").append(B);if(F>SEARCH_RESULTS_COUNT){$("#cmd_video_search_results_next_page").show()}else{$("#cmd_video_search_results_next_page").hide()}if(this.iPageNumber>1){$("#cmd_video_search_results_previous_page").show()}else{$("#cmd_video_search_results_previous_page").hide()}if(oEditPlaylist.oPlaylist.iId<1&&oEditPlaylist.oPlaylist.aPlaylistItems.length==0){oEditPlaylist.iInstructionState=3}}else{if(oEditPlaylist.oPlaylist.iId<1&&oEditPlaylist.oPlaylist.aPlaylistItems.length==0){oEditPlaylist.iInstructionState=2}}oEditPlaylist.updateInstructions();$("#video_search_results_message").text("Results Found!")}else{$("#video_search_results").append("<li><p>No results found. Please try again.</li></p>");$(".txt_video_search_term").val(VIDEO_SEARCH_TERM_TEXT)}this.wireUp();$("#video_search_results_container").show();$("#jooque_browser-nagivation > ul").tabs("select",1);return false}catch(D){publishException(D)}},wireUp:function(){try{$("div.play","#video_search_results").click(ctlPlaylistItem.play);$("div.remove","#video_search_results").click(ctlEditPlaylist.handleRemoveItemClick);$("div.drag","#video_search_results").click(ctlEditPlaylist.addToPlaylist);$("li","#video_search_results").hover(function(){$(".overlay","#video_search_results").hide();$(".overlay",this).show()},function(){$(".overlay",this).hide()});$("#cmd_video_search_results_next_page").click(ctlVideoSearchResults.gotoNextPage);$("#cmd_video_search_results_previous_page").click(ctlVideoSearchResults.gotoPreviousPage);$("#jooque_browser-search_videos div.section-search_results ul").sortable({connectWith:$("ul#ep_playlist"),items:".draggable",start:function(C,B){if($("span",".cmd_toggle_ep_details").eq(0).text()=="View Playlist"){ctlEditPlaylist.displayPlaylistDetails()}return false},stop:function(){$("#ep_playlist").jScrollPane(jScrollPaneSetup)},helper:function(C,B){var D=$(B).clone();$(".overlay",D).css({display:"none"});$(D).css({border:"none","background-color":"transparent"});return D}});$(".rating","#video_search_results").each(function(){var C=parseFloat($(".video_rating_average",$(this).parent()).eq(0).val());var B=Math.round(C);$(this).stars({disabled:true,selected:B-1})});return true}catch(A){publishException(A)}}});var VideoSearchResultsItem=View.extend({oVideo:null,render:function(){try{if(this.oVideo){var D=Date.parse(this.oVideo.published.$t.substr(0,19));var B=-1;if(this.oVideo.media$group.media$category[0].label=="Music"){B=1}else{B=2}var A=$(sVideoTemplate);$(A).removeClass("template");$(".video_media_type_id",A).val(B);$(".thumbnail img",A).attr("src",this.oVideo.media$group.media$thumbnail[0].url);$(".thumbnail img",A).attr("alt",this.oVideo.title.$t);$(".title",A).text(this.oVideo.title.$t);$(".duration",A).text(formatMinutes(this.oVideo.media$group.yt$duration.seconds));$(".video_duration_seconds",A).val(this.oVideo.media$group.yt$duration.seconds);$(".video_youtube_id",A).val(getYouTubeIdFromUrl(this.oVideo.media$group.media$player[0].url));$(".date_published",A).text(D.toString("MMM d, yyyy"));if(this.oVideo.yt$statistics){$(".view_count",A).text(this.oVideo.yt$statistics.viewCount.formatNumber())}if(this.oVideo.gd$rating){$(".video_rating_average",A).val(this.oVideo.gd$rating.average);$(".vote_count",A).text(this.oVideo.gd$rating.numRaters.formatNumber())}else{$(".vote_count",A).text("0")}$(".video_data_id",A).val("");$(A).attr("id","sri_"+getYouTubeIdFromUrl(this.oVideo.media$group.media$player[0].url));$(A).addClass("draggable");return $(A)}}catch(C){publishException(C)}}});var PlaylistSearchForm=View.extend({render:function(){try{$(".txt_playlist_search_term").val(PLAYLIST_SEARCH_TERM_TEXT);this.wireUp();return false}catch(A){publishException(A)}},wireUp:function(){try{$(".playlist_search_form").submit(ctlPlaylistSearchForm.handleSearchSubmit);$(".txt_playlist_search_term").blur(ctlPlaylistSearchForm.handleSearchTermBlur);$(".txt_playlist_search_term").focus(ctlPlaylistSearchForm.handleSearchTermFocus);$(".cmd_playlist_search_submit").click(function(){$(this).parent().parent().submit()});return false}catch(A){publishException(A)}}});var PlaylistSearchResults=View.extend({iPageNumber:1,sSearchTerm:"",oData:null,render:function(){try{var F=(this.oData)?this.oData.length:0;if(F>0){this.aChildren=new Array();for(var C=0,A=F;C<SEARCH_RESULTS_COUNT;++C){if(this.oData[C]){oPlaylistSearchResultsItem=new PlaylistListItem();oPlaylistSearchResultsItem.oPlaylist=this.oData[C];this.addChild(oPlaylistSearchResultsItem)}}}var E=this.aChildren.length;$("#playlist_search_results").empty();for(var C=0,A=E;C<A;++C){$("#playlist_search_results").append(this.aChildren[C].render())}if(F>SEARCH_RESULTS_COUNT||this.iPageNumber>1){var B=$('<li id="playlist_search_results_controls"></li>');$(B).append('<a href="#" id="cmd_playlist_search_results_next_page" class="disabled next"><img src="/img/next.png" /></a>');$(B).append('<a href="#" id="cmd_playlist_search_results_previous_page" class="disabled prev"><img src="/img/previous.png" /></a>');$("#playlist_search_results").append(B);if(F>SEARCH_RESULTS_COUNT){$("#cmd_playlist_search_results_next_page").show()}else{$("#cmd_playlist_search_results_next_page").hide()}if(this.iPageNumber>1){$("#cmd_playlist_search_results_previous_page").show()}else{$("#cmd_playlist_search_results_previous_page").hide()}}this.wireUp();$("#playlist_search_results_container").show();$("#jooque_browser-nagivation > ul").tabs("select",2);return }catch(D){publishException(D)}},wireUp:function(){try{$("div.edit","#playlist_search_results").click(ctlPlaylistList.loadPlaylist);$("div.remove","#playlist_search_results").click(ctlPlaylistList.deletePlaylist);$("div.play","#playlist_search_results").click(ctlPlaylistList.selectPlaylist);$("li","#playlist_search_results").hover(function(){$(".overlay",this).show()},function(){$(".overlay",this).hide()});$("#cmd_playlist_search_results_next_page").click(ctlPlaylistSearchResults.gotoNextPage);$("#cmd_playlist_search_results_previous_page").click(ctlPlaylistSearchResults.gotoPreviousPage);$(".rating","#playlist_search_results").each(function(){var C=parseFloat($(".rating_average",$(this)).eq(0).val());var B=Math.round(C);$(this).stars({disabled:true,selected:B-1})})}catch(A){publishException(A)}}});var Status=View.extend({render:function(){try{var H=this.aChildren.length;for(var C=0,B=H;C<B;++C){this.aChildren[C].render()}var F=readCookie("session_guid");var E=readCookie("mid");var A=readCookie("username");var D=readCookie("avatar");if(FACEBOOK_ENABLED){FB.ensureInit(function(){FB.Connect.ifUserConnected(function(){if(A&&D){$("#status_user").text(A);$("#status_avatar").attr("src",D)}$("#cmd_logout").text("Logout of Facebook");$(".logged_in").show();$(".logged_out").hide()},function(){if(F!=null&&E!=null&&A!=null){$("#status_user").text(A);$("#status_avatar").attr("src",D);$(".logged_in").show();$(".logged_out").hide()}else{$(".logged_in").hide();$(".logged_out").show()}})})}else{if(F!=null&&E!=null&&A!=null){$("#status_user").text(A);$("#status_avatar").attr("src",D);$(".logged_in").show();$(".logged_out").hide()}else{$(".logged_in").hide();$(".logged_out").show()}}this.display();this.wireUp()}catch(G){publishException(G)}},display:function(){try{$("#header-user_panel").show()}catch(A){publishException(A)}},hide:function(){try{$("#header-user_panel").hide()}catch(A){publishException(A)}},wireUp:function(){try{$("#cmd_logout").click(ctlLoginRegistrationForm.logout);$(".cmd_display_login_registration_form").click(ctlLoginRegistrationForm.displayLoginRegistrationForm)}catch(A){publishException(A)}}});var swfu;var User=View.extend({render:function(){try{FB.Connect.ifUserConnected(function(){$("#avatar_controls").hide()},function(){$("#avatar_controls").show()});this.wireUp()}catch(A){publishException(A)}},wireUp:function(){try{var A={flash_url:"/flash/swfupload.swf",upload_url:"/Account.php",post_params:{PHPSESSID:"",cmd_upload_image:true},file_size_limit:"3 MB",file_types:"*.jpg;*.jpeg;*.gif;*.png",file_types_description:"JPG, PNG, GIFs",file_upload_limit:1,file_queue_limit:0,custom_settings:{progressTarget:"fsUploadProgress"},debug:false,button_image_url:"/img/xhtmlized/XPButtonUploadText_61x22.png",button_width:"61",button_height:"22",button_placeholder_id:"spanButtonPlaceHolder",button_text_left_padding:12,button_text_top_padding:3,file_queued_handler:fileQueued,file_queue_error_handler:fileQueueError,file_dialog_complete_handler:fileDialogComplete,upload_start_handler:uploadStart,upload_progress_handler:uploadProgress,upload_error_handler:uploadError,upload_success_handler:ctlPhoto.uploadSuccess,upload_complete_handler:uploadComplete,queue_complete_handler:queueComplete,minimum_flash_version:"9.0.28",swfupload_pre_load_handler:swfUploadPreLoad,swfupload_load_failed_handler:swfUploadLoadFailed};swfu=new SWFUpload(A)}catch(B){publishException(B)}}});var ctlEditPlaylist={newPlaylist:function(){try{if(oEditPlaylist.oPlaylist.isDirty){ctlEditPlaylist.save(function(){oEditPlaylist.oPlaylist=new mdlPlaylist();oEditPlaylist.render()})}else{oEditPlaylist.oPlaylist=new mdlPlaylist();oEditPlaylist.render()}var A=$("span",".cmd_toggle_ep_details").eq(0).text();$("span",".cmd_toggle_ep_details").eq(0).text("Share!");$("#ep_details").hide();$("#ep_items_container").show();$("#ep_playlist").jScrollPane(jScrollPaneSetup);return false}catch(B){publishException(B)}},handleListSorted:function(A,B){try{$("div.overlay","#ep_playlist").hide();oEditPlaylist.oPlaylist.bIsDirty=true;oEditPlaylist.update();return false}catch(C){publishException(C)}},load:function(A,B){try{var C={cmd_retrieve_playlist:true,playlist_id:A,mid:readCookie("mid"),session_guid:readCookie("session_guid")};$.ajax({type:"GET",url:sAJAXURL+"/Playlist.php",dataType:"json",data:C,success:function(E){B(E)},error:handleAjaxError});return false}catch(D){publishException(D)}},autoSave:function(){try{if(oEditPlaylist.oPlaylist.bIsDirty==false||oEditPlaylist.oPlaylist.sName==""){return }if(!bUserLoggedIn){return }ctlEditPlaylist.save(function(B){if(B.iReturn==AJAX_SUCCESS){oEditPlaylist.oPlaylist.iId=parseInt(B.playlist_id);oEditPlaylist.oPlaylist.bIsDirty=false;oMyPlaylists.bIsDirty=true;oEditPlaylist.oPlaylist.bIsNew=false;oEditPlaylist.update();oEditPlaylist.oPlaylist.bPublishedToFacebook=B.playlist.published_to_facebook;oEditPlaylist.updateFacebookStatus();if(B.is_new==true){oPlaylistItem=new PlaylistListItem();oPlaylistItem.oPlaylist=B.playlist;elDom=oPlaylistItem.render();oPlaylistItem.wireUp(elDom);if(!oEditPlaylist.oPlaylist.bIsPublic){oEditPlaylist.iInstructionState=5}else{oEditPlaylist.iInstructionState=-1}$("#section-playlists_list").append(elDom);$("#section-playlists_list").jScrollPane(jScrollPaneSetup)}else{if(!oEditPlaylist.oPlaylist.bIsPublic){oEditPlaylist.iInstructionState=5}else{oEditPlaylist.iInstructionState=-1}}oEditPlaylist.updateInstructions()}else{displayMessages(B.aMessages)}})}catch(A){publishException(A)}},handleItemAdded:function(B,C){try{$(".placeholder","#ep_playlist").remove();var A=$(C.item).attr("id").substr(4);$(C.item).attr("id","pli_"+A);oEditPlaylist.oPlaylist.bIsDirty=true;if(oEditPlaylist.oPlaylist.iId<1&&$("#ep_playlist").children().length>0){oEditPlaylist.iInstructionState=4}oEditPlaylist.updateInstructions();$("ul#ep_playlist").jScrollPane(jScrollPaneSetup);return true}catch(D){publishException(D)}},handleRemoveItemClick:function(){try{$(this).parent().parent().remove();if($("#ep_playlist").children().length==0){$("#ep_playlist").append($(sPlaylistPlaceholderTemplate))}oEditPlaylist.oPlaylist.bIsDirty=true;$("ul#ep_playlist").jScrollPane(jScrollPaneSetup);oEditPlaylist.update();return true}catch(A){publishException(A)}},save:function(J){try{if(!oEditPlaylist.oPlaylist.bIsDirty){var G={};G.iReturn=1;G.aMessages=new Array("Your playlist has been saved.");J(G);return }if(!bUserLoggedIn){var G={};G.iReturn=0;G.aMessages=new Array("You must log in to save a playlist.");J(G);return }if(oEditPlaylist.oPlaylist.sName==""){var G={};G.iReturn=1;G.aMessages=new Array("Please provide a name for your playlist.");J(G);return true}var H=Array();var D=$(".video","#ep_playlist");var F=D.length;var C="";for(i=0;i<F;i++){var E=D[i];var A={index:i,video_youtube_id:$(".video_youtube_id",E).eq(0).val(),video_thumbnail:$(".thumbnail > img",E).eq(0).attr("src"),video_title:encodeURIComponent($(".title",E).eq(0).text()),video_duration_seconds:$(".video_duration_seconds",E).eq(0).val(),video_media_type_id:$(".video_media_type_id",E).eq(0).val(),video_data_id:$(".video_data_id",E).eq(0).val()};H[i]=A;if(i==0){C=A.video_thumbnail}}var B={cmd_save_playlist_complete:true,playlist_id:oEditPlaylist.oPlaylist.iId,playlist_name:encodeURIComponent(oEditPlaylist.oPlaylist.sName),playlist_thumbnail_url:C,playlist_items:$.toJSON(H),playlist_description:encodeURIComponent(oEditPlaylist.oPlaylist.sDescription),playlist_keywords:encodeURIComponent(oEditPlaylist.oPlaylist.sKeywords),playlist_is_public:oEditPlaylist.oPlaylist.bIsPublic,playlist_published_to_facebook:oEditPlaylist.oPlaylist.bPublishedToFacebook};$.ajax({type:"POST",url:sAJAXURL+"/Playlist.php",dataType:"json",data:B,success:function(K){J(K)},error:handleAjaxError})}catch(I){publishException(I)}},handlePlaylistDescriptionBlur:function(){try{if($(this).val().trim()!=oEditPlaylist.oPlaylist.sDescription.trim()&&$(".video","#ep_playlist").length>0){oEditPlaylist.oPlaylist.bIsDirty=true}oEditPlaylist.oPlaylist.sDescription=$("#txt_playlist_description").val().trim();oEditPlaylist.update();return false}catch(A){publishException(A)}},handlePlaylistKeywordsBlur:function(){try{if($(this).val().trim()!=oEditPlaylist.oPlaylist.sKeywords.trim()&&$(".video","#ep_playlist").length>0){oEditPlaylist.oPlaylist.bIsDirty=true}oEditPlaylist.oPlaylist.sKeywords=$("#txt_playlist_keywords").val().trim();oEditPlaylist.update();return false}catch(A){publishException(A)}},handleIsPublicClick:function(){try{if($("#chk_is_public").attr("checked")==true){oEditPlaylist.oPlaylist.bIsPublic=true}else{oEditPlaylist.oPlaylist.bIsPublic=false}oEditPlaylist.oPlaylist.bIsDirty=true;oEditPlaylist.updateVisibility();oEditPlaylist.update()}catch(A){publishException(A)}},handlePublishToFacebookClick:function(){try{if($("#chk_publish_to_facebook").attr("checked")==true){FB.ensureInit(function(){FB.Connect.ifUserConnected(function(){var B={playlist:oEditPlaylist.oPlaylist.sName,url:oEditPlaylist.oPlaylist.getRelativeUrl()};FB.Connect.showFeedDialog(FACEBOOK_TEMPLATE_BUNDLE_NEW_PLAYLIST,B,null,null,null,FB.RequireConnect.promptConnect,function(C){})})})}}catch(A){publishException(A)}},displayPlaylistDetails:function(){try{var A=$("span",".cmd_toggle_ep_details").eq(0).text();if(A=="View Playlist"){$("span",".cmd_toggle_ep_details").eq(0).text("Click to Share!")}else{$("span",".cmd_toggle_ep_details").eq(0).text("View Playlist")}$("#ep_details").toggle();$("#ep_items_container").toggle();return false}catch(B){publishException(B)}},handlePlaylistNameBlur:function(){try{if($(this).val().trim()==""){$(this).val(PLAYLIST_NAME_TEXT);oEditPlaylist.oPlaylist.sName="";return }if($(this).val().trim()!=oEditPlaylist.oPlaylist.sName&&$(this).val().trim()!=PLAYLIST_NAME_TEXT&&$(".video","#ep_playlist").length>0){oEditPlaylist.oPlaylist.bIsDirty=true}oEditPlaylist.oPlaylist.sName=$(this).val().trim();oEditPlaylist.update()}catch(A){publishException(A)}},handlePlaylistNameFocus:function(){try{if($("#txt_playlist_name").val().trim()==PLAYLIST_NAME_TEXT){$("#txt_playlist_name").val("")}}catch(A){publishException(A)}},addToPlaylist:function(){try{$(".placeholder","#ep_playlist").remove();var B=$(this).parent().parent();var A=$(B).attr("id").substr(4);$(B).attr("id","pli_"+A);$("ul#ep_playlist").append(B);$(".overlay","ul#ep_playlist").hide();oEditPlaylist.oPlaylist.bIsDirty=true;oEditPlaylist.update();if(oEditPlaylist.oPlaylist.iId<1&&$("#ep_playlist").children().length>0){oEditPlaylist.iInstructionState=4}oEditPlaylist.updateInstructions();$("ul#ep_playlist").jScrollPane(jScrollPaneSetup);return false}catch(C){publishException(C)}}};var ctlLoginRegistrationForm={sendPasswordReminder:function(){try{var D=true;var C=new Array();var F=$("#txt_password_reminder_email_address").val().trim();if(F==""){C[C.length]="Email Address is required."}else{if(!isValidEmailAddress(F)){C[C.length]="The email address you provided is not valid."}}if(C.length>0){displayMessages(C,"login_registration_messages");return false}var A={cmd_send_password_reminder:true,txt_email_address:F};$("#cmd_send_password_reminder_email").addClass("submitting");$.ajax({type:"GET",url:sAJAXURL+"/Password.php",dataType:"json",data:A,success:function(G){E(G)},error:handleAjaxError});function E(H){try{$("#cmd_send_password_reminder_email").removeClass("submitting");if(H.iReturn!=1){displayMessages(H.aMessages,"login_registration_messages");return false}displayMessages(Array("Your instructions have been sent."),"login_registration_messages");var G=setTimeout(function(){tb_remove()},3000);return false}catch(I){publishException(I)}}return false}catch(B){publishException(B)}},register:function(){try{var F=true;var E=new Array();var H=$("#txt_registration_email_address").val().trim();var A=$("#txt_registration_username").val().trim();var B=$("#pwd_registration_password").val().trim();if(H==""){E[E.length]="Email Address is required."}else{if(!isValidEmailAddress(H)){E[E.length]="The email address you provided is not valid."}}if(B==""){E[E.length]="Password is required."}else{if(!isValidPassword(B)){E[E.length]="Password must be 6-15 characters (Letters, numbers, or @_#$%^&+= ok)."}}if(A==""){E[E.length]="Username is required."}else{if(!isValidUsername(A)){E[E.length]="Username must be 8-15 characters."}}if(E.length>0){displayMessages(E,"login_registration_messages");return false}var C={cmd_submit_registration:true,txt_email_address:H,txt_username:A,pwd_password:B};$("#cmd_submit_registration").addClass("submitting");$.ajax({type:"GET",url:sAJAXURL+"/Registration.php",dataType:"json",data:C,success:function(I){G(I)},error:handleAjaxError});function G(J){try{$("#cmd_submit_registration").removeClass("submitting");if(J.iReturn!=1){displayMessages(J.aMessages,"login_registration_messages");return false}createCookie("session_guid",J.session_guid);createCookie("mid",J.mid);createCookie("email_address",J.email_address);createCookie("username",J.username);createCookie("avatar",J.avatar);aUserPlaylists=J.playlists;aUserFavorites=J.favorites;oStatus.render();ctlLoginRegistrationForm.displayPreviousState();oMyFavorites.oData=aUserFavorites;oMyFavorites.render();oMyPlaylists.oData=aUserPlaylists;oMyPlaylists.render();oEditPlaylist.updateInstructions();displayMessages(Array("Welcome to Jooque!"),"login_registration_messages");var I=setInterval(function(){tb_remove()},3000);return false}catch(K){publishException(K)}}return false}catch(D){publishException(D)}},loginFacebookUser:function(){try{var D=true;$("#login_registration_messages").text("&nbsp;");var C=new Array();displayMessages(Array("Retrieving account..."),"login_registration_messages");$("#login_controls").hide();var A={cmd_submit_facebook_login:true};$.ajax({type:"GET",url:sAJAXURL+"/Login.php",dataType:"json",data:A,success:function(F){E(F)},error:handleAjaxError});function E(G){try{if(G.iReturn!=1){displayMessages(C,"login_registration_messages");return false}displayMessages(Array("Loading data..."),"login_registration_messages");var I=1;createCookie("username",G.username,I);createCookie("avatar",G.avatar,I);bUserLoggedIn=true;$(".user_avatar").attr("src",G.avatar);aUserPlaylists=G.playlists;aUserFavorites=G.favorites;oStatus.render();ctlLoginRegistrationForm.displayPreviousState();displayMessages(Array("Loading favorites."),"login_registration_messages");oMyFavorites.oData=aUserFavorites;displayMessages(Array("Loading playlists."),"login_registration_messages");oMyPlaylists.oData=aUserPlaylists;oMyPlaylists.render();displayMessages(Array("Enabling rating system."),"login_registration_messages");$("#current-ratings-widget").stars("enable");displayMessages(Array("Welcome back!"),"login_registration_messages");var F=setInterval(function(){tb_remove()},1000);return false}catch(H){publishException(H)}}return false}catch(B){publishException(B)}},login:function(){try{var F=true;$("#login_registration_messages").text("&nbsp;");var C=new Array();var G=$("#txt_login_email_address").val().trim();var D=$("#pwd_login_password").val().trim();var H=$("#hdn_seed").val().trim();var B=$("#hdn_seed_id").val().trim();if(G==""){C[C.length]="Email Address is required."}if(D==""){C[C.length]="Password is required."}if(C.length>0){displayMessages(C,"login_registration_messages");return false}D=sha1Hash(sha1Hash(D)+H);displayMessages(Array("Submitting Login..."),"login_registration_messages");$("#cmd_submit_login").addClass("submitting");var A={cmd_submit_login:true,email_address:G,password:D,seed_id:B};$.ajax({type:"GET",url:sAJAXURL+"/Login.php",dataType:"json",data:A,success:function(J){I(J)},error:handleAjaxError});function I(L){try{$("#cmd_submit_login").removeClass("submitting");if(L.iReturn!=1){displayMessages(C,"login_registration_messages");return false}displayMessages(Array("Login Successful. Loading data."),"login_registration_messages");var J=$("#chk_remember_login").attr("checked");var N=(J)?30:0;createCookie("session_guid",L.session_guid,N);createCookie("mid",L.mid,N);createCookie("email_address",L.email_address,N);createCookie("username",L.username,N);createCookie("avatar",L.avatar,N);bUserLoggedIn=true;$(".user_avatar").attr("src",L.avatar);aUserPlaylists=L.playlists;aUserFavorites=L.favorites;oStatus.render();ctlLoginRegistrationForm.displayPreviousState();displayMessages(Array("Loading favorites."),"login_registration_messages");oMyFavorites.oData=aUserFavorites;displayMessages(Array("Loading playlists."),"login_registration_messages");oMyPlaylists.oData=aUserPlaylists;oMyPlaylists.render();displayMessages(Array("Enabling rating system."),"login_registration_messages");$("#current-ratings-widget").stars("enable");displayMessages(Array("Welcome back!"),"login_registration_messages");var K=setInterval(function(){tb_remove()},1000);return false}catch(M){publishException(M)}}return false}catch(E){publishException(E)}},logout:function(){try{eraseCookie("session_guid");eraseCookie("mid");eraseCookie("email_address");eraseCookie("username");bUserLoggedIn=false;FB.Connect.ifUserConnected(function(){FB.Connect.logout(function(B){refresh_page();return false});return false},function(){refresh_page();return true});return false}catch(A){publishException(A)}},displayLoginRegistrationForm:function(){try{oLoginRegistrationForm.display();return false}catch(A){publishException(A)}},displayReminderForm:function(){try{oLoginRegistrationForm.renderReminderForm();return false}catch(A){publishException(A)}},cancel:function(){try{oStatus.display();if(oPlayer.sYTVideoId!=""&&oPlayer.sYTVideoId!=null){oPlayerContainer.display()}else{oVideoLargeSearchForm.display()}tb_remove();return false}catch(A){publishException(A)}},displayPreviousState:function(){try{if(oPlayer.sYTVideoId!=""&&oPlayer.sYTVideoId!=null){oPlayerContainer.display()}else{oVideoLargeSearchForm.display()}}catch(A){publishException(A)}}};var ctlNavigation={selectTab:function(A,B){try{switch(B.index){case 0:pageTracker._trackPageview("/");break;case 1:pageTracker._trackPageview("/search/");break;case 2:pageTracker._trackPageview("/searchplaylists/");break;case 3:pageTracker._trackPageview("/myplaylists/");break;case 4:pageTracker._trackPageview("/favorites/");break}$("#jooque_browser-nagivation > ul").find("a.selected").removeClass("selected");$(B.tab).addClass("selected");return true}catch(C){publishException(C)}}};var ctlBlog={loadBlog:function(D){try{if(D.posts[0]){var A=D.posts[0]["regular-title"];var C=D.posts[0]["regular-body"];var B=D.posts[0]["date"];oBlog=new Blog();oBlog.sTitle=A;oBlog.sBody=C;oBlog.dtDate=B;oBlog.render()}}catch(E){publishException(E)}},test:function(A){alert("hello")}};function loadBlog(A){ctlBlog.loadBlog(A)}var ctlPage={checkTimer:function(){try{ctlEditPlaylist.autoSave();if(oPlayerContainer.currentMode==oPlayerContainer.MODE_SMART){switch(oPlayer.currentState){case"":case"IDLE":case"PAUSED":return ;break}var B=new Date();var A=B.getTime()-oPlayerContainer.smartTime;if((A>SMART_MODE_LIMIT)&&(oPlayerContainer.smartState==oPlayerContainer.MODE_SEARCH)){oPlayerContainer.smartState=oPlayerContainer.MODE_PLAY;ctlPlayerContainer.setupPlayMode()}}}catch(C){publishException(C)}}};var ctlPhoto={uploadSuccess:function(file,serverData){try{var progress=new FileProgress(file,this.customSettings.progressTarget);progress.setComplete();progress.setStatus("Complete.");progress.toggleCancel(false);eval("data = "+serverData);oPhoto=new Photo();oPhoto.iHeight=data.height;oPhoto.iWidth=data.width;oPhoto.sImageSrc=data.url;oPhoto.render();return true}catch(e){publishException(e)}},update:function(){try{var A={mid:readCookie("mid"),session_guid:readCookie("session_guid"),x:oPhoto.iX,y:oPhoto.iY,width:oPhoto.iWidth,height:oPhoto.iHeight,url:$("#img_crop_image").attr("src"),cmd_crop_image:true};$.ajax({type:"GET",url:sAJAXURL+"/Account.php",dataType:"json",data:A,success:function(D){C(D)},error:handleAjaxError});function C(D){try{if(D.iReturn==1){$("#img_crop_image").unbind("load");$("#img_avatar").attr("src",D.url);createCookie("avatar",D.url);oPhoto.reset()}return false}catch(E){publishException(E)}}return false}catch(B){publishException(B)}}};var ctlPlayer={handleStateChange:function(G){try{oPlayer.currentState=G.newstate;switch(G.newstate){case"COMPLETED":if(sNowPlaying=="search"){return false}if(sNowPlaying=="edit"){var D=$("#ep_playlist");var L=$("#txt_playlist_name").val();var E=oPlayer.sYTVideoId}else{if(sNowPlaying=="current"){var D=$("#section-current_list");var L=$("#section-current_playlist-name").text();if((oPlayer.sYTVideoId==null||oPlayer.sYTVideoId=="")&&$("#identify_youtube_id").val().length>0){var E=$("#identify_youtube_id").val()}else{if(oPlayer.sYTVideoId.length>0){var E=oPlayer.sYTVideoId}else{throw"Invalid player state."}}}}var F=$(D).children().index($("#pli_"+E));var I=$(D).children().length-1;if(F<0){throw"Unable to locate the file in the list."}if(F>=I){var B=0;var H=F;var K=1}else{var B=F+1;var H=F;var K=((B+1)>I-1)?0:(B+1)}var M=$(D).children().eq(B);oPlayer.sYTVideoId=$(M).attr("id").substr(4);oPlayer.iPlaylistIndex=B;if(sNowPlaying=="edit"){if($("#ep_playlist")[0].scrollTo){$("#ep_playlist")[0].scrollTo("#pli_"+oPlayer.sYTVideoId)}}else{if($("#section-current_list")[0].scrollTo){$("#section-current_list")[0].scrollTo("#pli_"+oPlayer.sYTVideoId)}}if(I>1){var C=$(D).children().eq(K);var A=$(D).children().eq(H);$("img","#cmd_goto_next_video").attr("src",$("img",C).attr("src"));$("img","#cmd_goto_previous_video").attr("src",$("img",A).attr("src"));$("#cmd_goto_next_video").addClass("hidden");$("#cmd_goto_previous_video").removeClass("hidden")}else{$("#cmd_goto_next_video").addClass("hidden");$("#cmd_goto_previous_video").addClass("hidden")}oPlayerInformation.init();oPlayerInformation.sVideoTitle=$(".title",M).text();oPlayerInformation.sPlaylistName=L;oPlayerInformation.sYoutubeId=$(M).attr("id").substr(4);oPlayerInformation.iMediaTypeId=$(".video_media_type_id",M).val();oPlayerInformation.iVideoDataId=$(".video_data_id",M).val();oPlayerInformation.render();ctlPlayerInformation.getVideoInformation();$(".now_playing").removeClass("now_playing");$("#pli_"+oPlayerInformation.sYoutubeId).addClass("now_playing");$("#sri_"+oPlayerInformation.sYoutubeId).addClass("now_playing");setTimeout(function(){ctlPlayer.loadVideo();ctlPlayer.playVideo()},1000);return false;break;case"PLAYING":if(sNowPlaying=="search"){return false}if(oPlayerInformation.sYoutubeId!=""){$(".now_playing").removeClass("now_playing");$("#pli_"+oPlayerInformation.sYoutubeId).addClass("now_playing");$("#sri_"+oPlayerInformation.sYoutubeId).addClass("now_playing")}else{if($("#identify_youtube_id").val()!=""){oPlayer.sYTVideoId=$("#identify_youtube_id").val();oPlayerInformation.init();oPlayerInformation.sVideoTitle=$("#current_video_title").text();oPlayerInformation.sPlaylistName=$("#current_playlist_name").text();oPlayerInformation.sYoutubeId=$("#identify_youtube_id").val();oPlayerInformation.iMediaTypeId=$("#identify_media_type_id").val();oPlayerInformation.iVideoDataId=$("#identify_video_data_id").val();oPlayerInformation.render();ctlPlayerInformation.getVideoInformation();$(".now_playing").removeClass("now_playing");$("#pli_"+$("#identify_youtube_id").val()).addClass("now_playing");$("#sri_"+$("#identify_youtube_id").val()).addClass("now_playing")}}if(sNowPlaying=="edit"){var D=$("#ep_playlist")}else{if(sNowPlaying=="current"){var D=$("#section-current_list")}}var I=$(D).children().length;var B=$(D).children().index($("#pli_"+oPlayerInformation.sYoutubeId));var H=((B-1)<0)?(I-1):(B-1);var K=((B+1)>I-1)?0:(B+1);oPlayer.iPlaylistIndex=B;if(I>1){var C=$(D).children().eq(K);var A=$(D).children().eq(H);$("img","#cmd_goto_next_video").attr("src",$("img",C).attr("src"));$("img","#cmd_goto_previous_video").attr("src",$("img",A).attr("src"));$("#cmd_goto_next_video").removeClass("hidden");$("#cmd_goto_previous_video").removeClass("hidden")}else{$("#cmd_goto_next_video").addClass("hidden");$("#cmd_goto_previous_video").addClass("hidden")}break;case"PAUSED":break;case"BUFFERING":break;case"IDLE":break;default:break}return }catch(J){publishException(J)}},loadVideo:function(){try{$(".video_search_form_small").parent().show();$("div.play").removeClass("loading");if(oSWFPlayer){var B=YOUTUBE_VIDEO_URL+oPlayer.sYTVideoId;var A={type:"youtube",file:B,title:"video name"};oSWFPlayer.sendEvent("LOAD",A);return true}}catch(C){publishException(C)}},playVideo:function(){try{if(oSWFPlayer){var A=oSWFPlayer.getConfig();if(A.state=="IDLE"||A.state=="BUFFERING"){oSWFPlayer.sendEvent("PLAY")}}return true}catch(B){publishException(B)}},handleError:function(C){try{var A=C.message;return true}catch(B){publishException(B)}}};var ctlPasswordResetForm={submit:function(){try{var F=true;var B=new Array();var G=$("#pwd_reset_email_address").val().trim();var C=$("#pwd_reset_password").val().trim();var D=$("#pwd_reset_password_confirm").val().trim();var H=$("#k").val().trim();if(G==""){B[B.length]="Email Address is required."}else{if(!isValidEmailAddress(G)){B[B.length]="The email address you provided is not valid."}}if(C==""){B[B.length]="Password is required."}else{if(D==""){B[B.length]="Please confirm your password."}else{if(D!=C){B[B.length]="The passwords you entered do not match."}}}if(B.length>0){displayMessages(B);return false}var A={cmd_reset_password:true,txt_email_address:G,txt_password:C,hdn_hash:H};$("#cmd_submit_password_reset").addClass("submitting");$.ajax({type:"GET",url:sAJAXURL+"/Password.php",dataType:"json",data:A,success:function(J){I(J)},error:handleAjaxError});function I(J){try{$("#cmd_submit_password_reset").removeClass("submitting");if(J.iReturn!=1){displayMessages(J.aMessages);return false}$("#password-reset-message").html('Your password has been reset. <a href="/">Back to Jooque!</a>');return false}catch(K){publishException(K)}}return false}catch(E){publishException(E)}}};var ctlPlayerContainer={registerSmartEvent:function(){try{if(oPlayerContainer.currentMode==oPlayerContainer.MODE_SMART){ctlPlayerContainer.setupSearchMode()}return false}catch(A){publishException(A)}},gotoPlayMode:function(){try{oPlayerContainer.currentMode=oPlayerContainer.MODE_PLAY;ctlPlayerContainer.setupPlayMode();oPlayerContainer.render();return false}catch(A){publishException(A)}},gotoSearchMode:function(){try{oPlayerContainer.currentMode=oPlayerContainer.MODE_SEARCH;ctlPlayerContainer.setupSearchMode();oPlayerContainer.render();return false}catch(A){publishException(A)}},gotoFullscreenMode:function(){try{if(oSWFPlayer){oSWFPlayer.sendEvent("FULLSCREEN")}}catch(A){publishException(A)}},gotoSmartMode:function(){try{var A=new Date();oPlayerContainer.smartTime=A.getTime();if(oPlayerContainer.smartState!=oPlayerContainer.MODE_SEARCH){ctlPlayerContainer.setupSearchMode()}oPlayerContainer.smartState=oPlayerContainer.MODE_SEARCH;oPlayerContainer.currentMode=oPlayerContainer.MODE_SMART;oPlayerContainer.render();return false}catch(B){publishException(B)}},setupPlayMode:function(){try{$("#current_content-video").removeClass("search_mode");$("#current_content-video").addClass("play_mode");$("#current_content").addClass("wide");if(oSWFPlayer){$("#oSWFPlayer").css("width",FLASH_PLAYER_LARGE_WIDTH+"px");$("#oSWFPlayer").css("height",FLASH_PLAYER_LARGE_HEIGHT+"px")}}catch(A){publishException(A)}},setupSearchMode:function(){try{$("#current_content-video").removeClass("play_mode");$("#current_content-video").addClass("search_mode");$("#current_content").removeClass("wide");if(oSWFPlayer){$("#oSWFPlayer").css("width",FLASH_PLAYER_SMALL_WIDTH+"px");$("#oSWFPlayer").css("height",FLASH_PLAYER_SMALL_HEIGHT+"px")}}catch(A){publishException(A)}}};var ctlPlayerIdentify={handleSongBlur:function(){try{if($(this).val().trim()==""){$(this).val(IDENTIFY_SONG)}return false}catch(A){publishException(A)}},handleArtistBlur:function(){try{if($(this).val().trim()==""){$(this).val(IDENTIFY_ARTIST)}return false}catch(A){publishException(A)}},handleSongFocus:function(){try{if($(this).val().trim()==IDENTIFY_SONG){$(this).val("")}return false}catch(A){publishException(A)}},handleArtistFocus:function(){try{if($(this).val().trim()==IDENTIFY_ARTIST){$(this).val("")}return false}catch(A){publishException(A)}},confirm:function(){try{var A={cmd_video_data_confirm:true,mid:readCookie("mid"),session_guid:readCookie("session_guid"),video_data_id:oPlayerInformation.iVideoDataId};$.ajax({type:"GET",url:sAJAXURL+"/Video.php",dataType:"json",data:A,success:function(D){C(D)},error:handleAjaxError});oPlayerIdentify.hide();function C(D){if(D.iReturn!=AJAX_SUCCESS){return false}oPlayerPurchase.render()}return false}catch(B){publishException(B)}},reject:function(){try{oPlayerIdentify.iStep=2;oPlayerIdentify.render();return false}catch(A){publishException(A)}},unknown:function(){try{oPlayerPurchase.bUnknown=true;oPlayerPurchase.render();return false}catch(A){publishException(A)}},suggest:function(){try{var A={cmd_video_data_suggest:true,mid:readCookie("mid"),session_guid:readCookie("session_guid"),youtube_id:oPlayerInformation.sYoutubeId,song:$("#txt_identify_song").val().trim(),artist:$("#txt_identify_artist").val().trim(),media_type_id:oPlayerInformation.iMediaTypeId};$.ajax({type:"GET",url:sAJAXURL+"/Video.php",dataType:"json",data:A,success:function(D){C(D)},error:handleAjaxError});function C(D){if(D.iReturn!=AJAX_SUCCESS){return false}oPlayerInformation.iVideoDataId=D.video_data_id;oPlayerInformation.sSong=D.song;oPlayerInformation.sArtist=D.artist;oPlayerInformation.bIsConfirmed=D.is_confirmed;oPlayerInformation.iMediaTypeId=D.media_type_id;oPlayerPurchase.render()}return false}catch(B){publishException(B)}}};var ctlPlayerInformation={getVideoInformation:function(){try{if(oPlayerInformation.iVideoDataId<1){var D=oPlayerInformation.sVideoTitle;var A=oPlayerInformation.sYoutubeId;var B=oPlayerInformation.iMediaTypeId;if(D==""){D=$("#identify_video_title").val().trim()}if(A==""){A=$("#identify_youtube_id").val().trim()}if(B<1){B=$("#identify_media_type_id").val().trim()}var C={cmd_retrieve_video_data:true,mid:readCookie("mid"),session_guid:readCookie("session_guid"),title:D,youtube_id:A,media_type_id:B};$.ajax({type:"GET",url:sAJAXURL+"/Video.php",dataType:"json",data:C,success:function(G){F(G)},error:handleAjaxError});function F(G){if(G.iReturn!=AJAX_SUCCESS){return false}oPlayerInformation.iVideoDataId=G.video_data_id;oPlayerInformation.sSong=G.song;oPlayerInformation.sArtist=G.artist;oPlayerInformation.bIsConfirmed=G.is_confirmed;oPlayerInformation.iMediaTypeId=G.media_type_id;oPlayerInformation.sYoutubeId=G.youtube_id;if(oPlayerInformation.bIsConfirmed&&oPlayerInformation.iMediaTypeId==1){oPlayerPurchase.render();oPlayerIdentify.hide()}else{if(oPlayerInformation.iMediaTypeId==1&&G.song!=""&&G.artist!=""){oPlayerPurchase.hide();oPlayerIdentify.iStep=1;oPlayerIdentify.render()}else{if(oPlayerInformation.iMediaTypeId==1){oPlayerPurchase.hide();oPlayerIdentify.iStep=2;oPlayerIdentify.render()}else{oPlayerPurchase.hide();oPlayerIdentify.hide()}}}return true}return false}}catch(E){publishException(E)}}};var ctlPlayerPurchase={};var ctlPlaylistItem={gotoNextVideo:function(){try{if(sNowPlaying=="search"){return false}oPlayerInformation.init();if(sNowPlaying=="edit"){var E=$("#ep_playlist");oPlayerInformation.sPlaylistName=$("#txt_playlist_name").val()}else{if(sNowPlaying=="current"){var E=$("#section-current_list");oPlayerInformation.sPlaylistName=$("#section-current_playlist-name").text()}}var B=$(E).children().length;var A=oPlayer.iPlaylistIndex+1;if(A>=B){A=0}var C=$(E).children().eq(A);ctlPlaylistItem.loadVideo(C,A);return false}catch(D){publishException(D)}},gotoPreviousVideo:function(){try{if(sNowPlaying=="search"){return false}oPlayerInformation.init();if(sNowPlaying=="edit"){var E=$("#ep_playlist");oPlayerInformation.sPlaylistName=$("#txt_playlist_name").val()}else{if(sNowPlaying=="current"){var E=$("#section-current_list");oPlayerInformation.sPlaylistName=$("#section-current_playlist-name").text()}}var B=$(E).children().length;var A=oPlayer.iPlaylistIndex-1;if(A<0){A=B-1}var C=$(E).children().eq(A);ctlPlaylistItem.loadVideo(C,A);return false}catch(D){publishException(D)}},play:function(){try{var C=$(this).parent().parent();var E=$(C).parent();oPlayerInformation.init();if($(E).attr("id")=="ep_playlist"){sNowPlaying="edit";oPlayerInformation.sPlaylistName=($("#txt_playlist_name").val()!=PLAYLIST_NAME_TEXT)?$("#txt_playlist_name").val():""}else{if($(E).attr("id")=="section-current_list"){sNowPlaying="current";oPlayerInformation.sPlaylistName=$("#section-current_playlist-name").text()}}var B=$(E).children().length;var A=$(E).children().index(C);$(this).addClass("loading");ctlPlaylistItem.loadVideo(C,A);oPlayerContainer.display();return false}catch(D){publishException(D)}},loadVideo:function(C,A){try{var B=$(".video_youtube_id",C).eq(0).val();oPlayer.iPlaylistIndex=A;oPlayer.sYTVideoId=B;setTimeout(function(){ctlPlayer.loadVideo();ctlPlayer.playVideo()},500);oPlayerInformation.sVideoTitle=$(".title",C).text();oPlayerInformation.sYoutubeId=B;oPlayerInformation.iMediaTypeId=$(".video_media_type_id",C).val();oPlayerInformation.iVideoDataId=$(".video_data_id",C).val();oPlayerInformation.render();$(".now_playing").removeClass("now_playing");$("#pli_"+oPlayerInformation.sYoutubeId).addClass("now_playing");$("#sri_"+oPlayerInformation.sYoutubeId).addClass("now_playing");oPlayerInformation.render();ctlPlayerInformation.getVideoInformation()}catch(D){publishException(D)}}};var ctlPlaylistList={vote:function(D,A,C){try{if(!isUserLoggedIn()){displayMessages("Please login to rate a playlist.");return false}var B={cmd_submit_playist_rating:true,mid:readCookie("mid"),session_guid:readCookie("session_guid"),playlist_id:$("#hdn_current_playlist_id").val(),rating:C};$.ajax({type:"GET",url:sAJAXURL+"/Playlist.php",dataType:"json",data:B,error:handleAjaxError});return false}catch(E){publishException(E)}},selectPlaylist:function(){try{window.location=$("a",this).eq(0).attr("href");return true}catch(A){publishException(A)}},loadPlaylist:function(A){try{var B={cmd_retrieve_playlist:true,mid:readCookie("mid"),session_guid:readCookie("session_guid"),playlist_id:A};$.ajax({type:"GET",url:sAJAXURL+"/Playlist.php",dataType:"json",data:B,success:function(E){D(E)},error:handleAjaxError});$("div.edit").addClass("loading");function D(E){if(E.iReturn!=AJAX_SUCCESS){displayMessages(E.aMessages);return false}oPlaylist=new mdlPlaylist();oPlaylist.iId=E.playlist_id;oPlaylist.sOwner=E.playlist_owner;oPlaylist.sName=E.playlist_name;oPlaylist.iDuration=E.playlist_duration;oPlaylist.sDescription=E.playlist_description;oPlaylist.sKeywords=E.playlist_keywords;oPlaylist.bIsPublic=E.playlist_is_public;oPlaylist.bPublishedToFacebook=E.playlist_published_to_facebook;oPlaylist.aPlaylistItems=E.playlist_items;oPlaylist.bIsNew=false;oPlaylist.bIsDirty=false;oEditPlaylist=new EditPlaylist();oEditPlaylist.oPlaylist=oPlaylist;oEditPlaylist.render();$("div.edit").removeClass("loading");$("#img_ico_edit_playlist").attr("src","/img/xhtmlized/ico-edit.png");return }return false}catch(C){publishException(C)}},deletePlaylist:function(){try{if(!confirm("Are you sure you want to delete this playlist?")){return false}var A=$(this).parent().parent().attr("id").substr(9);var B={cmd_delete_playlist:true,playlist_id:A,mid:readCookie("mid"),session_guid:readCookie("session_guid")};$("#playlist_"+A).remove();$.ajax({type:"GET",url:sAJAXURL+"/Playlist.php",dataType:"json",data:B,success:function(E){D(E)},error:handleAjaxError});function D(E){if(E.iReturn!=AJAX_SUCCESS){return false}return true}}catch(C){publishException(C)}}};var ctlPlaylistSearchForm={handleSearchTermBlur:function(){try{if($(this).val().trim()==""){$(this).val(PLAYLIST_SEARCH_TERM_TEXT)}}catch(A){publishException(A)}},handleSearchTermFocus:function(){try{if($(this).val().trim()==PLAYLIST_SEARCH_TERM_TEXT){$(this).val("")}}catch(A){publishException(A)}},handleSearchSubmit:function(){try{if(($(".txt_playlist_search_term",$(this)).eq(0).val().trim()==PLAYLIST_SEARCH_TERM_TEXT)||($(".txt_playlist_search_term",$(this)).eq(0).val().trim()=="")){displayMessages(new Array("Please enter a search term."));$(".txt_playlist_search_term",$(this)).eq(0).val(PLAYLIST_SEARCH_TERM_TEXT);return false}oVideoSearchResults.sSearchTerm=$(".txt_playlist_search_term",$(this)).eq(0).val().trim();oVideoSearchResults.iPageNumber=1;var A={cmd_search_playlists:true,mid:readCookie("mid"),keywords:$(".txt_playlist_search_term",$(this)).eq(0).val().trim(),page_number:1,session_guid:readCookie("session_guid")};$(".cmd_playlist_search_submit",this).attr("src","/img/loading_32.gif");$.ajax({type:"GET",url:sAJAXURL+"/Playlist.php",dataType:"json",data:A,success:function(D){C(D)},error:handleAjaxError});function C(D){if(D.iReturn!=AJAX_SUCCESS){return false}oPlaylistSearchResults.oData=D.playlists;oPlaylistSearchResults.render();$(".cmd_playlist_search_submit").attr("src","/img/xhtmlized/videos_browser-search-btn-dark.png");$("#navigation").tabs("select",1);return true}return false}catch(B){publishException(B)}}};var ctlPlaylistSearchResults={startSorting:function(){try{}catch(A){publishException(A)}},gotoNextPage:function(){try{oPlaylistSearchResults.iPageNumber=oPlaylistSearchResults.iPageNumber+1;$("#playlist_search_results_controls").removeClass("active").addClass("processing");ctlPlaylistSearchResults.getPage(function(B){oPlaylistSearchResults.oData=B;$("#playlist_playlist_search_results_controls").removeClass("processing").addClass("active");oPlaylistSearchResults.render()});return false}catch(A){publishException(A)}},gotoPreviousPage:function(){try{oPlaylistSearchResults.iPageNumber=oPlaylistSearchResults.iPageNumber-1;if(oPlaylistSearchResults.iPageNumber<1){oPlaylistSearchResults.iPageNumber=1}$("#search_results_controls").removeClass("active").addClass("processing");ctlPlaylistSearchResults.getPage(function(B){oPlaylistSearchResults.oData=B;$("#search_results_controls").removeClass("processing").addClass("active");oPlaylistSearchResults.render()});return false}catch(A){publishException(A)}},getPage:function(C){try{var A=formatYoutubeSearchUrl(oPlaylistSearchResults.sSearchTerm,oPlaylistSearchResults.iPageNumber);$.ajax({url:A,dataType:"jsonp",success:function(D){C(D)},error:handleAjaxError})}catch(B){publishException(B)}}};var ctlVideoSearchForm={handleSearchTermBlur:function(){try{if($(this).val().trim()==""){$(this).val(VIDEO_SEARCH_TERM_TEXT)}}catch(A){publishException(A)}},handleSearchTermFocus:function(){try{if($(this).val().trim()==VIDEO_SEARCH_TERM_TEXT){$(this).val("")}else{$(this).select()}}catch(A){publishException(A)}},handleSearchSubmit:function(){try{if(($(".txt_video_search_term",$(this)).eq(0).val().trim()==VIDEO_SEARCH_TERM_TEXT)||($(".txt_video_search_term",$(this)).eq(0).val().trim()=="")){displayMessages(new Array("Please enter a few search keywords"));$(".txt_search_term",$(this)).eq(0).val(VIDEO_SEARCH_TERM_TEXT);return false}oVideoSearchResults.sSearchTerm=$(".txt_video_search_term",$(this)).eq(0).val().trim();oVideoSearchResults.iPageNumber=1;$(".txt_video_search_term").val(oVideoSearchResults.sSearchTerm);var A=formatYoutubeSearchUrl(oVideoSearchResults.sSearchTerm,oVideoSearchResults.iPageNumber);$(".cmd_video_search_submit",this).attr("src","/img/loading_32.gif");$.ajax({url:A,dataType:"jsonp",success:function(C){oVideoSearchResults.oData=C;oVideoSearchResults.render();$(".cmd_video_search_submit").attr("src","/img/xhtmlized/videos_browser-search-btn.png");$("#navigation").tabs("select",1)},error:handleAjaxError});return false}catch(B){publishException(B)}}};var ctlVideoSearchResults={startSorting:function(){try{}catch(A){publishException(A)}},gotoNextPage:function(){try{oVideoSearchResults.iPageNumber=oVideoSearchResults.iPageNumber+1;$("#video_search_results_controls").removeClass("active").addClass("processing");ctlVideoSearchResults.getPage(function(B){oVideoSearchResults.oData=B;$("#video_search_results_controls").removeClass("processing").addClass("active");oVideoSearchResults.render()});return false}catch(A){publishException(A)}},gotoPreviousPage:function(){try{oVideoSearchResults.iPageNumber=oVideoSearchResults.iPageNumber-1;if(oVideoSearchResults.iPageNumber<1){oVideoSearchResults.iPageNumber=1}$("#search_results_controls").removeClass("active").addClass("processing");ctlVideoSearchResults.getPage(function(B){oVideoSearchResults.oData=B;$("#search_results_controls").removeClass("processing").addClass("active");oVideoSearchResults.render()});return false}catch(A){publishException(A)}},getPage:function(C){try{var A=formatYoutubeSearchUrl(oVideoSearchResults.sSearchTerm,oVideoSearchResults.iPageNumber);$.ajax({url:A,dataType:"jsonp",success:function(D){C(D)},error:handleAjaxError})}catch(B){publishException(B)}}};