/*!
  jQuery JavaScript Library v1.10.2
  http://jquery.com/
 
  Includes Sizzle.js
  http://sizzlejs.com/
 
  Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
  Released under the MIT license
  http://jquery.org/license
 
  Date: 2013-07-03T13:48Z
 */(function(window,undefined){var
readyList,rootjQuery,core_strundefined=typeof undefined,location=window.location,document=window.document,docElem=document.documentElement,_jQuery=window.jQuery,_$=window.$,class2type={},core_deletedIds=[],core_version="1.10.2",core_concat=core_deletedIds.concat,core_push=core_deletedIds.push,core_slice=core_deletedIds.slice,core_indexOf=core_deletedIds.indexOf,core_toString=class2type.toString,core_hasOwn=class2type.hasOwnProperty,core_trim=core_version.trim,jQuery=function(selector,context){return new jQuery.fn.init(selector,context,rootjQuery);},core_pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,core_rnotwhite=/\S+/g,rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rvalidchars=/^[\],:{}\s]*$/,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rvalidescape=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rvalidtokens=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase();},completed=function(event){if(document.addEventListener||event.type==="load"||document.readyState==="complete"){detach();jQuery.ready();}},detach=function(){if(document.addEventListener){document.removeEventListener("DOMContentLoaded",completed,false);window.removeEventListener("load",completed,false);}else{document.detachEvent("onreadystatechange",completed);window.detachEvent("onload",completed);}};jQuery.fn=jQuery.prototype={jquery:core_version,constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem;if(!selector){return this;}
if(typeof selector==="string"){if(selector.charAt(0)==="<"&&selector.charAt(selector.length-1)===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);}
if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}}
return this;}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){if(elem.id!==match[2]){return rootjQuery.find(selector);}
this.length=1;this[0]=elem;}
this.context=document;this.selector=selector;return this;}}else if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector);}
if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;}
return jQuery.makeArray(selector,this);},selector:"",length:0,toArray:function(){return core_slice.call(this);},get:function(num){return num==null?this.toArray():(num<0?this[this.length+num]:this[num]);},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;ret.context=this.context;return ret;},each:function(callback,args){return jQuery.each(this,callback,args);},ready:function(fn){jQuery.ready.promise().done(fn);return this;},slice:function(){return this.pushStack(core_slice.apply(this,arguments));},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[]);},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},end:function(){return this.prevObject||this.constructor(null);},push:core_push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var src,copyIsArray,copy,name,options,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
if(typeof target!=="object"&&!jQuery.isFunction(target)){target={};}
if(length===i){target=this;--i;}
for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue;}
if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=jQuery.isArray(copy)))){if(copyIsArray){copyIsArray=false;clone=src&&jQuery.isArray(src)?src:[];}else{clone=src&&jQuery.isPlainObject(src)?src:{};}
target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}
return target;};jQuery.extend({expando:"jQuery"+(core_version+Math.random()).replace(/\D/g,""),noConflict:function(deep){if(window.$===jQuery){window.$=_$;}
if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;}
return jQuery;},isReady:false,readyWait:1,holdReady:function(hold){if(hold){jQuery.readyWait++;}else{jQuery.ready(true);}},ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return;}
if(!document.body){return setTimeout(jQuery.ready);}
jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;}
readyList.resolveWith(document,[jQuery]);if(jQuery.fn.trigger){jQuery(document).trigger("ready").off("ready");}},isFunction:function(obj){return jQuery.type(obj)==="function";},isArray:Array.isArray||function(obj){return jQuery.type(obj)==="array";},isWindow:function(obj){return obj!=null&&obj==obj.window;},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj);},type:function(obj){if(obj==null){return String(obj);}
return typeof obj==="object"||typeof obj==="function"?class2type[core_toString.call(obj)]||"object":typeof obj;},isPlainObject:function(obj){var key;if(!obj||jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false;}
try{if(obj.constructor&&!core_hasOwn.call(obj,"constructor")&&!core_hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false;}}catch(e){return false;}
if(jQuery.support.ownLast){for(key in obj){return core_hasOwn.call(obj,key);}}
for(key in obj){}
return key===undefined||core_hasOwn.call(obj,key);},isEmptyObject:function(obj){var name;for(name in obj){return false;}
return true;},error:function(msg){throw new Error(msg);},parseHTML:function(data,context,keepScripts){if(!data||typeof data!=="string"){return null;}
if(typeof context==="boolean"){keepScripts=context;context=false;}
context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])];}
parsed=jQuery.buildFragment([data],context,scripts);if(scripts){jQuery(scripts).remove();}
return jQuery.merge([],parsed.childNodes);},parseJSON:function(data){if(window.JSON&&window.JSON.parse){return window.JSON.parse(data);}
if(data===null){return data;}
if(typeof data==="string"){data=jQuery.trim(data);if(data){if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return(new Function("return "+data))();}}}
jQuery.error("Invalid JSON: "+data);},parseXML:function(data){var xml,tmp;if(!data||typeof data!=="string"){return null;}
try{if(window.DOMParser){tmp=new DOMParser();xml=tmp.parseFromString(data,"text/xml");}else{xml=new ActiveXObject("Microsoft.XMLDOM");xml.async="false";xml.loadXML(data);}}catch(e){xml=undefined;}
if(!xml||!xml.documentElement||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);}
return xml;},noop:function(){},globalEval:function(data){if(data&&jQuery.trim(data)){(window.execScript||function(data){window["eval"].call(window,data);})(data);}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();},each:function(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray){for(;i<length;i++){value=callback.apply(obj[i],args);if(value===false){break;}}}else{for(i in obj){value=callback.apply(obj[i],args);if(value===false){break;}}}}else{if(isArray){for(;i<length;i++){value=callback.call(obj[i],i,obj[i]);if(value===false){break;}}}else{for(i in obj){value=callback.call(obj[i],i,obj[i]);if(value===false){break;}}}}
return obj;},trim:core_trim&&!core_trim.call("\uFEFF\xA0")?function(text){return text==null?"":core_trim.call(text);}:function(text){return text==null?"":(text+"").replace(rtrim,"");},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArraylike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr);}else{core_push.call(ret,arr);}}
return ret;},inArray:function(elem,arr,i){var len;if(arr){if(core_indexOf){return core_indexOf.call(arr,elem,i);}
len=arr.length;i=i?i<0?Math.max(0,len+i):i:0;for(;i<len;i++){if(i in arr&&arr[i]===elem){return i;}}}
return-1;},merge:function(first,second){var l=second.length,i=first.length,j=0;if(typeof l==="number"){for(;j<l;j++){first[i++]=second[j];}}else{while(second[j]!==undefined){first[i++]=second[j++];}}
first.length=i;return first;},grep:function(elems,callback,inv){var retVal,ret=[],i=0,length=elems.length;inv=!!inv;for(;i<length;i++){retVal=!!callback(elems[i],i);if(inv!==retVal){ret.push(elems[i]);}}
return ret;},map:function(elems,callback,arg){var value,i=0,length=elems.length,isArray=isArraylike(elems),ret=[];if(isArray){for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value;}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value;}}}
return core_concat.apply([],ret);},guid:1,proxy:function(fn,context){var args,proxy,tmp;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp;}
if(!jQuery.isFunction(fn)){return undefined;}
args=core_slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(core_slice.call(arguments)));};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy;},access:function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,length=elems.length,bulk=key==null;if(jQuery.type(key)==="object"){chainable=true;for(i in key){jQuery.access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!jQuery.isFunction(value)){raw=true;}
if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;fn=function(elem,key,value){return bulk.call(jQuery(elem),value);};}}
if(fn){for(;i<length;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));}}}
return chainable?elems:bulk?fn.call(elems):length?fn(elems[0],key):emptyGet;},now:function(){return(new Date()).getTime();},swap:function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name];}
return ret;}});jQuery.ready.promise=function(obj){if(!readyList){readyList=jQuery.Deferred();if(document.readyState==="complete"){setTimeout(jQuery.ready);}else if(document.addEventListener){document.addEventListener("DOMContentLoaded",completed,false);window.addEventListener("load",completed,false);}else{document.attachEvent("onreadystatechange",completed);window.attachEvent("onload",completed);var top=false;try{top=window.frameElement==null&&document.documentElement;}catch(e){}
if(top&&top.doScroll){(function doScrollCheck(){if(!jQuery.isReady){try{top.doScroll("left");}catch(e){return setTimeout(doScrollCheck,50);}
detach();jQuery.ready();}})();}}}
return readyList.promise(obj);};jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase();});function isArraylike(obj){var length=obj.length,type=jQuery.type(obj);if(jQuery.isWindow(obj)){return false;}
if(obj.nodeType===1&&length){return true;}
return type==="array"||type!=="function"&&(length===0||typeof length==="number"&&length>0&&(length-1)in obj);}
rootjQuery=jQuery(document);/*!
  Sizzle CSS Selector Engine v1.10.2
  http://sizzlejs.com/
 
  Copyright 2013 jQuery Foundation, Inc. and other contributors
  Released under the MIT license
  http://jquery.org/license
 
  Date: 2013-07-03
 */(function(window,undefined){var i,support,cachedruns,Expr,getText,isXML,compile,outermostContext,sortInput,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+-(new Date()),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),hasDuplicate=false,sortOrder=function(a,b){if(a===b){hasDuplicate=true;return 0;}
return 0;},strundefined=typeof undefined,MAX_NEGATIVE=1<<31,hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){var i=0,len=this.length;for(;i<len;i++){if(this[i]===elem){return i;}}
return-1;},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",characterEncoding="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",identifier=characterEncoding.replace("w","w#"),attributes="\\["+whitespace+"*("+characterEncoding+")"+whitespace+"*(?:([*^$|!~]?=)"+whitespace+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+identifier+")|)|)"+whitespace+"*\\]",pseudos=":("+characterEncoding+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+attributes.replace(3,8)+")*)|.*)\\)|)",rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rsibling=new RegExp(whitespace+"*[+~]"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+characterEncoding+")"),"CLASS":new RegExp("^\\.("+characterEncoding+")"),"TAG":new RegExp("^("+characterEncoding.replace("w","w*")+")"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+
whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-0x10000;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);};try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){}
target.length=j-1;}};}
function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context);}
context=context||document;results=results||[];if(!selector||typeof selector!=="string"){return results;}
if((nodeType=context.nodeType)!==1&&nodeType!==9){return[];}
if(documentIsHTML&&!seed){if((match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){elem=context.getElementById(m);if(elem&&elem.parentNode){if(elem.id===m){results.push(elem);return results;}}else{return results;}}else{if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}}
if(support.qsa&&(!rbuggyQSA||!rbuggyQSA.test(selector))){nid=old=expando;newContext=context;newSelector=nodeType===9&&selector;if(nodeType===1&&context.nodeName.toLowerCase()!=="object"){groups=tokenize(selector);if((old=context.getAttribute("id"))){nid=old.replace(rescape,"\\$&");}else{context.setAttribute("id",nid);}
nid="[id='"+nid+"'] ";i=groups.length;while(i--){groups[i]=nid+toSelector(groups[i]);}
newContext=rsibling.test(selector)&&context.parentNode||context;newSelector=groups.join(",");}
if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){}finally{if(!old){context.removeAttribute("id");}}}}}
return select(selector.replace(rtrim,"$1"),context,results,seed);}
function createCache(){var keys=[];function cache(key,value){if(keys.push(key+=" ")>Expr.cacheLength){delete cache[keys.shift()];}
return(cache[key]=value);}
return cache;}
function markFunction(fn){fn[expando]=true;return fn;}
function assert(fn){var div=document.createElement("div");try{return!!fn(div);}catch(e){return false;}finally{if(div.parentNode){div.parentNode.removeChild(div);}
div=null;}}
function addHandle(attrs,handler){var arr=attrs.split("|"),i=attrs.length;while(i--){Expr.attrHandle[arr[i]]=handler;}}
function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||MAX_NEGATIVE)-
(~a.sourceIndex||MAX_NEGATIVE);if(diff){return diff;}
if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1;}}}
return a?1:-1;}
function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type;};}
function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type;};}
function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j]);}}});});}
isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};support=Sizzle.support={};setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc,parent=doc.defaultView;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document;}
document=doc;docElem=doc.documentElement;documentIsHTML=!isXML(doc);if(parent&&parent.attachEvent&&parent!==parent.top){parent.attachEvent("onbeforeunload",function(){setDocument();});}
support.attributes=assert(function(div){div.className="i";return!div.getAttribute("className");});support.getElementsByTagName=assert(function(div){div.appendChild(doc.createComment(""));return!div.getElementsByTagName("*").length;});support.getElementsByClassName=assert(function(div){div.innerHTML="<div class='a'></div><div class='a i'></div>";div.firstChild.className="i";return div.getElementsByClassName("i").length===2;});support.getById=assert(function(div){docElem.appendChild(div).id=expando;return!doc.getElementsByName||!doc.getElementsByName(expando).length;});if(support.getById){Expr.find["ID"]=function(id,context){if(typeof context.getElementById!==strundefined&&documentIsHTML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[];}};Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};}else{delete Expr.find["ID"];Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId;};};}
Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!==strundefined){return context.getElementsByTagName(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}}
return tmp;}
return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(doc.querySelectorAll))){assert(function(div){div.innerHTML="<select><option selected=''></option></select>";if(!div.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");}
if(!div.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");}});assert(function(div){var input=doc.createElement("input");input.setAttribute("type","hidden");div.appendChild(input).setAttribute("t","");if(div.querySelectorAll("[t^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");}
if(!div.querySelectorAll(":enabled").length){rbuggyQSA.push(":enabled",":disabled");}
div.querySelectorAll("*,:x");rbuggyQSA.push(",.*:");});}
if((support.matchesSelector=rnative.test((matches=docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(div){support.disconnectedMatch=matches.call(div,"div");matches.call(div,"[s!='']:x");rbuggyMatches.push("!=",pseudos);});}
rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));contains=rnative.test(docElem.contains)||docElem.compareDocumentPosition?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}}
return false;};sortOrder=docElem.compareDocumentPosition?function(a,b){if(a===b){hasDuplicate=true;return 0;}
var compare=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b);if(compare){if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===doc||contains(preferredDoc,a)){return-1;}
if(b===doc||contains(preferredDoc,b)){return 1;}
return sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0;}
return compare&4?-1:1;}
return a.compareDocumentPosition?-1:1;}:function(a,b){var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(a===b){hasDuplicate=true;return 0;}else if(!aup||!bup){return a===doc?-1:b===doc?1:aup?-1:bup?1:sortInput?(indexOf.call(sortInput,a)-indexOf.call(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);}
cur=a;while((cur=cur.parentNode)){ap.unshift(cur);}
cur=b;while((cur=cur.parentNode)){bp.unshift(cur);}
while(ap[i]===bp[i]){i++;}
return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0;};return doc;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem);}
expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){}}
return Sizzle(expr,document,null,[elem]).length>0;};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context);}
return contains(context,elem);};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem);}
var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val===undefined?support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null:val;};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}}
while(j--){results.splice(duplicates[j],1);}}
return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){for(;(node=elem[i]);i++){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;}
return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";}
return match.slice(0,4);},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0]);}
match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd");}else if(match[3]){Sizzle.error(match[0]);}
return match;},"PSEUDO":function(match){var excess,unquoted=!match[5]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;}
if(match[3]&&match[4]!==undefined){match[2]=match[4];}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);}
return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"");});},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!=";}
if(!operator){return true;}
result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"CHILD":function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}}
start=dir=type==="only"&&!start&&"nextSibling";}
return true;}
start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){outerCache=parent[expando]||(parent[expando]={});cache=outerCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=cache[0]===dirruns&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break;}}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns){diff=cache[1];}else{while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){(node[expando]||(node[expando]={}))[type]=[dirruns,diff];}
if(node===elem){break;}}}}
diff-=last;return diff===first||(diff%first===0&&diff/first>=0);}};},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);}
if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf.call(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};}
return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);return!results.pop();};}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);}
lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":function(elem){return elem.disabled===false;},"disabled":function(elem){return elem.disabled===true;},"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;}
return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeName>"@"||elem.nodeType===3||elem.nodeType===4){return false;}}
return true;},"parent":function(elem){return!Expr.pseudos["empty"](elem);},"header":function(elem){return rheader.test(elem.nodeName);},"input":function(elem){return rinputs.test(elem.nodeName);},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()===elem.type);},"first":createPositionalPseudo(function(){return[0];}),"last":createPositionalPseudo(function(matchIndexes,length){return[length-1];}),"eq":createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument];}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i);}
return matchIndexes;}),"odd":createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i);}
return matchIndexes;}),"lt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;--i>=0;){matchIndexes.push(i);}
return matchIndexes;}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i);}
return matchIndexes;})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i);}
for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i);}
function setFilters(){}
setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0);}
soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar;}
groups.push(tokens=[]);}
matched=false;if((match=rcombinators.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length);}
for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length);}}
if(!matched){break;}}
return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0);}
function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value;}
return selector;}
function addCombinator(matcher,combinator,base){var dir=combinator.dir,checkNonElements=base&&dir==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml);}}}:function(elem,context,xml){var data,cache,outerCache,dirkey=dirruns+" "+doneName;if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true;}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});if((cache=outerCache[dir])&&cache[0]===dirkey){if((data=cache[1])===true||data===cachedruns){return data===true;}}else{cache=outerCache[dir]=[dirkey];cache[1]=matcher(elem,context,xml)||cachedruns;if(cache[1]===true){return true;}}}}}};}
function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}}
return true;}:matchers[0];}
function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if((elem=unmatched[i])){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i);}}}}
return newUnmatched;}
function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter);}
if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector);}
return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml);}
if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if((elem=temp[i])){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem);}}}
if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem));}}
postFinder(null,(matcherOut=[]),temp,xml);}
i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf.call(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});}
function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){return(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));}];for(;i<len;i++){if((matcher=Expr.relative[tokens[i].type])){matchers=[addCombinator(elementMatcher(matchers),matcher)];}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break;}}
return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens));}
matchers.push(matcher);}}
return elementMatcher(matchers);}
function matcherFromGroupMatchers(elementMatchers,setMatchers){var matcherCachedRuns=0,bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,expandContext){var elem,j,matcher,setMatched=[],matchedCount=0,i="0",unmatched=seed&&[],outermost=expandContext!=null,contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",expandContext&&context.parentNode||context),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1);if(outermost){outermostContext=context!==document&&context;cachedruns=matcherCachedRuns;}
for(;(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;while((matcher=elementMatchers[j++])){if(matcher(elem,context,xml)){results.push(elem);break;}}
if(outermost){dirruns=dirrunsUnique;cachedruns=++matcherCachedRuns;}}
if(bySet){if((elem=!matcher&&elem)){matchedCount--;}
if(seed){unmatched.push(elem);}}}
matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);}
if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results);}}}
setMatched=condense(setMatched);}
push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results);}}
if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;}
return unmatched;};return bySet?markFunction(superMatcher):superMatcher;}
compile=Sizzle.compile=function(selector,group){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!group){group=tokenize(selector);}
i=group.length;while(i--){cached=matcherFromTokens(group[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}}
cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));}
return cached;};function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results);}
return results;}
function select(selector,context,results,seed){var i,tokens,token,type,find,match=tokenize(selector);if(!seed){if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&support.getById&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;}
selector=selector.slice(tokens.shift().value.length);}
i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;}
if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&context.parentNode||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results;}
break;}}}}}
compile(selector,match)(seed,context,!documentIsHTML,results,rsibling.test(selector));return results;}
support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=hasDuplicate;setDocument();support.sortDetached=assert(function(div1){return div1.compareDocumentPosition(document.createElement("div"))&1;});if(!assert(function(div){div.innerHTML="<a href='#'></a>";return div.firstChild.getAttribute("href")==="#";})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2);}});}
if(!support.attributes||!assert(function(div){div.innerHTML="<input/>";div.firstChild.setAttribute("value","");return div.firstChild.getAttribute("value")==="";})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue;}});}
if(!assert(function(div){return div.getAttribute("disabled")==null;})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return(val=elem.getAttributeNode(name))&&val.specified?val.value:elem[name]===true?name.toLowerCase():null;}});}
jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;})(window);var optionsCache={};function createOptions(options){var object=optionsCache[options]={};jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=true;});return object;}
jQuery.Callbacks=function(options){options=typeof options==="string"?(optionsCache[options]||createOptions(options)):jQuery.extend({},options);var
firing,memory,fired,firingLength,firingIndex,firingStart,list=[],stack=!options.once&&[],fire=function(data){memory=options.memory&&data;fired=true;firingIndex=firingStart||0;firingStart=0;firingLength=list.length;firing=true;for(;list&&firingIndex<firingLength;firingIndex++){if(list[firingIndex].apply(data[0],data[1])===false&&options.stopOnFalse){memory=false;break;}}
firing=false;if(list){if(stack){if(stack.length){fire(stack.shift());}}else if(memory){list=[];}else{self.disable();}}},self={add:function(){if(list){var start=list.length;(function add(args){jQuery.each(args,function(_,arg){var type=jQuery.type(arg);if(type==="function"){if(!options.unique||!self.has(arg)){list.push(arg);}}else if(arg&&arg.length&&type!=="string"){add(arg);}});})(arguments);if(firing){firingLength=list.length;}else if(memory){firingStart=start;fire(memory);}}
return this;},remove:function(){if(list){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(firing){if(index<=firingLength){firingLength--;}
if(index<=firingIndex){firingIndex--;}}}});}
return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!!(list&&list.length);},empty:function(){list=[];firingLength=0;return this;},disable:function(){list=stack=memory=undefined;return this;},disabled:function(){return!list;},lock:function(){stack=undefined;if(!memory){self.disable();}
return this;},locked:function(){return!stack;},fireWith:function(context,args){if(list&&(!fired||stack)){args=args||[];args=[context,args.slice?args.slice():args];if(firing){stack.push(args);}else{fire(args);}}
return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var action=tuple[0],fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify);}else{newDefer[action+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments);}});});fns=null;}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};promise.pipe=promise.then;jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[i^1][2].disable,tuples[2][2].lock);}
deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?promise:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);}
return deferred;},when:function(subordinate){var i=0,resolveValues=core_slice.call(arguments),length=resolveValues.length,remaining=length!==1||(subordinate&&jQuery.isFunction(subordinate.promise))?length:0,deferred=remaining===1?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this;values[i]=arguments.length>1?core_slice.call(arguments):value;if(values===progressValues){deferred.notifyWith(contexts,values);}else if(!(--remaining)){deferred.resolveWith(contexts,values);}};},progressValues,progressContexts,resolveContexts;if(length>1){progressValues=new Array(length);progressContexts=new Array(length);resolveContexts=new Array(length);for(;i<length;i++){if(resolveValues[i]&&jQuery.isFunction(resolveValues[i].promise)){resolveValues[i].promise().done(updateFunc(i,resolveContexts,resolveValues)).fail(deferred.reject).progress(updateFunc(i,progressContexts,progressValues));}else{--remaining;}}}
if(!remaining){deferred.resolveWith(resolveContexts,resolveValues);}
return deferred.promise();}});jQuery.support=(function(support){var all,a,input,select,fragment,opt,eventName,isSupported,i,div=document.createElement("div");div.setAttribute("className","t");div.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";all=div.getElementsByTagName("*")||[];a=div.getElementsByTagName("a")[0];if(!a||!a.style||!all.length){return support;}
select=document.createElement("select");opt=select.appendChild(document.createElement("option"));input=div.getElementsByTagName("input")[0];a.style.cssText="top:1px;float:left;opacity:.5";support.getSetAttribute=div.className!=="t";support.leadingWhitespace=div.firstChild.nodeType===3;support.tbody=!div.getElementsByTagName("tbody").length;support.htmlSerialize=!!div.getElementsByTagName("link").length;support.style=/top/.test(a.getAttribute("style"));support.hrefNormalized=a.getAttribute("href")==="/a";support.opacity=/^0.5/.test(a.style.opacity);support.cssFloat=!!a.style.cssFloat;support.checkOn=!!input.value;support.optSelected=opt.selected;support.enctype=!!document.createElement("form").enctype;support.html5Clone=document.createElement("nav").cloneNode(true).outerHTML!=="<:nav></:nav>";support.inlineBlockNeedsLayout=false;support.shrinkWrapBlocks=false;support.pixelPosition=false;support.deleteExpando=true;support.noCloneEvent=true;support.reliableMarginRight=true;support.boxSizingReliable=true;input.checked=true;support.noCloneChecked=input.cloneNode(true).checked;select.disabled=true;support.optDisabled=!opt.disabled;try{delete div.test;}catch(e){support.deleteExpando=false;}
input=document.createElement("input");input.setAttribute("value","");support.input=input.getAttribute("value")==="";input.value="t";input.setAttribute("type","radio");support.radioValue=input.value==="t";input.setAttribute("checked","t");input.setAttribute("name","t");fragment=document.createDocumentFragment();fragment.appendChild(input);support.appendChecked=input.checked;support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;if(div.attachEvent){div.attachEvent("onclick",function(){support.noCloneEvent=false;});div.cloneNode(true).click();}
for(i in{submit:true,change:true,focusin:true}){div.setAttribute(eventName="on"+i,"t");support[i+"Bubbles"]=eventName in window||div.attributes[eventName].expando===false;}
div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";for(i in jQuery(support)){break;}
support.ownLast=i!=="0";jQuery(function(){var container,marginDiv,tds,divReset="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",body=document.getElementsByTagName("body")[0];if(!body){return;}
container=document.createElement("div");container.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";body.appendChild(container).appendChild(div);div.innerHTML="<table><tr><td></td><td>t</td></tr></table>";tds=div.getElementsByTagName("td");tds[0].style.cssText="padding:0;margin:0;border:0;display:none";isSupported=(tds[0].offsetHeight===0);tds[0].style.display="";tds[1].style.display="none";support.reliableHiddenOffsets=isSupported&&(tds[0].offsetHeight===0);div.innerHTML="";div.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";jQuery.swap(body,body.style.zoom!=null?{zoom:1}:{},function(){support.boxSizing=div.offsetWidth===4;});if(window.getComputedStyle){support.pixelPosition=(window.getComputedStyle(div,null)||{}).top!=="1%";support.boxSizingReliable=(window.getComputedStyle(div,null)||{width:"4px"}).width==="4px";marginDiv=div.appendChild(document.createElement("div"));marginDiv.style.cssText=div.style.cssText=divReset;marginDiv.style.marginRight=marginDiv.style.width="0";div.style.width="1px";support.reliableMarginRight=!parseFloat((window.getComputedStyle(marginDiv,null)||{}).marginRight);}
if(typeof div.style.zoom!==core_strundefined){div.innerHTML="";div.style.cssText=divReset+"width:1px;padding:1px;display:inline;zoom:1";support.inlineBlockNeedsLayout=(div.offsetWidth===3);div.style.display="block";div.innerHTML="<div></div>";div.firstChild.style.width="5px";support.shrinkWrapBlocks=(div.offsetWidth!==3);if(support.inlineBlockNeedsLayout){body.style.zoom=1;}}
body.removeChild(container);container=div=tds=marginDiv=null;});all=select=fragment=opt=a=input=null;return support;})({});var rbrace=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,rmultiDash=/([A-Z])/g;function internalData(elem,name,data,pvt){if(!jQuery.acceptData(elem)){return;}
var ret,thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if((!id||!cache[id]||(!pvt&&!cache[id].data))&&data===undefined&&typeof name==="string"){return;}
if(!id){if(isNode){id=elem[internalKey]=core_deletedIds.pop()||jQuery.guid++;}else{id=internalKey;}}
if(!cache[id]){cache[id]=isNode?{}:{toJSON:jQuery.noop};}
if(typeof name==="object"||typeof name==="function"){if(pvt){cache[id]=jQuery.extend(cache[id],name);}else{cache[id].data=jQuery.extend(cache[id].data,name);}}
thisCache=cache[id];if(!pvt){if(!thisCache.data){thisCache.data={};}
thisCache=thisCache.data;}
if(data!==undefined){thisCache[jQuery.camelCase(name)]=data;}
if(typeof name==="string"){ret=thisCache[name];if(ret==null){ret=thisCache[jQuery.camelCase(name)];}}else{ret=thisCache;}
return ret;}
function internalRemoveData(elem,name,pvt){if(!jQuery.acceptData(elem)){return;}
var thisCache,i,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(!cache[id]){return;}
if(name){thisCache=pvt?cache[id]:cache[id].data;if(thisCache){if(!jQuery.isArray(name)){if(name in thisCache){name=[name];}else{name=jQuery.camelCase(name);if(name in thisCache){name=[name];}else{name=name.split(" ");}}}else{name=name.concat(jQuery.map(name,jQuery.camelCase));}
i=name.length;while(i--){delete thisCache[name[i]];}
if(pvt?!isEmptyDataObject(thisCache):!jQuery.isEmptyObject(thisCache)){return;}}}
if(!pvt){delete cache[id].data;if(!isEmptyDataObject(cache[id])){return;}}
if(isNode){jQuery.cleanData([elem],true);}else if(jQuery.support.deleteExpando||cache!=cache.window){delete cache[id];}else{cache[id]=null;}}
jQuery.extend({cache:{},noData:{"applet":true,"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(elem){elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando];return!!elem&&!isEmptyDataObject(elem);},data:function(elem,name,data){return internalData(elem,name,data);},removeData:function(elem,name){return internalRemoveData(elem,name);},_data:function(elem,name,data){return internalData(elem,name,data,true);},_removeData:function(elem,name){return internalRemoveData(elem,name,true);},acceptData:function(elem){if(elem.nodeType&&elem.nodeType!==1&&elem.nodeType!==9){return false;}
var noData=elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()];return!noData||noData!==true&&elem.getAttribute("classid")===noData;}});jQuery.fn.extend({data:function(key,value){var attrs,name,data=null,i=0,elem=this[0];if(key===undefined){if(this.length){data=jQuery.data(elem);if(elem.nodeType===1&&!jQuery._data(elem,"parsedAttrs")){attrs=elem.attributes;for(;i<attrs.length;i++){name=attrs[i].name;if(name.indexOf("data-")===0){name=jQuery.camelCase(name.slice(5));dataAttr(elem,name,data[name]);}}
jQuery._data(elem,"parsedAttrs",true);}}
return data;}
if(typeof key==="object"){return this.each(function(){jQuery.data(this,key);});}
return arguments.length>1?this.each(function(){jQuery.data(this,key,value);}):elem?dataAttr(elem,key,jQuery.data(elem,key)):null;},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});}});function dataAttr(elem,key,data){if(data===undefined&&elem.nodeType===1){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data;}catch(e){}
jQuery.data(elem,key,data);}else{data=undefined;}}
return data;}
function isEmptyDataObject(obj){var name;for(name in obj){if(name==="data"&&jQuery.isEmptyObject(obj[name])){continue;}
if(name!=="toJSON"){return false;}}
return true;}
jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=jQuery._data(elem,type);if(data){if(!queue||jQuery.isArray(data)){queue=jQuery._data(elem,type,jQuery.makeArray(data));}else{queue.push(data);}}
return queue||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type);};if(fn==="inprogress"){fn=queue.shift();startLength--;}
if(fn){if(type==="fx"){queue.unshift("inprogress");}
delete hooks.stop;fn.call(elem,next,hooks);}
if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue");jQuery._removeData(elem,key);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;}
if(arguments.length<setter){return jQuery.queue(this[0],type);}
return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=setTimeout(next,time);hooks.stop=function(){clearTimeout(timeout);};});},clearQueue:function(type){return this.queue(type||"fx",[]);},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements]);}};if(typeof type!=="string"){obj=type;type=undefined;}
type=type||"fx";while(i--){tmp=jQuery._data(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve);}}
resolve();return defer.promise(obj);}});var nodeHook,boolHook,rclass=/[\t\r\n\f]/g,rreturn=/\r/g,rfocusable=/^(?:input|select|textarea|button|object)$/i,rclickable=/^(?:a|area)$/i,ruseDefault=/^(?:checked|selected)$/i,getSetAttribute=jQuery.support.getSetAttribute,getSetInput=jQuery.support.input;jQuery.fn.extend({attr:function(name,value){return jQuery.access(this,jQuery.attr,name,value,arguments.length>1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});},prop:function(name,value){return jQuery.access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){name=jQuery.propFix[name]||name;return this.each(function(){try{this[name]=undefined;delete this[name];}catch(e){}});},addClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed=typeof value==="string"&&value;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className));});}
if(proceed){classes=(value||"").match(core_rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):" ");if(cur){j=0;while((clazz=classes[j++])){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" ";}}
elem.className=jQuery.trim(cur);}}}
return this;},removeClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed=arguments.length===0||typeof value==="string"&&value;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,this.className));});}
if(proceed){classes=(value||"").match(core_rnotwhite)||[];for(;i<len;i++){elem=this[i];cur=elem.nodeType===1&&(elem.className?(" "+elem.className+" ").replace(rclass," "):"");if(cur){j=0;while((clazz=classes[j++])){while(cur.indexOf(" "+clazz+" ")>=0){cur=cur.replace(" "+clazz+" "," ");}}
elem.className=value?jQuery.trim(cur):"";}}}
return this;},toggleClass:function(value,stateVal){var type=typeof value;if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value);}
if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal);});}
return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),classNames=value.match(core_rnotwhite)||[];while((className=classNames[i++])){if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(type===core_strundefined||type==="boolean"){if(this.className){jQuery._data(this,"__className__",this.className);}
this.className=this.className||value===false?"":jQuery._data(this,"__className__")||"";}});},hasClass:function(selector){var className=" "+selector+" ",i=0,l=this.length;for(;i<l;i++){if(this[i].nodeType===1&&(" "+this[i].className+" ").replace(rclass," ").indexOf(className)>=0){return true;}}
return false;},val:function(value){var ret,hooks,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;}
ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret;}
return;}
isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;}
if(isFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;}
if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});}
hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:elem.text;}},select:{get:function(elem){var value,option,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one"||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;for(;i<max;i++){option=options[i];if((option.selected||i===index)&&(jQuery.support.optDisabled?!option.disabled:option.getAttribute("disabled")===null)&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value;}
values.push(value);}}
return values;},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if((option.selected=jQuery.inArray(jQuery(option).val(),values)>=0)){optionSet=true;}}
if(!optionSet){elem.selectedIndex=-1;}
return values;}}},attr:function(elem,name,value){var hooks,ret,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return;}
if(typeof elem.getAttribute===core_strundefined){return jQuery.prop(elem,name,value);}
if(nType!==1||!jQuery.isXMLDoc(elem)){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:nodeHook);}
if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);}else if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}else{elem.setAttribute(name,value+"");return value;}}else if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}else{ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;}},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){propName=jQuery.propFix[name]||name;if(jQuery.expr.match.bool.test(name)){if(getSetInput&&getSetAttribute||!ruseDefault.test(name)){elem[propName]=false;}else{elem[jQuery.camelCase("default-"+name)]=elem[propName]=false;}}else{jQuery.attr(elem,name,"");}
elem.removeAttribute(getSetAttribute?name:propName);}}},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;}
return value;}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return;}
notxml=nType!==1||!jQuery.isXMLDoc(elem);if(notxml){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];}
if(value!==undefined){return hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem[name]=value);}else{return hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null?ret:elem[name];}},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1;}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else if(getSetInput&&getSetAttribute||!ruseDefault.test(name)){elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name);}else{elem[jQuery.camelCase("default-"+name)]=elem[name]=true;}
return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=jQuery.expr.attrHandle[name]||jQuery.find.attr;jQuery.expr.attrHandle[name]=getSetInput&&getSetAttribute||!ruseDefault.test(name)?function(elem,name,isXML){var fn=jQuery.expr.attrHandle[name],ret=isXML?undefined:(jQuery.expr.attrHandle[name]=undefined)!=getter(elem,name,isXML)?name.toLowerCase():null;jQuery.expr.attrHandle[name]=fn;return ret;}:function(elem,name,isXML){return isXML?undefined:elem[jQuery.camelCase("default-"+name)]?name.toLowerCase():null;};});if(!getSetInput||!getSetAttribute){jQuery.attrHooks.value={set:function(elem,value,name){if(jQuery.nodeName(elem,"input")){elem.defaultValue=value;}else{return nodeHook&&nodeHook.set(elem,value,name);}}};}
if(!getSetAttribute){nodeHook={set:function(elem,value,name){var ret=elem.getAttributeNode(name);if(!ret){elem.setAttributeNode((ret=elem.ownerDocument.createAttribute(name)));}
ret.value=value+="";return name==="value"||value===elem.getAttribute(name)?value:undefined;}};jQuery.expr.attrHandle.id=jQuery.expr.attrHandle.name=jQuery.expr.attrHandle.coords=function(elem,name,isXML){var ret;return isXML?undefined:(ret=elem.getAttributeNode(name))&&ret.value!==""?ret.value:null;};jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&ret.specified?ret.value:undefined;},set:nodeHook.set};jQuery.attrHooks.contenteditable={set:function(elem,value,name){nodeHook.set(elem,value===""?false:value,name);}};jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]={set:function(elem,value){if(value===""){elem.setAttribute(name,"auto");return value;}}};});}
if(!jQuery.support.hrefNormalized){jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4);}};});}
if(!jQuery.support.style){jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||undefined;},set:function(elem,value){return(elem.style.cssText=value+"");}};}
if(!jQuery.support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}
return null;}};}
jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});if(!jQuery.support.enctype){jQuery.propFix.enctype="encoding";}
jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0);}}};if(!jQuery.support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;function returnTrue(){return true;}
function returnFalse(){return false;}
function safeActiveElement(){try{return document.activeElement;}catch(err){}}
jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(!elemData){return;}
if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;}
if(!handler.guid){handler.guid=jQuery.guid++;}
if(!(events=elemData.events)){events=elemData.events={};}
if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!==core_strundefined&&(!e||jQuery.event.triggered!==e.type)?jQuery.event.dispatch.apply(eventHandle.elem,arguments):undefined;};eventHandle.elem=elem;}
types=(types||"").match(core_rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false);}else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle);}}}
if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}
if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);}
jQuery.event.global[type]=true;}
elem=null;},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(!elemData||!(events=elemData.events)){return;}
types=(types||"").match(core_rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);}
continue;}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--;}
if(special.remove){special.remove.call(elem,handleObj);}}}
if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);}
delete events[type];}}
if(jQuery.isEmptyObject(events)){delete elemData.handle;jQuery._removeData(elem,"events");}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=core_hasOwn.call(event,"type")?event.type:event,namespaces=core_hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;}
if(rfocusMorph.test(type+jQuery.event.triggered)){return;}
if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();}
ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;}
data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;}
if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;}
for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;}
if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}}
i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle");if(handle){handle.apply(cur,data);}
handle=ontype&&cur[ontype];if(handle&&jQuery.acceptData(cur)&&handle.apply&&handle.apply(cur,data)===false){event.preventDefault();}}
event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&jQuery.acceptData(elem)){if(ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;}
jQuery.event.triggered=type;try{elem[type]();}catch(e){}
jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}}
return event.result;},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=core_slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;}
handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation();}}}}}
if(special.postDispatch){special.postDispatch.call(this,event);}
return event.result;},handlers:function(event,handlers){var sel,handleObj,matches,i,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||event.type!=="click")){for(;cur!=this;cur=cur.parentNode||this){if(cur.nodeType===1&&(cur.disabled!==true||event.type!=="click")){matches=[];for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matches[sel]===undefined){matches[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>=0:jQuery.find(sel,this,null,[cur]).length;}
if(matches[sel]){matches.push(handleObj);}}
if(matches.length){handlerQueue.push({elem:cur,handlers:matches});}}}}
if(delegateCount<handlers.length){handlerQueue.push({elem:this,handlers:handlers.slice(delegateCount)});}
return handlerQueue;},fix:function(event){if(event[jQuery.expando]){return event;}
var i,prop,copy,type=event.type,originalEvent=event,fixHook=this.fixHooks[type];if(!fixHook){this.fixHooks[type]=fixHook=rmouseEvent.test(type)?this.mouseHooks:rkeyEvent.test(type)?this.keyHooks:{};}
copy=fixHook.props?this.props.concat(fixHook.props):this.props;event=new jQuery.Event(originalEvent);i=copy.length;while(i--){prop=copy[i];event[prop]=originalEvent[prop];}
if(!event.target){event.target=originalEvent.srcElement||document;}
if(event.target.nodeType===3){event.target=event.target.parentNode;}
event.metaKey=!!event.metaKey;return fixHook.filter?fixHook.filter(event,originalEvent):event;},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(event,original){if(event.which==null){event.which=original.charCode!=null?original.charCode:original.keyCode;}
return event;}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(event,original){var body,eventDoc,doc,button=original.button,fromElement=original.fromElement;if(event.pageX==null&&original.clientX!=null){eventDoc=event.target.ownerDocument||document;doc=eventDoc.documentElement;body=eventDoc.body;event.pageX=original.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=original.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0);}
if(!event.relatedTarget&&fromElement){event.relatedTarget=fromElement===event.target?original.toElement:fromElement;}
if(!event.which&&button!==undefined){event.which=(button&1?1:(button&2?3:(button&4?2:0)));}
return event;}},special:{load:{noBubble:true},focus:{trigger:function(){if(this!==safeActiveElement()&&this.focus){try{this.focus();return false;}catch(e){}}},delegateType:"focusin"},blur:{trigger:function(){if(this===safeActiveElement()&&this.blur){this.blur();return false;}},delegateType:"focusout"},click:{trigger:function(){if(jQuery.nodeName(this,"input")&&this.type==="checkbox"&&this.click){this.click();return false;}},_default:function(event){return jQuery.nodeName(event.target,"a");}},beforeunload:{postDispatch:function(event){if(event.result!==undefined){event.originalEvent.returnValue=event.result;}}}},simulate:function(type,elem,event,bubble){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true,originalEvent:{}});if(bubble){jQuery.event.trigger(e,null,elem);}else{jQuery.event.dispatch.call(elem,e);}
if(e.isDefaultPrevented()){event.preventDefault();}}};jQuery.removeEvent=document.removeEventListener?function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle,false);}}:function(elem,type,handle){var name="on"+type;if(elem.detachEvent){if(typeof elem[name]===core_strundefined){elem[name]=null;}
elem.detachEvent(name,handle);}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props);}
if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=(src.defaultPrevented||src.returnValue===false||src.getPreventDefault&&src.getPreventDefault())?returnTrue:returnFalse;}else{this.type=src;}
if(props){jQuery.extend(this,props);}
this.timeStamp=src&&src.timeStamp||jQuery.now();this[jQuery.expando]=true;};jQuery.Event.prototype={isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(!e){return;}
if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(!e){return;}
if(e.stopPropagation){e.stopPropagation();}
e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();}};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix;}
return ret;}};});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(){if(jQuery.nodeName(this,"form")){return false;}
jQuery.event.add(this,"click._submit keypress._submit",function(e){var elem=e.target,form=jQuery.nodeName(elem,"input")||jQuery.nodeName(elem,"button")?elem.form:undefined;if(form&&!jQuery._data(form,"submitBubbles")){jQuery.event.add(form,"submit._submit",function(event){event._submit_bubble=true;});jQuery._data(form,"submitBubbles",true);}});},postDispatch:function(event){if(event._submit_bubble){delete event._submit_bubble;if(this.parentNode&&!event.isTrigger){jQuery.event.simulate("submit",this.parentNode,event,true);}}},teardown:function(){if(jQuery.nodeName(this,"form")){return false;}
jQuery.event.remove(this,"._submit");}};}
if(!jQuery.support.changeBubbles){jQuery.event.special.change={setup:function(){if(rformElems.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio"){jQuery.event.add(this,"propertychange._change",function(event){if(event.originalEvent.propertyName==="checked"){this._just_changed=true;}});jQuery.event.add(this,"click._change",function(event){if(this._just_changed&&!event.isTrigger){this._just_changed=false;}
jQuery.event.simulate("change",this,event,true);});}
return false;}
jQuery.event.add(this,"beforeactivate._change",function(e){var elem=e.target;if(rformElems.test(elem.nodeName)&&!jQuery._data(elem,"changeBubbles")){jQuery.event.add(elem,"change._change",function(event){if(this.parentNode&&!event.isSimulated&&!event.isTrigger){jQuery.event.simulate("change",this.parentNode,event,true);}});jQuery._data(elem,"changeBubbles",true);}});},handle:function(event){var elem=event.target;if(this!==elem||event.isSimulated||event.isTrigger||(elem.type!=="radio"&&elem.type!=="checkbox")){return event.handleObj.handler.apply(this,arguments);}},teardown:function(){jQuery.event.remove(this,"._change");return!rformElems.test(this.nodeName);}};}
if(!jQuery.support.focusinBubbles){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var attaches=0,handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event),true);};jQuery.event.special[fix]={setup:function(){if(attaches++===0){document.addEventListener(orig,handler,true);}},teardown:function(){if(--attaches===0){document.removeEventListener(orig,handler,true);}}};});}
jQuery.fn.extend({on:function(types,selector,data,fn,one){var type,origFn;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;}
for(type in types){this.on(type,selector,data,types[type],one);}
return this;}
if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}}
if(fn===false){fn=returnFalse;}else if(!fn){return this;}
if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);}
return this.each(function(){jQuery.event.add(this,types,fn,data,selector);});},one:function(types,selector,data,fn){return this.on(types,selector,data,fn,1);},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this;}
if(typeof types==="object"){for(type in types){this.off(type,selector,types[type]);}
return this;}
if(selector===false||typeof selector==="function"){fn=selector;selector=undefined;}
if(fn===false){fn=returnFalse;}
return this.each(function(){jQuery.event.remove(this,types,fn,selector);});},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true);}}});var isSimple=/^.[^:#\[\.,]*$/,rparentsprev=/^(?:parents|prev(?:Until|All))/,rneedsContext=jQuery.expr.match.needsContext,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({find:function(selector){var i,ret=[],self=this,len=self.length;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true;}}}));}
for(i=0;i<len;i++){jQuery.find(selector,self[i],ret);}
ret=this.pushStack(len>1?jQuery.unique(ret):ret);ret.selector=this.selector?this.selector+" "+selector:selector;return ret;},has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;i<len;i++){if(jQuery.contains(this,targets[i])){return true;}}});},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;},closest:function(selectors,context){var cur,i=0,l=this.length,ret=[],pos=rneedsContext.test(selectors)||typeof selectors!=="string"?jQuery(selectors,context||this.context):0;for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(pos?pos.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){cur=ret.push(cur);break;}}}
return this.pushStack(ret.length>1?jQuery.unique(ret):ret);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;}
if(typeof elem==="string"){return jQuery.inArray(this[0],jQuery(elem));}
return jQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(jQuery.unique(all));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){do{cur=cur[dir];}while(cur&&cur.nodeType!==1);return cur;}
jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return jQuery.dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until);},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;}
if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret);}
if(this.length>1){if(!guaranteedUnique[name]){ret=jQuery.unique(ret);}
if(rparentsprev.test(name)){ret=ret.reverse();}}
return this.pushStack(ret);};});jQuery.extend({filter:function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";}
return elems.length===1&&elem.nodeType===1?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur);}
cur=cur[dir];}
return matched;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n);}}
return r;}});function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}
if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});}
if(typeof qualifier==="string"){if(isSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);}
qualifier=jQuery.filter(qualifier,elements);}
return jQuery.grep(elements,function(elem){return(jQuery.inArray(elem,qualifier)>=0)!==not;});}
function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement){while(list.length){safeFrag.createElement(list.pop());}}
return safeFrag;}
var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnoInnerhtml=/<(?:script|style|link)/i,manipulation_rcheckableType=/^(?:checkbox|radio)$/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/^$|\/(?:java|ecma)script/i,rscriptTypeMasked=/^true\/(.*)/,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:jQuery.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;jQuery.fn.extend({text:function(value){return jQuery.access(this,function(value){return value===undefined?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value));},null,value,arguments.length);},append:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return this.domManip(arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},remove:function(selector,keepData){var elem,elems=selector?jQuery.filter(selector,this):this,i=0;for(;(elem=elems[i])!=null;i++){if(!keepData&&elem.nodeType===1){jQuery.cleanData(getAll(elem));}
if(elem.parentNode){if(keepData&&jQuery.contains(elem.ownerDocument,elem)){setGlobalEval(getAll(elem,"script"));}
elem.parentNode.removeChild(elem);}}
return this;},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));}
while(elem.firstChild){elem.removeChild(elem.firstChild);}
if(elem.options&&jQuery.nodeName(elem,"select")){elem.options.length=0;}}
return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return jQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined){return elem.nodeType===1?elem.innerHTML.replace(rinlinejQuery,""):undefined;}
if(typeof value==="string"&&!rnoInnerhtml.test(value)&&(jQuery.support.htmlSerialize||!rnoshimcache.test(value))&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1></$2>");try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value;}}
elem=0;}catch(e){}}
if(elem){this.empty().append(value);}},null,value,arguments.length);},replaceWith:function(){var
args=jQuery.map(this,function(elem){return[elem.nextSibling,elem.parentNode];}),i=0;this.domManip(arguments,function(elem){var next=args[i++],parent=args[i++];if(parent){if(next&&next.parentNode!==parent){next=this.nextSibling;}
jQuery(this).remove();parent.insertBefore(elem,next);}},true);return i?this:this.remove();},detach:function(selector){return this.remove(selector,true);},domManip:function(args,callback,allowIntersection){args=core_concat.apply([],args);var first,node,hasScripts,scripts,doc,fragment,i=0,l=this.length,set=this,iNoClone=l-1,value=args[0],isFunction=jQuery.isFunction(value);if(isFunction||!(l<=1||typeof value!=="string"||jQuery.support.checkClone||!rchecked.test(value))){return this.each(function(index){var self=set.eq(index);if(isFunction){args[0]=value.call(this,index,self.html());}
self.domManip(args,callback,allowIntersection);});}
if(l){fragment=jQuery.buildFragment(args,this[0].ownerDocument,false,!allowIntersection&&this);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;}
if(first){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"));}}
callback.call(this[i],node,i);}
if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!jQuery._data(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src){jQuery._evalUrl(node.src);}else{jQuery.globalEval((node.text||node.textContent||node.innerHTML||"").replace(rcleanScript,""));}}}}
fragment=first=null;}}
return this;}});function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(content.nodeType===1?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem;}
function disableScript(elem){elem.type=(jQuery.find.attr(elem,"type")!==null)+"/"+elem.type;return elem;}
function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);if(match){elem.type=match[1];}else{elem.removeAttribute("type");}
return elem;}
function setGlobalEval(elems,refElements){var elem,i=0;for(;(elem=elems[i])!=null;i++){jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"));}}
function cloneCopyEvent(src,dest){if(dest.nodeType!==1||!jQuery.hasData(src)){return;}
var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle;curData.events={};for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i]);}}}
if(curData.data){curData.data=jQuery.extend({},curData.data);}}
function fixCloneNodeIssues(src,dest){var nodeName,e,data;if(dest.nodeType!==1){return;}
nodeName=dest.nodeName.toLowerCase();if(!jQuery.support.noCloneEvent&&dest[jQuery.expando]){data=jQuery._data(dest);for(e in data.events){jQuery.removeEvent(dest,e,data.handle);}
dest.removeAttribute(jQuery.expando);}
if(nodeName==="script"&&dest.text!==src.text){disableScript(dest).text=src.text;restoreScript(dest);}else if(nodeName==="object"){if(dest.parentNode){dest.outerHTML=src.outerHTML;}
if(jQuery.support.html5Clone&&(src.innerHTML&&!jQuery.trim(dest.innerHTML))){dest.innerHTML=src.innerHTML;}}else if(nodeName==="input"&&manipulation_rcheckableType.test(src.type)){dest.defaultChecked=dest.checked=src.checked;if(dest.value!==src.value){dest.value=src.value;}}else if(nodeName==="option"){dest.defaultSelected=dest.selected=src.defaultSelected;}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue;}}
jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,i=0,ret=[],insert=jQuery(selector),last=insert.length-1;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);core_push.apply(ret,elems.get());}
return this.pushStack(ret);};});function getAll(context,tag){var elems,elem,i=0,found=typeof context.getElementsByTagName!==core_strundefined?context.getElementsByTagName(tag||"*"):typeof context.querySelectorAll!==core_strundefined?context.querySelectorAll(tag||"*"):undefined;if(!found){for(found=[],elems=context.childNodes||context;(elem=elems[i])!=null;i++){if(!tag||jQuery.nodeName(elem,tag)){found.push(elem);}else{jQuery.merge(found,getAll(elem,tag));}}}
return tag===undefined||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],found):found;}
function fixDefaultChecked(elem){if(manipulation_rcheckableType.test(elem.type)){elem.defaultChecked=elem.checked;}}
jQuery.extend({clone:function(elem,dataAndEvents,deepDataAndEvents){var destElements,node,clone,i,srcElements,inPage=jQuery.contains(elem.ownerDocument,elem);if(jQuery.support.html5Clone||jQuery.isXMLDoc(elem)||!rnoshimcache.test("<"+elem.nodeName+">")){clone=elem.cloneNode(true);}else{fragmentDiv.innerHTML=elem.outerHTML;fragmentDiv.removeChild(clone=fragmentDiv.firstChild);}
if((!jQuery.support.noCloneEvent||!jQuery.support.noCloneChecked)&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0;(node=srcElements[i])!=null;++i){if(destElements[i]){fixCloneNodeIssues(node,destElements[i]);}}}
if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0;(node=srcElements[i])!=null;i++){cloneCopyEvent(node,destElements[i]);}}else{cloneCopyEvent(elem,clone);}}
destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));}
destElements=srcElements=node=null;return clone;},buildFragment:function(elems,context,scripts,selection){var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(jQuery.type(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem);}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem));}else{tmp=tmp||safe.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+elem.replace(rxhtmlTag,"<$1></$2>")+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild;}
if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0]));}
if(!jQuery.support.tbody){elem=tag==="table"&&!rtbody.test(elem)?tmp.firstChild:wrap[1]==="<table>"&&!rtbody.test(elem)?tmp:0;j=elem&&elem.childNodes.length;while(j--){if(jQuery.nodeName((tbody=elem.childNodes[j]),"tbody")&&!tbody.childNodes.length){elem.removeChild(tbody);}}}
jQuery.merge(nodes,tmp.childNodes);tmp.textContent="";while(tmp.firstChild){tmp.removeChild(tmp.firstChild);}
tmp=safe.lastChild;}}}
if(tmp){safe.removeChild(tmp);}
if(!jQuery.support.appendChecked){jQuery.grep(getAll(nodes,"input"),fixDefaultChecked);}
i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)!==-1){continue;}
contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(safe.appendChild(elem),"script");if(contains){setGlobalEval(tmp);}
if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}}
tmp=null;return safe;},cleanData:function(elems,acceptData){var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=jQuery.support.deleteExpando,special=jQuery.event.special;for(;(elem=elems[i])!=null;i++){if(acceptData||jQuery.acceptData(elem)){id=elem[internalKey];data=id&&cache[id];if(data){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}}
if(cache[id]){delete cache[id];if(deleteExpando){delete elem[internalKey];}else if(typeof elem.removeAttribute!==core_strundefined){elem.removeAttribute(internalKey);}else{elem[internalKey]=null;}
core_deletedIds.push(id);}}}}},_evalUrl:function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:false,global:false,"throws":true});}});jQuery.fn.extend({wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});}
if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}
wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild;}
return elem;}).append(this);}
return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}
return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];function vendorPropName(style,name){if(name in style){return name;}
var capName=name.charAt(0).toUpperCase()+name.slice(1),origName=name,i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in style){return name;}}
return origName;}
function isHidden(elem,el){elem=el||elem;return jQuery.css(elem,"display")==="none"||!jQuery.contains(elem.ownerDocument,elem);}
function showHide(elements,show){var display,elem,hidden,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue;}
values[index]=jQuery._data(elem,"olddisplay");display=elem.style.display;if(show){if(!values[index]&&display==="none"){elem.style.display="";}
if(elem.style.display===""&&isHidden(elem)){values[index]=jQuery._data(elem,"olddisplay",css_defaultDisplay(elem.nodeName));}}else{if(!values[index]){hidden=isHidden(elem);if(display&&display!=="none"||!hidden){jQuery._data(elem,"olddisplay",hidden?display:jQuery.css(elem,"display"));}}}}
for(index=0;index<length;index++){elem=elements[index];if(!elem.style){continue;}
if(!show||elem.style.display==="none"||elem.style.display===""){elem.style.display=show?values[index]||"":"none";}}
return elements;}
jQuery.fn.extend({css:function(name,value){return jQuery.access(this,function(elem,name,value){var len,styles,map={},i=0;if(jQuery.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles);}
return map;}
return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name);},name,value,arguments.length>1);},show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();}
return this.each(function(){if(isHidden(this)){jQuery(this).show();}else{jQuery(this).hide();}});}});jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{"columnCount":true,"fillOpacity":true,"fontWeight":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;}
var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rrelNum.exec(value))){value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name));type="number";}
if(value==null||type==="number"&&isNaN(value)){return;}
if(type==="number"&&!jQuery.cssNumber[origName]){value+="px";}
if(!jQuery.support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";}
if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){try{style[name]=value;}catch(e){}}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret;}
return style[name];}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName));hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra);}
if(val===undefined){val=curCSS(elem,name,styles);}
if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];}
if(extra===""||extra){num=parseFloat(val);return extra===true||jQuery.isNumeric(num)?num||0:val;}
return val;}});if(window.getComputedStyle){getStyles=function(elem){return window.getComputedStyle(elem,null);};curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;if(computed){if(ret===""&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name);}
if(rnumnonpx.test(ret)&&rmargin.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth;}}
return ret;};}else if(document.documentElement.currentStyle){getStyles=function(elem){return elem.currentStyle;};curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;if(ret==null&&style&&style[name]){ret=style[name];}
if(rnumnonpx.test(ret)&&!rposition.test(name)){left=style.left;rs=elem.runtimeStyle;rsLeft=rs&&rs.left;if(rsLeft){rs.left=elem.currentStyle.left;}
style.left=name==="fontSize"?"1em":ret;ret=style.pixelLeft+"px";style.left=left;if(rsLeft){rs.left=rsLeft;}}
return ret===""?"auto":ret;};}
function setPositiveNumber(elem,value,subtract){var matches=rnumsplit.exec(value);return matches?Math.max(0,matches[1]-(subtract||0))+(matches[2]||"px"):value;}
function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){var i=extra===(isBorderBox?"border":"content")?4:name==="width"?1:0,val=0;for(;i<4;i+=2){if(extra==="margin"){val+=jQuery.css(elem,extra+cssExpand[i],true,styles);}
if(isBorderBox){if(extra==="content"){val-=jQuery.css(elem,"padding"+cssExpand[i],true,styles);}
if(extra!=="margin"){val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}else{val+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(extra!=="padding"){val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}}
return val;}
function getWidthOrHeight(elem,name,extra){var valueIsBorderBox=true,val=name==="width"?elem.offsetWidth:elem.offsetHeight,styles=getStyles(elem),isBorderBox=jQuery.support.boxSizing&&jQuery.css(elem,"boxSizing",false,styles)==="border-box";if(val<=0||val==null){val=curCSS(elem,name,styles);if(val<0||val==null){val=elem.style[name];}
if(rnumnonpx.test(val)){return val;}
valueIsBorderBox=isBorderBox&&(jQuery.support.boxSizingReliable||val===elem.style[name]);val=parseFloat(val)||0;}
return(val+
augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles))+"px";}
function css_defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];if(!display){display=actualDisplay(nodeName,doc);if(display==="none"||!display){iframe=(iframe||jQuery("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(doc.documentElement);doc=(iframe[0].contentWindow||iframe[0].contentDocument).document;doc.write("<!doctype html><html><body>");doc.close();display=actualDisplay(nodeName,doc);iframe.detach();}
elemdisplay[nodeName]=display;}
return display;}
function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");elem.remove();return display;}
jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed){return elem.offsetWidth===0&&rdisplayswap.test(jQuery.css(elem,"display"))?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra);}):getWidthOrHeight(elem,name,extra);}},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.support.boxSizing&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",styles):0);}};});if(!jQuery.support.opacity){jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?(0.01*parseFloat(RegExp.$1))+"":computed?"1":"";},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+value*100+")":"",filter=currentStyle&&currentStyle.filter||style.filter||"";style.zoom=1;if((value>=1||value==="")&&jQuery.trim(filter.replace(ralpha,""))===""&&style.removeAttribute){style.removeAttribute("filter");if(value===""||currentStyle&&!currentStyle.filter){return;}}
style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity;}};}
jQuery(function(){if(!jQuery.support.reliableMarginRight){jQuery.cssHooks.marginRight={get:function(elem,computed){if(computed){return jQuery.swap(elem,{"display":"inline-block"},curCSS,[elem,"marginRight"]);}}};}
if(!jQuery.support.pixelPosition&&jQuery.fn.position){jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]={get:function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed;}}};});}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||(!jQuery.support.reliableHiddenOffsets&&((elem.style&&elem.style.display)||jQuery.css(elem,"display"))==="none");};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem);};}
jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];}
return expanded;}};if(!rmargin.test(prefix)){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber;}});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!manipulation_rcheckableType.test(type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}):{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():(value==null?"":value);s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);};if(traditional===undefined){traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional;}
if(jQuery.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}}
return s.join("&").replace(r20,"+");};function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"?i:"")+"]",v,traditional,add);}});}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}}
jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);},bind:function(types,data,fn){return this.on(types,null,data,fn);},unbind:function(types,fn){return this.off(types,null,fn);},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn);},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn);}});var
ajaxLocParts,ajaxLocation,ajax_nonce=jQuery.now(),ajax_rquery=/\?/,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,_load=jQuery.fn.load,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href;}catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href;}
ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";}
var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(core_rnotwhite)||[];if(jQuery.isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};}
function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;}
return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");}
function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}}
if(deep){jQuery.extend(true,target,deep);}
return target;}
jQuery.fn.load=function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments);}
var selector,response,type,self=this,off=url.indexOf(" ");if(off>=0){selector=url.slice(off,url.length);url=url.slice(0,off);}
if(jQuery.isFunction(params)){callback=params;params=undefined;}else if(params&&typeof params==="object"){type="POST";}
if(self.length>0){jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText);}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR]);});}
return this;};jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn);};});jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;}
options=options||{};var
parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}}
match=responseHeaders[key.toLowerCase()];}
return match==null?null:match;},getAllResponseHeaders:function(){return state===2?responseHeadersString:null;},setRequestHeader:function(name,value){var lname=name.toLowerCase();if(!state){name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value;}
return this;},overrideMimeType:function(type){if(!state){s.mimeType=type;}
return this;},statusCode:function(map){var code;if(map){if(state<2){for(code in map){statusCode[code]=[statusCode[code],map[code]];}}else{jqXHR.always(map[jqXHR.status]);}}
return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);}
done(0,finalText);return this;}};deferred.promise(jqXHR).complete=completeDeferred.add;jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(core_rnotwhite)||[""];if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!==ajaxLocParts[1]||parts[2]!==ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?"80":"443"))!==(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?"80":"443"))));}
if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}
inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return jqXHR;}
fireGlobals=s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");}
s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url;if(!s.hasContent){if(s.data){cacheURL=(s.url+=(ajax_rquery.test(cacheURL)?"&":"?")+s.data);delete s.data;}
if(s.cache===false){s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+ajax_nonce++):cacheURL+(ajax_rquery.test(cacheURL)?"&":"?")+"_="+ajax_nonce++;}}
if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);}
if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}}
if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);}
jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);}
if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){return jqXHR.abort();}
strAbort="abort";for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i]);}
transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);}
if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout");},s.timeout);}
try{state=1;transport.send(requestHeaders,done);}catch(e){if(state<2){done(-1,e);}else{throw e;}}}
function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(state===2){return;}
state=2;if(timeoutTimer){clearTimeout(timeoutTimer);}
transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);}
response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;}
modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}}
if(status===204||s.type==="HEAD"){statusText="nocontent";}else if(status===304){statusText="notmodified";}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error;}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0;}}}
jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);}
jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);}
completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}}
return jqXHR;},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined;}
return jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback});};});function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}}
if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}
if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;}
if(!firstDataType){firstDataType=type;}}
finalDataType=finalDataType||firstDataType;}
if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}
return responses[finalDataType];}}
function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}
current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}
if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}
prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}
break;}}}}
if(conv!==true){if(conv&&s["throws"]){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}}
return{state:"success",data:response};}
jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;}
if(s.crossDomain){s.type="GET";s.global=false;}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script");script.async=true;if(s.scriptCharset){script.charset=s.scriptCharset;}
script.src=s.url;script.onload=script.onreadystatechange=function(_,isAbort){if(isAbort||!script.readyState||/loaded|complete/.test(script.readyState)){script.onload=script.onreadystatechange=null;if(script.parentNode){script.parentNode.removeChild(script);}
script=null;if(!isAbort){callback(200,"success");}}};head.insertBefore(script,head.firstChild);},abort:function(){if(script){script.onload(undefined,true);}}};}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(ajax_nonce++));this[callback]=true;return callback;}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName);}else if(s.jsonp!==false){s.url+=(ajax_rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName;}
s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called");}
return responseContainer[0];};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments;};jqXHR.always(function(){window[callbackName]=overwritten;if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName);}
if(responseContainer&&jQuery.isFunction(overwritten)){overwritten(responseContainer[0]);}
responseContainer=overwritten=undefined;});return"script";}});var xhrCallbacks,xhrSupported,xhrId=0,xhrOnUnloadAbort=window.ActiveXObject&&function(){var key;for(key in xhrCallbacks){xhrCallbacks[key](undefined,true);}};function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}
function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}
jQuery.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&createStandardXHR()||createActiveXHR();}:createStandardXHR;xhrSupported=jQuery.ajaxSettings.xhr();jQuery.support.cors=!!xhrSupported&&("withCredentials"in xhrSupported);xhrSupported=jQuery.support.ajax=!!xhrSupported;if(xhrSupported){jQuery.ajaxTransport(function(s){if(!s.crossDomain||jQuery.support.cors){var callback;return{send:function(headers,complete){var handle,i,xhr=s.xhr();if(s.username){xhr.open(s.type,s.url,s.async,s.username,s.password);}else{xhr.open(s.type,s.url,s.async);}
if(s.xhrFields){for(i in s.xhrFields){xhr[i]=s.xhrFields[i];}}
if(s.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(s.mimeType);}
if(!s.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";}
try{for(i in headers){xhr.setRequestHeader(i,headers[i]);}}catch(err){}
xhr.send((s.hasContent&&s.data)||null);callback=function(_,isAbort){var status,responseHeaders,statusText,responses;try{if(callback&&(isAbort||xhr.readyState===4)){callback=undefined;if(handle){xhr.onreadystatechange=jQuery.noop;if(xhrOnUnloadAbort){delete xhrCallbacks[handle];}}
if(isAbort){if(xhr.readyState!==4){xhr.abort();}}else{responses={};status=xhr.status;responseHeaders=xhr.getAllResponseHeaders();if(typeof xhr.responseText==="string"){responses.text=xhr.responseText;}
try{statusText=xhr.statusText;}catch(e){statusText="";}
if(!status&&s.isLocal&&!s.crossDomain){status=responses.text?200:404;}else if(status===1223){status=204;}}}}catch(firefoxAccessException){if(!isAbort){complete(-1,firefoxAccessException);}}
if(responses){complete(status,statusText,responses,responseHeaders);}};if(!s.async){callback();}else if(xhr.readyState===4){setTimeout(callback);}else{handle=++xhrId;if(xhrOnUnloadAbort){if(!xhrCallbacks){xhrCallbacks={};jQuery(window).unload(xhrOnUnloadAbort);}
xhrCallbacks[handle]=callback;}
xhr.onreadystatechange=callback;}},abort:function(){if(callback){callback(undefined,true);}}};}});}
var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+core_pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var tween=this.createTween(prop,value),target=tween.cur(),parts=rfxnum.exec(value),unit=parts&&parts[3]||(jQuery.cssNumber[prop]?"":"px"),start=(jQuery.cssNumber[prop]||unit!=="px"&&+target)&&rfxnum.exec(jQuery.css(tween.elem,prop)),scale=1,maxIterations=20;if(start&&start[3]!==unit){unit=unit||start[3];parts=parts||[];start=+target||1;do{scale=scale||".5";start=start/scale;jQuery.style(tween.elem,prop,start+unit);}while(scale!==(scale=tween.cur()/target)&&scale!==1&&--maxIterations);}
if(parts){start=tween.start=+start||+target||0;tween.unit=unit;tween.end=parts[1]?start+(parts[1]+1)*parts[2]:+parts[2];}
return tween;}]};function createFxNow(){setTimeout(function(){fxNow=undefined;});return(fxNow=jQuery.now());}
function createTween(value,prop,animation){var tween,collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if((tween=collection[index].call(animation,prop,value))){return tween;}}}
function Animation(elem,properties,options){var result,stopped,index=0,length=animationPrefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem;}),tick=function(){if(stopped){return false;}
var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent);}
deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining;}else{deferred.resolveWith(elem,[animation]);return false;}},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{}},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween;},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this;}
stopped=true;for(;index<length;index++){animation.tweens[index].run(1);}
if(gotoEnd){deferred.resolveWith(elem,[animation,gotoEnd]);}else{deferred.rejectWith(elem,[animation,gotoEnd]);}
return this;}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=animationPrefilters[index].call(animation,elem,props,animation.opts);if(result){return result;}}
jQuery.map(props,createTween,animation);if(jQuery.isFunction(animation.opts.start)){animation.opts.start.call(elem,animation);}
jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);}
function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=jQuery.camelCase(index);easing=specialEasing[name];value=props[index];if(jQuery.isArray(value)){easing=value[1];value=props[index]=value[0];}
if(index!==name){props[name]=value;delete props[index];}
hooks=jQuery.cssHooks[name];if(hooks&&"expand"in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing;}}}else{specialEasing[name]=easing;}}}
jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){if(jQuery.isFunction(props)){callback=props;props=["*"];}else{props=props.split(" ");}
var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];tweeners[prop]=tweeners[prop]||[];tweeners[prop].unshift(callback);}},prefilter:function(callback,prepend){if(prepend){animationPrefilters.unshift(callback);}else{animationPrefilters.push(callback);}}});function defaultPrefilter(elem,props,opts){var prop,value,toggle,tween,hooks,oldfire,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHidden(elem),dataShow=jQuery._data(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire();}};}
hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire();}});});}
if(elem.nodeType===1&&("height"in props||"width"in props)){opts.overflow=[style.overflow,style.overflowX,style.overflowY];if(jQuery.css(elem,"display")==="inline"&&jQuery.css(elem,"float")==="none"){if(!jQuery.support.inlineBlockNeedsLayout||css_defaultDisplay(elem.nodeName)==="inline"){style.display="inline-block";}else{style.zoom=1;}}}
if(opts.overflow){style.overflow="hidden";if(!jQuery.support.shrinkWrapBlocks){anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2];});}}
for(prop in props){value=props[prop];if(rfxtypes.exec(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){continue;}
orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop);}}
if(!jQuery.isEmptyObject(orig)){if(dataShow){if("hidden"in dataShow){hidden=dataShow.hidden;}}else{dataShow=jQuery._data(elem,"fxshow",{});}
if(toggle){dataShow.hidden=!hidden;}
if(hidden){jQuery(elem).show();}else{anim.done(function(){jQuery(elem).hide();});}
anim.done(function(){var prop;jQuery._removeData(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop]);}});for(prop in orig){tween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=tween.start;if(hidden){tween.end=tween.start;tween.start=prop==="width"||prop==="height"?1:0;}}}}}
function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing);}
jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||"swing";this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px");},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this);},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration);}else{this.pos=eased=percent;}
this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);}
if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);}
return this;}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem[tween.prop]!=null&&(!tween.elem.style||tween.elem.style[tween.prop]==null)){return tween.elem[tween.prop];}
result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween);}else if(tween.elem.style&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit);}else{tween.elem[tween.prop]=tween.now;}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now;}}};jQuery.each(["toggle","show","hide"],function(i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback);};});jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHidden).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback);},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||jQuery._data(this,"finish")){anim.stop(true);}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation);},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd);};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined;}
if(clearQueue&&type!==false){this.queue(type||"fx",[]);}
return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=jQuery._data(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index]);}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index]);}}}
for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1);}}
if(dequeue||!gotoEnd){jQuery.dequeue(this,type);}});},finish:function(type){if(type!==false){type=type||"fx";}
return this.each(function(){var index,data=jQuery._data(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true);}
for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1);}}
for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this);}}
delete data.finish;});}});function genFx(type,includeWidth){var which,attrs={height:type},i=0;includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type;}
if(includeWidth){attrs.opacity=attrs.width=type;}
return attrs;}
jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback);};});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:opt.duration in jQuery.fx.speeds?jQuery.fx.speeds[opt.duration]:jQuery.fx.speeds._default;if(opt.queue==null||opt.queue===true){opt.queue="fx";}
opt.old=opt.complete;opt.complete=function(){if(jQuery.isFunction(opt.old)){opt.old.call(this);}
if(opt.queue){jQuery.dequeue(this,opt.queue);}};return opt;};jQuery.easing={linear:function(p){return p;},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2;}};jQuery.timers=[];jQuery.fx=Tween.prototype.init;jQuery.fx.tick=function(){var timer,timers=jQuery.timers,i=0;fxNow=jQuery.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1);}}
if(!timers.length){jQuery.fx.stop();}
fxNow=undefined;};jQuery.fx.timer=function(timer){if(timer()&&jQuery.timers.push(timer)){jQuery.fx.start();}};jQuery.fx.interval=13;jQuery.fx.start=function(){if(!timerId){timerId=setInterval(jQuery.fx.tick,jQuery.fx.interval);}};jQuery.fx.stop=function(){clearInterval(timerId);timerId=null;};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fx.step={};if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};}
jQuery.fn.offset=function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i);});}
var docElem,win,box={top:0,left:0},elem=this[0],doc=elem&&elem.ownerDocument;if(!doc){return;}
docElem=doc.documentElement;if(!jQuery.contains(docElem,elem)){return box;}
if(typeof elem.getBoundingClientRect!==core_strundefined){box=elem.getBoundingClientRect();}
win=getWindow(doc);return{top:box.top+(win.pageYOffset||docElem.scrollTop)-(docElem.clientTop||0),left:box.left+(win.pageXOffset||docElem.scrollLeft)-(docElem.clientLeft||0)};};jQuery.offset={setOffset:function(elem,options,i){var position=jQuery.css(elem,"position");if(position==="static"){elem.style.position="relative";}
var curElem=jQuery(elem),curOffset=curElem.offset(),curCSSTop=jQuery.css(elem,"top"),curCSSLeft=jQuery.css(elem,"left"),calculatePosition=(position==="absolute"||position==="fixed")&&jQuery.inArray("auto",[curCSSTop,curCSSLeft])>-1,props={},curPosition={},curTop,curLeft;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;}
if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset);}
if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;}
if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;}
if("using"in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({position:function(){if(!this[0]){return;}
var offsetParent,offset,parentOffset={top:0,left:0},elem=this[0];if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect();}else{offsetParent=this.offsetParent();offset=this.offset();if(!jQuery.nodeName(offsetParent[0],"html")){parentOffset=offsetParent.offset();}
parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",true);}
return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||docElem;while(offsetParent&&(!jQuery.nodeName(offsetParent,"html")&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent;}
return offsetParent||docElem;});}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);jQuery.fn[method]=function(val){return jQuery.access(this,function(elem,method,val){var win=getWindow(elem);if(val===undefined){return win?(prop in win)?win[prop]:win.document.documentElement[method]:elem[method];}
if(win){win.scrollTo(!top?val:jQuery(win).scrollLeft(),top?val:jQuery(win).scrollTop());}else{elem[method]=val;}},method,val,arguments.length,null);};});function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;}
jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return jQuery.access(this,function(elem,type,value){var doc;if(jQuery.isWindow(elem)){return elem.document.documentElement["client"+name];}
if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name]);}
return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra);},type,chainable?margin:undefined,chainable,null);};});});jQuery.fn.size=function(){return this.length;};jQuery.fn.andSelf=jQuery.fn.addBack;if(typeof module==="object"&&module&&typeof module.exports==="object"){module.exports=jQuery;}else{window.jQuery=window.$=jQuery;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery;});}}})(window);;var JSON;if(!JSON){JSON={}}(function(){function f(a){return a<10?"0"+a:a}function quote(a){escapable.lastIndex=0;return escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b==="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];if(i&&typeof i==="object"&&typeof i.toJSON==="function"){i=i.toJSON(a)}if(typeof rep==="function"){i=rep.call(b,a,i)}switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i){return"null"}gap+=indent;h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1){h[c]=str(c,i)||"null"}e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]";gap=g;return e}if(rep&&typeof rep==="object"){f=rep.length;for(c=0;c<f;c+=1){if(typeof rep[c]==="string"){d=rep[c];e=str(d,i);if(e){h.push(quote(d)+(gap?": ":":")+e)}}}}else{for(d in i){if(Object.prototype.hasOwnProperty.call(i,d)){e=str(d,i);if(e){h.push(quote(d)+(gap?": ":":")+e)}}}}e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}";gap=g;return e}}"use strict";if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;if(typeof JSON.stringify!=="function"){JSON.stringify=function(a,b,c){var d;gap="";indent="";if(typeof c==="number"){for(d=0;d<c;d+=1){indent+=" "}}else if(typeof c==="string"){indent=c}rep=b;if(b&&typeof b!=="function"&&(typeof b!=="object"||typeof b.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":a})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e==="object"){for(c in e){if(Object.prototype.hasOwnProperty.call(e,c)){d=walk(e,c);if(d!==undefined){e[c]=d}else{delete e[c]}}}}return reviver.call(a,b,e)}var j;text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();(function(root,factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else{if(root.jQuery){factory(root.jQuery);}else{factory(root.Zepto);}}}(this,function($,undefined){$.fn.jPlayer=function(options){var name="jPlayer";var isMethodCall=typeof options==="string",args=Array.prototype.slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.charAt(0)==="_"){return returnValue;}
if(isMethodCall){this.each(function(){var instance=$(this).data(name),methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false;}});}else{this.each(function(){var instance=$(this).data(name);if(instance){instance.option(options||{});}else{$(this).data(name,new $.jPlayer(options,this));}});}
return returnValue;};$.jPlayer=function(options,element){if(arguments.length){this.element=$(element);this.options=$.extend(true,{},this.options,options);var self=this;this.element.bind("remove.jPlayer",function(){self.destroy();});this._init();}};if(typeof $.fn.stop!=='function'){$.fn.stop=function(){};}
$.jPlayer.emulateMethods="load play pause";$.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";$.jPlayer.emulateOptions="muted volume";$.jPlayer.reservedEvent="ready flashreset resize repeat error warning";$.jPlayer.event={};$.each(['ready','setmedia','flashreset','resize','repeat','click','error','warning','loadstart','progress','suspend','abort','emptied','stalled','play','pause','loadedmetadata','loadeddata','waiting','playing','canplay','canplaythrough','seeking','seeked','timeupdate','ended','ratechange','durationchange','volumechange'],function(){$.jPlayer.event[this]='jPlayer_'+this;});$.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"];$.jPlayer.pause=function(){$.each($.jPlayer.prototype.instances,function(i,element){if(element.data("jPlayer").status.srcSet){element.jPlayer("pause");}});};$.jPlayer.timeFormat={showHour:false,showMin:true,showSec:true,padHour:false,padMin:true,padSec:true,sepHour:":",sepMin:":",sepSec:""};var ConvertTime=function(){this.init();};ConvertTime.prototype={init:function(){this.options={timeFormat:$.jPlayer.timeFormat};},time:function(s){s=(s&&typeof s==='number')?s:0;var myTime=new Date(s*1000),hour=myTime.getUTCHours(),min=this.options.timeFormat.showHour?myTime.getUTCMinutes():myTime.getUTCMinutes()+hour*60,sec=this.options.timeFormat.showMin?myTime.getUTCSeconds():myTime.getUTCSeconds()+min*60,strHour=(this.options.timeFormat.padHour&&hour<10)?"0"+hour:hour,strMin=(this.options.timeFormat.padMin&&min<10)?"0"+min:min,strSec=(this.options.timeFormat.padSec&&sec<10)?"0"+sec:sec,strTime="";strTime+=this.options.timeFormat.showHour?strHour+this.options.timeFormat.sepHour:"";strTime+=this.options.timeFormat.showMin?strMin+this.options.timeFormat.sepMin:"";strTime+=this.options.timeFormat.showSec?strSec+this.options.timeFormat.sepSec:"";return strTime;}};var myConvertTime=new ConvertTime();$.jPlayer.convertTime=function(s){return myConvertTime.time(s);};$.jPlayer.uaBrowser=function(userAgent){var ua=userAgent.toLowerCase();var rwebkit=/(webkit)[ \/]([\w.]+)/;var ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/;var rmsie=/(msie) ([\w.]+)/;var rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/;var match=rwebkit.exec(ua)||ropera.exec(ua)||rmsie.exec(ua)||ua.indexOf("compatible")<0&&rmozilla.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};};$.jPlayer.uaPlatform=function(userAgent){var ua=userAgent.toLowerCase();var rplatform=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/;var rtablet=/(ipad|playbook)/;var randroid=/(android)/;var rmobile=/(mobile)/;var platform=rplatform.exec(ua)||[];var tablet=rtablet.exec(ua)||!rmobile.exec(ua)&&randroid.exec(ua)||[];if(platform[1]){platform[1]=platform[1].replace(/\s/g,"_");}
return{platform:platform[1]||"",tablet:tablet[1]||""};};$.jPlayer.browser={};$.jPlayer.platform={};var browserMatch=$.jPlayer.uaBrowser(navigator.userAgent);if(browserMatch.browser){$.jPlayer.browser[browserMatch.browser]=true;$.jPlayer.browser.version=browserMatch.version;}
var platformMatch=$.jPlayer.uaPlatform(navigator.userAgent);if(platformMatch.platform){$.jPlayer.platform[platformMatch.platform]=true;$.jPlayer.platform.mobile=!platformMatch.tablet;$.jPlayer.platform.tablet=!!platformMatch.tablet;}
$.jPlayer.getDocMode=function(){var docMode;if($.jPlayer.browser.msie){if(document.documentMode){docMode=document.documentMode;}else{docMode=5;if(document.compatMode){if(document.compatMode==="CSS1Compat"){docMode=7;}}}}
return docMode;};$.jPlayer.browser.documentMode=$.jPlayer.getDocMode();$.jPlayer.nativeFeatures={init:function(){var d=document,v=d.createElement('video'),spec={w3c:['fullscreenEnabled','fullscreenElement','requestFullscreen','exitFullscreen','fullscreenchange','fullscreenerror'],moz:['mozFullScreenEnabled','mozFullScreenElement','mozRequestFullScreen','mozCancelFullScreen','mozfullscreenchange','mozfullscreenerror'],webkit:['','webkitCurrentFullScreenElement','webkitRequestFullScreen','webkitCancelFullScreen','webkitfullscreenchange',''],webkitVideo:['webkitSupportsFullscreen','webkitDisplayingFullscreen','webkitEnterFullscreen','webkitExitFullscreen','','']},specOrder=['w3c','moz','webkit','webkitVideo'],fs,i,il;this.fullscreen=fs={support:{w3c:!!d[spec.w3c[0]],moz:!!d[spec.moz[0]],webkit:typeof d[spec.webkit[3]]==='function',webkitVideo:typeof v[spec.webkitVideo[2]]==='function'},used:{}};for(i=0,il=specOrder.length;i<il;i++){var n=specOrder[i];if(fs.support[n]){fs.spec=n;fs.used[n]=true;break;}}
if(fs.spec){var s=spec[fs.spec];fs.api={fullscreenEnabled:true,fullscreenElement:function(elem){elem=elem?elem:d;return elem[s[1]];},requestFullscreen:function(elem){return elem[s[2]]();},exitFullscreen:function(elem){elem=elem?elem:d;return elem[s[3]]();}};fs.event={fullscreenchange:s[4],fullscreenerror:s[5]};}else{fs.api={fullscreenEnabled:false,fullscreenElement:function(){return null;},requestFullscreen:function(){},exitFullscreen:function(){}};fs.event={};}}};$.jPlayer.nativeFeatures.init();$.jPlayer.focus=null;$.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";var keyBindings=function(event){var f=$.jPlayer.focus,pageFocus=document.activeElement,ignoreKey;if(f){if(typeof pageFocus!=='undefined'){if(pageFocus!==null&&pageFocus.nodeName.toUpperCase()!=="BODY"){ignoreKey=true;}}else{$.each($.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(i,name){if(event.target.nodeName.toUpperCase()===name.toUpperCase()){ignoreKey=true;return false;}});}
if(!ignoreKey){$.each(f.options.keyBindings,function(action,binding){if(binding&&event.which===binding.key&&$.isFunction(binding.fn)){event.preventDefault();binding.fn(f);return false;}});}}};$.jPlayer.keys=function(en){var event="keydown.jPlayer";$(document.documentElement).unbind(event);if(en){$(document.documentElement).bind(event,keyBindings);}};$.jPlayer.keys(true);$.jPlayer.prototype={count:0,version:{script:"2.7.1",needFlash:"2.7.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",preload:'metadata',volume:0.8,muted:false,remainingDuration:false,toggleDuration:false,captureDuration:true,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:0.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen"},useStateClassSkin:false,autoBlur:true,smoothPlayBar:false,fullScreen:false,fullWindow:false,autohide:{restored:false,full:true,fadeIn:200,fadeOut:600,hold:1000},loop:false,repeat:function(event){if(event.jPlayer.options.loop){$(this).unbind(".jPlayerRepeat").bind($.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){$(this).jPlayer("play");});}else{$(this).unbind(".jPlayerRepeat");}},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:false,audioFullScreen:false,keyBindings:{play:{key:32,fn:function(f){if(f.status.paused){f.play();}else{f.pause();}}},fullScreen:{key:13,fn:function(f){if(f.status.video||f.options.audioFullScreen){f._setOption("fullScreen",!f.options.fullScreen);}}},muted:{key:8,fn:function(f){f._muted(!f.options.muted);}},volumeUp:{key:38,fn:function(f){f.volume(f.options.volume+0.1);}},volumeDown:{key:40,fn:function(f){f.volume(f.options.volume-0.1);}}},verticalVolume:false,verticalPlaybackRate:false,globalVolume:false,idPrefix:"jp",noConflict:"jQuery",emulateHtml:false,consoleAlerts:true,errorAlerts:false,warningAlerts:false},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:true,format:{},formatType:"",waitForPlay:true,waitForLoad:true,srcSet:false,video:false,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:false},solution:{html:true,flash:true},format:{mp3:{codec:'audio/mpeg',flashCanPlay:true,media:'audio'},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:true,media:'audio'},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:false,media:'audio'},m3ua:{codec:'audio/mpegurl',flashCanPlay:false,media:'audio'},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:false,media:'audio'},flac:{codec:'audio/x-flac',flashCanPlay:false,media:'audio'},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:false,media:'audio'},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:false,media:'audio'},fla:{codec:'audio/x-flv',flashCanPlay:true,media:'audio'},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:true,media:'audio'},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:true,media:'video'},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:false,media:'video'},m3uv:{codec:'audio/mpegurl',flashCanPlay:false,media:'video'},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:false,media:'video'},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:false,media:'video'},flv:{codec:'video/x-flv',flashCanPlay:true,media:'video'},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:true,media:'video'}},_init:function(){var self=this;this.element.empty();this.status=$.extend({},this.status);this.internal=$.extend({},this.internal);this.options.timeFormat=$.extend({},$.jPlayer.timeFormat,this.options.timeFormat);this.internal.cmdsIgnored=$.jPlayer.platform.ipad||$.jPlayer.platform.iphone||$.jPlayer.platform.ipod;this.internal.domNode=this.element.get(0);if(this.options.keyEnabled&&!$.jPlayer.focus){$.jPlayer.focus=this;}
this.androidFix={setMedia:false,play:false,pause:false,time:NaN};if($.jPlayer.platform.android){this.options.preload=this.options.preload!=='auto'?'metadata':'auto';}
this.formats=[];this.solutions=[];this.require={};this.htmlElement={};this.html={};this.html.audio={};this.html.video={};this.flash={};this.css={};this.css.cs={};this.css.jq={};this.ancestorJq=[];this.options.volume=this._limitValue(this.options.volume,0,1);$.each(this.options.supplied.toLowerCase().split(","),function(index1,value1){var format=value1.replace(/^\s+|\s+$/g,"");if(self.format[format]){var dupFound=false;$.each(self.formats,function(index2,value2){if(format===value2){dupFound=true;return false;}});if(!dupFound){self.formats.push(format);}}});$.each(this.options.solution.toLowerCase().split(","),function(index1,value1){var solution=value1.replace(/^\s+|\s+$/g,"");if(self.solution[solution]){var dupFound=false;$.each(self.solutions,function(index2,value2){if(solution===value2){dupFound=true;return false;}});if(!dupFound){self.solutions.push(solution);}}});this.internal.instance="jp_"+this.count;this.instances[this.internal.instance]=this.element;if(!this.element.attr("id")){this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count);}
this.internal.self=$.extend({},{id:this.element.attr("id"),jq:this.element});this.internal.audio=$.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:undefined});this.internal.video=$.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:undefined});this.internal.flash=$.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:undefined,swf:this.options.swfPath+(this.options.swfPath.toLowerCase().slice(-4)!==".swf"?(this.options.swfPath&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"Jplayer.swf":"")});this.internal.poster=$.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:undefined});$.each($.jPlayer.event,function(eventName,eventType){if(self.options[eventName]!==undefined){self.element.bind(eventType+".jPlayer",self.options[eventName]);self.options[eventName]=undefined;}});this.require.audio=false;this.require.video=false;$.each(this.formats,function(priority,format){self.require[self.format[format].media]=true;});if(this.require.video){this.options=$.extend(true,{},this.optionsVideo,this.options);}else{this.options=$.extend(true,{},this.optionsAudio,this.options);}
this._setSize();this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this.status.noVolume=this._uaBlocklist(this.options.noVolume);if($.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled){this._fullscreenAddEventListeners();}
this._restrictNativeVideoControls();this.htmlElement.poster=document.createElement('img');this.htmlElement.poster.id=this.internal.poster.id;this.htmlElement.poster.onload=function(){if(!self.status.video||self.status.waitForPlay){self.internal.poster.jq.show();}};this.element.append(this.htmlElement.poster);this.internal.poster.jq=$("#"+this.internal.poster.id);this.internal.poster.jq.css({'width':this.status.width,'height':this.status.height});this.internal.poster.jq.hide();this.internal.poster.jq.bind("click.jPlayer",function(){self._trigger($.jPlayer.event.click);});this.html.audio.available=false;if(this.require.audio){this.htmlElement.audio=document.createElement('audio');this.htmlElement.audio.id=this.internal.audio.id;this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio);}
this.html.video.available=false;if(this.require.video){this.htmlElement.video=document.createElement('video');this.htmlElement.video.id=this.internal.video.id;this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video);}
this.flash.available=this._checkForFlash(10.1);this.html.canPlay={};this.flash.canPlay={};$.each(this.formats,function(priority,format){self.html.canPlay[format]=self.html[self.format[format].media].available&&""!==self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec);self.flash.canPlay[format]=self.format[format].flashCanPlay&&self.flash.available;});this.html.desired=false;this.flash.desired=false;$.each(this.solutions,function(solutionPriority,solution){if(solutionPriority===0){self[solution].desired=true;}else{var audioCanPlay=false;var videoCanPlay=false;$.each(self.formats,function(formatPriority,format){if(self[self.solutions[0]].canPlay[format]){if(self.format[format].media==='video'){videoCanPlay=true;}else{audioCanPlay=true;}}});self[solution].desired=(self.require.audio&&!audioCanPlay)||(self.require.video&&!videoCanPlay);}});this.html.support={};this.flash.support={};$.each(this.formats,function(priority,format){self.html.support[format]=self.html.canPlay[format]&&self.html.desired;self.flash.support[format]=self.flash.canPlay[format]&&self.flash.desired;});this.html.used=false;this.flash.used=false;$.each(this.solutions,function(solutionPriority,solution){$.each(self.formats,function(formatPriority,format){if(self[solution].support[format]){self[solution].used=true;return false;}});});this._resetActive();this._resetGate();this._cssSelectorAncestor(this.options.cssSelectorAncestor);if(!(this.html.used||this.flash.used)){this._error({type:$.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SOLUTION,hint:$.jPlayer.errorHint.NO_SOLUTION});if(this.css.jq.noSolution.length){this.css.jq.noSolution.show();}}else{if(this.css.jq.noSolution.length){this.css.jq.noSolution.hide();}}
if(this.flash.used){var htmlObj,flashVars='jQuery='+encodeURI(this.options.noConflict)+'&id='+encodeURI(this.internal.self.id)+'&vol='+this.options.volume+'&muted='+this.options.muted;if($.jPlayer.browser.msie&&(Number($.jPlayer.browser.version)<9||$.jPlayer.browser.documentMode<9)){var objStr='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>';var paramStr=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+flashVars+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];htmlObj=document.createElement(objStr);for(var i=0;i<paramStr.length;i++){htmlObj.appendChild(document.createElement(paramStr[i]));}}else{var createParam=function(el,n,v){var p=document.createElement("param");p.setAttribute("name",n);p.setAttribute("value",v);el.appendChild(p);};htmlObj=document.createElement("object");htmlObj.setAttribute("id",this.internal.flash.id);htmlObj.setAttribute("name",this.internal.flash.id);htmlObj.setAttribute("data",this.internal.flash.swf);htmlObj.setAttribute("type","application/x-shockwave-flash");htmlObj.setAttribute("width","1");htmlObj.setAttribute("height","1");htmlObj.setAttribute("tabindex","-1");createParam(htmlObj,"flashvars",flashVars);createParam(htmlObj,"allowscriptaccess","always");createParam(htmlObj,"bgcolor",this.options.backgroundColor);createParam(htmlObj,"wmode",this.options.wmode);}
this.element.append(htmlObj);this.internal.flash.jq=$(htmlObj);}
if(this.html.used&&!this.flash.used){this.status.playbackRateEnabled=this._testPlaybackRate('audio');}else{this.status.playbackRateEnabled=false;}
this._updatePlaybackRate();if(this.html.used){if(this.html.audio.available){this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio);this.element.append(this.htmlElement.audio);this.internal.audio.jq=$("#"+this.internal.audio.id);}
if(this.html.video.available){this._addHtmlEventListeners(this.htmlElement.video,this.html.video);this.element.append(this.htmlElement.video);this.internal.video.jq=$("#"+this.internal.video.id);if(this.status.nativeVideoControls){this.internal.video.jq.css({'width':this.status.width,'height':this.status.height});}else{this.internal.video.jq.css({'width':'0px','height':'0px'});}
this.internal.video.jq.bind("click.jPlayer",function(){self._trigger($.jPlayer.event.click);});}}
if(this.options.emulateHtml){this._emulateHtmlBridge();}
if(this.html.used&&!this.flash.used){setTimeout(function(){self.internal.ready=true;self.version.flash="n/a";self._trigger($.jPlayer.event.repeat);self._trigger($.jPlayer.event.ready);},100);}
this._updateNativeVideoControls();if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide();}
$.jPlayer.prototype.count++;},destroy:function(){this.clearMedia();this._removeUiClass();if(this.css.jq.currentTime.length){this.css.jq.currentTime.text("");}
if(this.css.jq.duration.length){this.css.jq.duration.text("");}
$.each(this.css.jq,function(fn,jq){if(jq.length){jq.unbind(".jPlayer");}});this.internal.poster.jq.unbind(".jPlayer");if(this.internal.video.jq){this.internal.video.jq.unbind(".jPlayer");}
this._fullscreenRemoveEventListeners();if(this===$.jPlayer.focus){$.jPlayer.focus=null;}
if(this.options.emulateHtml){this._destroyHtmlBridge();}
this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();delete this.instances[this.internal.instance];},enable:function(){},disable:function(){},_testCanPlayType:function(elem){try{elem.canPlayType(this.format.mp3.codec);return true;}catch(err){return false;}},_testPlaybackRate:function(type){var el,rate=0.5;type=typeof type==='string'?type:'audio';el=document.createElement(type);try{if('playbackRate'in el){el.playbackRate=rate;return el.playbackRate===rate;}else{return false;}}catch(err){return false;}},_uaBlocklist:function(list){var ua=navigator.userAgent.toLowerCase(),block=false;$.each(list,function(p,re){if(re&&re.test(ua)){block=true;return false;}});return block;},_restrictNativeVideoControls:function(){if(this.require.audio){if(this.status.nativeVideoControls){this.status.nativeVideoControls=false;this.status.noFullWindow=true;}}},_updateNativeVideoControls:function(){if(this.html.video.available&&this.html.used){this.htmlElement.video.controls=this.status.nativeVideoControls;this._updateAutohide();if(this.status.nativeVideoControls&&this.require.video){this.internal.poster.jq.hide();this.internal.video.jq.css({'width':this.status.width,'height':this.status.height});}else if(this.status.waitForPlay&&this.status.video){this.internal.poster.jq.show();this.internal.video.jq.css({'width':'0px','height':'0px'});}}},_addHtmlEventListeners:function(mediaElement,entity){var self=this;mediaElement.preload=this.options.preload;mediaElement.muted=this.options.muted;mediaElement.volume=this.options.volume;if(this.status.playbackRateEnabled){mediaElement.defaultPlaybackRate=this.options.defaultPlaybackRate;mediaElement.playbackRate=this.options.playbackRate;}
mediaElement.addEventListener("progress",function(){if(entity.gate){if(self.internal.cmdsIgnored&&this.readyState>0){self.internal.cmdsIgnored=false;}
self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.progress);}},false);mediaElement.addEventListener("loadeddata",function(){if(entity.gate){self.androidFix.setMedia=false;if(self.androidFix.play){self.androidFix.play=false;self.play(self.androidFix.time);}
if(self.androidFix.pause){self.androidFix.pause=false;self.pause(self.androidFix.time);}
self._trigger($.jPlayer.event.loadeddata);}},false);mediaElement.addEventListener("timeupdate",function(){if(entity.gate){self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.timeupdate);}},false);mediaElement.addEventListener("durationchange",function(){if(entity.gate){self._getHtmlStatus(mediaElement);self._updateInterface();self._trigger($.jPlayer.event.durationchange);}},false);mediaElement.addEventListener("play",function(){if(entity.gate){self._updateButtons(true);self._html_checkWaitForPlay();self._trigger($.jPlayer.event.play);}},false);mediaElement.addEventListener("playing",function(){if(entity.gate){self._updateButtons(true);self._seeked();self._trigger($.jPlayer.event.playing);}},false);mediaElement.addEventListener("pause",function(){if(entity.gate){self._updateButtons(false);self._trigger($.jPlayer.event.pause);}},false);mediaElement.addEventListener("waiting",function(){if(entity.gate){self._seeking();self._trigger($.jPlayer.event.waiting);}},false);mediaElement.addEventListener("seeking",function(){if(entity.gate){self._seeking();self._trigger($.jPlayer.event.seeking);}},false);mediaElement.addEventListener("seeked",function(){if(entity.gate){self._seeked();self._trigger($.jPlayer.event.seeked);}},false);mediaElement.addEventListener("volumechange",function(){if(entity.gate){self.options.volume=mediaElement.volume;self.options.muted=mediaElement.muted;self._updateMute();self._updateVolume();self._trigger($.jPlayer.event.volumechange);}},false);mediaElement.addEventListener("ratechange",function(){if(entity.gate){self.options.defaultPlaybackRate=mediaElement.defaultPlaybackRate;self.options.playbackRate=mediaElement.playbackRate;self._updatePlaybackRate();self._trigger($.jPlayer.event.ratechange);}},false);mediaElement.addEventListener("suspend",function(){if(entity.gate){self._seeked();self._trigger($.jPlayer.event.suspend);}},false);mediaElement.addEventListener("ended",function(){if(entity.gate){if(!$.jPlayer.browser.webkit){self.htmlElement.media.currentTime=0;}
self.htmlElement.media.pause();self._updateButtons(false);self._getHtmlStatus(mediaElement,true);self._updateInterface();self._trigger($.jPlayer.event.ended);}},false);mediaElement.addEventListener("error",function(){if(entity.gate){self._updateButtons(false);self._seeked();if(self.status.srcSet){clearTimeout(self.internal.htmlDlyCmdId);self.status.waitForLoad=true;self.status.waitForPlay=true;if(self.status.video&&!self.status.nativeVideoControls){self.internal.video.jq.css({'width':'0px','height':'0px'});}
if(self._validString(self.status.media.poster)&&!self.status.nativeVideoControls){self.internal.poster.jq.show();}
if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show();}
self._error({type:$.jPlayer.error.URL,context:self.status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});}}},false);$.each($.jPlayer.htmlEvent,function(i,eventType){mediaElement.addEventListener(this,function(){if(entity.gate){self._trigger($.jPlayer.event[eventType]);}},false);});},_getHtmlStatus:function(media,override){var ct=0,cpa=0,sp=0,cpr=0;if(isFinite(media.duration)){this.status.duration=media.duration;}
ct=media.currentTime;cpa=(this.status.duration>0)?100*ct/this.status.duration:0;if((typeof media.seekable==="object")&&(media.seekable.length>0)){sp=(this.status.duration>0)?100*media.seekable.end(media.seekable.length-1)/this.status.duration:100;cpr=(this.status.duration>0)?100*media.currentTime/media.seekable.end(media.seekable.length-1):0;}else{sp=100;cpr=cpa;}
if(override){ct=0;cpr=0;cpa=0;}
this.status.seekPercent=sp;this.status.currentPercentRelative=cpr;this.status.currentPercentAbsolute=cpa;this.status.currentTime=ct;this.status.remaining=this.status.duration-this.status.currentTime;this.status.videoWidth=media.videoWidth;this.status.videoHeight=media.videoHeight;this.status.readyState=media.readyState;this.status.networkState=media.networkState;this.status.playbackRate=media.playbackRate;this.status.ended=media.ended;},_resetStatus:function(){this.status=$.extend({},this.status,$.jPlayer.prototype.status);},_trigger:function(eventType,error,warning){var event=$.Event(eventType);event.jPlayer={};event.jPlayer.version=$.extend({},this.version);event.jPlayer.options=$.extend(true,{},this.options);event.jPlayer.status=$.extend(true,{},this.status);event.jPlayer.html=$.extend(true,{},this.html);event.jPlayer.flash=$.extend(true,{},this.flash);if(error){event.jPlayer.error=$.extend({},error);}
if(warning){event.jPlayer.warning=$.extend({},warning);}
this.element.trigger(event);},jPlayerFlashEvent:function(eventType,status){if(eventType===$.jPlayer.event.ready){if(!this.internal.ready){this.internal.ready=true;this.internal.flash.jq.css({'width':'0px','height':'0px'});this.version.flash=status.version;if(this.version.needFlash!==this.version.flash){this._error({type:$.jPlayer.error.VERSION,context:this.version.flash,message:$.jPlayer.errorMsg.VERSION+this.version.flash,hint:$.jPlayer.errorHint.VERSION});}
this._trigger($.jPlayer.event.repeat);this._trigger(eventType);}else{if(this.flash.gate){if(this.status.srcSet){var currentTime=this.status.currentTime,paused=this.status.paused;this.setMedia(this.status.media);this.volumeWorker(this.options.volume);if(currentTime>0){if(paused){this.pause(currentTime);}else{this.play(currentTime);}}}
this._trigger($.jPlayer.event.flashreset);}}}
if(this.flash.gate){switch(eventType){case $.jPlayer.event.progress:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.timeupdate:this._getFlashStatus(status);this._updateInterface();this._trigger(eventType);break;case $.jPlayer.event.play:this._seeked();this._updateButtons(true);this._trigger(eventType);break;case $.jPlayer.event.pause:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.ended:this._updateButtons(false);this._trigger(eventType);break;case $.jPlayer.event.click:this._trigger(eventType);break;case $.jPlayer.event.error:this.status.waitForLoad=true;this.status.waitForPlay=true;if(this.status.video){this.internal.flash.jq.css({'width':'0px','height':'0px'});}
if(this._validString(this.status.media.poster)){this.internal.poster.jq.show();}
if(this.css.jq.videoPlay.length&&this.status.video){this.css.jq.videoPlay.show();}
if(this.status.video){this._flash_setVideo(this.status.media);}else{this._flash_setAudio(this.status.media);}
this._updateButtons(false);this._error({type:$.jPlayer.error.URL,context:status.src,message:$.jPlayer.errorMsg.URL,hint:$.jPlayer.errorHint.URL});break;case $.jPlayer.event.seeking:this._seeking();this._trigger(eventType);break;case $.jPlayer.event.seeked:this._seeked();this._trigger(eventType);break;case $.jPlayer.event.ready:break;default:this._trigger(eventType);}}
return false;},_getFlashStatus:function(status){this.status.seekPercent=status.seekPercent;this.status.currentPercentRelative=status.currentPercentRelative;this.status.currentPercentAbsolute=status.currentPercentAbsolute;this.status.currentTime=status.currentTime;this.status.duration=status.duration;this.status.remaining=status.duration-status.currentTime;this.status.videoWidth=status.videoWidth;this.status.videoHeight=status.videoHeight;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=false;},_updateButtons:function(playing){if(playing===undefined){playing=!this.status.paused;}else{this.status.paused=!playing;}
if(playing){this.addStateClass('playing');}else{this.removeStateClass('playing');}
if(!this.status.noFullWindow&&this.options.fullWindow){this.addStateClass('fullScreen');}else{this.removeStateClass('fullScreen');}
if(this.options.loop){this.addStateClass('looped');}else{this.removeStateClass('looped');}
if(this.css.jq.play.length&&this.css.jq.pause.length){if(playing){this.css.jq.play.hide();this.css.jq.pause.show();}else{this.css.jq.play.show();this.css.jq.pause.hide();}}
if(this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length){if(this.status.noFullWindow){this.css.jq.fullScreen.hide();this.css.jq.restoreScreen.hide();}else if(this.options.fullWindow){this.css.jq.fullScreen.hide();this.css.jq.restoreScreen.show();}else{this.css.jq.fullScreen.show();this.css.jq.restoreScreen.hide();}}
if(this.css.jq.repeat.length&&this.css.jq.repeatOff.length){if(this.options.loop){this.css.jq.repeat.hide();this.css.jq.repeatOff.show();}else{this.css.jq.repeat.show();this.css.jq.repeatOff.hide();}}},_updateInterface:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.width(this.status.seekPercent+"%");}
if(this.css.jq.playBar.length){if(this.options.smoothPlayBar){this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear");}else{this.css.jq.playBar.width(this.status.currentPercentRelative+"%");}}
var currentTimeText='';if(this.css.jq.currentTime.length){currentTimeText=this._convertTime(this.status.currentTime);if(currentTimeText!==this.css.jq.currentTime.text()){this.css.jq.currentTime.text(this._convertTime(this.status.currentTime));}}
var durationText='',duration=this.status.duration,remaining=this.status.remaining;if(this.css.jq.duration.length){if(typeof this.status.media.duration==='string'){durationText=this.status.media.duration;}else{if(typeof this.status.media.duration==='number'){duration=this.status.media.duration;remaining=duration-this.status.currentTime;}
if(this.options.remainingDuration){durationText=(remaining>0?'-':'')+this._convertTime(remaining);}else{durationText=this._convertTime(duration);}}
if(durationText!==this.css.jq.duration.text()){this.css.jq.duration.text(durationText);}}},_convertTime:ConvertTime.prototype.time,_seeking:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.addClass("jp-seeking-bg");}
this.addStateClass('seeking');},_seeked:function(){if(this.css.jq.seekBar.length){this.css.jq.seekBar.removeClass("jp-seeking-bg");}
this.removeStateClass('seeking');},_resetGate:function(){this.html.audio.gate=false;this.html.video.gate=false;this.flash.gate=false;},_resetActive:function(){this.html.active=false;this.flash.active=false;},_escapeHtml:function(s){return s.split('&').join('&amp;').split('<').join('&lt;').split('>').join('&gt;').split('"').join('&quot;');},_qualifyURL:function(url){var el=document.createElement('div');el.innerHTML='<a href="'+this._escapeHtml(url)+'">x</a>';return el.firstChild.href;},_absoluteMediaUrls:function(media){var self=this;$.each(media,function(type,url){if(url&&self.format[type]){media[type]=self._qualifyURL(url);}});return media;},addStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.addClass(this.options.stateClass[state]);}},removeStateClass:function(state){if(this.ancestorJq.length){this.ancestorJq.removeClass(this.options.stateClass[state]);}},setMedia:function(media){var self=this,supported=false,posterChanged=this.status.media.poster!==media.poster;this._resetMedia();this._resetGate();this._resetActive();this.androidFix.setMedia=false;this.androidFix.play=false;this.androidFix.pause=false;media=this._absoluteMediaUrls(media);$.each(this.formats,function(formatPriority,format){var isVideo=self.format[format].media==='video';$.each(self.solutions,function(solutionPriority,solution){if(self[solution].support[format]&&self._validString(media[format])){var isHtml=solution==='html';if(isVideo){if(isHtml){self.html.video.gate=true;self._html_setVideo(media);self.html.active=true;}else{self.flash.gate=true;self._flash_setVideo(media);self.flash.active=true;}
if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.show();}
self.status.video=true;}else{if(isHtml){self.html.audio.gate=true;self._html_setAudio(media);self.html.active=true;if($.jPlayer.platform.android){self.androidFix.setMedia=true;}}else{self.flash.gate=true;self._flash_setAudio(media);self.flash.active=true;}
if(self.css.jq.videoPlay.length){self.css.jq.videoPlay.hide();}
self.status.video=false;}
supported=true;return false;}});if(supported){return false;}});if(supported){if(!(this.status.nativeVideoControls&&this.html.video.gate)){if(this._validString(media.poster)){if(posterChanged){this.htmlElement.poster.src=media.poster;}else{this.internal.poster.jq.show();}}}
if(this.css.jq.title.length){if(typeof media.title==='string'){this.css.jq.title.html(media.title);if(this.htmlElement.audio){this.htmlElement.audio.setAttribute('title',media.title);}
if(this.htmlElement.video){this.htmlElement.video.setAttribute('title',media.title);}}}
this.status.srcSet=true;this.status.media=$.extend({},media);this._updateButtons(false);this._updateInterface();this._trigger($.jPlayer.event.setmedia);}else{this._error({type:$.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:$.jPlayer.errorMsg.NO_SUPPORT,hint:$.jPlayer.errorHint.NO_SUPPORT});}},_resetMedia:function(){this._resetStatus();this._updateButtons(false);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);if(this.html.active){this._html_resetMedia();}else if(this.flash.active){this._flash_resetMedia();}},clearMedia:function(){this._resetMedia();if(this.html.active){this._html_clearMedia();}else if(this.flash.active){this._flash_clearMedia();}
this._resetGate();this._resetActive();},load:function(){if(this.status.srcSet){if(this.html.active){this._html_load();}else if(this.flash.active){this._flash_load();}}else{this._urlNotSetError("load");}},focus:function(){if(this.options.keyEnabled){$.jPlayer.focus=this;}},play:function(time){var guiAction=typeof time==="object";if(guiAction&&this.options.useStateClassSkin&&!this.status.paused){this.pause(time);}else{time=(typeof time==="number")?time:NaN;if(this.status.srcSet){this.focus();if(this.html.active){this._html_play(time);}else if(this.flash.active){this._flash_play(time);}}else{this._urlNotSetError("play");}}},videoPlay:function(){this.play();},pause:function(time){time=(typeof time==="number")?time:NaN;if(this.status.srcSet){if(this.html.active){this._html_pause(time);}else if(this.flash.active){this._flash_pause(time);}}else{this._urlNotSetError("pause");}},tellOthers:function(command,conditions){var self=this,hasConditions=typeof conditions==='function',args=Array.prototype.slice.call(arguments);if(typeof command!=='string'){return;}
if(hasConditions){args.splice(1,1);}
$.each(this.instances,function(){if(self.element!==this){if(!hasConditions||conditions.call(this.data("jPlayer"),self)){this.jPlayer.apply(this,args);}}});},pauseOthers:function(time){this.tellOthers("pause",function(){return this.status.srcSet;},time);},stop:function(){if(this.status.srcSet){if(this.html.active){this._html_pause(0);}else if(this.flash.active){this._flash_pause(0);}}else{this._urlNotSetError("stop");}},playHead:function(p){p=this._limitValue(p,0,100);if(this.status.srcSet){if(this.html.active){this._html_playHead(p);}else if(this.flash.active){this._flash_playHead(p);}}else{this._urlNotSetError("playHead");}},_muted:function(muted){this.mutedWorker(muted);if(this.options.globalVolume){this.tellOthers("mutedWorker",function(){return this.options.globalVolume;},muted);}},mutedWorker:function(muted){this.options.muted=muted;if(this.html.used){this._html_setProperty('muted',muted);}
if(this.flash.used){this._flash_mute(muted);}
if(!this.html.video.gate&&!this.html.audio.gate){this._updateMute(muted);this._updateVolume(this.options.volume);this._trigger($.jPlayer.event.volumechange);}},mute:function(mute){var guiAction=typeof mute==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.muted){this._muted(false);}else{mute=mute===undefined?true:!!mute;this._muted(mute);}},unmute:function(unmute){unmute=unmute===undefined?true:!!unmute;this._muted(!unmute);},_updateMute:function(mute){if(mute===undefined){mute=this.options.muted;}
if(mute){this.addStateClass('muted');}else{this.removeStateClass('muted');}
if(this.css.jq.mute.length&&this.css.jq.unmute.length){if(this.status.noVolume){this.css.jq.mute.hide();this.css.jq.unmute.hide();}else if(mute){this.css.jq.mute.hide();this.css.jq.unmute.show();}else{this.css.jq.mute.show();this.css.jq.unmute.hide();}}},volume:function(v){this.volumeWorker(v);if(this.options.globalVolume){this.tellOthers("volumeWorker",function(){return this.options.globalVolume;},v);}},volumeWorker:function(v){v=this._limitValue(v,0,1);this.options.volume=v;if(this.html.used){this._html_setProperty('volume',v);}
if(this.flash.used){this._flash_volume(v);}
if(!this.html.video.gate&&!this.html.audio.gate){this._updateVolume(v);this._trigger($.jPlayer.event.volumechange);}},volumeBar:function(e){if(this.css.jq.volumeBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),y=$bar.height()-e.pageY+offset.top,h=$bar.height();if(this.options.verticalVolume){this.volume(y/h);}else{this.volume(x/w);}}
if(this.options.muted){this._muted(false);}},_updateVolume:function(v){if(v===undefined){v=this.options.volume;}
v=this.options.muted?0:v;if(this.status.noVolume){if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.hide();}
if(this.css.jq.volumeBarValue.length){this.css.jq.volumeBarValue.hide();}
if(this.css.jq.volumeMax.length){this.css.jq.volumeMax.hide();}}else{if(this.css.jq.volumeBar.length){this.css.jq.volumeBar.show();}
if(this.css.jq.volumeBarValue.length){this.css.jq.volumeBarValue.show();this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"]((v*100)+"%");}
if(this.css.jq.volumeMax.length){this.css.jq.volumeMax.show();}}},volumeMax:function(){this.volume(1);if(this.options.muted){this._muted(false);}},_cssSelectorAncestor:function(ancestor){var self=this;this.options.cssSelectorAncestor=ancestor;this._removeUiClass();this.ancestorJq=ancestor?$(ancestor):[];if(ancestor&&this.ancestorJq.length!==1){this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:ancestor,message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT});}
this._addUiClass();$.each(this.options.cssSelector,function(fn,cssSel){self._cssSelector(fn,cssSel);});this._updateInterface();this._updateButtons();this._updateAutohide();this._updateVolume();this._updateMute();},_cssSelector:function(fn,cssSel){var self=this;if(typeof cssSel==='string'){if($.jPlayer.prototype.options.cssSelector[fn]){if(this.css.jq[fn]&&this.css.jq[fn].length){this.css.jq[fn].unbind(".jPlayer");}
this.options.cssSelector[fn]=cssSel;this.css.cs[fn]=this.options.cssSelectorAncestor+" "+cssSel;if(cssSel){this.css.jq[fn]=$(this.css.cs[fn]);}else{this.css.jq[fn]=[];}
if(this.css.jq[fn].length&&this[fn]){var handler=function(e){e.preventDefault();self[fn](e);if(self.options.autoBlur){$(this).blur();}};this.css.jq[fn].bind("click.jPlayer",handler);}
if(cssSel&&this.css.jq[fn].length!==1){this._warning({type:$.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[fn],message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[fn].length+" found for "+fn+" method.",hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT});}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_METHOD,context:fn,message:$.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:$.jPlayer.warningHint.CSS_SELECTOR_METHOD});}}else{this._warning({type:$.jPlayer.warning.CSS_SELECTOR_STRING,context:cssSel,message:$.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:$.jPlayer.warningHint.CSS_SELECTOR_STRING});}},duration:function(e){if(this.options.toggleDuration){if(this.options.captureDuration){e.stopPropagation();}
this._setOption("remainingDuration",!this.options.remainingDuration);}},seekBar:function(e){if(this.css.jq.seekBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),p=100*x/w;this.playHead(p);}},playbackRate:function(pbr){this._setOption("playbackRate",pbr);},playbackRateBar:function(e){if(this.css.jq.playbackRateBar.length){var $bar=$(e.currentTarget),offset=$bar.offset(),x=e.pageX-offset.left,w=$bar.width(),y=$bar.height()-e.pageY+offset.top,h=$bar.height(),ratio,pbr;if(this.options.verticalPlaybackRate){ratio=y/h;}else{ratio=x/w;}
pbr=ratio*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate;this.playbackRate(pbr);}},_updatePlaybackRate:function(){var pbr=this.options.playbackRate,ratio=(pbr-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);if(this.status.playbackRateEnabled){if(this.css.jq.playbackRateBar.length){this.css.jq.playbackRateBar.show();}
if(this.css.jq.playbackRateBarValue.length){this.css.jq.playbackRateBarValue.show();this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"]((ratio*100)+"%");}}else{if(this.css.jq.playbackRateBar.length){this.css.jq.playbackRateBar.hide();}
if(this.css.jq.playbackRateBarValue.length){this.css.jq.playbackRateBarValue.hide();}}},repeat:function(event){var guiAction=typeof event==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.loop){this._loop(false);}else{this._loop(true);}},repeatOff:function(){this._loop(false);},_loop:function(loop){if(this.options.loop!==loop){this.options.loop=loop;this._updateButtons();this._trigger($.jPlayer.event.repeat);}},option:function(key,value){var options=key;if(arguments.length===0){return $.extend(true,{},this.options);}
if(typeof key==="string"){var keys=key.split(".");if(value===undefined){var opt=$.extend(true,{},this.options);for(var i=0;i<keys.length;i++){if(opt[keys[i]]!==undefined){opt=opt[keys[i]];}else{this._warning({type:$.jPlayer.warning.OPTION_KEY,context:key,message:$.jPlayer.warningMsg.OPTION_KEY,hint:$.jPlayer.warningHint.OPTION_KEY});return undefined;}}
return opt;}
options={};var opts=options;for(var j=0;j<keys.length;j++){if(j<keys.length-1){opts[keys[j]]={};opts=opts[keys[j]];}else{opts[keys[j]]=value;}}}
this._setOptions(options);return this;},_setOptions:function(options){var self=this;$.each(options,function(key,value){self._setOption(key,value);});return this;},_setOption:function(key,value){var self=this;switch(key){case"volume":this.volume(value);break;case"muted":this._muted(value);break;case"globalVolume":this.options[key]=value;break;case"cssSelectorAncestor":this._cssSelectorAncestor(value);break;case"cssSelector":$.each(value,function(fn,cssSel){self._cssSelector(fn,cssSel);});break;case"playbackRate":this.options[key]=value=this._limitValue(value,this.options.minPlaybackRate,this.options.maxPlaybackRate);if(this.html.used){this._html_setProperty('playbackRate',value);}
this._updatePlaybackRate();break;case"defaultPlaybackRate":this.options[key]=value=this._limitValue(value,this.options.minPlaybackRate,this.options.maxPlaybackRate);if(this.html.used){this._html_setProperty('defaultPlaybackRate',value);}
this._updatePlaybackRate();break;case"minPlaybackRate":this.options[key]=value=this._limitValue(value,0.1,this.options.maxPlaybackRate-0.1);this._updatePlaybackRate();break;case"maxPlaybackRate":this.options[key]=value=this._limitValue(value,this.options.minPlaybackRate+0.1,16);this._updatePlaybackRate();break;case"fullScreen":if(this.options[key]!==value){var wkv=$.jPlayer.nativeFeatures.fullscreen.used.webkitVideo;if(!wkv||wkv&&!this.status.waitForPlay){if(!wkv){this.options[key]=value;}
if(value){this._requestFullscreen();}else{this._exitFullscreen();}
if(!wkv){this._setOption("fullWindow",value);}}}
break;case"fullWindow":if(this.options[key]!==value){this._removeUiClass();this.options[key]=value;this._refreshSize();}
break;case"size":if(!this.options.fullWindow&&this.options[key].cssClass!==value.cssClass){this._removeUiClass();}
this.options[key]=$.extend({},this.options[key],value);this._refreshSize();break;case"sizeFull":if(this.options.fullWindow&&this.options[key].cssClass!==value.cssClass){this._removeUiClass();}
this.options[key]=$.extend({},this.options[key],value);this._refreshSize();break;case"autohide":this.options[key]=$.extend({},this.options[key],value);this._updateAutohide();break;case"loop":this._loop(value);break;case"remainingDuration":this.options[key]=value;this._updateInterface();break;case"toggleDuration":this.options[key]=value;break;case"nativeVideoControls":this.options[key]=$.extend({},this.options[key],value);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case"noFullWindow":this.options[key]=$.extend({},this.options[key],value);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this._restrictNativeVideoControls();this._updateButtons();break;case"noVolume":this.options[key]=$.extend({},this.options[key],value);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case"emulateHtml":if(this.options[key]!==value){this.options[key]=value;if(value){this._emulateHtmlBridge();}else{this._destroyHtmlBridge();}}
break;case"timeFormat":this.options[key]=$.extend({},this.options[key],value);break;case"keyEnabled":this.options[key]=value;if(!value&&this===$.jPlayer.focus){$.jPlayer.focus=null;}
break;case"keyBindings":this.options[key]=$.extend(true,{},this.options[key],value);break;case"audioFullScreen":this.options[key]=value;break;case"autoBlur":this.options[key]=value;break;}
return this;},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger($.jPlayer.event.resize);},_setSize:function(){if(this.options.fullWindow){this.status.width=this.options.sizeFull.width;this.status.height=this.options.sizeFull.height;this.status.cssClass=this.options.sizeFull.cssClass;}else{this.status.width=this.options.size.width;this.status.height=this.options.size.height;this.status.cssClass=this.options.size.cssClass;}
this.element.css({'width':this.status.width,'height':this.status.height});},_addUiClass:function(){if(this.ancestorJq.length){this.ancestorJq.addClass(this.status.cssClass);}},_removeUiClass:function(){if(this.ancestorJq.length){this.ancestorJq.removeClass(this.status.cssClass);}},_updateSize:function(){this.internal.poster.jq.css({'width':this.status.width,'height':this.status.height});if(!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls){this.internal.video.jq.css({'width':this.status.width,'height':this.status.height});}
else if(!this.status.waitForPlay&&this.flash.active&&this.status.video){this.internal.flash.jq.css({'width':this.status.width,'height':this.status.height});}},_updateAutohide:function(){var self=this,event="mousemove.jPlayer",namespace=".jPlayerAutohide",eventType=event+namespace,handler=function(){self.css.jq.gui.fadeIn(self.options.autohide.fadeIn,function(){clearTimeout(self.internal.autohideId);self.internal.autohideId=setTimeout(function(){self.css.jq.gui.fadeOut(self.options.autohide.fadeOut);},self.options.autohide.hold);});};if(this.css.jq.gui.length){this.css.jq.gui.stop(true,true);clearTimeout(this.internal.autohideId);this.element.unbind(namespace);this.css.jq.gui.unbind(namespace);if(!this.status.nativeVideoControls){if(this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored){this.element.bind(eventType,handler);this.css.jq.gui.bind(eventType,handler);this.css.jq.gui.hide();}else{this.css.jq.gui.show();}}else{this.css.jq.gui.hide();}}},fullScreen:function(event){var guiAction=typeof event==="object";if(guiAction&&this.options.useStateClassSkin&&this.options.fullScreen){this._setOption("fullScreen",false);}else{this._setOption("fullScreen",true);}},restoreScreen:function(){this._setOption("fullScreen",false);},_fullscreenAddEventListeners:function(){var self=this,fs=$.jPlayer.nativeFeatures.fullscreen;if(fs.api.fullscreenEnabled){if(fs.event.fullscreenchange){if(typeof this.internal.fullscreenchangeHandler!=='function'){this.internal.fullscreenchangeHandler=function(){self._fullscreenchange();};}
document.addEventListener(fs.event.fullscreenchange,this.internal.fullscreenchangeHandler,false);}}},_fullscreenRemoveEventListeners:function(){var fs=$.jPlayer.nativeFeatures.fullscreen;if(this.internal.fullscreenchangeHandler){document.removeEventListener(fs.event.fullscreenchange,this.internal.fullscreenchangeHandler,false);}},_fullscreenchange:function(){if(this.options.fullScreen&&!$.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()){this._setOption("fullScreen",false);}},_requestFullscreen:function(){var e=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],fs=$.jPlayer.nativeFeatures.fullscreen;if(fs.used.webkitVideo){e=this.htmlElement.video;}
if(fs.api.fullscreenEnabled){fs.api.requestFullscreen(e);}},_exitFullscreen:function(){var fs=$.jPlayer.nativeFeatures.fullscreen,e;if(fs.used.webkitVideo){e=this.htmlElement.video;}
if(fs.api.fullscreenEnabled){fs.api.exitFullscreen(e);}},_html_initMedia:function(media){var $media=$(this.htmlElement.media).empty();$.each(media.track||[],function(i,v){var track=document.createElement('track');track.setAttribute("kind",v.kind?v.kind:"");track.setAttribute("src",v.src?v.src:"");track.setAttribute("srclang",v.srclang?v.srclang:"");track.setAttribute("label",v.label?v.label:"");if(v.def){track.setAttribute("default",v.def);}
$media.append(track);});this.htmlElement.media.src=this.status.src;if(this.options.preload!=='none'){this._html_load();}
this._trigger($.jPlayer.event.timeupdate);},_html_setFormat:function(media){var self=this;$.each(this.formats,function(priority,format){if(self.html.support[format]&&media[format]){self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});},_html_setAudio:function(media){this._html_setFormat(media);this.htmlElement.media=this.htmlElement.audio;this._html_initMedia(media);},_html_setVideo:function(media){this._html_setFormat(media);if(this.status.nativeVideoControls){this.htmlElement.video.poster=this._validString(media.poster)?media.poster:"";}
this.htmlElement.media=this.htmlElement.video;this._html_initMedia(media);},_html_resetMedia:function(){if(this.htmlElement.media){if(this.htmlElement.media.id===this.internal.video.id&&!this.status.nativeVideoControls){this.internal.video.jq.css({'width':'0px','height':'0px'});}
this.htmlElement.media.pause();}},_html_clearMedia:function(){if(this.htmlElement.media){this.htmlElement.media.src="about:blank";this.htmlElement.media.load();}},_html_load:function(){if(this.status.waitForLoad){this.status.waitForLoad=false;this.htmlElement.media.load();}
clearTimeout(this.internal.htmlDlyCmdId);},_html_play:function(time){var self=this,media=this.htmlElement.media;this.androidFix.pause=false;this._html_load();if(this.androidFix.setMedia){this.androidFix.play=true;this.androidFix.time=time;}else if(!isNaN(time)){if(this.internal.cmdsIgnored){media.play();}
try{if(!media.seekable||typeof media.seekable==="object"&&media.seekable.length>0){media.currentTime=time;media.play();}else{throw 1;}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.play(time);},250);return;}}else{media.play();}
this._html_checkWaitForPlay();},_html_pause:function(time){var self=this,media=this.htmlElement.media;this.androidFix.play=false;if(time>0){this._html_load();}else{clearTimeout(this.internal.htmlDlyCmdId);}
media.pause();if(this.androidFix.setMedia){this.androidFix.pause=true;this.androidFix.time=time;}else if(!isNaN(time)){try{if(!media.seekable||typeof media.seekable==="object"&&media.seekable.length>0){media.currentTime=time;}else{throw 1;}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.pause(time);},250);return;}}
if(time>0){this._html_checkWaitForPlay();}},_html_playHead:function(percent){var self=this,media=this.htmlElement.media;this._html_load();try{if(typeof media.seekable==="object"&&media.seekable.length>0){media.currentTime=percent*media.seekable.end(media.seekable.length-1)/100;}else if(media.duration>0&&!isNaN(media.duration)){media.currentTime=percent*media.duration/100;}else{throw"e";}}catch(err){this.internal.htmlDlyCmdId=setTimeout(function(){self.playHead(percent);},250);return;}
if(!this.status.waitForLoad){this._html_checkWaitForPlay();}},_html_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide();}
if(this.status.video){this.internal.poster.jq.hide();this.internal.video.jq.css({'width':this.status.width,'height':this.status.height});}}},_html_setProperty:function(property,value){if(this.html.audio.available){this.htmlElement.audio[property]=value;}
if(this.html.video.available){this.htmlElement.video[property]=value;}},_flash_setAudio:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4a":case"fla":self._getMovie().fl_setAudio_m4a(media[format]);break;case"mp3":self._getMovie().fl_setAudio_mp3(media[format]);break;case"rtmpa":self._getMovie().fl_setAudio_rtmp(media[format]);break;}
self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false;}}catch(err){this._flashError(err);}},_flash_setVideo:function(media){var self=this;try{$.each(this.formats,function(priority,format){if(self.flash.support[format]&&media[format]){switch(format){case"m4v":case"flv":self._getMovie().fl_setVideo_m4v(media[format]);break;case"rtmpv":self._getMovie().fl_setVideo_rtmp(media[format]);break;}
self.status.src=media[format];self.status.format[format]=true;self.status.formatType=format;return false;}});if(this.options.preload==='auto'){this._flash_load();this.status.waitForLoad=false;}}catch(err){this._flashError(err);}},_flash_resetMedia:function(){this.internal.flash.jq.css({'width':'0px','height':'0px'});this._flash_pause(NaN);},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia();}catch(err){this._flashError(err);}},_flash_load:function(){try{this._getMovie().fl_load();}catch(err){this._flashError(err);}
this.status.waitForLoad=false;},_flash_play:function(time){try{this._getMovie().fl_play(time);}catch(err){this._flashError(err);}
this.status.waitForLoad=false;this._flash_checkWaitForPlay();},_flash_pause:function(time){try{this._getMovie().fl_pause(time);}catch(err){this._flashError(err);}
if(time>0){this.status.waitForLoad=false;this._flash_checkWaitForPlay();}},_flash_playHead:function(p){try{this._getMovie().fl_play_head(p);}catch(err){this._flashError(err);}
if(!this.status.waitForLoad){this._flash_checkWaitForPlay();}},_flash_checkWaitForPlay:function(){if(this.status.waitForPlay){this.status.waitForPlay=false;if(this.css.jq.videoPlay.length){this.css.jq.videoPlay.hide();}
if(this.status.video){this.internal.poster.jq.hide();this.internal.flash.jq.css({'width':this.status.width,'height':this.status.height});}}},_flash_volume:function(v){try{this._getMovie().fl_volume(v);}catch(err){this._flashError(err);}},_flash_mute:function(m){try{this._getMovie().fl_mute(m);}catch(err){this._flashError(err);}},_getMovie:function(){return document[this.internal.flash.id];},_getFlashPluginVersion:function(){var version=0,flash;if(window.ActiveXObject){try{flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(flash){var v=flash.GetVariable("$version");if(v){v=v.split(" ")[1].split(",");version=parseInt(v[0],10)+"."+parseInt(v[1],10);}}}catch(e){}}
else if(navigator.plugins&&navigator.mimeTypes.length>0){flash=navigator.plugins["Shockwave Flash"];if(flash){version=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1");}}
return version*1;},_checkForFlash:function(version){var flashOk=false;if(this._getFlashPluginVersion()>=version){flashOk=true;}
return flashOk;},_validString:function(url){return(url&&typeof url==="string");},_limitValue:function(value,min,max){return(value<min)?min:((value>max)?max:value);},_urlNotSetError:function(context){this._error({type:$.jPlayer.error.URL_NOT_SET,context:context,message:$.jPlayer.errorMsg.URL_NOT_SET,hint:$.jPlayer.errorHint.URL_NOT_SET});},_flashError:function(error){var errorType;if(!this.internal.ready){errorType="FLASH";}else{errorType="FLASH_DISABLED";}
this._error({type:$.jPlayer.error[errorType],context:this.internal.flash.swf,message:$.jPlayer.errorMsg[errorType]+error.message,hint:$.jPlayer.errorHint[errorType]});this.internal.flash.jq.css({'width':'1px','height':'1px'});},_error:function(error){this._trigger($.jPlayer.event.error,error);if(this.options.errorAlerts){this._alert("Error!"+(error.message?"\n"+error.message:"")+(error.hint?"\n"+error.hint:"")+"\nContext: "+error.context);}},_warning:function(warning){this._trigger($.jPlayer.event.warning,undefined,warning);if(this.options.warningAlerts){this._alert("Warning!"+(warning.message?"\n"+warning.message:"")+(warning.hint?"\n"+warning.hint:"")+"\nContext: "+warning.context);}},_alert:function(message){var msg="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+message;if(!this.options.consoleAlerts){alert(msg);}else if(window.console&&window.console.log){window.console.log(msg);}},_emulateHtmlBridge:function(){var self=this;$.each($.jPlayer.emulateMethods.split(/\s+/g),function(i,name){self.internal.domNode[name]=function(arg){self[name](arg);};});$.each($.jPlayer.event,function(eventName,eventType){var nativeEvent=true;$.each($.jPlayer.reservedEvent.split(/\s+/g),function(i,name){if(name===eventName){nativeEvent=false;return false;}});if(nativeEvent){self.element.bind(eventType+".jPlayer.jPlayerHtml",function(){self._emulateHtmlUpdate();var domEvent=document.createEvent("Event");domEvent.initEvent(eventName,false,true);self.internal.domNode.dispatchEvent(domEvent);});}});},_emulateHtmlUpdate:function(){var self=this;$.each($.jPlayer.emulateStatus.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.status[name];});$.each($.jPlayer.emulateOptions.split(/\s+/g),function(i,name){self.internal.domNode[name]=self.options[name];});},_destroyHtmlBridge:function(){var self=this;this.element.unbind(".jPlayerHtml");var emulated=$.jPlayer.emulateMethods+" "+$.jPlayer.emulateStatus+" "+$.jPlayer.emulateOptions;$.each(emulated.split(/\s+/g),function(i,name){delete self.internal.domNode[name];});}};$.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};$.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+$.jPlayer.prototype.version.script+" needs Jplayer.swf version "+$.jPlayer.prototype.version.needFlash+" but found "};$.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};$.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};$.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};$.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."};}));;(function($,undefined){jPlayerPlaylist=function(cssSelector,playlist,options){var self=this;this.active=false;this.current=0;this.loop=false;this.shuffled=false;this.removing=false;this.cssSelector=$.extend({},this._cssSelector,cssSelector);this.options=$.extend(true,{},this._options,options);this.playlist=[];this.original=[];this._initPlaylist(playlist);this.cssSelector.title=this.cssSelector.cssSelectorAncestor+" .jp-title";if(this.options.playlistOptions.playlistSelector){this.cssSelector.playlist=this.options.playlistOptions.playlistSelector;}else{this.cssSelector.playlist=this.cssSelector.cssSelectorAncestor+" .jp-playlist";}
this.cssSelector.next=this.cssSelector.cssSelectorAncestor+" .jp-next";this.cssSelector.previous=this.cssSelector.cssSelectorAncestor+" .jp-previous";this.cssSelector.shuffle=this.cssSelector.cssSelectorAncestor+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelector.cssSelectorAncestor+" .jp-shuffle-off";this.options.cssSelectorAncestor=this.cssSelector.cssSelectorAncestor;this.options.repeat=function(event){self.loop=event.jPlayer.options.loop;};$(this.cssSelector.jPlayer).bind($.jPlayer.event.play,function(event){$(this).jPlayer("pauseOthers");});$(this.cssSelector.jPlayer).bind($.jPlayer.event.resize,function(event){if(event.jPlayer.options.fullScreen){$(self.cssSelector.title).show();}else{$(self.cssSelector.title).hide();}});if(!this.options.fullScreen){$(this.cssSelector.title).hide();}
$(this.cssSelector.playlist+" ul.playlist-container-list").empty();this._createItemHandlers();};jPlayerPlaylist.prototype={_cssSelector:{jPlayer:"#jquery_jplayer_1",cssSelectorAncestor:"#jp_container_1"},_options:{playlistOptions:{autoPlay:false,loopOnPrevious:false,shuffleOnLoop:true,enableRemoveControls:false,displayTime:'slow',addTime:'fast',removeTime:'fast',shuffleTime:'slow',itemClass:"jp-playlist-item",freeGroupClass:"jp-free-media",freeItemClass:"jp-playlist-item-free",removeItemClass:"jp-playlist-item-remove",actionItemClass:"jp-playlist-item-action",parentFolderItemClass:"jp-playlist-item-show-parent-folder",playlistSelector:false,playtimeClass:"jp-playlist-playtime",},hooks:{"setMedia":function(track){return track},},},option:function(option,value){if(value===undefined){return this.options.playlistOptions[option];}
this.options.playlistOptions[option]=value;switch(option){case"enableRemoveControls":this._updateControls();break;case"itemClass":case"freeGroupClass":case"freeItemClass":case"removeItemClass":this._refresh(true);this._createItemHandlers();break;}
return this;},_init:function(){var self=this;this._refresh(function(){if(self.options.playlistOptions.autoPlay){self.play(self.current);}});},_initPlaylist:function(playlist){for(var i=0;i<playlist.length;i++){if(typeof playlist[i].wasPlayed==='undefined'){playlist[i].wasPlayed=0;}}
this.current=0;this.shuffled=false;this.removing=false;this.original=$.extend(true,[],playlist);this._originalPlaylist();},_originalPlaylist:function(){var self=this;this.playlist=[];$.each(this.original,function(i,v){self.playlist[i]=self.original[i];});},_refresh:function(instant){var self=this;if(instant&&!$.isFunction(instant)){$(this.cssSelector.playlist+" ul.playlist-container-list").empty();$.each(this.playlist,function(i,v){$(self.cssSelector.playlist+" ul.playlist-container-list").append(self._createListItem(self.playlist[i]));var litem=$(self.cssSelector.playlist+" > ul > li:last");litem.attr('name',litem.index());});this._updateControls();}else{var displayTime=$(this.cssSelector.playlist+" ul.playlist-container-list").children().length?this.options.playlistOptions.displayTime:0;$(this.cssSelector.playlist+" ul.playlist-container-list").slideUp(displayTime,function(){var $this=$(this);$(this).empty();$.each(self.playlist,function(i,v){$this.append(self._createListItem(self.playlist[i]));var litem=$(self.cssSelector.playlist+" > ul.playlist-container-list > li:last");litem.attr('name',litem.index());});self._updateControls();if($.isFunction(instant)){instant();}
if(self.playlist.length){$(this).slideDown(self.options.playlistOptions.displayTime);}else{$(this).show();}});}
this._updatePlaytime();this._highlight(this.current);this._createItemHandlers();},_updatePlaytime:function(){var self=this;var playtimeSum=0;$.each(this.playlist,function(i,v){if(self.playlist[i].duration){playtimeSum+=self.playlist[i].duration;}});if(playtimeSum){$(self.cssSelector.playlist+"-playtime-sum").html("<div><span href='javascript:;'>"+self._formatTime(playtimeSum)+"</span></div>");}else{$(self.cssSelector.playlist+"-playtime-sum").html("");}},_formatTime:function(secs){secs=Math.floor(secs);var mins=Math.floor(secs/60);var hours=Math.floor(mins/60);var s=secs%60;if(s<10){s='0'+s;}
var m=mins%60;if(m<10){m='0'+m;}
var h=hours>0?hours+':':'';return h+m+':'+s;},_createListItem:function(media){var self=this;var listItem="<li><div>";listItem+='<div class="btn-group '+this.options.playlistOptions.actionItemClass+'">'+'  <button type="button" class="btn-transparent btn-xs dropdown-toggle" data-toggle="dropdown">'+'    <span class="caret"></span>'+'  </button>'+'  <ul class="dropdown-menu" role="menu">'+'    <li><a class="'+this.options.playlistOptions.parentFolderItemClass+'" href="#">Show parent folder</a></li>'+'  </ul>'+'</div>';if(media.duration){listItem+="<span href='javascript:;' class='"+this.options.playlistOptions.playtimeClass+"'>"+self._formatTime(media.duration)+"</span>";}
listItem+="<a href='javascript:;' class='"+this.options.playlistOptions.removeItemClass+"'>&times;</a>";if(media.free){var first=true;listItem+="<span class='"+this.options.playlistOptions.freeGroupClass+"'>(";$.each(media,function(property,value){if($.jPlayer.prototype.format[property]){if(first){first=false;}else{listItem+=" | ";}
listItem+="<a class='"+self.options.playlistOptions.freeItemClass+"' href='"+value+"' tabindex='1'>"+property+"</a>";}});listItem+=")</span>";}
listItem+="<a href='javascript:;' class='"+this.options.playlistOptions.itemClass+"' tabindex='1'>"+media.title+(media.artist?" <span class='jp-artist'>by "+media.artist+"</span>":"")+"</a>";listItem+="</div></li>";return listItem;},_createItemHandlers:function(){var self=this;$(this.cssSelector.playlist+" a."+this.options.playlistOptions.itemClass).off("click").on("click",function(){$(self.options.playlistOptions.playlistSelector).trigger('requestPlay',[self.options.playlistOptions.playlistSelector]);var index=$(this).parent().parent().index();self.play(index);$(this).blur();return false;});$(self.cssSelector.playlist+" a."+this.options.playlistOptions.freeItemClass).off("click").on("click",function(event){$(this).parent().parent().find("."+self.options.playlistOptions.itemClass).click();$(this).blur();return false;});$(self.cssSelector.playlist+" a."+this.options.playlistOptions.removeItemClass).off("click").on("click",function(event){event.stopPropagation();var index=$(this).parent().parent().index();self.remove(index);$(this).blur();return false;});$(self.cssSelector.playlist+" a."+this.options.playlistOptions.parentFolderItemClass).off('click').on("click",function(event){var index=$(this).parent().parent().parent().parent().parent().index();var folder=decodeURIComponent(self.playlist[index].url);lastFolderSeparator=folder.lastIndexOf('/');if(lastFolderSeparator==-1){folder='';}else{folder=folder.slice(0,lastFolderSeparator);}
loadBrowser(folder,folder);});},_updateControls:function(){if(this.options.playlistOptions.enableRemoveControls){$(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).show();}else{$(this.cssSelector.playlist+" ."+this.options.playlistOptions.removeItemClass).hide();}
if(this.shuffled){$(this.cssSelector.shuffleOff).show();$(this.cssSelector.shuffle).hide();}else{$(this.cssSelector.shuffleOff).hide();$(this.cssSelector.shuffle).show();}},_highlight:function(index){if(this.playlist.length&&index!==undefined){$(this.cssSelector.playlist+" .jp-playlist-current").removeClass("jp-playlist-current");$(this.cssSelector.playlist+">ul>li:nth-child("+(index+1)+")").addClass("jp-playlist-current").find(".jp-playlist-item").addClass("jp-playlist-current");$(this.cssSelector.title+" li").html(this.playlist[index].title+(this.playlist[index].artist?" <span class='jp-artist'>by "+this.playlist[index].artist+"</span>":""));}},setPlaylist:function(playlist){this._initPlaylist(playlist);this._init();},add:function(media,playNow,animate){var self=this;if(typeof animate==='undefined'){animate=true;}
if(animate){$(this.cssSelector.playlist+" ul.playlist-container-list").append(this._createListItem(media)).find("li:last-child").hide().slideDown(this.options.playlistOptions.addTime);}else{$(this.cssSelector.playlist+" ul.playlist-container-list").append(this._createListItem(media));}
this._updateControls();this._createItemHandlers();this.original.push(media);this.playlist.push(media);if(playNow){this.play(this.playlist.length-1);}
$(self.options.playlistOptions.playlistSelector).trigger('addedItem',[self.options.playlistOptions.playlistSelector]);},remove:function(index){var self=this;$(self.options.playlistOptions.playlistSelector).trigger('removedItem',[self.options.playlistOptions.playlistSelector]);if(index===undefined){this._initPlaylist([]);this._refresh(function(){if(self.active){$(self.cssSelector.jPlayer).jPlayer("clearMedia");}});return true;}else{if(this.removing){return false;}else{index=(index<0)?self.original.length+index:index;if(0<=index&&index<this.playlist.length){this.removing=true;$(this.cssSelector.playlist+">ul>li:nth-child("+(index+1)+")").slideUp(this.options.playlistOptions.removeTime,function(){$(this).remove();if(self.shuffled){var item=self.playlist[index];$.each(self.original,function(i,v){if(self.original[i]===item){self.original.splice(i,1);return false;}});self.playlist.splice(index,1);}else{self.original.splice(index,1);self.playlist.splice(index,1);}
if(self.original.length){if(index===self.current){self.current=(index<self.original.length)?self.current:self.original.length-1;self.select(self.current);}else if(index<self.current){self.current--;}}else{$(self.cssSelector.jPlayer).jPlayer("clearMedia");self.current=0;self.shuffled=false;self._updateControls();}
self._updatePlaytime();self.removing=false;self._refresh(true);});}
return true;}}},select:function(index){index=(index<0)?this.original.length+index:index;if(0<=index&&index<this.playlist.length){this.current=index;this._highlight(index);this.playlist[this.current].wasPlayed+=1;var self=this;$(this.cssSelector.jPlayer).jPlayer("setMedia",self.options.hooks["setMedia"](this.playlist[this.current]));}else{this.current=0;}},play:function(index){index=(index<0)?this.original.length+index:index;if(0<=index&&index<this.playlist.length){if(this.playlist.length){this.select(index);$(this.cssSelector.jPlayer).jPlayer("play");}}else if(index===undefined){$(this.cssSelector.jPlayer).jPlayer("play");}},pause:function(){$(this.cssSelector.jPlayer).jPlayer("pause");},next:function(){if(this.shuffled){playRandomTrack();}else{var index=(this.current+1<this.playlist.length)?this.current+1:0;if(this.loop||index>0){this.play(index);}}},playRandomTrack:function(){var weighted=[];for(var i=0;i<this.playlist.length;i++){if(typeof this.playlist[i].wasPlayed==='undefined'){this.playlist.wasPlayed[i]=0;}
weighted.push([i,this.playlist[i].wasPlayed]);}
weighted.sort(function(a,b){return a[1]-b[1]});var index=weighted[parseInt(Math.random()*this.playlist.length/2)][0];this.play(index);},previous:function(){if(this.shuffled){playRandomTrack();}else{var index=(this.current-1>=0)?this.current-1:this.playlist.length-1;if(this.loop&&this.options.playlistOptions.loopOnPrevious||index<this.playlist.length-1){this.play(index);}}},shuffle:function(shuffled,playNow){this.shuffled=!this.shuffled;this._updateControls();},scan:function(){var self=this;var isAdjusted=false;var replace=[];$.each($(this.cssSelector.playlist+" > ul.playlist-container-list > li"),function(index,value){replace[index]=self.original[$(value).attr('name')];if(!isAdjusted&&self.current===parseInt($(value).attr('name'),10)){self.current=index;isAdjusted=true;}
$(value).attr('name',index);});this.original=replace;this._originalPlaylist();$(self.options.playlistOptions.playlistSelector).trigger('sortedItems',[self.options.playlistOptions.playlistSelector]);}};})(jQuery);;(function($,undefined){$.jPlayerInspector={};$.jPlayerInspector.i=0;$.jPlayerInspector.defaults={jPlayer:undefined,idPrefix:"jplayer_inspector_",visible:false};var methods={init:function(options){var self=this;var $this=$(this);var config=$.extend({},$.jPlayerInspector.defaults,options);$(this).data("jPlayerInspector",config);config.id=$(this).attr("id");config.jPlayerId=config.jPlayer.attr("id");config.windowId=config.idPrefix+"window_"+$.jPlayerInspector.i;config.statusId=config.idPrefix+"status_"+$.jPlayerInspector.i;config.configId=config.idPrefix+"config_"+$.jPlayerInspector.i;config.toggleId=config.idPrefix+"toggle_"+$.jPlayerInspector.i;config.eventResetId=config.idPrefix+"event_reset_"+$.jPlayerInspector.i;config.updateId=config.idPrefix+"update_"+$.jPlayerInspector.i;config.eventWindowId=config.idPrefix+"event_window_"+$.jPlayerInspector.i;config.eventId={};config.eventJq={};config.eventTimeout={};config.eventOccurrence={};$.each($.jPlayer.event,function(eventName,eventType){config.eventId[eventType]=config.idPrefix+"event_"+eventName+"_"+$.jPlayerInspector.i;config.eventOccurrence[eventType]=0;});var structure='<p><a href="#" id="'+config.toggleId+'">'+(config.visible?"Hide":"Show")+'</a> jPlayer Inspector</p>'
+'<div id="'+config.windowId+'">'
+'<div id="'+config.statusId+'"></div>'
+'<div id="'+config.eventWindowId+'" style="padding:5px 5px 0 5px;background-color:#eee;border:1px dotted #000;">'
+'<p style="margin:0 0 10px 0;"><strong>jPlayer events that have occurred over the past 1 second:</strong>'
+'<br />(Backgrounds: <span style="padding:0 5px;background-color:#eee;border:1px dotted #000;">Never occurred</span> <span style="padding:0 5px;background-color:#fff;border:1px dotted #000;">Occurred before</span> <span style="padding:0 5px;background-color:#9f9;border:1px dotted #000;">Occurred</span> <span style="padding:0 5px;background-color:#ff9;border:1px dotted #000;">Multiple occurrences</span> <a href="#" id="'+config.eventResetId+'">reset</a>)</p>';var eventStyle="float:left;margin:0 5px 5px 0;padding:0 5px;border:1px dotted #000;";structure+='<div id="'+config.eventId[$.jPlayer.event.ready]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.flashreset]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.resize]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.repeat]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.click]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.error]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.warning]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.loadstart]+'" style="clear:left;'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.progress]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.timeupdate]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.volumechange]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.play]+'" style="clear:left;'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.pause]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.waiting]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.playing]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.seeking]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.seeked]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.ended]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.loadeddata]+'" style="clear:left;'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.loadedmetadata]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.canplay]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.canplaythrough]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.suspend]+'" style="clear:left;'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.abort]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.emptied]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.stalled]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.ratechange]+'" style="'+eventStyle+'"></div>'
+'<div id="'+config.eventId[$.jPlayer.event.durationchange]+'" style="'+eventStyle+'"></div>'
+'<div style="clear:both"></div>';structure+='</div>'
+'<p><a href="#" id="'+config.updateId+'">Update</a> jPlayer Inspector</p>'
+'<div id="'+config.configId+'"></div>'
+'</div>';$(this).html(structure);config.windowJq=$("#"+config.windowId);config.statusJq=$("#"+config.statusId);config.configJq=$("#"+config.configId);config.toggleJq=$("#"+config.toggleId);config.eventResetJq=$("#"+config.eventResetId);config.updateJq=$("#"+config.updateId);$.each($.jPlayer.event,function(eventName,eventType){config.eventJq[eventType]=$("#"+config.eventId[eventType]);config.eventJq[eventType].text(eventName+" ("+config.eventOccurrence[eventType]+")");config.jPlayer.bind(eventType+".jPlayerInspector",function(e){config.eventOccurrence[e.type]++;if(config.eventOccurrence[e.type]>1){config.eventJq[e.type].css("background-color","#ff9");}else{config.eventJq[e.type].css("background-color","#9f9");}
config.eventJq[e.type].text(eventName+" ("+config.eventOccurrence[e.type]+")");clearTimeout(config.eventTimeout[e.type]);config.eventTimeout[e.type]=setTimeout(function(){config.eventJq[e.type].css("background-color","#fff");},1000);setTimeout(function(){config.eventOccurrence[e.type]--;config.eventJq[e.type].text(eventName+" ("+config.eventOccurrence[e.type]+")");},1000);if(config.visible){$this.jPlayerInspector("updateStatus");}});});config.jPlayer.bind($.jPlayer.event.ready+".jPlayerInspector",function(e){$this.jPlayerInspector("updateConfig");});config.toggleJq.click(function(){if(config.visible){$(this).text("Show");config.windowJq.hide();config.statusJq.empty();config.configJq.empty();}else{$(this).text("Hide");config.windowJq.show();config.updateJq.click();}
config.visible=!config.visible;$(this).blur();return false;});config.eventResetJq.click(function(){$.each($.jPlayer.event,function(eventName,eventType){config.eventJq[eventType].css("background-color","#eee");});$(this).blur();return false;});config.updateJq.click(function(){$this.jPlayerInspector("updateStatus");$this.jPlayerInspector("updateConfig");return false;});if(!config.visible){config.windowJq.hide();}else{}
$.jPlayerInspector.i++;return this;},destroy:function(){$(this).data("jPlayerInspector")&&$(this).data("jPlayerInspector").jPlayer.unbind(".jPlayerInspector");$(this).empty();},updateConfig:function(){var jPlayerInfo="<p>This jPlayer instance is running in your browser where:<br />"
for(i=0;i<$(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions.length;i++){var solution=$(this).data("jPlayerInspector").jPlayer.data("jPlayer").solutions[i];jPlayerInfo+="&nbsp;jPlayer's <strong>"+solution+"</strong> solution is";if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].used){jPlayerInfo+=" being <strong>used</strong> and will support:<strong>";for(format in $(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support){if($(this).data("jPlayerInspector").jPlayer.data("jPlayer")[solution].support[format]){jPlayerInfo+=" "+format;}}
jPlayerInfo+="</strong><br />";}else{jPlayerInfo+=" <strong>not required</strong><br />";}}
jPlayerInfo+="</p>";if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.active){if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active){jPlayerInfo+="<strong>Problem with jPlayer since both HTML5 and Flash are active.</strong>";}else{jPlayerInfo+="The <strong>HTML5 is active</strong>.";}}else{if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").flash.active){jPlayerInfo+="The <strong>Flash is active</strong>.";}else{jPlayerInfo+="No solution is currently active. jPlayer needs a setMedia().";}}
jPlayerInfo+="</p>";var formatType=$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.formatType;jPlayerInfo+="<p><code>status.formatType = '"+formatType+"'</code><br />";if(formatType){jPlayerInfo+="<code>Browser canPlay('"+$.jPlayer.prototype.format[formatType].codec+"')</code>";}else{jPlayerInfo+="</p>";}
jPlayerInfo+="<p><code>status.src = '"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.src+"'</code></p>";jPlayerInfo+="<p><code>status.media = {<br />";for(prop in $(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media){jPlayerInfo+="&nbsp;"+prop+": "+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.media[prop]+"<br />";}
jPlayerInfo+="};</code></p>"
+"<p>Raw browser test for HTML5 support. Should equal a function if HTML5 is available.<br />";if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.audio.available){jPlayerInfo+="<code>htmlElement.audio.canPlayType = "+(typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.audio.canPlayType)+"</code><br />"}
if($(this).data("jPlayerInspector").jPlayer.data("jPlayer").html.video.available){jPlayerInfo+="<code>htmlElement.video.canPlayType = "+(typeof $(this).data("jPlayerInspector").jPlayer.data("jPlayer").htmlElement.video.canPlayType)+"</code>";}
jPlayerInfo+="</p>";jPlayerInfo+="<p>This instance is using the constructor options:<br />"
+"<code>$('#"+$(this).data("jPlayerInspector").jPlayer.data("jPlayer").internal.self.id+"').jPlayer({<br />"
+"&nbsp;swfPath: '"+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","swfPath")+"',<br />"
+"&nbsp;solution: '"+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","solution")+"',<br />"
+"&nbsp;supplied: '"+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","supplied")+"',<br />"
+"&nbsp;preload: '"+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","preload")+"',<br />"
+"&nbsp;volume: "+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","volume")+",<br />"
+"&nbsp;muted: "+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","muted")+",<br />"
+"&nbsp;backgroundColor: '"+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","backgroundColor")+"',<br />"
+"&nbsp;cssSelectorAncestor: '"+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","cssSelectorAncestor")+"',<br />"
+"&nbsp;cssSelector: {";var cssSelector=$(this).data("jPlayerInspector").jPlayer.jPlayer("option","cssSelector");for(prop in cssSelector){jPlayerInfo+="<br />&nbsp;&nbsp;"+prop+": '"+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","cssSelector."+prop)+"',"}
jPlayerInfo=jPlayerInfo.slice(0,-1);jPlayerInfo+="<br />&nbsp;},<br />"
+"&nbsp;errorAlerts: "+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","errorAlerts")+",<br />"
+"&nbsp;warningAlerts: "+$(this).data("jPlayerInspector").jPlayer.jPlayer("option","warningAlerts")+"<br />"
+"});</code></p>";$(this).data("jPlayerInspector").configJq.html(jPlayerInfo);return this;},updateStatus:function(){$(this).data("jPlayerInspector").statusJq.html("<p>jPlayer is "+
($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.paused?"paused":"playing")+" at time: "+Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentTime*10)/10+"s."+" (d: "+Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.duration*10)/10+"s"+", sp: "+Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.seekPercent)+"%"+", cpr: "+Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentRelative)+"%"+", cpa: "+Math.floor($(this).data("jPlayerInspector").jPlayer.data("jPlayer").status.currentPercentAbsolute)+"%)</p>");return this;}};$.fn.jPlayerInspector=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.jPlayerInspector');}};})(jQuery);;/*!
  mustache.js - Logic-less {{mustache}} templates with JavaScript
  http://github.com/janl/mustache.js
 */var Mustache;(function(exports){if(typeof module!=="undefined"&&module.exports){module.exports=exports;}else if(typeof define==="function"){define(exports);}else{Mustache=exports;}}((function(){var exports={};exports.name="mustache.js";exports.version="0.7.0";exports.tags=["{{","}}"];exports.Scanner=Scanner;exports.Context=Context;exports.Writer=Writer;var whiteRe=/\s*/;var spaceRe=/\s+/;var nonSpaceRe=/\S/;var eqRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function testRe(re,string){return RegExp.prototype.test.call(re,string);}
function isWhitespace(string){return!testRe(nonSpaceRe,string);}
var isArray=Array.isArray||function(obj){return Object.prototype.toString.call(obj)==="[object Array]";};function escapeRe(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");}
var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':'&quot;',"'":'&#39;',"/":'&#x2F;'};function escapeHtml(string){return String(string).replace(/[&<>"'\/]/g,function(s){return entityMap[s];});}
exports.escape=escapeHtml;function Scanner(string){this.string=string;this.tail=string;this.pos=0;}
Scanner.prototype.eos=function(){return this.tail==="";};Scanner.prototype.scan=function(re){var match=this.tail.match(re);if(match&&match.index===0){this.tail=this.tail.substring(match[0].length);this.pos+=match[0].length;return match[0];}
return"";};Scanner.prototype.scanUntil=function(re){var match,pos=this.tail.search(re);switch(pos){case-1:match=this.tail;this.pos+=this.tail.length;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,pos);this.tail=this.tail.substring(pos);this.pos+=pos;}
return match;};function Context(view,parent){this.view=view;this.parent=parent;this.clearCache();}
Context.make=function(view){return(view instanceof Context)?view:new Context(view);};Context.prototype.clearCache=function(){this._cache={};};Context.prototype.push=function(view){return new Context(view,this);};Context.prototype.lookup=function(name){var value=this._cache[name];if(!value){if(name==="."){value=this.view;}else{var context=this;while(context){if(name.indexOf(".")>0){var names=name.split("."),i=0;value=context.view;while(value&&i<names.length){value=value[names[i++]];}}else{value=context.view[name];}
if(value!=null){break;}
context=context.parent;}}
this._cache[name]=value;}
if(typeof value==="function"){value=value.call(this.view);}
return value;};function Writer(){this.clearCache();}
Writer.prototype.clearCache=function(){this._cache={};this._partialCache={};};Writer.prototype.compile=function(template,tags){return this._compile(this._cache,template,template,tags);};Writer.prototype.compilePartial=function(name,template,tags){return this._compile(this._partialCache,name,template,tags);};Writer.prototype.render=function(template,view,partials){return this.compile(template)(view,partials);};Writer.prototype._compile=function(cache,key,template,tags){if(!cache[key]){var tokens=exports.parse(template,tags);var fn=compileTokens(tokens);var self=this;cache[key]=function(view,partials){if(partials){if(typeof partials==="function"){self._loadPartial=partials;}else{for(var name in partials){self.compilePartial(name,partials[name]);}}}
return fn(self,Context.make(view),template);};}
return cache[key];};Writer.prototype._section=function(name,context,text,callback){var value=context.lookup(name);switch(typeof value){case"object":if(isArray(value)){var buffer="";for(var i=0,len=value.length;i<len;++i){buffer+=callback(this,context.push(value[i]));}
return buffer;}
return value?callback(this,context.push(value)):"";case"function":var self=this;var scopedRender=function(template){return self.render(template,context);};return value.call(context.view,text,scopedRender)||"";default:if(value){return callback(this,context);}}
return"";};Writer.prototype._inverted=function(name,context,callback){var value=context.lookup(name);if(!value||(isArray(value)&&value.length===0)){return callback(this,context);}
return"";};Writer.prototype._partial=function(name,context){if(!(name in this._partialCache)&&this._loadPartial){this.compilePartial(name,this._loadPartial(name));}
var fn=this._partialCache[name];return fn?fn(context):"";};Writer.prototype._name=function(name,context){var value=context.lookup(name);if(typeof value==="function"){value=value.call(context.view);}
return(value==null)?"":String(value);};Writer.prototype._escaped=function(name,context){return exports.escape(this._name(name,context));};function sectionBounds(token){var start=token[3];var end=start;var tokens;while((tokens=token[4])&&tokens.length){token=tokens[tokens.length-1];end=token[3];}
return[start,end];}
function compileTokens(tokens){var subRenders={};function subRender(i,tokens,template){if(!subRenders[i]){var fn=compileTokens(tokens);subRenders[i]=function(writer,context){return fn(writer,context,template);};}
return subRenders[i];}
function renderFunction(writer,context,template){var buffer="";var token,sectionText;for(var i=0,len=tokens.length;i<len;++i){token=tokens[i];switch(token[0]){case"#":sectionText=template.slice.apply(template,sectionBounds(token));buffer+=writer._section(token[1],context,sectionText,subRender(i,token[4],template));break;case"^":buffer+=writer._inverted(token[1],context,subRender(i,token[4],template));break;case">":buffer+=writer._partial(token[1],context);break;case"&":buffer+=writer._name(token[1],context);break;case"name":buffer+=writer._escaped(token[1],context);break;case"text":buffer+=token[1];break;}}
return buffer;}
return renderFunction;}
function nestTokens(tokens){var tree=[];var collector=tree;var sections=[];var token,section;for(var i=0;i<tokens.length;++i){token=tokens[i];switch(token[0]){case"#":case"^":token[4]=[];sections.push(token);collector.push(token);collector=token[4];break;case"/":if(sections.length===0){throw new Error("Unopened section: "+token[1]);}
section=sections.pop();if(section[1]!==token[1]){throw new Error("Unclosed section: "+section[1]);}
if(sections.length>0){collector=sections[sections.length-1][4];}else{collector=tree;}
break;default:collector.push(token);}}
section=sections.pop();if(section){throw new Error("Unclosed section: "+section[1]);}
return tree;}
function squashTokens(tokens){var token,lastToken;for(var i=0;i<tokens.length;++i){token=tokens[i];if(lastToken&&lastToken[0]==="text"&&token[0]==="text"){lastToken[1]+=token[1];lastToken[3]=token[3];tokens.splice(i--,1);}else{lastToken=token;}}}
function escapeTags(tags){if(tags.length!==2){throw new Error("Invalid tags: "+tags.join(" "));}
return[new RegExp(escapeRe(tags[0])+"\\s*"),new RegExp("\\s*"+escapeRe(tags[1]))];}
exports.parse=function(template,tags){tags=tags||exports.tags;var tagRes=escapeTags(tags);var scanner=new Scanner(template);var tokens=[],spaces=[],hasTag=false,nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length){tokens.splice(spaces.pop(),1);}}else{spaces=[];}
hasTag=false;nonSpace=false;}
var start,type,value,chr;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(tagRes[0]);if(value){for(var i=0,len=value.length;i<len;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length);}else{nonSpace=true;}
tokens.push(["text",chr,start,start+1]);start+=1;if(chr==="\n"){stripSpace();}}}
start=scanner.pos;if(!scanner.scan(tagRes[0])){break;}
hasTag=true;type=scanner.scan(tagRe)||"name";scanner.scan(whiteRe);if(type==="="){value=scanner.scanUntil(eqRe);scanner.scan(eqRe);scanner.scanUntil(tagRes[1]);}else if(type==="{"){var closeRe=new RegExp("\\s*"+escapeRe("}"+tags[1]));value=scanner.scanUntil(closeRe);scanner.scan(curlyRe);scanner.scanUntil(tagRes[1]);type="&";}else{value=scanner.scanUntil(tagRes[1]);}
if(!scanner.scan(tagRes[1])){throw new Error("Unclosed tag at "+scanner.pos);}
tokens.push([type,value,start,scanner.pos]);if(type==="name"||type==="{"||type==="&"){nonSpace=true;}
if(type==="="){tags=value.split(spaceRe);tagRes=escapeTags(tags);}}
squashTokens(tokens);return nestTokens(tokens);};var _writer=new Writer();exports.clearCache=function(){return _writer.clearCache();};exports.compile=function(template,tags){return _writer.compile(template,tags);};exports.compilePartial=function(name,template,tags){return _writer.compilePartial(name,template,tags);};exports.render=function(template,view,partials){return _writer.render(template,view,partials);};exports.to_html=function(template,view,partials,send){var result=exports.render(template,view,partials);if(typeof send==="function"){send(result);}else{return result;}};return exports;}())));;/*! jQuery UI - v1.11.1 - 2014-09-18
 http://jqueryui.com
 Includes: core.js, widget.js, mouse.js, sortable.js
 Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{factory(jQuery);}}(function($){/*!
  jQuery UI Core 1.11.1
  http://jqueryui.com
 
  Copyright 2014 jQuery Foundation and other contributors
  Released under the MIT license.
  http://jquery.org/license
 
  http://api.jqueryui.com/category/ui-core/
 */$.ui=$.ui||{};$.extend($.ui,{version:"1.11.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});$.fn.extend({scrollParent:function(includeHidden){var position=this.css("position"),excludeStaticParent=position==="absolute",overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);if(excludeStaticParent&&parent.css("position")==="static"){return false;}
return overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css("overflow-x"));}).eq(0);return position==="fixed"||!scrollParent.length?$(this[0].ownerDocument||document):scrollParent;},uniqueId:(function(){var uuid=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid);}});};})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){$(this).removeAttr("id");}});}});function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false;}
img=$("img[usemap='#"+mapName+"']")[0];return!!img&&visible(img);}
return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element);}
function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return $.css(this,"visibility")==="hidden";}).length;}
$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")));},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN);}});if(!$("<a>").outerWidth(1).jquery){$.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0;if(border){size-=parseFloat($.css(elem,"border"+this+"Width"))||0;}
if(margin){size-=parseFloat($.css(elem,"margin"+this))||0;}});return size;}
$.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this);}
return this.each(function(){$(this).css(type,reduce(this,size)+"px");});};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size);}
return this.each(function(){$(this).css(type,reduce(this,size,true,margin)+"px");});};});}
if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};}
if($("<a>").data("a-b","a").removeData("a-b").data("a-b")){$.fn.removeData=(function(removeData){return function(key){if(arguments.length){return removeData.call(this,$.camelCase(key));}else{return removeData.call(this);}};})($.fn.removeData);}
$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());$.fn.extend({focus:(function(orig){return function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();if(fn){fn.call(elem);}},delay);}):orig.apply(this,arguments);};})($.fn.focus),disableSelection:(function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(eventType+".ui-disableSelection",function(event){event.preventDefault();});};})(),enableSelection:function(){return this.unbind(".ui-disableSelection");},zIndex:function(zIndex){if(zIndex!==undefined){return this.css("zIndex",zIndex);}
if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}}
elem=elem.parent();}}
return 0;}});$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(!set){return;}
if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11)){return;}
for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}};/*!
  jQuery UI Widget 1.11.1
  http://jqueryui.com
 
  Copyright 2014 jQuery Foundation and other contributors
  Released under the MIT license.
  http://jquery.org/license
 
  http://api.jqueryui.com/jQuery.widget/
 */var widget_uuid=0,widget_slice=Array.prototype.slice;$.cleanData=(function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove");}}catch(e){}}
orig(elems);};})($.cleanData);$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}
$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element);}
if(arguments.length){this._createWidget(options,element);}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(!$.isFunction(value)){proxiedPrototype[prop]=value;return;}
proxiedPrototype[prop]=(function(){var _super=function(){return base.prototype[prop].apply(this,arguments);},_superApply=function(args){return base.prototype[prop].apply(this,args);};return function(){var __super=this._super,__superApply=this._superApply,returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue;};})();});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?(basePrototype.widgetEventPrefix||name):name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto);});delete existingConstructor._childConstructors;}else{base._childConstructors.push(constructor);}
$.widget.bridge(name,constructor);return constructor;};$.widget.extend=function(target){var input=widget_slice.call(arguments,1),inputIndex=0,inputLength=input.length,key,value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}}
return target;};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=widget_slice.call(arguments,1),returnValue=this;options=!isMethodCall&&args.length?$.widget.extend.apply(null,[options].concat(args)):options;if(isMethodCall){this.each(function(){var methodValue,instance=$.data(this,fullName);if(options==="instance"){returnValue=instance;return false;}
if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'");}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}else{this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{$.data(this,fullName,new object(options,this));}});}
return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=widget_uuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this.bindings=$();this.hoverable=$();this.focusable=$();if(element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{remove:function(event){if(event.target===element){this.destroy();}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow);}
this._create();this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");},_destroy:$.noop,widget:function(){return this.element;},option:function(key,value){var options=key,parts,curOption,i;if(arguments.length===0){return $.widget.extend({},this.options);}
if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]];}
key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key];}
curOption[key]=value;}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key];}
options[key]=value;}}
this._setOptions(options);return this;},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key]);}
return this;},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled",!!value);if(value){this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");}}
return this;},enable:function(){return this._setOptions({disabled:false});},disable:function(){return this._setOptions({disabled:true});},_on:function(suppressDisabledCheck,element,handlers){var delegateElement,instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=false;}
if(!handlers){handlers=element;element=this.element;delegateElement=this.widget();}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element);}
$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return;}
return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++;}
var match=event.match(/^([\w:-]*)\s*(.*)$/),eventName=match[1]+instance.eventNamespace,selector=match[2];if(selector){delegateElement.delegate(selector,eventName,handlerProxy);}else{element.bind(eventName,handlerProxy);}});},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;element.unbind(eventName).undelegate(eventName);},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
var instance=this;return setTimeout(handlerProxy,delay||0);},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){$(event.currentTarget).addClass("ui-state-hover");},mouseleave:function(event){$(event.currentTarget).removeClass("ui-state-hover");}});},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){$(event.currentTarget).addClass("ui-state-focus");},focusout:function(event){$(event.currentTarget).removeClass("ui-state-focus");}});},_trigger:function(type,event,data){var prop,orig,callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop];}}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented());}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options};}
var hasOptions,effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options};}
hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay);}
if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options);}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback);}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0]);}
next();});}};});var widget=$.widget;/*!
  jQuery UI Mouse 1.11.1
  http://jqueryui.com
 
  Copyright 2014 jQuery Foundation and other contributors
  Released under the MIT license.
  http://jquery.org/license
 
  http://api.jqueryui.com/mouse/
 */var mouseHandled=false;$(document).mouseup(function(){mouseHandled=false;});var mouse=$.widget("ui.mouse",{version:"1.11.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.bind("mousedown."+this.widgetName,function(event){return that._mouseDown(event);}).bind("click."+this.widgetName,function(event){if(true===$.data(event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);}},_mouseDown:function(event){if(mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var that=this,btnIsLeft=(event.which===1),elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
if(true===$.data(event.target,this.widgetName+".preventClickEvent")){$.removeData(event.target,this.widgetName+".preventClickEvent");}
this._mouseMoveDelegate=function(event){return that._mouseMove(event);};this._mouseUpDelegate=function(event){return that._mouseUp(event);};this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();mouseHandled=true;return true;},_mouseMove:function(event){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button){return this._mouseUp(event);}else if(!event.which){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(event.target===this._mouseDownEvent.target){$.data(event.target,this.widgetName+".preventClickEvent",true);}
this._mouseStop(event);}
mouseHandled=false;return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(){return this.mouseDelayMet;},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}});/*!
  jQuery UI Sortable 1.11.1
  http://jqueryui.com
 
  Copyright 2014 jQuery Foundation and other contributors
  Released under the MIT license.
  http://jquery.org/license
 
  http://api.jqueryui.com/sortable/
 */var sortable=$.widget("ui.sortable",$.ui.mouse,{version:"1.11.1",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return(x>=reference)&&(x<(reference+size));},_isFloating:function(item){return(/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display"));},_create:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?o.axis==="x"||this._isFloating(this.items[0].item):false;this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true;},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._setHandleClassName();}},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");$.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle");});},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData(this.widgetName+"-item");}
return this;},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=false,that=this;if(this.reverting){return false;}
if(this.options.disabled||this.options.type==="static"){return false;}
this._refreshItems(event);$(event.target).parents().each(function(){if($.data(this,that.widgetName+"-item")===that){currentItem=$(this);return false;}});if($.data(event.target,that.widgetName+"-item")===that){currentItem=$(event.target);}
if(!currentItem){return false;}
if(this.options.handle&&!overrideHandle){$(this.options.handle,currentItem).find("*").addBack().each(function(){if(this===event.target){validHandle=true;}});if(!validHandle){return false;}}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide();}
this._createPlaceholder();if(o.containment){this._setContainment();}
if(o.cursor&&o.cursor!=="auto"){body=this.document.find("body");this.storedCursor=body.css("cursor");body.css("cursor",o.cursor);this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body);}
if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity");}
this.helper.css("opacity",o.opacity);}
if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex");}
this.helper.css("zIndex",o.zIndex);}
if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset();}
this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions();}
if(!noActivation){for(i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,this._uiHash(this));}}
if($.ui.ddmanager){$.ui.ddmanager.current=this;}
if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}
this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=false;this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;}
if(this.options.scroll){if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;}else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;}
if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;}else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}}
this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px";}
if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px";}
for(i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];intersection=this._intersectsWithPointer(item);if(!intersection){continue;}
if(item.instance!==this.currentContainer){continue;}
if(itemElement!==this.currentItem[0]&&this.placeholder[intersection===1?"next":"prev"]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],itemElement):true)){this.direction=intersection===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;}
this._trigger("change",event,this._uiHash());break;}}
this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);}
this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event){return;}
if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event);}
if(this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};if(!axis||axis==="x"){animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft);}
if(!axis||axis==="y"){animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop);}
this.reverting=true;$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event);});}else{this._clear(event,noPropagation);}
return false;},cancel:function(){if(this.dragging){this._mouseUp({target:null});if(this.options.helper==="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,this._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,this._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0]);}
if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove();}
$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}}
return this;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[\-=_](.+)/));if(res){str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]));}});if(!str.length&&o.key){str.push(o.key+"=");}
return str.join("&");},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"");});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight=(this.options.axis==="x")||((y1+dyClick)>t&&(y1+dyClick)<b),isOverElementWidth=(this.options.axis==="y")||((x1+dxClick)>l&&(x1+dxClick)<r),isOverElement=isOverElementHeight&&isOverElementWidth;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var isOverElementHeight=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement){return false;}
return this.floating?(((horizontalDirection&&horizontalDirection==="right")||verticalDirection==="down")?2:1):(verticalDirection&&(verticalDirection==="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!==0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!==0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this._setHandleClassName();this.refreshPositions();return this;},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);}}}}
queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function addItems(){items.push(this);}
for(i=queries.length-1;i>=0;i--){queries[i][0].each(addItems);}
return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++){if(list[j]===item.item[0]){return false;}}
return true;});},_refreshItems:function(event){this.items=[];this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}}}}
for(i=queries.length-1;i>=0;i--){targetData=queries[i][1];_queries=queries[i][0];for(j=0,queriesLength=_queries.length;j<queriesLength;j++){item=$(_queries[j]);item.data(this.widgetName+"-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});}}},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();}
var i,item,t,p;for(i=this.items.length-1;i>=0;i--){item=this.items[i];if(item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]){continue;}
t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();}
p=t.offset();item.left=p.left;item.top=p.top;}
if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(i=this.containers.length-1;i>=0;i--){p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();}}
return this;},_createPlaceholder:function(that){that=that||this;var className,o=that.options;if(!o.placeholder||o.placeholder.constructor===String){className=o.placeholder;o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]).addClass(className||that.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");if(nodeName==="tr"){that.currentItem.children().each(function(){$("<td>&#160;</td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(element);});}else if(nodeName==="img"){element.attr("src",that.currentItem.attr("src"));}
if(!className){element.css("visibility","hidden");}
return element;},update:function(container,p){if(className&&!o.forcePlaceholderSize){return;}
if(!p.height()){p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10));}
if(!p.width()){p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10));}}};}
that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem));that.currentItem.after(that.placeholder);o.placeholder.update(that,that.placeholder);},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--){if($.contains(this.currentItem[0],this.containers[i].element[0])){continue;}
if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0])){continue;}
innermostContainer=this.containers[i];innermostIndex=i;}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}}
if(!innermostContainer){return;}
if(this.containers.length===1){if(!this.containers[innermostIndex].containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}}else{dist=10000;itemWithLeastDistance=null;floating=innermostContainer.floating||this._isFloating(this.currentItem);posProperty=floating?"left":"top";sizeProperty=floating?"width":"height";axis=floating?"clientX":"clientY";for(j=this.items.length-1;j>=0;j--){if(!$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])){continue;}
if(this.items[j].item[0]===this.currentItem[0]){continue;}
cur=this.items[j].item.offset()[posProperty];nearBottom=false;if(event[axis]-cur>this.items[j][sizeProperty]/2){nearBottom=true;}
if(Math.abs(event[axis]-cur)<dist){dist=Math.abs(event[axis]-cur);itemWithLeastDistance=this.items[j];this.direction=nearBottom?"up":"down";}}
if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return;}
if(this.currentContainer===this.containers[innermostIndex]){return;}
itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[innermostIndex].element,true);this._trigger("change",event,this._uiHash());this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));this.currentContainer=this.containers[innermostIndex];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper==="clone"?this.currentItem.clone():this.currentItem);if(!helper.parents("body").length){$(o.appendTo!=="parent"?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);}
if(helper[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};}
if(!helper[0].style.width||o.forceHelperSize){helper.width(this.currentItem.width());}
if(!helper[0].style.height||o.forceHelperSize){helper.height(this.currentItem.height());}
return helper;},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");}
if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};}
if("left"in obj){this.offset.click.left=obj.left+this.margins.left;}
if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;}
if("top"in obj){this.offset.click.top=obj.top+this.margins.top;}
if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if(this.offsetParent[0]===document.body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){po={top:0,left:0};}
return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var ce,co,over,o=this.options;if(o.containment==="parent"){o.containment=this.helper[0].parentNode;}
if(o.containment==="document"||o.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];}
if(!(/^(document|window|parent)$/).test(o.containment)){ce=$(o.containment)[0];co=$(o.containment).offset();over=($(ce).css("overflow")!=="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;}
var mod=d==="absolute"?1:-1,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+
this.offset.relative.top*mod+
this.offset.parent.top*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+
this.offset.relative.left*mod+
this.offset.parent.left*mod-
((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left;}
if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top;}
if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left;}
if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top;}}
if(o.grid){top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?((top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3])?top:((top-this.offset.click.top>=this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?((left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2])?left:((left-this.offset.click.left>=this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY-
this.offset.click.top-
this.offset.relative.top-
this.offset.parent.top+
((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX-
this.offset.click.left-
this.offset.relative.left-
this.offset.parent.left+
((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){if(counter===this.counter){this.refreshPositions(!hardRefresh);}});},_clear:function(event,noPropagation){this.reverting=false;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem);}
this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]="";}}
this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();}
if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});}
if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});}
if(this!==this.currentContainer){if(!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.currentContainer));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.currentContainer));}}
function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};}
for(i=this.containers.length-1;i>=0;i--){if(!noPropagation){delayedTriggers.push(delayEvent("deactivate",this,this.containers[i]));}
if(this.containers[i].containerCache.over){delayedTriggers.push(delayEvent("out",this,this.containers[i]));this.containers[i].containerCache.over=0;}}
if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove();}
if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity);}
if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex);}
this.dragging=false;if(this.cancelHelperRemoval){if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);}
this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return false;}
if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());}
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!==this.currentItem[0]){this.helper.remove();}
this.helper=null;if(!noPropagation){for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);}
this._trigger("stop",event,this._uiHash());}
this.fromOutside=false;return true;},_trigger:function(){if($.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null};}});}));;+function($){"use strict";var Modal=function(element,options){this.options=options
this.$element=$(element)
this.$backdrop=this.isShown=null
if(this.options.remote)this.$element.load(this.options.remote)}
Modal.DEFAULTS={backdrop:true,keyboard:true,show:true}
Modal.prototype.toggle=function(_relatedTarget){return this[!this.isShown?'show':'hide'](_relatedTarget)}
Modal.prototype.show=function(_relatedTarget){var that=this
var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget})
this.$element.trigger(e)
if(this.isShown||e.isDefaultPrevented())return
this.isShown=true
this.escape()
this.$element.on('click.dismiss.modal','[data-dismiss="modal"]',$.proxy(this.hide,this))
this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade')
if(!that.$element.parent().length){that.$element.appendTo(document.body)}
that.$element.show()
if(transition){that.$element[0].offsetWidth}
that.$element.addClass('in').attr('aria-hidden',false)
that.enforceFocus()
var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget})
transition?that.$element.find('.modal-dialog').one($.support.transition.end,function(){that.$element.focus().trigger(e)}).emulateTransitionEnd(300):that.$element.focus().trigger(e)})}
Modal.prototype.hide=function(e){if(e)e.preventDefault()
e=$.Event('hide.bs.modal')
this.$element.trigger(e)
if(!this.isShown||e.isDefaultPrevented())return
this.isShown=false
this.escape()
$(document).off('focusin.bs.modal')
this.$element.removeClass('in').attr('aria-hidden',true).off('click.dismiss.modal')
$.support.transition&&this.$element.hasClass('fade')?this.$element.one($.support.transition.end,$.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}
Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.focus()}},this))}
Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keyup.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keyup.dismiss.bs.modal')}}
Modal.prototype.hideModal=function(){var that=this
this.$element.hide()
this.backdrop(function(){that.removeBackdrop()
that.$element.trigger('hidden.bs.modal')})}
Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove()
this.$backdrop=null}
Modal.prototype.backdrop=function(callback){var that=this
var animate=this.$element.hasClass('fade')?'fade':''
if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate
this.$backdrop=$('<div class="modal-backdrop '+animate+'" />').appendTo(document.body)
this.$element.on('click.dismiss.modal',$.proxy(function(e){if(e.target!==e.currentTarget)return
this.options.backdrop=='static'?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this))
if(doAnimate)this.$backdrop[0].offsetWidth
this.$backdrop.addClass('in')
if(!callback)return
doAnimate?this.$backdrop.one($.support.transition.end,callback).emulateTransitionEnd(150):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in')
$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one($.support.transition.end,callback).emulateTransitionEnd(150):callback()}else if(callback){callback()}}
var old=$.fn.modal
$.fn.modal=function(option,_relatedTarget){return this.each(function(){var $this=$(this)
var data=$this.data('bs.modal')
var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option)
if(!data)$this.data('bs.modal',(data=new Modal(this,options)))
if(typeof option=='string')data[option](_relatedTarget)
else if(options.show)data.show(_relatedTarget)})}
$.fn.modal.Constructor=Modal
$.fn.modal.noConflict=function(){$.fn.modal=old
return this}
$(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this)
var href=$this.attr('href')
var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,'')))
var option=$target.data('modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data())
e.preventDefault()
$target.modal(option,this).one('hide',function(){$this.is(':visible')&&$this.focus()})})
$(document).on('show.bs.modal','.modal',function(){$(document.body).addClass('modal-open')}).on('hidden.bs.modal','.modal',function(){$(document.body).removeClass('modal-open')})}(window.jQuery);;+function($){"use strict";var Collapse=function(element,options){this.$element=$(element)
this.options=$.extend({},Collapse.DEFAULTS,options)
this.transitioning=null
if(this.options.parent)this.$parent=$(this.options.parent)
if(this.options.toggle)this.toggle()}
Collapse.DEFAULTS={toggle:true}
Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width')
return hasWidth?'width':'height'}
Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return
var startEvent=$.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented())return
var actives=this.$parent&&this.$parent.find('> .panel > .in')
if(actives&&actives.length){var hasData=actives.data('bs.collapse')
if(hasData&&hasData.transitioning)return
actives.collapse('hide')
hasData||actives.data('bs.collapse',null)}
var dimension=this.dimension()
this.$element.removeClass('collapse').addClass('collapsing')
[dimension](0)
this.transitioning=1
var complete=function(){this.$element.removeClass('collapsing').addClass('in')
[dimension]('auto')
this.transitioning=0
this.$element.trigger('shown.bs.collapse')}
if(!$.support.transition)return complete.call(this)
var scrollSize=$.camelCase(['scroll',dimension].join('-'))
this.$element.one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)
[dimension](this.$element[0][scrollSize])}
Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return
var startEvent=$.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if(startEvent.isDefaultPrevented())return
var dimension=this.dimension()
this.$element
[dimension](this.$element[dimension]())
[0].offsetHeight
this.$element.addClass('collapsing').removeClass('collapse').removeClass('in')
this.transitioning=1
var complete=function(){this.transitioning=0
this.$element.trigger('hidden.bs.collapse').removeClass('collapsing').addClass('collapse')}
if(!$.support.transition)return complete.call(this)
this.$element
[dimension](0).one($.support.transition.end,$.proxy(complete,this)).emulateTransitionEnd(350)}
Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()}
var old=$.fn.collapse
$.fn.collapse=function(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.collapse')
var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option)
if(!data)$this.data('bs.collapse',(data=new Collapse(this,options)))
if(typeof option=='string')data[option]()})}
$.fn.collapse.Constructor=Collapse
$.fn.collapse.noConflict=function(){$.fn.collapse=old
return this}
$(document).on('click.bs.collapse.data-api','[data-toggle=collapse]',function(e){var $this=$(this),href
var target=$this.attr('data-target')||e.preventDefault()||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')
var $target=$(target)
var data=$target.data('bs.collapse')
var option=data?'toggle':$this.data()
var parent=$this.attr('data-parent')
var $parent=parent&&$(parent)
if(!data||!data.transitioning){if($parent)$parent.find('[data-toggle=collapse][data-parent="'+parent+'"]').not($this).addClass('collapsed')
$this[$target.hasClass('in')?'addClass':'removeClass']('collapsed')}
$target.collapse(option)})}(window.jQuery);;+function($){"use strict";function transitionEnd(){var el=document.createElement('bootstrap')
var transEndEventNames={'WebkitTransition':'webkitTransitionEnd','MozTransition':'transitionend','OTransition':'oTransitionEnd otransitionend','transition':'transitionend'}
for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}}
$.fn.emulateTransitionEnd=function(duration){var called=false,$el=this
$(this).one($.support.transition.end,function(){called=true})
var callback=function(){if(!called)$($el).trigger($.support.transition.end)}
setTimeout(callback,duration)
return this}
$(function(){$.support.transition=transitionEnd()})}(window.jQuery);;+function($){"use strict";var backdrop='.dropdown-backdrop'
var toggle='[data-toggle=dropdown]'
var Dropdown=function(element){var $el=$(element).on('click.bs.dropdown',this.toggle)}
Dropdown.prototype.toggle=function(e){var $this=$(this)
if($this.is('.disabled, :disabled'))return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
clearMenus()
if(!isActive){if('ontouchstart'in document.documentElement&&!$parent.closest('.navbar-nav').length){$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click',clearMenus)}
$parent.trigger(e=$.Event('show.bs.dropdown'))
if(e.isDefaultPrevented())return
$parent.toggleClass('open').trigger('shown.bs.dropdown')
$this.focus()}
return false}
Dropdown.prototype.keydown=function(e){if(!/(38|40|27)/.test(e.keyCode))return
var $this=$(this)
e.preventDefault()
e.stopPropagation()
if($this.is('.disabled, :disabled'))return
var $parent=getParent($this)
var isActive=$parent.hasClass('open')
if(!isActive||(isActive&&e.keyCode==27)){if(e.which==27)$parent.find(toggle).focus()
return $this.click()}
var $items=$('[role=menu] li:not(.divider):visible a',$parent)
if(!$items.length)return
var index=$items.index($items.filter(':focus'))
if(e.keyCode==38&&index>0)index--
if(e.keyCode==40&&index<$items.length-1)index++
if(!~index)index=0
$items.eq(index).focus()}
function clearMenus(){$(backdrop).remove()
$(toggle).each(function(e){var $parent=getParent($(this))
if(!$parent.hasClass('open'))return
$parent.trigger(e=$.Event('hide.bs.dropdown'))
if(e.isDefaultPrevented())return
$parent.removeClass('open').trigger('hidden.bs.dropdown')})}
function getParent($this){var selector=$this.attr('data-target')
if(!selector){selector=$this.attr('href')
selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
var $parent;if(selector==="#"){$parent=$("")}else{$parent=selector&&$(selector)}
return $parent&&$parent.length?$parent:$this.parent()}
var old=$.fn.dropdown
$.fn.dropdown=function(option){return this.each(function(){var $this=$(this)
var data=$this.data('dropdown')
if(!data)$this.data('dropdown',(data=new Dropdown(this)))
if(typeof option=='string')data[option].call($this)})}
$.fn.dropdown.Constructor=Dropdown
$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
return this}
$(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle+', [role=menu]',Dropdown.prototype.keydown)}(window.jQuery);;+function($){"use strict";var dismiss='[data-dismiss="alert"]'
var Alert=function(el){$(el).on('click',dismiss,this.close)}
Alert.prototype.close=function(e){var $this=$(this)
var selector=$this.attr('data-target')
if(!selector){selector=$this.attr('href')
selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')}
var $parent=$(selector)
if(e)e.preventDefault()
if(!$parent.length){$parent=$this.hasClass('alert')?$this:$this.parent()}
$parent.trigger(e=$.Event('close.bs.alert'))
if(e.isDefaultPrevented())return
$parent.removeClass('in')
function removeElement(){$parent.trigger('closed.bs.alert').remove()}
$.support.transition&&$parent.hasClass('fade')?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement()}
var old=$.fn.alert
$.fn.alert=function(option){return this.each(function(){var $this=$(this)
var data=$this.data('bs.alert')
if(!data)$this.data('bs.alert',(data=new Alert(this)))
if(typeof option=='string')data[option].call($this)})}
$.fn.alert.Constructor=Alert
$.fn.alert.noConflict=function(){$.fn.alert=old
return this}
$(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(window.jQuery);;var ManagedPlaylist=function(playlistManager,playlist,options){this.playlistManager=playlistManager;this.id=options.id;this.name=options.name;this.closable=options.closable;this.public=options.public;this.owner=options.owner;this.saved=options.saved;this.reason_open=options.reason_open;this.jplayerplaylist;this._init(playlist,playlistManager)}
ManagedPlaylist.prototype={_init:function(playlist,playlistManager){var self=this;this.playlistSelector=self._createNewPlaylistContainer();for(var i=0;i<playlist.length;i++){if(typeof playlist[0].path==='undefined'){window.console.error('track has no path set!');}
if(typeof playlist[0].label==='undefined'){window.console.error('track has no label set!');}}
self.jplayerplaylist=new jPlayerPlaylist({jPlayer:this.playlistManager.cssSelectorjPlayer,cssSelectorAncestor:this.playlistManager.cssSelectorJPlayerControls},playlist,{playlistOptions:{'enableRemoveControls':true,'playlistSelector':this.playlistSelector,'playlistController':this,'loopOnPrevious':true},hooks:{"setMedia":playlistManager.transcodeURL},loop:self.playlistManager.loop});self.jplayerplaylist._init();self.jplayerplaylist._updateControls=function(){playlistManager.refreshCommands();}
$(self.playlistSelector+">ul.playlist-container-list").sortable({axis:"y",delay:150,helper:'clone',update:function(e,ui){self.jplayerplaylist.scan();}});$(self.playlistSelector+">ul.playlist-container-list").disableSelection();$(this.playlistSelector).bind('requestPlay',function(event,playlistSelector){self.playlistManager.setPlayingPlaylist(self.playlistManager.htmlid2plid(playlistSelector));});$(this.playlistSelector).bind('removedItem',function(event,playlistSelector){self.setSaved(false);});$(this.playlistSelector).bind('sortedItems',function(event,playlistSelector){self.setSaved(false);});$(this.playlistSelector).bind('addedItem',function(event,playlistSelector){self.setSaved(false);});},setSaved:function(issaved){this.saved=issaved;this.playlistManager.refreshCommands();this.playlistManager.refreshTabs();},wasSaved:function(){return this.saved;},_createNewPlaylistContainer:function(){var playlistContainerParent=this.playlistManager.cssSelectorPlaylistContainerParent;var id=this.playlistManager.plid2htmlid(this.id);$(playlistContainerParent).append('<div class="playlist-container jp-playlist" id="'+id+'">'+'<ul class="playlist-container-list"><li></li></ul>'+'<div class="jp-playlist-playtime-sum"></div></div>');return'#'+id;},getCanonicalPlaylist:function(){var canonical=[];for(var i=0;i<this.jplayerplaylist.playlist.length;i++){var elem=this.jplayerplaylist.playlist[i];var track={title:elem.title,duration:elem.duration,url:elem.url,meta:elem.meta,}
canonical.push(track);}
return{'playlist':canonical,'name':this.name,'closable':this.closable,'public':this.public,'owner':this.owner,'saved':this.saved,'reason_open':this.reason_open,};},getPlayTimeSec:function(playlist){var durationsec=0;var tracks_with_duration=0;for(var i=0;i<playlist.length;i++){if(typeof playlist[i].duration!=='undefined'){durationsec+=playlist[i].duration;tracks_with_duration++;}}
if(tracks_with_duration==0){return;}else{return(durationsec/tracks_with_duration)*playlist.length;}},getRemainingTracks:function(){if(playlistManager.shuffled){var n=this._getMostPlayedTrack();var remainingTracks=this.jplayerplaylist.playlist.filter(function(elem,idx,arr){return elem.wasPlayed<n;});remainingTracks.push(this.jplayerplaylist.playlist[this.jplayerplaylist.current]);return remainingTracks}else{return this.jplayerplaylist.playlist.slice(this.jplayerplaylist.current);}},_getMostPlayedTrack:function(){var wasplayermost=0;for(var i=0;i<this.jplayerplaylist.playlist.length;i++){if(this.jplayerplaylist.playlist[i].wasPlayed>wasplayermost){wasplayermost=this.jplayerplaylist.playlist[i].wasPlayed;}}
return wasplayermost;},makeThisPlayingPlaylist:function(){this.playlistManager.setPlayingPlaylist(this.id);},addTrack:function(track,animate){if(typeof animate==='undefined'){animate=true;}
this.jplayerplaylist.add(track,false,animate);this.scrollToTrack(this.jplayerplaylist.playlist.length-1);},scrollToTrack:function(number){var htmlid='#'+playlistManager.plid2htmlid(this.id);var yoffset=$($(htmlid+' > ul > li')[number]).position().top;var current_scroll=$('.playlist-container-parent').scrollTop();$('.playlist-container-parent').scrollTop(current_scroll+yoffset);},scrollToCurrentTrack:function(){this.scrollToTrack(this.jplayerplaylist.current);},sort_by:function(sort_by){this.jplayerplaylist.playlist.sort(function(a,b){var value_a='';var value_b='';if(typeof a.meta!=='undefined'){value_a=a.meta[sort_by];}
if(typeof b.meta!=='undefined'){value_b=b.meta[sort_by];}
if(!!value_a.match(/^\d+/)&&!!value_b.match(/^\d+/)){return parseInt(value_a)-parseInt(value_b);}
if(value_a>value_b){return 1;}else if(value_a<value_b){return-1;}else{return 0;}});this.jplayerplaylist._refresh(true);}}
var NewplaylistProxy=function(playlistManager){options={};options.id=0;options.name="new playlist";options.closable=false;options.public=true;options.owner='me';options.saved=true;options.reason_open='newplaylist_proxy';var actual=new ManagedPlaylist(playlistManager,[],options);actual.makeThisPlayingPlaylist=function(){var newpl=this.playlistManager.newPlaylist();newpl.makeThisPlayingPlaylist();};actual.addTrack=function(track){var newpl=this.playlistManager.newPlaylist();this.playlistManager.setEditingPlaylist(newpl.id);newpl.jplayerplaylist.add(track);};return actual;}
PlaylistManager=function(){"use strict";var self=this;this.cssSelectorPlaylistContainerParent='.playlist-container-parent';this.cssSelectorPlaylistChooser='#playlistChooser';this.cssSelectorPlaylistCommands='#playlistCommands';this.cssSelectorJPlayerControls='#jp_ancestor';this.cssSelectorjPlayer="#jquery_jplayer_1";this.cssSelectorAlbumArt="#albumart";this.newplaylistProxy=new NewplaylistProxy(this);this.managedPlaylists=[]
this.playingPlaylist=0;this.editingPlaylist=0;this.shuffled=false;this.cssSelector={}
this.lastRememberedPlaylist='';this.nrOfCreatedPlaylists=0;this.flashBlockCheckIntervalId;this.cssSelector.next=this.cssSelectorJPlayerControls+" .jp-next";this.cssSelector.previous=this.cssSelectorJPlayerControls+" .jp-previous";this.cssSelector.shuffle=this.cssSelectorJPlayerControls+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelectorJPlayerControls+" .jp-shuffle-off";$(this.cssSelectorjPlayer).bind($.jPlayer.event.ready,function(event){self.restorePlaylists();window.setInterval('playlistManager.displayCurrentSong()',1000);window.setInterval('playlistManager.refreshCommands()',1000);self.flashSize('0px','0px',-10000);availablejPlayerFormats=[]
var jplayer=self.jPlayerInstance.data('jPlayer');if(jplayer.html.canPlay.oga||jplayer.flash.canPlay.oga){availablejPlayerFormats.push('opus');availablejPlayerFormats.push('ogg')}
if(jplayer.html.canPlay.mp3||jplayer.flash.canPlay.mp3){availablejPlayerFormats.push('mp3')}
if(availablejPlayerFormats.length==0){alert('Your browser does not support audio playback.');}});$(this.cssSelectorjPlayer).bind($.jPlayer.event.setmedia,function(event){var playlist=self.getPlayingPlaylist().jplayerplaylist;var track=playlist.playlist[playlist.current];if(track){self.setAlbumArtDisplay(track);}});this.initJPlayer();}
PlaylistManager.prototype={initJPlayer:function(){"use strict";availablejPlayerFormats.push("m4v");var usedSolution="html, flash";if(detectBrowser()=='midori'){usedSolution="flash, html";}
var self=this;if(typeof self.jPlayerInstance==='undefined'){self.jPlayerInstance=$(self.cssSelectorjPlayer).jPlayer({swfPath:"res/js/ext",solution:usedSolution,preload:'metadata',supplied:"mp3, oga, m4v",wmode:"window",cssSelectorAncestor:self.cssSelectorJPlayerControls,errorAlerts:false,repeat:self._getRepeatHandler()});this.cssSelector.next=this.cssSelectorJPlayerControls+" .jp-next";this.cssSelector.previous=this.cssSelectorJPlayerControls+" .jp-previous";this.cssSelector.shuffle=this.cssSelectorJPlayerControls+" .jp-shuffle";this.cssSelector.shuffleOff=this.cssSelectorJPlayerControls+" .jp-shuffle-off";$(this.cssSelectorjPlayer).bind($.jPlayer.event.ended,function(event){self.cmd_next();});$(this.cssSelectorjPlayer).bind($.jPlayer.event.error,function(event){var now=new Date().getTime();var min_error_gap_sec=5;if(typeof self.jPlayerInstance.data("jPlayer").status.media.last_error==='undefined'){self.jPlayerInstance.data("jPlayer").status.media.last_error=0;}
var error_gap=now-self.jPlayerInstance.data("jPlayer").status.media.last_error;if(error_gap>min_error_gap_sec){self.jPlayerInstance.data("jPlayer").status.media.last_error=now;window.console.log("Playback failed! trying to resume from the point it failed.");var current_playtime=self.jPlayerInstance.data("jPlayer").status.currentTime;playlistManager.jPlayerInstance.data("jPlayer").play(current_playtime);}else{window.console.log("Playback failed too often! Trying next track.");self.cmd_next();}});$(this.cssSelector.previous).click(function(){self.cmd_previous();$(this).blur();return false;});$(this.cssSelector.next).click(function(){self.cmd_next();$(this).blur();return false;});$(this.cssSelector.shuffle).click(function(){self.shuffleToggle();self.refreshShuffle();$(this).blur();return false;});$(this.cssSelector.shuffleOff).click(function(){self.shuffleToggle();self.refreshShuffle();$(this).blur();return false;});self.refreshShuffle();this.flashBlockCheckIntervalId=window.setInterval("playlistManager.checkFlashBlock()",200);}},cmd_play:function(){$(this.cssSelectorjPlayer).jPlayer("play");},cmd_pause:function(){if($(this.cssSelectorjPlayer).data().jPlayer.status.paused){$(this.cssSelectorjPlayer).jPlayer("play");}else{$(this.cssSelectorjPlayer).jPlayer("pause");}},cmd_stop:function(){$(this.cssSelectorjPlayer).jPlayer("stop");},cmd_previous:function(){this.getPlayingPlaylist().jplayerplaylist.previous();},cmd_next:function(){if(this.shuffled){this.getPlayingPlaylist().jplayerplaylist.playRandomTrack();return false;}else{var currentPL=this.getPlayingPlaylist();currentPL.jplayerplaylist.next();if(currentPL.id==this.getEditingPlaylist().id){currentPL.scrollToCurrentTrack();}
return false;}},checkFlashBlock:function(){flashBlocked=false;if(detectBrowser()=='opera'){try{window.document.getElementById('jp_flash_0').SetVariable("flashblock","flashblock");}catch(err){flashBlocked=true;}}else{flashBlocked=$('#jquery_jplayer_1 > div').length>0;}
if(flashBlocked){$('#jquery_jplayer_1 div').css('background-color','#fff');this.flashSize('100%','80px','10000');errorFunc('Flashblock is enabled. Please click on the flash symbol on top of the player to activate flash.')();}else{window.clearInterval(this.flashBlockCheckIntervalId);window.setTimeout("playlistManager.flashSize('0px','0px',-10000);",1000);playlistManager.flashSize('0px','0px',-10000);}},flashSize:function(w,h,zidx){$('#jquery_jplayer_1 object').css('z-index',zidx);$('#jquery_jplayer_1 object').css('position','absolute');$('#jquery_jplayer_1 div').css('z-index',zidx);$('#jquery_jplayer_1 div').css('position','absolute');$('#jquery_jplayer_1 object').css('width',w);$('#jquery_jplayer_1 object').css('height',h);$('#jquery_jplayer_1 div').css('width',w);$('#jquery_jplayer_1 div').css('height',h);},shuffleToggle:function(){this.shuffled=!this.shuffled;this.refreshShuffle();},refresh:function(){var self=this;self.refreshTabs();self.refreshCommands();self.refreshPlaylists();self.refreshShuffle();},refreshShuffle:function(){if(this.shuffled){$(this.cssSelector.shuffle).hide();$(this.cssSelector.shuffleOff).show();}else{$(this.cssSelector.shuffle).show();$(this.cssSelector.shuffleOff).hide();}},refreshCommands:function(){var epl=this.getEditingPlaylist();if(typeof epl!=='undefined'){show_ui_conditionally(['.playlist-command-buttons','#playlist-command-button-group'],{'queue':epl.reason_open=='queue','playlist':epl.reason_open!='queue','not-saved':epl.saved==false,'user-may-download':userOptions.media.may_download,});$('.save-current-playlist-button').off().on("click",function(){var epl=playlistManager.getEditingPlaylist();savePlaylist(epl.id,false,false,true);$(this).blur();return false;});$('.save-as-new-playlist-button').off().on("click",function(){var epl=playlistManager.getEditingPlaylist();$('#playlisttitle').val(epl.name+' copy');if(epl.public){$("#playlistpublic").attr("checked",true);}else{$("#playlistpublic").removeAttr("checked");}});var remaintracks=epl.getRemainingTracks();var completetimesec=epl.getPlayTimeSec(epl.jplayerplaylist.playlist);var remaintimesec=epl.getPlayTimeSec(remaintracks);var playingPlaylist=this.getPlayingPlaylist();var remainingStr='';var proc=0;if(playlistManager.shuffled){if(typeof completetimesec!=='undefined'){remainingStr=epl.jplayerplaylist._formatTime(completetimesec)+' total'
proc=1;}}else{if(playingPlaylist&&epl.id===playingPlaylist.id){remaintimesec-=$(this.cssSelectorjPlayer).data("jPlayer").status.currentTime;}
remaintimesec=remaintimesec<0?0:remaintimesec;var littleTimeLeft=false;if(typeof remaintimesec!=='undefined'&&typeof completetimesec!=='undefined'){if(completetimesec!=0){proc=remaintimesec/completetimesec;}else{proc=1;}
littleTimeLeft=remaintimesec<300;remainingStr=(epl.jplayerplaylist._formatTime(remaintimesec)+' / '+
epl.jplayerplaylist._formatTime(completetimesec)+' remaining');}else{proc=remaintracks.length/epl.jplayerplaylist.playlist.length;littleTimeLeft=remaintracks.length<3;remainingStr=(remaintracks.length+' / '+
epl.jplayerplaylist.playlist.length+' remaining tracks');}
if(littleTimeLeft){$('.remaining-tracks-or-time').removeClass('label-default');$('.remaining-tracks-or-time').addClass('label-danger');$('.playlist-progress-bar .progress-bar').addClass('progress-bar-danger');$('.playlist-progress-bar .progress-bar').removeClass('progress-bar-default');}else{$('.remaining-tracks-or-time').addClass('label-default');$('.remaining-tracks-or-time').removeClass('label-danger');$('.playlist-progress-bar .progress-bar').addClass('progress-bar-default');$('.playlist-progress-bar .progress-bar').removeClass('progress-bar-danger');}}
$('.remaining-tracks-or-time').html(remainingStr);$('.playlist-progress-bar .progress-bar').css('width',parseInt(100-proc*100)+'%');}},refreshTabs:function(){"use strict";window.console.log('refreshTabs');var self=this;var pltabs='';for(var i=0;i<this.managedPlaylists.length;i++){var pl=this.managedPlaylists[i];var isactive=''
if(pl.id==this.editingPlaylist){isactive=' class="active" ';}else{isactive=' class="playlist-tab-inactive" ';}
pltabs+='<li '+isactive+' id="'+this.tabid2htmlid(pl.id)+'">';var isplaying='';if(pl.id==this.playingPlaylist){isplaying+='&#9654;';}
var isunsaved='';if(!pl.saved&&pl.reason_open!=='queue'){isunsaved+=' <em>(unsaved)</em>';}
var escaped_playlist_name=$("<div>").text(pl.name).html();pltabs+='<a href="#" onclick="playlistManager.showPlaylist('+pl.id+')">'+isplaying+' '+escaped_playlist_name+isunsaved;if(pl.closable){pltabs+='<span class="playlist-tab-closer pointer" href="#" onclick="playlistManager.closePlaylist('+pl.id+')">&times;</span>';}
pltabs+='</a></li>';}
pltabs+='<li class="playlist-tab-inactive playlist-tab-new"><a href="#" onclick="playlistManager.newPlaylist()"><b>+</b></a></li>';$(self.cssSelectorPlaylistChooser+' ul').empty()
$(self.cssSelectorPlaylistChooser+' ul').append(pltabs);},tabid2htmlid:function(id){return this.plid2htmlid(id)+'-tab';},plid2htmlid:function(id){return'pl-'+id;},htmlid2plid:function(htmlid){return parseInt(htmlid.slice(4,htmlid.length))},refreshPlaylists:function(){window.console.log('refreshPlaylists');var self=this;var validHTMLIds=[];for(var i=0;i<this.managedPlaylists.length;i++){validHTMLIds.push(this.plid2htmlid(this.managedPlaylists[i].id));}
window.console.log(validHTMLIds);$.each($('#playlistContainerParent>div'),function(i,v){window.console.log($(this).attr('id'));if($.inArray($(this).attr('id'),validHTMLIds)<0){$(this).remove();window.console.log('removing invalid playlist from ui');}});this.showPlaylist(this.getEditingPlaylist().id);},showPlaylist:function(playlistid){$('#playlistCommands').show();$('#playlistContainerParent').show();$('#playlistBrowser').hide();var self=this;var plhtmlid='#'+this.plid2htmlid(playlistid);var showpl=$(plhtmlid);this.hideAll();$('#playlistChooser ul li:last').removeClass('active');if(showpl.length<1){window.console.warn("tried showing playlist with htmlid "+plhtmlid+" which doesn't exist!");this.setEditingPlaylist(this.managedPlaylists[0].id);showpl=$('#'+this.plid2htmlid(this.getEditingPlaylist().id));}else{this.setEditingPlaylist(playlistid);}
this.setTrackDestinationLabel();showpl.show();this.refreshTabs();this.refreshCommands();},setTrackDestinationLabel:function(){$('#searchresults .add-track-destination').text('add all to '+this.getEditingPlaylist().name);},hideAll:function(){$(this.cssSelectorPlaylistContainerParent+'>div').hide();$(this.cssSelectorPlaylistChooser+' ul li').removeClass('active');this.setEditingPlaylist(0);},getPlaylistById:function(plid){if(plid===0){return this.newplaylistProxy;}
for(var i=0;i<this.managedPlaylists.length;i++){if(this.managedPlaylists[i].id==plid){return this.managedPlaylists[i];}}},getEditingPlaylist:function(){var pl=this.getPlaylistById(this.editingPlaylist);if(typeof pl!=='undefined'){return pl;}},getPlayingPlaylist:function(){for(var i=0;i<this.managedPlaylists.length;i++){if(this.managedPlaylists[i].id==this.playingPlaylist){return this.managedPlaylists[i];}}
return this.managedPlaylists[0];},newPlaylistFromQueue:function(){return this.newPlaylist(this.managedPlaylists[0].jplayerplaylist.playlist);},newPlaylistFromEditing:function(){return this.newPlaylist(this.getEditingPlaylist().jplayerplaylist.playlist);},closePlaylist:function(plid){for(var i=0;i<this.managedPlaylists.length;i++){if(this.managedPlaylists[i].id==plid){window.console.log('closing PL '+plid)
this.managedPlaylists.splice(i,1);$('#'+this.plid2htmlid(plid)).remove()
var otherId=this.managedPlaylists[i<this.managedPlaylists.length?i:0].id;window.console.log('showing '+otherId+' and using it as editing PL')
this.showPlaylist(otherId)
return false;}}
this.refresh();$(this).blur();return false;},clearQueue:function(){this.managedPlaylists[0].jplayerplaylist.remove();this.refreshCommands();$(this).blur();return false;},setEditingPlaylist:function(editingplid){var plist=this.getPlaylistById(editingplid);var plname='';if(typeof plist!=='undefined'){this.editingPlaylist=editingplid;plname=plist.name;}else{window.console.error('Tried setting editing playlist to unknown id '+editingplid);this.editingPlaylist=0;plname='unknown playlist'}
$('.plsmgr-editingplaylist-name').text(plname);},setPlayingPlaylist:function(plid){this.playingPlaylist=plid;this.refreshTabs();},transcodeURL:function(track){"use strict";var self=this;var path=track.url;var title=track.title;var duration=track.duration;var ext=getFileTypeByExt(path);var track={title:title,wasPlayed:0,duration:duration,}
var forced_bitrate=userOptions.media.force_transcode_to_bitrate;var formats=[];if(!(forced_bitrate)&&availablejPlayerFormats.indexOf(ext)!==-1){track[ext2jPlayerFormat(ext)]=SERVER_CONFIG.serve_path+path;formats.push(ext);window.console.log('added native format '+ext);}else if(!transcodingEnabled){var msg=forced_bitrate?"bitrate limit requested":("browser doesn't support filetype "+ext);msg+=' and transcoding is disabled. Transcoding can be enabled in the server configuration.';errorFunc(msg)();window.console.log(msg);return;}else{window.console.log('Trying available transcoders.');if(availableDecoders.indexOf(ext)===-1){window.console.log('missing decoder for filetype '+ext+'. track '+path+' can not be transcoded.')
return;}else{for(var i=0;i<availablejPlayerFormats.length;i++){if(availableEncoders.indexOf(availablejPlayerFormats[i])!==-1){formats.push(availablejPlayerFormats[i]);var transurl=SERVER_CONFIG.transcode_path+availablejPlayerFormats[i]+'/'+path;transurl+='?bitrate='+forced_bitrate;track[ext2jPlayerFormat(availablejPlayerFormats[i])]=transurl;window.console.log('added live transcoding '+ext+' --> '+availablejPlayerFormats[i]+' @ '+transurl);}}}
if(formats.length==0){window.console.log('no suitable encoder available! Try installing vorbis-tools or lame!');return;}}
return track;},setAlbumArtDisplay:function(track){if(userOptions.ui.display_album_art){var directory=track.url;if(directory=='')
directory='/';var api_param=JSON.stringify({directory:directory});var imgurl='api/fetchalbumart?data='+api_param;$(this.cssSelectorAlbumArt).attr('src',imgurl);}},addSong:function(path,title,plid,animate){"use strict";var self=this;if(typeof animate==='undefined'){animate=true;}
var track={title:title,url:path,wasPlayed:0,}
var playlist;if(plid){playlist=this.getPlaylistById(plid);}
if(typeof playlist=='undefined'){playlist=this.getEditingPlaylist();}
playlist.addTrack(track,animate);if(!jPlayerIsPlaying()&&playlist.jplayerplaylist.playlist.length==1){if(userOptions.misc.autoplay_on_add){playlist.makeThisPlayingPlaylist();playlist.jplayerplaylist.play(0);}else{playlist.jplayerplaylist.select(0);}}
var success=function(data){var metainfo=$.parseJSON(data);var any_info_received=false;track.meta=metainfo;if(metainfo.length){track.duration=metainfo.length;any_info_received=true;}
if(metainfo.title.length>0&&metainfo.artist.length>0){track.title=metainfo.artist+' - '+metainfo.title;if(metainfo.track.length>0){track.title=metainfo.track+' '+track.title;if(metainfo.track.length<2){track.title='0'+track.title;}}
any_info_received=true;}
if(any_info_received){self.getEditingPlaylist().jplayerplaylist._refresh(true);}}
window.setTimeout(function(){api('getsonginfo',{'path':decodeURIComponent(path)},success,errorFunc('error getting song metainfo'),true);},1000);},clearPlaylist:function(){"use strict";this.getEditingPlaylist().remove();if(this.getEditingPlaylist()==this.getPlayingPlaylist()){$(this.cssSelectorjPlayer).jPlayer("clearMedia");}
return false;},displayCurrentSong:function(){var pl=this.getPlayingPlaylist();if(typeof pl==='undefined'){return;}
var jPlaylist=pl.jplayerplaylist;var songtitle='';var tabtitle='CherryMusic';if(typeof this.jPlayerInstance!=='undefined'){var currentTitle=this.jPlayerInstance.data().jPlayer.status.media.title;if(typeof currentTitle!=='undefined'){songtitle=currentTitle;tabtitle=currentTitle+' | CherryMusic';}}
$('.cm-songtitle').html(songtitle);$('title').text(tabtitle);},rememberPlaylist:function(){"use strict";var self=this;var canonicalPlaylists=[]
for(var i=0;i<this.managedPlaylists.length;i++){var cano=this.managedPlaylists[i].getCanonicalPlaylist();if(cano.playlist.length||cano.reason_open=='queue'){canonicalPlaylists.push(cano);}}
var newToRememberPlaylist=JSON.stringify(canonicalPlaylists)
if(this.lastRememberedPlaylist!==newToRememberPlaylist){var error=errorFunc('cannot remember playlist: failed to connect to server.');var success=function(){self.lastRememberedPlaylist=newToRememberPlaylist;}
api('rememberplaylist',{'playlist':canonicalPlaylists},success,error,true);}},restorePlaylists:function(){var self=this;"use strict";var success=function(data){var playlistsToRestore=data;if(playlistsToRestore!==null&&playlistsToRestore.length>0){window.console.log('restoring playlist from last session');for(var i=0;i<playlistsToRestore.length;i++){var pl=playlistsToRestore[i];var newpl=self._createPlaylist(pl.playlist,pl.closable,pl.public,pl.owner,pl.reason_open,pl.name,pl.saved);}
self.setPlayingPlaylist(self.getPlayingPlaylist().id);self.showPlaylist();}else{var pl=self._createPlaylist([],false,false,'self','queue','Queue',true);self.playingPlaylist=pl.id;self.setEditingPlaylist(pl.id);self.showPlaylist(pl.id);}
self.refresh();window.console.log('remembering playlists periodically');window.setInterval("playlistManager.rememberPlaylist()",REMEMBER_PLAYLIST_INTERVAL);};api('restoreplaylist',success,errorFunc('error restoring playlist'));},_createPlaylist:function(playlist,closable,public,owner,reason,name,saved){var a=new Date();var timemillis=a.getTime();if(typeof name==='undefined'){this.nrOfCreatedPlaylists++;name='playlist '+this.nrOfCreatedPlaylists;}
if(typeof saved==='undefined'){saved=false;}
var newpl=new ManagedPlaylist(this,playlist,{'id':parseInt(timemillis),'name':name,'closable':closable,'public':public,'owner':owner,'reason_open':reason,'saved':saved,});this.managedPlaylists.push(newpl);this.refresh();return newpl;},newPlaylist:function(playlist,name){var newpl=this.newPlaylistNoShow(playlist,name);this.showPlaylist(newpl.id);return newpl;},newPlaylistNoShow:function(playlist,name){playlist=playlist||[];var newpl=this._createPlaylist(playlist,true,false,'me','ownwill',name,true);return newpl;},removePlayedFromPlaylist:function(){var mediaPlaylist=this.getEditingPlaylist().jplayerplaylist;for(var i=0;i<mediaPlaylist.playlist.length;i++){var wasPlayed=mediaPlaylist.playlist[i].wasPlayed>0;var isCurrentTrack=i==mediaPlaylist.current;var isBeforeCurrent=i<mediaPlaylist.current;var clearCurrent=!jPlayerIsPlaying();if(wasPlayed&&(!isCurrentTrack||clearCurrent)){mediaPlaylist.playlist.splice(i,1);i--;if(isBeforeCurrent){mediaPlaylist.current--;}}}
mediaPlaylist._refresh(true);},_getRepeatHandler:function(){var playlistManager=this;var _handleRepeat=function(event){var repeatState=event.jPlayer.options.loop;playlistManager.loop=repeatState;$.each(playlistManager.managedPlaylists,function(i,playlist){playlist.jplayerplaylist.loop=repeatState;});}
return _handleRepeat;}};MediaBrowser=function(cssSelector,json,title,enable_breadcrumbs,options){"use strict";this.listing_data_stack=[{'title':title,'data':json,'scroll':0,'listview':false}];this.cssSelector=cssSelector;$(this.cssSelector).css('left',0);if(typeof enable_breadcrumbs==='undefined'){enable_breadcrumbs=true;}
this.options=typeof options==='undefined'?{}:options;var self=this;var listdirclick=function(){"use strict";$(self.cssSelector+' .cm-media-list-category').animate({left:'-100%'},{duration:1000,queue:false});$(self.cssSelector).addClass('cm-media-list-busy');var last_scroll_pos=$(self.cssSelector).parent().parent().scrollTop();$(self.cssSelector).parent().parent().scrollTop(0);var next_mb_title='';var directory=$(this).attr("dir");var compactlisting=$(this).is("[filter]");var action='listdir';var dirdata={'directory':directory};if(compactlisting){action='compactlistdir';dirdata['filterstr']=$(this).attr("filter");next_mb_title='Filter: '+dirdata['filterstr'];}else{next_mb_title=$(this).text();}
var currdir=this;var success=function(json){$(self.cssSelector).removeClass('cm-media-list-busy');var last_stack_top=self.listing_data_stack[self.listing_data_stack.length-1];last_stack_top.scroll=last_scroll_pos;self.listing_data_stack.push({'title':next_mb_title,'data':json,'scroll':0,'listview':last_stack_top.listview});self.render();};var error=function(){$(self.cssSelector).removeClass('cm-media-list-busy');errorFunc('unable to list compact directory');}
api(action,dirdata,success,error);$(this).blur();return false;}
var view_list_enable=function(){self.listing_data_stack[self.listing_data_stack.length-1].listview=true;self.render();}
var view_cover_enable=function(){self.listing_data_stack[self.listing_data_stack.length-1].listview=false;self.render();}
this.go_to_parent=function(levels){if(typeof levels==='undefined'){levels=1;}
for(var i=0;i<levels;i++){self.listing_data_stack.pop();}}
this.render=function(){var stack_top=self.listing_data_stack[self.listing_data_stack.length-1]['data'];var listview_enabled=self.listing_data_stack[self.listing_data_stack.length-1].listview;var folders=[];var files=[];var compact=[];var playlist=[]
for(var i=0;i<stack_top.length;i++){var e=stack_top[i];if("file"==e.type){files.push(e);}else if("dir"==e.type){folders.push(e);}else if("compact"==e.type){compact.push(e);}else if("playlist"==e.type){playlist.push(e);}else{window.console.error('unknown media browser item '+e.type);}}
var filehtml=MediaBrowser.static._renderList(files,listview_enabled);var folderhtml=MediaBrowser.static._renderList(folders,listview_enabled);var compacthtml=MediaBrowser.static._renderList(compact,listview_enabled);var playlisthtml=MediaBrowser.static._renderList(playlist,listview_enabled);var html='';if(''!=folderhtml){html+='<div class="cm-media-list-category"><h3>Collections'+'<div class="input-group-btn btn-group-xs cm-media-list-view-change-buttons">'+'    <button type="button" class="mb-view-cover-enable btn btn-default">'+'        <span class="glyphicon glyphicon-th-large"></span>'+'    </button>'+'    <button type="button" class="mb-view-list-enable btn btn-default">'+'        <span class="glyphicon glyphicon-th-list"></span>'+'    </button>'+'</div>'+'</h3>'+'<ul class="cm-media-list">'+folderhtml+'</ul></div>';}
if(''!=filehtml){html+='<div class="cm-media-list-category"><h3>Tracks <a href="#" class="btn btn-default" '+'onclick="MediaBrowser.static._addAllToPlaylist($(this).parent().siblings(\'ul\'))">'+'add all tracks to current playlist</a>'+'</h3><ul class="cm-media-list">'+filehtml+'</ul></div>';}
if(''!=compacthtml){html+='<div class="cm-media-list-category"><h3>Compact</h3>'+'<ul class="cm-media-list">'+compacthtml+'</ul></div>';}
if(''!=playlisthtml||self.options.showPlaylistPanel){html+='<div class="cm-media-list-category"><h3>Playlists</h3>'+'<div class="row">'+'<div class="col-md-6">'+'<div class="btn-group input-group-sm">'+'<span class="input-group-addon">sort by</span>'+'<div class="input-group-btn">'+'<button type="button" class="btn btn-default" onclick="showPlaylists(\'title\', $(\'.playlist-filter-input\').val())">'+'<span class="glyphicon glyphicon-sort-by-alphabet"></span> title'+'</button>'+'<button type="button" class="btn btn-default" onclick="showPlaylists(\'username\', $(\'.playlist-filter-input\').val())">'+'<span class="glyphicon glyphicon-user"></span> user'+'</button>'+'<button type="button" class="btn btn-default" onclick="showPlaylists(\'age\', $(\'.playlist-filter-input\').val())">'+'<span class="glyphicon glyphicon-time"></span> age'+'</button>'+'</div>'+'</div>'+'</div>'+'<div class="col-md-6">'+'<div class="input-group input-group-sm">'+'<input type="text" class="playlist-filter-input form-control" placeholder="title or trackname"'+'onchange="showPlaylists(\'\', $(\'.playlist-filter-input\').val())">'+'<span class="input-group-btn">'+'<button type="submit" onclick="showPlaylists(\'\', $(\'.playlist-filter-input\').val())" class="btn btn-default">Search</button>'+'</span>'+'</div>'+'</div>'+'</div>'+'<ul class="cm-media-list">'+playlisthtml+'</ul></div>';}
if(''==html){html='<div class="cm-media-list-category"><ul class="cm-media-list">'+MediaBrowser.static._renderMessage('No playable media files here.')+'</ul></div>';}
if(enable_breadcrumbs){html='<ol class="breadcrumb"></ol>'+html;}
$(self.cssSelector).html(html);var create_jump_func=function(i){return function(){self.go_to_parent(self.listing_data_stack.length-1-i);self.render();};}
if(self.listing_data_stack.length>1){var node=$('<div class="cm-media-list-item cm-media-list-parent-item">'+'   <a class="cm-media-list-parent" href="javascript:;">'+'   <span class="glyphicon glyphicon-arrow-left"></span>'+'</a></div>');node.on('click',create_jump_func(self.listing_data_stack.length-2));$(this.cssSelector).prepend(node);}
if(enable_breadcrumbs){for(var i=0;i<self.listing_data_stack.length;i++){var title=self.listing_data_stack[i]['title'];var li='<li';if(i==self.listing_data_stack.length-1){li+=' class="active"';}
li+='><a href="#">'+title+'</a></li>';var $li=$(li);$li.on('click',create_jump_func(i));$(this.cssSelector+' .breadcrumb').append($li);}}
$(self.cssSelector).parent().parent().scrollTop(self.listing_data_stack[self.listing_data_stack.length-1].scroll);playlistManager.setTrackDestinationLabel();MediaBrowser.static.albumArtLoader('#search-panel');}
this.render();$(cssSelector).off('click');$(cssSelector).on('click','.list-dir',listdirclick);$(cssSelector).on('click','.compact-list-dir',listdirclick);$(cssSelector).on('click','.musicfile',MediaBrowser.static.addThisTrackToPlaylist);$(cssSelector).on('click','.cm-media-list-wrench',function(){var dirname=decodeURIComponent($(this).attr('data-dirname'));$('#changeAlbumArt').attr('data-dirname',$(this).attr('data-dirname'));$('#changeAlbumArt .foldername').text(dirname)
$('#changeAlbumArt').modal('show');});$(cssSelector).on('click','.mb-view-list-enable',view_list_enable);$(cssSelector).on('click','.mb-view-cover-enable',view_cover_enable);$(cssSelector).on('click','.addAllToPlaylist',function(){if(isplaylist){var pl=playlistManager.newPlaylist([],playlistlabel);}else{var pl=playlistManager.getEditingPlaylist();}
MediaBrowser.static._addAllToPlaylist($(this),pl.id);if(isplaylist){pl.setSaved(true);}
$(this).blur();return false;});}
MediaBrowser.static={_renderList:function(l,listview){"use strict";var self=this;var html="";$.each(l,function(i,e){switch(e.type){case'dir':html+=MediaBrowser.static._renderDirectory(e,listview);break;case'file':html+=MediaBrowser.static._renderFile(e);break;case'compact':html+=MediaBrowser.static._renderCompactDirectory(e);break;case'playlist':html+=MediaBrowser.static._renderPlaylist(e);break;default:window.console.log('cannot render unknown type '+e.type);}});return html;},_renderMessage:function(msg){var template=templateLoader.cached('mediabrowser-message');return Mustache.render(template,{message:msg});},_renderFile:function(json){var template=templateLoader.cached('mediabrowser-file');var template_data={fileurl:json.urlpath,fullpath:json.path,label:json.label,};return Mustache.render(template,template_data);},_renderDirectory:function(json,listview){var template=templateLoader.cached('mediabrowser-directory');var template_data={isrootdir:json.path&&!json.path.indexOf('/')>0,dirpath:json.path,label:json.label,listview:listview,maychangecoverart:!!isAdmin,coverarturl:encodeURIComponent(JSON.stringify({'directory':json.path})),directoryname:encodeURIComponent(json.path),foldercount:json.foldercount,showfoldercount:json.foldercount>0,filescount:json.filescount,showfilescount:json.filescount>0,filescountestimate:json.filescountestimate,};return Mustache.render(template,template_data);},_renderPlaylist:function(e){var template=templateLoader.cached('mediabrowser-playlist');var template_data={playlistid:e['plid'],isowner:e.owner,candelete:e.owner||isAdmin,playlistlabel:e['title'],encodedplaylistlabel:encodeURI(e['title']),username:e['username'],age:time2text(e['age']),username_color:userNameToColor(e.username),publicchecked:e['public']?'checked="checked"':'',publiclabelclass:e['public']?'label-success':'label-default',};return Mustache.render(template,template_data);},_renderCompactDirectory:function(json){var template=templateLoader.cached('mediabrowser-compact');var template_data={filepath:json.urlpath,filter:json.label,filterUPPER:json.label.toUpperCase(),};return Mustache.render(template,template_data);},addThisTrackToPlaylist:function(){"use strict"
playlistManager.addSong($(this).attr("path"),$(this).attr("title"));$(this).blur();return false;},_addAllToPlaylist:function($source,plid){"use strict";$source.find('li .musicfile').each(function(){playlistManager.addSong($(this).attr("path"),$(this).attr("title"),plid);});},albumArtLoader:function(cssSelector){"use strict";var winheight=$(window).height();var scrolled_down=$(cssSelector).scrollTop();var preload_threshold=50;$(cssSelector).find('.list-dir-albumart.unloaded').each(function(idx){var img_pos=$(this).position().top;var above_screen=img_pos<scrolled_down-preload_threshold;var below_screen=img_pos>winheight+scrolled_down+preload_threshold;if(!above_screen&&!below_screen){$(this).find('img').attr('src','api/fetchalbumart/?data='+$(this).attr('search-data'));$(this).removeClass('unloaded');}});var renderMetaData=function(selector,metainfo){console.log('renderMetaData');if(metainfo.artist.length>0&&metainfo.title.length>0){selector.find('.meta-info-artist').text(metainfo.artist);selector.find('.meta-info-title').text(metainfo.title);if(metainfo.track.length>0){if(metainfo.track.length<2){metainfo.track='0'+metainfo.track;}
selector.find('.meta-info-track').text(metainfo.track);}
selector.parent().find('.simplelabel').hide();}
if(metainfo.length){selector.find('.meta-info-length').text('('+jPlayerPlaylist.prototype._formatTime(metainfo.length)+')');}}
var fetch_meta_data=function(elem){var jqelem=$(elem);console.log('fetch_meta_data');var track_pos=jqelem.parent().position().top;var above_screen=track_pos<scrolled_down-preload_threshold;var below_screen=track_pos>winheight+scrolled_down+preload_threshold;if(!above_screen&&!below_screen){var self=jqelem;var path_url_enc=jqelem.attr('path');var success=function(data){$(self).show();var metainfo=$.parseJSON(data);renderMetaData($(self),metainfo);}
var complete=function(){jqelem.removeClass('unloaded');load_unloaded_meta_data(cssSelector);}
api('getsonginfo',{'path':decodeURIComponent(path_url_enc)},success,errorFunc('error getting song metainfo'),complete);}}
var load_unloaded_meta_data=function(cssSelector){console.log('load_unloaded_meta_data');var unloaded_metadata=$(cssSelector).find('.meta-info.unloaded');if(unloaded_metadata.length>0){fetch_meta_data(unloaded_metadata[0]);}}
load_unloaded_meta_data(cssSelector);},};var browser=detectBrowser();if(['msie','safari'].indexOf(browser)!=-1){var encoderPreferenceOrder=['mp3','ogg'];}else{var encoderPreferenceOrder=['opus','ogg','mp3'];}
var SERVER_CONFIG={};var availableEncoders=undefined;var availablejPlayerFormats=['opus','mp3','ogg'];var availableDecoders=undefined;var transcodingEnabled=undefined;var userOptions=undefined;var isAdmin=undefined;var loggedInUserName=undefined;var REMEMBER_PLAYLIST_INTERVAL=3000;var CHECK_MUSIC_PLAYING_INTERVAL=2000;var HEARTBEAT_INTERVAL_MS=30*1000;var playlistSelector='.jp-playlist';var previousSorted=undefined
var executeAfterConfigLoaded=[]
function api(){"use strict";var action=arguments[0];var has_data=!(typeof arguments[1]==='function');var data={};if(has_data){data=arguments[1];}
var successfunc=arguments[has_data?2:1];var errorfunc=arguments[has_data?3:2];var completefunc=arguments[has_data?4:3];if(!successfunc)successfunc=function(){};if(!completefunc)completefunc=function(){};var successFuncWrapper=function(successFunc){return function handler(json){var result=$.parseJSON(json);if(result.flash){successNotify(result.flash);}
successFunc(result.data);}}
var errorFuncWrapper=function(errorFunc){return function(httpstatus){if(httpstatus.status==401){reloadPage();}
errorFunc();}}
if(!errorfunc){errorfunc=function(){errorFunc('Error calling API function "'+action+'"')();};}
$.ajax({url:'api/'+action,context:$(this),type:'POST',data:{'data':JSON.stringify(data)},success:successFuncWrapper(successfunc),error:errorFuncWrapper(errorfunc),complete:completefunc,});}
htmlencode=function(val){return $('<div />').text(val?val:'').html();}
htmldecode=function(val){return $('<div />').html(val?val:'').text();}
function errorFunc(msg){"use strict";return function(){window.console.error('CMError: '+msg);displayNotification(msg,'error');};}
function successNotify(msg){return function(){displayNotification(msg,'success');};}
function hideNotification(selector){var notification=$(selector);if(notification.length){notification.fadeOut('slow',function(){notification.remove();});}}
function displayNotification(msg,type,duration){if(typeof duration==='undefined'){duration=5000;}
var selector='#errormessage:contains('+msg+')';var notificationExists=Boolean($(selector).length);if(notificationExists){return;}
var unique_class_id='notification-'+Math.floor(Math.random()*1000000);var cssclass;if(type=='error'){cssclass='alert-danger';}else if(type=='success'){cssclass='alert-success';}else{cssclass='alert-info';}
cssclass+=' '+unique_class_id;templateLoader.render_append('flash-message',{msg:msg,cssclass:cssclass,},$('#errormessage'));window.setTimeout('hideNotification(".'+unique_class_id+'")',duration)}
function loadConfig(executeAfter){"use strict";var success=function(data){var dictatedClientConfig=data;availableEncoders=dictatedClientConfig.getencoders;availableDecoders=dictatedClientConfig.getdecoders;transcodingEnabled=dictatedClientConfig.transcodingenabled;isAdmin=dictatedClientConfig.isadmin;loggedInUserName=dictatedClientConfig.username;SERVER_CONFIG={'available_encoders':dictatedClientConfig.getencoders,'available_decoders':dictatedClientConfig.getdecoders,'transcoding_enabled':dictatedClientConfig.transcodingenabled,'is_admin':dictatedClientConfig.isadmin,'user_name':dictatedClientConfig.username,'serve_path':dictatedClientConfig.servepath,'transcode_path':dictatedClientConfig.transcodepath,'auto_login':dictatedClientConfig.auto_login,'version':dictatedClientConfig.version,}
executeAfter();if(isAdmin){$('a[href="#adminpanel"]').show();}
if(SERVER_CONFIG.auto_login){$('#logout-menu-button').parent('li').addClass('disabled');$('#logout-menu-button').attr('onclick','');$('#logout-menu-button').attr('title','Cannot logout: Auto-Login enabled');}
$('#aboutModal #cherrymusic-version').html(SERVER_CONFIG.version)};var error=errorFunc("Could not fetch client configuration, CherryMusic will not work. Clearing the browser cache might help.");api('getconfiguration',{},success,error);}
function loadUserOptions(onSuccess){var success=function(userOptionsLoaded){userOptions=userOptionsLoaded;if(typeof onSuccess!=='undefined'){onSuccess();}
$('#custom_theme-primary_color').val(userOptions.custom_theme.primary_color);$('#custom_theme-white_on_black').attr('checked',userOptions.custom_theme.white_on_black);$('#keyboard_shortcuts-next').html(String.fromCharCode(userOptions.keyboard_shortcuts.next));$('#keyboard_shortcuts-prev').html(String.fromCharCode(userOptions.keyboard_shortcuts.prev));$('#keyboard_shortcuts-stop').html(String.fromCharCode(userOptions.keyboard_shortcuts.stop));$('#keyboard_shortcuts-play').html(String.fromCharCode(userOptions.keyboard_shortcuts.play));$('#keyboard_shortcuts-pause').html(String.fromCharCode(userOptions.keyboard_shortcuts.pause));$('#keyboard_shortcuts-search').html(String.fromCharCode(userOptions.keyboard_shortcuts.search));$('#misc-autoplay_on_add').attr('checked',userOptions.misc.autoplay_on_add);$('#ui-confirm_quit_dialog').attr('checked',userOptions.ui.confirm_quit_dialog);$('#ui-display_album_art').attr('checked',userOptions.ui.display_album_art);handle_useroption_force_transcode_bitrate();};api('getuseroptions',success);}
var waitForServerOptions=function(callback){var serverOptionsAreLoaded=Boolean(Object.keys(SERVER_CONFIG).length);if(!serverOptionsAreLoaded){var timeout=500;setTimeout(callback,timeout);return true;}
return false;};var handle_useroption_force_transcode_bitrate=function(){if(waitForServerOptions(handle_useroption_force_transcode_bitrate)){console.info('useroption handler waiting for server options...');return;}
var forced_bitrate=userOptions.media.force_transcode_to_bitrate;if(SERVER_CONFIG['transcoding_enabled']){var select="select[name='media-force_transcode_to_bitrate']";var selected=select+"> option[value='x']".replace(/x/,forced_bitrate);var deselected=selected.replace(/value=/,'value!=');$(selected).attr('selected','selected');$(deselected).removeAttr('selected');$("#media-force_transcode_to_bitrate-display").val(forced_bitrate);if([0,48,64,96,128,320].indexOf(forced_bitrate)<0){console.log("Unknown bitrate value:",forced_bitrate);}}else{var optionContainer=$("#media-force_transcode_to_bitrate-container");optionContainer.find(".success").hide();if(forced_bitrate){userOptions.media.force_transcode_to_bitrate=false;var msg='WARNING Cannot enforce bitrate limit of :value kbps: server does not transcode!';var extra=' <a href="#userOptions" role="button" class="btn btn-info" data-toggle="modal">Disable limit in options menu</a>';msg=msg.replace(/:value/,forced_bitrate);displayNotification(msg+extra,'error');var errorArea=optionContainer.find(".error");errorArea.find(".msg").html(msg);errorArea.show();}}};var optionSetter=function(name,val,success,error){busy('#userOptions .content').hide().fadeIn();api('setuseroption',{'optionkey':name,'optionval':val},function(){success();loadUserOptions();},error,function(){busy('#userOptions .content').fadeOut('fast');})}
keyboard_shortcut_setter=function(option,optionname){$('#shortcut-changer span').html('Hit any key to set shortcut for<br><b><i>'+optionname+'</i></b><br><br>Press <b>escape</b> or <b>space</b> to cancel.');$('#shortcut-changer').fadeIn('fast');$('#shortcut-changer input').val('');$('#shortcut-changer input').focus();var keydownhandler=function(e){if(e.altKey)return;if(e.shiftKey)return;if(e.ctrlKey)return;if(e.metaKey)return;var keyboardsetterend=function(){$('#shortcut-changer input').unbind('keydown',keydownhandler);$('html').unbind('keydown',keydownhandler);$('#shortcut-changer').fadeOut('fast');}
if(e.which&&e.which!==27&&e.which!==32){optionSetter(option,e.which,keyboardsetterend,keyboardsetterend);}
keyboardsetterend();return false;}
$('#shortcut-changer input').bind('keydown',keydownhandler);$('html').bind('keydown',keydownhandler);}
function busy(selector,rect){"use strict";var domelem=$(selector).children('.busy-indicator');if(domelem.length==0){domelem=$('<div></div>');domelem.addClass('busy-indicator');$(selector).append(domelem);}
var top,left,width,height;var pos=$(selector).position();top='top: '+pos.top+'px;';left='left: '+pos.left+'px;';width='width: '+$(selector).width()+'px;';height='height: '+$(selector).height()+'px;';domelem.attr('style','position: absolute;'+top+left+width+height);return domelem;}
function search($form){"use strict";var $input=$form.find('input');if($input.val().trim()==""){$input.val('');$input.prop('placeholder','Search for what?');$input.focus();return false;}
var searchstring=$input.val();var success=function(json){$('.searchinput').removeClass('searchinput-busy');new MediaBrowser('.search-results',json,'Search: '+htmlencode(searchstring));};var error=function(){$('.searchinput').removeClass('searchinput-busy');errorFunc('failed loading search results')();};$('.searchinput').addClass('searchinput-busy');api('search',{'searchstring':searchstring},success,error);return false;}
function submitsearch(){search();return false;}
ext2jPlayerFormat=function(ext){switch(ext){case"mp3":return"mp3";case"ogg":case"opus":case"oga":return"oga";case"m4a":case"mp4":case"aac":return"m4a";case"flac":return"flac"
case"wav":return"wav";case"weba":return"webma";}}
function savePlaylistAndHideDialog(){"use strict";var name=$('#playlisttitle').val();var pub=$('#playlistpublic').prop('checked')?true:false;if(name.trim()!==''){var pl=playlistManager.newPlaylistFromEditing();savePlaylist(pl.id,name,pub);$('#saveplaylistmodal').modal('hide');}
$(this).blur();return false;}
function savePlaylist(plid,playlistname,ispublic,overwrite){"use strict";var pl=playlistManager.getPlaylistById(plid);overwrite=Boolean(overwrite);ispublic=ispublic||pl.public;playlistname=playlistname||pl.name;var success=function(){playlistManager.getPlaylistById(plid).name=playlistname;playlistManager.getPlaylistById(plid).public=ispublic;playlistManager.getPlaylistById(plid).saved=true;playlistManager.refresh();playlistManager.showPlaylist(plid);}
busy('#playlist-panel').hide().fadeIn('fast');api('saveplaylist',{'playlist':pl.jplayerplaylist.playlist,'public':ispublic,'playlistname':playlistname,'overwrite':overwrite,},success,errorFunc('error saving playlist'),function(){busy('#playlist-panel').fadeOut('fast')});}
function getAddrPort(){m=(window.location+"").match(/(https?):\/\/([^/:]+)(?::(\d+))?/);return m[0];}
function ord(c)
{return c.charCodeAt(0);}
function showPlaylists(sortby,filterby){"use strict";var success=function(data){var addressAndPort=getAddrPort();var value_before=$('.playlist-filter-input').val();new MediaBrowser('.search-results',data,'Playlist browser',false,{showPlaylistPanel:true});$('.playlist-filter-input').val(value_before);};var error=errorFunc('error loading external playlists');if(sortby==previousSorted){sortby='-'+sortby;}
previousSorted=sortby;busy('.search-results').hide().fadeIn('fast');api('showplaylists',{'sortby':sortby,'filterby':filterby},success,error,function(){busy('.search-results').fadeOut('fast')});}
function changePlaylist(plid,attrname,value){window.console.log(plid);window.console.log(attrname);window.console.log(value);busy('#playlist-panel').hide().fadeIn('fast');api('changeplaylist',{'plid':plid,'attribute':attrname,'value':value},function(){showPlaylists();},errorFunc('error changing playlist attribute'),function(){busy('#playlist-panel').fadeOut('fast')});}
function confirmDeletePlaylist(id,title){$('#deletePlaylistConfirmButton').off();$('#deletePlaylistConfirmButton').on('click',function(){busy('#playlist-panel').hide().fadeIn('fast');api('deleteplaylist',{'playlistid':id},false,errorFunc('error deleting playlist'),function(){busy('#playlist-panel').fadeOut('fast')});$('#dialog').fadeOut('fast');showPlaylists();});$('#deleteplaylistmodalLabel').html(Mustache.render('Really delete Playlist "{{title}}"',{title:title}));$('#deleteplaylistmodal').modal('show');}
function loadPlaylist(playlistid,playlistlabel){var success=function(data){var tracklist=data;var pl=playlistManager.newPlaylist([],playlistlabel);var animate=false;for(var i=0;i<tracklist.length;i++){playlistManager.addSong(tracklist[i].urlpath,tracklist[i].label,pl.id,animate);}
pl.setSaved(true);pl.scrollToTrack(0);}
api('loadplaylist',{'playlistid':playlistid},success,errorFunc('error loading external playlist'),function(){busy('#playlist-panel').fadeOut('fast')})}
function loadPlaylistContent(playlistid,playlistlabel){"use strict";var pldomid="#playlist"+playlistid+' .playlist-content';if(''===$(pldomid).html().trim()){var success=function(data){new MediaBrowser(pldomid,data,playlistlabel,false);$("#playlist"+playlistid+' .playlist-detail-switch .glyphicon').toggleClass('glyphicon-chevron-right').toggleClass('glyphicon-chevron-down');};busy('#playlist-panel').hide().fadeIn('fast');api('loadplaylist',{'playlistid':playlistid},success,errorFunc('error loading external playlist'),function(){busy('#playlist-panel').fadeOut('fast')});}else{$(pldomid).slideToggle('slow');$("#playlist"+playlistid+' .playlist-detail-switch .glyphicon').toggleClass('glyphicon-chevron-right').toggleClass('glyphicon-chevron-down');}}
function randomPlaylist(){"use strict";playlistManager.clearQueue();var success=function(tracks){for(var i=0;i<tracks.length;i++){var track=tracks[i];playlistManager.addSong(track.urlpath,track.label)}};busy('#jplayer').hide().fadeIn('fast');api('generaterandomplaylist',success,errorFunc('error loading random playlist'),function(){busy('#jplayer').fadeOut('fast')});}
var lastPlaylistHeight=0;function resizePlaylistSlowly(){var currentHeight=$('.jp-playlist').height();if(lastPlaylistHeight<=currentHeight){$('#playlistContainerParent').animate({'min-height':currentHeight});}
lastPlaylistHeight=currentHeight;}
function download_editing_playlist(){var pl=playlistManager.getEditingPlaylist();var p=pl.jplayerplaylist.playlist;var track_urls=[];for(i=0;i<p.length;i++){track_urls.push(decodeURIComponent(p[i].url));}
api('downloadcheck',{'filelist':track_urls},function(msg){if(msg=='ok'){$('#download-redirect-files').val(encodeURIComponent(JSON.stringify(track_urls)));window.onbeforeunload=null
$('#download-redirect').submit();}else{alert(msg);}},errorFunc('Failed to check if playlist may be downloaded'));}
function reloadPage(){var reloadurl=window.location.protocol+'//'+window.location.host;window.location.href=reloadurl;}
function logout(){"use strict";api('logout',reloadPage);}
function TemplateLoader(template_path){this.template_path=template_path;this.loaded_templates={};var self=this;this.get=function(template_name,callback){if(this.loaded_templates.hasOwnProperty(template_name)){callback(this.loaded_templates[template_name]);}else{$.get(this.template_path+'/'+template_name+'.html',function(data){self.loaded_templates[template_name]=data;if(typeof callback==='undefined'){window.console.log('preloaded template '+template_name);}else{callback(self.loaded_templates[template_name]);}});}}
this.render=function(template_name,content,$jqobj){this.get(template_name,function(template){$jqobj.html(Mustache.render(template,content));});}
this.render_append=function(template_name,content,$jqobj){this.get(template_name,function(template){$jqobj.append(Mustache.render(template,content));});};this.cached=function(template_name){if(this.loaded_templates.hasOwnProperty(template_name)){return this.loaded_templates[template_name];}else{window.console.error('Can not return unloaded template '+template_name+'!');return'';}}}
var templateLoader=new TemplateLoader('res/templates');templateLoader.get('mediabrowser-directory');templateLoader.get('mediabrowser-file');templateLoader.get('mediabrowser-compact');templateLoader.get('mediabrowser-message');templateLoader.get('mediabrowser-playlist');templateLoader.get('flash-message');function updateUserList(){"use strict";var success=function(data){var htmllist="";var response=$.parseJSON(data);var time=response['time'];var template_user_data={'users':[]};$.each(response['userlist'],function(i,e){var reltime=time-e.last_time_online;template_user_data['users'].push({isadmin:e.admin,may_download:e.may_download,isnotadmin:!e.admin,isdeletable:e.deletable,userid:e.id,isonline:reltime<HEARTBEAT_INTERVAL_MS/500,username:e.username,username_color:userNameToColor(e.username),fuzzytime:time2text(reltime),});});templateLoader.get('user-list',function(template){$('#adminuserlist').html(Mustache.render(template,template_user_data));});};busy('#adminuserlist').hide().fadeIn('fast');api('getuserlist',success,errorFunc('cannot fetch user list'),function(){busy('#adminuserlist').fadeOut('fast')});}
function addNewUser(){"use strict";var newusername=$('#newusername').val();var newpassword=$('#newpassword').val();var newisadmin=$('#newisadmin').prop('checked')?1:0;if(newusername.trim()===''||newpassword.trim()===''){return;}
var success=function(data){$('#newusername').val('');$('#newpassword').val('');$('#newisadmin').prop('checked',false);updateUserList();};busy('#adminpanel').hide().fadeIn('fast');api('adduser',{'username':newusername,'password':newpassword,'isadmin':newisadmin},success,errorFunc('failed to add new user'),function(){busy('#adminpanel').fadeOut('fast')});}
function userDelete(userid){var success=function(data){updateUserList();};busy('#adminuserlist').hide().fadeIn('fast');api('userdelete',{'userid':userid},success,errorFunc('failed to delete user'),function(){busy('#adminuserlist').fadeOut('fast')});}
function userSetPermitDownload(userid,allow_download){var success=function(data){updateUserList();};busy('#adminuserlist').hide().fadeIn('fast');api('setuseroptionfor',{'optionkey':'media.may_download','optionval':allow_download,'userid':userid,},success,errorFunc('Failed to set user download state'),function(){busy('#adminuserlist').fadeOut('fast')});}
function userChangePassword(){if(!validateNewPassword($('#newpassword-change'),$('#repeatpassword-change'))){return false;}
var success=function(data){$('#changePassword').find('input').each(function(idx,el){$(el).val('');});$('#changePassword').modal('hide');$('#userOptions').modal('hide');successNotify('Password changed successfully!')();};var error=function(){$('#oldpassword-change').val('');$('#oldpassword-change').focus();$("#changePassword").modal('attention');};busy('#changePassword').hide().fadeIn('fast');api('userchangepassword',{'oldpassword':$('#oldpassword-change').val(),'newpassword':$('#newpassword-change').val()},success,error,function(){busy('#changePassword').fadeOut('fast');});}
function validateNewPassword($newpwfield,$repeatpwfield){var newpw=$newpwfield.val();var repeatpw=$repeatpwfield.val();if(newpw==repeatpw){$repeatpwfield.closest('.control-group').removeClass('error');return true;}
$repeatpwfield.closest('.control-group').addClass('error');return false;}
function userExportPlaylists(){var loc=window.location;var hostaddr=loc.protocol+'//'+loc.host;$('#exportPlaylists input[name=hostaddr]').val(hostaddr);$('#exportPlaylists form').submit();$('#exportPlaylists').modal('hide');$('#userOptions').modal('hide');}
function enableJplayerDebugging(){$('#jplayer_inspector').jPlayerInspector({jPlayer:$('#jquery_jplayer_1'),visible:true});$('#jquery_jplayer_1').data().jPlayer.options.errorAlerts=true;$('#jquery_jplayer_1').data().jPlayer.options.warningAlerts=true;$('#jplayer_inspector_update_0').click();}
function loadBrowser(directory,title){if(typeof directory==='undefined'){directory='';}
if(typeof title==='undefined'){title='Root';}
var success=function(data){new MediaBrowser('.search-results',data,title);};busy('#searchfield').hide().fadeIn('fast');api('listdir',{'directory':directory},success,errorFunc('failed to load file browser'),function(){busy('#searchfield').fadeOut('fast')});}
function endsWith(str,suffix){"use strict";return str.indexOf(suffix,str.length-suffix.length)!==-1;}
function getFileTypeByExt(filepath){"use strict";var extmatch=filepath.match(/.*?\.(\w+)$/);if(extmatch){return extmatch[1].toLowerCase();}}
function detectBrowser(){var browsers=['midori','firefox','msie','chrome','safari','opera']
for(var i=0;i<browsers.length;i++){if(navigator.userAgent.toLowerCase().indexOf(browsers[i])!=-1){return browsers[i];}}
return'unknown';}
function unixtime(){var d=new Date;return parseInt(d.getTime()/1000);}
function time2text(sec){var abssec=Math.abs(sec);var minutes=parseInt(abssec/60);var hours=parseInt(minutes/60)
var days=parseInt(hours/24);var weeks=parseInt(days/7);var months=parseInt(days/30);var years=parseInt(days/365);var t='';if(abssec<30){return'just now'}else{if(years!=0){t=years==1?'a year':years+' years';if(years>20){t='a long time';}}else if(months!=0){t=months==1?'a month':months+' months';}else if(weeks!=0){t=weeks==1?'a week':weeks+' weeks';}else if(days!=0){t=days==1?'a day':days+' days';}else if(hours!=0){t=hours==1?'an hour':hours+' hours';}else if(minutes!=0){t=minutes>25?'half an hour':minutes+' minutes';if(minutes==1){t='a minute';}}else{t='a few seconds'}
return sec>0?t+' ago':'in '+t;}}
function dec2Hex(dec){var hexChars="0123456789ABCDEF";var a=dec%16;var b=(dec-a)/16;hex=hexChars.charAt(b)+hexChars.charAt(a);return hex;}
function userNameToColor(username){username=username.toUpperCase();username+='AAA';var g=((ord(username[0])-65)*255)/30;var b=((ord(username[1])-65)*255)/30;var r=((ord(username[2])-65)*255)/30;return'#'+dec2Hex(r)+dec2Hex(g)+dec2Hex(b);}
function initKeyboardshortcuts(){$(window.document).bind('keydown',keyboardShortcuts);$(document).keydown(function(e){var focusedElement=$("*:focus");var inputFieldFocused=focusedElement.length>0;var key=e.charCode?e.charCode:e.keyCode?e.keyCode:0;if(key===32&&!inputFieldFocused)e.preventDefault();});}
function keyboardShortcuts(e){if(e.altKey)return;if(e.shiftKey)return;if(e.ctrlKey)return;if(e.metaKey)return;var actions={'next':function(e){playlistManager.cmd_next()},'pause':function(e){playlistManager.cmd_pause()},'play':function(e){playlistManager.cmd_play()},'prev':function(e){playlistManager.cmd_previous()},'search':function(e){$('#searchform input').focus().select();e.preventDefault();},'stop':function(e){playlistManager.cmd_stop()},};var mediaKeys={'MediaNextTrack':'next','MediaPlayPause':'pause','MediaPreviousTrack':'prev','MediaStop':'stop'};var triggerAction=function(action){window.console.log('triggering: '+action);actions[action](e);};if(e.key&&mediaKeys[e.key]){triggerAction(mediaKeys[e.key]);}else{var focusedElement=$("*:focus");var inputFieldFocused=focusedElement.length>0;if(inputFieldFocused){if(e.which===27){focusedElement.blur();}}else if(e.which===32){triggerAction('pause');}else{for(var action in actions){if(e.which===userOptions.keyboard_shortcuts[action]&&userOptions.keyboard_shortcuts[action]){triggerAction(action);break;}}}}}
function sendHeartBeat(){api('heartbeat',function(){},errorFunc('connection to server lost'),true)
window.setTimeout('sendHeartBeat()',HEARTBEAT_INTERVAL_MS);}
function userOptionCheckboxListener(htmlid,optionname){REQUIRES_RELOAD_ON_ENABLE=['#ui-confirm_quit_dialog'];$(htmlid).on('change',function(){var self=this;optionSetter(optionname,$(this).is(':checked'),function(){if($(self).is(':checked')){if(REQUIRES_RELOAD_ON_ENABLE.indexOf(htmlid)!=-1){alert('You need to reload the page for this setting to take effect.')}}},errorFunc('Error setting option! '+optionname));});}
function userOptionMultivalListener(selector,optionname){$(selector).on('change',function(){var self=this;optionSetter(optionname,$(this).val(),function(){},errorFunc('Error setting option! '+optionname));});}
function show_ui_conditionally(selectors,conditions_table){var conditions_met=[];for(var condition_name in conditions_table){if(conditions_table.hasOwnProperty(condition_name)){if(conditions_table[condition_name]){conditions_met.push(condition_name);}}}
if(!selectors instanceof Array){selectors=[selectors];}
for(var i=0;i<selectors.length;i++){$(selectors[i]+' > [show-cond]').each(function(i,e){var ui_element=$(e);var conditions_needed=ui_element.attr('show-cond').split(' ');ui_element.show();$.each(conditions_needed,function(i,e){if(conditions_met.indexOf(e)<0){ui_element.hide();return false;}});});}}
function jPlayerIsPlaying(){return!$('#jquery_jplayer_1').data().jPlayer.status.paused;}
function dontCloseWindowIfMusicPlays(){if(userOptions.ui.confirm_quit_dialog){if(jPlayerIsPlaying()){if(window.onbeforeunload===null){window.onbeforeunload=function(){return"This will stop the playback. Do you really want to close CherryMusic?";}}}else{if(window.onbeforeunload!==null){window.onbeforeunload=null;}}
window.setTimeout("dontCloseWindowIfMusicPlays()",CHECK_MUSIC_PLAYING_INTERVAL)}else{window.onbeforeunload=null;}}
function searchAlbumArt(){busy('#changeAlbumArt .modal-body').hide().fadeIn('fast');var success=function(urllist){$('.coverart-tryout').html('');for(var i=0;i<urllist.length;i++){var html='<div class="album-art-choice">'+'<img width="80" height="80" src="'+urllist[i]+'"'+' onclick="pickCoverArt($(this))" '+'" />'+'</div>';$('.coverart-tryout').append(html);}}
api('fetchalbumarturls',{'searchterm':$('#albumart-search-term').val()},success,errorFunc('Error fetching image urls'),function(){busy('#changeAlbumArt .modal-body').fadeOut('fast')});}
function pickCoverArt(img){var imagesrc=$(img).attr('src');var dirname=decodeURIComponent($('#changeAlbumArt').attr('data-dirname'));var success=function(){$('#changeAlbumArt').modal('hide');var folder_div=$('.list-dir[dir="'+dirname+'"]')
var folder_image=folder_div.find('img');folder_image.attr('src',folder_image.attr('src')+'&reload=1');}
api('albumart_set',{'directory':dirname,'imageurl':imagesrc,},success);}
function displayMessageOfTheDay(){api('getmotd',function(resp){if(resp.type=='update'){html=Mustache.render('<a href="http://fomori.org/cherrymusic/">'+'CherryMusic {{version}} is available!'+'<h2>download now →</h2>'+'</a><hr>'+'<h3>{{features_count}} new {{feature_title}}:</h3>'+'<ul class="feature-list">'+'   {{#features}}<li>{{.}}</li>{{/features}}'+'</ul>'+'<h3>{{fixes_count}} {{fixes_title}}:</h3>'+'<ul class="feature-list">'+'   {{#fixes}}<li>{{.}}</li>{{/fixes}}'+'</ul><hr>'+'<p>'+'   And a lot of other stuff, see the'+'   <a href="https://github.com/devsnd/cherrymusic/blob/{{version}}/CHANGES" target="_blank">'+'   CHANGELOG</a>.'+'</p>',{version:resp.data.version,features:resp.data.features,features_count:resp.data.features.length,feature_title:resp.data.features.length>1?'features':'feature',fixes:resp.data.fixes,fixes_count:resp.data.fixes.length,fixes_title:resp.data.fixes.length>1?'fixes':'fix',});$('#motd').html(html);}else if(resp.type=='wisdom'){$('#motd').html('useless wisdom<hr>'+resp.data);}else{window.console.error('unknown motd type '+resp.type);}},errorFunc('could not fetch message of the day'));}
var playlistManager;$(document).ready(function(){"use strict";$('#playlistBrowser').hide();loadConfig(function(){playlistManager=new PlaylistManager();$('#username-label').text('('+loggedInUserName+')');});loadUserOptions(function(){initKeyboardshortcuts();dontCloseWindowIfMusicPlays();$('#albumart').toggle(userOptions.ui.display_album_art)});$('#search-panel').on('scroll',function(){MediaBrowser.static.albumArtLoader('#search-panel');});$('div#progressscreen').fadeOut('slow');$('#searchform .searchinput').focus();sendHeartBeat();displayMessageOfTheDay();$('#adminpanel').on('shown.bs.modal',function(e){updateUserList();});$('#save-playlist-from-queue').on('click',function(){$('#playlisttitle').val('');$("#playlistpublic").attr("checked",true);});$('#saveplaylistmodal').on('shown.bs.modal',function(){$('#playlisttitle').focus();$('#playlisttitle').bind('keyup',function(e){if(e.which===13){savePlaylistAndHideDialog();}else if(e.which===27){$('#saveplaylistmodal').modal('hide');}});});$('#saveplaylistmodal').on('hide',function(){$('#playlisttitle').unbind('keyup');});$('#changeAlbumArt').on('shown.bs.modal',function(){$('#changeAlbumArt .coverart-tryout').empty();$("#albumart-search-term").val(decodeURIComponent($('#changeAlbumArt').attr('data-dirname')));$("#albumart-search-term").focus();$("#albumart-search-term").off('keypress').on('keypress',function(e){if(e.keyCode=='13'||e.which=='13'){searchAlbumArt();}});});$('#changePassword').on('show.bs.modal',function(){});userOptionCheckboxListener('#misc-show_playlist_download_buttons','misc.show_playlist_download_buttons');userOptionCheckboxListener('#misc-autoplay_on_add','misc.autoplay_on_add');userOptionCheckboxListener('#ui-confirm_quit_dialog','ui.confirm_quit_dialog');userOptionCheckboxListener('#ui-display_album_art','ui.display_album_art');userOptionMultivalListener("select[name='media-force_transcode_to_bitrate']",'media.force_transcode_to_bitrate');$('#media-force_transcode_to_bitrate-disable').click(function(){optionSetter('media.force_transcode_to_bitrate',0,function(){$('#media-force_transcode_to_bitrate-disable').closest('.error').hide();});});$('#ui-display_album_art').click(function(){$('#albumart').toggle($('#ui-display_album_art').prop('checked'));});});;