(function(window,undefined){var document=window.document;var jQuery=(function(){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},_jQuery=window.jQuery,_$=window.$,rootjQuery,quickExpr=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rwhite=/\s/,trimLeft=/^\s+/,trimRight=/\s+$/,rnonword=/\W/,rdigit=/\d/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,rvalidchars=/^[\],:{}\s]*$/,rvalidescape=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rvalidtokens=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rwebkit=/(webkit)[ \/]([\w.]+)/,ropera=/(opera)(?:.*version)?[ \/]([\w.]+)/,rmsie=/(msie) ([\w.]+)/,rmozilla=/(mozilla)(?:.*? rv:([\w.]+))?/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwn=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,trim=String.prototype.trim,indexOf=Array.prototype.indexOf,class2type={};jQuery.fn=jQuery.prototype={init:function(selector,context){var match,elem,ret,doc;if(!selector){return this}if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}if(selector==="body"&&!context&&document.body){this.context=document;this[0]=document.body;this.selector="body";this.length=1;return this}if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true)}else{selector=[doc.createElement(ret[1])]}}else{ret=jQuery.buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes}return jQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem&&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&&!rnonword.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector);return jQuery.merge(this,selector);}else if(!context||context.jquery){return(context||rootjQuery).find(selector);}else{return jQuery(context).find(selector)}}else if(jQuery.isFunction(selector)){return rootjQuery.ready(selector)}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}return jQuery.makeArray(selector,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},toArray:function(){return slice.call(this,0)},get:function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num])},pushStack:function(elems,name,selector){var ret=jQuery();if(jQuery.isArray(elems)){push.apply(ret,elems)}else{jQuery.merge(ret,elems)}ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector}else if(name){ret.selector=this.selector+"."+name+"("+selector+")"}return ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery);}else if(readyList){readyList.push(fn)}return this},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},end:function(){return this.prevObject||jQuery(null)},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,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({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isReady:false,readyWait:1,ready:function(wait){if(wait===true){jQuery.readyWait--}if(!jQuery.readyWait||(wait!==true&&!jQuery.isReady)){if(!document.body){return setTimeout(jQuery.ready,1)}jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return}if(readyList){var fn,i=0,ready=readyList;readyList=null;while((fn=ready[i++])){fn.call(document,jQuery)}if(jQuery.fn.trigger){jQuery(document).trigger("ready").unbind("ready")}}}},bindReady:function(){if(readyBound){return}readyBound=true;if(document.readyState==="complete"){return setTimeout(jQuery.ready,1)}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null}catch(e){}if(document.documentElement.doScroll&&toplevel){doScrollCheck()}}},isFunction:function(obj){return jQuery.type(obj)==="function"},isArray:Array.isArray||function(obj){return jQuery.type(obj)==="array"},isWindow:function(obj){return obj&&typeof obj==="object"&&"setInterval"in obj},isNaN:function(obj){return obj==null||!rdigit.test(obj)||isNaN(obj)},type:function(obj){return obj==null?String(obj):class2type[toString.call(obj)]||"object"},isPlainObject:function(obj){if(!obj||jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false}if(obj.constructor&&!hasOwn.call(obj,"constructor")&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false}var key;for(key in obj){}return key===undefined||hasOwn.call(obj,key)},isEmptyObject:function(obj){for(var name in obj){return false}return true},error:function(msg){throw msg},parseJSON:function(data){if(typeof data!=="string"||!data){return null}data=jQuery.trim(data);if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return window.JSON&&window.JSON.parse?window.JSON.parse(data):(new Function("return "+data))()}else{jQuery.error("Invalid JSON: "+data)}},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data))}else{script.text=data}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase()},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},trim:trim?function(text){return text==null?"":trim.call(text)}:function(text){return text==null?"":text.toString().replace(trimLeft,"").replace(trimRight,"")},makeArray:function(array,results){var ret=results||[];if(array!=null){var type=jQuery.type(array);if(array.length==null||type==="string"||type==="function"||type==="regexp"||jQuery.isWindow(array)){push.call(ret,array)}else{jQuery.merge(ret,array)}}return ret},inArray:function(elem,array){if(array.indexOf){return array.indexOf(elem)}for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return-1},merge:function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j]}}else{while(second[j]!==undefined){first[i++]=second[j++]}}first.length=i;return first},grep:function(elems,callback,inv){var ret=[],retVal;inv=!!inv;for(var i=0,length=elems.length;i<length;i++){retVal=!!callback(elems[i],i);if(inv!==retVal){ret.push(elems[i])}}return ret},map:function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value}}return ret.concat.apply([],ret)},guid:1,proxy:function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined}else if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined}}if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments)}}if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++}return proxy},access:function(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){jQuery.access(elems,k,key[k],exec,fn,value)}return elems}if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass)}return elems}return length?fn(elems[0],key):undefined},now:function(){return(new Date()).getTime()},uaMatch:function(ua){ua=ua.toLowerCase();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"}},browser:{}});jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase()});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version}if(jQuery.browser.webkit){jQuery.browser.safari=true}if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem)}}if(!rwhite.test("\xA0")){trimLeft=/^[\s\xA0]+/;trimRight=/[\s\xA0]+$/}rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready()}}else if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready()}}}function doScrollCheck(){if(jQuery.isReady){return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(doScrollCheck,1);return}jQuery.ready()}return(window.jQuery=window.$=jQuery)})();(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+jQuery.now();div.style.display="none";div.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0],select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));if(!all||!all.length||!a){return}jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:opt.selected,deleteExpando:true,optDisabled:false,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};select.disabled=true;jQuery.support.optDisabled=!opt.disabled;script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"))}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id]}try{delete script.test}catch(e){jQuery.support.deleteExpando=false}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click)});div.cloneNode(true).fireEvent("onclick")}div=document.createElement("div");div.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var fragment=document.createDocumentFragment();fragment.appendChild(div.firstChild);jQuery.support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;if("zoom"in div.style){div.style.display="inline";div.style.zoom=1;jQuery.support.inlineBlockNeedsLayout=div.offsetWidth===2;div.style.display="";div.innerHTML="<div style='width:4px;'></div>";jQuery.support.shrinkWrapBlocks=div.offsetWidth!==2}div.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var tds=div.getElementsByTagName("td");jQuery.support.reliableHiddenOffsets=tds[0].offsetHeight===0;tds[0].style.display="";tds[1].style.display="none";jQuery.support.reliableHiddenOffsets=jQuery.support.reliableHiddenOffsets&&tds[0].offsetHeight===0;div.innerHTML="";document.body.removeChild(div).style.display="none";div=tds=null});var eventSupported=function(eventName){var el=document.createElement("div");eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function"}el=null;return isSupported};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null})();var windowData={},rbrace=/^(?:\{.*\}|\[.*\])$/;jQuery.extend({cache:{},uuid:0,expando:"jQuery"+jQuery.now(),noData:{"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","applet":true},data:function(elem,name,data){if(!jQuery.acceptData(elem)){return}elem=elem==window?windowData:elem;var isNode=elem.nodeType,id=isNode?elem[jQuery.expando]:null,cache=jQuery.cache,thisCache;if(isNode&&!id&&typeof name==="string"&&data===undefined){return}if(!isNode){cache=elem;}else if(!id){elem[jQuery.expando]=id=++jQuery.uuid}if(typeof name==="object"){if(isNode){cache[id]=jQuery.extend(cache[id],name)}else{jQuery.extend(cache,name)}}else if(isNode&&!cache[id]){cache[id]={}}thisCache=isNode?cache[id]:cache;if(data!==undefined){thisCache[name]=data}return typeof name==="string"?thisCache[name]:thisCache},removeData:function(elem,name){if(!jQuery.acceptData(elem)){return}elem=elem==window?windowData:elem;var isNode=elem.nodeType,id=isNode?elem[jQuery.expando]:elem,cache=jQuery.cache,thisCache=isNode?cache[id]:id;if(name){if(thisCache){delete thisCache[name];if(isNode&&jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem)}}}else{if(isNode&&jQuery.support.deleteExpando){delete elem[jQuery.expando]}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando);}else if(isNode){delete cache[id];}else{for(var n in elem){delete elem[n]}}}},acceptData:function(elem){if(elem.nodeName){var match=jQuery.noData[elem.nodeName.toLowerCase()];if(match){return!(match===true||elem.getAttribute("classid")!==match)}}return true}});jQuery.fn.extend({data:function(key,value){var data=null;if(typeof key==="undefined"){if(this.length){var attr=this[0].attributes,name;data=jQuery.data(this[0]);for(var i=0,l=attr.length;i<l;i++){name=attr[i].name;if(name.indexOf("data-")===0){name=name.substr(5);dataAttr(this[0],name,data[name])}}}return data}else if(typeof key==="object"){return this.each(function(){jQuery.data(this,key)})}var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key);data=dataAttr(this[0],key,data)}return data===undefined&&parts[1]?this.data(parts[0]):data}else{return this.each(function(){var $this=jQuery(this),args=[parts[0],value];$this.triggerHandler("setData"+parts[1]+"!",args);jQuery.data(this,key,value);$this.triggerHandler("changeData"+parts[1]+"!",args)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}});function dataAttr(elem,key,data){if(data===undefined&&elem.nodeType===1){data=elem.getAttribute("data-"+key);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:!jQuery.isNaN(data)?parseFloat(data):rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}jQuery.data(elem,key,data)}else{data=undefined}}return data}jQuery.extend({queue:function(elem,type,data){if(!elem){return}type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[]}if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data))}else{q.push(data)}return q},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift()}if(fn){if(type==="fx"){queue.unshift("inprogress")}fn.call(elem,function(){jQuery.dequeue(elem,type)})}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx"}if(data===undefined){return jQuery.queue(this[0],type)}return this.each(function(i){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type)},time)})},clearQueue:function(type){return this.queue(type||"fx",[])}});var rclass=/[\n\t]/g,rspaces=/\s+/,rreturn=/\r/g,rspecialurl=/^(?:href|src|style)$/,rtype=/^(?:button|input)$/i,rfocusable=/^(?:button|input|object|select|textarea)$/i,rclickable=/^a(?:rea)?$/i,rradiocheck=/^(?:radio|checkbox)$/i;jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};jQuery.fn.extend({attr:function(name,value){return jQuery.access(this,name,value,true,jQuery.attr)},removeAttr:function(name,fn){return this.each(function(){jQuery.attr(this,name,"");if(this.nodeType===1){this.removeAttribute(name)}})},addClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")))})}if(value&&typeof value==="string"){var classNames=(value||"").split(rspaces);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value}else{var className=" "+elem.className+" ",setClass=elem.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c]}}elem.className=jQuery.trim(setClass)}}}}return this},removeClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")))})}if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspaces);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ")}elem.className=jQuery.trim(className)}else{elem.className=""}}}}return this},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal)})}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspaces);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className)}}else if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className)}this.className=this.className||value===false?"":jQuery.data(this,"__className__")||""}})},hasClass:function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true}}return false},val:function(value){if(!arguments.length){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected&&(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}if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value}return(elem.value||"").replace(rreturn,"")}return undefined}var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return}if(isFunction){val=value.call(this,i,self.val())}if(val==null){val=""}else if(typeof val==="number"){val+=""}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+""})}if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0}else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);jQuery("option",this).each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0});if(!values.length){this.selectedIndex=-1}}else{this.value=val}})}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value)}var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex}}}if((name in elem||elem[name]!==undefined)&&notxml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){jQuery.error("type property can't be changed")}if(value===null){if(elem.nodeType===1){elem.removeAttribute(name)}}else{elem[name]=value}}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}return elem[name]}if(!jQuery.support.style&&notxml&&name==="style"){if(set){elem.style.cssText=""+value}return elem.style.cssText}if(set){elem.setAttribute(name,""+value)}if(!elem.attributes[name]&&(elem.hasAttribute&&!elem.hasAttribute(name))){return undefined}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}});var rnamespaces=/\.(.*)$/,rformElems=/^(?:textarea|input|select)$/i,rperiod=/\./g,rspace=/ /g,rescape=/[^\w\s.|`]/g,fcleanup=function(nm){return nm.replace(rescape,"\\$&")},focusCounts={focusin:0,focusout:0};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return}if(jQuery.isWindow(elem)&&(elem!==window&&!elem.frameElement)){elem=window}if(handler===false){handler=returnFalse}else if(!handler){return}var handleObjIn,handleObj;if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler}if(!handler.guid){handler.guid=jQuery.guid++}var elemData=jQuery.data(elem);if(!elemData){return}var eventKey=elem.nodeType?"events":"__events__",events=elemData[eventKey],eventHandle=elemData.handle;if(typeof events==="function"){eventHandle=events.handle;events=events.events}else if(!events){if(!elem.nodeType){elemData[eventKey]=elemData=function(){}}elemData.events=events={}}if(!eventHandle){elemData.handle=eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined}}eventHandle.elem=elem;types=types.split(" ");var type,i=0,namespaces;while((type=types[i++])){handleObj=handleObjIn?jQuery.extend({},handleObjIn):{handler:handler,data:data};if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();handleObj.namespace=namespaces.slice(0).sort().join(".")}else{namespaces=[];handleObj.namespace=""}handleObj.type=type;if(!handleObj.guid){handleObj.guid=handler.guid}var handlers=events[type],special=jQuery.event.special[type]||{};if(!handlers){handlers=events[type]=[];if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle,false)}else if(elem.attachEvent){elem.attachEvent("on"+type,eventHandle)}}}if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}handlers.push(handleObj);jQuery.event.global[type]=true}elem=null},global:{},remove:function(elem,types,handler,pos){if(elem.nodeType===3||elem.nodeType===8){return}if(handler===false){handler=returnFalse}var ret,type,fn,j,i=0,all,namespaces,namespace,special,eventType,handleObj,origType,eventKey=elem.nodeType?"events":"__events__",elemData=jQuery.data(elem),events=elemData&&elemData[eventKey];if(!elemData||!events){return}if(typeof events==="function"){elemData=events;events=events.events}if(types&&types.type){handler=types.handler;types=types.type}if(!types||typeof types==="string"&&types.charAt(0)==="."){types=types||"";for(type in events){jQuery.event.remove(elem,type+types)}return}types=types.split(" ");while((type=types[i++])){origType=type;handleObj=null;all=type.indexOf(".")<0;namespaces=[];if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+jQuery.map(namespaces.slice(0).sort(),fcleanup).join("\\.(?:.*\\.)?")+"(\\.|$)")}eventType=events[type];if(!eventType){continue}if(!handler){for(j=0;j<eventType.length;j++){handleObj=eventType[j];if(all||namespace.test(handleObj.namespace)){jQuery.event.remove(elem,origType,handleObj.handler,j);eventType.splice(j--,1)}}continue}special=jQuery.event.special[type]||{};for(j=pos||0;j<eventType.length;j++){handleObj=eventType[j];if(handler.guid===handleObj.guid){if(all||namespace.test(handleObj.namespace)){if(pos==null){eventType.splice(j--,1)}if(special.remove){special.remove.call(elem,handleObj)}}if(pos!=null){break}}}if(eventType.length===0||pos!=null&&eventType.length===1){if(!special.teardown||special.teardown.call(elem,namespaces)===false){jQuery.removeEvent(elem,type,elemData.handle)}ret=null;delete events[type]}}if(jQuery.isEmptyObject(events)){var handle=elemData.handle;if(handle){handle.elem=null}delete elemData.events;delete elemData.handle;if(typeof elemData==="function"){jQuery.removeData(elem,eventKey)}else if(jQuery.isEmptyObject(elemData)){jQuery.removeData(elem)}}},trigger:function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[jQuery.expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true}if(!elem){event.stopPropagation();if(jQuery.event.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem)}})}}if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event)}event.currentTarget=elem;var handle=elem.nodeType?jQuery.data(elem,"handle"):(jQuery.data(elem,"__events__")||{}).handle;if(handle){handle.apply(elem,data)}var parent=elem.parentNode||elem.ownerDocument;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){if(elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false;event.preventDefault()}}}catch(inlineError){}if(!event.isPropagationStopped()&&parent){jQuery.event.trigger(event,data,parent,true)}else if(!event.isDefaultPrevented()){var old,target=event.target,targetType=type.replace(rnamespaces,""),isClick=jQuery.nodeName(target,"a")&&targetType==="click",special=jQuery.event.special[targetType]||{};if((!special._default||special._default.call(elem,event)===false)&&!isClick&&!(target&&target.nodeName&&jQuery.noData[target.nodeName.toLowerCase()])){try{if(target[targetType]){old=target["on"+targetType];if(old){target["on"+targetType]=null}jQuery.event.triggered=true;target[targetType]()}}catch(triggerError){}if(old){target["on"+targetType]=old}jQuery.event.triggered=false}}},handle:function(event){var all,handlers,namespaces,namespace_re,events,namespace_sort=[],args=jQuery.makeArray(arguments);event=args[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;all=event.type.indexOf(".")<0&&!event.exclusive;if(!all){namespaces=event.type.split(".");event.type=namespaces.shift();namespace_sort=namespaces.slice(0).sort();namespace_re=new RegExp("(^|\\.)"+namespace_sort.join("\\.(?:.*\\.)?")+"(\\.|$)")}event.namespace=event.namespace||namespace_sort.join(".");events=jQuery.data(this,this.nodeType?"events":"__events__");if(typeof events==="function"){events=events.events}handlers=(events||{})[event.type];if(events&&handlers){handlers=handlers.slice(0);for(var j=0,l=handlers.length;j<l;j++){var handleObj=handlers[j];if(all||namespace_re.test(handleObj.namespace)){event.handler=handleObj.handler;event.data=handleObj.data;event.handleObj=handleObj;var ret=handleObj.handler.apply(this,args);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation()}}if(event.isImmediatePropagationStopped()){break}}}}return event.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[jQuery.expando]){return event}var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop]}if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType===3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}if(event.which==null&&(event.charCode!=null||event.keyCode!=null)){event.which=event.charCode!=null?event.charCode:event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},guid:1E8,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add:function(handleObj){jQuery.event.add(this,liveConvert(handleObj.origType,handleObj.selector),jQuery.extend({},handleObj,{handler:liveHandler,guid:handleObj.handler.guid}))},remove:function(handleObj){jQuery.event.remove(this,liveConvert(handleObj.origType,handleObj.selector),handleObj)}},beforeunload:{setup:function(data,namespaces,eventHandle){if(jQuery.isWindow(this)){this.onbeforeunload=eventHandle}},teardown:function(namespaces,eventHandle){if(this.onbeforeunload===eventHandle){this.onbeforeunload=null}}}}};jQuery.removeEvent=document.removeEventListener?function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle,false)}}:function(elem,type,handle){if(elem.detachEvent){elem.detachEvent("on"+type,handle)}};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src)}if(src&&src.type){this.originalEvent=src;this.type=src.type;}else{this.type=src}this.timeStamp=jQuery.now();this[jQuery.expando]=true};function returnFalse(){return false}function returnTrue(){return true}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return}if(e.preventDefault){e.preventDefault();}else{e.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return}if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation()},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;try{while(parent&&parent!==this){parent=parent.parentNode}if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments)}}catch(e){}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments)};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={setup:function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig)},teardown:function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement)}}});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(data,namespaces){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){e.liveFired=undefined;return trigger("submit",this,arguments)}});jQuery.event.add(this,"keypress.specialSubmit",function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){e.liveFired=undefined;return trigger("submit",this,arguments)}})}else{return false}},teardown:function(namespaces){jQuery.event.remove(this,".specialSubmit")}}}if(!jQuery.support.changeBubbles){var changeFilters,getVal=function(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked}else if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options,function(elem){return elem.selected}).join("-"):""}else if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex}return val},testChange=function testChange(e){var elem=e.target,data,val;if(!rformElems.test(elem.nodeName)||elem.readOnly){return}data=jQuery.data(elem,"_change_data");val=getVal(elem);if(e.type!=="focusout"||elem.type!=="radio"){jQuery.data(elem,"_change_data",val)}if(data===undefined||val===data){return}if(data!=null||val){e.type="change";e.liveFired=undefined;return jQuery.event.trigger(e,arguments[1],elem)}};jQuery.event.special.change={filters:{focusout:testChange,beforedeactivate:testChange,click:function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e)}},keydown:function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return testChange.call(this,e)}},beforeactivate:function(e){var elem=e.target;jQuery.data(elem,"_change_data",getVal(elem))}},setup:function(data,namespaces){if(this.type==="file"){return false}for(var type in changeFilters){jQuery.event.add(this,type+".specialChange",changeFilters[type])}return rformElems.test(this.nodeName)},teardown:function(namespaces){jQuery.event.remove(this,".specialChange");return rformElems.test(this.nodeName)}};changeFilters=jQuery.event.special.change.filters;changeFilters.focus=changeFilters.beforeactivate}function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args)}if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){jQuery.event.special[fix]={setup:function(){if(focusCounts[fix]++===0){document.addEventListener(orig,handler,true)}},teardown:function(){if(--focusCounts[fix]===0){document.removeEventListener(orig,handler,true)}}};function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.trigger(e,null,e.target)}})}jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn)}return this}if(jQuery.isFunction(data)||data===false){fn=data;data=undefined}var handler=name==="one"?jQuery.proxy(fn,function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments)}):fn;if(type==="unload"&&name!=="one"){this.one(type,data,fn)}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.add(this[i],type,handler,data)}}return this}});jQuery.fn.extend({unbind:function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key])}}else{for(var i=0,l=this.length;i<l;i++){jQuery.event.remove(this[i],type,fn)}}return this},delegate:function(selector,types,data,fn){return this.live(types,data,fn,selector)},undelegate:function(selector,types,fn){if(arguments.length===0){return this.unbind("live")}else{return this.die(types,null,fn,selector)}},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++])}return this.click(jQuery.proxy(fn,function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)}});var liveMap={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};jQuery.each(["live","die"],function(i,name){jQuery.fn[name]=function(types,data,fn,origSelector){var type,i=0,match,namespaces,preType,selector=origSelector||this.selector,context=origSelector?this:jQuery(this.context);if(typeof types==="object"&&!types.preventDefault){for(var key in types){context[name](key,data,types[key],selector)}return this}if(jQuery.isFunction(data)){fn=data;data=undefined}types=(types||"").split(" ");while((type=types[i++])!=null){match=rnamespaces.exec(type);namespaces="";if(match){namespaces=match[0];type=type.replace(rnamespaces,"")}if(type==="hover"){types.push("mouseenter"+namespaces,"mouseleave"+namespaces);continue}preType=type;if(type==="focus"||type==="blur"){types.push(liveMap[type]+namespaces);type=type+namespaces}else{type=(liveMap[type]||type)+namespaces}if(name==="live"){for(var j=0,l=context.length;j<l;j++){jQuery.event.add(context[j],"live."+liveConvert(type,selector),{data:data,selector:selector,handler:fn,origType:type,origHandler:fn,preType:preType})}}else{context.unbind("live."+liveConvert(type,selector),fn)}}return this}});function liveHandler(event){var stop,maxLevel,related,match,handleObj,elem,j,i,l,data,close,namespace,ret,elems=[],selectors=[],events=jQuery.data(this,this.nodeType?"events":"__events__");if(typeof events==="function"){events=events.events}if(event.liveFired===this||!events||!events.live||event.button&&event.type==="click"){return}if(event.namespace){namespace=new RegExp("(^|\\.)"+event.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")}event.liveFired=this;var live=events.live.slice(0);for(j=0;j<live.length;j++){handleObj=live[j];if(handleObj.origType.replace(rnamespaces,"")===event.type){selectors.push(handleObj.selector)}else{live.splice(j--,1)}}match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){close=match[i];for(j=0;j<live.length;j++){handleObj=live[j];if(close.selector===handleObj.selector&&(!namespace||namespace.test(handleObj.namespace))){elem=close.elem;related=null;if(handleObj.preType==="mouseenter"||handleObj.preType==="mouseleave"){event.type=handleObj.preType;related=jQuery(event.relatedTarget).closest(handleObj.selector)[0]}if(!related||related!==elem){elems.push({elem:elem,handleObj:handleObj,level:close.level})}}}}for(i=0,l=elems.length;i<l;i++){match=elems[i];if(maxLevel&&match.level>maxLevel){break}event.currentTarget=match.elem;event.data=match.handleObj.data;event.handleObj=match.handleObj;ret=match.handleObj.origHandler.apply(match.elem,arguments);if(ret===false||event.isPropagationStopped()){maxLevel=match.level;if(ret===false){stop=false}if(event.isImmediatePropagationStopped()){break}}}return stop}function liveConvert(type,selector){return(type&&type!=="*"?type+".":"")+selector.replace(rperiod,"`").replace(rspace,"&")}jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){if(fn==null){fn=data;data=null}return arguments.length>0?this.bind(name,data,fn):this.trigger(name)};if(jQuery.attrFn){jQuery.attrFn[name]=true}});if(window.attachEvent&&!window.addEventListener){jQuery(window).bind("unload",function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem)}catch(e){}}}})}(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;var origContext=context;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var m,set,checkSet,extra,ret,cur,pop,i,prune=true,contextXML=Sizzle.isXML(context),parts=[],soFar=selector;do{chunker.exec("");m=chunker.exec(soFar);if(m){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break}}}while(m);if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0]}if(context){ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){cur=parts.pop();pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,contextXML)}}else{checkSet=parts=[]}}if(!checkSet){checkSet=set}if(!checkSet){Sizzle.error(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else if(context&&context.nodeType===1){for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&Sizzle.contains(context,checkSet[i]))){results.push(set[i])}}}else{for(i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results)}return results};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.matchesSelector=function(node,expr){return Sizzle(expr,null,null,[node]).length>0};Sizzle.find=function(expr,context,isXML){var set;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var match,type=Expr.order[i];if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var match,anyFound,old=expr,result=[],curLoop=set,isXMLFilter=set&&set[0]&&Sizzle.isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var found,item,filter=Expr.filter[type],left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue}if(curLoop===result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else if(match===true){continue}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else if(pass){result.push(item);anyFound=true}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr===old){if(anyFound==null){Sizzle.error(expr)}else{break}}old=expr}return curLoop};Sizzle.error=function(msg){throw"Syntax error, unrecognized expression: "+msg};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part){var elem,isPartStr=typeof part==="string",i=0,l=checkSet.length;if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(;i<l;i++){elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false}}}else{for(;i<l;i++){elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var nodeCheck,doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){part=part.toLowerCase();nodeCheck=part;checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var nodeCheck,doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){part=part.toLowerCase();nodeCheck=part;checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m&&m.parentNode?[m]:[]}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem)}}else if(inplace){curLoop[i]=false}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){return match[1].toLowerCase()},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return!!elem.firstChild},empty:function(elem){return!elem.firstChild},has:function(elem,i,match){return!!Sizzle(match[3],elem).length},header:function(elem){return(/h\d/i).test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button"},input:function(elem){return(/input|select|textarea|button/i).test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0===i},eq:function(elem,i,match){return match[3]-0===i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else if(name==="contains"){return(elem.textContent||elem.innerText||Sizzle.getText([elem])||"").indexOf(match[3])>=0}else if(name==="not"){var not=match[3];for(var j=0,l=not.length;j<l;j++){if(not[j]===elem){return false}}return true}else{Sizzle.error("Syntax error, unrecognized expression: "+name)}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false}}if(type==="first"){return true}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false}}return true;case"nth":var first=match[2],last=match[3];if(first===1&&last===0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first===0){return diff===0}else{return(diff%first===0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS,fescape=function(all,num){return"\\"+(num-0+1)};for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+(/(?![^\[]*\])(?![^\(]*\))/.source));Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,fescape))}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;}catch(e){makeArray=function(array,results){var i=0,ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var l=array.length;i<l;i++){ret.push(array[i])}}else{for(;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder,siblingCheck;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(a===b){hasDuplicate=true;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1}}else{sortOrder=function(a,b){var al,bl,ap=[],bp=[],aup=a.parentNode,bup=b.parentNode,cur=aup;if(a===b){hasDuplicate=true;return 0;}else if(aup===bup){return siblingCheck(a,b);}else if(!aup){return-1}else if(!bup){return 1}while(cur){ap.unshift(cur);cur=cur.parentNode}cur=bup;while(cur){bp.unshift(cur);cur=cur.parentNode}al=ap.length;bl=bp.length;for(var i=0;i<al&&i<bl;i++){if(ap[i]!==bp[i]){return siblingCheck(ap[i],bp[i])}}return i===al?siblingCheck(a,bp[i],-1):siblingCheck(ap[i],b,1)};siblingCheck=function(a,b,ret){if(a===b){return ret}var cur=a.nextSibling;while(cur){if(cur===b){return-1}cur=cur.nextSibling}return 1}}Sizzle.getText=function(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue;}else if(elem.nodeType!==8){ret+=Sizzle.getText(elem.childNodes)}}return ret};(function(){var form=document.createElement("div"),id="script"+(new Date()).getTime(),root=document.documentElement;form.innerHTML="<a name='"+id+"'/>";root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form);root=form=null})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}div=null})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div"),id="__sizzle__";div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}Sizzle=function(query,context,extra,seed){context=context||document;query=query.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!seed&&!Sizzle.isXML(context)){if(context.nodeType===9){try{return makeArray(context.querySelectorAll(query),extra)}catch(qsaError){}}else if(context.nodeType===1&&context.nodeName.toLowerCase()!=="object"){var old=context.getAttribute("id"),nid=old||id;if(!old){context.setAttribute("id",nid)}try{return makeArray(context.querySelectorAll("#"+nid+" "+query),extra)}catch(pseudoError){}finally{if(!old){context.removeAttribute("id")}}}}return oldSizzle(query,context,extra,seed)};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop]}div=null})()}(function(){var html=document.documentElement,matches=html.matchesSelector||html.mozMatchesSelector||html.webkitMatchesSelector||html.msMatchesSelector,pseudoWorks=false;try{matches.call(document.documentElement,"[test!='']:sizzle")}catch(pseudoError){pseudoWorks=true}if(matches){Sizzle.matchesSelector=function(node,expr){expr=expr.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!Sizzle.isXML(node)){try{if(pseudoWorks||!Expr.match.PSEUDO.test(expr)&&!/!=/.test(expr)){return matches.call(node,expr)}}catch(e){}}return Sizzle(expr,null,null,[node]).length>0}}})();(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}};div=null})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var match=false;elem=elem[dir];while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName.toLowerCase()===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var match=false;elem=elem[dir];while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break}}elem=elem[dir]}checkSet[i]=match}}}if(document.documentElement.contains){Sizzle.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):true)}}else if(document.documentElement.compareDocumentPosition){Sizzle.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}}else{Sizzle.contains=function(){return false}}Sizzle.isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};var posProcess=function(selector,context){var match,tmpSet=[],later="",root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet)}return Sizzle.filter(later,tmpSet)};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,isSimple=/^.[^:#\[\.,]*$/,slice=Array.prototype.slice,POS=jQuery.expr.match.POS;jQuery.fn.extend({find:function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break}}}}}return ret},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true}}})},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector)},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector)},is:function(selector){return!!selector&&jQuery.filter(selector,this).length>0},closest:function(selectors,context){var ret=[],i,l,cur=this[0];if(jQuery.isArray(selectors)){var match,selector,matches={},level=1;if(cur&&selectors.length){for(i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector}}while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur,level:level})}}cur=cur.parentNode;level++}}return ret}var pos=POS.test(selectors)?jQuery(selectors,context||this.context):null;for(i=0,l=this.length;i<l;i++){cur=this[i];while(cur){if(pos?pos.index(cur)>-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break}else{cur=cur.parentNode;if(!cur||!cur.ownerDocument||cur===context){break}}}}ret=ret.length>1?jQuery.unique(ret):ret;return this.pushStack(ret,"closest",selectors)},index:function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children())}return jQuery.inArray(elem.jquery?elem[0]:elem,this)},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all))},andSelf:function(){return this.add(this.prevObject)}});function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret)}ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse()}return this.pushStack(ret,name,slice.call(arguments).join(","))}});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")"}return elems.length===1?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems)},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n)}}return r}});function winnow(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){var retVal=!!qualifier.call(elem,i,elem);return retVal===keep})}else if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep})}else if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep)}else{qualifier=jQuery.filter(qualifier,filtered)}}return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep})}var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&#?\w+;/,rnocache=/<(?:script|object|embed|option|style)/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,raction=/\=([^="'>\s]+\/)>/g,wrapMap={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"]}jQuery.fn.extend({text:function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);self.text(text.call(this,i,self.text()))})}if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}return jQuery.text(this)},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))})}if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i))})}return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this)})}else if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})}else if(arguments.length){var set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery(arguments[0]).toArray());return set}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||jQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"));jQuery.cleanData([elem])}if(elem.parentNode){elem.parentNode.removeChild(elem)}}}return this},empty:function(){for(var i=0,elem;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(elem.getElementsByTagName("*"))}while(elem.firstChild){elem.removeChild(elem.firstChild)}}return this},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML}return jQuery.clean([html.replace(rinlinejQuery,"").replace(raction,'="$1">').replace(rleadingWhitespace,"")],ownerDocument)[0]}else{return this.cloneNode(true)}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"))}return ret},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null;}else if(typeof value==="string"&&!rnocache.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1></$2>");try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){jQuery.cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value}}}catch(e){this.empty().append(value)}}else if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this);self.html(value.call(this,i,self.html()))})}else{this.empty().append(value)}return this},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this),old=self.html();self.replaceWith(value.call(this,i,old))})}if(typeof value!=="string"){value=jQuery(value).detach()}return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value)}else{jQuery(parent).append(value)}})}else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value)}},detach:function(selector){return this.remove(selector,true)},domManip:function(args,table,callback){var results,first,fragment,parent,value=args[0],scripts=[];if(!jQuery.support.checkClone&&arguments.length===3&&typeof value==="string"&&rchecked.test(value)){return this.each(function(){jQuery(this).domManip(args,table,callback,true)})}if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);self.domManip(args,table,callback)})}if(this[0]){parent=value&&value.parentNode;if(jQuery.support.parentNode&&parent&&parent.nodeType===11&&parent.childNodes.length===this.length){results={fragment:parent}}else{results=jQuery.buildFragment(args,this,scripts)}fragment=results.fragment;if(fragment.childNodes.length===1){first=fragment=fragment.firstChild}else{first=fragment.firstChild}if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],i>0||results.cacheable||this.length>1?fragment.cloneNode(true):fragment)}}if(scripts.length){jQuery.each(scripts,evalScript)}}return this}});function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem}function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return}var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)}}}})}jQuery.buildFragment=function(args,nodes,scripts){var fragment,cacheable,cacheresults,doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&doc===document&&!rnocache.test(args[0])&&(jQuery.support.checkClone||!rchecked.test(args[0]))){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults}}}if(!fragment){fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts)}if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1}return{fragment:fragment,cacheable:cacheable}};jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),parent=this.length===1&&this[0].parentNode;if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);return this}else{for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery(insert[i])[original](elems);ret=ret.concat(elems)}return this.pushStack(ret,name,insert.selector)}}});jQuery.extend({clean:function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}var ret=[];for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+=""}if(!elem){continue}if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem)}else if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,"<$1></$2>");var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild}if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild)}elem=div.childNodes}if(elem.nodeType){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}}if(fragment){for(i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))))}fragment.appendChild(ret[i])}}}return ret},cleanData:function(elems){var data,id,cache=jQuery.cache,special=jQuery.event.special,deleteExpando=jQuery.support.deleteExpando;for(var i=0,elem;(elem=elems[i])!=null;i++){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){continue}id=elem[jQuery.expando];if(id){data=cache[id];if(data&&data.events){for(var type in data.events){if(special[type]){jQuery.event.remove(elem,type)}else{jQuery.removeEvent(elem,type,data.handle)}}}if(deleteExpando){delete elem[jQuery.expando]}else if(elem.removeAttribute){elem.removeAttribute(jQuery.expando)}delete cache[id]}}}});function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}var ralpha=/alpha\([^)]*\)/i,ropacity=/opacity=([^)]*)/,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],curCSS,getComputedStyle,currentStyle,fcamelCase=function(all,letter){return letter.toUpperCase()};jQuery.fn.css=function(name,value){if(arguments.length===2&&value===undefined){return this}return jQuery.access(this,name,value,true,function(elem,name,value){return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name)})};jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity","opacity");return ret===""?"1":ret}else{return elem.style.opacity}}}},cssNumber:{"zIndex":true,"fontWeight":true,"opacity":true,"zoom":true,"lineHeight":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,origName=jQuery.camelCase(name),style=elem.style,hooks=jQuery.cssHooks[origName];name=jQuery.cssProps[origName]||origName;if(value!==undefined){if(typeof value==="number"&&isNaN(value)||value==null){return}if(typeof value==="number"&&!jQuery.cssNumber[origName]){value+="px"}if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value))!==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){var ret,origName=jQuery.camelCase(name),hooks=jQuery.cssHooks[origName];name=jQuery.cssProps[origName]||origName;if(hooks&&"get"in hooks&&(ret=hooks.get(elem,true,extra))!==undefined){return ret;}else if(curCSS){return curCSS(elem,name,origName)}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(name in options){elem.style[name]=old[name]}},camelCase:function(string){return string.replace(rdashAlpha,fcamelCase)}});jQuery.curCSS=jQuery.css;jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){var val;if(computed){if(elem.offsetWidth!==0){val=getWH(elem,name,extra)}else{jQuery.swap(elem,cssShow,function(){val=getWH(elem,name,extra)})}if(val<=0){val=curCSS(elem,name,name);if(val==="0px"&&currentStyle){val=currentStyle(elem,name,name)}if(val!=null){return val===""||val==="auto"?"0px":val}}if(val<0||val==null){val=elem.style[name];return val===""||val==="auto"?"0px":val}return typeof val==="string"?val:val+"px"}},set:function(elem,value){if(rnumpx.test(value)){value=parseFloat(value);if(value>=0){return value+"px"}}else{return value}}}});if(!jQuery.support.opacity){jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":computed?"1":""},set:function(elem,value){var style=elem.style;style.zoom=1;var opacity=jQuery.isNaN(value)?"":"alpha(opacity="+value*100+")",filter=style.filter||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):style.filter+' '+opacity}}}if(document.defaultView&&document.defaultView.getComputedStyle){getComputedStyle=function(elem,newName,name){var ret,defaultView,computedStyle;name=name.replace(rupper,"-$1").toLowerCase();if(!(defaultView=elem.ownerDocument.defaultView)){return undefined}if((computedStyle=defaultView.getComputedStyle(elem,null))){ret=computedStyle.getPropertyValue(name);if(ret===""&&!jQuery.contains(elem.ownerDocument.documentElement,elem)){ret=jQuery.style(elem,name)}}return ret}}if(document.documentElement.currentStyle){currentStyle=function(elem,name){var left,rsLeft,ret=elem.currentStyle&&elem.currentStyle[name],style=elem.style;if(!rnumpx.test(ret)&&rnum.test(ret)){left=style.left;rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=name==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}return ret===""?"auto":ret}}curCSS=getComputedStyle||currentStyle;function getWH(elem,name,extra){var which=name==="width"?cssWidth:cssHeight,val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return val}jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.css(elem,"padding"+this))||0}if(extra==="margin"){val+=parseFloat(jQuery.css(elem,"margin"+this))||0}else{val-=parseFloat(jQuery.css(elem,"border"+this+"Width"))||0}});return val}if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight;return(width===0&&height===0)||(!jQuery.support.reliableHiddenOffsets&&(elem.style.display||jQuery.css(elem,"display"))==="none")};jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)}}var jsc=jQuery.now(),rscript=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,rselectTextarea=/^(?:select|textarea)/i,rinput=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,rnoContent=/^(?:GET|HEAD)$/,rbracket=/\[\]$/,jsre=/\=\?(&|$)/,rquery=/\?/,rts=/([?&])_=[^&]*/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g,rhash=/#.*$/,_load=jQuery.fn.load;jQuery.fn.extend({load:function(url,params,callback){if(typeof url!=="string"&&_load){return _load.apply(this,arguments);}else if(!this.length){return this}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST"}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status==="success"||status==="notmodified"){self.html(selector?jQuery("<div>").append(res.responseText.replace(rscript,"")).find(selector):res.responseText)}if(callback){self.each(callback,[res.responseText,status,res])}}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new window.XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings),jsonp,status,data,type=s.type.toUpperCase(),noContent=rnoContent.test(type);s.url=s.url.replace(rhash,"");s.context=origSettings&&origSettings.context!=null?origSettings.context:s;if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?"}}else if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}s.dataType="json"}if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";var customJsonp=window[jsonp];window[jsonp]=function(tmp){if(jQuery.isFunction(customJsonp)){customJsonp(tmp)}else{window[jsonp]=undefined;try{delete window[jsonp]}catch(jsonpError){}}data=tmp;jQuery.handleSuccess(s,xhr,status,data);jQuery.handleComplete(s,xhr,status,data);if(head){head.removeChild(script)}}}if(s.dataType==="script"&&s.cache===null){s.cache=false}if(s.cache===false&&noContent){var ts=jQuery.now();var ret=s.url.replace(rts,"$1_="+ts);s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"")}if(s.data&&noContent){s.url+=(rquery.test(s.url)?"&":"?")+s.data}if(s.global&&jQuery.active++===0){jQuery.event.trigger("ajaxStart")}var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1].toLowerCase()!==location.protocol||parts[2].toLowerCase()!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");if(s.scriptCharset){script.charset=s.scriptCharset}script.src=s.url;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;jQuery.handleSuccess(s,xhr,status,data);jQuery.handleComplete(s,xhr,status,data);script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script)}}}}head.insertBefore(script,head.firstChild);return undefined}var requestDone=false;var xhr=s.xhr();if(!xhr){return}if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)}try{if((s.data!=null&&!noContent)||(origSettings&&origSettings.contentType)){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url])}if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url])}}if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest")}xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*; q=0.01":s.accepts._default)}catch(headerError){}if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global&&jQuery.active--===1){jQuery.event.trigger("ajaxStop")}xhr.abort();return false}if(s.global){jQuery.triggerGlobal(s,"ajaxSend",[xhr,s])}var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0||isTimeout==="abort"){if(!requestDone){jQuery.handleComplete(s,xhr,status,data)}requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop}}else if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";var errMsg;if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s)}catch(parserError){status="parsererror";errMsg=parserError}}if(status==="success"||status==="notmodified"){if(!jsonp){jQuery.handleSuccess(s,xhr,status,data)}}else{jQuery.handleError(s,xhr,status,errMsg)}if(!jsonp){jQuery.handleComplete(s,xhr,status,data)}if(isTimeout==="timeout"){xhr.abort()}if(s.async){xhr=null}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){Function.prototype.call.call(oldAbort,xhr)}onreadystatechange("abort")}}catch(abortError){}if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout")}},s.timeout)}try{xhr.send(noContent||s.data==null?null:s.data)}catch(sendError){jQuery.handleError(s,xhr,null,sendError);jQuery.handleComplete(s,xhr,status,data)}if(!s.async){onreadystatechange()}return xhr},param:function(a,traditional){var s=[],add=function(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value)})}else{for(var prefix in a){buildParams(prefix,a[prefix],traditional,add)}}return s.join("&").replace(r20,"+")}});function buildParams(prefix,obj,traditional,add){if(jQuery.isArray(obj)&&obj.length){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v)}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v,traditional,add)}})}else if(!traditional&&obj!=null&&typeof obj==="object"){if(jQuery.isEmptyObject(obj)){add(prefix,"");}else{jQuery.each(obj,function(k,v){buildParams(prefix+"["+k+"]",v,traditional,add)})}}else{add(prefix,obj)}}jQuery.extend({active:0,lastModified:{},etag:{},handleError:function(s,xhr,status,e){if(s.error){s.error.call(s.context,xhr,status,e)}if(s.global){jQuery.triggerGlobal(s,"ajaxError",[xhr,s,e])}},handleSuccess:function(s,xhr,status,data){if(s.success){s.success.call(s.context,data,status,xhr)}if(s.global){jQuery.triggerGlobal(s,"ajaxSuccess",[xhr,s])}},handleComplete:function(s,xhr,status){if(s.complete){s.complete.call(s.context,xhr,status)}if(s.global){jQuery.triggerGlobal(s,"ajaxComplete",[xhr,s])}if(s.global&&jQuery.active--===1){jQuery.event.trigger("ajaxStop")}},triggerGlobal:function(s,type,args){(s.context&&s.context.url==null?jQuery(s.context):jQuery.event).trigger(type,args)},httpSuccess:function(xhr){try{return!xhr.status&&location.protocol==="file:"||xhr.status>=200&&xhr.status<300||xhr.status===304||xhr.status===1223}catch(e){}return false},httpNotModified:function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified}if(etag){jQuery.etag[url]=etag}return xhr.status===304},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){jQuery.error("parsererror")}if(s&&s.dataFilter){data=s.dataFilter(data,type)}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=jQuery.parseJSON(data);}else if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data)}}return data}});if(window.ActiveXObject){jQuery.ajaxSettings.xhr=function(){if(window.location.protocol!=="file:"){try{return new window.XMLHttpRequest()}catch(xhrError){}}try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(activeError){}}}jQuery.support.ajax=!!jQuery.ajaxSettings.xhr();var elemdisplay={},rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=/^([+\-]=)?([\d+.\-]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show:function(speed,easing,callback){var elem,display;if(speed||speed===0){return this.animate(genFx("show",3),speed,easing,callback)}else{for(var i=0,j=this.length;i<j;i++){elem=this[i];display=elem.style.display;if(!jQuery.data(elem,"olddisplay")&&display==="none"){display=elem.style.display=""}if(display===""&&jQuery.css(elem,"display")==="none"){jQuery.data(elem,"olddisplay",defaultDisplay(elem.nodeName))}}for(i=0;i<j;i++){elem=this[i];display=elem.style.display;if(display===""||display==="none"){elem.style.display=jQuery.data(elem,"olddisplay")||""}}return this}},hide:function(speed,easing,callback){if(speed||speed===0){return this.animate(genFx("hide",3),speed,easing,callback)}else{for(var i=0,j=this.length;i<j;i++){var display=jQuery.css(this[i],"display");if(display!=="none"){jQuery.data(this[i],"olddisplay",display)}}for(i=0;i<j;i++){this[i].style.display="none"}return this}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2,callback){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments)}else if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]()})}else{this.animate(genFx("toggle",3),fn,fn2,callback)}return this},fadeTo:function(speed,to,easing,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete)}return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,isElement=this.nodeType===1,hidden=isElement&&jQuery(this).is(":hidden"),self=this;for(p in prop){var name=jQuery.camelCase(p);if(p!==name){prop[name]=prop[p];delete prop[p];p=name}if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this)}if(isElement&&(p==="height"||p==="width")){opt.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(jQuery.css(this,"display")==="inline"&&jQuery.css(this,"float")==="none"){if(!jQuery.support.inlineBlockNeedsLayout){this.style.display="inline-block"}else{var display=defaultDisplay(this.nodeName);if(display==="inline"){this.style.display="inline-block"}else{this.style.display="inline";this.style.zoom=1}}}}if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0]}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop)}else{var parts=rfxnum.exec(val),start=e.cur()||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){jQuery.style(self,name,(end||1)+unit);start=((end||1)/e.cur())*start;jQuery.style(self,name,start+unit)}if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type});return obj}jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),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.extend({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;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.call(this)}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop));return r&&r>-10000?r:0},custom:function(from,to,unit){var self=this,fx=jQuery.fx;this.startTime=jQuery.now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(fx.tick,fx.interval)}},show:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=jQuery.now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.overflow!=null&&!jQuery.support.shrinkWrapBlocks){var elem=this.elem,options=this.options;jQuery.each(["","X","Y"],function(index,value){elem.style["overflow"+value]=options.overflow[index]})}if(this.options.hide){jQuery(this.elem).hide()}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p])}}this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{tick:function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){jQuery.fx.stop()}},interval:13,stop:function(){clearInterval(timerId);timerId=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now)},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit}else{fx.elem[fx.prop]=fx.now}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length}}function defaultDisplay(nodeName){if(!elemdisplay[nodeName]){var elem=jQuery("<"+nodeName+">").appendTo("body"),display=elem.css("display");elem.remove();if(display==="none"||display===""){display="block"}elemdisplay[nodeName]=display}return elemdisplay[nodeName]}var rtable=/^t(?:able|d|h)$/i,rroot=/^(?:body|html)$/i;if("getBoundingClientRect"in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0],box;if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}if(!elem||!elem.ownerDocument){return null}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}try{box=elem.getBoundingClientRect()}catch(e){}var doc=elem.ownerDocument,docElem=doc.documentElement;if(!box||!jQuery.contains(docElem,elem)){return box||{top:0,left:0}}var body=doc.body,win=getWindow(doc),clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,scrollTop=(win.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop),scrollLeft=(win.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft),top=box.top+scrollTop-clientTop,left=box.left+scrollLeft-clientLeft;return{top:top,left:left}}}else{jQuery.fn.offset=function(options){var elem=this[0];if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}if(!elem||!elem.ownerDocument){return null}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}jQuery.offset.initialize();var computedStyle,offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break}computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&rtable.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}prevOffsetParent=offsetParent;offsetParent=elem.offsetParent}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}prevComputedStyle=computedStyle}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft}if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft)}return{top:top,left:left}}}jQuery.offset={initialize:function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.css(body,"marginTop"))||0,html="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed";checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden";innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);body=container=innerDiv=checkDiv=table=td=null;jQuery.offset.initialize=jQuery.noop},bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.css(body,"marginTop"))||0;left+=parseFloat(jQuery.css(body,"marginLeft"))||0}return{top:top,left:left}},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"&&jQuery.inArray('auto',[curCSSTop,curCSSLeft])>-1),props={},curPosition={},curTop,curLeft;if(calculatePosition){curPosition=curElem.position()}curTop=calculatePosition?curPosition.top:parseInt(curCSSTop,10)||0;curLeft=calculatePosition?curPosition.left:parseInt(curCSSLeft,10)||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 null}var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=rroot.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.css(elem,"marginTop"))||0;offset.left-=parseFloat(jQuery.css(elem,"marginLeft"))||0;parentOffset.top+=parseFloat(jQuery.css(offsetParent[0],"borderTopWidth"))||0;parentOffset.left+=parseFloat(jQuery.css(offsetParent[0],"borderLeftWidth"))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!rroot.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent}return offsetParent})}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem=this[0],win;if(!elem){return null}if(val!==undefined){return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop())}else{this[method]=val}})}else{win=getWindow(elem);return win?("pageXOffset"in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method]}}});function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false}jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?parseFloat(jQuery.css(this[0],type,"padding")):null};jQuery.fn["outer"+name]=function(margin){return this[0]?parseFloat(jQuery.css(this[0],type,margin?"margin":"border")):null};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this}if(jQuery.isFunction(size)){return this.each(function(i){var self=jQuery(this);self[type](size.call(this,i,self[type]()))})}if(jQuery.isWindow(elem)){return elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name];}else if(elem.nodeType===9){return Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]);}else if(size===undefined){var orig=jQuery.css(elem,type),ret=parseFloat(orig);return jQuery.isNaN(ret)?orig:ret;}else{return this.css(type,typeof size==="string"?size:size+"px")}}})})(window);;(function(){var root=this;var previousUnderscore=root._;var breaker={};var ArrayProto=Array.prototype,ObjProto=Object.prototype,FuncProto=Function.prototype;var slice=ArrayProto.slice,unshift=ArrayProto.unshift,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty;var nativeForEach=ArrayProto.forEach,nativeMap=ArrayProto.map,nativeReduce=ArrayProto.reduce,nativeReduceRight=ArrayProto.reduceRight,nativeFilter=ArrayProto.filter,nativeEvery=ArrayProto.every,nativeSome=ArrayProto.some,nativeIndexOf=ArrayProto.indexOf,nativeLastIndexOf=ArrayProto.lastIndexOf,nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeBind=FuncProto.bind;var _=function(obj){return new wrapper(obj)};if(typeof module!=='undefined'&&module.exports){module.exports=_;_._=_}else{root['_']=_}_.VERSION='1.1.7';var each=_.each=_.forEach=function(obj,iterator,context){if(obj==null)return;if(nativeForEach&&obj.forEach===nativeForEach){obj.forEach(iterator,context)}else if(obj.length===+obj.length){for(var i=0,l=obj.length;i<l;i++){if(i in obj&&iterator.call(context,obj[i],i,obj)===breaker)return}}else{for(var key in obj){if(hasOwnProperty.call(obj,key)){if(iterator.call(context,obj[key],key,obj)===breaker)return}}}};_.map=function(obj,iterator,context){var results=[];if(obj==null)return results;if(nativeMap&&obj.map===nativeMap)return obj.map(iterator,context);each(obj,function(value,index,list){results[results.length]=iterator.call(context,value,index,list)});return results};_.reduce=_.foldl=_.inject=function(obj,iterator,memo,context){var initial=memo!==void 0;if(obj==null)obj=[];if(nativeReduce&&obj.reduce===nativeReduce){if(context)iterator=_.bind(iterator,context);return initial?obj.reduce(iterator,memo):obj.reduce(iterator)}each(obj,function(value,index,list){if(!initial){memo=value;initial=true}else{memo=iterator.call(context,memo,value,index,list)}});if(!initial)throw new TypeError("Reduce of empty array with no initial value");return memo};_.reduceRight=_.foldr=function(obj,iterator,memo,context){if(obj==null)obj=[];if(nativeReduceRight&&obj.reduceRight===nativeReduceRight){if(context)iterator=_.bind(iterator,context);return memo!==void 0?obj.reduceRight(iterator,memo):obj.reduceRight(iterator)}var reversed=(_.isArray(obj)?obj.slice():_.toArray(obj)).reverse();return _.reduce(reversed,iterator,memo,context)};_.find=_.detect=function(obj,iterator,context){var result;any(obj,function(value,index,list){if(iterator.call(context,value,index,list)){result=value;return true}});return result};_.filter=_.select=function(obj,iterator,context){var results=[];if(obj==null)return results;if(nativeFilter&&obj.filter===nativeFilter)return obj.filter(iterator,context);each(obj,function(value,index,list){if(iterator.call(context,value,index,list))results[results.length]=value});return results};_.reject=function(obj,iterator,context){var results=[];if(obj==null)return results;each(obj,function(value,index,list){if(!iterator.call(context,value,index,list))results[results.length]=value});return results};_.every=_.all=function(obj,iterator,context){var result=true;if(obj==null)return result;if(nativeEvery&&obj.every===nativeEvery)return obj.every(iterator,context);each(obj,function(value,index,list){if(!(result=result&&iterator.call(context,value,index,list)))return breaker});return result};var any=_.some=_.any=function(obj,iterator,context){iterator=iterator||_.identity;var result=false;if(obj==null)return result;if(nativeSome&&obj.some===nativeSome)return obj.some(iterator,context);each(obj,function(value,index,list){if(result|=iterator.call(context,value,index,list))return breaker});return!!result};_.include=_.contains=function(obj,target){var found=false;if(obj==null)return found;if(nativeIndexOf&&obj.indexOf===nativeIndexOf)return obj.indexOf(target)!=-1;any(obj,function(value){if(found=value===target)return true});return found};_.invoke=function(obj,method){var args=slice.call(arguments,2);return _.map(obj,function(value){return(method.call?method||value:value[method]).apply(value,args)})};_.pluck=function(obj,key){return _.map(obj,function(value){return value[key]})};_.max=function(obj,iterator,context){if(!iterator&&_.isArray(obj))return Math.max.apply(Math,obj);var result={computed:-Infinity};each(obj,function(value,index,list){var computed=iterator?iterator.call(context,value,index,list):value;computed>=result.computed&&(result={value:value,computed:computed})});return result.value};_.min=function(obj,iterator,context){if(!iterator&&_.isArray(obj))return Math.min.apply(Math,obj);var result={computed:Infinity};each(obj,function(value,index,list){var computed=iterator?iterator.call(context,value,index,list):value;computed<result.computed&&(result={value:value,computed:computed})});return result.value};_.sortBy=function(obj,iterator,context){return _.pluck(_.map(obj,function(value,index,list){return{value:value,criteria:iterator.call(context,value,index,list)}}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0}),'value')};_.groupBy=function(obj,iterator){var result={};each(obj,function(value,index){var key=iterator(value,index);(result[key]||(result[key]=[])).push(value)});return result};_.sortedIndex=function(array,obj,iterator){iterator||(iterator=_.identity);var low=0,high=array.length;while(low<high){var mid=(low+high)>>1;iterator(array[mid])<iterator(obj)?low=mid+1:high=mid}return low};_.toArray=function(iterable){if(!iterable)return[];if(iterable.toArray)return iterable.toArray();if(_.isArray(iterable))return slice.call(iterable);if(_.isArguments(iterable))return slice.call(iterable);return _.values(iterable)};_.size=function(obj){return _.toArray(obj).length};_.first=_.head=function(array,n,guard){return(n!=null)&&!guard?slice.call(array,0,n):array[0]};_.rest=_.tail=function(array,index,guard){return slice.call(array,(index==null)||guard?1:index)};_.last=function(array){return array[array.length-1]};_.compact=function(array){return _.filter(array,function(value){return!!value})};_.flatten=function(array){return _.reduce(array,function(memo,value){if(_.isArray(value))return memo.concat(_.flatten(value));memo[memo.length]=value;return memo},[])};_.without=function(array){return _.difference(array,slice.call(arguments,1))};_.uniq=_.unique=function(array,isSorted){return _.reduce(array,function(memo,el,i){if(0==i||(isSorted===true?_.last(memo)!=el:!_.include(memo,el)))memo[memo.length]=el;return memo},[])};_.union=function(){return _.uniq(_.flatten(arguments))};_.intersection=_.intersect=function(array){var rest=slice.call(arguments,1);return _.filter(_.uniq(array),function(item){return _.every(rest,function(other){return _.indexOf(other,item)>=0})})};_.difference=function(array,other){return _.filter(array,function(value){return!_.include(other,value)})};_.zip=function(){var args=slice.call(arguments);var length=_.max(_.pluck(args,'length'));var results=new Array(length);for(var i=0;i<length;i++)results[i]=_.pluck(args,""+i);return results};_.indexOf=function(array,item,isSorted){if(array==null)return-1;var i,l;if(isSorted){i=_.sortedIndex(array,item);return array[i]===item?i:-1}if(nativeIndexOf&&array.indexOf===nativeIndexOf)return array.indexOf(item);for(i=0,l=array.length;i<l;i++)if(array[i]===item)return i;return-1};_.lastIndexOf=function(array,item){if(array==null)return-1;if(nativeLastIndexOf&&array.lastIndexOf===nativeLastIndexOf)return array.lastIndexOf(item);var i=array.length;while(i--)if(array[i]===item)return i;return-1};_.range=function(start,stop,step){if(arguments.length<=1){stop=start||0;start=0}step=arguments[2]||1;var len=Math.max(Math.ceil((stop-start)/step),0);var idx=0;var range=new Array(len);while(idx<len){range[idx++]=start;start+=step}return range};_.bind=function(func,obj){if(func.bind===nativeBind&&nativeBind)return nativeBind.apply(func,slice.call(arguments,1));var args=slice.call(arguments,2);return function(){return func.apply(obj,args.concat(slice.call(arguments)))}};_.bindAll=function(obj){var funcs=slice.call(arguments,1);if(funcs.length==0)funcs=_.functions(obj);each(funcs,function(f){obj[f]=_.bind(obj[f],obj)});return obj};_.memoize=function(func,hasher){var memo={};hasher||(hasher=_.identity);return function(){var key=hasher.apply(this,arguments);return hasOwnProperty.call(memo,key)?memo[key]:(memo[key]=func.apply(this,arguments))}};_.delay=function(func,wait){var args=slice.call(arguments,2);return setTimeout(function(){return func.apply(func,args)},wait)};_.defer=function(func){return _.delay.apply(_,[func,1].concat(slice.call(arguments,1)))};var limit=function(func,wait,debounce){var timeout;return function(){var context=this,args=arguments;var throttler=function(){timeout=null;func.apply(context,args)};if(debounce)clearTimeout(timeout);if(debounce||!timeout)timeout=setTimeout(throttler,wait)}};_.throttle=function(func,wait){return limit(func,wait,false)};_.debounce=function(func,wait){return limit(func,wait,true)};_.once=function(func){var ran=false,memo;return function(){if(ran)return memo;ran=true;return memo=func.apply(this,arguments)}};_.wrap=function(func,wrapper){return function(){var args=[func].concat(slice.call(arguments));return wrapper.apply(this,args)}};_.compose=function(){var funcs=slice.call(arguments);return function(){var args=slice.call(arguments);for(var i=funcs.length-1;i>=0;i--){args=[funcs[i].apply(this,args)]}return args[0]}};_.after=function(times,func){return function(){if(--times<1){return func.apply(this,arguments)}}};_.keys=nativeKeys||function(obj){if(obj!==Object(obj))throw new TypeError('Invalid object');var keys=[];for(var key in obj)if(hasOwnProperty.call(obj,key))keys[keys.length]=key;return keys};_.values=function(obj){return _.map(obj,_.identity)};_.functions=_.methods=function(obj){var names=[];for(var key in obj){if(_.isFunction(obj[key]))names.push(key)}return names.sort()};_.extend=function(obj){each(slice.call(arguments,1),function(source){for(var prop in source){if(source[prop]!==void 0)obj[prop]=source[prop]}});return obj};_.defaults=function(obj){each(slice.call(arguments,1),function(source){for(var prop in source){if(obj[prop]==null)obj[prop]=source[prop]}});return obj};_.clone=function(obj){return _.isArray(obj)?obj.slice():_.extend({},obj)};_.tap=function(obj,interceptor){interceptor(obj);return obj};_.isEqual=function(a,b){if(a===b)return true;var atype=typeof(a),btype=typeof(b);if(atype!=btype)return false;if(a==b)return true;if((!a&&b)||(a&&!b))return false;if(a._chain)a=a._wrapped;if(b._chain)b=b._wrapped;if(a.isEqual)return a.isEqual(b);if(b.isEqual)return b.isEqual(a);if(_.isDate(a)&&_.isDate(b))return a.getTime()===b.getTime();if(_.isNaN(a)&&_.isNaN(b))return false;if(_.isRegExp(a)&&_.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(atype!=='object')return false;if(a.length&&(a.length!==b.length))return false;var aKeys=_.keys(a),bKeys=_.keys(b);if(aKeys.length!=bKeys.length)return false;for(var key in a)if(!(key in b)||!_.isEqual(a[key],b[key]))return false;return true};_.isEmpty=function(obj){if(_.isArray(obj)||_.isString(obj))return obj.length===0;for(var key in obj)if(hasOwnProperty.call(obj,key))return false;return true};_.isElement=function(obj){return!!(obj&&obj.nodeType==1)};_.isArray=nativeIsArray||function(obj){return toString.call(obj)==='[object Array]'};_.isObject=function(obj){return obj===Object(obj)};_.isArguments=function(obj){return!!(obj&&hasOwnProperty.call(obj,'callee'))};_.isFunction=function(obj){return!!(obj&&obj.constructor&&obj.call&&obj.apply)};_.isString=function(obj){return!!(obj===''||(obj&&obj.charCodeAt&&obj.substr))};_.isNumber=function(obj){return!!(obj===0||(obj&&obj.toExponential&&obj.toFixed))};_.isNaN=function(obj){return obj!==obj};_.isBoolean=function(obj){return obj===true||obj===false};_.isDate=function(obj){return!!(obj&&obj.getTimezoneOffset&&obj.setUTCFullYear)};_.isRegExp=function(obj){return!!(obj&&obj.test&&obj.exec&&(obj.ignoreCase||obj.ignoreCase===false))};_.isNull=function(obj){return obj===null};_.isUndefined=function(obj){return obj===void 0};_.noConflict=function(){root._=previousUnderscore;return this};_.identity=function(value){return value};_.times=function(n,iterator,context){for(var i=0;i<n;i++)iterator.call(context,i)};_.mixin=function(obj){each(_.functions(obj),function(name){addToWrapper(name,_[name]=obj[name])})};var idCounter=0;_.uniqueId=function(prefix){var id=idCounter++;return prefix?prefix+id:id};_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g};_.template=function(str,data){var c=_.templateSettings;var tmpl='var __p=[],print=function(){__p.push.apply(__p,arguments);};'+'with(obj||{}){__p.push(\''+str.replace(/\\/g,'\\\\').replace(/'/g,"\\'").replace(c.interpolate,function(match,code){return"',"+code.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(match,code){return"');"+code.replace(/\\'/g,"'").replace(/[\r\n\t]/g,' ')+"__p.push('"}).replace(/\r/g,'\\r').replace(/\n/g,'\\n').replace(/\t/g,'\\t')+"');}return __p.join('');";var func=new Function('obj',tmpl);return data?func(data):func};var wrapper=function(obj){this._wrapped=obj};_.prototype=wrapper.prototype;var result=function(obj,chain){return chain?_(obj).chain():obj};var addToWrapper=function(name,func){wrapper.prototype[name]=function(){var args=slice.call(arguments);unshift.call(args,this._wrapped);return result(func.apply(_,args),this._chain)}};_.mixin(_);each(['pop','push','reverse','shift','sort','splice','unshift'],function(name){var method=ArrayProto[name];wrapper.prototype[name]=function(){method.apply(this._wrapped,arguments);return result(this._wrapped,this._chain)}});each(['concat','join','slice'],function(name){var method=ArrayProto[name];wrapper.prototype[name]=function(){return result(method.apply(this._wrapped,arguments),this._chain)}});wrapper.prototype.chain=function(){this._chain=true;return this};wrapper.prototype.value=function(){return this._wrapped}})();Joose=function(){throw"Modules may not be instantiated."};Joose.top=this;Joose.VERSION=3.008;Joose.AUTHORITY='jsan:NPLATONOV';Joose.A={each:function(array,func,scope){scope=scope||this;for(var i=0,len=array.length;i<len;i++)if(func.call(scope,array[i],i)===false)return false},exists:function(array,value){for(var i=0,len=array.length;i<len;i++)if(array[i]==value)return true;return false},map:function(array,func,scope){scope=scope||this;var res=[];for(var i=0,len=array.length;i<len;i++)res.push(func.call(scope,array[i],i));return res},grep:function(array,func){var a=[];Joose.A.each(array,function(t){if(func(t))a.push(t)});return a},remove:function(array,removeEle){var a=[];Joose.A.each(array,function(t){if(t!==removeEle)a.push(t)});return a}};Joose.S={saneSplit:function(str,delimeter){var res=(str||'').split(delimeter);if(res.length==1&&!res[0])res.shift();return res},uppercaseFirst:function(string){return string.substr(0,1).toUpperCase()+string.substr(1,string.length-1)}};Joose.O={each:function(object,func,scope){scope=scope||this;for(var i in object)if(func.call(scope,object[i],i)===false)return false;if(Joose.is_IE)return Joose.A.each(['toString','constructor','hasOwnProperty'],function(el){if(object.hasOwnProperty(el))return func.call(scope,object[el],el)})},eachOwn:function(object,func,scope){scope=scope||this;return Joose.O.each(object,function(value,name){if(object.hasOwnProperty(name))return func.call(scope,value,name)},scope)},copy:function(source,target){target=target||{};Joose.O.each(source,function(value,name){target[name]=value});return target},copyOwn:function(source,target){target=target||{};Joose.O.eachOwn(source,function(value,name){target[name]=value});return target},getMutableCopy:function(object){var f=function(){};f.prototype=object;return new f()},extend:function(target,source){return Joose.O.copy(source,target)},isEmpty:function(object){for(var i in object)if(object.hasOwnProperty(i))return false;return true},isInstance:function(obj){return obj&&obj.meta&&obj.constructor==obj.meta.c},wantArray:function(obj){if(obj instanceof Array)return obj;return[obj]},isFunction:function(obj){return typeof obj=='function'&&obj.constructor!=RegExp}};Joose.I={Array:function(){return[]},Object:function(){return{}},Function:function(){return function(){}},Now:function(){return new Date()}};try{Joose.is_IE=/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)}catch(e){Joose.is_IE=false};try{Joose.is_NodeJS=Boolean(process.argv[0])}catch(e){Joose.is_NodeJS=false};Joose.Proto=function(){throw"Modules may not be instantiated."};Joose.Proto.Empty=function(){throw"Joose.Proto.Empty can't be instantiated"};Joose.Proto.Empty.meta={};(function(){Joose.Proto.Object=function(){throw"Joose.Proto.Object can't be instantiated"};var SUPER=function(){var self=SUPER.caller;if(self==SUPERARG)self=self.caller;if(!self.SUPER)throw"Invalid call to SUPER";return self.SUPER[self.methodName].apply(this,arguments)};var SUPERARG=function(){return this.SUPER.apply(this,arguments[0])};Joose.Proto.Object.prototype={SUPERARG:SUPERARG,SUPER:SUPER,INNER:function(){throw"Invalid call to INNER"},BUILD:function(config){return arguments.length==1&&typeof config=='object'&&config||{}},initialize:function(){},toString:function(){return"a "+this.meta.name}};Joose.Proto.Object.meta={constructor:Joose.Proto.Object,methods:Joose.O.copy(Joose.Proto.Object.prototype),attributes:{}};Joose.Proto.Object.prototype.meta=Joose.Proto.Object.meta})();(function(){Joose.Proto.Class=function(){this.initialize(this.BUILD.apply(this,arguments))};var bootstrap={VERSION:null,AUTHORITY:null,constructor:Joose.Proto.Class,superClass:null,name:null,attributes:null,methods:null,meta:null,c:null,defaultSuperClass:Joose.Proto.Object,BUILD:function(name,extend){this.name=name;return{__extend__:extend||{}}},initialize:function(props){var extend=props.__extend__;this.VERSION=extend.VERSION;this.AUTHORITY=extend.AUTHORITY;delete extend.VERSION;delete extend.AUTHORITY;this.c=this.extractConstructor(extend);this.adaptConstructor(this.c);if(extend.constructorOnly){delete extend.constructorOnly;return}this.construct(extend)},construct:function(extend){if(!this.prepareProps(extend))return;var superClass=this.superClass=this.extractSuperClass(extend);this.processSuperClass(superClass);this.adaptPrototype(this.c.prototype);this.finalize(extend)},finalize:function(extend){this.processStem(extend);this.extend(extend)},prepareProps:function(extend){return true},extractConstructor:function(extend){var res=extend.hasOwnProperty('constructor')?extend.constructor:this.defaultConstructor();delete extend.constructor;return res},extractSuperClass:function(extend){var res=extend.isa||this.defaultSuperClass;delete extend.isa;return res},processStem:function(){var superMeta=this.superClass.meta||{};this.methods=Joose.O.getMutableCopy(superMeta.methods||{});this.attributes=Joose.O.getMutableCopy(superMeta.attributes||{})},initInstance:function(instance,props){Joose.O.copyOwn(props,instance)},defaultConstructor:function(){return function(){var args=this.BUILD.apply(this,arguments);this.meta.initInstance(this,args);var initialize=this.initialize;if(typeof initialize=='function')initialize.call(this,args)}},processSuperClass:function(superClass){this.c.prototype=Joose.O.getMutableCopy(superClass.prototype);this.c.superClass=superClass.prototype},adaptConstructor:function(c){c.meta=this;if(!c.hasOwnProperty('toString'))c.toString=function(){return this.meta.name}},adaptPrototype:function(proto){proto.constructor=this.c;proto.meta=this},addMethod:function(name,func){func.SUPER=this.superClass.prototype;func.methodName=name;this.methods[name]=func;this.c.prototype[name]=func},addAttribute:function(name,init){this.attributes[name]=init;this.c.prototype[name]=init},removeMethod:function(name){delete this.methods[name];delete this.c.prototype[name]},removeAttribute:function(name){delete this.attributes[name];delete this.c.prototype[name]},hasMethod:function(name){return Boolean(this.methods[name])},hasAttribute:function(name){return this.attributes[name]!==undefined},hasOwnMethod:function(name){return this.hasMethod(name)&&this.methods.hasOwnProperty(name)},hasOwnAttribute:function(name){return this.hasAttribute(name)&&this.attributes.hasOwnProperty(name)},extend:function(props){Joose.O.eachOwn(props,function(value,name){if(name!='meta'&&name!='constructor')if(Joose.O.isFunction(value)&&!value.meta)this.addMethod(name,value);else this.addAttribute(name,value)},this)},subClassOf:function(classObject,extend){extend=extend||{};extend.isa=classObject||this.c;return new this.constructor(null,extend).c},instantiate:function(){var f=function(){};f.prototype=this.c.prototype;var obj=new f();return this.c.apply(obj,arguments)||obj}};Joose.Proto.Class.prototype=Joose.O.getMutableCopy(Joose.Proto.Object.prototype);Joose.O.extend(Joose.Proto.Class.prototype,bootstrap);Joose.Proto.Class.prototype.meta=new Joose.Proto.Class('Joose.Proto.Class',bootstrap);Joose.Proto.Class.meta.addMethod('isa',function(someClass){var f=function(){};f.prototype=this.c.prototype;return new f()instanceof someClass})})();Joose.Managed=function(){throw"Modules may not be instantiated."};Joose.Managed.Property=new Joose.Proto.Class('Joose.Managed.Property',{name:null,init:null,value:null,definedIn:null,initialize:function(props){Joose.Managed.Property.superClass.initialize.call(this,props);this.computeValue()},computeValue:function(){this.value=this.init},preApply:function(targetClass){},postUnApply:function(targetClass){},apply:function(target){target[this.name]=this.value},isAppliedTo:function(target){return target[this.name]==this.value},unapply:function(from){if(!this.isAppliedTo(from))throw"Unapply of property ["+this.name+"] from ["+from+"] failed";delete from[this.name]},cloneProps:function(){return{name:this.name,init:this.init,definedIn:this.definedIn}},clone:function(name){var props=this.cloneProps();props.name=name||props.name;return new this.constructor(props)}}).c;Joose.Managed.Property.ConflictMarker=new Joose.Proto.Class('Joose.Managed.Property.ConflictMarker',{isa:Joose.Managed.Property,apply:function(target){throw"Attempt to apply ConflictMarker ["+this.name+"] to ["+target+"]"}}).c;Joose.Managed.Property.Requirement=new Joose.Proto.Class('Joose.Managed.Property.Requirement',{isa:Joose.Managed.Property,apply:function(target){if(!target.meta.hasMethod(this.name))throw"Requirement ["+this.name+"], defined in ["+this.definedIn.definedIn.name+"] is not satisfied for class ["+target+"]"},unapply:function(from){}}).c;Joose.Managed.Property.Attribute=new Joose.Proto.Class('Joose.Managed.Property.Attribute',{isa:Joose.Managed.Property,slot:null,initialize:function(){Joose.Managed.Property.Attribute.superClass.initialize.apply(this,arguments);this.slot=this.name},apply:function(target){target.prototype[this.slot]=this.value},isAppliedTo:function(target){return target.prototype[this.slot]==this.value},unapply:function(from){if(!this.isAppliedTo(from))throw"Unapply of property ["+this.name+"] from ["+from+"] failed";delete from.prototype[this.slot]},getRawValueFrom:function(instance){return instance[this.slot]},setRawValueTo:function(instance,value){instance[this.slot]=value}}).c;Joose.Managed.Property.MethodModifier=new Joose.Proto.Class('Joose.Managed.Property.MethodModifier',{isa:Joose.Managed.Property,prepareWrapper:function(){throw"Abstract method [prepareWrapper] of "+this+" was called"},apply:function(target){var name=this.name;var targetProto=target.prototype;var isOwn=targetProto.hasOwnProperty(name);var original=targetProto[name];var superProto=target.meta.superClass.prototype;var originalCall=isOwn?original:function(){return superProto[name].apply(this,arguments)};var methodWrapper=this.prepareWrapper({name:name,modifier:this.value,isOwn:isOwn,originalCall:originalCall,superProto:superProto,target:target});if(isOwn)methodWrapper._original=original;methodWrapper._contain=this.value;targetProto[name]=methodWrapper},isAppliedTo:function(target){var targetCont=target.prototype[this.name];return targetCont&&targetCont._contain==this.value},unapply:function(from){var name=this.name;var fromProto=from.prototype;var original=fromProto[name]._original;if(!this.isAppliedTo(from))throw"Unapply of method ["+name+"] from class ["+from+"] failed";if(original)fromProto[name]=original;else delete fromProto[name]}}).c;Joose.Managed.Property.MethodModifier.Override=new Joose.Proto.Class('Joose.Managed.Property.MethodModifier.Override',{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(params){var modifier=params.modifier;var originalCall=params.originalCall;var superProto=params.superProto;var superMetaConst=superProto.meta.constructor;var isCallToProto=(superMetaConst==Joose.Proto.Class||superMetaConst==Joose.Proto.Object)&&!(params.isOwn&&originalCall.IS_OVERRIDE);var original=originalCall;if(isCallToProto)original=function(){var beforeSUPER=this.SUPER;this.SUPER=superProto.SUPER;var res=originalCall.apply(this,arguments);this.SUPER=beforeSUPER;return res};var override=function(){var beforeSUPER=this.SUPER;this.SUPER=original;var res=modifier.apply(this,arguments);this.SUPER=beforeSUPER;return res};override.IS_OVERRIDE=true;return override}}).c;Joose.Managed.Property.MethodModifier.Put=new Joose.Proto.Class('Joose.Managed.Property.MethodModifier.Put',{isa:Joose.Managed.Property.MethodModifier.Override,prepareWrapper:function(params){if(params.isOwn)throw"Method ["+params.name+"] is applying over something ["+params.originalCall+"] in class ["+params.target+"]";return Joose.Managed.Property.MethodModifier.Put.superClass.prepareWrapper.call(this,params)}}).c;Joose.Managed.Property.MethodModifier.After=new Joose.Proto.Class('Joose.Managed.Property.MethodModifier.After',{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(params){var modifier=params.modifier;var originalCall=params.originalCall;return function(){var res=originalCall.apply(this,arguments);modifier.apply(this,arguments);return res}}}).c;Joose.Managed.Property.MethodModifier.Before=new Joose.Proto.Class('Joose.Managed.Property.MethodModifier.Before',{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(params){var modifier=params.modifier;var originalCall=params.originalCall;return function(){modifier.apply(this,arguments);return originalCall.apply(this,arguments)}}}).c;Joose.Managed.Property.MethodModifier.Around=new Joose.Proto.Class('Joose.Managed.Property.MethodModifier.Around',{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(params){var modifier=params.modifier;var originalCall=params.originalCall;var me;var bound=function(){return originalCall.apply(me,arguments)};return function(){me=this;var boundArr=[bound];boundArr.push.apply(boundArr,arguments);return modifier.apply(this,boundArr)}}}).c;Joose.Managed.Property.MethodModifier.Augment=new Joose.Proto.Class('Joose.Managed.Property.MethodModifier.Augment',{isa:Joose.Managed.Property.MethodModifier,prepareWrapper:function(params){var AUGMENT=function(){var callstack=[];var self=AUGMENT;do{callstack.push(self.IS_AUGMENT?self._contain:self);self=self.IS_AUGMENT&&(self._original||self.SUPER[self.methodName])}while(self);var beforeINNER=this.INNER;this.INNER=function(){var innerCall=callstack.pop();return innerCall?innerCall.apply(this,arguments):undefined};var res=this.INNER.apply(this,arguments);this.INNER=beforeINNER;return res};AUGMENT.methodName=params.name;AUGMENT.SUPER=params.superProto;AUGMENT.IS_AUGMENT=true;return AUGMENT}}).c;Joose.Managed.PropertySet=new Joose.Proto.Class('Joose.Managed.PropertySet',{isa:Joose.Managed.Property,properties:null,propertyMetaClass:Joose.Managed.Property,initialize:function(props){Joose.Managed.PropertySet.superClass.initialize.call(this,props);this.properties=props.properties||{}},addProperty:function(name,props){var metaClass=props.meta||this.propertyMetaClass;delete props.meta;props.definedIn=this;props.name=name;return this.properties[name]=new metaClass(props)},addPropertyObject:function(object){return this.properties[object.name]=object},removeProperty:function(name){var prop=this.properties[name];delete this.properties[name];return prop},haveProperty:function(name){return this.properties[name]!=null},haveOwnProperty:function(name){return this.haveProperty(name)&&this.properties.hasOwnProperty(name)},getProperty:function(name){return this.properties[name]},each:function(func,scope){scope=scope||this;Joose.O.each(this.properties,function(property,name){func.call(scope,property,name)})},eachOwn:function(func,scope){scope=scope||this;Joose.O.eachOwn(this.properties,function(property,name){func.call(scope,property,name)})},eachAll:function(func,scope){this.each(func,scope)},cloneProps:function(){var props=Joose.Managed.PropertySet.superClass.cloneProps.call(this);props.propertyMetaClass=this.propertyMetaClass;return props},clone:function(name){var clone=this.cleanClone(name);clone.properties=Joose.O.copyOwn(this.properties);return clone},cleanClone:function(name){var props=this.cloneProps();props.name=name||props.name;return new this.constructor(props)},alias:function(what){var props=this.properties;Joose.O.each(what,function(aliasName,originalName){var original=props[originalName];if(original)this.addPropertyObject(original.clone(aliasName))},this)},exclude:function(what){var props=this.properties;Joose.A.each(what,function(name){delete props[name]})},flattenTo:function(target){var targetProps=target.properties;this.eachOwn(function(property,name){var targetProperty=targetProps[name];if(targetProperty instanceof Joose.Managed.Property.ConflictMarker)return;if(targetProperty==null){target.addPropertyObject(property);return}if(targetProperty==property)return;target.removeProperty(name);target.addProperty(name,{meta:Joose.Managed.Property.ConflictMarker})},this)},composeTo:function(target){this.eachOwn(function(property,name){if(!target.haveOwnProperty(name))target.addPropertyObject(property)})},composeFrom:function(){if(!arguments.length)return;var flattening=this.cleanClone();Joose.A.each(arguments,function(arg){var propSet=arg;if(!(arg instanceof Joose.Managed.PropertySet)){propSet=arg.propertySet;if(arg.alias||arg.exclude)propSet=propSet.clone();if(arg.alias)propSet.alias(arg.alias);if(arg.exclude)propSet.exclude(arg.exclude)}propSet.flattenTo(flattening)});flattening.composeTo(this)},preApply:function(target){this.eachOwn(function(property){property.preApply(target)})},apply:function(target){this.eachOwn(function(property){property.apply(target)})},unapply:function(from){this.eachOwn(function(property){property.unapply(from)})},postUnApply:function(target){this.eachOwn(function(property){property.postUnApply(target)})}}).c;(function(){var __ID__=1;Joose.Managed.PropertySet.Mutable=new Joose.Proto.Class('Joose.Managed.PropertySet.Mutable',{isa:Joose.Managed.PropertySet,ID:null,derivatives:null,opened:null,composedFrom:null,initialize:function(props){Joose.Managed.PropertySet.Mutable.superClass.initialize.call(this,props);this.opened=1;this.derivatives={};this.ID=__ID__++;this.composedFrom=[]},setComposeInfo:function(){this.ensureOpen();Joose.A.each(this.composedFrom,function(arg){var propSet=arg instanceof Joose.Managed.PropertySet?arg:arg.propertySet;delete propSet.derivatives[this.ID]},this);this.composedFrom=[];this.addComposeInfo.apply(this,arguments)},addComposeInfo:function(){this.ensureOpen();Joose.A.each(arguments,function(arg){this.composedFrom.push(arg);var propSet=arg instanceof Joose.Managed.PropertySet?arg:arg.propertySet;propSet.derivatives[this.ID]=this},this)},removeComposeInfo:function(){this.ensureOpen();Joose.A.each(arguments,function(arg){var i=0;while(i<this.composedFrom.length){var propSet=this.composedFrom[i];propSet=propSet instanceof Joose.Managed.PropertySet?propSet:propSet.propertySet;if(arg==propSet){delete propSet.derivatives[this.ID];this.composedFrom.splice(i,1)}else i++}},this)},ensureOpen:function(){if(!this.opened)throw"Mutation of closed property set: ["+this.name+"]"},addProperty:function(name,props){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.addProperty.call(this,name,props)},addPropertyObject:function(object){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.addPropertyObject.call(this,object)},removeProperty:function(name){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.removeProperty.call(this,name)},composeFrom:function(){this.ensureOpen();return Joose.Managed.PropertySet.Mutable.superClass.composeFrom.apply(this,this.composedFrom)},open:function(){this.opened++;if(this.opened==1){Joose.O.each(this.derivatives,function(propSet){propSet.open()});this.deCompose()}},close:function(){if(!this.opened)throw"Unmatched 'close' operation on property set: ["+this.name+"]";if(this.opened==1){this.reCompose();Joose.O.each(this.derivatives,function(propSet){propSet.close()})}this.opened--},reCompose:function(){this.composeFrom()},deCompose:function(){this.eachOwn(function(property,name){if(property.definedIn!=this)this.removeProperty(name)},this)}}).c})();Joose.Managed.StemElement=function(){throw"Modules may not be instantiated."};Joose.Managed.StemElement.Attributes=new Joose.Proto.Class('Joose.Managed.StemElement.Attributes',{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.Property.Attribute}).c;Joose.Managed.StemElement.Methods=new Joose.Proto.Class('Joose.Managed.StemElement.Methods',{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.Property.MethodModifier.Put,preApply:function(){},postUnApply:function(){}}).c;Joose.Managed.StemElement.Requirements=new Joose.Proto.Class('Joose.Managed.StemElement.Requirements',{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.Property.Requirement,alias:function(){},exclude:function(){},flattenTo:function(target){this.each(function(property,name){if(!target.haveProperty(name))target.addPropertyObject(property)})},composeTo:function(target){this.flattenTo(target)},preApply:function(target){},postUnApply:function(){}}).c;Joose.Managed.StemElement.MethodModifiers=new Joose.Proto.Class('Joose.Managed.StemElement.MethodModifiers',{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:null,addProperty:function(name,props){var metaClass=props.meta;delete props.meta;props.definedIn=this;props.name=name;var modifier=new metaClass(props);if(!this.properties[name])this.properties[name]=[];this.properties[name].push(modifier);return modifier},addPropertyObject:function(object){var name=object.name;if(!this.properties[name])this.properties[name]=[];this.properties[name].push(object);return object},removeProperty:function(name){if(!this.haveProperty(name))return undefined;var modifier=this.properties[name].pop();if(!this.properties[name].length)Joose.Managed.StemElement.MethodModifiers.superClass.removeProperty.call(this,name);return modifier},alias:function(){},exclude:function(){},flattenTo:function(target){var targetProps=target.properties;this.each(function(modifiersArr,name){var targetModifiersArr=targetProps[name];if(targetModifiersArr==null)targetModifiersArr=targetProps[name]=[];Joose.A.each(modifiersArr,function(modifier){if(!Joose.A.exists(targetModifiersArr,modifier))targetModifiersArr.push(modifier)})},this)},composeTo:function(target){this.flattenTo(target)},deCompose:function(){this.each(function(modifiersArr,name){var i=0;while(i<modifiersArr.length){if(modifiersArr[i].definedIn!=this){modifiersArr.splice(i,1)}else{i++}}},this)},preApply:function(target){},postUnApply:function(target){},apply:function(target){this.each(function(modifiersArr,name){Joose.A.each(modifiersArr,function(modifier){modifier.apply(target)})})},unapply:function(from){this.each(function(modifiersArr,name){for(var i=modifiersArr.length-1;i>=0;i--)modifiersArr[i].unapply(from)})}}).c;Joose.Managed.PropertySet.Composition=new Joose.Proto.Class('Joose.Managed.PropertySet.Composition',{isa:Joose.Managed.PropertySet.Mutable,propertyMetaClass:Joose.Managed.PropertySet.Mutable,processOrder:null,each:function(func,scope){var props=this.properties;Joose.A.each(this.processOrder,function(name){func.call(scope||this,props[name],name)},this)},eachR:function(func,scope){var props=this.properties;for(var i=this.processOrder.length-1;i>=0;i--)func.call(scope||this,props[this.processOrder[i]],this.processOrder[i])},clone:function(name){var clone=this.cleanClone(name);this.each(function(property){clone.addPropertyObject(property.clone())});return clone},alias:function(what){this.each(function(property){property.alias(what)})},exclude:function(what){this.each(function(property){property.exclude(what)})},flattenTo:function(target){var targetProps=target.properties;this.each(function(property,name){var subTarget=targetProps[name]||target.addProperty(name,{meta:property.constructor});property.flattenTo(subTarget)})},composeTo:function(target){var targetProps=target.properties;this.each(function(property,name){var subTarget=targetProps[name]||target.addProperty(name,{meta:property.constructor});property.composeTo(subTarget)})},deCompose:function(){this.eachR(function(property){property.open()});Joose.Managed.PropertySet.Composition.superClass.deCompose.call(this)},reCompose:function(){Joose.Managed.PropertySet.Composition.superClass.reCompose.call(this);this.each(function(property){property.close()})},unapply:function(from){this.eachR(function(property){property.unapply(from)})}}).c;Joose.Managed.Stem=new Joose.Proto.Class('Joose.Managed.Stem',{isa:Joose.Managed.PropertySet.Composition,targetMeta:null,attributesMC:Joose.Managed.StemElement.Attributes,methodsMC:Joose.Managed.StemElement.Methods,requirementsMC:Joose.Managed.StemElement.Requirements,methodsModifiersMC:Joose.Managed.StemElement.MethodModifiers,processOrder:['attributes','methods','requirements','methodsModifiers'],initialize:function(props){Joose.Managed.Stem.superClass.initialize.call(this,props);var targetMeta=this.targetMeta;this.addProperty('attributes',{meta:this.attributesMC,properties:targetMeta?targetMeta.attributes:{}});this.addProperty('methods',{meta:this.methodsMC,properties:targetMeta?targetMeta.methods:{}});this.addProperty('requirements',{meta:this.requirementsMC});this.addProperty('methodsModifiers',{meta:this.methodsModifiersMC})},reCompose:function(){this.preApply(this.targetMeta.c);Joose.Managed.Stem.superClass.reCompose.call(this);this.apply(this.targetMeta.c)},deCompose:function(){this.unapply(this.targetMeta.c);Joose.Managed.Stem.superClass.deCompose.call(this);this.postUnApply(this.targetMeta.c)}}).c;Joose.Managed.Builder=new Joose.Proto.Class('Joose.Managed.Builder',{targetMeta:null,_buildStart:function(targetMeta,props){targetMeta.stem.open();Joose.A.each(['trait','traits','removeTrait','removeTraits','does','doesnot','doesnt'],function(builder){if(props[builder]){this[builder](targetMeta,props[builder]);delete props[builder]}},this)},_extend:function(props){if(Joose.O.isEmpty(props))return;var targetMeta=this.targetMeta;this._buildStart(targetMeta,props);Joose.O.eachOwn(props,function(value,name){var handler=this[name];if(!handler)throw"Unknow builder ["+name+"] was used during extending of ["+targetMeta.c+"]";handler.call(this,targetMeta,value)},this);this._buildComplete(targetMeta,props)},_buildComplete:function(targetMeta,props){targetMeta.stem.close()},methods:function(targetMeta,info){Joose.O.eachOwn(info,function(value,name){targetMeta.addMethod(name,value)},this)},removeMethods:function(targetMeta,info){Joose.A.each(info,function(name){targetMeta.removeMethod(name)},this)},have:function(targetMeta,info){Joose.O.eachOwn(info,function(value,name){targetMeta.addAttribute(name,value)},this)},havenot:function(targetMeta,info){Joose.A.each(info,function(name){targetMeta.removeAttribute(name)},this)},havent:function(targetMeta,info){this.havenot(targetMeta,info)},after:function(targetMeta,info){Joose.O.each(info,function(value,name){targetMeta.addMethodModifier(name,value,Joose.Managed.Property.MethodModifier.After)},this)},before:function(targetMeta,info){Joose.O.each(info,function(value,name){targetMeta.addMethodModifier(name,value,Joose.Managed.Property.MethodModifier.Before)},this)},override:function(targetMeta,info){Joose.O.each(info,function(value,name){targetMeta.addMethodModifier(name,value,Joose.Managed.Property.MethodModifier.Override)},this)},around:function(targetMeta,info){Joose.O.each(info,function(value,name){targetMeta.addMethodModifier(name,value,Joose.Managed.Property.MethodModifier.Around)},this)},augment:function(targetMeta,info){Joose.O.each(info,function(value,name){targetMeta.addMethodModifier(name,value,Joose.Managed.Property.MethodModifier.Augment)},this)},removeModifier:function(targetMeta,info){Joose.A.each(info,function(name){targetMeta.removeMethodModifier(name)},this)},does:function(targetMeta,info){Joose.A.each(Joose.O.wantArray(info),function(desc){targetMeta.addRole(desc)},this)},doesnot:function(targetMeta,info){Joose.A.each(Joose.O.wantArray(info),function(desc){targetMeta.removeRole(desc)},this)},doesnt:function(targetMeta,info){this.doesnot(targetMeta,info)},trait:function(){this.traits.apply(this,arguments)},traits:function(targetMeta,info){if(targetMeta.firstPass)return;if(!targetMeta.meta.isDetached)throw"Can't apply trait to not detached class";targetMeta.meta.extend({does:info})},removeTrait:function(){this.removeTraits.apply(this,arguments)},removeTraits:function(targetMeta,info){if(!targetMeta.meta.isDetached)throw"Can't remove trait from not detached class";targetMeta.meta.extend({doesnot:info})}}).c;Joose.Managed.Class=new Joose.Proto.Class('Joose.Managed.Class',{isa:Joose.Proto.Class,stem:null,stemClass:Joose.Managed.Stem,stemClassCreated:false,builder:null,builderClass:Joose.Managed.Builder,builderClassCreated:false,isDetached:false,firstPass:true,skipTraitsAnchor:{},BUILD:function(){var sup=Joose.Managed.Class.superClass.BUILD.apply(this,arguments);var props=sup.__extend__;var traits=Joose.O.wantArray(props.trait||props.traits||[]);delete props.trait;delete props.traits;Joose.A.each(Joose.O.wantArray(props.does||[]),function(arg){var role=(arg.meta instanceof Joose.Managed.Class)?arg:arg.role;if(role.meta.meta.isDetached)traits.push(role.meta.constructor)});if(traits.length)props.traits=traits;return sup},initInstance:function(instance,props){Joose.O.each(this.attributes,function(attribute,name){if(attribute instanceof Joose.Managed.Attribute)attribute.initFromConfig(instance,props);else{if(props.hasOwnProperty(name))instance[name]=props[name]}})},defaultConstructor:function(){return function(skipTraitsAnchor,params){var thisMeta=this.meta;var skipTraits=skipTraitsAnchor==thisMeta.skipTraitsAnchor;var props=this.BUILD.apply(this,skipTraits?params:arguments);var extend=props.__extend__||props;var traits=extend.trait||extend.traits;if(traits||extend.detached){delete extend.trait;delete extend.traits;delete extend.detached;if(!skipTraits){var classWithTrait=thisMeta.subClassOf(this.constructor,{does:traits||[]});var meta=classWithTrait.meta;meta.isDetached=true;meta.name=thisMeta.name;return meta.instantiate.call(meta,thisMeta.skipTraitsAnchor,arguments)}}thisMeta.initInstance(this,props);var initialize=this.initialize;if(typeof initialize=='function')initialize.call(this,props)}},finalize:function(extend){Joose.Managed.Class.superClass.finalize.call(this,extend);this.stem.close();this.afterMutate()},processStem:function(){Joose.Managed.Class.superClass.processStem.call(this);this.builder=new this.builderClass({targetMeta:this});this.stem=new this.stemClass({name:this.name,targetMeta:this});var builderClass=this.getClassInAttribute('builderClass');if(builderClass){this.builderClassCreated=true;this.addAttribute('builderClass',this.subClassOf(builderClass))}var stemClass=this.getClassInAttribute('stemClass');if(stemClass){this.stemClassCreated=true;this.addAttribute('stemClass',this.subClassOf(stemClass))}},extend:function(props){if(props.builder){this.getBuilderTarget().meta.extend(props.builder);delete props.builder}if(props.stem){this.getStemTarget().meta.extend(props.stem);delete props.stem}this.builder._extend(props);this.firstPass=false;if(!this.stem.opened)this.afterMutate()},getBuilderTarget:function(){var builderClass=this.getClassInAttribute('builderClass');if(!builderClass)throw"Attempt to extend a builder on non-meta class";return builderClass},getStemTarget:function(){var stemClass=this.getClassInAttribute('stemClass');if(!stemClass)throw"Attempt to extend a stem on non-meta class";return stemClass},getClassInAttribute:function(attributeName){var attrClass=this.getAttribute(attributeName);if(attrClass instanceof Joose.Managed.Property.Attribute)attrClass=attrClass.value;return attrClass},addMethodModifier:function(name,func,type){var props={};props.init=func;props.meta=type;return this.stem.properties.methodsModifiers.addProperty(name,props)},removeMethodModifier:function(name){return this.stem.properties.methodsModifiers.removeProperty(name)},addMethod:function(name,func,props){props=props||{};props.init=func;return this.stem.properties.methods.addProperty(name,props)},addAttribute:function(name,init,props){props=props||{};props.init=init;return this.stem.properties.attributes.addProperty(name,props)},removeMethod:function(name){return this.stem.properties.methods.removeProperty(name)},removeAttribute:function(name){return this.stem.properties.attributes.removeProperty(name)},hasMethod:function(name){return this.stem.properties.methods.haveProperty(name)},hasAttribute:function(name){return this.stem.properties.attributes.haveProperty(name)},hasOwnMethod:function(name){return this.stem.properties.methods.haveOwnProperty(name)},hasOwnAttribute:function(name){return this.stem.properties.attributes.haveOwnProperty(name)},getMethod:function(name){return this.stem.properties.methods.getProperty(name)},getAttribute:function(name){return this.stem.properties.attributes.getProperty(name)},eachRole:function(roles,func,scope){Joose.A.each(roles,function(arg,index){var role=(arg.meta instanceof Joose.Managed.Class)?arg:arg.role;func.call(scope||this,arg,role,index)},this)},addRole:function(){this.eachRole(arguments,function(arg,role){this.beforeRoleAdd(role);var desc=arg;if(role!=arg){desc.propertySet=role.meta.stem;delete desc.role}else desc=desc.meta.stem;this.stem.addComposeInfo(desc)},this)},beforeRoleAdd:function(role){var roleMeta=role.meta;if(roleMeta.builderClassCreated)this.getBuilderTarget().meta.extend({does:[roleMeta.getBuilderTarget()]});if(roleMeta.stemClassCreated)this.getStemTarget().meta.extend({does:[roleMeta.getStemTarget()]});if(roleMeta.meta.isDetached&&!this.firstPass)this.builder.traits(this,roleMeta.constructor)},beforeRoleRemove:function(role){var roleMeta=role.meta;if(roleMeta.builderClassCreated)this.getBuilderTarget().meta.extend({doesnt:[roleMeta.getBuilderTarget()]});if(roleMeta.stemClassCreated)this.getStemTarget().meta.extend({doesnt:[roleMeta.getStemTarget()]});if(roleMeta.meta.isDetached&&!this.firstPass)this.builder.removeTraits(this,roleMeta.constructor)},removeRole:function(){this.eachRole(arguments,function(arg,role){this.beforeRoleRemove(role);this.stem.removeComposeInfo(role.meta.stem)},this)},getRoles:function(){var roles=[];Joose.A.each(this.stem.composedFrom,function(composeDesc){if(!(composeDesc instanceof Joose.Managed.PropertySet))composeDesc=composeDesc.propertySet;roles.push(composeDesc.targetMeta.c)});return roles},does:function(role){var myRoles=this.getRoles();for(var i=0;i<myRoles.length;i++)if(role==myRoles[i])return true;for(var i=0;i<myRoles.length;i++)if(myRoles[i].meta.does(role))return true;var superMeta=this.superClass.meta;if(this.superClass!=Joose.Proto.Empty&&superMeta&&superMeta.meta&&superMeta.meta.hasMethod('does'))return superMeta.does(role);return false},getMethods:function(){return this.stem.properties.methods},getAttributes:function(){return this.stem.properties.attributes},afterMutate:function(){}}).c;Joose.Managed.Role=new Joose.Managed.Class('Joose.Managed.Role',{isa:Joose.Managed.Class,have:{defaultSuperClass:Joose.Proto.Empty,builderRole:null,stemRole:null},methods:{defaultConstructor:function(){return function(){throw"Roles cant be instantiated"}},processSuperClass:function(){if(this.superClass!=this.defaultSuperClass)throw"Roles can't inherit from anything"},getBuilderTarget:function(){if(!this.builderRole){this.builderRole=new this.constructor().c;this.builderClassCreated=true}return this.builderRole},getStemTarget:function(){if(!this.stemRole){this.stemRole=new this.constructor().c;this.stemClassCreated=true}return this.stemRole},addRequirement:function(methodName){this.stem.properties.requirements.addProperty(methodName,{})}},stem:{methods:{apply:function(){},unapply:function(){}}},builder:{methods:{requires:function(targetClassMeta,info){Joose.A.each(Joose.O.wantArray(info),function(methodName){targetClassMeta.addRequirement(methodName)},this)}}}}).c;Joose.Managed.Attribute=new Joose.Managed.Class('Joose.Managed.Attribute',{isa:Joose.Managed.Property.Attribute,have:{is:null,builder:null,isPrivate:false,role:null,publicName:null,setterName:null,getterName:null,readable:false,writeable:false,hasGetter:false,hasSetter:false,required:false},after:{initialize:function(){var name=this.name;this.publicName=name.replace(/^_+/,'');this.slot=this.isPrivate?'$$'+name:name;this.setterName=this.setterName||this.getSetterName();this.getterName=this.getterName||this.getGetterName();this.readable=this.hasGetter=/^r/i.test(this.is);this.writeable=this.hasSetter=/^.w/i.test(this.is)}},override:{computeValue:function(){if(!Joose.O.isFunction(this.init))this.SUPER()},preApply:function(targetClass){targetClass.meta.extend({methods:this.getAccessorsFor(targetClass)})},postUnApply:function(from){from.meta.extend({removeMethods:this.getAccessorsFrom(from)})}},methods:{getAccessorsFor:function(targetClass){var targetMeta=targetClass.meta;var setterName=this.setterName;var getterName=this.getterName;var methods={};if(this.hasSetter&&!targetMeta.hasMethod(setterName)){methods[setterName]=this.getSetter();methods[setterName].ACCESSOR_FROM=this}if(this.hasGetter&&!targetMeta.hasMethod(getterName)){methods[getterName]=this.getGetter();methods[getterName].ACCESSOR_FROM=this}return methods},getAccessorsFrom:function(from){var targetMeta=from.meta;var setterName=this.setterName;var getterName=this.getterName;var setter=this.hasSetter&&targetMeta.getMethod(setterName);var getter=this.hasGetter&&targetMeta.getMethod(getterName);var removeMethods=[];if(setter&&setter.value.ACCESSOR_FROM==this)removeMethods.push(setterName);if(getter&&getter.value.ACCESSOR_FROM==this)removeMethods.push(getterName);return removeMethods},getGetterName:function(){return'get'+Joose.S.uppercaseFirst(this.publicName)},getSetterName:function(){return'set'+Joose.S.uppercaseFirst(this.publicName)},getSetter:function(){var slot=this.slot;return function(value){this[slot]=value;return this}},getGetter:function(){var slot=this.slot;return function(){return this[slot]}},getValueFrom:function(instance){var getterName=this.getterName;if(this.readable&&instance.meta.hasMethod(getterName))return instance[getterName]();return instance[this.slot]},setValueTo:function(instance,value){var setterName=this.setterName;if(this.writeable&&instance.meta.hasMethod(setterName))instance[setterName](value);else instance[this.slot]=value},initFromConfig:function(instance,config){var name=this.name;var value,isSet=false;if(config.hasOwnProperty(name)){value=config[name];isSet=true}else if(Joose.O.isFunction(this.init)){value=this.init.call(instance,name,config);isSet=true}else if(this.builder){value=instance[this.builder.replace(/^this\./,'')](name,config);isSet=true}if(isSet)this.setValueTo(instance,value);else if(this.required)throw"Required attribute ["+name+"] is missed during initialization of "+instance}}}).c;Joose.Managed.PropertySet.Namespace=new Joose.Proto.Class('Joose.Managed.PropertySet.Namespace',{isa:Joose.Managed.PropertySet,propertyMetaClass:null,targetMeta:null,container:null,initialize:function(props){Joose.Managed.PropertySet.Namespace.superClass.initialize.call(this,props);this.container=this.targetMeta.c},addProperty:function(name,value){if(value&&value.meta&&value.meta.meta.hasAttribute('ns'))value.meta.parentNs=this.targetMeta.ns;return this.container[name]=this.properties[name]=value},removeProperty:function(name){try{delete this.container[name]}catch(e){this.container[name]=undefined}return Joose.Managed.PropertySet.Namespace.superClass.removeProperty.call(this,name)}}).c;Joose.Managed.Attribute.Builder=new Joose.Managed.Role('Joose.Managed.Attribute.Builder',{have:{defaultAttributeClass:Joose.Managed.Attribute},builder:{methods:{has:function(targetClassMeta,info){Joose.O.eachOwn(info,function(props,name){if(typeof props!='object'||props==null||props.constructor==RegExp)props={init:props};props.meta=props.meta||targetClassMeta.defaultAttributeClass;if(/^__/.test(name)){name=name.replace(/^_+/,'');props.isPrivate=true}targetClassMeta.addAttribute(name,props.init,props)},this)},hasnot:function(targetClassMeta,info){this.havenot(targetClassMeta,info)},hasnt:function(targetClassMeta,info){this.hasnot(targetClassMeta,info)}}}}).c;Joose.Managed.My=new Joose.Managed.Role('Joose.Managed.My',{have:{myClass:null,needToReAlias:false},methods:{createMy:function(extend){var thisMeta=this.meta;var isRole=this instanceof Joose.Managed.Role;var myExtend=extend.my||{};delete extend.my;if(!isRole)myExtend.isa=myExtend.isa||this.superClass.meta.myClass;if(!myExtend.meta&&!myExtend.isa)myExtend.meta=this.constructor;var createdClass=this.myClass=Class(myExtend);this.c.prototype.my=this.c.my=isRole?createdClass:new createdClass({HOST:this.c});this.needToReAlias=true},aliasStaticMethods:function(){this.needToReAlias=false;var c=this.c;var myProto=this.myClass.prototype;this.myClass.meta.stem.properties.methods.each(function(method,name){var alias=c[name];if(alias&&alias.IS_ALIAS)delete c[name];if(!c[name]){(c[name]=function(){return myProto[name].apply(c.my,arguments)}).IS_ALIAS=true}})}},override:{extend:function(props){if(!this.myClass&&this.superClass.meta.myClass)this.createMy(props);if(props.my){if(!this.myClass)this.createMy(props);else{this.myClass.meta.extend(props.my);delete props.my}}this.SUPER(props);if(this.needToReAlias&&!(this instanceof Joose.Managed.Role))this.aliasStaticMethods()}},before:{addRole:function(){var myStem;Joose.A.each(arguments,function(arg){var role=(arg.meta instanceof Joose.Managed.Class)?arg:arg.role;if(role.meta.meta.hasAttribute('myClass')&&role.meta.myClass){if(!this.myClass){this.createMy({my:{does:role.meta.myClass}});return}myStem=this.myClass.meta.stem;if(!myStem.opened)myStem.open();myStem.addComposeInfo(role.my.meta.stem)}},this);if(myStem){myStem.close();this.needToReAlias=true}},removeRole:function(){if(!this.myClass)return;var myStem=this.myClass.meta.stem;myStem.open();Joose.A.each(arguments,function(role){if(role.meta.meta.hasAttribute('myClass')&&role.meta.myClass){myStem.removeComposeInfo(role.my.meta.stem);this.needToReAlias=true}},this);myStem.close()}}}).c;Joose.Namespace=function(){throw"Modules may not be instantiated."};Joose.Namespace.Able=new Joose.Managed.Role('Joose.Namespace.Able',{have:{parentNs:null,ns:null,bodyFunc:null},before:{extend:function(extend){if(extend.body){this.bodyFunc=extend.body;delete extend.body}}},after:{adaptConstructor:function(extend){var localName=(this.name||'').split('.').pop();this.ns=new Joose.Managed.PropertySet.Namespace({name:localName,targetMeta:this})},afterMutate:function(){var bodyFunc=this.bodyFunc;delete this.bodyFunc;if(bodyFunc)Joose.Namespace.Manager.my.executeIn(this.c,bodyFunc)}}}).c;Joose.Managed.Bootstrap=new Joose.Managed.Role('Joose.Managed.Bootstrap',{does:[Joose.Namespace.Able,Joose.Managed.My,Joose.Managed.Attribute.Builder]}).c;Joose.Meta=function(){throw"Modules may not be instantiated."};Joose.Meta.Object=new Joose.Proto.Class('Joose.Meta.Object',{isa:Joose.Proto.Object}).c;Joose.Meta.Class=new Joose.Managed.Class('Joose.Meta.Class',{isa:Joose.Managed.Class,does:Joose.Managed.Bootstrap,have:{defaultSuperClass:Joose.Meta.Object}}).c;Joose.Meta.Role=new Joose.Meta.Class('Joose.Meta.Role',{isa:Joose.Managed.Role,does:Joose.Managed.Bootstrap}).c;Joose.Namespace.Keeper=new Joose.Meta.Class('Joose.Namespace.Keeper',{isa:Joose.Meta.Class,have:{externalConstructor:null},methods:{defaultConstructor:function(){return function(){var thisMeta=arguments.callee.meta;if(thisMeta instanceof Joose.Namespace.Keeper)throw"Module ["+thisMeta.c+"] may not be instantiated.";var externalConstructor=thisMeta.externalConstructor;if(typeof externalConstructor=='function'){externalConstructor.meta=thisMeta;return externalConstructor.apply(this,arguments)}throw"NamespaceKeeper of ["+thisMeta.name+"] was planted incorrectly."}},plant:function(withClass){this.copyNamespaceState(withClass);var keeper=this.c;keeper.meta=withClass.meta;keeper.meta.c=keeper;keeper.meta.externalConstructor=withClass},copyNamespaceState:function(targetClass){var targetMeta=targetClass.meta;targetMeta.parentNs=this.parentNs;targetMeta.ns=this.ns}}}).c;Joose.Namespace.Manager=new Joose.Managed.Class('Joose.Namespace.Manager',{have:{global:null,globalNs:null,current:null},methods:{initialize:function(){var globalKeeper=this.global=new Joose.Namespace.Keeper('').c;var globalNs=this.globalNs=globalKeeper.meta.ns;globalNs.container=Joose.is_NodeJS&&global||Joose.top;globalKeeper.meta.parentNs=globalKeeper;this.current=[globalKeeper]},getCurrent:function(){return this.current[0]},executeIn:function(ns,func){var current=this.current;var scope=ns.meta.ns?ns.meta.ns.container:ns;current.unshift(ns);var res=func.call(scope,ns);current.shift();return res},earlyCreate:function(name,metaClass,props){props.constructorOnly=true;return new metaClass(name,props).c},create:function(nsName,metaClass,extend){if(!nsName)return new metaClass(nsName,extend).c;var me=this;if(/^\./.test(nsName))return this.executeIn(this.global,function(){return me.create(nsName.replace(/^\./,''),metaClass,extend)});props=extend||{};var parts=Joose.S.saneSplit(nsName,'.');var object=this.getCurrent();var soFar=Joose.S.saneSplit(object.meta.name,'.');for(var i=0;i<parts.length;i++){var part=parts[i];var isLast=i==parts.length-1;if(part=="meta"||part=="my"||!part)throw"Module name ["+nsName+"] may not include a part called 'meta' or 'my' or empty part.";var cur=(object==this.global?this.global.meta.ns.container:object)[part];soFar.push(part);var soFarName=soFar.join(".");var needFinalize=false;var nsKeeper;if(typeof cur=="undefined"){if(isLast){nsKeeper=this.earlyCreate(soFarName,metaClass,props);needFinalize=true}else nsKeeper=new Joose.Namespace.Keeper(soFarName).c;if(object.meta)object.meta.ns.addProperty(part,nsKeeper);else object[part]=nsKeeper;cur=nsKeeper}else if(isLast&&cur&&cur.meta){if(cur.meta.constructor==metaClass&&extend)cur.meta.extend(props);else if(cur.meta instanceof Joose.Namespace.Keeper&&metaClass!=Joose.Namespace.Keeper){cur.meta.plant(this.earlyCreate(soFarName,metaClass,props));needFinalize=true}else if(metaClass!=Joose.Namespace.Keeper)throw"Re-declaration of class "+soFarName+"with different meta is not allowed"}else if(isLast&&!(cur&&cur.meta&&cur.meta.meta&&cur.meta.meta.hasAttribute('ns')))throw"Trying to setup module "+soFarName+" failed. There is already something: "+cur;if(needFinalize)cur.meta.construct(props);object=cur}return object},prepareProperties:function(name,props,defaultMeta,callback){if(name&&typeof name!='string'){props=name;name=null}var meta;if(props&&props.meta){meta=props.meta;delete props.meta}if(!meta){if(props&&typeof props.isa=='function')meta=props.isa.meta.constructor;else meta=defaultMeta}return callback.call(this,name,meta,props)},getDefaultHelperFor:function(metaClass){var me=this;return function(name,props){return me.prepareProperties(name,props,metaClass,function(name,meta,props){return me.create(name,meta,props)})}},register:function(helperName,metaClass,func){var me=this;if(this.meta.hasMethod(helperName)){var helper=function(){return me[helperName].apply(me,arguments)};if(!Joose.top[helperName])Joose.top[helperName]=helper;if(!Joose[helperName])Joose[helperName]=helper;if(Joose.is_NodeJS&&!global[helperName])global[helperName]=helper}else{var methods={};methods[helperName]=func||this.getDefaultHelperFor(metaClass);this.meta.extend({methods:methods});this.register(helperName)}},Module:function(name,props){return this.prepareProperties(name,props,Joose.Namespace.Keeper,function(name,meta,props){if(typeof props=='function')props={body:props};return this.create(name,meta,props)})}}}).c;Joose.Namespace.Manager.my=new Joose.Namespace.Manager();Joose.Namespace.Manager.my.register('Class',Joose.Meta.Class);Joose.Namespace.Manager.my.register('Role',Joose.Meta.Role);Joose.Namespace.Manager.my.register('Module');;var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return!a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();var JSON;if(!JSON){JSON={}}(function(){"use strict";function f(n){return n<10?'0'+n:n}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){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(key){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':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key)}if(typeof rep==='function'){value=rep.call(holder,key,value)}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null'}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null'}v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v}if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v)}}}}v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v}}if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' '}}else if(typeof space==='string'){indent=space}rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify')}return str('',{'':value})}}if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}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(a,b){var c=[].slice,d={},e=a.amplify={publish:function(a){var b=c.call(arguments,1),e,f,g,h=0,i;if(!d[a])return!0;e=d[a].slice();for(g=e.length;h<g;h++){f=e[h],i=f.callback.apply(f.context,b);if(i===!1)break}return i!==!1},subscribe:function(a,b,c,e){arguments.length===3&&typeof c=="number"&&(e=c,c=b,b=null),arguments.length===2&&(c=b,b=null),e=e||10;var f=0,g=a.split(/\s/),h=g.length,i;for(;f<h;f++){a=g[f],i=!1,d[a]||(d[a]=[]);var j=d[a].length-1,k={callback:c,context:b,priority:e};for(;j>=0;j--)if(d[a][j].priority<=e){d[a].splice(j+1,0,k),i=!0;break}i||d[a].unshift(k)}return c},unsubscribe:function(a,b){if(!!d[a]){var c=d[a].length,e=0;for(;e<c;e++)if(d[a][e].callback===b){d[a].splice(e,1);break}}}}})(this),function(a,b){function e(a,e){c.addType(a,function(f,g,h){var i,j,k,l,m=g,n=(new Date).getTime();if(!f){m={},l=[],k=0;try{f=e.length;while(f=e.key(k++))d.test(f)&&(j=JSON.parse(e.getItem(f)),j.expires&&j.expires<=n?l.push(f):m[f.replace(d,"")]=j.data);while(f=l.pop())e.removeItem(f)}catch(o){}return m}f="__amplify__"+f;if(g===b){i=e.getItem(f),j=i?JSON.parse(i):{expires:-1};if(j.expires&&j.expires<=n)e.removeItem(f);else return j.data}else if(g===null)e.removeItem(f);else{j=JSON.stringify({data:g,expires:h.expires?n+h.expires:null});try{e.setItem(f,j)}catch(o){c[a]();try{e.setItem(f,j)}catch(o){throw c.error()}}}return m})}var c=a.store=function(a,b,d,e){var e=c.type;d&&d.type&&d.type in c.types&&(e=d.type);return c.types[e](a,b,d||{})};c.types={},c.type=null,c.addType=function(a,b){c.type||(c.type=a),c.types[a]=b,c[a]=function(b,d,e){e=e||{},e.type=a;return c(b,d,e)}},c.error=function(){return"amplify.store quota exceeded"};var d=/^__amplify__/;for(var f in{localStorage:1,sessionStorage:1})try{window[f].getItem&&e(f,window[f])}catch(g){}if(window.globalStorage)try{e("globalStorage",window.globalStorage[window.location.hostname]),c.type==="sessionStorage"&&(c.type="globalStorage")}catch(g){}(function(){if(!c.types.localStorage){var a=document.createElement("div"),d="amplify";a.style.display="none",document.getElementsByTagName("head")[0].appendChild(a);try{a.addBehavior("#default#userdata"),a.load(d)}catch(e){a.parentNode.removeChild(a);return}c.addType("userData",function(e,f,g){a.load(d);var h,i,j,k,l,m=f,n=(new Date).getTime();if(!e){m={},l=[],k=0;while(h=a.XMLDocument.documentElement.attributes[k++])i=JSON.parse(h.value),i.expires&&i.expires<=n?l.push(h.name):m[h.name]=i.data;while(e=l.pop())a.removeAttribute(e);a.save(d);return m}e=e.replace(/[^-._0-9A-Za-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u37f-\u1fff\u200c-\u200d\u203f\u2040\u2070-\u218f]/g,"-");if(f===b){h=a.getAttribute(e),i=h?JSON.parse(h):{expires:-1};if(i.expires&&i.expires<=n)a.removeAttribute(e);else return i.data}else f===null?a.removeAttribute(e):(j=a.getAttribute(e),i=JSON.stringify({data:f,expires:g.expires?n+g.expires:null}),a.setAttribute(e,i));try{a.save(d)}catch(o){j===null?a.removeAttribute(e):a.setAttribute(e,j),c.userData();try{a.setAttribute(e,i),a.save(d)}catch(o){j===null?a.removeAttribute(e):a.setAttribute(e,j);throw c.error()}}return m})}})(),function(){function e(a){return a===b?b:JSON.parse(JSON.stringify(a))}var a={},d={};c.addType("memory",function(c,f,g){if(!c)return e(a);if(f===b)return e(a[c]);d[c]&&(clearTimeout(d[c]),delete d[c]);if(f===null){delete a[c];return null}a[c]=f,g.expires&&(d[c]=setTimeout(function(){delete a[c],delete d[c]},g.expires));return f})}()}(this.amplify=this.amplify||{}),function(a,b){function e(a){var b=!1;setTimeout(function(){b=!0},1);return function(){var c=this,d=arguments;b?a.apply(c,d):setTimeout(function(){a.apply(c,d)},1)}}function d(a){return{}.toString.call(a)==="[object Function]"}function c(){}a.request=function(b,f,g){var h=b||{};typeof h=="string"&&(d(f)&&(g=f,f={}),h={resourceId:b,data:f||{},success:g});var i={abort:c},j=a.request.resources[h.resourceId],k=h.success||c,l=h.error||c;h.success=e(function(b,c){c=c||"success",a.publish("request.success",h,b,c),a.publish("request.complete",h,b,c),k(b,c)}),h.error=e(function(b,c){c=c||"error",a.publish("request.error",h,b,c),a.publish("request.complete",h,b,c),l(b,c)});if(!j){if(!h.resourceId)throw"amplify.request: no resourceId provided";throw"amplify.request: unknown resourceId: "+h.resourceId}if(!a.publish("request.before",h))h.error(null,"abort");else{a.request.resources[h.resourceId](h,i);return i}},a.request.types={},a.request.resources={},a.request.define=function(b,c,d){if(typeof c=="string"){if(!(c in a.request.types))throw"amplify.request.define: unknown type: "+c;d.resourceId=b,a.request.resources[b]=a.request.types[c](d)}else a.request.resources[b]=c}}(amplify),function(a,b,c){var d=["status","statusText","responseText","responseXML","readyState"],e=/\{([^\}]+)\}/g;a.request.types.ajax=function(e){e=b.extend({type:"GET"},e);return function(f,g){function n(a,e){b.each(d,function(a,b){try{m[b]=h[b]}catch(c){}}),/OK$/.test(m.statusText)&&(m.statusText="success"),a===c&&(a=null),l&&(e="abort"),/timeout|error|abort/.test(e)?m.error(a,e):m.success(a,e),n=b.noop}var h,i=e.url,j=g.abort,k=b.extend(!0,{},e,{data:f.data}),l=!1,m={readyState:0,setRequestHeader:function(a,b){return h.setRequestHeader(a,b)},getAllResponseHeaders:function(){return h.getAllResponseHeaders()},getResponseHeader:function(a){return h.getResponseHeader(a)},overrideMimeType:function(a){return h.overrideMideType(a)},abort:function(){l=!0;try{h.abort()}catch(a){}n(null,"abort")},success:function(a,b){f.success(a,b)},error:function(a,b){f.error(a,b)}};a.publish("request.ajax.preprocess",e,f,k,m),b.extend(k,{success:function(a,b){n(a,b)},error:function(a,b){n(null,b)},beforeSend:function(b,c){h=b,k=c;var d=e.beforeSend?e.beforeSend.call(this,m,k):!0;return d&&a.publish("request.before.ajax",e,f,k,m)}}),b.ajax(k),g.abort=function(){m.abort(),j.call(this)}}},a.subscribe("request.ajax.preprocess",function(a,c,d){var f=[],g=d.data;typeof g!="string"&&(g=b.extend(!0,{},a.data,g),d.url=d.url.replace(e,function(a,b){if(b in g){f.push(b);return g[b]}}),b.each(f,function(a,b){delete g[b]}),d.data=g)}),a.subscribe("request.ajax.preprocess",function(a,c,d){var e=d.data,f=a.dataMap;!!f&&typeof e!="string"&&(b.isFunction(f)?d.data=f(e):(b.each(a.dataMap,function(a,b){a in e&&(e[b]=e[a],delete e[a])}),d.data=e))});var f=a.request.cache={_key:function(a,b,c){function g(){return c.charCodeAt(e++)<<24|c.charCodeAt(e++)<<16|c.charCodeAt(e++)<<8|c.charCodeAt(e++)<<0}c=b+c;var d=c.length,e=0,f=g();while(e<d)f^=g();return"request-"+a+"-"+f},_default:function(){var a={};return function(b,c,d,e){var g=f._key(c.resourceId,d.url,d.data),h=b.cache;if(g in a){e.success(a[g]);return!1}var i=e.success;e.success=function(b){a[g]=b,typeof h=="number"&&setTimeout(function(){delete a[g]},h),i.apply(this,arguments)}}}()};a.store&&(b.each(a.store.types,function(b){f[b]=function(c,d,e,g){var h=f._key(d.resourceId,e.url,e.data),i=a.store[b](h);if(i){e.success(i);return!1}var j=g.success;g.success=function(d){a.store[b](h,d,{expires:c.cache.expires}),j.apply(this,arguments)}}}),f.persist=f[a.store.type]),a.subscribe("request.before.ajax",function(a){var b=a.cache;if(b){b=b.type||b;return f[b in f?b:"_default"].apply(this,arguments)}}),a.request.decoders={jsend:function(a,b,c,d,e){a.status==="success"?d(a.data):a.status==="fail"?e(a.data,"fail"):a.status==="error"&&(delete a.status,e(a,"error"))}},a.subscribe("request.before.ajax",function(c,d,e,f){function k(a,b){h(a,b)}function j(a,b){g(a,b)}var g=f.success,h=f.error,i=b.isFunction(c.decoder)?c.decoder:c.decoder in a.request.decoders?a.request.decoders[c.decoder]:a.request.decoders._default;!i||(f.success=function(a,b){i(a,b,f,j,k)},f.error=function(a,b){i(a,b,f,j,k)})})}(amplify,jQuery);(function($){$.alerts={opts:null,init:function(options){$.alerts.opts=$.extend({},$.alerts.defaults,options)},alert:function(message,title,ok,cancel,callback){if(title==null)title='Alert';$.alerts._show(title,message,ok,cancel,null,'alert',function(result){if(callback)callback(result)})},confirm:function(message,title,ok,cancel,callback){if(title==null)title='Confirm';$.alerts._show(title,message,ok,cancel,null,'confirm',function(result){if(callback)callback(result)})},prompt:function(message,value,title,ok,cancel,callback){if(title==null)title='Prompt';$.alerts._show(title,message,ok,cancel,value,'prompt',function(result){if(callback)callback(result)})},info:function(message,title,callback){if(title==null)title='Info';$.alerts._show(title,message,null,null,null,'info',function(result){if(callback)callback(result)})},_show:function(title,msg,ok,cancel,value,type,callback){$.alerts._hide();$.alerts._overlay('show',type);$("BODY").append('<div id="popup_container">'+'<div id="popup_title_bg"></div>'+'<div id="popup_icon"></div>'+'<h1 id="popup_title" style=\"display:block;\"></h1>'+'<div id="popup_content">'+'<div id="popup_message"></div>'+'</div>'+'</div>');if($.alerts.opts.dialogClass)$("#popup_container").addClass($.alerts.opts.dialogClass);var pos=($.browser.msie&&parseInt($.browser.version)<=6)?'absolute':'fixed';if($.browser.msie&&parseInt($.browser.version)<=7&&$.alerts.opts.width>0){$("#popup_message").css('width',$.alerts.opts.width)}$("#popup_container").css({position:pos,zIndex:99999,padding:0,margin:0});$("#popup_title").text(title);$("#popup_content").addClass(type);if(type!='info'){$("#popup_message").text(msg);$("#popup_message").html($("#popup_message").text().replace(/\n/g,'<br />'))}else{$("#popup_message").html(msg)}$.alerts.opts.width=$.alerts.opts.width>0?$.alerts.opts.width:$("#popup_container").outerWidth();$("#popup_container").css({minWidth:$.alerts.opts.width,maxWidth:$.alerts.opts.width});$.alerts._reposition();$.alerts._maintainPosition(true);switch(type){case'alert':$("#popup_message").after('<div id="popup_panel" class="button"><div id="popup_ok" class="popup_button text"><div class="bt_left"></div><div class="bt_mid">'+ok+'</div><div class="bt_right"></div></div></div>');$("#popup_ok").click(function(){$.alerts._hide();callback(true)});$("#popup_ok").focus().keypress(function(e){if(e.keyCode==13||e.keyCode==27)$("#popup_ok").trigger('click')});break;case'confirm':$("#popup_message").after('<div id="popup_panel" class="button"><div id="popup_ok" class="popup_button text"><div class="bt_left"></div><div class="bt_mid">'+ok+'</div><div class="bt_right"></div></div> <div id="popup_cancel" class="popup_button text"><div class="bt_left"></div><div class="bt_mid">'+cancel+'</div><div class="bt_right"></div></div></div>');$("#popup_ok").click(function(){$.alerts._hide();if(callback)callback(true)});$("#popup_cancel").click(function(){$.alerts._hide();if(callback)callback(false)});$("#popup_ok").focus();$("#popup_ok, #popup_cancel").keypress(function(e){if(e.keyCode==13)$("#popup_ok").trigger('click');if(e.keyCode==27)$("#popup_cancel").trigger('click')});break;case'prompt':$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel" class="button"><div id="popup_ok" class="popup_button text"><div class="bt_left"></div><div class="bt_mid">'+ok+'</div><div class="bt_right"></div></div> <div id="popup_cancel" class="popup_button text"><div class="bt_left"></div><div class="bt_mid">'+cancel+'</div><div class="bt_right"></div></div></div>');$("#popup_prompt").width($("#popup_message").width());$("#popup_ok").click(function(){var val=$("#popup_prompt").val();$.alerts._hide();if(callback)callback(val)});$("#popup_cancel").click(function(){$.alerts._hide();if(callback)callback(null)});$("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(e){if(e.keyCode==13)$("#popup_ok").trigger('click');if(e.keyCode==27)$("#popup_cancel").trigger('click')});if(value)$("#popup_prompt").val(value);$("#popup_prompt").focus().select();break;case'info':$("#popup_title").after('<div id="popup_close" class="popup_close"><span>Schlie&szlig;en</span></div>');$("#popup_close").click(function(){$.alerts._hide();if(callback)callback(false)});break}if($.alerts.draggable){try{$("#popup_container").draggable({handle:$("#popup_title")});$("#popup_title").css({cursor:'move'})}catch(e){}}},_hide:function(){$("#popup_container").remove();$.alerts._overlay('hide');$.alerts._maintainPosition(false)},_overlay:function(status,type){switch(status){case'show':$.alerts._overlay('hide');$("BODY").append('<div id="popup_overlay"></div>');$("#popup_overlay").css({position:'absolute',zIndex:99998,top:'0px',left:'0px',width:'100%',height:$(document).height(),background:$.alerts.opts.overlayColor,opacity:$.alerts.opts.overlayOpacity});$("#popup_overlay").click(function(){switch(type){case'alert':$("#popup_ok").click();break;case'prompt':$("#popup_cancel").click();break;case'info':$("#popup_close").click();break}return false});break;case'hide':$("#popup_overlay").remove();break}},_reposition:function(){var top=(($(window).height()/ 2) - ($("#popup_container").outerHeight() /2))+$.alerts.opts.verticalOffset;var left=(($(window).width()/ 2) - ($("#popup_container").outerWidth() /2))+$.alerts.opts.horizontalOffset;if(top<0)top=0;if(left<0)left=0;if($.browser.msie&&parseInt($.browser.version)<=6)top=top+$(window).scrollTop();$("#popup_container").css({top:top+'px',left:left+'px'});$("#popup_overlay").height($(document).height())},_maintainPosition:function(status){if($.alerts.opts.repositionOnResize){switch(status){case true:$(window).bind('resize',$.alerts._reposition);break;case false:$(window).unbind('resize',$.alerts._reposition);break}}}};jAlert=function(message,title,ok,cancel,callback,options){$.alerts.init(options);$.alerts.alert(message,title,ok,cancel,callback)};jConfirm=function(message,title,ok,cancel,callback){$.alerts.init();$.alerts.confirm(message,title,ok,cancel,callback)};jPrompt=function(message,value,title,ok,cancel,callback){$.alerts.init();$.alerts.prompt(message,value,title,ok,cancel,callback)};jLayer=function(message,url,title,callback,options){jAlert('Daten werden geladen.','Lade...','OK',undefined,undefined,{dialogClass:'preLogin',width:250,overlayOpacity:0.5,removeLinks:true});$.alerts.init(options);if(url!==null){$.ajax({url:url,success:function(data){$.alerts._hide();message=data.substring(data.indexOf('<body>')+6,data.indexOf('</body>'));if(options.removeLinks)message=message.replace(/(<a.*?>)/ig,"").replace(/(<\/a>)/ig,"");$.alerts.info(message,title,callback)}})}else{$.alerts.info(message,title,callback)}};$.alerts.defaults={verticalOffset:-75,horizontalOffset:0,repositionOnResize:true,overlayOpacity:.5,overlayColor:'#000000',draggable:true,okButton:'&nbsp;ok&nbsp;',cancelButton:'&nbsp;abbrechen&nbsp;',dialogClass:null,width:0,height:0,removeLinks:false}})(jQuery);(function($){function raiseEvents(arr,eventArgs,setValue){var triggerEvents=!!eventArgs;if(triggerEvents){var ret,event=$.Event("arrayChanging");$.event.trigger(event,[eventArgs],arr);if(!event.isDefaultPrevented()){ret=setValue();$.event.trigger("arrayChange",[eventArgs],arr)}return ret}else{return setValue()}}$.each("pop push reverse shift sort splice unshift".split(" "),function(i,name){$[name]=function(arr){var args=$.makeArray(arguments);args.splice(0,1);return raiseEvents(arr,createEventArguments(name,arr,args),function(){arr[name].apply(arr,args)})}});var eventArgCreators={pop:function(arr,args){if(arr.length>0){return{change:"remove",oldIndex:arr.length-1,oldItems:[arr[arr.length-1]]}}},push:function(arr,args){return{change:"add",newIndex:arr.length,newItems:[args[0]]}},reverse:function(arr,args){if(arr.length>0){return{change:"reset"}}},shift:function(arr,args){if(arr.length>0){return{change:"remove",oldIndex:0,oldItems:[arr[0]]}}},sort:function(arr,args){if(arr.length>0){return{change:"reset"}}},splice:function(arr,args){var index=args[0];var numToRemove=args[1];var elementsToAdd=args.slice(2);if(numToRemove<=0){if(elementsToAdd.length>0){return{change:"add",newIndex:index,newItems:elementsToAdd}}}else{var elementsToRemove=arr.slice(index,index+numToRemove);if(elementsToAdd.length>0){var move=elementsToAdd.length===elementsToRemove.length&&$.grep(elementsToAdd,function(elementToAdd,index){return elementToAdd!==elementsToRemove[index]}).length===0;if(move){return{change:"move",oldIndex:index,oldItems:elementsToRemove,newIndex:index,newItems:elementsToAdd}}else{return{change:"replace",oldIndex:index,oldItems:elementsToRemove,newIndex:index,newItems:elementsToAdd}}}else{return{change:"remove",oldIndex:index,oldItems:elementsToRemove}}}},unshift:function(arr,args){return{change:"add",newIndex:0,newItems:[args[0]]}},move:function(arr,args){var numToMove=arguments[1];if(numToMove>0){var fromIndex=arguments[0];var toIndex=arguments[2];var elementsToMove=arr.splice(fromIndex,numToMove);return{change:"move",oldIndex:fromIndex,oldItems:elementsToMove,newIndex:toIndex,newItems:elementsToMove}}}};function createEventArguments(operation,arr,args){return eventArgCreators[operation](arr,args)}$.move=function(arr){var args=$.makeArray(arguments);args.splice(0,1);return raiseEvents(arr,createEventArguments("move",arr,args),function(){var fromIndex=args[0];var numToMove=args[1];var toIndex=args[2];var removed=arr.splice(fromIndex,numToMove);arr.splice(toIndex,0,removed)})};var special=$.event.special;$.fn.triggerHandler=function(type,data){if(this[0]){var event=jQuery.Event(type);if(this.nodeType){event.preventDefault()}event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result}};special.changeData={_default:function(event){var events=((this.__events__||{}).events||{}).changeData;if(events){var eventsToCallback=events.slice();$.each(eventsToCallback,function(index,handler){if($.inArray(handler,events)>=0&&handler.data&&handler.data.eventDefault){handler.data.eventDefault(event)}})}return false}};$.each("arrayChanging arrayChange".split(' '),function(i,name){$.fn[name]=function(filter,fn){if(arguments.length===1){fn=filter;filter=null}return fn?this.bind(name,filter,fn):this.trigger(name)};special[name]={setup:function(){this.__events__.events[name].push=function(){Array.prototype.push.apply(this,arguments);this.sort(function(handler){return handler.data&&handler.data.first?1:0})};return false},_default:function(event){var events=((this.__events__||{}).events||{})[name];if(events){var eventsToCallback=events.slice();$.each(eventsToCallback,function(index,handler){if($.inArray(handler,events)>=0&&handler.data&&handler.data.eventDefault){handler.data.eventDefault(event)}})}return false}}})})(jQuery);(function($){var rotateLeft=function(lValue,iShiftBits){return(lValue<<iShiftBits)|(lValue>>>(32-iShiftBits))};var addUnsigned=function(lX,lY){var lX4,lY4,lX8,lY8,lResult;lX8=(lX&0x80000000);lY8=(lY&0x80000000);lX4=(lX&0x40000000);lY4=(lY&0x40000000);lResult=(lX&0x3FFFFFFF)+(lY&0x3FFFFFFF);if(lX4&lY4)return(lResult^0x80000000^lX8^lY8);if(lX4|lY4){if(lResult&0x40000000)return(lResult^0xC0000000^lX8^lY8);else return(lResult^0x40000000^lX8^lY8)}else{return(lResult^lX8^lY8)}};var F=function(x,y,z){return(x&y)|((~x)&z)};var G=function(x,y,z){return(x&z)|(y&(~z))};var H=function(x,y,z){return(x^y^z)};var I=function(x,y,z){return(y^(x|(~z)))};var FF=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(F(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b)};var GG=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(G(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b)};var HH=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(H(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b)};var II=function(a,b,c,d,x,s,ac){a=addUnsigned(a,addUnsigned(addUnsigned(I(b,c,d),x),ac));return addUnsigned(rotateLeft(a,s),b)};var convertToWordArray=function(string){var lWordCount;var lMessageLength=string.length;var lNumberOfWordsTempOne=lMessageLength+8;var lNumberOfWordsTempTwo=(lNumberOfWordsTempOne-(lNumberOfWordsTempOne%64))/64;var lNumberOfWords=(lNumberOfWordsTempTwo+1)*16;var lWordArray=Array(lNumberOfWords-1);var lBytePosition=0;var lByteCount=0;while(lByteCount<lMessageLength){lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=(lWordArray[lWordCount]|(string.charCodeAt(lByteCount)<<lBytePosition));lByteCount++}lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=lWordArray[lWordCount]|(0x80<<lBytePosition);lWordArray[lNumberOfWords-2]=lMessageLength<<3;lWordArray[lNumberOfWords-1]=lMessageLength>>>29;return lWordArray};var wordToHex=function(lValue){var WordToHexValue="",WordToHexValueTemp="",lByte,lCount;for(lCount=0;lCount<=3;lCount++){lByte=(lValue>>>(lCount*8))&255;WordToHexValueTemp="0"+lByte.toString(16);WordToHexValue=WordToHexValue+WordToHexValueTemp.substr(WordToHexValueTemp.length-2,2)}return WordToHexValue};var uTF8Encode=function(string){string=string.replace(/\x0d\x0a/g,"\x0a");var output="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){output+=String.fromCharCode(c)}else if((c>127)&&(c<2048)){output+=String.fromCharCode((c>>6)|192);output+=String.fromCharCode((c&63)|128)}else{output+=String.fromCharCode((c>>12)|224);output+=String.fromCharCode(((c>>6)&63)|128);output+=String.fromCharCode((c&63)|128)}}return output};$.extend({md5:function(string){var x=Array();var k,AA,BB,CC,DD,a,b,c,d;var S11=7,S12=12,S13=17,S14=22;var S21=5,S22=9,S23=14,S24=20;var S31=4,S32=11,S33=16,S34=23;var S41=6,S42=10,S43=15,S44=21;string=uTF8Encode(string);x=convertToWordArray(string);a=0x67452301;b=0xEFCDAB89;c=0x98BADCFE;d=0x10325476;for(k=0;k<x.length;k+=16){AA=a;BB=b;CC=c;DD=d;a=FF(a,b,c,d,x[k+0],S11,0xD76AA478);d=FF(d,a,b,c,x[k+1],S12,0xE8C7B756);c=FF(c,d,a,b,x[k+2],S13,0x242070DB);b=FF(b,c,d,a,x[k+3],S14,0xC1BDCEEE);a=FF(a,b,c,d,x[k+4],S11,0xF57C0FAF);d=FF(d,a,b,c,x[k+5],S12,0x4787C62A);c=FF(c,d,a,b,x[k+6],S13,0xA8304613);b=FF(b,c,d,a,x[k+7],S14,0xFD469501);a=FF(a,b,c,d,x[k+8],S11,0x698098D8);d=FF(d,a,b,c,x[k+9],S12,0x8B44F7AF);c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);a=FF(a,b,c,d,x[k+12],S11,0x6B901122);d=FF(d,a,b,c,x[k+13],S12,0xFD987193);c=FF(c,d,a,b,x[k+14],S13,0xA679438E);b=FF(b,c,d,a,x[k+15],S14,0x49B40821);a=GG(a,b,c,d,x[k+1],S21,0xF61E2562);d=GG(d,a,b,c,x[k+6],S22,0xC040B340);c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);b=GG(b,c,d,a,x[k+0],S24,0xE9B6C7AA);a=GG(a,b,c,d,x[k+5],S21,0xD62F105D);d=GG(d,a,b,c,x[k+10],S22,0x2441453);c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);b=GG(b,c,d,a,x[k+4],S24,0xE7D3FBC8);a=GG(a,b,c,d,x[k+9],S21,0x21E1CDE6);d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);c=GG(c,d,a,b,x[k+3],S23,0xF4D50D87);b=GG(b,c,d,a,x[k+8],S24,0x455A14ED);a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);d=GG(d,a,b,c,x[k+2],S22,0xFCEFA3F8);c=GG(c,d,a,b,x[k+7],S23,0x676F02D9);b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);a=HH(a,b,c,d,x[k+5],S31,0xFFFA3942);d=HH(d,a,b,c,x[k+8],S32,0x8771F681);c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);a=HH(a,b,c,d,x[k+1],S31,0xA4BEEA44);d=HH(d,a,b,c,x[k+4],S32,0x4BDECFA9);c=HH(c,d,a,b,x[k+7],S33,0xF6BB4B60);b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);d=HH(d,a,b,c,x[k+0],S32,0xEAA127FA);c=HH(c,d,a,b,x[k+3],S33,0xD4EF3085);b=HH(b,c,d,a,x[k+6],S34,0x4881D05);a=HH(a,b,c,d,x[k+9],S31,0xD9D4D039);d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);b=HH(b,c,d,a,x[k+2],S34,0xC4AC5665);a=II(a,b,c,d,x[k+0],S41,0xF4292244);d=II(d,a,b,c,x[k+7],S42,0x432AFF97);c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);b=II(b,c,d,a,x[k+5],S44,0xFC93A039);a=II(a,b,c,d,x[k+12],S41,0x655B59C3);d=II(d,a,b,c,x[k+3],S42,0x8F0CCC92);c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);b=II(b,c,d,a,x[k+1],S44,0x85845DD1);a=II(a,b,c,d,x[k+8],S41,0x6FA87E4F);d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);c=II(c,d,a,b,x[k+6],S43,0xA3014314);b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);a=II(a,b,c,d,x[k+4],S41,0xF7537E82);d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);c=II(c,d,a,b,x[k+2],S43,0x2AD7D2BB);b=II(b,c,d,a,x[k+9],S44,0xEB86D391);a=addUnsigned(a,AA);b=addUnsigned(b,BB);c=addUnsigned(c,CC);d=addUnsigned(d,DD)}var tempValue=wordToHex(a)+wordToHex(b)+wordToHex(c)+wordToHex(d);return tempValue.toLowerCase()}})})(jQuery);(function(jQuery,undefined){var oldManip=jQuery.fn.domManip,tmplItmAtt="_tmplitem",htmlExpr=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,newTmplItems={},wrappedItems={},appendToTmplItems,topTmplItem={key:0,data:{}},itemKey=0,cloneIndex=0,stack=[];function newTmplItem(options,parentItem,fn,data){var newItem={data:data||(data===0||data===false)?data:(parentItem?parentItem.data:{}),_wrap:parentItem?parentItem._wrap:null,tmpl:null,parent:parentItem||null,nodes:[],calls:tiCalls,nest:tiNest,wrap:tiWrap,html:tiHtml,update:tiUpdate};if(options){jQuery.extend(newItem,options,{nodes:[],parent:parentItem})}if(fn){newItem.tmpl=fn;newItem._ctnt=newItem._ctnt||newItem.tmpl(jQuery,newItem);newItem.key=++itemKey;(stack.length?wrappedItems:newTmplItems)[itemKey]=newItem}return newItem}jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector),elems,i,l,tmplItems,parent=this.length===1&&this[0].parentNode;appendToTmplItems=newTmplItems||{};if(parent&&parent.nodeType===11&&parent.childNodes.length===1&&insert.length===1){insert[original](this[0]);ret=this}else{for(i=0,l=insert.length;i<l;i++){cloneIndex=i;elems=(i>0?this.clone(true):this).get();jQuery(insert[i])[original](elems);ret=ret.concat(elems)}cloneIndex=0;ret=this.pushStack(ret,name,insert.selector)}tmplItems=appendToTmplItems;appendToTmplItems=null;jQuery.tmpl.complete(tmplItems);return ret}});jQuery.fn.extend({tmpl:function(data,options,parentItem){return jQuery.tmpl(this[0],data,options,parentItem)},tmplItem:function(){return jQuery.tmplItem(this[0])},template:function(name){return jQuery.template(name,this[0])},domManip:function(args,table,callback,options){if(args[0]&&jQuery.isArray(args[0])){var dmArgs=jQuery.makeArray(arguments),elems=args[0],elemsLength=elems.length,i=0,tmplItem;while(i<elemsLength&&!(tmplItem=jQuery.data(elems[i++],"tmplItem"))){}if(tmplItem&&cloneIndex){dmArgs[2]=function(fragClone){jQuery.tmpl.afterManip(this,fragClone,callback)}}oldManip.apply(this,dmArgs)}else{oldManip.apply(this,arguments)}cloneIndex=0;if(!appendToTmplItems){jQuery.tmpl.complete(newTmplItems)}return this}});jQuery.extend({tmpl:function(tmpl,data,options,parentItem){var ret,topLevel=!parentItem;if(topLevel){parentItem=topTmplItem;tmpl=jQuery.template[tmpl]||jQuery.template(null,tmpl);wrappedItems={};}else if(!tmpl){tmpl=parentItem.tmpl;newTmplItems[parentItem.key]=parentItem;parentItem.nodes=[];if(parentItem.wrapped){updateWrapped(parentItem,parentItem.wrapped)}return jQuery(build(parentItem,null,parentItem.tmpl(jQuery,parentItem)))}if(!tmpl){return[];}if(typeof data==="function"){data=data.call(parentItem||{})}if(options&&options.wrapped){updateWrapped(options,options.wrapped)}ret=jQuery.isArray(data)?jQuery.map(data,function(dataItem){return dataItem?newTmplItem(options,parentItem,tmpl,dataItem):null}):[newTmplItem(options,parentItem,tmpl,data)];return topLevel?jQuery(build(parentItem,null,ret)):ret},tmplItem:function(elem){var tmplItem;if(elem instanceof jQuery){elem=elem[0]}while(elem&&elem.nodeType===1&&!(tmplItem=jQuery.data(elem,"tmplItem"))&&(elem=elem.parentNode)){}return tmplItem||topTmplItem},template:function(name,tmpl){if(tmpl){if(typeof tmpl==="string"){tmpl=buildTmplFn(tmpl)}else if(tmpl instanceof jQuery){tmpl=tmpl[0]||{}}if(tmpl.nodeType){tmpl=jQuery.data(tmpl,"tmpl")||jQuery.data(tmpl,"tmpl",buildTmplFn(tmpl.innerHTML));}return typeof name==="string"?(jQuery.template[name]=tmpl):tmpl}return name?(typeof name!=="string"?jQuery.template(null,name):(jQuery.template[name]||jQuery.template(null,htmlExpr.test(name)?name:jQuery(name)))):null},encode:function(text){return(""+text).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});jQuery.extend(jQuery.tmpl,{tag:{"tmpl":{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},"wrap":{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},"each":{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},"html":{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(items){newTmplItems={}},afterManip:function afterManip(elem,fragClone,callback){var content=fragClone.nodeType===11?jQuery.makeArray(fragClone.childNodes):fragClone.nodeType===1?[fragClone]:[];callback.call(elem,fragClone);storeTmplItems(content);cloneIndex++}});function build(tmplItem,nested,content){var frag,ret=content?jQuery.map(content,function(item){return(typeof item==="string")?(tmplItem.key?item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+tmplItmAtt+"=\""+tmplItem.key+"\" $2"):item):build(item,tmplItem,item._ctnt)}):tmplItem;if(nested){return ret}ret=ret.join("");ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(all,before,middle,after){frag=jQuery(middle).get();storeTmplItems(frag);if(before){frag=unencode(before).concat(frag)}if(after){frag=frag.concat(unencode(after))}});return frag?frag:unencode(ret)}function unencode(text){var el=document.createElement("div");el.innerHTML=text;return jQuery.makeArray(el.childNodes)}function buildTmplFn(markup){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;"+"with($data){__.push('"+jQuery.trim(markup).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(all,slash,type,fnargs,target,parens,args){var tag=jQuery.tmpl.tag[type],def,expr,exprAutoFnDetect;if(!tag){throw"Unknown template tag: "+type}def=tag._default||[];if(parens&&!/\w$/.test(target)){target+=parens;parens=""}if(target){target=unescape(target);args=args?(","+unescape(args)+")"):(parens?")":"");expr=parens?(target.indexOf(".")>-1?target+unescape(parens):("("+target+").call($item"+args)):target;exprAutoFnDetect=parens?expr:"(typeof("+target+")==='function'?("+target+").call($item):("+target+"))"}else{exprAutoFnDetect=expr=def.$1||"null"}fnargs=unescape(fnargs);return"');"+tag[slash?"close":"open"].split("$notnull_1").join(target?"typeof("+target+")!=='undefined' && ("+target+")!=null":"true").split("$1a").join(exprAutoFnDetect).split("$1").join(expr).split("$2").join(fnargs||def.$2||"")+"__.push('"})+"');}return __;")}function updateWrapped(options,wrapped){options._wrap=build(options,true,jQuery.isArray(wrapped)?wrapped:[htmlExpr.test(wrapped)?wrapped:jQuery(wrapped).html()]).join("")}function unescape(args){return args?args.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function outerHtml(elem){var div=document.createElement("div");div.appendChild(elem.cloneNode(true));return div.innerHTML}function storeTmplItems(content){var keySuffix="_"+cloneIndex,elem,elems,newClonedItems={},i,l,m;for(i=0,l=content.length;i<l;i++){if((elem=content[i]).nodeType!==1){continue}elems=elem.getElementsByTagName("*");for(m=elems.length-1;m>=0;m--){processItemKey(elems[m])}processItemKey(elem)}function processItemKey(el){var pntKey,pntNode=el,pntItem,tmplItem,key;if((key=el.getAttribute(tmplItmAtt))){while(pntNode.parentNode&&(pntNode=pntNode.parentNode).nodeType===1&&!(pntKey=pntNode.getAttribute(tmplItmAtt))){}if(pntKey!==key){pntNode=pntNode.parentNode?(pntNode.nodeType===11?0:(pntNode.getAttribute(tmplItmAtt)||0)):0;if(!(tmplItem=newTmplItems[key])){tmplItem=wrappedItems[key];tmplItem=newTmplItem(tmplItem,newTmplItems[pntNode]||wrappedItems[pntNode]);tmplItem.key=++itemKey;newTmplItems[itemKey]=tmplItem}if(cloneIndex){cloneTmplItem(key)}}el.removeAttribute(tmplItmAtt)}else if(cloneIndex&&(tmplItem=jQuery.data(el,"tmplItem"))){cloneTmplItem(tmplItem.key);newTmplItems[tmplItem.key]=tmplItem;pntNode=jQuery.data(el.parentNode,"tmplItem");pntNode=pntNode?pntNode.key:0}if(tmplItem){pntItem=tmplItem;while(pntItem&&pntItem.key!=pntNode){pntItem.nodes.push(el);pntItem=pntItem.parent}delete tmplItem._ctnt;delete tmplItem._wrap;jQuery.data(el,"tmplItem",tmplItem)}function cloneTmplItem(key){key=key+keySuffix;tmplItem=newClonedItems[key]=(newClonedItems[key]||newTmplItem(tmplItem,newTmplItems[tmplItem.parent.key+keySuffix]||tmplItem.parent))}}}function tiCalls(content,tmpl,data,options){if(!content){return stack.pop()}stack.push({_:content,tmpl:tmpl,item:this,data:data,options:options})}function tiNest(tmpl,data,options){return jQuery.tmpl(jQuery.template(tmpl),data,options,this)}function tiWrap(call,wrapped){var options=call.options||{};options.wrapped=wrapped;return jQuery.tmpl(jQuery.template(call.tmpl),call.data,options,call.item)}function tiHtml(filter,textOnly){var wrapped=this._wrap;return jQuery.map(jQuery(jQuery.isArray(wrapped)?wrapped.join(""):wrapped).filter(filter||"*"),function(e){return textOnly?e.innerText||e.textContent:e.outerHTML||outerHtml(e)})}function tiUpdate(){var coll=this.nodes;jQuery.tmpl(null,null,null,this).insertBefore(coll[0]);jQuery(coll).remove()}})(jQuery);;(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var validator=$.data(this[0],'validator');if(validator){return validator}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this})}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm)}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove()}return false}return true}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle()}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false}return handle()}else{validator.focusInvalid();return false}})}return validator},valid:function(){if($(this[0]).is('form')){return this.validate().form()}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this)});return valid}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value)});return result},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method]});return filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data)}return data}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value)},filled:function(a){return!!$.trim(""+a.value)},unchecked:function(a){return!a.checked}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init()};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args)};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1)}if(params.constructor!=Array){params=[params]}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)});return source};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide()}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element)}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element)}},onclick:function(element){if(element.name in this.submitted)this.element(element);else if(element.parentNode.name in this.submitted)this.element(element.parentNode)},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass)},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0])}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox, select, option",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i])}return this.valid()},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name]}else{this.invalid[element.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]})}this.successList=$.grep(this.successList,function(element){return!(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0;for(var i in obj)count++;return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name}).length==1&&lastActive},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true})},clean:function(selector){return $(selector)[0]},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element)},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0]}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return}if(!result){this.formatAndAdd(element,rule);return false}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method",e);throw e}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i]}return undefined},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element)}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters)}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i])}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message)}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element)}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label)}this.toShow=this.toShow.add(label)},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name})},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},checkable:function(element){return/radio|checkbox/i.test(element.type)},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null})},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true},dependTypes:{"boolean":function(param,element){return param},"string":function(param,element){return!!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch"},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this])}});return rules},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength}return rules},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}}return rules},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break}if(keepRule){rules[prop]=val.param!==undefined?val.param:true}else{delete rules[prop]}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this])}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])]}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength}}if(rules.messages){delete rules.messages}return rules},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true});data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name))}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors()}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors)}previous.valid=valid;validator.stopRequest(element,valid)}},param));return"pending"}else if(this.pending[element.name]){return"pending"}return previous.valid},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1])},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||value<=param},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1])},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value))},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9}nCheck+=nDigit;bEven=!bEven}return(nCheck%10)==0},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"))},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid()});return value==target.val()}}});$.format=$.validator.format})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort()}return(pendingRequests[port]=ajax.apply(this,arguments))}return ajax.apply(this,arguments)}})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true)},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true)},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments)}}});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments)}})},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})])}})})(jQuery);;(function($){$.fn.jFlow=function(options){var opts=$.extend({},$.fn.jFlow.defaults,options);var randNum=Math.floor(Math.random()*11);var jFC=opts.controller;var jFS=opts.slideWrapper;var jSel=opts.selectedWrapper;var cur=0;var timer;var maxi=$(jFC).length;var slide=function(dur,i){$(opts.slides).children().css({overflow:"hidden"});$(opts.slides+" iframe").hide().addClass("temp_hide");$(opts.slides).animate({marginLeft:"-"+(i*$(opts.slides).find(":first-child").width()+"px")},opts.duration*(dur),opts.easing,function(){$(opts.slides).children().css({overflow:"hidden"});$(".temp_hide").show()})};$(this).find(jFC).each(function(i){$(this).click(function(){dotimer();if($(opts.slides).is(":not(:animated)")){$(jFC).removeClass(jSel);$(this).addClass(jSel);var dur=Math.abs(cur-i);slide(dur,i);cur=i}})});$(opts.slides).before('<div id="'+jFS.substring(1,jFS.length)+'"></div>').appendTo(jFS);$(opts.slides).find("div").each(function(){$(this).before('<div class="jFlowSlideContainer"></div>').appendTo($(this).prev())});$(jFC).eq(cur).addClass(jSel);var resize=function(x){$(jFS).css({position:"relative",width:opts.width,height:opts.height,overflow:"hidden"});$(opts.slides).css({position:"relative",width:$(jFS).width()*$(jFC).length+"px",height:$(jFS).height()+"px",overflow:"hidden"});$(opts.slides).children().css({position:"relative",width:$(jFS).width()+"px",height:$(jFS).height()+"px","float":"left",overflow:"hidden"});$(opts.slides).css({marginLeft:"-"+(cur*$(opts.slides).find(":eq(0)").width()+"px")})};resize();$(window).resize(function(){resize()});$(opts.prev).click(function(){dotimer();doprev()});$(opts.next).click(function(){dotimer();donext()});var doprev=function(x){if($(opts.slides).is(":not(:animated)")){var dur=1;if(cur>0)cur--;else{cur=maxi-1;dur=cur}$(jFC).removeClass(jSel);slide(dur,cur);$(jFC).eq(cur).addClass(jSel)}};var donext=function(x){if($(opts.slides).is(":not(:animated)")){var dur=1;if(cur<maxi-1)cur++;else{cur=0;dur=maxi-1}$(jFC).removeClass(jSel);slide(dur,cur);$(jFC).eq(cur).addClass(jSel)}};var dotimer=function(x){if((opts.auto)==true){if(timer!=null)clearInterval(timer);timer=setInterval(function(){$(opts.next).click()},3000)}};dotimer()};$.fn.jFlow.defaults={controller:".jFlowControl",slideWrapper:"#jFlowSlide",selectedWrapper:"jFlowSelected",auto:false,easing:"swing",duration:400,width:"100%",prev:".jFlowPrev",next:".jFlowNext"}})(jQuery);;jQuery.fn.liScroll=function(settings){settings=jQuery.extend({travelocity:0.07},settings);return this.each(function(){var $strip=jQuery(this);$strip.addClass("newsticker");var stripWidth=1;$strip.find("li").each(function(i){stripWidth+=jQuery(this,i).outerWidth(true)+20;});var $mask=$strip.wrap("<div class='mask'></div>");var $tickercontainer=$strip.parent().wrap("<div class='tickercontainer'></div>");var containerWidth=$strip.parent().parent().width();$strip.width(stripWidth);var totalTravel=stripWidth+containerWidth;var defTiming=totalTravel/ settings.travelocity; /*thanks to Scott Waye*/function scrollnews(spazio,tempo){$strip.animate({left:'-='+spazio},tempo,"linear",function(){$strip.css("left",containerWidth);scrollnews(totalTravel,defTiming)})}scrollnews(totalTravel,defTiming);$strip.hover(function(){jQuery(this).stop()},function(){var offset=jQuery(this).offset();var residualSpace=offset.left+stripWidth;var residualTime=residualSpace/settings.travelocity;scrollnews(residualSpace,residualTime)})})};(function($){$.fn.Slider=function(options){var opts=$.extend({},$.fn.Slider.defaults,options);var menuclickable=true;var timer;var $this=this;var slideToElement=function(idx){var firstShownItem=parseInt($(opts.container+' '+opts.slideElement+':eq('+opts.moveElements+')').attr('elementid'));if(idx!=firstShownItem){var orgMoveElements=opts.moveElements;var diff=0;var direction='next';if(firstShownItem>idx){diff=firstShownItem-idx;if(diff<=opts.moveElements){direction='prev'}else{diff=opts.maxElements-firstShownItem+(idx+1)}}else if(firstShownItem<idx){diff=idx-firstShownItem;if(diff>opts.maxElements-opts.moveElements){direction='prev';diff=opts.maxElements-idx+(firstShownItem+1)}}opts.moveElements=diff;if(direction=='next')donext(function(){menuclickable=true;opts.moveElements=orgMoveElements;moveItems(direction,diff)});else doprev(function(){menuclickable=true;opts.moveElements=orgMoveElements;moveItems(direction,diff)})}};var setStartElement=function(){if(opts.startElement>0){var pos=$(opts.container+' '+opts.slideElement).index($(opts.container+' '+opts.slideElement+'[elementid='+opts.startElement+']'))-opts.moveElements;for(var i=0;i<pos;i++){moveItems('next')}}};var initializeSlider=function(){var elems=$(opts.container+' '+opts.slideElement);if($(opts.controlContainer).length>0){jQuery.each(elems,function(index,value){$(value).attr('elementid',index);var div=document.createElement('div');var ctrl=document.createElement('span');$(div).addClass(opts.controlElement).show().attr('elementid',index).appendTo($(opts.controlContainer));$(ctrl).show().html(index).appendTo($(div));opts.maxElements=index;(function(idx){$(div).click(function(){slideToElement(idx)})})(index)})};moveItems('prev');$this.css(((opts.direction=='vertical')?'height':'width'),(opts.showElements*opts.elementSpace)+'px');$this.css('overflow','hidden').css('position','relative');$(opts.container).css(((opts.direction=='vertical')?'height':'width'),'10000px').css('position','absolute');var naviElements=$(opts.container+' '+opts.slideElement);if(naviElements.length>0&&(opts.moveElements*2)+opts.showElements>naviElements.length){for(var i=naviElements.length;i<(opts.moveElements*2)+opts.showElements;i+=naviElements.length){$.each(naviElements,function(){$(this).clone(true).appendTo($(opts.container))})}}$(opts.slideElement).each(function(){if(opts.direction=='horizontal'){$(this).css('float','left');$(this).css('width',opts.elementSpace+'px')}else{$(this).css('height',opts.elementSpace+'px')}});setStartElement()};var moveItems=function(direction){for(var i=0;i<opts.moveElements;i++){if(direction=='next'){$(opts.container+' '+opts.slideElement+':last').after($(opts.container+' '+opts.slideElement+':first'))}else{$(opts.container+' '+opts.slideElement+':first').before($(opts.container+' '+opts.slideElement+':last'))}}$(opts.container).css(((opts.direction=='vertical')?'top':'left'),'-'+(opts.elementSpace*opts.moveElements)+'px');var elementid=parseInt($(opts.container+' '+opts.slideElement+':eq('+opts.moveElements+')').attr('elementid'));$(opts.container+' '+opts.slideElement).removeClass("active");$(opts.container+' '+opts.slideElement+'[elementid='+elementid+']').addClass("active");if($(opts.controlContainer).length>0){$(opts.controlContainer+' div').removeClass("active");$(opts.controlContainer+' div[elementid='+elementid+']').addClass("active")};amplify.store($($this).attr('id')+"_"+site.getArea(),elementid)};var createButton=function(btnId){if($(btnId).length==0){var btn=document.createElement('div');btn.id=btnId.replace('#','');$(btn).hide().appendTo($this)}};initializeSlider();createButton(opts.next);createButton(opts.prev);$(opts.prev).click(function(){try{if($($this).has(':hover').length==0)dotimer()}catch(ex){dotimer()}doprev(function(func){menuclickable=true;moveItems('prev')})});$(opts.next).click(function(){try{if($($this).has(':hover').length==0)dotimer()}catch(ex){dotimer()}donext(function(func){menuclickable=true;moveItems('next')})});var doprev=function(callback){if(menuclickable){menuclickable=false;if(opts.direction=='vertical')$(opts.container).animate({top:"+="+(opts.elementSpace*opts.moveElements)+"px"},opts.speed,callback);else $(opts.container).animate({left:"+="+(opts.elementSpace*opts.moveElements)+"px"},opts.speed,callback)}};var donext=function(callback){if(menuclickable){menuclickable=false;if(opts.direction=='vertical')$(opts.container).animate({top:"-="+(opts.elementSpace*opts.moveElements)+"px"},opts.speed,callback);else $(opts.container).animate({left:"-="+(opts.elementSpace*opts.moveElements)+"px"},opts.speed,callback)}};var dotimer=function(){if((opts.auto)==true){if(timer!=null)clearInterval(timer);timer=setInterval(function(){$(opts.next).click()},opts.duration)}};dotimer();$($this).hover(function(){clearInterval(timer)},function(){dotimer()})};$.fn.Slider.defaults={elementSpace:100,showElements:1,moveElements:1,speed:600,prev:"#sliderPrev",next:"#sliderNext",container:"#slideContainer",slideElement:".slideElement",direction:'vertical',auto:false,duration:3000,easing:"swing",startElement:0}})(jQuery);(function(f,g,j,b){var h=/progid:DXImageTransform\.Microsoft\.Matrix\(.*?\)/,c=/^([\+\-]=)?([\d+.\-]+)(.*)$/,q=/%/;var d=j.createElement("modernizr"),e=d.style;function n(s){return parseFloat(s)}function l(){var s={transformProperty:"",MozTransform:"-moz-",WebkitTransform:"-webkit-",OTransform:"-o-",msTransform:"-ms-"};for(var t in s){if(typeof e[t]!="undefined"){return s[t]}}return null}function r(){if(typeof(g.Modernizr)!=="undefined"){return Modernizr.csstransforms}var t=["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"];for(var s in t){if(e[t[s]]!==b){return true}}}var a=l(),i=a!==null?a+"transform":false,k=a!==null?a+"transform-origin":false;f.support.csstransforms=r();if(a=="-ms-"){i="msTransform";k="msTransformOrigin"}f.extend({transform:function(s){s.transform=this;this.$elem=f(s);this.applyingMatrix=false;this.matrix=null;this.height=null;this.width=null;this.outerHeight=null;this.outerWidth=null;this.boxSizingValue=null;this.boxSizingProperty=null;this.attr=null;this.transformProperty=i;this.transformOriginProperty=k}});f.extend(f.transform,{funcs:["matrix","origin","reflect","reflectX","reflectXY","reflectY","rotate","scale","scaleX","scaleY","skew","skewX","skewY","translate","translateX","translateY"]});f.fn.transform=function(s,t){return this.each(function(){var u=this.transform||new f.transform(this);if(s){u.exec(s,t)}})};f.transform.prototype={exec:function(s,t){t=f.extend(true,{forceMatrix:false,preserve:false},t);this.attr=null;if(t.preserve){s=f.extend(true,this.getAttrs(true,true),s)}else{s=f.extend(true,{},s)}this.setAttrs(s);if(f.support.csstransforms&&!t.forceMatrix){return this.execFuncs(s)}else{if(f.browser.msie||(f.support.csstransforms&&t.forceMatrix)){return this.execMatrix(s)}}return false},execFuncs:function(t){var s=[];for(var u in t){if(u=="origin"){this[u].apply(this,f.isArray(t[u])?t[u]:[t[u]])}else{if(f.inArray(u,f.transform.funcs)!==-1){s.push(this.createTransformFunc(u,t[u]))}}}this.$elem.css(i,s.join(" "));return true},execMatrix:function(z){var C,x,t;var F=this.$elem[0],B=this;function A(N,M){if(q.test(N)){return parseFloat(N)/100*B["safeOuter"+(M?"Height":"Width")]()}return o(F,N)}var s=/translate[X|Y]?/,u=[];for(var v in z){switch(f.type(z[v])){case"array":t=z[v];break;case"string":t=f.map(z[v].split(","),f.trim);break;default:t=[z[v]]}if(f.matrix[v]){if(f.cssAngle[v]){t=f.map(t,f.angle.toDegree)}else{if(!f.cssNumber[v]){t=f.map(t,A)}else{t=f.map(t,n)}}x=f.matrix[v].apply(this,t);if(s.test(v)){u.push(x)}else{C=C?C.x(x):x}}else{if(v=="origin"){this[v].apply(this,t)}}}C=C||f.matrix.identity();f.each(u,function(M,N){C=C.x(N)});var K=parseFloat(C.e(1,1).toFixed(6)),I=parseFloat(C.e(2,1).toFixed(6)),H=parseFloat(C.e(1,2).toFixed(6)),G=parseFloat(C.e(2,2).toFixed(6)),L=C.rows===3?parseFloat(C.e(1,3).toFixed(6)):0,J=C.rows===3?parseFloat(C.e(2,3).toFixed(6)):0;if(f.support.csstransforms&&a==="-moz-"){this.$elem.css(i,"matrix("+K+", "+I+", "+H+", "+G+", "+L+"px, "+J+"px)")}else{if(f.support.csstransforms){this.$elem.css(i,"matrix("+K+", "+I+", "+H+", "+G+", "+L+", "+J+")")}else{if(f.browser.msie){var w=", FilterType='nearest neighbor'";var D=this.$elem[0].style;var E="progid:DXImageTransform.Microsoft.Matrix(M11="+K+", M12="+H+", M21="+I+", M22="+G+", sizingMethod='auto expand'"+w+")";var y=D.filter||f.curCSS(this.$elem[0],"filter")||"";D.filter=h.test(y)?y.replace(h,E):y?y+" "+E:E;this.applyingMatrix=true;this.matrix=C;this.fixPosition(C,L,J);this.applyingMatrix=false;this.matrix=null}}}return true},origin:function(s,t){if(f.support.csstransforms){if(typeof t==="undefined"){this.$elem.css(k,s)}else{this.$elem.css(k,s+" "+t)}return true}switch(s){case"left":s="0";break;case"right":s="100%";break;case"center":case b:s="50%"}switch(t){case"top":t="0";break;case"bottom":t="100%";break;case"center":case b:t="50%"}this.setAttr("origin",[q.test(s)?s:o(this.$elem[0],s)+"px",q.test(t)?t:o(this.$elem[0],t)+"px"]);return true},createTransformFunc:function(t,u){if(t.substr(0,7)==="reflect"){var s=u?f.matrix[t]():f.matrix.identity();return"matrix("+s.e(1,1)+", "+s.e(2,1)+", "+s.e(1,2)+", "+s.e(2,2)+", 0, 0)"}if(t=="matrix"){if(a==="-moz-"){u[4]=u[4]?u[4]+"px":0;u[5]=u[5]?u[5]+"px":0}}return t+"("+(f.isArray(u)?u.join(", "):u)+")"},fixPosition:function(B,y,x,D,s){var w=new f.matrix.calc(B,this.safeOuterHeight(),this.safeOuterWidth()),C=this.getAttr("origin");var v=w.originOffset(new f.matrix.V2(q.test(C[0])?parseFloat(C[0])/100*w.outerWidth:parseFloat(C[0]),q.test(C[1])?parseFloat(C[1])/100*w.outerHeight:parseFloat(C[1])));var t=w.sides();var u=this.$elem.css("position");if(u=="static"){u="relative"}var A={top:0,left:0};var z={position:u,top:(v.top+x+t.top+A.top)+"px",left:(v.left+y+t.left+A.left)+"px",zoom:1};this.$elem.css(z)}};function o(s,u){var t=c.exec(f.trim(u));if(t[3]&&t[3]!=="px"){var w="paddingBottom",v=f.style(s,w);f.style(s,w,u);u=p(s,w);f.style(s,w,v);return u}return parseFloat(u)}function p(t,u){if(t[u]!=null&&(!t.style||t.style[u]==null)){return t[u]}var s=parseFloat(f.css(t,u));return s&&s>-10000?s:0}})(jQuery,this,this.document);(function(d,c,a,f){d.extend(d.transform.prototype,{safeOuterHeight:function(){return this.safeOuterLength("height")},safeOuterWidth:function(){return this.safeOuterLength("width")},safeOuterLength:function(l){var p="outer"+(l=="width"?"Width":"Height");if(!d.support.csstransforms&&d.browser.msie){l=l=="width"?"width":"height";if(this.applyingMatrix&&!this[p]&&this.matrix){var k=new d.matrix.calc(this.matrix,1,1),n=k.offset(),g=this.$elem[p]()/n[l];this[p]=g;return g}else{if(this.applyingMatrix&&this[p]){return this[p]}}var o={height:["top","bottom"],width:["left","right"]};var h=this.$elem[0],j=parseFloat(d.curCSS(h,l,true)),q=this.boxSizingProperty,i=this.boxSizingValue;if(!this.boxSizingProperty){q=this.boxSizingProperty=e()||"box-sizing";i=this.boxSizingValue=this.$elem.css(q)||"content-box"}if(this[p]&&this[l]==j){return this[p]}else{this[l]=j}if(q&&(i=="padding-box"||i=="content-box")){j+=parseFloat(d.curCSS(h,"padding-"+o[l][0],true))||0+parseFloat(d.curCSS(h,"padding-"+o[l][1],true))||0}if(q&&i=="content-box"){j+=parseFloat(d.curCSS(h,"border-"+o[l][0]+"-width",true))||0+parseFloat(d.curCSS(h,"border-"+o[l][1]+"-width",true))||0}this[p]=j;return j}return this.$elem[p]()}});var b=null;function e(){if(b){return b}var h={boxSizing:"box-sizing",MozBoxSizing:"-moz-box-sizing",WebkitBoxSizing:"-webkit-box-sizing",OBoxSizing:"-o-box-sizing"},g=a.body;for(var i in h){if(typeof g.style[i]!="undefined"){b=h[i];return b}}return null}})(jQuery,this,this.document);(function(g,f,b,h){var d=/([\w\-]*?)\((.*?)\)/g,a="data-transform",e=/\s/,c=/,\s?/;g.extend(g.transform.prototype,{setAttrs:function(i){var j="",l;for(var k in i){l=i[k];if(g.isArray(l)){l=l.join(", ")}j+=" "+k+"("+l+")"}this.attr=g.trim(j);this.$elem.attr(a,this.attr)},setAttr:function(k,l){if(g.isArray(l)){l=l.join(", ")}var j=this.attr||this.$elem.attr(a);if(!j||j.indexOf(k)==-1){this.attr=g.trim(j+" "+k+"("+l+")");this.$elem.attr(a,this.attr)}else{var i=[],n;d.lastIndex=0;while(n=d.exec(j)){if(k==n[1]){i.push(k+"("+l+")")}else{i.push(n[0])}}this.attr=i.join(" ");this.$elem.attr(a,this.attr)}},getAttrs:function(){var j=this.attr||this.$elem.attr(a);if(!j){return{}}var i={},l,k;d.lastIndex=0;while((l=d.exec(j))!==null){if(l){k=l[2].split(c);i[l[1]]=k.length==1?k[0]:k}}return i},getAttr:function(j){var i=this.getAttrs();if(typeof i[j]!=="undefined"){return i[j]}if(j==="origin"&&g.support.csstransforms){return this.$elem.css(this.transformOriginProperty).split(e)}else{if(j==="origin"){return["50%","50%"]}}return g.cssDefault[j]||0}});if(typeof(g.cssAngle)=="undefined"){g.cssAngle={}}g.extend(g.cssAngle,{rotate:true,skew:true,skewX:true,skewY:true});if(typeof(g.cssDefault)=="undefined"){g.cssDefault={}}g.extend(g.cssDefault,{scale:[1,1],scaleX:1,scaleY:1,matrix:[1,0,0,1,0,0],origin:["50%","50%"],reflect:[1,0,0,1,0,0],reflectX:[1,0,0,1,0,0],reflectXY:[1,0,0,1,0,0],reflectY:[1,0,0,1,0,0]});if(typeof(g.cssMultipleValues)=="undefined"){g.cssMultipleValues={}}g.extend(g.cssMultipleValues,{matrix:6,origin:{length:2,duplicate:true},reflect:6,reflectX:6,reflectXY:6,reflectY:6,scale:{length:2,duplicate:true},skew:2,translate:2});g.extend(g.cssNumber,{matrix:true,reflect:true,reflectX:true,reflectXY:true,reflectY:true,scale:true,scaleX:true,scaleY:true});g.each(g.transform.funcs,function(j,k){g.cssHooks[k]={set:function(n,o){var l=n.transform||new g.transform(n),i={};i[k]=o;l.exec(i,{preserve:true})},get:function(n,l){var i=n.transform||new g.transform(n);return i.getAttr(k)}}});g.each(["reflect","reflectX","reflectXY","reflectY"],function(j,k){g.cssHooks[k].get=function(n,l){var i=n.transform||new g.transform(n);return i.getAttr("matrix")||g.cssDefault[k]}})})(jQuery,this,this.document);(function(e,g,h,c){var d=/^([+\-]=)?([\d+.\-]+)(.*)$/;var a=e.fn.animate;e.fn.animate=function(p,l,o,n){var k=e.speed(l,o,n),j=e.cssMultipleValues;k.complete=k.old;if(!e.isEmptyObject(p)){if(typeof k.original==="undefined"){k.original={}}e.each(p,function(s,u){if(j[s]||e.cssAngle[s]||(!e.cssNumber[s]&&e.inArray(s,e.transform.funcs)!==-1)){var t=null;if(jQuery.isArray(p[s])){var r=1,q=u.length;if(j[s]){r=(typeof j[s].length==="undefined"?j[s]:j[s].length)}if(q>r||(q<r&&q==2)||(q==2&&r==2&&isNaN(parseFloat(u[q-1])))){t=u[q-1];u.splice(q-1,1)}}k.original[s]=u.toString();p[s]=parseFloat(u)}})}return a.apply(this,[arguments[0],k])};var b="paddingBottom";function i(k,l){if(k[l]!=null&&(!k.style||k.style[l]==null)){}var j=parseFloat(e.css(k,l));return j&&j>-10000?j:0}var f=e.fx.prototype.custom;e.fx.prototype.custom=function(u,v,w){var y=e.cssMultipleValues[this.prop],p=e.cssAngle[this.prop];if(y||(!e.cssNumber[this.prop]&&e.inArray(this.prop,e.transform.funcs)!==-1)){this.values=[];if(!y){y=1}var x=this.options.original[this.prop],t=e(this.elem).css(this.prop),j=e.cssDefault[this.prop]||0;if(!e.isArray(t)){t=[t]}if(!e.isArray(x)){if(e.type(x)==="string"){x=x.split(",")}else{x=[x]}}var l=y.length||y,s=0;while(x.length<l){x.push(y.duplicate?x[0]:j[s]||0);s++}var k,r,q,o=this,n=o.elem.transform;orig=e.style(o.elem,b);e.each(x,function(z,A){if(t[z]){k=t[z]}else{if(j[z]&&!y.duplicate){k=j[z]}else{if(y.duplicate){k=t[0]}else{k=0}}}if(p){k=e.angle.toDegree(k)}else{if(!e.cssNumber[o.prop]){r=d.exec(e.trim(k));if(r[3]&&r[3]!=="px"){if(r[3]==="%"){k=parseFloat(r[2])/100*n["safeOuter"+(z?"Height":"Width")]()}else{e.style(o.elem,b,k);k=i(o.elem,b);e.style(o.elem,b,orig)}}}}k=parseFloat(k);r=d.exec(e.trim(A));if(r){q=parseFloat(r[2]);w=r[3]||"px";if(p){q=e.angle.toDegree(q+w);w="deg"}else{if(!e.cssNumber[o.prop]&&w==="%"){k=(k/n["safeOuter"+(z?"Height":"Width")]())*100}else{if(!e.cssNumber[o.prop]&&w!=="px"){e.style(o.elem,b,(q||1)+w);k=((q||1)/i(o.elem,b))*k;e.style(o.elem,b,orig)}}}if(r[1]){q=((r[1]==="-="?-1:1)*q)+k}}else{q=A;w=""}o.values.push({start:k,end:q,unit:w})})}return f.apply(this,arguments)};e.fx.multipleValueStep={_default:function(j){e.each(j.values,function(k,l){j.values[k].now=l.start+((l.end-l.start)*j.pos)})}};e.each(["matrix","reflect","reflectX","reflectXY","reflectY"],function(j,k){e.fx.multipleValueStep[k]=function(n){var p=n.decomposed,l=e.matrix;m=l.identity();p.now={};e.each(p.start,function(q){p.now[q]=parseFloat(p.start[q])+((parseFloat(p.end[q])-parseFloat(p.start[q]))*n.pos);if(((q==="scaleX"||q==="scaleY")&&p.now[q]===1)||(q!=="scaleX"&&q!=="scaleY"&&p.now[q]===0)){return true}m=m.x(l[q](p.now[q]))});var o;e.each(n.values,function(q){switch(q){case 0:o=parseFloat(m.e(1,1).toFixed(6));break;case 1:o=parseFloat(m.e(2,1).toFixed(6));break;case 2:o=parseFloat(m.e(1,2).toFixed(6));break;case 3:o=parseFloat(m.e(2,2).toFixed(6));break;case 4:o=parseFloat(m.e(1,3).toFixed(6));break;case 5:o=parseFloat(m.e(2,3).toFixed(6));break}n.values[q].now=o})}});e.each(e.transform.funcs,function(j,k){e.fx.step[k]=function(o){var n=o.elem.transform||new e.transform(o.elem),l={};if(e.cssMultipleValues[k]||(!e.cssNumber[k]&&e.inArray(k,e.transform.funcs)!==-1)){(e.fx.multipleValueStep[o.prop]||e.fx.multipleValueStep._default)(o);l[o.prop]=[];e.each(o.values,function(p,q){l[o.prop].push(q.now+(e.cssNumber[o.prop]?"":q.unit))})}else{l[o.prop]=o.now+(e.cssNumber[o.prop]?"":o.unit)}n.exec(l,{preserve:true})}});e.each(["matrix","reflect","reflectX","reflectXY","reflectY"],function(j,k){e.fx.step[k]=function(q){var p=q.elem.transform||new e.transform(q.elem),o={};if(!q.initialized){q.initialized=true;if(k!=="matrix"){var n=e.matrix[k]().elements;var r;e.each(q.values,function(s){switch(s){case 0:r=n[0];break;case 1:r=n[2];break;case 2:r=n[1];break;case 3:r=n[3];break;default:r=0}q.values[s].end=r})}q.decomposed={};var l=q.values;q.decomposed.start=e.matrix.matrix(l[0].start,l[1].start,l[2].start,l[3].start,l[4].start,l[5].start).decompose();q.decomposed.end=e.matrix.matrix(l[0].end,l[1].end,l[2].end,l[3].end,l[4].end,l[5].end).decompose()}(e.fx.multipleValueStep[q.prop]||e.fx.multipleValueStep._default)(q);o.matrix=[];e.each(q.values,function(s,t){o.matrix.push(t.now)});p.exec(o,{preserve:true})}})})(jQuery,this,this.document);(function(g,h,j,c){var d=180/Math.PI;var k=200/Math.PI;var f=Math.PI/180;var e=2/1.8;var i=0.9;var a=Math.PI/200;var b=/^([+\-]=)?([\d+.\-]+)(.*)$/;g.extend({angle:{runit:/(deg|g?rad)/,radianToDegree:function(l){return l*d},radianToGrad:function(l){return l*k},degreeToRadian:function(l){return l*f},degreeToGrad:function(l){return l*e},gradToDegree:function(l){return l*i},gradToRadian:function(l){return l*a},toDegree:function(n){var l=b.exec(n);if(l){n=parseFloat(l[2]);switch(l[3]||"deg"){case"grad":n=g.angle.gradToDegree(n);break;case"rad":n=g.angle.radianToDegree(n);break}return n}return 0}}})})(jQuery,this,this.document);(function(f,e,b,g){if(typeof(f.matrix)=="undefined"){f.extend({matrix:{}})}var d=f.matrix;f.extend(d,{V2:function(h,i){if(f.isArray(arguments[0])){this.elements=arguments[0].slice(0,2)}else{this.elements=[h,i]}this.length=2},V3:function(h,j,i){if(f.isArray(arguments[0])){this.elements=arguments[0].slice(0,3)}else{this.elements=[h,j,i]}this.length=3},M2x2:function(i,h,k,j){if(f.isArray(arguments[0])){this.elements=arguments[0].slice(0,4)}else{this.elements=Array.prototype.slice.call(arguments).slice(0,4)}this.rows=2;this.cols=2},M3x3:function(n,l,k,j,i,h,q,p,o){if(f.isArray(arguments[0])){this.elements=arguments[0].slice(0,9)}else{this.elements=Array.prototype.slice.call(arguments).slice(0,9)}this.rows=3;this.cols=3}});var c={e:function(k,h){var i=this.rows,j=this.cols;if(k>i||h>i||k<1||h<1){return 0}return this.elements[(k-1)*j+h-1]},decompose:function(){var v=this.e(1,1),t=this.e(2,1),q=this.e(1,2),p=this.e(2,2),o=this.e(1,3),n=this.e(2,3);if(Math.abs(v*p-t*q)<0.01){return{rotate:0+"deg",skewX:0+"deg",scaleX:1,scaleY:1,translateX:0+"px",translateY:0+"px"}}var l=o,j=n;var u=Math.sqrt(v*v+t*t);v=v/u;t=t/u;var i=v*q+t*p;q-=v*i;p-=t*i;var s=Math.sqrt(q*q+p*p);q=q/s;p=p/s;i=i/s;if((v*p-t*q)<0){v=-v;t=-t;u=-u}var w=f.angle.radianToDegree;var h=w(Math.atan2(t,v));i=w(Math.atan(i));return{rotate:h+"deg",skewX:i+"deg",scaleX:u,scaleY:s,translateX:l+"px",translateY:j+"px"}}};f.extend(d.M2x2.prototype,c,{toM3x3:function(){var h=this.elements;return new d.M3x3(h[0],h[1],0,h[2],h[3],0,0,0,1)},x:function(j){var k=typeof(j.rows)==="undefined";if(!k&&j.rows==3){return this.toM3x3().x(j)}var i=this.elements,h=j.elements;if(k&&h.length==2){return new d.V2(i[0]*h[0]+i[1]*h[1],i[2]*h[0]+i[3]*h[1])}else{if(h.length==i.length){return new d.M2x2(i[0]*h[0]+i[1]*h[2],i[0]*h[1]+i[1]*h[3],i[2]*h[0]+i[3]*h[2],i[2]*h[1]+i[3]*h[3])}}return false},inverse:function(){var i=1/this.determinant(),h=this.elements;return new d.M2x2(i*h[3],i*-h[1],i*-h[2],i*h[0])},determinant:function(){var h=this.elements;return h[0]*h[3]-h[1]*h[2]}});f.extend(d.M3x3.prototype,c,{x:function(j){var k=typeof(j.rows)==="undefined";if(!k&&j.rows<3){j=j.toM3x3()}var i=this.elements,h=j.elements;if(k&&h.length==3){return new d.V3(i[0]*h[0]+i[1]*h[1]+i[2]*h[2],i[3]*h[0]+i[4]*h[1]+i[5]*h[2],i[6]*h[0]+i[7]*h[1]+i[8]*h[2])}else{if(h.length==i.length){return new d.M3x3(i[0]*h[0]+i[1]*h[3]+i[2]*h[6],i[0]*h[1]+i[1]*h[4]+i[2]*h[7],i[0]*h[2]+i[1]*h[5]+i[2]*h[8],i[3]*h[0]+i[4]*h[3]+i[5]*h[6],i[3]*h[1]+i[4]*h[4]+i[5]*h[7],i[3]*h[2]+i[4]*h[5]+i[5]*h[8],i[6]*h[0]+i[7]*h[3]+i[8]*h[6],i[6]*h[1]+i[7]*h[4]+i[8]*h[7],i[6]*h[2]+i[7]*h[5]+i[8]*h[8])}}return false},inverse:function(){var i=1/this.determinant(),h=this.elements;return new d.M3x3(i*(h[8]*h[4]-h[7]*h[5]),i*(-(h[8]*h[1]-h[7]*h[2])),i*(h[5]*h[1]-h[4]*h[2]),i*(-(h[8]*h[3]-h[6]*h[5])),i*(h[8]*h[0]-h[6]*h[2]),i*(-(h[5]*h[0]-h[3]*h[2])),i*(h[7]*h[3]-h[6]*h[4]),i*(-(h[7]*h[0]-h[6]*h[1])),i*(h[4]*h[0]-h[3]*h[1]))},determinant:function(){var h=this.elements;return h[0]*(h[8]*h[4]-h[7]*h[5])-h[3]*(h[8]*h[1]-h[7]*h[2])+h[6]*(h[5]*h[1]-h[4]*h[2])}});var a={e:function(h){return this.elements[h-1]}};f.extend(d.V2.prototype,a);f.extend(d.V3.prototype,a)})(jQuery,this,this.document);(function(c,b,a,d){if(typeof(c.matrix)=="undefined"){c.extend({matrix:{}})}c.extend(c.matrix,{calc:function(e,f,g){this.matrix=e;this.outerHeight=f;this.outerWidth=g}});c.matrix.calc.prototype={coord:function(e,i,h){h=typeof(h)!=="undefined"?h:0;var g=this.matrix,f;switch(g.rows){case 2:f=g.x(new c.matrix.V2(e,i));break;case 3:f=g.x(new c.matrix.V3(e,i,h));break}return f},corners:function(e,h){var f=!(typeof(e)!=="undefined"||typeof(h)!=="undefined"),g;if(!this.c||!f){h=h||this.outerHeight;e=e||this.outerWidth;g={tl:this.coord(0,0),bl:this.coord(0,h),tr:this.coord(e,0),br:this.coord(e,h)}}else{g=this.c}if(f){this.c=g}return g},sides:function(e){var f=e||this.corners();return{top:Math.min(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),bottom:Math.max(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),left:Math.min(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1)),right:Math.max(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1))}},offset:function(e){var f=this.sides(e);return{height:Math.abs(f.bottom-f.top),width:Math.abs(f.right-f.left)}},area:function(e){var h=e||this.corners();var g={x:h.tr.e(1)-h.tl.e(1)+h.br.e(1)-h.bl.e(1),y:h.tr.e(2)-h.tl.e(2)+h.br.e(2)-h.bl.e(2)},f={x:h.bl.e(1)-h.tl.e(1)+h.br.e(1)-h.tr.e(1),y:h.bl.e(2)-h.tl.e(2)+h.br.e(2)-h.tr.e(2)};return 0.25*Math.abs(g.e(1)*f.e(2)-g.e(2)*f.e(1))},nonAffinity:function(){var f=this.sides(),g=f.top-f.bottom,e=f.left-f.right;return parseFloat(parseFloat(Math.abs((Math.pow(g,2)+Math.pow(e,2))/(f.top*f.bottom+f.left*f.right))).toFixed(8))},originOffset:function(h,g){h=h?h:new c.matrix.V2(this.outerWidth*0.5,this.outerHeight*0.5);g=g?g:new c.matrix.V2(0,0);var e=this.coord(h.e(1),h.e(2));var f=this.coord(g.e(1),g.e(2));return{top:(f.e(2)-g.e(2))-(e.e(2)-h.e(2)),left:(f.e(1)-g.e(1))-(e.e(1)-h.e(1))}}}})(jQuery,this,this.document);(function(e,d,a,f){if(typeof(e.matrix)=="undefined"){e.extend({matrix:{}})}var c=e.matrix,g=c.M2x2,b=c.M3x3;e.extend(c,{identity:function(k){k=k||2;var l=k*k,n=new Array(l),j=k+1;for(var h=0;h<l;h++){n[h]=(h%j)===0?1:0}return new c["M"+k+"x"+k](n)},matrix:function(){var h=Array.prototype.slice.call(arguments);switch(arguments.length){case 4:return new g(h[0],h[2],h[1],h[3]);case 6:return new b(h[0],h[2],h[4],h[1],h[3],h[5],0,0,1)}},reflect:function(){return new g(-1,0,0,-1)},reflectX:function(){return new g(1,0,0,-1)},reflectXY:function(){return new g(0,1,1,0)},reflectY:function(){return new g(-1,0,0,1)},rotate:function(l){var i=e.angle.degreeToRadian(l),k=Math.cos(i),n=Math.sin(i);var j=k,h=n,p=-n,o=k;return new g(j,p,h,o)},scale:function(i,h){i=i||i===0?i:1;h=h||h===0?h:i;return new g(i,0,0,h)},scaleX:function(h){return c.scale(h,1)},scaleY:function(h){return c.scale(1,h)},skew:function(k,i){k=k||0;i=i||0;var l=e.angle.degreeToRadian(k),j=e.angle.degreeToRadian(i),h=Math.tan(l),n=Math.tan(j);return new g(1,h,n,1)},skewX:function(h){return c.skew(h)},skewY:function(h){return c.skew(0,h)},translate:function(i,h){i=i||0;h=h||0;return new b(1,0,i,0,1,h,0,0,1)},translateX:function(h){return c.translate(h)},translateY:function(h){return c.translate(0,h)}})})(jQuery,this,this.document);if(typeof jwplayer=="undefined"){var jwplayer=function(b){if(jwplayer.api){return jwplayer.api.selectPlayer(b)}};var $jw=jwplayer;jwplayer.version="5.8.2011 (Licensed version)";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(c){c.utils=function(){};c.utils.typeOf=function(a){var b=typeof a;if(b==="object"){if(a){if(a instanceof Array){b="array"}}else{b="null"}}return b};c.utils.extend=function(){var f=c.utils.extend["arguments"];if(f.length>1){for(var a=1;a<f.length;a++){for(var b in f[a]){f[0][b]=f[a][b]}}return f[0]}return null};c.utils.clone=function(a){var h;var g=c.utils.clone["arguments"];if(g.length==1){switch(c.utils.typeOf(g[0])){case"object":h={};for(var b in g[0]){h[b]=c.utils.clone(g[0][b])}break;case"array":h=[];for(var b in g[0]){h[b]=c.utils.clone(g[0][b])}break;default:return g[0];break}}return h};c.utils.extension=function(a){if(!a){return""}a=a.substring(a.lastIndexOf("/")+1,a.length);a=a.split("?")[0];if(a.lastIndexOf(".")>-1){return a.substr(a.lastIndexOf(".")+1,a.length).toLowerCase()}return};c.utils.html=function(b,a){b.innerHTML=a};c.utils.wrap=function(b,a){if(b.parentNode){b.parentNode.replaceChild(a,b)}a.appendChild(b)};c.utils.ajax=function(a,b,k){var h;if(window.XMLHttpRequest){h=new XMLHttpRequest()}else{h=new ActiveXObject("Microsoft.XMLHTTP")}h.onreadystatechange=function(){if(h.readyState===4){if(h.status===200){if(b){if(!c.utils.exists(h.responseXML)){try{if(window.DOMParser){var f=(new DOMParser()).parseFromString(h.responseText,"text/xml");if(f){h=c.utils.extend({},h,{responseXML:f})}}else{f=new ActiveXObject("Microsoft.XMLDOM");f.async="false";f.loadXML(h.responseText);h=c.utils.extend({},h,{responseXML:f})}}catch(e){if(k){k(a)}}}b(h)}}else{if(k){k(a)}}}};try{h.open("GET",a,true);h.send(null)}catch(j){if(k){k(a)}}return h};c.utils.load=function(b,a,f){b.onreadystatechange=function(){if(b.readyState===4){if(b.status===200){if(a){a()}}else{if(f){f()}}}}};c.utils.find=function(a,b){return a.getElementsByTagName(b)};c.utils.append=function(b,a){b.appendChild(a)};c.utils.isIE=function(){return((!+"\v1")||(typeof window.ActiveXObject!="undefined"))};c.utils.userAgentMatch=function(a){var b=navigator.userAgent.toLowerCase();return(b.match(a)!==null)};c.utils.isIOS=function(){return c.utils.userAgentMatch(/iP(hone|ad|od)/i)};c.utils.isIPad=function(){return c.utils.userAgentMatch(/iPad/i)};c.utils.isIPod=function(){return c.utils.userAgentMatch(/iP(hone|od)/i)};c.utils.isAndroid=function(){return c.utils.userAgentMatch(/android/i)};c.utils.isLegacyAndroid=function(){return c.utils.userAgentMatch(/android 2.[012]/i)};c.utils.isBlackberry=function(){return c.utils.userAgentMatch(/blackberry/i)};c.utils.isMobile=function(){return c.utils.isIOS()};c.utils.getFirstPlaylistItemFromConfig=function(f){var b={};var a;if(f.playlist&&f.playlist.length){a=f.playlist[0]}else{a=f}b.file=a.file;b.levels=a.levels;b.streamer=a.streamer;b.playlistfile=a.playlistfile;b.provider=a.provider;if(!b.provider){if(b.file&&(b.file.toLowerCase().indexOf("youtube.com")>-1||b.file.toLowerCase().indexOf("youtu.be")>-1)){b.provider="youtube"}if(b.streamer&&b.streamer.toLowerCase().indexOf("rtmp://")==0){b.provider="rtmp"}if(a.type){b.provider=a.type.toLowerCase()}}if(b.provider=="audio"){b.provider="sound"}return b};c.utils.getOuterHTML=function(b){if(b.outerHTML){return b.outerHTML}else{try{return new XMLSerializer().serializeToString(b)}catch(a){return""}}};c.utils.setOuterHTML=function(b,h){if(b.outerHTML){b.outerHTML=h}else{var a=document.createElement("div");a.innerHTML=h;var k=document.createRange();k.selectNodeContents(a);var j=k.extractContents();b.parentNode.insertBefore(j,b);b.parentNode.removeChild(b)}};c.utils.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined"){return true}if(typeof window.ActiveXObject!="undefined"){try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(a){}}return false};c.utils.getPluginName=function(a){if(a.lastIndexOf("/")>=0){a=a.substring(a.lastIndexOf("/")+1,a.length)}if(a.lastIndexOf("-")>=0){a=a.substring(0,a.lastIndexOf("-"))}if(a.lastIndexOf(".swf")>=0){a=a.substring(0,a.lastIndexOf(".swf"))}if(a.lastIndexOf(".js")>=0){a=a.substring(0,a.lastIndexOf(".js"))}return a};c.utils.getPluginVersion=function(a){if(a.lastIndexOf("-")>=0){if(a.lastIndexOf(".js")>=0){return a.substring(a.lastIndexOf("-")+1,a.lastIndexOf(".js"))}else{if(a.lastIndexOf(".swf")>=0){return a.substring(a.lastIndexOf("-")+1,a.lastIndexOf(".swf"))}else{return a.substring(a.lastIndexOf("-")+1)}}}return""};c.utils.getAbsolutePath=function(b,l){if(!c.utils.exists(l)){l=document.location.href}if(!c.utils.exists(b)){return undefined}if(d(b)){return b}var a=l.substring(0,l.indexOf("://")+3);var m=l.substring(a.length,l.indexOf("/",a.length+1));var p;if(b.indexOf("/")===0){p=b.split("/")}else{var o=l.split("?")[0];o=o.substring(a.length+m.length+1,o.lastIndexOf("/"));p=o.split("/").concat(b.split("/"))}var q=[];for(var n=0;n<p.length;n++){if(!p[n]||!c.utils.exists(p[n])||p[n]=="."){continue}else{if(p[n]==".."){q.pop()}else{q.push(p[n])}}}return a+m+"/"+q.join("/")};function d(b){if(!c.utils.exists(b)){return}var a=b.indexOf("://");var f=b.indexOf("?");return(a>0&&(f<0||(f>a)))}c.utils.pluginPathType={ABSOLUTE:"ABSOLUTE",RELATIVE:"RELATIVE",CDN:"CDN"};c.utils.getPluginPathType=function(g){if(typeof g!="string"){return}g=g.split("?")[0];var b=g.indexOf("://");if(b>0){return c.utils.pluginPathType.ABSOLUTE}var h=g.indexOf("/");var a=c.utils.extension(g);if(b<0&&h<0&&(!a||!isNaN(a))){return c.utils.pluginPathType.CDN}return c.utils.pluginPathType.RELATIVE};c.utils.mapEmpty=function(b){for(var a in b){return false}return true};c.utils.mapLength=function(b){var f=0;for(var a in b){f++}return f};c.utils.log=function(a,b){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(b){console.log(a,b)}else{console.log(a)}}};c.utils.css=function(j,a,k){if(c.utils.exists(j)){for(var h in a){try{if(typeof a[h]==="undefined"){continue}else{if(typeof a[h]=="number"&&!(h=="zIndex"||h=="opacity")){if(isNaN(a[h])){continue}if(h.match(/color/i)){a[h]="#"+c.utils.strings.pad(a[h].toString(16),6)}else{a[h]=Math.ceil(a[h])+"px"}}}j.style[h]=a[h]}catch(b){}}}};c.utils.isYouTube=function(a){return(a.indexOf("youtube.com")>-1||a.indexOf("youtu.be")>-1)};c.utils.transform=function(k,l,m,b,a){if(!c.utils.exists(l)){l=1}if(!c.utils.exists(m)){m=1}if(!c.utils.exists(b)){b=0}if(!c.utils.exists(a)){a=0}if(l==1&&m==1&&b==0&&a==0){k.style.webkitTransform="";k.style.MozTransform="";k.style.OTransform=""}else{var j="scale("+l+","+m+") translate("+b+"px,"+a+"px)";k.style.webkitTransform=j;k.style.MozTransform=j;k.style.OTransform=j}};c.utils.stretch=function(u,a,b,x,r,w){if(typeof b=="undefined"||typeof x=="undefined"||typeof r=="undefined"||typeof w=="undefined"){return}var z=b/r;var y=x/w;var s=0;var t=0;var A={};if(a.parentElement){a.parentElement.style.overflow="hidden"}c.utils.transform(a);switch(u.toUpperCase()){case c.utils.stretching.NONE:A.width=r;A.height=w;A.top=(x-A.height)/2;A.left=(b-A.width)/2;break;case c.utils.stretching.UNIFORM:if(z>y){A.width=r*y;A.height=w*y}else{A.width=r*z;A.height=w*z}A.top=(x-A.height)/2;A.left=(b-A.width)/2;break;case c.utils.stretching.FILL:if(z>y){A.width=r*z;A.height=w*z}else{A.width=r*y;A.height=w*y}A.top=(x-A.height)/2;A.left=(b-A.width)/2;break;case c.utils.stretching.EXACTFIT:A.width=r;A.height=w;var q=Math.round((r/2)*(1-1/z));var v=Math.round((w/2)*(1-1/y));c.utils.transform(a,z,y,q,v);A.top=A.left=0;break;default:break}c.utils.css(a,A)};c.utils.stretching={NONE:"NONE",FILL:"FILL",UNIFORM:"UNIFORM",EXACTFIT:"EXACTFIT"};c.utils.deepReplaceKeyName=function(a,k,m){switch(c.utils.typeOf(a)){case"array":for(var b=0;b<a.length;b++){a[b]=c.utils.deepReplaceKeyName(a[b],k,m)}break;case"object":for(var j in a){var l=j.replace(new RegExp(k,"g"),m);a[l]=c.utils.deepReplaceKeyName(a[j],k,m);if(j!=l){delete a[j]}}break}return a};c.utils.isInArray=function(a,b){if(!(a)||!(a instanceof Array)){return false}for(var f=0;f<a.length;f++){if(b===a[f]){return true}}return false};c.utils.exists=function(a){switch(typeof(a)){case"string":return(a.length>0);break;case"object":return(a!==null);case"undefined":return false}return true};c.utils.empty=function(a){if(typeof a.hasChildNodes=="function"){while(a.hasChildNodes()){a.removeChild(a.firstChild)}}};c.utils.parseDimension=function(a){if(typeof a=="string"){if(a===""){return 0}else{if(a.lastIndexOf("%")>-1){return a}else{return parseInt(a.replace("px",""),10)}}}return a};c.utils.getDimensions=function(a){if(a&&a.style){return{x:c.utils.parseDimension(a.style.left),y:c.utils.parseDimension(a.style.top),width:c.utils.parseDimension(a.style.width),height:c.utils.parseDimension(a.style.height)}}else{return{}}};c.utils.getElementWidth=function(a){if(!a){return null}else{if(a==document.body){return c.utils.parentNode(a).clientWidth}else{if(a.clientWidth>0){return a.clientWidth}else{if(a.style){return c.utils.parseDimension(a.style.width)}else{return null}}}}};c.utils.getElementHeight=function(a){if(!a){return null}else{if(a==document.body){return c.utils.parentNode(a).clientHeight}else{if(a.clientHeight>0){return a.clientHeight}else{if(a.style){return c.utils.parseDimension(a.style.height)}else{return null}}}}};c.utils.timeFormat=function(a){str="00:00";if(a>0){str=Math.floor(a/60)<10?"0"+Math.floor(a/60)+":":Math.floor(a/60)+":";str+=Math.floor(a%60)<10?"0"+Math.floor(a%60):Math.floor(a%60)}return str};c.utils.useNativeFullscreen=function(){return(navigator&&navigator.vendor&&navigator.vendor.indexOf("Apple")==0)};c.utils.parentNode=function(a){if(!a){return docuemnt.body}else{if(a.parentNode){return a.parentNode}else{if(a.parentElement){return a.parentElement}else{return a}}}};c.utils.getBoundingClientRect=function(a){if(typeof a.getBoundingClientRect=="function"){return a.getBoundingClientRect()}else{return{left:a.offsetLeft+document.body.scrollLeft,top:a.offsetTop+document.body.scrollTop,width:a.offsetWidth,height:a.offsetHeight}}}})(jwplayer);(function(b){b.events=function(){};b.events.COMPLETE="COMPLETE";b.events.ERROR="ERROR"})(jwplayer);(function(jwplayer){jwplayer.events.eventdispatcher=function(debug){var _debug=debug;var _listeners;var _globallisteners;this.resetEventListeners=function(){_listeners={};_globallisteners=[]};this.resetEventListeners();this.addEventListener=function(type,listener,count){try{if(!jwplayer.utils.exists(_listeners[type])){_listeners[type]=[]}if(typeof(listener)=="string"){eval("listener = "+listener)}_listeners[type].push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeEventListener=function(type,listener){if(!_listeners[type]){return}try{for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){if(_listeners[type][listenerIndex].listener.toString()==listener.toString()){_listeners[type].splice(listenerIndex,1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.addGlobalListener=function(listener,count){try{if(typeof(listener)=="string"){eval("listener = "+listener)}_globallisteners.push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeGlobalListener=function(listener){if(!_globallisteners[type]){return}try{for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){if(_globallisteners[globalListenerIndex].listener.toString()==listener.toString()){_globallisteners.splice(globalListenerIndex,1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.sendEvent=function(type,data){if(!jwplayer.utils.exists(data)){data={}}if(_debug){jwplayer.utils.log(type,data)}if(typeof _listeners[type]!="undefined"){for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){try{_listeners[type][listenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener: "+err.toString(),_listeners[type][listenerIndex].listener)}if(_listeners[type][listenerIndex]){if(_listeners[type][listenerIndex].count===1){delete _listeners[type][listenerIndex]}else{if(_listeners[type][listenerIndex].count>0){_listeners[type][listenerIndex].count=_listeners[type][listenerIndex].count-1}}}}}for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){try{_globallisteners[globalListenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener: "+err.toString(),_globallisteners[globalListenerIndex].listener)}if(_globallisteners[globalListenerIndex]){if(_globallisteners[globalListenerIndex].count===1){delete _globallisteners[globalListenerIndex]}else{if(_globallisteners[globalListenerIndex].count>0){_globallisteners[globalListenerIndex].count=_globallisteners[globalListenerIndex].count-1}}}}}}})(jwplayer);(function(d){var c={};d.utils.animations=function(){};d.utils.animations.transform=function(b,a){b.style.webkitTransform=a;b.style.MozTransform=a;b.style.OTransform=a;b.style.msTransform=a};d.utils.animations.transformOrigin=function(b,a){b.style.webkitTransformOrigin=a;b.style.MozTransformOrigin=a;b.style.OTransformOrigin=a;b.style.msTransformOrigin=a};d.utils.animations.rotate=function(b,a){d.utils.animations.transform(b,["rotate(",a,"deg)"].join(""))};d.utils.cancelAnimation=function(a){delete c[a.id]};d.utils.fadeTo=function(a,r,s,o,p,t){if(c[a.id]!=t&&d.utils.exists(t)){return}if(a.style.opacity==r){return}var u=new Date().getTime();if(t>u){setTimeout(function(){d.utils.fadeTo(a,r,s,o,0,t)},t-u)}if(a.style.display=="none"){a.style.display="block"}if(!d.utils.exists(o)){o=a.style.opacity===""?1:a.style.opacity}if(a.style.opacity==r&&a.style.opacity!==""&&d.utils.exists(t)){if(r===0){a.style.display="none"}return}if(!d.utils.exists(t)){t=u;c[a.id]=t}if(!d.utils.exists(p)){p=0}var n=(s>0)?((u-t)/(s*1000)):0;n=n>1?1:n;var b=r-o;var q=o+(n*b);if(q>1){q=1}else{if(q<0){q=0}}a.style.opacity=q;if(p>0){c[a.id]=t+p*1000;d.utils.fadeTo(a,r,s,o,0,c[a.id]);return}setTimeout(function(){d.utils.fadeTo(a,r,s,o,0,t)},10)}})(jwplayer);(function(b){b.utils.arrays=function(){};b.utils.arrays.indexOf=function(f,e){for(var a=0;a<f.length;a++){if(f[a]==e){return a}}return-1};b.utils.arrays.remove=function(f,e){var a=b.utils.arrays.indexOf(f,e);if(a>-1){f.splice(a,1)}}})(jwplayer);(function(b){b.utils.extensionmap={"3gp":{html5:"video/3gpp",flash:"video"},"3gpp":{html5:"video/3gpp"},"3g2":{html5:"video/3gpp2",flash:"video"},"3gpp2":{html5:"video/3gpp2"},flv:{flash:"video"},f4a:{html5:"audio/mp4"},f4b:{html5:"audio/mp4",flash:"video"},f4v:{html5:"video/mp4",flash:"video"},mov:{html5:"video/quicktime",flash:"video"},m4a:{html5:"audio/mp4",flash:"video"},m4b:{html5:"audio/mp4"},m4p:{html5:"audio/mp4"},m4v:{html5:"video/mp4",flash:"video"},mp4:{html5:"video/mp4",flash:"video"},rbs:{flash:"sound"},aac:{html5:"audio/aac",flash:"video"},mp3:{html5:"audio/mp3",flash:"sound"},ogg:{html5:"audio/ogg"},oga:{html5:"audio/ogg"},ogv:{html5:"video/ogg"},webm:{html5:"video/webm"},m3u8:{html5:"audio/x-mpegurl"},gif:{flash:"image"},jpeg:{flash:"image"},jpg:{flash:"image"},swf:{flash:"image"},png:{flash:"image"},wav:{html5:"audio/x-wav"}}})(jwplayer);(function(o){o.utils.mediaparser=function(){};var m={element:{width:"width",height:"height",id:"id","class":"className",name:"name"},media:{src:"file",preload:"preload",autoplay:"autostart",loop:"repeat",controls:"controls"},source:{src:"file",type:"type",media:"media","data-jw-width":"width","data-jw-bitrate":"bitrate"},video:{poster:"image"}};var n={};o.utils.mediaparser.parseMedia=function(a){return p(a)};function q(a,b){if(!o.utils.exists(b)){b=m[a]}else{o.utils.extend(b,m[a])}return b}function p(f,d){if(n[f.tagName.toLowerCase()]&&!o.utils.exists(d)){return n[f.tagName.toLowerCase()](f)}else{d=q("element",d);var e={};for(var c in d){if(c!="length"){var a=f.getAttribute(c);if(o.utils.exists(a)){e[d[c]]=a}}}var b=f.style["#background-color"];if(b&&!(b=="transparent"||b=="rgba(0, 0, 0, 0)")){e.screencolor=b}return e}}function l(f,c){c=q("media",c);var b=[];var d=o.utils.selectors("source",f);for(var a in d){if(!isNaN(a)){b.push(k(d[a]))}}var e=p(f,c);if(o.utils.exists(e.file)){b[0]={file:e.file}}e.levels=b;return e}function k(a,b){b=q("source",b);var c=p(a,b);c.width=c.width?c.width:0;c.bitrate=c.bitrate?c.bitrate:0;return c}function j(a,b){b=q("video",b);var c=l(a,b);return c}n.media=l;n.audio=l;n.source=k;n.video=j})(jwplayer);(function(b){b.utils.loaderstatus={NEW:"NEW",LOADING:"LOADING",ERROR:"ERROR",COMPLETE:"COMPLETE"};b.utils.scriptloader=function(f){var e=b.utils.loaderstatus.NEW;var a=new b.events.eventdispatcher();b.utils.extend(this,a);this.load=function(){if(e==b.utils.loaderstatus.NEW){e=b.utils.loaderstatus.LOADING;var c=document.createElement("script");c.onload=function(d){e=b.utils.loaderstatus.COMPLETE;a.sendEvent(b.events.COMPLETE)};c.onerror=function(d){e=b.utils.loaderstatus.ERROR;a.sendEvent(b.events.ERROR)};c.onreadystatechange=function(){if(c.readyState=="loaded"||c.readyState=="complete"){e=b.utils.loaderstatus.COMPLETE;a.sendEvent(b.events.COMPLETE)}};document.getElementsByTagName("head")[0].appendChild(c);c.src=f}};this.getStatus=function(){return e}}})(jwplayer);(function(b){b.utils.selectors=function(a,f){if(!b.utils.exists(f)){f=document}a=b.utils.strings.trim(a);var h=a.charAt(0);if(h=="#"){return f.getElementById(a.substr(1))}else{if(h=="."){if(f.getElementsByClassName){return f.getElementsByClassName(a.substr(1))}else{return b.utils.selectors.getElementsByTagAndClass("*",a.substr(1))}}else{if(a.indexOf(".")>0){var g=a.split(".");return b.utils.selectors.getElementsByTagAndClass(g[0],g[1])}else{return f.getElementsByTagName(a)}}}return null};b.utils.selectors.getElementsByTagAndClass=function(o,l,m){var k=[];if(!b.utils.exists(m)){m=document}var n=m.getElementsByTagName(o);for(var p=0;p<n.length;p++){if(b.utils.exists(n[p].className)){var q=n[p].className.split(" ");for(var a=0;a<q.length;a++){if(q[a]==l){k.push(n[p])}}}}return k}})(jwplayer);(function(b){b.utils.strings=function(){};b.utils.strings.trim=function(a){return a.replace(/^\s*/,"").replace(/\s*$/,"")};b.utils.strings.pad=function(f,e,a){if(!a){a="0"}while(f.length<e){f=a+f}return f};b.utils.strings.serialize=function(a){if(a==null){return null}else{if(a=="true"){return true}else{if(a=="false"){return false}else{if(isNaN(Number(a))||a.length>5||a.length==0){return a}else{return Number(a)}}}}};b.utils.strings.seconds=function(e){e=e.replace(",",".");var a=e.split(":");var f=0;if(e.substr(-1)=="s"){f=Number(e.substr(0,e.length-1))}else{if(e.substr(-1)=="m"){f=Number(e.substr(0,e.length-1))*60}else{if(e.substr(-1)=="h"){f=Number(e.substr(0,e.length-1))*3600}else{if(a.length>1){f=Number(a[a.length-1]);f+=Number(a[a.length-2])*60;if(a.length==3){f+=Number(a[a.length-3])*3600}}else{f=Number(e)}}}}return f};b.utils.strings.xmlAttribute=function(a,f){for(var e=0;e<a.attributes.length;e++){if(a.attributes[e].name&&a.attributes[e].name.toLowerCase()==f.toLowerCase()){return a.attributes[e].value.toString()}}return""};b.utils.strings.jsonToString=function(l){var j=j||{};if(j&&j.stringify){return j.stringify(l)}var o=typeof(l);if(o!="object"||l===null){if(o=="string"){l='"'+l.replace(/"/g,'\\"')+'"'}else{return String(l)}}else{var k=[],a=(l&&l.constructor==Array);for(var n in l){var m=l[n];switch(typeof(m)){case"string":m='"'+m.replace(/"/g,'\\"')+'"';break;case"object":if(b.utils.exists(m)){m=b.utils.strings.jsonToString(m)}break}if(a){if(typeof(m)!="function"){k.push(String(m))}}else{if(typeof(m)!="function"){k.push('"'+n+'":'+String(m))}}}if(a){return"["+String(k)+"]"}else{return"{"+String(k)+"}"}}}})(jwplayer);(function(k){var j=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);k.utils.typechecker=function(a,b){b=!k.utils.exists(b)?f(a):b;return h(a,b)};function f(b){var a=["true","false","t","f"];if(a.toString().indexOf(b.toLowerCase().replace(" ",""))>=0){return"boolean"}else{if(j.test(b)){return"color"}else{if(!isNaN(parseInt(b,10))&&parseInt(b,10).toString().length==b.length){return"integer"}else{if(!isNaN(parseFloat(b))&&parseFloat(b).toString().length==b.length){return"float"}}}}return"string"}function h(a,b){if(!k.utils.exists(b)){return a}switch(b){case"color":if(a.length>0){return g(a)}return null;case"integer":return parseInt(a,10);case"float":return parseFloat(a);case"boolean":if(a.toLowerCase()=="true"){return true}else{if(a=="1"){return true}}return false}return a}function g(a){switch(a.toLowerCase()){case"blue":return parseInt("0000FF",16);case"green":return parseInt("00FF00",16);case"red":return parseInt("FF0000",16);case"cyan":return parseInt("00FFFF",16);case"magenta":return parseInt("FF00FF",16);case"yellow":return parseInt("FFFF00",16);case"black":return parseInt("000000",16);case"white":return parseInt("FFFFFF",16);default:a=a.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(a.length==3){a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)}return parseInt(a,16)}return parseInt("000000",16)}})(jwplayer);(function(b){b.utils.parsers=function(){};b.utils.parsers.localName=function(a){if(!a){return""}else{if(a.localName){return a.localName}else{if(a.baseName){return a.baseName}else{return""}}}};b.utils.parsers.textContent=function(a){if(!a){return""}else{if(a.textContent){return a.textContent}else{if(a.text){return a.text}else{return""}}}}})(jwplayer);(function(b){b.utils.parsers.jwparser=function(){};b.utils.parsers.jwparser.PREFIX="jwplayer";b.utils.parsers.jwparser.parseEntry=function(f,e){for(var a=0;a<f.childNodes.length;a++){if(f.childNodes[a].prefix==b.utils.parsers.jwparser.PREFIX){e[b.utils.parsers.localName(f.childNodes[a])]=b.utils.strings.serialize(b.utils.parsers.textContent(f.childNodes[a]))}if(!e.file&&String(e.link).toLowerCase().indexOf("youtube")>-1){e.file=e.link}}return e};b.utils.parsers.jwparser.getProvider=function(d){if(d.type){return d.type}else{if(d.file.indexOf("youtube.com/w")>-1||d.file.indexOf("youtube.com/v")>-1||d.file.indexOf("youtu.be/")>-1){return"youtube"}else{if(d.streamer&&d.streamer.indexOf("rtmp")==0){return"rtmp"}else{if(d.streamer&&d.streamer.indexOf("http")==0){return"http"}else{var a=b.utils.strings.extension(d.file);if(extensions.hasOwnProperty(a)){return extensions[a]}}}}}return""}})(jwplayer);(function(b){b.utils.parsers.mediaparser=function(){};b.utils.parsers.mediaparser.PREFIX="media";b.utils.parsers.mediaparser.parseGroup=function(j,g){var h=false;for(var k=0;k<j.childNodes.length;k++){if(j.childNodes[k].prefix==b.utils.parsers.mediaparser.PREFIX){if(!b.utils.parsers.localName(j.childNodes[k])){continue}switch(b.utils.parsers.localName(j.childNodes[k]).toLowerCase()){case"content":if(!h){g.file=b.utils.strings.xmlAttribute(j.childNodes[k],"url")}if(b.utils.strings.xmlAttribute(j.childNodes[k],"duration")){g.duration=b.utils.strings.seconds(b.utils.strings.xmlAttribute(j.childNodes[k],"duration"))}if(b.utils.strings.xmlAttribute(j.childNodes[k],"start")){g.start=b.utils.strings.seconds(b.utils.strings.xmlAttribute(j.childNodes[k],"start"))}if(j.childNodes[k].childNodes&&j.childNodes[k].childNodes.length>0){g=b.utils.parsers.mediaparser.parseGroup(j.childNodes[k],g)}if(b.utils.strings.xmlAttribute(j.childNodes[k],"width")||b.utils.strings.xmlAttribute(j.childNodes[k],"bitrate")||b.utils.strings.xmlAttribute(j.childNodes[k],"url")){if(!g.levels){g.levels=[]}g.levels.push({width:b.utils.strings.xmlAttribute(j.childNodes[k],"width"),bitrate:b.utils.strings.xmlAttribute(j.childNodes[k],"bitrate"),file:b.utils.strings.xmlAttribute(j.childNodes[k],"url")})}break;case"title":g.title=b.utils.parsers.textContent(j.childNodes[k]);break;case"description":g.description=b.utils.parsers.textContent(j.childNodes[k]);break;case"keywords":g.tags=b.utils.parsers.textContent(j.childNodes[k]);break;case"thumbnail":g.image=b.utils.strings.xmlAttribute(j.childNodes[k],"url");break;case"credit":g.author=b.utils.parsers.textContent(j.childNodes[k]);break;case"player":var a=j.childNodes[k].url;if(a.indexOf("youtube.com")>=0||a.indexOf("youtu.be")>=0){h=true;g.file=b.utils.strings.xmlAttribute(j.childNodes[k],"url")}break;case"group":b.utils.parsers.mediaparser.parseGroup(j.childNodes[k],g);break}}}return g}})(jwplayer);(function(c){c.utils.parsers.rssparser=function(){};c.utils.parsers.rssparser.parse=function(a){var h=[];for(var b=0;b<a.childNodes.length;b++){if(c.utils.parsers.localName(a.childNodes[b]).toLowerCase()=="channel"){for(var g=0;g<a.childNodes[b].childNodes.length;g++){if(c.utils.parsers.localName(a.childNodes[b].childNodes[g]).toLowerCase()=="item"){h.push(d(a.childNodes[b].childNodes[g]))}}}}return h};function d(b){var a={};for(var f=0;f<b.childNodes.length;f++){if(!c.utils.parsers.localName(b.childNodes[f])){continue}switch(c.utils.parsers.localName(b.childNodes[f]).toLowerCase()){case"enclosure":a.file=c.utils.strings.xmlAttribute(b.childNodes[f],"url");break;case"title":a.title=c.utils.parsers.textContent(b.childNodes[f]);break;case"pubdate":a.date=c.utils.parsers.textContent(b.childNodes[f]);break;case"description":a.description=c.utils.parsers.textContent(b.childNodes[f]);break;case"link":a.link=c.utils.parsers.textContent(b.childNodes[f]);break;case"category":if(a.tags){a.tags+=c.utils.parsers.textContent(b.childNodes[f])}else{a.tags=c.utils.parsers.textContent(b.childNodes[f])}break}}a=c.utils.parsers.mediaparser.parseGroup(b,a);a=c.utils.parsers.jwparser.parseEntry(b,a);return new c.html5.playlistitem(a)}})(jwplayer);(function(e){var f={};var d={};e.plugins=function(){};e.plugins.loadPlugins=function(a,b){d[a]=new e.plugins.pluginloader(new e.plugins.model(f),b);return d[a]};e.plugins.registerPlugin=function(a,c,j){var k=e.utils.getPluginName(a);if(f[k]){f[k].registerPlugin(a,c,j)}else{e.utils.log("A plugin ("+a+") was registered with the player that was not loaded. Please check your configuration.");for(var b in d){d[b].pluginFailed()}}}})(jwplayer);(function(b){b.plugins.model=function(a){this.addPlugin=function(f){var e=b.utils.getPluginName(f);if(!a[e]){a[e]=new b.plugins.plugin(f)}return a[e]}}})(jwplayer);(function(b){b.plugins.pluginmodes={FLASH:"FLASH",JAVASCRIPT:"JAVASCRIPT",HYBRID:"HYBRID"};b.plugins.plugin=function(u){var s="http://lp.longtailvideo.com";var n=b.utils.loaderstatus.NEW;var m;var o;var a;var t=new b.events.eventdispatcher();b.utils.extend(this,t);function r(){switch(b.utils.getPluginPathType(u)){case b.utils.pluginPathType.ABSOLUTE:return u;case b.utils.pluginPathType.RELATIVE:return b.utils.getAbsolutePath(u,window.location.href);case b.utils.pluginPathType.CDN:var d=b.utils.getPluginName(u);var e=b.utils.getPluginVersion(u);var c=(window.location.href.indexOf("https://")==0)?s.replace("http://","https://secure"):s;return c+"/"+b.version.split(".")[0]+"/"+d+"/"+d+(e!==""?("-"+e):"")+".js"}}function p(c){a=setTimeout(function(){n=b.utils.loaderstatus.COMPLETE;t.sendEvent(b.events.COMPLETE)},1000)}function q(c){n=b.utils.loaderstatus.ERROR;t.sendEvent(b.events.ERROR)}this.load=function(){if(n==b.utils.loaderstatus.NEW){if(u.lastIndexOf(".swf")>0){m=u;n=b.utils.loaderstatus.COMPLETE;t.sendEvent(b.events.COMPLETE);return}n=b.utils.loaderstatus.LOADING;var c=new b.utils.scriptloader(r());c.addEventListener(b.events.COMPLETE,p);c.addEventListener(b.events.ERROR,q);c.load()}};this.registerPlugin=function(d,e,c){if(a){clearTimeout(a);a=undefined}if(e&&c){m=c;o=e}else{if(typeof e=="string"){m=e}else{if(typeof e=="function"){o=e}else{if(!e&&!c){m=d}}}}n=b.utils.loaderstatus.COMPLETE;t.sendEvent(b.events.COMPLETE)};this.getStatus=function(){return n};this.getPluginName=function(){return b.utils.getPluginName(u)};this.getFlashPath=function(){if(m){switch(b.utils.getPluginPathType(m)){case b.utils.pluginPathType.ABSOLUTE:return m;case b.utils.pluginPathType.RELATIVE:if(u.lastIndexOf(".swf")>0){return b.utils.getAbsolutePath(m,window.location.href)}return b.utils.getAbsolutePath(m,r());case b.utils.pluginPathType.CDN:if(m.indexOf("-")>-1){return m+"h"}return m+"-h"}}return null};this.getJS=function(){return o};this.getPluginmode=function(){if(typeof m!="undefined"&&typeof o!="undefined"){return b.plugins.pluginmodes.HYBRID}else{if(typeof m!="undefined"){return b.plugins.pluginmodes.FLASH}else{if(typeof o!="undefined"){return b.plugins.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(e,c,d){return new o(e,c,d)};this.getURL=function(){return u}}})(jwplayer);(function(b){b.plugins.pluginloader=function(m,p){var n={};var a=b.utils.loaderstatus.NEW;var q=false;var s=false;var r=new b.events.eventdispatcher();b.utils.extend(this,r);function o(){if(!s){s=true;a=b.utils.loaderstatus.COMPLETE;r.sendEvent(b.events.COMPLETE)}}function l(){if(!s){var c=0;for(plugin in n){var d=n[plugin].getStatus();if(d==b.utils.loaderstatus.LOADING||d==b.utils.loaderstatus.NEW){c++}}if(c==0){o()}}}this.setupPlugins=function(k,d,e){var c={length:0,plugins:{}};var h={length:0,plugins:{}};for(var j in n){var g=n[j].getPluginName();if(n[j].getFlashPath()){c.plugins[n[j].getFlashPath()]=d.plugins[j];c.plugins[n[j].getFlashPath()].pluginmode=n[j].getPluginmode();c.length++}if(n[j].getJS()){var f=document.createElement("div");f.id=k.id+"_"+g;f.style.position="absolute";f.style.zIndex=h.length+10;h.plugins[g]=n[j].getNewInstance(k,d.plugins[j],f);h.length++;if(typeof h.plugins[g].resize!="undefined"){k.onReady(e(h.plugins[g],f,true));k.onResize(e(h.plugins[g],f))}}}k.plugins=h.plugins;return c};this.load=function(){a=b.utils.loaderstatus.LOADING;q=true;for(var c in p){if(b.utils.exists(c)){n[c]=m.addPlugin(c);n[c].addEventListener(b.events.COMPLETE,l);n[c].addEventListener(b.events.ERROR,l)}}for(c in n){n[c].load()}q=false;l()};this.pluginFailed=function(){o()};this.getStatus=function(){return a}}})(jwplayer);(function(c){var d=[];c.api=function(E){this.container=E;this.id=E.id;var v={};var G={};var b={};var F=[];var A=undefined;var x=false;var z=[];var t=c.utils.getOuterHTML(E);var a={};var y={};this.getBuffer=function(){return this.callInternal("jwGetBuffer")};this.getContainer=function(){return this.container};function D(e,f){return function(k,j,h,g){if(e.renderingMode=="flash"||e.renderingMode=="html5"){var l;if(j){y[k]=j;l="jwplayer('"+e.id+"').callback('"+k+"')"}else{if(!j&&y[k]){delete y[k]}}A.jwDockSetButton(k,l,h,g)}return f}}this.getPlugin=function(g){var e=this;var f={};if(g=="dock"){return c.utils.extend(f,{setButton:D(e,f),show:function(){e.callInternal("jwDockShow");return f},hide:function(){e.callInternal("jwDockHide");return f},onShow:function(h){e.componentListener("dock",c.api.events.JWPLAYER_COMPONENT_SHOW,h);return f},onHide:function(h){e.componentListener("dock",c.api.events.JWPLAYER_COMPONENT_HIDE,h);return f}})}else{if(g=="controlbar"){return c.utils.extend(f,{show:function(){e.callInternal("jwControlbarShow");return f},hide:function(){e.callInternal("jwControlbarHide");return f},onShow:function(h){e.componentListener("controlbar",c.api.events.JWPLAYER_COMPONENT_SHOW,h);return f},onHide:function(h){e.componentListener("controlbar",c.api.events.JWPLAYER_COMPONENT_HIDE,h);return f}})}else{if(g=="display"){return c.utils.extend(f,{show:function(){e.callInternal("jwDisplayShow");return f},hide:function(){e.callInternal("jwDisplayHide");return f},onShow:function(h){e.componentListener("display",c.api.events.JWPLAYER_COMPONENT_SHOW,h);return f},onHide:function(h){e.componentListener("display",c.api.events.JWPLAYER_COMPONENT_HIDE,h);return f}})}else{return this.plugins[g]}}}};this.callback=function(e){if(y[e]){return y[e]()}};this.getDuration=function(){return this.callInternal("jwGetDuration")};this.getFullscreen=function(){return this.callInternal("jwGetFullscreen")};this.getHeight=function(){return this.callInternal("jwGetHeight")};this.getLockState=function(){return this.callInternal("jwGetLockState")};this.getMeta=function(){return this.getItemMeta()};this.getMute=function(){return this.callInternal("jwGetMute")};this.getPlaylist=function(){var e=this.callInternal("jwGetPlaylist");if(this.renderingMode=="flash"){c.utils.deepReplaceKeyName(e,"__dot__",".")}for(var f=0;f<e.length;f++){if(!c.utils.exists(e[f].index)){e[f].index=f}}return e};this.getPlaylistItem=function(e){if(!c.utils.exists(e)){e=this.getCurrentItem()}return this.getPlaylist()[e]};this.getPosition=function(){return this.callInternal("jwGetPosition")};this.getRenderingMode=function(){return this.renderingMode};this.getState=function(){return this.callInternal("jwGetState")};this.getVolume=function(){return this.callInternal("jwGetVolume")};this.getWidth=function(){return this.callInternal("jwGetWidth")};this.setFullscreen=function(e){if(!c.utils.exists(e)){this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen"))}else{this.callInternal("jwSetFullscreen",e)}return this};this.setMute=function(e){if(!c.utils.exists(e)){this.callInternal("jwSetMute",!this.callInternal("jwGetMute"))}else{this.callInternal("jwSetMute",e)}return this};this.lock=function(){return this};this.unlock=function(){return this};this.load=function(e){this.callInternal("jwLoad",e);return this};this.playlistItem=function(e){this.callInternal("jwPlaylistItem",e);return this};this.playlistPrev=function(){this.callInternal("jwPlaylistPrev");return this};this.playlistNext=function(){this.callInternal("jwPlaylistNext");return this};this.resize=function(f,g){if(this.renderingMode=="html5"){A.jwResize(f,g)}else{this.container.width=f;this.container.height=g;var e=document.getElementById(this.id+"_wrapper");if(e){e.style.width=f+"px";e.style.height=g+"px"}}return this};this.play=function(e){if(typeof e=="undefined"){e=this.getState();if(e==c.api.events.state.PLAYING||e==c.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPlay",e)}return this};this.pause=function(e){if(typeof e=="undefined"){e=this.getState();if(e==c.api.events.state.PLAYING||e==c.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPause",e)}return this};this.stop=function(){this.callInternal("jwStop");return this};this.seek=function(e){this.callInternal("jwSeek",e);return this};this.setVolume=function(e){this.callInternal("jwSetVolume",e);return this};this.onBufferChange=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_BUFFER,e)};this.onBufferFull=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_BUFFER_FULL,e)};this.onError=function(e){return this.eventListener(c.api.events.JWPLAYER_ERROR,e)};this.onFullscreen=function(e){return this.eventListener(c.api.events.JWPLAYER_FULLSCREEN,e)};this.onMeta=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_META,e)};this.onMute=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_MUTE,e)};this.onPlaylist=function(e){return this.eventListener(c.api.events.JWPLAYER_PLAYLIST_LOADED,e)};this.onPlaylistItem=function(e){return this.eventListener(c.api.events.JWPLAYER_PLAYLIST_ITEM,e)};this.onReady=function(e){return this.eventListener(c.api.events.API_READY,e)};this.onResize=function(e){return this.eventListener(c.api.events.JWPLAYER_RESIZE,e)};this.onComplete=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_COMPLETE,e)};this.onSeek=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_SEEK,e)};this.onTime=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_TIME,e)};this.onVolume=function(e){return this.eventListener(c.api.events.JWPLAYER_MEDIA_VOLUME,e)};this.onBuffer=function(e){return this.stateListener(c.api.events.state.BUFFERING,e)};this.onPause=function(e){return this.stateListener(c.api.events.state.PAUSED,e)};this.onPlay=function(e){return this.stateListener(c.api.events.state.PLAYING,e)};this.onIdle=function(e){return this.stateListener(c.api.events.state.IDLE,e)};this.remove=function(){v={};z=[];if(c.utils.getOuterHTML(this.container)!=t){c.api.destroyPlayer(this.id,t)}};this.setup=function(f){if(c.embed){var g=this.id;this.remove();var e=c(g);e.config=f;return new c.embed(e)}return this};this.registerPlugin=function(e,f,g){c.plugins.registerPlugin(e,f,g)};this.setPlayer=function(f,e){A=f;this.renderingMode=e};this.stateListener=function(f,e){if(!G[f]){G[f]=[];this.eventListener(c.api.events.JWPLAYER_PLAYER_STATE,B(f))}G[f].push(e);return this};this.detachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwDetachMedia")}};this.attachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwAttachMedia")}};function B(e){return function(h){var j=h.newstate,f=h.oldstate;if(j==e){var g=G[j];if(g){for(var k=0;k<g.length;k++){if(typeof g[k]=="function"){g[k].call(this,{oldstate:f,newstate:j})}}}}}}this.componentListener=function(g,f,e){if(!b[g]){b[g]={}}if(!b[g][f]){b[g][f]=[];this.eventListener(f,w(g,f))}b[g][f].push(e);return this};function w(f,e){return function(h){if(f==h.component){var j=b[f][e];if(j){for(var g=0;g<j.length;g++){if(typeof j[g]=="function"){j[g].call(this,h)}}}}}}this.addInternalListener=function(f,e){f.jwAddEventListener(e,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+e+'", dat); }')};this.eventListener=function(f,e){if(!v[f]){v[f]=[];if(A&&x){this.addInternalListener(A,f)}}v[f].push(e);return this};this.dispatchEvent=function(e){if(v[e]){var f=C(e,arguments[1]);for(var g=0;g<v[e].length;g++){if(typeof v[e][g]=="function"){v[e][g].call(this,f)}}}};function C(g,j){var e=c.utils.extend({},j);if(g==c.api.events.JWPLAYER_FULLSCREEN&&!e.fullscreen){e.fullscreen=e.message=="true"?true:false;delete e.message}else{if(typeof e.data=="object"){e=c.utils.extend(e,e.data);delete e.data}}var h=["position","duration","offset"];for(var f in h){if(e[h[f]]){e[h[f]]=Math.round(e[h[f]]*1000)/1000}}return e}this.callInternal=function(e,f){if(x){if(typeof A!="undefined"&&typeof A[e]=="function"){if(c.utils.exists(f)){return(A[e])(f)}else{return(A[e])()}}return null}else{z.push({method:e,parameters:f})}};this.playerReady=function(e){x=true;if(!A){this.setPlayer(document.getElementById(e.id))}this.container=document.getElementById(this.id);for(var g in v){this.addInternalListener(A,g)}this.eventListener(c.api.events.JWPLAYER_PLAYLIST_ITEM,function(h){a={}});this.eventListener(c.api.events.JWPLAYER_MEDIA_META,function(h){c.utils.extend(a,h.metadata)});this.dispatchEvent(c.api.events.API_READY);while(z.length>0){var f=z.shift();this.callInternal(f.method,f.parameters)}};this.getItemMeta=function(){return a};this.getCurrentItem=function(){return this.callInternal("jwGetPlaylistIndex")};function u(g,e,f){var j=[];if(!e){e=0}if(!f){f=g.length-1}for(var h=e;h<=f;h++){j.push(g[h])}return j}return this};c.api.selectPlayer=function(b){var f;if(!c.utils.exists(b)){b=0}if(b.nodeType){f=b}else{if(typeof b=="string"){f=document.getElementById(b)}}if(f){var a=c.api.playerById(f.id);if(a){return a}else{return c.api.addPlayer(new c.api(f))}}else{if(typeof b=="number"){return c.getPlayers()[b]}}return null};c.api.events={API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem"};c.api.events.state={BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"};c.api.playerById=function(a){for(var b=0;b<d.length;b++){if(d[b].id==a){return d[b]}}return null};c.api.addPlayer=function(b){for(var a=0;a<d.length;a++){if(d[a]==b){return b}}d.push(b);return b};c.api.destroyPlayer=function(k,n){var l=-1;for(var a=0;a<d.length;a++){if(d[a].id==k){l=a;continue}}if(l>=0){var o=document.getElementById(d[l].id);if(document.getElementById(d[l].id+"_wrapper")){o=document.getElementById(d[l].id+"_wrapper")}if(o){if(n){c.utils.setOuterHTML(o,n)}else{var b=document.createElement("div");var m=o.id;if(o.id.indexOf("_wrapper")==o.id.length-8){newID=o.id.substring(0,o.id.length-8)}b.setAttribute("id",m);o.parentNode.replaceChild(b,o)}}d.splice(l,1)}return null};c.getPlayers=function(){return d.slice(0)}})(jwplayer);var _userPlayerReady=(typeof playerReady=="function")?playerReady:undefined;playerReady=function(c){var d=jwplayer.api.playerById(c.id);if(d){d.playerReady(c)}else{jwplayer.api.selectPlayer(c.id).playerReady(c)}if(_userPlayerReady){_userPlayerReady.call(this,c)}};(function(e){var f=e.utils;e.embed=function(c){var a={width:400,height:300,components:{controlbar:{position:"over"}}};var l=f.mediaparser.parseMedia(c.container);var m=new e.embed.config(f.extend(a,l,c.config),this);var b=e.plugins.loadPlugins(c.id,m.plugins);function o(j,g){for(var h in g){if(typeof j[h]=="function"){(j[h]).call(j,g[h])}}}function n(){if(b.getStatus()==f.loaderstatus.COMPLETE){for(var u=0;u<m.modes.length;u++){if(m.modes[u].type&&e.embed[m.modes[u].type]){var j=m.modes[u].config;var x=m;if(j){x=f.extend(f.clone(m),j);var y=["file","levels","playlist"];for(var v=0;v<y.length;v++){var h=y[v];if(f.exists(j[h])){for(var w=0;w<y.length;w++){if(w!=v){var k=y[w];if(f.exists(x[k])&&!f.exists(j[k])){delete x[k]}}}}}}var g=new e.embed[m.modes[u].type](document.getElementById(c.id),m.modes[u],x,b,c);if(g.supportsConfig()){g.embed();o(c,m.events);return c}}}f.log("No suitable players found");new e.embed.logo(f.extend({hide:true},m.components.logo),"none",c.id)}}b.addEventListener(e.events.COMPLETE,n);b.addEventListener(e.events.ERROR,n);b.load();return c};function d(){if(!document.body){return setTimeout(d,15)}var c=f.selectors.getElementsByTagAndClass("video","jwplayer");for(var b=0;b<c.length;b++){var a=c[b];if(a.id==""){a.id="jwplayer_"+Math.round(Math.random()*100000)}e(a.id).setup({})}}d()})(jwplayer);(function(o){function l(){return[{type:"flash",src:"/jwplayer/player.swf"},{type:"html5"},{type:"download"}]}var s={players:"modes",autoplay:"autostart"};function r(d){var a=d.toLowerCase();var b=["left","right","top","bottom"];for(var c=0;c<b.length;c++){if(a==b[c]){return true}}return false}function q(a){var b=false;b=(a instanceof Array)||(typeof a=="object"&&!a.position&&!a.size);return b}function k(a){if(typeof a=="string"){if(parseInt(a).toString()==a||a.toLowerCase().indexOf("px")>-1){return parseInt(a)}}return a}var m=["playlist","dock","controlbar","logo","display"];function n(c){var e={};switch(o.utils.typeOf(c.plugins)){case"object":for(var a in c.plugins){e[o.utils.getPluginName(a)]=a}break;case"string":var d=c.plugins.split(",");for(var b=0;b<d.length;b++){e[o.utils.getPluginName(d[b])]=d[b]}break}return e}function p(e,f,a,c){if(o.utils.typeOf(e[f])!="object"){e[f]={}}var b=e[f][a];if(o.utils.typeOf(b)!="object"){e[f][a]=b={}}if(c){if(f=="plugins"){var d=o.utils.getPluginName(a);b[c]=e[d+"."+c];delete e[d+"."+c]}else{b[c]=e[a+"."+c];delete e[a+"."+c]}}}o.embed.deserialize=function(b){var a=n(b);for(var c in a){p(b,"plugins",a[c])}for(var d in b){if(d.indexOf(".")>-1){var e=d.split(".");var f=e[0];var d=e[1];if(o.utils.isInArray(m,f)){p(b,"components",f,d)}else{if(a[f]){p(b,"plugins",a[f],d)}}}}return b};o.embed.config=function(h,j){var v=o.utils.extend({},h);var a;if(q(v.playlist)){a=v.playlist;delete v.playlist}v=o.embed.deserialize(v);v.height=k(v.height);v.width=k(v.width);if(typeof v.plugins=="string"){var g=v.plugins.split(",");if(typeof v.plugins!="object"){v.plugins={}}for(var c=0;c<g.length;c++){var b=o.utils.getPluginName(g[c]);if(typeof v[b]=="object"){v.plugins[g[c]]=v[b];delete v[b]}else{v.plugins[g[c]]={}}}}for(var w=0;w<m.length;w++){var d=m[w];if(o.utils.exists(v[d])){if(typeof v[d]!="object"){if(!v.components[d]){v.components[d]={}}if(d=="logo"){v.components[d].file=v[d]}else{v.components[d].position=v[d]}delete v[d]}else{if(!v.components[d]){v.components[d]={}}o.utils.extend(v.components[d],v[d]);delete v[d]}}if(typeof v[d+"size"]!="undefined"){if(!v.components[d]){v.components[d]={}}v.components[d].size=v[d+"size"];delete v[d+"size"]}}if(typeof v.icons!="undefined"){if(!v.components.display){v.components.display={}}v.components.display.icons=v.icons;delete v.icons}for(var e in s){if(v[e]){if(!v[s[e]]){v[s[e]]=v[e]}delete v[e]}}var f;if(v.flashplayer&&!v.modes){f=l();f[0].src=v.flashplayer;delete v.flashplayer}else{if(v.modes){if(typeof v.modes=="string"){f=l();f[0].src=v.modes}else{if(v.modes instanceof Array){f=v.modes}else{if(typeof v.modes=="object"&&v.modes.type){f=[v.modes]}}}delete v.modes}else{f=l()}}v.modes=f;if(a){v.playlist=a}return v}})(jwplayer);(function(b){b.embed.download=function(m,h,a,l,j){this.embed=function(){var x=b.utils.extend({},a);var d={};var y=a.width?a.width:480;if(typeof y!="number"){y=parseInt(y,10)}var v=a.height?a.height:320;if(typeof v!="number"){v=parseInt(v,10)}var A,f,g;var C={};if(a.playlist&&a.playlist.length){C.file=a.playlist[0].file;f=a.playlist[0].image;C.levels=a.playlist[0].levels}else{C.file=a.file;f=a.image;C.levels=a.levels}if(C.file){A=C.file}else{if(C.levels&&C.levels.length){A=C.levels[0].file}}g=A?"pointer":"auto";var w={display:{style:{cursor:g,width:y,height:v,backgroundColor:"#000",position:"relative",textDecoration:"none",border:"none",display:"block"}},display_icon:{style:{cursor:g,position:"absolute",display:A?"block":"none",top:0,left:0,border:0,margin:0,padding:0,zIndex:3,width:50,height:50,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"}},display_iconBackground:{style:{cursor:g,position:"absolute",display:A?"block":"none",top:((v-50)/2),left:((y-50)/2),border:0,width:50,height:50,margin:0,padding:0,zIndex:2,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"}},display_image:{style:{width:y,height:v,display:f?"block":"none",position:"absolute",cursor:g,left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1,border:"none"}}};var z=function(p,n,q){var o=document.createElement(p);if(q){o.id=q}else{o.id=m.id+"_jwplayer_"+n}b.utils.css(o,w[n].style);return o};d.display=z("a","display",m.id);if(A){d.display.setAttribute("href",b.utils.getAbsolutePath(A))}d.display_image=z("img","display_image");d.display_image.setAttribute("alt","Click to download...");if(f){d.display_image.setAttribute("src",b.utils.getAbsolutePath(f))}if(true){d.display_icon=z("div","display_icon");d.display_iconBackground=z("div","display_iconBackground");d.display.appendChild(d.display_image);d.display_iconBackground.appendChild(d.display_icon);d.display.appendChild(d.display_iconBackground)}_css=b.utils.css;_hide=function(n){_css(n,{display:"none"})};function c(n){_imageWidth=d.display_image.naturalWidth;_imageHeight=d.display_image.naturalHeight;B()}function B(){b.utils.stretch(b.utils.stretching.UNIFORM,d.display_image,y,v,_imageWidth,_imageHeight)}d.display_image.onerror=function(n){_hide(d.display_image)};d.display_image.onload=c;m.parentNode.replaceChild(d.display,m);var e=(a.plugins&&a.plugins.logo)?a.plugins.logo:{};d.display.appendChild(new b.embed.logo(a.components.logo,"download",m.id));j.container=document.getElementById(j.id);j.setPlayer(d.display,"download")};this.supportsConfig=function(){if(a){var c=b.utils.getFirstPlaylistItemFromConfig(a);if(typeof c.file=="undefined"&&typeof c.levels=="undefined"){return true}else{if(c.file){return k(c.file,c.provider,c.playlistfile)}else{if(c.levels&&c.levels.length){for(var d=0;d<c.levels.length;d++){if(c.levels[d].file&&k(c.levels[d].file,c.provider,c.playlistfile)){return true}}}}}}else{return true}};function k(f,d,g){if(g){return false}var e=["image","sound","youtube","http"];if(d&&(e.toString().indexOf(d)>-1)){return true}if(!d||(d&&d=="video")){var c=b.utils.extension(f);if(c&&b.utils.extensionmap[c]){return true}}return false}}})(jwplayer);(function(b){b.embed.flash=function(s,r,n,t,p){function a(e,f,d){var c=document.createElement("param");c.setAttribute("name",f);c.setAttribute("value",d);e.appendChild(c)}function o(d,c,e){return function(h){if(e){document.getElementById(p.id+"_wrapper").appendChild(c)}var f=document.getElementById(p.id).getPluginConfig("display");d.resize(f.width,f.height);var g={left:f.x,top:f.y};b.utils.css(c,g)}}function u(e){if(!e){return{}}var c={};for(var f in e){var g=e[f];for(var d in g){c[f+"."+d]=g[d]}}return c}function q(e,f){if(e[f]){var c=e[f];for(var g in c){var h=c[g];if(typeof h=="string"){if(!e[g]){e[g]=h}}else{for(var d in h){if(!e[g+"."+d]){e[g+"."+d]=h[d]}}}}delete e[f]}}function w(f){if(!f){return{}}var c={},d=[];for(var j in f){var g=b.utils.getPluginName(j);var h=f[j];d.push(j);for(var e in h){c[g+"."+e]=h[e]}}c.plugins=d.join(",");return c}function v(c){var e=c.netstreambasepath?"":"netstreambasepath="+encodeURIComponent(window.location.href.split("#")[0])+"&";for(var d in c){if(typeof(c[d])=="object"){e+=d+"="+encodeURIComponent("[[JSON]]"+b.utils.strings.jsonToString(c[d]))+"&"}else{e+=d+"="+encodeURIComponent(c[d])+"&"}}return e.substring(0,e.length-1)}this.embed=function(){n.id=p.id;var h;var d=b.utils.extend({},n);var g=d.width;var k=d.height;if(s.id+"_wrapper"==s.parentNode.id){h=document.getElementById(s.id+"_wrapper")}else{h=document.createElement("div");h.id=s.id+"_wrapper";b.utils.wrap(s,h);b.utils.css(h,{position:"relative",width:g,height:k})}var f=t.setupPlugins(p,d,o);if(f.length>0){b.utils.extend(d,w(f.plugins))}else{delete d.plugins}var c=["height","width","modes","events"];for(var m=0;m<c.length;m++){delete d[c[m]]}var e="opaque";if(d.wmode){e=d.wmode}q(d,"components");q(d,"providers");if(typeof d["dock.position"]!="undefined"){if(d["dock.position"].toString().toLowerCase()=="false"){d.dock=d["dock.position"];delete d["dock.position"]}}var j="#000000";var z;if(b.utils.isIE()){var l='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+j+'" width="100%" height="100%" id="'+s.id+'" name="'+s.id+'" tabindex=0"">';l+='<param name="movie" value="'+r.src+'">';l+='<param name="allowfullscreen" value="true">';l+='<param name="allowscriptaccess" value="always">';l+='<param name="seamlesstabbing" value="true">';l+='<param name="wmode" value="'+e+'">';l+='<param name="flashvars" value="'+v(d)+'">';l+="</object>";b.utils.setOuterHTML(s,l);z=document.getElementById(s.id)}else{var A=document.createElement("object");A.setAttribute("type","application/x-shockwave-flash");A.setAttribute("data",r.src);A.setAttribute("width","100%");A.setAttribute("height","100%");A.setAttribute("bgcolor","#000000");A.setAttribute("id",s.id);A.setAttribute("name",s.id);A.setAttribute("tabindex",0);a(A,"allowfullscreen","true");a(A,"allowscriptaccess","always");a(A,"seamlesstabbing","true");a(A,"wmode",e);a(A,"flashvars",v(d));s.parentNode.replaceChild(A,s);z=A}p.container=z;p.setPlayer(z,"flash")};this.supportsConfig=function(){if(b.utils.hasFlash()){if(n){var c=b.utils.getFirstPlaylistItemFromConfig(n);if(typeof c.file=="undefined"&&typeof c.levels=="undefined"){return true}else{if(c.file){return flashCanPlay(c.file,c.provider)}else{if(c.levels&&c.levels.length){for(var d=0;d<c.levels.length;d++){if(c.levels[d].file&&flashCanPlay(c.levels[d].file,c.provider)){return true}}}}}}else{return true}}return false};flashCanPlay=function(f,d){var e=["video","http","sound","image"];if(d&&(e.toString().indexOf(d<0))){return true}var c=b.utils.extension(f);if(!c){return true}if(b.utils.exists(b.utils.extensionmap[c])&&!b.utils.exists(b.utils.extensionmap[c].flash)){return false}return true}}})(jwplayer);(function(b){b.embed.html5=function(m,h,a,l,j){function k(d,c,e){return function(g){var f=document.getElementById(m.id+"_displayarea");if(e){f.appendChild(c)}d.resize(f.clientWidth,f.clientHeight);c.left=f.style.left;c.top=f.style.top}}this.embed=function(){if(b.html5){l.setupPlugins(j,a,k);m.innerHTML="";var e=b.utils.extend({screencolor:"0x000000"},a);var f=["plugins","modes","events"];for(var d=0;d<f.length;d++){delete e[f[d]]}if(e.levels&&!e.sources){e.sources=a.levels}if(e.skin&&e.skin.toLowerCase().indexOf(".zip")>0){e.skin=e.skin.replace(/\.zip/i,".xml")}var c=new(b.html5(m)).setup(e);j.container=document.getElementById(j.id);j.setPlayer(c,"html5")}else{return null}};this.supportsConfig=function(){if(!!b.vid.canPlayType){if(a){var c=b.utils.getFirstPlaylistItemFromConfig(a);if(typeof c.file=="undefined"&&typeof c.levels=="undefined"){return true}else{if(c.file){return html5CanPlay(b.vid,c.file,c.provider,c.playlistfile)}else{if(c.levels&&c.levels.length){for(var d=0;d<c.levels.length;d++){if(c.levels[d].file&&html5CanPlay(b.vid,c.levels[d].file,c.provider,c.playlistfile)){return true}}}}}}else{return true}}return false};html5CanPlay=function(e,f,d,g){if(g){return false}if(d&&d=="youtube"){return true}if(d&&d!="video"&&d!="http"&&d!="sound"){return false}var c=b.utils.extension(f);if(!b.utils.exists(c)||!b.utils.exists(b.utils.extensionmap[c])){return true}if(!b.utils.exists(b.utils.extensionmap[c].html5)){return false}if(b.utils.isLegacyAndroid()&&c.match(/m4v|mp4/)){return true}return browserCanPlay(e,b.utils.extensionmap[c].html5)};browserCanPlay=function(c,d){if(!d){return true}if(c.canPlayType(d)){return true}else{if(d=="audio/mp3"&&navigator.userAgent.match(/safari/i)){return c.canPlayType("audio/mpeg")}else{return false}}}}})(jwplayer);(function(b){b.embed.logo=function(s,t,A){var v={prefix:"http://l.longtailvideo.com/"+t+"/",file:"",link:"",margin:8,out:0.5,over:1,timeout:5,hide:false,position:"bottom-left"};_css=b.utils.css;var C;var w;u();function u(){q();B();y()}function q(){if(v.prefix){var c=b.version.split(/\W/).splice(0,2).join("/");if(v.prefix.indexOf(c)<0){v.prefix+=c+"/"}}w=b.utils.extend({},v,s)}function a(){var c={border:"none",textDecoration:"none",position:"absolute",cursor:"pointer",zIndex:10};c.display=w.hide?"none":"block";var d=w.position.toLowerCase().split("-");for(var e in d){c[d[e]]=w.margin}return c}function B(){C=document.createElement("img");C.id=A+"_jwplayer_logo";C.style.display="none";C.onload=function(c){_css(C,a());z()};if(!w.file){return}if(w.file.indexOf("http://")===0){C.src=w.file}else{C.src=w.prefix+w.file}}if(!w.file){return}function y(){if(w.link){C.onmouseover=x;C.onmouseout=z;C.onclick=r}else{this.mouseEnabled=false}}function r(c){if(typeof c!="undefined"){c.preventDefault();c.stopPropagation()}if(w.link){window.open(w.link,"_blank")}return}function z(c){if(w.link){C.style.opacity=w.out}return}function x(c){if(w.hide){C.style.opacity=w.over}return}return C}})(jwplayer);(function(b){b.html5=function(a){var d=a;this.setup=function(c){b.utils.extend(this,new b.html5.api(d,c));return this};return this}})(jwplayer);(function(e){var f=e.utils;var d=f.css;e.html5.view=function(R,T,ah){var J=R;var aa=T;var b=ah;var c;var ag;var L;var P;var I;var X;var O;var V=false;var U,Y;function W(){c=document.createElement("div");c.id=aa.id;c.className=aa.className;_videowrapper=document.createElement("div");_videowrapper.id=c.id+"_video_wrapper";aa.id=c.id+"_video";d(c,{position:"relative",height:b.height,width:b.width,padding:0,backgroundColor:g(),zIndex:0});function g(){if(J.skin.getComponentSettings("display")&&J.skin.getComponentSettings("display").backgroundcolor){return J.skin.getComponentSettings("display").backgroundcolor}return parseInt("000000",16)}d(aa,{width:"100%",height:"100%",top:0,left:0,zIndex:1,margin:"auto",display:"block"});d(_videowrapper,{overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0});f.wrap(aa,c);f.wrap(aa,_videowrapper);P=document.createElement("div");P.id=c.id+"_displayarea";c.appendChild(P)}function ad(){for(var h=0;h<b.plugins.order.length;h++){var g=b.plugins.order[h];if(f.exists(b.plugins.object[g].getDisplayElement)){b.plugins.object[g].height=f.parseDimension(b.plugins.object[g].getDisplayElement().style.height);b.plugins.object[g].width=f.parseDimension(b.plugins.object[g].getDisplayElement().style.width);b.plugins.config[g].currentPosition=b.plugins.config[g].position}}K()}function ab(g){d(P,{display:(b.getMedia()&&b.getMedia().hasChrome()&&g.newstate!=e.api.events.state.IDLE)?"none":"block"})}function K(j){var g=b.getMedia()?b.getMedia().getDisplayElement():null;if(f.exists(g)){if(O!=g){if(O&&O.parentNode){O.parentNode.replaceChild(g,O)}O=g}for(var k=0;k<b.plugins.order.length;k++){var h=b.plugins.order[k];if(f.exists(b.plugins.object[h].getDisplayElement)){b.plugins.config[h].currentPosition=b.plugins.config[h].position}}}ae(b.width,b.height)}this.setup=function(){if(b&&b.getMedia()){aa=b.getMedia().getDisplayElement()}W();ad();J.jwAddEventListener(e.api.events.JWPLAYER_PLAYER_STATE,ab);J.jwAddEventListener(e.api.events.JWPLAYER_MEDIA_LOADED,K);J.jwAddEventListener(e.api.events.JWPLAYER_MEDIA_META,function(){a()});var g;if(f.exists(window.onresize)){g=window.onresize}window.onresize=function(k){if(f.exists(g)){try{g(k)}catch(h){}}if(J.jwGetFullscreen()){if(!S()){var j=f.getBoundingClientRect(document.body);b.width=Math.abs(j.left)+Math.abs(j.right);b.height=window.innerHeight;ae(b.width,b.height)}}else{ae(b.width,b.height)}}};function af(g){switch(g.keyCode){case 27:if(J.jwGetFullscreen()){J.jwSetFullscreen(false)}break;case 32:if(J.jwGetState()!=e.api.events.state.IDLE&&J.jwGetState()!=e.api.events.state.PAUSED){J.jwPause()}else{J.jwPlay()}break}}function ae(g,k){if(c.style.display=="none"){return}var h=[].concat(b.plugins.order);h.reverse();I=h.length+2;if(S()){try{if(b.fullscreen&&!b.getMedia().getDisplayElement().webkitDisplayingFullscreen){b.fullscreen=false}}catch(m){}}if(!b.fullscreen){ag=g;L=k;if(typeof g=="string"&&g.indexOf("%")>0){ag=f.getElementWidth(f.parentNode(c))*parseInt(g.replace("%"),"")/100}else{ag=g}if(typeof k=="string"&&k.indexOf("%")>0){L=f.getElementHeight(f.parentNode(c))*parseInt(k.replace("%"),"")/100}else{L=k}d(P,{top:0,bottom:0,left:0,right:0,width:ag,height:L,position:"absolute"});d(c,{height:L,width:ag});var j=Z(N,h);if(j.length>0){I+=j.length;var l=j.indexOf("playlist"),n=j.indexOf("controlbar");if(l>=0&&n>=0){j[l]=j.splice(n,1,j[l])[0]}Z(ac,j,true)}U=f.getElementWidth(P);Y=f.getElementHeight(P)}else{if(!S()){Z(M,h,true)}}a()}function Z(h,m,l){var k=[];for(var n=0;n<m.length;n++){var j=m[n];if(f.exists(b.plugins.object[j].getDisplayElement)){if(b.plugins.config[j].currentPosition!=e.html5.view.positions.NONE){var p=h(j,I--);if(!p){k.push(j)}else{var o=p.width;var g=p.height;if(l){delete p.width;delete p.height}d(b.plugins.object[j].getDisplayElement(),p);b.plugins.object[j].resize(o,g)}}else{d(b.plugins.object[j].getDisplayElement(),{display:"none"})}}}return k}function N(h,g){if(f.exists(b.plugins.object[h].getDisplayElement)){if(b.plugins.config[h].position&&Q(b.plugins.config[h].position)){if(!f.exists(b.plugins.object[h].getDisplayElement().parentNode)){c.appendChild(b.plugins.object[h].getDisplayElement())}var j=ai(h);j.zIndex=g;return j}}return false}function ac(h,g){if(!f.exists(b.plugins.object[h].getDisplayElement().parentNode)){P.appendChild(b.plugins.object[h].getDisplayElement())}return{position:"absolute",width:(f.getElementWidth(P)-f.parseDimension(P.style.left)-f.parseDimension(P.style.right)),height:(f.getElementHeight(P)-f.parseDimension(P.style.top)-f.parseDimension(P.style.bottom)),zIndex:g}}function M(h,g){return{position:"fixed",width:b.width,height:b.height,zIndex:g}}function a(){if(!f.exists(b.getMedia())){return}P.style.position="absolute";var g=b.getMedia().getDisplayElement();if(g&&g.tagName.toLowerCase()=="video"){g.style.position="absolute";if(g.parentNode){g.parentNode.style.left=P.style.left;g.parentNode.style.top=P.style.top}if(b.fullscreen&&J.jwGetStretching()==e.utils.stretching.EXACTFIT&&!f.isMobile()){var j=document.createElement("div");f.stretch(e.utils.stretching.UNIFORM,j,f.getElementWidth(P),f.getElementHeight(P),U,Y);f.stretch(e.utils.stretching.EXACTFIT,g,f.parseDimension(j.style.width),f.parseDimension(j.style.height),g.videoWidth?g.videoWidth:400,g.videoHeight?g.videoHeight:300);d(g,{left:j.style.left,top:j.style.top})}else{f.stretch(J.jwGetStretching(),g,f.getElementWidth(P),f.getElementHeight(P),g.videoWidth?g.videoWidth:400,g.videoHeight?g.videoHeight:300)}}else{var h=b.plugins.object.display.getDisplayElement();if(h){b.getMedia().resize(f.parseDimension(h.style.width),f.parseDimension(h.style.height))}else{b.getMedia().resize(f.parseDimension(P.style.width),f.parseDimension(P.style.height))}}}function ai(h){var g={position:"absolute",margin:0,padding:0,top:null};var j=b.plugins.config[h].currentPosition.toLowerCase();switch(j.toUpperCase()){case e.html5.view.positions.TOP:g.top=f.parseDimension(P.style.top);g.left=f.parseDimension(P.style.left);g.width=f.getElementWidth(P)-f.parseDimension(P.style.left)-f.parseDimension(P.style.right);g.height=b.plugins.object[h].height;P.style[j]=f.parseDimension(P.style[j])+b.plugins.object[h].height+"px";P.style.height=f.getElementHeight(P)-g.height+"px";break;case e.html5.view.positions.RIGHT:g.top=f.parseDimension(P.style.top);g.right=f.parseDimension(P.style.right);g.width=b.plugins.object[h].width;g.height=f.getElementHeight(P)-f.parseDimension(P.style.top)-f.parseDimension(P.style.bottom);P.style.width=f.getElementWidth(P)-g.width+"px";break;case e.html5.view.positions.BOTTOM:g.bottom=f.parseDimension(P.style.bottom);g.left=f.parseDimension(P.style.left);g.width=f.getElementWidth(P)-f.parseDimension(P.style.left)-f.parseDimension(P.style.right);g.height=b.plugins.object[h].height;P.style.height=f.getElementHeight(P)-g.height+"px";break;case e.html5.view.positions.LEFT:g.top=f.parseDimension(P.style.top);g.left=f.parseDimension(P.style.left);g.width=b.plugins.object[h].width;g.height=f.getElementHeight(P)-f.parseDimension(P.style.top)-f.parseDimension(P.style.bottom);P.style[j]=f.parseDimension(P.style[j])+b.plugins.object[h].width+"px";P.style.width=f.getElementWidth(P)-g.width+"px";break;default:break}return g}this.resize=ae;this.fullscreen=function(g){var l;try{l=b.getMedia().getDisplayElement()}catch(m){}if(S()&&l&&l.webkitSupportsFullscreen){if(g&&!l.webkitDisplayingFullscreen){try{f.transform(l);l.webkitEnterFullscreen()}catch(h){}}else{if(!g){a();if(l.webkitDisplayingFullscreen){try{l.webkitExitFullscreen()}catch(h){}}}}V=false}else{if(g){document.onkeydown=af;clearInterval(X);var j=f.getBoundingClientRect(document.body);b.width=Math.abs(j.left)+Math.abs(j.right);b.height=window.innerHeight;var k={position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:2147483000};d(c,k);k.zIndex=1;if(b.getMedia()&&b.getMedia().getDisplayElement()){d(b.getMedia().getDisplayElement(),k)}k.zIndex=2;d(P,k);V=true}else{document.onkeydown="";b.width=ag;b.height=L;d(c,{position:"relative",height:b.height,width:b.width,zIndex:0});V=false}ae(b.width,b.height)}};function Q(g){return([e.html5.view.positions.TOP,e.html5.view.positions.RIGHT,e.html5.view.positions.BOTTOM,e.html5.view.positions.LEFT].toString().indexOf(g.toUpperCase())>-1)}function S(){if(J.jwGetState()!=e.api.events.state.IDLE&&!V&&(b.getMedia()&&b.getMedia().getDisplayElement()&&b.getMedia().getDisplayElement().webkitSupportsFullscreen)&&f.useNativeFullscreen()){return true}return false}};e.html5.view.positions={TOP:"TOP",RIGHT:"RIGHT",BOTTOM:"BOTTOM",LEFT:"LEFT",OVER:"OVER",NONE:"NONE"}})(jwplayer);(function(d){var c={backgroundcolor:"",margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",buttoncolor:parseInt("ffffff",16),position:d.html5.view.positions.BOTTOM,idlehide:false,hideplaylistcontrols:false,layout:{left:{position:"left",elements:[{name:"play",type:"button"},{name:"divider",type:"divider"},{name:"prev",type:"button"},{name:"divider",type:"divider"},{name:"next",type:"button"},{name:"divider",type:"divider"},{name:"elapsed",type:"text"}]},center:{position:"center",elements:[{name:"time",type:"slider"}]},right:{position:"right",elements:[{name:"duration",type:"text"},{name:"blank",type:"button"},{name:"divider",type:"divider"},{name:"mute",type:"button"},{name:"volume",type:"slider"},{name:"divider",type:"divider"},{name:"fullscreen",type:"button"}]}}};_utils=d.utils;_css=_utils.css;_hide=function(a){_css(a,{display:"none"})};_show=function(a){_css(a,{display:"block"})};d.html5.controlbar=function(ba,am){window.controlbar=this;var bb=ba;var aP=_utils.extend({},c,bb.skin.getComponentSettings("controlbar"),am);if(aP.position==d.html5.view.positions.NONE||typeof d.html5.view.positions[aP.position]=="undefined"){return}if(_utils.mapLength(bb.skin.getComponentLayout("controlbar"))>0){aP.layout=bb.skin.getComponentLayout("controlbar")}var aM;var au;var aO;var aN;var a0="none";var be;var bc;var aL;var bf;var bg;var aX;var at={};var a6=false;var bj={};var aU;var bd=false;var a7;var bi;var ap=false;var aJ=false;var aH;var a=new d.html5.eventdispatcher();_utils.extend(this,a);function aB(){if(!aU){aU=bb.skin.getSkinElement("controlbar","background");if(!aU){aU={width:0,height:0,src:null}}}return aU}function aw(){aO=0;aN=0;au=0;if(!a6){var e={height:aB().height,backgroundColor:aP.backgroundcolor};aM=document.createElement("div");aM.id=bb.id+"_jwplayer_controlbar";_css(aM,e)}var f=(bb.skin.getSkinElement("controlbar","capLeft"));var g=(bb.skin.getSkinElement("controlbar","capRight"));if(f){aY("capLeft","left",false,aM)}aT("background",aM,{position:"absolute",height:aB().height,left:(f?f.width:0),zIndex:0},"img");if(aB().src){at.background.src=aB().src}aT("elements",aM,{position:"relative",height:aB().height,zIndex:1});if(g){aY("capRight","right",false,aM)}}this.getDisplayElement=function(){return aM};this.resize=function(e,g){ar();_utils.cancelAnimation(aM);bg=e;aX=g;if(aJ!=bb.jwGetFullscreen()){aJ=bb.jwGetFullscreen();bi=undefined}var f=aZ();aC({id:bb.id,duration:aL,position:bc});a1({id:bb.id,bufferPercent:bf});return f};this.show=function(){if(bd){bd=false;_show(aM);ao()}};this.hide=function(){if(!bd){bd=true;_hide(aM);aR()}};function a5(){var f=["timeSlider","volumeSlider","timeSliderRail","volumeSliderRail"];for(var e in f){var g=f[e];if(typeof at[g]!="undefined"){bj[g]=_utils.getBoundingClientRect(at[g])}}}var bh;function b(e){if(bd){return}clearTimeout(a7);if(aP.position==d.html5.view.positions.OVER||bb.jwGetFullscreen()){switch(bb.jwGetState()){case d.api.events.state.PAUSED:case d.api.events.state.IDLE:if(aM&&aM.style.opacity<1&&(!aP.idlehide||_utils.exists(e))){bh=false;setTimeout(function(){if(!bh){an()}},100)}if(aP.idlehide){a7=setTimeout(function(){aV()},2000)}break;default:bh=true;if(e){an()}a7=setTimeout(function(){aV()},2000);break}}else{an()}}function aV(){if(!bd){aR();if(aM.style.opacity==1){_utils.cancelAnimation(aM);_utils.fadeTo(aM,0,0.1,1,0)}}}function an(){if(!bd){ao();if(aM.style.opacity==0){_utils.cancelAnimation(aM);_utils.fadeTo(aM,1,0.1,0,0)}}}function aF(e){return function(){if(ap&&bi!=e){bi=e;a.sendEvent(e,{component:"controlbar",boundingRect:av()})}}}var ao=aF(d.api.events.JWPLAYER_COMPONENT_SHOW);var aR=aF(d.api.events.JWPLAYER_COMPONENT_HIDE);function av(){if(aP.position==d.html5.view.positions.OVER||bb.jwGetFullscreen()){return _utils.getDimensions(aM)}else{return{x:0,y:0,width:0,height:0}}}function aT(e,f,g,j){var h;if(!a6){if(!j){j="div"}h=document.createElement(j);at[e]=h;h.id=aM.id+"_"+e;f.appendChild(h)}else{h=document.getElementById(aM.id+"_"+e)}if(_utils.exists(g)){_css(h,g)}return h}function ax(){if(bb.jwGetHeight()<=40){aP.layout=_utils.clone(aP.layout);for(var e=0;e<aP.layout.left.elements.length;e++){if(aP.layout.left.elements[e].name=="fullscreen"){aP.layout.left.elements.splice(e,1)}}for(e=0;e<aP.layout.right.elements.length;e++){if(aP.layout.right.elements[e].name=="fullscreen"){aP.layout.right.elements.splice(e,1)}}a8()}aA(aP.layout.left);aA(aP.layout.center);aA(aP.layout.right)}function aA(f,j){var e=f.position=="right"?"right":"left";var g=_utils.extend([],f.elements);if(_utils.exists(j)){g.reverse()}var f=aT(f.position+"Group",at.elements,{"float":"left",styleFloat:"left",cssFloat:"left",height:"100%"});for(var h=0;h<g.length;h++){aQ(g[h],e,f)}}function az(){return au++}function aQ(k,h,f){var l,n,m,o,e;if(!f){f=at.elements}if(k.type=="divider"){aY("divider"+az(),h,true,f,undefined,k.width,k.element);return}switch(k.name){case"play":aY("playButton",h,false,f);aY("pauseButton",h,true,f);aq("playButton","jwPlay");aq("pauseButton","jwPause");break;case"prev":aY("prevButton",h,true,f);aq("prevButton","jwPlaylistPrev");break;case"stop":aY("stopButton",h,true,f);aq("stopButton","jwStop");break;case"next":aY("nextButton",h,true,f);aq("nextButton","jwPlaylistNext");break;case"elapsed":aY("elapsedText",h,true,f);break;case"time":n=!_utils.exists(bb.skin.getSkinElement("controlbar","timeSliderCapLeft"))?0:bb.skin.getSkinElement("controlbar","timeSliderCapLeft").width;m=!_utils.exists(bb.skin.getSkinElement("controlbar","timeSliderCapRight"))?0:bb.skin.getSkinElement("controlbar","timeSliderCapRight").width;l=h=="left"?n:m;e={height:aB().height,position:"relative","float":"left",styleFloat:"left",cssFloat:"left"};var j=aT("timeSlider",f,e);aY("timeSliderCapLeft",h,true,j,"relative");aY("timeSliderRail",h,false,j,"relative");aY("timeSliderBuffer",h,false,j,"absolute");aY("timeSliderProgress",h,false,j,"absolute");aY("timeSliderThumb",h,false,j,"absolute");aY("timeSliderCapRight",h,true,j,"relative");aW("time");break;case"fullscreen":aY("fullscreenButton",h,false,f);aY("normalscreenButton",h,true,f);aq("fullscreenButton","jwSetFullscreen",true);aq("normalscreenButton","jwSetFullscreen",false);break;case"volume":n=!_utils.exists(bb.skin.getSkinElement("controlbar","volumeSliderCapLeft"))?0:bb.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;m=!_utils.exists(bb.skin.getSkinElement("controlbar","volumeSliderCapRight"))?0:bb.skin.getSkinElement("controlbar","volumeSliderCapRight").width;l=h=="left"?n:m;o=bb.skin.getSkinElement("controlbar","volumeSliderRail").width+n+m;e={height:aB().height,position:"relative",width:o,"float":"left",styleFloat:"left",cssFloat:"left"};var g=aT("volumeSlider",f,e);aY("volumeSliderCapLeft",h,false,g,"relative");aY("volumeSliderRail",h,false,g,"relative");aY("volumeSliderProgress",h,false,g,"absolute");aY("volumeSliderThumb",h,false,g,"absolute");aY("volumeSliderCapRight",h,false,g,"relative");aW("volume");break;case"mute":aY("muteButton",h,false,f);aY("unmuteButton",h,true,f);aq("muteButton","jwSetMute",true);aq("unmuteButton","jwSetMute",false);break;case"duration":aY("durationText",h,true,f);break}}function aY(m,j,o,f,l,p,n){if(_utils.exists(bb.skin.getSkinElement("controlbar",m))||m.indexOf("Text")>0||m.indexOf("divider")===0){var k={height:"100%",position:l?l:"relative",display:"block","float":"left",styleFloat:"left",cssFloat:"left"};if((m.indexOf("next")===0||m.indexOf("prev")===0)&&(bb.jwGetPlaylist().length<2||aP.hideplaylistcontrols)){o=false;k.display="none"}var e;if(m.indexOf("Text")>0){m.innerhtml="00:00";k.font=aP.fontsize+"px/"+(aB().height+1)+"px "+aP.font;k.color=aP.fontcolor;k.textAlign="center";k.fontWeight=aP.fontweight;k.fontStyle=aP.fontstyle;k.cursor="default";e=14+3*aP.fontsize}else{if(m.indexOf("divider")===0){if(p){if(!isNaN(parseInt(p))){e=parseInt(p)}}else{if(n){var h=bb.skin.getSkinElement("controlbar",n);if(h){k.background="url("+h.src+") repeat-x center left";e=h.width}}else{k.background="url("+bb.skin.getSkinElement("controlbar","divider").src+") repeat-x center left";e=bb.skin.getSkinElement("controlbar","divider").width}}}else{k.background="url("+bb.skin.getSkinElement("controlbar",m).src+") repeat-x center left";e=bb.skin.getSkinElement("controlbar",m).width}}if(j=="left"){if(o){aO+=e}}else{if(j=="right"){if(o){aN+=e}}}if(_utils.typeOf(f)=="undefined"){f=at.elements}k.width=e;if(a6){_css(at[m],k)}else{var g=aT(m,f,k);if(_utils.exists(bb.skin.getSkinElement("controlbar",m+"Over"))){g.onmouseover=function(q){g.style.backgroundImage=["url(",bb.skin.getSkinElement("controlbar",m+"Over").src,")"].join("")};g.onmouseout=function(q){g.style.backgroundImage=["url(",bb.skin.getSkinElement("controlbar",m).src,")"].join("")}}if(m.indexOf("divider")==0){g.setAttribute("class","divider")}}}}function aK(){bb.jwAddEventListener(d.api.events.JWPLAYER_PLAYLIST_LOADED,aS);bb.jwAddEventListener(d.api.events.JWPLAYER_PLAYLIST_ITEM,a3);bb.jwAddEventListener(d.api.events.JWPLAYER_MEDIA_BUFFER,a1);bb.jwAddEventListener(d.api.events.JWPLAYER_PLAYER_STATE,a4);bb.jwAddEventListener(d.api.events.JWPLAYER_MEDIA_TIME,aC);bb.jwAddEventListener(d.api.events.JWPLAYER_MEDIA_MUTE,aD);bb.jwAddEventListener(d.api.events.JWPLAYER_MEDIA_VOLUME,a9);bb.jwAddEventListener(d.api.events.JWPLAYER_MEDIA_COMPLETE,ay)}function aS(){if(!aP.hideplaylistcontrols){if(bb.jwGetPlaylist().length>1){_show(at.nextButton);_show(at.prevButton)}else{_hide(at.nextButton);_hide(at.prevButton)}aZ();aI()}}function a3(e){aL=bb.jwGetPlaylist()[e.index].duration;aC({id:bb.id,duration:aL,position:0});a1({id:bb.id,bufferProgress:0})}function aI(){aC({id:bb.id,duration:bb.jwGetDuration(),position:0});a1({id:bb.id,bufferProgress:0});aD({id:bb.id,mute:bb.jwGetMute()});a4({id:bb.id,newstate:d.api.events.state.IDLE});a9({id:bb.id,volume:bb.jwGetVolume()})}function aq(f,e,g){if(a6){return}if(_utils.exists(bb.skin.getSkinElement("controlbar",f))){var h=at[f];if(_utils.exists(h)){_css(h,{cursor:"pointer"});if(e=="fullscreen"){h.onmouseup=function(j){j.stopPropagation();bb.jwSetFullscreen(!bb.jwGetFullscreen())}}else{h.onmouseup=function(j){j.stopPropagation();if(_utils.exists(g)){bb[e](g)}else{bb[e]()}}}}}}function aW(f){if(a6){return}var e=at[f+"Slider"];_css(at.elements,{cursor:"pointer"});_css(e,{cursor:"pointer"});e.onmousedown=function(g){a0=f};e.onmouseup=function(g){g.stopPropagation();aE(g.pageX)};e.onmousemove=function(h){if(a0=="time"){be=true;var g=h.pageX-bj[f+"Slider"].left-window.pageXOffset;_css(at[a0+"SliderThumb"],{left:g})}}}function aE(g){be=false;var h;if(a0=="time"){h=g-bj.timeSliderRail.left+window.pageXOffset;var e=h/bj.timeSliderRail.width*aL;if(e<0){e=0}else{if(e>aL){e=aL-3}}if(bb.jwGetState()==d.api.events.state.PAUSED||bb.jwGetState()==d.api.events.state.IDLE){bb.jwPlay()}bb.jwSeek(e)}else{if(a0=="volume"){h=g-bj.volumeSliderRail.left-window.pageXOffset;var f=Math.round(h/bj.volumeSliderRail.width*100);if(f<0){f=0}else{if(f>100){f=100}}if(bb.jwGetMute()){bb.jwSetMute(false)}bb.jwSetVolume(f)}}a0="none"}function a1(g){if(_utils.exists(g.bufferPercent)){bf=g.bufferPercent}if(bj.timeSliderRail){var e=bb.skin.getSkinElement("controlbar","timeSliderCapLeft");var f=bj.timeSliderRail.width;var h=isNaN(Math.round(f*bf/100))?0:Math.round(f*bf/100);_css(at.timeSliderBuffer,{width:h,left:e?e.width:0})}}function aD(e){if(e.mute){_hide(at.muteButton);_show(at.unmuteButton);_hide(at.volumeSliderProgress)}else{_show(at.muteButton);_hide(at.unmuteButton);_show(at.volumeSliderProgress)}}function a4(e){if(e.newstate==d.api.events.state.BUFFERING||e.newstate==d.api.events.state.PLAYING){_show(at.pauseButton);_hide(at.playButton)}else{_hide(at.pauseButton);_show(at.playButton)}b();if(e.newstate==d.api.events.state.IDLE){_hide(at.timeSliderBuffer);_hide(at.timeSliderProgress);_hide(at.timeSliderThumb);aC({id:bb.id,duration:bb.jwGetDuration(),position:0})}else{_show(at.timeSliderBuffer);if(e.newstate!=d.api.events.state.BUFFERING){_show(at.timeSliderProgress);_show(at.timeSliderThumb)}}}function ay(e){a1({bufferPercent:0});aC(_utils.extend(e,{position:0,duration:aL}))}function aC(g){if(_utils.exists(g.position)){bc=g.position}if(_utils.exists(g.duration)){aL=g.duration}var j=(bc===aL===0)?0:bc/aL;var e=bj.timeSliderRail;if(e){var k=isNaN(Math.round(e.width*j))?0:Math.round(e.width*j);var f=bb.skin.getSkinElement("controlbar","timeSliderCapLeft");var h=k+(f?f.width:0);if(at.timeSliderProgress){_css(at.timeSliderProgress,{width:k,left:f?f.width:0});if(!be){if(at.timeSliderThumb){at.timeSliderThumb.style.left=h+"px"}}}}if(at.durationText){at.durationText.innerHTML=_utils.timeFormat(aL)}if(at.elapsedText){at.elapsedText.innerHTML=_utils.timeFormat(bc)}}function a8(){var k=at.elements.childNodes;var e,g;for(var h=0;h<k.length;h++){var f=k[h].childNodes;for(var j in f){if(isNaN(parseInt(j,10))){continue}if(f[j].id.indexOf(aM.id+"_divider")===0&&g&&g.id.indexOf(aM.id+"_divider")===0&&f[j].style.backgroundImage==g.style.backgroundImage){f[j].style.display="none"}else{if(f[j].id.indexOf(aM.id+"_divider")===0&&e&&e.style.display!="none"){f[j].style.display="block"}}if(f[j].style.display!="none"){g=f[j]}e=f[j]}}}function aG(){if(bb.jwGetFullscreen()){_show(at.normalscreenButton);_hide(at.fullscreenButton)}else{_hide(at.normalscreenButton);_show(at.fullscreenButton)}if(bb.jwGetState()==d.api.events.state.BUFFERING||bb.jwGetState()==d.api.events.state.PLAYING){_show(at.pauseButton);_hide(at.playButton)}else{_hide(at.pauseButton);_show(at.playButton)}if(bb.jwGetMute()==true){_hide(at.muteButton);_show(at.unmuteButton)}else{_show(at.muteButton);_hide(at.unmuteButton)}}function aZ(){a8();aG();var m={width:bg};var e={"float":"left",styleFloat:"left",cssFloat:"left"};if(aP.position==d.html5.view.positions.OVER||bb.jwGetFullscreen()){m.left=aP.margin;m.width-=2*aP.margin;m.top=aX-aB().height-aP.margin;m.height=aB().height}var k=bb.skin.getSkinElement("controlbar","capLeft");var g=bb.skin.getSkinElement("controlbar","capRight");e.width=m.width-(k?k.width:0)-(g?g.width:0);var l=_utils.getBoundingClientRect(at.leftGroup).width;var h=_utils.getBoundingClientRect(at.rightGroup).width;var j=e.width-l-h;var n=j;var o=bb.skin.getSkinElement("controlbar","timeSliderCapLeft");var f=bb.skin.getSkinElement("controlbar","timeSliderCapRight");if(_utils.exists(o)){n-=o.width}if(_utils.exists(f)){n-=f.width}at.timeSlider.style.width=j+"px";at.timeSliderRail.style.width=n+"px";_css(aM,m);_css(at.elements,e);_css(at.background,e);a5();return m}function a9(f){if(_utils.exists(at.volumeSliderRail)){var j=isNaN(f.volume/100)?1:f.volume/100;var h=_utils.parseDimension(at.volumeSliderRail.style.width);var l=isNaN(Math.round(h*j))?0:Math.round(h*j);var e=_utils.parseDimension(at.volumeSliderRail.style.right);var k=(!_utils.exists(bb.skin.getSkinElement("controlbar","volumeSliderCapLeft")))?0:bb.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;_css(at.volumeSliderProgress,{width:l,left:k});if(at.volumeSliderThumb){var g=(l-Math.round(_utils.parseDimension(at.volumeSliderThumb.style.width)/2));g=Math.min(Math.max(g,0),h-_utils.parseDimension(at.volumeSliderThumb.style.width));_css(at.volumeSliderThumb,{left:g})}if(_utils.exists(at.volumeSliderCapLeft)){_css(at.volumeSliderCapLeft,{left:0})}}}function ar(){aH=document.getElementById(bb.id);aH.addEventListener("mousemove",b)}function a2(){aw();ax();a5();a6=true;aK();aP.idlehide=(aP.idlehide.toString().toLowerCase()=="true");if(aP.position==d.html5.view.positions.OVER&&aP.idlehide){aM.style.opacity=0;ap=true}else{aM.style.opacity=1;setTimeout((function(){ap=true;ao()}),1)}ar();aI()}a2();return this}})(jwplayer);(function(d){var e=["width","height","state","playlist","item","position","buffer","duration","volume","mute","fullscreen"];var f=d.utils;d.html5.controller=function(ap,U,ay,aw){var aq=ap;var at=ay;var av=aw;var af=U;var S=true;var Y=-1;var ad=f.exists(at.config.debug)&&(at.config.debug.toString().toLowerCase()=="console");var R=new d.html5.eventdispatcher(af.id,ad);f.extend(this,R);var ab=[];var an=false;function T(g){if(an){R.sendEvent(g.type,g)}else{ab.push(g)}}function al(j){if(!an){an=true;R.sendEvent(d.api.events.JWPLAYER_READY,j);if(d.utils.exists(window.playerReady)){playerReady(j)}if(d.utils.exists(window[ay.config.playerReady])){window[ay.config.playerReady](j)}while(ab.length>0){var g=ab.shift();R.sendEvent(g.type,g)}if(ay.config.autostart&&!d.utils.isIOS()){Q()}while(ag.length>0){var h=ag.shift();ac(h.method,h.arguments)}}}at.addGlobalListener(T);at.addEventListener(d.api.events.JWPLAYER_MEDIA_BUFFER_FULL,function(){at.getMedia().play()});at.addEventListener(d.api.events.JWPLAYER_MEDIA_TIME,function(g){if(g.position>=at.playlist[at.item].start&&Y>=0){at.playlist[at.item].start=Y;Y=-1}});at.addEventListener(d.api.events.JWPLAYER_MEDIA_COMPLETE,function(g){setTimeout(aa,25)});at.addEventListener(d.api.events.JWPLAYER_PLAYLIST_LOADED,Q);at.addEventListener(d.api.events.JWPLAYER_FULLSCREEN,ao);function Z(){try{ai(at.item);if(at.playlist[at.item].levels[0].file.length>0){if(S||at.state==d.api.events.state.IDLE){at.getMedia().load(at.playlist[at.item]);S=false}else{if(at.state==d.api.events.state.PAUSED){at.getMedia().play()}}}return true}catch(g){R.sendEvent(d.api.events.JWPLAYER_ERROR,g)}return false}function az(){try{if(at.playlist[at.item].levels[0].file.length>0){switch(at.state){case d.api.events.state.PLAYING:case d.api.events.state.BUFFERING:if(at.getMedia()){at.getMedia().pause()}break}}return true}catch(g){R.sendEvent(d.api.events.JWPLAYER_ERROR,g)}return false}function ae(h){try{if(at.playlist[at.item].levels[0].file.length>0){if(typeof h!="number"){h=parseFloat(h)}switch(at.state){case d.api.events.state.IDLE:if(Y<0){Y=at.playlist[at.item].start;at.playlist[at.item].start=h}Z();break;case d.api.events.state.PLAYING:case d.api.events.state.PAUSED:case d.api.events.state.BUFFERING:at.seek(h);break}}return true}catch(g){R.sendEvent(d.api.events.JWPLAYER_ERROR,g)}return false}function ah(h){if(!f.exists(h)){h=true}try{if(at.getMedia()){at.getMedia().stop(h)}return true}catch(g){R.sendEvent(d.api.events.JWPLAYER_ERROR,g)}return false}function au(){try{if(at.playlist[at.item].levels[0].file.length>0){if(at.config.shuffle){ai(a())}else{if(at.item+1==at.playlist.length){ai(0)}else{ai(at.item+1)}}}if(at.state!=d.api.events.state.IDLE){var g=at.state;at.state=d.api.events.state.IDLE;R.sendEvent(d.api.events.JWPLAYER_PLAYER_STATE,{oldstate:g,newstate:d.api.events.state.IDLE})}Z();return true}catch(h){R.sendEvent(d.api.events.JWPLAYER_ERROR,h)}return false}function W(){try{if(at.playlist[at.item].levels[0].file.length>0){if(at.config.shuffle){ai(a())}else{if(at.item===0){ai(at.playlist.length-1)}else{ai(at.item-1)}}}if(at.state!=d.api.events.state.IDLE){var g=at.state;at.state=d.api.events.state.IDLE;R.sendEvent(d.api.events.JWPLAYER_PLAYER_STATE,{oldstate:g,newstate:d.api.events.state.IDLE})}Z();return true}catch(h){R.sendEvent(d.api.events.JWPLAYER_ERROR,h)}return false}function a(){var g=null;if(at.playlist.length>1){while(!f.exists(g)){g=Math.floor(Math.random()*at.playlist.length);if(g==at.item){g=null}}}else{g=0}return g}function X(h){if(!at.playlist||!at.playlist[h]){return false}try{if(at.playlist[h].levels[0].file.length>0){var g=at.state;if(g!==d.api.events.state.IDLE){if(at.playlist[at.item].provider==at.playlist[h].provider){ah(false)}else{ah()}}ai(h);Z()}return true}catch(j){R.sendEvent(d.api.events.JWPLAYER_ERROR,j)}return false}function ai(g){if(!at.playlist[g]){return}at.setActiveMediaProvider(at.playlist[g]);if(at.item!=g){at.item=g;S=true;R.sendEvent(d.api.events.JWPLAYER_PLAYLIST_ITEM,{index:g})}}function ax(h){try{ai(at.item);var g=at.getMedia();switch(typeof(h)){case"number":g.volume(h);break;case"string":g.volume(parseInt(h,10));break}return true}catch(j){R.sendEvent(d.api.events.JWPLAYER_ERROR,j)}return false}function am(h){try{ai(at.item);var g=at.getMedia();if(typeof h=="undefined"){g.mute(!at.mute)}else{if(h.toString().toLowerCase()=="true"){g.mute(true)}else{g.mute(false)}}return true}catch(j){R.sendEvent(d.api.events.JWPLAYER_ERROR,j)}return false}function V(h,j){try{at.width=h;at.height=j;av.resize(h,j);R.sendEvent(d.api.events.JWPLAYER_RESIZE,{width:at.width,height:at.height});return true}catch(g){R.sendEvent(d.api.events.JWPLAYER_ERROR,g)}return false}function aj(g){try{if(typeof g=="undefined"){g=!at.fullscreen}if(g!=at.fullscreen){if(g.toString().toLowerCase()=="true"){at.fullscreen=true;av.fullscreen(true);R.sendEvent(d.api.events.JWPLAYER_FULLSCREEN,{fullscreen:true})}else{at.fullscreen=false;av.fullscreen(false);R.sendEvent(d.api.events.JWPLAYER_FULLSCREEN,{fullscreen:false})}R.sendEvent(d.api.events.JWPLAYER_RESIZE,{width:at.width,height:at.height})}return true}catch(h){R.sendEvent(d.api.events.JWPLAYER_ERROR,h)}return false}function b(h){try{ah();at.loadPlaylist(h);if(at.playlist[at.item].provider){ai(at.item);if(at.config.autostart.toString().toLowerCase()=="true"){Z()}return true}else{return false}}catch(g){R.sendEvent(d.api.events.JWPLAYER_ERROR,g)}return false}function Q(g){ai(at.playlist[at.item]);if(at.config.autostart.toString().toLowerCase()=="true"){Z()}}function ao(g){aj(g.fullscreen)}function ak(){try{return at.getMedia().detachMedia()}catch(g){return null}}function ar(){try{return at.getMedia().attachMedia()}catch(g){return null}}d.html5.controller.repeatoptions={LIST:"LIST",ALWAYS:"ALWAYS",SINGLE:"SINGLE",NONE:"NONE"};function aa(){switch(at.config.repeat.toUpperCase()){case d.html5.controller.repeatoptions.SINGLE:Z();break;case d.html5.controller.repeatoptions.ALWAYS:if(at.item==at.playlist.length-1&&!at.config.shuffle){X(0)}else{au()}break;case d.html5.controller.repeatoptions.LIST:if(at.item==at.playlist.length-1&&!at.config.shuffle){ah();ai(0)}else{au()}break;default:ah();break}}var ag=[];function c(g){return function(){if(an){ac(g,arguments)}else{ag.push({method:g,arguments:arguments})}}}function ac(g,h){var j=[];for(i=0;i<h.length;i++){j.push(h[i])}g.apply(this,j)}this.play=c(Z);this.pause=c(az);this.seek=c(ae);this.stop=c(ah);this.next=c(au);this.prev=c(W);this.item=c(X);this.setVolume=c(ax);this.setMute=c(am);this.resize=c(V);this.setFullscreen=c(aj);this.load=c(b);this.playerReady=al;this.detachMedia=ak;this.attachMedia=ar}})(jwplayer);(function(b){b.html5.defaultSkin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.1"><components><component name="controlbar"><settings><setting name="margin" value="20"/><setting name="fontsize" value="11"/><setting name="fontcolor" value="0x000000"/></settings><layout><group position="left"><button name="play"/><divider name="divider"/><button name="prev"/><divider name="divider"/><button name="next"/><divider name="divider"/><text name="elapsed"/></group><group position="center"><slider name="time"/></group><group position="right"><text name="duration"/><divider name="divider"/><button name="blank"/><divider name="divider"/><button name="mute"/><slider name="volume"/><divider name="divider"/><button name="fullscreen"/></group></layout><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUOI3t1LERACAMQlFgGvcfxNIhHMK4gsUvUviOmgtNsiAZkBSEKxKEnCYkkQrJn/YwbUNiSDDYRZaQRDaShv+oX9GBZEIuK+8hXVLs+/YAAAAASUVORK5CYII="/><element name="blankButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUCB0FwcENgEAAw7Aq+893g8APUILNOQcbFRktVGqUVFRkWNz3xTa2sUaLNUosKlRUvvf5AdbWOTtzmzyWAAAAAElFTkSuQmCC"/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAANUlEQVR42u2RsQkAAAjD/NTTPaW6dXLrINJA1kBpGPMAjDWmOgp1HFQXx+b1KOefO4oxY57R73YnVYCQUCQAAAAASUVORK5CYII="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAIUlEQVQ4jWNgGAWjYOiD/0gYG3/U0FFDB4Oho2AUDAYAAEwiL9HrpdMVAAAAAElFTkSuQmCC"/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQklEQVQ4y2NgGAWjYOiD/1AMA/JAfB5NjCJD/YH4PRaLyDa0H4lNNUP/DxlD59PCUBCIp3ZEwYA+NZLUKBgFgwEAAN+HLX9sB8u8AAAAAElFTkSuQmCC"/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQElEQVQ4y2NgGAWjYOiD/0B8Hojl0cT+U2ooCL8HYn9qGwrD/bQw9P+QMXQ+tSMqnpoRBUpS+tRMUqNgFAwGAADxZy1/mHvFnAAAAABJRU5ErkJggg=="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAOElEQVRIDe3BwQkAIRADwAhhw/nU/kWwUK+KPITMABFh19Y+F0acY8CJvX9wYpXgRElwolSIiMf9ZWEDhtwurFsAAAAASUVORK5CYII="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAN0lEQVRIDe3BwQkAMQwDMBcc55mRe9zi7RR+FCwBEWG39vcfGHFm4MTuhhMlwYlVBSdKhYh43AW/LQMKm1spzwAAAABJRU5ErkJggg=="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAIElEQVRIiWNgGAWjYBTQBfynMR61YCRYMApGwSigMQAAiVWPcbq6UkIAAAAASUVORK5CYII="/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAYCAYAAAA/OUfnAAAAO0lEQVQYlWP4//8/Awwz0JgDBP/BeN6Cxf/hnI2btiI4u/fsQ3AOHjqK4Jw4eQbBOX/hEoKDYjSd/AMA4cS4mfLsorgAAAAASUVORK5CYII="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAJklEQVQ4y2NgGAUjDcwH4v/kaPxPikZkxcNVI9mBQ5XoGAWDFwAAsKAXKQQmfbUAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAMklEQVQ4y2NgGAWDHPyntub5xBr6Hwv/Pzk2/yfVG/8psRFE25Oq8T+tQnsIaB4FVAcAi2YVysVY52AAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAACmpqampqbBXAu8AAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAQklEQVRIiWNgGAWjYMiD/0iYFDmSLbDHImdPLQtgBpEiR7Zl2NijAA5oEkT/0Whi5UiyAJ8BVMsHNMtoo2AUDAIAAGdcIN3IDNXoAAAAAElFTkSuQmCC"/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAP0lEQVRIx2NgGAWjYMiD/1RSQ5QB/wmIUWzJfzx8qhj+n4DYCAY0DyJ7PBbYU8sHMEvwiZFtODXUjIJRMJgBACpWIN2ZxdPTAAAAAElFTkSuQmCC"/></elements></component><component name="display"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiUlEQVR42u3XSw2AMBREURwgAQlIQAISKgUpSEFKJeCg5b0E0kWBTVcD9ySTsL0Jn9IBAAAA+K2UUrBlW/Rr5ZDoIeeuoFkxJD9ss03aIXXQqB9SttoG7ZA6qNcOKdttiwcJh9RB+iFl4SshkRBuLR72+9cvH0SOKI2HRo7x/Fi1/uoCAAAAwLsD8ki99IlO2dQAAAAASUVORK5CYII="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAVUlEQVR42u3WMQrAIAxAUW/g/SdvGmvpoOBeSHgPsjj5QTANAACARCJilIhYM0tEvJM+Ik3Id9E957kQIb+F3OdCPC0hPkQriqWx9hp/x/QGAABQyAPLB22VGrpLDgAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAA/0lEQVR42u2U0QmEMBAF7cASLMESUoIlpARLSCkpwRJSgiWkhOvAXD4WsgRkyaG5DbyB+Yvg8KITAAAAAAAYk+u61mwk15EjPtlEfihmqIiZR1Qx80ghjgdUuiHXGHSVsoag0x6x8DUoyjD5KovmEJ9NTDMRPIT0mtdIUkjlonuNohO+Ha99DTmkuGgKCTcvebAzx82ZoCWC3/3aIMWSRucaxcjORSFY4xpFdjYJGp1rFGcyCYZ/RVh6AUnfcNZ2zih3/mGj1jVCdiNDwyrq1rA/xMdeEXvDVdnYc1vDc3uPkDObXrlaxbNHSOohQhr/WOeLEWfWTgAAAAAAADzNF9sHJ7PJ57MlAAAAAElFTkSuQmCC"/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAACBklEQVR42u3Zv0sCYRzH8USTzOsHHEWGkC1HgaDgkktGDjUYtDQ01RDSljQ1BLU02+rk1NTm2NLq4Nx/0L/h9fnCd3j4cnZe1/U8xiO8h3uurufF0/3COd/3/0UWYiEWYiEWYiGJQ+J8xuPxKhXjEMZANinjIZhkGuVRNioE4wVURo4JkHm0xKWmhRAc1bh1EyCUw5BcBIjHiApKa4CErko6DEJwuRo6IRKzyJD8FJAyI3Zp2zRImiBcRhlfo5RtlxCcE3CcDNpGrhYIT2IhAJKilO0VRmzJ32fAMTpBTS0QMfGwlcuKMRftE0DJ0wCJdcOsCkBdXP3Mh9CEFUBTPS9mDZJBG6io4aqVzMdCokCw9H3kT6j/C/9iDdSeUMNC7DkyyxAs/Rk6Qss8FPWRZgdVtUH4DjxEn1zxh+/zj1wHlf4MQhNGrwqA6sY40U8JonRJwEQh+AO3AvCG6gHv4U7IY4krxkroWoAOkoQMGfCBrgIm+YBGqPENpIJ66CJg3x66Y0gnSUidAEEnNr9jjLiWMn5DiWP0OC/oAsCgkq43xBdGDMQr7YASP/vEkHvdl1+JOCcEV5sC4hGEOzTlPuKgd0b0xD4JkRcOgnRRTjdErkYhAsQVq6IdUuPJtmk7BCL3t/h88cx91pKQkI/pkDx6pmYTIjEoxiHsN1YWYiEWYiEWknhflZ5IErA5nr8AAAAASUVORK5CYII="/></elements></component><component name="dock"><settings><setting name="fontcolor" value="0xffffff"/></settings><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/></elements></component><component name="playlist"><settings><setting name="backgroundcolor" value="0xe8e8e8"/></settings><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHBJREFUaN7t2MENwCAMBEEe9N8wSKYC/D8YV7CyJoRkVtVImxkZPQInMxoP0XiIxkM0HsGbjjSNBx544IEHHnjggUe/6UQeey0PIh7XTftGxKPj4eXCtLsHHh+ZxkO0Iw8PR55Ni8ZD9Hu/EAoP0dc5RRg9qeRjVF8AAAAASUVORK5CYII="/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAKElEQVQ4y2P4//8/Az68bNmy/+iYkB6GUUNHDR01dNTQUUNHDaXcUABUDOKhcxnsSwAAAABJRU5ErkJggg=="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAJUlEQVQ4T2P4//8/Ay4MBP9xYbz6Rg0dNXTU0FFDRw0dNZRyQwHH4NBa7GJsXAAAAABJRU5ErkJggg=="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/></elements></component></components></skin>';this.xml=null;if(window.DOMParser){parser=new DOMParser();this.xml=parser.parseFromString(this.text,"text/xml")}else{this.xml=new ActiveXObject("Microsoft.XMLDOM");this.xml.async="false";this.xml.loadXML(this.text)}return this}})(jwplayer);(function(b){_utils=b.utils;_css=_utils.css;_hide=function(a){_css(a,{display:"none"})};_show=function(a){_css(a,{display:"block"})};b.html5.display=function(aB,ad){var aC={icons:true,showmute:false};var a=_utils.extend({},aC,ad);var aD=aB;var T={};var aG;var aq;var an;var V;var at;var ab;var aj;var aa=!_utils.exists(aD.skin.getComponentSettings("display").bufferrotation)?15:parseInt(aD.skin.getComponentSettings("display").bufferrotation,10);var av=!_utils.exists(aD.skin.getComponentSettings("display").bufferinterval)?100:parseInt(aD.skin.getComponentSettings("display").bufferinterval,10);var ak=-1;var ar="";var Z=true;var aH;var aE=false;var ay=false;var ao,X;var ac=new b.html5.eventdispatcher();_utils.extend(this,ac);var ag={display:{style:{cursor:"pointer",top:0,left:0,overflow:"hidden"},click:az},display_icon:{style:{cursor:"pointer",position:"absolute",top:((aD.skin.getSkinElement("display","background").height-aD.skin.getSkinElement("display","playIcon").height)/2),left:((aD.skin.getSkinElement("display","background").width-aD.skin.getSkinElement("display","playIcon").width)/2),border:0,margin:0,padding:0,zIndex:3,display:"none"}},display_iconBackground:{style:{cursor:"pointer",position:"absolute",top:((aq-aD.skin.getSkinElement("display","background").height)/2),left:((aG-aD.skin.getSkinElement("display","background").width)/2),border:0,backgroundImage:(["url(",aD.skin.getSkinElement("display","background").src,")"]).join(""),width:aD.skin.getSkinElement("display","background").width,height:aD.skin.getSkinElement("display","background").height,margin:0,padding:0,zIndex:2,display:"none"}},display_image:{style:{display:"none",width:aG,height:aq,position:"absolute",cursor:"pointer",left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1}},display_text:{style:{zIndex:4,position:"relative",opacity:0.8,backgroundColor:parseInt("000000",16),color:parseInt("ffffff",16),textAlign:"center",fontFamily:"Arial,sans-serif",padding:"0 5px",fontSize:14}}};aD.jwAddEventListener(b.api.events.JWPLAYER_PLAYER_STATE,ax);aD.jwAddEventListener(b.api.events.JWPLAYER_MEDIA_MUTE,ax);aD.jwAddEventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,ax);aD.jwAddEventListener(b.api.events.JWPLAYER_ERROR,aw);Y();function Y(){T.display=ah("div","display");T.display_text=ah("div","display_text");T.display.appendChild(T.display_text);T.display_image=ah("img","display_image");T.display_image.onerror=function(c){_hide(T.display_image)};T.display_image.onload=al;T.display_icon=ah("div","display_icon");T.display_iconBackground=ah("div","display_iconBackground");T.display.appendChild(T.display_image);T.display_iconBackground.appendChild(T.display_icon);T.display.appendChild(T.display_iconBackground);aF();setTimeout((function(){ay=true;if(a.icons.toString()=="true"){ae()}}),1)}this.getDisplayElement=function(){return T.display};this.resize=function(c,d){_css(T.display,{width:c,height:d});_css(T.display_text,{width:(c-10),top:((d-_utils.getBoundingClientRect(T.display_text).height)/2)});_css(T.display_iconBackground,{top:((d-aD.skin.getSkinElement("display","background").height)/2),left:((c-aD.skin.getSkinElement("display","background").width)/2)});if(aG!=c||aq!=d){aG=c;aq=d;aH=undefined;ae()}if(!aD.jwGetFullscreen()){ao=c;X=d}aI();ax({})};this.show=function(){if(aE){aE=false;au(aD.jwGetState())}};this.hide=function(){if(!aE){ai();aE=true}};function al(c){an=T.display_image.naturalWidth;V=T.display_image.naturalHeight;aI()}function aI(){if(aD.jwGetFullscreen()&&aD.jwGetStretching()==b.utils.stretching.EXACTFIT){var c=document.createElement("div");_utils.stretch(b.utils.stretching.UNIFORM,c,aG,aq,ao,X);_utils.stretch(b.utils.stretching.EXACTFIT,T.display_image,_utils.parseDimension(c.style.width),_utils.parseDimension(c.style.height),an,V);_css(T.display_image,{left:c.style.left,top:c.style.top})}else{_utils.stretch(aD.jwGetStretching(),T.display_image,aG,aq,an,V)}}function ah(e,c){var d=document.createElement(e);d.id=aD.id+"_jwplayer_"+c;_css(d,ag[c].style);return d}function aF(){for(var c in T){if(_utils.exists(ag[c].click)){T[c].onclick=ag[c].click}}}function az(c){if(typeof c.preventDefault!="undefined"){c.preventDefault()}else{c.returnValue=false}if(aD.jwGetState()!=b.api.events.state.PLAYING){aD.jwPlay()}else{aD.jwPause()}}function U(c){if(aj){ai();return}T.display_icon.style.backgroundImage=(["url(",aD.skin.getSkinElement("display",c).src,")"]).join("");_css(T.display_icon,{width:aD.skin.getSkinElement("display",c).width,height:aD.skin.getSkinElement("display",c).height,top:(aD.skin.getSkinElement("display","background").height-aD.skin.getSkinElement("display",c).height)/2,left:(aD.skin.getSkinElement("display","background").width-aD.skin.getSkinElement("display",c).width)/2});aJ();if(_utils.exists(aD.skin.getSkinElement("display",c+"Over"))){T.display_icon.onmouseover=function(d){T.display_icon.style.backgroundImage=["url(",aD.skin.getSkinElement("display",c+"Over").src,")"].join("")};T.display_icon.onmouseout=function(d){T.display_icon.style.backgroundImage=["url(",aD.skin.getSkinElement("display",c).src,")"].join("")}}else{T.display_icon.onmouseover=null;T.display_icon.onmouseout=null}}function ai(){if(a.icons.toString()=="true"){_hide(T.display_icon);_hide(T.display_iconBackground);W()}}function aJ(){if(!aE&&a.icons.toString()=="true"){_show(T.display_icon);_show(T.display_iconBackground);ae()}}function aw(c){aj=true;ai();T.display_text.innerHTML=c.message;_show(T.display_text);T.display_text.style.top=((aq-_utils.getBoundingClientRect(T.display_text).height)/2)+"px"}function af(){T.display_image.style.display="none"}function ax(d){if((d.type==b.api.events.JWPLAYER_PLAYER_STATE||d.type==b.api.events.JWPLAYER_PLAYLIST_ITEM)&&aj){aj=false;_hide(T.display_text)}var c=aD.jwGetState();if(c==ar){return}ar=c;if(ak>=0){clearTimeout(ak)}if(Z||aD.jwGetState()==b.api.events.state.PLAYING||aD.jwGetState()==b.api.events.state.PAUSED){au(aD.jwGetState())}else{ak=setTimeout(aA(aD.jwGetState()),500)}}function aA(c){return(function(){au(c)})}function au(c){if(_utils.exists(ab)){clearInterval(ab);ab=null;_utils.animations.rotate(T.display_icon,0)}switch(c){case b.api.events.state.BUFFERING:if(_utils.isMobile()){af();ai()}else{if(aD.jwGetPlaylist()[aD.jwGetItem()].provider=="sound"){ap()}at=0;ab=setInterval(function(){at+=aa;_utils.animations.rotate(T.display_icon,at%360)},av);U("bufferIcon");Z=true}break;case b.api.events.state.PAUSED:if(!_utils.isMobile()){if(aD.jwGetPlaylist()[aD.jwGetItem()].provider!="sound"){_css(T.display_image,{background:"transparent no-repeat center center"})}U("playIcon");Z=true}break;case b.api.events.state.IDLE:if(aD.jwGetPlaylist()[aD.jwGetItem()]&&aD.jwGetPlaylist()[aD.jwGetItem()].image){ap()}else{af()}U("playIcon");Z=true;break;default:if(aD.jwGetPlaylist()[aD.jwGetItem()]&&aD.jwGetPlaylist()[aD.jwGetItem()].provider=="sound"){if(_utils.isMobile()){af();Z=false}else{ap()}}else{af();Z=false}if(aD.jwGetMute()&&a.showmute){U("muteIcon")}else{ai()}break}ak=-1}function ap(){if(aD.jwGetPlaylist()[aD.jwGetItem()]&&aD.jwGetPlaylist()[aD.jwGetItem()].image){_css(T.display_image,{display:"block"});T.display_image.src=_utils.getAbsolutePath(aD.jwGetPlaylist()[aD.jwGetItem()].image)}}function am(c){return function(){if(!ay){return}if(!aE&&aH!=c){aH=c;ac.sendEvent(c,{component:"display",boundingRect:_utils.getDimensions(T.display_iconBackground)})}}}var ae=am(b.api.events.JWPLAYER_COMPONENT_SHOW);var W=am(b.api.events.JWPLAYER_COMPONENT_HIDE);return this}})(jwplayer);(function(e){var f=e.utils;var d=f.css;e.html5.dock=function(H,P){function G(){return{align:e.html5.view.positions.RIGHT}}var W=f.extend({},G(),P);if(W.align=="FALSE"){return}var aa={};var a=[];var Z;var L;var ac=false;var Q=false;var ab={x:0,y:0,width:0,height:0};var b;var V;var c;var X=new e.html5.eventdispatcher();f.extend(this,X);var R=document.createElement("div");R.id=H.id+"_jwplayer_dock";R.style.opacity=1;U();H.jwAddEventListener(e.api.events.JWPLAYER_PLAYER_STATE,T);this.getDisplayElement=function(){return R};this.setButton=function(g,k,j,h){if(!k&&aa[g]){f.arrays.remove(a,g);R.removeChild(aa[g].div);delete aa[g]}else{if(k){if(!aa[g]){aa[g]={}}aa[g].handler=k;aa[g].outGraphic=j;aa[g].overGraphic=h;if(!aa[g].div){a.push(g);aa[g].div=document.createElement("div");aa[g].div.style.position="relative";R.appendChild(aa[g].div);aa[g].div.appendChild(document.createElement("img"));aa[g].div.childNodes[0].style.position="absolute";aa[g].div.childNodes[0].style.left=0;aa[g].div.childNodes[0].style.top=0;aa[g].div.childNodes[0].style.zIndex=10;aa[g].div.childNodes[0].style.cursor="pointer";aa[g].div.appendChild(document.createElement("img"));aa[g].div.childNodes[1].style.position="absolute";aa[g].div.childNodes[1].style.left=0;aa[g].div.childNodes[1].style.top=0;if(H.skin.getSkinElement("dock","button")){aa[g].div.childNodes[1].src=H.skin.getSkinElement("dock","button").src}aa[g].div.childNodes[1].style.zIndex=9;aa[g].div.childNodes[1].style.cursor="pointer";aa[g].div.onmouseover=function(){if(aa[g].overGraphic){aa[g].div.childNodes[0].src=aa[g].overGraphic}if(H.skin.getSkinElement("dock","buttonOver")){aa[g].div.childNodes[1].src=H.skin.getSkinElement("dock","buttonOver").src}};aa[g].div.onmouseout=function(){if(aa[g].outGraphic){aa[g].div.childNodes[0].src=aa[g].outGraphic}if(H.skin.getSkinElement("dock","button")){aa[g].div.childNodes[1].src=H.skin.getSkinElement("dock","button").src}};if(H.skin.getSkinElement("dock","button")){aa[g].div.childNodes[1].src=H.skin.getSkinElement("dock","button").src}}if(aa[g].outGraphic){aa[g].div.childNodes[0].src=aa[g].outGraphic}else{if(aa[g].overGraphic){aa[g].div.childNodes[0].src=aa[g].overGraphic}}if(k){aa[g].div.onclick=function(l){l.preventDefault();e(H.id).callback(g);if(aa[g].overGraphic){aa[g].div.childNodes[0].src=aa[g].overGraphic}if(H.skin.getSkinElement("dock","button")){aa[g].div.childNodes[1].src=H.skin.getSkinElement("dock","button").src}}}}}Y(Z,L)};function N(g){}function Y(u,h){U();if(a.length>0){var t=10;var j=t;var m=-1;var l=H.skin.getSkinElement("dock","button").height;var n=H.skin.getSkinElement("dock","button").width;var p=u-n-t;var k,q;if(W.align==e.html5.view.positions.LEFT){m=1;p=t}for(var s=0;s<a.length;s++){var g=Math.floor(j/h);if((j+l+t)>((g+1)*h)){j=((g+1)*h)+t;g=Math.floor(j/h)}var r=aa[a[s]].div;r.style.top=(j%h)+"px";r.style.left=(p+(H.skin.getSkinElement("dock","button").width+t)*g*m)+"px";var o={x:f.parseDimension(r.style.left),y:f.parseDimension(r.style.top),width:n,height:l};if(!k||(o.x<=k.x&&o.y<=k.y)){k=o}if(!q||(o.x>=q.x&&o.y>=q.y)){q=o}j+=H.skin.getSkinElement("dock","button").height+t}ab={x:k.x,y:k.y,width:q.x-k.x+q.width,height:k.y-q.y+q.height}}if(Q!=H.jwGetFullscreen()||Z!=u||L!=h){Z=u;L=h;Q=H.jwGetFullscreen();b=undefined;setTimeout(O,1)}}function ae(g){return function(){if(!ac&&b!=g&&a.length>0){b=g;X.sendEvent(g,{component:"dock",boundingRect:ab})}}}function T(g){if(f.isMobile()){if(g.newstate==e.api.events.state.IDLE){I()}else{ad()}}else{S()}}function S(g){if(ac){return}clearTimeout(c);if(P.position==e.html5.view.positions.OVER||H.jwGetFullscreen()){switch(H.jwGetState()){case e.api.events.state.PAUSED:case e.api.events.state.IDLE:if(R&&R.style.opacity<1&&(!P.idlehide||f.exists(g))){M()}if(P.idlehide){c=setTimeout(function(){K()},2000)}break;default:if(f.exists(g)){M()}c=setTimeout(function(){K()},2000);break}}else{M()}}var O=ae(e.api.events.JWPLAYER_COMPONENT_SHOW);var J=ae(e.api.events.JWPLAYER_COMPONENT_HIDE);this.resize=Y;var I=function(){d(R,{display:"block"});if(ac){ac=false;O()}};var ad=function(){d(R,{display:"none"});if(!ac){J();ac=true}};function K(){if(!ac){J();if(R.style.opacity==1){f.cancelAnimation(R);f.fadeTo(R,0,0.1,1,0)}}}function M(){if(!ac){O();if(R.style.opacity==0){f.cancelAnimation(R);f.fadeTo(R,1,0.1,0,0)}}}function U(){V=document.getElementById(H.id);V.addEventListener("mousemove",S)}this.hide=ad;this.show=I;return this}})(jwplayer);(function(b){b.html5.eventdispatcher=function(e,a){var f=new b.events.eventdispatcher(a);b.utils.extend(this,f);this.sendEvent=function(d,c){if(!b.utils.exists(c)){c={}}b.utils.extend(c,{id:e,version:b.version,type:d});f.sendEvent(d,c)}}})(jwplayer);(function(d){var c={prefix:"",file:"",link:"",margin:8,out:0.5,over:1,timeout:5,hide:true,position:"bottom-left"};_css=d.utils.css;d.html5.logo=function(A,w){var x=A;var a;var J;var b;var F=false;G();function G(){z();x.jwAddEventListener(d.api.events.JWPLAYER_PLAYER_STATE,E);K();C()}function z(){if(c.prefix){var f=A.version.split(/\W/).splice(0,2).join("/");if(c.prefix.indexOf(f)<0){c.prefix+=f+"/"}}if(w.position==d.html5.view.positions.OVER){w.position=c.position}try{if(window.location.href.indexOf("https")==0){c.prefix=c.prefix.replace("http://l.longtailvideo.com","https://securel.longtailvideo.com")}}catch(e){}J=d.utils.extend({},c,w)}function K(){b=document.createElement("img");b.id=x.id+"_jwplayer_logo";b.style.display="none";b.onload=function(e){_css(b,D());y()};if(!J.file){return}if(J.file.indexOf("/")>=0){b.src=J.file}else{b.src=J.prefix+J.file}}if(!J.file){return}this.resize=function(e,f){};this.getDisplayElement=function(){return b};function C(){if(J.link){b.onmouseover=H;b.onmouseout=y;b.onclick=v}else{this.mouseEnabled=false}}function v(e){if(typeof e!="undefined"){e.stopPropagation()}if(!F){return}x.jwPause();x.jwSetFullscreen(false);if(J.link){window.open(J.link,"_top")}return}function y(e){if(J.link&&F){b.style.opacity=J.out}return}function H(e){if(F){b.style.opacity=J.over}return}function D(){var e={textDecoration:"none",position:"absolute",cursor:"pointer"};e.display=(J.hide.toString()=="true"&&!F)?"none":"block";var f=J.position.toLowerCase().split("-");for(var g in f){e[f[g]]=J.margin}return e}function B(){if(J.hide.toString()=="true"){b.style.display="block";b.style.opacity=0;d.utils.fadeTo(b,J.out,0.1,parseFloat(b.style.opacity));a=setTimeout(function(){I()},J.timeout*1000)}F=true}function I(){F=false;if(J.hide.toString()=="true"){d.utils.fadeTo(b,0,0.1,parseFloat(b.style.opacity))}}function E(e){if(e.newstate==d.api.events.state.BUFFERING){clearTimeout(a);B()}}return this}})(jwplayer);(function(f){var j={ended:f.api.events.state.IDLE,playing:f.api.events.state.PLAYING,pause:f.api.events.state.PAUSED,buffering:f.api.events.state.BUFFERING};var h=f.utils;var k=h.css;var g=h.isMobile();f.html5.mediavideo=function(al,T){var V={abort:ae,canplay:ai,canplaythrough:ai,durationchange:b,emptied:ae,ended:ai,error:O,loadeddata:b,loadedmetadata:b,loadstart:ai,pause:ai,play:ae,playing:ai,progress:e,ratechange:ae,seeked:ai,seeking:ai,stalled:ai,suspend:ai,timeupdate:P,volumechange:W,waiting:ai,canshowcurrentframe:ae,dataunavailable:ae,empty:ae,load:Y,loadedfirstframe:ae,webkitfullscreenchange:ak};var aj=new f.html5.eventdispatcher();h.extend(this,aj);var ad=al,ah=T,ag,S,U,af,an,a=false,aa=false,R,ab,Z;ac();this.load=function(n,m){if(typeof m=="undefined"){m=true}if(!aa){return}af=n;h.empty(ag);Z=0;if(n.levels&&n.levels.length>0){if(n.levels.length==1){ag.src=n.levels[0].file}else{ao(n.levels);if(ag.src){ag.removeAttribute("src")}for(var o=0;o<n.levels.length;o++){var l=ag.ownerDocument.createElement("source");l.src=n.levels[o].file;ag.appendChild(l);Z++}}}else{ag.src=n.file}if(g){if(n.image){ag.poster=n.image}ag.style.display="block";setTimeout(function(){ag.setAttribute("controls","controls")},100)}R=ab=U=false;ad.buffer=0;if(!h.exists(n.start)){n.start=0}ad.duration=n.duration;aj.sendEvent(f.api.events.JWPLAYER_MEDIA_LOADED);if((!g&&n.levels.length==1)||!a){ag.load()}a=false;if(m){N(f.api.events.state.BUFFERING);aj.sendEvent(f.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:0});this.play()}};this.play=function(){if(!aa){return}if(S!=f.api.events.state.PLAYING){Q();if(ab){N(f.api.events.state.PLAYING)}else{N(f.api.events.state.BUFFERING)}ag.play()}};this.pause=function(){if(!aa){return}ag.pause();N(f.api.events.state.PAUSED)};this.seek=function(l){if(!aa){return}if(!(ad.duration<=0||isNaN(ad.duration))&&!(ad.position<=0||isNaN(ad.position))){ag.currentTime=l;ag.play()}};_stop=this.stop=function(n){if(!aa){return}if(!h.exists(n)){n=true}am();if(n){ag.style.display="none";ab=false;var m=navigator.userAgent;if(m.match(/chrome/i)){ag.src=undefined}else{if(m.match(/safari/i)||m.match(/firefox/i)){ag.removeAttribute("src")}else{ag.src=""}}ag.removeAttribute("controls");ag.removeAttribute("poster");h.empty(ag);ag.load();a=true;if(ag.webkitSupportsFullscreen){try{ag.webkitExitFullscreen()}catch(l){}}}N(f.api.events.state.IDLE)};this.fullscreen=function(l){if(l===true){this.resize("100%","100%")}else{this.resize(ad.config.width,ad.config.height)}};this.resize=function(l,m){};this.volume=function(l){if(!g){ag.volume=l/100}};this.mute=function(l){if(!g){ag.muted=l}};this.getDisplayElement=function(){return ag};this.hasChrome=function(){return g};this.detachMedia=function(){aa=false;return this.getDisplayElement()};this.attachMedia=function(){aa=true};function X(l,m){return function(n){if(aa&&h.exists(n.target.parentNode)){m(n)}}}function ac(){ag=document.createElement("video");S=f.api.events.state.IDLE;for(var l in V){ag.addEventListener(l,X(l,V[l]),true)}aa=true;ag.setAttribute("x-webkit-airplay","allow");if(ah.parentNode){ah.parentNode.replaceChild(ag,ah)}if(!ag.id){ag.id=ah.id}ag.volume=ad.volume/100}function N(m){if(m==f.api.events.state.PAUSED&&S==f.api.events.state.IDLE){return}if(S!=m){var l=S;ad.state=S=m;aj.sendEvent(f.api.events.JWPLAYER_PLAYER_STATE,{oldstate:l,newstate:m})}}function ae(l){}function W(m){var l=Math.round(ag.volume*100);if(l!=ad.volume){ad.volume=l;aj.sendEvent(f.api.events.JWPLAYER_MEDIA_VOLUME,{volume:ad.volume})}if(ag.muted!=ad.mute){ad.mute=ag.muted;aj.sendEvent(f.api.events.JWPLAYER_MEDIA_MUTE,{mute:ad.mute})}}function e(l){var m;if(h.exists(l)&&l.lengthComputable&&l.total){m=l.loaded/l.total*100}else{if(h.exists(ag.buffered)&&(ag.buffered.length>0)){var n=ag.buffered.length-1;if(n>=0){m=ag.buffered.end(n)/ag.duration*100}}}if(ab===false&&S==f.api.events.state.BUFFERING){aj.sendEvent(f.api.events.JWPLAYER_MEDIA_BUFFER_FULL);ab=true}if(!R){if(m==100){R=true}if(h.exists(m)&&(m>ad.buffer)){ad.buffer=Math.round(m);aj.sendEvent(f.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(m)})}}}function P(l){if(h.exists(l)&&h.exists(l.target)){if(!isNaN(l.target.duration)&&(isNaN(ad.duration)||ad.duration<1)){if(l.target.duration==Infinity){ad.duration=0}else{ad.duration=Math.round(l.target.duration*10)/10}}if(!U&&ag.readyState>0){ag.style.display="block";N(f.api.events.state.PLAYING)}if(S==f.api.events.state.PLAYING){if(!U&&ag.readyState>0){U=true;try{if(ag.currentTime<af.start){ag.currentTime=af.start}}catch(m){}ag.volume=ad.volume/100;ag.muted=ad.mute}ad.position=ad.duration>0?(Math.round(l.target.currentTime*10)/10):0;aj.sendEvent(f.api.events.JWPLAYER_MEDIA_TIME,{position:ad.position,duration:ad.duration});if(ad.position>=ad.duration&&(ad.position>0||ad.duration>0)){c()}}}e(l)}function Y(l){}function ai(l){if(j[l.type]){if(l.type=="ended"){c()}else{N(j[l.type])}}}function b(m){var n=Math.round(m.target.duration*10)/10;var l={height:m.target.videoHeight,width:m.target.videoWidth,duration:n};if((ad.duration<n||isNaN(ad.duration))&&m.target.duration!=Infinity){ad.duration=n}aj.sendEvent(f.api.events.JWPLAYER_MEDIA_META,{metadata:l})}function O(l){if(S==f.api.events.state.IDLE){return}var m="There was an error: ";if((l.target.error&&l.target.tagName.toLowerCase()=="video")||l.target.parentNode.error&&l.target.parentNode.tagName.toLowerCase()=="video"){var n=!h.exists(l.target.error)?l.target.parentNode.error:l.target.error;switch(n.code){case n.MEDIA_ERR_ABORTED:m="You aborted the video playback: ";break;case n.MEDIA_ERR_NETWORK:m="A network error caused the video download to fail part-way: ";break;case n.MEDIA_ERR_DECODE:m="The video playback was aborted due to a corruption problem or because the video used features your browser did not support: ";break;case n.MEDIA_ERR_SRC_NOT_SUPPORTED:m="The video could not be loaded, either because the server or network failed or because the format is not supported: ";break;default:m="An unknown error occurred: ";break}}else{if(l.target.tagName.toLowerCase()=="source"){Z--;if(Z>0){return}m="The video could not be loaded, either because the server or network failed or because the format is not supported: "}else{h.log("An unknown error occurred.  Continuing...");return}}_stop(false);m+=d();_error=true;aj.sendEvent(f.api.events.JWPLAYER_ERROR,{message:m});return}function d(){var m="";for(var n in af.levels){var o=af.levels[n];var l=ah.ownerDocument.createElement("source");m+=f.utils.getAbsolutePath(o.file);if(n<(af.levels.length-1)){m+=", "}}return m}function Q(){if(!h.exists(an)){an=setInterval(function(){e()},100)}}function am(){clearInterval(an);an=null}function c(){if(S!=f.api.events.state.IDLE){_stop(false);aj.sendEvent(f.api.events.JWPLAYER_MEDIA_COMPLETE)}}function ak(l){if(h.exists(ag.webkitDisplayingFullscreen)){if(ad.fullscreen&&!ag.webkitDisplayingFullscreen){aj.sendEvent(f.api.events.JWPLAYER_FULLSCREEN,{fullscreen:false})}}}function ao(m){if(m.length>0&&h.isIOS()){if(h.extension(m[0].file)!="mp4"){var o=-1;for(var n=1;n<m.length;n++){if(h.extension(m[n].file)=="mp4"){o=n;break}}if(o>-1){var l=m.splice(o,1)[0];m.unshift(l)}}}}}})(jwplayer);(function(e){var f={ended:e.api.events.state.IDLE,playing:e.api.events.state.PLAYING,pause:e.api.events.state.PAUSED,buffering:e.api.events.state.BUFFERING};var d=e.utils.css;e.html5.mediayoutube=function(r,v){var u=new e.html5.eventdispatcher();e.utils.extend(this,u);var p=r;var s=document.getElementById(v.id);var t=e.api.events.state.IDLE;var b,c;function q(h){if(t!=h){var g=t;p.state=h;t=h;u.sendEvent(e.api.events.JWPLAYER_PLAYER_STATE,{oldstate:g,newstate:h})}}this.getDisplayElement=this.detachMedia=function(){return s};this.attachMedia=function(){};this.play=function(){if(t==e.api.events.state.IDLE){u.sendEvent(e.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:100});u.sendEvent(e.api.events.JWPLAYER_MEDIA_BUFFER_FULL);q(e.api.events.state.PLAYING)}else{if(t==e.api.events.state.PAUSED){q(e.api.events.state.PLAYING)}}};this.pause=function(){q(e.api.events.state.PAUSED)};this.seek=function(g){};this.stop=function(g){if(!_utils.exists(g)){g=true}p.position=0;q(e.api.events.state.IDLE);if(g){d(s,{display:"none"})}};this.volume=function(g){p.volume=g;u.sendEvent(e.api.events.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(g)})};this.mute=function(g){s.muted=g;p.mute=g;u.sendEvent(e.api.events.JWPLAYER_MEDIA_MUTE,{mute:g})};this.resize=function(g,h){if(g*h>0&&b){b.width=c.width=g;b.height=c.height=h}};this.fullscreen=function(g){if(g===true){this.resize("100%","100%")}else{this.resize(p.config.width,p.config.height)}};this.load=function(g){a(g);d(b,{display:"block"});q(e.api.events.state.BUFFERING);u.sendEvent(e.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:0});u.sendEvent(e.api.events.JWPLAYER_MEDIA_LOADED);this.play()};this.hasChrome=function(){return(t!=e.api.events.state.IDLE)};function a(g){var k=g.levels[0].file;k=["http://www.youtube.com/v/",w(k),"&amp;hl=en_US&amp;fs=1&autoplay=1"].join("");b=document.createElement("object");b.id=s.id;b.style.position="absolute";var h={movie:k,allowfullscreen:"true",allowscriptaccess:"always"};for(var n in h){var j=document.createElement("param");j.name=n;j.value=h[n];b.appendChild(j)}c=document.createElement("embed");b.appendChild(c);var m={src:k,type:"application/x-shockwave-flash",allowfullscreen:"true",allowscriptaccess:"always",width:b.width,height:b.height};for(var l in m){c.setAttribute(l,m[l])}b.appendChild(c);b.style.zIndex=2147483000;if(s!=b&&s.parentNode){s.parentNode.replaceChild(b,s)}s=b}function w(j){var k=j.split(/\?|\#\!/);var g="";for(var h=0;h<k.length;h++){if(k[h].substr(0,2)=="v="){g=k[h].substr(2)}}if(g==""){if(j.indexOf("/v/")>=0){g=j.substr(j.indexOf("/v/")+3)}else{if(j.indexOf("youtu.be")>=0){g=j.substr(j.indexOf("youtu.be/")+9)}else{g=j}}}if(g.indexOf("?")>-1){g=g.substr(0,g.indexOf("?"))}if(g.indexOf("&")>-1){g=g.substr(0,g.indexOf("&"))}return g}this.embed=c;return this}})(jwplayer);(function(jwplayer){var _configurableStateVariables=["width","height","start","duration","volume","mute","fullscreen","item","plugins","stretching"];jwplayer.html5.model=function(api,container,options){var _api=api;var _container=container;var _model={id:_container.id,playlist:[],state:jwplayer.api.events.state.IDLE,position:0,buffer:0,config:{width:480,height:320,item:-1,skin:undefined,file:undefined,image:undefined,start:0,duration:0,bufferlength:5,volume:90,mute:false,fullscreen:false,repeat:"",stretching:jwplayer.utils.stretching.UNIFORM,autostart:false,debug:undefined,screencolor:undefined}};var _media;var _eventDispatcher=new jwplayer.html5.eventdispatcher();var _components=["display","logo","controlbar","playlist","dock"];jwplayer.utils.extend(_model,_eventDispatcher);for(var option in options){if(typeof options[option]=="string"){var type=/color$/.test(option)?"color":null;options[option]=jwplayer.utils.typechecker(options[option],type)}var config=_model.config;var path=option.split(".");for(var edge in path){if(edge==path.length-1){config[path[edge]]=options[option]}else{if(!jwplayer.utils.exists(config[path[edge]])){config[path[edge]]={}}config=config[path[edge]]}}}for(var index in _configurableStateVariables){var configurableStateVariable=_configurableStateVariables[index];_model[configurableStateVariable]=_model.config[configurableStateVariable]}var pluginorder=_components.concat([]);if(jwplayer.utils.exists(_model.plugins)){if(typeof _model.plugins=="string"){var userplugins=_model.plugins.split(",");for(var userplugin in userplugins){if(typeof userplugins[userplugin]=="string"){pluginorder.push(userplugins[userplugin].replace(/^\s+|\s+$/g,""))}}}}if(jwplayer.utils.isMobile()){pluginorder=["display","logo","dock","playlist"];if(!jwplayer.utils.exists(_model.config.repeat)){_model.config.repeat="list"}}else{if(_model.config.chromeless){pluginorder=["logo","dock","playlist"];if(!jwplayer.utils.exists(_model.config.repeat)){_model.config.repeat="list"}}}_model.plugins={order:pluginorder,config:{},object:{}};if(typeof _model.config.components!="undefined"){for(var component in _model.config.components){_model.plugins.config[component]=_model.config.components[component]}}var playlistVisible=false;for(var pluginIndex in _model.plugins.order){var pluginName=_model.plugins.order[pluginIndex];var pluginConfig=!jwplayer.utils.exists(_model.plugins.config[pluginName])?{}:_model.plugins.config[pluginName];_model.plugins.config[pluginName]=!jwplayer.utils.exists(_model.plugins.config[pluginName])?pluginConfig:jwplayer.utils.extend(_model.plugins.config[pluginName],pluginConfig);if(!jwplayer.utils.exists(_model.plugins.config[pluginName].position)){if(pluginName=="playlist"){_model.plugins.config[pluginName].position=jwplayer.html5.view.positions.NONE}else{_model.plugins.config[pluginName].position=jwplayer.html5.view.positions.OVER}}else{if(pluginName=="playlist"){playlistVisible=true}_model.plugins.config[pluginName].position=_model.plugins.config[pluginName].position.toString().toUpperCase()}}if(_model.plugins.config.controlbar&&playlistVisible){_model.plugins.config.controlbar.hideplaylistcontrols=true}if(typeof _model.plugins.config.dock!="undefined"){if(typeof _model.plugins.config.dock!="object"){var position=_model.plugins.config.dock.toString().toUpperCase();_model.plugins.config.dock={position:position}}if(typeof _model.plugins.config.dock.position!="undefined"){_model.plugins.config.dock.align=_model.plugins.config.dock.position;_model.plugins.config.dock.position=jwplayer.html5.view.positions.OVER}if(typeof _model.plugins.config.dock.idlehide=="undefined"){try{_model.plugins.config.dock.idlehide=_model.plugins.config.controlbar.idlehide}catch(e){}}}function _loadExternal(playlistfile){var loader=new jwplayer.html5.playlistloader();loader.addEventListener(jwplayer.api.events.JWPLAYER_PLAYLIST_LOADED,function(evt){_model.playlist=new jwplayer.html5.playlist(evt);_loadComplete(true)});loader.addEventListener(jwplayer.api.events.JWPLAYER_ERROR,function(evt){_model.playlist=new jwplayer.html5.playlist({playlist:[]});_loadComplete(false)});loader.load(playlistfile)}function _loadComplete(){if(_model.config.shuffle){_model.item=_getShuffleItem()}else{if(_model.config.item>=_model.playlist.length){_model.config.item=_model.playlist.length-1}else{if(_model.config.item<0){_model.config.item=0}}_model.item=_model.config.item}_model.position=0;_model.duration=_model.playlist.length>0?_model.playlist[_model.item].duration:0;_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:_model.playlist});_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_PLAYLIST_ITEM,{index:_model.item})}_model.loadPlaylist=function(arg){var input;if(typeof arg=="string"){if(arg.indexOf("[")==0||arg.indexOf("{")=="0"){try{input=eval(arg)}catch(err){input=arg}}else{input=arg}}else{input=arg}var config;switch(jwplayer.utils.typeOf(input)){case"object":config=input;break;case"array":config={playlist:input};break;default:config={file:input};break}_model.playlist=new jwplayer.html5.playlist(config);_model.item=_model.config.item>=0?_model.config.item:0;if(!_model.playlist[_model.item].provider){_loadExternal(_model.playlist[_model.item].file)}else{_loadComplete()}};function _getShuffleItem(){var result=null;if(_model.playlist.length>1){while(!jwplayer.utils.exists(result)){result=Math.floor(Math.random()*_model.playlist.length);if(result==_model.item){result=null}}}else{result=0}return result}function forward(evt){if(evt.type==jwplayer.api.events.JWPLAYER_MEDIA_LOADED){_container=_media.getDisplayElement()}_eventDispatcher.sendEvent(evt.type,evt)}var _mediaProviders={};_model.setActiveMediaProvider=function(playlistItem){if(playlistItem.provider=="audio"){playlistItem.provider="sound"}var provider=playlistItem.provider;var current=_media?_media.getDisplayElement():null;if(provider=="sound"||provider=="http"||provider==""){provider="video"}if(!jwplayer.utils.exists(_mediaProviders[provider])){switch(provider){case"video":_media=new jwplayer.html5.mediavideo(_model,current?current:_container);break;case"youtube":_media=new jwplayer.html5.mediayoutube(_model,current?current:_container);break}if(!jwplayer.utils.exists(_media)){return false}_media.addGlobalListener(forward);_mediaProviders[provider]=_media}else{if(_media!=_mediaProviders[provider]){if(_media){_media.stop()}_media=_mediaProviders[provider]}}return true};_model.getMedia=function(){return _media};_model.seek=function(pos){_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_MEDIA_SEEK,{position:_model.position,offset:pos});return _media.seek(pos)};_model.setupPlugins=function(){if(!jwplayer.utils.exists(_model.plugins)||!jwplayer.utils.exists(_model.plugins.order)||_model.plugins.order.length==0){jwplayer.utils.log("No plugins to set up");return _model}for(var i=0;i<_model.plugins.order.length;i++){try{var pluginName=_model.plugins.order[i];if(jwplayer.utils.exists(jwplayer.html5[pluginName])){if(pluginName=="playlist"){_model.plugins.object[pluginName]=new jwplayer.html5.playlistcomponent(_api,_model.plugins.config[pluginName])}else{_model.plugins.object[pluginName]=new jwplayer.html5[pluginName](_api,_model.plugins.config[pluginName])}}else{_model.plugins.order.splice(plugin,plugin+1)}if(typeof _model.plugins.object[pluginName].addGlobalListener=="function"){_model.plugins.object[pluginName].addGlobalListener(forward)}}catch(err){jwplayer.utils.log("Could not setup "+pluginName)}}};return _model}})(jwplayer);(function(b){b.html5.playlist=function(a){var e=[];if(a.playlist&&a.playlist instanceof Array&&a.playlist.length>0){for(var f in a.playlist){if(!isNaN(parseInt(f))){e.push(new b.html5.playlistitem(a.playlist[f]))}}}else{e.push(new b.html5.playlistitem(a))}return e}})(jwplayer);(function(e){var f={size:180,position:e.html5.view.positions.NONE,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""};var d={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"};_utils=e.utils;_css=_utils.css;_hide=function(a){_css(a,{display:"none"})};_show=function(a){_css(a,{display:"block"})};e.html5.playlistcomponent=function(J,K){var D=J;var X=e.utils.extend({},f,D.skin.getComponentSettings("playlist"),K);if(X.position==e.html5.view.positions.NONE||typeof e.html5.view.positions[X.position]=="undefined"){return}var c;var R;var I;var Y;var V;var W;var S=-1;var U={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return c};this.resize=function(g,j){R=g;I=j;if(D.jwGetFullscreen()){_hide(c)}else{var h={display:"block",width:R,height:I};_css(c,h)}};this.show=function(){_show(c)};this.hide=function(){_hide(c)};function T(){c=document.createElement("div");c.id=D.id+"_jwplayer_playlistcomponent";c.style.overflow="hidden";switch(X.position){case e.html5.view.positions.RIGHT:case e.html5.view.positions.LEFT:c.style.width=X.size+"px";break;case e.html5.view.positions.TOP:case e.html5.view.positions.BOTTOM:c.style.height=X.size+"px";break}M();if(U.item){X.itemheight=U.item.height}c.style.backgroundColor="#C6C6C6";D.jwAddEventListener(e.api.events.JWPLAYER_PLAYLIST_LOADED,H);D.jwAddEventListener(e.api.events.JWPLAYER_PLAYLIST_ITEM,F);D.jwAddEventListener(e.api.events.JWPLAYER_PLAYER_STATE,Q)}function N(){var g=document.createElement("ul");_css(g,{width:c.style.width,minWidth:c.style.width,height:c.style.height,backgroundColor:X.backgroundcolor,backgroundImage:U.background?"url("+U.background.src+")":"",color:X.fontcolor,listStyle:"none",margin:0,padding:0,fontFamily:d[X.font]?d[X.font]:d._sans,fontSize:(X.fontsize?X.fontsize:11)+"px",fontStyle:X.fontstyle,fontWeight:X.fontweight,overflowY:"auto"});return g}function b(g){return function(){var k=W.getElementsByClassName("item")[g];var j=X.fontcolor;var h=U.item?"url("+U.item.src+")":"";if(g==D.jwGetPlaylistIndex()){if(X.activecolor!==""){j=X.activecolor}if(U.itemActive){h="url("+U.itemActive.src+")"}}_css(k,{color:X.overcolor!==""?X.overcolor:j,backgroundImage:U.itemOver?"url("+U.itemOver.src+")":h})}}function O(g){return function(){var k=W.getElementsByClassName("item")[g];var j=X.fontcolor;var h=U.item?"url("+U.item.src+")":"";if(g==D.jwGetPlaylistIndex()){if(X.activecolor!==""){j=X.activecolor}if(U.itemActive){h="url("+U.itemActive.src+")"}}_css(k,{color:j,backgroundImage:h})}}function L(p){var h=Y[p];var j=document.createElement("li");j.className="item";_css(j,{height:X.itemheight,display:"block",cursor:"pointer",backgroundImage:U.item?"url("+U.item.src+")":"",backgroundSize:"100% "+X.itemheight+"px"});j.onmouseover=b(p);j.onmouseout=O(p);var o=document.createElement("div");var s=new Image();var n=0;var m=0;var l=0;if(E()&&(h.image||h["playlist.image"]||U.itemImage)){s.className="image";if(U.itemImage){n=(X.itemheight-U.itemImage.height)/2;m=U.itemImage.width;l=U.itemImage.height}else{m=X.itemheight*4/3;l=X.itemheight}_css(o,{height:l,width:m,"float":"left",styleFloat:"left",cssFloat:"left",margin:"0 5px 0 0",background:"black",overflow:"hidden",margin:n+"px",position:"relative"});_css(s,{position:"relative"});o.appendChild(s);s.onload=function(){e.utils.stretch(e.utils.stretching.FILL,s,m,l,this.naturalWidth,this.naturalHeight)};if(h["playlist.image"]){s.src=h["playlist.image"]}else{if(h.image){s.src=h.image}else{if(U.itemImage){s.src=U.itemImage.src}}}j.appendChild(o)}var t=R-m-n*2;if(I<X.itemheight*Y.length){t-=15}var g=document.createElement("div");_css(g,{position:"relative",height:"100%",overflow:"hidden"});var r=document.createElement("span");if(h.duration>0){r.className="duration";_css(r,{fontSize:(X.fontsize?X.fontsize:11)+"px",fontWeight:(X.fontweight?X.fontweight:"bold"),width:"40px",height:X.fontsize?X.fontsize+10:20,lineHeight:24,"float":"right",styleFloat:"right",cssFloat:"right"});r.innerHTML=_utils.timeFormat(h.duration);g.appendChild(r)}var k=document.createElement("span");k.className="title";_css(k,{padding:"5px 5px 0 "+(n?0:"5px"),height:X.fontsize?X.fontsize+10:20,lineHeight:X.fontsize?X.fontsize+10:20,overflow:"hidden","float":"left",styleFloat:"left",cssFloat:"left",width:((h.duration>0)?t-50:t)-10+"px",fontSize:(X.fontsize?X.fontsize:13)+"px",fontWeight:(X.fontweight?X.fontweight:"bold")});k.innerHTML=h?h.title:"";g.appendChild(k);if(h.description){var q=document.createElement("span");q.className="description";_css(q,{display:"block","float":"left",styleFloat:"left",cssFloat:"left",margin:0,paddingLeft:k.style.paddingLeft,paddingRight:k.style.paddingRight,lineHeight:(X.fontsize?X.fontsize+4:16)+"px",overflow:"hidden",position:"relative"});q.innerHTML=h.description;g.appendChild(q)}j.appendChild(g);return j}function H(j){c.innerHTML="";Y=D.jwGetPlaylist();if(!Y){return}items=[];W=N();for(var h=0;h<Y.length;h++){var k=L(h);k.onclick=a(h);W.appendChild(k);items.push(k)}S=D.jwGetPlaylistIndex();O(S)();c.appendChild(W);if(_utils.isIOS()&&window.iScroll){W.style.height=X.itemheight*Y.length+"px";var g=new iScroll(c.id)}}function a(g){return function(){D.jwPlaylistItem(g);D.jwPlay(true)}}function P(){W.scrollTop=D.jwGetPlaylistIndex()*X.itemheight}function E(){return X.thumbs.toString().toLowerCase()=="true"}function F(g){if(S>=0){O(S)();S=g.index}O(g.index)();P()}function Q(){if(X.position==e.html5.view.positions.OVER){switch(D.jwGetState()){case e.api.events.state.IDLE:_show(c);break;default:_hide(c);break}}}function M(){for(var g in U){U[g]=G(g)}}function G(g){return D.skin.getSkinElement("playlist",g)}T();return this}})(jwplayer);(function(c){c.html5.playlistitem=function(b){var a={author:"",date:"",description:"",image:"",link:"",mediaid:"",tags:"",title:"",provider:"",file:"",streamer:"",duration:-1,start:0,currentLevel:-1,levels:[]};var f=c.utils.extend({},a,b);if(f.type){f.provider=f.type;delete f.type}if(f.levels.length===0){f.levels[0]=new c.html5.playlistitemlevel(f)}if(!f.provider){f.provider=d(f.levels[0])}else{f.provider=f.provider.toLowerCase()}return f};function d(b){if(c.utils.isYouTube(b.file)){return"youtube"}else{var a=c.utils.extension(b.file);var h;if(a&&c.utils.extensionmap[a]){if(a=="m3u8"){return"video"}h=c.utils.extensionmap[a].html5}else{if(b.type){h=b.type}}if(h){var g=h.split("/")[0];if(g=="audio"){return"sound"}else{if(g=="video"){return g}}}}return""}})(jwplayer);(function(b){b.html5.playlistitemlevel=function(a){var e={file:"",streamer:"",bitrate:0,width:0};for(var f in e){if(b.utils.exists(a[f])){e[f]=a[f]}}return e}})(jwplayer);(function(b){b.html5.playlistloader=function(){var f=new b.html5.eventdispatcher();b.utils.extend(this,f);this.load=function(c){b.utils.ajax(c,e,a)};function e(d){var j=[];try{var j=b.utils.parsers.rssparser.parse(d.responseXML.firstChild);f.sendEvent(b.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:new b.html5.playlist({playlist:j})})}catch(c){a("Could not parse the playlist")}}function a(c){f.sendEvent(b.api.events.JWPLAYER_ERROR,{message:c?c:"Could not load playlist an unknown reason."})}}})(jwplayer);(function(b){b.html5.skin=function(){var a={};var d=false;this.load=function(f,c){new b.html5.skinloader(f,function(e){d=true;a=e;c()},function(){new b.html5.skinloader("",function(e){d=true;a=e;c()})})};this.getSkinElement=function(h,g){if(d){try{return a[h].elements[g]}catch(c){b.utils.log("No such skin component / element: ",[h,g])}}return null};this.getComponentSettings=function(c){if(d){return a[c].settings}return null};this.getComponentLayout=function(c){if(d){return a[c].layout}return null}}})(jwplayer);(function(b){b.html5.skinloader=function(D,u,z){var v={};var G=u;var y=z;var E=true;var A;var w=D;var I=false;function x(){if(typeof w!="string"||w===""){F(b.html5.defaultSkin().xml)}else{b.utils.ajax(b.utils.getAbsolutePath(w),function(d){try{if(b.utils.exists(d.responseXML)){F(d.responseXML);return}}catch(c){B()}F(b.html5.defaultSkin().xml)},function(c){F(b.html5.defaultSkin().xml)})}}function F(m){var U=m.getElementsByTagName("component");if(U.length===0){return}for(var p=0;p<U.length;p++){var W=U[p].getAttribute("name");var X={settings:{},elements:{},layout:{}};v[W]=X;var s=U[p].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var S=0;S<s.length;S++){H(s[S],W)}var k=U[p].getElementsByTagName("settings")[0];if(k&&k.childNodes.length>0){var j=k.getElementsByTagName("setting");for(var d=0;d<j.length;d++){var c=j[d].getAttribute("name");var n=j[d].getAttribute("value");var o=/color$/.test(c)?"color":null;v[W].settings[c]=b.utils.typechecker(n,o)}}var h=U[p].getElementsByTagName("layout")[0];if(h&&h.childNodes.length>0){var g=h.getElementsByTagName("group");for(var q=0;q<g.length;q++){var Y=g[q];v[W].layout[Y.getAttribute("position")]={elements:[]};for(var e=0;e<Y.attributes.length;e++){var V=Y.attributes[e];v[W].layout[Y.getAttribute("position")][V.name]=V.value}var f=Y.getElementsByTagName("*");for(var r=0;r<f.length;r++){var T=f[r];v[W].layout[Y.getAttribute("position")].elements.push({type:T.tagName});for(var R=0;R<T.attributes.length;R++){var l=T.attributes[R];v[W].layout[Y.getAttribute("position")].elements[r][l.name]=l.value}if(!b.utils.exists(v[W].layout[Y.getAttribute("position")].elements[r].name)){v[W].layout[Y.getAttribute("position")].elements[r].name=T.tagName}}}}E=false;a()}}function a(){clearInterval(A);if(!I){A=setInterval(function(){t()},100)}}function H(k,d){var e=new Image();var h=k.getAttribute("name");var f=k.getAttribute("src");var c;if(f.indexOf("data:image/png;base64,")===0){c=f}else{var g=b.utils.getAbsolutePath(w);var j=g.substr(0,g.lastIndexOf("/"));c=[j,d,f].join("/")}v[d].elements[h]={height:0,width:0,src:"",ready:false,image:e};e.onload=function(l){C(e,h,d)};e.onerror=function(l){I=true;a();y()};e.src=c}function B(){for(var f in v){var d=v[f];for(var g in d.elements){var c=d.elements[g];var e=c.image;e.onload=null;e.onerror=null;delete c.image;delete d.elements[g]}delete v[f]}}function t(){for(var d in v){if(d!="properties"){for(var c in v[d].elements){if(!v[d].elements[c].ready){return}}}}if(E===false){clearInterval(A);G(v)}}function C(e,c,d){if(v[d]&&v[d].elements[c]){v[d].elements[c].height=e.height;v[d].elements[c].width=e.width;v[d].elements[c].src=e.src;v[d].elements[c].ready=true;a()}else{b.utils.log("Loaded an image for a missing element: "+d+"."+c)}}x()}})(jwplayer);(function(b){b.html5.api=function(x,a){var o={};var u=document.createElement("div");x.parentNode.replaceChild(u,x);u.id=x.id;o.version=b.version;o.id=u.id;var p=new b.html5.model(o,u,a);var r=new b.html5.view(o,u,p);var q=new b.html5.controller(o,u,p,r);o.skin=new b.html5.skin();o.jwPlay=function(c){if(typeof c=="undefined"){v()}else{if(c.toString().toLowerCase()=="true"){q.play()}else{q.pause()}}};o.jwPause=function(c){if(typeof c=="undefined"){v()}else{if(c.toString().toLowerCase()=="true"){q.pause()}else{q.play()}}};function v(){if(p.state==b.api.events.state.PLAYING||p.state==b.api.events.state.BUFFERING){q.pause()}else{q.play()}}o.jwStop=q.stop;o.jwSeek=q.seek;o.jwPlaylistItem=q.item;o.jwPlaylistNext=q.next;o.jwPlaylistPrev=q.prev;o.jwResize=q.resize;o.jwLoad=q.load;o.jwDetachMedia=q.detachMedia;o.jwAttachMedia=q.attachMedia;function s(c){return function(){return p[c]}}function w(e,c,d){return function(){var f=p.plugins.object[e];if(f&&f[c]&&typeof f[c]=="function"){f[c].apply(f,d)}}}o.jwGetItem=s("item");o.jwGetPosition=s("position");o.jwGetDuration=s("duration");o.jwGetBuffer=s("buffer");o.jwGetWidth=s("width");o.jwGetHeight=s("height");o.jwGetFullscreen=s("fullscreen");o.jwSetFullscreen=q.setFullscreen;o.jwGetVolume=s("volume");o.jwSetVolume=q.setVolume;o.jwGetMute=s("mute");o.jwSetMute=q.setMute;o.jwGetStretching=function(){return p.stretching.toUpperCase()};o.jwGetState=s("state");o.jwGetVersion=function(){return o.version};o.jwGetPlaylist=function(){return p.playlist};o.jwGetPlaylistIndex=o.jwGetItem;o.jwAddEventListener=q.addEventListener;o.jwRemoveEventListener=q.removeEventListener;o.jwSendEvent=q.sendEvent;o.jwDockSetButton=function(c,f,e,d){if(p.plugins.object.dock&&p.plugins.object.dock.setButton){p.plugins.object.dock.setButton(c,f,e,d)}};o.jwControlbarShow=w("controlbar","show");o.jwControlbarHide=w("controlbar","hide");o.jwDockShow=w("dock","show");o.jwDockHide=w("dock","hide");o.jwDisplayShow=w("display","show");o.jwDisplayHide=w("display","hide");o.jwGetLevel=function(){};o.jwGetBandwidth=function(){};o.jwGetLockState=function(){};o.jwLock=function(){};o.jwUnlock=function(){};function y(){if(p.config.playlistfile){p.addEventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,t);p.loadPlaylist(p.config.playlistfile)}else{if(typeof p.config.playlist=="string"){p.addEventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,t);p.loadPlaylist(p.config.playlist)}else{p.loadPlaylist(p.config);setTimeout(t,25)}}}function t(c){p.removeEventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,t);p.setupPlugins();r.setup();var c={id:o.id,version:o.version};q.playerReady(c)}if(p.config.chromeless&&!b.utils.isIOS()){y()}else{o.skin.load(p.config.skin,y)}return o}})(jwplayer)};var Microsoft=Microsoft||[];Microsoft.ServiceModel=Microsoft.ServiceModel||[];Microsoft.ServiceModel.DomainServices=Microsoft.ServiceModel.DomainServices||[];var MSD=Microsoft.ServiceModel.DomainServices;MSD.DataSource=function(inputData){};MSD.DataSource.prototype={_inputData:null,_entityCollectionEventHandler:null,_skip:null,_take:null,_includeTotalCount:false,_observers:null,_entities:null,_clientEntities:null,_lastRefreshTotalEntityCount:0,dispose:function(){if(this._entityCollectionEventHandler){$([this._clientEntities]).unbind("arrayChange",this._entityCollectionEventHandler);this._entityCollectionEventHandler=null}this._observers=[]},addObserver:function(observer){if($.inArray(observer,this._observers)<0){this._observers.push(observer)}},removeObserver:function(observer){this._observers=$.grep(this._observers,function(element,index){return element!==observer})},getEntities:function(){return this._clientEntities},getTotalEntityCount:function(){var addedEntityCount=$.grep(this._entities,function(cachedEntity){return cachedEntity.added}).length;return this._lastRefreshTotalEntityCount+addedEntityCount},getEntityState:function(entity){if(this._getCachedEntityByEntity(entity)){return this._inputData.getEntityState(entity)}else{return null}},isPropertyChanged:function(entity,propertyName){if(this._getCachedEntityByEntity(entity)){return this._inputData.isPropertyChanged(entity,propertyName)}else{throw"Entity no longer cached in data source."}},getErrors:function(){var self=this;return $.grep(this._inputData.getErrors(),function(error){return!!self._getCachedEntityByEntity(error.entity)})},getDataContext:function(){throw"Unreachable";},getEntityValidationRules:function(){return this._inputData.getEntityValidationRules()},setSort:function(options){throw"Unreachable";},setFilter:function(filter){throw"Unreachable";},setPaging:function(options){options=options||{};this._skip=options.skip;this._take=options.take;this._includeTotalCount=!!options.includeTotalCount},refresh:function(options){throw"Unreachable";},revertChange:function(entity,propertyName){var cachedEntity=this._getCachedEntityByEntity(entity);if(cachedEntity){this._inputData.revertChange(entity,propertyName);if(!propertyName&&cachedEntity.added){this._purgeEntity(cachedEntity.entity)}}else{throw"Entity no longer cached in data source."}},revertChanges:function(all){this._inputData.revertChanges(all);var uncommittedAddedEntities=$.grep(this._entities,function(cachedEntity){return cachedEntity.added}),self=this;$.each(uncommittedAddedEntities,function(index,cachedEntity){self._purgeEntity(cachedEntity.entity)})},_init:function(inputData,options){this._inputData=inputData;var clientEntityCollection;if(options&&options.entityCollection){if(Object.prototype.toString.call(options.entityCollection)!=="[object Array]"){throw"Entity collection must be an array"}clientEntityCollection=options.entityCollection}this._observers=[];this._entities=[];this._clientEntities=clientEntityCollection||[];var self=this;this._clientEntities.deleteEntity=function(entity){self._deleteEntity(entity)};var eventData={first:true,eventDefault:function(){self._flushDeferredEvents()}};this._entityCollectionEventHandler=function(changeEvent,change){self._handleCollectionChange(changeEvent,change)};$([this._clientEntities]).bind("arrayChange",eventData,this._entityCollectionEventHandler)},_onPropertyChanged:function(entity,property,newValue){var cachedEntity=this._getCachedEntityByEntity(entity);if(cachedEntity){this._raiseChangeEvent(entity,property,newValue)}},_onEntityStateChanged:function(entity,state){var self=this;$.each(this._entities,function(index,cachedEntityToClearAdded){if(cachedEntityToClearAdded.added&&self._inputData.getEntityState(cachedEntityToClearAdded.entity)==="Unmodified"){cachedEntityToClearAdded.added=false}});var cachedEntity=this._getCachedEntityByEntity(entity);var purgeEntity=state==="Deleted"&&cachedEntity&&(typeof this!==MSD.LocalDataSource||cachedEntity.added);if(purgeEntity){this._purgeEntity(cachedEntity.entity)}if(cachedEntity){this._raiseEntityStateChangedEvent(entity,state)}},_raiseRefreshStartEvent:function(entities,totalCount){this._raiseEvent("refreshStart")},_raiseRefreshEvent:function(entities,totalCount){this._raiseEvent("refresh",entities,totalCount)},_raiseChangeEvent:function(entity,property,newValue){this._raiseEvent("propertyChanged",entity,property,newValue)},_raiseEntityStateChangedEvent:function(entity,state){this._raiseEvent("entityStateChanged",entity,state)},_raiseEvent:function(eventType){var eventArguments=Array.prototype.slice.call(arguments,1),toNotify=this._observers.slice();$.each(toNotify,function(index,observer){if($.isFunction(observer[eventType])){observer[eventType].apply(null,eventArguments)}})},_getCachedEntityByEntity:function(entity){return $.grep(this._entities,function(cachedEntity){return cachedEntity.entity===entity})[0]},_handleCollectionChange:function(changeEvent,change){if(changeEvent.isInternalChange){return}switch(change.change){case"add":var entitiesToAdd=change.newItems;if(entitiesToAdd.length>1){throw"NYI -- Can only add a single entity to/from an array in one operation."}var entityToAdd=entitiesToAdd[0];this._addEntity(entityToAdd);break;case"remove":var index=change.oldIndex,entitiesToDelete=change.oldItems;if(entitiesToDelete.length>1){throw"NYI -- Can only remove a single entity to/from an array in one operation."}throw"NYI -- Cannot apply destructive deletes to a entity collection.  Use 'deleteEntity' for non-destructive delete.";break;default:throw"NYI -- Array operation '"+change.change+"' is not supported."}},_addEntity:function(entity){this._entities.push({entity:entity,added:true});$.push(this._inputData.getEntities(),entity)},_deleteEntity:function(entity){if(this._getCachedEntityByEntity(entity)){this._inputData.getEntities().deleteEntity(entity)}else{throw"Entity no longer cached in data source."}},_purgeEntity:function(entityToPurge){this._entities=$.grep(this._entities,function(cachedEntity){return cachedEntity.entity!==entityToPurge});var index=$.inArray(entityToPurge,this._clientEntities),eventArguments=[{change:"remove",oldIndex:index,oldItems:[entityToPurge]}];$([this._clientEntities]).trigger("arrayChanging",eventArguments);this._clientEntities.splice(index,1);$([this._clientEntities]).trigger({type:"arrayChange",isInternalChange:true},eventArguments)},_processFilter:function(filter){var filterProperty=filter.property,filterValue=filter.value,filterOperator;if(!filter.operator){filterOperator="=="}else{var operatorStrings={"<":["<","islessthan","lessthan","less","lt"],"<=":["<=","islessthanorequalto","lessthanequal","lte"],"==":["==","isequalto","equals","equalto","equal","eq"],"!=":["!=","isnotequalto","notequals","notequalto","notequal","neq","not"],">=":[">=","isgreaterthanorequalto","greaterthanequal","gte"],">":[">","isgreaterthan","greaterthan","greater","gt"]},lowerOperator=filter.operator.toLowerCase();for(var op in operatorStrings){if($.inArray(lowerOperator,operatorStrings[op])>-1){filterOperator=op;break}}if(!filterOperator){filterOperator=filter.operator;}}return{filterProperty:filterProperty,filterOperator:filterOperator,filterValue:filterValue}},_flushDeferredEvents:function(){},_completeRefresh:function(entities,totalCount,options){this._lastRefreshTotalEntityCount=totalCount;var changed;var oldEntities=this.getEntities();if(oldEntities.length!==entities.length){changed=true}else{$.each(oldEntities,function(index,entity){if(entity!==entities[index]){changed=true;return false}})}if(changed){var self=this;this._entities=$.map(entities,function(entity){var added=$.grep(self._entities,function(cachedEntity){return cachedEntity.entity===entity&&cachedEntity.added}).length>0;return{entity:entity,added:added}});var eventArguments=[{change:"reset"}];$([this._clientEntities]).trigger("arrayChanging",eventArguments);Array.prototype.splice.apply(this._clientEntities,[0,this._clientEntities.length].concat(entities));$([this._clientEntities]).trigger({type:"arrayChange",isInternalChange:true},eventArguments)}var newClientEntities=this.getEntities(),newTotalCount=this.getTotalEntityCount();if(options&&options.completed&&$.isFunction(options.completed)){options.completed(newClientEntities,newTotalCount)}this._raiseRefreshEvent(newClientEntities,newTotalCount)}};;var Microsoft=Microsoft||[];Microsoft.ServiceModel=Microsoft.ServiceModel||[];Microsoft.ServiceModel.DomainServices=Microsoft.ServiceModel.DomainServices||[];var MSD=Microsoft.ServiceModel.DomainServices;MSD.DataContext=function(serviceUrl,bufferChanges){this._serviceUrl=serviceUrl;this._changeTracking=!!bufferChanges;this._domainServiceProxy=new MSD.DomainServiceProxy(serviceUrl);this._observers=[];this._entitySets={};this._metadata={}};MSD.DataContext.prototype={_serviceUrl:null,_changeTracking:null,_domainServiceProxy:null,_observers:null,_entitySets:null,_flushingDeferredEvents:false,_metadata:null,dispose:function(){},addObserver:function(observer){if($.inArray(observer,this._observers)<0){this._observers.push(observer)}},removeObserver:function(observer){this._observers=$.grep(this._observers,function(element,index){return element!==observer})},getEntitySet:function(entityType){var entitySet=this._entitySets[entityType];if(!entitySet){entitySet=this._entitySets[entityType]=new MSD.EntitySet(this,entityType)}return entitySet},getErrors:function(){var errors=[];$.each(this._entitySets,function(type,entitySet){var spliceArguments=[errors.length,0].concat(entitySet.getErrors());Array.prototype.splice.apply(errors,spliceArguments)});return errors},commitChanges:function(){if(!this._changeTracking){throw"Data context must be in change-tracking mode to explicitly commit changes."}var editedEntities=[];$.each(this._entitySets,function(type,entitySet){var editedEntitiesT=$.map(entitySet.__getEditedEntities(),function(entity){return{entitySet:entitySet,entity:entity}});var spliceArguments=[editedEntities.length,0].concat(editedEntitiesT);Array.prototype.splice.apply(editedEntities,spliceArguments)});var self=this;this._executeWithDeferredEvents(function(deferredEvents){self._submitChanges(editedEntities,deferredEvents)})},revertChanges:function(){var self=this;this._executeWithDeferredEvents(function(deferredEvents){$.each(self._entitySets,function(type,entitySet){entitySet.__revertChanges(deferredEvents)})})},__load:function(query){$.each(this._entitySets,function(type,entitySet){if(entitySet.__hasUncommittedEdits()){throw"Load is not allowed while the data source contains uncommitted edits."}});var self=this,success=function(queryResult){var metadata=queryResult.Metadata;self._addMetadata(metadata);var entityType=metadata[0].type;var entitySet=self.getEntitySet(entityType);var loadedEntities=self._executeWithDeferredEvents(function(deferredEvents){if(queryResult.IncludedResults){var includedEntities={};$.each(queryResult.IncludedResults,function(unused,entity){var entityType=entity.__type;if(!includedEntities[entityType]){includedEntities[entityType]=[]}includedEntities[entityType].push(entity)});for(var includedEntityType in includedEntities){var includedEntitySet=self.getEntitySet(includedEntityType);includedEntitySet.__loadEntities(includedEntities[includedEntityType],deferredEvents)}}var entities=entitySet.__loadEntities(queryResult.RootResults,deferredEvents);return entities});var totalCount=!!query.includeTotalCount&&queryResult.TotalCount===undefined?0:queryResult.TotalCount;query.success(entitySet,loadedEntities,totalCount)},getQueryParts=function(queryBase){if(query.filters){$.each(query.filters,function(index,filter){queryBase.where(filter.filterProperty,filter.filterValue,filter.filterOperator)})}if(query.sort){queryBase.orderBy(query.sort)}if(query.skip>0){queryBase.skip(query.skip)}if(query.take!==null&&query.take!==undefined){queryBase.take(query.take)}if(!!query.includeTotalCount){queryBase.includeTotalCount()}return queryBase};this._domainServiceProxy.query(query.queryName,success,getQueryParts,query.queryParameters);},__commitEntityIfImplicit:function(entitySet,entity,deferredEvents){if(!this._changeTracking){this._submitChanges([{entitySet:entitySet,entity:entity}],deferredEvents)}},__getMetadata:function(entityType){return this._metadata[entityType]},__entitySetChanged:function(entityType,deferredEventsCollector){this._distributeEntitySetChanged(entityType,deferredEventsCollector)},_raiseCommitSucceededEvent:function(){this._raiseEvent("commitSucceeded")},_raiseEvent:function(eventType){var eventArguments=Array.prototype.slice.call(arguments,1),toNotify=this._observers.slice();$.each(toNotify,function(index,observer){if($.isFunction(observer[eventType])){observer[eventType].apply(null,eventArguments)}})},_submitChanges:function(editedEntities,deferredEvents){var edits=$.map(editedEntities,function(editedEntity){return editedEntity.entitySet.__getEntityEdit(editedEntity.entity)});$.each(edits,function(index,edit){edit.updateEntityState(deferredEvents)});var operations=$.map(edits,function(edit,index){return $.extend({Id:index.toString()},edit.operation)});var self=this;$.ajax({url:this._serviceUrl+"/JSON/SubmitChanges",contentType:"application/json",type:"POST",data:JSON.stringify({changeSet:operations}),success:function(data){var hasErrors=self._executeWithDeferredEvents(function(deferredEvents){var submitResult=data.SubmitChangesResult;for(var i=0;i<submitResult.length;i++){var edit=edits[i];if(!edit.succeeded(submitResult[i],deferredEvents)){return true}}return false});if(!hasErrors){self._raiseCommitSucceededEvent()}},error:function(response){self._executeWithDeferredEvents(function(deferredEvents){$.each(edits,function(index,edit){edit.failed(response,deferredEvents)})})}})},_executeWithDeferredEvents:function(toExecute){this._assertNotFlushingDeferredEvents();var deferredEvents=[],changedEntitySets={},deferredEventsCollector={deferEvent:function(eventToDefer){deferredEvents.push(eventToDefer)},entitySetChanged:function(entityType){changedEntitySets[entityType]=true}},result=toExecute(deferredEventsCollector);for(var changedEntitySetType in changedEntitySets){this._distributeEntitySetChanged(changedEntitySetType,deferredEventsCollector)}try{this._flushingDeferredEvents=true;$.each(deferredEvents,function(index,deferredEvent){deferredEvent()})}finally{this._flushingDeferredEvents=false}return result},_distributeEntitySetChanged:function(changedEntitySetType,deferredEvents){for(var entityType in this._entitySets){var entitySetToNotify=this._entitySets[entityType];entitySetToNotify.__handleEntitySetChanged(changedEntitySetType,deferredEvents)}},_assertNotFlushingDeferredEvents:function(){if(this._flushingDeferredEvents){throw"Issuing side-effecting operations during event callbacks is not supported."}},_addMetadata:function(metadata){var self=this;$.each(metadata,function(unused,metadataForType){var type=metadataForType.type;if(!self._metadata[type]){self._metadata[type]=metadataForType}})}};;var Microsoft=Microsoft||[];Microsoft.ServiceModel=Microsoft.ServiceModel||[];Microsoft.ServiceModel.DomainServices=Microsoft.ServiceModel.DomainServices||[];var MSD=Microsoft.ServiceModel.DomainServices;MSD.DomainServiceProxy=function(serviceBaseUrl){if(!(this instanceof MSD.DomainServiceProxy)){return new MSD.DomainServiceProxy(serviceBaseUrl)}this.serviceBaseUrl=serviceBaseUrl;this.query=function(queryName,successCallback,queryPartsFunction,queryParts){var isArray=function(object){return(Object.prototype.toString.call(object)==="[object Array]")};if(queryParts&&!isArray(queryParts)){var queryPartsArray=[];$.each(queryParts,function(parameterName,parameterValue){queryPartsArray.push({name:parameterName,value:parameterValue})});queryParts=queryPartsArray}else if(!queryParts){queryParts=[]}queryParts._includeTotalCount=false;if($.isFunction(queryPartsFunction)){var operatorStrings={"<":["<","islessthan","lessthan","less","lt"],"<=":["<=","islessthanorequalto","lessthanequal","lte"],"==":["==","isequalto","equals","equalto","equal","eq"],"!=":["!=","isnotequalto","notequals","notequalto","notequal","neq","not"],">=":[">=","isgreaterthanorequalto","greaterthanequal","gte"],">":[">","isgreaterthan","greaterthan","greater","gt"]};var applyOperator=function(property,operator,value){var lowerOperator=operator.toString().toLowerCase();if(typeof value==="string"){value='"'+value+'"'}for(var op in operatorStrings){if($.inArray(lowerOperator,operatorStrings[op])>-1){return property+op+value}}return property+'.'+operator+'('+value+')'};queryParts.orderby=queryParts.orderBy=queryParts.OrderBy=function(sort){var sortValue;if(Object.prototype.toString.call(sort)==="[object Array]"){sortValue="";$.each(sort,function(index,sortPart){if(index>0){sortValue+=","}sortValue+=makeSortPartValue(sortPart)})}else{sortValue=makeSortPartValue(sort)}this.push({name:"$orderby",value:sortValue});return this;function makeSortPartValue(sortPart){return sortPart.property+(sortPart.direction?" "+sortPart.direction:"")}};queryParts.where=queryParts.Where=function(clause,value,operator){if(value===undefined){this.push({name:"$where",value:clause})}else{if(operator===null||operator===undefined){operator="eq"}this.push({name:"$where",value:applyOperator(clause,operator,value)})}return this};queryParts.skip=queryParts.Skip=function(skipAmount){this.push({name:"$skip",value:skipAmount});return this};queryParts.take=queryParts.Take=function(takeAmount){this.push({name:"$take",value:takeAmount});return this};queryParts.includetotalcount=queryParts.includeTotalCount=queryParts.IncludeTotalCount=function(){this._includeTotalCount=true;return this};queryPartsFunction(queryParts)}if(queryParts._includeTotalCount){queryParts.push({name:"$includeTotalCount",value:true})}var slash=(this.serviceBaseUrl.substring(this.serviceBaseUrl.length-1)!=="/"?"/":"");$.ajax({url:this.serviceBaseUrl+slash+"json/"+queryName,data:queryParts,dataType:"json",success:function(queryResult){if($.isFunction(successCallback)){var resultData=queryResult[queryName+"Result"];successCallback(resultData)}}})}};var Microsoft=Microsoft||[];Microsoft.ServiceModel=Microsoft.ServiceModel||[];Microsoft.ServiceModel.DomainServices=Microsoft.ServiceModel.DomainServices||[];var MSD=Microsoft.ServiceModel.DomainServices;MSD.EntitySet=function(dataContext,entityType){this._dataContext=dataContext;this._entityType=entityType;var metadata=dataContext.__getMetadata(entityType);this._idProperty=metadata.key[0];this._observers=[];this._updatedEntities=[];this._originalEntities=[];this._entityStates={};this._addedEntities=[];this._changeHandlers={};this._errors=[];this._clientEntities=[];this._deferredEvents=[];this._childEntitiesCollections={};var self=this,eventData={first:true,eventDefault:function(){self._flushDeferredEventsFromAddOrUpdate()}};$([this._clientEntities]).bind("arrayChange",eventData,function(changeEvent,change){self._handleCollectionChange(changeEvent,change)});this._clientEntities.deleteEntity=function(entity){self._deleteEntity(entity)}};MSD.EntitySet.prototype={_dataContext:null,_entityType:null,_idProperty:null,_observers:null,_updatedEntities:null,_originalEntities:null,_clientEntities:null,_entityStates:null,_addedEntities:null,_changeHandlers:null,_errors:null,_deferredEvents:null,_flushingDeferredEvents:false,_childEntitiesCollections:null,dispose:function(){},addObserver:function(observer){if($.inArray(observer,this._observers)<0){this._observers.push(observer)}},removeObserver:function(observer){this._observers=$.grep(this._observers,function(element,index){return element!==observer})},getEntities:function(){return this._clientEntities},getEntityState:function(entity){var id=this._getEntityId(entity);if(id){return this._entityStates[id]}return null},isPropertyChanged:function(entity,propertyName){var id=this._getEntityId(entity);switch(this._entityStates[id]){case"ClientUpdated":case"ServerUpdating":var index=this._getEntityIndexFromId(id);return this._originalEntities[index][propertyName]!==this._updatedEntities[index][propertyName];case undefined:case"Deleted":throw"Entity no longer cached in data source.";default:return false}},getErrors:function(){return this._errors},revertChange:function(entity,propertyName){var id=this._getEntityId(entity);var state=this._entityStates[id];if(!state||state==="Deleted"){throw"Entity no longer cached in data source."}var self=this;this._executeWithDeferredEvents(function(deferredEvents){if(!propertyName){if(state==="ClientDeleted"||state==="ClientUpdated"){self._revertToOriginalEntity(id,deferredEvents);self._errors=$.grep(self._errors,function(unused,error){return error.entity!==entity});self._updateEntityState(id,"Unmodified",deferredEvents);}else if(state==="ClientAdded"){self._purgeUncommittedAddedEntity(self._getAddedEntityFromId(id),true,deferredEvents)}else{throw"Entity changes cannot be reverted for entity in state '"+state+"'."}}else{if(state!=="ClientUpdated"){throw"Property change cannot be reverted for entity in state '"+state+"'."}else{var index=self._getEntityIndexFromId(id);$(self._updatedEntities[index]).data(propertyName,self._originalEntities[index][propertyName]);deferredEvents.entitySetChanged(self._entityType);}}})},revertChanges:function(){var self=this;this._executeWithDeferredEvents(function(deferredEvents){self.__revertChanges(deferredEvents)})},__hasUncommittedEdits:function(){var hasUncommittedEdits=false;$.each(this._entityStates,function(key,value){if(value!=="Unmodified"){hasUncommittedEdits=true}});return hasUncommittedEdits},__loadEntities:function(entities,deferredEvents){var self=this,mergedLoadedEntities=[],entitiesNewToEntitySet=[];$.each(entities,function(unused,entity){var updatedEntity,serverId=self._getServerEntityId(entity),index=self._getEntityIndexFromServerId(serverId);if(index>=0){updatedEntity=self._updatedEntities[index];self._mergeEntities(updatedEntity,entity,deferredEvents)}else{updatedEntity=$.extend({},entity);self._addAssociationProperties(updatedEntity);var id=serverId.toString();self._wirePropertyChanged(updatedEntity,id);self._entityStates[id]="Unmodified";self._updatedEntities.push(updatedEntity);self._originalEntities.push(entity);entitiesNewToEntitySet.push(updatedEntity)}mergedLoadedEntities.push(updatedEntity)});var newClientEntities=function(){var addedEntities=$.map(self._addedEntities,function(addedEntity){return addedEntity.entity});addedEntities=$.grep(addedEntities,function(addedEntity){return $.inArray(addedEntity,self._updatedEntities)<0});return self._updatedEntities.concat(addedEntities)}();Array.prototype.splice.apply(this._clientEntities,[0,this._clientEntities.length].concat(newClientEntities));if(entitiesNewToEntitySet.length>0){deferredEvents.deferEvent(function(){var eventArguments=[{change:"add",newIndex:$.inArray(entitiesNewToEntitySet[0],newClientEntities),newItems:entitiesNewToEntitySet}];$([self._clientEntities]).trigger({type:"arrayChange",isInternalChange:true},eventArguments)})}return mergedLoadedEntities},__getEditedEntities:function(){var self=this,entities=[];$.each(this._entityStates,function(id,state){if(state.indexOf("Client")===0){entities.push(self._getEntityFromId(id))}});return entities},__getEntityEdit:function(entity){var id=this._getEntityId(entity),self=this,submittingState,operation,index=this._getEntityIndexFromId(id),addEntityType=function(entityToExtend){return $.extend({"__type":self._entityType},entityToExtend)};switch(this._entityStates[id]){case"ClientUpdated":submittingState="ServerUpdating";operation={Operation:3,Entity:addEntityType(this._updatedEntities[index]),OriginalEntity:addEntityType(this._originalEntities[index])};break;case"ClientAdded":submittingState="ServerAdding";var addedEntity=this._getAddedEntityFromId(id);operation={Operation:2,Entity:addEntityType(addedEntity.entity)};break;case"ClientDeleted":submittingState="ServerDeleting";var addedEntityBeingDeleted=this._getAddedEntityFromId(id),serverId=addedEntityBeingDeleted?addedEntityBeingDeleted.serverId:this._getServerEntityId(this._originalEntities[index]),key={};key[this._idProperty]=serverId;operation={Operation:4,Entity:addEntityType(key)};break;default:throw"Unrecognized entity state."}var edit={updateEntityState:function(deferredEvents){self._updateEntityState(id,submittingState,deferredEvents)},operation:operation,succeeded:function(result,deferredEvents){return self._handleSubmitSucceeded(id,operation,result,deferredEvents)},failed:function(response,deferredEvents){self._handleSubmitFailed(id,operation,response,deferredEvents)}};return edit},__revertChanges:function(deferredEvents){var synchronizing;$.each(this._entityStates,function(unused,state){if(state.indexOf("Server")===0){synchronizing=true;return false}});if(synchronizing){throw"Can't revert changes while a commit is in progress."}var self=this;var uncommittedAddedEntities=$.grep(this._addedEntities,function(addedEntity){return addedEntity.entity&&$.inArray(addedEntity.entity,self._updatedEntities)<0});if(uncommittedAddedEntities.length>0){this._addedEntities=$.grep(this._addedEntities,function(addedEntity){return $.inArray(addedEntity,uncommittedAddedEntities)<0});$.each(uncommittedAddedEntities,function(index,addedEntity){self._purgeUncommittedAddedEntity(addedEntity,true,deferredEvents)})}this._errors=[];for(var id in this._entityStates){if(this._entityStates[id].indexOf("Client")===0){this._revertToOriginalEntity(id,deferredEvents);this._updateEntityState(id,"Unmodified",deferredEvents)}}},__handleEntitySetChanged:function(entityType,deferredEvents){var metadata=this._dataContext.__getMetadata(this._entityType);if(!metadata){return}for(var id in this._childEntitiesCollections){var childEntitiesCollections=this._childEntitiesCollections[id];var entity=this._getEntityFromId(id);for(var fieldName in childEntitiesCollections){var associationMetadata=metadata.fields[fieldName];if(associationMetadata.type===entityType){var childEntitiesCollection=childEntitiesCollections[fieldName];var newChildEntities=this._computeAssociatedEntities(entity,associationMetadata);var addedEntities=$.grep(newChildEntities,function(childEntity){return $.inArray(childEntity,childEntitiesCollection)<0});$.each(addedEntities,function(unused,addedEntity){childEntitiesCollection.push(addedEntity);var indexAdd=childEntitiesCollection.length;var childEntitiesCollectionForEvent=childEntitiesCollection;var addedEntityForEvent=addedEntity;deferredEvents.deferEvent(function(){var eventArguments=[{change:"add",newIndex:indexAdd,newItems:[addedEntityForEvent]}];$([childEntitiesCollectionForEvent]).trigger({type:"arrayChange",isInternalChange:true},eventArguments)})});var removedEntities=$.grep(childEntitiesCollection,function(childEntity){return $.inArray(childEntity,newChildEntities)<0});$.each(removedEntities,function(unused,removedEntity){var indexRemove=$.inArray(removedEntity,childEntitiesCollection);Array.prototype.splice.call(childEntitiesCollection,indexRemove,1);var childEntitiesCollectionForEvent=childEntitiesCollection;var removedEntityForEvent=removedEntity;deferredEvents.deferEvent(function(){var eventArguments=[{change:"remove",oldIndex:indexRemove,oldItems:[removedEntityForEvent]}];$([childEntitiesCollectionForEvent]).trigger({type:"arrayChange",isInternalChange:true},eventArguments)})});if(addedEntities.length>0||removedEntities.length>0){$.dataSource.unwrapHack(childEntitiesCollection).__syncToNewEntities()}}}}},__getEntityType:function(){return this._entityType},_handleCollectionChange:function(changeEvent,change){if(changeEvent.isInternalChange){return}switch(change.change){case"add":var entitiesToAdd=change.newItems;if(entitiesToAdd.length>1){throw"NYI -- Can only add a single entity to/from an array in one operation."}var entityToAdd=entitiesToAdd[0],self=this;this._executeWithDeferredEvents(function(deferredEvents){self._addEntity(entityToAdd,deferredEvents);},true);break;case"remove":var index=change.oldIndex;var entitiesToDelete=change.oldItems;if(entitiesToDelete.length>1){throw"NYI -- Can only remove a single entity to/from an array in one operation."}throw"NYI -- Cannot apply destructive deletes to a entity collection.  Use 'deleteEntity' for non-destructive delete.";break;default:throw"NYI -- Array operation '"+change.change+"' is not supported."}},_addEntity:function(entity,deferredEvents){if($.inArray(entity,this._updatedEntities)>=0||this._getAddedEntityFromEntity(entity)){throw"Entity already in data source."}var id="added"+(Math.floor(Math.random()*Math.pow(2,32)+1)).toString(),addedEntity={entity:entity,clientId:id};this._addedEntities.push(addedEntity);this._wirePropertyChanged(entity,id);this._entityStates[id]="Unmodified";this._addAssociationProperties(entity);this._updateEntityState(id,"ClientAdded",deferredEvents);this._dataContext.__commitEntityIfImplicit(this,entity,deferredEvents);deferredEvents.entitySetChanged(this._entityType)},_deleteEntity:function(entity){var self=this;this._executeWithDeferredEvents(function(deferredEvents){var id=self._getEntityId(entity),index=self._getEntityIndexFromId(id),addedEntityBeingDeleted=self._getAddedEntityFromId(id),deletingAddedEntity=index<0&&addedEntityBeingDeleted;if(deletingAddedEntity){var entityState=self._entityStates[id];if(entityState==="ClientAdded"){self._purgeUncommittedAddedEntity(addedEntityBeingDeleted,true,deferredEvents)}else{throw"NYI -- Can't edit a entity while previous edits are being committed."}}else if(index<0){throw"Entity no longer cached in data source."}else{if(self._entityStates[id].indexOf("Server")===0){throw"NYI -- Can't edit a entity while previous edits are being committed."}self._updateEntityState(id,"ClientDeleted",deferredEvents);self._dataContext.__commitEntityIfImplicit(self,entity,deferredEvents)}})},_updateEntity:function(entity,deferredEvents){var index=$.inArray(entity,this._updatedEntities),updatingAddedEntity=index<0&&this._getAddedEntityFromEntity(entity);if(updatingAddedEntity){var entityState=this._entityStates[this._getEntityId(entity)];if(entityState==="ClientAdded"){return}else{throw"NYI -- Can't update an added entity while it's being committed."}}else if(index<0){throw"Entity no longer cached in data source."}var id=this._getEntityId(entity);if(this._entityStates[id].indexOf("Server")===0){throw"NYI -- Can't edit a entity while previous edits are being committed."}this._updateEntityState(id,"ClientUpdated",deferredEvents);this._dataContext.__commitEntityIfImplicit(this,entity,deferredEvents)},_updateEntityState:function(id,state,deferredEvents,responseText,entity){var oldState=this._entityStates[id];if(this._entityStates[id]){this._entityStates[id]=state}entity=entity||this._getEntityFromId(id);if(responseText){var error=JSON.parse(responseText);this._errors.push({entity:entity,error:error})}if(oldState!==state){var self=this;deferredEvents.deferEvent(function(){self._raiseEntityStateChangedEvent(entity,state)})}},_purgeEntityAtIndex:function(indexToPurge,triggerArrayChange,deferredEvents){var entityToPurge=this._updatedEntities[indexToPurge],idToPurge=this._getEntityId(entityToPurge);$(this._updatedEntities[indexToPurge]).unbind('changeData',this._changeHandlers[idToPurge]);delete this._changeHandlers[idToPurge];this._updatedEntities=$.grep(this._updatedEntities,function(unused,index){return index!==indexToPurge});this._originalEntities=$.grep(this._originalEntities,function(unused,index){return index!==indexToPurge});this._purgeFromClientEntities(entityToPurge,triggerArrayChange,deferredEvents);delete this._entityStates[idToPurge];this._disposeChildEntitiesCollections(idToPurge);if(this._getAddedEntityFromId(idToPurge)){this._addedEntities=$.grep(this._addedEntities,function(entity){return entity.clientId!==idToPurge})}this._errors=$.grep(this._errors,function(index,error){return error.entity!==entityToPurge});},_raiseChangeEvent:function(entity,property,newValue){this._raiseEvent("propertyChanged",entity,property,newValue)},_raiseEntityStateChangedEvent:function(entity,state){this._raiseEvent("entityStateChanged",entity,state)},_raiseEvent:function(eventType){var eventArguments=Array.prototype.slice.call(arguments,1),toNotify=this._observers.slice();$.each(toNotify,function(index,observer){if($.isFunction(observer[eventType])){observer[eventType].apply(null,eventArguments)}})},_getServerEntityId:function(entity){return entity[this._idProperty]},_getEntityIndexFromId:function(id){var addedEntity=this._getAddedEntityFromId(id),idToFind;if(!addedEntity){idToFind=id}else if(addedEntity.serverId===undefined){return-1}else{idToFind=addedEntity.serverId.toString()}var index=-1;for(var i=0;i<this._originalEntities.length;i++){if(this._getServerEntityId(this._originalEntities[i]).toString()===idToFind){index=i;break}}return index},_getEntityIndexFromServerId:function(id){var index=-1;for(var i=0;i<this._originalEntities.length;i++){if(this._getServerEntityId(this._originalEntities[i])===id){index=i;break}}return index},_wirePropertyChanged:function(entity,id){var self=this,eventData={first:true,eventDefault:function(){self._flushDeferredEventsFromAddOrUpdate()}},changeHandler=function(changeEvent,changed,newValue){self._handlePropertyChange(changeEvent,changed,newValue)};$(entity).bind('changeData',eventData,changeHandler);this._changeHandlers[id]=changeHandler},_handlePropertyChange:function(changeEvent,changed,newValue){if(changeEvent.isInternalChange){return}if(changed===""){return}var entity=changeEvent.target,id=this._getEntityId(entity);if(this._entityStates[id]==="Unmodified"&&entity[changed]===this._originalEntities[this._getEntityIndexFromId(id)][changed]){return}var self=this;this._executeWithDeferredEvents(function(deferredEvents){deferredEvents.deferEvent(function(){self._raiseChangeEvent(entity,changed,newValue)});self._updateEntity(entity,deferredEvents);deferredEvents.entitySetChanged(self._entityType)},true)},_mergeEntities:function(updatedEntity,entity,deferredEvents){var self=this,changed;$.each(entity,function(key,value){if(updatedEntity[key]!==value){changed=true;updatedEntity[key]=value;deferredEvents.deferEvent(function(){var eventArguments=[key,value];$(updatedEntity).trigger({type:"changeData",isInternalChange:true},eventArguments);self._raiseChangeEvent(updatedEntity,key,value)})}});if(changed){deferredEvents.entitySetChanged(this._entityType)}},_getAddedEntityFromId:function(id){var addedEntities=$.grep(this._addedEntities,function(addedEntity){return addedEntity.clientId===id});return addedEntities[0]},_getAddedEntityFromEntity:function(entity){var addedEntities=$.grep(this._addedEntities,function(addedEntity){return addedEntity.entity===entity});return addedEntities[0]},_handleSubmitSucceeded:function(id,operation,result,deferredEvents){var success=true,entity=this._getEntityFromId(id);switch(operation.Operation){case 2:if(result.ValidationErrors){success=false;var self=this;$.each(result.ValidationErrors,function(index,error){self._errors.push({entity:entity,error:error})});this._updateEntityState(id,"ClientAdded",deferredEvents)}else{var newOriginalEntity=result.Entity;delete newOriginalEntity.__type;var addedEntity=this._getAddedEntityFromId(id),newUpdatedEntity=addedEntity.entity;addedEntity.serverId=this._getServerEntityId(newOriginalEntity);this._updatedEntities.push(newUpdatedEntity);this._originalEntities.push(newOriginalEntity);this._revertToOriginalEntity(addedEntity.clientId,deferredEvents);this._updateEntityState(id,"Unmodified",deferredEvents)}break;case 3:var updatedOriginalEntity=result.Entity;delete updatedOriginalEntity.__type;this._originalEntities[this._getEntityIndexFromId(id)]=updatedOriginalEntity;this._revertToOriginalEntity(id,deferredEvents);this._updateEntityState(id,"Unmodified",deferredEvents);break;case 4:var indexToPurge=this._getEntityIndexFromId(id);this._purgeEntityAtIndex(indexToPurge,true,deferredEvents);this._updateEntityState(id,"Deleted",deferredEvents,null,entity);break}if(success){this._errors=$.grep(this._errors,function(index,error){return error.entity!==entity})}return success},_handleSubmitFailed:function(id,operation,response,deferredEvents){var state;switch(operation.Operation){case 2:state="ClientAdded";break;case 3:state="ClientUpdated";break;case 4:state="ClientDeleted";break}this._updateEntityState(id,state,deferredEvents,response.responseText)},_revertToOriginalEntity:function(id,deferredEvents){var index=this._getEntityIndexFromId(id);this._mergeEntities(this._updatedEntities[index],this._originalEntities[index],deferredEvents)},_purgeUncommittedAddedEntity:function(addedEntityBeingPurged,triggerArrayChange,deferredEvents){var id=addedEntityBeingPurged.clientId,entity=addedEntityBeingPurged.entity;$(entity).unbind('changeData',this._changeHandlers[id]);delete this._changeHandlers[id];this._addedEntities=$.grep(this._addedEntities,function(addedEntity){return addedEntity!==addedEntityBeingPurged});delete this._entityStates[id];this._disposeChildEntitiesCollections(id);this._errors=$.grep(this._errors,function(index,error){return error.entity!==entity});this._purgeFromClientEntities(entity,triggerArrayChange,deferredEvents);this._updateEntityState(id,"Deleted",deferredEvents,null,entity)},_purgeFromClientEntities:function(entity,triggerArrayChange,deferredEvents){var index=$.inArray(entity,this._clientEntities);this._clientEntities.splice(index,1);if(triggerArrayChange){var self=this;deferredEvents.deferEvent(function(){var eventArguments=[{change:"remove",oldIndex:index,oldItems:[entity]}];$([self._clientEntities]).trigger({type:"arrayChange",isInternalChange:true},eventArguments)})}deferredEvents.entitySetChanged(this._entityType)},_getEntityFromId:function(id){var self=this;return $.grep(this.getEntities(),function(entity){return self._getEntityId(entity)===id})[0]},_getEntityId:function(entity){var addedEntity=this._getAddedEntityFromEntity(entity);if(addedEntity){return addedEntity.clientId}var index=$.inArray(entity,this._updatedEntities);if(index>=0){return this._getServerEntityId(this._originalEntities[index]).toString()}return null},_executeWithDeferredEvents:function(toExecute,fromAddOrUpdate){this._assertNotFlushingDeferredEvents();var deferredEvents=[],entitySetChanged,deferredEventsCollector={deferEvent:function(eventToDefer){deferredEvents.push(eventToDefer)},entitySetChanged:function(entityType){entitySetChanged=true}},result=toExecute(deferredEventsCollector);if(entitySetChanged){this._dataContext.__entitySetChanged(this._entityType,deferredEventsCollector)}if(fromAddOrUpdate){var self=this;$.each(deferredEvents,function(index,deferredEvent){self._deferredEvents.push(deferredEvent)})}else{this._flushDeferredEvents(deferredEvents)}return result},_flushDeferredEventsFromAddOrUpdate:function(){if(this._deferredEvents.length!==0){var deferredEvents=this._deferredEvents;this._deferredEvents=[];this._flushDeferredEvents(deferredEvents)}},_flushDeferredEvents:function(deferredEvents){try{this._flushingDeferredEvents=true;$.each(deferredEvents,function(index,deferredEvent){deferredEvent()})}finally{this._flushingDeferredEvents=false}},_assertNotFlushingDeferredEvents:function(){if(this._flushingDeferredEvents){throw"Issuing side-effecting operations during event callbacks is not supported."}},_addAssociationProperties:function(entity){var metadata=this._dataContext.__getMetadata(this._entityType)||{};if(metadata.fields){var self=this;$.each(metadata.fields,function(fieldName,fieldMetadata){if(fieldMetadata.association){if(fieldMetadata.association.isForeignKey){entity["get_"+fieldName]=function(){return self._getParentEntity(entity,fieldName)};entity["set_"+fieldName]=function(parentEntity){return self._setParentEntity(entity,fieldName,parentEntity)}}else if(fieldMetadata.array){entity["get_"+fieldName]=function(){return self._getChildEntities(entity,fieldName)}}else{}}})}},_getParentEntity:function(entity,fieldName){var metadata=this._dataContext.__getMetadata(this._entityType),associationMetadata=metadata.fields[fieldName];var parentEntity=this._computeAssociatedEntities(entity,associationMetadata)[0];return parentEntity||null},_setParentEntity:function(entity,fieldName,parentEntity){var metadata=this._dataContext.__getMetadata(this._entityType),associationMetadata=metadata.fields[fieldName];var targetEntitySet=this._dataContext.getEntitySet(associationMetadata.type);if($.inArray(parentEntity,targetEntitySet.getEntities())<0){throw"Parent entity is not in the parent entity set for this association."}else if((targetEntitySet.getEntityState(parentEntity)||"").indexOf("Add")>0){throw"NYI -- Cannot set foreign keys to key values computed from added entities.  Commit your parent entity first."}var targetKey=associationMetadata.association.otherKey,targetKeyValue=parentEntity?parentEntity[targetKey[0]]:null;if(targetKeyValue===undefined){throw"Parent entity has no value for its '"+targetKey[0]+"' key property."}var sourceKey=associationMetadata.association.thisKey,sourceKeyValue=entity[sourceKey[0]],setForeignKeyValue;if(!parentEntity){if(sourceKeyValue!==null){setForeignKeyValue=true}}else if(sourceKeyValue===undefined||sourceKeyValue!==targetKeyValue){setForeignKeyValue=true}if(setForeignKeyValue){$(entity).data(sourceKey[0],targetKeyValue);}},_getChildEntities:function(entity,fieldName){var id=this._getEntityId(entity),childEntitiesCollections=this._childEntitiesCollections[id];if(!childEntitiesCollections){childEntitiesCollections=this._childEntitiesCollections[id]={}}var childEntitiesCollection=childEntitiesCollections[fieldName];if(!childEntitiesCollection){var metadata=this._dataContext.__getMetadata(this._entityType),associationMetadata=metadata.fields[fieldName];childEntitiesCollection=this._computeAssociatedEntities(entity,associationMetadata);var self=this;var handleAddEntity=function(entityToAdd){if((self.getEntityState(entity)||"").indexOf("Add")>0){throw"NYI -- Cannot set foreign keys to key values computed from added entities.  Commit your parent entity first."}var sourceKey=associationMetadata.association.thisKey,sourceKeyValue=entity[sourceKey[0]];if(sourceKeyValue===undefined){throw"Parent entity has no value for its '"+sourceKey[0]+"' key property."}var targetKey=associationMetadata.association.otherKey,targetKeyValue=entityToAdd[targetKey[0]];if(targetKeyValue===undefined||targetKeyValue!==sourceKeyValue){$(entityToAdd).data(targetKey[0],sourceKeyValue);}var targetEntitySet=self._dataContext.getEntitySet(associationMetadata.type);if($.inArray(entityToAdd,targetEntitySet.getEntities())<0){targetEntitySet._addEntityViaChildEntitiesCollection(entityToAdd);$.dataSource.unwrapHack(childEntitiesCollection).__syncToNewEntities()}},flushDeferredEventsFromAdd=function(){var targetEntitySet=self._dataContext.getEntitySet(associationMetadata.type);targetEntitySet._flushDeferredEventsFromAddOrUpdate()};var dataSource=new MSD.AssociatedEntitiesDataSource(this._dataContext,associationMetadata.type,childEntitiesCollection,handleAddEntity,flushDeferredEventsFromAdd);$.dataSource.wrapHack(childEntitiesCollection,dataSource);childEntitiesCollections[fieldName]=childEntitiesCollection}return childEntitiesCollection},_computeAssociatedEntities:function(entity,associationMetadata){var sourceKeyValue=entity[associationMetadata.association.thisKey[0]];var targetEntitySet=this._dataContext.getEntitySet(associationMetadata.type);var targetEntities=targetEntitySet._getTargetEntities(associationMetadata.association.otherKey,sourceKeyValue);return targetEntities},_getTargetEntities:function(key,keyValue){var targetEntities=$.grep(this._clientEntities,function(entity){var targetKeyValue=entity[key[0]];return targetKeyValue!==undefined&&targetKeyValue===keyValue;});return targetEntities},_disposeChildEntitiesCollections:function(id){var childEntitiesCollections=this._childEntitiesCollections[id];if(childEntitiesCollections){$.each(childEntitiesCollections,function(unused,childEntitiesCollection){$([childEntitiesCollection]).dataSource().destroy()})}delete this._childEntitiesCollections[id]},_addEntityViaChildEntitiesCollection:function(entityToAdd){var self=this;this._executeWithDeferredEvents(function(deferredEvents){self._clientEntities.push(entityToAdd);self._addEntity(entityToAdd,deferredEvents);deferredEvents.deferEvent(function(){var eventArguments=[{change:"add",newIndex:$.inArray(entityToAdd,self.getEntities()),newItems:entityToAdd}];$([self._clientEntities]).trigger({type:"arrayChange",isInternalChange:true},eventArguments)})},true);}};;(function($){$.fn.extend({dataSource:function(options){return makeDataSource(this[0],options)}});$.dataSource=function(options){if(!options){throw"Provide contruction options to $.dataSource"}else{var entityCollection=options.entityCollection||[];delete options.entityCollection;return makeDataSource(entityCollection,options)}};function makeDataSource(entityCollection,options){if(options){var currentDataSource=entityCollection.__dataSource__;if(currentDataSource){currentDataSource.destroy()}entityCollection.__dataSource__=createDataSource(entityCollection,options)}return entityCollection.__dataSource__};$.dataSource.wrapHack=function(entityCollection,dataSource){entityCollection.__dataSource__=wrap(dataSource)};$.dataSource.unwrapHack=function(entityCollection){return entityCollection.__dataSource__._dataSource};function createDataSource(entityCollection,options){var MSD=Microsoft.ServiceModel.DomainServices;var dataSource;if(options.serviceUrl){dataSource=new MSD.RemoteDataSource(options.serviceUrl,options.queryName,options.entityType,{queryParameters:options.queryParameters,bufferChanges:options.bufferChanges,dataContext:options.dataContext,entityCollection:entityCollection})}else if(options.inputData){if(!options.inputData.__dataSource__){throw"NYI -- Currenty, input array must be bound to a data source."}dataSource=new MSD.LocalDataSource($.dataSource.unwrapHack(options.inputData),{entityCollection:entityCollection})}else{throw"Must provide either server parameters or an input array."}return wrap(dataSource).options(options)};function wrap(dataSource){var refreshingHandler,refreshHandler,committingHandler,commitHandler,queryResultsStaleHandler,entityStateChangeHandler;var observer={refreshStart:function(){$(result).trigger("datasourcerefreshing",arguments);if(refreshingHandler){refreshingHandler.apply(null,arguments)}},refresh:function(){$(result).trigger("datasourcerefresh",arguments);if(refreshHandler){refreshHandler.apply(null,arguments)}},commitStart:function(){$(result).trigger("datasourcecommitting",arguments);if(committingHandler){committingHandler.apply(null,arguments)}},commit:function(){$(result).trigger("datasourcecommit",arguments);if(commitHandler){commitHandler.apply(null,arguments)}},resultsStale:function(){$(result).trigger("datasourcequeryresultsstale",arguments);if(queryResultsStaleHandler){queryResultsStaleHandler.apply(null,arguments)}},entityStateChanged:function(){$(result).trigger("datasourceentitiestatechange",arguments);if(entityStateChangeHandler){entityStateChangeHandler.apply(null,arguments)}}};dataSource.addObserver(observer);var result={applyLocalQuery:function(options){var newDataSource=new MSD.LocalDataSource(dataSource);var entityCollection=newDataSource.getEntities();entityCollection.__dataSource__=wrap(newDataSource);entityCollection.__dataSource__.options(options);return entityCollection;},options:function(options){applyOptions(options);return this},option:function(option,value){applyOption(option,value);return this},refresh:function(options){if(options){var hasDataSourceOptions;$.each(options,function(key,value){if(key!=="all"&&key!=="completed"){hasDataSourceOptions=true}});if(hasDataSourceOptions){applyOptions(options)}}dataSource.refresh(options);return this},commitChanges:function(){dataSource.commitChanges();return this},revertChanges:function(entity,propertyName){if(typeof entity==="object"){dataSource.revertChange(entity,propertyName)}else{dataSource.revertChanges(!!entity)}return this},destroy:function(){if(dataSource){delete dataSource.getEntities().__dataSource__;dataSource.removeObserver(observer);dataSource.dispose();dataSource=null}return this},getEntities:function(){return dataSource.getEntities()},getEntityState:function(entity){return dataSource.getEntityState(entity)},getEntityValidationRules:function(){return dataSource.getEntityValidationRules()},getErrors:function(){return dataSource.getErrors()},isPropertyChanged:function(entity,propertyName){return dataSource.isPropertyChanged(entity,propertyName)},dataContext:function(){return dataSource.getDataContext()},getTotalCount:function(){return dataSource.getTotalEntityCount()},_dataSource:dataSource};return result;function applyOptions(options){options=options||{};var self=this;$.each(["filter","sort","paging","refreshing","refresh","commit","queryResultsStale","entityStateChange"],function(index,eventName){applyOption(eventName,options[eventName])})};function applyOption(option,value){switch(option){case"filter":dataSource.setFilter(value);break;case"sort":dataSource.setSort(value);break;case"paging":dataSource.setPaging(value);break;case"refreshing":observer.refreshStart=value;break;case"refresh":refreshHandler=value;break;case"committing":committingHandler=value;break;case"commit":commitHandler=value;break;case"queryResultsStale":queryResultsStaleHandler=value;break;case"entityStateChange":entityStateChangeHandler=value;break;default:throw"Unrecognized option '"+option+"'"}}}})(jQuery);;var Microsoft=Microsoft||[];Microsoft.ServiceModel=Microsoft.ServiceModel||[];Microsoft.ServiceModel.DomainServices=Microsoft.ServiceModel.DomainServices||[];var MSD=Microsoft.ServiceModel.DomainServices;MSD.RemoteDataSource=function(serviceUrl,queryName,entityType,options){var queryParameters,bufferChanges,dataContext;if(options){queryParameters=options.queryParameters;bufferChanges=options.bufferChanges;dataContext=options.dataContext;if(options.entityCollection&&options.entityCollection.length!==0){throw"NYI -- Currently, entity collection must be empty to bind to a data source."}}this._queryName=queryName;this._queryParameters=queryParameters;if(!dataContext){dataContext=new MSD.DataContext(serviceUrl,!!bufferChanges);}this._init(dataContext,entityType,options)};MSD.RemoteDataSource.prototype=$.extend({},new MSD.DataSource(),{_queryName:null,_queryParameters:null,_dataContext:null,_dataContextObserver:null,_entitySet:null,_entitySetObserver:null,_sort:null,_filters:null,dispose:function(){MSD.DataSource.prototype.dispose.apply(this);if(this._dataContextObserver){this._dataContext.removeObserver(this._dataContextObserver);this._dataContextObserver=null}if(this._entitySetObserver&&this._entitySet){this._entitySet.removeObserver(this._entitySetObserver);this._entitySetObserver=null}},getDataContext:function(){return this._dataContext},setSort:function(sort){this._sort=sort},setFilter:function(filter){if(!filter){this._filters=null;}else if(Object.prototype.toString.call(filter)==="[object Array]"){var self=this;this._filters=$.map(filter,function(filterPart){return self._processFilter(filterPart)})}else{this._filters=[this._processFilter(filter)]}},refresh:function(options){this._raiseRefreshStartEvent();var self=this;this._dataContext.__load({queryName:this._queryName,queryParameters:this._queryParameters,filters:this._filters,sort:this._sort,skip:this._skip,take:this._take,includeTotalCount:this._includeTotalCount,success:function(entitySet,entities,totalCount){self._bindToEntitySet(entitySet);self._completeRefresh(entities,totalCount,options)}})},commitChanges:function(){this._dataContext.commitChanges()},_init:function(dataContext,entityType,options){this._dataContext=dataContext;var self=this;this._dataContextObserver={commitSucceeded:function(){self._onCommitSucceeded()}};this._dataContext.addObserver(this._dataContextObserver);this._entitySetObserver={propertyChanged:function(entity,property,newValue){self._onPropertyChanged(entity,property,newValue)},entityStateChanged:function(entity,state){self._onEntityStateChanged(entity,state)}};if(entityType){}var inputData={getEntities:function(){return self._entitySet.getEntities()},getEntityState:function(entity){return self._entitySet.getEntityState(entity)},getEntityValidationRules:function(){return{rules:self._dataContext.__getMetadata(self._getEntityType()).rules,messages:self._dataContext.__getMetadata(self._getEntityType()).messages}},isPropertyChanged:function(entity,propertyName){return self._entitySet.isPropertyChanged(entity,propertyName)},getErrors:function(){return self._dataContext.getErrors()},revertChange:function(entity,propertyName){return self._entitySet.revertChange(entity,propertyName)},revertChanges:function(all){if(!!all){self._dataContext.revertChanges()}else{self._entitySet.revertChanges()}}};MSD.DataSource.prototype._init.call(this,inputData,options)},_onCommitSucceeded:function(){this._raiseCommitSucceededEvent()},_raiseCommitSucceededEvent:function(){this._raiseEvent("commitSucceeded")},_bindToEntitySet:function(entitySet){if(entitySet!==this._entitySet){if(this._entitySet){this._entitySet.removeObserver(this._entitySetObserver)}this._entitySet=entitySet;this._entitySet.addObserver(this._entitySetObserver)}},_getEntityType:function(){return this._entitySet.__getEntityType()}});;var site=null;var content=null;$(document).bind('scriptLoadReady',function(){site=Site.getSite();site.logInfo('init','ready');$(document).trigger('scriptSiteReady',site)});$(document).bind('scriptSiteReady',function(){$("a").attr("href",function(arr){if($(this).attr('href').indexOf('{area}')>-1){$(this).attr('href',$(this).attr('href').replace('{area}',Site.getArea()))}})});$(function(){$(document).trigger('scriptLoadReady');$(document).trigger('scriptLoadDone')});(function($,undefined){$.sessionAdd=function(key,value,callback){return $.getBase('rest','SessionAdd',key,value,callback)};$.sessionGet=function(key,callback){return $.getBase('rest','SessionGet',key,callback)};$.getBase=function(){var namespace="";var method="";var callback=null;var hasCallback=false;if(arguments.length>=1)namespace=arguments[0];if(arguments.length>=2)method=arguments[1];if(typeof arguments[arguments.length-1]=='function')hasCallback=true;if(hasCallback&&arguments.length>=3)callback=arguments[arguments.length-1];var loadBaseUrl='/base/'+namespace+'/'+method;for(i=2;i<arguments.length-(hasCallback?1:0)&&arguments[i]!==undefined;i++)loadBaseUrl+='/'+arguments[i];var loadBase=$.get(loadBaseUrl+'.aspx');loadBase.then(function(data,status){if(callback!=null)callback(eval('('+data.documentElement.textContent+')'))});return loadBase};$.eoaJAX=function(options){var opts=$.extend({},{type:'GET'},options);var objEnc=$.param(options.data);opts.data={d:objEnc,cs:$.md5(objEnc)};if(options.service!==undefined&&options.method!==undefined)opts.url='/uiServices/'+options.service+'Service.svc/'+options.method;$.ajax(opts)}})(jQuery);(function($,_){_.mixin({format:function(string){var formatString=string;var myArgs=arguments;if(myArgs.length<=0||myArgs[0]===undefined)return"";if(myArgs.length<=1)return arguments[0];formatString=myArgs[0].replace(/\{([0-9]+)\}/g,function(){return myArgs[parseInt(arguments[1])+1]});return formatString},capitalize:function(string){return string.charAt(0).toUpperCase()+string.substring(1).toLowerCase()},movie:function(movieName){if(window[movieName]!==undefined)return window[movieName];return document[movieName]}})})(jQuery,_);$(window).load(function(){_.delay(function(){if(!window.suppressBH){$('#bcFrame').append('<iframe id="BrowserCheck" style="height:1px;width:1px;display:none;"></iframe>');$('#BrowserCheck').attr('src','/CustomPages/Browsercheck.aspx{0}'.format(document.location.search))}$('#line01').append('<iframe id="facebook" src="{0}//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.toggo-cleverclub.de&amp;layout=standard&amp;show_faces=false&amp;width=675&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=24" scrolling="no" frameborder="0" allowTransparency="true"></iframe>'.format(document.location.protocol))},1000);$("#line02 #tuev").css('cursor','pointer').click(function(){site.openTUEVPage()})});String.prototype.format=function(){var formatString="";var myArgs=arguments;formatString=this.toString().replace(/\{([0-9]+)\}/g,function(){return myArgs[parseInt(arguments[1])]});return formatString};Class('eoa',{has:{},methods:{events:function(eventArray){_.each(eventArray,function(value){if(typeof value=='string'){this.bind(value)}else{try{this.bind.apply(this,value)}catch(ex){this.logError(ex)}}},this)},bind:function(event,func,bindingContext,jContext,mapArgs){if(bindingContext===undefined)bindingContext=this;if(jContext===undefined)jContext=$(document);if(func===undefined){callFunc=this[event];if(typeof callFunc=='function')func=callFunc;else throw('Function to bind on Event \'{0}\' is not defined!'.format(event))}if(mapArgs===undefined)mapArgs=true;(function($this){var intFunc=function(){try{if(mapArgs)callArgs=_.rest(arguments);else callArgs=arguments;if(callArgs!==undefined&&callArgs!=null&&callArgs.length>0)$this.logVerbose('bind','{0} => {1}',event,$this.arrayToString(callArgs));else $this.logVerbose('bind','{0}',event);try{result=func.apply($this,callArgs)}catch(ex){this.logError(ex)}}catch(e){}};jContext.bind(event,intFunc)})(bindingContext)},trigger:function(event){args=_.rest(arguments);if(args===undefined)args=[];(function($this){if(args!==undefined&&args!=null&&args.length>0)$this.logVerbose('trigger','{0} => {1}',event,$this.arrayToString(args));else $this.logVerbose('trigger','{0}',event);$(document).trigger(event,args)})(this)},unbind:function(event,jContext){if(jContext===undefined)jContext=$(document);this.logVerbose('unbind','=> {0}',event);jContext.unbind(event)},get:function(url,func){(function($this){$.get(url,function(data,status){func.apply($this,[data,status])})})(this)},getScript:function(url,func){(function($this){$.getScript(url,function(data,status){func.apply($this,[data,status])})})(this)},logVerbose:function(){Logger.log(Logger.getVerbose(),_(arguments[1]).format(_.tail(arguments,2)),'{0}:{1}'.format(this.meta.name,arguments[0]))},logInfo:function(){Logger.log(Logger.getInfo(),_(arguments[1]).format(_.tail(arguments,2)),'{0}:{1}'.format(this.meta.name,arguments[0]))},logError:function(){Logger.logError(arguments[0])},arrayToString:function(array,depth){theString='[ ';try{if(depth===undefined)depth=3;else if(depth==0)return'';if(array===undefined||array==null)return theString;this.each(array,function(index,value){var typeOfValue=typeof value;typeOfValue=typeOfValue.toLowerCase();if(typeOfValue=='string'||typeOfValue=='number'||typeOfValue=='boolean')theString+='{0} => {1} '.format(index,value);else if(typeOfValue!='function')theString+='{0}:{1} => {2} '.format(index,typeOfValue,this.arrayToString(value,depth-1))})}catch(ex){}return theString+']'},_toString:function(obj){myString="";try{for(key in obj)myString+=key+'='+obj[key]+' '}catch(ex){}return myString},formatNumber:function(number){var i;var j=0;var ergebnis="";i=number.toString().length-1;while(i>=0){ergebnis=number.toString().substr(i,1)+ergebnis;j++;if((j%3==0)&&j<number.toString().length){ergebnis="."+ergebnis}i--}return ergebnis},each:function(array,func){(function($this){$.each(array,function(index,value){try{func.apply($this,[index,value])}catch(ex){$this.logError(ex)}})})(this)},setInterval:function(time,func){(function($this){var interv=null;interv=window.setInterval(function(){try{func.apply($this,[interv])}catch(ex){$this.logError(ex)}},time)})(this)},clearInterval:function(interval){window.clearInterval(interval)},getCookie:function(name){var allCookies=document.cookie.split(';');var tempCookie='';var cookieName='';var cookieValue='';var cookieFound=false;for(i=0;i<allCookies.length;i++){tempCookie=allCookies[i].split('=');cookieName=tempCookie[0].replace(/^\s+|\s+$/g,'');if(cookieName==name){cookieFound=true;if(tempCookie.length>1){cookieValue=unescape(tempCookie[1].replace(/^\s+|\s+$/g,''))}return cookieValue;break}tempCookie=null;cookieName=''}if(!cookieFound){return null}}}});var __eoa=new eoa();Class('Logger',{has:{},methods:{initialize:function(){Logger.logLevel=Logger.getError()},setLogLevel:function(level){Logger.logLevel=level},log:function(level,message,source){Logger.log(level,message,source)},logError:function(e){Logger.logError(e)}},my:{has:{verbose:{is:'ro',init:0},info:{is:'ro',init:1},error:{is:'ro',init:2},instance:{is:'ro',init:null},logLevel:{is:'rw',init:0}},methods:{initialize:function(){},log:function(level,message,source){if(level<Logger.getLogLevel())return;if(window.console&&window.console.log){logMessage=((source!=null&&source!='')?'['+source+'] ':'')+message;window.console.log(logMessage)}},logError:function(e){var logMessage='';if(typeof e.name!=='undefined'){logMessage='['+e.name+'] File: '+e.fileName+' ('+e.lineNumber+'): '+e.message;Logger.log(Logger.getError(),logMessage,e.fileName)}else{logMessage="Error: "+e;Logger.log(Logger.getError(),logMessage,'')}}}}});;Class('Site',{isa:eoa,has:{area:{is:'rw',init:'free'},user:{is:'rw',init:-1},siteHost:{is:'ro',init:window.location.host},parentSite:{is:'ro',init:null},coreReady:{is:'ro',init:false},flashReady:{is:'ro',init:false},startupScripts:{is:'ro',init:[]},cacheVar:{is:'rw',init:''},siteReady:{is:'ro',init:false},memberRefresh:{is:'ro',init:false},geolocationData:{is:'rw',init:null}},methods:{BUILD:function(area,parent,cVar){return{area:area,parentSite:parent,cacheVar:cVar}},initialize:function(props){if(Site.instance!=null)throw('only one Site instance allowed!');this.area=props.area;this.parentSite=props.parentSite;this.cacheVar=props.cacheVar;this.events([])},registerStartupScript:function(func){if(this.siteReady)func.apply(this);else this.startupScripts.push(func)},openFile:function(url,width,height){if(url===undefined)throw('no url specified!');if(width===undefined)width=780;if(height===undefined)height=548;var options="";options=options+"width="+width+",";options=options+"height="+height;try{Logger.log(Logger.getVerbose(),'Function openFile(\''+url+'\') called');var fileWindow=window.open(url,"_blank",options,false);fileWindow.name="filePopup"}catch(ex){Logger.logError(ex,'de.eoa.Site:openFile')}},loadGeoData:function(){var callBack=null;if(arguments.length>0&&(typeof arguments[0]==='function'))callBack=arguments[0];if(this.geolocationData===undefined||this.geolocationData==null){this.logVerbose('loading geo data');(function($this){$.ajax({url:"/custompages/loc.aspx",dataType:'json',type:'GET',async:callBack!=null,success:function(json){$this.geolocationData=json;$this.logVerbose('geo data ready','hello to {0}',$this.geolocationData.city);if(callBack!=null)callBack()}})})(this)}else{if(callBack!=null)callBack()}},queryString:function(key){vars={};window.location.href.replace(/([^?=&]+)(=([^&]*))?/g,function(){vars[arguments[1]]=arguments[3]});if(key!==undefined&&vars[key]!==undefined)return vars[key];else if(key!==undefined)return'';return vars},triggerSiteReady:function(){this.siteReady=true;for(key in this.startupScripts){if(!this.startupScripts.hasOwnProperty(key))continue;try{this.startupScripts[key].apply(this)}catch(e){this.logError(e)}}this.trigger('onSiteReady')},triggerMemberRefresh:function(data){this.memberRefresh=true;this.replaceUserFields();this.replaceChildName();this.trigger('onMemberRefresh')},setData:function(key,value){this.logVerbose('setData','{0} => {1}',key,value);if(this.parentSite!=null)this.parentSite.setData(key,value);else amplify.store(key,value)},getData:function(key){value="";if(this.parentSite!=null)value=this.parentSite.getData(key);else value=amplify.store(key);this.logVerbose('getData','{0} => {1}',key,value);return value},removeEmptyTags:function(selector){$(selector).each(function(){var $this=$(this);if($this.html().replace(/\s|&nbsp;/g,'').length==0)$this.remove()})},disableLoginData:function(holderID){var id=($(holderID).length==0?'login':holderID);$('#'+id+' input').each(function(){$(this).val('');$(this).attr('eman',$(this).attr('name'));$(this).removeAttr('name')})},replaceFreeUserFields:function(){$('#content_container *:contains("#firstname#"), #content_container *:contains("#lastname#")').each(function(){if($(this).children().length<1)$(this).html($(this).html().replace('#firstname#','').replace('#lastname#',''))})},replaceUserFields:function(){var data=MemberService.memberData;if(data==null){this.replaceFreeUserFields();return}else{$('#content_container *:contains("#firstname#"), #content_container *:contains("#lastname#")').each(function(){if($(this).children().length<1)$(this).html($(this).html().replace('#firstname#',data.Firstname).replace('#lastname#',data.Lastname))})}},replaceChildName:function(){if(MemberService.memberData==null)$('.replaceChildName').text('');else{$('.replaceChildName').text(getChildName())}},setDefaultLoginButton:function(){jQuery(document).ready(function(){$("#login input, #login select").live('keypress',function(e){if((e.which&&e.which==13)||(e.keyCode&&e.keyCode==13)){$('.loginButton').click();return false}else{return true}})})},openTUEVPage:function(){open('http://www.safer-shopping.de/index.php?id=267&showUID=376')}},my:{has:{instance:{is:'ro',init:null}},methods:{getSite:function(cacheVar){if(Site.instance!=null)return Site.instance;var currentArea=Site.getArea();var parentSite=null;try{if(window.site!==undefined&&window.site!=null){Logger.log(Logger.getVerbose(),'=> window','Site:getSite');parentSite=window.site}else if(Site.checkPolicy(window,parent)&&parent!=null&&parent.site!==undefined&&parent.site!=null){Logger.log(Logger.getVerbose(),'=> parent','Site:getSite');parentSite=parent.site}else if(Site.checkPolicy(window,opener)&&opener!=null&&opener.site!==undefined&&opener.site!=null){Logger.log(Logger.getVerbose(),'=> opener','Site:getSite');parentSite=opener.site}if(parentSite!=null){if(parentSite.getArea()==currentArea){Logger.log(Logger.getVerbose(),'area => '+parentSite.getArea(),'Site:getSite')}}}catch(ex){Logger.logError(ex,'Site:getSite')}Site.instance=new Site(currentArea,parentSite,webConfig.cacheVar);if(window.sessionStorage){try{window.sessionStorage.setItem('__site__'+currentArea+'__',Site.instance)}catch(e){}}return Site.instance},getArea:function(){var currentArea='free';try{if(window._area!==undefined&&window._area!=''){currentArea=window._area;Logger.log(Logger.getVerbose(),'window => {0}'.format(currentArea),'Site:getArea')}else if(Site.checkPolicy(window,parent)&&parent!=null&&parent._area!==undefined&&parent._area!=''){currentArea=parent._area;Logger.log(Logger.getVerbose(),'parent => {0}'.format(currentArea),'Site:getArea')}else if(Site.checkPolicy(window,opener)&&opener!=null&&opener._area!==undefined&&opener._area!=''){currentArea=opener._area;Logger.log(Logger.getVerbose(),'opener => {0}'.format(currentArea),'Site:getArea')}}catch(ex){Logger.logError(ex,'Site:getArea')}return currentArea},loadSiteWithArea:function(url){if(url.substr(0,1)!='/')url='/'+url;document.location.href='/{0}{1}'.format(site.getArea(),url)},openNoPaymentClub:function(customerId){var openerAvailable=false;try{if(window.opener&&window.opener.flashSite)openerAvailable=true}catch(e){openerAvailable=false}if(openerAvailable){window.opener.flashSite.redirectAfterLogout='/subscription/start.aspx?onlypayment='+customerId;self.close()}else{window.open('http{0}://{1}/subscription/start.aspx?onlypayment={2}'.format((webConfig.useSSL?"s":""),document.location.host,customerId),'TOGGO-CleverClub');MemberService.logout();self.close()}},checkPolicy:function(mainWindow,subWindow){try{var pcl1=subWindow.location.protocol;var pcl2=mainWindow.location.protocol}catch(e){return false}return true}}}});function EKCgameStart(gameid){try{Logger.log(Logger.getVerbose(),'Function EKCgameStart(\''+gameid+'\') called');$(document).trigger('onEKCgameStart',[gameid])}catch(ex){Logger.logError(ex,'de.synth.Interface:EKCgameStart')}}function EKCgameEnd(gameid){try{Logger.log(Logger.getVerbose(),'Function EKCgameEnd(\''+gameid+'\') called');$(document).trigger('onEKCgameEnd',[gameid])}catch(ex){Logger.logError(ex,'de.synth.Interface:EKCgameEnd')}}function gameLoad(worldName,gameName){try{Logger.log(Logger.getVerbose(),'Function gameLoad(\''+worldName+'\', \''+gameName+'\') called');$(document).trigger('onGameLoad',[worldName,gameName])}catch(ex){Logger.logError(ex,'de.synth.Interface:gameLoad')}}function gameStart(worldName,gameName,fromEoG){if(fromEoG===undefined){fromEoG=false}try{Logger.log(Logger.getVerbose(),'Function gameStart(\''+worldName+'\', \''+gameName+'\', \''+fromEoG+'\') called');$(document).trigger('onGameStart',[worldName,gameName,fromEoG])}catch(ex){Logger.logError(ex,'de.synth.Interface:gameStart')}}function gameEnd(worldName,gameName,fromEoG){if(fromEoG===undefined){fromEoG=false}try{Logger.log(Logger.getVerbose(),'Function gameEnd(\''+worldName+'\', \''+gameName+'\', \''+fromEoG+'\') called');$(document).trigger('onGameEnd',[worldName,gameName,fromEoG])}catch(ex){Logger.logError(ex,'de.synth.Interface:gameEnd')}}function gameHelp(worldName,gameName){try{Logger.log(Logger.getVerbose(),'Function gameHelp(\''+worldName+'\', \''+gameName+'\') called');$(document).trigger('onGameHelp',[worldName,gameName])}catch(ex){Logger.logError(ex,'de.synth.Interface:gameHelp')}}function setValue(worldName,gameName,key,value){try{Logger.log(Logger.getVerbose(),'Function setValue(\'{0}\', \'{1}\', \'{2}\', \'{3}\') called'.format(worldName,gameName,key,value));Site.getSite().setValue('{0}:{1}:{2}'.format(worldName,gameName,key),value)}catch(ex){Logger.logError(ex,'de.synth.Interface:gameHelp')}}function getValue(worldName,gameName,key){try{Logger.log(Logger.getVerbose(),'Function getValue(\'{0}\', \'{1}\', \'{2}\') called'.format(worldName,gameName,key));return Site.getSite().getValue('{0}:{1}:{2}'.format(worldName,gameName,key))}catch(ex){Logger.logError(ex,'de.synth.Interface:gameHelp')}}function openWindow(url,target,width,height,top,left){if(url===undefined)throw('no url specified!');if(target===undefined)target='popUpWindow';if(width===undefined)width=780;if(height===undefined)height=548;Logger.log(Logger.getVerbose(),'Function openWindow(\''+url+'\', \''+target+'\', \''+width+'\', \''+height+'\') called');try{var options="";options=options+"width="+width+",";options=options+"height="+height+",";options=options+"top="+0+",";options=options+"left="+0+",";options=options+"fullscreen=no,";options=options+"resizable=no,";options=options+"menubar=no,";options=options+"toolbar=no,";options=options+"location=no,";options=options+"scrollbars=yes,";options=options+"status=no,";options=options+"dependant=no";return window.open(url,target,options,true)}catch(ex){Logger.logError(ex,'de.synth.Interface:openWindow')}}function openFile(url,width,height){if(url===undefined)throw('no url specified!');if(width===undefined)width=780;if(height===undefined)height=548;var options="";options=options+"width="+width+",";options=options+"height="+height;try{Logger.log(Logger.getVerbose(),'Function openFile(\''+url+'\') called');var fileWindow=window.open(url,"_blank",options,false);fileWindow.name="filePopup"}catch(ex){Logger.logError(ex,'de.synth.Interface:openFile')}}function getMainFlashDimensions(){return{width:$('#mainflash').attr('width'),height:$('#mainflash').attr('height')}}function getLatLon(callback){var latLon=[];site.loadGeoData();latLon.push(site.geolocationData.lat||0);latLon.push(site.geolocationData.lon||0);return latLon}function getLocation(){var callBack=null;if(arguments.length>0&&(typeof arguments[0]==='function'))callBack=arguments[0];if(callBack!=null){site.loadGeoData(function(){var location=[];location.push(site.geolocationData.city);location.push(site.geolocationData.country);location.push(site.geolocationData.lat||0);location.push(site.geolocationData.lon||0);callBack(location)})}else{var location=[];site.loadGeoData();location.push(site.geolocationData.city);location.push(site.geolocationData.country);location.push(site.geolocationData.lat);location.push(site.geolocationData.lon);return location}}function sayHello(){getLocation(function(loc){alert("Hallo nach "+loc[0]+' in '+loc[1])})}function testMamilade(delta){if(delta===undefined||delta==null)delta=50;var myLatLon=getLatLon();var mamiUrl='/custompages/mamiproxy.aspx?long={1}&lat={0}&delta={2}'.format(myLatLon[0],myLatLon[1],delta);$.getJSON(mamiUrl,function(jsonData){site.logVerbose(site.arrayToString(jsonData))})}function getChildCoins(){if(MemberService.memberData==null||MemberService.memberData.SelectedChildId<=0)return 0;for(i=0;i<MemberService.memberData.Childs.length;i++){var child=MemberService.memberData.Childs[i];if(child.ChildId==MemberService.memberData.SelectedChildId)return child.Coins}return 0}function getChildName(){if(MemberService.memberData==null||MemberService.memberData.SelectedChildId<=0)return'';for(i=0;i<MemberService.memberData.Childs.length;i++){var child=MemberService.memberData.Childs[i];if(child.ChildId==MemberService.memberData.SelectedChildId)return child.ChildName}return''}Class('FlashSite',{isa:eoa,has:{site:{is:'ro',init:null},contentLayerPosition:{is:'ro'},contentLayer:{is:'ro',init:null},contentLayerId:{is:'ro',init:'tl_nav_center_right'},clubPopup:{is:'ro',init:null},clubPopupInterval:{is:'ro',init:null},clubPopupOpen:{is:'ro',init:false},redirectAfterLogout:{is:'rw',init:'/startpage.aspx'},windowInterval:{is:'ro',init:null}},methods:{BUILD:function(site){return{site:site}},initialize:function(props){this.site=props.site||null;this.contentLayerPosition=new Point();this.events(['onCreateContentLayer','onRemoveContentLayer','onOpenClubPopup','onCloseClubPopup','onContentChanged'])},getContentLayer:function(area,x,y,width,height){if(this.contentLayer!=null){}else if($(this.contentLayerId).length!=0){this.contentLayer=$('#'+this.contentLayerId)}else{layerStyle="border: none; position: absolute: z-index: -1; display: none; left: {0}px; top: {1}px; width: {2}px; height: {3}px".format(x,y,width,height);$("body").append('<iframe name="{0}" id="{0}" frameborder="none" area="{1}" style="{2}" />'.format(this.contentLayerId,area,layerStyle));this.contentLayer=$('#'+this.contentLayerId);this.bind('resize',this.onBodyResize,this,$(window))}if(this.contentLayer.attr('area')!=area)this.contentLayer.attr('area',area);return this.contentLayer},onCreateContentLayer:function(contentPath,x,y,width,height){this.getContentLayer(this.site.getContentArea(),x,y,width,height);this.contentLayer.css('border','none');this.contentLayer.css('position','absolute');this.contentLayer.css('display','block');this.contentLayer.css('zIndex',-1);this.contentLayer.css('width',width);this.contentLayer.css('height',height);this.contentLayerPosition.setX(x);this.contentLayerPosition.setY(y);this.bind('load',this.onContentLayerLoaded,this,this.contentLayer);if(contentPath.indexOf('?')==-1)contentPath+='?';contentPath+='area='+this.site.getContentArea()+'&';var querys={};this.each(contentPath.substring(contentPath.indexOf('?')+1).split('&'),function(idx,arr){var val=arr.split('=');if(val[0]!='')querys[val[0].toLowerCase()]=val[1]});this.each(this.site.queryString(),function(key,value){if(key!='content'&&querys[key.toLowerCase()]==undefined){contentPath+=key+'='+value+'&'}});this.logVerbose('onCreateContentLayer','=> {0}',contentPath);this.contentLayer.attr('src',contentPath)},onContentChanged:function(){this.onRemoveContentLayer()},onRemoveContentLayer:function(){if(this.contentLayer===undefined||this.contentLayer==null)return;this.contentLayer.css('zIndex',-1);this.unbind('load',this.contentLayer);this.contentLayer.remove();this.contentLayer=null;this.logVerbose('onRemoveContentLayer','=> removed')},onContentLayerLoaded:function(){this.logVerbose('onContentLayerLoaded','=> show');this.setContentLayerPosition();this.getMovie('mainflash').disableLoadAnimation();this.contentLayer.css('zIndex',2)},onBodyResize:function(){if(this.contentLayer!=null)this.setContentLayerPosition()},setContentLayerPosition:function(){var _browserDimensions=this.getBrowserDimensions();var _flashDimensions=this.getMainFlashDimensions();if(this.contentLayer!=null&&this.contentLayer.length>0){this.contentLayer.css('top',this.contentLayerPosition.getY());this.contentLayer.css('left',((_browserDimensions.getX()-_flashDimensions.getX())/2+this.contentLayerPosition.getX()))}else this.logInfo('setContentLayerPosition','fehler => kein content layer')},onOpenClubPopupWithCounter:function(counter){if(counter===undefined)counter=1;if(counter<5){this.logInfo('onOpenClubPopupWithCounter','counter überprüfen {0}'.format(counter));this.onOpenClubPopup(++counter)}else{this.logInfo('onOpenClubPopupWithCounter','counter überschritten {0}'.format(counter));try{this.getMovie('mainflash').onCallComplete(this.clubPopupOpen);this.trigger('onCloseClubPopup')}catch(ex){Logger.logError(ex)}}},onOpenClubPopup:function(callback){var protocol='http://';if(webConfig.useSSL)protocol='https://';if(this.getCookie('yourAuthCookie')==null&&this.getCookie('umbracoMemberLogin')==null&&this.getCookie('umbracoMemberId')==null){this.logInfo('onOpenClubPopup','cookies nicht vorhanden! recall #{0} in 1sek!'.format(arguments[0]));this.setTimeout(1000,function(count){this.onOpenClubPopupWithCounter(count)},arguments[0])}else{this.clubPopup=openWindow('http://'+document.location.host+'/club/index.aspx','clubPopup',this.getWindowDimensions().getX(),this.getWindowDimensions().getY(),0,0);if(this.clubPopup!=null&&!this.clubPopup.opener){this.clubPopup.opener=self}this.clubPopupOpen=this.clubPopup!=null&&!this.clubPopup.closed&&this.clubPopup.outerWidth!=0;if(callback)callback(this.clubPopupOpen);this.focusClubPopup();if(this.clubPopupOpen){$('#right_content').html('');$.get('/free/loggedintext.aspx',function(data){$('#right_content').html(data)});this.whileClubPopupOpen(this.clubPopup)}}},whileClubPopupOpen:function(handle){this.clubPopup=handle;this.setInterval(1000,function(interv){if(this.clubPopup==null||this.clubPopup.closed){this.clearInterval(interv);this.trigger('onCloseClubPopup')}})},focusClubPopup:function(){if(this.clubPopup){this.clubPopup.focus();if(this.clubPopup.window)this.clubPopup.window.focus()}},onCloseClubPopup:function(){MemberService.logout(function(){this.clubPopup=null;if(document.location.pathname!=flashSite.redirectAfterLogout)document.location.href=flashSite.redirectAfterLogout;else document.location.reload()})},getBrowserDimensions:function(){var overflowY=$("html").css("overflowY");var browserDimensions=new Point(0,0);if(self.innerHeight){try{browserDimensions.setX(self.innerWidth);browserDimensions.setY(self.innerHeight)}catch(ex){Logger.logException(ex)}}else if(document.documentElement&&document.documentElement.clientHeight){try{browserDimensions.setX(document.documentElement.clientWidth);browserDimensions.setY(document.documentElement.clientHeight)}catch(ex){Logger.logException(ex)}}else{try{browserDimensions.setX(document.body.clientWidth+((overflowY=="scroll")?this.getScrollbarWidth():0));browserDimensions.setY(document.body.clientHeight)}catch(ex){Logger.logException(ex)}}if(overflowY!='scroll'){browserDimensions.setX(browserDimensions.getX()-(this.getScrollbarWidth()*2))}else{browserDimensions.setX(browserDimensions.getX()-this.getScrollbarWidth())}return browserDimensions},getMainFlashDimensions:function(){var mainFlash=$('#mainflash');return new Point(mainFlash.attr('width'),mainFlash.attr('height'))},getWindowDimensions:function(){return new Point(window.screen.availWidth,window.screen.availHeight)},getScrollbarWidth:function(){$('body').append('<div id="__outerScrollTestFrame" style="position: absolute; top: -1000px; left: -1000px; width: 100px; height: 50px; overflow: hidden"></div>');outerDiv=$('#__outerScrollTestFrame');outerDiv.append('<div id="__innerScrollTestFrame" style="width: 100%; height: 200px;"></div>');innerDiv=$('#__innerScrollTestFrame');var wNoScroll=innerDiv.outerWidth();outerDiv.css('overflow','auto');var wScroll=innerDiv.outerWidth();outerDiv.remove();var scrollbarWidth=wNoScroll-wScroll;return(scrollbarWidth>0)?scrollbarWidth:17},setContent:function(contentId){try{mainFlash=this.getMovie("mainflash");if(mainFlash!=null){mainFlash.setContentFromExternal(contentId)}}catch(e){Logger.logError(e)}},changeLocation:function(location){var url='';switch(location.toLowerCase()){case"wasistderclub":url='/free/eltern/was-ist-der-club.aspx';break;case"neuanmeldung":url='/free/eltern/mitgliedschaft/mitglied-werden.aspx';break}if(url!='')document.location.href=url},getMovie:function(movieName){try{var movie=null;if(navigator.appName.indexOf("Microsoft")!=-1)movie=window[movieName];if(movie==null){if(document[movieName].length!==undefined){return document[movieName][1]}return document[movieName]}else return movie}catch(ex){Logger.logError(ex)}return null}}});Class('Point',{has:{x:{is:'rw',init:0},y:{is:'rw',init:0}},methods:{BUILD:function(x,y){return{x:x,y:y}},initialize:function(props){this.x=props.x;this.y=props.y}}});Class('TrackingService',{isa:eoa,has:{arrayOfProviders:{is:'ro',init:[]},site:{is:'ro',init:null},currentTrackingData:{is:'ro',init:''},currentLocation:{is:'ro',init:''}},methods:{BUILD:function(site,arrayOfProviders){return{site:site,arrayOfProviders:arrayOfProviders}},initialize:function(props){this.site=props.site;this.arrayOfProviders=props.arrayOfProviders;this.events(['onLocationChanged','onGameLoad','onGameStart','onGameEnd','onGameHelp','onEKCgameStart','onEKCgameEnd']);this.initializeProviders()},initializeProviders:function(){this.each(this.arrayOfProviders,function(index,value){try{this.logVerbose('initializeProviders','=> {0}',value.getProviderName());value.init(this,site)}catch(ex){Logger.logError(ex,'TrackingService:initializeProviders')}})},onLocationChanged:function(location){if(location==''||location=='/')location='/default.aspx';if(pageTracking!==undefined&&!window.suppressTagging)this.track(location,pageTracking)},incrementEventData:function(dataKey){dataValue=this.site.getData(dataKey);if(dataValue==null||dataValue==''||parseInt(dataValue)==NaN)dataValue=1;else dataValue=parseInt(dataValue)+1;this.site.setData(dataKey,dataValue);return dataValue},onGameLoad:function(worldName,gameName){dataKey='gameLoad_'+worldName+'_'+gameName;dataValue=this.incrementEventData(dataKey);this.trackGameEvent(worldName,gameName,'OnLoad',dataValue)},onGameIntro:function(worldName,gameName){dataKey='gameIntro_'+worldName+'_'+gameName;dataValue=this.incrementEventData(dataKey);this.trackGameEvent(worldName,gameName,'OnIntro',dataValue)},onGameDemo:function(worldName,gameName){dataKey='gameDemo_'+worldName+'_'+gameName;dataValue=this.incrementEventData(dataKey);this.trackGameEvent(worldName,gameName,'OnDemo',dataValue)},onGameStart:function(worldName,gameName,fromEog){dataKey='gameStart_'+worldName+'_'+gameName;dataValue=this.incrementEventData(dataKey);this.trackGameEvent(worldName,gameName,'On'+(fromEog?'Re':'')+'Start',dataValue)},onGameEnd:function(worldName,gameName,fromEog){dataKey='gameEnd_'+worldName+'_'+gameName;dataValue=this.incrementEventData(dataKey);this.trackGameEvent(worldName,gameName,'On'+(fromEog?'Pre':'')+'End',dataValue)},onGameHelp:function(worldName,gameName){dataKey='gameHelp_'+worldName+'_'+gameName;dataValue=this.incrementEventData(dataKey);this.trackGameEvent(worldName,gameName,'OnHelp',dataValue)},onGameHighscore:function(worldName,gameName){dataKey='gameHelp_'+worldName+'_'+gameName;dataValue=this.incrementEventData(dataKey);this.trackGameEvent(worldName,gameName,'OnHelp',dataValue)},onEKCgameStart:function(appId){this.trackAppEvent(appId,1)},onEKCgameEnd:function(appId){this.trackAppEvent(appId,2)},track:function(location,data){if(location===undefined)location=window.location.href;if(data===undefined)data=pageTracking;this.currentTrackingData=data;this.currentLocation=location;this.each(this.arrayOfProviders,function(index,value){try{this.logVerbose('track','{0} => {1}',value.getProviderName(),location);value.track(location,data)}catch(ex){this.logError(ex)}})},trackGameEvent:function(worldName,gameName,eventName,eventCounter){this.each(this.arrayOfProviders,function(index,value){try{if(typeof value.trackGameEvent=='function'){this.logVerbose('trackGameEvent','{0} => {1}:{2}:{3} ({4})',value.getProviderName(),worldName,gameName,eventName,eventCounter);value.trackGameEvent(this.currentLocation,this.currentTrackingData,worldName,gameName,eventName,eventCounter)}}catch(ex){Logger.logError(ex,'TrackingService:trackGameEvent')}})},trackAppEvent:function(appId,type){this.each(this.arrayOfProviders,function(index,value){try{if(typeof value.trackAppEvent=='function'){this.logVerbose('trackAppEvent','{0} => {1}:{2}',value.getProviderName(),appId,type);value.trackAppEvent(this.currentLocation,this.currentTrackingData,appId,type)}}catch(ex){Logger.logError(ex,'TrackingService:trackAppEvent')}})},trackContent:function(){try{var worldName=arguments.length>0?arguments[1]:'';var gameName=arguments.length>1?arguments[2]:'';if(arguments.length>2){for(i=3;i<arguments.length;i++)gameName='{0}:{1}'.format(gameName,arguments[i])}switch(arguments[0].toLowerCase()){case'load':this.onGameLoad(worldName,gameName);break;case'intro':this.onGameIntro(worldName,gameName);break;case'demo':this.onGameDemo(worldName,gameName);break;case'gamestart':this.onGameStart(worldName,gameName);break;case'help':this.onGameHelp(worldName,gameName);break;case'gameend':this.onGameEnd(worldName,gameName);break;case'highscore':this.onGameHighscore(worldName,gameName);break;default:this.trackGameEvent.apply(this,arguments);break}}catch(ex){Logger.logError(ex,'TrackingService:trackGameEvent')}}}});Class('TrackingProvider',{isa:eoa,has:{trackingService:{is:'ro',init:null},site:{is:'ro',init:null},providerName:{is:'ro',init:'TrackingService'},tagName:{is:'ro',init:'general'}},methods:{initialize:function(){},init:function(trackingService,site){this.trackingService=trackingService;this.site=site},_toString:function(obj){myString="";for(key in obj)myString+=key+'='+obj[key]+' ';return myString},toTag:function(data,eventName,eventCounter){var general={eventName:eventName||'',eventCounter:eventCounter||''};$(data).find('node[ name = \'general\' ]').children().each(function(){name=$(this).attr('name');value=$(this).text();general[name]=value});$(data).find('node[ name = \''+this.tagName+'\' ]').children().each(function(){name=$(this).attr('name');value=$(this).text();general[name]=value});return general}}});Class('SynthiconTrackingProvider',{isa:TrackingProvider,has:{trackingImage:{is:'ro'},trackingImageId:{is:'rw',init:'synthiconTrackingProvider'},trackingImageSite:{is:'rw',init:'/tracking2.aspx'}},after:{init:function(){this.trackingImage=$('#'+this.trackingImageId);if(this.trackingImage.length==0){this.logVerbose('init','=> writing image tag');$("body").append('<img width="1px" height="1px" src="" id="'+this.trackingImageId+'" ></img>');this.trackingImage=$('#'+this.trackingImageId)}}},methods:{initialize:function(){this.providerName='SynthiconTrackingProvider'},track:function(location,data){this.writeTag('name='+data.pageName)},trackGameEvent:function(location,data,worldName,gameName,eventName,eventCount){this.writeTag('name='+worldName+'_'+gameName+'_'+eventName)},trackAppEvent:function(location,data,appId,type){if(appId>0&&type>0){this.writeTag('appid='+appId+'&type='+type)}},writeTag:function(tagSrc){this.logVerbose('writing tag','=> {0}',tagSrc);$(this.trackingImage).attr('src',this.trackingImageSite+'?'+tagSrc+'&free='+(site.getArea()=='free'))}}});Class('OmnitureTrackingProvider',{isa:TrackingProvider,has:{asyncTrack:{is:'ro',init:[]},isReady:{is:'ro',init:false}},after:{init:function(){Logger.log(Logger.getVerbose(),'init',this.providerName);this.getScript(('https:'==document.location.protocol?'https://':'http://')+this.site.getSiteHost()+'/scripts/s_code.js',function(){this.isReady=true;this.trigger('onOmnitureTrackingProviderReady')})}},override:{toTag:function(data,eventName,eventCounter){var result=this.SUPER(data,eventName,eventCounter);if(eventName===undefined)result.pageName=data.pageName;else result.pageName=eventName;if(data.channel!==undefined)result.channel=data.channel;if(data.landingPageName!==undefined)result.landingPageName=data.landingPageName;result.events=data.events||'event1';result.server=this.site.getSiteHost();return result}},methods:{initialize:function(props){this.providerName='OmnitureTrackingProvider';this.tagName="omniture";this.events(['onOmnitureTrackingProviderReady'])},track:function(location,data){var tag=this.toTag(data);this.writeTag(tag)},trackGameEvent:function(location,data,worldName,gameName,eventName,eventCounter){var tagName=worldName;if(gameName!=undefined&&gameName!='')tagName+=':'+gameName;var tag=this.toTag(data,tagName,eventCounter);this.writeTag(tag)},onOmnitureTrackingProviderReady:function(){this.each(this.asyncTrack,function(index,value){tag=this.asyncTrack.pop();this.writeTag(tag)})},writeTag:function(tag){if(this.isReady==false){Logger.log(Logger.getVerbose(),'pushing to async => '+this.toString(tag),this.providerName);this.asyncTrack.push(tag)}else{if(window.gameId!=null||window.worldId!=null){tag=this.correctPageName(tag)}s.pageName=tag.pageName.toLowerCase();s.server=tag.server.toLowerCase();if(tag.events==''||tag.events.indexOf('event1')==-1)tag.events='event1,'+tag.events;s.events=tag.events.toLowerCase();if(tag.channel!=''&&tag.channel!==undefined)s.channel=tag.channel.toLowerCase();if(tag.landingPageName!=''&&tag.landingPageName!==undefined)s.eVar5=tag.landingPageName.toLowerCase();Logger.log(Logger.getVerbose(),'writing => '+this._toString(tag),this.providerName);var s_code=s.t();if(s_code){Logger.log(Logger.getVerbose(),'OmnitureTracking:TAG',s_code);document.write(s_code)}}},correctPageName:function(tag){if(tag.pageName.indexOf('free_matheland')==0||tag.pageName.indexOf('free_medicus')==0)tag.pageName=tag.pageName.replace('free_','');if(tag.pageName.indexOf(('{0}:').format(site.area))!=0)tag.pageName=('{0}:{1}').format(site.area,tag.pageName);var second=tag.pageName.substr(tag.pageName.indexOf(':')+1).toLowerCase();second=second.substr(0,second.indexOf(':')+1);if(second!="worlds:"&&second!="kino:"&&second!="laden:"&&second!="garten:")tag.pageName=('{0}worlds:{1}').format(tag.pageName.substr(0,tag.pageName.indexOf(':')+1),tag.pageName.substr(tag.pageName.indexOf(':')+1));tag.pageName=tag.pageName.replace('videoworld_','').replace('play_','');if(window.worldId!=null&&window.o_worldName!=null&&(tag.pageName.substr(tag.pageName.indexOf(':')+1,6)=='worlds'||tag.pageName.substr(tag.pageName.indexOf(':')+1,5)=='laden')){var tmp=tag.pageName;for(var i=0;i<3;i++){tmp=tmp.substr(tmp.indexOf(':')+1)}tag.pageName=('{0}:{1}{2}').format(site.area,window.o_worldName.replace(/:/g,'_'),tmp.length>0?(":"+tmp):tmp)}else if(window.gameId!=null&&window.o_gameName!=null&&window.o_worldName!=null){var tmp=tag.pageName;for(var i=0;i<4;i++){tmp=tmp.substr(tmp.indexOf(':')+1)}tag.pageName=('{0}:{1}:{2}{3}').format(site.area,window.o_worldName.replace(/:/g,'_'),window.o_gameName.replace(/:/g,'_'),tmp.length>0?(":"+tmp):tmp)}tag.pageName=tag.pageName.toLowerCase();tag.pageName=tag.pageName.replace(/\s/g,'_').replace(/ä/g,'ae').replace(/ö/g,'oe').replace(/ü/g,'ue').replace(/ß/g,'ss').replace(/!/g,'').replace(/&/g,'').replace(/,/g,'').replace(/\?/g,'').replace(/\(/g,'').replace(/\)/g,'');return tag}}});var site=null;var flashSite=null;var trackingService=null;$(document).ready(function(){site=Site.getSite();site.registerStartupScript(function(){})});$(window).load(function(){site.triggerSiteReady();flashSite=new FlashSite(site);trackingService=new TrackingService(site,[new SynthiconTrackingProvider(),new OmnitureTrackingProvider()]);$(document).trigger('onLocationChanged',[window.location.pathname])});if(window.localStorage&&window.localStorage['cacheVar']!=webConfig.cacheVar){try{window.localStorage.clear();window.localStorage['cacheVar']=webConfig.cacheVar}catch(e){}};Class('serviceCall',{has:{service:{is:'ro',init:null},data:{is:'rw',init:null},dataSource:{is:'rw',init:null},dataSourceName:{is:'rw',init:''},queryName:{is:'ro',init:''},queryParameters:{is:'rw',init:[]},invalidates:{is:'rw',init:[]},isCachable:{is:'rw',init:true}},methods:{BUILD:function(service,dataSourceName,queryName,queryParameters,isCachable,invalidates){return{service:service,dataSourceName:dataSourceName,queryName:queryName,queryParameters:queryParameters||[],isCachable:isCachable!=undefined?isCachable:true,invalidates:invalidates||[]}},initialize:function(props){this.service=props.service;this.dataSourceName=props.dataSourceName;this.queryName=props.queryName;this.queryParameters=props.queryParameters;this.isCachable=props.isCachable;this.invalidates=props.invalidates},reset:function(){this.data=[]}}});Class('_serviceBase',{has:{serviceUri:{is:'ro',init:''},serviceData:{is:'rw',init:{}},dataSources:{is:'ro',init:{}},serviceCalls:{is:'rw',init:{}},callSecure:{is:'ro',init:false}},my:{methods:{clearCache:function(startsWith){var store=amplify.store();var lowerKey,lowerStartsWith;if(startsWith)lowerStartsWith=startsWith.toLowerCase();for(key in store){if(store.hasOwnProperty(key)){lowerKey=key.toLowerCase();if((lowerStartsWith&&lowerKey.indexOf(lowerStartsWith)==0)||!lowerStartsWith)amplify.store(key,null)}}},getDateTime:function(dateString){if(dateString===null){return null}if(dateString.match(/\/Date\((\d+\+\d+)\)\//)){return new Date(parseInt(dateString.replace(/\/Date\((\d+\+\d+)\)\//,"$1")))}else{return new Date(dateString)}}}},methods:{initialize:function(props){if(props.serviceUri)this.serviceUri=props.serviceUri;if(props.callSecure){this.callSecure=props.callSecure;this.serviceUri='https://{0}{1}'.format(window.location.host,this.serviceUri)}},randomString:function(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=8;var randomstring='';for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring},getDataSource:function(serviceCall,cacheKey,fromCache,queryParams,callback){var callName=this.randomString();(function(my,methodName,_serviceCall,_cacheKey,_fromCache,_queryParams,_callback){my[methodName]=function(data){my.refresh.apply(my,[data,_serviceCall,_cacheKey,_fromCache,_queryParams,_callback])}})(this,callName,serviceCall,cacheKey,queryParams,fromCache,callback);var options={queryParameters:queryParams,refresh:this[callName],serviceUrl:this.serviceUri,queryName:serviceCall.getQueryName()};serviceCall.reset();var dataSource=$([serviceCall.getData()]).dataSource(options);serviceCall.setDataSource(dataSource);return dataSource},applyServiceCalls:function(callArray){for(callName in callArray){if(!callArray.hasOwnProperty(callName))continue;var serviceCall=callArray[callName];this.serviceCalls[callName]=serviceCall;this[serviceCall.getDataSourceName()]=[];this[serviceCall.getDataSourceName()+'Source']=$([this[serviceCall.getDataSourceName()]]).dataSource({serviceUrl:this.serviceUri,queryName:serviceCall.getQueryName()});serviceCall.setDataSource(this[serviceCall.getDataSourceName()+'Source']);serviceCall.setData(this[serviceCall.getDataSourceName()]);(function(my,methodName){my[methodName]=function(){var args=[methodName];_.each(arguments,function(arg){args.push(arg)});my.call.apply(my,args)}})(this,callName)}},call:function(name){var serviceCall=this.serviceCalls[name];if(!serviceCall)return;var cacheKey=this.getCacheKey(serviceCall,arguments);var queryParameters=this.getQueryParameters(serviceCall,arguments);var callback={'cbFunction':this.getCallback(serviceCall,arguments),'fromFlash':this.isCalledFromFlash(arguments),'movie':arguments[2]};var cacheData=amplify.store(cacheKey);if($.isFunction(this.beforeCall)){var beforeCallRet=this.beforeCall(name,serviceCall,cacheKey,cacheData,queryParameters,callback);if(!beforeCallRet)return}if(serviceCall.getIsCachable()&&cacheData){this.refresh.apply(this,[cacheData,serviceCall,cacheKey,true,queryParameters,callback])}else{var dataSource=this.getDataSource(serviceCall,cacheKey,false,queryParameters,callback);dataSource.refresh()}},isCalledFromFlash:function(args){if(!args||!args[1])return false;if(!_.isString(args[1]))return false;return args[1].substring(0,3)=='cbn'},getCallback:function(serviceCall,args){if(!this.isCalledFromFlash(args)){var startIndex=1;var params=serviceCall.getQueryParameters();if(args.length>startIndex+params.length){var cb=args[startIndex+params.length];if($.isFunction(cb))return cb}}else{return args[1]}return null},getQueryParameters:function(serviceCall,args){var startIndex=this.isCalledFromFlash(args)?3:1;var queryParameters={};var params=serviceCall.getQueryParameters();var count=0;if(startIndex>args.length||!params)return null;for(i=startIndex;i<args.length;i++){if(params[i-startIndex]&&(args[i]||args[i]===0)){queryParameters[params[i-startIndex]]=args[i];count++}}return queryParameters},getCacheKey:function(serviceCall,args){var cacheKey=serviceCall.getQueryName();if(_.isArguments(args)||_.isArray(args)){var startIndex=this.isCalledFromFlash(args)?3:1;var params=serviceCall.getQueryParameters();for(i=startIndex;i<args.length;i++){if($.isFunction(args[i]))continue;cacheKey+='_{0}={1}'.format(params[i-startIndex],args[i])}}else{for(name in args){if(args.hasOwnProperty(name)){if($.isFunction(args[name]))continue;cacheKey+='_{0}={1}'.format(name,args[name])}}}cacheKey+='_site={0}'.format(site.area);return cacheKey},invalidate:function(name,cacheKey){var serviceCall=this.serviceCalls[name];var doInvalidate=true;if($.isFunction(this.onInvalidate))doInvalidate=this.onInvalidate(name,serviceCall,serviceCall.getData(),cacheKey);if(serviceCall){serviceCall.reset();_serviceBase.clearCache(serviceCall.getQueryName())}},refresh:function(data,serviceCall,cacheKey,fromCache,queryParams,callback){this.serviceData[serviceCall.getDataSourceName()]=data;if($.isFunction(this.onRefresh)){this.onRefresh(serviceCall.getDataSourceName(),serviceCall,data,cacheKey,fromCache,queryParams,callback)}var sendToCache=serviceCall.getIsCachable();if($.isFunction(this.onUpdateCache)&&sendToCache)sendToCache=this.onUpdateCache(serviceCall.getDataSourceName(),serviceCall,data,cacheKey,sendToCache,queryParams,callback);if(sendToCache){try{amplify.store(cacheKey,data,{expires:60*60*1000})}catch(e){}}if(serviceCall.getInvalidates()){var invalidateArr=serviceCall.getInvalidates();for(i=0;i<invalidateArr.length;i++)this.invalidate(invalidateArr[i])}this[serviceCall.dataSourceName]=data;if(callback.fromFlash){_(callback.movie).movie()[callback.cbFunction](data)}else if(callback.cbFunction){callback.cbFunction(data)}if($.isFunction(this.afterCall)){this.afterCall(serviceCall.getDataSourceName(),serviceCall,data,cacheKey,fromCache,queryParams)}},onRefresh:function(name,serviceCall,data,cacheKey,fromCache,queryParameters,callback){},beforeCall:function(name,serviceCall,cacheKey,cacheData,queryParameters,callback){return true},afterCall:function(name,serviceCall,data,cacheKey,fromCache,queryParameters){},onUpdateCache:function(name,serviceCall,data,cacheKey,isCachable,queryParameters,callback){return true},onInvalidate:function(name,serviceCall,data,cacheKey){return true},getDateTime:function(dateString){if(dateString===null){return null}if(dateString.match(/\/Date\((\d+\+\d+)\)\//)){return new Date(parseInt(dateString.replace(/\/Date\((\d+\+\d+)\)\//,"$1")))}else{return new Date(dateString)}}}});var contentItemModel={modelData:[],modelUri:'/EoA-CleverClub-Web-uiServices-ContentService.svc',modelDataSource:null,initialize:function(){this.modelDataSource=$([this.modelData]).dataSource({serviceUrl:this.modelUri,queryName:'GetContentItems',refresh:function(items){amplify.publish('model_content_refresh',items)}});this.modelDataSource.refresh()}};Class('shopService',{isa:_serviceBase,methods:{initialize:function(props){this.SUPER({serviceUri:'/EoA-CleverClub-Web-uiServices-ShopService.svc',callSecure:false});this.applyServiceCalls({getShopItemsByPrice:new serviceCall(this,'shopData','GetAllShopItemsForChildByPrice',['price','free']),getChildItemQuantity:new serviceCall(this,'quantityData','GetAllChildShopItemsQuantity',['worldId','categoryId','shopCategoryId','free']),getShopWorlds:new serviceCall(this,'worldData','GetShopWorlds'),getAllCategories:new serviceCall(this,'categoryData','GetAllCategories'),getAllShopCategories:new serviceCall(this,'shopCategoryData','GetAllShopCategories'),getWorldCategories:new serviceCall(this,'categoryData','GetWorldCategories',['worldId']),getWorldShopCategories:new serviceCall(this,'shopCategoryData','GetWorldShopCategories',['worldId']),getAllShopItems:new serviceCall(this,'shopData','GetAllShopItemsForChild',['free']),getWorldShopItems:new serviceCall(this,'shopData','GetShopItemsForChildByWorld',['worldId','free']),getWorldCatShopItems:new serviceCall(this,'shopData','GetAllShopItemsForChildByWorldAndCategory',['worldId','categoryId','free']),getWorldShopCatShopItems:new serviceCall(this,'shopData','GetAllShopItemsForChildByWorldAndShopCategory',['worldId','categoryId','free']),buyItem:new serviceCall(this,'buyData','BuyItemForChild',['itemId','free'],false,['getAllCategories','getAllShopCategories','getWorldCategories','getWorldShopCategories','getAllShopItems','getWorldShopItems','getWorldCatShopItems','getWorldShopCatShopItems','getChildItemQuantity','getShopItemsByPrice']),buyItemQuantity:new serviceCall(this,'buyData','BuyItemForChildWithQuantity',['itemId','quantity','free'],false,['getAllCategories','getAllShopCategories','getWorldCategories','getWorldShopCategories','getAllShopItems','getWorldShopItems','getWorldCatShopItems','getWorldShopCatShopItems','getChildItemQuantity','getShopItemsByPrice'])})},beforeCall:function(name,serviceCall,cacheKey,cacheData,queryParameters,callback){if(serviceCall.queryName=="GetAllShopItemsForChildByPrice"||serviceCall.queryName=="GetAllChildShopItemsQuantity"||serviceCall.queryName=="GetAllShopItemsForChild"||serviceCall.queryName=="GetShopItemsForChildByWorld"||serviceCall.queryName=="GetAllShopItemsForChildByWorldAndCategory"||serviceCall.queryName=="GetAllShopItemsForChildByWorldAndShopCategory"||serviceCall.queryName=="BuyItemForChild"||serviceCall.queryName=="BuyItemForChildWithQuantity"){if(queryParameters!==null)$(queryParameters)[0].free=(site.getArea()=='free');else queryParameters=[{free:(site.getArea()=='free')}]}return this.SUPER()},onRefresh:function(name,serviceCall,data,cacheKey,fromCache,queryParameters,callback){if(name=='shopData'){(function($this){$.each(data,function(idx){this.Item.StartDate=$this.getDateTime(this.Item.StartDate);this.Item.EndDate=$this.getDateTime(this.Item.EndDate);this.Item.DateCreated=$this.getDateTime(this.Item.DateCreated);this.Item.DateModified=$this.getDateTime(this.Item.DateModified)})})(this)}if(serviceCall.queryName=='BuyItemForChild'||serviceCall.queryName=='BuyItemForChildWithQuantity'){InventoryService.invalidate('getAllItems');InventoryService.invalidate('getWorldItems');InventoryService.invalidate('getWorldCatItems');InventoryService.invalidate('getWorldShopCatItems');MemberService.refresh(function(childs){var coins=0;if(childs.SelectedChildId>0){coins=jQuery.grep(childs.Childs,function(c){return c.ChildId==childs.SelectedChildId})[0].Coins;removeCoins(coins)}})}return this.SUPER()}}});var ShopService=new shopService();Class('memberService',{has:{serviceUri:{is:'ro',init:''},memberData:{is:'rw',init:{}},childCreationData:{is:'rw',init:{}}},methods:{initialize:function(){this.serviceUri='http{2}://{0}{1}'.format(window.location.host,'/uiServices/MemberService.svc',(webConfig.useSSL?'s':''))},serviceCall:function(service,data,params,callback){var uri='{0}/{1}'.format(this.serviceUri,service);$.ajax({url:uri,data:params,dataType:"jsonp",success:function(queryResult){MemberService[data]=queryResult.d;if($.isFunction(callback)){callback(queryResult.d)}}})},login:function(username,password,callback){this.serviceCall('Login','memberData',{'user':username,'pass':$.md5(password.toLowerCase())},callback);this.clearStorage()},refresh:function(callback){this.serviceCall('Refresh','memberData',{},callback)},selectChild:function(childId,callback){this.serviceCall('SelectChild','memberData',{'childId':childId},callback);this.clearStorage()},createChild:function(name,gender,callback){this.serviceCall('CreateChild','childCreationData',{'name':name,'gender':gender},callback)},createChildWithBirthday:function(name,gender,birthday,callback){this.serviceCall('CreateChildWithBirthday','childCreationData',{'name':name,'gender':gender,'birthday':birthday},callback)},saveChild:function(childId,name,gender,birthday,callback){this.serviceCall('SaveChild','childCreationData',{'childId':childId,'name':name,'gender':gender,'birthday':birthday},callback)},passwordLost:function(){jLayer('','/globale-texte/lostpassword.aspx','Passwort vergessen',null,{dialogClass:'lostPassword',overlayOpacity:0.5})},sendPassword:function(username,email,callback){this.serviceCall('SendPassword','boolData',{'username':username,'email':email},callback)},logout:function(callback){this.serviceCall('Logout','memberData',{},callback);this.clearStorage()},clearStorage:function(){$.each(amplify.store(),function(key){amplify.store(key,null)})}}});var MemberService=new memberService();Class('inventoryService',{isa:_serviceBase,methods:{initialize:function(props){this.SUPER({serviceUri:'/EoA-CleverClub-Web-uiServices-ShopService.svc',callSecure:false});this.applyServiceCalls({getAllItems:new serviceCall(this,'inventoryData','GetAllChildItems',['free']),getWorldItems:new serviceCall(this,'inventoryData','GetChildItemsByWorld',['worldId','free']),getWorldCatItems:new serviceCall(this,'inventoryData','GetChildItemsByWorldAndCategory',['worldId','categoryId','free']),getWorldShopCatItems:new serviceCall(this,'inventoryData','GetChildItemsByWorldAndShopCategory',['worldId','categoryId','free']),getPlacedWorldItems:new serviceCall(this,'worldData','GetWorldItems',['worldId','categories','free']),useItem:new serviceCall(this,'boolData','UseItemForChild',['itemId','free'],false,['getAllItems','getWorldItems','getWorldCatItems','getWorldShopCatItems','getPlacedWorldItems']),useItemWithQuantity:new serviceCall(this,'boolData','UseItemForChildWithQuantity',['itemId','quantity','free'],false,['getAllItems','getWorldItems','getWorldCatItems','getWorldShopCatItems','getPlacedWorldItems']),putWorldItem:new serviceCall(this,'boolData','PutChildItemInWorld',['itemId','position','free'],false,['getAllItems','getWorldItems','getWorldCatItems','getWorldShopCatItems','getPlacedWorldItems'])})},beforeCall:function(name,serviceCall,cacheKey,cacheData,queryParameters,callback){if(queryParameters!==null)$(queryParameters)[0].free=(site.getArea()=='free');else queryParameters=[{free:(site.getArea()=='free')}];return this.SUPER()},onRefresh:function(name,serviceCall,data,cacheKey,fromCache,queryParameters,callback){if(name!='boolData'){(function($this){$.each(data,function(idx){if(this.Item!=null){this.Item.StartDate=$this.getDateTime(this.Item.StartDate);this.Item.EndDate=$this.getDateTime(this.Item.EndDate);this.Item.DateCreated=$this.getDateTime(this.Item.DateCreated);this.Item.DateModified=$this.getDateTime(this.Item.DateModified)}})})(this)}ShopService.invalidate('getWorldShopCatShopItems');ShopService.invalidate('getWorldCatShopItems');ShopService.invalidate('getWorldShopItems');ShopService.invalidate('getChildItemQuantity');return this.SUPER()}}});var InventoryService=new inventoryService();Class('gardenService',{isa:_serviceBase,methods:{initialize:function(props){this.SUPER({serviceUri:'/EoA-CleverClub-Web-uiServices-GardenService.svc',callSecure:false});this.applyServiceCalls({getGarden:new serviceCall(this,'gardenData','GetChildGarden',['free']),addItem:new serviceCall(this,'boolData','AddItem',['itemId','posX','posY','free'],false,['getGarden']),removeItem:new serviceCall(this,'boolData','RemoveItem',['posX','posY','free'],false,['getGarden']),moveItem:new serviceCall(this,'boolData','MoveItem',['oldX','oldY','posX','posY','free'],false,['getGarden']),manuring:new serviceCall(this,'boolData','Manuring',['quantity','free'],false,['getGarden'])})},beforeCall:function(name,serviceCall,cacheKey,cacheData,queryParameters,callback){if(queryParameters!==null)$(queryParameters)[0].free=(site.getArea()=='free');else queryParameters=[{free:(site.getArea()=='free')}];return this.SUPER()},onRefresh:function(name,serviceCall,data,cacheKey,fromCache,queryParameters,callback){if(name!='boolData'&&data[0]){(function($this){$.each(data[0].Items,function(idx){this.Item.StartDate=$this.getDateTime(this.Item.StartDate);this.Item.EndDate=$this.getDateTime(this.Item.EndDate);this.Item.DateCreated=$this.getDateTime(this.Item.DateCreated);this.Item.DateModified=$this.getDateTime(this.Item.DateModified)})})(this)}if(serviceCall.queryName=='AddItem'||serviceCall.queryName=='RemoveItem'){InventoryService.invalidate('getAllItems');InventoryService.invalidate('getWorldItems');InventoryService.invalidate('getWorldCatItems');InventoryService.invalidate('getWorldShopCatItems');ShopService.invalidate('getWorldShopCatShopItems');ShopService.invalidate('getWorldCatShopItems');ShopService.invalidate('getWorldShopItems');ShopService.invalidate('getChildItemQuantity')}return this.SUPER()}}});var GardenService=new gardenService();Class('flowerService',{isa:_serviceBase,methods:{initialize:function(props){this.SUPER({serviceUri:'/EoA-CleverClub-Web-uiServices-FlowerService.svc',callSecure:false});this.applyServiceCalls({getFlowerbed:new serviceCall(this,'flowerData','GetFlowerbed',['free']),addFlower:new serviceCall(this,'boolData','AddFlower',['itemId','position','free'],false,['getFlowerbed']),moveFlower:new serviceCall(this,'boolData','MoveFlower',['oldPosition','newPosition','free'],false,['getFlowerbed']),doAction:new serviceCall(this,'boolData','DoAction',['position','actionId','free'],false,['getFlowerbed'])})},beforeCall:function(name,serviceCall,cacheKey,cacheData,queryParameters,callback){if(serviceCall.queryName=="GetFlowerbed"||serviceCall.queryName=="AddFlower"||serviceCall.queryName=="MoveFlower"||serviceCall.queryName=="DoAction"){if(queryParameters!==null)$(queryParameters)[0].free=(site.getArea()=='free');else queryParameters=[{free:(site.getArea()=='free')}]}return this.SUPER()},ActionFlowerWater:function(position,refreshFn){return this.doAction(position,1,refreshFn,site.getArea()=='free')},ActionFlowerManure:function(position,refreshFn){return this.doAction(position,2,refreshFn,site.getArea()=='free')},ActionFlowerSuperManure:function(position,refreshFn){return this.doAction(position,3,refreshFn,site.getArea()=='free')},ActionFlowerMayBeetle:function(position,refreshFn){return this.doAction(position,4,refreshFn,site.getArea()=='free')},HarvestFlower:function(position,refreshFn){return this.doAction(position,5,refreshFn,site.getArea()=='free')},DeleteFlower:function(position,refreshFn){return this.doAction(position,7,refreshFn)},onRefresh:function(name,serviceCall,data,cacheKey,fromCache,queryParameters,callback){if(name!='boolData'&&data[0]){(function($this){$.each(data[0].Flowers,function(idx){this.CreationDate=$this.getDateTime(this.CreationDate);this.StateDate=$this.getDateTime(this.StateDate)})})(this)}if(serviceCall.queryName=='AddFlower'||serviceCall.queryName=='DoAction'){InventoryService.invalidate('getAllItems');InventoryService.invalidate('getWorldItems');InventoryService.invalidate('getWorldCatItems');InventoryService.invalidate('getWorldShopCatItems');ShopService.invalidate('getWorldShopCatShopItems');ShopService.invalidate('getWorldCatShopItems');ShopService.invalidate('getWorldShopItems');ShopService.invalidate('getChildItemQuantity');GardenService.invalidate('getGarden')}return this.SUPER()}}});var FlowerService=new flowerService();Class('highscoreService',{isa:_serviceBase,methods:{initialize:function(props){this.SUPER({serviceUri:'/EoA-CleverClub-Web-uiServices-HighscoreService.svc',callSecure:false});this.applyServiceCalls({getGameScores:new serviceCall(this,'highscoreData','GetGameScores',['gameid'],false),getWorldScores:new serviceCall(this,'highscoreData','GetWorldScores',['worldid'],false),saveScore:new serviceCall(this,'awardData','SaveScore',['gameid','score'],false),free_createPlayer:new serviceCall(this,'freeUserData','CreateFreePlayer',['EMail','Password','PlayerName','Vorname','Nachname','Strasse','HausNr','PLZ','Ort','Land','Telefon','EigeneMail','Newsletter'],false),free_login:new serviceCall(this,'freeUserData','LoginFreePlayer',['email','password'],false),free_isLoggedIn:new serviceCall(this,'freeUserData','IsFreeLoggedIn',[],false),free_saveScore:new serviceCall(this,'boolData','SaveFreeScore',['childId','gameId','score'],false),free_sendPassword:new serviceCall(this,'boolData','SendPassword',['email'],false),free_getGameScores:new serviceCall(this,'freeHighscoreData','GetScoresForFreeGame',['childId','gameId'],false),teufelskicker_getUserData:new serviceCall(this,'teufelskickerData','GetTeufelskickerUserData',[],false),teufelskicker_getLigaData:new serviceCall(this,'teufelskickerData','GetTeufelskickerLigaData',['liga','maxRecords'],false),teufelskicker_saveUserData:new serviceCall(this,'teufelskickerData','SaveTeufelskickerUserData',['tore','gegentore'],false),teufelskicker_getPenaltyData:new serviceCall(this,'penaltyData','GetPenaltyData',[],false),teufelskicker_savePenaltyData:new serviceCall(this,'boolData','SavePenaltyData',['country'],false),loadAdditionalData:new serviceCall(this,'additionalData','LoadTKKGData',['gameId'],false),saveAdditionalData:new serviceCall(this,'boolData','SaveTKKGData',['gameId','data'],false),archiv_getBackups:new serviceCall(this,'backupData','GetBackups',['worldId'],true),archiv_getWorldData:new serviceCall(this,'archivData','GetBackupWor
