// OverlayMe v0.13.2 // http://github.com/frontfoot/overlay_me // // Copyright (c) 2012 Joseph Boiteau, FrontFoot Media Solutions // OverlayMe is freely distributable under the MIT license. // // Includes: // - jQuery - http://jquery.com/ - Copyright 2011, John Resig // - Backbone.js - http://documentcloud.github.com/backbone - (c) 2010 Jeremy Ashkenas, DocumentCloud Inc. // - Underscore.js - http://documentcloud.github.com/underscore - (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. // - html5slider - https://github.com/fryn/html5slider - Copyright (c) 2010-2011 Frank Yan (function(window,undefined){var document=window.document,navigator=window.navigator,location=window.location;var OMjQuery=(function(){var OMjQuery=function(selector,context){return new OMjQuery.fn.init(selector,context,rootOMjQuery);},_OMjQuery=window.OMjQuery,_$=window.$o,rootOMjQuery,quickExpr=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,rnotwhite=/\S/,trimLeft=/^\s+/,trimRight=/\s+$/,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.]+))?/,rdashAlpha=/-([a-z]|[0-9])/ig,rmsPrefix=/^-ms-/,fcamelCase=function(all,letter){return(letter+"").toUpperCase();},userAgent=navigator.userAgent,browserMatch,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={};OMjQuery.fn=OMjQuery.prototype={constructor:OMjQuery,init:function(selector,context,rootOMjQuery){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=selector;this.length=1;return this;} if(typeof selector==="string"){if(selector.charAt(0)==="<"&&selector.charAt(selector.length-1)===">"&&selector.length>=3){match=[null,selector,null];}else{match=quickExpr.exec(selector);} if(match&&(match[1]||!context)){if(match[1]){context=context instanceof OMjQuery?context[0]:context;doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(OMjQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];OMjQuery.fn.attr.call(selector,context,true);}else{selector=[doc.createElement(ret[1])];}}else{ret=OMjQuery.buildFragment([match[1]],[doc]);selector=(ret.cacheable?OMjQuery.clone(ret.fragment):ret.fragment).childNodes;} return OMjQuery.merge(this,selector);}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){if(elem.id!==match[2]){return rootOMjQuery.find(selector);} this.length=1;this[0]=elem;} this.context=document;this.selector=selector;return this;}}else if(!context||context.jquery){return(context||rootOMjQuery).find(selector);}else{return this.constructor(context).find(selector);}}else if(OMjQuery.isFunction(selector)){return rootOMjQuery.ready(selector);} if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;} return OMjQuery.makeArray(selector,this);},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length;},toArray:function(){return slice.call(this,0);},get:function(num){return num==null?this.toArray():(num<0?this[this.length+num]:this[num]);},pushStack:function(elems,name,selector){var ret=this.constructor();if(OMjQuery.isArray(elems)){push.apply(ret,elems);}else{OMjQuery.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 OMjQuery.each(this,callback,args);},ready:function(fn){OMjQuery.bindReady();readyList.add(fn);return this;},eq:function(i){i=+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(OMjQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},end:function(){return this.prevObject||this.constructor(null);},push:push,sort:[].sort,splice:[].splice};OMjQuery.fn.init.prototype=OMjQuery.fn;OMjQuery.extend=OMjQuery.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"&&!OMjQuery.isFunction(target)){target={};} if(length===i){target=this;--i;} for(;i0){return;} readyList.fireWith(document,[OMjQuery]);if(OMjQuery.fn.trigger){OMjQuery(document).trigger("ready").off("ready");}}},bindReady:function(){if(readyList){return;} readyList=OMjQuery.Callbacks("once memory");if(document.readyState==="complete"){return setTimeout(OMjQuery.ready,1);} if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",OMjQuery.ready,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",OMjQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null;}catch(e){} if(document.documentElement.doScroll&&toplevel){doScrollCheck();}}},isFunction:function(obj){return OMjQuery.type(obj)==="function";},isArray:Array.isArray||function(obj){return OMjQuery.type(obj)==="array";},isWindow:function(obj){return obj!=null&&obj==obj.window;},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj);},type:function(obj){return obj==null?String(obj):class2type[toString.call(obj)]||"object";},isPlainObject:function(obj){if(!obj||OMjQuery.type(obj)!=="object"||obj.nodeType||OMjQuery.isWindow(obj)){return false;} try{if(obj.constructor&&!hasOwn.call(obj,"constructor")&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false;}}catch(e){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 new Error(msg);},parseJSON:function(data){if(typeof data!=="string"||!data){return null;} data=OMjQuery.trim(data);if(window.JSON&&window.JSON.parse){return window.JSON.parse(data);} if(rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,""))){return(new Function("return "+data))();} OMjQuery.error("Invalid JSON: "+data);},parseXML:function(data){if(typeof data!=="string"||!data){return null;} var xml,tmp;try{if(window.DOMParser){tmp=new DOMParser();xml=tmp.parseFromString(data,"text/xml");}else{xml=new ActiveXObject("Microsoft.XMLDOM");xml.async="false";xml.loadXML(data);}}catch(e){xml=undefined;} if(!xml||!xml.documentElement||xml.getElementsByTagName("parsererror").length){OMjQuery.error("Invalid XML: "+data);} return xml;},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){(window.execScript||function(data){window["eval"].call(window,data);})(data);}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||OMjQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break;}}}else{for(;i0&&elems[0]&&elems[length-1])||length===0||OMjQuery.isArray(elems));if(isArray){for(;i1?sliceDeferred.call(arguments,0):value;if(!(--count)){deferred.resolveWith(deferred,args);}};} function progressFunc(i){return function(value){pValues[i]=arguments.length>1?sliceDeferred.call(arguments,0):value;deferred.notifyWith(promise,pValues);};} if(length>1){for(;i
a";all=div.getElementsByTagName("*");a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return{};} select=document.createElement("select");opt=select.appendChild(document.createElement("option"));input=div.getElementsByTagName("input")[0];support={leadingWhitespace:(div.firstChild.nodeType===3),tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/top/.test(a.getAttribute("style")),hrefNormalized:(a.getAttribute("href")==="/a"),opacity:/^0.55/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:(input.value==="on"),optSelected:opt.selected,getSetAttribute:div.className!=="t",enctype:!!document.createElement("form").enctype,html5Clone:document.createElement("nav").cloneNode(true).outerHTML!=="<:nav>",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true,pixelMargin:true};OMjQuery.boxModel=support.boxModel=(document.compatMode==="CSS1Compat");input.checked=true;support.noCloneChecked=input.cloneNode(true).checked;select.disabled=true;support.optDisabled=!opt.disabled;try{delete div.test;}catch(e){support.deleteExpando=false;} if(!div.addEventListener&&div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){support.noCloneEvent=false;});div.cloneNode(true).fireEvent("onclick");} input=document.createElement("input");input.value="t";input.setAttribute("type","radio");support.radioValue=input.value==="t";input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);fragment=document.createDocumentFragment();fragment.appendChild(div.lastChild);support.checkClone=fragment.cloneNode(true).cloneNode(true).lastChild.checked;support.appendChecked=input.checked;fragment.removeChild(input);fragment.appendChild(div);if(div.attachEvent){for(i in{submit:1,change:1,focusin:1}){eventName="on"+i;isSupported=(eventName in div);if(!isSupported){div.setAttribute(eventName,"return;");isSupported=(typeof div[eventName]==="function");} support[i+"Bubbles"]=isSupported;}} fragment.removeChild(div);fragment=select=opt=div=input=null;OMjQuery(function(){var container,outer,inner,table,td,offsetSupport,marginDiv,conMarginTop,style,html,positionTopLeftWidthHeight,paddingMarginBorderVisibility,paddingMarginBorder,body=document.getElementsByTagName("body")[0];if(!body){return;} conMarginTop=1;paddingMarginBorder="padding:0;margin:0;border:";positionTopLeftWidthHeight="position:absolute;top:0;left:0;width:1px;height:1px;";paddingMarginBorderVisibility=paddingMarginBorder+"0;visibility:hidden;";style="style='"+positionTopLeftWidthHeight+paddingMarginBorder+"5px solid #000;";html="
"+""+"
";container=document.createElement("div");container.style.cssText=paddingMarginBorderVisibility+"width:0;height:0;position:static;top:0;margin-top:"+conMarginTop+"px";body.insertBefore(container,body.firstChild);div=document.createElement("div");container.appendChild(div);div.innerHTML="
t
";tds=div.getElementsByTagName("td");isSupported=(tds[0].offsetHeight===0);tds[0].style.display="";tds[1].style.display="none";support.reliableHiddenOffsets=isSupported&&(tds[0].offsetHeight===0);if(window.getComputedStyle){div.innerHTML="";marginDiv=document.createElement("div");marginDiv.style.width="0";marginDiv.style.marginRight="0";div.style.width="2px";div.appendChild(marginDiv);support.reliableMarginRight=(parseInt((window.getComputedStyle(marginDiv,null)||{marginRight:0}).marginRight,10)||0)===0;} if(typeof div.style.zoom!=="undefined"){div.innerHTML="";div.style.width=div.style.padding="1px";div.style.border=0;div.style.overflow="hidden";div.style.display="inline";div.style.zoom=1;support.inlineBlockNeedsLayout=(div.offsetWidth===3);div.style.display="block";div.style.overflow="visible";div.innerHTML="
";support.shrinkWrapBlocks=(div.offsetWidth!==3);} div.style.cssText=positionTopLeftWidthHeight+paddingMarginBorderVisibility;div.innerHTML=html;outer=div.firstChild;inner=outer.firstChild;td=outer.nextSibling.firstChild.firstChild;offsetSupport={doesNotAddBorder:(inner.offsetTop!==5),doesAddBorderForTableAndCells:(td.offsetTop===5)};inner.style.position="fixed";inner.style.top="20px";offsetSupport.fixedPosition=(inner.offsetTop===20||inner.offsetTop===15);inner.style.position=inner.style.top="";outer.style.overflow="hidden";outer.style.position="relative";offsetSupport.subtractsBorderForOverflowNotVisible=(inner.offsetTop===-5);offsetSupport.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==conMarginTop);if(window.getComputedStyle){div.style.marginTop="1%";support.pixelMargin=(window.getComputedStyle(div,null)||{marginTop:0}).marginTop!=="1%";} if(typeof container.style.zoom!=="undefined"){container.style.zoom=1;} body.removeChild(container);marginDiv=div=container=null;OMjQuery.extend(support,offsetSupport);});return support;})();var rbrace=/^(?:\{.*\}|\[.*\])$/,rmultiDash=/([A-Z])/g;OMjQuery.extend({cache:{},uuid:0,expando:"OMjQuery"+(OMjQuery.fn.jquery+Math.random()).replace(/\D/g,""),noData:{"embed":true,"object":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","applet":true},hasData:function(elem){elem=elem.nodeType?OMjQuery.cache[elem[OMjQuery.expando]]:elem[OMjQuery.expando];return!!elem&&!isEmptyDataObject(elem);},data:function(elem,name,data,pvt){if(!OMjQuery.acceptData(elem)){return;} var privateCache,thisCache,ret,internalKey=OMjQuery.expando,getByName=typeof name==="string",isNode=elem.nodeType,cache=isNode?OMjQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey,isEvents=name==="events";if((!id||!cache[id]||(!isEvents&&!pvt&&!cache[id].data))&&getByName&&data===undefined){return;} if(!id){if(isNode){elem[internalKey]=id=++OMjQuery.uuid;}else{id=internalKey;}} if(!cache[id]){cache[id]={};if(!isNode){cache[id].toJSON=OMjQuery.noop;}} if(typeof name==="object"||typeof name==="function"){if(pvt){cache[id]=OMjQuery.extend(cache[id],name);}else{cache[id].data=OMjQuery.extend(cache[id].data,name);}} privateCache=thisCache=cache[id];if(!pvt){if(!thisCache.data){thisCache.data={};} thisCache=thisCache.data;} if(data!==undefined){thisCache[OMjQuery.camelCase(name)]=data;} if(isEvents&&!thisCache[name]){return privateCache.events;} if(getByName){ret=thisCache[name];if(ret==null){ret=thisCache[OMjQuery.camelCase(name)];}}else{ret=thisCache;} return ret;},removeData:function(elem,name,pvt){if(!OMjQuery.acceptData(elem)){return;} var thisCache,i,l,internalKey=OMjQuery.expando,isNode=elem.nodeType,cache=isNode?OMjQuery.cache:elem,id=isNode?elem[internalKey]:internalKey;if(!cache[id]){return;} if(name){thisCache=pvt?cache[id]:cache[id].data;if(thisCache){if(!OMjQuery.isArray(name)){if(name in thisCache){name=[name];}else{name=OMjQuery.camelCase(name);if(name in thisCache){name=[name];}else{name=name.split(" ");}}} for(i=0,l=name.length;i1,null,false);},removeData:function(key){return this.each(function(){OMjQuery.removeData(this,key);});}});function dataAttr(elem,key,data){if(data===undefined&&elem.nodeType===1){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=data==="true"?true:data==="false"?false:data==="null"?null:OMjQuery.isNumeric(data)?+data:rbrace.test(data)?OMjQuery.parseJSON(data):data;}catch(e){} OMjQuery.data(elem,key,data);}else{data=undefined;}} return data;} function isEmptyDataObject(obj){for(var name in obj){if(name==="data"&&OMjQuery.isEmptyObject(obj[name])){continue;} if(name!=="toJSON"){return false;}} return true;} function handleQueueMarkDefer(elem,type,src){var deferDataKey=type+"defer",queueDataKey=type+"queue",markDataKey=type+"mark",defer=OMjQuery._data(elem,deferDataKey);if(defer&&(src==="queue"||!OMjQuery._data(elem,queueDataKey))&&(src==="mark"||!OMjQuery._data(elem,markDataKey))){setTimeout(function(){if(!OMjQuery._data(elem,queueDataKey)&&!OMjQuery._data(elem,markDataKey)){OMjQuery.removeData(elem,deferDataKey,true);defer.fire();}},0);}} OMjQuery.extend({_mark:function(elem,type){if(elem){type=(type||"fx")+"mark";OMjQuery._data(elem,type,(OMjQuery._data(elem,type)||0)+1);}},_unmark:function(force,elem,type){if(force!==true){type=elem;elem=force;force=false;} if(elem){type=type||"fx";var key=type+"mark",count=force?0:((OMjQuery._data(elem,key)||1)-1);if(count){OMjQuery._data(elem,key,count);}else{OMjQuery.removeData(elem,key,true);handleQueueMarkDefer(elem,type,"mark");}}},queue:function(elem,type,data){var q;if(elem){type=(type||"fx")+"queue";q=OMjQuery._data(elem,type);if(data){if(!q||OMjQuery.isArray(data)){q=OMjQuery._data(elem,type,OMjQuery.makeArray(data));}else{q.push(data);}} return q||[];}},dequeue:function(elem,type){type=type||"fx";var queue=OMjQuery.queue(elem,type),fn=queue.shift(),hooks={};if(fn==="inprogress"){fn=queue.shift();} if(fn){if(type==="fx"){queue.unshift("inprogress");} OMjQuery._data(elem,type+".run",hooks);fn.call(elem,function(){OMjQuery.dequeue(elem,type);},hooks);} if(!queue.length){OMjQuery.removeData(elem,type+"queue "+type+".run",true);handleQueueMarkDefer(elem,type,"queue");}}});OMjQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;} if(arguments.length1);},removeAttr:function(name){return this.each(function(){OMjQuery.removeAttr(this,name);});},prop:function(name,value){return OMjQuery.access(this,OMjQuery.prop,name,value,arguments.length>1);},removeProp:function(name){name=OMjQuery.propFix[name]||name;return this.each(function(){try{this[name]=undefined;delete this[name];}catch(e){}});},addClass:function(value){var classNames,i,l,elem,setClass,c,cl;if(OMjQuery.isFunction(value)){return this.each(function(j){OMjQuery(this).addClass(value.call(this,j,this.className));});} if(value&&typeof value==="string"){classNames=value.split(rspace);for(i=0,l=this.length;i-1){return true;}} return false;},val:function(value){var hooks,ret,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=OMjQuery.valHooks[elem.type]||OMjQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;} ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret;} return;} isFunction=OMjQuery.isFunction(value);return this.each(function(i){var self=OMjQuery(this),val;if(this.nodeType!==1){return;} if(isFunction){val=value.call(this,i,self.val());}else{val=value;} if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(OMjQuery.isArray(val)){val=OMjQuery.map(val,function(value){return value==null?"":value+"";});} hooks=OMjQuery.valHooks[this.type]||OMjQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});OMjQuery.extend({valHooks:{option:{get:function(elem){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text;}},select:{get:function(elem){var value,i,max,option,index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null;} i=one?index:0;max=one?index+1:options.length;for(;i=0;});if(!values.length){elem.selectedIndex=-1;} return values;}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){var ret,hooks,notxml,nType=elem.nodeType;if(!elem||nType===3||nType===8||nType===2){return;} if(pass&&name in OMjQuery.attrFn){return OMjQuery(elem)[name](value);} if(typeof elem.getAttribute==="undefined"){return OMjQuery.prop(elem,name,value);} notxml=nType!==1||!OMjQuery.isXMLDoc(elem);if(notxml){name=name.toLowerCase();hooks=OMjQuery.attrHooks[name]||(rboolean.test(name)?boolHook:nodeHook);} if(value!==undefined){if(value===null){OMjQuery.removeAttr(elem,name);return;}else if(hooks&&"set"in hooks&¬xml&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}else{elem.setAttribute(name,""+value);return value;}}else if(hooks&&"get"in hooks&¬xml&&(ret=hooks.get(elem,name))!==null){return ret;}else{ret=elem.getAttribute(name);return ret===null?undefined:ret;}},removeAttr:function(elem,value){var propName,attrNames,name,l,isBool,i=0;if(value&&elem.nodeType===1){attrNames=value.toLowerCase().split(rspace);l=attrNames.length;for(;i=0);}}});});var rformElems=/^(?:textarea|input|select)$/i,rtypenamespace=/^([^\.]*)?(?:\.(.+))?$/,rhoverHack=/(?:^|\s)hover(\.\S+)?\b/,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rquickIs=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,quickParse=function(selector){var quick=rquickIs.exec(selector);if(quick){quick[1]=(quick[1]||"").toLowerCase();quick[3]=quick[3]&&new RegExp("(?:^|\\s)"+quick[3]+"(?:\\s|$)");} return quick;},quickIs=function(elem,m){var attrs=elem.attributes||{};return((!m[1]||elem.nodeName.toLowerCase()===m[1])&&(!m[2]||(attrs.id||{}).value===m[2])&&(!m[3]||m[3].test((attrs["class"]||{}).value)));},hoverHack=function(events){return OMjQuery.event.special.hover?events:events.replace(rhoverHack,"mouseenter$1 mouseleave$1");};OMjQuery.event={add:function(elem,types,handler,data,selector){var elemData,eventHandle,events,t,tns,type,namespaces,handleObj,handleObjIn,quick,handlers,special;if(elem.nodeType===3||elem.nodeType===8||!types||!handler||!(elemData=OMjQuery._data(elem))){return;} if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;} if(!handler.guid){handler.guid=OMjQuery.guid++;} events=elemData.events;if(!events){elemData.events=events={};} eventHandle=elemData.handle;if(!eventHandle){elemData.handle=eventHandle=function(e){return typeof OMjQuery!=="undefined"&&(!e||OMjQuery.event.triggered!==e.type)?OMjQuery.event.dispatch.apply(eventHandle.elem,arguments):undefined;};eventHandle.elem=elem;} types=OMjQuery.trim(hoverHack(types)).split(" ");for(t=0;t=0){type=type.slice(0,-1);exclusive=true;} if(type.indexOf(".")>=0){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();} if((!elem||OMjQuery.event.customEvent[type])&&!OMjQuery.event.global[type]){return;} event=typeof event==="object"?event[OMjQuery.expando]?event:new OMjQuery.Event(type,event):new OMjQuery.Event(type);event.type=type;event.isTrigger=true;event.exclusive=exclusive;event.namespace=namespaces.join(".");event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.)?")+"(\\.|$)"):null;ontype=type.indexOf(":")<0?"on"+type:"";if(!elem){cache=OMjQuery.cache;for(i in cache){if(cache[i].events&&cache[i].events[type]){OMjQuery.event.trigger(event,data,cache[i].handle.elem,true);}} return;} event.result=undefined;if(!event.target){event.target=elem;} data=data!=null?OMjQuery.makeArray(data):[];data.unshift(event);special=OMjQuery.event.special[type]||{};if(special.trigger&&special.trigger.apply(elem,data)===false){return;} eventPath=[[elem,special.bindType||type]];if(!onlyHandlers&&!special.noBubble&&!OMjQuery.isWindow(elem)){bubbleType=special.delegateType||type;cur=rfocusMorph.test(bubbleType+type)?elem:elem.parentNode;old=null;for(;cur;cur=cur.parentNode){eventPath.push([cur,bubbleType]);old=cur;} if(old&&old===elem.ownerDocument){eventPath.push([old.defaultView||old.parentWindow||window,bubbleType]);}} for(i=0;idelegateCount){handlerQueue.push({elem:this,matches:handlers.slice(delegateCount)});} for(i=0;i0?this.on(name,null,data,fn):this.trigger(name);};if(OMjQuery.attrFn){OMjQuery.attrFn[name]=true;} if(rkeyEvent.test(name)){OMjQuery.event.fixHooks[name]=OMjQuery.event.keyHooks;} if(rmouseEvent.test(name)){OMjQuery.event.fixHooks[name]=OMjQuery.event.mouseHooks;}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,expando="sizcache"+(Math.random()+'').replace('.',''),done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true,rBackslash=/\\/g,rReturn=/\r\n/g,rNonWord=/\W/;[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,seed);}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,seed);}}}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;i0;};Sizzle.find=function(expr,context,isXML){var set,i,len,match,type,left;if(!expr){return[];} for(i=0,len=Expr.order.length;i":function(checkSet,part){var elem,isPartStr=typeof part==="string",i=0,l=checkSet.length;if(isPartStr&&!rNonWord.test(part)){part=part.toLowerCase();for(;i=0)){if(!inplace){result.push(elem);}}else if(inplace){curLoop[i]=false;}}} return false;},ID:function(match){return match[1].replace(rBackslash,"");},TAG:function(match,curLoop){return match[1].replace(rBackslash,"").toLowerCase();},CHILD:function(match){if(match[1]==="nth"){if(!match[2]){Sizzle.error(match[0]);} match[2]=match[2].replace(/^\+|\s*/g,'');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;} else if(match[2]){Sizzle.error(match[0]);} match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1]=match[1].replace(rBackslash,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];} match[4]=(match[4]||match[5]||"").replace(rBackslash,"");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){if(elem.parentNode){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){var attr=elem.getAttribute("type"),type=elem.type;return elem.nodeName.toLowerCase()==="input"&&"text"===type&&(attr===type||attr===null);},radio:function(elem){return elem.nodeName.toLowerCase()==="input"&&"radio"===elem.type;},checkbox:function(elem){return elem.nodeName.toLowerCase()==="input"&&"checkbox"===elem.type;},file:function(elem){return elem.nodeName.toLowerCase()==="input"&&"file"===elem.type;},password:function(elem){return elem.nodeName.toLowerCase()==="input"&&"password"===elem.type;},submit:function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"submit"===elem.type;},image:function(elem){return elem.nodeName.toLowerCase()==="input"&&"image"===elem.type;},reset:function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&"reset"===elem.type;},button:function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&"button"===elem.type||name==="button";},input:function(elem){return(/input|select|textarea|button/i).test(elem.nodeName);},focus:function(elem){return elem===elem.ownerDocument.activeElement;}},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 imatch[3]-0;},nth:function(elem,i,match){return match[3]-0===i;},eq:function(elem,i,match){return match[3]-0===i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var j=0,l=not.length;j=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||!!elem.nodeName&&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=Sizzle.attr?Sizzle.attr(elem,name):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&&Sizzle.attr?result!=null: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));} Expr.match.globalPOS=origPOS;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";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="";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="

