/*
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(aM,C){var a=function(aY,aZ){return new a.fn.init(aY,aZ)},n=aM.jQuery,R=aM.$,ab=aM.document,X,P=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,aW=/^.[^:#\[\.,]*$/,ax=/\S/,M=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,e=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,b=navigator.userAgent,u,K=false,ad=[],aG,at=Object.prototype.toString,ap=Object.prototype.hasOwnProperty,g=Array.prototype.push,F=Array.prototype.slice,s=Array.prototype.indexOf;a.fn=a.prototype={init:function(aY,a1){var a0,a2,aZ,a3;if(!aY){return this}if(aY.nodeType){this.context=this[0]=aY;this.length=1;return this}if(aY==="body"&&!a1){this.context=ab;this[0]=ab.body;this.selector="body";this.length=1;return this}if(typeof aY==="string"){a0=P.exec(aY);if(a0&&(a0[1]||!a1)){if(a0[1]){a3=(a1?a1.ownerDocument||a1:ab);aZ=e.exec(aY);if(aZ){if(a.isPlainObject(a1)){aY=[ab.createElement(aZ[1])];a.fn.attr.call(aY,a1,true)}else{aY=[a3.createElement(aZ[1])]}}else{aZ=J([a0[1]],[a3]);aY=(aZ.cacheable?aZ.fragment.cloneNode(true):aZ.fragment).childNodes}return a.merge(this,aY)}else{a2=ab.getElementById(a0[2]);if(a2){if(a2.id!==a0[2]){return X.find(aY)}this.length=1;this[0]=a2}this.context=ab;this.selector=aY;return this}}else{if(!a1&&/^\w+$/.test(aY)){this.selector=aY;this.context=ab;aY=ab.getElementsByTagName(aY);return a.merge(this,aY)}else{if(!a1||a1.jquery){return(a1||X).find(aY)}else{return a(a1).find(aY)}}}}else{if(a.isFunction(aY)){return X.ready(aY)}}if(aY.selector!==C){this.selector=aY.selector;this.context=aY.context}return a.makeArray(aY,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(aY){return aY==null?this.toArray():(aY<0?this.slice(aY)[0]:this[aY])},pushStack:function(aZ,a1,aY){var a0=a();if(a.isArray(aZ)){g.apply(a0,aZ)}else{a.merge(a0,aZ)}a0.prevObject=this;a0.context=this.context;if(a1==="find"){a0.selector=this.selector+(this.selector?" ":"")+aY}else{if(a1){a0.selector=this.selector+"."+a1+"("+aY+")"}}return a0},each:function(aZ,aY){return a.each(this,aZ,aY)},ready:function(aY){a.bindReady();if(a.isReady){aY.call(ab,a)}else{if(ad){ad.push(aY)}}return this},eq:function(aY){return aY===-1?this.slice(aY):this.slice(aY,+aY+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(aY){return this.pushStack(a.map(this,function(a0,aZ){return aY.call(a0,aZ,a0)}))},end:function(){return this.prevObject||a(null)},push:g,sort:[].sort,splice:[].splice};a.fn.init.prototype=a.fn;a.extend=a.fn.extend=function(){var a3=arguments[0]||{},a2=1,a1=arguments.length,a5=false,a6,a0,aY,aZ;if(typeof a3==="boolean"){a5=a3;a3=arguments[1]||{};a2=2}if(typeof a3!=="object"&&!a.isFunction(a3)){a3={}}if(a1===a2){a3=this;--a2}for(;a2<a1;a2++){if((a6=arguments[a2])!=null){for(a0 in a6){aY=a3[a0];aZ=a6[a0];if(a3===aZ){continue}if(a5&&aZ&&(a.isPlainObject(aZ)||a.isArray(aZ))){var a4=aY&&(a.isPlainObject(aY)||a.isArray(aY))?aY:a.isArray(aZ)?[]:{};a3[a0]=a.extend(a5,a4,aZ)}else{if(aZ!==C){a3[a0]=aZ}}}}}return a3};a.extend({noConflict:function(aY){aM.$=R;if(aY){aM.jQuery=n}return a},isReady:false,ready:function(){if(!a.isReady){if(!ab.body){return setTimeout(a.ready,13)}a.isReady=true;if(ad){var aZ,aY=0;while((aZ=ad[aY++])){aZ.call(ab,a)}ad=null}if(a.fn.triggerHandler){a(ab).triggerHandler("ready")}}},bindReady:function(){if(K){return}K=true;if(ab.readyState==="complete"){return a.ready()}if(ab.addEventListener){ab.addEventListener("DOMContentLoaded",aG,false);aM.addEventListener("load",a.ready,false)}else{if(ab.attachEvent){ab.attachEvent("onreadystatechange",aG);aM.attachEvent("onload",a.ready);var aY=false;try{aY=aM.frameElement==null}catch(aZ){}if(ab.documentElement.doScroll&&aY){x()}}}},isFunction:function(aY){return at.call(aY)==="[object Function]"},isArray:function(aY){return at.call(aY)==="[object Array]"},isPlainObject:function(aZ){if(!aZ||at.call(aZ)!=="[object Object]"||aZ.nodeType||aZ.setInterval){return false}if(aZ.constructor&&!ap.call(aZ,"constructor")&&!ap.call(aZ.constructor.prototype,"isPrototypeOf")){return false}var aY;for(aY in aZ){}return aY===C||ap.call(aZ,aY)},isEmptyObject:function(aZ){for(var aY in aZ){return false}return true},error:function(aY){throw aY},parseJSON:function(aY){if(typeof aY!=="string"||!aY){return null}aY=a.trim(aY);if(/^[\],:{}\s]*$/.test(aY.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return aM.JSON&&aM.JSON.parse?aM.JSON.parse(aY):(new Function("return "+aY))()}else{a.error("Invalid JSON: "+aY)}},noop:function(){},globalEval:function(a0){if(a0&&ax.test(a0)){var aZ=ab.getElementsByTagName("head")[0]||ab.documentElement,aY=ab.createElement("script");aY.type="text/javascript";if(a.support.scriptEval){aY.appendChild(ab.createTextNode(a0))}else{aY.text=a0}aZ.insertBefore(aY,aZ.firstChild);aZ.removeChild(aY)}},nodeName:function(aZ,aY){return aZ.nodeName&&aZ.nodeName.toUpperCase()===aY.toUpperCase()},each:function(a1,a5,a0){var aZ,a2=0,a3=a1.length,aY=a3===C||a.isFunction(a1);if(a0){if(aY){for(aZ in a1){if(a5.apply(a1[aZ],a0)===false){break}}}else{for(;a2<a3;){if(a5.apply(a1[a2++],a0)===false){break}}}}else{if(aY){for(aZ in a1){if(a5.call(a1[aZ],aZ,a1[aZ])===false){break}}}else{for(var a4=a1[0];a2<a3&&a5.call(a4,a2,a4)!==false;a4=a1[++a2]){}}}return a1},trim:function(aY){return(aY||"").replace(M,"")},makeArray:function(a0,aZ){var aY=aZ||[];if(a0!=null){if(a0.length==null||typeof a0==="string"||a.isFunction(a0)||(typeof a0!=="function"&&a0.setInterval)){g.call(aY,a0)}else{a.merge(aY,a0)}}return aY},inArray:function(a0,a1){if(a1.indexOf){return a1.indexOf(a0)}for(var aY=0,aZ=a1.length;aY<aZ;aY++){if(a1[aY]===a0){return aY}}return -1},merge:function(a2,a0){var a1=a2.length,aZ=0;if(typeof a0.length==="number"){for(var aY=a0.length;aZ<aY;aZ++){a2[a1++]=a0[aZ]}}else{while(a0[aZ]!==C){a2[a1++]=a0[aZ++]}}a2.length=a1;return a2},grep:function(aZ,a3,aY){var a0=[];for(var a1=0,a2=aZ.length;a1<a2;a1++){if(!aY!==!a3(aZ[a1],a1)){a0.push(aZ[a1])}}return a0},map:function(aZ,a4,aY){var a0=[],a3;for(var a1=0,a2=aZ.length;a1<a2;a1++){a3=a4(aZ[a1],a1,aY);if(a3!=null){a0[a0.length]=a3}}return a0.concat.apply([],a0)},guid:1,proxy:function(a0,aZ,aY){if(arguments.length===2){if(typeof aZ==="string"){aY=a0;a0=aY[aZ];aZ=C}else{if(aZ&&!a.isFunction(aZ)){aY=aZ;aZ=C}}}if(!aZ&&a0){aZ=function(){return a0.apply(aY||this,arguments)}}if(a0){aZ.guid=a0.guid=a0.guid||aZ.guid||a.guid++}return aZ},uaMatch:function(aZ){aZ=aZ.toLowerCase();var aY=/(webkit)[ \/]([\w.]+)/.exec(aZ)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(aZ)||/(msie) ([\w.]+)/.exec(aZ)||!/compatible/.test(aZ)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(aZ)||[];return{browser:aY[1]||"",version:aY[2]||"0"}},browser:{}});u=a.uaMatch(b);if(u.browser){a.browser[u.browser]=true;a.browser.version=u.version}if(a.browser.webkit){a.browser.safari=true}if(s){a.inArray=function(aY,aZ){return s.call(aZ,aY)}}X=a(ab);if(ab.addEventListener){aG=function(){ab.removeEventListener("DOMContentLoaded",aG,false);a.ready()}}else{if(ab.attachEvent){aG=function(){if(ab.readyState==="complete"){ab.detachEvent("onreadystatechange",aG);a.ready()}}}}function x(){if(a.isReady){return}try{ab.documentElement.doScroll("left")}catch(aY){setTimeout(x,1);return}a.ready()}function aV(aY,aZ){if(aZ.src){a.ajax({url:aZ.src,async:false,dataType:"script"})}else{a.globalEval(aZ.text||aZ.textContent||aZ.innerHTML||"")}if(aZ.parentNode){aZ.parentNode.removeChild(aZ)}}function an(aY,a6,a4,a0,a3,a5){var aZ=aY.length;if(typeof a6==="object"){for(var a1 in a6){an(aY,a1,a6[a1],a0,a3,a4)}return aY}if(a4!==C){a0=!a5&&a0&&a.isFunction(a4);for(var a2=0;a2<aZ;a2++){a3(aY[a2],a6,a0?a4.call(aY[a2],a2,a3(aY[a2],a6)):a4,a5)}return aY}return aZ?a3(aY[0],a6):C}function aP(){return(new Date).getTime()}(function(){a.support={};var a4=ab.documentElement,a3=ab.createElement("script"),aY=ab.createElement("div"),aZ="script"+aP();aY.style.display="none";aY.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var a6=aY.getElementsByTagName("*"),a5=aY.getElementsByTagName("a")[0];if(!a6||!a6.length||!a5){return}a.support={leadingWhitespace:aY.firstChild.nodeType===3,tbody:!aY.getElementsByTagName("tbody").length,htmlSerialize:!!aY.getElementsByTagName("link").length,style:/red/.test(a5.getAttribute("style")),hrefNormalized:a5.getAttribute("href")==="/a",opacity:/^0.55$/.test(a5.style.opacity),cssFloat:!!a5.style.cssFloat,checkOn:aY.getElementsByTagName("input")[0].value==="on",optSelected:ab.createElement("select").appendChild(ab.createElement("option")).selected,parentNode:aY.removeChild(aY.appendChild(ab.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};a3.type="text/javascript";try{a3.appendChild(ab.createTextNode("window."+aZ+"=1;"))}catch(a1){}a4.insertBefore(a3,a4.firstChild);if(aM[aZ]){a.support.scriptEval=true;delete aM[aZ]}try{delete a3.test}catch(a1){a.support.deleteExpando=false}a4.removeChild(a3);if(aY.attachEvent&&aY.fireEvent){aY.attachEvent("onclick",function a7(){a.support.noCloneEvent=false;aY.detachEvent("onclick",a7)});aY.cloneNode(true).fireEvent("onclick")}aY=ab.createElement("div");aY.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var a0=ab.createDocumentFragment();a0.appendChild(aY.firstChild);a.support.checkClone=a0.cloneNode(true).cloneNode(true).lastChild.checked;a(function(){var a8=ab.createElement("div");a8.style.width=a8.style.paddingLeft="1px";ab.body.appendChild(a8);a.boxModel=a.support.boxModel=a8.offsetWidth===2;ab.body.removeChild(a8).style.display="none";a8=null});var a2=function(a8){var ba=ab.createElement("div");a8="on"+a8;var a9=(a8 in ba);if(!a9){ba.setAttribute(a8,"return;");a9=typeof ba[a8]==="function"}ba=null;return a9};a.support.submitBubbles=a2("submit");a.support.changeBubbles=a2("change");a4=a3=aY=a6=a5=null})();a.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var aI="jQuery"+aP(),aH=0,aT={};a.extend({cache:{},expando:aI,noData:{embed:true,object:true,applet:true},data:function(a0,aZ,a2){if(a0.nodeName&&a.noData[a0.nodeName.toLowerCase()]){return}a0=a0==aM?aT:a0;var a3=a0[aI],aY=a.cache,a1;if(!a3&&typeof aZ==="string"&&a2===C){return null}if(!a3){a3=++aH}if(typeof aZ==="object"){a0[aI]=a3;a1=aY[a3]=a.extend(true,{},aZ)}else{if(!aY[a3]){a0[aI]=a3;aY[a3]={}}}a1=aY[a3];if(a2!==C){a1[aZ]=a2}return typeof aZ==="string"?a1[aZ]:a1},removeData:function(a0,aZ){if(a0.nodeName&&a.noData[a0.nodeName.toLowerCase()]){return}a0=a0==aM?aT:a0;var a2=a0[aI],aY=a.cache,a1=aY[a2];if(aZ){if(a1){delete a1[aZ];if(a.isEmptyObject(a1)){a.removeData(a0)}}}else{if(a.support.deleteExpando){delete a0[a.expando]}else{if(a0.removeAttribute){a0.removeAttribute(a.expando)}}delete aY[a2]}}});a.fn.extend({data:function(aY,a0){if(typeof aY==="undefined"&&this.length){return a.data(this[0])}else{if(typeof aY==="object"){return this.each(function(){a.data(this,aY)})}}var a1=aY.split(".");a1[1]=a1[1]?"."+a1[1]:"";if(a0===C){var aZ=this.triggerHandler("getData"+a1[1]+"!",[a1[0]]);if(aZ===C&&this.length){aZ=a.data(this[0],aY)}return aZ===C&&a1[1]?this.data(a1[0]):aZ}else{return this.trigger("setData"+a1[1]+"!",[a1[0],a0]).each(function(){a.data(this,aY,a0)})}},removeData:function(aY){return this.each(function(){a.removeData(this,aY)})}});a.extend({queue:function(aZ,aY,a1){if(!aZ){return}aY=(aY||"fx")+"queue";var a0=a.data(aZ,aY);if(!a1){return a0||[]}if(!a0||a.isArray(a1)){a0=a.data(aZ,aY,a.makeArray(a1))}else{a0.push(a1)}return a0},dequeue:function(a1,a0){a0=a0||"fx";var aY=a.queue(a1,a0),aZ=aY.shift();if(aZ==="inprogress"){aZ=aY.shift()}if(aZ){if(a0==="fx"){aY.unshift("inprogress")}aZ.call(a1,function(){a.dequeue(a1,a0)})}}});a.fn.extend({queue:function(aY,aZ){if(typeof aY!=="string"){aZ=aY;aY="fx"}if(aZ===C){return a.queue(this[0],aY)}return this.each(function(a1,a2){var a0=a.queue(this,aY,aZ);if(aY==="fx"&&a0[0]!=="inprogress"){a.dequeue(this,aY)}})},dequeue:function(aY){return this.each(function(){a.dequeue(this,aY)})},delay:function(aZ,aY){aZ=a.fx?a.fx.speeds[aZ]||aZ:aZ;aY=aY||"fx";return this.queue(aY,function(){var a0=this;setTimeout(function(){a.dequeue(a0,aY)},aZ)})},clearQueue:function(aY){return this.queue(aY||"fx",[])}});var ao=/[\n\t]/g,S=/\s+/,av=/\r/g,aQ=/href|src|style/,d=/(button|input)/i,z=/(button|input|object|select|textarea)/i,j=/^(a|area)$/i,I=/radio|checkbox/;a.fn.extend({attr:function(aY,aZ){return an(this,aY,aZ,true,a.attr)},removeAttr:function(aY,aZ){return this.each(function(){a.attr(this,aY,"");if(this.nodeType===1){this.removeAttribute(aY)}})},addClass:function(a5){if(a.isFunction(a5)){return this.each(function(a8){var a7=a(this);a7.addClass(a5.call(this,a8,a7.attr("class")))})}if(a5&&typeof a5==="string"){var aY=(a5||"").split(S);for(var a1=0,a0=this.length;a1<a0;a1++){var aZ=this[a1];if(aZ.nodeType===1){if(!aZ.className){aZ.className=a5}else{var a2=" "+aZ.className+" ",a4=aZ.className;for(var a3=0,a6=aY.length;a3<a6;a3++){if(a2.indexOf(" "+aY[a3]+" ")<0){a4+=" "+aY[a3]}}aZ.className=a.trim(a4)}}}}return this},removeClass:function(a3){if(a.isFunction(a3)){return this.each(function(a7){var a6=a(this);a6.removeClass(a3.call(this,a7,a6.attr("class")))})}if((a3&&typeof a3==="string")||a3===C){var a4=(a3||"").split(S);for(var a0=0,aZ=this.length;a0<aZ;a0++){var a2=this[a0];if(a2.nodeType===1&&a2.className){if(a3){var a1=(" "+a2.className+" ").replace(ao," ");for(var a5=0,aY=a4.length;a5<aY;a5++){a1=a1.replace(" "+a4[a5]+" "," ")}a2.className=a.trim(a1)}else{a2.className=""}}}}return this},toggleClass:function(a1,aZ){var a0=typeof a1,aY=typeof aZ==="boolean";if(a.isFunction(a1)){return this.each(function(a3){var a2=a(this);a2.toggleClass(a1.call(this,a3,a2.attr("class"),aZ),aZ)})}return this.each(function(){if(a0==="string"){var a4,a3=0,a2=a(this),a5=aZ,a6=a1.split(S);while((a4=a6[a3++])){a5=aY?a5:!a2.hasClass(a4);a2[a5?"addClass":"removeClass"](a4)}}else{if(a0==="undefined"||a0==="boolean"){if(this.className){a.data(this,"__className__",this.className)}this.className=this.className||a1===false?"":a.data(this,"__className__")||""}}})},hasClass:function(aY){var a1=" "+aY+" ";for(var a0=0,aZ=this.length;a0<aZ;a0++){if((" "+this[a0].className+" ").replace(ao," ").indexOf(a1)>-1){return true}}return false},val:function(a5){if(a5===C){var aZ=this[0];if(aZ){if(a.nodeName(aZ,"option")){return(aZ.attributes.value||{}).specified?aZ.value:aZ.text}if(a.nodeName(aZ,"select")){var a3=aZ.selectedIndex,a6=[],a7=aZ.options,a2=aZ.type==="select-one";if(a3<0){return null}for(var a0=a2?a3:0,a4=a2?a3+1:a7.length;a0<a4;a0++){var a1=a7[a0];if(a1.selected){a5=a(a1).val();if(a2){return a5}a6.push(a5)}}return a6}if(I.test(aZ.type)&&!a.support.checkOn){return aZ.getAttribute("value")===null?"on":aZ.value}return(aZ.value||"").replace(av,"")}return C}var aY=a.isFunction(a5);return this.each(function(ba){var a9=a(this),bb=a5;if(this.nodeType!==1){return}if(aY){bb=a5.call(this,ba,a9.val())}if(typeof bb==="number"){bb+=""}if(a.isArray(bb)&&I.test(this.type)){this.checked=a.inArray(a9.val(),bb)>=0}else{if(a.nodeName(this,"select")){var a8=a.makeArray(bb);a("option",this).each(function(){this.selected=a.inArray(a(this).val(),a8)>=0});if(!a8.length){this.selectedIndex=-1}}else{this.value=bb}}})}});a.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(aZ,aY,a4,a7){if(!aZ||aZ.nodeType===3||aZ.nodeType===8){return C}if(a7&&aY in a.attrFn){return a(aZ)[aY](a4)}var a0=aZ.nodeType!==1||!a.isXMLDoc(aZ),a3=a4!==C;aY=a0&&a.props[aY]||aY;if(aZ.nodeType===1){var a2=aQ.test(aY);if(aY==="selected"&&!a.support.optSelected){var a5=aZ.parentNode;if(a5){a5.selectedIndex;if(a5.parentNode){a5.parentNode.selectedIndex}}}if(aY in aZ&&a0&&!a2){if(a3){if(aY==="type"&&d.test(aZ.nodeName)&&aZ.parentNode){a.error("type property can't be changed")}aZ[aY]=a4}if(a.nodeName(aZ,"form")&&aZ.getAttributeNode(aY)){return aZ.getAttributeNode(aY).nodeValue}if(aY==="tabIndex"){var a6=aZ.getAttributeNode("tabIndex");return a6&&a6.specified?a6.value:z.test(aZ.nodeName)||j.test(aZ.nodeName)&&aZ.href?0:C}return aZ[aY]}if(!a.support.style&&a0&&aY==="style"){if(a3){aZ.style.cssText=""+a4}return aZ.style.cssText}if(a3){aZ.setAttribute(aY,""+a4)}var a1=!a.support.hrefNormalized&&a0&&a2?aZ.getAttribute(aY,2):aZ.getAttribute(aY);return a1===null?C:a1}return a.style(aZ,aY,a4)}});var aC=/\.(.*)$/,A=function(aY){return aY.replace(/[^\w\s\.\|`]/g,function(aZ){return"\\"+aZ})};a.event={add:function(a1,a5,ba,a3){if(a1.nodeType===3||a1.nodeType===8){return}if(a1.setInterval&&(a1!==aM&&!a1.frameElement)){a1=aM}var aZ,a9;if(ba.handler){aZ=ba;ba=aZ.handler}if(!ba.guid){ba.guid=a.guid++}var a6=a.data(a1);if(!a6){return}var bb=a6.events=a6.events||{},a4=a6.handle,a4;if(!a4){a6.handle=a4=function(){return typeof a!=="undefined"&&!a.event.triggered?a.event.handle.apply(a4.elem,arguments):C}}a4.elem=a1;a5=a5.split(" ");var a8,a2=0,aY;while((a8=a5[a2++])){a9=aZ?a.extend({},aZ):{handler:ba,data:a3};if(a8.indexOf(".")>-1){aY=a8.split(".");a8=aY.shift();a9.namespace=aY.slice(0).sort().join(".")}else{aY=[];a9.namespace=""}a9.type=a8;a9.guid=ba.guid;var a0=bb[a8],a7=a.event.special[a8]||{};if(!a0){a0=bb[a8]=[];if(!a7.setup||a7.setup.call(a1,a3,aY,a4)===false){if(a1.addEventListener){a1.addEventListener(a8,a4,false)}else{if(a1.attachEvent){a1.attachEvent("on"+a8,a4)}}}}if(a7.add){a7.add.call(a1,a9);if(!a9.handler.guid){a9.handler.guid=ba.guid}}a0.push(a9);a.event.global[a8]=true}a1=null},global:{},remove:function(bd,a8,aZ,a4){if(bd.nodeType===3||bd.nodeType===8){return}var bg,a3,a5,bb=0,a1,a6,a9,a2,a7,aY,bf,bc=a.data(bd),a0=bc&&bc.events;if(!bc||!a0){return}if(a8&&a8.type){aZ=a8.handler;a8=a8.type}if(!a8||typeof a8==="string"&&a8.charAt(0)==="."){a8=a8||"";for(a3 in a0){a.event.remove(bd,a3+a8)}return}a8=a8.split(" ");while((a3=a8[bb++])){bf=a3;aY=null;a1=a3.indexOf(".")<0;a6=[];if(!a1){a6=a3.split(".");a3=a6.shift();a9=new RegExp("(^|\\.)"+a.map(a6.slice(0).sort(),A).join("\\.(?:.*\\.)?")+"(\\.|$)")}a7=a0[a3];if(!a7){continue}if(!aZ){for(var ba=0;ba<a7.length;ba++){aY=a7[ba];if(a1||a9.test(aY.namespace)){a.event.remove(bd,bf,aY.handler,ba);a7.splice(ba--,1)}}continue}a2=a.event.special[a3]||{};for(var ba=a4||0;ba<a7.length;ba++){aY=a7[ba];if(aZ.guid===aY.guid){if(a1||a9.test(aY.namespace)){if(a4==null){a7.splice(ba--,1)}if(a2.remove){a2.remove.call(bd,aY)}}if(a4!=null){break}}}if(a7.length===0||a4!=null&&a7.length===1){if(!a2.teardown||a2.teardown.call(bd,a6)===false){ag(bd,a3,bc.handle)}bg=null;delete a0[a3]}}if(a.isEmptyObject(a0)){var be=bc.handle;if(be){be.elem=null}delete bc.events;delete bc.handle;if(a.isEmptyObject(bc)){a.removeData(bd)}}},trigger:function(aY,a2,a0){var a7=aY.type||aY,a1=arguments[3];if(!a1){aY=typeof aY==="object"?aY[aI]?aY:a.extend(a.Event(a7),aY):a.Event(a7);if(a7.indexOf("!")>=0){aY.type=a7=a7.slice(0,-1);aY.exclusive=true}if(!a0){aY.stopPropagation();if(a.event.global[a7]){a.each(a.cache,function(){if(this.events&&this.events[a7]){a.event.trigger(aY,a2,this.handle.elem)}})}}if(!a0||a0.nodeType===3||a0.nodeType===8){return C}aY.result=C;aY.target=a0;a2=a.makeArray(a2);a2.unshift(aY)}aY.currentTarget=a0;var a3=a.data(a0,"handle");if(a3){a3.apply(a0,a2)}var a8=a0.parentNode||a0.ownerDocument;try{if(!(a0&&a0.nodeName&&a.noData[a0.nodeName.toLowerCase()])){if(a0["on"+a7]&&a0["on"+a7].apply(a0,a2)===false){aY.result=false}}}catch(a5){}if(!aY.isPropagationStopped()&&a8){a.event.trigger(aY,a2,a8,true)}else{if(!aY.isDefaultPrevented()){var a4=aY.target,aZ,a9=a.nodeName(a4,"a")&&a7==="click",a6=a.event.special[a7]||{};if((!a6._default||a6._default.call(a0,aY)===false)&&!a9&&!(a4&&a4.nodeName&&a.noData[a4.nodeName.toLowerCase()])){try{if(a4[a7]){aZ=a4["on"+a7];if(aZ){a4["on"+a7]=null}a.event.triggered=true;a4[a7]()}}catch(a5){}if(aZ){a4["on"+a7]=aZ}a.event.triggered=false}}}},handle:function(aY){var a6,a0,aZ,a1,a7;aY=arguments[0]=a.event.fix(aY||aM.event);aY.currentTarget=this;a6=aY.type.indexOf(".")<0&&!aY.exclusive;if(!a6){aZ=aY.type.split(".");aY.type=aZ.shift();a1=new RegExp("(^|\\.)"+aZ.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}var a7=a.data(this,"events"),a0=a7[aY.type];if(a7&&a0){a0=a0.slice(0);for(var a3=0,a2=a0.length;a3<a2;a3++){var a5=a0[a3];if(a6||a1.test(a5.namespace)){aY.handler=a5.handler;aY.data=a5.data;aY.handleObj=a5;var a4=a5.handler.apply(this,arguments);if(a4!==C){aY.result=a4;if(a4===false){aY.preventDefault();aY.stopPropagation()}}if(aY.isImmediatePropagationStopped()){break}}}}return aY.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a1){if(a1[aI]){return a1}var aZ=a1;a1=a.Event(aZ);for(var a0=this.props.length,a3;a0;){a3=this.props[--a0];a1[a3]=aZ[a3]}if(!a1.target){a1.target=a1.srcElement||ab}if(a1.target.nodeType===3){a1.target=a1.target.parentNode}if(!a1.relatedTarget&&a1.fromElement){a1.relatedTarget=a1.fromElement===a1.target?a1.toElement:a1.fromElement}if(a1.pageX==null&&a1.clientX!=null){var a2=ab.documentElement,aY=ab.body;a1.pageX=a1.clientX+(a2&&a2.scrollLeft||aY&&aY.scrollLeft||0)-(a2&&a2.clientLeft||aY&&aY.clientLeft||0);a1.pageY=a1.clientY+(a2&&a2.scrollTop||aY&&aY.scrollTop||0)-(a2&&a2.clientTop||aY&&aY.clientTop||0)}if(!a1.which&&((a1.charCode||a1.charCode===0)?a1.charCode:a1.keyCode)){a1.which=a1.charCode||a1.keyCode}if(!a1.metaKey&&a1.ctrlKey){a1.metaKey=a1.ctrlKey}if(!a1.which&&a1.button!==C){a1.which=(a1.button&1?1:(a1.button&2?3:(a1.button&4?2:0)))}return a1},guid:100000000,proxy:a.proxy,special:{ready:{setup:a.bindReady,teardown:a.noop},live:{add:function(aY){a.event.add(this,aY.origType,a.extend({},aY,{handler:V}))},remove:function(aZ){var aY=true,a0=aZ.origType.replace(aC,"");a.each(a.data(this,"events").live||[],function(){if(a0===this.origType.replace(aC,"")){aY=false;return false}});if(aY){a.event.remove(this,aZ.origType,V)}}},beforeunload:{setup:function(a0,aZ,aY){if(this.setInterval){this.onbeforeunload=aY}return false},teardown:function(aZ,aY){if(this.onbeforeunload===aY){this.onbeforeunload=null}}}}};var ag=ab.removeEventListener?function(aZ,aY,a0){aZ.removeEventListener(aY,a0,false)}:function(aZ,aY,a0){aZ.detachEvent("on"+aY,a0)};a.Event=function(aY){if(!this.preventDefault){return new a.Event(aY)}if(aY&&aY.type){this.originalEvent=aY;this.type=aY.type}else{this.type=aY}this.timeStamp=aP();this[aI]=true};function aR(){return false}function f(){return true}a.Event.prototype={preventDefault:function(){this.isDefaultPrevented=f;var aY=this.originalEvent;if(!aY){return}if(aY.preventDefault){aY.preventDefault()}aY.returnValue=false},stopPropagation:function(){this.isPropagationStopped=f;var aY=this.originalEvent;if(!aY){return}if(aY.stopPropagation){aY.stopPropagation()}aY.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=f;this.stopPropagation()},isDefaultPrevented:aR,isPropagationStopped:aR,isImmediatePropagationStopped:aR};var Q=function(aZ){var aY=aZ.relatedTarget;try{while(aY&&aY!==this){aY=aY.parentNode}if(aY!==this){aZ.type=aZ.data;a.event.handle.apply(this,arguments)}}catch(a0){}},ay=function(aY){aY.type=aY.data;a.event.handle.apply(this,arguments)};a.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(aZ,aY){a.event.special[aZ]={setup:function(a0){a.event.add(this,aY,a0&&a0.selector?ay:Q,aZ)},teardown:function(a0){a.event.remove(this,aY,a0&&a0.selector?ay:Q)}}});if(!a.support.submitBubbles){a.event.special.submit={setup:function(aZ,aY){if(this.nodeName.toLowerCase()!=="form"){a.event.add(this,"click.specialSubmit",function(a2){var a1=a2.target,a0=a1.type;if((a0==="submit"||a0==="image")&&a(a1).closest("form").length){return aA("submit",this,arguments)}});a.event.add(this,"keypress.specialSubmit",function(a2){var a1=a2.target,a0=a1.type;if((a0==="text"||a0==="password")&&a(a1).closest("form").length&&a2.keyCode===13){return aA("submit",this,arguments)}})}else{return false}},teardown:function(aY){a.event.remove(this,".specialSubmit")}}}if(!a.support.changeBubbles){var aq=/textarea|input|select/i,aS,i=function(aZ){var aY=aZ.type,a0=aZ.value;if(aY==="radio"||aY==="checkbox"){a0=aZ.checked}else{if(aY==="select-multiple"){a0=aZ.selectedIndex>-1?a.map(aZ.options,function(a1){return a1.selected}).join("-"):""}else{if(aZ.nodeName.toLowerCase()==="select"){a0=aZ.selectedIndex}}}return a0},O=function O(a0){var aY=a0.target,aZ,a1;if(!aq.test(aY.nodeName)||aY.readOnly){return}aZ=a.data(aY,"_change_data");a1=i(aY);if(a0.type!=="focusout"||aY.type!=="radio"){a.data(aY,"_change_data",a1)}if(aZ===C||a1===aZ){return}if(aZ!=null||a1){a0.type="change";return a.event.trigger(a0,arguments[1],aY)}};a.event.special.change={filters:{focusout:O,click:function(a0){var aZ=a0.target,aY=aZ.type;if(aY==="radio"||aY==="checkbox"||aZ.nodeName.toLowerCase()==="select"){return O.call(this,a0)}},keydown:function(a0){var aZ=a0.target,aY=aZ.type;if((a0.keyCode===13&&aZ.nodeName.toLowerCase()!=="textarea")||(a0.keyCode===32&&(aY==="checkbox"||aY==="radio"))||aY==="select-multiple"){return O.call(this,a0)}},beforeactivate:function(aZ){var aY=aZ.target;a.data(aY,"_change_data",i(aY))}},setup:function(a0,aZ){if(this.type==="file"){return false}for(var aY in aS){a.event.add(this,aY+".specialChange",aS[aY])}return aq.test(this.nodeName)},teardown:function(aY){a.event.remove(this,".specialChange");return aq.test(this.nodeName)}};aS=a.event.special.change.filters}function aA(aZ,a0,aY){aY[0].type=aZ;return a.event.handle.apply(a0,aY)}if(ab.addEventListener){a.each({focus:"focusin",blur:"focusout"},function(a0,aY){a.event.special[aY]={setup:function(){this.addEventListener(a0,aZ,true)},teardown:function(){this.removeEventListener(a0,aZ,true)}};function aZ(a1){a1=a.event.fix(a1);a1.type=aY;return a.event.handle.call(this,a1)}})}a.each(["bind","one"],function(aZ,aY){a.fn[aY]=function(a5,a6,a4){if(typeof a5==="object"){for(var a2 in a5){this[aY](a2,a6,a5[a2],a4)}return this}if(a.isFunction(a6)){a4=a6;a6=C}var a3=aY==="one"?a.proxy(a4,function(a7){a(this).unbind(a7,a3);return a4.apply(this,arguments)}):a4;if(a5==="unload"&&aY!=="one"){this.one(a5,a6,a4)}else{for(var a1=0,a0=this.length;a1<a0;a1++){a.event.add(this[a1],a5,a3,a6)}}return this}});a.fn.extend({unbind:function(a2,a1){if(typeof a2==="object"&&!a2.preventDefault){for(var a0 in a2){this.unbind(a0,a2[a0])}}else{for(var aZ=0,aY=this.length;aZ<aY;aZ++){a.event.remove(this[aZ],a2,a1)}}return this},delegate:function(aY,aZ,a1,a0){return this.live(aZ,a1,a0,aY)},undelegate:function(aY,aZ,a0){if(arguments.length===0){return this.unbind("live")}else{return this.die(aZ,null,a0,aY)}},trigger:function(aY,aZ){return this.each(function(){a.event.trigger(aY,aZ,this)})},triggerHandler:function(aY,a0){if(this[0]){var aZ=a.Event(aY);aZ.preventDefault();aZ.stopPropagation();a.event.trigger(aZ,a0,this[0]);return aZ.result}},toggle:function(a0){var aY=arguments,aZ=1;while(aZ<aY.length){a.proxy(a0,aY[aZ++])}return this.click(a.proxy(a0,function(a1){var a2=(a.data(this,"lastToggle"+a0.guid)||0)%aZ;a.data(this,"lastToggle"+a0.guid,a2+1);a1.preventDefault();return aY[a2].apply(this,arguments)||false}))},hover:function(aY,aZ){return this.mouseenter(aY).mouseleave(aZ||aY)}});var aw={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};a.each(["live","die"],function(aZ,aY){a.fn[aY]=function(a7,a4,a9,a2){var a8,a5=0,a6,a1,ba,a3=a2||this.selector,a0=a2?this:a(this.context);if(a.isFunction(a4)){a9=a4;a4=C}a7=(a7||"").split(" ");while((a8=a7[a5++])!=null){a6=aC.exec(a8);a1="";if(a6){a1=a6[0];a8=a8.replace(aC,"")}if(a8==="hover"){a7.push("mouseenter"+a1,"mouseleave"+a1);continue}ba=a8;if(a8==="focus"||a8==="blur"){a7.push(aw[a8]+a1);a8=a8+a1}else{a8=(aw[a8]||a8)+a1}if(aY==="live"){a0.each(function(){a.event.add(this,m(a8,a3),{data:a4,selector:a3,handler:a9,origType:a8,origHandler:a9,preType:ba})})}else{a0.unbind(m(a8,a3),a9)}}return this}});function V(aY){var a8,aZ=[],bb=[],a7=arguments,ba,a6,a9,a1,a3,a5,a2,a4,bc=a.data(this,"events");if(aY.liveFired===this||!bc||!bc.live||aY.button&&aY.type==="click"){return}aY.liveFired=this;var a0=bc.live.slice(0);for(a3=0;a3<a0.length;a3++){a9=a0[a3];if(a9.origType.replace(aC,"")===aY.type){bb.push(a9.selector)}else{a0.splice(a3--,1)}}a6=a(aY.target).closest(bb,aY.currentTarget);for(a5=0,a2=a6.length;a5<a2;a5++){for(a3=0;a3<a0.length;a3++){a9=a0[a3];if(a6[a5].selector===a9.selector){a1=a6[a5].elem;ba=null;if(a9.preType==="mouseenter"||a9.preType==="mouseleave"){ba=a(aY.relatedTarget).closest(a9.selector)[0]}if(!ba||ba!==a1){aZ.push({elem:a1,handleObj:a9})}}}}for(a5=0,a2=aZ.length;a5<a2;a5++){a6=aZ[a5];aY.currentTarget=a6.elem;aY.data=a6.handleObj.data;aY.handleObj=a6.handleObj;if(a6.handleObj.origHandler.apply(a6.elem,a7)===false){a8=false;break}}return a8}function m(aZ,aY){return"live."+(aZ&&aZ!=="*"?aZ+".":"")+aY.replace(/\./g,"`").replace(/ /g,"&")}a.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" "),function(aZ,aY){a.fn[aY]=function(a0){return a0?this.bind(aY,a0):this.trigger(aY)};if(a.attrFn){a.attrFn[aY]=true}});if(aM.attachEvent&&!aM.addEventListener){aM.attachEvent("onunload",function(){for(var aZ in a.cache){if(a.cache[aZ].handle){try{a.event.remove(a.cache[aZ].handle.elem)}catch(aY){}}}});
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
}(function(){var a9=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,ba=0,bc=Object.prototype.toString,a4=false,a3=true;[0,0].sort(function(){a3=false;return 0});var a0=function(bl,bg,bo,bp){bo=bo||[];var br=bg=bg||ab;if(bg.nodeType!==1&&bg.nodeType!==9){return[]}if(!bl||typeof bl!=="string"){return bo}var bm=[],bi,bt,bw,bh,bk=true,bj=a1(bg),bq=bl;while((a9.exec(""),bi=a9.exec(bq))!==null){bq=bi[3];bm.push(bi[1]);if(bi[2]){bh=bi[3];break}}if(bm.length>1&&a5.exec(bl)){if(bm.length===2&&a6.relative[bm[0]]){bt=bd(bm[0]+bm[1],bg)}else{bt=a6.relative[bm[0]]?[bg]:a0(bm.shift(),bg);while(bm.length){bl=bm.shift();if(a6.relative[bl]){bl+=bm.shift()}bt=bd(bl,bt)}}}else{if(!bp&&bm.length>1&&bg.nodeType===9&&!bj&&a6.match.ID.test(bm[0])&&!a6.match.ID.test(bm[bm.length-1])){var bs=a0.find(bm.shift(),bg,bj);bg=bs.expr?a0.filter(bs.expr,bs.set)[0]:bs.set[0]}if(bg){var bs=bp?{expr:bm.pop(),set:a8(bp)}:a0.find(bm.pop(),bm.length===1&&(bm[0]==="~"||bm[0]==="+")&&bg.parentNode?bg.parentNode:bg,bj);bt=bs.expr?a0.filter(bs.expr,bs.set):bs.set;if(bm.length>0){bw=a8(bt)}else{bk=false}while(bm.length){var bv=bm.pop(),bu=bv;if(!a6.relative[bv]){bv=""}else{bu=bm.pop()}if(bu==null){bu=bg}a6.relative[bv](bw,bu,bj)}}else{bw=bm=[]}}if(!bw){bw=bt}if(!bw){a0.error(bv||bl)}if(bc.call(bw)==="[object Array]"){if(!bk){bo.push.apply(bo,bw)}else{if(bg&&bg.nodeType===1){for(var bn=0;bw[bn]!=null;bn++){if(bw[bn]&&(bw[bn]===true||bw[bn].nodeType===1&&a7(bg,bw[bn]))){bo.push(bt[bn])}}}else{for(var bn=0;bw[bn]!=null;bn++){if(bw[bn]&&bw[bn].nodeType===1){bo.push(bt[bn])}}}}}else{a8(bw,bo)}if(bh){a0(bh,br,bo,bp);a0.uniqueSort(bo)}return bo};a0.uniqueSort=function(bh){if(bb){a4=a3;bh.sort(bb);if(a4){for(var bg=1;bg<bh.length;bg++){if(bh[bg]===bh[bg-1]){bh.splice(bg--,1)}}}}return bh};a0.matches=function(bg,bh){return a0(bg,null,null,bh)};a0.find=function(bn,bg,bo){var bm,bk;if(!bn){return[]}for(var bj=0,bi=a6.order.length;bj<bi;bj++){var bl=a6.order[bj],bk;if((bk=a6.leftMatch[bl].exec(bn))){var bh=bk[1];bk.splice(1,1);if(bh.substr(bh.length-1)!=="\\"){bk[1]=(bk[1]||"").replace(/\\/g,"");bm=a6.find[bl](bk,bg,bo);if(bm!=null){bn=bn.replace(a6.match[bl],"");break}}}}if(!bm){bm=bg.getElementsByTagName("*")}return{set:bm,expr:bn}};a0.filter=function(br,bq,bu,bk){var bi=br,bw=[],bo=bq,bm,bg,bn=bq&&bq[0]&&a1(bq[0]);while(br&&bq.length){for(var bp in a6.filter){if((bm=a6.leftMatch[bp].exec(br))!=null&&bm[2]){var bh=a6.filter[bp],bv,bt,bj=bm[1];bg=false;bm.splice(1,1);if(bj.substr(bj.length-1)==="\\"){continue}if(bo===bw){bw=[]}if(a6.preFilter[bp]){bm=a6.preFilter[bp](bm,bo,bu,bw,bk,bn);if(!bm){bg=bv=true}else{if(bm===true){continue}}}if(bm){for(var bl=0;(bt=bo[bl])!=null;bl++){if(bt){bv=bh(bt,bm,bl,bo);var bs=bk^!!bv;if(bu&&bv!=null){if(bs){bg=true}else{bo[bl]=false}}else{if(bs){bw.push(bt);bg=true}}}}}if(bv!==C){if(!bu){bo=bw}br=br.replace(a6.match[bp],"");if(!bg){return[]}break}}}if(br===bi){if(bg==null){a0.error(br)}else{break}}bi=br}return bo};a0.error=function(bg){throw"Syntax error, unrecognized expression: "+bg};var a6=a0.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(bg){return bg.getAttribute("href")}},relative:{"+":function(bm,bh){var bj=typeof bh==="string",bl=bj&&!/\W/.test(bh),bn=bj&&!bl;if(bl){bh=bh.toLowerCase()}for(var bi=0,bg=bm.length,bk;bi<bg;bi++){if((bk=bm[bi])){while((bk=bk.previousSibling)&&bk.nodeType!==1){}bm[bi]=bn||bk&&bk.nodeName.toLowerCase()===bh?bk||false:bk===bh}}if(bn){a0.filter(bh,bm,true)}},">":function(bm,bh){var bk=typeof bh==="string";if(bk&&!/\W/.test(bh)){bh=bh.toLowerCase();for(var bi=0,bg=bm.length;bi<bg;bi++){var bl=bm[bi];if(bl){var bj=bl.parentNode;bm[bi]=bj.nodeName.toLowerCase()===bh?bj:false}}}else{for(var bi=0,bg=bm.length;bi<bg;bi++){var bl=bm[bi];if(bl){bm[bi]=bk?bl.parentNode:bl.parentNode===bh}}if(bk){a0.filter(bh,bm,true)}}},"":function(bj,bh,bl){var bi=ba++,bg=be;if(typeof bh==="string"&&!/\W/.test(bh)){var bk=bh=bh.toLowerCase();bg=aY}bg("parentNode",bh,bi,bj,bk,bl)},"~":function(bj,bh,bl){var bi=ba++,bg=be;if(typeof bh==="string"&&!/\W/.test(bh)){var bk=bh=bh.toLowerCase();bg=aY}bg("previousSibling",bh,bi,bj,bk,bl)}},find:{ID:function(bh,bi,bj){if(typeof bi.getElementById!=="undefined"&&!bj){var bg=bi.getElementById(bh[1]);return bg?[bg]:[]}},NAME:function(bi,bl){if(typeof bl.getElementsByName!=="undefined"){var bh=[],bk=bl.getElementsByName(bi[1]);for(var bj=0,bg=bk.length;bj<bg;bj++){if(bk[bj].getAttribute("name")===bi[1]){bh.push(bk[bj])}}return bh.length===0?null:bh}},TAG:function(bg,bh){return bh.getElementsByTagName(bg[1])}},preFilter:{CLASS:function(bj,bh,bi,bg,bm,bn){bj=" "+bj[1].replace(/\\/g,"")+" ";if(bn){return bj}for(var bk=0,bl;(bl=bh[bk])!=null;bk++){if(bl){if(bm^(bl.className&&(" "+bl.className+" ").replace(/[\t\n]/g," ").indexOf(bj)>=0)){if(!bi){bg.push(bl)}}else{if(bi){bh[bk]=false}}}}return false},ID:function(bg){return bg[1].replace(/\\/g,"")},TAG:function(bh,bg){return bh[1].toLowerCase()},CHILD:function(bg){if(bg[1]==="nth"){var bh=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(bg[2]==="even"&&"2n"||bg[2]==="odd"&&"2n+1"||!/\D/.test(bg[2])&&"0n+"+bg[2]||bg[2]);bg[2]=(bh[1]+(bh[2]||1))-0;bg[3]=bh[3]-0}bg[0]=ba++;return bg},ATTR:function(bk,bh,bi,bg,bl,bm){var bj=bk[1].replace(/\\/g,"");if(!bm&&a6.attrMap[bj]){bk[1]=a6.attrMap[bj]}if(bk[2]==="~="){bk[4]=" "+bk[4]+" "}return bk},PSEUDO:function(bk,bh,bi,bg,bl){if(bk[1]==="not"){if((a9.exec(bk[3])||"").length>1||/^\w/.test(bk[3])){bk[3]=a0(bk[3],null,null,bh)}else{var bj=a0.filter(bk[3],bh,bi,true^bl);if(!bi){bg.push.apply(bg,bj)}return false}}else{if(a6.match.POS.test(bk[0])||a6.match.CHILD.test(bk[0])){return true}}return bk},POS:function(bg){bg.unshift(true);return bg}},filters:{enabled:function(bg){return bg.disabled===false&&bg.type!=="hidden"},disabled:function(bg){return bg.disabled===true},checked:function(bg){return bg.checked===true},selected:function(bg){bg.parentNode.selectedIndex;return bg.selected===true},parent:function(bg){return !!bg.firstChild},empty:function(bg){return !bg.firstChild},has:function(bi,bh,bg){return !!a0(bg[3],bi).length},header:function(bg){return/h\d/i.test(bg.nodeName)},text:function(bg){return"text"===bg.type},radio:function(bg){return"radio"===bg.type},checkbox:function(bg){return"checkbox"===bg.type},file:function(bg){return"file"===bg.type},password:function(bg){return"password"===bg.type},submit:function(bg){return"submit"===bg.type},image:function(bg){return"image"===bg.type},reset:function(bg){return"reset"===bg.type},button:function(bg){return"button"===bg.type||bg.nodeName.toLowerCase()==="button"},input:function(bg){return/input|select|textarea|button/i.test(bg.nodeName)}},setFilters:{first:function(bh,bg){return bg===0},last:function(bi,bh,bg,bj){return bh===bj.length-1},even:function(bh,bg){return bg%2===0},odd:function(bh,bg){return bg%2===1},lt:function(bi,bh,bg){return bh<bg[3]-0},gt:function(bi,bh,bg){return bh>bg[3]-0},nth:function(bi,bh,bg){return bg[3]-0===bh},eq:function(bi,bh,bg){return bg[3]-0===bh}},filter:{PSEUDO:function(bm,bi,bj,bn){var bh=bi[1],bk=a6.filters[bh];if(bk){return bk(bm,bj,bi,bn)}else{if(bh==="contains"){return(bm.textContent||bm.innerText||aZ([bm])||"").indexOf(bi[3])>=0}else{if(bh==="not"){var bl=bi[3];for(var bj=0,bg=bl.length;bj<bg;bj++){if(bl[bj]===bm){return false}}return true}else{a0.error("Syntax error, unrecognized expression: "+bh)}}}},CHILD:function(bg,bj){var bm=bj[1],bh=bg;switch(bm){case"only":case"first":while((bh=bh.previousSibling)){if(bh.nodeType===1){return false}}if(bm==="first"){return true}bh=bg;case"last":while((bh=bh.nextSibling)){if(bh.nodeType===1){return false}}return true;case"nth":var bi=bj[2],bp=bj[3];if(bi===1&&bp===0){return true}var bl=bj[0],bo=bg.parentNode;if(bo&&(bo.sizcache!==bl||!bg.nodeIndex)){var bk=0;for(bh=bo.firstChild;bh;bh=bh.nextSibling){if(bh.nodeType===1){bh.nodeIndex=++bk}}bo.sizcache=bl}var bn=bg.nodeIndex-bp;if(bi===0){return bn===0}else{return(bn%bi===0&&bn/bi>=0)}}},ID:function(bh,bg){return bh.nodeType===1&&bh.getAttribute("id")===bg},TAG:function(bh,bg){return(bg==="*"&&bh.nodeType===1)||bh.nodeName.toLowerCase()===bg},CLASS:function(bh,bg){return(" "+(bh.className||bh.getAttribute("class"))+" ").indexOf(bg)>-1},ATTR:function(bl,bj){var bi=bj[1],bg=a6.attrHandle[bi]?a6.attrHandle[bi](bl):bl[bi]!=null?bl[bi]:bl.getAttribute(bi),bm=bg+"",bk=bj[2],bh=bj[4];return bg==null?bk==="!=":bk==="="?bm===bh:bk==="*="?bm.indexOf(bh)>=0:bk==="~="?(" "+bm+" ").indexOf(bh)>=0:!bh?bm&&bg!==false:bk==="!="?bm!==bh:bk==="^="?bm.indexOf(bh)===0:bk==="$="?bm.substr(bm.length-bh.length)===bh:bk==="|="?bm===bh||bm.substr(0,bh.length+1)===bh+"-":false},POS:function(bk,bh,bi,bl){var bg=bh[2],bj=a6.setFilters[bg];if(bj){return bj(bk,bi,bh,bl)}}}};var a5=a6.match.POS;for(var a2 in a6.match){a6.match[a2]=new RegExp(a6.match[a2].source+/(?![^\[]*\])(?![^\(]*\))/.source);a6.leftMatch[a2]=new RegExp(/(^(?:.|\r|\n)*?)/.source+a6.match[a2].source.replace(/\\(\d+)/g,function(bh,bg){return"\\"+(bg-0+1)}))}var a8=function(bh,bg){bh=Array.prototype.slice.call(bh,0);if(bg){bg.push.apply(bg,bh);return bg}return bh};try{Array.prototype.slice.call(ab.documentElement.childNodes,0)[0].nodeType}catch(bf){a8=function(bk,bj){var bh=bj||[];if(bc.call(bk)==="[object Array]"){Array.prototype.push.apply(bh,bk)}else{if(typeof bk.length==="number"){for(var bi=0,bg=bk.length;bi<bg;bi++){bh.push(bk[bi])}}else{for(var bi=0;bk[bi];bi++){bh.push(bk[bi])}}}return bh}}var bb;if(ab.documentElement.compareDocumentPosition){bb=function(bh,bg){if(!bh.compareDocumentPosition||!bg.compareDocumentPosition){if(bh==bg){a4=true}return bh.compareDocumentPosition?-1:1}var bi=bh.compareDocumentPosition(bg)&4?-1:bh===bg?0:1;if(bi===0){a4=true}return bi}}else{if("sourceIndex" in ab.documentElement){bb=function(bh,bg){if(!bh.sourceIndex||!bg.sourceIndex){if(bh==bg){a4=true}return bh.sourceIndex?-1:1}var bi=bh.sourceIndex-bg.sourceIndex;if(bi===0){a4=true}return bi}}else{if(ab.createRange){bb=function(bj,bh){if(!bj.ownerDocument||!bh.ownerDocument){if(bj==bh){a4=true}return bj.ownerDocument?-1:1}var bi=bj.ownerDocument.createRange(),bg=bh.ownerDocument.createRange();bi.setStart(bj,0);bi.setEnd(bj,0);bg.setStart(bh,0);bg.setEnd(bh,0);var bk=bi.compareBoundaryPoints(Range.START_TO_END,bg);if(bk===0){a4=true}return bk}}}}function aZ(bg){var bh="",bj;for(var bi=0;bg[bi];bi++){bj=bg[bi];if(bj.nodeType===3||bj.nodeType===4){bh+=bj.nodeValue}else{if(bj.nodeType!==8){bh+=aZ(bj.childNodes)}}}return bh}(function(){var bh=ab.createElement("div"),bi="script"+(new Date).getTime();bh.innerHTML="<a name='"+bi+"'/>";var bg=ab.documentElement;bg.insertBefore(bh,bg.firstChild);if(ab.getElementById(bi)){a6.find.ID=function(bk,bl,bm){if(typeof bl.getElementById!=="undefined"&&!bm){var bj=bl.getElementById(bk[1]);return bj?bj.id===bk[1]||typeof bj.getAttributeNode!=="undefined"&&bj.getAttributeNode("id").nodeValue===bk[1]?[bj]:C:[]}};a6.filter.ID=function(bl,bj){var bk=typeof bl.getAttributeNode!=="undefined"&&bl.getAttributeNode("id");return bl.nodeType===1&&bk&&bk.nodeValue===bj}}bg.removeChild(bh);bg=bh=null})();(function(){var bg=ab.createElement("div");bg.appendChild(ab.createComment(""));if(bg.getElementsByTagName("*").length>0){a6.find.TAG=function(bh,bl){var bk=bl.getElementsByTagName(bh[1]);if(bh[1]==="*"){var bj=[];for(var bi=0;bk[bi];bi++){if(bk[bi].nodeType===1){bj.push(bk[bi])}}bk=bj}return bk}}bg.innerHTML="<a href='#'></a>";if(bg.firstChild&&typeof bg.firstChild.getAttribute!=="undefined"&&bg.firstChild.getAttribute("href")!=="#"){a6.attrHandle.href=function(bh){return bh.getAttribute("href",2)}}bg=null})();if(ab.querySelectorAll){(function(){var bg=a0,bi=ab.createElement("div");bi.innerHTML="<p class='TEST'></p>";if(bi.querySelectorAll&&bi.querySelectorAll(".TEST").length===0){return}a0=function(bm,bl,bj,bk){bl=bl||ab;if(!bk&&bl.nodeType===9&&!a1(bl)){try{return a8(bl.querySelectorAll(bm),bj)}catch(bn){}}return bg(bm,bl,bj,bk)};for(var bh in bg){a0[bh]=bg[bh]}bi=null})()}(function(){var bg=ab.createElement("div");bg.innerHTML="<div class='test e'></div><div class='test'></div>";if(!bg.getElementsByClassName||bg.getElementsByClassName("e").length===0){return}bg.lastChild.className="e";if(bg.getElementsByClassName("e").length===1){return}a6.order.splice(1,0,"CLASS");a6.find.CLASS=function(bh,bi,bj){if(typeof bi.getElementsByClassName!=="undefined"&&!bj){return bi.getElementsByClassName(bh[1])}};bg=null})();function aY(bh,bm,bl,bp,bn,bo){for(var bj=0,bi=bp.length;bj<bi;bj++){var bg=bp[bj];if(bg){bg=bg[bh];var bk=false;while(bg){if(bg.sizcache===bl){bk=bp[bg.sizset];break}if(bg.nodeType===1&&!bo){bg.sizcache=bl;bg.sizset=bj}if(bg.nodeName.toLowerCase()===bm){bk=bg;break}bg=bg[bh]}bp[bj]=bk}}}function be(bh,bm,bl,bp,bn,bo){for(var bj=0,bi=bp.length;bj<bi;bj++){var bg=bp[bj];if(bg){bg=bg[bh];var bk=false;while(bg){if(bg.sizcache===bl){bk=bp[bg.sizset];break}if(bg.nodeType===1){if(!bo){bg.sizcache=bl;bg.sizset=bj}if(typeof bm!=="string"){if(bg===bm){bk=true;break}}else{if(a0.filter(bm,[bg]).length>0){bk=bg;break}}}bg=bg[bh]}bp[bj]=bk}}}var a7=ab.compareDocumentPosition?function(bh,bg){return !!(bh.compareDocumentPosition(bg)&16)}:function(bh,bg){return bh!==bg&&(bh.contains?bh.contains(bg):true)};var a1=function(bg){var bh=(bg?bg.ownerDocument||bg:0).documentElement;return bh?bh.nodeName!=="HTML":false};var bd=function(bg,bn){var bj=[],bk="",bl,bi=bn.nodeType?[bn]:bn;while((bl=a6.match.PSEUDO.exec(bg))){bk+=bl[0];bg=bg.replace(a6.match.PSEUDO,"")}bg=a6.relative[bg]?bg+"*":bg;for(var bm=0,bh=bi.length;bm<bh;bm++){a0(bg,bi[bm],bj)}return a0.filter(bk,bj)};a.find=a0;a.expr=a0.selectors;a.expr[":"]=a.expr.filters;a.unique=a0.uniqueSort;a.text=aZ;a.isXMLDoc=a1;a.contains=a7;return;aM.Sizzle=a0})();var N=/Until$/,Y=/^(?:parents|prevUntil|prevAll)/,aL=/,/,F=Array.prototype.slice;var ai=function(a1,a0,aY){if(a.isFunction(a0)){return a.grep(a1,function(a3,a2){return !!a0.call(a3,a2,a3)===aY})}else{if(a0.nodeType){return a.grep(a1,function(a3,a2){return(a3===a0)===aY})}else{if(typeof a0==="string"){var aZ=a.grep(a1,function(a2){return a2.nodeType===1});if(aW.test(a0)){return a.filter(a0,aZ,!aY)}else{a0=a.filter(a0,aZ)}}}}return a.grep(a1,function(a3,a2){return(a.inArray(a3,a0)>=0)===aY})};a.fn.extend({find:function(aY){var a0=this.pushStack("","find",aY),a3=0;for(var a1=0,aZ=this.length;a1<aZ;a1++){a3=a0.length;a.find(aY,this[a1],a0);if(a1>0){for(var a4=a3;a4<a0.length;a4++){for(var a2=0;a2<a3;a2++){if(a0[a2]===a0[a4]){a0.splice(a4--,1);break}}}}}return a0},has:function(aZ){var aY=a(aZ);return this.filter(function(){for(var a1=0,a0=aY.length;a1<a0;a1++){if(a.contains(this,aY[a1])){return true}}})},not:function(aY){return this.pushStack(ai(this,aY,false),"not",aY)},filter:function(aY){return this.pushStack(ai(this,aY,true),"filter",aY)},is:function(aY){return !!aY&&a.filter(aY,this).length>0},closest:function(a7,aY){if(a.isArray(a7)){var a4=[],a6=this[0],a3,a2={},a0;if(a6&&a7.length){for(var a1=0,aZ=a7.length;a1<aZ;a1++){a0=a7[a1];if(!a2[a0]){a2[a0]=a.expr.match.POS.test(a0)?a(a0,aY||this.context):a0}}while(a6&&a6.ownerDocument&&a6!==aY){for(a0 in a2){a3=a2[a0];if(a3.jquery?a3.index(a6)>-1:a(a6).is(a3)){a4.push({selector:a0,elem:a6});delete a2[a0]}}a6=a6.parentNode}}return a4}var a5=a.expr.match.POS.test(a7)?a(a7,aY||this.context):null;return this.map(function(a8,a9){while(a9&&a9.ownerDocument&&a9!==aY){if(a5?a5.index(a9)>-1:a(a9).is(a7)){return a9}a9=a9.parentNode}return null})},index:function(aY){if(!aY||typeof aY==="string"){return a.inArray(this[0],aY?a(aY):this.parent().children())}return a.inArray(aY.jquery?aY[0]:aY,this)},add:function(aY,aZ){var a1=typeof aY==="string"?a(aY,aZ||this.context):a.makeArray(aY),a0=a.merge(this.get(),a1);return this.pushStack(y(a1[0])||y(a0[0])?a0:a.unique(a0))},andSelf:function(){return this.add(this.prevObject)}});function y(aY){return !aY||!aY.parentNode||aY.parentNode.nodeType===11}a.each({parent:function(aZ){var aY=aZ.parentNode;return aY&&aY.nodeType!==11?aY:null},parents:function(aY){return a.dir(aY,"parentNode")},parentsUntil:function(aZ,aY,a0){return a.dir(aZ,"parentNode",a0)},next:function(aY){return a.nth(aY,2,"nextSibling")},prev:function(aY){return a.nth(aY,2,"previousSibling")},nextAll:function(aY){return a.dir(aY,"nextSibling")},prevAll:function(aY){return a.dir(aY,"previousSibling")},nextUntil:function(aZ,aY,a0){return a.dir(aZ,"nextSibling",a0)},prevUntil:function(aZ,aY,a0){return a.dir(aZ,"previousSibling",a0)},siblings:function(aY){return a.sibling(aY.parentNode.firstChild,aY)},children:function(aY){return a.sibling(aY.firstChild)},contents:function(aY){return a.nodeName(aY,"iframe")?aY.contentDocument||aY.contentWindow.document:a.makeArray(aY.childNodes)}},function(aY,aZ){a.fn[aY]=function(a2,a0){var a1=a.map(this,aZ,a2);if(!N.test(aY)){a0=a2}if(a0&&typeof a0==="string"){a1=a.filter(a0,a1)}a1=this.length>1?a.unique(a1):a1;if((this.length>1||aL.test(a0))&&Y.test(aY)){a1=a1.reverse()}return this.pushStack(a1,aY,F.call(arguments).join(","))}});a.extend({filter:function(a0,aY,aZ){if(aZ){a0=":not("+a0+")"}return a.find.matches(a0,aY)},dir:function(a0,aZ,a2){var aY=[],a1=a0[aZ];while(a1&&a1.nodeType!==9&&(a2===C||a1.nodeType!==1||!a(a1).is(a2))){if(a1.nodeType===1){aY.push(a1)}a1=a1[aZ]}return aY},nth:function(a2,aY,a0,a1){aY=aY||1;var aZ=0;for(;a2;a2=a2[a0]){if(a2.nodeType===1&&++aZ===aY){break}}return a2},sibling:function(a0,aZ){var aY=[];for(;a0;a0=a0.nextSibling){if(a0.nodeType===1&&a0!==aZ){aY.push(a0)}}return aY}});var T=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,H=/(<([\w:]+)[^>]*?)\/>/g,al=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,c=/<([\w:]+)/,t=/<tbody/i,L=/<|&#?\w+;/,E=/<script|<object|<embed|<option|<style/i,l=/checked\s*(?:[^=]|=\s*.checked.)/i,p=function(aZ,a0,aY){return al.test(aY)?aZ:a0+"></"+aY+">"},ac={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};ac.optgroup=ac.option;ac.tbody=ac.tfoot=ac.colgroup=ac.caption=ac.thead;ac.th=ac.td;if(!a.support.htmlSerialize){ac._default=[1,"div<div>","</div>"]}a.fn.extend({text:function(aY){if(a.isFunction(aY)){return this.each(function(a0){var aZ=a(this);aZ.text(aY.call(this,a0,aZ.text()))})}if(typeof aY!=="object"&&aY!==C){return this.empty().append((this[0]&&this[0].ownerDocument||ab).createTextNode(aY))}return a.text(this)},wrapAll:function(aY){if(a.isFunction(aY)){return this.each(function(a0){a(this).wrapAll(aY.call(this,a0))})}if(this[0]){var aZ=a(aY,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){aZ.insertBefore(this[0])}aZ.map(function(){var a0=this;while(a0.firstChild&&a0.firstChild.nodeType===1){a0=a0.firstChild}return a0}).append(this)}return this},wrapInner:function(aY){if(a.isFunction(aY)){return this.each(function(aZ){a(this).wrapInner(aY.call(this,aZ))})}return this.each(function(){var aZ=a(this),a0=aZ.contents();if(a0.length){a0.wrapAll(aY)}else{aZ.append(aY)}})},wrap:function(aY){return this.each(function(){a(this).wrapAll(aY)})},unwrap:function(){return this.parent().each(function(){if(!a.nodeName(this,"body")){a(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(aY){if(this.nodeType===1){this.appendChild(aY)}})},prepend:function(){return this.domManip(arguments,true,function(aY){if(this.nodeType===1){this.insertBefore(aY,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aZ){this.parentNode.insertBefore(aZ,this)})}else{if(arguments.length){var aY=a(arguments[0]);aY.push.apply(aY,this.toArray());return this.pushStack(aY,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(aZ){this.parentNode.insertBefore(aZ,this.nextSibling)})}else{if(arguments.length){var aY=this.pushStack(this,"after",arguments);aY.push.apply(aY,a(arguments[0]).toArray());return aY}}},remove:function(aY,a1){for(var aZ=0,a0;(a0=this[aZ])!=null;aZ++){if(!aY||a.filter(aY,[a0]).length){if(!a1&&a0.nodeType===1){a.cleanData(a0.getElementsByTagName("*"));a.cleanData([a0])}if(a0.parentNode){a0.parentNode.removeChild(a0)}}}return this},empty:function(){for(var aY=0,aZ;(aZ=this[aY])!=null;aY++){if(aZ.nodeType===1){a.cleanData(aZ.getElementsByTagName("*"))}while(aZ.firstChild){aZ.removeChild(aZ.firstChild)}}return this},clone:function(aZ){var aY=this.map(function(){if(!a.support.noCloneEvent&&!a.isXMLDoc(this)){var a1=this.outerHTML,a0=this.ownerDocument;if(!a1){var a2=a0.createElement("div");a2.appendChild(this.cloneNode(true));a1=a2.innerHTML}return a.clean([a1.replace(T,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Z,"")],a0)[0]}else{return this.cloneNode(true)}});if(aZ===true){q(this,aY);q(this.find("*"),aY.find("*"))}return aY},html:function(a0){if(a0===C){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(T,""):null}else{if(typeof a0==="string"&&!E.test(a0)&&(a.support.leadingWhitespace||!Z.test(a0))&&!ac[(c.exec(a0)||["",""])[1].toLowerCase()]){a0=a0.replace(H,p);try{for(var aZ=0,aY=this.length;aZ<aY;aZ++){if(this[aZ].nodeType===1){a.cleanData(this[aZ].getElementsByTagName("*"));this[aZ].innerHTML=a0}}}catch(a1){this.empty().append(a0)}}else{if(a.isFunction(a0)){this.each(function(a4){var a3=a(this),a2=a3.html();a3.empty().append(function(){return a0.call(this,a4,a2)})})}else{this.empty().append(a0)}}}return this},replaceWith:function(aY){if(this[0]&&this[0].parentNode){if(a.isFunction(aY)){return this.each(function(a1){var a0=a(this),aZ=a0.html();a0.replaceWith(aY.call(this,a1,aZ))})}if(typeof aY!=="string"){aY=a(aY).detach()}return this.each(function(){var a0=this.nextSibling,aZ=this.parentNode;a(this).remove();if(a0){a(a0).before(aY)}else{a(aZ).append(aY)}})}else{return this.pushStack(a(a.isFunction(aY)?aY():aY),"replaceWith",aY)}},detach:function(aY){return this.remove(aY,true)},domManip:function(a4,a9,a8){var a1,a2,a7=a4[0],aZ=[],a3,a6;if(!a.support.checkClone&&arguments.length===3&&typeof a7==="string"&&l.test(a7)){return this.each(function(){a(this).domManip(a4,a9,a8,true)})}if(a.isFunction(a7)){return this.each(function(bb){var ba=a(this);a4[0]=a7.call(this,bb,a9?ba.html():C);ba.domManip(a4,a9,a8)})}if(this[0]){a6=a7&&a7.parentNode;if(a.support.parentNode&&a6&&a6.nodeType===11&&a6.childNodes.length===this.length){a1={fragment:a6}}else{a1=J(a4,this,aZ)}a3=a1.fragment;if(a3.childNodes.length===1){a2=a3=a3.firstChild}else{a2=a3.firstChild}if(a2){a9=a9&&a.nodeName(a2,"tr");for(var a0=0,aY=this.length;a0<aY;a0++){a8.call(a9?a5(this[a0],a2):this[a0],a0>0||a1.cacheable||this.length>1?a3.cloneNode(true):a3)}}if(aZ.length){a.each(aZ,aV)}}return this;function a5(ba,bb){return a.nodeName(ba,"table")?(ba.getElementsByTagName("tbody")[0]||ba.appendChild(ba.ownerDocument.createElement("tbody"))):ba}}});function q(a0,aY){var aZ=0;aY.each(function(){if(this.nodeName!==(a0[aZ]&&a0[aZ].nodeName)){return}var a5=a.data(a0[aZ++]),a4=a.data(this,a5),a1=a5&&a5.events;if(a1){delete a4.handle;a4.events={};for(var a3 in a1){for(var a2 in a1[a3]){a.event.add(this,a3,a1[a3][a2],a1[a3][a2].data)}}}})}function J(a3,a1,aZ){var a2,aY,a0,a4=(a1&&a1[0]?a1[0].ownerDocument||a1[0]:ab);if(a3.length===1&&typeof a3[0]==="string"&&a3[0].length<512&&a4===ab&&!E.test(a3[0])&&(a.support.checkClone||!l.test(a3[0]))){aY=true;a0=a.fragments[a3[0]];if(a0){if(a0!==1){a2=a0}}}if(!a2){a2=a4.createDocumentFragment();a.clean(a3,a4,a2,aZ)}if(aY){a.fragments[a3[0]]=a0?a2:1}return{fragment:a2,cacheable:aY}}a.fragments={};a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(aY,aZ){a.fn[aY]=function(a0){var a3=[],a6=a(a0),a5=this.length===1&&this[0].parentNode;if(a5&&a5.nodeType===11&&a5.childNodes.length===1&&a6.length===1){a6[aZ](this[0]);return this}else{for(var a4=0,a1=a6.length;a4<a1;a4++){var a2=(a4>0?this.clone(true):this).get();a.fn[aZ].apply(a(a6[a4]),a2);a3=a3.concat(a2)}return this.pushStack(a3,aY,a6.selector)}}});a.extend({clean:function(a0,a2,a9,a4){a2=a2||ab;if(typeof a2.createElement==="undefined"){a2=a2.ownerDocument||a2[0]&&a2[0].ownerDocument||ab}var ba=[];for(var a8=0,a3;(a3=a0[a8])!=null;a8++){if(typeof a3==="number"){a3+=""}if(!a3){continue}if(typeof a3==="string"&&!L.test(a3)){a3=a2.createTextNode(a3)}else{if(typeof a3==="string"){a3=a3.replace(H,p);var bb=(c.exec(a3)||["",""])[1].toLowerCase(),a1=ac[bb]||ac._default,a7=a1[0],aZ=a2.createElement("div");aZ.innerHTML=a1[1]+a3+a1[2];while(a7--){aZ=aZ.lastChild}if(!a.support.tbody){var aY=t.test(a3),a6=bb==="table"&&!aY?aZ.firstChild&&aZ.firstChild.childNodes:a1[1]==="<table>"&&!aY?aZ.childNodes:[];for(var a5=a6.length-1;a5>=0;--a5){if(a.nodeName(a6[a5],"tbody")&&!a6[a5].childNodes.length){a6[a5].parentNode.removeChild(a6[a5])}}}if(!a.support.leadingWhitespace&&Z.test(a3)){aZ.insertBefore(a2.createTextNode(Z.exec(a3)[0]),aZ.firstChild)}a3=aZ.childNodes}}if(a3.nodeType){ba.push(a3)}else{ba=a.merge(ba,a3)}}if(a9){for(var a8=0;ba[a8];a8++){if(a4&&a.nodeName(ba[a8],"script")&&(!ba[a8].type||ba[a8].type.toLowerCase()==="text/javascript")){a4.push(ba[a8].parentNode?ba[a8].parentNode.removeChild(ba[a8]):ba[a8])}else{if(ba[a8].nodeType===1){ba.splice.apply(ba,[a8+1,0].concat(a.makeArray(ba[a8].getElementsByTagName("script"))))}a9.appendChild(ba[a8])}}}return ba},cleanData:function(aZ){var a2,a0,aY=a.cache,a5=a.event.special,a4=a.support.deleteExpando;for(var a3=0,a1;(a1=aZ[a3])!=null;a3++){a0=a1[a.expando];if(a0){a2=aY[a0];if(a2.events){for(var a6 in a2.events){if(a5[a6]){a.event.remove(a1,a6)}else{ag(a1,a6,a2.handle)}}}if(a4){delete a1[a.expando]}else{if(a1.removeAttribute){a1.removeAttribute(a.expando)}}delete aY[a0]}}}});var ar=/z-?index|font-?weight|opacity|zoom|line-?height/i,U=/alpha\([^)]*\)/,aa=/opacity=([^)]*)/,ah=/float/i,az=/-([a-z])/ig,v=/([A-Z])/g,aO=/^-?\d+(?:px)?$/i,aU=/^-?\d/,aK={position:"absolute",visibility:"hidden",display:"block"},W=["Left","Right"],aE=["Top","Bottom"],ak=ab.defaultView&&ab.defaultView.getComputedStyle,aN=a.support.cssFloat?"cssFloat":"styleFloat",k=function(aY,aZ){return aZ.toUpperCase()};a.fn.css=function(aY,aZ){return an(this,aY,aZ,true,function(a1,a0,a2){if(a2===C){return a.curCSS(a1,a0)}if(typeof a2==="number"&&!ar.test(a0)){a2+="px"}a.style(a1,a0,a2)})};a.extend({style:function(a2,aZ,a3){if(!a2||a2.nodeType===3||a2.nodeType===8){return C}if((aZ==="width"||aZ==="height")&&parseFloat(a3)<0){a3=C}var a1=a2.style||a2,a4=a3!==C;if(!a.support.opacity&&aZ==="opacity"){if(a4){a1.zoom=1;var aY=parseInt(a3,10)+""==="NaN"?"":"alpha(opacity="+a3*100+")";var a0=a1.filter||a.curCSS(a2,"filter")||"";a1.filter=U.test(a0)?a0.replace(U,aY):aY}return a1.filter&&a1.filter.indexOf("opacity=")>=0?(parseFloat(aa.exec(a1.filter)[1])/100)+"":""}if(ah.test(aZ)){aZ=aN}aZ=aZ.replace(az,k);if(a4){a1[aZ]=a3}return a1[aZ]},css:function(a1,aZ,a3,aY){if(aZ==="width"||aZ==="height"){var a5,a0=aK,a4=aZ==="width"?W:aE;function a2(){a5=aZ==="width"?a1.offsetWidth:a1.offsetHeight;if(aY==="border"){return}a.each(a4,function(){if(!aY){a5-=parseFloat(a.curCSS(a1,"padding"+this,true))||0}if(aY==="margin"){a5+=parseFloat(a.curCSS(a1,"margin"+this,true))||0}else{a5-=parseFloat(a.curCSS(a1,"border"+this+"Width",true))||0}})}if(a1.offsetWidth!==0){a2()}else{a.swap(a1,a0,a2)}return Math.max(0,Math.round(a5))}return a.curCSS(a1,aZ,a3)},curCSS:function(a4,aZ,a0){var a7,aY=a4.style,a1;if(!a.support.opacity&&aZ==="opacity"&&a4.currentStyle){a7=aa.test(a4.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return a7===""?"1":a7}if(ah.test(aZ)){aZ=aN}if(!a0&&aY&&aY[aZ]){a7=aY[aZ]}else{if(ak){if(ah.test(aZ)){aZ="float"}aZ=aZ.replace(v,"-$1").toLowerCase();var a6=a4.ownerDocument.defaultView;if(!a6){return null}var a8=a6.getComputedStyle(a4,null);if(a8){a7=a8.getPropertyValue(aZ)}if(aZ==="opacity"&&a7===""){a7="1"}}else{if(a4.currentStyle){var a3=aZ.replace(az,k);a7=a4.currentStyle[aZ]||a4.currentStyle[a3];if(!aO.test(a7)&&aU.test(a7)){var a2=aY.left,a5=a4.runtimeStyle.left;a4.runtimeStyle.left=a4.currentStyle.left;aY.left=a3==="fontSize"?"1em":(a7||0);a7=aY.pixelLeft+"px";aY.left=a2;a4.runtimeStyle.left=a5}}}}return a7},swap:function(a1,a0,a2){var aY={};for(var aZ in a0){aY[aZ]=a1.style[aZ];a1.style[aZ]=a0[aZ]}a2.call(a1);for(var aZ in a0){a1.style[aZ]=aY[aZ]}}});if(a.expr&&a.expr.filters){a.expr.filters.hidden=function(a1){var aZ=a1.offsetWidth,aY=a1.offsetHeight,a0=a1.nodeName.toLowerCase()==="tr";return aZ===0&&aY===0&&!a0?true:aZ>0&&aY>0&&!a0?false:a.curCSS(a1,"display")==="none"};a.expr.filters.visible=function(aY){return !a.expr.filters.hidden(aY)}}var af=aP(),aJ=/<script(.|\s)*?\/script>/gi,o=/select|textarea/i,aB=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,r=/=\?(&|$)/,D=/\?/,aX=/(\?|&)_=.*?(&|$)/,B=/^(\w+:)?\/\/([^\/?#]+)/,h=/%20/g,w=a.fn.load;a.fn.extend({load:function(a0,a3,a4){if(typeof a0!=="string"){return w.call(this,a0)}else{if(!this.length){return this}}var a2=a0.indexOf(" ");if(a2>=0){var aY=a0.slice(a2,a0.length);a0=a0.slice(0,a2)}var a1="GET";if(a3){if(a.isFunction(a3)){a4=a3;a3=null}else{if(typeof a3==="object"){a3=a.param(a3,a.ajaxSettings.traditional);a1="POST"}}}var aZ=this;a.ajax({url:a0,type:a1,dataType:"html",data:a3,complete:function(a6,a5){if(a5==="success"||a5==="notmodified"){aZ.html(aY?a("<div />").append(a6.responseText.replace(aJ,"")).find(aY):a6.responseText)}if(a4){aZ.each(a4,[a6.responseText,a5,a6])}}});return this},serialize:function(){return a.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?a.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||o.test(this.nodeName)||aB.test(this.type))}).map(function(aY,aZ){var a0=a(this).val();return a0==null?null:a.isArray(a0)?a.map(a0,function(a2,a1){return{name:aZ.name,value:a2}}):{name:aZ.name,value:a0}}).get()}});a.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(aY,aZ){a.fn[aZ]=function(a0){return this.bind(aZ,a0)}});a.extend({get:function(aY,a0,a1,aZ){if(a.isFunction(a0)){aZ=aZ||a1;a1=a0;a0=null}return a.ajax({type:"GET",url:aY,data:a0,success:a1,dataType:aZ})},getScript:function(aY,aZ){return a.get(aY,null,aZ,"script")},getJSON:function(aY,aZ,a0){return a.get(aY,aZ,a0,"json")},post:function(aY,a0,a1,aZ){if(a.isFunction(a0)){aZ=aZ||a1;a1=a0;a0={}}return a.ajax({type:"POST",url:aY,data:a0,success:a1,dataType:aZ})},ajaxSetup:function(aY){a.extend(a.ajaxSettings,aY)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:aM.XMLHttpRequest&&(aM.location.protocol!=="file:"||!aM.ActiveXObject)?function(){return new aM.XMLHttpRequest()}:function(){try{return new aM.ActiveXObject("Microsoft.XMLHTTP")}catch(aY){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(bd){var a8=a.extend(true,{},a.ajaxSettings,bd);var bi,bc,bh,bj=bd&&bd.context||a8,a0=a8.type.toUpperCase();if(a8.data&&a8.processData&&typeof a8.data!=="string"){a8.data=a.param(a8.data,a8.traditional)}if(a8.dataType==="jsonp"){if(a0==="GET"){if(!r.test(a8.url)){a8.url+=(D.test(a8.url)?"&":"?")+(a8.jsonp||"callback")+"=?"}}else{if(!a8.data||!r.test(a8.data)){a8.data=(a8.data?a8.data+"&":"")+(a8.jsonp||"callback")+"=?"}}a8.dataType="json"}if(a8.dataType==="json"&&(a8.data&&r.test(a8.data)||r.test(a8.url))){bi=a8.jsonpCallback||("jsonp"+af++);if(a8.data){a8.data=(a8.data+"").replace(r,"="+bi+"$1")}a8.url=a8.url.replace(r,"="+bi+"$1");a8.dataType="script";aM[bi]=aM[bi]||function(bk){bh=bk;a3();a6();aM[bi]=C;try{delete aM[bi]}catch(bl){}if(a1){a1.removeChild(bf)}}}if(a8.dataType==="script"&&a8.cache===null){a8.cache=false}if(a8.cache===false&&a0==="GET"){var aY=aP();var bg=a8.url.replace(aX,"$1_="+aY+"$2");a8.url=bg+((bg===a8.url)?(D.test(a8.url)?"&":"?")+"_="+aY:"")}if(a8.data&&a0==="GET"){a8.url+=(D.test(a8.url)?"&":"?")+a8.data}if(a8.global&&!a.active++){a.event.trigger("ajaxStart")}var bb=B.exec(a8.url),a2=bb&&(bb[1]&&bb[1]!==location.protocol||bb[2]!==location.host);if(a8.dataType==="script"&&a0==="GET"&&a2){var a1=ab.getElementsByTagName("head")[0]||ab.documentElement;var bf=ab.createElement("script");bf.src=a8.url;if(a8.scriptCharset){bf.charset=a8.scriptCharset}if(!bi){var ba=false;bf.onload=bf.onreadystatechange=function(){if(!ba&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){ba=true;a3();a6();bf.onload=bf.onreadystatechange=null;if(a1&&bf.parentNode){a1.removeChild(bf)}}}}a1.insertBefore(bf,a1.firstChild);return C}var a5=false;var a4=a8.xhr();if(!a4){return}if(a8.username){a4.open(a0,a8.url,a8.async,a8.username,a8.password)}else{a4.open(a0,a8.url,a8.async)}try{if(a8.data||bd&&bd.contentType){a4.setRequestHeader("Content-Type",a8.contentType)}if(a8.ifModified){if(a.lastModified[a8.url]){a4.setRequestHeader("If-Modified-Since",a.lastModified[a8.url])}if(a.etag[a8.url]){a4.setRequestHeader("If-None-Match",a.etag[a8.url])}}if(!a2){a4.setRequestHeader("X-Requested-With","XMLHttpRequest")}a4.setRequestHeader("Accept",a8.dataType&&a8.accepts[a8.dataType]?a8.accepts[a8.dataType]+", */*":a8.accepts._default)}catch(be){}if(a8.beforeSend&&a8.beforeSend.call(bj,a4,a8)===false){if(a8.global&&!--a.active){a.event.trigger("ajaxStop")}a4.abort();return false}if(a8.global){a9("ajaxSend",[a4,a8])}var a7=a4.onreadystatechange=function(bk){if(!a4||a4.readyState===0||bk==="abort"){if(!a5){a6()}a5=true;if(a4){a4.onreadystatechange=a.noop}}else{if(!a5&&a4&&(a4.readyState===4||bk==="timeout")){a5=true;a4.onreadystatechange=a.noop;bc=bk==="timeout"?"timeout":!a.httpSuccess(a4)?"error":a8.ifModified&&a.httpNotModified(a4,a8.url)?"notmodified":"success";var bm;if(bc==="success"){try{bh=a.httpData(a4,a8.dataType,a8)}catch(bl){bc="parsererror";bm=bl}}if(bc==="success"||bc==="notmodified"){if(!bi){a3()}}else{a.handleError(a8,a4,bc,bm)}a6();if(bk==="timeout"){a4.abort()}if(a8.async){a4=null}}}};try{var aZ=a4.abort;a4.abort=function(){if(a4){aZ.call(a4)}a7("abort")}}catch(be){}if(a8.async&&a8.timeout>0){setTimeout(function(){if(a4&&!a5){a7("timeout")}},a8.timeout)}try{a4.send(a0==="POST"||a0==="PUT"||a0==="DELETE"?a8.data:null)}catch(be){a.handleError(a8,a4,null,be);a6()}if(!a8.async){a7()}function a3(){if(a8.success){a8.success.call(bj,bh,bc,a4)}if(a8.global){a9("ajaxSuccess",[a4,a8])}}function a6(){if(a8.complete){a8.complete.call(bj,a4,bc)}if(a8.global){a9("ajaxComplete",[a4,a8])}if(a8.global&&!--a.active){a.event.trigger("ajaxStop")}}function a9(bl,bk){(a8.context?a(a8.context):a.event).trigger(bl,bk)}return a4},handleError:function(aZ,a1,aY,a0){if(aZ.error){aZ.error.call(aZ.context||aZ,a1,aY,a0)}if(aZ.global){(aZ.context?a(aZ.context):a.event).trigger("ajaxError",[a1,aZ,a0])}},active:0,httpSuccess:function(aZ){try{return !aZ.status&&location.protocol==="file:"||(aZ.status>=200&&aZ.status<300)||aZ.status===304||aZ.status===1223||aZ.status===0}catch(aY){}return false},httpNotModified:function(a1,aY){var a0=a1.getResponseHeader("Last-Modified"),aZ=a1.getResponseHeader("Etag");if(a0){a.lastModified[aY]=a0}if(aZ){a.etag[aY]=aZ}return a1.status===304||a1.status===0},httpData:function(a3,a1,a0){var aZ=a3.getResponseHeader("content-type")||"",aY=a1==="xml"||!a1&&aZ.indexOf("xml")>=0,a2=aY?a3.responseXML:a3.responseText;if(aY&&a2.documentElement.nodeName==="parsererror"){a.error("parsererror")}if(a0&&a0.dataFilter){a2=a0.dataFilter(a2,a1)}if(typeof a2==="string"){if(a1==="json"||!a1&&aZ.indexOf("json")>=0){a2=a.parseJSON(a2)}else{if(a1==="script"||!a1&&aZ.indexOf("javascript")>=0){a.globalEval(a2)}}}return a2},param:function(aY,a1){var aZ=[];if(a1===C){a1=a.ajaxSettings.traditional}if(a.isArray(aY)||aY.jquery){a.each(aY,function(){a3(this.name,this.value)})}else{for(var a2 in aY){a0(a2,aY[a2])}}return aZ.join("&").replace(h,"+");function a0(a4,a5){if(a.isArray(a5)){a.each(a5,function(a7,a6){if(a1||/\[\]$/.test(a4)){a3(a4,a6)}else{a0(a4+"["+(typeof a6==="object"||a.isArray(a6)?a7:"")+"]",a6)}})}else{if(!a1&&a5!=null&&typeof a5==="object"){a.each(a5,function(a7,a6){a0(a4+"["+a7+"]",a6)})}else{a3(a4,a5)}}}function a3(a4,a5){a5=a.isFunction(a5)?a5():a5;aZ[aZ.length]=encodeURIComponent(a4)+"="+encodeURIComponent(a5)}}});var G={},ae=/toggle|show|hide/,au=/^([+-]=)?([\d+-.]+)(.*)$/,aF,aj=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];a.fn.extend({show:function(aZ,a7){if(aZ||aZ===0){return this.animate(aD("show",3),aZ,a7)}else{for(var a4=0,a1=this.length;a4<a1;a4++){var aY=a.data(this[a4],"olddisplay");this[a4].style.display=aY||"";if(a.css(this[a4],"display")==="none"){var a6=this[a4].nodeName,a5;if(G[a6]){a5=G[a6]}else{var a0=a("<"+a6+" />").appendTo("body");a5=a0.css("display");if(a5==="none"){a5="block"}a0.remove();G[a6]=a5}a.data(this[a4],"olddisplay",a5)}}for(var a3=0,a2=this.length;a3<a2;a3++){this[a3].style.display=a.data(this[a3],"olddisplay")||""}return this}},hide:function(a3,a4){if(a3||a3===0){return this.animate(aD("hide",3),a3,a4)}else{for(var a2=0,aZ=this.length;a2<aZ;a2++){var aY=a.data(this[a2],"olddisplay");if(!aY&&aY!=="none"){a.data(this[a2],"olddisplay",a.css(this[a2],"display"))}}for(var a1=0,a0=this.length;a1<a0;a1++){this[a1].style.display="none"}return this}},_toggle:a.fn.toggle,toggle:function(a0,aZ){var aY=typeof a0==="boolean";if(a.isFunction(a0)&&a.isFunction(aZ)){this._toggle.apply(this,arguments)}else{if(a0==null||aY){this.each(function(){var a1=aY?a0:a(this).is(":hidden");a(this)[a1?"show":"hide"]()})}else{this.animate(aD("toggle",3),a0,aZ)}}return this},fadeTo:function(aY,a0,aZ){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:a0},aY,aZ)},animate:function(a2,aZ,a1,a0){var aY=a.speed(aZ,a1,a0);if(a.isEmptyObject(a2)){return this.each(aY.complete)}return this[aY.queue===false?"each":"queue"](function(){var a5=a.extend({},aY),a7,a6=this.nodeType===1&&a(this).is(":hidden"),a3=this;for(a7 in a2){var a4=a7.replace(az,k);if(a7!==a4){a2[a4]=a2[a7];delete a2[a7];a7=a4}if(a2[a7]==="hide"&&a6||a2[a7]==="show"&&!a6){return a5.complete.call(this)}if((a7==="height"||a7==="width")&&this.style){a5.display=a.css(this,"display");a5.overflow=this.style.overflow}if(a.isArray(a2[a7])){(a5.specialEasing=a5.specialEasing||{})[a7]=a2[a7][1];a2[a7]=a2[a7][0]}}if(a5.overflow!=null){this.style.overflow="hidden"}a5.curAnim=a.extend({},a2);a.each(a2,function(a9,bd){var bc=new a.fx(a3,a5,a9);if(ae.test(bd)){bc[bd==="toggle"?a6?"show":"hide":bd](a2)}else{var bb=au.exec(bd),be=bc.cur(true)||0;if(bb){var a8=parseFloat(bb[2]),ba=bb[3]||"px";if(ba!=="px"){a3.style[a9]=(a8||1)+ba;be=((a8||1)/bc.cur(true))*be;a3.style[a9]=be+ba}if(bb[1]){a8=((bb[1]==="-="?-1:1)*a8)+be}bc.custom(be,a8,ba)}else{bc.custom(be,bd,"")}}});return true})},stop:function(aZ,aY){var a0=a.timers;if(aZ){this.queue([])}this.each(function(){for(var a1=a0.length-1;a1>=0;a1--){if(a0[a1].elem===this){if(aY){a0[a1](true)}a0.splice(a1,1)}}});if(!aY){this.dequeue()}return this}});a.each({slideDown:aD("show",1),slideUp:aD("hide",1),slideToggle:aD("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(aY,aZ){a.fn[aY]=function(a0,a1){return this.animate(aZ,a0,a1)}});a.extend({speed:function(a0,a1,aZ){var aY=a0&&typeof a0==="object"?a0:{complete:aZ||!aZ&&a1||a.isFunction(a0)&&a0,duration:a0,easing:aZ&&a1||a1&&!a.isFunction(a1)&&a1};aY.duration=a.fx.off?0:typeof aY.duration==="number"?aY.duration:a.fx.speeds[aY.duration]||a.fx.speeds._default;aY.old=aY.complete;aY.complete=function(){if(aY.queue!==false){a(this).dequeue()}if(a.isFunction(aY.old)){aY.old.call(this)}};return aY},easing:{linear:function(a0,a1,aY,aZ){return aY+aZ*a0},swing:function(a0,a1,aY,aZ){return((-Math.cos(a0*Math.PI)/2)+0.5)*aZ+aY}},timers:[],fx:function(aZ,aY,a0){this.options=aY;this.elem=aZ;this.prop=a0;if(!aY.orig){aY.orig={}}}});a.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(a.fx.step[this.prop]||a.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(aZ){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var aY=parseFloat(a.css(this.elem,this.prop,aZ));return aY&&aY>-10000?aY:parseFloat(a.curCSS(this.elem,this.prop))||0},custom:function(a2,a1,a0){this.startTime=aP();this.start=a2;this.end=a1;this.unit=a0||this.unit||"px";this.now=this.start;this.pos=this.state=0;var aY=this;function aZ(a3){return aY.step(a3)}aZ.elem=this.elem;if(aZ()&&a.timers.push(aZ)&&!aF){aF=setInterval(a.fx.tick,13)}},show:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());a(this.elem).show()},hide:function(){this.options.orig[this.prop]=a.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a1){var a6=aP(),a2=true;if(a1||a6>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var a3 in this.options.curAnim){if(this.options.curAnim[a3]!==true){a2=false}}if(a2){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var a0=a.data(this.elem,"olddisplay");this.elem.style.display=a0?a0:this.options.display;if(a.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){a(this.elem).hide()}if(this.options.hide||this.options.show){for(var aY in this.options.curAnim){a.style(this.elem,aY,this.options.orig[aY])}}this.options.complete.call(this.elem)}return false}else{var aZ=a6-this.startTime;this.state=aZ/this.options.duration;var a4=this.options.specialEasing&&this.options.specialEasing[this.prop];var a5=this.options.easing||(a.easing.swing?"swing":"linear");this.pos=a.easing[a4||a5](this.state,aZ,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};a.extend(a.fx,{tick:function(){var aZ=a.timers;for(var aY=0;aY<aZ.length;aY++){if(!aZ[aY]()){aZ.splice(aY--,1)}}if(!aZ.length){a.fx.stop()}},stop:function(){clearInterval(aF);aF=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(aY){a.style(aY.elem,"opacity",aY.now)},_default:function(aY){if(aY.elem.style&&aY.elem.style[aY.prop]!=null){aY.elem.style[aY.prop]=(aY.prop==="width"||aY.prop==="height"?Math.max(0,aY.now):aY.now)+aY.unit}else{aY.elem[aY.prop]=aY.now}}}});if(a.expr&&a.expr.filters){a.expr.filters.animated=function(aY){return a.grep(a.timers,function(aZ){return aY===aZ.elem}).length}}function aD(aZ,aY){var a0={};a.each(aj.concat.apply([],aj.slice(0,aY)),function(){a0[this]=aZ});return a0}if("getBoundingClientRect" in ab.documentElement){a.fn.offset=function(a7){var a0=this[0];if(a7){return this.each(function(a8){a.offset.setOffset(this,a7,a8)})}if(!a0||!a0.ownerDocument){return null}if(a0===a0.ownerDocument.body){return a.offset.bodyOffset(a0)}var a2=a0.getBoundingClientRect(),a6=a0.ownerDocument,a3=a6.body,aY=a6.documentElement,a1=aY.clientTop||a3.clientTop||0,a4=aY.clientLeft||a3.clientLeft||0,a5=a2.top+(self.pageYOffset||a.support.boxModel&&aY.scrollTop||a3.scrollTop)-a1,aZ=a2.left+(self.pageXOffset||a.support.boxModel&&aY.scrollLeft||a3.scrollLeft)-a4;return{top:a5,left:aZ}}}else{a.fn.offset=function(a9){var a3=this[0];if(a9){return this.each(function(ba){a.offset.setOffset(this,a9,ba)})}if(!a3||!a3.ownerDocument){return null}if(a3===a3.ownerDocument.body){return a.offset.bodyOffset(a3)}a.offset.initialize();var a0=a3.offsetParent,aZ=a3,a8=a3.ownerDocument,a6,a1=a8.documentElement,a4=a8.body,a5=a8.defaultView,aY=a5?a5.getComputedStyle(a3,null):a3.currentStyle,a7=a3.offsetTop,a2=a3.offsetLeft;while((a3=a3.parentNode)&&a3!==a4&&a3!==a1){if(a.offset.supportsFixedPosition&&aY.position==="fixed"){break}a6=a5?a5.getComputedStyle(a3,null):a3.currentStyle;a7-=a3.scrollTop;a2-=a3.scrollLeft;if(a3===a0){a7+=a3.offsetTop;a2+=a3.offsetLeft;if(a.offset.doesNotAddBorder&&!(a.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(a3.nodeName))){a7+=parseFloat(a6.borderTopWidth)||0;a2+=parseFloat(a6.borderLeftWidth)||0}aZ=a0,a0=a3.offsetParent}if(a.offset.subtractsBorderForOverflowNotVisible&&a6.overflow!=="visible"){a7+=parseFloat(a6.borderTopWidth)||0;a2+=parseFloat(a6.borderLeftWidth)||0}aY=a6}if(aY.position==="relative"||aY.position==="static"){a7+=a4.offsetTop;a2+=a4.offsetLeft}if(a.offset.supportsFixedPosition&&aY.position==="fixed"){a7+=Math.max(a1.scrollTop,a4.scrollTop);a2+=Math.max(a1.scrollLeft,a4.scrollLeft)}return{top:a7,left:a2}}}a.offset={initialize:function(){var aY=ab.body,aZ=ab.createElement("div"),a2,a4,a3,a5,a0=parseFloat(a.curCSS(aY,"marginTop",true))||0,a1="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.extend(aZ.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});aZ.innerHTML=a1;aY.insertBefore(aZ,aY.firstChild);a2=aZ.firstChild;a4=a2.firstChild;a5=a2.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(a4.offsetTop!==5);this.doesAddBorderForTableAndCells=(a5.offsetTop===5);a4.style.position="fixed",a4.style.top="20px";this.supportsFixedPosition=(a4.offsetTop===20||a4.offsetTop===15);a4.style.position=a4.style.top="";a2.style.overflow="hidden",a2.style.position="relative";this.subtractsBorderForOverflowNotVisible=(a4.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(aY.offsetTop!==a0);aY.removeChild(aZ);aY=aZ=a2=a4=a3=a5=null;a.offset.initialize=a.noop},bodyOffset:function(aY){var a0=aY.offsetTop,aZ=aY.offsetLeft;a.offset.initialize();if(a.offset.doesNotIncludeMarginInBodyOffset){a0+=parseFloat(a.curCSS(aY,"marginTop",true))||0;aZ+=parseFloat(a.curCSS(aY,"marginLeft",true))||0}return{top:a0,left:aZ}},setOffset:function(a3,aZ,a0){if(/static/.test(a.curCSS(a3,"position"))){a3.style.position="relative"}var a2=a(a3),a5=a2.offset(),aY=parseInt(a.curCSS(a3,"top",true),10)||0,a4=parseInt(a.curCSS(a3,"left",true),10)||0;if(a.isFunction(aZ)){aZ=aZ.call(a3,a0,a5)}var a1={top:(aZ.top-a5.top)+aY,left:(aZ.left-a5.left)+a4};if("using" in aZ){aZ.using.call(a3,a1)}else{a2.css(a1)}}};a.fn.extend({position:function(){if(!this[0]){return null}var a0=this[0],aZ=this.offsetParent(),a1=this.offset(),aY=/^body|html$/i.test(aZ[0].nodeName)?{top:0,left:0}:aZ.offset();a1.top-=parseFloat(a.curCSS(a0,"marginTop",true))||0;a1.left-=parseFloat(a.curCSS(a0,"marginLeft",true))||0;aY.top+=parseFloat(a.curCSS(aZ[0],"borderTopWidth",true))||0;aY.left+=parseFloat(a.curCSS(aZ[0],"borderLeftWidth",true))||0;return{top:a1.top-aY.top,left:a1.left-aY.left}},offsetParent:function(){return this.map(function(){var aY=this.offsetParent||ab.body;while(aY&&(!/^body|html$/i.test(aY.nodeName)&&a.css(aY,"position")==="static")){aY=aY.offsetParent}return aY})}});a.each(["Left","Top"],function(aZ,aY){var a0="scroll"+aY;a.fn[a0]=function(a3){var a1=this[0],a2;if(!a1){return null}if(a3!==C){return this.each(function(){a2=am(this);if(a2){a2.scrollTo(!aZ?a3:a(a2).scrollLeft(),aZ?a3:a(a2).scrollTop())}else{this[a0]=a3}})}else{a2=am(a1);return a2?("pageXOffset" in a2)?a2[aZ?"pageYOffset":"pageXOffset"]:a.support.boxModel&&a2.document.documentElement[a0]||a2.document.body[a0]:a1[a0]}}});function am(aY){return("scrollTo" in aY&&aY.document)?aY:aY.nodeType===9?aY.defaultView||aY.parentWindow:false}a.each(["Height","Width"],function(aZ,aY){var a0=aY.toLowerCase();a.fn["inner"+aY]=function(){return this[0]?a.css(this[0],a0,false,"padding"):null};a.fn["outer"+aY]=function(a1){return this[0]?a.css(this[0],a0,false,a1?"margin":"border"):null};a.fn[a0]=function(a1){var a2=this[0];if(!a2){return a1==null?null:this}if(a.isFunction(a1)){return this.each(function(a4){var a3=a(this);a3[a0](a1.call(this,a4,a3[a0]()))})}return("scrollTo" in a2&&a2.document)?a2.document.compatMode==="CSS1Compat"&&a2.document.documentElement["client"+aY]||a2.document.body["client"+aY]:(a2.nodeType===9)?Math.max(a2.documentElement["client"+aY],a2.body["scroll"+aY],a2.documentElement["scroll"+aY],a2.body["offset"+aY],a2.documentElement["offset"+aY]):a1===C?a.css(a2,a0):this.css(a0,typeof a1==="string"?a1:a1+"px")}});aM.jQuery=aM.$=a})(window);
/*
 * jQuery UI 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||function(a){a.ui={version:"1.8.1",plugin:{add:function(f,c,h){f=a.ui[f].prototype;for(var g in h){f.plugins[g]=f.plugins[g]||[];f.plugins[g].push([c,h[g]])}},call:function(f,c,h){if((c=f.plugins[c])&&f.element[0].parentNode){for(var g=0;g<c.length;g++){f.options[c[g][0]]&&c[g][1].apply(f.element,h)}}}},contains:function(d,c){return document.compareDocumentPosition?d.compareDocumentPosition(c)&16:d!==c&&d.contains(c)},hasScroll:function(e,c){if(a(e).css("overflow")=="hidden"){return false}c=c&&c=="left"?"scrollLeft":"scrollTop";var f=false;if(e[c]>0){return true}e[c]=1;f=e[c]>0;e[c]=0;return f},isOverAxis:function(e,c,f){return e>c&&e<c+f},isOver:function(h,c,l,k,j,i){return a.ui.isOverAxis(h,l,j)&&a.ui.isOverAxis(c,k,i)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};a.fn.extend({_focus:a.fn.focus,focus:function(d,c){return typeof d==="number"?this.each(function(){var b=this;setTimeout(function(){a(b).focus();c&&c.call(b)},d)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var b;b=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(d){if(d!==undefined){return this.css("zIndex",d)}if(this.length){d=a(this[0]);for(var c;d.length&&d[0]!==document;){c=d.css("position");if(c=="absolute"||c=="relative"||c=="fixed"){c=parseInt(d.css("zIndex"));if(!isNaN(c)&&c!=0){return c}}d=d.parent()}}return 0}});a.extend(a.expr[":"],{data:function(e,c,f){return !!a.data(e,f[3])},focusable:function(e){var c=e.nodeName.toLowerCase(),f=a.attr(e,"tabindex");return(/input|select|textarea|button|object/.test(c)?!e.disabled:"a"==c||"area"==c?e.href||!isNaN(f):!isNaN(f))&&!a(e)["area"==c?"parents":"closest"](":hidden").length},tabbable:function(d){var c=a.attr(d,"tabindex");return(isNaN(c)||c>=0)&&a(d).is(":focusable")}})}(jQuery);
/*
 * jQuery UI Widget 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(a){var c=a.fn.remove;a.fn.remove=function(b,d){return this.each(function(){if(!d){if(!b||a.filter(b,[this]).length){a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})}}return c.call(a(this),b,d)})};a.widget=function(b,j,i){var h=b.split(".")[0],g;b=b.split(".")[1];g=h+"-"+b;if(!i){i=j;j=a.Widget}a.expr[":"][g]=function(d){return !!a.data(d,b)};a[h]=a[h]||{};a[h][b]=function(d,e){arguments.length&&this._createWidget(d,e)};j=new j;j.options=a.extend({},j.options);a[h][b].prototype=a.extend(true,j,{namespace:h,widgetName:b,widgetEventPrefix:a[h][b].prototype.widgetEventPrefix||b,widgetBaseClass:g},i);a.widget.bridge(b,a[h][b])};a.widget.bridge=function(b,d){a.fn[b]=function(k){var j=typeof k==="string",i=Array.prototype.slice.call(arguments,1),g=this;k=!j&&i.length?a.extend.apply(null,[true,k].concat(i)):k;if(j&&k.substring(0,1)==="_"){return g}j?this.each(function(){var f=a.data(this,b),e=f&&a.isFunction(f[k])?f[k].apply(f,i):f;if(e!==f&&e!==undefined){g=e;return false}}):this.each(function(){var e=a.data(this,b);if(e){k&&e.option(k);e._init()}else{a.data(this,b,new d(k,this))}});return g}};a.Widget=function(b,d){arguments.length&&this._createWidget(b,d)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,f){this.element=a(f).data(this.widgetName,this);this.options=a.extend(true,{},this.options,a.metadata&&a.metadata.get(f)[this.widgetName],b);var e=this;this.element.bind("remove."+this.widgetName,function(){e.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(b,h){var g=b,f=this;if(arguments.length===0){return a.extend({},f.options)}if(typeof b==="string"){if(h===undefined){return this.options[b]}g={};g[b]=h}a.each(g,function(e,d){f._setOption(e,d)});return f},_setOption:function(b,d){this.options[b]=d;if(b==="disabled"){this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",d)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,j,i){var h=this.options[b];j=a.Event(j);j.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();i=i||{};if(j.originalEvent){b=a.event.props.length;for(var g;b;){g=a.event.props[--b];j[g]=j.originalEvent[g]}}this.element.trigger(j,i);return !(a.isFunction(h)&&h.call(this.element[0],j,i)===false||j.isDefaultPrevented())}}})(jQuery);
/*
 * jQuery UI Mouse 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(c){return b._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(b._preventClickEvent){b._preventClickEvent=false;c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(d){d.originalEvent=d.originalEvent||{};if(!d.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(d);this._mouseDownEvent=d;var c=this,h=d.which==1,g=typeof this.options.cancel=="string"?a(d.target).parents().add(d.target).filter(this.options.cancel).length:false;if(!h||g||!this._mouseCapture(d)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=this._mouseStart(d)!==false;if(!this._mouseStarted){d.preventDefault();return true}}this._mouseMoveDelegate=function(b){return c._mouseMove(b)};this._mouseUpDelegate=function(b){return c._mouseUp(b)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.browser.safari||d.preventDefault();return d.originalEvent.mouseHandled=true}},_mouseMove:function(b){if(a.browser.msie&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false)?this._mouseDrag(b):this._mouseUp(b)}return !this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=b.target==this._mouseDownEvent.target;this._mouseStop(b)}return false},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);(function(f){f.ui=f.ui||{};var a=/left|center|right/,e=/top|center|bottom/,d=f.fn.position,b=f.fn.offset;f.fn.position=function(j){if(!j||!j.of){return d.apply(this,arguments)}j=f.extend({},j);var c=f(j.of),o=(j.collision||"flip").split(" "),n=j.offset?j.offset.split(" "):[0,0],m,l,k;if(j.of.nodeType===9){m=c.width();l=c.height();k={top:0,left:0}}else{if(j.of.scrollTo&&j.of.document){m=c.width();l=c.height();k={top:c.scrollTop(),left:c.scrollLeft()}}else{if(j.of.preventDefault){j.at="left top";m=l=0;k={top:j.of.pageY,left:j.of.pageX}}else{m=c.outerWidth();l=c.outerHeight();k=c.offset()}}}f.each(["my","at"],function(){var g=(j[this]||"").split(" ");if(g.length===1){g=a.test(g[0])?g.concat(["center"]):e.test(g[0])?["center"].concat(g):["center","center"]}g[0]=a.test(g[0])?g[0]:"center";g[1]=e.test(g[1])?g[1]:"center";j[this]=g});if(o.length===1){o[1]=o[0]}n[0]=parseInt(n[0],10)||0;if(n.length===1){n[1]=n[0]}n[1]=parseInt(n[1],10)||0;if(j.at[0]==="right"){k.left+=m}else{if(j.at[0]==="center"){k.left+=m/2}}if(j.at[1]==="bottom"){k.top+=l}else{if(j.at[1]==="center"){k.top+=l/2}}k.left+=n[0];k.top+=n[1];return this.each(function(){var p=f(this),h=p.outerWidth(),g=p.outerHeight(),i=f.extend({},k);if(j.my[0]==="right"){i.left-=h}else{if(j.my[0]==="center"){i.left-=h/2}}if(j.my[1]==="bottom"){i.top-=g}else{if(j.my[1]==="center"){i.top-=g/2}}i.left=parseInt(i.left);i.top=parseInt(i.top);f.each(["left","top"],function(s,q){f.ui.position[o[s]]&&f.ui.position[o[s]][q](i,{targetWidth:m,targetHeight:l,elemWidth:h,elemHeight:g,offset:n,my:j.my,at:j.at})});f.fn.bgiframe&&p.bgiframe();p.offset(f.extend(i,{using:j.using}))})};f.ui.position={fit:{left:function(g,c){var h=f(window);c=g.left+c.elemWidth-h.width()-h.scrollLeft();g.left=c>0?g.left-c:Math.max(0,g.left)},top:function(g,c){var h=f(window);c=g.top+c.elemHeight-h.height()-h.scrollTop();g.top=c>0?g.top-c:Math.max(0,g.top)}},flip:{left:function(h,c){if(c.at[0]!=="center"){var k=f(window);k=h.left+c.elemWidth-k.width()-k.scrollLeft();var j=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,i=-2*c.offset[0];h.left+=h.left<0?j+c.targetWidth+i:k>0?j-c.targetWidth+i:0}},top:function(i,c){if(c.at[1]!=="center"){var m=f(window);m=i.top+c.elemHeight-m.height()-m.scrollTop();var l=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,k=c.at[1]==="top"?c.targetHeight:-c.targetHeight,j=-2*c.offset[1];i.top+=i.top<0?l+c.targetHeight+j:m>0?l+k+j:0}}}};if(!f.offset.setOffset){f.offset.setOffset=function(i,c){if(/static/.test(f.curCSS(i,"position"))){i.style.position="relative"}var m=f(i),l=m.offset(),k=parseInt(f.curCSS(i,"top",true),10)||0,j=parseInt(f.curCSS(i,"left",true),10)||0;l={top:c.top-l.top+k,left:c.left-l.left+j};"using" in c?c.using.call(i,l):m.css(l)};f.fn.offset=function(g){var c=this[0];if(!c||!c.ownerDocument){return null}if(g){return this.each(function(){f.offset.setOffset(this,g)})}return b.call(this)}}})(jQuery);(function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");d.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");this.range=a([]);if(d.range){if(d.range===true){this.range=a("<div></div>");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!==2){d.values=[d.values[0],d.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range==="min"||d.range==="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}a(".ui-slider-handle",this.element).length===0&&a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");if(d.values&&d.values.length){for(;a(".ui-slider-handle",this.element).length<d.values.length;){a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(d.disabled){a(this).blur()}else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)});this.handles.keydown(function(n){var m=true,l=a(this).data("index.ui-slider-handle"),k,j,b;if(!c.options.disabled){switch(n.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:m=false;if(!c._keySliding){c._keySliding=true;a(this).addClass("ui-state-active");k=c._start(n,l);if(k===false){return}}break}b=c.options.step;k=c.options.values&&c.options.values.length?(j=c.values(l)):(j=c.value());switch(n.keyCode){case a.ui.keyCode.HOME:j=c._valueMin();break;case a.ui.keyCode.END:j=c._valueMax();break;case a.ui.keyCode.PAGE_UP:j=k+(c._valueMax()-c._valueMin())/5;break;case a.ui.keyCode.PAGE_DOWN:j=k-(c._valueMax()-c._valueMin())/5;break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(k===c._valueMax()){return}j=k+b;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(k===c._valueMin()){return}j=k-b;break}c._slide(n,l,j);return m}}).keyup(function(f){var b=a(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(f,b);c._change(f,b);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(d){var j=this.options,p,o,n,m,l,k;if(j.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();p={x:d.pageX,y:d.pageY};o=this._normValueFromMouse(p);n=this._valueMax()-this._valueMin()+1;l=this;this.handles.each(function(c){var b=Math.abs(o-l.values(c));if(n>b){n=b;m=a(this);k=c}});if(j.range===true&&this.values(1)===j.min){k+=1;m=a(this.handles[k])}if(this._start(d,k)===false){return false}this._mouseSliding=true;l._handleIndex=k;m.addClass("ui-state-active").focus();j=m.offset();this._clickOffset=!a(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-j.left-m.width()/2,top:d.pageY-j.top-m.height()/2-(parseInt(m.css("borderTopWidth"),10)||0)-(parseInt(m.css("borderBottomWidth"),10)||0)+(parseInt(m.css("marginTop"),10)||0)};o=this._normValueFromMouse(p);this._slide(d,k,o);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(c){var d=this._normValueFromMouse({x:c.pageX,y:c.pageY});this._slide(c,this._handleIndex,d);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(c){var d;if(this.orientation==="horizontal"){d=this.elementSize.width;c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}d=c/d;if(d>1){d=1}if(d<0){d=0}if(this.orientation==="vertical"){d=1-d}c=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+d*c)},_start:function(d,e){var f={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(e);f.values=this.values()}return this._trigger("start",d,f)},_slide:function(d,f,h){var g;if(this.options.values&&this.options.values.length){g=this.values(f?0:1);if(this.options.values.length===2&&this.options.range===true&&(f===0&&h>g||f===1&&h<g)){h=g}if(h!==this.values(f)){g=this.values();g[f]=h;d=this._trigger("slide",d,{handle:this.handles[f],value:h,values:g});this.values(f?0:1);d!==false&&this.values(f,h,true)}}else{if(h!==this.value()){d=this._trigger("slide",d,{handle:this.handles[f],value:h});d!==false&&this.value(h)}}},_stop:function(d,e){var f={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(e);f.values=this.values()}this._trigger("stop",d,f)},_change:function(d,e){if(!this._keySliding&&!this._mouseSliding){var f={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(e);f.values=this.values()}this._trigger("change",d,f)}},value:function(c){if(arguments.length){this.options.value=this._trimAlignValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(d,g){var j,i,h;if(arguments.length>1){this.options.values[d]=this._trimAlignValue(g);this._refreshValue();this._change(null,d)}if(arguments.length){if(a.isArray(arguments[0])){j=this.options.values;i=arguments[0];for(h=0;h<j.length;h+=1){j[h]=this._trimAlignValue(i[h]);this._change(null,h)}this._refreshValue()}else{return this.options.values&&this.options.values.length?this._values(d):this.value()}}else{return this._values()}},_setOption:function(d,f){var h,g=0;if(a.isArray(this.options.values)){g=this.options.values.length}a.Widget.prototype._setOption.apply(this,arguments);switch(d){case"disabled":if(f){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(h=0;h<g;h+=1){this._change(null,h)}this._animateOff=false;break}},_value:function(){var c=this.options.value;return c=this._trimAlignValue(c)},_values:function(d){var e,f;if(arguments.length){e=this.options.values[d];return e=this._trimAlignValue(e)}else{e=this.options.values.slice();for(f=0;f<e.length;f+=1){e[f]=this._trimAlignValue(e[f])}return e}},_trimAlignValue:function(d){if(d<this._valueMin()){return this._valueMin()}if(d>this._valueMax()){return this._valueMax()}var e=this.options.step,f=d%e;d=d-f;if(f>=e/2){d+=e}return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var s=this.options.range,t=this.options,r=this,q=!this._animateOff?t.animate:false,p,o={},n,m,l,d;if(this.options.values&&this.options.values.length){this.handles.each(function(b){p=(r.values(b)-r._valueMin())/(r._valueMax()-r._valueMin())*100;o[r.orientation==="horizontal"?"left":"bottom"]=p+"%";a(this).stop(1,1)[q?"animate":"css"](o,t.animate);if(r.options.range===true){if(r.orientation==="horizontal"){if(b===0){r.range.stop(1,1)[q?"animate":"css"]({left:p+"%"},t.animate)}if(b===1){r.range[q?"animate":"css"]({width:p-n+"%"},{queue:false,duration:t.animate})}}else{if(b===0){r.range.stop(1,1)[q?"animate":"css"]({bottom:p+"%"},t.animate)}if(b===1){r.range[q?"animate":"css"]({height:p-n+"%"},{queue:false,duration:t.animate})}}}n=p})}else{m=this.value();l=this._valueMin();d=this._valueMax();p=d!==l?(m-l)/(d-l)*100:0;o[r.orientation==="horizontal"?"left":"bottom"]=p+"%";this.handle.stop(1,1)[q?"animate":"css"](o,t.animate);if(s==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[q?"animate":"css"]({width:p+"%"},t.animate)}if(s==="max"&&this.orientation==="horizontal"){this.range[q?"animate":"css"]({width:100-p+"%"},{queue:false,duration:t.animate})}if(s==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[q?"animate":"css"]({height:p+"%"},t.animate)}if(s==="max"&&this.orientation==="vertical"){this.range[q?"animate":"css"]({height:100-p+"%"},{queue:false,duration:t.animate})}}}});a.extend(a.ui.slider,{version:"1.8.1"})})(jQuery);jQuery.effects||function(p){function h(j){var f;if(j&&j.constructor==Array&&j.length==3){return j}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(j)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(j)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(j)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(j)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(/rgba\(0, 0, 0, 0\)/.exec(j)){return g.transparent}return g[p.trim(j).toLowerCase()]}function b(k,j){var f;do{f=p.curCSS(k,j);if(f!=""&&f!="transparent"||p.nodeName(k,"body")){break}j="backgroundColor"}while(k=k.parentNode);return h(f)}function e(){var m=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,j={},f,l;if(m&&m.length&&m[0]&&m[m[0]]){for(var k=m.length;k--;){f=m[k];if(typeof m[f]=="string"){l=f.replace(/\-(\w)/g,function(o,n){return n.toUpperCase()});j[l]=m[f]}}}else{for(f in m){if(typeof m[f]==="string"){j[f]=m[f]}}}return j}function d(k){var j,f;for(j in k){f=k[j];if(f==null||p.isFunction(f)||j in a||/scrollbar/.test(j)||!/color/i.test(j)&&isNaN(parseFloat(f))){delete k[j]}}return k}function t(l,j){var f={_:0},k;for(k in j){if(l[k]!=j[k]){f[k]=j[k]}}return f}function i(l,j,f,k){if(typeof l=="object"){k=j;f=null;j=l;l=j.effect}if(p.isFunction(j)){k=j;f=null;j={}}if(p.isFunction(f)){k=f;f=null}if(typeof j=="number"||p.fx.speeds[j]){k=f;f=j;j={}}j=j||{};f=f||j.duration;f=p.fx.off?0:typeof f=="number"?f:p.fx.speeds[f]||p.fx.speeds._default;k=k||j.complete;return[l,j,f,k]}p.effects={};p.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(j,f){p.fx.step[f]=function(k){if(!k.colorInit){k.start=b(k.elem,f);k.end=h(k.end);k.colorInit=true}k.elem.style[f]="rgb("+Math.max(Math.min(parseInt(k.pos*(k.end[0]-k.start[0])+k.start[0],10),255),0)+","+Math.max(Math.min(parseInt(k.pos*(k.end[1]-k.start[1])+k.start[1],10),255),0)+","+Math.max(Math.min(parseInt(k.pos*(k.end[2]-k.start[2])+k.start[2],10),255),0)+")"}});var g={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},c=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};p.effects.animateClass=function(l,j,f,k){if(p.isFunction(f)){k=f;f=null}return this.each(function(){var r=p(this),o=r.attr("style")||" ",n=d(e.call(this)),q,m=r.attr("className");p.each(c,function(s,v){l[v]&&r[v+"Class"](l[v])});q=d(e.call(this));r.attr("className",m);r.animate(t(n,q),j,f,function(){p.each(c,function(s,v){l[v]&&r[v+"Class"](l[v])});if(typeof r.attr("style")=="object"){r.attr("style").cssText="";r.attr("style").cssText=o}else{r.attr("style",o)}k&&k.apply(this,arguments)})})};p.fn.extend({_addClass:p.fn.addClass,addClass:function(l,j,f,k){return j?p.effects.animateClass.apply(this,[{add:l},j,f,k]):this._addClass(l)},_removeClass:p.fn.removeClass,removeClass:function(l,j,f,k){return j?p.effects.animateClass.apply(this,[{remove:l},j,f,k]):this._removeClass(l)},_toggleClass:p.fn.toggleClass,toggleClass:function(m,j,f,l,k){return typeof j=="boolean"||j===undefined?f?p.effects.animateClass.apply(this,[j?{add:m}:{remove:m},f,l,k]):this._toggleClass(m,j):p.effects.animateClass.apply(this,[{toggle:m},j,f,l])},switchClass:function(m,j,f,l,k){return p.effects.animateClass.apply(this,[{add:j,remove:m},f,l,k])}});p.extend(p.effects,{version:"1.8.1",save:function(k,j){for(var f=0;f<j.length;f++){j[f]!==null&&k.data("ec.storage."+j[f],k[0].style[j[f]])}},restore:function(k,j){for(var f=0;f<j.length;f++){j[f]!==null&&k.css(j[f],k.data("ec.storage."+j[f]))}},setMode:function(j,f){if(f=="toggle"){f=j.is(":hidden")?"show":"hide"}return f},getBaseline:function(k,j){var f;switch(k[0]){case"top":f=0;break;case"middle":f=0.5;break;case"bottom":f=1;break;default:f=k[0]/j.height}switch(k[1]){case"left":k=0;break;case"center":k=0.5;break;case"right":k=1;break;default:k=k[1]/j.width}return{x:k,y:f}},createWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent()}var j={width:k.outerWidth(true),height:k.outerHeight(true),"float":k.css("float")},f=p("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});k.wrap(f);f=k.parent();if(k.css("position")=="static"){f.css({position:"relative"});k.css({position:"relative"})}else{p.extend(j,{position:k.css("position"),zIndex:k.css("z-index")});p.each(["top","left","bottom","right"],function(m,l){j[l]=k.css(l);if(isNaN(parseInt(j[l],10))){j[l]="auto"}});k.css({position:"relative",top:0,left:0})}return f.css(j).show()},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(l,j,f,k){k=k||{};p.each(j,function(n,m){unit=l.cssUnit(m);if(unit[0]>0){k[m]=unit[0]*f+unit[1]}});return k}});p.fn.extend({effect:function(k){var j=i.apply(this,arguments);j={options:j[1],duration:j[2],callback:j[3]};var f=p.effects[k];return f&&!p.fx.off?f.call(this,j):this},_show:p.fn.show,show:function(j){if(!j||typeof j=="number"||p.fx.speeds[j]){return this._show.apply(this,arguments)}else{var f=i.apply(this,arguments);f[1].mode="show";return this.effect.apply(this,f)}},_hide:p.fn.hide,hide:function(j){if(!j||typeof j=="number"||p.fx.speeds[j]){return this._hide.apply(this,arguments)}else{var f=i.apply(this,arguments);f[1].mode="hide";return this.effect.apply(this,f)}},__toggle:p.fn.toggle,toggle:function(j){if(!j||typeof j=="number"||p.fx.speeds[j]||typeof j=="boolean"||p.isFunction(j)){return this.__toggle.apply(this,arguments)}else{var f=i.apply(this,arguments);f[1].mode="toggle";return this.effect.apply(this,f)}},cssUnit:function(k){var j=this.css(k),f=[];p.each(["em","px","%","pt"],function(m,l){if(j.indexOf(l)>0){f=[parseFloat(j),l]}});return f}});p.easing.jswing=p.easing.swing;p.extend(p.easing,{def:"easeOutQuad",swing:function(m,j,f,l,k){return p.easing[p.easing.def](m,j,f,l,k)},easeInQuad:function(m,j,f,l,k){return l*(j/=k)*j+f},easeOutQuad:function(m,j,f,l,k){return -l*(j/=k)*(j-2)+f},easeInOutQuad:function(m,j,f,l,k){if((j/=k/2)<1){return l/2*j*j+f}return -l/2*(--j*(j-2)-1)+f},easeInCubic:function(m,j,f,l,k){return l*(j/=k)*j*j+f},easeOutCubic:function(m,j,f,l,k){return l*((j=j/k-1)*j*j+1)+f},easeInOutCubic:function(m,j,f,l,k){if((j/=k/2)<1){return l/2*j*j*j+f}return l/2*((j-=2)*j*j+2)+f},easeInQuart:function(m,j,f,l,k){return l*(j/=k)*j*j*j+f},easeOutQuart:function(m,j,f,l,k){return -l*((j=j/k-1)*j*j*j-1)+f},easeInOutQuart:function(m,j,f,l,k){if((j/=k/2)<1){return l/2*j*j*j*j+f}return -l/2*((j-=2)*j*j*j-2)+f},easeInQuint:function(m,j,f,l,k){return l*(j/=k)*j*j*j*j+f},easeOutQuint:function(m,j,f,l,k){return l*((j=j/k-1)*j*j*j*j+1)+f},easeInOutQuint:function(m,j,f,l,k){if((j/=k/2)<1){return l/2*j*j*j*j*j+f}return l/2*((j-=2)*j*j*j*j+2)+f},easeInSine:function(m,j,f,l,k){return -l*Math.cos(j/k*(Math.PI/2))+l+f},easeOutSine:function(m,j,f,l,k){return l*Math.sin(j/k*(Math.PI/2))+f},easeInOutSine:function(m,j,f,l,k){return -l/2*(Math.cos(Math.PI*j/k)-1)+f},easeInExpo:function(m,j,f,l,k){return j==0?f:l*Math.pow(2,10*(j/k-1))+f},easeOutExpo:function(m,j,f,l,k){return j==k?f+l:l*(-Math.pow(2,-10*j/k)+1)+f},easeInOutExpo:function(m,j,f,l,k){if(j==0){return f}if(j==k){return f+l}if((j/=k/2)<1){return l/2*Math.pow(2,10*(j-1))+f}return l/2*(-Math.pow(2,-10*--j)+2)+f},easeInCirc:function(m,j,f,l,k){return -l*(Math.sqrt(1-(j/=k)*j)-1)+f},easeOutCirc:function(m,j,f,l,k){return l*Math.sqrt(1-(j=j/k-1)*j)+f},easeInOutCirc:function(m,j,f,l,k){if((j/=k/2)<1){return -l/2*(Math.sqrt(1-j*j)-1)+f}return l/2*(Math.sqrt(1-(j-=2)*j)+1)+f},easeInElastic:function(o,j,f,n,m){o=1.70158;var l=0,k=n;if(j==0){return f}if((j/=m)==1){return f+n}l||(l=m*0.3);if(k<Math.abs(n)){k=n;o=l/4}else{o=l/(2*Math.PI)*Math.asin(n/k)}return -(k*Math.pow(2,10*(j-=1))*Math.sin((j*m-o)*2*Math.PI/l))+f},easeOutElastic:function(o,j,f,n,m){o=1.70158;var l=0,k=n;if(j==0){return f}if((j/=m)==1){return f+n}l||(l=m*0.3);if(k<Math.abs(n)){k=n;o=l/4}else{o=l/(2*Math.PI)*Math.asin(n/k)}return k*Math.pow(2,-10*j)*Math.sin((j*m-o)*2*Math.PI/l)+n+f},easeInOutElastic:function(o,j,f,n,m){o=1.70158;var l=0,k=n;if(j==0){return f}if((j/=m/2)==2){return f+n}l||(l=m*0.3*1.5);if(k<Math.abs(n)){k=n;o=l/4}else{o=l/(2*Math.PI)*Math.asin(n/k)}if(j<1){return -0.5*k*Math.pow(2,10*(j-=1))*Math.sin((j*m-o)*2*Math.PI/l)+f}return k*Math.pow(2,-10*(j-=1))*Math.sin((j*m-o)*2*Math.PI/l)*0.5+n+f},easeInBack:function(n,j,f,m,l,k){if(k==undefined){k=1.70158}return m*(j/=l)*j*((k+1)*j-k)+f},easeOutBack:function(n,j,f,m,l,k){if(k==undefined){k=1.70158}return m*((j=j/l-1)*j*((k+1)*j+k)+1)+f},easeInOutBack:function(n,j,f,m,l,k){if(k==undefined){k=1.70158}if((j/=l/2)<1){return m/2*j*j*(((k*=1.525)+1)*j-k)+f}return m/2*((j-=2)*j*(((k*=1.525)+1)*j+k)+2)+f},easeInBounce:function(m,j,f,l,k){return l-p.easing.easeOutBounce(m,k-j,0,l,k)+f},easeOutBounce:function(m,j,f,l,k){return(j/=k)<1/2.75?l*7.5625*j*j+f:j<2/2.75?l*(7.5625*(j-=1.5/2.75)*j+0.75)+f:j<2.5/2.75?l*(7.5625*(j-=2.25/2.75)*j+0.9375)+f:l*(7.5625*(j-=2.625/2.75)*j+0.984375)+f},easeInOutBounce:function(m,j,f,l,k){if(j<k/2){return p.easing.easeInBounce(m,j*2,0,l,k)*0.5+f}return p.easing.easeOutBounce(m,j*2-k,0,l,k)*0.5+l*0.5+f}})}(jQuery);(function(a){a.effects.blind=function(b){return this.queue(function(){var c=a(this),l=["position","top","left"],m=a.effects.setMode(c,b.options.mode||"hide"),o=b.options.direction||"vertical";a.effects.save(c,l);c.show();var n=a.effects.createWrapper(c).css({overflow:"hidden"}),k=o=="vertical"?"height":"width";o=o=="vertical"?n.height():n.width();m=="show"&&n.css(k,0);var j={};j[k]=m=="show"?o:0;n.animate(j,b.duration,b.options.easing,function(){m=="hide"&&c.hide();a.effects.restore(c,l);a.effects.removeWrapper(c);b.callback&&b.callback.apply(c[0],arguments);c.dequeue()})})}})(jQuery);(function(){var u=this;var r=u._;var b=typeof StopIteration!=="undefined"?StopIteration:"__break__";var g=function(C){return C.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")};var j=Array.prototype,A=Object.prototype;var s=j.slice,w=j.unshift,v=A.toString,p=A.hasOwnProperty,n=A.propertyIsEnumerable;var m=j.forEach,i=j.map,y=j.reduce,e=j.reduceRight,l=j.filter,a=j.every,x=j.some,t=j.indexOf,f=j.lastIndexOf,c=Array.isArray,z=Object.keys;var B=function(C){return new h(C)};if(typeof exports!=="undefined"){exports._=B}u._=B;B.VERSION="1.1.0";var d=B.forEach=function(I,G,F){try{if(m&&I.forEach===m){I.forEach(G,F)}else{if(B.isNumber(I.length)){for(var E=0,C=I.length;E<C;E++){G.call(F,I[E],E,I)}}else{for(var D in I){if(p.call(I,D)){G.call(F,I[D],D,I)}}}}}catch(H){if(H!=b){throw H}}return I};B.map=function(F,E,D){if(i&&F.map===i){return F.map(E,D)}var C=[];d(F,function(I,G,H){C.push(E.call(D,I,G,H))});return C};B.reduce=function(F,E,C,D){if(y&&F.reduce===y){if(D){E=B.bind(E,D)}return F.reduce(E,C)}d(F,function(I,G,H){C=E.call(D,C,I,G,H)});return C};B.reduceRight=function(F,E,C,D){if(e&&F.reduceRight===e){if(D){E=B.bind(E,D)}return F.reduceRight(E,C)}var G=B.clone(B.toArray(F)).reverse();return B.reduce(G,E,C,D)};B.detect=function(F,E,D){var C;d(F,function(I,G,H){if(E.call(D,I,G,H)){C=I;B.breakLoop()}});return C};B.filter=function(F,E,D){if(l&&F.filter===l){return F.filter(E,D)}var C=[];d(F,function(I,G,H){E.call(D,I,G,H)&&C.push(I)});return C};B.reject=function(F,E,D){var C=[];d(F,function(I,G,H){!E.call(D,I,G,H)&&C.push(I)});return C};B.every=function(F,E,D){E=E||B.identity;if(a&&F.every===a){return F.every(E,D)}var C=true;d(F,function(I,G,H){if(!(C=C&&E.call(D,I,G,H))){B.breakLoop()}});return C};B.some=function(F,E,D){E=E||B.identity;if(x&&F.some===x){return F.some(E,D)}var C=false;d(F,function(I,G,H){if(C=E.call(D,I,G,H)){B.breakLoop()}});return C};B.include=function(E,D){if(t&&E.indexOf===t){return E.indexOf(D)!=-1}var C=false;d(E,function(F){if(C=F===D){B.breakLoop()}});return C};B.invoke=function(D,E){var C=B.rest(arguments,2);return B.map(D,function(F){return(E?F[E]:F).apply(F,C)})};B.pluck=function(D,C){return B.map(D,function(E){return E[C]})};B.max=function(F,E,D){if(!E&&B.isArray(F)){return Math.max.apply(Math,F)}var C={computed:-Infinity};d(F,function(J,G,I){var H=E?E.call(D,J,G,I):J;H>=C.computed&&(C={value:J,computed:H})});return C.value};B.min=function(F,E,D){if(!E&&B.isArray(F)){return Math.min.apply(Math,F)}var C={computed:Infinity};d(F,function(J,G,I){var H=E?E.call(D,J,G,I):J;H<C.computed&&(C={value:J,computed:H})});return C.value};B.sortBy=function(E,D,C){return B.pluck(B.map(E,function(H,F,G){return{value:H,criteria:D.call(C,H,F,G)}}).sort(function(I,H){var G=I.criteria,F=H.criteria;return G<F?-1:G>F?1:0}),"value")};B.sortedIndex=function(H,G,E){E=E||B.identity;var C=0,F=H.length;while(C<F){var D=(C+F)>>1;E(H[D])<E(G)?C=D+1:F=D}return C};B.toArray=function(C){if(!C){return[]}if(C.toArray){return C.toArray()}if(B.isArray(C)){return C}if(B.isArguments(C)){return s.call(C)}return B.values(C)};B.size=function(C){return B.toArray(C).length};B.first=function(E,D,C){return D&&!C?s.call(E,0,D):E[0]};B.rest=function(E,C,D){return s.call(E,B.isUndefined(C)||D?1:C)};B.last=function(C){return C[C.length-1]};B.compact=function(C){return B.filter(C,function(D){return !!D})};B.flatten=function(C){return B.reduce(C,function(D,E){if(B.isArray(E)){return D.concat(B.flatten(E))}D.push(E);return D},[])};B.without=function(D){var C=B.rest(arguments);return B.filter(D,function(E){return !B.include(C,E)})};B.uniq=function(D,C){return B.reduce(D,function(E,G,F){if(0==F||(C===true?B.last(E)!=G:!B.include(E,G))){E.push(G)}return E},[])};B.intersect=function(D){var C=B.rest(arguments);return B.filter(B.uniq(D),function(E){return B.every(C,function(F){return B.indexOf(F,E)>=0})})};B.zip=function(){var C=B.toArray(arguments);var F=B.max(B.pluck(C,"length"));var E=new Array(F);for(var D=0;D<F;D++){E[D]=B.pluck(C,String(D))}return E};B.indexOf=function(F,E){if(t&&F.indexOf===t){return F.indexOf(E)}for(var D=0,C=F.length;D<C;D++){if(F[D]===E){return D}}return -1};B.lastIndexOf=function(E,D){if(f&&E.lastIndexOf===f){return E.lastIndexOf(D)}var C=E.length;while(C--){if(E[C]===D){return C}}return -1};B.range=function(C,I,D){var J=B.toArray(arguments);var H=J.length<=1;var C=H?0:J[0],I=H?J[0]:J[1],D=J[2]||1;var G=Math.ceil((I-C)/D);if(G<=0){return[]}var F=new Array(G);for(var E=C,K=0;true;E+=D){if((D>0?E-I:I-E)>=0){return F}F[K++]=E}};B.bind=function(D,E){var C=B.rest(arguments,2);return function(){return D.apply(E||{},C.concat(B.toArray(arguments)))}};B.bindAll=function(D){var C=B.rest(arguments);if(C.length==0){C=B.functions(D)}d(C,function(E){D[E]=B.bind(D[E],D)});return D};B.memoize=function(E,D){var C={};D=D||B.identity;return function(){var F=D.apply(this,arguments);return F in C?C[F]:(C[F]=E.apply(this,arguments))}};B.delay=function(D,E){var C=B.rest(arguments,2);return setTimeout(function(){return D.apply(D,C)},E)};B.defer=function(C){return B.delay.apply(B,[C,1].concat(B.rest(arguments)))};B.wrap=function(C,D){return function(){var E=[C].concat(B.toArray(arguments));return D.apply(D,E)}};B.compose=function(){var C=B.toArray(arguments);return function(){var D=B.toArray(arguments);for(var E=C.length-1;E>=0;E--){D=[C[E].apply(this,D)]}return D[0]}};B.keys=z||function(E){if(B.isArray(E)){return B.range(0,E.length)}var D=[];for(var C in E){if(p.call(E,C)){D.push(C)}}return D};B.values=function(C){return B.map(C,B.identity)};B.functions=function(C){return B.filter(B.keys(C),function(D){return B.isFunction(C[D])}).sort()};B.extend=function(C){d(B.rest(arguments),function(D){for(var E in D){C[E]=D[E]}});return C};B.clone=function(C){if(B.isArray(C)){return C.slice(0)}return B.extend({},C)};B.tap=function(D,C){C(D);return D};B.isEqual=function(D,C){if(D===C){return true}var G=typeof(D),I=typeof(C);if(G!=I){return false}if(D==C){return true}if((!D&&C)||(D&&!C)){return false}if(D.isEqual){return D.isEqual(C)}if(B.isDate(D)&&B.isDate(C)){return D.getTime()===C.getTime()}if(B.isNaN(D)&&B.isNaN(C)){return false}if(B.isRegExp(D)&&B.isRegExp(C)){return D.source===C.source&&D.global===C.global&&D.ignoreCase===C.ignoreCase&&D.multiline===C.multiline}if(G!=="object"){return false}if(D.length&&(D.length!==C.length)){return false}var E=B.keys(D),H=B.keys(C);if(E.length!=H.length){return false}for(var F in D){if(!(F in C)||!B.isEqual(D[F],C[F])){return false}}return true};B.isEmpty=function(D){if(B.isArray(D)||B.isString(D)){return D.length===0}for(var C in D){if(p.call(D,C)){return false}}return true};B.isElement=function(C){return !!(C&&C.nodeType==1)};B.isArray=c||function(C){return !!(C&&C.concat&&C.unshift&&!C.callee)};B.isArguments=function(C){return C&&C.callee};B.isFunction=function(C){return !!(C&&C.constructor&&C.call&&C.apply)};B.isString=function(C){return !!(C===""||(C&&C.charCodeAt&&C.substr))};B.isNumber=function(C){return(C===+C)||(v.call(C)==="[object Number]")};B.isBoolean=function(C){return C===true||C===false};B.isDate=function(C){return !!(C&&C.getTimezoneOffset&&C.setUTCFullYear)};B.isRegExp=function(C){return !!(C&&C.test&&C.exec&&(C.ignoreCase||C.ignoreCase===false))};B.isNaN=function(C){return B.isNumber(C)&&isNaN(C)};B.isNull=function(C){return C===null};B.isUndefined=function(C){return typeof C=="undefined"};B.noConflict=function(){u._=r;return this};B.identity=function(C){return C};B.times=function(F,E,D){for(var C=0;C<F;C++){E.call(D,C)}};B.breakLoop=function(){throw b};B.mixin=function(C){d(B.functions(C),function(D){q(D,B[D]=C[D])})};var k=0;B.uniqueId=function(C){var D=k++;return C?C+D:D};B.templateSettings={start:"<%",end:"%>",interpolate:/<%=(.+?)%>/g};B.template=function(F,E){var G=B.templateSettings;var D=new RegExp("'(?=[^"+G.end.substr(0,1)+"]*"+g(G.end)+")","g");var C=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj||{}){p.push('"+F.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(D,"✄").split("'").join("\\'").split("✄").join("'").replace(G.interpolate,"',$1,'").split(G.start).join("');").split(G.end).join("p.push('")+"');}return p.join('');");return E?C(E):C};B.each=B.forEach;B.foldl=B.inject=B.reduce;B.foldr=B.reduceRight;B.select=B.filter;B.all=B.every;B.any=B.some;B.contains=B.include;B.head=B.first;B.tail=B.rest;B.methods=B.functions;var h=function(C){this._wrapped=C};var o=function(D,C){return C?B(D).chain():D};var q=function(C,D){h.prototype[C]=function(){var E=B.toArray(arguments);w.call(E,this._wrapped);return o(D.apply(B,E),this._chain)}};B.mixin(B);d(["pop","push","reverse","shift","sort","splice","unshift"],function(C){var D=j[C];h.prototype[C]=function(){D.apply(this._wrapped,arguments);return o(this._wrapped,this._chain)}});d(["concat","join","slice"],function(C){var D=j[C];h.prototype[C]=function(){return o(D.apply(this._wrapped,arguments),this._chain)}});h.prototype.chain=function(){this._chain=true;return this};h.prototype.value=function(){return this._wrapped}})();(function(){jQuery.fn.autohide=function(a){var b=this;a=_.extend({clickable:null,onHide:null},a||{});b._autoignore=true;setTimeout(function(){delete b._autoignore},0);if(!b._autohider){b.forceHide=function(c){if(!c&&a.onHide){a.onHide()}b.hide();jQuery(document).unbind("click",b._autohider);jQuery(document).unbind("keypress",b._autohider);b._autohider=null;b.forceHide=null};b._autohider=function(c){if(b._autoignore){return}if(a.clickable&&(b[0]==c.target||_.include(jQuery(c.target).parents(),b[0]))){return}if(a.onHide&&!a.onHide(c)){return}b.forceHide(c)};jQuery(document).bind("click",this._autohider);jQuery(document).bind("keypress",this._autohider)}};jQuery.fn.acceptInput=function(b){var a={delay:1000,callback:null,className:"acceptInput",initialStateClassName:"acceptInput-awaitingActivity",typingStateClassName:"acceptInput-acceptingInput",inputClassName:"acceptInput-textField"};if(b){jQuery.extend(a,b)}this.editTimer=null;this.deny=function(){this.parent().addClass("stopAcceptingInput")};this.allow=function(){this.parent().removeClass("stopAcceptingInput")};this.each(function(d,e){if(jQuery(e).parent().hasClass(a.initialStateClassName)){return true}e=jQuery(e);var c=e.wrap('<span class="'+a.initialStateClassName+'"></span>');c=c.parent();var f=jQuery('<input type="text" class="'+a.inputClassName+'" style="display:none;" />').appendTo(c);f.bind("blur",function(){c.addClass(a.initialStateClassName).removeClass(a.typingStateClassName);f.hide();e.show()});f.bind("keyup",function(){var g=f.attr("value");e.text(g);if(a.changeCallBack){jQuery.fn.acceptInput.editTimer=setTimeout(a.changeCallBack,500)}});f.bind("keydown",function(){if(jQuery.fn.acceptInput.editTimer){clearTimeout(jQuery.fn.acceptInput.editTimer)}});c.bind("click",function(){if(c.hasClass("stopAcceptingInput")){return}if(c.hasClass(a.initialStateClassName)){var g=function(){c.addClass(a.initialStateClassName).removeClass(a.typingStateClassName)};jQuery(f).autohide({clickable:true,onHide:DV.jQuery.proxy(g,this)});e.hide();f.attr("value",e.text()).show()[0].focus();f[0].select();c.addClass(a.typingStateClassName).removeClass(a.initialStateClassName)}})});return this}}).call(this);(function(a){a.fn.placeholder=function(d){var e={message:"...",className:"placeholder",clearClassName:"show_cancel_search"};var b=a.extend({},e,d);var c=function(f){f.val(f.attr("placeholder")||b.message);f.addClass(b.className)};return this.each(function(){var f=a(this);if(f.attr("type")=="search"){return}f.bind("blur",function(){if(f.val()==""){c(f)}}).bind("focus",function(){if(f.val()==(f.attr("placeholder")||b.message)){f.val("")}f.removeClass(b.className)}).bind("keyup",function(){var g=f.val();if(g!=""&&g!=b.message){f.parent().addClass(b.clearClassName)}else{f.parent().removeClass(b.clearClassName)}});_.defer(function(){f.keyup().blur()})})}})(jQuery);window.console||(window.console={});console.log||(console.log=_.identity);window.DV=window.DV||{};DV.jQuery=jQuery.noConflict();DV.viewers=DV.viewers||{};DV.model=DV.model||{};DV.Annotation=function(a){this.position={top:a.top,left:a.left};this.dimensions={width:a.width,height:a.height};this.page=a.page;this.pageEl=a.pageEl;this.annotationContainerEl=a.annotationContainerEl;this.viewer=this.page.set.viewer;this.annotationEl=null;this.renderedHTML=a.renderedHTML;this.type=a.type;this.id=a.id;this.model=this.viewer.models.annotations.getAnnotation(this.id);this.state="collapsed";this.active=false;this.remove();this.add();if(a.active){this.viewer.helpers.setActiveAnnotationLimits(this);this.viewer.events.resetTracker();this.active=null;this.show();if(a.showEdit){this.showEdit()}}};DV.Annotation.prototype.add=function(){if(this.type==="page"){this.annotationEl=this.renderedHTML.insertBefore(this.annotationContainerEl)}else{if(this.page.annotations.length>0){for(var b=0,a=this.page.annotations.length;b<a;b++){if(this.page.annotations[b].id===this.id){return false}else{this.annotationEl=this.renderedHTML.appendTo(this.annotationContainerEl)}}}else{this.annotationEl=this.renderedHTML.appendTo(this.annotationContainerEl)}}};DV.Annotation.prototype.next=function(){this.hide.preventRemovalOfCoverClass=true;var a=this.viewer.models.annotations.getNextAnnotation(this.id);if(!a){return}this.page.set.showAnnotation({index:a.index,id:a.id,top:a.y1})};DV.Annotation.prototype.previous=function(){this.hide.preventRemovalOfCoverClass=true;var a=this.viewer.models.annotations.getPreviousAnnotation(this.id);if(!a){return}this.page.set.showAnnotation({index:a.index,id:a.id,top:a.y1})};DV.Annotation.prototype.show=function(a){if(this.viewer.activeAnnotation&&this.viewer.activeAnnotation.id!=this.id){this.viewer.activeAnnotation.hide()}this.viewer.annotationToLoadId=null;this.viewer.elements.window.addClass("DV-coverVisible");this.annotationEl.find("div.DV-annotationBG").css({display:"block",opacity:1});this.annotationEl.addClass("DV-activeAnnotation");this.page.activeAnnotation=this;this.viewer.activeAnnotation=this;this.viewer.helpers.addObserver("trackAnnotation");this.viewer.helpers.setActiveAnnotationInNav(this.id);this.active=true;this.pageEl.parent(".DV-set").addClass("DV-activePage");this.viewer.history.save("document/p"+(parseInt(this.page.index,10)+1)+"/a"+this.id);if(a&&a.edit){this.showEdit()}};DV.Annotation.prototype.hide=function(b){var a=parseInt(this.viewer.elements.currentPage.text(),10);if(this.type!=="page"){this.annotationEl.find("div.DV-annotationBG").css({opacity:0,display:"none"})}if(this.annotationEl.hasClass("DV-editing")){this.viewer.helpers.saveAnnotation({target:this.annotationEl},"onlyIfText")}this.annotationEl.removeClass("DV-editing DV-activeAnnotation");if(b===true){this.viewer.elements.window.removeClass("DV-coverVisible")}if(this.hide.preventRemovalOfCoverClass===false||!this.hide.preventRemovalOfCoverClass){this.viewer.elements.window.removeClass("DV-coverVisible");this.hide.preventRemovalOfCoverClass=false}this.page.activeAnnotation=null;this.viewer.activeAnnotation=null;this.viewer.helpers.removeObserver("trackAnnotation");this.viewer.pageSet.setActiveAnnotation(null);this.viewer.activeAnnotation=null;this.viewer.events.trackAnnotation.h=null;this.viewer.events.trackAnnotation.id=null;this.viewer.events.trackAnnotation.combined=null;this.viewer.helpers.setActiveAnnotationInNav();this.active=false;this.pageEl.parent(".DV-set").removeClass("DV-activePage");this.viewer.history.save("document/p"+a);this.removeConnector(true)};DV.Annotation.prototype.toggle=function(b){if(this.viewer.activeAnnotation&&(this.viewer.activeAnnotation!=this)){this.viewer.activeAnnotation.hide()}if(this.type==="page"){return}var a=this.annotationEl.find("div.DV-annotationBG");this.annotationEl.toggleClass("DV-activeAnnotation");if(this.active==true){this.hide(true)}else{this.show()}};DV.Annotation.prototype.drawConnector=function(){if(this.active!=true){this.viewer.elements.window.addClass("DV-annotationActivated");this.annotationEl.addClass("DV-annotationHover")}};DV.Annotation.prototype.removeConnector=function(a){if(this.active!=true){this.viewer.elements.window.removeClass("DV-annotationActivated");this.annotationEl.removeClass("DV-annotationHover")}};DV.Annotation.prototype.showEdit=function(){this.annotationEl.addClass("DV-editing");this.viewer.$(".DV-annotationTitleInput",this.annotationEl).focus()};DV.Annotation.prototype.remove=function(){this.viewer.$("#DV-annotation-"+this.id).remove()};DV.DragReporter=function(d,a,c,b){this.viewer=d;this.dragClassName="DV-dragging";this.sensitivity=1.5;this.oldPageY=0;_.extend(this,b);this.dispatcher=c;this.toWatch=this.viewer.$(a);this.boundReporter=_.bind(this.mouseMoveReporter,this);this.boundMouseUpReporter=_.bind(this.mouseUpReporter,this);this.boundMouseDownReporter=_.bind(this.mouseDownReporter,this);this.boundEase=_.bind(this.boundEase,this);this.setBinding()};DV.DragReporter.prototype.shouldIgnore=function(b){if(!this.ignoreSelector){return false}var a=this.viewer.$(b.target);return a.parents().is(this.ignoreSelector)||a.is(this.ignoreSelector)};DV.DragReporter.prototype.mouseUpReporter=function(a){if(this.shouldIgnore(a)){return true}a.preventDefault();clearInterval(this.updateTimer);this.stop()};DV.DragReporter.prototype.oldPositionUpdater=function(){this.oldPageY=this.pageY};DV.DragReporter.prototype.stop=function(){this.toWatch.removeClass(this.dragClassName);this.toWatch.unbind("mousemove")};DV.DragReporter.prototype.setBinding=function(){this.toWatch.mouseup(this.boundMouseUpReporter);this.toWatch.mousedown(this.boundMouseDownReporter)};DV.DragReporter.prototype.unBind=function(){this.toWatch.unbind("mouseup",this.boundMouseUpReporter);this.toWatch.unbind("mousedown",this.boundMouseDownReporter)};DV.DragReporter.prototype.destroy=function(){this.unBind();this.toWatch=null};DV.DragReporter.prototype.mouseDownReporter=function(a){if(this.shouldIgnore(a)){return true}a.preventDefault();this.pageY=a.pageY;this.pageX=a.pageX;this.oldPageY=a.pageY;this.updateTimer=setInterval(_.bind(this.oldPositionUpdater,this),1200);this.toWatch.addClass(this.dragClassName);this.toWatch.mousemove(this.boundReporter)};DV.DragReporter.prototype.mouseMoveReporter=function(b){if(this.shouldIgnore(b)){return true}b.preventDefault();var c=Math.round(this.sensitivity*(this.pageY-b.pageY));var a=(c>0)?"down":"up";this.pageY=b.pageY;if(c===0){return}this.dispatcher({event:b,delta:c,direction:a})};DV.Elements=function(a){this._viewer=a;_.each(DV.Schema.elements,_.bind(function(b){this.getElement(b)},this))};DV.Elements.prototype.getElement=function(b,a){this[b.name]=this._viewer.$(b.query)};DV.History=function(a){this.viewer=a;DV.History.count++;this.URL_CHECK_INTERVAL=500;this.USE_IFRAME=jQuery.browser.msie&&jQuery.browser.version<8;this.handlers=[];this.defaultCallback=null;this.hash=window.location.hash;_.bindAll(this,"checkURL");if(DV.History.count>1){return}DV.jQuery(_.bind(function(){if(this.USE_IFRAME){this.iframe=DV.jQuery('<iframe src="javascript:0"/>').hide().appendTo("body")[0].contentWindow}if("onhashchange" in window){window.onhashchange=this.checkURL}else{setInterval(this.checkURL,this.URL_CHECK_INTERVAL)}},this))};DV.History.count=0;DV.History.prototype={register:function(a,b){this.handlers.push({matcher:a,callback:b})},save:function(a){if(DV.History.count>1){return}window.location.hash=this.hash=(a?"#"+a:"");if(this.USE_IFRAME&&(this.iframe&&(this.hash!=this.iframe.location.hash))){this.iframe.document.open().close();this.iframe.location.hash=this.hash}},checkURL:function(){if(DV.History.count>1){return}try{var b=(this.USE_IFRAME?this.iframe:window).location.hash}catch(a){}if(!b||b==this.hash||"#"+b==this.hash||b==decodeURIComponent(this.hash)){return false}if(this.USE_IFRAME){window.location.hash=b}this.loadURL(true)},loadURL:function(c){var d=this.hash=window.location.hash;for(var b=this.handlers.length-1;b>=0;b--){var a=d.match(this.handlers[b].matcher);if(a){if(c===true){this.handlers[b].callback.apply(this.handlers[b].callback,a.slice(1,a.length))}return true}}if(this.defaultCallback!=null&&c===true){this.defaultCallback()}else{return false}}};DV.Page=function(d,c){this.viewer=d;this.index=c.index;for(var b in c){this[b]=c[b]}this.el=this.viewer.$(this.el);this.parent=this.el.parent();this.pageNumberEl=this.el.find("span.DV-pageNumber");this.pageInsertEl=this.el.find(".DV-pageNoteInsert");this.removedOverlayEl=this.el.find(".DV-removeOverlay");this.pageImageEl=this.getPageImage();this.pageEl=this.el.find("div.DV-page");this.annotationContainerEl=this.el.find("div.DV-annotations");this.coverEl=this.el.find("div.DV-cover");this.loadTimer=null;this.hasLayerPage=false;this.hasLayerRegional=false;this.imgSource=null;this.offset=null;this.pageNumber=null;this.zoom=1;this.annotations=[];this.activeAnnotation=null;var a=this.viewer.models;this.model_document=a.document;this.model_pages=a.pages;this.model_annotations=a.annotations;this.model_chapters=a.chapters;this.model_removedPages=a.removedPages};DV.Page.prototype.setPageImage=function(){this.pageImageEl=this.getPageImage()};DV.Page.prototype.getPageImage=function(){return this.el.find("img.DV-pageImage")};DV.Page.prototype.getOffset=function(){return this.model_document.offsets[this.index]};DV.Page.prototype.getPageNoteHeight=function(){return this.model_pages.pageNoteHeights[this.index]};DV.Page.prototype.draw=function(d){if(this.index===d.index&&!d.force&&this.imgSource==this.model_pages.imageURL(this.index)){return}this.index=(d.force===true)?this.index:d.index;var h=[];var f=this.model_pages.imageURL(this.index);if(this.imgSource!=f){this.imgSource=f;this.loadImage()}this.sizeImage();this.position();if(this.pageNumber!=this.index+1||d.forceAnnotationRedraw===true){for(var c=0;c<this.annotations.length;c++){this.annotations[c].remove();delete this.annotations[c];this.hasLayerRegional=false;this.hasLayerPage=false}this.annotations=[];var e=this.model_annotations.byPage[this.index];if(e){for(var c=0;c<e.length;c++){var b=e[c];if(b.id===this.viewer.annotationToLoadId){var g=true;if(b.id===this.viewer.annotationToLoadEdit){d.edit=true}this.viewer.helpers.jump(this.index,(b.y1||0)-37)}else{var g=false}if(b.type=="page"){this.hasLayerPage=true}else{if(b.type=="regional"){this.hasLayerRegional=true}}var a=new DV.Annotation({renderedHTML:this.viewer.$(".DV-allAnnotations .DV-annotation[rel=aid-"+b.id+"]").clone().attr("id","DV-annotation-"+b.id),id:b.id,page:this,pageEl:this.pageEl,annotationContainerEl:this.annotationContainerEl,pageNumber:this.pageNumber,state:"collapsed",top:b.y1,left:b.x1,width:b.x1+b.x2,height:b.y1+b.y2,active:g,showEdit:d.edit,type:b.type});this.annotations.push(a)}}console.log(["remove overlay",this.model_removedPages,this.index,this.pageNumber,!!this.model_removedPages[this.index+1],this.removedOverlayEl]);this.removedOverlayEl.toggleClass("visible",!!this.model_removedPages[this.index+1]);this.pageInsertEl.toggleClass("visible",!this.hasLayerPage);this.renderMeta({pageNumber:this.index+1})}this.setPageType()};DV.Page.prototype.setPageType=function(){if(this.annotations.length>0){if(this.hasLayerPage===true){this.el.addClass("DV-layer-page")}if(this.hasLayerRegional===true){this.el.addClass("DV-layer-page")}}else{this.el.removeClass("DV-layer-page DV-layer-regional")}};DV.Page.prototype.position=function(a){this.el.css({top:this.model_document.offsets[this.index]});this.offset=this.getOffset()};DV.Page.prototype.renderMeta=function(a){this.pageNumberEl.text("p. "+a.pageNumber);this.pageNumber=a.pageNumber};DV.Page.prototype.loadImage=function(c){if(this.loadTimer){clearTimeout(this.loadTimer);delete this.loadTimer}this.el.removeClass("DV-loaded").addClass("DV-loading");var a=this.model_pages;var b=this.viewer.$(new Image());var d=this;var e=function(){if(d.loadTimer){clearTimeout(d.loadTimer);delete d.loadTimer}b.bind("load readystatechange",function(g){if(this.complete||(this.readyState=="complete"&&g.type=="readystatechange")){if(b[0].src!=d._currentSrc){return}a.updateHeight(b[0],d.index);d.drawImage(b[0].src);clearTimeout(d.loadTimer);delete d.loadTimer}});var f=d.model_pages.imageURL(d.index);d._currentSrc=f;b[0].src=f};this.loadTimer=setTimeout(e,150);this.viewer.pageSet.redraw()};DV.Page.prototype.sizeImage=function(){var b=this.model_pages.width;var a=this.model_pages.getPageHeight(this.index);this.coverEl.css({width:b,height:a});this.pageImageEl.css({width:b,height:a});this.el.css({height:a,width:b});this.pageEl.css({height:a,width:b})};DV.Page.prototype.drawImage=function(b){var a=this.model_pages.getPageHeight(this.index);if(b==this.pageImageEl.attr("src")&&a==this.pageImageEl.attr("height")){this.el.addClass("DV-loaded").removeClass("DV-loading");return}this.pageImageEl.replaceWith('<img width="'+this.model_pages.width+'" height="'+a+'" class="DV-pageImage" src="'+b+'" />');this.setPageImage();this.sizeImage();this.el.addClass("DV-loaded").removeClass("DV-loading")};DV.PageSet=function(a){this.currentPage=null;this.pages={};this.viewer=a;this.zoomText()};DV.PageSet.prototype.execute=function(a,b){this.pages.each(function(c){c[a].apply(c,b)})};DV.PageSet.prototype.buildPages=function(b){b=b||{};var a=this.getPages();for(var c=0;c<a.length;c++){var d=a[c];d.set=this;d.index=c;this.pages[d.label]=new DV.Page(this.viewer,d);if(d.currentPage==true){this.currentPage=this.pages[d.label]}}this.viewer.models.annotations.renderAnnotations()};DV.PageSet.prototype.getPages=function(){var a=[];this.viewer.elements.sets.each(function(d,c){var b=(d==0)?true:false;a.push({label:"p"+d,el:c,index:d,pageNumber:d+1,currentPage:b})});return a};DV.PageSet.prototype.reflowPages=function(){this.viewer.models.pages.resize();this.viewer.helpers.setActiveAnnotationLimits();this.redraw(false,true)};DV.PageSet.prototype.simpleReflowPages=function(){this.viewer.helpers.setActiveAnnotationLimits();this.redraw(false,false)};DV.PageSet.prototype.cleanUp=function(){if(this.viewer.activeAnnotation){this.viewer.activeAnnotation.hide(true)}};DV.PageSet.prototype.zoom=function(d){if(this.viewer.models.document.zoomLevel===d.zoomLevel){return}var e=this.viewer.models.document.currentIndex();var g=e-1;var c=this.viewer.models.document.offsets[e];var j=this.viewer.models.document.zoomLevel*1;var b=this.viewer.elements.window.scrollTop();this.viewer.models.document.zoom(d.zoomLevel);var h=(parseInt(b,10)>parseInt(c,10))?b-c:c-b;var a=h/this.viewer.models.pages.height;this.reflowPages();this.zoomText();if(this.viewer.activeAnnotation!=null){var f={index:this.viewer.models.document.currentIndex(),top:this.viewer.activeAnnotation.y1,id:this.viewer.activeAnnotation.id};this.viewer.activeAnnotation=null;this.showAnnotation(f);this.viewer.helpers.setActiveAnnotationLimits(this.viewer.activeAnnotation)}else{var i=Math.round(this.viewer.models.pages.height*a);this.viewer.helpers.jump(this.viewer.models.document.currentIndex(),i)}};DV.PageSet.prototype.zoomText=function(){var b=this.viewer.models.pages.DEFAULT_PADDING;var a=this.viewer.models.pages.zoomLevel;this.viewer.$(".DV-textContents").width(a-b);this.viewer.$(".DV-textPage").width(a);if(this.viewer.options.zoom=="auto"){b=this.viewer.models.pages.REDUCED_PADDING}this.viewer.elements.collection.css({width:a+b})};DV.PageSet.prototype.draw=function(a){for(var c=0,b=a.length;c<b;c++){var d=this.pages[a[c].label];if(d){d.draw({index:a[c].index,pageNumber:a[c].index+1})}}};DV.PageSet.prototype.redraw=function(a,c){var b=this.viewer.models.document.currentIndex();if(this.pages.p0){this.pages.p0.draw({force:true,forceAnnotationRedraw:c})}if(this.pages.p1){this.pages.p1.draw({force:true,forceAnnotationRedraw:c})}if(this.pages.p2){this.pages.p2.draw({force:true,forceAnnotationRedraw:c})}if(c&&this.viewer.activeAnnotation){this.viewer.helpers.jump(this.viewer.activeAnnotation.page.index,this.viewer.activeAnnotation.position.top-37)}};DV.PageSet.prototype.setActiveAnnotation=function(b,a){this.viewer.annotationToLoadId=b;this.viewer.annotationToLoadEdit=a?b:null};DV.PageSet.prototype.showAnnotation=function(d,b){b=b||{};if(this.viewer.state==="ViewAnnotation"){var f=this.viewer.$(".DV-allAnnotations div[rel=aid-"+d.id+"]")[0].offsetTop;this.viewer.elements.window.scrollTop(f+10,"fast");this.viewer.helpers.setActiveAnnotationInNav(d.id);this.viewer.activeAnnotationId=d.id;this.viewer.history.save("annotation/a"+d.id);return}else{this.viewer.helpers.removeObserver("trackAnnotation");this.viewer.activeAnnotationId=null;if(this.viewer.activeAnnotation!=null){this.viewer.activeAnnotation.hide()}this.setActiveAnnotation(d.id,b.edit);var e=this.viewer.models.annotations.byId[d.id].type=="page";var a=e?-7:36;var f=(d.top*this.viewer.models.pages.zoomFactor())-a;for(var c=0;c<=2;c++){if(this.pages["p"+c]){for(var g=0;g<this.pages["p"+c].annotations.length;g++){if(this.pages["p"+c].annotations[g].id===d.id){this.viewer.helpers.jump(d.index,f);this.pages["p"+c].annotations[g].show(b);return}}}}this.viewer.helpers.jump(d.index,f)}};DV.Schema=function(){this.models={};this.views={};this.states={};this.helpers={};this.events={};this.elements={};this.text={};this.data={zoomLevel:700,pageWidthPadding:20,additionalPaddingOnPage:30,state:{page:{previous:0,current:0,next:1}}}};DV.Schema.prototype.importCanonicalDocument=function(a){a.sections=a.sections||[];a.annotations=a.annotations||[];a.canonicalURL=a.canonical_url;this.document=DV.jQuery.extend(true,{},a);this.data.title=a.title;this.data.totalPages=a.pages;this.data.totalAnnotations=a.annotations.length;this.data.sections=a.sections;this.data.chapters=[];this.data.annotationsById={};this.data.annotationsByPage={};_.each(a.annotations,DV.jQuery.proxy(this.loadAnnotation,this))};DV.Schema.prototype.loadAnnotation=function(b){if(b.id){b.server_id=b.id}var a=b.page-1;b.id=_.uniqueId();b.title=b.title||"Untitled Note";b.text=b.content||"";b.access=b.access||"public";b.type=b.location&&b.location.image?"region":"page";if(b.type==="region"){var e=DV.jQuery.map(b.location.image.split(","),function(g,f){return parseInt(g,10)});b.y1=e[0];b.x2=e[1];b.y2=e[2];b.x1=e[3]}else{if(b.type==="page"){b.y1=0;b.x2=0;b.y2=0;b.x1=0}}this.data.annotationsById[b.id]=b;var d=this.data.annotationsByPage[a]=this.data.annotationsByPage[a]||[];var c=_.sortedIndex(d,b,function(f){return f.y1});d.splice(c,0,b);return b};DV.Schema.elements=[{name:"browserDocument",query:document},{name:"browserWindow",query:window},{name:"header",query:"div.DV-header"},{name:"viewer",query:"div.DV-docViewer"},{name:"window",query:"div.DV-pages"},{name:"sets",query:"div.DV-set"},{name:"pages",query:"div.DV-page"},{name:"metas",query:"div.DV-pageMeta"},{name:"bar",query:"div.DV-bar"},{name:"currentPage",query:"span.DV-currentPage"},{name:"well",query:"div.DV-well"},{name:"collection",query:"div.DV-pageCollection"},{name:"annotations",query:"div.DV-allAnnotations"},{name:"navigation",query:"div.DV-navigation"},{name:"chaptersContainer",query:"div.DV-chaptersContainer"},{name:"searchInput",query:"input.DV-searchInput"},{name:"textCurrentPage",query:"span.DV-textCurrentPage"},{name:"textContents",query:".DV-textContents"},{name:"coverPages",query:"div.DV-cover"},{name:"fullscreen",query:"div.DV-fullscreen"}];DV.model.Annotations=function(a){this.LEFT_MARGIN=25;this.PAGE_NOTE_FUDGE=26;this.viewer=a;this.offsetsAdjustments=[];this.offsetAdjustmentSum=0;this.saveCallbacks=[];this.deleteCallbacks=[];this.byId=this.viewer.schema.data.annotationsById;this.byPage=this.viewer.schema.data.annotationsByPage;this.bySortOrder=this.sortAnnotations()};DV.model.Annotations.prototype={render:function(e){var c=this.viewer.models.document;var d=this.viewer.models.pages;var i=d.zoomFactor();var j=e;var b,a,g,f;if(j.type==="page"){b=a=g=f=0;j.top=0}else{g=Math.round(j.y1*i);f=Math.round(j.y2*i);if(b<this.LEFT_MARGIN){b=this.LEFT_MARGIN}b=Math.round(j.x1*i);a=Math.round(j.x2*i);j.top=g-6}j.width=d.width;j.pageNumber=j.page;j.bgWidth=j.width;j.bWidth=j.width-66;j.excerptWidth=(a-b)-10;j.excerptMarginLeft=b-18;j.excerptLeft=b-25;j.excerptHeight=f-g;j.index=j.page-1;j.image=d.imageURL(j.index);j.imageLeft=b;j.imageTop=g+2;j.imageWidth=d.width;j.imageHeight=Math.round(d.height*i);j.regionLeft=b;j.regionWidth=a-b;j.regionHeight=f-g;j.excerptDSHeight=j.excerptHeight-6;j.DSOffset=3;j.orderClass="";j.options=this.viewer.options;if(j.position==1){j.orderClass+=" DV-firstAnnotation"}if(j.position==this.bySortOrder.length){j.orderClass+=" DV-lastAnnotation"}var h=(j.type==="page")?"pageAnnotation":"annotation";return JST[h](j)},sortAnnotations:function(){return this.bySortOrder=_.sortBy(_.values(this.byId),function(a){return a.page*10000+a.y1})},renderAnnotations:function(){for(var b=0;b<this.bySortOrder.length;b++){var a=this.bySortOrder[b];a.of=_.indexOf(this.byPage[a.page-1],a);a.position=b+1;a.html=this.render(a)}this.renderAnnotationsByIndex()},renderAnnotationsByIndex:function(){var b=_.map(this.bySortOrder,function(c){return c.html});var a=b.join("").replace(/id="DV-annotation-(\d+)"/g,function(c,d){return'id="DV-listAnnotation-'+d+'" rel="aid-'+d+'"'});this.viewer.$("div.DV-allAnnotations").html(a);this.renderAnnotationsByIndex.rendered=true;this.renderAnnotationsByIndex.zoomLevel=this.zoomLevel;this.updateAnnotationOffsets()},refreshAnnotation:function(a){var b=this.viewer;b.$("#DV-annotation-"+a.id+", #DV-listAnnotation-"+a.id).each(function(){b.$(".DV-annotationTitleInput",this).val(a.title);b.$(".DV-annotationTitle",this).text(a.title);b.$(".DV-annotationTextArea",this).val(a.text);b.$(".DV-annotationBody",this).html(a.text)})},removeAnnotation:function(b){delete this.byId[b.id];var a=b.page-1;this.byPage[a]=_.without(this.byPage[a],b);this.sortAnnotations();this.viewer.$("#DV-annotation-"+b.id+", #DV-listAnnotation-"+b.id).remove();this.viewer.api.redraw(true)},updateAnnotationOffsets:function(){this.offsetsAdjustments=[];this.offsetAdjustmentSum=0;var a=this.viewer.models.document;var b=this.viewer.$("div.DV-allAnnotations");var g=b.find(".DV-pageNote");var c=this.viewer.models.pages.pageNoteHeights;var f=this;if(this.viewer.$("div.DV-docViewer").hasClass("DV-viewAnnotations")==false){b.addClass("DV-getHeights")}var h=[];_.each(_.select(this.bySortOrder,function(i){return i.type=="page"}),function(l,k){l.el=g[k];h[l.pageNumber]=l});for(var d=0,e=a.totalPages;d<=e;d++){c[d]=0;if(h[d]){var j=(this.viewer.$(h[d].el).height()+this.PAGE_NOTE_FUDGE);c[d-1]=j;this.offsetAdjustmentSum+=j}this.offsetsAdjustments[d]=this.offsetAdjustmentSum}b.removeClass("DV-getHeights")},fireSaveCallbacks:function(a){_.each(this.saveCallbacks,function(b){b(a)})},fireDeleteCallbacks:function(a){_.each(this.deleteCallbacks,function(b){b(a)})},getAnnotations:function(a){return this.byPage[a]},getFirstAnnotation:function(){return _.first(this.bySortOrder)},getNextAnnotation:function(a){var b=this.byId[a];return this.bySortOrder[_.indexOf(this.bySortOrder,b)+1]},getPreviousAnnotation:function(a){var b=this.byId[a];return this.bySortOrder[_.indexOf(this.bySortOrder,b)-1]},getAnnotation:function(a){if(a.id){return this.byId[a.id]}if(a.index&&!a.id){throw new Error("looked up an annotation without an id")}return this.byId[a]}};DV.model.Chapters=function(a){this.viewer=a;this.loadChapters()};DV.model.Chapters.prototype={loadChapters:function(){var a=this.chapters=this.viewer.schema.data.chapters=[];_.each(this.viewer.schema.data.sections,function(e){e.id=e.id||_.uniqueId();var c=e.pages.split("-");var f=parseInt(c[0],10);var b=parseInt(c[0],10);for(var d=c[0]-1;d<c[1];d++){a[d]=e.id}})},getChapterId:function(a){return this.chapters[a]},getChapterPosition:function(c){for(var b=0,a=this.chapters.length;b<a;b++){if(this.chapters[b]===c){return b}}}};DV.model.Document=function(d){this.viewer=d;this.currentPageIndex=0;this.offsets=[];this.baseHeightsPortion=[];this.baseHeightsPortionOffsets=[];this.paddedOffsets=[];this.totalDocumentHeight=0;this.totalPages=0;this.additionalPaddingOnPage=0;this.ZOOM_RANGES=[500,700,800,900,1000];var c=this.viewer.schema.data;this.state=c.state;this.baseImageURL=c.baseImageURL;this.canonicalURL=c.canonicalURL;this.additionalPaddingOnPage=c.additionalPaddingOnPage;this.pageWidthPadding=c.pageWidthPadding;this.totalPages=c.totalPages;var b=this.zoomLevel=this.viewer.options.zoom||c.zoomLevel;if(b=="auto"){this.zoomLevel=c.zoomLevel}var a=_.last(this.ZOOM_RANGES);if(this.zoomLevel>a){this.zoomLevel=a}};DV.model.Document.prototype={setPageIndex:function(a){this.currentPageIndex=a;this.viewer.elements.currentPage.text(this.currentPage());this.viewer.helpers.setActiveChapter(this.viewer.models.chapters.getChapterId(a));return a},currentPage:function(){return this.currentPageIndex+1},currentIndex:function(){return this.currentPageIndex},nextPage:function(){var a=this.currentIndex()+1;if(a>=this.totalPages){return this.currentIndex()}return this.setPageIndex(a)},previousPage:function(){var a=this.currentIndex()-1;if(a<0){return this.currentIndex()}return this.setPageIndex(a)},zoom:function(b,a){if(this.zoomLevel!=b||a===true){this.zoomLevel=b;this.viewer.models.pages.resize(this.zoomLevel);this.viewer.models.annotations.renderAnnotations();this.computeOffsets()}},computeOffsets:function(){var m=this.viewer.models.annotations;var j=0;var f=0;var e=this.totalPages;var k=0;var a=this.viewer.elements.window[0].scrollTop;for(var c=0;c<e;c++){if(m.offsetsAdjustments[c]){f=m.offsetsAdjustments[c]}var b=this.viewer.models.pages.getPageHeight(c);var g=this.offsets[c]||0;var d=this.offsets[c]=f+j;if((g!==d)&&(d<a)){var l=d-g-k;a+=l;k+=l}this.baseHeightsPortion[c]=Math.round((b+this.additionalPaddingOnPage)/3);this.baseHeightsPortionOffsets[c]=(c==0)?0:d-this.baseHeightsPortion[c];j+=(b+this.additionalPaddingOnPage)}if(j!=this.totalDocumentHeight){k=(this.totalDocumentHeight!=0)?k:j-this.totalDocumentHeight;this.viewer.helpers.setDocHeight(j,k);this.totalDocumentHeight=j}},getOffset:function(a){return this.offsets[a]},resetRemovedPages:function(){this.viewer.models.removedPages={};console.log(["Reset",this.viewer.models.removedPages])},addPageToRemovedPages:function(a){this.viewer.models.removedPages[a]=true;console.log(["Added",a,this.viewer.models.removedPages])},removePageFromRemovedPages:function(a){this.viewer.models.removedPages[a]=false;console.log(["Removed",a,this.viewer.models.removedPages])},removePages:function(c,a,b){b=b||{};$.ajax({url:"/documents/"+c+"/remove_pages",type:"POST",data:{pages:a},dataType:"json",success:function(d){if(b.success){b.success(c,d)}},error:_.bind(function(d){this._handleError(model,b.error,null,d)},this)})}};DV.model.Pages=function(a){this.viewer=a;this.averageHeight=0;this.pageHeights=[];this.pageNoteHeights=[];this.BASE_WIDTH=700;this.BASE_HEIGHT=906;this.SCALE_FACTORS={"500":0.714,"700":1,"800":0.8,"900":0.9,"1000":1};this.DEFAULT_PADDING=100;this.REDUCED_PADDING=44;this.zoomLevel=this.viewer.models.document.zoomLevel;this.baseWidth=this.BASE_WIDTH;this.baseHeight=this.BASE_HEIGHT;this.width=this.zoomLevel;this.height=this.baseHeight*this.zoomFactor();this.numPagesLoaded=0};DV.model.Pages.prototype={imageURL:function(c){var b=this.viewer.schema.document.resources.page.image;var d=this.zoomLevel>this.BASE_WIDTH?"large":"normal";var a=c+1;if(this.viewer.schema.document.resources.page.zeropad){a=this.zeroPad(a,5)}b=b.replace(/\{size\}/,d);b=b.replace(/\{page\}/,a);return b},zeroPad:function(b,c){var a=b.toString();while(a.length<c){a="0"+a}return a},zoomFactor:function(){return this.zoomLevel/this.BASE_WIDTH},resize:function(d){var b=this.viewer.models.pages.DEFAULT_PADDING;if(d){if(d==this.zoomLevel){return}var a=this.zoomFactor();this.zoomLevel=d||this.zoomLevel;var c=this.zoomFactor()-a+1;this.width=Math.round(this.baseWidth*this.zoomFactor());this.height=Math.round(this.height*c);this.averageHeight=Math.round(this.averageHeight*c)}this.viewer.elements.sets.width(this.zoomLevel);this.viewer.elements.collection.css({width:this.width+b});this.viewer.elements.textContents.css({"font-size":this.zoomLevel*0.02+"px"})},updateHeight:function(d,b){var c=this.getPageHeight(b);if(c===d.height){return}var a=d.height*(this.zoomLevel>this.BASE_WIDTH?0.7:1);this.setPageHeight(b,a);this.updateBaseHeightBasedOnAveragePageHeight(d);this.viewer.models.document.computeOffsets();this.viewer.pageSet.simpleReflowPages()},updateBaseHeightBasedOnAveragePageHeight:function(a){this.averageHeight=((this.averageHeight*this.numPagesLoaded)+a.height)/(this.numPagesLoaded+1);this.numPagesLoaded+=1;if(this.updateTimeout){clearTimeout(this.updateTimeout)}this.updateTimeout=setTimeout(_.bind(function(){this.updateTimeout=null;var b=Math.round(this.averageHeight);if(Math.abs(b-this.height)>10){this.baseHeight=b;this.height=Math.round(this.baseHeight*this.zoomFactor());this.viewer.models.document.computeOffsets();this.viewer.pageSet.simpleReflowPages()}},this),100)},setPageHeight:function(a,b){this.pageHeights[a]=b},getPageHeight:function(a){var b=this.pageHeights[a];return b?b*this.zoomFactor():this.height}};DV.Schema.events={zoom:function(b){this.viewer.pageSet.zoom({zoomLevel:b});var a=this.viewer.models.document.ZOOM_RANGES;if(a[a.length-1]==b){this.viewer.dragReporter.sensitivity=1.5}else{this.viewer.dragReporter.sensitivity=1}},drawPages:function(){if(this.viewer.state!="ViewDocument"){return}var e=this.models.document;var d=e.baseHeightsPortionOffsets;var g=this.viewer.scrollPosition=this.elements.window[0].scrollTop;var b=_.sortedIndex(d,g);if(d[b]==g){b++}var a=b-1;var f=this.helpers.sortPages(a);var c=e.totalPages;if(e.currentPage()!=b){e.setPageIndex(a)}this.drawPageAt(f,a)},drawPageAt:function(e,b){var d=b==0;var c=b==this.models.document.totalPages-1;if(d){b+=1}var a=[{label:e[0],index:b-1},{label:e[1],index:b},{label:e[2],index:b+1}];if(c){a.pop()}a[d?0:a.length-1].currentPage=true;this.viewer.pageSet.draw(a)},check:function(){var b=this.viewer;if(b.busy===false){b.busy=true;for(var a=0;a<this.viewer.observers.length;a++){this[b.observers[a]].call(this)}b.busy=false}},loadText:function(a,f){a=(!a)?this.models.document.currentIndex():parseInt(a,10);this._previousTextIndex=a;var d=this;var b=function(i){var h=parseInt(a,10)+1;d.viewer.$(".DV-textContents").text(i);d.elements.currentPage.text(h);d.elements.textCurrentPage.text("p. "+(h));d.models.document.setPageIndex(a);d.helpers.setActiveChapter(d.models.chapters.getChapterId(a));if(f){f.call(d.helpers)}};if(d.viewer.schema.text[a]){return b(d.viewer.schema.text[a])}var c=DV.jQuery.proxy(function(h){b(d.viewer.schema.text[a]=h)},this);this.viewer.$(".DV-textContents").text("");var g=d.viewer.schema.document.resources.page.text.replace("{page}",a+1);var e=this.helpers.isCrossDomain(g);if(e){g+="?callback=?"}DV.jQuery[e?"getJSON":"get"](g,{},c)},resetTracker:function(){this.viewer.activeAnnotation=null;this.trackAnnotation.combined=null;this.trackAnnotation.h=null},trackAnnotation:function(){var e=this.viewer;var d=this.helpers;var b=this.elements.window[0].scrollTop;if(e.activeAnnotation){var a=e.activeAnnotation;var c=this.trackAnnotation;if(c.id!=a.id){c.id=a.id;d.setActiveAnnotationLimits(a)}if(!e.activeAnnotation.annotationEl.hasClass("DV-editing")&&(b>(c.h)||b<c.combined)){a.hide(true);e.pageSet.setActiveAnnotation(null);e.activeAnnotation=null;c.h=null;c.id=null;c.combined=null}}else{e.pageSet.setActiveAnnotation(null);e.activeAnnotation=null;c.h=null;c.id=null;c.combined=null;d.removeObserver("trackAnnotation")}}};DV.Schema.events.ViewAnnotation={next:function(d){var f=this.viewer;var b=f.activeAnnotationId;var a=this.models.annotations;var c=(b===null)?a.getFirstAnnotation():a.getNextAnnotation(b);if(!c){return false}f.pageSet.showAnnotation(c);this.helpers.setAnnotationPosition(c.position)},previous:function(d){var f=this.viewer;var c=f.activeAnnotationId;var a=this.models.annotations;var b=(!c)?a.getFirstAnnotation():a.getPreviousAnnotation(c);if(!b){return false}f.pageSet.showAnnotation(b);this.helpers.setAnnotationPosition(b.position)},search:function(a){a.preventDefault();this.viewer.open("ViewSearch");return false}};DV.Schema.events.ViewDocument={next:function(){var a=this.models.document.nextPage();this.helpers.jump(a);this.viewer.history.save("document/p"+(a+1))},previous:function(b){var a=this.models.document.previousPage();this.helpers.jump(a);this.viewer.history.save("document/p"+(a+1))},search:function(a){a.preventDefault();this.viewer.open("ViewSearch");return false}};DV.Schema.events.ViewSearch={next:function(b){var a=this.models.document.nextPage();this.loadText(a)},previous:function(b){var a=this.models.document.previousPage();this.loadText(a)},search:function(a){a.preventDefault();this.helpers.getSearchResponse(this.elements.searchInput.val());return false}};DV.Schema.events.ViewText={next:function(b){var a=this.models.document.nextPage();this.loadText(a);this.viewer.history.save("text/p"+(a+1))},previous:function(b){var a=this.models.document.previousPage();this.loadText(a);this.viewer.history.save("text/p"+(a+1))},search:function(a){a.preventDefault();this.viewer.open("ViewSearch");return false}};_.extend(DV.Schema.events,{handleHashChangeViewDocumentPage:function(b){var a=parseInt(b,10)-1;if(this.viewer.state==="ViewDocument"){this.viewer.pageSet.cleanUp();this.helpers.jump(a)}else{this.models.document.setPageIndex(a);this.viewer.open("ViewDocument")}},handleHashChangeLegacyViewDocumentPage:function(b){var a=parseInt(b,10)-1;this.handleHashChangeViewDocumentPage(b)},handleHashChangeViewDocumentAnnotation:function(c,b){var a=parseInt(c,10)-1;var b=parseInt(b,10);if(this.viewer.state==="ViewDocument"){this.viewer.pageSet.showAnnotation(this.viewer.models.annotations.byId[b])}else{this.models.document.setPageIndex(a);this.viewer.pageSet.setActiveAnnotation(b);this.viewer.open("ViewDocument")}},handleHashChangeViewAnnotationAnnotation:function(a){var a=parseInt(a,10);var b=this.viewer;if(b.state==="ViewAnnotation"){b.pageSet.showAnnotation(this.viewer.models.annotations.byId[a])}else{b.activeAnnotationId=a;this.viewer.open("ViewAnnotation")}},handleHashChangeDefault:function(){this.viewer.pageSet.cleanUp();this.models.document.setPageIndex(0);if(this.viewer.state==="ViewDocument"){this.helpers.jump(0);this.viewer.history.save("document/p1")}else{this.viewer.open("ViewDocument")}},handleHashChangeViewText:function(b){var a=parseInt(b,10)-1;if(this.viewer.state==="ViewText"){this.events.loadText(a)}else{this.models.document.setPageIndex(a);this.viewer.open("ViewText")}},handleHashChangeViewSearchRequest:function(c,b){var a=parseInt(c,10)-1;this.elements.searchInput.val(decodeURIComponent(b));if(this.viewer.state!=="ViewSearch"){this.models.document.setPageIndex(a)}this.viewer.open("ViewSearch")},handleHashChangeViewEntity:function(c,a,d,b){c=parseInt(c,10)-1;a=decodeURIComponent(a);this.elements.searchInput.val(a);this.models.document.setPageIndex(c);this.states.ViewEntity(a,parseInt(d,10),parseInt(b,10))}});_.extend(DV.Schema.events,{handleNavigation:function(h){var f=this.viewer.$(h.target);var d=f.parent();if(f.hasClass("DV-trigger")||d.hasClass("DV-trigger")){if(f.hasClass("DV-expander")){return d.parent().toggleClass("DV-expanded")}else{if(d.hasClass("DV-first")){d.parent().addClass("DV-expanded");var i=parseInt(d.parent()[0].id.replace("DV-chapter-",""),10);var c=parseInt(this.models.chapters.getChapterPosition(i),10);var b=parseInt(c,10)+1;if(this.viewer.state==="ViewText"){this.loadText(c);this.viewer.history.save("text/p"+b)}else{if(this.viewer.state==="ViewDocument"){this.helpers.jump(c);this.viewer.history.save("document/p"+b)}else{return false}}}else{if(d[0].tagName.toUpperCase()==="DIV"){var g=d[0].id.replace("DV-annotationMarker-","");var a=this.models.annotations.getAnnotation(g);var b=parseInt(a.index,10)+1;if(this.viewer.state==="ViewText"){this.loadText(a.index);this.viewer.history.save("text/p"+b)}else{this.viewer.pageSet.showAnnotation(a)}}else{return false}}}}}});DV.Schema.helpers={HOST_EXTRACTOR:(/https?:\/\/([^\/]+)\//),BLANK_GIF:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",annotationClassName:".DV-annotation",bindEvents:function(a){var c=this.events.compile("zoom");var i=a.models.document;var j=_.indexOf(i.ZOOM_RANGES,i.zoomLevel)*24.7;var d=this.viewer;d.slider=d.$(".DV-zoomBox").slider({step:24.7,value:j,slide:function(l,m){c(a.models.document.ZOOM_RANGES[parseInt(m.value/24.7,10)])},change:function(l,m){c(a.models.document.ZOOM_RANGES[parseInt(m.value/24.7,10)])}});var f=d.history;var g=d.compiled;g.next=this.events.compile("next");g.previous=this.events.compile("previous");var k=a.states;d.$(".DV-navControls").delegate("span.DV-next","click",g.next);d.$(".DV-navControls").delegate("span.DV-previous","click",g.previous);d.$(".DV-annotationView").delegate(".DV-trigger","click",function(l){l.preventDefault();a.open("ViewAnnotation")});d.$(".DV-documentView").delegate(".DV-trigger","click",function(l){f.save("document/p"+a.models.document.currentPage());a.open("ViewDocument")});d.$(".DV-textView").delegate(".DV-trigger","click",function(l){f.save("text/p"+a.models.document.currentPage());a.open("ViewText")});d.$(".DV-allAnnotations").delegate(".DV-annotationGoto .DV-trigger","click",DV.jQuery.proxy(this.gotoPage,this));d.$("form.DV-searchDocument").submit(this.events.compile("search"));d.$(".DV-searchBar").delegate(".DV-closeSearch","click",function(l){l.preventDefault();f.save("text/p"+a.models.document.currentPage());a.open("ViewText")});d.$(".DV-searchBox").delegate(".DV-searchInput-cancel","click",DV.jQuery.proxy(this.clearSearch,this));d.$(".DV-searchResults").delegate("span.DV-resultPrevious","click",DV.jQuery.proxy(this.highlightPreviousMatch,this));d.$(".DV-searchResults").delegate("span.DV-resultNext","click",DV.jQuery.proxy(this.highlightNextMatch,this));d.$(".DV-trigger").bind("selectstart",function(){return false});d.$(".DV-footer").delegate(".DV-fullscreen","click",_.bind(this.openFullScreen,this));var h=DV.jQuery.proxy(this.annotationBridgeToggle,this);var e=this.elements.collection;e.delegate(".DV-annotationTab","click",h);e.delegate(".DV-annotationRegion","click",DV.jQuery.proxy(this.annotationBridgeShow,this));e.delegate(".DV-annotationNext","click",DV.jQuery.proxy(this.annotationBridgeNext,this));e.delegate(".DV-annotationPrevious","click",DV.jQuery.proxy(this.annotationBridgePrevious,this));e.delegate(".DV-showEdit","click",DV.jQuery.proxy(this.showAnnotationEdit,this));e.delegate(".DV-cancelEdit","click",DV.jQuery.proxy(this.cancelAnnotationEdit,this));e.delegate(".DV-saveAnnotation","click",DV.jQuery.proxy(this.saveAnnotation,this));e.delegate(".DV-deleteAnnotation","click",DV.jQuery.proxy(this.deleteAnnotation,this));d.$(".DV-descriptionToggle").live("click",function(l){l.preventDefault();l.stopPropagation();d.$(".DV-descriptionText").slideToggle(300,function(){d.$(".DV-descriptionToggle").toggleClass("DV-showDescription")})});var b=DV.jQuery.proxy(d.pageSet.cleanUp,this);this.elements.window.live("mousedown",function(m){var l=d.$(m.target);if(l.parents().is(".DV-annotation")||l.is(".DV-annotation")){return true}if(a.elements.window.hasClass("DV-coverVisible")){if((l.width()-parseInt(m.clientX,10))>=15){b()}}});if(jQuery.browser.msie==true){this.elements.browserDocument.bind("focus",DV.jQuery.proxy(this.focusWindow,this));this.elements.browserDocument.bind("focusout",DV.jQuery.proxy(this.focusOut,this))}else{this.elements.browserWindow.bind("focus",DV.jQuery.proxy(this.focusWindow,this));this.elements.browserWindow.bind("blur",DV.jQuery.proxy(this.blurWindow,this))}this.elements.window.bind("scroll",DV.jQuery.proxy(this.focusWindow,this));this.elements.coverPages.live("mousedown",b);d.acceptInput=this.elements.currentPage.acceptInput({changeCallBack:DV.jQuery.proxy(this.acceptInputCallBack,this)})},startCheckTimer:function(){var b=this.viewer;var a=function(){b.events.check()};this.viewer.checkTimer=setInterval(a,100)},stopCheckTimer:function(){clearTimeout(this.viewer.checkTimer)},blurWindow:function(){if(this.viewer.isFocus===true){this.viewer.isFocus=false;this.stopCheckTimer()}else{return}},focusOut:function(){if(this.viewer.activeElement!=document.activeElement){this.viewer.activeElement=document.activeElement;this.viewer.isFocus=true}else{this.viewer.isFocus=false;this.viewer.helpers.stopCheckTimer();return}},focusWindow:function(){if(this.viewer.isFocus===true){return}else{this.viewer.isFocus=true;this.startCheckTimer()}},setDocHeight:function(a,b){this.elements.window[0].scrollTop+=b;this.elements.bar.css("height",a)},getWindowDimensions:function(){var a={height:window.innerHeight?window.innerHeight:this.elements.browserWindow.height(),width:this.elements.browserWindow.width()};return a},isCrossDomain:function(b){var a=b.match(this.HOST_EXTRACTOR);return a&&(a[1]!=window.location.host)},resetScrollState:function(){this.elements.window.scrollTop(0)},gotoPage:function(c){c.preventDefault();var b=this.viewer.$(c.target).parents(".DV-annotation").attr("rel").replace("aid-","");var a=this.models.annotations.getAnnotation(b);var d=this.viewer;if(d.state!=="ViewDocument"){this.models.document.setPageIndex(a.index);d.open("ViewDocument");this.viewer.history.save("document/p"+(parseInt(a.index,10)+1))}},openFullScreen:function(){var a=this.viewer.schema.document;window.open(a.canonicalURL,a.title,"toolbar=no,resizable=yes,scrollbars=no,status=no")},sortPages:function(a){if(a==0||a%3==1){return["p0","p1","p2"]}if(a%3==2){return["p1","p2","p0"]}if(a%3==0){return["p2","p0","p1"]}},addObserver:function(a){this.removeObserver(a);this.viewer.observers.push(a)},removeObserver:function(b){var d=this.viewer.observers;for(var c=0,a=d.length;c<a;c++){if(b===d[c]){d.splice(c,1)}}},setWindowSize:function(f){var e=this.viewer;var b=this.elements;var a=b.header.outerHeight()+15;var d=DV.jQuery(this.viewer.options.container).offset().top;var c=Math.round((f.height)-a-d);b.window.css({height:c,width:f.width-267});b.well.css({height:c});e.windowDimensions=f},toggleContent:function(a){this.elements.viewer.removeClass("DV-viewText DV-viewSearch DV-viewDocument DV-viewAnnotations").addClass("DV-"+a)},jump:function(c,b,d){b=(b)?parseInt(b,10):0;var a=this.models.document.getOffset(parseInt(c,10))+b;this.elements.window.scrollTop(a);this.models.document.setPageIndex(c);if(d){this.viewer.pageSet.redraw(true)}},shift:function(a){var c=this.elements.window;var b=c.scrollTop()+a.delta;c.scrollTop(b)},getAppState:function(){var a=this.models.document;var b=(a.currentIndex()==0)?1:a.currentPage();return{page:b,zoom:a.zoomLevel,view:this.viewer.state}},constructPages:function(){var b=[];var d=(this.viewer.schema.data.totalPages<3)?this.viewer.schema.data.totalPages:3;var a=this.models.pages.height;for(var c=0;c<d;c++){b.push(JST.pages({pageNumber:c+1,pageIndex:c,pageImageSource:this.BLANK_GIF,baseHeight:a}))}return b.join("")},positionViewer:function(){var a=this.elements.viewer.position();this.elements.viewer.css({position:"absolute",top:a.top,bottom:0,left:a.left,right:a.left})},unsupportedBrowser:function(){if(!(DV.jQuery.browser.msie&&DV.jQuery.browser.version<="6.0")){return false}DV.jQuery(this.viewer.options.container).html(JST.unsupported({viewer:this.viewer}));return true},registerHashChangeEvents:function(){var a=this.events;var b=this.viewer.history;b.defaultCallback=DV.jQuery.proxy(a.handleHashChangeDefault,this.events);b.register(/document\/p(\d*)$/,DV.jQuery.proxy(a.handleHashChangeViewDocumentPage,this.events));b.register(/p(\d*)$/,DV.jQuery.proxy(a.handleHashChangeLegacyViewDocumentPage,this.events));b.register(/p=(\d*)$/,DV.jQuery.proxy(a.handleHashChangeLegacyViewDocumentPage,this.events));b.register(/document\/p(\d*)\/a(\d*)$/,DV.jQuery.proxy(a.handleHashChangeViewDocumentAnnotation,this.events));b.register(/annotation\/a(\d*)$/,DV.jQuery.proxy(a.handleHashChangeViewAnnotationAnnotation,this.events));b.register(/text\/p(\d*)$/,DV.jQuery.proxy(a.handleHashChangeViewText,this.events));b.register(/entity\/p(\d*)\/(.*)\/(\d+):(\d+)$/,DV.jQuery.proxy(a.handleHashChangeViewEntity,this.events));b.register(/search\/p(\d*)\/(.*)$/,DV.jQuery.proxy(a.handleHashChangeViewSearchRequest,this.events))},autoZoomPage:function(){var d=this.elements.window.outerWidth(true);var e;if(this.viewer.options.zoom=="auto"){e=Math.min(700,d-(this.viewer.models.pages.REDUCED_PADDING*2))}else{e=this.viewer.options.zoom}var c=[];if(e<=500){var b=(e+700)/2;c=[e,b,700,850,1000]}else{if(e<=750){var b=((1000-700)/3)+e;var a=((1000-700)/3)*2+e;c=[0.66*e,e,b,a,1000]}else{if(750<e&&e<=850){var b=((1000-e)/2)+e;c=[0.66*e,700,e,b,1000]}else{if(850<e&&e<1000){var b=((e-700)/2)+700;c=[0.66*e,700,b,e,1000]}else{if(e>=1000){e=1000;c=this.viewer.models.document.ZOOM_RANGES}}}}}this.viewer.models.document.ZOOM_RANGES=c;this.viewer.slider.slider({value:parseInt(_.indexOf(c,e)*24.7,10)});this.events.zoom(e)},handleInitialState:function(){var a=this.viewer.history.loadURL(true);if(!a){this.viewer.open("ViewDocument")}}};_.extend(DV.Schema.helpers,{getAnnotationModel:function(b){var a=parseInt(b.attr("rel").match(/\d+/),10);return this.models.annotations.getAnnotation(a)},getAnnotationObject:function(a){var a=this.viewer.$(a);var d=a.attr("id").replace(/DV\-annotation\-|DV\-listAnnotation\-/,"");var b=a.closest("div.DV-set").attr("data-id");for(var c=0;(annotationObject=this.viewer.pageSet.pages[b].annotations[c]);c++){if(annotationObject.id==d){a=null;return annotationObject}}return false},annotationBridgeToggle:function(b){b.preventDefault();var a=this.getAnnotationObject(this.viewer.$(b.target).closest(this.annotationClassName));a.toggle()},annotationBridgeShow:function(b){b.preventDefault();var a=this.getAnnotationObject(this.viewer.$(b.target).closest(this.annotationClassName));a.show()},annotationBridgeHide:function(b){b.preventDefault();var a=this.getAnnotationObject(this.viewer.$(b.target).closest(this.annotationClassName));a.hide(true)},annotationBridgeNext:function(b){b.preventDefault();var a=this.getAnnotationObject(this.viewer.$(b.target).closest(this.annotationClassName));a.next()},annotationBridgePrevious:function(b){b.preventDefault();var a=this.getAnnotationObject(this.viewer.$(b.target).closest(this.annotationClassName));a.previous()},setAnnotationPosition:function(a){this.elements.currentPage.text(a)},setActiveAnnotationLimits:function(a){var a=(a)?a:this.viewer.activeAnnotation;if(!a||a==null){return}var e=this.elements;var b=a.page;var d=a.annotationEl;var c=a.position.top*this.models.pages.zoomFactor();var f=this.events.trackAnnotation;if(a.type==="page"){f.h=d.outerHeight()+b.getOffset();f.combined=(b.getOffset())-e.window.height()}else{f.h=d.height()+c-20+b.getOffset()+b.getPageNoteHeight();f.combined=(c-20+b.getOffset()+b.getPageNoteHeight())-e.window.height()}}});_.extend(DV.Schema.helpers,{renderViewer:function(){var i=this.viewer.schema.document;var b=this.constructPages();var j=(i.description)?i.description:null;var d=i.resources.related_article;var g=JST.header({options:this.viewer.options,id:i.id,story_url:d,title:i.title||""});var c=JST.footer({options:this.viewer.options});var h=i.resources.pdf;h=h?'<a target="_blank" href="'+h+'">Original Document (PDF)</a>':"";var e={options:this.viewer.options,pages:b,header:g,footer:c,pdf_url:h,story_url:d,descriptionContainer:JST.descriptionContainer({description:j}),autoZoom:this.viewer.options.zoom=="auto"};if(this.viewer.options.width&&this.viewer.options.height){DV.jQuery(this.viewer.options.container).css({position:"relative",width:this.viewer.options.width,height:this.viewer.options.height})}var a=this.viewer.options.container;var f=DV.jQuery(a);if(!f.length){throw"Document Viewer container element not found: "+a}f.html(JST.viewer(e))},displayNavigation:function(){var b=this.viewer.schema.document;var a=(!b.description&&!_.size(this.viewer.schema.data.annotationsById)&&!this.viewer.schema.data.sections.length);this.viewer.$(".DV-supplemental").toggleClass("DV-noNavigation",a)},renderNavigation:function(){var u=this;var c=[],g=[],e=[],q=[],o=JST.navigationExpander({}),h=[],k=[],f=[];var r=function(z,y){var A=[];for(var x=z,w=y;x<w;x++){if(k[x]){A.push(k[x]);h[x]=""}}return A.join("")};var a=function(i){var w="#DV-selectedChapter-"+i.id+" #DV-chapter-"+i.id;g.push(w+" .DV-first span.DV-trigger");return(JST.chapterNav(i))};var d=function(x){var y=[];var z=u.viewer.schema.data.annotationsByPage[x];for(var w=0;w<z.length;w++){var i=z[w];y.push(JST.annotationNav(i));g.push("#DV-selectedAnnotation-"+i.id+" #DV-annotationMarker-"+i.id+" span.DV-trigger")}return y.join("")};for(var s=0,t=this.models.document.totalPages;s<t;s++){if(this.viewer.schema.data.annotationsByPage[s]){h[s]=d(s);k[s]=h[s]}}if(this.viewer.schema.data.sections.length>=1){for(var s=0;s<this.viewer.schema.data.sections.length;s++){var j=this.viewer.schema.data.sections[s];var m=j.pages.split("-");var b=r(m[0]-1,m[1]);j.pageNumber=m[0];if(b!=""){j.navigationExpander=o;j.navigationExpanderClass="DV-hasChildren";j.noteViews=b;h[m[0]-1]=a(j)}else{j.navigationExpanderClass="DV-noChildren";j.noteViews="";j.navigationExpander="";h[m[0]-1]=a(j)}}}var v=h.join("");var n=this.viewer.$("div.DV-chaptersContainer");n.html(v);n.live("click",this.events.compile("handleNavigation"));this.viewer.schema.data.sections.length||_.size(this.viewer.schema.data.annotationsById)?n.show():n.hide();this.displayNavigation();this.viewer.$(".DV-navigationBolds",document.head).remove();var p=g.join(", ")+" { font-weight:bold; color:#000 !important; }";var l='<style id="DV-navigationBolds" type="text/css" media="screen,print">\n'+p+"\n</style>";this.viewer.$("head").append(l);n=null},renderComponents:function(){var b=DV.jQuery(this.viewer.options.container).css("position");if(b!="relative"&&b!="absolute"&&!this.viewer.options.fixedSize){DV.jQuery(document.body).css({overflow:"hidden"})}var f=_.any(this.models.annotations.byId);var d=this.viewer.$(".DV-annotationView");d[f?"show":"hide"]();this.elements.viewer.addClass("DV-searchable");this.viewer.$("input.DV-searchInput",this.viewer.options.container).placeholder({message:"Search",clearClassName:"DV-searchInput-show-search-cancel"});var c=this.models.chapters.chapters.length>0;this.viewer.$(".DV-navControls").remove();var e=JST.navControls({totalPages:this.viewer.schema.data.totalPages,totalAnnotations:this.viewer.schema.data.totalAnnotations});this.viewer.$(".DV-navControlsContainer").html(e);this.viewer.$(".DV-fullscreenControl").remove();if(this.viewer.schema.document.canonicalURL){var a=JST.fullscreenControl({});this.viewer.$(".DV-fullscreenContainer").html(a)}if(this.viewer.options.sidebar){this.viewer.$(".DV-sidebar").show()}if(this.elements.viewer.width()<=650){this.viewer.$(".DV-controls").addClass("DV-narrowControls")}this.elements.currentPage=this.viewer.$("span.DV-currentPage");this.models.document.setPageIndex(this.models.document.currentIndex())},reset:function(){this.resetNavigationState();this.cleanUpSearch();this.viewer.pageSet.cleanUp();this.removeObserver("drawPages");this.viewer.dragReporter.unBind();this.elements.window.scrollTop(0)}});_.extend(DV.Schema.helpers,{showAnnotationEdit:function(d){var c=this.viewer.$(d.target).closest(this.annotationClassName);var b=this.viewer.$(".DV-annotationTextArea",c);var a=this.viewer.$(".DV-annotationBody",c).height();b.css({height:a-65});c.addClass("DV-editing");b.focus()},cancelAnnotationEdit:function(c){var b=this.viewer.$(c.target).closest(this.annotationClassName);var a=this.getAnnotationModel(b);this.viewer.$(".DV-annotationTitleInput",b).val(a.title);this.viewer.$(".DV-annotationTextArea",b).val(a.text);if(a.unsaved){this.models.annotations.removeAnnotation(a)}else{b.removeClass("DV-editing")}},saveAnnotation:function(d,b){var c=this.viewer.$(d.target).closest(this.annotationClassName);var a=this.getAnnotationModel(c);if(!a){return}a.title=this.viewer.$(".DV-annotationTitleInput",c).val();a.text=this.viewer.$(".DV-annotationTextArea",c).val();if(b=="onlyIfText"&&(!a.title||a.title=="Untitled Note")&&!a.text){return this.models.annotations.removeAnnotation(a)}this.models.annotations.refreshAnnotation(a);c.removeClass("DV-editing");this.viewer.api.redraw();this.models.annotations.fireSaveCallbacks(a)},deleteAnnotation:function(c){var b=this.viewer.$(c.target).closest(this.annotationClassName);var a=this.getAnnotationModel(b);this.models.annotations.removeAnnotation(a);this.models.annotations.fireDeleteCallbacks(a)}});_.extend(DV.Schema.helpers,{resetNavigationState:function(){var a=this.elements;if(a.chaptersContainer.length){a.chaptersContainer[0].id=""}if(a.navigation.length){a.navigation[0].id=""}},setActiveChapter:function(a){this.elements.chaptersContainer.attr("id","DV-selectedChapter-"+a)},setActiveAnnotationInNav:function(a){if(a){this.elements.navigation.attr("id","DV-selectedAnnotation-"+a)}else{this.elements.navigation.attr("id","")}}});_.extend(DV.Schema.helpers,{getSearchResponse:function(d){var c=DV.jQuery.proxy(function(e){this.viewer.searchResponse=e;var g=(e.results.length>0)?true:false;var f=g?"of "+e.results.length+" ":" ";this.viewer.$("span.DV-totalSearchResult").text(f);this.viewer.$("span.DV-searchQuery").text(e.query);if(g){this.viewer.history.save("search/p"+e.results[0]+"/"+e.query);this.events.loadText(e.results[0]-1,this.highlightSearchResponses)}else{this.highlightSearchResponses()}},this);var b=function(){this.viewer.$(".DV-currentSearchResult").text("Search is not available at this time");this.viewer.$("span.DV-searchQuery").text(d);this.viewer.$(".DV-searchResults").addClass("DV-noResults")};var a=this.viewer.schema.document.resources.search.replace("{query}",encodeURIComponent(d));if(this.viewer.helpers.isCrossDomain(a)){a+="&callback=?"}DV.jQuery.ajax({url:a,dataType:"json",success:c,error:b})},acceptInputCallBack:function(){var a=parseInt(this.elements.currentPage.text(),10)-1;a=(a==="")?0:a;a=(a<0)?0:a;a=(a+1>this.models.document.totalPages)?this.models.document.totalPages-1:a;var b=a+1;this.elements.currentPage.text(b);this.viewer.$(".DV-pageNumberContainer input").val(b);if(this.viewer.state==="ViewDocument"){this.viewer.history.save("document/p"+b);this.jump(a)}else{if(this.viewer.state==="ViewText"){this.viewer.history.save("text/p"+b);this.events.loadText(a)}}},highlightSearchResponses:function(){var g=this.viewer;var c=g.searchResponse;if(!c){return false}var e=c.results;var h=this.viewer.$(".DV-currentSearchResult");if(e.length==0){h.text("No Results");this.viewer.$(".DV-searchResults").addClass("DV-noResults")}else{this.viewer.$(".DV-searchResults").removeClass("DV-noResults")}for(var f=0;f<c.results.length;f++){if(this.models.document.currentPage()===c.results[f]){h.text("Page "+(f+1)+" ");break}}var l="\\b"+c.query.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&").replace(/\s+/g,"\\s+")+"\\b";var j=this.viewer.$(".DV-textContents");var d=j.text();var k=new RegExp(l,"ig");var b=d.replace(k,'<span class="DV-searchMatch">$&</span>');j.html(b);var a=(g.toHighLight)?g.toHighLight:0;this.highlightMatch(a);h=null;j=null},highlightEntity:function(g,d){this.viewer.$(".DV-searchResults").addClass("DV-noResults");var c=this.viewer.$(".DV-textContents");var f=c.text();var e=f.substr(0,g);var a=f.substr(g,d);var b=f.substr(g+d);f=[e,'<span class="DV-searchMatch">',a,"</span>",b].join("");c.html(f);this.highlightMatch(0)},highlightMatch:function(c){var d=this.viewer.$(".DV-textContents span.DV-searchMatch");if(d.length==0){return false}var f=this.getCurrentSearchPageIndex();var a=this.viewer.toHighLight;if(a){if(a!==false){if(a==="last"){c=d.length-1}else{if(a==="first"){c=0}else{c=a}}}a=false}var e=this.viewer.searchResponse;if(e){if(c===(d.length)){if(e.results.length===f+1){return}a="first";this.events.loadText(e.results[f+1]-1,this.highlightSearchResponses);return}else{if(c===-1){if(f-1<0){return false}a="last";this.events.loadText(e.results[f-1]-1,this.highlightSearchResponses);return}}d.removeClass("DV-highlightedMatch")}var b=this.viewer.$(".DV-textContents span.DV-searchMatch:eq("+c+")");b.addClass("DV-highlightedMatch");this.elements.window[0].scrollTop=b.position().top-50;if(e){e.highlighted=c}d=null;b=null},getCurrentSearchPageIndex:function(){var d=this.viewer.searchResponse;if(!d){return false}var b=this.models.document;for(var c=0,a=d.results.length;c<a;c++){if(d.results[c]===b.currentPage()){return c}}},highlightPreviousMatch:function(a){a.preventDefault();this.highlightMatch(this.viewer.searchResponse.highlighted-1)},highlightNextMatch:function(a){a.preventDefault(a);this.highlightMatch(this.viewer.searchResponse.highlighted+1)},clearSearch:function(a){this.elements.searchInput.val("").keyup().focus()},showEntity:function(a,c,b){this.viewer.$("span.DV-totalSearchResult").text("");this.viewer.$("span.DV-searchQuery").text(a);this.viewer.$("span.DV-currentSearchResult").text("Searching");this.events.loadText(this.models.document.currentIndex(),_.bind(this.viewer.helpers.highlightEntity,this.viewer.helpers,c,b))},cleanUpSearch:function(){var a=this.viewer;a.searchResponse=null;a.toHighLight=null;if(this.elements){this.elements.searchInput.keyup().blur()}}});DV.Schema.states={InitialLoad:function(){if(this.helpers.unsupportedBrowser()){return}this.helpers.renderViewer();window.v=this;this.events.elements=this.helpers.elements=this.elements=new DV.Elements(this);this.helpers.renderComponents();this.helpers.renderNavigation();this.pageSet=new DV.PageSet(this);this.pageSet.buildPages();this.helpers.bindEvents(this);this.helpers.positionViewer();this.models.document.computeOffsets();this.helpers.addObserver("drawPages");this.helpers.registerHashChangeEvents();this.dragReporter=new DV.DragReporter(this,".DV-pageCollection",DV.jQuery.proxy(this.helpers.shift,this),{ignoreSelector:".DV-annotationRegion,.DV-annotationContent"});this.helpers.startCheckTimer();this.helpers.handleInitialState();this.helpers.autoZoomPage()},ViewAnnotation:function(){this.helpers.reset();this.activeAnnotationId=null;this.acceptInput.deny();if(jQuery.browser.msie){this.elements.annotations.css({zoom:0});this.elements.annotations.css({zoom:1})}this.helpers.toggleContent("viewAnnotations");this.compiled.next();return true},ViewDocument:function(){this.helpers.reset();this.helpers.addObserver("drawPages");this.dragReporter.setBinding();this.elements.window.mouseleave(DV.jQuery.proxy(this.dragReporter.stop,this.dragReporter));this.acceptInput.allow();this.helpers.toggleContent("viewDocument");this.helpers.setActiveChapter(this.models.chapters.getChapterId(this.models.document.currentIndex()));this.helpers.jump(this.models.document.currentIndex());return true},ViewEntity:function(a,c,b){this.helpers.reset();this.helpers.toggleContent("viewSearch");this.helpers.showEntity(a,c,b)},ViewSearch:function(){this.helpers.reset();if(this.elements.searchInput.val()==""){this.elements.searchInput.val(a)}else{var a=this.elements.searchInput.val()}this.helpers.getSearchResponse(a);this.acceptInput.deny();this.helpers.toggleContent("viewSearch");return true},ViewText:function(){this.helpers.reset();this.acceptInput.allow();this.pageSet.zoomText();this.helpers.toggleContent("viewText");this.events.loadText();return true}};DV.Api=function(a){this.viewer=a};DV.Api.prototype={currentPage:function(){return this.viewer.models.document.currentPage()},getPageNumberForId:function(b){var a=this.viewer.pageSet.pages[b];return a.index+1},getId:function(){return this.viewer.schema.document.id},currentZoom:function(){var a=this.viewer.models.document;return a.zoomLevel/a.ZOOM_RANGES[1]},numberOfPages:function(){return this.viewer.models.document.totalPages},setSections:function(a){this.viewer.schema.data.sections=a;this.viewer.models.chapters.loadChapters();this.redraw()},getSections:function(){return _.clone(this.viewer.schema.data.sections||[])},getDescription:function(){return this.viewer.schema.document.description},setDescription:function(a){this.viewer.schema.document.description=a;this.viewer.$(".DV-description").remove();this.viewer.$(".DV-navigation").prepend(JST.descriptionContainer({description:a}));this.viewer.helpers.displayNavigation()},getRelatedArticle:function(){return this.viewer.schema.document.resources.related_article},setRelatedArticle:function(a){this.viewer.schema.document.resources.related_article=a;this.viewer.$(".DV-storyLink a").attr({href:a});this.viewer.$(".DV-storyLink").toggle(!!a)},getTitle:function(){return this.viewer.schema.document.title},setTitle:function(a){this.viewer.schema.document.title=a;document.title=a},setPageText:function(b,a){this.viewer.schema.text[a-1]=b},redraw:function(a){if(a){this.viewer.models.annotations.renderAnnotations();this.viewer.models.document.computeOffsets()}this.viewer.helpers.renderNavigation();this.viewer.helpers.renderComponents();if(a){this.viewer.elements.window.removeClass("DV-coverVisible");this.viewer.pageSet.buildPages({noNotes:true});this.viewer.pageSet.reflowPages()}},addAnnotation:function(a){a=this.viewer.schema.loadAnnotation(a);this.viewer.models.annotations.sortAnnotations();this.redraw(true);this.viewer.pageSet.showAnnotation(a,{active:true,edit:true});return a},onAnnotationSave:function(a){this.viewer.models.annotations.saveCallbacks.push(a)},onAnnotationDelete:function(a){this.viewer.models.annotations.deleteCallbacks.push(a)},resetRemovedPages:function(){this.viewer.models.document.resetRemovedPages()},addPageToRemovedPages:function(a){this.viewer.models.document.addPageToRemovedPages(a)},removePageFromRemovedPages:function(a){this.viewer.models.document.removePageFromRemovedPages(a)},removePages:function(a,c){var b=this.getModelId();this.viewer.models.document.removePages(b,a,c)},getModelId:function(){return parseInt(this.getId(),10)},loadJS:function(a,b){DV.jQuery.getScript(a,b)}};DV.DocumentViewer=function(a){this.options=a;this.$=this.jQuery;this.schema=new DV.Schema();this.api=new DV.Api(this);this.history=new DV.History(this);this.models=this.schema.models;this.events=_.extend({},DV.Schema.events);this.helpers=_.extend({},DV.Schema.helpers);this.states=_.extend({},DV.Schema.states);this.isFocus=true;this.activeElement=null;this.observers=[];this.windowDimensions={};this.scrollPosition=null;this.checkTimer={};this.busy=false;this.annotationToLoadId=null;this.dragReporter=null;this.compiled={};this.tracker={};this.events=_.extend(this.events,{viewer:this,states:this.states,elements:this.elements,helpers:this.helpers,models:this.models,compile:function(){var b=this.viewer;var c=arguments[0];return function(){if(!b.events[b.state][c]){b.events[c].apply(b.events,arguments)}else{b.events[b.state][c].apply(b.events,arguments)}}}});this.helpers=_.extend(this.helpers,{viewer:this,states:this.states,elements:this.elements,events:this.events,models:this.models});this.states=_.extend(this.states,{viewer:this,helpers:this.helpers,elements:this.elements,events:this.events,models:this.models})};DV.DocumentViewer.prototype.loadModels=function(){this.models.chapters=new DV.model.Chapters(this);this.models.document=new DV.model.Document(this);this.models.pages=new DV.model.Pages(this);this.models.annotations=new DV.model.Annotations(this);console.log(["loadModels",this.models.removedPages]);this.models.removedPages={}};DV.DocumentViewer.prototype.open=function(a){if(this.state==a){return}this.state=a;this.states[a].apply(this,arguments)};DV.DocumentViewer.prototype.jQuery=function(a,b){b=b||this.options.container;return DV.jQuery.call(DV.jQuery,a,b)};DV.load=function(a,c){c=c||{};var g=a.id||a.match(/([^\/]+)(\.js|\.json)$/)[1];if("showSidebar" in c){c.sidebar=c.showSidebar}var e={container:document.body,zoom:"auto",sidebar:true};c=_.extend({},e,c);c.fixedSize=!!(c.width||c.height);var f=new DV.DocumentViewer(c);DV.viewers[g]=f;var b=DV.loadJSON=function(h){var i=DV.viewers[h.id];i.schema.importCanonicalDocument(h);i.loadModels();DV.jQuery(function(){i.open("InitialLoad");if(c.afterLoad){c.afterLoad(i)}if(DV.afterLoad){DV.afterLoad(i)}})};var d=function(){if(_.isString(a)){if(a.match(/\.js$/)){DV.jQuery.getScript(a)}else{var h=f.helpers.isCrossDomain(a);if(h){a=a+"?callback=?"}DV.jQuery.getJSON(a,b)}}else{b(a)}};if(c.templates){DV.jQuery.getScript(c.templates,d)}else{d()}return f};if(DV.onload){_.defer(DV.onload)};