/*!
 * Bits on the Run UI Javascript
 * Copyright 2010, Roel Meurders, Longtail AD Solutions, New York, USA
 *
 * This javascript includes the following third party scripts:
 *      - jQuery Javascript Library v1.4.2
 *        Copyright (c) 2010 John Resig
 *        http://jquery.com/
 *      - AJAX Upload
 *        Copyright (c) Andris Valums
 *        http://valums.com/ajax-upload/
 *      - jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 
 *        Copyright (c) 2010 "Cowboy" Ben Alman
 *        http://benalman.com/projects/jquery-bbq-plugin/
 *      - Cookies
 *        Copyright (c) 2005 - 2010, James Auldridge version 2.2.0
 *        http://code.google.com/p/cookies/
 *      - Parts of jQuery UI Effects 1.8
 *        Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 *        http://docs.jquery.com/UI/Effects/
 *      - Date Input 1.2.1
 *        Copyright (c) 2007-2008 Jonathan Leighton & Torchbox Ltd
 *        http://jonathanleighton.com/projects/date-input
 *
 * All the above third party scripts were released under the MIT License,
 *
 */

LOCALES["default"]={ready:"ready",failed:"failed",processing:"processing",updating:"updating",embed:"embed",del:"delete",publish:"publish",working:"working",video:"video",playlist:"playlist",duplicate:"duplicate",player:"player",name:"name",value:"value",manual:"manual",dynamic:"dynamic",none:"none",bottom:"bottom",right:"right",over:"over",ie_warning_1:"You are using Internet Explorer 1#VERSION#. We do not support IE below version 7",ie_warning_2:"You can still use this site, but beware of the limitations!",
one_moment_please:"one moment please",close_overlay:"close overlay",select_frame_at:"Select frame at 1#TIME#",confirm_delete:"Are you sure you want to delete this 1#ITEM_NAME#?",confirm_delete_original_video:"Warning: when you delete your original file, you cannot create additional conversions or thumbnails.\n\nAre you sure you want to delete your original?",conversion_failed_notice:"Please note that the conversion of this media file has failed (%ERROR%). Contact us if you think this is shouldn't happen.",
publish_title:"Publish this conversion",transcoding_in_progress:"Transcoding in progress...",transcoding_failed_contact_us:"Transcoding failed, please contact us.",drag_drop_info:"Drag a video from the list below and drop it here to add it to your channel.",no_videos_found:'No videos where found that matched your search for "1#TEXT#".',delete_from_channel:"Delete video from playlist",signed_players_warning:"Be aware that all regular embed codes stop working when securing players. See our contentserver documentation for more info on how to publish signed players.",
delete_template_warning:"Warning: If you delete this template, all transcoded files built with this template will also be deleted. Are you sure?",audio_quality_estimate:"Audio in this quality will be <strong>about 1#BITRATE# kbps</strong>.",video_quality_estimate:"Video in this quality will be <strong>about 1#BITRATE# kbps</strong>.",customvars_name_error:"A name can contain letters, numbers, a point (.), a dash (-) and and underscore. A name must start with a letter",customvars_no_name_set:"Please set a name for this value. Without name the value will not be saved.",
date_input_months:["January","February","March","April","May","June","July","August","September","October","November","December"],date_input_months_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],date_input_days:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_thousands_sep:",",_decimal_point:".",empty:""};
function _(d){d=typeof LOCALES[LANGUAGE]=="undefined"||typeof LOCALES[LANGUAGE][d]=="undefined"?LOCALES["default"][d]:LOCALES[LANGUAGE][d];if(arguments.length>1)for(i=1;i<arguments.length;i++)d=d.replace(new RegExp(i+"#[A-Z_]+#","g"),arguments[i]);return d}function _nr(d){d+="";d=d.split(".");for(var h=d[0],m=/(\d+)(\d{3})/;m.test(h);)h=h.replace(m,"$1"+_("_thousands_sep")+"$2");if(d.length>1)h=h+_("_decimal_point")+d[1];return h}
(function(d,h){function m(){if(!f.isReady){try{G.documentElement.doScroll("left")}catch(b){setTimeout(m,1);return}f.ready()}}function p(b,e){e.src?f.ajax({url:e.src,async:false,dataType:"script"}):f.globalEval(e.text||e.textContent||e.innerHTML||"");e.parentNode&&e.parentNode.removeChild(e)}function E(b,e,g,k,l,o){var q=b.length;if(typeof e==="object"){for(var z in e)E(b,z,e[z],k,l,g);return b}if(g!==h){k=!o&&k&&f.isFunction(g);for(z=0;z<q;z++)l(b[z],e,k?g.call(b[z],z,l(b[z],e)):g,o);return b}return q?
l(b[0],e):h}function B(){return(new Date).getTime()}function I(){return false}function u(){return true}function F(b,e,g){g[0].type=b;return f.event.handle.apply(e,g)}function J(b){var e,g=[],k=[],l=arguments,o,q,z,w,A,H;q=f.data(this,"events");if(!(b.liveFired===this||!q||!q.live||b.button&&b.type==="click")){b.liveFired=this;var S=q.live.slice(0);for(w=0;w<S.length;w++){q=S[w];q.origType.replace(wa,"")===b.type?k.push(q.selector):S.splice(w--,1)}o=f(b.target).closest(k,b.currentTarget);A=0;for(H=
o.length;A<H;A++)for(w=0;w<S.length;w++){q=S[w];if(o[A].selector===q.selector){z=o[A].elem;k=null;if(q.preType==="mouseenter"||q.preType==="mouseleave")k=f(b.relatedTarget).closest(q.selector)[0];if(!k||k!==z)g.push({elem:z,handleObj:q})}}A=0;for(H=g.length;A<H;A++){o=g[A];b.currentTarget=o.elem;b.data=o.handleObj.data;b.handleObj=o.handleObj;if(o.handleObj.origHandler.apply(o.elem,l)===false){e=false;break}}return e}}function P(b,e){return"live."+(b&&b!=="*"?b+".":"")+e.replace(/\./g,"`").replace(/ /g,
"&")}function U(b,e){var g=0;e.each(function(){if(this.nodeName===(b[g]&&b[g].nodeName)){var k=f.data(b[g++]),l=f.data(this,k);if(k=k&&k.events){delete l.handle;l.events={};for(var o in k)for(var q in k[o])f.event.add(this,o,k[o][q],k[o][q].data)}}})}function Q(b,e,g){var k,l,o;e=e&&e[0]?e[0].ownerDocument||e[0]:G;if(b.length===1&&typeof b[0]==="string"&&b[0].length<512&&e===G&&!Oa.test(b[0])&&(f.support.checkClone||!Pa.test(b[0]))){l=true;if(o=f.fragments[b[0]])if(o!==1)k=o}if(!k){k=e.createDocumentFragment();
f.clean(b,e,k,g)}if(l)f.fragments[b[0]]=o?k:1;return{fragment:k,cacheable:l}}function X(b,e){var g={};f.each(Qa.concat.apply([],Qa.slice(0,e)),function(){g[this]=b});return g}function ma(b){return"scrollTo"in b&&b.document?b:b.nodeType===9?b.defaultView||b.parentWindow:false}var f=function(b,e){return new f.fn.init(b,e)},oa=d.jQuery,fa=d.$,G=d.document,da,ia=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,xa=/^.[^:#\[\.,]*$/,pa=/\S/,za=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Aa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,qa=navigator.userAgent,
Ba=false,L=[],O,R=Object.prototype.toString,V=Object.prototype.hasOwnProperty,ga=Array.prototype.push,ba=Array.prototype.slice,Z=Array.prototype.indexOf;f.fn=f.prototype={init:function(b,e){var g,k,l;if(!b)return this;if(b.nodeType){this.context=this[0]=b;this.length=1;return this}if(b==="body"&&!e){this.context=G;this[0]=G.body;this.selector="body";this.length=1;return this}if(typeof b==="string")if((g=ia.exec(b))&&(g[1]||!e))if(g[1]){l=e?e.ownerDocument||e:G;if(k=Aa.exec(b))if(f.isPlainObject(e)){b=
[G.createElement(k[1])];f.fn.attr.call(b,e,true)}else b=[l.createElement(k[1])];else{k=Q([g[1]],[l]);b=(k.cacheable?k.fragment.cloneNode(true):k.fragment).childNodes}return f.merge(this,b)}else{if(k=G.getElementById(g[2])){if(k.id!==g[2])return da.find(b);this.length=1;this[0]=k}this.context=G;this.selector=b;return this}else if(!e&&/^\w+$/.test(b)){this.selector=b;this.context=G;b=G.getElementsByTagName(b);return f.merge(this,b)}else return!e||e.jquery?(e||da).find(b):f(e).find(b);else if(f.isFunction(b))return da.ready(b);
if(b.selector!==h){this.selector=b.selector;this.context=b.context}return f.makeArray(b,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return ba.call(this,0)},get:function(b){return b==null?this.toArray():b<0?this.slice(b)[0]:this[b]},pushStack:function(b,e,g){var k=f();f.isArray(b)?ga.apply(k,b):f.merge(k,b);k.prevObject=this;k.context=this.context;if(e==="find")k.selector=this.selector+(this.selector?" ":"")+g;else if(e)k.selector=this.selector+
"."+e+"("+g+")";return k},each:function(b,e){return f.each(this,b,e)},ready:function(b){f.bindReady();if(f.isReady)b.call(G,f);else L&&L.push(b);return this},eq:function(b){return b===-1?this.slice(b):this.slice(b,+b+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(ba.apply(this,arguments),"slice",ba.call(arguments).join(","))},map:function(b){return this.pushStack(f.map(this,function(e,g){return b.call(e,g,e)}))},end:function(){return this.prevObject||
f(null)},push:ga,sort:[].sort,splice:[].splice};f.fn.init.prototype=f.fn;f.extend=f.fn.extend=function(){var b=arguments[0]||{},e=1,g=arguments.length,k=false,l,o,q,z;if(typeof b==="boolean"){k=b;b=arguments[1]||{};e=2}if(typeof b!=="object"&&!f.isFunction(b))b={};if(g===e){b=this;--e}for(;e<g;e++)if((l=arguments[e])!=null)for(o in l){q=b[o];z=l[o];if(b!==z)if(k&&z&&(f.isPlainObject(z)||f.isArray(z))){q=q&&(f.isPlainObject(q)||f.isArray(q))?q:f.isArray(z)?[]:{};b[o]=f.extend(k,q,z)}else if(z!==h)b[o]=
z}return b};f.extend({noConflict:function(b){d.$=fa;if(b)d.jQuery=oa;return f},isReady:false,ready:function(){if(!f.isReady){if(!G.body)return setTimeout(f.ready,13);f.isReady=true;if(L){for(var b,e=0;b=L[e++];)b.call(G,f);L=null}f.fn.triggerHandler&&f(G).triggerHandler("ready")}},bindReady:function(){if(!Ba){Ba=true;if(G.readyState==="complete")return f.ready();if(G.addEventListener){G.addEventListener("DOMContentLoaded",O,false);d.addEventListener("load",f.ready,false)}else if(G.attachEvent){G.attachEvent("onreadystatechange",
O);d.attachEvent("onload",f.ready);var b=false;try{b=d.frameElement==null}catch(e){}G.documentElement.doScroll&&b&&m()}}},isFunction:function(b){return R.call(b)==="[object Function]"},isArray:function(b){return R.call(b)==="[object Array]"},isPlainObject:function(b){if(!b||R.call(b)!=="[object Object]"||b.nodeType||b.setInterval)return false;if(b.constructor&&!V.call(b,"constructor")&&!V.call(b.constructor.prototype,"isPrototypeOf"))return false;var e;for(e in b);return e===h||V.call(b,e)},isEmptyObject:function(b){for(var e in b)return false;
return true},error:function(b){throw b;},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=f.trim(b);if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return d.JSON&&d.JSON.parse?d.JSON.parse(b):(new Function("return "+b))();else f.error("Invalid JSON: "+b)},noop:function(){},globalEval:function(b){if(b&&pa.test(b)){var e=G.getElementsByTagName("head")[0]||
G.documentElement,g=G.createElement("script");g.type="text/javascript";if(f.support.scriptEval)g.appendChild(G.createTextNode(b));else g.text=b;e.insertBefore(g,e.firstChild);e.removeChild(g)}},nodeName:function(b,e){return b.nodeName&&b.nodeName.toUpperCase()===e.toUpperCase()},each:function(b,e,g){var k,l=0,o=b.length,q=o===h||f.isFunction(b);if(g)if(q)for(k in b){if(e.apply(b[k],g)===false)break}else for(;l<o;){if(e.apply(b[l++],g)===false)break}else if(q)for(k in b){if(e.call(b[k],k,b[k])===false)break}else for(g=
b[0];l<o&&e.call(g,l,g)!==false;g=b[++l]);return b},trim:function(b){return(b||"").replace(za,"")},makeArray:function(b,e){var g=e||[];if(b!=null)b.length==null||typeof b==="string"||f.isFunction(b)||typeof b!=="function"&&b.setInterval?ga.call(g,b):f.merge(g,b);return g},inArray:function(b,e){if(e.indexOf)return e.indexOf(b);for(var g=0,k=e.length;g<k;g++)if(e[g]===b)return g;return-1},merge:function(b,e){var g=b.length,k=0;if(typeof e.length==="number")for(var l=e.length;k<l;k++)b[g++]=e[k];else for(;e[k]!==
h;)b[g++]=e[k++];b.length=g;return b},grep:function(b,e,g){for(var k=[],l=0,o=b.length;l<o;l++)!g!==!e(b[l],l)&&k.push(b[l]);return k},map:function(b,e,g){for(var k=[],l,o=0,q=b.length;o<q;o++){l=e(b[o],o,g);if(l!=null)k[k.length]=l}return k.concat.apply([],k)},guid:1,proxy:function(b,e,g){if(arguments.length===2)if(typeof e==="string"){g=b;b=g[e];e=h}else if(e&&!f.isFunction(e)){g=e;e=h}if(!e&&b)e=function(){return b.apply(g||this,arguments)};if(b)e.guid=b.guid=b.guid||e.guid||f.guid++;return e},
uaMatch:function(b){b=b.toLowerCase();b=/(webkit)[ \/]([\w.]+)/.exec(b)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(b)||/(msie) ([\w.]+)/.exec(b)||!/compatible/.test(b)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(b)||[];return{browser:b[1]||"",version:b[2]||"0"}},browser:{}});qa=f.uaMatch(qa);if(qa.browser){f.browser[qa.browser]=true;f.browser.version=qa.version}if(f.browser.webkit)f.browser.safari=true;if(Z)f.inArray=function(b,e){return Z.call(e,b)};da=f(G);if(G.addEventListener)O=function(){G.removeEventListener("DOMContentLoaded",
O,false);f.ready()};else if(G.attachEvent)O=function(){if(G.readyState==="complete"){G.detachEvent("onreadystatechange",O);f.ready()}};(function(){f.support={};var b=G.documentElement,e=G.createElement("script"),g=G.createElement("div"),k="script"+B();g.style.display="none";g.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var l=g.getElementsByTagName("*"),o=g.getElementsByTagName("a")[0];if(!(!l||!l.length||!o)){f.support=
{leadingWhitespace:g.firstChild.nodeType===3,tbody:!g.getElementsByTagName("tbody").length,htmlSerialize:!!g.getElementsByTagName("link").length,style:/red/.test(o.getAttribute("style")),hrefNormalized:o.getAttribute("href")==="/a",opacity:/^0.55$/.test(o.style.opacity),cssFloat:!!o.style.cssFloat,checkOn:g.getElementsByTagName("input")[0].value==="on",optSelected:G.createElement("select").appendChild(G.createElement("option")).selected,parentNode:g.removeChild(g.appendChild(G.createElement("div"))).parentNode===
null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(G.createTextNode("window."+k+"=1;"))}catch(q){}b.insertBefore(e,b.firstChild);if(d[k]){f.support.scriptEval=true;delete d[k]}try{delete e.test}catch(z){f.support.deleteExpando=false}b.removeChild(e);if(g.attachEvent&&g.fireEvent){g.attachEvent("onclick",function w(){f.support.noCloneEvent=false;g.detachEvent("onclick",w)});g.cloneNode(true).fireEvent("onclick")}g=G.createElement("div");
g.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";b=G.createDocumentFragment();b.appendChild(g.firstChild);f.support.checkClone=b.cloneNode(true).cloneNode(true).lastChild.checked;f(function(){var w=G.createElement("div");w.style.width=w.style.paddingLeft="1px";G.body.appendChild(w);f.boxModel=f.support.boxModel=w.offsetWidth===2;G.body.removeChild(w).style.display="none"});b=function(w){var A=G.createElement("div");w="on"+w;var H=w in A;if(!H){A.setAttribute(w,"return;");H=typeof A[w]===
"function"}return H};f.support.submitBubbles=b("submit");f.support.changeBubbles=b("change");b=e=g=l=o=null}})();f.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var ca="jQuery"+B(),ta=0,na={};f.extend({cache:{},expando:ca,noData:{embed:true,object:true,applet:true},data:function(b,e,g){if(!(b.nodeName&&f.noData[b.nodeName.toLowerCase()])){b=
b==d?na:b;var k=b[ca],l=f.cache;if(!k&&typeof e==="string"&&g===h)return null;k||(k=++ta);if(typeof e==="object"){b[ca]=k;l[k]=f.extend(true,{},e)}else if(!l[k]){b[ca]=k;l[k]={}}b=l[k];if(g!==h)b[e]=g;return typeof e==="string"?b[e]:b}},removeData:function(b,e){if(!(b.nodeName&&f.noData[b.nodeName.toLowerCase()])){b=b==d?na:b;var g=b[ca],k=f.cache,l=k[g];if(e){if(l){delete l[e];f.isEmptyObject(l)&&f.removeData(b)}}else{if(f.support.deleteExpando)delete b[f.expando];else b.removeAttribute&&b.removeAttribute(f.expando);
delete k[g]}}}});f.fn.extend({data:function(b,e){if(typeof b==="undefined"&&this.length)return f.data(this[0]);else if(typeof b==="object")return this.each(function(){f.data(this,b)});var g=b.split(".");g[1]=g[1]?"."+g[1]:"";if(e===h){var k=this.triggerHandler("getData"+g[1]+"!",[g[0]]);if(k===h&&this.length)k=f.data(this[0],b);return k===h&&g[1]?this.data(g[0]):k}else return this.trigger("setData"+g[1]+"!",[g[0],e]).each(function(){f.data(this,b,e)})},removeData:function(b){return this.each(function(){f.removeData(this,
b)})}});f.extend({queue:function(b,e,g){if(b){e=(e||"fx")+"queue";var k=f.data(b,e);if(!g)return k||[];if(!k||f.isArray(g))k=f.data(b,e,f.makeArray(g));else k.push(g);return k}},dequeue:function(b,e){e=e||"fx";var g=f.queue(b,e),k=g.shift();if(k==="inprogress")k=g.shift();if(k){e==="fx"&&g.unshift("inprogress");k.call(b,function(){f.dequeue(b,e)})}}});f.fn.extend({queue:function(b,e){if(typeof b!=="string"){e=b;b="fx"}if(e===h)return f.queue(this[0],b);return this.each(function(){var g=f.queue(this,
b,e);b==="fx"&&g[0]!=="inprogress"&&f.dequeue(this,b)})},dequeue:function(b){return this.each(function(){f.dequeue(this,b)})},delay:function(b,e){b=f.fx?f.fx.speeds[b]||b:b;e=e||"fx";return this.queue(e,function(){var g=this;setTimeout(function(){f.dequeue(g,e)},b)})},clearQueue:function(b){return this.queue(b||"fx",[])}});var ea=/[\n\t]/g,la=/\s+/,fb=/\r/g,gb=/href|src|style/,hb=/(button|input)/i,ib=/(button|input|object|select|textarea)/i,jb=/^(a|area)$/i,Ra=/radio|checkbox/;f.fn.extend({attr:function(b,
e){return E(this,b,e,true,f.attr)},removeAttr:function(b){return this.each(function(){f.attr(this,b,"");this.nodeType===1&&this.removeAttribute(b)})},addClass:function(b){if(f.isFunction(b))return this.each(function(A){var H=f(this);H.addClass(b.call(this,A,H.attr("class")))});if(b&&typeof b==="string")for(var e=(b||"").split(la),g=0,k=this.length;g<k;g++){var l=this[g];if(l.nodeType===1)if(l.className){for(var o=" "+l.className+" ",q=l.className,z=0,w=e.length;z<w;z++)if(o.indexOf(" "+e[z]+" ")<
0)q+=" "+e[z];l.className=f.trim(q)}else l.className=b}return this},removeClass:function(b){if(f.isFunction(b))return this.each(function(w){var A=f(this);A.removeClass(b.call(this,w,A.attr("class")))});if(b&&typeof b==="string"||b===h)for(var e=(b||"").split(la),g=0,k=this.length;g<k;g++){var l=this[g];if(l.nodeType===1&&l.className)if(b){for(var o=(" "+l.className+" ").replace(ea," "),q=0,z=e.length;q<z;q++)o=o.replace(" "+e[q]+" "," ");l.className=f.trim(o)}else l.className=""}return this},toggleClass:function(b,
e){var g=typeof b,k=typeof e==="boolean";if(f.isFunction(b))return this.each(function(l){var o=f(this);o.toggleClass(b.call(this,l,o.attr("class"),e),e)});return this.each(function(){if(g==="string")for(var l,o=0,q=f(this),z=e,w=b.split(la);l=w[o++];){z=k?z:!q.hasClass(l);q[z?"addClass":"removeClass"](l)}else if(g==="undefined"||g==="boolean"){this.className&&f.data(this,"__className__",this.className);this.className=this.className||b===false?"":f.data(this,"__className__")||""}})},hasClass:function(b){for(var e=
0,g=this.length;e<g;e++)if((" "+this[e].className+" ").replace(ea," ").indexOf(" "+b+" ")>-1)return true;return false},val:function(b){if(b===h){var e=this[0];if(e){if(f.nodeName(e,"option"))return(e.attributes.value||{}).specified?e.value:e.text;if(f.nodeName(e,"select")){var g=e.selectedIndex,k=[],l=e.options;e=e.type==="select-one";if(g<0)return null;var o=e?g:0;for(g=e?g+1:l.length;o<g;o++){var q=l[o];if(q.selected){b=f(q).val();if(e)return b;k.push(b)}}return k}if(Ra.test(e.type)&&!f.support.checkOn)return e.getAttribute("value")===
null?"on":e.value;return(e.value||"").replace(fb,"")}return h}var z=f.isFunction(b);return this.each(function(w){var A=f(this),H=b;if(this.nodeType===1){if(z)H=b.call(this,w,A.val());if(typeof H==="number")H+="";if(f.isArray(H)&&Ra.test(this.type))this.checked=f.inArray(A.val(),H)>=0;else if(f.nodeName(this,"select")){var S=f.makeArray(H);f("option",this).each(function(){this.selected=f.inArray(f(this).val(),S)>=0});if(!S.length)this.selectedIndex=-1}else this.value=H}})}});f.extend({attrFn:{val:true,
css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(b,e,g,k){if(!b||b.nodeType===3||b.nodeType===8)return h;if(k&&e in f.attrFn)return f(b)[e](g);k=b.nodeType!==1||!f.isXMLDoc(b);var l=g!==h;e=k&&f.props[e]||e;if(b.nodeType===1){var o=gb.test(e);if(e in b&&k&&!o){if(l){e==="type"&&hb.test(b.nodeName)&&b.parentNode&&f.error("type property can't be changed");b[e]=g}if(f.nodeName(b,"form")&&b.getAttributeNode(e))return b.getAttributeNode(e).nodeValue;if(e==="tabIndex")return(e=
b.getAttributeNode("tabIndex"))&&e.specified?e.value:ib.test(b.nodeName)||jb.test(b.nodeName)&&b.href?0:h;return b[e]}if(!f.support.style&&k&&e==="style"){if(l)b.style.cssText=""+g;return b.style.cssText}l&&b.setAttribute(e,""+g);b=!f.support.hrefNormalized&&k&&o?b.getAttribute(e,2):b.getAttribute(e);return b===null?h:b}return f.style(b,e,g)}});var wa=/\.(.*)$/,kb=function(b){return b.replace(/[^\w\s\.\|`]/g,function(e){return"\\"+e})};f.event={add:function(b,e,g,k){if(!(b.nodeType===3||b.nodeType===
8)){if(b.setInterval&&b!==d&&!b.frameElement)b=d;var l,o;if(g.handler){l=g;g=l.handler}if(!g.guid)g.guid=f.guid++;if(o=f.data(b)){var q=o.events=o.events||{},z=o.handle;if(!z)o.handle=z=function(){return typeof f!=="undefined"&&!f.event.triggered?f.event.handle.apply(z.elem,arguments):h};z.elem=b;e=e.split(" ");for(var w,A=0,H;w=e[A++];){o=l?f.extend({},l):{handler:g,data:k};if(w.indexOf(".")>-1){H=w.split(".");w=H.shift();o.namespace=H.slice(0).sort().join(".")}else{H=[];o.namespace=""}o.type=w;
o.guid=g.guid;var S=q[w],W=f.event.special[w]||{};if(!S){S=q[w]=[];if(!W.setup||W.setup.call(b,k,H,z)===false)if(b.addEventListener)b.addEventListener(w,z,false);else b.attachEvent&&b.attachEvent("on"+w,z)}if(W.add){W.add.call(b,o);if(!o.handler.guid)o.handler.guid=g.guid}S.push(o);f.event.global[w]=true}b=null}}},global:{},remove:function(b,e,g,k){if(!(b.nodeType===3||b.nodeType===8)){var l,o=0,q,z,w,A,H,S,W=f.data(b),aa=W&&W.events;if(W&&aa){if(e&&e.type){g=e.handler;e=e.type}if(!e||typeof e===
"string"&&e.charAt(0)===".")for(l in aa)f.event.remove(b,l+(e||""));else{for(e=e.split(" ");l=e[o++];){A=l;q=l.indexOf(".")<0;z=[];if(!q){z=l.split(".");l=z.shift();w=new RegExp("(^|\\.)"+f.map(z.slice(0).sort(),kb).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(H=aa[l])if(g){A=f.event.special[l]||{};for(Y=k||0;Y<H.length;Y++){S=H[Y];if(g.guid===S.guid){if(q||w.test(S.namespace)){k==null&&H.splice(Y--,1);A.remove&&A.remove.call(b,S)}if(k!=null)break}}if(H.length===0||k!=null&&H.length===1){if(!A.teardown||A.teardown.call(b,
z)===false)Sa(b,l,W.handle);delete aa[l]}}else for(var Y=0;Y<H.length;Y++){S=H[Y];if(q||w.test(S.namespace)){f.event.remove(b,A,S.handler,Y);H.splice(Y--,1)}}}if(f.isEmptyObject(aa)){if(e=W.handle)e.elem=null;delete W.events;delete W.handle;f.isEmptyObject(W)&&f.removeData(b)}}}}},trigger:function(b,e,g,k){var l=b.type||b;if(!k){b=typeof b==="object"?b[ca]?b:f.extend(f.Event(l),b):f.Event(l);if(l.indexOf("!")>=0){b.type=l=l.slice(0,-1);b.exclusive=true}if(!g){b.stopPropagation();f.event.global[l]&&
f.each(f.cache,function(){this.events&&this.events[l]&&f.event.trigger(b,e,this.handle.elem)})}if(!g||g.nodeType===3||g.nodeType===8)return h;b.result=h;b.target=g;e=f.makeArray(e);e.unshift(b)}b.currentTarget=g;(k=f.data(g,"handle"))&&k.apply(g,e);k=g.parentNode||g.ownerDocument;try{if(!(g&&g.nodeName&&f.noData[g.nodeName.toLowerCase()]))if(g["on"+l]&&g["on"+l].apply(g,e)===false)b.result=false}catch(o){}if(!b.isPropagationStopped()&&k)f.event.trigger(b,e,k,true);else if(!b.isDefaultPrevented()){k=
b.target;var q,z=f.nodeName(k,"a")&&l==="click",w=f.event.special[l]||{};if((!w._default||w._default.call(g,b)===false)&&!z&&!(k&&k.nodeName&&f.noData[k.nodeName.toLowerCase()])){try{if(k[l]){if(q=k["on"+l])k["on"+l]=null;f.event.triggered=true;k[l]()}}catch(A){}if(q)k["on"+l]=q;f.event.triggered=false}}},handle:function(b){var e,g,k,l;b=arguments[0]=f.event.fix(b||d.event);b.currentTarget=this;e=b.type.indexOf(".")<0&&!b.exclusive;if(!e){g=b.type.split(".");b.type=g.shift();k=new RegExp("(^|\\.)"+
g.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}l=f.data(this,"events");g=l[b.type];if(l&&g){g=g.slice(0);l=0;for(var o=g.length;l<o;l++){var q=g[l];if(e||k.test(q.namespace)){b.handler=q.handler;b.data=q.data;b.handleObj=q;q=q.handler.apply(this,arguments);if(q!==h){b.result=q;if(q===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped())break}}}return b.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(b){if(b[ca])return b;var e=b;b=f.Event(e);for(var g=this.props.length,k;g;){k=this.props[--g];b[k]=e[k]}if(!b.target)b.target=b.srcElement||G;if(b.target.nodeType===3)b.target=b.target.parentNode;if(!b.relatedTarget&&b.fromElement)b.relatedTarget=b.fromElement===b.target?b.toElement:b.fromElement;if(b.pageX==null&&b.clientX!=null){e=G.documentElement;g=G.body;b.pageX=b.clientX+(e&&e.scrollLeft||g&&g.scrollLeft||0)-(e&&e.clientLeft||g&&g.clientLeft||0);b.pageY=b.clientY+(e&&e.scrollTop||
g&&g.scrollTop||0)-(e&&e.clientTop||g&&g.clientTop||0)}if(!b.which&&(b.charCode||b.charCode===0?b.charCode:b.keyCode))b.which=b.charCode||b.keyCode;if(!b.metaKey&&b.ctrlKey)b.metaKey=b.ctrlKey;if(!b.which&&b.button!==h)b.which=b.button&1?1:b.button&2?3:b.button&4?2:0;return b},guid:1E8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(b){f.event.add(this,b.origType,f.extend({},b,{handler:J}))},remove:function(b){var e=true,g=b.origType.replace(wa,"");f.each(f.data(this,
"events").live||[],function(){if(g===this.origType.replace(wa,""))return e=false});e&&f.event.remove(this,b.origType,J)}},beforeunload:{setup:function(b,e,g){if(this.setInterval)this.onbeforeunload=g;return false},teardown:function(b,e){if(this.onbeforeunload===e)this.onbeforeunload=null}}}};var Sa=G.removeEventListener?function(b,e,g){b.removeEventListener(e,g,false)}:function(b,e,g){b.detachEvent("on"+e,g)};f.Event=function(b){if(!this.preventDefault)return new f.Event(b);if(b&&b.type){this.originalEvent=
b;this.type=b.type}else this.type=b;this.timeStamp=B();this[ca]=true};f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var b=this.originalEvent;if(b){b.preventDefault&&b.preventDefault();b.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=u;var b=this.originalEvent;if(b){b.stopPropagation&&b.stopPropagation();b.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:I,isPropagationStopped:I,
isImmediatePropagationStopped:I};var Ta=function(b){var e=b.relatedTarget;try{for(;e&&e!==this;)e=e.parentNode;if(e!==this){b.type=b.data;f.event.handle.apply(this,arguments)}}catch(g){}},Ua=function(b){b.type=b.data;f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(b,e){f.event.special[b]={setup:function(g){f.event.add(this,e,g&&g.selector?Ua:Ta,b)},teardown:function(g){f.event.remove(this,e,g&&g.selector?Ua:Ta)}}});if(!f.support.submitBubbles)f.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){f.event.add(this,"click.specialSubmit",function(b){var e=b.target,g=e.type;if((g==="submit"||g==="image")&&f(e).closest("form").length)return F("submit",this,arguments)});f.event.add(this,"keypress.specialSubmit",function(b){var e=b.target,g=e.type;if((g==="text"||g==="password")&&f(e).closest("form").length&&b.keyCode===13)return F("submit",this,arguments)})}else return false},teardown:function(){f.event.remove(this,".specialSubmit")}};if(!f.support.changeBubbles){var Fa=
/textarea|input|select/i,Ga,Va=function(b){var e=b.type,g=b.value;if(e==="radio"||e==="checkbox")g=b.checked;else if(e==="select-multiple")g=b.selectedIndex>-1?f.map(b.options,function(k){return k.selected}).join("-"):"";else if(b.nodeName.toLowerCase()==="select")g=b.selectedIndex;return g},Ha=function(b,e){var g=b.target,k,l;if(!(!Fa.test(g.nodeName)||g.readOnly)){k=f.data(g,"_change_data");l=Va(g);if(b.type!=="focusout"||g.type!=="radio")f.data(g,"_change_data",l);if(!(k===h||l===k))if(k!=null||
l){b.type="change";return f.event.trigger(b,e,g)}}};f.event.special.change={filters:{focusout:Ha,click:function(b){var e=b.target,g=e.type;if(g==="radio"||g==="checkbox"||e.nodeName.toLowerCase()==="select")return Ha.call(this,b)},keydown:function(b){var e=b.target,g=e.type;if(b.keyCode===13&&e.nodeName.toLowerCase()!=="textarea"||b.keyCode===32&&(g==="checkbox"||g==="radio")||g==="select-multiple")return Ha.call(this,b)},beforeactivate:function(b){b=b.target;f.data(b,"_change_data",Va(b))}},setup:function(){if(this.type===
"file")return false;for(var b in Ga)f.event.add(this,b+".specialChange",Ga[b]);return Fa.test(this.nodeName)},teardown:function(){f.event.remove(this,".specialChange");return Fa.test(this.nodeName)}};Ga=f.event.special.change.filters}G.addEventListener&&f.each({focus:"focusin",blur:"focusout"},function(b,e){function g(k){k=f.event.fix(k);k.type=e;return f.event.handle.call(this,k)}f.event.special[e]={setup:function(){this.addEventListener(b,g,true)},teardown:function(){this.removeEventListener(b,
g,true)}}});f.each(["bind","one"],function(b,e){f.fn[e]=function(g,k,l){if(typeof g==="object"){for(var o in g)this[e](o,k,g[o],l);return this}if(f.isFunction(k)){l=k;k=h}var q=e==="one"?f.proxy(l,function(w){f(this).unbind(w,q);return l.apply(this,arguments)}):l;if(g==="unload"&&e!=="one")this.one(g,k,l);else{o=0;for(var z=this.length;o<z;o++)f.event.add(this[o],g,q,k)}return this}});f.fn.extend({unbind:function(b,e){if(typeof b==="object"&&!b.preventDefault)for(var g in b)this.unbind(g,b[g]);else{g=
0;for(var k=this.length;g<k;g++)f.event.remove(this[g],b,e)}return this},delegate:function(b,e,g,k){return this.live(e,g,k,b)},undelegate:function(b,e,g){return arguments.length===0?this.unbind("live"):this.die(e,null,g,b)},trigger:function(b,e){return this.each(function(){f.event.trigger(b,e,this)})},triggerHandler:function(b,e){if(this[0]){var g=f.Event(b);g.preventDefault();g.stopPropagation();f.event.trigger(g,e,this[0]);return g.result}},toggle:function(b){for(var e=arguments,g=1;g<e.length;)f.proxy(b,
e[g++]);return this.click(f.proxy(b,function(k){var l=(f.data(this,"lastToggle"+b.guid)||0)%g;f.data(this,"lastToggle"+b.guid,l+1);k.preventDefault();return e[l].apply(this,arguments)||false}))},hover:function(b,e){return this.mouseenter(b).mouseleave(e||b)}});var Wa={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(b,e){f.fn[e]=function(g,k,l,o){var q,z=0,w,A,H=o||this.selector,S=o?this:f(this.context);if(f.isFunction(k)){l=k;k=h}for(g=
(g||"").split(" ");(q=g[z++])!=null;){o=wa.exec(q);w="";if(o){w=o[0];q=q.replace(wa,"")}if(q==="hover")g.push("mouseenter"+w,"mouseleave"+w);else{A=q;if(q==="focus"||q==="blur"){g.push(Wa[q]+w);q+=w}else q=(Wa[q]||q)+w;e==="live"?S.each(function(){f.event.add(this,P(q,H),{data:k,selector:H,handler:l,origType:q,origHandler:l,preType:A})}):S.unbind(P(q,H),l)}}return this}});f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(b,e){f.fn[e]=function(g){return g?this.bind(e,g):this.trigger(e)};if(f.attrFn)f.attrFn[e]=true});d.attachEvent&&!d.addEventListener&&d.attachEvent("onunload",function(){for(var b in f.cache)if(f.cache[b].handle)try{f.event.remove(f.cache[b].handle.elem)}catch(e){}});(function(){function b(n){for(var s="",x,y=0;n[y];y++){x=n[y];if(x.nodeType===3||x.nodeType===4)s+=x.nodeValue;else if(x.nodeType!==8)s+=b(x.childNodes)}return s}function e(n,s,x,y,D,C){D=0;for(var M=y.length;D<M;D++){var K=y[D];
if(K){K=K[n];for(var T=false;K;){if(K.sizcache===x){T=y[K.sizset];break}if(K.nodeType===1&&!C){K.sizcache=x;K.sizset=D}if(K.nodeName.toLowerCase()===s){T=K;break}K=K[n]}y[D]=T}}}function g(n,s,x,y,D,C){D=0;for(var M=y.length;D<M;D++){var K=y[D];if(K){K=K[n];for(var T=false;K;){if(K.sizcache===x){T=y[K.sizset];break}if(K.nodeType===1){if(!C){K.sizcache=x;K.sizset=D}if(typeof s!=="string"){if(K===s){T=true;break}}else if(w.filter(s,[K]).length>0){T=K;break}}K=K[n]}y[D]=T}}}var k=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
l=0,o=Object.prototype.toString,q=false,z=true;[0,0].sort(function(){z=false;return 0});var w=function(n,s,x,y){x=x||[];var D=s=s||G;if(s.nodeType!==1&&s.nodeType!==9)return[];if(!n||typeof n!=="string")return x;for(var C=[],M,K,T,ya,ra=true,ua=N(s),sa=n;(k.exec(""),M=k.exec(sa))!==null;){sa=M[3];C.push(M[1]);if(M[2]){ya=M[3];break}}if(C.length>1&&H.exec(n))if(C.length===2&&A.relative[C[0]])K=Ia(C[0]+C[1],s);else for(K=A.relative[C[0]]?[s]:w(C.shift(),s);C.length;){n=C.shift();if(A.relative[n])n+=
C.shift();K=Ia(n,K)}else{if(!y&&C.length>1&&s.nodeType===9&&!ua&&A.match.ID.test(C[0])&&!A.match.ID.test(C[C.length-1])){M=w.find(C.shift(),s,ua);s=M.expr?w.filter(M.expr,M.set)[0]:M.set[0]}if(s){M=y?{expr:C.pop(),set:W(y)}:w.find(C.pop(),C.length===1&&(C[0]==="~"||C[0]==="+")&&s.parentNode?s.parentNode:s,ua);K=M.expr?w.filter(M.expr,M.set):M.set;if(C.length>0)T=W(K);else ra=false;for(;C.length;){var ja=C.pop();M=ja;if(A.relative[ja])M=C.pop();else ja="";if(M==null)M=s;A.relative[ja](T,M,ua)}}else T=
[]}T||(T=K);T||w.error(ja||n);if(o.call(T)==="[object Array]")if(ra)if(s&&s.nodeType===1)for(n=0;T[n]!=null;n++){if(T[n]&&(T[n]===true||T[n].nodeType===1&&ha(s,T[n])))x.push(K[n])}else for(n=0;T[n]!=null;n++)T[n]&&T[n].nodeType===1&&x.push(K[n]);else x.push.apply(x,T);else W(T,x);if(ya){w(ya,D,x,y);w.uniqueSort(x)}return x};w.uniqueSort=function(n){if(Y){q=z;n.sort(Y);if(q)for(var s=1;s<n.length;s++)n[s]===n[s-1]&&n.splice(s--,1)}return n};w.matches=function(n,s){return w(n,null,null,s)};w.find=function(n,
s,x){var y,D;if(!n)return[];for(var C=0,M=A.order.length;C<M;C++){var K=A.order[C];if(D=A.leftMatch[K].exec(n)){var T=D[1];D.splice(1,1);if(T.substr(T.length-1)!=="\\"){D[1]=(D[1]||"").replace(/\\/g,"");y=A.find[K](D,s,x);if(y!=null){n=n.replace(A.match[K],"");break}}}}y||(y=s.getElementsByTagName("*"));return{set:y,expr:n}};w.filter=function(n,s,x,y){for(var D=n,C=[],M=s,K,T,ya=s&&s[0]&&N(s[0]);n&&s.length;){for(var ra in A.filter)if((K=A.leftMatch[ra].exec(n))!=null&&K[2]){var ua=A.filter[ra],sa,
ja;ja=K[1];T=false;K.splice(1,1);if(ja.substr(ja.length-1)!=="\\"){if(M===C)C=[];if(A.preFilter[ra])if(K=A.preFilter[ra](K,M,x,C,y,ya)){if(K===true)continue}else T=sa=true;if(K)for(var Ca=0;(ja=M[Ca])!=null;Ca++)if(ja){sa=ua(ja,K,Ca,M);var Xa=y^!!sa;if(x&&sa!=null)if(Xa)T=true;else M[Ca]=false;else if(Xa){C.push(ja);T=true}}if(sa!==h){x||(M=C);n=n.replace(A.match[ra],"");if(!T)return[];break}}}if(n===D)if(T==null)w.error(n);else break;D=n}return M};w.error=function(n){throw"Syntax error, unrecognized expression: "+
n;};var A=w.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},
leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(n){return n.getAttribute("href")}},relative:{"+":function(n,s){var x=typeof s==="string",y=x&&!/\W/.test(s);x=x&&!y;if(y)s=s.toLowerCase();y=0;for(var D=n.length,C;y<D;y++)if(C=n[y]){for(;(C=C.previousSibling)&&C.nodeType!==1;);n[y]=x||C&&C.nodeName.toLowerCase()===s?C||false:C===s}x&&w.filter(s,n,true)},">":function(n,s){var x=typeof s==="string";if(x&&!/\W/.test(s)){s=s.toLowerCase();for(var y=0,D=n.length;y<D;y++){var C=
n[y];if(C){x=C.parentNode;n[y]=x.nodeName.toLowerCase()===s?x:false}}}else{y=0;for(D=n.length;y<D;y++)if(C=n[y])n[y]=x?C.parentNode:C.parentNode===s;x&&w.filter(s,n,true)}},"":function(n,s,x){var y=l++,D=g;if(typeof s==="string"&&!/\W/.test(s)){var C=s=s.toLowerCase();D=e}D("parentNode",s,y,n,C,x)},"~":function(n,s,x){var y=l++,D=g;if(typeof s==="string"&&!/\W/.test(s)){var C=s=s.toLowerCase();D=e}D("previousSibling",s,y,n,C,x)}},find:{ID:function(n,s,x){if(typeof s.getElementById!=="undefined"&&
!x)return(n=s.getElementById(n[1]))?[n]:[]},NAME:function(n,s){if(typeof s.getElementsByName!=="undefined"){for(var x=[],y=s.getElementsByName(n[1]),D=0,C=y.length;D<C;D++)y[D].getAttribute("name")===n[1]&&x.push(y[D]);return x.length===0?null:x}},TAG:function(n,s){return s.getElementsByTagName(n[1])}},preFilter:{CLASS:function(n,s,x,y,D,C){n=" "+n[1].replace(/\\/g,"")+" ";if(C)return n;C=0;for(var M;(M=s[C])!=null;C++)if(M)if(D^(M.className&&(" "+M.className+" ").replace(/[\t\n]/g," ").indexOf(n)>=
0))x||y.push(M);else if(x)s[C]=false;return false},ID:function(n){return n[1].replace(/\\/g,"")},TAG:function(n){return n[1].toLowerCase()},CHILD:function(n){if(n[1]==="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(n[2]==="even"&&"2n"||n[2]==="odd"&&"2n+1"||!/\D/.test(n[2])&&"0n+"+n[2]||n[2]);n[2]=s[1]+(s[2]||1)-0;n[3]=s[3]-0}n[0]=l++;return n},ATTR:function(n,s,x,y,D,C){s=n[1].replace(/\\/g,"");if(!C&&A.attrMap[s])n[1]=A.attrMap[s];if(n[2]==="~=")n[4]=" "+n[4]+" ";return n},PSEUDO:function(n,s,x,y,
D){if(n[1]==="not")if((k.exec(n[3])||"").length>1||/^\w/.test(n[3]))n[3]=w(n[3],null,null,s);else{n=w.filter(n[3],s,x,true^D);x||y.push.apply(y,n);return false}else if(A.match.POS.test(n[0])||A.match.CHILD.test(n[0]))return true;return n},POS:function(n){n.unshift(true);return n}},filters:{enabled:function(n){return n.disabled===false&&n.type!=="hidden"},disabled:function(n){return n.disabled===true},checked:function(n){return n.checked===true},selected:function(n){return n.selected===true},parent:function(n){return!!n.firstChild},
empty:function(n){return!n.firstChild},has:function(n,s,x){return!!w(x[3],n).length},header:function(n){return/h\d/i.test(n.nodeName)},text:function(n){return"text"===n.type},radio:function(n){return"radio"===n.type},checkbox:function(n){return"checkbox"===n.type},file:function(n){return"file"===n.type},password:function(n){return"password"===n.type},submit:function(n){return"submit"===n.type},image:function(n){return"image"===n.type},reset:function(n){return"reset"===n.type},button:function(n){return"button"===
n.type||n.nodeName.toLowerCase()==="button"},input:function(n){return/input|select|textarea|button/i.test(n.nodeName)}},setFilters:{first:function(n,s){return s===0},last:function(n,s,x,y){return s===y.length-1},even:function(n,s){return s%2===0},odd:function(n,s){return s%2===1},lt:function(n,s,x){return s<x[3]-0},gt:function(n,s,x){return s>x[3]-0},nth:function(n,s,x){return x[3]-0===s},eq:function(n,s,x){return x[3]-0===s}},filter:{PSEUDO:function(n,s,x,y){var D=s[1],C=A.filters[D];if(C)return C(n,
x,s,y);else if(D==="contains")return(n.textContent||n.innerText||b([n])||"").indexOf(s[3])>=0;else if(D==="not"){s=s[3];x=0;for(y=s.length;x<y;x++)if(s[x]===n)return false;return true}else w.error("Syntax error, unrecognized expression: "+D)},CHILD:function(n,s){var x=s[1],y=n;switch(x){case "only":case "first":for(;y=y.previousSibling;)if(y.nodeType===1)return false;if(x==="first")return true;y=n;case "last":for(;y=y.nextSibling;)if(y.nodeType===1)return false;return true;case "nth":x=s[2];var D=
s[3];if(x===1&&D===0)return true;var C=s[0],M=n.parentNode;if(M&&(M.sizcache!==C||!n.nodeIndex)){var K=0;for(y=M.firstChild;y;y=y.nextSibling)if(y.nodeType===1)y.nodeIndex=++K;M.sizcache=C}y=n.nodeIndex-D;return x===0?y===0:y%x===0&&y/x>=0}},ID:function(n,s){return n.nodeType===1&&n.getAttribute("id")===s},TAG:function(n,s){return s==="*"&&n.nodeType===1||n.nodeName.toLowerCase()===s},CLASS:function(n,s){return(" "+(n.className||n.getAttribute("class"))+" ").indexOf(s)>-1},ATTR:function(n,s){var x=
s[1];x=A.attrHandle[x]?A.attrHandle[x](n):n[x]!=null?n[x]:n.getAttribute(x);var y=x+"",D=s[2],C=s[4];return x==null?D==="!=":D==="="?y===C:D==="*="?y.indexOf(C)>=0:D==="~="?(" "+y+" ").indexOf(C)>=0:!C?y&&x!==false:D==="!="?y!==C:D==="^="?y.indexOf(C)===0:D==="$="?y.substr(y.length-C.length)===C:D==="|="?y===C||y.substr(0,C.length+1)===C+"-":false},POS:function(n,s,x,y){var D=A.setFilters[s[2]];if(D)return D(n,x,s,y)}}},H=A.match.POS;for(var S in A.match){A.match[S]=new RegExp(A.match[S].source+/(?![^\[]*\])(?![^\(]*\))/.source);
A.leftMatch[S]=new RegExp(/(^(?:.|\r|\n)*?)/.source+A.match[S].source.replace(/\\(\d+)/g,function(n,s){return"\\"+(s-0+1)}))}var W=function(n,s){n=Array.prototype.slice.call(n,0);if(s){s.push.apply(s,n);return s}return n};try{Array.prototype.slice.call(G.documentElement.childNodes,0)}catch(aa){W=function(n,s){var x=s||[];if(o.call(n)==="[object Array]")Array.prototype.push.apply(x,n);else if(typeof n.length==="number")for(var y=0,D=n.length;y<D;y++)x.push(n[y]);else for(y=0;n[y];y++)x.push(n[y]);
return x}}var Y;if(G.documentElement.compareDocumentPosition)Y=function(n,s){if(!n.compareDocumentPosition||!s.compareDocumentPosition){if(n==s)q=true;return n.compareDocumentPosition?-1:1}var x=n.compareDocumentPosition(s)&4?-1:n===s?0:1;if(x===0)q=true;return x};else if("sourceIndex"in G.documentElement)Y=function(n,s){if(!n.sourceIndex||!s.sourceIndex){if(n==s)q=true;return n.sourceIndex?-1:1}var x=n.sourceIndex-s.sourceIndex;if(x===0)q=true;return x};else if(G.createRange)Y=function(n,s){if(!n.ownerDocument||
!s.ownerDocument){if(n==s)q=true;return n.ownerDocument?-1:1}var x=n.ownerDocument.createRange(),y=s.ownerDocument.createRange();x.setStart(n,0);x.setEnd(n,0);y.setStart(s,0);y.setEnd(s,0);x=x.compareBoundaryPoints(Range.START_TO_END,y);if(x===0)q=true;return x};(function(){var n=G.createElement("div"),s="script"+(new Date).getTime();n.innerHTML="<a name='"+s+"'/>";var x=G.documentElement;x.insertBefore(n,x.firstChild);if(G.getElementById(s)){A.find.ID=function(y,D,C){if(typeof D.getElementById!==
"undefined"&&!C)return(D=D.getElementById(y[1]))?D.id===y[1]||typeof D.getAttributeNode!=="undefined"&&D.getAttributeNode("id").nodeValue===y[1]?[D]:h:[]};A.filter.ID=function(y,D){var C=typeof y.getAttributeNode!=="undefined"&&y.getAttributeNode("id");return y.nodeType===1&&C&&C.nodeValue===D}}x.removeChild(n);x=n=null})();(function(){var n=G.createElement("div");n.appendChild(G.createComment(""));if(n.getElementsByTagName("*").length>0)A.find.TAG=function(s,x){var y=x.getElementsByTagName(s[1]);
if(s[1]==="*"){for(var D=[],C=0;y[C];C++)y[C].nodeType===1&&D.push(y[C]);y=D}return y};n.innerHTML="<a href='#'></a>";if(n.firstChild&&typeof n.firstChild.getAttribute!=="undefined"&&n.firstChild.getAttribute("href")!=="#")A.attrHandle.href=function(s){return s.getAttribute("href",2)};n=null})();G.querySelectorAll&&function(){var n=w,s=G.createElement("div");s.innerHTML="<p class='TEST'></p>";if(!(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0)){w=function(y,D,C,M){D=D||G;if(!M&&D.nodeType===
9&&!N(D))try{return W(D.querySelectorAll(y),C)}catch(K){}return n(y,D,C,M)};for(var x in n)w[x]=n[x];s=null}}();(function(){var n=G.createElement("div");n.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!n.getElementsByClassName||n.getElementsByClassName("e").length===0)){n.lastChild.className="e";if(n.getElementsByClassName("e").length!==1){A.order.splice(1,0,"CLASS");A.find.CLASS=function(s,x,y){if(typeof x.getElementsByClassName!=="undefined"&&!y)return x.getElementsByClassName(s[1])};
n=null}}})();var ha=G.compareDocumentPosition?function(n,s){return!!(n.compareDocumentPosition(s)&16)}:function(n,s){return n!==s&&(n.contains?n.contains(s):true)},N=function(n){return(n=(n?n.ownerDocument||n:0).documentElement)?n.nodeName!=="HTML":false},Ia=function(n,s){for(var x=[],y="",D,C=s.nodeType?[s]:s;D=A.match.PSEUDO.exec(n);){y+=D[0];n=n.replace(A.match.PSEUDO,"")}n=A.relative[n]?n+"*":n;D=0;for(var M=C.length;D<M;D++)w(n,C[D],x);return w.filter(y,x)};f.find=w;f.expr=w.selectors;f.expr[":"]=
f.expr.filters;f.unique=w.uniqueSort;f.text=b;f.isXMLDoc=N;f.contains=ha})();var lb=/Until$/,mb=/^(?:parents|prevUntil|prevAll)/,nb=/,/;ba=Array.prototype.slice;var Ya=function(b,e,g){if(f.isFunction(e))return f.grep(b,function(l,o){return!!e.call(l,o,l)===g});else if(e.nodeType)return f.grep(b,function(l){return l===e===g});else if(typeof e==="string"){var k=f.grep(b,function(l){return l.nodeType===1});if(xa.test(e))return f.filter(e,k,!g);else e=f.filter(e,k)}return f.grep(b,function(l){return f.inArray(l,
e)>=0===g})};f.fn.extend({find:function(b){for(var e=this.pushStack("","find",b),g=0,k=0,l=this.length;k<l;k++){g=e.length;f.find(b,this[k],e);if(k>0)for(var o=g;o<e.length;o++)for(var q=0;q<g;q++)if(e[q]===e[o]){e.splice(o--,1);break}}return e},has:function(b){var e=f(b);return this.filter(function(){for(var g=0,k=e.length;g<k;g++)if(f.contains(this,e[g]))return true})},not:function(b){return this.pushStack(Ya(this,b,false),"not",b)},filter:function(b){return this.pushStack(Ya(this,b,true),"filter",
b)},is:function(b){return!!b&&f.filter(b,this).length>0},closest:function(b,e){if(f.isArray(b)){var g=[],k=this[0],l,o={},q;if(k&&b.length){l=0;for(var z=b.length;l<z;l++){q=b[l];o[q]||(o[q]=f.expr.match.POS.test(q)?f(q,e||this.context):q)}for(;k&&k.ownerDocument&&k!==e;){for(q in o){l=o[q];if(l.jquery?l.index(k)>-1:f(k).is(l)){g.push({selector:q,elem:k});delete o[q]}}k=k.parentNode}}return g}var w=f.expr.match.POS.test(b)?f(b,e||this.context):null;return this.map(function(A,H){for(;H&&H.ownerDocument&&
H!==e;){if(w?w.index(H)>-1:f(H).is(b))return H;H=H.parentNode}return null})},index:function(b){if(!b||typeof b==="string")return f.inArray(this[0],b?f(b):this.parent().children());return f.inArray(b.jquery?b[0]:b,this)},add:function(b,e){var g=typeof b==="string"?f(b,e||this.context):f.makeArray(b),k=f.merge(this.get(),g);return this.pushStack(!g[0]||!g[0].parentNode||g[0].parentNode.nodeType===11||!k[0]||!k[0].parentNode||k[0].parentNode.nodeType===11?k:f.unique(k))},andSelf:function(){return this.add(this.prevObject)}});
f.each({parent:function(b){return(b=b.parentNode)&&b.nodeType!==11?b:null},parents:function(b){return f.dir(b,"parentNode")},parentsUntil:function(b,e,g){return f.dir(b,"parentNode",g)},next:function(b){return f.nth(b,2,"nextSibling")},prev:function(b){return f.nth(b,2,"previousSibling")},nextAll:function(b){return f.dir(b,"nextSibling")},prevAll:function(b){return f.dir(b,"previousSibling")},nextUntil:function(b,e,g){return f.dir(b,"nextSibling",g)},prevUntil:function(b,e,g){return f.dir(b,"previousSibling",
g)},siblings:function(b){return f.sibling(b.parentNode.firstChild,b)},children:function(b){return f.sibling(b.firstChild)},contents:function(b){return f.nodeName(b,"iframe")?b.contentDocument||b.contentWindow.document:f.makeArray(b.childNodes)}},function(b,e){f.fn[b]=function(g,k){var l=f.map(this,e,g);lb.test(b)||(k=g);if(k&&typeof k==="string")l=f.filter(k,l);l=this.length>1?f.unique(l):l;if((this.length>1||nb.test(k))&&mb.test(b))l=l.reverse();return this.pushStack(l,b,ba.call(arguments).join(","))}});
f.extend({filter:function(b,e,g){if(g)b=":not("+b+")";return f.find.matches(b,e)},dir:function(b,e,g){var k=[];for(b=b[e];b&&b.nodeType!==9&&(g===h||b.nodeType!==1||!f(b).is(g));){b.nodeType===1&&k.push(b);b=b[e]}return k},nth:function(b,e,g){for(var k=0;b;b=b[g])if(b.nodeType===1&&++k===(e||1))break;return b},sibling:function(b,e){for(var g=[];b;b=b.nextSibling)b.nodeType===1&&b!==e&&g.push(b);return g}});var Za=/ jQuery\d+="(?:\d+|null)"/g,Da=/^\s+/,$a=/(<([\w:]+)[^>]*?)\/>/g,ob=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
ab=/<([\w:]+)/,pb=/<tbody/i,qb=/<|&#?\w+;/,Oa=/<script|<object|<embed|<option|<style/i,Pa=/checked\s*(?:[^=]|=\s*.checked.)/i,bb=function(b,e,g){return ob.test(g)?b:e+"></"+g+">"},ka={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,
"",""]};ka.optgroup=ka.option;ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead;ka.th=ka.td;if(!f.support.htmlSerialize)ka._default=[1,"div<div>","</div>"];f.fn.extend({text:function(b){if(f.isFunction(b))return this.each(function(e){var g=f(this);g.text(b.call(this,e,g.text()))});if(typeof b!=="object"&&b!==h)return this.empty().append((this[0]&&this[0].ownerDocument||G).createTextNode(b));return f.text(this)},wrapAll:function(b){if(f.isFunction(b))return this.each(function(g){f(this).wrapAll(b.call(this,
g))});if(this[0]){var e=f(b,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&e.insertBefore(this[0]);e.map(function(){for(var g=this;g.firstChild&&g.firstChild.nodeType===1;)g=g.firstChild;return g}).append(this)}return this},wrapInner:function(b){if(f.isFunction(b))return this.each(function(e){f(this).wrapInner(b.call(this,e))});return this.each(function(){var e=f(this),g=e.contents();g.length?g.wrapAll(b):e.append(b)})},wrap:function(b){return this.each(function(){f(this).wrapAll(b)})},
unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(b){this.nodeType===1&&this.appendChild(b)})},prepend:function(){return this.domManip(arguments,true,function(b){this.nodeType===1&&this.insertBefore(b,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this)});else if(arguments.length){var b=
f(arguments[0]);b.push.apply(b,this.toArray());return this.pushStack(b,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this.nextSibling)});else if(arguments.length){var b=this.pushStack(this,"after",arguments);b.push.apply(b,f(arguments[0]).toArray());return b}},remove:function(b,e){for(var g=0,k;(k=this[g])!=null;g++)if(!b||f.filter(b,[k]).length){if(!e&&k.nodeType===1){f.cleanData(k.getElementsByTagName("*"));
f.cleanData([k])}k.parentNode&&k.parentNode.removeChild(k)}return this},empty:function(){for(var b=0,e;(e=this[b])!=null;b++)for(e.nodeType===1&&f.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(b){var e=this.map(function(){if(!f.support.noCloneEvent&&!f.isXMLDoc(this)){var g=this.outerHTML,k=this.ownerDocument;if(!g){g=k.createElement("div");g.appendChild(this.cloneNode(true));g=g.innerHTML}return f.clean([g.replace(Za,"").replace(/=([^="'>\s]+\/)>/g,
'="$1">').replace(Da,"")],k)[0]}else return this.cloneNode(true)});if(b===true){U(this,e);U(this.find("*"),e.find("*"))}return e},html:function(b){if(b===h)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Za,""):null;else if(typeof b==="string"&&!Oa.test(b)&&(f.support.leadingWhitespace||!Da.test(b))&&!ka[(ab.exec(b)||["",""])[1].toLowerCase()]){b=b.replace($a,bb);try{for(var e=0,g=this.length;e<g;e++)if(this[e].nodeType===1){f.cleanData(this[e].getElementsByTagName("*"));this[e].innerHTML=
b}}catch(k){this.empty().append(b)}}else f.isFunction(b)?this.each(function(l){var o=f(this),q=o.html();o.empty().append(function(){return b.call(this,l,q)})}):this.empty().append(b);return this},replaceWith:function(b){if(this[0]&&this[0].parentNode){if(f.isFunction(b))return this.each(function(e){var g=f(this),k=g.html();g.replaceWith(b.call(this,e,k))});if(typeof b!=="string")b=f(b).detach();return this.each(function(){var e=this.nextSibling,g=this.parentNode;f(this).remove();e?f(e).before(b):
f(g).append(b)})}else return this.pushStack(f(f.isFunction(b)?b():b),"replaceWith",b)},detach:function(b){return this.remove(b,true)},domManip:function(b,e,g){var k,l,o=b[0],q=[],z;if(!f.support.checkClone&&arguments.length===3&&typeof o==="string"&&Pa.test(o))return this.each(function(){f(this).domManip(b,e,g,true)});if(f.isFunction(o))return this.each(function(A){var H=f(this);b[0]=o.call(this,A,e?H.html():h);H.domManip(b,e,g)});if(this[0]){k=o&&o.parentNode;k=f.support.parentNode&&k&&k.nodeType===
11&&k.childNodes.length===this.length?{fragment:k}:Q(b,this,q);z=k.fragment;if(l=z.childNodes.length===1?(z=z.firstChild):z.firstChild){e=e&&f.nodeName(l,"tr");l=0;for(var w=this.length;l<w;l++)g.call(e?f.nodeName(this[l],"table")?this[l].getElementsByTagName("tbody")[0]||this[l].appendChild(this[l].ownerDocument.createElement("tbody")):this[l]:this[l],l>0||k.cacheable||this.length>1?z.cloneNode(true):z)}q.length&&f.each(q,p)}return this}});f.fragments={};f.each({appendTo:"append",prependTo:"prepend",
insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,e){f.fn[b]=function(g){var k=[];g=f(g);var l=this.length===1&&this[0].parentNode;if(l&&l.nodeType===11&&l.childNodes.length===1&&g.length===1){g[e](this[0]);return this}else{l=0;for(var o=g.length;l<o;l++){var q=(l>0?this.clone(true):this).get();f.fn[e].apply(f(g[l]),q);k=k.concat(q)}return this.pushStack(k,b,g.selector)}}});f.extend({clean:function(b,e,g,k){e=e||G;if(typeof e.createElement==="undefined")e=e.ownerDocument||
e[0]&&e[0].ownerDocument||G;for(var l=[],o=0,q;(q=b[o])!=null;o++){if(typeof q==="number")q+="";if(q){if(typeof q==="string"&&!qb.test(q))q=e.createTextNode(q);else if(typeof q==="string"){q=q.replace($a,bb);var z=(ab.exec(q)||["",""])[1].toLowerCase(),w=ka[z]||ka._default,A=w[0],H=e.createElement("div");for(H.innerHTML=w[1]+q+w[2];A--;)H=H.lastChild;if(!f.support.tbody){A=pb.test(q);z=z==="table"&&!A?H.firstChild&&H.firstChild.childNodes:w[1]==="<table>"&&!A?H.childNodes:[];for(w=z.length-1;w>=0;--w)f.nodeName(z[w],
"tbody")&&!z[w].childNodes.length&&z[w].parentNode.removeChild(z[w])}!f.support.leadingWhitespace&&Da.test(q)&&H.insertBefore(e.createTextNode(Da.exec(q)[0]),H.firstChild);q=H.childNodes}if(q.nodeType)l.push(q);else l=f.merge(l,q)}}if(g)for(o=0;l[o];o++)if(k&&f.nodeName(l[o],"script")&&(!l[o].type||l[o].type.toLowerCase()==="text/javascript"))k.push(l[o].parentNode?l[o].parentNode.removeChild(l[o]):l[o]);else{l[o].nodeType===1&&l.splice.apply(l,[o+1,0].concat(f.makeArray(l[o].getElementsByTagName("script"))));
g.appendChild(l[o])}return l},cleanData:function(b){for(var e,g,k=f.cache,l=f.event.special,o=f.support.deleteExpando,q=0,z;(z=b[q])!=null;q++)if(g=z[f.expando]){e=k[g];if(e.events)for(var w in e.events)l[w]?f.event.remove(z,w):Sa(z,w,e.handle);if(o)delete z[f.expando];else z.removeAttribute&&z.removeAttribute(f.expando);delete k[g]}}});var rb=/z-?index|font-?weight|opacity|zoom|line-?height/i,cb=/alpha\([^)]*\)/,db=/opacity=([^)]*)/,Ja=/float/i,Ka=/-([a-z])/ig,sb=/([A-Z])/g,tb=/^-?\d+(?:px)?$/i,
ub=/^-?\d/,vb={position:"absolute",visibility:"hidden",display:"block"},wb=["Left","Right"],xb=["Top","Bottom"],yb=G.defaultView&&G.defaultView.getComputedStyle,eb=f.support.cssFloat?"cssFloat":"styleFloat",La=function(b,e){return e.toUpperCase()};f.fn.css=function(b,e){return E(this,b,e,true,function(g,k,l){if(l===h)return f.curCSS(g,k);if(typeof l==="number"&&!rb.test(k))l+="px";f.style(g,k,l)})};f.extend({style:function(b,e,g){if(!b||b.nodeType===3||b.nodeType===8)return h;if((e==="width"||e===
"height")&&parseFloat(g)<0)g=h;var k=b.style||b,l=g!==h;if(!f.support.opacity&&e==="opacity"){if(l){k.zoom=1;e=parseInt(g,10)+""==="NaN"?"":"alpha(opacity="+g*100+")";b=k.filter||f.curCSS(b,"filter")||"";k.filter=cb.test(b)?b.replace(cb,e):e}return k.filter&&k.filter.indexOf("opacity=")>=0?parseFloat(db.exec(k.filter)[1])/100+"":""}if(Ja.test(e))e=eb;e=e.replace(Ka,La);if(l)k[e]=g;return k[e]},css:function(b,e,g,k){if(e==="width"||e==="height"){var l,o=e==="width"?wb:xb;g=function(){l=e==="width"?
b.offsetWidth:b.offsetHeight;k!=="border"&&f.each(o,function(){k||(l-=parseFloat(f.curCSS(b,"padding"+this,true))||0);if(k==="margin")l+=parseFloat(f.curCSS(b,"margin"+this,true))||0;else l-=parseFloat(f.curCSS(b,"border"+this+"Width",true))||0})};b.offsetWidth!==0?g():f.swap(b,vb,g);return Math.max(0,Math.round(l))}return f.curCSS(b,e,g)},curCSS:function(b,e,g){var k,l=b.style;if(!f.support.opacity&&e==="opacity"&&b.currentStyle){k=db.test(b.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":
"";return k===""?"1":k}if(Ja.test(e))e=eb;if(!g&&l&&l[e])k=l[e];else if(yb){if(Ja.test(e))e="float";e=e.replace(sb,"-$1").toLowerCase();l=b.ownerDocument.defaultView;if(!l)return null;if(b=l.getComputedStyle(b,null))k=b.getPropertyValue(e);if(e==="opacity"&&k==="")k="1"}else if(b.currentStyle){g=e.replace(Ka,La);k=b.currentStyle[e]||b.currentStyle[g];if(!tb.test(k)&&ub.test(k)){e=l.left;var o=b.runtimeStyle.left;b.runtimeStyle.left=b.currentStyle.left;l.left=g==="fontSize"?"1em":k||0;k=l.pixelLeft+
"px";l.left=e;b.runtimeStyle.left=o}}return k},swap:function(b,e,g){var k={};for(var l in e){k[l]=b.style[l];b.style[l]=e[l]}g.call(b);for(l in e)b.style[l]=k[l]}});if(f.expr&&f.expr.filters){f.expr.filters.hidden=function(b){var e=b.offsetWidth,g=b.offsetHeight,k=b.nodeName.toLowerCase()==="tr";return e===0&&g===0&&!k?true:e>0&&g>0&&!k?false:f.curCSS(b,"display")==="none"};f.expr.filters.visible=function(b){return!f.expr.filters.hidden(b)}}var zb=B(),Ab=/<script(.|\s)*?\/script>/gi,Bb=/select|textarea/i,
Cb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,va=/=\?(&|$)/,Ma=/\?/,Db=/(\?|&)_=.*?(&|$)/,Eb=/^(\w+:)?\/\/([^\/?#]+)/,Fb=/%20/g,Gb=f.fn.load;f.fn.extend({load:function(b,e,g){if(typeof b!=="string")return Gb.call(this,b);else if(!this.length)return this;var k=b.indexOf(" ");if(k>=0){var l=b.slice(k,b.length);b=b.slice(0,k)}k="GET";if(e)if(f.isFunction(e)){g=e;e=null}else if(typeof e==="object"){e=f.param(e,f.ajaxSettings.traditional);k="POST"}var o=
this;f.ajax({url:b,type:k,dataType:"html",data:e,complete:function(q,z){if(z==="success"||z==="notmodified")o.html(l?f("<div />").append(q.responseText.replace(Ab,"")).find(l):q.responseText);g&&o.each(g,[q.responseText,z,q])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Bb.test(this.nodeName)||
Cb.test(this.type))}).map(function(b,e){var g=f(this).val();return g==null?null:f.isArray(g)?f.map(g,function(k){return{name:e.name,value:k}}):{name:e.name,value:g}}).get()}});f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(b,e){f.fn[e]=function(g){return this.bind(e,g)}});f.extend({get:function(b,e,g,k){if(f.isFunction(e)){k=k||g;g=e;e=null}return f.ajax({type:"GET",url:b,data:e,success:g,dataType:k})},getScript:function(b,e){return f.get(b,null,e,"script")},
getJSON:function(b,e,g){return f.get(b,e,g,"json")},post:function(b,e,g,k){if(f.isFunction(e)){k=k||g;g=e;e={}}return f.ajax({type:"POST",url:b,data:e,success:g,dataType:k})},ajaxSetup:function(b){f.extend(f.ajaxSettings,b)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:d.XMLHttpRequest&&(d.location.protocol!=="file:"||!d.ActiveXObject)?function(){return new d.XMLHttpRequest}:function(){try{return new d.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}},
accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(b){function e(){l.success&&l.success.call(w,z,q,N);l.global&&k("ajaxSuccess",[N,l])}function g(){l.complete&&l.complete.call(w,N,q);l.global&&k("ajaxComplete",[N,l]);l.global&&!--f.active&&f.event.trigger("ajaxStop")}function k(D,C){(l.context?f(l.context):f.event).trigger(D,C)}var l=
f.extend(true,{},f.ajaxSettings,b),o,q,z,w=b&&b.context||l,A=l.type.toUpperCase();if(l.data&&l.processData&&typeof l.data!=="string")l.data=f.param(l.data,l.traditional);if(l.dataType==="jsonp"){if(A==="GET")va.test(l.url)||(l.url+=(Ma.test(l.url)?"&":"?")+(l.jsonp||"callback")+"=?");else if(!l.data||!va.test(l.data))l.data=(l.data?l.data+"&":"")+(l.jsonp||"callback")+"=?";l.dataType="json"}if(l.dataType==="json"&&(l.data&&va.test(l.data)||va.test(l.url))){o=l.jsonpCallback||"jsonp"+zb++;if(l.data)l.data=
(l.data+"").replace(va,"="+o+"$1");l.url=l.url.replace(va,"="+o+"$1");l.dataType="script";d[o]=d[o]||function(D){z=D;e();g();d[o]=h;try{delete d[o]}catch(C){}W&&W.removeChild(aa)}}if(l.dataType==="script"&&l.cache===null)l.cache=false;if(l.cache===false&&A==="GET"){var H=B(),S=l.url.replace(Db,"$1_="+H+"$2");l.url=S+(S===l.url?(Ma.test(l.url)?"&":"?")+"_="+H:"")}if(l.data&&A==="GET")l.url+=(Ma.test(l.url)?"&":"?")+l.data;l.global&&!f.active++&&f.event.trigger("ajaxStart");H=(H=Eb.exec(l.url))&&(H[1]&&
H[1]!==location.protocol||H[2]!==location.host);if(l.dataType==="script"&&A==="GET"&&H){var W=G.getElementsByTagName("head")[0]||G.documentElement,aa=G.createElement("script");aa.src=l.url;if(l.scriptCharset)aa.charset=l.scriptCharset;if(!o){var Y=false;aa.onload=aa.onreadystatechange=function(){if(!Y&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){Y=true;e();g();aa.onload=aa.onreadystatechange=null;W&&aa.parentNode&&W.removeChild(aa)}}}W.insertBefore(aa,W.firstChild);
return h}var ha=false,N=l.xhr();if(N){l.username?N.open(A,l.url,l.async,l.username,l.password):N.open(A,l.url,l.async);try{if(l.data||b&&b.contentType)N.setRequestHeader("Content-Type",l.contentType);if(l.ifModified){f.lastModified[l.url]&&N.setRequestHeader("If-Modified-Since",f.lastModified[l.url]);f.etag[l.url]&&N.setRequestHeader("If-None-Match",f.etag[l.url])}H||N.setRequestHeader("X-Requested-With","XMLHttpRequest");N.setRequestHeader("Accept",l.dataType&&l.accepts[l.dataType]?l.accepts[l.dataType]+
", */*":l.accepts._default)}catch(Ia){}if(l.beforeSend&&l.beforeSend.call(w,N,l)===false){l.global&&!--f.active&&f.event.trigger("ajaxStop");N.abort();return false}l.global&&k("ajaxSend",[N,l]);var n=N.onreadystatechange=function(D){if(!N||N.readyState===0||D==="abort"){ha||g();ha=true;if(N)N.onreadystatechange=f.noop}else if(!ha&&N&&(N.readyState===4||D==="timeout")){ha=true;N.onreadystatechange=f.noop;q=D==="timeout"?"timeout":!f.httpSuccess(N)?"error":l.ifModified&&f.httpNotModified(N,l.url)?"notmodified":
"success";var C;if(q==="success")try{z=f.httpData(N,l.dataType,l)}catch(M){q="parsererror";C=M}if(q==="success"||q==="notmodified")o||e();else f.handleError(l,N,q,C);g();D==="timeout"&&N.abort();if(l.async)N=null}};try{var s=N.abort;N.abort=function(){N&&s.call(N);n("abort")}}catch(x){}l.async&&l.timeout>0&&setTimeout(function(){N&&!ha&&n("timeout")},l.timeout);try{N.send(A==="POST"||A==="PUT"||A==="DELETE"?l.data:null)}catch(y){f.handleError(l,N,null,y);g()}l.async||n();return N}},handleError:function(b,
e,g,k){if(b.error)b.error.call(b.context||b,e,g,k);if(b.global)(b.context?f(b.context):f.event).trigger("ajaxError",[e,b,k])},active:0,httpSuccess:function(b){try{return!b.status&&location.protocol==="file:"||b.status>=200&&b.status<300||b.status===304||b.status===1223||b.status===0}catch(e){}return false},httpNotModified:function(b,e){var g=b.getResponseHeader("Last-Modified"),k=b.getResponseHeader("Etag");if(g)f.lastModified[e]=g;if(k)f.etag[e]=k;return b.status===304||b.status===0},httpData:function(b,
e,g){var k=b.getResponseHeader("content-type")||"",l=e==="xml"||!e&&k.indexOf("xml")>=0;b=l?b.responseXML:b.responseText;l&&b.documentElement.nodeName==="parsererror"&&f.error("parsererror");if(g&&g.dataFilter)b=g.dataFilter(b,e);if(typeof b==="string")if(e==="json"||!e&&k.indexOf("json")>=0)b=f.parseJSON(b);else if(e==="script"||!e&&k.indexOf("javascript")>=0)f.globalEval(b);return b},param:function(b,e){function g(q,z){if(f.isArray(z))f.each(z,function(w,A){e||/\[\]$/.test(q)?k(q,A):g(q+"["+(typeof A===
"object"||f.isArray(A)?w:"")+"]",A)});else!e&&z!=null&&typeof z==="object"?f.each(z,function(w,A){g(q+"["+w+"]",A)}):k(q,z)}function k(q,z){z=f.isFunction(z)?z():z;l[l.length]=encodeURIComponent(q)+"="+encodeURIComponent(z)}var l=[];if(e===h)e=f.ajaxSettings.traditional;if(f.isArray(b)||b.jquery)f.each(b,function(){k(this.name,this.value)});else for(var o in b)g(o,b[o]);return l.join("&").replace(Fb,"+")}});var Na={},Hb=/toggle|show|hide/,Ib=/^([+-]=)?([\d+-.]+)(.*)$/,Ea,Qa=[["height","marginTop",
"marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];f.fn.extend({show:function(b,e){if(b||b===0)return this.animate(X("show",3),b,e);else{for(var g=0,k=this.length;g<k;g++){var l=f.data(this[g],"olddisplay");this[g].style.display=l||"";if(f.css(this[g],"display")==="none"){l=this[g].nodeName;var o;if(Na[l])o=Na[l];else{var q=f("<"+l+" />").appendTo("body");o=q.css("display");if(o==="none")o="block";q.remove();Na[l]=o}f.data(this[g],
"olddisplay",o)}}g=0;for(k=this.length;g<k;g++)this[g].style.display=f.data(this[g],"olddisplay")||"";return this}},hide:function(b,e){if(b||b===0)return this.animate(X("hide",3),b,e);else{for(var g=0,k=this.length;g<k;g++){var l=f.data(this[g],"olddisplay");!l&&l!=="none"&&f.data(this[g],"olddisplay",f.css(this[g],"display"))}g=0;for(k=this.length;g<k;g++)this[g].style.display="none";return this}},_toggle:f.fn.toggle,toggle:function(b,e){var g=typeof b==="boolean";if(f.isFunction(b)&&f.isFunction(e))this._toggle.apply(this,
arguments);else b==null||g?this.each(function(){var k=g?b:f(this).is(":hidden");f(this)[k?"show":"hide"]()}):this.animate(X("toggle",3),b,e);return this},fadeTo:function(b,e,g){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:e},b,g)},animate:function(b,e,g,k){var l=f.speed(e,g,k);if(f.isEmptyObject(b))return this.each(l.complete);return this[l.queue===false?"each":"queue"](function(){var o=f.extend({},l),q,z=this.nodeType===1&&f(this).is(":hidden"),w=this;for(q in b){var A=
q.replace(Ka,La);if(q!==A){b[A]=b[q];delete b[q];q=A}if(b[q]==="hide"&&z||b[q]==="show"&&!z)return o.complete.call(this);if((q==="height"||q==="width")&&this.style){o.display=f.css(this,"display");o.overflow=this.style.overflow}if(f.isArray(b[q])){(o.specialEasing=o.specialEasing||{})[q]=b[q][1];b[q]=b[q][0]}}if(o.overflow!=null)this.style.overflow="hidden";o.curAnim=f.extend({},b);f.each(b,function(H,S){var W=new f.fx(w,o,H);if(Hb.test(S))W[S==="toggle"?z?"show":"hide":S](b);else{var aa=Ib.exec(S),
Y=W.cur(true)||0;if(aa){var ha=parseFloat(aa[2]),N=aa[3]||"px";if(N!=="px"){w.style[H]=(ha||1)+N;Y=(ha||1)/W.cur(true)*Y;w.style[H]=Y+N}if(aa[1])ha=(aa[1]==="-="?-1:1)*ha+Y;W.custom(Y,ha,N)}else W.custom(Y,S,"")}});return true})},stop:function(b,e){var g=f.timers;b&&this.queue([]);this.each(function(){for(var k=g.length-1;k>=0;k--)if(g[k].elem===this){e&&g[k](true);g.splice(k,1)}});e||this.dequeue();return this}});f.each({slideDown:X("show",1),slideUp:X("hide",1),slideToggle:X("toggle",1),fadeIn:{opacity:"show"},
fadeOut:{opacity:"hide"}},function(b,e){f.fn[b]=function(g,k){return this.animate(e,g,k)}});f.extend({speed:function(b,e,g){var k=b&&typeof b==="object"?b:{complete:g||!g&&e||f.isFunction(b)&&b,duration:b,easing:g&&e||e&&!f.isFunction(e)&&e};k.duration=f.fx.off?0:typeof k.duration==="number"?k.duration:f.fx.speeds[k.duration]||f.fx.speeds._default;k.old=k.complete;k.complete=function(){k.queue!==false&&f(this).dequeue();f.isFunction(k.old)&&k.old.call(this)};return k},easing:{linear:function(b,e,
g,k){return g+k*b},swing:function(b,e,g,k){return(-Math.cos(b*Math.PI)/2+0.5)*k+g}},timers:[],fx:function(b,e,g){this.options=e;this.elem=b;this.prop=g;if(!e.orig)e.orig={}}});f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(f.fx.step[this.prop]||f.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(b){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
null))return this.elem[this.prop];return(b=parseFloat(f.css(this.elem,this.prop,b)))&&b>-10000?b:parseFloat(f.curCSS(this.elem,this.prop))||0},custom:function(b,e,g){function k(o){return l.step(o)}this.startTime=B();this.start=b;this.end=e;this.unit=g||this.unit||"px";this.now=this.start;this.pos=this.state=0;var l=this;k.elem=this.elem;if(k()&&f.timers.push(k)&&!Ea)Ea=setInterval(f.fx.tick,13)},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop===
"width"||this.prop==="height"?1:0,this.cur());f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(b){var e=B(),g=true;if(b||e>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var k in this.options.curAnim)if(this.options.curAnim[k]!==true)g=false;if(g){if(this.options.display!=null){this.elem.style.overflow=
this.options.overflow;b=f.data(this.elem,"olddisplay");this.elem.style.display=b?b:this.options.display;if(f.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&f(this.elem).hide();if(this.options.hide||this.options.show)for(var l in this.options.curAnim)f.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{l=e-this.startTime;this.state=l/this.options.duration;b=this.options.easing||(f.easing.swing?"swing":"linear");this.pos=
f.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,l,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};f.extend(f.fx,{tick:function(){for(var b=f.timers,e=0;e<b.length;e++)b[e]()||b.splice(e--,1);b.length||f.fx.stop()},stop:function(){clearInterval(Ea);Ea=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(b){f.style(b.elem,"opacity",b.now)},_default:function(b){if(b.elem.style&&b.elem.style[b.prop]!=
null)b.elem.style[b.prop]=(b.prop==="width"||b.prop==="height"?Math.max(0,b.now):b.now)+b.unit;else b.elem[b.prop]=b.now}}});if(f.expr&&f.expr.filters)f.expr.filters.animated=function(b){return f.grep(f.timers,function(e){return b===e.elem}).length};f.fn.offset="getBoundingClientRect"in G.documentElement?function(b){var e=this[0];if(b)return this.each(function(l){f.offset.setOffset(this,b,l)});if(!e||!e.ownerDocument)return null;if(e===e.ownerDocument.body)return f.offset.bodyOffset(e);var g=e.getBoundingClientRect(),
k=e.ownerDocument;e=k.body;k=k.documentElement;return{top:g.top+(self.pageYOffset||f.support.boxModel&&k.scrollTop||e.scrollTop)-(k.clientTop||e.clientTop||0),left:g.left+(self.pageXOffset||f.support.boxModel&&k.scrollLeft||e.scrollLeft)-(k.clientLeft||e.clientLeft||0)}}:function(b){var e=this[0];if(b)return this.each(function(H){f.offset.setOffset(this,b,H)});if(!e||!e.ownerDocument)return null;if(e===e.ownerDocument.body)return f.offset.bodyOffset(e);f.offset.initialize();var g=e.offsetParent,k=
e,l=e.ownerDocument,o,q=l.documentElement,z=l.body;k=(l=l.defaultView)?l.getComputedStyle(e,null):e.currentStyle;for(var w=e.offsetTop,A=e.offsetLeft;(e=e.parentNode)&&e!==z&&e!==q;){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;o=l?l.getComputedStyle(e,null):e.currentStyle;w-=e.scrollTop;A-=e.scrollLeft;if(e===g){w+=e.offsetTop;A+=e.offsetLeft;if(f.offset.doesNotAddBorder&&!(f.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(e.nodeName))){w+=parseFloat(o.borderTopWidth)||
0;A+=parseFloat(o.borderLeftWidth)||0}k=g;g=e.offsetParent}if(f.offset.subtractsBorderForOverflowNotVisible&&o.overflow!=="visible"){w+=parseFloat(o.borderTopWidth)||0;A+=parseFloat(o.borderLeftWidth)||0}k=o}if(k.position==="relative"||k.position==="static"){w+=z.offsetTop;A+=z.offsetLeft}if(f.offset.supportsFixedPosition&&k.position==="fixed"){w+=Math.max(q.scrollTop,z.scrollTop);A+=Math.max(q.scrollLeft,z.scrollLeft)}return{top:w,left:A}};f.offset={initialize:function(){var b=G.body,e=G.createElement("div"),
g,k,l,o=parseFloat(f.curCSS(b,"marginTop",true))||0;f.extend(e.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});e.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";b.insertBefore(e,b.firstChild);
g=e.firstChild;k=g.firstChild;l=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=k.offsetTop!==5;this.doesAddBorderForTableAndCells=l.offsetTop===5;k.style.position="fixed";k.style.top="20px";this.supportsFixedPosition=k.offsetTop===20||k.offsetTop===15;k.style.position=k.style.top="";g.style.overflow="hidden";g.style.position="relative";this.subtractsBorderForOverflowNotVisible=k.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=b.offsetTop!==o;b.removeChild(e);f.offset.initialize=f.noop},
bodyOffset:function(b){var e=b.offsetTop,g=b.offsetLeft;f.offset.initialize();if(f.offset.doesNotIncludeMarginInBodyOffset){e+=parseFloat(f.curCSS(b,"marginTop",true))||0;g+=parseFloat(f.curCSS(b,"marginLeft",true))||0}return{top:e,left:g}},setOffset:function(b,e,g){if(/static/.test(f.curCSS(b,"position")))b.style.position="relative";var k=f(b),l=k.offset(),o=parseInt(f.curCSS(b,"top",true),10)||0,q=parseInt(f.curCSS(b,"left",true),10)||0;if(f.isFunction(e))e=e.call(b,g,l);g={top:e.top-l.top+o,left:e.left-
l.left+q};"using"in e?e.using.call(b,g):k.css(g)}};f.fn.extend({position:function(){if(!this[0])return null;var b=this[0],e=this.offsetParent(),g=this.offset(),k=/^body|html$/i.test(e[0].nodeName)?{top:0,left:0}:e.offset();g.top-=parseFloat(f.curCSS(b,"marginTop",true))||0;g.left-=parseFloat(f.curCSS(b,"marginLeft",true))||0;k.top+=parseFloat(f.curCSS(e[0],"borderTopWidth",true))||0;k.left+=parseFloat(f.curCSS(e[0],"borderLeftWidth",true))||0;return{top:g.top-k.top,left:g.left-k.left}},offsetParent:function(){return this.map(function(){for(var b=
this.offsetParent||G.body;b&&!/^body|html$/i.test(b.nodeName)&&f.css(b,"position")==="static";)b=b.offsetParent;return b})}});f.each(["Left","Top"],function(b,e){var g="scroll"+e;f.fn[g]=function(k){var l=this[0],o;if(!l)return null;if(k!==h)return this.each(function(){if(o=ma(this))o.scrollTo(!b?k:f(o).scrollLeft(),b?k:f(o).scrollTop());else this[g]=k});else return(o=ma(l))?"pageXOffset"in o?o[b?"pageYOffset":"pageXOffset"]:f.support.boxModel&&o.document.documentElement[g]||o.document.body[g]:l[g]}});
f.each(["Height","Width"],function(b,e){var g=e.toLowerCase();f.fn["inner"+e]=function(){return this[0]?f.css(this[0],g,false,"padding"):null};f.fn["outer"+e]=function(k){return this[0]?f.css(this[0],g,false,k?"margin":"border"):null};f.fn[g]=function(k){var l=this[0];if(!l)return k==null?null:this;if(f.isFunction(k))return this.each(function(o){var q=f(this);q[g](k.call(this,o,q[g]()))});return"scrollTo"in l&&l.document?l.document.compatMode==="CSS1Compat"&&l.document.documentElement["client"+e]||
l.document.body["client"+e]:l.nodeType===9?Math.max(l.documentElement["client"+e],l.body["scroll"+e],l.documentElement["scroll"+e],l.body["offset"+e],l.documentElement["offset"+e]):k===h?f.css(l,g):this.css(g,typeof k==="string"?k:k+"px")}});d.jQuery=d.$=f})(window);
(function(){function d(u,F,J){if(u.addEventListener)u.addEventListener(F,J,false);else if(u.attachEvent)u.attachEvent("on"+F,function(){J.call(u)});else throw new Error("not supported or DOM not loaded");}function h(u,F){for(var J in F)if(F.hasOwnProperty(J))u.style[J]=F[J]}function m(u,F){u.className=u.className.replace(new RegExp("\\b"+F+"\\b"),"")}function p(u){u.parentNode.removeChild(u)}var E=document.documentElement.getBoundingClientRect?function(u){var F=u.getBoundingClientRect(),J=u.ownerDocument;
u=J.body;J=J.documentElement;var P=J.clientTop||u.clientTop||0,U=J.clientLeft||u.clientLeft||0,Q=1;if(u.getBoundingClientRect){Q=u.getBoundingClientRect();Q=(Q.right-Q.left)/u.clientWidth}if(Q>1)U=P=0;return{top:F.top/Q+(window.pageYOffset||J&&J.scrollTop/Q||u.scrollTop/Q)-P,left:F.left/Q+(window.pageXOffset||J&&J.scrollLeft/Q||u.scrollLeft/Q)-U}}:function(u){var F=0,J=0;do{F+=u.offsetTop||0;J+=u.offsetLeft||0;u=u.offsetParent}while(u);return{left:J,top:F}},B=function(){var u=document.createElement("div");
return function(F){u.innerHTML=F;return u.removeChild(u.firstChild)}}(),I=function(){var u=0;return function(){return"ValumsAjaxUpload"+u++}}();window.AjaxUpload=function(u,F){this._settings={action:"upload.php",name:"userfile",data:{},autoSubmit:true,responseType:false,hoverClass:"hover",disabledClass:"disabled",onChange:function(){},onSubmit:function(){},onComplete:function(){}};for(var J in F)if(F.hasOwnProperty(J))this._settings[J]=F[J];if(u.jquery)u=u[0];else if(typeof u=="string"){if(/^#.*/.test(u))u=
u.slice(1);u=document.getElementById(u)}if(!u||u.nodeType!==1)throw new Error("Please make sure that you're passing a valid element");u.nodeName.toUpperCase()=="A"&&d(u,"click",function(P){if(P&&P.preventDefault)P.preventDefault();else if(window.event)window.event.returnValue=false});this._button=u;this._input=null;this._disabled=false;this.enable();this._rerouteClicks()};AjaxUpload.prototype={setData:function(u){this._settings.data=u},disable:function(){var u=this._button,F=this._settings.disabledClass;
(new RegExp("\\b"+F+"\\b")).test(u.className)||(u.className+=" "+F);this._disabled=true;u=this._button.nodeName.toUpperCase();if(u=="INPUT"||u=="BUTTON")this._button.setAttribute("disabled","disabled");if(this._input)this._input.parentNode.style.visibility="hidden"},enable:function(){m(this._button,this._settings.disabledClass);this._button.removeAttribute("disabled");this._disabled=false},_createInput:function(){var u=this,F=document.createElement("input");F.setAttribute("type","file");F.setAttribute("name",
this._settings.name);h(F,{position:"absolute",right:0,margin:0,padding:0,fontSize:"480px",cursor:"pointer"});var J=document.createElement("div");h(J,{display:"block",position:"absolute",overflow:"hidden",margin:0,padding:0,opacity:0,direction:"ltr",zIndex:2147483583});if(J.style.opacity!=="0"){if(typeof J.filters=="undefined")throw new Error("Opacity not supported by the browser");J.style.filter="alpha(opacity=0)"}d(F,"change",function(){if(!(!F||F.value==="")){var P=F.value.replace(/.*(\/|\\)/,"");
if(false===u._settings.onChange.call(u,P,-1!==P.indexOf(".")?P.replace(/.*[.]/,""):""))u._clearInput();else u._settings.autoSubmit&&u.submit()}});d(F,"mouseover",function(){var P=u._button,U=u._settings.hoverClass;(new RegExp("\\b"+U+"\\b")).test(P.className)||(P.className+=" "+U)});d(F,"mouseout",function(){m(u._button,u._settings.hoverClass);F.parentNode.style.visibility="hidden"});J.appendChild(F);document.body.appendChild(J);this._input=F},_clearInput:function(){if(this._input){p(this._input.parentNode);
this._input=null;this._createInput();m(this._button,this._settings.hoverClass)}},_rerouteClicks:function(){var u=this;d(u._button,"mouseover",function(){if(!u._disabled){u._input||u._createInput();var F=u._input.parentNode,J=u._button,P,U;U=E(J);P=U.left;U=U.top;P={left:P,right:P+J.offsetWidth,top:U,bottom:U+J.offsetHeight};h(F,{position:"absolute",left:P.left+"px",top:P.top+"px",width:J.offsetWidth+"px",height:J.offsetHeight+"px"});F.style.visibility="visible"}})},_createIframe:function(){var u=
I(),F=B('<iframe src="javascript:false;" name="'+u+'">');F.setAttribute("id",u);F.style.display="none";document.body.appendChild(F);return F},_createForm:function(u){var F=this._settings,J=B('<form method="post" enctype="multipart/form-data"></form>');J.setAttribute("action",F.action);J.setAttribute("target",u.name);J.style.display="none";document.body.appendChild(J);for(var P in F.data)if(F.data.hasOwnProperty(P)){u=document.createElement("input");u.setAttribute("type","hidden");u.setAttribute("name",
P);u.setAttribute("value",F.data[P]);J.appendChild(u)}return J},_getResponse:function(u,F){var J=false,P=this,U=this._settings;d(u,"load",function(){if(u.src=="javascript:'%3Chtml%3E%3C/html%3E';"||u.src=="javascript:'<html></html>';")J&&setTimeout(function(){p(u)},0);else{var Q=u.contentDocument?u.contentDocument:window.frames[u.id].document;if(!(Q.body&&Q.body.innerHTML=="false")){var X;if(Q.XMLDocument)X=Q.XMLDocument;else if(Q.body){X=Q.body.innerHTML;if(U.responseType&&U.responseType.toLowerCase()==
"json"){if(Q.body.firstChild&&Q.body.firstChild.nodeName.toUpperCase()=="PRE")X=Q.body.firstChild.firstChild.nodeValue;X=X?eval("("+X+")"):{}}}else X=Q;U.onComplete.call(P,F,X);J=true;u.src="javascript:'<html></html>';"}}})},submit:function(){var u=this._settings;if(!(!this._input||this._input.value==="")){var F=this._input.value.replace(/.*(\/|\\)/,"");if(false===u.onSubmit.call(this,F,-1!==F.indexOf(".")?F.replace(/.*[.]/,""):""))this._clearInput();else{u=this._createIframe();var J=this._createForm(u);
p(this._input.parentNode);m(this._button,this._settings.hoverClass);J.appendChild(this._input);J.submit();p(J);p(this._input);this._input=null;this._getResponse(u,F);this._createInput()}}}}})();
(function(d,h){function m(L){return typeof L==="string"}function p(L){var O=F.call(arguments,1);return function(){return L.apply(this,O.concat(F.call(arguments)))}}function E(L,O,R,V,ga){var ba;if(V!==u){O=R.match(L?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);R=O[3]||"";if(ga===2&&m(V))V=V.replace(L?Aa:za,"");else{ba=Q(O[2]);V=m(V)?Q[L?ia:da](V):V;V=ga===2?V:ga===1?d.extend({},V,ba):d.extend({},ba,V);V=P(V);if(L)V=V.replace(qa,J)}L=O[1]+(L?"#":V||!O[1]?"?":"")+V+R}else L=O(R!==u?R:h[xa][pa]);
return L}function B(L,O,R){if(O===u||typeof O==="boolean"){R=O;O=P[L?ia:da]()}else O=m(O)?O.replace(L?Aa:za,""):O;return Q(O,R)}function I(L,O,R,V){if(!m(R)&&typeof R!=="object"){V=R;R=O;O=u}return this.each(function(){var ga=d(this),ba=O||fa()[(this.nodeName||"").toLowerCase()]||"",Z=ba&&ga.attr(ba)||"";ga.attr(ba,P[L](Z,R,V))})}var u,F=Array.prototype.slice,J=decodeURIComponent,P=d.param,U,Q,X,ma=d.bbq=d.bbq||{},f,oa,fa,G=d.event.special,da="querystring",ia="fragment",xa="location",pa="href",za=
/^.*\?|#.*$/g,Aa=/^.*\#/,qa,Ba={};P[da]=p(E,0,function(L){return L.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});P[ia]=U=p(E,1,function(L){return L.replace(/^[^#]*#?(.*)$/,"$1")});U.noEscape=function(L){L=d.map((L||"").split(""),encodeURIComponent);qa=new RegExp(L.join("|"),"g")};U.noEscape(",/");d.deparam=Q=function(L,O){var R={},V={"true":true,"false":false,"null":null};d.each(L.replace(/\+/g," ").split("&"),function(ga,ba){var Z=ba.split("="),ca=J(Z[0]),ta=R,na=0,ea=ca.split("]["),la=ea.length-
1;if(/\[/.test(ea[0])&&/\]$/.test(ea[la])){ea[la]=ea[la].replace(/\]$/,"");ea=ea.shift().split("[").concat(ea);la=ea.length-1}else la=0;if(Z.length===2){Z=J(Z[1]);if(O)Z=Z&&!isNaN(Z)?+Z:Z==="undefined"?u:V[Z]!==u?V[Z]:Z;if(la)for(;na<=la;na++){ca=ea[na]===""?ta.length:ea[na];ta=ta[ca]=na<la?ta[ca]||(ea[na+1]&&isNaN(ea[na+1])?{}:[]):Z}else if(d.isArray(R[ca]))R[ca].push(Z);else R[ca]=R[ca]!==u?[R[ca],Z]:Z}else if(ca)R[ca]=O?u:""});return R};Q[da]=p(B,0);Q[ia]=X=p(B,1);d.elemUrlAttr||(d.elemUrlAttr=
function(L){return d.extend(Ba,L)})({a:pa,base:pa,iframe:"src",img:"src",input:"src",form:"action",link:pa,script:"src"});fa=d.elemUrlAttr;d.fn[da]=p(I,da);d.fn[ia]=p(I,ia);ma.pushState=f=function(L,O){if(m(L)&&/^#/.test(L)&&O===u)O=2;var R=L!==u;R=U(h[xa][pa],R?L:{},R?O:2);h[xa][pa]=R+(/#/.test(R)?"":"#")};ma.getState=oa=function(L,O){return L===u||typeof L==="boolean"?X(L):X(O)[L]};ma.removeState=function(L){var O={};if(L!==u){O=oa();d.each(d.isArray(L)?L:arguments,function(R,V){delete O[V]})}f(O,
2)};G.hashchange=d.extend(G.hashchange,{add:function(L){function O(V){var ga=V[ia]=U();V.getState=function(ba,Z){return ba===u||typeof ba==="boolean"?Q(ga,ba):Q(ga,Z)[ba]};R.apply(this,arguments)}var R;if(d.isFunction(L)){R=L;return O}else{R=L.handler;L.handler=O}}})})(jQuery,this);
(function(d,h,m){function p(U){U=U||h[I][u];return U.replace(/^[^#]*#?(.*)$/,"$1")}var E,B=d.event.special,I="location",u="href",F=document.documentMode,J=d.browser.msie&&(F===m||F<8),P="onhashchange"in h&&!J;d.hashchangeDelay=100;B.hashchange=d.extend(B.hashchange,{setup:function(){if(P)return false;d(E.start)},teardown:function(){if(P)return false;d(E.stop)}});E=function(){function U(){f=oa=function(fa){return fa};if(J){ma=d('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;
oa=function(){return p(ma.document[I][u])};f=function(fa,G){if(fa!==G){var da=ma.document;da.open().close();da[I].hash="#"+fa}};f(p())}}var Q={},X,ma,f,oa;Q.start=function(){if(!X){var fa=p();f||U();(function G(){var da=p(),ia=oa(fa);if(da!==fa){f(fa=da,ia);d(h).trigger("hashchange")}else if(ia!==fa)h[I][u]=h[I][u].replace(/#.*/,"")+"#"+ia;X=setTimeout(G,d.hashchangeDelay)})()}};Q.stop=function(){if(!ma){X&&clearTimeout(X);X=0}};return Q}()})(jQuery,this);var jaaulde=window.jaaulde||{};
jaaulde.utils=jaaulde.utils||{};
jaaulde.utils.cookies=function(){var d,h,m,p,E={expiresAt:null,path:"/",domain:null,secure:false};d=function(B){var I,u;if(typeof B!=="object"||B===null)I=E;else{I={expiresAt:E.expiresAt,path:E.path,domain:E.domain,secure:E.secure};if(typeof B.expiresAt==="object"&&B.expiresAt instanceof Date)I.expiresAt=B.expiresAt;else if(typeof B.hoursToLive==="number"&&B.hoursToLive!==0){u=new Date;u.setTime(u.getTime()+B.hoursToLive*60*60*1E3);I.expiresAt=u}if(typeof B.path==="string"&&B.path!=="")I.path=B.path;
if(typeof B.domain==="string"&&B.domain!=="")I.domain=B.domain;if(B.secure===true)I.secure=B.secure}return I};h=function(B){B=d(B);return(typeof B.expiresAt==="object"&&B.expiresAt instanceof Date?"; expires="+B.expiresAt.toGMTString():"")+"; path="+B.path+(typeof B.domain==="string"?"; domain="+B.domain:"")+(B.secure===true?"; secure":"")};m=function(){var B={},I,u,F,J,P=document.cookie.split(";"),U;for(I=0;I<P.length;I+=1){u=P[I].split("=");F=u[0].replace(/^\s*/,"").replace(/\s*$/,"");try{J=decodeURIComponent(u[1])}catch(Q){J=
u[1]}if(typeof JSON==="object"&&JSON!==null&&typeof JSON.parse==="function")try{U=J;J=JSON.parse(J)}catch(X){J=U}B[F]=J}return B};p=function(){};p.prototype.get=function(B){var I,u,F=m();if(typeof B==="string")I=typeof F[B]!=="undefined"?F[B]:null;else if(typeof B==="object"&&B!==null){I={};for(u in B)I[B[u]]=typeof F[B[u]]!=="undefined"?F[B[u]]:null}else I=F;return I};p.prototype.filter=function(B){var I,u={},F=m();if(typeof B==="string")B=new RegExp(B);for(I in F)if(I.match(B))u[I]=F[I];return u};
p.prototype.set=function(B,I,u){if(typeof u!=="object"||u===null)u={};if(typeof I==="undefined"||I===null){I="";u.hoursToLive=-8760}else if(typeof I!=="string")if(typeof JSON==="object"&&JSON!==null&&typeof JSON.stringify==="function")I=JSON.stringify(I);else throw new Error("cookies.set() received non-string value and could not serialize.");u=h(u);document.cookie=B+"="+encodeURIComponent(I)+u};p.prototype.del=function(B,I){var u={},F;if(typeof I!=="object"||I===null)I={};if(typeof B==="boolean"&&
B===true)u=this.get();else if(typeof B==="string")u[B]=true;for(F in u)typeof F==="string"&&F!==""&&this.set(F,null,I)};p.prototype.test=function(){var B=false;this.set("cT","data");if(this.get("cT")==="data"){this.del("cT");B=true}return B};p.prototype.setOptions=function(B){if(typeof B!=="object")B=null;E=d(B)};return new p}();
(function(){window.jQuery&&function(d){d.cookies=jaaulde.utils.cookies;d.each({cookify:function(h){return this.each(function(){var m,p=["name","id"],E,B=d(this),I;for(m in p)if(!isNaN(m)){E=B.attr(p[m]);if(typeof E==="string"&&E!==""){if(B.is(":checkbox, :radio")){if(B.attr("checked"))I=B.val()}else I=B.is(":input")?B.val():B.html();if(typeof I!=="string"||I==="")I=null;d.cookies.set(E,I,h);break}}})},cookieFill:function(){return this.each(function(){for(var h,m=["name","id"],p,E=d(this);function(){h=
m.pop();return!!h}();){p=E.attr(h);if(typeof p==="string"&&p!==""){p=d.cookies.get(p);if(p!==null)if(E.is(":checkbox, :radio"))E.val()===p?E.attr("checked","checked"):E.removeAttr("checked");else E.is(":input")?E.val(p):E.html(p);break}}})},cookieBind:function(h){return this.each(function(){var m=d(this);m.cookieFill().change(function(){m.cookify(h)})})}},function(h){d.fn[h]=this})}(window.jQuery)})();
DateInput=function(d){function h(m,p){if(typeof p!="object")p={};d.extend(this,h.DEFAULT_OPTS,p);this.input=d(m);this.bindMethodsToObj("show","hide","hideIfClickOutside","keydownHandler","selectDate");this.build();this.selectDate();this.hide()}h.DEFAULT_OPTS={month_names:_("date_input_months"),short_month_names:_("date_input_months_short"),short_day_names:_("date_input_days"),start_of_week:1};h.prototype={build:function(){var m=d('<p class="month_nav"><span class="button prev" title="[Page-Up]">&#171;</span> <span class="month_name"></span> <span class="button next" title="[Page-Down]">&#187;</span></p>');
this.monthNameSpan=d(".month_name",m);d(".prev",m).click(this.bindToObj(function(){this.moveMonthBy(-1)}));d(".next",m).click(this.bindToObj(function(){this.moveMonthBy(1)}));var p=d('<p class="year_nav"><span class="button prev" title="[Ctrl+Page-Up]">&#171;</span> <span class="year_name"></span> <span class="button next" title="[Ctrl+Page-Down]">&#187;</span></p>');this.yearNameSpan=d(".year_name",p);d(".prev",p).click(this.bindToObj(function(){this.moveMonthBy(-12)}));d(".next",p).click(this.bindToObj(function(){this.moveMonthBy(12)}));
m=d('<div class="nav"></div>').append(m,p);var E="<table><thead><tr>";d(this.adjustDays(this.short_day_names)).each(function(){E+="<th>"+this+"</th>"});E+="</tr></thead><tbody></tbody></table>";this.dateSelector=this.rootLayers=d('<div class="date_selector"></div>').append(m,E).insertAfter(this.input);if(d.browser.msie&&d.browser.version<7){this.ieframe=d('<iframe class="date_selector_ieframe" frameborder="0" src="#"></iframe>').insertBefore(this.dateSelector);this.rootLayers=this.rootLayers.add(this.ieframe);
d(".button",m).mouseover(function(){d(this).addClass("hover")});d(".button",m).mouseout(function(){d(this).removeClass("hover")})}this.tbody=d("tbody",this.dateSelector);this.input.change(this.bindToObj(function(){this.selectDate()}));this.selectDate()},selectMonth:function(m){var p=new Date(m.getFullYear(),m.getMonth(),1);if(!this.currentMonth||!(this.currentMonth.getFullYear()==p.getFullYear()&&this.currentMonth.getMonth()==p.getMonth())){this.currentMonth=p;p=this.rangeStart(m);var E=this.rangeEnd(m);
E=this.daysBetween(p,E);for(var B="",I=0;I<=E;I++){var u=new Date(p.getFullYear(),p.getMonth(),p.getDate()+I,12,0);if(this.isFirstDayOfWeek(u))B+="<tr>";B+=u.getMonth()==m.getMonth()?'<td class="selectable_day" date="'+this.dateToString(u)+'">'+u.getDate()+"</td>":'<td class="unselected_month" date="'+this.dateToString(u)+'">'+u.getDate()+"</td>";if(this.isLastDayOfWeek(u))B+="</tr>"}this.tbody.empty().append(B);this.monthNameSpan.empty().append(this.monthName(m));this.yearNameSpan.empty().append(this.currentMonth.getFullYear());
d(".selectable_day",this.tbody).click(this.bindToObj(function(F){this.changeInput(d(F.target).attr("date"))}));d("td[date="+this.dateToString(new Date)+"]",this.tbody).addClass("today");d("td.selectable_day",this.tbody).mouseover(function(){d(this).addClass("hover")});d("td.selectable_day",this.tbody).mouseout(function(){d(this).removeClass("hover")})}d(".selected",this.tbody).removeClass("selected");d("td[date="+this.selectedDateString+"]",this.tbody).addClass("selected")},selectDate:function(m){if(typeof m==
"undefined")m=this.stringToDate(this.input.val());m||(m=new Date);this.selectedDate=m;this.selectedDateString=this.dateToString(this.selectedDate);this.selectMonth(this.selectedDate)},changeInput:function(m){this.input.val(m).change();this.hide()},show:function(){this.rootLayers.css("display","block");d([window,document.body]).click(this.hideIfClickOutside);this.input.unbind("focus",this.show);d(document.body).keydown(this.keydownHandler);this.setPosition()},hide:function(){this.rootLayers.css("display",
"none");d([window,document.body]).unbind("click",this.hideIfClickOutside);this.input.focus(this.show);d(document.body).unbind("keydown",this.keydownHandler)},hideIfClickOutside:function(m){m.target!=this.input[0]&&!this.insideSelector(m)&&this.hide()},insideSelector:function(m){var p=this.dateSelector.offset();p.right=p.left+this.dateSelector.outerWidth();p.bottom=p.top+this.dateSelector.outerHeight();return m.pageY<p.bottom&&m.pageY>p.top&&m.pageX<p.right&&m.pageX>p.left},keydownHandler:function(m){switch(m.keyCode){case 9:case 27:this.hide();
return;case 13:this.changeInput(this.selectedDateString);break;case 33:this.moveDateMonthBy(m.ctrlKey?-12:-1);break;case 34:this.moveDateMonthBy(m.ctrlKey?12:1);break;case 38:this.moveDateBy(-7);break;case 40:this.moveDateBy(7);break;case 37:this.moveDateBy(-1);break;case 39:this.moveDateBy(1);break;default:return}m.preventDefault()},stringToDate:function(m){var p;return(p=m.match(/^(\d{4,4})-(\d{2,2})-(\d{2,2})$/))?new Date(p[1],p[2]-1,p[3]):null},dateToString:function(m){var p=(m.getMonth()+1).toString(),
E=m.getDate().toString();if(p.length==1)p="0"+p;if(E.length==1)E="0"+E;return m.getFullYear()+"-"+p+"-"+E},setPosition:function(){var m=this.input.position();this.rootLayers.css({top:m.top+this.input.outerHeight(),left:m.left});this.ieframe&&this.ieframe.css({width:this.dateSelector.outerWidth(),height:this.dateSelector.outerHeight()})},moveDateBy:function(m){this.selectDate(new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth(),this.selectedDate.getDate()+m))},moveDateMonthBy:function(m){var p=
new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth()+m,this.selectedDate.getDate());p.getMonth()==this.selectedDate.getMonth()+m+1&&p.setDate(0);this.selectDate(p)},moveMonthBy:function(m){this.selectMonth(new Date(this.currentMonth.getFullYear(),this.currentMonth.getMonth()+m,this.currentMonth.getDate()))},monthName:function(m){return this.month_names[m.getMonth()]},bindToObj:function(m){var p=this;return function(){return m.apply(p,arguments)}},bindMethodsToObj:function(){for(var m=
0;m<arguments.length;m++)this[arguments[m]]=this.bindToObj(this[arguments[m]])},indexFor:function(m,p){for(var E=0;E<m.length;E++)if(p==m[E])return E},monthNum:function(m){return this.indexFor(this.month_names,m)},shortMonthNum:function(m){return this.indexFor(this.short_month_names,m)},shortDayNum:function(m){return this.indexFor(this.short_day_names,m)},daysBetween:function(m,p){m=Date.UTC(m.getFullYear(),m.getMonth(),m.getDate());p=Date.UTC(p.getFullYear(),p.getMonth(),p.getDate());return(p-m)/
864E5},changeDayTo:function(m,p,E){m=E*(Math.abs(p.getDay()-m-E*7)%7);return new Date(p.getFullYear(),p.getMonth(),p.getDate()+m)},rangeStart:function(m){return this.changeDayTo(this.start_of_week,new Date(m.getFullYear(),m.getMonth()),-1)},rangeEnd:function(m){return this.changeDayTo((this.start_of_week-1)%7,new Date(m.getFullYear(),m.getMonth()+1,0),1)},isFirstDayOfWeek:function(m){return m.getDay()==this.start_of_week},isLastDayOfWeek:function(m){return m.getDay()==(this.start_of_week-1)%7},adjustDays:function(m){for(var p=
[],E=0;E<m.length;E++)p[E]=m[(E+this.start_of_week)%7];return p}};d.fn.date_input=function(m){return this.each(function(){new h(this,m)})};d.date_input={initialize:function(m){d("input.date_input").date_input(m)}};return h}(jQuery);
(function(d){d.dds={dragli:false,click_position:false,dragdiv_position:false,droplists:false,draglists:false,item_index:false,item_id:false,max_drops:false,dropcall:function(){},stopdragcall:function(){},dragable:function(h){d.dds.draglists=h;h.each(function(){d("li:not(.nodrag)",this).addClass("draghandle").bind("mousedown.dragable",function(m){d.dds.dragli||d.dds.start_drag(m);return false})})},dropable:function(h){d.dds.droplists=h;d.dds.generate_dropindex();d("html").bind("mousemove.dropable",
function(m){d.dds.dragli&&d.dds.droplists&&d.dds.check_drop_zone(m)})},start_drag:function(h){d.dds.dragli=h.target.nodeName=="LI"?h.target:d(h.target).parent("li:first");d.dds.click_position=h.pageY;h=d(d.dds.dragli);d.dds.item_id=h.attr("id");d("html").addClass("draghandle").bind("mousemove.dragable",function(m){d.dds.drag(m);return false}).bind("mouseup.dragable mouseleave.dragable",function(m){d.dds.stop_drag(m);return false});d("body").append('<div id="dragdiv"><ul><li></li></ul></div>');d("#dragdiv").height(h.height()+
"px").width(h.outerWidth()+"px").offset(h.offset());d.dds.dragdiv_position=d("#dragdiv").offset();d("#dragdiv ul li").html(h.html()).attr("style",h.attr("style"));h.html("").attr("style","").addClass("empty")},drag:function(h){h=h.pageY-d.dds.click_position;d("#dragdiv").offset({left:d.dds.dragdiv_position.left,top:d.dds.dragdiv_position.top+h})},stop_drag:function(){d("html").unbind(".dragable").removeClass("draghandle");d(d.dds.dragli).html(d("#dragdiv ul li").html()).attr("style",d("#dragdiv ul li").attr("style")).removeClass("empty");
d.dds.item_id&&d(d.dds.dragli).attr("id",d.dds.item_id);d("#dragdiv").remove();d.dds.dragli=false;d.dds.click_position=false;d.dds.stopdragcall(d.dds.item_index,d.dds.item_id);d.dds.item_index=false;d.dds.item_id=false;!d.dds.max_drops||d("li",d.dds.droplists).length<=d.dds.max_drops?d("li.dropzone").show():d("html").unbind(".dropable")},generate_dropindex:function(){d.dds.dropindex=[];d.dds.droplists.children("li").each(function(h){dtop=d(this).offset().top;dbtm=dtop+d(this).outerHeight();d.dds.dropindex[h]=
{obj:this,top:dtop,btm:dbtm}});BR.l("generate_dropindex","length: "+d.dds.dropindex.length)},check_drop_zone:function(){di=d.dds.dropindex;for(i in di){li=d(di[i].obj);if(!li.hasClass("empty")){dragdivY=d("#dragdiv").offset().top+d("#dragdiv").outerHeight()/2;liTop=li.offset().top;liBottom=liTop+li.outerHeight();dragdivY>=liTop&&dragdivY<=liBottom&&d.dds.position_dropli(i)}}},position_dropli:function(h){BR.l("position_dropli",h);d("li.dropzone").hide();d.dds.item_index=h;dropli=d(d.dds.dropindex[h].obj);
dragli=d(d.dds.dragli);dragli.offset().top<dropli.offset().top?dragli.insertAfter(dropli):dragli.insertBefore(dropli);d.dds.generate_dropindex();d.dds.dropcall(h)}};d.fn.extend({dragable:function(h){if(typeof h!="undefined")d.dds.stopdragcall=h;d.dds.dragable(this);return this},dropable:function(h,m){if(typeof h!="undefined")d.dds.dropcall=h;if(typeof m!="undefined")d.dds.max_drops=m;d.dds.dropable(this);return this}})})(jQuery);
jQuery.effects||function(d){function h(m){var p;if(m&&m.constructor==Array&&m.length==3)return m;if(p=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(m))return[parseInt(p[1],10),parseInt(p[2],10),parseInt(p[3],10)];if(p=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(m))return[parseFloat(p[1])*2.55,parseFloat(p[2])*2.55,parseFloat(p[3])*2.55];if(p=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(m))return[parseInt(p[1],
16),parseInt(p[2],16),parseInt(p[3],16)];if(p=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(m))return[parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16),parseInt(p[3]+p[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(m))return[255,255,255];return[255,255,255]}d.effects={};d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(m,p){d.fx.step[p]=function(E){if(!E.colorInit){var B;B=E.elem;var I=p,u;do{u=d.curCSS(B,I);if(u!=""&&u!="transparent"||
d.nodeName(B,"body"))break;I="backgroundColor"}while(B=B.parentNode);B=h(u);E.start=B;E.end=h(E.end);E.colorInit=true}E.elem.style[p]="rgb("+Math.max(Math.min(parseInt(E.pos*(E.end[0]-E.start[0])+E.start[0],10),255),0)+","+Math.max(Math.min(parseInt(E.pos*(E.end[1]-E.start[1])+E.start[1],10),255),0)+","+Math.max(Math.min(parseInt(E.pos*(E.end[2]-E.start[2])+E.start[2],10),255),0)+")"}})}(jQuery);
(function(d){d.tabify={init:function(h){h.each(function(){var m=this;if(d.bbq){var p=d.bbq.getState("tab");p&&d("li > a",this).each(function(){this.href.split("#").length>1&&this.href.split("#")[1]==p&&d(this).parent().addClass("current").siblings().removeClass("current")})}if(d("li.current",this).length!=1){d("li",this).removeClass("current");d("li:first",this).addClass("current")}d("li > a",this).click(function(){d(this).parent().addClass("current").siblings().removeClass("current");d.tabify.toggle_tabs(m);
return false});d.tabify.toggle_tabs(m);d.tabify.options.onInit()})},toggle_tabs:function(h){d.tabify.options.beforeSwitch();d("li > a",h).each(function(){if(d(this).parent().hasClass("current")){d("#"+this.href.split("#")[1]).show();d.bbq&&d.bbq.pushState({tab:this.href.split("#")[1]},2)}else d("#"+this.href.split("#")[1]).hide()});d.tabify.options.afterSwitch()},options:{afterSwitch:function(){},beforeSwitch:function(){},onInit:function(){}}};d.fn.extend({tabify:function(h){d.extend(d.tabify.options,
h);d.tabify.init(this);return this}})})(jQuery);
(function(d){d.multiselect={defaults:{prefix:"",separator:",",options:{}},settings:{},element:false,yes:false,no:false,init:function(h,m){d.extend(d.multiselect.settings,d.multiselect.defaults,m);pf=d.multiselect.settings.prefix;d.multiselect.yes=d("#"+pf+"yes");d.multiselect.no=d("#"+pf+"no");d.multiselect.element=h;d("#"+pf+"add-sel").bind("click.multiselect",d.multiselect.add_sel);d("#"+pf+"del-sel").bind("click.multiselect",d.multiselect.del_sel);d("#"+pf+"add-all").bind("click.multiselect",d.multiselect.add_all);
d("#"+pf+"del-all").bind("click.multiselect",d.multiselect.del_all);d.multiselect.set_values()},set_values:function(h){typeof h!="undefined"&&d.multiselect.element.val(h.join(d.multiselect.settings.separator));d.multiselect.yes.html("");d.multiselect.no.html("");for(value in d.multiselect.settings.options){html='<option value="'+value+'">';html+=d.multiselect.settings.options[value]+"</option>";d.inArray(value,d.multiselect.val())<0?d.multiselect.no.append(html):d.multiselect.yes.append(html)}},del_all:function(){d.multiselect.element.val("");
d.multiselect.set_values();return false},del_sel:function(){new_val=[];old_val=d.multiselect.val();for(i in old_val)if(d.inArray(old_val[i],d.multiselect.yes.val())<0)new_val[new_val.length]=old_val[i];d.multiselect.set_values(new_val);return false},add_all:function(){new_val=[];for(i in d.multiselect.settings.options)new_val[new_val.length]=i;d.multiselect.set_values(new_val);return false},add_sel:function(){d.multiselect.set_values(d.merge(d.multiselect.val(),d.multiselect.no.val()));return false},
val:function(){var h=d.multiselect.element.val();return h?h.split(d.multiselect.settings.separator):[]}};d.fn.extend({multiselect:function(h){d.multiselect.init(this,h);return this}})})(jQuery);function playerReady(d){for(i in BR.playerready_actions){BR.l("playerReady",d.id+": "+BR.playerready_actions[i][0]+"; "+BR.playerready_actions[i][1]);document.getElementById(d.id).addModelListener(BR.playerready_actions[i][0],BR.playerready_actions[i][1])}}
var BR={json_request_uri:"/json/",progress_url:"http://upload.roel.botr.nl/progress",debug:true,chart_swf:"/static/etc/dailychart.swf",player_swf:"http://d2ciznq2rtdp7k.cloudfront.net/player.11548.swf",shortcuts_speed:250,processing_delay:1E3,touchable:"ontouchend"in document?true:false,colors:{red:["#cc1414","#d18d8b","#f1c4c6"],green:["#46800d","#a9bc8a","#d2e0c4"],blue:["#1369bf","#94b3dc","#c4d9ef"],yellow:["#d9a816","#e6d290","#f5ebc6"]},playerready_actions:[],l:function(d,h){typeof console!=
"undefined"&&BR.debug&&console.log(d+": "+h)},dummy:function(){},tab:function(d){var h=$("meta[name='botr-tab']").length>0?$("meta[name='botr-tab']").attr("content").split(","):false;if(typeof d!="undefined")return h;return h[0]},view:function(){return $("meta[name='botr-view']").length>0?$("meta[name='botr-view']").attr("content"):false},current_url:function(){return window.location.href.split("?")[0].split("#")[0]},url_key:function(d){var h=window.location.pathname.split("/");d=typeof d=="number"?
d:2;if(h.length>d)return h[d];return false},hash_key:function(d){d=(d instanceof jQuery?d.attr("href")?d.attr("href"):d.parents("a").attr("href"):typeof d.href=="undefined"?$(d).parents("a").attr("href"):d.href).split("#")[1];if(typeof d!="undefined")return d;return false},detectIE6:function(){if($.browser.msie&&$.browser.version.substr(0,1)<7){wn=_("ie_warning_1",$.browser.version.substr(0,1));wn+=_("ie_warning_2");$("body").prepend('<div id="IE-warning">'+wn+"</div>");$("html").css({backgroundPosition:"center 102px"})}},
get_json:function(d,h,m){m=$.extend({type:"POST",url:BR.json_request_uri,dataType:"json"},m);data=typeof h=="object"?h:{};data.call=d;m.data=data;$.ajax(m)},object_size:function(d){var h=0;for(i in d)h++;return h},stringify_obj:function(d,h){h=typeof h=="number"?h:0;var m="{\n",p=0,E=0;for(i in d)E++;for(i in d){p++;for(j=0;j<h;j++)m+="    ";m+="    "+i+": ";m+=typeof d[i]=="object"?BR.stringify_obj(d[i],h+1):typeof d[i]=="string"?'"'+d[i]+'"':d[i];if(p!=E)m+=",";m+="\n"}for(j=0;j<h;j++)m+="    ";
m+="}";return m},root_url:function(){return document.location.protocol+"//"+document.location.hostname+(document.location.port==80?"":":"+document.location.port)},thumburl:function(d,h){return CONTENT_SERVER+"/thumbs/"+d+"-"+(typeof h=="number"?h:40)+".jpg"},generate_hash:function(d){var h="";for(i=0;i<(typeof d=="number"?d:8);i++)h+="abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ".charAt(Math.floor(Math.random()*53));return h},replace:function(d,h){if(typeof h=="object")for(r in h)d=d.replace("%"+
r.toUpperCase()+"%",replace[r]);return d},string_to_timestamp:function(d){var h=d.split("-");BR.l("string_to_timestamp","ar: "+h);if(h.length==3){h=Date.UTC(parseInt(h[0],10),parseInt(h[1],10)-1,parseInt(h[2],10));var m=new Date(h);m=m.getUTCFullYear()+"-"+BR.pad_zeros(m.getUTCMonth()+1)+"-"+BR.pad_zeros(m.getUTCDate());if(d==m)return h/1E3}return false},timestamp_to_string:function(d,h){h=typeof h=="undefined"?false:true;date=new Date(parseInt(d,10)*1E3);var m=date.getUTCFullYear()+"-"+BR.pad_zeros(date.getUTCMonth()+
1)+"-"+BR.pad_zeros(date.getUTCDate());if(h)m+=" "+BR.pad_zeros(date.getUTCHours())+":"+BR.pad_zeros(date.getUTCMinutes());return m},seconds_to_timestring:function(d){d=parseInt(d,10);if(isNaN(d))return"---";var h=Math.floor(d/3600),m=d%3600;m=Math.floor(m/60);d=d%60;return BR.pad_zeros(h)+":"+BR.pad_zeros(m)+":"+BR.pad_zeros(d)},format_filesize:function(d){if(parseInt(d,10)==-1)return"unknown";var h=parseFloat(d);if(h<1)return"-";GB=Math.round(h/1E9*10)/10;if(GB>1)return GB+" GB";else{MB=Math.round(h/
1E6*10)/10;if(MB>1)return MB+" MB";else{KB=Math.round(h/1E3);if(KB>1)return KB+" KB"}}return d+" bytes"},to_GB:function(d,h){if(d==0)return"-";h=typeof h=="number"?parseInt(h):2;var m=Math.round(d/1E9*Math.pow(10,h));if(h>0){m+="";m=m.substr(0,m.length-h)+"."+m.substr(m.length-h);m=m.split(".")[0]?m:"0"+m}return _nr(m)},dimmer:{on:false,show:function(d){BR.dimmer.on=true;d=typeof d=="undefined"?100:d;$("#dimmer").length<1&&$("body").append('<div id="dimmer"></div>');$("#dimmer").hide();BR.dimmer.position();
$("#dimmer").fadeIn(d);BR.touchable||$(window).bind("resize.dimmer",BR.dimmer.position)},position:function(){var d=$("html").outerHeight(),h=$(window).height();$("#dimmer").offset({left:0,top:0}).height(d>h?d:h).width($("html").outerWidth())},hide:function(d){if(!$("#overlay").length||(typeof d=="undefined"?false:true)){BR.dimmer.on=false;$("#dimmer").fadeOut(100,function(){$(window).unbind(".dimmer");BR.dimmer.on||$("#dimmer").remove()})}}},processing:{indicating:false,timeout:false,start:function(){if(!BR.processing.timeout&&
!BR.processing.indicating)BR.processing.timeout=setTimeout(BR.processing.indicate,BR.processing_delay)},indicate:function(){if(!BR.processing.indicating){BR.processing.indicating=true;$("html").focus();BR.dimmer.show(100);$("#processing").length<1&&$("body").append('<div id="processing">'+_("one_moment_please")+"</div>");$("#processing").hide().offset({left:$(window).width()/2+$(window).scrollLeft(),top:$(window).height()/2+$(window).scrollTop()}).fadeIn(100)}},finished:function(){clearTimeout(BR.processing.timeout);
BR.processing.timeout=false;BR.processing.indicating=false;$("#processing").fadeOut(100,function(){BR.processing.indicating||$("#processing").remove()});BR.dimmer.hide()},error:function(d){BR.processing.finished();d=$.parseJSON(d.responseText);BR.notice.show(d.message,"red",2E4,d.title);d=d.message.split(":")[0];$("#"+d).length==1&&$("#"+d).addClass("error")}},overlay:{open:function(d){$("html").bind("keyup.overlay, click.overlay",function(h){if(h.type=="click"&&h.target.id=="dimmer"||h.type=="keyup"&&
h.which==27)BR.overlay.close(h)});$("body").append('<div id="overlay"><div id="overlay-close"><a href="#">'+_("close_overlay")+'</a></div><div id="overlay-content"></div></div>');$("#overlay").hide();$("#overlay-close").click(function(h){BR.overlay.close(h);return false});$("#overlay-content").load(d+"?js=1",{},function(h,m){if(m=="error")BR.overlay.close();else{BR.dimmer.show();BR.overlay.position();$("#overlay").fadeIn("fast");BR.form.init();BR.init_shortcuts()}});BR.touchable||$(window).bind("scroll.overlay, resize.overlay",
BR.overlay.position);return false},position:function(){var d=Math.round(($(window).height()-$("#overlay").outerHeight())/3+$(window).scrollTop()),h=Math.round(($(window).width()-$("#overlay").outerWidth())/2+$(window).scrollLeft());$("#overlay").css({left:h,top:d})},close:function(){$("#overlay").fadeOut("fast",function(){$("#overlay").remove()});BR.dimmer.hide(true);$("html").unbind(".overlay");$(window).unbind(".overlay")},attach:function(d){$(d).unbind(".overlay").bind("click.overlay",function(h){a=
h.target.nodeName=="A"?$(h.target):$(h.target).parents("a:first");a.hasClass("disabled")||BR.overlay.open(a.attr("href"));return false})},reload:function(d){BR.l("overlay.reload","Reloading Overlay");$("#overlay-content").html(d);BR.overlay.position()}},notice:{notes:[],show:function(d,h,m){h=typeof h=="string"?h:"green";m=typeof m=="number"?m:5E3;var p=BR.notice.notes.length;BR.notice.notes[p]=false;$(".section:first").before('<div id="note-'+p+'" class="notice"><div></div></div>');$("#note-"+p).hide().addClass(h);
$("#note-"+p+" div").html(d);BR.notice.notes[p]=setTimeout(function(){BR.notice.hide(p)},m);BR.effect.slide_down("#note-"+p,function(){BR.effect.highlight("#note-"+p+" div",BR.colors[h][1])},100)},hide:function(d){BR.effect.slide_up("#note-"+d,function(){$("#note-"+d).remove()},100)},set:function(d,h,m){notice={message:d,type:h,time:m};try{$.cookies.set("notice",notice,{path:"/"})}catch(p){}},init:function(){var d=$.cookies.get("notice");BR.object_size(d)==3&&BR.notice.show(decodeURI(d.message),d.type,
d.time);BR.overlay.attach("a.overlay");$.cookies.del("notice")}},effect:{slide_down:function(d,h,m){h=typeof h=="function"?h:function(){};m=typeof m=="undefined"?300:m;slide_to={height:$(d).height(),"margin-top":$(d).css("margin-top"),"margin-bottom":$(d).css("margin-bottom"),"padding-top":$(d).css("padding-top"),"padding-bottom":$(d).css("padding-bottom")};$(d).height(0).css("margin-top",0).css("margin-bottom",0).css("padding-top",0).css("padding-bottom",0).css("overflow","hidden").show(0,function(){$(d).animate(slide_to,
m,h)})},slide_up:function(d,h,m){$(d).animate({height:0,"margin-top":0,"margin-bottom":0,"padding-top":0,"padding-bottom":0},typeof m=="undefined"?300:m,typeof h=="function"?h:function(){})},flash:function(d,h){defaults={from:{opacity:1},to:{opacity:0.5},callBack:function(){BR.l("effect flash","callback")},speed:300,delay:0,removeStyle:false};h=$.extend(defaults,h);temp=setTimeout(function(){$(d).animate(h.to,h.speed,function(){$(d).animate(h.from,h.speed,function(){h.removeStyle&&$(this).removeAttr("style")})})},
h.delay)},highlight:function(d,h,m){defaults={from:{backgroundColor:$(d).css("backgroundColor")},to:{backgroundColor:h}};m=$.extend(defaults,m);BR.effect.flash(d,m)}},new_item:function(){$("p.bigbutton a.new").click()},init_shortcuts:function(d){typeof d!="undefined"&&$("html").unbind("."+d);$("html").unbind(".shortcuts").bind("keypress.shortcuts",function(h){if(sc=BR.shortcuts[h.which])if(typeof sc[1]=="function")sc[1](sc[2]);else if(typeof sc[1]=="object"){setTimeout(function(){BR.init_shortcuts("subshortcuts")},
BR.shortcuts_speed);$("html").unbind(".shortcuts").bind("keypress.subshortcuts",function(m){if(ssc=sc[1][m.which])typeof ssc[1]=="function"&&ssc[1](ssc[2])})}});$("input, textarea, select").unbind(".shortcuts").bind("keypress.shortcuts",function(h){h.stopPropagation()})},show_shortcuts:function(){BR.l("show_shortcuts","Show all shortcuts")},load_url:function(d){window.location.href=BR.root_url()+d},format_date:function(d){if(typeof d=="number"){time=new Date(d*1E3);return time.getUTCFullYear()+"."+
BR.pad_zeros(time.getUTCMonth()+1)+"."+BR.pad_zeros(time.getUTCDate())}return false},format_time:function(d){d=parseInt(Math.round(parseFloat(d)),10);var h=0,m=0,p=d%60;h=d-p;if(h>0){h%=3600;m=(d-(p+h))/3600;h/=60}return(m<10?"0"+m:m)+":"+(h<10?"0"+h:h)+":"+(p<10?"0"+p:p)},pad_zeros:function(d,h){h=typeof h=="number"?h:2;for(d=d.toString();d.length<h;)d="0"+d;return d},upload:{timer:false,poll_interval:1500,nr_bar_width:0,init:function(d,h,m,p){var E=new AjaxUpload($("#"+d+" .fileupload"),{action:h,
name:"file",autoSubmit:false,onChange:function(B){$("#"+d+" .fileupload span").text(B)},onSubmit:function(){$("#overlay-close").hide();$("#"+d+" :submit").attr("disabled","disabled");$("#"+d+" .fileupload").after('<div id="progress-bar-bg"><div id="progress-bar"><div id="progress-nr"></div></div></div>').hide();BR.upload.nr_bar_width=$("#progress-nr").outerWidth();BR.upload.timer=window.setInterval(function(){BR.upload.poll(m)},BR.upload.poll_interval)},onComplete:function(B,I){window.clearTimeout(BR.upload.timer);
typeof p=="function"&&p(B,I);BR.overlay.close()}});$("#"+d+" :submit").bind("click",function(){E.submit();return false})},poll:function(d){$.ajax({url:d,dataType:"jsonp",beforeSend:BR.dummy,complete:BR.dummy,error:BR.dummy,success:function(h){percentage=h.state=="uploading"?Math.floor(h.received/h.size*1E3)/10:h.state=="starting"?0:100;if(h.state=="done"||h.state=="error")window.clearTimeout(BR.upload.timer);BR.l("BR.upload.poll","percentage: "+percentage);$("#progress-bar").width(percentage+"%");
$("#progress-nr").text(percentage+" %");bar_width=$("#progress-bar").width();bar_width<BR.upload.nr_bar_width?$("#progress-nr").css({left:bar_width+"px"}):$("#progress-nr").css({left:bar_width-BR.upload.nr_bar_width+"px",color:"#fff","text-align":"right"})}})}},thumbnails:{timer:false,call:"/videos/thumbnails/show",key_type:"video",track_time:function(d){$("#thumb_position").val(d.position);var h=Math.floor(d.position/60);d=Math.round(d.position%60);h=BR.pad_zeros(h)+":"+BR.pad_zeros(d);$("#overlay .button button").text(_("select_frame_at",
h))},submit_time:function(){BR.get_json("/videos/thumbnails/update",{video_key:BR.url_key(),position:$("#thumb_position").val()},{success:BR.thumbnails.submitted});BR.overlay.close()},submitted:function(){$(".aside p.thumb a.thumb").css("backgroundImage","url(/static/img/working-white.gif)");BR.thumbnails.timer=setTimeout(BR.thumbnails.poll,3E3)},submitted_for_playlist:function(){BR.thumbnails.call="/channels/thumbnails/show";BR.thumbnails.key_type="channel";BR.thumbnails.submitted()},poll:function(){var d=
{call:BR.thumbnails.call};d[BR.thumbnails.key_type+"_key"]=BR.url_key();$.ajax({type:"POST",url:BR.json_request_uri,dataType:"json",data:d,beforeSend:BR.dummy,complete:BR.dummy,success:function(h){if(h.thumbnail.status=="ready"){clearTimeout(BR.thumbnails.timer);$(".aside p.thumb a.thumb").css("backgroundImage","url("+BR.thumburl(BR.url_key(),320)+"?"+(new Date).getTime()+")")}else if($("ul.summary li.status strong").text()==_("failed")||h.thumbnail.status=="failed"){clearTimeout(BR.thumbnails.timer);
$(".aside p.thumb a.thumb").css("backgroundImage","")}else{$(".aside p.thumb a.thumb").css("backgroundImage","url(/static/img/working-white.gif)");BR.thumbnails.timer=setTimeout(BR.thumbnails.poll,3E3)}}})}},daterange:function(d,h){h=typeof h=="function"?h:function(){};$("#set_date_range").unbind("."+d).bind("click."+d,function(){var m=BR.string_to_timestamp($("#start_date").val()),p=BR.string_to_timestamp($("#end_date").val());if(m&&p){if(m>p){var E=m;m=p;p=E}$("#start_date, #end_date").removeClass("error");
h({start_date:m,end_date:p})}else{m||$("#start_date").addClass("error");p||$("#end_date").addClass("error")}})},watermark_change:function(){if($("#watermark_key").val()){$("#watermark_margin").val()||$("#watermark_margin").val(10).addClass("changed");$("#watermark_position").addClass("changed");$(".withwatermark").removeClass("off")}else $(".withwatermark").addClass("off")},number_list:function(d,h){h=typeof h=="string"?h:"noindex";$("li",$(d)).each(function(m){if(!$(this).hasClass(h)){$("span.index",
this).remove();$(this).prepend('<span class="index">'+(m+1)+".</span>")}})}};
BR.shortcuts={63:["?",BR.show_shortcuts,"","Show an overview of all shortcuts"],78:["N",BR.new_item,"","Add a new item (shortcut for the green button)"],110:["n",{99:["c",BR.overlay.open,"/channels/new/","Add a new Channel"],112:["p",BR.overlay.open,"/players/new/","Add a new Player"],118:["v",BR.overlay.open,"/videos/new/","Add a new video"]}],116:["t",{97:["a",BR.load_url,"/account/","Switch to the account tab"],99:["c",BR.load_url,"/channels/","Switch to the channels tab"],112:["p",BR.load_url,
"/players/","Switch to the Players tab"],118:["v",BR.load_url,"/videos/","Switch to the Videos tab"]}]};
BR.form={init:function(){$(".emptyonfocus").unbind(".emptyonfocus").bind("focus.emptyonfocus",function(){$(this).val("")}).bind("blur.emtyonfocus",function(){if(this.value=="")this.value=this.defaultValue;else $(this).removeClass("emptyonfocus").unbind(".emptyonfocus")});$("input:not(.search, .autoupdate, .noedit), textarea:not(.search, .autoupdate, .noedit), select:not(.search, .autoupdate, .noedit)").unbind(".focusform").bind("focus.focusform",function(){$(this).addClass("focussed")}).bind("blur.focusform",
function(){$(this).removeClass("focussed")}).bind("change.focusform",function(){this.value==this.defaultValue?$(this).removeClass("changed"):$(this).removeClass("error").addClass("changed");BR.form.buttons()});$("input[readonly=readonly]").addClass("readonly");$("textarea.enlarge").unbind(".enlarge").bind("focus.enlarge",function(d){$(d.target).height($(d.target).height()+200)}).bind("blur.enlarge",function(d){$(d.target).height($(d.target).height()-200)});$("textarea.html").unbind(".tab").bind("keydown.tab",
function(d){if(d.which==9){BR.form.insert_tab(d.target);return false}});$("input.date").unbind(".verifydate").bind("change.verifydate",BR.form.verify_date).date_input();$("input.time").unbind(".verifytime").bind("change.verifytime",BR.form.verify_time);$("form").unbind(".formsave").bind("submit.formsave",BR.form.submit)},buttons:function(){$("form a.submit").unbind(".formsave").bind("click.formsave",BR.form.submit)},submit:function(d){form=d.target.nodeName=="FORM"?$(d.target):$(d.target).parents("form:first");
form.hasClass("ajax")?BR.form.save(form):form.unbind(".formsave").submit();return false},save:function(){var d=BR.form.success;if(form.hasClass("backtooverview"))d=BR.form.back;if(form.hasClass("overlay"))d=BR.overlay.reload;else $("#overlay").length>0&&BR.overlay.close();var h=form.attr("action")?form.attr("action"):"";$(".emptyonfocus").val("");var m=$("input:not(.noedit), textarea:not(.noedit), select:not(.noedit)",form).serializeArray();$(".emptyonfocus").each(function(){this.value=this.defaultValue});
$.ajax({url:h+"?js=1",type:"POST",data:m,success:d});return false},get_data:function(d){arr=$(d).serializeArray();data={};for(i in arr)data[arr[i].name]=arr[i].value;return data},back:function(d){BR.notice.set(d,"green",8E3);location.href="/"+BR.tab(true).join("/")+"/"},success:function(d){BR.effect.highlight($(".changed",form),BR.colors.blue[1],{from:{backgroundColor:""},removeStyle:true});typeof BR[BR.tab()]!="undefined"&&typeof BR[BR.tab()].after_form_save=="function"&&BR[BR.tab()].after_form_save(d);
$(".changed",form).removeClass("changed").each(function(){$("input[name="+this.id+"-current]").val(this.value);this.defaultValue=this.value});$(".clearaftersave",form).val("");BR.form.buttons()},notice:function(){},verify_date:function(d){var h=d.target.value,m=h.split("-");m.length!=3&&$(d.target).addClass("error");m=new Date(m[0],parseInt(m[1],10)-1,parseInt(m[2],10));var p=m.getFullYear()+"-";p+=BR.pad_zeros(m.getMonth()+1)+"-";p+=BR.pad_zeros(m.getDate());h==p?$(d.target).removeClass("error"):
$(d.target).addClass("error");return false},verify_time:function(d){var h=d.target.value,m=h.split(":");m.length!=2&&$(d.target).addClass("error");m=new Date(2E3,0,1,parseInt(m[0],10),parseInt(m[1],10));var p=BR.pad_zeros(m.getHours())+":";p+=BR.pad_zeros(m.getMinutes());h==p?$(d.target).removeClass("error"):$(d.target).addClass("error");return false},insert_tab:function(d){tab="    ";if(document.selection){d.focus();sel=document.selection.createRange();sel.text=tab;d.focus()}else if(d.selectionStart||
d.selectionStart=="0"){var h=d.selectionStart,m=d.selectionEnd,p=d.scrollTop;d.value=d.value.substring(0,h)+tab+d.value.substring(m,d.value.length);d.focus();d.selectionStart=h+tab.length;d.selectionEnd=h+tab.length;d.scrollTop=p}else{d.value+=tab;d.focus()}},inputselect:{init:function(d,h){var m=BR.form.inputselect;m.input=$("#"+d);m.select=$("#"+d+"-select");var p=m.input.outerWidth(),E=m.input.outerHeight(),B=m.input.position(),I=Math.round((E-16)/2);m.input.after('<a class="inputselect" id="'+
d+'-button">select</a>');m.button=$("#"+d+"-button");m.input.css({"padding-right":2*I+16,width:m.input.width()-(2*I+16)+parseInt(m.input.css("padding-right"),10)});m.select.css({top:B.top+E,left:B.left,width:p-2});m.button.css({top:I+B.top,right:I}).bind("click.inputselect",m.show);$("li",m.select).bind("click.inputselect",function(u){m.hide();h(u.target.title)})},show:function(){BR.form.inputselect.select.slideDown("fast");BR.form.inputselect.button.unbind(".inputselect").bind("click.inputselect",
BR.form.inputselect.hide)},hide:function(){BR.form.inputselect.select.slideUp("fast");BR.form.inputselect.button.unbind(".inputselect").bind("click.inputselect",BR.form.inputselect.show)}}};
BR.table={options:{el:false,filters:{},search_field_name:"text",confirm_deletion:false,afterSort:function(){},afterLoad:function(){}},params:{call:"/videos/list",order_by:"date:desc",result_limit:20,result_offset:0},init:function(d,h){$(window).bind("hashchange",function(){BR.table.load()});$("button[name='s']").bind("click.table",BR.table.search);$("form.table-search").bind("submit.table",function(){return false});$("th.sortable a").bind("click.table",BR.table.sort);$("ul.filter")&&$("ul.filter a").bind("click.tablefilter",
BR.table.filter);typeof d=="object"&&$.extend(BR.table.options,d);$("#date_range").length>0&&BR.daterange("table",BR.table.change_params);h=typeof h=="object"?h:{};$.extend(BR.table.params,h);BR.table.load()},load:function(){var d=$.extend(true,{},BR.table.get_params());if($("#date_range").length>0&&(typeof d.start_date=="undefined"||typeof d.end_date=="undefined"))d.date_range=true;$.ajax({type:"POST",url:BR.json_request_uri,dataType:"json",data:d,success:function(h){BR.table.update(h);BR.table.paginate(h);
BR.table.options.afterLoad(h);BR.table.links()}})},sort:function(d){order_by=BR.hash_key(d.target);order=$(d.target).hasClass("asc")?"desc":"asc";BR.table.change_params({order_by:order_by+":"+order});return false},search:function(){var d=$("input[name='q']").val();if(d){var h={};h[BR.table.options.search_field_name]=d;BR.table.change_params(h)}else BR.table.delete_param(BR.table.options.search_field_name);return false},update:function(d){var h=BR.table.get_params();typeof(h.text=="string")&&$("input[name='q']").val(h.text);
$("ul.filter").each(function(){param=$(this).attr("id").split("-")[0];$("li",this).removeClass("selected");if(typeof h[param]=="undefined"){$("li:first",this).addClass("selected");$(".tabletotal").text(d.total)}else $("li",this).each(function(){value=BR.hash_key($("a",this));value==h[param]&&$(this).addClass("selected")})});if(typeof h.order_by=="string"){order=h.order_by.split(":");$("th.sortable a").removeClass("desc").removeClass("asc").each(function(){BR.hash_key(this)==order[0]&&$(this).addClass(order[1])})}},
links:function(){$("td.delete a").bind("click.table",BR.table.delete_row);$("td.embed a").bind("click.table",BR.table.embed);$("td.duplicate a").bind("click.table",BR.table.duplicate)},delete_row:function(d){d=BR.hash_key(d.target);if(BR.table.options.confirm_deletion)delete_ok=(c=confirm(_("confirm_delete",BR.table.options.confirm_deletion)))?true:false;else delete_ok=true;delete_ok&&$.get("/"+BR.tab()+"/"+d+"/delete/?js=1",BR.table.load);return false},embed:function(d){d=BR.hash_key(d.target);BR.overlay.open("/"+
BR.tab()+"/"+d+"/embed/",true);return false},duplicate:function(d){d=BR.hash_key(d.target);$.get("/"+BR.tab()+"/"+d+"/duplicate/?js=1",BR.table.load);return false},paginate:function(d){var h=BR.table.get_params();h=Math.ceil(d.total/h.result_limit);$("p.pagination span.total").text(h);d=parseInt(d.offset/d.limit)+1;$("p.pagination span.current").text(d);$("p.pagination a").addClass("disabled").unbind(".table").bind("click.table",function(){return false});d>1&&$("p.pagination a.prev").removeClass("disabled").unbind(".table").bind("click.table",
BR.table.change_page);d<h&&$("p.pagination a.next").removeClass("disabled").unbind(".table").bind("click.table",BR.table.change_page)},change_page:function(d){var h=BR.table.get_params();d=BR.hash_key(d.target)=="next"?parseInt(h.result_offset)+parseInt(h.result_limit):parseInt(h.result_offset)-parseInt(h.result_limit);BR.table.change_params({result_offset:d});return false},get_params:function(){var d=$.bbq.getState();return BR.object_size(d)>0&&d.result_offset?d:$.extend({},BR.table.params)},change_params:function(d){if(typeof d.result_offset==
"undefined")d.result_offset=0;BR.table.store_params($.extend(true,{},BR.table.get_params(),d))},delete_param:function(d){var h=BR.table.get_params();delete h[d];BR.table.store_params(h)},store_params:function(d){$.bbq.pushState(d,2)},filter:function(d){if(!$(d.target).parents("li:first").hasClass("selected")){var h=$(d.target).parents("ul:first").attr("id").split("-")[0];if(d=BR.hash_key(d.target)){var m={};m[h]=decodeURI(d);BR.table.change_params(m)}else BR.table.delete_param(h)}return false}};
$(function(){$.ajaxSetup({beforeSend:function(d){d.setRequestHeader("X-CSRFToken",$.cookies.get("csrftoken"));BR.processing.start()},complete:BR.processing.finished,success:BR.processing.finished,error:BR.processing.error});$("ul.tabs").tabify();BR.form.init();BR.overlay.attach("p.bigbutton a");BR.overlay.attach("a.overlay");BR.init_shortcuts();BR.notice.init()});
BR.videos={insert_after:"table.overview tr.heading",timeout:false,init:function(){BR.videos.check_status();BR.videos.transcodings.init();BR.thumbnails.poll();$("a.embed").bind("click.embed",BR.table.embed);$("#captions-list a.delete").bind("click.del_caption",BR.videos.delete_caption);$("#delete-original-link a").bind("click.del_original",BR.videos.delete_original)},check_status:function(){$("ul.summary li.status strong").text().toLowerCase()!="ready"&&BR.get_json("/videos/show",{video_key:BR.url_key()},
{success:function(d){if(d.video.status=="ready")BR.videos.mark_ready(d);else if(d.video.status=="failed")BR.videos.mark_failed(d);else BR.videos.timeout=setTimeout(BR.videos.check_status,5E3)}})},delete_original:function(d){confirm(_("confirm_delete_original_video"))&&$.ajax({url:d.target.href+"?js=1",success:function(){$("#delete-original-link").remove();BR.videos.transcodings.fetch()}});return false},delete_caption:function(d){var h=d.target;$.ajax({url:h.href+"?js=1",success:function(){$(h).parents("tr:first").remove()}});
return false},mark_ready:function(d){clearTimeout(BR.videos.timeout);$("#duration").html(BR.format_time(d.video.duration));$("#mediatype").html(d.video.mediatype);$("a.disabled").removeClass("disabled");$("ul.summary li.status strong").text(_("ready"));BR.videos.transcodings.fetch()},mark_failed:function(d){var h=d.video.error?_("conversion_failed_notice").replace("%ERROR%","<strong>"+d.video.error.message+"</strong>"):_("conversion_failed_notice").replace("(%ERROR%)","");clearTimeout(BR.videos.timeout);
$("#mediatype").html(d.video.mediatype);$("a.nofail").addClass("disabled");$("p.thumb a.smallbutton").remove();$("ul.summary li.status").addClass("failed");$("ul.summary li.status strong").text(_("failed"));BR.notice.show(h,"red",1E5);BR.videos.transcodings.fetch()},after_table_load:function(d){$(BR.videos.insert_after).nextAll().remove();rows="";for(i in d.videos){video=d.videos[i];odd=i%2==0?true:false;rows+=odd?'<tr class="odd">\n':'<tr class="even">\n';rows+=video.status=="ready"?'\t<td class="img nopadding"><a href="'+
video.key+'" style="background-image: url('+BR.thumburl(video.key)+')">'+video.key+" </a></td>\n":'\t<td class="img nopadding"><a href="'+video.key+'">'+video.key+" </a></td>\n";rows+='\t<td class="title"><a href="'+video.key+'">'+video.title+"</a></td>\n";rows+='\t<td class="date">'+BR.format_date(video.date)+"</td>\n";rows+='\t<td class="status '+video.status+'">'+_(video.status)+"</td>\n";rows+='\t<td class="duration">'+BR.seconds_to_timestring(video.duration)+"</td>\n";rows+='\t<td class="views right">'+
_nr(video.views)+"</td>\n";rows+='\t<td class="embed"><a href="#'+video.key+'">'+_("embed")+"</a></td>\n";rows+='\t<td class="delete"><a href="#'+video.key+'" class="deletelink">'+_("del")+"</a></td>\n";rows+="</tr>\n\n"}$(BR.videos.insert_after).after(rows)},transcodings:{timer:false,interval:5E3,fetch:function(){$.get(BR.current_url()+"transcodings/?js=1",function(d){$("#transcoding-tab").empty().html(d);BR.videos.transcodings.init()})},init:function(){clearTimeout(BR.videos.transcodings.timer);
$("a.add").unbind(".conversions").bind("click.conversions",BR.videos.transcodings.add_conversion);$("a.delete",$("#transcoded-files-table")).unbind(".conversions").bind("click.conversions",BR.videos.transcodings.delete_conversion);$("a.delete",$("#original-table")).unbind(".videos").bind("click.conversions",BR.videos.transcodings.delete_original);BR.overlay.attach("a.publish, a.overlay");if($("#transcoded-files-table").hasClass("processing"))BR.videos.transcodings.timer=setTimeout(BR.videos.transcodings.fetch,
BR.videos.transcodings.interval)},edit_conversion:function(d,h){$.get(BR.current_url()+"conversions/"+h+"/"+BR.hash_key(d.target)+"/?js=1",function(){BR.videos.transcodings.fetch()});return false},add_conversion:function(d){return BR.videos.transcodings.edit_conversion(d,"transcode")},delete_conversion:function(d){return BR.videos.transcodings.edit_conversion(d,"delete")},delete_original:function(d){$.get(d.target.href+"?js=1",function(){BR.videos.transcodings.fetch()});return false}}};
$(function(){if(BR.tab()=="videos"){BR.view()=="list"&&BR.table.init({afterLoad:BR.videos.after_table_load,confirm_deletion:_("video")});BR.view()=="details"&&BR.videos.init()}});
$.extend(BR,{channels:{after_table_load:function(d){$("tr.heading").nextAll().remove();rows="";for(i in d.channels){pl=d.channels[i];odd=i%2==0?true:false;rows+=odd?'<tr class="odd">\n':'<tr class="even">\n';rows+='\t<td class="title"><a href="'+pl.key+'">'+pl.title+"</a></td>\n";rows+='\t<td class="type '+pl.type+'">'+_(pl.type)+"</td>\n";rows+='\t<td class="videos right">'+_nr(pl.videos.total)+"</td>\n";rows+='\t<td class="views right">'+_nr(pl.views)+"</td>\n";rows+='\t<td class="embed"><a href="#'+
pl.key+'">'+_("embed")+"</a></td>\n";rows+='\t<td class="delete"><a href="#'+pl.key+'" class="deletelink">'+_("del")+"</a></td>\n";rows+="</tr>\n\n"}$("tr.heading").after(rows)},set_delete_links:function(){$("a.deletelink").unbind(".deletelinks").bind("click.deletelinks",function(d){var h=$(d.target).parent("li:first"),m=$(d.target).parents("ul:first");BR.get_json("/channels/videos/delete",{channel_key:BR.url_key(),position:h.data("position")},{success:function(){BR.effect.slide_up(h,function(){h.remove();
$("li",m).length<2&&$.dds.generate_dropindex();BR.channels.index_positions();BR.number_list("#playlist","dropzone")},200)}});return false}).bind("mousedown.deletelinks",function(d){d.stopPropagation()})},videolist:{timer:false,item:'<li id="create-%VIDEOKEY%" style="background-image:url(%THUMBURL%);"><span class="draghandle"></span>%VIDEOTITLE%</li>',novideos:'<li class="nodrag">'+_("no_videos_found")+"</li>",search:function(d,h){var m={item:BR.channels.videolist.item,make_dragable:true,onsuccess:false};
h=typeof h=="object"?h:{};var p=$.extend({},m,h);clearTimeout(BR.channels.videolist.timer);$(d).unbind(".videolist").bind("keypress.videolist",function(E){if(E.type=="keypress"&&E.which==13){E.stopPropagation();return false}});BR.channels.videolist.timer=setTimeout(function(){BR.channels.videolist.get_videos(d,p)},500)},get_videos:function(d,h){params=(text=$(d).val())?{text:text}:{};$.extend(params,{order_by:"date:desc",result_limit:5,statuses_filter:"ready"});BR.get_json("/videos/list",params,{success:function(m){$("#searchlist").empty();
if(m.total<1){var p=BR.channels.videolist.novideos;$("#searchlist").append(p.replace("1#TEXT#",text))}else for(i in m.videos){p=h.item;p=p.replace("%VIDEOKEY%",m.videos[i].key);p=p.replace("%VIDEOTITLE%",m.videos[i].title);p=p.replace("%DURATION%",parseInt(m.videos[i].duration,10));p=p.replace("%THUMBURL%",BR.thumburl(m.videos[i].key));$("#searchlist").append(p)}h.make_dragable&&$("#searchlist").dragable();h.onsuccess&&h.onsuccess(m)}})}},update:function(d,h){BR.l("position, item_id",d+", "+h);var m=
h.split("-");params={channel_key:BR.url_key()};if(m[0]=="create"){params.video_key=m[1];params.position=d}else{params.position_from=$("#"+h).data("position");params.position_to=d}BR.get_json("/channels/videos/"+m[0],params,{success:function(p){if(p.status=="ok"){p="update-"+m[1]+"-"+BR.generate_hash(8);$("#"+h).attr("id",p);BR.effect.highlight("#"+p,"#94b3dc")}else m[0]=="create"&&$("#"+h).remove();m[0]=="create"&&BR.channels.videolist.search("#searchvideos");$.dds.droplists.children().each(function(){!$("a.deletelink",
this).length&&!$(this).hasClass("empty")&&!$(this).hasClass("dropzone")&&$(this).prepend('<a href="#deletevideo" class="deletelink">'+_("delete_from_channel")+"</a>")});BR.channels.index_positions();BR.channels.set_delete_links();BR.number_list("#playlist","dropzone")}})},index_positions:function(){$("#playlist li").each(function(d){$(this).data("position",d)})},dynamic:{init:function(){$("#playlist").hasClass("dynamic")&&$("#tags, #sort_order, #videos_max, #tags_mode").unbind(".dynamicpv").bind("change.dynamicpv",
BR.channels.dynamic.preview)},preview:function(){BR.get_json("/videos/list",{order_by:$("#sort_order").val().replace("-",":"),result_limit:$("#videos_max").val(),tags_mode:$("#tags_mode").val(),tags:$("#tags").val()},{success:BR.channels.dynamic.update})},update:function(d){if(d.status=="ok"){rows="";for(i in d.videos){v=d.videos[i];rows+='<li style="background-image: url('+BR.thumburl(v.key)+')">';rows+="\n\t<span>"+v.title+"</span>\n</li>\n"}$("#playlist").empty().html(rows)}}}}});
$(function(){if(BR.tab()=="channels"){$("a.embed").bind("click.embed",BR.table.embed);BR.view()=="list"&&BR.table.init({afterLoad:BR.channels.after_table_load,confirm_deletion:_("playlist")},{order_by:"title:asc",call:"/channels/list"});if(BR.view()=="details"){$("ul.minivideolist.manual").length>0?BR.channels.videolist.search("#searchvideos"):BR.get_json("/channels/videos/list",{channel_key:BR.url_key()});BR.channels.index_positions();BR.channels.set_delete_links();$("ul.minivideolist.manual").dragable(BR.channels.update);
BR.number_list("#playlist","dropzone");$("#playlist").dropable();$("#searchvideos").bind("keyup.channels",function(){BR.channels.videolist.search(this)});BR.channels.dynamic.init()}}});
BR.players={remap_vars:{playlist:"playlist.position",playlistsize:"playlist.size"},after_table_load:function(d){$("tr.heading").nextAll().remove();rows="";for(i in d.players){pl=d.players[i];odd=i%2==0?true:false;rows+=odd?'<tr class="odd">\n':'<tr class="even">\n';rows+='\t<td class="title"><a href="'+pl.key+'">'+pl.name+"</a></td>\n";rows+='\t<td class="width">'+pl.width+" x "+pl.height+"</td>\n";rows+='\t<td class="playlist">'+_(pl.playlist)+"</td>\n";rows+='\t<td class="views right">'+_nr(pl.views)+
"</td>\n";rows+='\t<td class="duplicate"><a href="#'+pl.key+'">'+_("duplicate")+"</a></td>\n";rows+='\t<td class="delete"><a href="#'+pl.key+'" class="deletelink">'+_("del")+"</a></td>\n";rows+="</tr>\n\n"}$("tr.heading").after(rows)},preview:function(){BR.players.check_playlist();var d=$.extend(true,{},BR.players.defaults),h={};$(".flashvar, .attr").each(function(){if(typeof BR.players.remap_vars[this.name]=="undefined")d[this.name]=this.value;else d[BR.players.remap_vars[this.name]]=this.value});
d.skin=encodeURI(BR.players.skins_url+$("#skin_key").val());var m=$("#sharing").val();if(m!="none"){h[SHARING_PLUGIN]={link:"http://example.com/this/will/be/the/link"};if(m=="dock")h[SHARING_PLUGIN].shortcuts=true;if(m=="screen-embed")h[SHARING_PLUGIN].code="After your publish your video, this will hold the actual embed code."}if($("#watermark_key").val()){m=WATERMARKS[$("#watermark_key").val()];if(m.status=="ready"){d.logo={file:m.url};m=$("#watermark_position").val();var p=$("#watermark_margin").val();
wmlink=$("#watermark_clicklink").val();if(m)d.logo.position=m;if(p)d.logo.margin=p;if(wmlink)d.logo.link=wmlink}else alert(WATERMARK_NOT_READY)}$(".custompair").each(function(){name=$(".customname:first",this).val();val=$(".customvalue:first",this).val();if(name!="plugins")d[name]=val});$.extend(d.plugins,h);try{jwplayer("preview-container").remove()}catch(E){}$("#preview-player-div").html('<div id="preview-container"></div>');$("#preview-player-div").css("height",d.height+"px");jwplayer("preview-container").setup(d)},
check_playlist:function(d){var h=$("#playlist").val(),m=$("#playlistsize"),p=$("#playlistinfo"),E=$("#height-input"),B=$("#height"),I=$("#width-input"),u=$("#width"),F=parseInt(m.val(),10);if(typeof d!="undefined"){BR.l("initializing playlist");I.val(u.val());E.val(B.val());h=="bottom"&&E.val(parseInt(B.val(),10)-parseInt(m.val(),10));h=="right"&&I.val(parseInt(u.val(),10)-parseInt(m.val(),10))}if(h=="bottom"||h=="right"){F||(F=200);m.val(F).parent().show();p.show()}else{F=0;m.val("200").parent().hide();
p.hide()}BR.l("size",F);B.val(E.val());u.val(I.val());if(h=="bottom")B.val(parseInt(E.val(),10)+F);else h=="right"&&u.val(parseInt(I.val(),10)+F);p.children("span").text(u.val()+" x "+B.val())},check_sharing:function(){var d=$("#sharing"),h=$("#sharingplayerselect");d.val()=="none"?h.hide():h.show()},check_template:function(){var d=$("#template-key-select");if(parseInt($("input[name=streaming]:checked").val())){d.removeAttr("disabled");$("input[name=template_key]").val(d.val())}else d.attr("disabled",
"disabled")}};
$(function(){if(BR.tab()=="players"){BR.view()=="list"&&BR.table.init({afterLoad:BR.players.after_table_load,confirm_deletion:_("player"),search_field_name:"search"},{order_by:"width:asc",call:"/players/list"});if(BR.view()=="details"){BR.players.check_playlist(true);BR.players.check_sharing();$("#template-key-select, input[name=streaming]").bind("change",BR.players.check_template);$("form.playerpreview input[class!=nopreview], form.playerpreview select[class!=nopreview]").unbind(".preview").bind("change.preview",BR.players.preview);
$("#sharing").bind("change.sharing",BR.players.check_sharing);$("#watermark_key").bind("change.watermark",BR.watermark_change);BR.players.preview()}}});
BR.account={init:function(){$("#new_template").bind("click.new_template",BR.account.new_template);$("#templates-list a.delete").bind("click.del_template",function(){BR.account.templates.del(this);return false});$("#skins-list a.delete").bind("click.del_skin",BR.account.del);$("#watermarks-list a.delete").bind("click.del_watermark",BR.account.del);$("#security").unbind(".warning").bind("change.warning",function(){$("#security").val().split("-")[1]=="False"&&alert(_("signed_players_warning"))})},after_form_save:function(){var d=
$("#logout a").text().split(" "),h=$("#login").val();if(d.length>1&&d[1]!=h){d[1]=h;$("#logout a").text(d.join(" "))}},new_template:function(){$("#new_template").unbind(".new_template")},templates:{init:function(){BR.account.templates.set_bitrates();$("#width, #video_quality, #audio_quality").bind("change.template",function(){BR.account.templates.set_bitrates()});$("#watermark_key").bind("change.watermark",BR.watermark_change)},del:function(d){confirm(_("delete_template_warning"))&&$.ajax({url:d.href+
"?js=1",success:function(){$(d).parents("tr:first").remove()}})},set_bitrates:function(){var d=$("#width").val(),h=$("#template_format").val(),m=$("#audio_quality").val();m=BR.account.templates.bitrates[h][m].audio;BR.l("set_bitrates",m);$("#audio-quality-text").html(_("audio_quality_estimate",m));if($("#video_quality").length>0){m=$("#video_quality").val();h=BR.account.templates.bitrates[h][m].video;for(i in h){vr=i;if(d<parseInt(i))break}$("#video-quality-text").html(_("video_quality_estimate",
h[vr]))}},bitrates:{mp4:{"1":{video:{"240":100,"320":300,"480":500,"720":800,"1280":1100,"1920":1500},audio:80},"5":{video:{"240":200,"320":400,"480":600,"720":900,"1280":1500,"1920":2E3},audio:120},"9":{video:{"240":300,"320":500,"480":800,"720":1200,"1280":2E3,"1920":3E3},audio:160}},ogg:{"1":{video:{"240":100,"320":300,"480":500,"720":800,"1280":1500,"1920":2500},audio:80},"5":{video:{"240":200,"320":400,"480":700,"720":1E3,"1280":2500,"1920":4E3},audio:120},"9":{video:{"240":300,"320":500,"480":900,
"720":1500,"1280":3E3,"1920":5E3},audio:160}},webm:{"1":{video:{"240":100,"320":300,"480":500,"720":800,"1280":1500,"1920":2500},audio:80},"5":{video:{"240":200,"320":400,"480":700,"720":1E3,"1280":2500,"1920":4E3},audio:120},"9":{video:{"240":300,"320":500,"480":900,"720":1500,"1280":3E3,"1920":5E3},audio:160}},flv:{"1":{video:{"240":200,"320":400,"480":700,"720":1E3,"1280":1500,"1920":2E3},audio:80},"5":{video:{"240":300,"320":500,"480":800,"720":1300,"1280":1600,"1920":2400},audio:120},"9":{video:{"240":400,
"320":700,"480":1E3,"720":1500,"1280":2200,"1920":3600},audio:160}},mp3:{"1":{video:0,audio:80},"5":{video:0,audio:112},"9":{video:0,audio:160}},aac:{"1":{video:0,audio:80},"5":{video:0,audio:120},"9":{video:0,audio:160}},vorbis:{"1":{video:0,audio:80},"5":{video:0,audio:120},"9":{video:0,audio:160}}}},del:function(d){var h=d.target;$.ajax({url:h.href+"?js=1",success:function(){$(h).parents("tr:first").remove()}});return false}};
$(function(){if(BR.tab()=="account"){BR.view()=="details"&&BR.account.init();if(BR.view()=="template_details"){$("input[name=width]").bind("change",function(d){parseInt(d.target.value,10)>480&&DEFAULT_CONVERSION&&alert(DEFAULT_CONVERSION_WARNING)});BR.account.templates.init()}}});
BR.analytics={chart_units:{views:"",pageviews:"",content:"GB",nrvideos:"",traffic:"GB",videoviews:"",impressions:""},init:function(){BR.daterange("analytics",BR.analytics.load_stats);BR.analytics.load_stats();$(".aside ul.export a").unbind(".export").bind("click.export",BR.analytics.export_csv)},export_csv:function(d){var h=BR.string_to_timestamp($("#start_date").val()),m=BR.string_to_timestamp($("#end_date").val());if(h&&m){if(h>m){var p=h;h=m;m=p}h="start_date="+h+"&end_date="+m;h=d.target.href.indexOf("?")>
0?"&"+h:"?"+h;window.location.href=d.target.href+h}return false},get_max_value:function(d,h){max={};for(c in h)max[h[c]]=0;for(i in d)for(c in h){val=parseInt(d[i][h[c]],10);if(val>max[h[c]])max[h[c]]=val}return max},minichart:function(d,h){chart_html='<div class="minichart"><div class="slider" style="width: @;"></div></div>';percentage=Math.round(d*100/h);return chart_html.replace("@",percentage+"%")},load_stats:function(d){data=typeof d=="object"?d:{};if(BR.url_key(3))data.video_key=BR.url_key(3);
$.ajax({type:"POST",url:"stats/?js=1",dataType:"json",data:data,success:BR.analytics.process_totals})},process_totals:function(d){$("#start_date").val(d.start_string);$("#end_date").val(d.end_string);for(t in d.totals){switch(t){case "viewed":text=d.totals[t].total+" "+d.totals[t].totals_scale;break;case "traffic":text=BR.to_GB(d.totals[t].total);break;case "content":text=BR.to_GB(d.totals[t].total);break;default:text=_nr(d.totals[t].total)}$(".totals-"+t).text(text)}$(".chart").empty().each(function(){charttype=
this.id.split("-")[0];$(this).html('<div id="'+charttype+'-container"></div>');unit=charttype=="viewed"?d.totals[charttype].chart_scale:BR.analytics.chart_units[charttype];dailychart(charttype+"-container").setup({swf:BR.chart_swf,width:720,height:200,data:d.totals[charttype].chart,unit:" "+unit,color:"46800d",labels:"date"})});BR.url_key(2)=="media"&&BR.url_key(3)&&BR.analytics.load_engagement(d)},load_engagement:function(d){dailychart("engagement-chart").setup({swf:BR.chart_swf,width:418,height:200,
data:d.engagement,unit:" %",color:"46800d",labels:"timecode"})},engagement_player:function(){jwplayer("engagement-player-placeholder").setup({modes:[{type:"flash",src:FLASH_PLAYER},{type:"html5",config:{skin:undefined}}],file:"/sign/jwp/"+BR.url_key(3)+".xml",width:300,height:200,"controlbar.position":"bottom"})},after_table_load:function(d){max=BR.analytics.get_max_value(d.videos,["pageviews","views","viewed"]);$("table.overview tr.heading").nextAll().remove();rows="";for(i in d.videos){video=d.videos[i];
odd=i%2==0?true:false;rows+=odd?'<tr class="odd">\n':'<tr class="even">\n';rows+='\t<td class="img nopadding"><a href="'+video.key+'" style="background-image: url('+BR.thumburl(video.key)+')">'+BR.thumburl(video.key)+"</a></td>\n";rows+='\t<td class="title"><a href="'+video.key+'">'+video.title+"</a></td>\n";rows+='\t<td class="views right">'+_nr(video.views)+BR.analytics.minichart(video.views,max.views)+"</td>\n";rows+='\t<td class="pageviews right">'+_nr(video.pageviews)+BR.analytics.minichart(video.pageviews,
max.pageviews)+"</td>\n";rows+='\t<td class="viewed right">'+BR.seconds_to_timestring(video.viewed)+BR.analytics.minichart(video.viewed,max.viewed)+"</td>\n";rows+="</tr>\n\n"}$("table.overview tr.heading").after(rows)},after_table_load_reseller:function(d){max=BR.analytics.get_max_value(d.accounts,["videoviews","traffic","nrvideos","content"]);$("table.overview tr.heading").nextAll().remove();rows="";for(i in d.accounts){acc=d.accounts[i];odd=i%2==0?true:false;rows+=odd?'<tr class="odd">\n':'<tr class="even">\n';
rows+='\t<td class="login"><a href="/analytics/usage/'+acc.key+'/">'+acc.login+"</a></td>\n";rows+='\t<td class="traffic right">'+BR.to_GB(acc.traffic,0)+BR.analytics.minichart(acc.traffic,max.traffic)+"</td>\n";rows+='\t<td class="content right">'+BR.to_GB(acc.content,0)+BR.analytics.minichart(acc.content,max.content)+"</td>\n";rows+="</tr>\n\n"}$("table.overview tr.heading").after(rows)}};
$(function(){var d=BR.tab(true);if(d[0]=="analytics"){BR.analytics.init();d[1]=="media"&&BR.view()=="overview"&&BR.table.init({afterLoad:BR.analytics.after_table_load},{order_by:"views:desc",call:"/videos/views/list",statuses_filter:"active"});d[1]=="media"&&BR.view()=="details"&&BR.analytics.engagement_player();d[1]=="usage"&&BR.view()=="overview"&&BR.table.init({afterLoad:BR.analytics.after_table_load_reseller},{order_by:"videoviews:desc",call:"/accounts/usage/list"})}});$(function(){});
BR.accounts={after_table_load:function(d){$("tr.heading").nextAll().remove();rows="";for(i in d.accounts){acc=d.accounts[i];odd=i%2==0?true:false;rows+=odd?'<tr class="odd">\n':'<tr class="even">\n';rows+='\t<td class="login"><a href="'+acc.key+'">'+acc.login+"</a></td>\n";rows+='\t<td class="registered">'+BR.timestamp_to_string(acc.registered)+"</td>\n";rows+='\t<td class="videos">'+acc.videos.total+"</td>\n";rows+='\t<td class="loginas"><a href="'+acc.key+'/login_as/">login as</a></td>\n';rows+=
'\t<td class="delete"><a href="#'+acc.key+'" class="deletelink">delete</a></td>\n';rows+="</tr>\n\n"}$("tr.heading").after(rows)},limiting:{init:function(){$("#usage_type").unbind(".limit").bind("change.limit",BR.accounts.limiting.check_setting);$("#usage-details input").unbind("limit").bind("keyup.limit",BR.accounts.limiting.check_value).bind("blur.limit",BR.accounts.limiting.check_value);BR.accounts.limiting.check_setting()},check_setting:function(){$("#usage_type").val()=="limited"?$("#usage-details").show():
$("#usage-details").hide()},check_value:function(d){var h=d.target.value;h=h.replace(",",".");if(h.match("^[0-9]*\\.{0,1}[0-9]*$")){if(d.type=="blur"){if(h.indexOf(".")==h.length-1)h=h.substr(0,h.length-1);if(h[0]=="0"&&h[1]!="."&&h.length>1)h=h.substr(1,h.length);if(h=="")h="0"}d.target.value=h;d.target.value!=d.target.defaultValue&&$("#"+d.target.id+"_changed").val("changed")}else d.target.value=""}}};
$(function(){if(BR.tab()=="accounts"){BR.view()=="list"&&BR.table.init({afterLoad:BR.accounts.after_table_load,search_field_name:"search",confirm_deletion:"user account"},{order_by:"registered:desc",states_filter:"active",call:"/accounts/list"});BR.view()=="details"&&BR.accounts.limiting.init()}});
BR.customvars={name_check:/^[a-z]{1}[a-z0-9_\-\.]*$/gi,init:function(){BR.form.init();$("input.customname").unbind(".customvars").bind("blur.customvars",BR.customvars.check_name);$("input.customvalue").unbind(".customvars").bind("blur.customvars",BR.customvars.check_value);$(".custompair input.hint").unbind(".customhint").bind("focus.customhint",BR.customvars.focus);$(".custompair a.deletelink").unbind().bind("click.customvars",function(d){BR.customvars.delete_pair(d);return false});BR.init_shortcuts()},
delete_pair:function(d){var h=$(d.target).parent();d=$(".customname:first",h).val();params={};tab=BR.tab();key_name=tab.substr(tab.length-1,tab.length)=="s"?tab.substr(0,tab.length-1):tab;params[key_name+"_key"]=BR.url_key();params["custom.-"+d]="";BR.get_json("/"+BR.tab()+"/update",params,{success:function(){h.remove()}});return false},add_pair:function(){$("#customvarsfield div.field:last").before('<div class="field custompair"><input type="text" class="customname hint" name="tempvar" value="'+
_("name")+'" /><input type="text" class="customvalue hint" name="tempname" value="'+_("value")+'" /></div>');BR.customvars.renumber();BR.customvars.init()},renumber:function(){$("div.custompair").each(function(d){$("input.customname",this).attr("name","var"+d);$("input.customvalue",this).attr("name","val"+d)});$("#custompair_total").val($("div.custompair").length)},show_name_error:function(d){d.addClass("error");if(typeof BR.customvars.name_error_was_showed=="undefined"){BR.notice.show("customvars_name_error",
"red",5E3);BR.customvars.name_error_was_showed=true}},show_name_warning:function(d){d.addClass("warning");if(typeof BR.customvars.name_warning_was_showed=="undefined"){BR.notice.show("customvars_no_name_set","yellow",4E3);BR.customvars.name_warning_was_showed=true}},focus:function(d){$(d.target).removeClass("hint").unbind(".customhint").val("")},check_name:function(d){var h=$(d.target);d=$(".customvalue[name=val"+d.target.name.substr(3)+"]");h.removeClass("warning");if(!h.val()||h.val()=="name"){h.val("name").addClass("hint").bind("focus.customhint",
BR.customvars.focus);d.val()!="value"&&BR.customvars.show_name_warning(h)}else h.val().search(BR.customvars.name_check)<0?BR.customvars.show_name_error(h):h.removeClass("error");BR.customvars.check_for_empty_var()},check_value:function(d){var h=$(d.target);d=$(".customname[name=var"+d.target.name.substr(3)+"]");d.removeClass("warning");if(!h.val()||h.val()=="value")h.val("value").addClass("hint").bind("focus.customhint",BR.customvars.focus);else d.val()=="name"&&BR.customvars.show_name_warning(d);
BR.customvars.check_for_empty_var()},check_for_empty_var:function(){var d=true;$("input.customname").each(function(){if(!this.value||this.value=="name")d=false});d&&BR.customvars.add_pair()}};$(function(){$("#customvarsfield").length>0&&BR.customvars.add_pair()});