";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;} Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&!Sizzle.isXML(context)){var match=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(query);if(match&&(context.nodeType===1||context.nodeType===9)){if(match[1]){return makeArray(context.getElementsByTagName(query),extra);}else if(match[2]&&Expr.find.CLASS&&context.getElementsByClassName){return makeArray(context.getElementsByClassName(match[2]),extra);}} if(context.nodeType===9){if(query==="body"&&context.body){return makeArray([context.body],extra);}else if(match&&match[3]){var elem=context.getElementById(match[3]);if(elem&&elem.parentNode){if(elem.id===match[3]){return makeArray([elem],extra);}}else{return makeArray([],extra);}} try{return makeArray(context.querySelectorAll(query),extra);}catch(qsaError){}}else if(context.nodeType===1&&context.nodeName.toLowerCase()!=="object"){var oldContext=context,old=context.getAttribute("id"),nid=old||id,hasParent=context.parentNode,relativeHierarchySelector=/^\s*[+~]/.test(query);if(!old){context.setAttribute("id",nid);}else{nid=nid.replace(/'/g,"\\$&");} if(relativeHierarchySelector&&hasParent){context=context.parentNode;} try{if(!relativeHierarchySelector||hasParent){return makeArray(context.querySelectorAll("[id='"+nid+"'] "+query),extra);}}catch(pseudoError){}finally{if(!old){oldContext.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;if(matches){var disconnectedMatch=!matches.call(document.createElement("div"),"div"),pseudoWorks=false;try{matches.call(document.documentElement,"[test!='']:sizzle");}catch(pseudoError){pseudoWorks=true;} 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)){var ret=matches.call(node,expr);if(ret||!disconnectedMatch||node.document&&node.document.nodeType!==11){return ret;}}}catch(e){}} return Sizzle(expr,null,null,[node]).length>0;};}})();(function(){var div=document.createElement("div");div.innerHTML="
";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;i0){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,seed){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;i0){for(n=length;n=0:OMjQuery.filter(selector,this).length>0:this.filter(selector).length>0);},closest:function(selectors,context){var ret=[],i,l,cur=this[0];if(OMjQuery.isArray(selectors)){var level=1;while(cur&&cur.ownerDocument&&cur!==context){for(i=0;i-1:OMjQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break;}else{cur=cur.parentNode;if(!cur||!cur.ownerDocument||cur===context||cur.nodeType===11){break;}}}} ret=ret.length>1?OMjQuery.unique(ret):ret;return this.pushStack(ret,"closest",selectors);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1;} if(typeof elem==="string"){return OMjQuery.inArray(this[0],OMjQuery(elem));} return OMjQuery.inArray(elem.jquery?elem[0]:elem,this);},add:function(selector,context){var set=typeof selector==="string"?OMjQuery(selector,context):OMjQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=OMjQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:OMjQuery.unique(all));},andSelf:function(){return this.add(this.prevObject);}});function isDisconnected(node){return!node||!node.parentNode||node.parentNode.nodeType===11;} OMjQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return OMjQuery.dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return OMjQuery.dir(elem,"parentNode",until);},next:function(elem){return OMjQuery.nth(elem,2,"nextSibling");},prev:function(elem){return OMjQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return OMjQuery.dir(elem,"nextSibling");},prevAll:function(elem){return OMjQuery.dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return OMjQuery.dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return OMjQuery.dir(elem,"previousSibling",until);},siblings:function(elem){return OMjQuery.sibling((elem.parentNode||{}).firstChild,elem);},children:function(elem){return OMjQuery.sibling(elem.firstChild);},contents:function(elem){return OMjQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:OMjQuery.makeArray(elem.childNodes);}},function(name,fn){OMjQuery.fn[name]=function(until,selector){var ret=OMjQuery.map(this,fn,until);if(!runtil.test(name)){selector=until;} if(selector&&typeof selector==="string"){ret=OMjQuery.filter(selector,ret);} ret=this.length>1&&!guaranteedUnique[name]?OMjQuery.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(","));};});OMjQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")";} return elems.length===1?OMjQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:OMjQuery.find.matches(expr,elems);},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||cur.nodeType!==1||!OMjQuery(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){qualifier=qualifier||0;if(OMjQuery.isFunction(qualifier)){return OMjQuery.grep(elements,function(elem,i){var retVal=!!qualifier.call(elem,i,elem);return retVal===keep;});}else if(qualifier.nodeType){return OMjQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep;});}else if(typeof qualifier==="string"){var filtered=OMjQuery.grep(elements,function(elem){return elem.nodeType===1;});if(isSimple.test(qualifier)){return OMjQuery.filter(qualifier,filtered,!keep);}else{qualifier=OMjQuery.filter(qualifier,filtered);}} return OMjQuery.grep(elements,function(elem,i){return(OMjQuery.inArray(elem,qualifier)>=0)===keep;});} function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement){while(list.length){safeFrag.createElement(list.pop());}} return safeFrag;} var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|"+"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlineOMjQuery=/ OMjQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,rtagName=/<([\w:]+)/,rtbody=/]","i"),rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rscriptType=/\/(java|ecma)script/i,rcleanScript=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},safeFragment=createSafeFragment(document);wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!OMjQuery.support.htmlSerialize){wrapMap._default=[1,"div
","
"];} OMjQuery.fn.extend({text:function(value){return OMjQuery.access(this,function(value){return value===undefined?OMjQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value));},null,value,arguments.length);},wrapAll:function(html){if(OMjQuery.isFunction(html)){return this.each(function(i){OMjQuery(this).wrapAll(html.call(this,i));});} if(this[0]){var wrap=OMjQuery(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(OMjQuery.isFunction(html)){return this.each(function(i){OMjQuery(this).wrapInner(html.call(this,i));});} return this.each(function(){var self=OMjQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var isFunction=OMjQuery.isFunction(html);return this.each(function(i){OMjQuery(this).wrapAll(isFunction?html.call(this,i):html);});},unwrap:function(){return this.parent().each(function(){if(!OMjQuery.nodeName(this,"body")){OMjQuery(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=OMjQuery.clean(arguments);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,OMjQuery.clean(arguments));return set;}},remove:function(selector,keepData){for(var i=0,elem;(elem=this[i])!=null;i++){if(!selector||OMjQuery.filter(selector,[elem]).length){if(!keepData&&elem.nodeType===1){OMjQuery.cleanData(elem.getElementsByTagName("*"));OMjQuery.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){OMjQuery.cleanData(elem.getElementsByTagName("*"));} while(elem.firstChild){elem.removeChild(elem.firstChild);}} return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return OMjQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return OMjQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined){return elem.nodeType===1?elem.innerHTML.replace(rinlineOMjQuery,""):null;} if(typeof value==="string"&&!rnoInnerhtml.test(value)&&(OMjQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1>");try{for(;i1&&i0?this.clone(true):this).get();OMjQuery(insert[i])[original](elems);ret=ret.concat(elems);} return this.pushStack(ret,name,insert.selector);}};});function getAll(elem){if(typeof elem.getElementsByTagName!=="undefined"){return elem.getElementsByTagName("*");}else if(typeof elem.querySelectorAll!=="undefined"){return elem.querySelectorAll("*");}else{return[];}} function fixDefaultChecked(elem){if(elem.type==="checkbox"||elem.type==="radio"){elem.defaultChecked=elem.checked;}} function findInputs(elem){var nodeName=(elem.nodeName||"").toLowerCase();if(nodeName==="input"){fixDefaultChecked(elem);}else if(nodeName!=="script"&&typeof elem.getElementsByTagName!=="undefined"){OMjQuery.grep(elem.getElementsByTagName("input"),fixDefaultChecked);}} function shimCloneNode(elem){var div=document.createElement("div");safeFragment.appendChild(div);div.innerHTML=elem.outerHTML;return div.firstChild;} OMjQuery.extend({clone:function(elem,dataAndEvents,deepDataAndEvents){var srcElements,destElements,i,clone=OMjQuery.support.html5Clone||OMjQuery.isXMLDoc(elem)||!rnoshimcache.test("<"+elem.nodeName+">")?elem.cloneNode(true):shimCloneNode(elem);if((!OMjQuery.support.noCloneEvent||!OMjQuery.support.noCloneChecked)&&(elem.nodeType===1||elem.nodeType===11)&&!OMjQuery.isXMLDoc(elem)){cloneFixAttributes(elem,clone);srcElements=getAll(elem);destElements=getAll(clone);for(i=0;srcElements[i];++i){if(destElements[i]){cloneFixAttributes(srcElements[i],destElements[i]);}}} if(dataAndEvents){cloneCopyEvent(elem,clone);if(deepDataAndEvents){srcElements=getAll(elem);destElements=getAll(clone);for(i=0;srcElements[i];++i){cloneCopyEvent(srcElements[i],destElements[i]);}}} srcElements=destElements=null;return clone;},clean:function(elems,context,fragment,scripts){var checkScriptType,script,j,ret=[];context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;} for(var i=0,elem;(elem=elems[i])!=null;i++){if(typeof elem==="number"){elem+="";} if(!elem){continue;} if(typeof elem==="string"){if(!rhtml.test(elem)){elem=context.createTextNode(elem);}else{elem=elem.replace(rxhtmlTag,"<$1>");var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div"),safeChildNodes=safeFragment.childNodes,remove;if(context===document){safeFragment.appendChild(div);}else{createSafeFragment(context).appendChild(div);} div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild;} if(!OMjQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]===""&&!hasBody?div.childNodes:[];for(j=tbody.length-1;j>=0;--j){if(OMjQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}} if(!OMjQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild);} elem=div.childNodes;if(div){div.parentNode.removeChild(div);if(safeChildNodes.length>0){remove=safeChildNodes[safeChildNodes.length-1];if(remove&&remove.parentNode){remove.parentNode.removeChild(remove);}}}}} var len;if(!OMjQuery.support.appendChecked){if(elem[0]&&typeof(len=elem.length)==="number"){for(j=0;j1);};OMjQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}else{return elem.style.opacity;}}}},cssNumber:{"fillOpacity":true,"fontWeight":true,"lineHeight":true,"opacity":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{"float":OMjQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;} var ret,type,origName=OMjQuery.camelCase(name),style=elem.style,hooks=OMjQuery.cssHooks[origName];name=OMjQuery.cssProps[origName]||origName;if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rrelNum.exec(value))){value=(+(ret[1]+1)*+ret[2])+parseFloat(OMjQuery.css(elem,name));type="number";} if(value==null||type==="number"&&isNaN(value)){return;} if(type==="number"&&!OMjQuery.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,hooks;name=OMjQuery.camelCase(name);hooks=OMjQuery.cssHooks[name];name=OMjQuery.cssProps[name]||name;if(name==="cssFloat"){name="float";} if(hooks&&"get"in hooks&&(ret=hooks.get(elem,true,extra))!==undefined){return ret;}else if(curCSS){return curCSS(elem,name);}},swap:function(elem,options,callback){var old={},ret,name;for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];} ret=callback.call(elem);for(name in options){elem.style[name]=old[name];} return ret;}});OMjQuery.curCSS=OMjQuery.css;if(document.defaultView&&document.defaultView.getComputedStyle){getComputedStyle=function(elem,name){var ret,defaultView,computedStyle,width,style=elem.style;name=name.replace(rupper,"-$1").toLowerCase();if((defaultView=elem.ownerDocument.defaultView)&&(computedStyle=defaultView.getComputedStyle(elem,null))){ret=computedStyle.getPropertyValue(name);if(ret===""&&!OMjQuery.contains(elem.ownerDocument.documentElement,elem)){ret=OMjQuery.style(elem,name);}} if(!OMjQuery.support.pixelMargin&&computedStyle&&rmargin.test(name)&&rnumnonpx.test(ret)){width=style.width;style.width=ret;ret=computedStyle.width;style.width=width;} return ret;};} if(document.documentElement.currentStyle){currentStyle=function(elem,name){var left,rsLeft,uncomputed,ret=elem.currentStyle&&elem.currentStyle[name],style=elem.style;if(ret==null&&style&&(uncomputed=style[name])){ret=uncomputed;} if(rnumnonpx.test(ret)){left=style.left;rsLeft=elem.runtimeStyle&&elem.runtimeStyle.left;if(rsLeft){elem.runtimeStyle.left=elem.currentStyle.left;} style.left=name==="fontSize"?"1em":ret;ret=style.pixelLeft+"px";style.left=left;if(rsLeft){elem.runtimeStyle.left=rsLeft;}} return ret===""?"auto":ret;};} curCSS=getComputedStyle||currentStyle;function getWidthOrHeight(elem,name,extra){var val=name==="width"?elem.offsetWidth:elem.offsetHeight,i=name==="width"?1:0,len=4;if(val>0){if(extra!=="border"){for(;i=1&&OMjQuery.trim(filter.replace(ralpha,""))===""){style.removeAttribute("filter");if(currentStyle&&!currentStyle.filter){return;}} style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity;}};} OMjQuery(function(){if(!OMjQuery.support.reliableMarginRight){OMjQuery.cssHooks.marginRight={get:function(elem,computed){return OMjQuery.swap(elem,{"display":"inline-block"},function(){if(computed){return curCSS(elem,"margin-right");}else{return elem.style.marginRight;}});}};}});if(OMjQuery.expr&&OMjQuery.expr.filters){OMjQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight;return(width===0&&height===0)||(!OMjQuery.support.reliableHiddenOffsets&&((elem.style&&elem.style.display)||OMjQuery.css(elem,"display"))==="none");};OMjQuery.expr.filters.visible=function(elem){return!OMjQuery.expr.filters.hidden(elem);};} OMjQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){OMjQuery.cssHooks[prefix+suffix]={expand:function(value){var i,parts=typeof value==="string"?value.split(" "):[value],expanded={};for(i=0;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];} return expanded;}};});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rhash=/#.*$/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,rinput=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,rlocalProtocol=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rquery=/\?/,rscript=/)<[^<]*)*<\/script>/gi,rselectTextarea=/^(?:select|textarea)/i,rspacesAjax=/\s+/,rts=/([?&])_=[^&]*/,rurl=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,_load=OMjQuery.fn.load,prefilters={},transports={},ajaxLocation,ajaxLocParts,allTypes=["*/"]+["*"];try{ajaxLocation=location.href;}catch(e){ajaxLocation=document.createElement("a");ajaxLocation.href="";ajaxLocation=ajaxLocation.href;} ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[];function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";} if(OMjQuery.isFunction(func)){var dataTypes=dataTypeExpression.toLowerCase().split(rspacesAjax),i=0,length=dataTypes.length,dataType,list,placeBefore;for(;i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);} var type="GET";if(params){if(OMjQuery.isFunction(params)){callback=params;params=undefined;}else if(typeof params==="object"){params=OMjQuery.param(params,OMjQuery.ajaxSettings.traditional);type="POST";}} var self=this;OMjQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(jqXHR,status,responseText){responseText=jqXHR.responseText;if(jqXHR.isResolved()){jqXHR.done(function(r){responseText=r;});self.html(selector?OMjQuery("
").append(responseText.replace(rscript,"")).find(selector):responseText);} if(callback){self.each(callback,[responseText,status,jqXHR]);}}});return this;},serialize:function(){return OMjQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?OMjQuery.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=OMjQuery(this).val();return val==null?null:OMjQuery.isArray(val)?OMjQuery.map(val,function(val,i){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}):{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});OMjQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){OMjQuery.fn[o]=function(f){return this.on(o,f);};});OMjQuery.each(["get","post"],function(i,method){OMjQuery[method]=function(url,data,callback,type){if(OMjQuery.isFunction(data)){type=type||callback;callback=data;data=undefined;} return OMjQuery.ajax({type:method,url:url,data:data,success:callback,dataType:type});};});OMjQuery.extend({getScript:function(url,callback){return OMjQuery.get(url,undefined,callback,"script");},getJSON:function(url,data,callback){return OMjQuery.get(url,data,callback,"json");},ajaxSetup:function(target,settings){if(settings){ajaxExtend(target,OMjQuery.ajaxSettings);}else{settings=target;target=OMjQuery.ajaxSettings;} ajaxExtend(target,settings);return target;},ajaxSettings:{url:ajaxLocation,isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":allTypes},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":true,"text json":OMjQuery.parseJSON,"text xml":OMjQuery.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;} options=options||{};var s=OMjQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=callbackContext!==s&&(callbackContext.nodeType||callbackContext instanceof OMjQuery)?OMjQuery(callbackContext):OMjQuery.event,deferred=OMjQuery.Deferred(),completeDeferred=OMjQuery.Callbacks("once memory"),statusCode=s.statusCode||{},ifModifiedKey,requestHeaders={},requestHeadersNames={},responseHeadersString,responseHeaders,transport,timeoutTimer,parts,state=0,fireGlobals,i,jqXHR={readyState:0,setRequestHeader:function(name,value){if(!state){var lname=name.toLowerCase();name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value;} return this;},getAllResponseHeaders:function(){return state===2?responseHeadersString:null;},getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}} match=responseHeaders[key.toLowerCase()];} return match===undefined?null:match;},overrideMimeType:function(type){if(!state){s.mimeType=type;} return this;},abort:function(statusText){statusText=statusText||"abort";if(transport){transport.abort(statusText);} done(0,statusText);return this;}};function done(status,nativeStatusText,responses,headers){if(state===2){return;} state=2;if(timeoutTimer){clearTimeout(timeoutTimer);} transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;var isSuccess,success,error,statusText=nativeStatusText,response=responses?ajaxHandleResponses(s,jqXHR,responses):undefined,lastModified,etag;if(status>=200&&status<300||status===304){if(s.ifModified){if((lastModified=jqXHR.getResponseHeader("Last-Modified"))){OMjQuery.lastModified[ifModifiedKey]=lastModified;} if((etag=jqXHR.getResponseHeader("Etag"))){OMjQuery.etag[ifModifiedKey]=etag;}} if(status===304){statusText="notmodified";isSuccess=true;}else{try{success=ajaxConvert(s,response);statusText="success";isSuccess=true;}catch(e){statusText="parsererror";error=e;}}}else{error=statusText;if(!statusText||status){statusText="error";if(status<0){status=0;}}} jqXHR.status=status;jqXHR.statusText=""+(nativeStatusText||statusText);if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);} jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger("ajax"+(isSuccess?"Success":"Error"),[jqXHR,s,isSuccess?success:error]);} completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--OMjQuery.active)){OMjQuery.event.trigger("ajaxStop");}}} deferred.promise(jqXHR);jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;jqXHR.complete=completeDeferred.add;jqXHR.statusCode=function(map){if(map){var tmp;if(state<2){for(tmp in map){statusCode[tmp]=[statusCode[tmp],map[tmp]];}}else{tmp=map[jqXHR.status];jqXHR.then(tmp,tmp);}} return this;};s.url=((url||s.url)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//");s.dataTypes=OMjQuery.trim(s.dataType||"*").toLowerCase().split(rspacesAjax);if(s.crossDomain==null){parts=rurl.exec(s.url.toLowerCase());s.crossDomain=!!(parts&&(parts[1]!=ajaxLocParts[1]||parts[2]!=ajaxLocParts[2]||(parts[3]||(parts[1]==="http:"?80:443))!=(ajaxLocParts[3]||(ajaxLocParts[1]==="http:"?80:443))));} if(s.data&&s.processData&&typeof s.data!=="string"){s.data=OMjQuery.param(s.data,s.traditional);} inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return false;} fireGlobals=s.global;s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);if(fireGlobals&&OMjQuery.active++===0){OMjQuery.event.trigger("ajaxStart");} if(!s.hasContent){if(s.data){s.url+=(rquery.test(s.url)?"&":"?")+s.data;delete s.data;} ifModifiedKey=s.url;if(s.cache===false){var ts=OMjQuery.now(),ret=s.url.replace(rts,"$1_="+ts);s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"");}} if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);} if(s.ifModified){ifModifiedKey=ifModifiedKey||s.url;if(OMjQuery.lastModified[ifModifiedKey]){jqXHR.setRequestHeader("If-Modified-Since",OMjQuery.lastModified[ifModifiedKey]);} if(OMjQuery.etag[ifModifiedKey]){jqXHR.setRequestHeader("If-None-Match",OMjQuery.etag[ifModifiedKey]);}} jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);} if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){jqXHR.abort();return false;} for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i]);} transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);} if(s.async&&s.timeout>0){timeoutTimer=setTimeout(function(){jqXHR.abort("timeout");},s.timeout);} try{state=1;transport.send(requestHeaders,done);}catch(e){if(state<2){done(-1,e);}else{throw e;}}} return jqXHR;},param:function(a,traditional){var s=[],add=function(key,value){value=OMjQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);};if(traditional===undefined){traditional=OMjQuery.ajaxSettings.traditional;} if(OMjQuery.isArray(a)||(a.jquery&&!OMjQuery.isPlainObject(a))){OMjQuery.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(OMjQuery.isArray(obj)){OMjQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"?i:"")+"]",v,traditional,add);}});}else if(!traditional&&OMjQuery.type(obj)==="object"){for(var name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}} OMjQuery.extend({active:0,lastModified:{},etag:{}});function ajaxHandleResponses(s,jqXHR,responses){var contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields,ct,type,finalDataType,firstDataType;for(type in responseFields){if(type in responses){jqXHR[responseFields[type]]=responses[type];}} while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("content-type");}} if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;} if(!firstDataType){firstDataType=type;}} finalDataType=finalDataType||firstDataType;} if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);} return responses[finalDataType];}} function ajaxConvert(s,response){if(s.dataFilter){response=s.dataFilter(response,s.dataType);} var dataTypes=s.dataTypes,converters={},i,key,length=dataTypes.length,tmp,current=dataTypes[0],prev,conversion,conv,conv1,conv2;for(i=1;i=options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();options.animatedProperties[this.prop]=true;for(p in options.animatedProperties){if(options.animatedProperties[p]!==true){done=false;}} if(done){if(options.overflow!=null&&!OMjQuery.support.shrinkWrapBlocks){OMjQuery.each(["","X","Y"],function(index,value){elem.style["overflow"+value]=options.overflow[index];});} if(options.hide){OMjQuery(elem).hide();} if(options.hide||options.show){for(p in options.animatedProperties){OMjQuery.style(elem,p,options.orig[p]);OMjQuery.removeData(elem,"fxshow"+p,true);OMjQuery.removeData(elem,"toggle"+p,true);}} complete=options.complete;if(complete){options.complete=false;complete.call(elem);}} return false;}else{if(options.duration==Infinity){this.now=t;}else{n=t-this.startTime;this.state=n/options.duration;this.pos=OMjQuery.easing[options.animatedProperties[this.prop]](this.state,n,0,1,options.duration);this.now=this.start+((this.end-this.start)*this.pos);} this.update();} return true;}};OMjQuery.extend(OMjQuery.fx,{tick:function(){var timer,timers=OMjQuery.timers,i=0;for(;i").appendTo(body),display=elem.css("display");elem.remove();if(display==="none"||display===""){if(!iframe){iframe=document.createElement("iframe");iframe.frameBorder=iframe.width=iframe.height=0;} body.appendChild(iframe);if(!iframeDoc||!iframe.createElement){iframeDoc=(iframe.contentWindow||iframe.contentDocument).document;iframeDoc.write((OMjQuery.support.boxModel?"":"")+"");iframeDoc.close();} elem=iframeDoc.createElement(nodeName);iframeDoc.body.appendChild(elem);display=OMjQuery.css(elem,"display");body.removeChild(iframe);} elemdisplay[nodeName]=display;} return elemdisplay[nodeName];} var getOffset,rtable=/^t(?:able|d|h)$/i,rroot=/^(?:body|html)$/i;if("getBoundingClientRect"in document.documentElement){getOffset=function(elem,doc,docElem,box){try{box=elem.getBoundingClientRect();}catch(e){} if(!box||!OMjQuery.contains(docElem,elem)){return box?{top:box.top,left:box.left}:{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||OMjQuery.support.boxModel&&docElem.scrollTop||body.scrollTop,scrollLeft=win.pageXOffset||OMjQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft,top=box.top+scrollTop-clientTop,left=box.left+scrollLeft-clientLeft;return{top:top,left:left};};}else{getOffset=function(elem,doc,docElem){var computedStyle,offsetParent=elem.offsetParent,prevOffsetParent=elem,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(OMjQuery.support.fixedPosition&&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(OMjQuery.support.doesNotAddBorder&&!(OMjQuery.support.doesAddBorderForTableAndCells&&rtable.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0;} prevOffsetParent=offsetParent;offsetParent=elem.offsetParent;} if(OMjQuery.support.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(OMjQuery.support.fixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft);} return{top:top,left:left};};} OMjQuery.fn.offset=function(options){if(arguments.length){return options===undefined?this:this.each(function(i){OMjQuery.offset.setOffset(this,options,i);});} var elem=this[0],doc=elem&&elem.ownerDocument;if(!doc){return null;} if(elem===doc.body){return OMjQuery.offset.bodyOffset(elem);} return getOffset(elem,doc,doc.documentElement);};OMjQuery.offset={bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;if(OMjQuery.support.doesNotIncludeMarginInBodyOffset){top+=parseFloat(OMjQuery.css(body,"marginTop"))||0;left+=parseFloat(OMjQuery.css(body,"marginLeft"))||0;} return{top:top,left:left};},setOffset:function(elem,options,i){var position=OMjQuery.css(elem,"position");if(position==="static"){elem.style.position="relative";} var curElem=OMjQuery(elem),curOffset=curElem.offset(),curCSSTop=OMjQuery.css(elem,"top"),curCSSLeft=OMjQuery.css(elem,"left"),calculatePosition=(position==="absolute"||position==="fixed")&&OMjQuery.inArray("auto",[curCSSTop,curCSSLeft])>-1,props={},curPosition={},curTop,curLeft;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;} if(OMjQuery.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);}}};OMjQuery.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(OMjQuery.css(elem,"marginTop"))||0;offset.left-=parseFloat(OMjQuery.css(elem,"marginLeft"))||0;parentOffset.top+=parseFloat(OMjQuery.css(offsetParent[0],"borderTopWidth"))||0;parentOffset.left+=parseFloat(OMjQuery.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)&&OMjQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent;} return offsetParent;});}});OMjQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);OMjQuery.fn[method]=function(val){return OMjQuery.access(this,function(elem,method,val){var win=getWindow(elem);if(val===undefined){return win?(prop in win)?win[prop]:OMjQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method];} if(win){win.scrollTo(!top?val:OMjQuery(win).scrollLeft(),top?val:OMjQuery(win).scrollTop());}else{elem[method]=val;}},method,val,arguments.length,null);};});function getWindow(elem){return OMjQuery.isWindow(elem)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;} OMjQuery.each({Height:"height",Width:"width"},function(name,type){var clientProp="client"+name,scrollProp="scroll"+name,offsetProp="offset"+name;OMjQuery.fn["inner"+name]=function(){var elem=this[0];return elem?elem.style?parseFloat(OMjQuery.css(elem,type,"padding")):this[type]():null;};OMjQuery.fn["outer"+name]=function(margin){var elem=this[0];return elem?elem.style?parseFloat(OMjQuery.css(elem,type,margin?"margin":"border")):this[type]():null;};OMjQuery.fn[type]=function(value){return OMjQuery.access(this,function(elem,type,value){var doc,docElemProp,orig,ret;if(OMjQuery.isWindow(elem)){doc=elem.document;docElemProp=doc.documentElement[clientProp];return OMjQuery.support.boxModel&&docElemProp||doc.body&&doc.body[clientProp]||docElemProp;} if(elem.nodeType===9){doc=elem.documentElement;if(doc[clientProp]>=doc[scrollProp]){return doc[clientProp];} return Math.max(elem.body[scrollProp],doc[scrollProp],elem.body[offsetProp],doc[offsetProp]);} if(value===undefined){orig=OMjQuery.css(elem,type);ret=parseFloat(orig);return OMjQuery.isNumeric(ret)?ret:orig;} OMjQuery(elem).css(type,value);},type,value,arguments.length,null);};});window.OMjQuery=window.$o=OMjQuery;if(typeof define==="function"&&define.amd&&define.amd.OMjQuery){define("jquery",[],function(){return OMjQuery;});}})(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 exports!=='undefined'){if(typeof module!=='undefined'&&module.exports){exports=module.exports=_;} exports._=_;}else{root['_']=_;} _.VERSION='1.3.3';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;i2;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){var initial=arguments.length>2;if(obj==null)obj=[];if(nativeReduceRight&&obj.reduceRight===nativeReduceRight){if(context)iterator=_.bind(iterator,context);return initial?obj.reduceRight(iterator,memo):obj.reduceRight(iterator);} var reversed=_.toArray(obj).reverse();if(context&&!initial)iterator=_.bind(iterator,context);return initial?_.reduce(reversed,iterator,memo,context):_.reduce(reversed,iterator);};_.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||(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;found=any(obj,function(value){return value===target;});return found;};_.invoke=function(obj,method){var args=slice.call(arguments,2);return _.map(obj,function(value){return(_.isFunction(method)?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)&&obj[0]===+obj[0])return Math.max.apply(Math,obj);if(!iterator&&_.isEmpty(obj))return-Infinity;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)&&obj[0]===+obj[0])return Math.min.apply(Math,obj);if(!iterator&&_.isEmpty(obj))return Infinity;var result={computed:Infinity};each(obj,function(value,index,list){var computed=iterator?iterator.call(context,value,index,list):value;computedb?1:0;}),'value');};_.groupBy=function(obj,val){var result={};var iterator=_.isFunction(val)?val:function(obj){return obj[val];};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>1;iterator(array[mid])=0;});});};_.difference=function(array){var rest=_.flatten(slice.call(arguments,1),true);return _.filter(array,function(value){return!_.include(rest,value);});};_.zip=function(){var args=slice.call(arguments);var length=_.max(_.pluck(args,'length'));var results=new Array(length);for(var i=0;i=0;i--){args=[funcs[i].apply(this,args)];} return args[0];};};_.after=function(times,func){if(times<=0)return 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(_.has(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){obj[prop]=source[prop];}});return obj;};_.pick=function(obj){var result={};each(_.flatten(slice.call(arguments,1)),function(key){if(key in obj)result[key]=obj[key];});return result;};_.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){if(!_.isObject(obj))return obj;return _.isArray(obj)?obj.slice():_.extend({},obj);};_.tap=function(obj,interceptor){interceptor(obj);return obj;};function eq(a,b,stack){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;if(a._chain)a=a._wrapped;if(b._chain)b=b._wrapped;if(a.isEqual&&_.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&_.isFunction(b.isEqual))return b.isEqual(a);var className=toString.call(a);if(className!=toString.call(b))return false;switch(className){case'[object String]':return a==String(b);case'[object Number]':return a!=+a?b!=+b:(a==0?1/a==1/b:a==+b);case'[object Date]':case'[object Boolean]':return+a==+b;case'[object RegExp]':return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase;} if(typeof a!='object'||typeof b!='object')return false;var length=stack.length;while(length--){if(stack[length]==a)return true;} stack.push(a);var size=0,result=true;if(className=='[object Array]'){size=a.length;result=size==b.length;if(result){while(size--){if(!(result=size in a==size in b&&eq(a[size],b[size],stack)))break;}}}else{if('constructor'in a!='constructor'in b||a.constructor!=b.constructor)return false;for(var key in a){if(_.has(a,key)){size++;if(!(result=_.has(b,key)&&eq(a[key],b[key],stack)))break;}} if(result){for(key in b){if(_.has(b,key)&&!(size--))break;} result=!size;}} stack.pop();return result;} _.isEqual=function(a,b){return eq(a,b,[]);};_.isEmpty=function(obj){if(obj==null)return true;if(_.isArray(obj)||_.isString(obj))return obj.length===0;for(var key in obj)if(_.has(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 toString.call(obj)=='[object Arguments]';};if(!_.isArguments(arguments)){_.isArguments=function(obj){return!!(obj&&_.has(obj,'callee'));};} _.isFunction=function(obj){return toString.call(obj)=='[object Function]';};_.isString=function(obj){return toString.call(obj)=='[object String]';};_.isNumber=function(obj){return toString.call(obj)=='[object Number]';};_.isFinite=function(obj){return _.isNumber(obj)&&isFinite(obj);};_.isNaN=function(obj){return obj!==obj;};_.isBoolean=function(obj){return obj===true||obj===false||toString.call(obj)=='[object Boolean]';};_.isDate=function(obj){return toString.call(obj)=='[object Date]';};_.isRegExp=function(obj){return toString.call(obj)=='[object RegExp]';};_.isNull=function(obj){return obj===null;};_.isUndefined=function(obj){return obj===void 0;};_.has=function(obj,key){return hasOwnProperty.call(obj,key);};_.noConflict=function(){root._=previousUnderscore;return this;};_.identity=function(value){return value;};_.times=function(n,iterator,context){for(var i=0;i/g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/\//g,'/');};_.result=function(object,property){if(object==null)return null;var value=object[property];return _.isFunction(value)?value.call(object):value;};_.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,escape:/<%-([\s\S]+?)%>/g};var noMatch=/.^/;var escapes={'\\':'\\',"'":"'",'r':'\r','n':'\n','t':'\t','u2028':'\u2028','u2029':'\u2029'};for(var p in escapes)escapes[escapes[p]]=p;var escaper=/\\|'|\r|\n|\t|\u2028|\u2029/g;var unescaper=/\\(\\|'|r|n|t|u2028|u2029)/g;var unescape=function(code){return code.replace(unescaper,function(match,escape){return escapes[escape];});};_.template=function(text,data,settings){settings=_.defaults(settings||{},_.templateSettings);var source="__p+='"+text.replace(escaper,function(match){return'\\'+escapes[match];}).replace(settings.escape||noMatch,function(match,code){return"'+\n_.escape("+unescape(code)+")+\n'";}).replace(settings.interpolate||noMatch,function(match,code){return"'+\n("+unescape(code)+")+\n'";}).replace(settings.evaluate||noMatch,function(match,code){return"';\n"+unescape(code)+"\n;__p+='";})+"';\n";if(!settings.variable)source='with(obj||{}){\n'+source+'}\n';source="var __p='';"+"var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+ source+"return __p;\n";var render=new Function(settings.variable||'obj','_',source);if(data)return render(data,_);var template=function(data){return render.call(this,data,_);};template.source='function('+(settings.variable||'obj')+'){\n'+ source+'}';return template;};_.chain=function(obj){return _(obj).chain();};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(){var wrapped=this._wrapped;method.apply(wrapped,arguments);var length=wrapped.length;if((name=='shift'||name=='splice')&&length===0)delete wrapped[0];return result(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;};}).call(this);(function(){var root=this;var previousBackbone=root.Backbone;var Backbone;if(typeof exports!=='undefined'){Backbone=exports;}else{Backbone=root.Backbone={};} Backbone.VERSION='0.5.2';var _=root._;if(!_&&(typeof require!=='undefined'))_=require('underscore')._;var $=root.jQuery||root.Zepto;Backbone.noConflict=function(){root.Backbone=previousBackbone;return this;};Backbone.emulateHTTP=false;Backbone.emulateJSON=false;Backbone.Events={bind:function(ev,callback,context){var calls=this._callbacks||(this._callbacks={});var list=calls[ev]||(calls[ev]=[]);list.push([callback,context]);return this;},unbind:function(ev,callback){var calls;if(!ev){this._callbacks={};}else if(calls=this._callbacks){if(!callback){calls[ev]=[];}else{var list=calls[ev];if(!list)return this;for(var i=0,l=list.length;i').hide().appendTo('body')[0].contentWindow;this.navigate(fragment);} if(this._hasPushState){$o(window).bind('popstate',this.checkUrl);}else if('onhashchange'in window&&!oldIE){$o(window).bind('hashchange',this.checkUrl);}else{setInterval(this.checkUrl,this.interval);} this.fragment=fragment;historyStarted=true;var loc=window.location;var atRoot=loc.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!atRoot){this.fragment=this.getFragment(null,true);window.location.replace(this.options.root+'#'+this.fragment);return true;}else if(this._wantsPushState&&this._hasPushState&&atRoot&&loc.hash){this.fragment=loc.hash.replace(hashStrip,'');window.history.replaceState({},document.title,loc.protocol+'//'+loc.host+this.options.root+this.fragment);} return this.loadUrl();},route:function(route,callback){this.handlers.unshift({route:route,callback:callback});},checkUrl:function(e){var current=this.getFragment();if(current==this.fragment&&this.iframe)current=this.getFragment(this.iframe.location.hash);if(current==this.fragment||current==decodeURIComponent(this.fragment))return false;if(this.iframe)this.navigate(current);this.loadUrl()||this.loadUrl(window.location.hash);},loadUrl:function(fragmentOverride){var fragment=this.fragment=this.getFragment(fragmentOverride);var matched=_.any(this.handlers,function(handler){if(handler.route.test(fragment)){handler.callback(fragment);return true;}});return matched;},navigate:function(fragment,triggerRoute){var frag=(fragment||'').replace(hashStrip,'');if(this.fragment==frag||this.fragment==decodeURIComponent(frag))return;if(this._hasPushState){var loc=window.location;if(frag.indexOf(this.options.root)!=0)frag=this.options.root+frag;this.fragment=frag;window.history.pushState({},document.title,loc.protocol+'//'+loc.host+frag);}else{window.location.hash=this.fragment=frag;if(this.iframe&&(frag!=this.getFragment(this.iframe.location.hash))){this.iframe.document.open().close();this.iframe.location.hash=frag;}} if(triggerRoute)this.loadUrl(fragment);}});Backbone.View=function(options){this.cid=_.uniqueId('view');this._configure(options||{});this._ensureElement();this.delegateEvents();this.initialize.apply(this,arguments);};var selectorDelegate=function(selector){return $o(selector,this.el);};var eventSplitter=/^(\S+)\s*(.*)$/;var viewOptions=['model','collection','el','id','attributes','className','tagName'];_.extend(Backbone.View.prototype,Backbone.Events,{tagName:'div',$:selectorDelegate,initialize:function(){},render:function(){return this;},remove:function(){$o(this.el).remove();return this;},make:function(tagName,attributes,content){var el=document.createElement(tagName);if(attributes)$o(el).attr(attributes);if(content)$o(el).html(content);return el;},delegateEvents:function(events){if(!(events||(events=this.events)))return;$o(this.el).unbind('.delegateEvents'+this.cid);for(var key in events){var method=this[events[key]];if(!method)throw new Error('Event "'+events[key]+'" does not exist');var match=key.match(eventSplitter);var eventName=match[1],selector=match[2];method=_.bind(method,this);eventName+='.delegateEvents'+this.cid;if(selector===''){$o(this.el).bind(eventName,method);}else{$o(this.el).delegate(selector,eventName,method);}}},_configure:function(options){if(this.options)options=_.extend({},this.options,options);for(var i=0,l=viewOptions.length;i/g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/\//g,'/');};}).call(this);(function(){var test=document.createElement('input');try{test.type='range';if(test.type=='range') return;}catch(e){return;} if(!document.mozSetImageElement||!('MozAppearance'in test.style)) return;var scale;var isMac=navigator.platform=='MacIntel';var thumb={radius:isMac?9:6,width:isMac?22:12,height:isMac?16:20};var track='-moz-linear-gradient(top, transparent '+(isMac?'6px, #999 6px, #999 7px, #ccc 9px, #bbb 11px, #bbb 12px, transparent 12px':'9px, #999 9px, #bbb 10px, #fff 11px, transparent 11px')+', transparent)';var styles={'min-width':thumb.width+'px','min-height':thumb.height+'px','max-height':thumb.height+'px',padding:0,border:0,'border-radius':0,cursor:'default','text-indent':'-999999px'};var onChange=document.createEvent('HTMLEvents');onChange.initEvent('change',true,false);if(document.readyState=='loading') document.addEventListener('DOMContentLoaded',initialize,true);else initialize();function initialize(){Array.forEach(document.querySelectorAll('input[type=range]'),transform);document.addEventListener('DOMNodeInserted',onNodeInserted,true);} function onNodeInserted(e){check(e.target);if(e.target.querySelectorAll) Array.forEach(e.target.querySelectorAll('input'),check);} function check(input,async){if(input.localName!='input'||input.type=='range');else if(input.getAttribute('type')=='range') transform(input);else if(!async) setTimeout(check,0,input,true);} function transform(slider){var isValueSet,areAttrsSet,isChanged,isClick,prevValue,rawValue,prevX;var min,max,step,range,value=slider.value;if(!scale){scale=document.body.appendChild(document.createElement('hr'));style(scale,{'-moz-appearance':isMac?'scale-horizontal':'scalethumb-horizontal',display:'block',visibility:'visible',opacity:1,position:'fixed',top:'-999999px'});document.mozSetImageElement('__sliderthumb__',scale);} var getValue=function(){return''+value;};var setValue=function setValue(val){value=''+val;isValueSet=true;draw();delete slider.value;slider.value=value;slider.__defineGetter__('value',getValue);slider.__defineSetter__('value',setValue);};slider.__defineGetter__('value',getValue);slider.__defineSetter__('value',setValue);slider.__defineGetter__('type',function(){return'range';});['min','max','step'].forEach(function(prop){if(slider.hasAttribute(prop)) areAttrsSet=true;slider.__defineGetter__(prop,function(){return this.hasAttribute(prop)?this.getAttribute(prop):'';});slider.__defineSetter__(prop,function(val){val===null?this.removeAttribute(prop):this.setAttribute(prop,val);});});slider.readOnly=true;style(slider,styles);update();slider.addEventListener('DOMAttrModified',function(e){if(e.attrName=='value'&&!isValueSet){value=e.newValue;draw();} else if(~['min','max','step'].indexOf(e.attrName)){update();areAttrsSet=true;}},true);slider.addEventListener('mousedown',onDragStart,true);slider.addEventListener('keydown',onKeyDown,true);slider.addEventListener('focus',onFocus,true);slider.addEventListener('blur',onBlur,true);function onDragStart(e){isClick=true;setTimeout(function(){isClick=false;},0);if(e.button||!range) return;var width=parseFloat(getComputedStyle(this,0).width);var multiplier=(width-thumb.width)/range;if(!multiplier) return;var dev=e.clientX-this.getBoundingClientRect().left-thumb.width/2- (value-min)*multiplier;if(Math.abs(dev)>thumb.radius){isChanged=true;this.value-=-dev/multiplier;} rawValue=value;prevX=e.clientX;this.addEventListener('mousemove',onDrag,true);this.addEventListener('mouseup',onDragEnd,true);} function onDrag(e){var width=parseFloat(getComputedStyle(this,0).width);var multiplier=(width-thumb.width)/range;if(!multiplier) return;rawValue+=(e.clientX-prevX)/multiplier;prevX=e.clientX;isChanged=true;this.value=rawValue;} function onDragEnd(){this.removeEventListener('mousemove',onDrag,true);this.removeEventListener('mouseup',onDragEnd,true);} function onKeyDown(e){if(e.keyCode>36&&e.keyCode<41){onFocus.call(this);isChanged=true;this.value=value+(e.keyCode==38||e.keyCode==39?step:-step);}} function onFocus(){if(!isClick) this.style.boxShadow=!isMac?'0 0 0 2px #fb0':'0 0 2px 1px -moz-mac-focusring, inset 0 0 1px -moz-mac-focusring';} function onBlur(){this.style.boxShadow='';} function isAttrNum(value){return!isNaN(value)&&+value==parseFloat(value);} function update(){min=isAttrNum(slider.min)?+slider.min:0;max=isAttrNum(slider.max)?+slider.max:100;if(max100?min:100;step=isAttrNum(slider.step)&&slider.step>0?+slider.step:1;range=max-min;draw(true);} function calc(){if(!isValueSet&&!areAttrsSet) value=slider.getAttribute('value');if(!isAttrNum(value)) value=(min+max)/2;;value=Math.round((value-min)/step)*step+min;if(valuemax) value=min+~~(range/step)*step;} function draw(attrsModified){calc();if(isChanged&&value!=prevValue) slider.dispatchEvent(onChange);isChanged=false;if(!attrsModified&&value==prevValue) return;prevValue=value;var position=range?(value-min)/range*100:0;var bg='-moz-element(#__sliderthumb__) '+position+'% no-repeat, ';style(slider,{background:bg+track});}} function style(element,styles){for(var prop in styles) element.style.setProperty(prop,styles[prop],'important');}})();(function(){$o('head').append('');window.OverlayMe={};window.OverlayMe.Mixin={};OverlayMe.isLoaded=function(){return window.overlay_me_loaded;};OverlayMe.setLoaded=function(){return window.overlay_me_loaded=true;};OverlayMe.isMobile=function(){return OverlayMe.userAgent().match(/(iPhone|iPod|iPad|Android)/);};OverlayMe.mustLoad=function(){return!OverlayMe.isLoaded()&&!OverlayMe.isMobile();};OverlayMe.clearAndReload=function(){localStorage.clear();return OverlayMe.pageReload();};OverlayMe.pageReload=function(){return window.location.reload();};OverlayMe.userAgent=function(){return navigator.userAgent;};}).call(this);(function(){OverlayMe.Mixin.Storable={loadCss:function(element,default_css){var cssData;if(element==null){element=this.el;} if(!this.id){return;} if((cssData=localStorage.getItem(this.id))){return $o(element).css(JSON.parse(cssData));}else{if(default_css!==void 0){return $o(element).css(default_css);}}},saveCss:function(element){var cssData,css_attribute,_i,_len,_ref;if(element==null){element=this.el;} if(!this.id){return;} if(!this.css_attributes_to_save){this.css_attributes_to_save=['top','left','display','opacity'];} cssData={};_ref=this.css_attributes_to_save;for(_i=0,_len=_ref.length;_i<_len;_i++){css_attribute=_ref[_i];cssData[css_attribute]=$o(element).css(css_attribute);} return localStorage.setItem(this.id,JSON.stringify(cssData));}};}).call(this);(function(){OverlayMe.Mixin.Hideable={isDisplayed:function(){var element;element=this.el||this;return $o(element).css('display')!=='none';},toggleDisplay:function(default_display_type){if(default_display_type==null){default_display_type='block';} if(this.isDisplayed()){return this.hide();}else{return this.show(default_display_type);}},show:function(default_display_type){var element;if(default_display_type==null){default_display_type='block';} element=this.el||this;$o(element).css({display:default_display_type});return this.saveState();},hide:function(){var element;element=this.el||this;$o(element).css({display:'none'});return this.saveState();},saveState:function(){var element;element=this.el||this;if(this.saveCss){return this.saveCss(element);}}};}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Draggable=(function(_super){__extends(Draggable,_super);Draggable.name='Draggable';function Draggable(){return Draggable.__super__.constructor.apply(this,arguments);} Draggable.prototype.tagName='div';Draggable.prototype.css_attributes_to_save=['top','left','display','opacity'];Draggable.prototype.initialize=function(attributes,options){Draggable.__super__.initialize.call(this,attributes,options);return this.loadCss(this.el,options.default_css);};Draggable.prototype.engageMove=function(event){var _this=this;event.preventDefault();this.moving=true;this.lastX=event.clientX;this.lastY=event.clientY;$o(window).bind('mymousemove',function(event,mouseEvent){_this.updateOverlay(mouseEvent.clientX-_this.lastX,mouseEvent.clientY-_this.lastY);_this.lastX=mouseEvent.clientX;return _this.lastY=mouseEvent.clientY;});return $o(this.el).addClass('on-move');};Draggable.prototype.endMove=function(event){this.moving=false;$o(window).unbind('mymousemove');return $o(this.el).removeClass('on-move');};Draggable.prototype.toggleMove=function(event){if(this.moving){return this.endMove(event);}else{return this.engageMove(event);}};Draggable.prototype.updateOverlay=function(x,y){var newX,newY;newX=parseInt($o(this.el).css('left'))+x;newY=parseInt($o(this.el).css('top'))+y;$o(this.el).css({top:""+newY+"px",left:""+newX+"px"});return this.saveCss();};Draggable.prototype.render=function(){return this.el;};return Draggable;})(Backbone.View);_.extend(OverlayMe.Draggable.prototype,OverlayMe.Mixin.Storable);_.extend(OverlayMe.Draggable.prototype,OverlayMe.Mixin.Hideable);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.MenuClass=(function(_super){__extends(MenuClass,_super);MenuClass.name='MenuClass';function MenuClass(){return MenuClass.__super__.constructor.apply(this,arguments);} MenuClass.prototype.id='overlay_me_menu';MenuClass.prototype.initialize=function(attributes){var drag_me_line,_this=this;MenuClass.__super__.initialize.call(this,attributes,{default_css:{top:'50px'}});drag_me_line=(new Backbone.View).make('div',{"class":'drag-me'},'Drag me up and down');this.menu_list=(new Backbone.View).make('ul');$o(this.el).append(drag_me_line);$o(this.el).append(this.menu_list);$o('body').append(this.render());$o(drag_me_line).bind('mousedown',function(event){return _this.toggleMove(event);});$o(window).bind('mouseup',function(event){return _this.endMove(event);});return $o(window).bind('overlay_me:toggle_all_display',function(){return _this.toggleDisplay();});};MenuClass.prototype.append=function(element){return this.menu_list.appendChild(element);};MenuClass.prototype.toggleCollapse=function(){if(this.collapsed()){return $o(this.el).removeClass('collapsed');}else{return $o(this.el).addClass('collapsed');}};MenuClass.prototype.collapsed=function(){return $o(this.el).hasClass('collapsed');};return MenuClass;})(OverlayMe.Draggable);if(OverlayMe.mustLoad()){$o(function(){if(!OverlayMe.menu){return OverlayMe.menu=new OverlayMe.MenuClass();}});}}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.MenuItem=(function(_super){__extends(MenuItem,_super);MenuItem.name='MenuItem';function MenuItem(){return MenuItem.__super__.constructor.apply(this,arguments);} MenuItem.prototype.tagName='li';MenuItem.prototype.className='menu-item';MenuItem.prototype.initialize=function(attributes,options){var _this=this;this.id=attributes.id;$o(this.el).addClass(attributes.id);this.el.appendChild(this.collapseButton());this.title=this.make('label',{"class":'title'},attributes.title);$o(this.title).bind('click',function(){return _this.toggleCollapse();});this.el.appendChild(this.title);this.content=this.make('div',{"class":'item-content'});this.el.appendChild(this.content);return this.setCollapse((localStorage.getItem(""+this.id+"-collapsed")==='1'?true:false));};MenuItem.prototype.collapseButton=function(){var _this=this;this.collapseButton=this.make('a',{"class":'collaps-button'},'o');$o(this.collapseButton).bind('click',function(){return _this.toggleCollapse();});return this.collapseButton;};MenuItem.prototype.toggleCollapse=function(){this.setCollapse(!this.collapsed);return this.saveState();};MenuItem.prototype.setCollapse=function(toCollapse){this.collapsed=toCollapse;if(toCollapse){return $o(this.el).addClass('collapsed');}else{return $o(this.el).removeClass('collapsed');}};MenuItem.prototype.append=function(childElemt){return this.content.appendChild(childElemt);};MenuItem.prototype.render=function(){return this.el;};MenuItem.prototype.saveState=function(){return localStorage.setItem(""+this.id+"-collapsed",(this.collapsed?1:0));};return MenuItem;})(Backbone.View);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.BasicsPanel=(function(_super){__extends(BasicsPanel,_super);BasicsPanel.name='BasicsPanel';function BasicsPanel(){return BasicsPanel.__super__.constructor.apply(this,arguments);} BasicsPanel.prototype.initialize=function(attributes,options){var clear_all_button,collapse_button,hide_button,toggle_all_display,_this=this;BasicsPanel.__super__.initialize.call(this,{id:"basics-options-panel",title:"Basics"},options);collapse_button=(new Backbone.View).make('button',{"class":'collapse'},'Collapse (c)');$o(collapse_button).bind('click',function(event){return OverlayMe.menu.toggleCollapse();});this.append(collapse_button);clear_all_button=(new Backbone.View).make('button',{"class":'reset',onClick:"javascript: OverlayMe.clearAndReload()"},'Reset All (r)');this.append(clear_all_button);toggle_all_display=function(){$o(window).trigger('overlay_me:toggle_all_display');return $o(window).trigger('overlay_me:toggle_overlay_me_images_container_display');};hide_button=(new Backbone.View).make('button',{"class":'hide'},'Hide (h)');$o(hide_button).bind('click',function(event){return toggle_all_display();});this.append(hide_button);OverlayMe.menu.append(this.render());return $o(window).bind('keypress',function(event){if(event.charCode===104){toggle_all_display();} if(event.charCode===99){OverlayMe.menu.toggleCollapse();} if(event.charCode===114){return OverlayMe.clearAndReload();}});};return BasicsPanel;})(OverlayMe.MenuItem);$o(function(){if(!OverlayMe.basics_panel){return OverlayMe.basics_panel=new OverlayMe.BasicsPanel();}});}).call(this);(function(){OverlayMe.Overlays={};OverlayMe.Overlays.urlToId=function(url){return url.replace(/[.:\/]/g,'_').replace(/[^a-zA-Z0-9_\-]/g,'');};OverlayMe.unicorns=["http://fc07.deviantart.net/fs49/f/2009/200/b/3/Fat_Unicorn_and_the_Rainbow_by_la_ratta.jpg","http://www.deviantart.com/download/126388773/Unicorn_Pukes_Rainbow_by_Angel35W.jpg","http://macmcrae.com/wp-content/uploads/2010/02/unicorn.jpg","http://4.bp.blogspot.com/-uPLiez-m9vY/TacC_Bmsn3I/AAAAAAAAAyg/jusQIA8aAME/s1600/Behold_A_Rainbow_Unicorn_Ninja_by_Jess4921.jpg","http://www.everquestdragon.com/everquestdragon/main/image.axd?picture=2009%2F9%2FPaperPaperNewrainbow.png"];}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Overlays.ContainerItself=(function(_super){__extends(ContainerItself,_super);ContainerItself.name='ContainerItself';function ContainerItself(){return ContainerItself.__super__.constructor.apply(this,arguments);} ContainerItself.prototype.tagName='div';ContainerItself.prototype.css_attributes_to_save=['display'];ContainerItself.prototype.initialize=function(attributes,options){var _this=this;ContainerItself.__super__.initialize.call(this,attributes,options);this.loadCss();return $o(window).bind("overlay_me:toggle_"+this.id+"_display",function(event,options){if(options){if(options.show){return _this.show();}else{return _this.hide();}}else{return _this.toggleDisplay();}});};return ContainerItself;})(Backbone.View);_.extend(OverlayMe.Overlays.ContainerItself.prototype,OverlayMe.Mixin.Storable);_.extend(OverlayMe.Overlays.ContainerItself.prototype,OverlayMe.Mixin.Hideable);OverlayMe.Overlays.ImagesContainer=(function(_super){__extends(ImagesContainer,_super);ImagesContainer.name='ImagesContainer';function ImagesContainer(){return ImagesContainer.__super__.constructor.apply(this,arguments);} ImagesContainer.prototype.initialize=function(options){var container;if(!OverlayMe.images_container){OverlayMe.images_container=new OverlayMe.Overlays.ContainerItself({id:'overlay_me_images_container'});$o('body').append(OverlayMe.images_container.el);} if(options.parent_path){container=this.subDirContainer(options.parent_path);}else{container=OverlayMe.images_container;} return this.el=container.el||container;};ImagesContainer.prototype.subDirContainer=function(path,done_bits){var path_bits,sub_container,sub_container_parent_post_string,the_dir;if(done_bits==null){done_bits=[];} path_bits=_.difference(path.split('/'),_.union(done_bits,''));the_dir=path_bits.slice(0,1).toString();if(done_bits.length>0){sub_container_parent_post_string=done_bits.join(' ').replace(/\ ?(\w+)/g,' #$1_container');}else{sub_container_parent_post_string='';} sub_container=$o("#overlay_me_images_container "+sub_container_parent_post_string+" #"+(the_dir+'_container'));if(sub_container.length<1){sub_container=new OverlayMe.Overlays.ContainerItself({id:the_dir+'_container'});$o("#overlay_me_images_container "+sub_container_parent_post_string).append(sub_container.el);} if(path_bits.length>1){done_bits.push(the_dir);return this.subDirContainer(path,done_bits);}else{return sub_container;}};return ImagesContainer;})(Backbone.View);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Overlays.DraggableImage=(function(_super){__extends(DraggableImage,_super);DraggableImage.name='DraggableImage';function DraggableImage(){return DraggableImage.__super__.constructor.apply(this,arguments);} DraggableImage.prototype.initialize=function(attributes,options){var _this=this;DraggableImage.__super__.initialize.call(this,attributes,options);this.image=new Image();$o(this.image).load(function(){return _this.fitDivToImage();});$o(this.image).attr('src',options.image_src);$o(this.el).append(this.image);if($o(this.el).css('left')==='auto'||$o(this.el).css('left')===''){$o(this.el).css('left','0px');} if($o(this.el).css('top')==='auto'||$o(this.el).css('top')===''){$o(this.el).css('top','0px');} $o(this.el).bind('mousedown',function(event){return _this.toggleMove(event);});$o(window).bind('mouseup',function(event){return _this.endMove(event);});$o(this.el).bind('mouseover',function(event){return $o(".overlay-image-block[data-img-id="+_this.id+"]").addClass('hovered');});return $o(this.el).bind('mouseout',function(event){return $o(".overlay-image-block[data-img-id="+_this.id+"]").removeClass('hovered');});};DraggableImage.prototype.fitDivToImage=function(){if(this.image.width>0){$o(this.el).css('width',this.image.width);return $o(this.el).css('height',this.image.height);}};DraggableImage.prototype.render=function(){return this.el;};return DraggableImage;})(OverlayMe.Draggable);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Overlays.Image=(function(_super){__extends(Image,_super);Image.name='Image';function Image(){return Image.__super__.constructor.apply(this,arguments);} Image.prototype.tagName='div';Image.prototype.className='overlay-image-block';Image.prototype.initialize=function(image_src,options){var images_container,slider_block,_this=this;$o.extend({destroyable:false},options);this.image_src=image_src;this.image_id=OverlayMe.Overlays.urlToId(image_src);$o(this.el).attr('data-img-id',this.image_id);images_container=new OverlayMe.Overlays.ImagesContainer({parent_path:options.parent_path});this.default_css=$o.extend({display:'none',opacity:0.5},options.default_css);if(!($o("#"+this.image_id,images_container.el).length>0)){$o(images_container.el).append(this.image());} $o(this.el).append(this.checkbox());$o(this.el).append(this.label());slider_block=this.make('div',{"class":'slider-block'});$o(this.el).append(slider_block);slider_block.appendChild(this.make('label',{},'Opacity'));slider_block.appendChild(this.slider());if(options.destroyable){$o(this.el).append(this.delButton());} $o(this.el).bind('click',function(e){e.stopPropagation();return _this.flickCheckbox();});$o(this.el).bind('mouseover',function(event){$o(_this.image.el).addClass('highlight');return $o(_this.el).addClass('hovered');});return $o(this.el).bind('mouseout',function(event){$o(_this.image.el).removeClass('highlight');return $o(_this.el).removeClass('hovered');});};Image.prototype.image=function(){this.image=new OverlayMe.Overlays.DraggableImage({id:this.image_id},{image_src:this.image_src,default_css:this.default_css});return this.image.render();};Image.prototype.checkbox=function(){var _this=this;this.checkbox=this.make('input',{type:"checkbox"});if(this.image.isDisplayed()){this.checkbox.checked=true;} $o(this.checkbox).bind('click',function(e){e.stopPropagation();return _this.flickVisibility();});$o(this.checkbox).bind('change',function(e){e.stopPropagation();return _this.flickVisibility();});return this.checkbox;};Image.prototype.delButton=function(){var _this=this;this.delButton=this.make('button',{"class":'del-button',title:'Delete'},'x');$o(this.delButton).bind('click',function(e){return OverlayMe.dyn_manager.delImage(_this.image_id);});return this.delButton;};Image.prototype.flickCheckbox=function(){this.checkbox.checked=!this.checkbox.checked;return this.flickVisibility();};Image.prototype.flickVisibility=function(){if(this.checkbox.checked){$o(this.image.el).css('display','block');}else{$o(this.image.el).css('display','none');} return this.image.saveCss();};Image.prototype.label=function(){return this.label=this.make('label',{},this.image_src.replace(/.*\//,'').slice(-22));};Image.prototype.slider=function(){var _this=this;this.slider=this.make('input',{type:"range",value:$o(this.image.el).css('opacity')*100});$o(this.slider).bind('click',function(e){return e.stopPropagation();});$o(this.slider).bind('change',function(e){$o(_this.image.el).css('opacity',$o(_this.slider)[0].value/100);return _this.image.saveCss();});$o(this.slider).bind('mouseover',function(e){e.stopPropagation();return $o(_this.el).addClass('hovered');});$o(this.slider).bind('mouseout',function(e){e.stopPropagation();return $o(_this.el).removeClass('hovered');});return this.slider;};Image.prototype.render=function(){return this.el;};return Image;})(Backbone.View);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Overlays.ImagesDirectory=(function(_super){__extends(ImagesDirectory,_super);ImagesDirectory.name='ImagesDirectory';function ImagesDirectory(){return ImagesDirectory.__super__.constructor.apply(this,arguments);} ImagesDirectory.prototype.tagName='div';ImagesDirectory.prototype.className='images_dir';ImagesDirectory.prototype.initialize=function(dirname){var _this=this;this.dirname=dirname;this.contentBlock=this.make('div',{id:this.dirname,"class":'sub-block'});_.extend(this.contentBlock,OverlayMe.Mixin.Hideable);_.extend(this.contentBlock,OverlayMe.Mixin.Storable);this.contentBlock.css_attributes_to_save=['display'];this.contentBlock.loadCss(this.contentBlock);$o(this.el).append(this.checkbox());$o(this.el).append(this.label());$o(this.el).append(this.contentBlock);return $o(this.el).bind('click',function(e){e.stopPropagation();return _this.checkbox.click();});};ImagesDirectory.prototype.checkbox=function(){var _this=this;this.checkbox=this.make('input',{type:"checkbox"});if(this.contentBlock.isDisplayed()){this.checkbox.checked=true;} $o(this.checkbox).bind('click',function(e){e.stopPropagation();return _this.flickVisibility();});return this.checkbox;};ImagesDirectory.prototype.flickVisibility=function(){if(this.checkbox.checked){this.contentBlock.show();}else{this.contentBlock.hide();} return $o(window).trigger("overlay_me:toggle_"+this.dirname+"_container_display",{show:this.checkbox.checked});};ImagesDirectory.prototype.label=function(){return this.label=this.make('label',{},'/'+this.dirname+'/');};ImagesDirectory.prototype.append=function(block){return this.contentBlock.appendChild(block);};ImagesDirectory.prototype.render=function(){return this.el;};return ImagesDirectory;})(Backbone.View);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Overlays.DynamicManager=(function(_super){__extends(DynamicManager,_super);DynamicManager.name='DynamicManager';function DynamicManager(){return DynamicManager.__super__.constructor.apply(this,arguments);} DynamicManager.prototype.initialize=function(){var listJSON;if((listJSON=localStorage.getItem('dyn_image_list'))){return this.list=JSON.parse(listJSON);}else{return this.list=[];}};DynamicManager.prototype.isPresent=function(image_id){var saved,_i,_len,_ref;_ref=this.list;for(_i=0,_len=_ref.length;_i<_len;_i++){saved=_ref[_i];if(saved.id===image_id){return true;}} return false;};DynamicManager.prototype.isEmpty=function(){return this.list.length===0;};DynamicManager.prototype.addImage=function(src,options){var new_image;if(options==null){options={};} new_image=this.loadImage(src,options);if(new_image&&!this.isPresent(new_image.image_id)){this.list.push({id:new_image.image_id,src:new_image.image_src});this.saveList();} return new_image;};DynamicManager.prototype.loadImage=function(src,options){var image,image_id,_default_css;if(options==null){options={};} image_id=OverlayMe.Overlays.urlToId(src);if(!($o("#overlay_me_images_container #"+image_id).length>0)){_default_css=$o.extend({display:'block'},options.default_css);image=new OverlayMe.Overlays.Image(src,{destroyable:true,default_css:_default_css});OverlayMe.images_management_div.append(image.render());} return image;};DynamicManager.prototype.delImage=function(image_id){var image,_i,_len,_ref;_ref=this.list;for(_i=0,_len=_ref.length;_i<_len;_i++){image=_ref[_i];if(image.id===image_id){this.list.splice(this.list.indexOf(image),1);this.saveList();break;}} return OverlayMe.images_management_div.del(image_id);};DynamicManager.prototype.loadAll=function(){var image,_i,_len,_ref,_results;_ref=this.list;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){image=_ref[_i];_results.push(this.addImage(image.src));} return _results;};DynamicManager.prototype.saveList=function(){return localStorage.setItem('dyn_image_list',JSON.stringify(this.list));};return DynamicManager;})(Backbone.Model);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Overlays.ContentDivManagementBlock=(function(_super){__extends(ContentDivManagementBlock,_super);ContentDivManagementBlock.name='ContentDivManagementBlock';function ContentDivManagementBlock(){return ContentDivManagementBlock.__super__.constructor.apply(this,arguments);} ContentDivManagementBlock.prototype.tagName='fieldset';ContentDivManagementBlock.prototype.className='content-mgnt-block';ContentDivManagementBlock.prototype.id='content_div_management_block';ContentDivManagementBlock.prototype.css_attributes_to_save=['z-index','opacity'];ContentDivManagementBlock.prototype.normal_zindex='0';ContentDivManagementBlock.prototype.over_zindex='5';ContentDivManagementBlock.prototype.initialize=function(){var slider_block,unicorn_button,_this=this;this.page_container_div=this.make('div',{id:'overlay_me_page_container'});$o('body').append(this.page_container_div);$o('body > *').each(function(index,thing){if(!(thing.id.match(/^overlay_me/)||thing.tagName==='SCRIPT')){return $o(_this.page_container_div).append(thing);}});this.loadCss(this.page_container_div,{'z-index':this.normal_zindex});unicorn_button=this.make('div',{"class":'unicorns',title:'Feeling corny?'});$o(unicorn_button).bind('click',function(){return OverlayMe.dyn_manager.addImage(OverlayMe.unicorns[Math.floor(Math.random()*OverlayMe.unicorns.length)],{default_css:{opacity:1}});});$o(this.el).append(unicorn_button);$o(this.el).append(this.make('legend',{},'Page content'));slider_block=this.make('div',{"class":'slider-block'});$o(this.el).append(slider_block);slider_block.appendChild(this.make('label',{},'Opacity'));slider_block.appendChild(this.contentSlider());$o(this.el).append(this.zIndexSwitch());return this.bindEvents();};ContentDivManagementBlock.prototype.zIndexSwitch=function(){var block,label,_this=this;block=this.make('div',{"class":'zindex-switch'});this.zIndexSwitch=this.make('input',{type:"checkbox"});$o(block).append(this.zIndexSwitch);setTimeout(function(){if($o("#overlay_me_page_container").css('z-index')===_this.over_zindex){return _this.zIndexSwitch.checked=true;}},500);label=this.make('label',{},'Content on top (t)');$o(label).bind('click',function(){return $o(_this.zIndexSwitch).trigger('click');});return $o(block).append(label);};ContentDivManagementBlock.prototype.contentSlider=function(){return this.contentSlider=this.make('input',{id:"contentSlider",type:"range",value:$o("#overlay_me_page_container").css('opacity')*100});};ContentDivManagementBlock.prototype.bindEvents=function(){var _this=this;$o(this.contentSlider).bind('change',function(){$o("#overlay_me_page_container").css('opacity',$o(_this.contentSlider)[0].value/100);return _this.saveCss(_this.page_container_div);});$o(this.zIndexSwitch).bind('change',function(event){if(_this.zIndexSwitch.checked){$o("#overlay_me_page_container").css({'z-index':_this.over_zindex});}else{$o("#overlay_me_page_container").css({'z-index':_this.normal_zindex});} return _this.saveCss(_this.page_container_div);});return $o(window).bind('keypress',function(event){if(event.charCode===116){return $o(_this.zIndexSwitch).trigger('click');}});};ContentDivManagementBlock.prototype.render=function(){return this.el;};return ContentDivManagementBlock;})(Backbone.View);_.extend(OverlayMe.Overlays.ContentDivManagementBlock.prototype,OverlayMe.Mixin.Storable);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.Overlays.ImagesManagementDiv=(function(_super){__extends(ImagesManagementDiv,_super);ImagesManagementDiv.name='ImagesManagementDiv';function ImagesManagementDiv(){return ImagesManagementDiv.__super__.constructor.apply(this,arguments);} ImagesManagementDiv.prototype.tagName='fieldset';ImagesManagementDiv.prototype.id='images_mgnt';ImagesManagementDiv.prototype.initialize=function(){$o(this.el).append(this.make('legend',{},'Overlaying images'));this.overlaysListBlock=this.make('div',{"class":'overlays-list'});$o(this.el).append(this.overlaysListBlock);return $o(this.el).append(this.dynamicAddsBlock());};ImagesManagementDiv.prototype.append=function(block){return this.overlaysListBlock.appendChild(block);};ImagesManagementDiv.prototype.del=function(image_id){$o(".overlay-image-block[data-img-id="+image_id+"]",this.el).remove();return $o("#overlay_me_images_container #"+image_id).remove();};ImagesManagementDiv.prototype.dynamicAddsBlock=function(){var dynamicAddsBlock,push_image_button,_this=this;dynamicAddsBlock=this.make('div',{"class":'dynamic-adds'});dynamicAddsBlock.appendChild(this.make('label',{},'Add image'));this.image_url_input=this.make('input',{type:'text',placeholder:"http://"});dynamicAddsBlock.appendChild(this.image_url_input);push_image_button=this.make('button',{},'+');dynamicAddsBlock.appendChild(push_image_button);$o(this.image_url_input).bind('keypress',function(e){if(e.keyCode===13){return _this.pushImage();}});$o(push_image_button).bind('click',function(e){return _this.pushImage();});return dynamicAddsBlock;};ImagesManagementDiv.prototype.pushImage=function(){OverlayMe.dyn_manager.addImage(this.image_url_input.value);return this.image_url_input.value='';};ImagesManagementDiv.prototype.render=function(){return this.el;};return ImagesManagementDiv;})(Backbone.View);}).call(this);(function(){var __hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key];}function ctor(){this.constructor=child;}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child;};OverlayMe.OverlaysPanel=(function(_super){__extends(OverlaysPanel,_super);OverlaysPanel.name='OverlaysPanel';function OverlaysPanel(){return OverlaysPanel.__super__.constructor.apply(this,arguments);} OverlaysPanel.prototype.initialize=function(attributes,options){var buildTree,displayTree,files_tree,shiftTofiles;OverlaysPanel.__super__.initialize.call(this,{id:"overlays-panel",title:"Overlays"},options);this.append(new OverlayMe.Overlays.ContentDivManagementBlock().render());OverlayMe.images_management_div=new OverlayMe.Overlays.ImagesManagementDiv();this.append(OverlayMe.images_management_div.render());OverlayMe.menu.append(this.render());$o(window).bind('mousemove',function(event){return $o(window).trigger('mymousemove',event);});OverlayMe.dyn_manager=new OverlayMe.Overlays.DynamicManager();OverlayMe.dyn_manager.loadAll();OverlayMe.loadDefaultImage=function(){if(OverlayMe.dyn_manager.isEmpty()){return OverlayMe.dyn_manager.addImage('https://a248.e.akamai.net/assets.github.com/images/modules/about_page/octocat.png',{default_css:{left:""+(window.document.width*.6)+"px"}});}};$o.ajax({url:'/overlay_images',dataType:'json',success:function(data){if(data.length===0){return OverlayMe.loadDefaultImage();}else{return buildTree(data);}},error:function(){return OverlayMe.loadDefaultImage();}});files_tree={};buildTree=function(data){$o.each(data,function(index,img_path){var bit,bits,parent_path,position,_results;bits=img_path.split('/');position=files_tree;parent_path='/';_results=[];while(bits.length>0){bit=bits[0];bits=bits.slice(1);if(bit===""){continue;} parent_path+=bit+'/';if(position[bit]===void 0){if(bits.length>0){position[bit]={parent_path:parent_path};}else{if(position['files']===void 0){position['files']=[];} position['files'].push(bit);}} _results.push(position=position[bit]);} return _results;});files_tree=shiftTofiles(files_tree);return displayTree(OverlayMe.images_management_div,files_tree);};shiftTofiles=function(tree){var keys;if(tree.files){return tree;} keys=Object.keys(tree);if(keys.length>2){return tree;} keys=_.without(keys,'parent_path');return shiftTofiles(tree[keys[0]]);};return displayTree=function(parent,tree){var dir,img,sub_dir,_i,_j,_len,_len1,_ref,_ref1,_results;_ref=Object.keys(tree);for(_i=0,_len=_ref.length;_i<_len;_i++){dir=_ref[_i];if(dir==='files'||dir==='parent_path'){continue;} sub_dir=new OverlayMe.Overlays.ImagesDirectory(dir);parent.append(sub_dir.render());displayTree(sub_dir,tree[dir]);} if(tree.files){_ref1=tree.files;_results=[];for(_j=0,_len1=_ref1.length;_j<_len1;_j++){img=_ref1[_j];_results.push(parent.append(new OverlayMe.Overlays.Image(tree.parent_path+img,{parent_path:tree.parent_path}).render()));} return _results;}};};return OverlaysPanel;})(OverlayMe.MenuItem);$o(function(){if(!OverlayMe.overlay_panel){return OverlayMe.overlay_panel=new OverlayMe.OverlaysPanel();}});}).call(this);(function(){OverlayMe.setLoaded();}).call(this);