PageSourceSearch

https://ssmr.ro/files/js/js_8172b0be7df20a51ce32de793acf4161.js

js ssmr.ro collected 2026-09-24 10:01:35 UTC 197,977 bytes, 2,820 lines download raw bytes

1/*
2 * jQuery JavaScript Library v1.3.2
3 * http://jquery.com/
4 *
5 * Copyright (c) 2009 John Resig
6 * Dual licensed under the MIT and GPL licenses.
7 * http://docs.jquery.com/License
8 *
9 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
10 * Revision: 6246
11 */
12(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})}
12,css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})}
12,remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?
120:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];
12if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
13/*
14 * Sizzle CSS Selector Engine - v0.9.3
15 *  Copyright 2009, The Dojo Foundation
16 *  Released under the MIT, BSD, and GPL Licenses.
17 *  More information: http://sizzlejs.com/
18 */
19(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.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\(\)]*
19)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}
19if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCo
19de clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}
19o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();
19if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["o
19pacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;
19if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.
19clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();;
20
21var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
22
23/**
24 * Set the variable that indicates if JavaScript behaviors should be applied
25 */
26Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;
27
28/**
29 * Attach all registered behaviors to a page element.
30 *
31 * Behaviors are event-triggered actions that attach to page elements, enhancing
32 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
33 * object as follows:
34 * @code
35 *    Drupal.behaviors.behaviorName = function () {
36 *      ...
37 *    };
38 * @endcode
39 *
40 * Drupal.attachBehaviors is added below to the jQuery ready event and so
41 * runs on initial page load. Developers implementing AHAH/AJAX in their
42 * solutions should also call this function after new page content has been
43 * loaded, feeding in an element to be processed, in order to attach all
44 * behaviors to the new content.
45 *
46 * Behaviors should use a class in the form behaviorName-processed to ensure
47 * the behavior is attached only once to a given element. (Doing so enables
48 * the reprocessing of given elements, which may be needed on occasion despite
49 * the ability to limit behavior attachment to a particular element.)
50 *
51 * @param context
52 *   An element to attach behaviors to. If none is given, the document element
53 *   is used.
54 */
55Drupal.attachBehaviors = function(context) {
56  context = context || document;
57  if (Drupal.jsEnabled) {
58    // Execute all of them.
59    jQuery.each(Drupal.behaviors, function() {
60      this(context);
61    });
62  }
63};
64
65/**
66 * Encode special characters in a plain-text string for display as HTML.
67 */
68Drupal.checkPlain = function(str) {
69  str = String(str);
70  var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
71  for (var character in replace) {
72    var regex = new RegExp(character, 'g');
73    str = str.replace(regex, replace[character]);
74  }
75  return str;
76};
77
78/**
79 * Translate strings to the page language or a given language.
80 *
81 * See the documentation of the server-side t() function for further details.
82 *
83 * @param str
84 *   A string containing the English string to translate.
85 * @param args
86 *   An object of replacements pairs to make after translation. Incidences
87 *   of any key in this array are replaced with the corresponding value.
88 *   Based on the first character of the key, the value is escaped and/or themed:
89 *    - !variable: inserted as is
90 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
91 *    - %variable: escape text and theme as a placeholder for user-submitted
92 *      content (checkPlain + Drupal.theme('placeholder'))
93 * @return
94 *   The translated string.
95 */
96Drupal.t = function(str, args) {
97  // Fetch the localized version of the string.
98  if (Drupal.locale.strings && Drupal.locale.strings[str]) {
99    str = Drupal.locale.strings[str];
100  }
101
102  if (args) {
103    // Transform arguments before inserting them
104    for (var key in args) {
105      switch (key.charAt(0)) {
106        // Escaped only
107        case '@':
108          args[key] = Drupal.checkPlain(args[key]);
109        break;
110        // Pass-through
111        case '!':
112          break;
113        // Escaped and placeholder
114        case '%':
115        default:
116          args[key] = Drupal.theme('placeholder', args[key]);
117          break;
118      }
119      str = str.replace(key, args[key]);
120    }
121  }
122  return str;
123};
124
125/**
126 * Format a string containing a count of items.
127 *
128 * This function ensures that the string is pluralized correctly. Since Drupal.t() is
129 * called by this function, make sure not to pass already-localized strings to it.
130 *
131 * See the documentation of the server-side format_plural() function for further details.
132 *
133 * @param count
134 *   The item count to display.
135 * @param singular
136 *   The string for the singular case. Please make sure it is clear this is
137 *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
138 *   Do not use @count in the singular string.
139 * @param plural
140 *   The string for the plural case. Please make sure it is clear this is plural,
141 *   to ease translation. Use @count in place of the item count, as in "@count
142 *   new comments".
143 * @param args
144 *   An object of replacements pairs to make after translation. Incidences
145 *   of any key in this array are replaced with the corresponding value.
146 *   Based on the first character of the key, the value is escaped and/or themed:
147 *    - !variable: inserted as is
148 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
149 *    - %variable: escape text and theme as a placeholder for user-submitted
150 *      content (checkPlain + Drupal.theme('placeholder'))
151 *   Note that you do not need to include @count in this array.
152 *   This replacement is done automatically for the plural case.
153 * @return
154 *   A translated string.
155 */
156Drupal.formatPlural = function(count, singular, plural, args) {
157  var args = args || {};
158  args['@count'] = count;
159  // Determine the index of the plural form.
160  var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
161
162  if (index == 0) {
163    return Drupal.t(singular, args);
164  }
165  else if (index == 1) {
166    return Drupal.t(plural, args);
167  }
168  else {
169    args['@count['+ index +']'] = args['@count'];
170    delete args['@count'];
171    return Drupal.t(plural.replace('@count', '@count['+ index +']'));
172  }
173};
174
175/**
176 * Generate the themed representation of a Drupal object.
177 *
178 * All requests for themed output must go through this function. It examines
179 * the request and routes it to the appropriate theme function. If the current
180 * theme does not provide an override function, the generic theme function is
181 * called.
182 *
183 * For example, to retrieve the HTML that is output by theme_placeholder(text),
184 * call Drupal.theme('placeholder', text).
185 *
186 * @param func
187 *   The name of the theme function to call.
188 * @param ...
189 *   Additional arguments to pass along to the theme function.
190 * @return
191 *   Any data the theme function returns. This could be a plain HTML string,
192 *   but also a complex object.
193 */
194Drupal.theme = function(func) {
195  for (var i = 1, args = []; i < arguments.length; i++) {
196    args.push(arguments[i]);
197  }
198
199  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
200};
201
202/**
203 * Parse a JSON response.
204 *
205 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
206 */
207Drupal.parseJson = function (data) {
208  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
209    return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') };
210  }
211  return eval('(' + data + ');');
212};
213
214/**
215 * Freeze the current body height (as minimum height). Used to prevent
216 * unnecessary upwards scrolling when doing DOM manipulations.
217 */
218Drupal.freezeHeight = function () {
219  Drupal.unfreezeHeight();
220  var div = document.createElement('div');
221  $(div).css({
222    position: 'absolute',
223    top: '0px',
224    left: '0px',
225    width: '1px',
226    height: $('body').css('height')
227  }).attr('id', 'freeze-height');
228  $('body').append(div);
229};
230
231/**
232 * Unfreeze the body height
233 */
234Drupal.unfreezeHeight = function () {
235  $('#freeze-height').remove();
236};
237
238/**
239 * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of
240 * drupal_urlencode() in PHP). This function should only be used on paths, not
241 * on query string arguments.
242 */
243Drupal.encodeURIComponent = function (item, uri) {
244  uri = uri || location.href;
245  item = encodeURIComponent(item).replace(/%2F/g, '/');
246  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
247};
248
249/**
250 * Get the text selection in a textarea.
251 */
252Drupal.getSelection = function (element) {
253  if (typeof(element.selectionStart) != 'number' && document.selection) {
254    // The current selection
255    var range1 = document.selection.createRange();
256    var range2 = range1.duplicate();
257    // Select all text.
258    range2.moveToElementText(element);
259    // Now move 'dummy' end point to end point of original range.
260    range2.setEndPoint('EndToEnd', range1);
261    // Now we can calculate start and end points.
262    var start = range2.text.length - range1.text.length;
263    var end = start + range1.text.length;
264    return { 'start': start, 'end': end };
265  }
266  return { 'start': element.selectionStart, 'end': element.selectionEnd };
267};
268
269/**
270 * Build an error message from ahah response.
271 */
272Drupal.ahahError = function(xmlhttp, uri) {
273  if (xmlhttp.status == 200) {
274    if (jQuery.trim($(xmlhttp.responseText).text())) {
275      var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText });
276    }
277    else {
278      var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText });
279    }
280  }
281  else {
282    var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
283  }
284  return message;
285}
286
287// Global Killswitch on the <html> element
288if (Drupal.jsEnabled) {
289  // Global Killswitch on the <html> element
290  $(document.documentElement).addClass('js');
291  // 'js enabled' cookie
292  document.cookie = 'has_js=1; path=/';
293  // Attach all behaviors.
294  $(document).ready(function() {
295    Drupal.attachBehaviors(this);
296  });
297}
298
299/**
300 * The default themes.
301 */
302Drupal.theme.prototype = {
303
304  /**
305   * Formats text for emphasized display in a placeholder inside a sentence.
306   *
307   * @param str
308   *   The text to format (plain-text).
309   * @return
310   *   The formatted text (html).
311   */
312  placeholder: function(str) {
313    return '<em>' + Drupal.checkPlain(str) + '</em>';
314  }
315};
316;
317// ColorBox v1.3.17.2 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
318// Copyright (c) 2011 Jack Moore - [email protected]
319// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
320(function(a,b,c){function bc(b){if(!U){P=b,_(),y=a(P),Q=0,K.rel!=="nofollow"&&(y=a("."+g).filter(function(){var b=a.data(this,e).rel||this.rel;return b===K.rel}),Q=y.index(P),Q===-1&&(y=y.add(P),Q=y.length-1));if(!S){S=T=!0,r.show();if(K.returnFocus)try{P.blur(),a(P).one(l,function(){try{this.focus()}catch(a){}})}catch(c){}q.css({opacity:+K.opacity,cursor:K.overlayClose?"pointer":"auto"}).show(),K.w=Z(K.initialWidth,"x"),K.h=Z(K.initialHeight,"y"),X.position(),o&&z.bind("resize."+p+" scroll."+p,function(){q.css({width:z.width(),height:z.height(),top:z.scrollTop(),left:z.scrollLeft()})}).trigger("resize."+p),ba(h,K.onOpen),J.add(D).hide(),I.html(K.close).show()}X.load(!0)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;K.slideshow&&y[1]?(d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop)a=setTimeout(X.next,K.slideshowSpeed)}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e),r.removeClass(b+"off").addClass(b+"on"),a=setTimeout(X.next,K.slideshowSpeed)},e=function(){clearTimeout(a),F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,d),r.removeClass(b+"on").addClass(b+"off")},K.slideshowAuto?d():e()):r.removeClass(b+"off "+b+"on")}function ba(b,c){c&&c.call(P),a.event.trigger(b)}function _(b){K=a.extend({},a.data(P,e));for(b in K)a.isFunction(K[b])&&b.substring(0,2)!=="on"&&(K[b]=K[b].call(P));K.rel=K.rel||P.rel||"nofollow",K.href=K.href||a(P).attr("href"),K.title=K.title||P.title,typeof K.href=="string"&&(K.href=a.trim(K.href))}function $(a){return K.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function Y(c,d,e){e=b.createElement("div"),c&&(e.id=f+c),e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},e="colorbox",f="cbox",g=f+"Element",h=f+"_open",i=f+"_load",j=f+"_complete",k=f+"_cleanup",l=f+"_closed",m=f+"_purge",n=a.browser.msie&&!a.support.opacity,o=n&&a.browser.version<7,p=f+"_IE6",q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X;X=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{};if(!f[0]){if(f.selector)return f;f=a("<a/>"),b.open=!0}c&&(b.onComplete=c),f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b)),a(this).addClass(g)}),(a.isFunction(b.open)&&b.open.call(f)||b.open)&&bc(f[0]);return f},X.init=function(){z=a(c),r=Y().attr({id:e,"class":n?f+(o?"IE6":"IE"):""}),q=Y("Overlay",o?"position:absolute":"").hide(),s=Y("Wrapper"),t=Y("Content").append(A=Y("LoadedContent","width:0; height:0; overflow:hidden"),C=Y("LoadingOverlay").add(Y("LoadingGraphic")),D=Y("Title"),E=Y("Current"),G=Y("Next"),H=Y("Previous"),F=Y("Slideshow").bind(h,bb),I=Y("Close")),s.append(Y().append(Y("TopLeft"),u=Y("TopCenter"),Y("TopRight")),Y(!1,"clear:left").append(v=Y("MiddleLeft"),t,w=Y("MiddleRight")),Y(!1,"clear:left").append(Y("BottomLeft"),x=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"}),B=Y(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(q,r.append(s,B)),t.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),L=u.height()+x.height()+t.outerHeight(!0)-t.height(),M=v.width()+w.width()+t.outerWidth(!0)-t.width(),N=A.outerHeight(!0),O=A.outerWidth(!0),r.css({"padding-bottom":L,"padding-right":M}).hide(),G.click(function(){X.next()}),H.click(function(){X.prev()}),I.click(function(){X.close()}),J=G.add(H).add(E).add(F),t.children().removeClass("hover"),q.click(function(){K.overlayClose&&X.close()}),a(b).bind("keydown."+f,function(a){var b=a.keyCode;S&&K.escKey&&b===27&&(a.preventDefault(),X.close()),S&&K.arrowKey&&y[1]&&(b===37?(a.preventDefault(),H.click()):b===39&&(a.preventDefault(),G.click()))})},X.remove=function(){r.add(q).remove(),a("."+g).removeData(e).removeClass(g)}
320,X.position=function(a,c){function g(a){u[0].style.width=x[0].style.width=t[0].style.width=a.style.width,C[0].style.height=C[1].style.height=t[0].style.height=v[0].style.height=w[0].style.height=a.style.height}var d=0,e=0;z.unbind("resize."+f),r.hide(),K.fixed&&!o?r.css({position:"fixed"}):(d=z.scrollTop(),e=z.scrollLeft(),r.css({position:"absolute"})),K.right!==!1?e+=Math.max(z.width()-K.w-O-M-Z(K.right,"x"),0):K.left!==!1?e+=Z(K.left,"x"):e+=Math.round(Math.max(z.width()-K.w-O-M,0)/2),K.bottom!==!1?d+=Math.max(b.documentElement.clientHeight-K.h-N-L-Z(K.bottom,"y"),0):K.top!==!1?d+=Z(K.top,"y"):d+=Math.round(Math.max(b.documentElement.clientHeight-K.h-N-L,0)/2),r.show(),a=r.width()===K.w+O&&r.height()===K.h+N?0:a||0,s[0].style.width=s[0].style.height="9999px",r.dequeue().animate({width:K.w+O,height:K.h+N,top:d,left:e},{duration:a,complete:function(){g(this),T=!1,s[0].style.width=K.w+O+M+"px",s[0].style.height=K.h+N+L+"px",c&&c(),setTimeout(function(){z.bind("resize."+f,X.position)},1)},step:function(){g(this)}})},X.resize=function(a){if(S){a=a||{},a.width&&(K.w=Z(a.width,"x")-O-M),a.innerWidth&&(K.w=Z(a.innerWidth,"x")),A.css({width:K.w}),a.height&&(K.h=Z(a.height,"y")-N-L),a.innerHeight&&(K.h=Z(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=A.wrapInner("<div style='overflow:auto'></div>").children();K.h=b.height(),b.replaceWith(b.children())}A.css({height:K.h}),X.position(K.transition==="none"?0:K.speed)}},X.prep=function(b){function h(){K.h=K.h||A.height(),K.h=K.mh&&K.mh<K.h?K.mh:K.h;return K.h}function g(){K.w=K.w||A.width(),K.w=K.mw&&K.mw<K.w?K.mw:K.w;return K.w}if(!!S){var c,d=K.transition==="none"?0:K.speed;A.remove(),A=Y("LoadedContent").append(b),A.hide().appendTo(B.show()).css({width:g(),overflow:K.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(t),B.hide(),a(R).css({"float":"none"}),o&&a("select").not(r.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(k,function(){this.style.visibility="inherit"}),c=function(){function o(){n&&r[0].style.removeAttribute("filter")}var b,c,g,h,i=y.length,k,l;!S||(l=function(){clearTimeout(W),C.hide(),ba(j,K.onComplete)},n&&R&&A.fadeIn(100),D.html(K.title).add(A).show(),i>1?(typeof K.current=="string"&&E.html(K.current.replace("{current}",Q+1).replace("{total}",i)).show(),G[K.loop||Q<i-1?"show":"hide"]().html(K.next),H[K.loop||Q?"show":"hide"]().html(K.previous),b=Q?y[Q-1]:y[i-1],g=Q<i-1?y[Q+1]:y[0],K.slideshow&&F.show(),K.preloading&&(h=a.data(g,e).href||g.href,c=a.data(b,e).href||b.href,h=a.isFunction(h)?h.call(g):h,c=a.isFunction(c)?c.call(b):c,$(h)&&(a("<img/>")[0].src=h),$(c)&&(a("<img/>")[0].src=c))):J.hide(),K.iframe?(k=a("<iframe/>").addClass(f+"Iframe")[0],K.fastIframe?l():a(k).one("load",l),k.name=f+ +(new Date),k.src=K.href,K.scrolling||(k.scrolling="no"),n&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(A).one(m,function(){k.src="//about:blank"})):l(),K.transition==="fade"?r.fadeTo(d,1,o):o())},K.transition==="fade"?r.fadeTo(d,0,function(){X.position(0,c)}):X.position(d,c)}},X.load=function(b){var c,d,e=X.prep;T=!0,R=!1,P=y[Q],b||_(),ba(m),ba(i,K.onLoad),K.h=K.height?Z(K.height,"y")-N-L:K.innerHeight&&Z(K.innerHeight,"y"),K.w=K.width?Z(K.width,"x")-O-M:K.innerWidth&&Z(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=Z(K.maxWidth,"x")-O-M,K.mw=K.w&&K.w<K.mw?K.w:K.mw),K.maxHeight&&(K.mh=Z(K.maxHeight,"y")-N-L,K.mh=K.h&&K.h<K.mh?K.h:K.mh),c=K.href,W=setTimeout(function(){C.show()},100),K.inline?(Y().hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())}),e(a(c))):K.iframe?e(" "):K.html?e(K.html):$(c)?(a(R=new Image).addClass(f+"Photo").error(function(){K.title=!1,e(Y("Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null,K.scalePhotos&&(d=function(){R.height-=R.height*a,R.width-=R.width*a},K.mw&&R.width>K.mw&&(a=(R.width-K.mw)/R.width,d()),K.mh&&R.height>K.mh&&(a=(R.height-K.mh)/R.height,d())),K.h&&(R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"),y[1]&&(Q<y.length-1||K.loop)&&(R.style.cursor="pointer",R.onclick=function(){X.next()}),n&&(R.style.msInterpolationMode="bicubic"),setTimeout(function(){e(R)},1)}),setTimeout(function(){R.src=c},1)):c&&B.load(c,K.data,function(b,c,d){e(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},X.next=function(){!T&&y[1]&&(Q<y.length-1||K.loop)&&(Q=Q<y.length-1?Q+1:0,X.load())},X.prev=function(){!T&&y[1]&&(Q||K.loop)&&(Q=Q?Q-1:y.length-1,X.load())},X.close=function(){S&&!U&&(U=!0,S=!1,ba(k,K.onCleanup),z.unbind("."+f+" ."+p),q.fadeTo(200,0),r.stop().fadeTo(300,0,function(){r.add(q).css({opacity:1,cursor:"auto"}).hide(),ba(m),A.remove(),setTimeout(function(){U=!1,ba(l,K.onClosed)},1)}))},X.element=function(){return a(P)},X.settings=d,V=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),bc(this))},a.fn.delegate?a(b).delegate("."+g,"click",V):a("."+g).live("click",V),a(X.init)})(jQuery,document,this);;
321(function ($) {
322
323Drupal.behaviors.initColorbox = function (context) {
324  if (!$.isFunction($.colorbox)) {
325    return;
326  }
327  $('a, area, input', context)
328    .filter('.colorbox:not(.initColorbox-processed)')
329    .addClass('initColorbox-processed')
330    .colorbox(Drupal.settings.colorbox);
331};
332
333{
334  $(document).bind('cbox_complete', function () {
335    Drupal.attachBehaviors('#cboxLoadedContent');
336  });
337}
338
339})(jQuery);
340;
341(function ($) {
342
343Drupal.behaviors.initColorboxLoad = function (context) {
344  if (!$.isFunction($.colorbox)) {
345    return;
346  }
347  var settings = Drupal.settings.colorbox;
348  $.urlParam = function(name, url){
349    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url);
350    if (!results) { return ''; }
351    return results[1] || '';
352  };
353  $('a, area, input', context).filter('.colorbox-load:not(.initColorboxLoad-processed)').addClass('initColorboxLoad-processed').colorbox({
354    transition:settings.transition,
355    speed:settings.speed,
356    opacity:settings.opacity,
357    slideshowAuto:settings.slideshowAuto,
358    slideshowSpeed:settings.slideshowSpeed,
359    slideshowStart:settings.slideshowStart,
360    slideshowStop:settings.slideshowStop,
361    current:settings.current,
362    previous:settings.previous,
363    next:settings.next,
364    close:settings.close,
365    overlayClose:settings.overlayClose,
366    maxWidth:settings.maxWidth,
367    maxHeight:settings.maxHeight,
368    innerWidth:function(){
369      return $.urlParam('width', $(this).attr('href'));
370    },
371    innerHeight:function(){
372      return $.urlParam('height', $(this).attr('href'));
373    },
374    iframe:function(){
375      return $.urlParam('iframe', $(this).attr('href'));
376    },
377    slideshow:function(){
378      return $.urlParam('slideshow', $(this).attr('href'));
379    }
380  });
381};
382
383})(jQuery);
384;
385(function ($) {
386
387Drupal.behaviors.initColorboxInline = function (context) {
388  if (!$.isFunction($.colorbox)) {
389    return;
390  }
391  var settings = Drupal.settings.colorbox;
392  $.urlParam = function(name, url){
393    if (name == 'fragment') {
394      var results = new RegExp('(#[^&#]*)').exec(url);
395    }
396    else {
397      var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url);
398    }
399    if (!results) { return ''; }
400    return results[1] || '';
401  };
402  $('a, area, input', context).filter('.colorbox-inline:not(.initColorboxInline-processed)').addClass('initColorboxInline-processed').colorbox({
403    transition:settings.transition,
404    speed:settings.speed,
405    opacity:settings.opacity,
406    slideshow:settings.slideshow,
407    slideshowAuto:settings.slideshowAuto,
408    slideshowSpeed:settings.slideshowSpeed,
409    slideshowStart:settings.slideshowStart,
410    slideshowStop:settings.slideshowStop,
411    current:settings.current,
412    previous:settings.previous,
413    next:settings.next,
414    close:settings.close,
415    overlayClose:settings.overlayClose,
416    maxWidth:settings.maxWidth,
417    maxHeight:settings.maxHeight,
418    innerWidth:function(){
419      return $.urlParam('width', $(this).attr('href'));
420    },
421    innerHeight:function(){
422      return $.urlParam('height', $(this).attr('href'));
423    },
424    title:function(){
425      return $.urlParam('title', $(this).attr('href'));
426    },
427    iframe:function(){
428      return $.urlParam('iframe', $(this).attr('href'));
429    },
430    inline:function(){
431      return $.urlParam('inline', $(this).attr('href'));
432    },
433    href:function(){
434      return $.urlParam('fragment', $(this).attr('href'));
435    }
436  });
437};
438
439})(jQuery);
440;
441/* $Id: lightbox.js,v 1.5.2.6.2.136 2010/09/24 08:39:40 snpower Exp $ */
442
443/**
444 * jQuery Lightbox
445 * @author
446 *   Stella Power, <http://drupal.org/user/66894>
447 *
448 * Based on Lightbox v2.03.3 by Lokesh Dhakar
449 * <http://www.huddletogether.com/projects/lightbox2/>
450 * Also partially based on the jQuery Lightbox by Warren Krewenki
451 *   <http://warren.mesozen.com>
452 *
453 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module
454 * maintainers to distribute this file via Drupal.org
455 * Under GPL license.
456 *
457 * Slideshow, iframe and video functionality added by Stella Power.
458 */
459
460var Lightbox = {
461  auto_modal : false,
462  overlayOpacity : 0.8, // Controls transparency of shadow overlay.
463  overlayColor : '000', // Controls colour of shadow overlay.
464  disableCloseClick : true,
465  // Controls the order of the lightbox resizing animation sequence.
466  resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width.
467  resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation.
468  fadeInSpeed: 'normal', // Controls the speed of the image appearance.
469  slideDownSpeed: 'slow', // Controls the speed of the image details appearance.
470  minWidth: 240,
471  borderSize : 10,
472  boxColor : 'fff',
473  fontColor : '000',
474  topPosition : '',
475  infoHeight: 20,
476  alternative_layout : false,
477  imageArray : [],
478  imageNum : null,
479  total : 0,
480  activeImage : null,
481  inprogress : false,
482  disableResize : false,
483  disableZoom : false,
484  isZoomedIn : false,
485  rtl : false,
486  loopItems : false,
487  keysClose : ['c', 'x', 27],
488  keysPrevious : ['p', 37],
489  keysNext : ['n', 39],
490  keysZoom : ['z'],
491  keysPlayPause : [32],
492
493  // Slideshow options.
494  slideInterval : 5000, // In milliseconds.
495  showPlayPause : true,
496  autoStart : true,
497  autoExit : true,
498  pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked.
499  pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked.
500  slideIdArray : [],
501  slideIdCount : 0,
502  isSlideshow : false,
503  isPaused : false,
504  loopSlides : false,
505
506  // Iframe options.
507  isLightframe : false,
508  iframe_width : 600,
509  iframe_height : 400,
510  iframe_border : 1,
511
512  // Video and modal options.
513  enableVideo : false,
514  flvPlayer : '/flvplayer.swf',
515  flvFlashvars : '',
516  isModal : false,
517  isVideo : false,
518  videoId : false,
519  modalWidth : 400,
520  modalHeight : 400,
521  modalHTML : null,
522
523
524  // initialize()
525  // Constructor runs on completion of the DOM loading.
526  // The function inserts html at the bottom of the page which is used
527  // to display the shadow overlay and the image container.
528  initialize: function() {
529
530    var s = Drupal.settings.lightbox2;
531    Lightbox.overlayOpacity = s.overlay_opacity;
532    Lightbox.overlayColor = s.overlay_color;
533    Lightbox.disableCloseClick = s.disable_close_click;
534    Lightbox.resizeSequence = s.resize_sequence;
535    Lightbox.resizeSpeed = s.resize_speed;
536    Lightbox.fadeInSpeed = s.fade_in_speed;
537    Lightbox.slideDownSpeed = s.slide_down_speed;
538    Lightbox.borderSize = s.border_size;
539    Lightbox.boxColor = s.box_color;
540    Lightbox.fontColor = s.font_color;
541    Lightbox.topPosition = s.top_position;
542    Lightbox.rtl = s.rtl;
543    Lightbox.loopItems = s.loop_items;
544    Lightbox.keysClose = s.keys_close.split(" ");
545    Lightbox.keysPrevious = s.keys_previous.split(" ");
546    Lightbox.keysNext = s.keys_next.split(" ");
547    Lightbox.keysZoom = s.keys_zoom.split(" ");
548    Lightbox.keysPlayPause = s.keys_play_pause.split(" ");
549    Lightbox.disableResize = s.disable_resize;
550    Lightbox.disableZoom = s.disable_zoom;
551    Lightbox.slideInterval = s.slideshow_interval;
552    Lightbox.showPlayPause = s.show_play_pause;
553    Lightbox.showCaption = s.show_caption;
554    Lightbox.autoStart = s.slideshow_automatic_start;
555    Lightbox.autoExit = s.slideshow_automatic_exit;
556    Lightbox.pauseOnNextClick = s.pause_on_next_click;
557    Lightbox.pauseOnPrevClick = s.pause_on_previous_click;
558    Lightbox.loopSlides = s.loop_slides;
559    Lightbox.alternative_layout = s.use_alt_layout;
560    Lightbox.iframe_width = s.iframe_width;
561    Lightbox.iframe_height = s.iframe_height;
562    Lightbox.iframe_border = s.iframe_border;
563    Lightbox.enableVideo = s.enable_video;
564    if (s.enable_video) {
565      Lightbox.flvPlayer = s.flvPlayer;
566      Lightbox.flvFlashvars = s.flvFlashvars;
567    }
568
569    // Make the lightbox divs.
570    var layout_class = (s.use_alt_layout ? 'lightbox2-alt-layout' : 'lightbox2-orig-layout');
571    var output = '<div id="lightbox2-overlay" style="display: none;"></div>\
572      <div id="lightbox" style="display: none;" class="' + layout_class + '">\
573        <div id="outerImageContainer"></div>\
574        <div id="imageDataContainer" class="clearfix">\
575          <div id="imageData"></div>\
576        </div>\
577      </div>';
578    var loading = '<div id="loading"><a href="#" id="loadingLink"></a></div>';
579    var modal = '<div id="modalContainer" style="display: none;"></div>';
580    var frame = '<div id="frameContainer" style="display: none;"></div>';
581    var imageContainer = '<div id="imageContainer" style="display: none;"></div>';
582    var details = '<div id="imageDetails"></div>';
583    var bottomNav = '<div id="bottomNav"></div>';
584    var image = '<img id="lightboxImage" alt="" />';
585    var hoverNav = '<div id="hoverNav"><a id="prevLink" href="#"></a><a id="nextLink" href="#"></a></div>';
586    var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" href="#"></a><a id="frameNextLink" href="#"></a></div>';
587    var hoverNav = '<div id="hoverNav"><a id="prevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="nextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>';
588    var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="frameNextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>';
589    var caption = '<span id="caption"></span>';
590    var numberDisplay = '<span id="numberDisplay"></span>';
591    var close = '<a id="bottomNavClose" title="' + Drupal.t('Close') + '" href="#"></a>';
592    var zoom = '<a id="bottomNavZoom" href="#"></a>';
593    var zoomOut = '<a id="bottomNavZoomOut" href="#"></a>';
594    var pause = '<a id="lightshowPause" title="' + Drupal.t('Pause Slideshow') + '" href="#" style="display: none;"></a>';
595    var play = '<a id="lightshowPlay" title="' + Drupal.t('Play Slideshow') + '" href="#" style="display: none;"></a>';
596
597    $("body").append(output);
598    $('#outerImageContainer').append(modal + frame + imageContainer + loading);
599    if (!s.use_alt_layout) {
600      $('#imageContainer').append(image + hoverNav);
601      $('#imageData').append(details + bottomNav);
602      $('#imageDetails').append(caption + numberDisplay);
603      $('#bottomNav').append(frameNav + close + zoom + zoomOut + pause + play);
604    }
605    else {
606      $('#outerImageContainer').append(bottomNav);
607      $('#imageContainer').append(image);
608      $('#bottomNav').append(close + zoom + zoomOut);
609      $('#imageData').append(hoverNav + details);
610      $('#imageDetails').append(caption + numberDisplay + pause + play);
611    }
612
613    // Setup onclick handlers.
614    if (Lightbox.disableCloseClick) {
615      $('#lightbox2-overlay').click(function() { Lightbox.end(); return false; } ).hide();
616    }
617    $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } );
618    $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } );
619    $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } );
620    $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } );
621    $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } );
622    $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } );
623    $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } );
624
625    // Fix positioning.
626    $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'});
627    $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'});
628    $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor});
629    if (Lightbox.alternative_layout) {
630      $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'});
631    }
632    else if (Lightbox.rtl == 1 && $.browser.msie) {
633      $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'});
634    }
635
636    // Force navigation links to always be displayed
637    if (s.force_show_nav) {
638      $('#prevLink, #nextLink').addClass("force_show_nav");
639    }
640
641  },
642
643  // initList()
644  // Loops through anchor tags looking for 'lightbox', 'lightshow' and
645  // 'lightframe', etc, references and applies onclick events to appropriate
646  // links. You can rerun after dynamically adding images w/ajax.
647  initList : function(context) {
648
649    if (context == undefined || context == null) {
650      context = document;
651    }
652
653    // Attach lightbox to any links with rel 'lightbox', 'lightshow' or
654    // 'lightframe', etc.
655    $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
656      if (Lightbox.disableCloseClick) {
657        $('#lightbox').unbind('click');
658        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
659      }
660      Lightbox.start(this, false, false, false, false);
661      if (e.preventDefault) { e.preventDefault(); }
662      return false;
663    });
664    $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
665      if (Lightbox.disableCloseClick) {
666        $('#lightbox').unbind('click');
667        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
668      }
669      Lightbox.start(this, true, false, false, false);
670      if (e.preventDefault) { e.preventDefault(); }
671      return false;
672    });
673    $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
674      if (Lightbox.disableCloseClick) {
675        $('#lightbox').unbind('click');
676        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
677      }
678      Lightbox.start(this, false, true, false, false);
679      if (e.preventDefault) { e.preventDefault(); }
680      return false;
681    });
682    if (Lightbox.enableVideo) {
683      $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
684        if (Lightbox.disableCloseClick) {
685          $('#lightbox').unbind('click');
686          $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
687        }
688        Lightbox.start(this, false, false, true, false);
689        if (e.preventDefault) { e.preventDefault(); }
690        return false;
691      });
692    }
693    $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
694      $('#lightbox').unbind('click');
695      // Add classes from the link to the lightbox div - don't include lightbox-processed
696      $('#lightbox').addClass($(this).attr('class'));
697      $('#lightbox').removeClass('lightbox-processed');
698      Lightbox.start(this, false, false, false, true);
699      if (e.preventDefault) { e.preventDefault(); }
700      return false;
701    });
702    $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
703      Lightbox.auto_modal = true;
704      $('#lightbox').unbind('click');
705      Lightbox.start(this, false, false, false, true);
706      if (e.preventDefault) { e.preventDefault(); }
707      return false;
708    });
709  },
710
711  // start()
712  // Display overlay and lightbox. If image is part of a set, add siblings to
713  // imageArray.
714  start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) {
715
716    Lightbox.isPaused = !Lightbox.autoStart;
717
718    // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2.
719    Lightbox.toggleSelectsFlash('hide');
720
721    // Stretch overlay to fill page and fade in.
722    var arrayPageSize = Lightbox.getPageSize();
723    $("#lightbox2-overlay").hide().css({
724      'width': '100%',
725      'zIndex': '10090',
726      'height': arrayPageSize[1] + 'px',
727      'backgroundColor' : '#' + Lightbox.overlayColor
728    });
729    // Detect OS X FF2 opacity + flash issue.
730    if (lightvideo && this.detectMacFF2()) {
731      $("#lightbox2-overlay").removeClass("overlay_default");
732      $("#lightbox2-overlay").addClass("overlay_macff2");
733      $("#lightbox2-overlay").css({'opacity' : null});
734    }
735    else {
736      $("#lightbox2-overlay").removeClass("overlay_macff2");
737      $("#lightbox2-overlay").addClass("overlay_default");
738      $("#lightbox2-overlay").css({'opacity' : Lightbox.overlayOpacity});
739    }
740    $("#lightbox2-overlay").fadeIn(Lightbox.fadeInSpeed);
741
742
743    Lightbox.isSlideshow = slideshow;
744    Lightbox.isLightframe = lightframe;
745    Lightbox.isVideo = lightvideo;
746    Lightbox.isModal = lightmodal;
747    Lightbox.imageArray = [];
748    Lightbox.imageNum = 0;
749
750    var anchors = $(imageLink.tagName);
751    var anchor = null;
752    var rel_parts = Lightbox.parseRel(imageLink);
753    var rel = rel_parts["rel"];
754    var rel_group = rel_parts["group"];
755    var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title);
756    var rel_style = null;
757    var i = 0;
758
759    if (rel_parts["flashvars"]) {
760      Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"];
761    }
762
763    // Set the title for image alternative text.
764    var alt = imageLink.title;
765    if (!alt) {
766      var img = $(imageLink).find("img");
767      if (img && $(img).attr("alt")) {
768        alt = $(img).attr("alt");
769      }
770      else {
771        alt = title;
772      }
773    }
774
775    if ($(imageLink).attr('id') == 'lightboxAutoModal') {
776      rel_style = rel_parts["style"];
777      Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]);
778    }
779    else {
780      // Handle lightbox images with no grouping.
781      if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {
782        Lightbox.imageArray.push([imageLink.href, title, alt]);
783      }
784
785      // Handle other items with no grouping.
786      else if (!rel_group) {
787        rel_style = rel_parts["style"];
788        Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
789      }
790
791      // Handle grouped items.
792      else {
793
794        // Loop through anchors and add them to imageArray.
795        for (i = 0; i < anchors.length; i++) {
796          anchor = anchors[i];
797          if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) {
798            var rel_data = Lightbox.parseRel(anchor);
799            var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title);
800            img_alt = anchor.title;
801            if (!img_alt) {
802              var anchor_img = $(anchor).find("img");
803              if (anchor_img && $(anchor_img).attr("alt")) {
804                img_alt = $(anchor_img).attr("alt");
805              }
806              else {
807                img_alt = title;
808              }
809            }
810            if (rel_data["rel"] == rel) {
811              if (rel_data["group"] == rel_group) {
812                if (Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) {
813                  rel_style = rel_data["style"];
814                }
815                Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]);
816              }
817            }
818          }
819        }
820
821        // Remove duplicates.
822        for (i = 0; i < Lightbox.imageArray.length; i++) {
823          for (j = Lightbox.imageArray.length-1; j > i; j--) {
824            if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) {
825              Lightbox.imageArray.splice(j,1);
826            }
827          }
828        }
829        while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) {
830          Lightbox.imageNum++;
831        }
832      }
833    }
834
835    if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) {
836      $('#lightshowPlay').show();
837      $('#lightshowPause').hide();
838    }
839
840    // Calculate top and left offset for the lightbox.
841    var arrayPageScroll = Lightbox.getPageScroll();
842    var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
843    var lightboxLeft = arrayPageScroll[0];
844    $('#frameContainer, #modalContainer, #lightboxImage').hide();
845    $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
846    $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();
847    $('#outerImageContainer').css({'width': '250px', 'height': '250px'});
848    $('#lightbox').css({
849      'zIndex': '10500',
850      'top': lightboxTop + 'px',
851      'left': lightboxLeft + 'px'
852    }).show();
853
854    Lightbox.total = Lightbox.imageArray.length;
855    Lightbox.changeData(Lightbox.imageNum);
856  },
857
858  // changeData()
859  // Hide most elements and preload image in preparation for resizing image
860  // container.
861  changeData: function(imageNum, zoomIn) {
862
863    if (Lightbox.inprogress === false) {
864      if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) {
865        if (imageNum >= Lightbox.total) imageNum = 0;
866        if (imageNum < 0) imageNum = Lightbox.total - 1;
867      }
868
869      if (Lightbox.isSlideshow) {
870        for (var i = 0; i < Lightbox.slideIdCount; i++) {
871          window.clearTimeout(Lightbox.slideIdArray[i]);
872        }
873      }
874      Lightbox.inprogress = true;
875      Lightbox.activeImage = imageNum;
876
877      if (Lightbox.disableResize && !Lightbox.isSlideshow) {
878        zoomIn = true;
879      }
880      Lightbox.isZoomedIn = zoomIn;
881
882
883      // Hide elements during transition.
884      $('#loading').css({'zIndex': '10500'}).show();
885      if (!Lightbox.alternative_layout) {
886        $('#imageContainer').hide();
887      }
888      $('#frameContainer, #modalContainer, #lightboxImage').hide();
889      $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
890      $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();
891
892      // Preload image content, but not iframe pages.
893      if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) {
894        $("#lightbox #imageDataContainer").removeClass('lightbox2-alt-layout-data');
895        imgPreloader = new Image();
896        imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); };
897
898        imgPreloader.onload = function() {
899          var photo = document.getElementById('lightboxImage');
900          photo.src = Lightbox.imageArray[Lightbox.activeImage][0];
901          photo.alt = Lightbox.imageArray[Lightbox.activeImage][2];
902
903          var imageWidth = imgPreloader.width;
904          var imageHeight = imgPreloader.height;
905
906          // Resize code.
907          var arrayPageSize = Lightbox.getPageSize();
908          var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) };
909          var orig = { w:imgPreloader.width, h:imgPreloader.height };
910
911          // Image is very large, so show a smaller version of the larger image
912          // with zoom button.
913          if (zoomIn !== true) {
914            var ratio = 1.0; // Shrink image with the same aspect.
915            $('#bottomNavZoomOut, #bottomNavZoom').hide();
916            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
917              ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h;
918              if (!Lightbox.disableZoom && !Lightbox.isSlideshow) {
919                $('#bottomNavZoom').css({'zIndex': '10500'}).show();
920              }
921            }
922
923            imageWidth  = Math.floor(orig.w * ratio);
924            imageHeight = Math.floor(orig.h * ratio);
925          }
926
927          else {
928            $('#bottomNavZoom').hide();
929            // Only display zoom out button if the image is zoomed in already.
930            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
931              // Only display zoom out button if not a slideshow and if the
932              // buttons aren't disabled.
933              if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) {
934                $('#bottomNavZoomOut').css({'zIndex': '10500'}).show();
935              }
936            }
937          }
938
939          photo.style.width = (imageWidth) + 'px';
940          photo.style.height = (imageHeight) + 'px';
941          Lightbox.resizeContainer(imageWidth, imageHeight);
942
943          // Clear onLoad, IE behaves irratically with animated gifs otherwise.
944          imgPreloader.onload = function() {};
945        };
946
947        imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
948        imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2];
949      }
950
951      // Set up frame size, etc.
952      else if (Lightbox.isLightframe) {
953        $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data');
954        var src = Lightbox.imageArray[Lightbox.activeImage][0];
955        $('#frameContainer').html('<iframe id="lightboxFrame" style="display: none;" src="'+src+'"></iframe>');
956
957        // Enable swf support in Gecko browsers.
958        if ($.browser.mozilla && src.indexOf('.swf') != -1) {
959          setTimeout(function () {
960            document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
961          }, 1000);
962        }
963
964        if (!Lightbox.iframe_border) {
965          $('#lightboxFrame').css({'border': 'none'});
966          $('#lightboxFrame').attr('frameborder', '0');
967        }
968        var iframe = document.getElementById('lightboxFrame');
969        var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3];
970        iframe = Lightbox.setStyles(iframe, iframeStyles);
971        Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));
972      }
973      else if (Lightbox.isVideo || Lightbox.isModal) {
974        $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data');
975        var container = document.getElementById('modalContainer');
976        var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3];
977        container = Lightbox.setStyles(container, modalStyles);
978        if (Lightbox.isVideo) {
979          Lightbox.modalHeight =  parseInt(container.height, 10) - 10;
980          Lightbox.modalWidth =  parseInt(container.width, 10) - 10;
981          Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]);
982        }
983        Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10));
984      }
985    }
986  },
987
988  // imgNodeLoadingError()
989  imgNodeLoadingError: function(image) {
990    var s = Drupal.settings.lightbox2;
991    var original_image = Lightbox.imageArray[Lightbox.activeImage][0];
992    if (s.display_image_size !== "") {
993      original_image = original_image.replace(new RegExp("."+s.display_image_size), "");
994    }
995    Lightbox.imageArray[Lightbox.activeImage][0] = original_image;
996    image.onerror = function() { Lightbox.imgLoadingError(image); };
997    image.src = original_image;
998  },
999
1000  // imgLoadingError()
1001  imgLoadingError: function(image) {
1002    var s = Drupal.settings.lightbox2;
1003    Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image;
1004    image.src = s.default_image;
1005  },
1006
1007  // resizeContainer()
1008  resizeContainer: function(imgWidth, imgHeight) {
1009
1010    imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth);
1011
1012    this.widthCurrent = $('#outerImageContainer').width();
1013    this.heightCurrent = $('#outerImageContainer').height();
1014
1015    var widthNew = (imgWidth  + (Lightbox.borderSize * 2));
1016    var heightNew = (imgHeight  + (Lightbox.borderSize * 2));
1017
1018    // Scalars based on change from old to new.
1019    this.xScale = ( widthNew / this.widthCurrent) * 100;
1020    this.yScale = ( heightNew / this.heightCurrent) * 100;
1021
1022    // Calculate size difference between new and old image, and resize if
1023    // necessary.
1024    wDiff = this.widthCurrent - widthNew;
1025    hDiff = this.heightCurrent - heightNew;
1026
1027    $('#modalContainer').css({'width': imgWidth, 'height': imgHeight});
1028    // Detect animation sequence.
1029    if (Lightbox.resizeSequence) {
1030      var animate1 = {width: widthNew};
1031      var animate2 = {height: heightNew};
1032      if (Lightbox.resizeSequence == 2) {
1033        animate1 = {height: heightNew};
1034        animate2 = {width: widthNew};
1035      }
1036      $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
1037    }
1038    // Simultaneous.
1039    else {
1040      $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
1041    }
1042
1043    // If new and old image are same size and no scaling transition is necessary
1044    // do a quick pause to prevent image flicker.
1045    if ((hDiff === 0) && (wDiff === 0)) {
1046      if ($.browser.msie) {
1047        Lightbox.pause(250);
1048      }
1049      else {
1050        Lightbox.pause(100);
1051      }
1052    }
1053
1054    var s = Drupal.settings.lightbox2;
1055    if (!s.use_alt_layout) {
1056      $('#prevLink, #nextLink').css({'height': imgHeight + 'px'});
1057    }
1058    $('#imageDataContainer').css({'width': widthNew + 'px'});
1059  },
1060
1061  // showData()
1062  // Display image and begin preloading neighbors.
1063  showData: function() {
1064    $('#loading').hide();
1065
1066    if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) {
1067      Lightbox.updateDetails();
1068      if (Lightbox.isLightframe) {
1069        $('#frameContainer').show();
1070        if ($.browser.safari || Lightbox.fadeInSpeed === 0) {
1071          $('#lightboxFrame').css({'zIndex': '10500'}).show();
1072        }
1073        else {
1074          $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
1075        }
1076      }
1077      else {
1078        if (Lightbox.isVideo) {
1079          $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show();
1080        }
1081        else {
1082          var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);
1083          if (Lightbox.imageArray[Lightbox.activeImage][4]) {
1084            $(src).appendTo("#modalContainer");
1085            $('#modalContainer').css({'zIndex': '10500'}).show();
1086          }
1087          else {
1088            // Use a callback to show the new image, otherwise you get flicker.
1089            $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();});
1090          }
1091          $('#modalContainer').unbind('click');
1092        }
1093        // This might be needed in the Lightframe section above.
1094        //$('#modalContainer').css({'zIndex': '10500'}).show();
1095      }
1096    }
1097
1098    // Handle display of image content.
1099    else {
1100      $('#imageContainer').show();
1101      if ($.browser.safari || Lightbox.fadeInSpeed === 0) {
1102        $('#lightboxImage').css({'zIndex': '10500'}).show();
1103      }
1104      else {
1105        $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
1106      }
1107      Lightbox.updateDetails();
1108      this.preloadNeighborImages();
1109    }
1110    Lightbox.inprogress = false;
1111
1112    // Slideshow specific stuff.
1113    if (Lightbox.isSlideshow) {
1114      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
1115        if (Lightbox.autoExit) {
1116          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval);
1117        }
1118      }
1119      else {
1120        if (!Lightbox.isPaused && Lightbox.total > 1) {
1121          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval);
1122        }
1123      }
1124      if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) {
1125        $('#lightshowPause').show();
1126        $('#lightshowPlay').hide();
1127      }
1128      else if (Lightbox.showPlayPause && Lightbox.total > 1) {
1129        $('#lightshowPause').hide();
1130        $('#lightshowPlay').show();
1131      }
1132    }
1133
1134    // Adjust the page overlay size.
1135    var arrayPageSize = Lightbox.getPageSize();
1136    var arrayPageScroll = Lightbox.getPageScroll();
1137    var pageHeight = arrayPageSize[1];
1138    if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) {
1139      var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
1140      pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop;
1141    }
1142    $('#lightbox2-overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'});
1143
1144    // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as
1145    // expected.
1146    if ($.browser.mozilla) {
1147      if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) {
1148        setTimeout(function () {
1149          document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
1150        }, 1000);
1151      }
1152    }
1153  },
1154
1155  // updateDetails()
1156  // Display caption, image number, and bottom nav.
1157  updateDetails: function() {
1158
1159    $("#imageDataContainer").hide();
1160
1161    var s = Drupal.settings.lightbox2;
1162
1163    if (s.show_caption) {
1164      var caption = Lightbox.filterXSS(Lightbox.imageArray[Lightbox.activeImage][1]);
1165      if (!caption) caption = '';
1166      $('#caption').html(caption).css({'zIndex': '10500'}).show();
1167    }
1168
1169    // If image is part of set display 'Image x of x'.
1170    var numberDisplay = null;
1171    if (s.image_count && Lightbox.total > 1) {
1172      var currentImage = Lightbox.activeImage + 1;
1173      if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) {
1174        numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1175      }
1176      else if (Lightbox.isVideo) {
1177        numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1178      }
1179      else {
1180        numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1181      }
1182      $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show();
1183    }
1184    else {
1185      $('#numberDisplay').hide();
1186    }
1187
1188    $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() {
1189      $("#bottomNav").show();
1190    });
1191    if (Lightbox.rtl == 1) {
1192      $("#bottomNav").css({'float': 'left'});
1193    }
1194    Lightbox.updateNav();
1195  },
1196
1197  // updateNav()
1198  // Display appropriate previous and next hover navigation.
1199  updateNav: function() {
1200
1201    $('#hoverNav').css({'zIndex': '10500'}).show();
1202    var prevLink = '#prevLink';
1203    var nextLink = '#nextLink';
1204
1205    // Slideshow is separated as we need to show play / pause button.
1206    if (Lightbox.isSlideshow) {
1207      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) {
1208        $(prevLink).css({'zIndex': '10500'}).show().click(function() {
1209          if (Lightbox.pauseOnPrevClick) {
1210            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1211          }
1212          Lightbox.changeData(Lightbox.activeImage - 1); return false;
1213        });
1214      }
1215      else {
1216        $(prevLink).hide();
1217      }
1218
1219      // If not last image in set, display next image button.
1220      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) {
1221        $(nextLink).css({'zIndex': '10500'}).show().click(function() {
1222          if (Lightbox.pauseOnNextClick) {
1223            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1224          }
1225          Lightbox.changeData(Lightbox.activeImage + 1); return false;
1226        });
1227      }
1228      // Safari browsers need to have hide() called again.
1229      else {
1230        $(nextLink).hide();
1231      }
1232    }
1233
1234    // All other types of content.
1235    else {
1236
1237      if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) {
1238        $('#frameHoverNav').css({'zIndex': '10500'}).show();
1239        $('#hoverNav').css({'zIndex': '10500'}).hide();
1240        prevLink = '#framePrevLink';
1241        nextLink = '#frameNextLink';
1242      }
1243
1244      // If not first image in set, display prev image button.
1245      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) {
1246        // Unbind any other click handlers, otherwise this adds a new click handler
1247        // each time the arrow is clicked.
1248        $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() {
1249          Lightbox.changeData(Lightbox.activeImage - 1); return false;
1250        });
1251      }
1252      // Safari browsers need to have hide() called again.
1253      else {
1254        $(prevLink).hide();
1255      }
1256
1257      // If not last image in set, display next image button.
1258      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) {
1259        // Unbind any other click handlers, otherwise this adds a new click handler
1260        // each time the arrow is clicked.
1261        $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() {
1262          Lightbox.changeData(Lightbox.activeImage + 1); return false;
1263        });
1264      }
1265      // Safari browsers need to have hide() called again.
1266      else {
1267        $(nextLink).hide();
1268      }
1269    }
1270
1271    // Don't enable keyboard shortcuts so forms will work.
1272    if (!Lightbox.isModal) {
1273      this.enableKeyboardNav();
1274    }
1275  },
1276
1277
1278  // enableKeyboardNav()
1279  enableKeyboardNav: function() {
1280    $(document).bind("keydown", this.keyboardAction);
1281  },
1282
1283  // disableKeyboardNav()
1284  disableKeyboardNav: function() {
1285    $(document).unbind("keydown", this.keyboardAction);
1286  },
1287
1288  // keyboardAction()
1289  keyboardAction: function(e) {
1290    if (e === null) { // IE.
1291      keycode = event.keyCode;
1292      escapeKey = 27;
1293    }
1294    else { // Mozilla.
1295      keycode = e.keyCode;
1296      escapeKey = e.DOM_VK_ESCAPE;
1297    }
1298
1299    key = String.fromCharCode(keycode).toLowerCase();
1300
1301    // Close lightbox.
1302    if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) {
1303      Lightbox.end('forceClose');
1304    }
1305    // Display previous image (p, <-).
1306    else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) {
1307      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) {
1308        Lightbox.changeData(Lightbox.activeImage - 1);
1309      }
1310
1311    }
1312    // Display next image (n, ->).
1313    else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) {
1314      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) {
1315        Lightbox.changeData(Lightbox.activeImage + 1);
1316      }
1317    }
1318    // Zoom in.
1319    else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) {
1320      if (Lightbox.isZoomedIn) {
1321        Lightbox.changeData(Lightbox.activeImage, false);
1322      }
1323      else if (!Lightbox.isZoomedIn) {
1324        Lightbox.changeData(Lightbox.activeImage, true);
1325      }
1326      return false;
1327    }
1328    // Toggle play / pause (space).
1329    else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) {
1330
1331      if (Lightbox.isPaused) {
1332        Lightbox.togglePlayPause("lightshowPlay", "lightshowPause");
1333      }
1334      else {
1335        Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1336      }
1337      return false;
1338    }
1339  },
1340
1341  preloadNeighborImages: function() {
1342
1343    if ((Lightbox.total - 1) > Lightbox.activeImage) {
1344      preloadNextImage = new Image();
1345      preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0];
1346    }
1347    if (Lightbox.activeImage > 0) {
1348      preloadPrevImage = new Image();
1349      preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0];
1350    }
1351
1352  },
1353
1354  end: function(caller) {
1355    var closeClick = (caller == 'slideshow' ? false : true);
1356    if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) {
1357      return;
1358    }
1359    // To prevent double clicks on navigation links.
1360    if (Lightbox.inprogress === true && caller != 'forceClose') {
1361      return;
1362    }
1363    Lightbox.disableKeyboardNav();
1364    $('#lightbox').hide();
1365    $("#lightbox2-overlay").fadeOut();
1366    Lightbox.isPaused = true;
1367    Lightbox.inprogress = false;
1368    // Replaces calls to showSelectBoxes() and showFlash() in original
1369    // lightbox2.
1370    Lightbox.toggleSelectsFlash('visible');
1371    if (Lightbox.isSlideshow) {
1372      for (var i = 0; i < Lightbox.slideIdCount; i++) {
1373        window.clearTimeout(Lightbox.slideIdArray[i]);
1374      }
1375      $('#lightshowPause, #lightshowPlay').hide();
1376    }
1377    else if (Lightbox.isLightframe) {
1378      $('#frameContainer').empty().hide();
1379    }
1380    else if (Lightbox.isVideo || Lightbox.isModal) {
1381      if (!Lightbox.auto_modal) {
1382        $('#modalContainer').hide().html("");
1383      }
1384      Lightbox.auto_modal = false;
1385    }
1386  },
1387
1388
1389  // getPageScroll()
1390  // Returns array with x,y page scroll values.
1391  // Core code from - quirksmode.com.
1392  getPageScroll : function() {
1393
1394    var xScroll, yScroll;
1395
1396    if (self.pageYOffset || self.pageXOffset) {
1397      yScroll = self.pageYOffset;
1398      xScroll = self.pageXOffset;
1399    }
1400    else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {  // Explorer 6 Strict.
1401      yScroll = document.documentElement.scrollTop;
1402      xScroll = document.documentElement.scrollLeft;
1403    }
1404    else if (document.body) {// All other Explorers.
1405      yScroll = document.body.scrollTop;
1406      xScroll = document.body.scrollLeft;
1407    }
1408
1409    arrayPageScroll = [xScroll,yScroll];
1410    return arrayPageScroll;
1411  },
1412
1413  // getPageSize()
1414  // Returns array with page width, height and window width, height.
1415  // Core code from - quirksmode.com.
1416  // Edit for Firefox by pHaez.
1417
1418  getPageSize : function() {
1419
1420    var xScroll, yScroll;
1421
1422    if (window.innerHeight && window.scrollMaxY) {
1423      xScroll = window.innerWidth + window.scrollMaxX;
1424      yScroll = window.innerHeight + window.scrollMaxY;
1425    }
1426    else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac.
1427      xScroll = document.body.scrollWidth;
1428      yScroll = document.body.scrollHeight;
1429    }
1430    else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari.
1431      xScroll = document.body.offsetWidth;
1432      yScroll = document.body.offsetHeight;
1433    }
1434
1435    var windowWidth, windowHeight;
1436
1437    if (self.innerHeight) { // All except Explorer.
1438      if (document.documentElement.clientWidth) {
1439        windowWidth = document.documentElement.clientWidth;
1440      }
1441      else {
1442        windowWidth = self.innerWidth;
1443      }
1444      windowHeight = self.innerHeight;
1445    }
1446    else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode.
1447      windowWidth = document.documentElement.clientWidth;
1448      windowHeight = document.documentElement.clientHeight;
1449    }
1450    else if (document.body) { // Other Explorers.
1451      windowWidth = document.body.clientWidth;
1452      windowHeight = document.body.clientHeight;
1453    }
1454    // For small pages with total height less than height of the viewport.
1455    if (yScroll < windowHeight) {
1456      pageHeight = windowHeight;
1457    }
1458    else {
1459      pageHeight = yScroll;
1460    }
1461    // For small pages with total width less than width of the viewport.
1462    if (xScroll < windowWidth) {
1463      pageWidth = xScroll;
1464    }
1465    else {
1466      pageWidth = windowWidth;
1467    }
1468    arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
1469    return arrayPageSize;
1470  },
1471
1472
1473  // pause(numberMillis)
1474  pause : function(ms) {
1475    var date = new Date();
1476    var curDate = null;
1477    do { curDate = new Date(); }
1478    while (curDate - date < ms);
1479  },
1480
1481
1482  // toggleSelectsFlash()
1483  // Hide / unhide select lists and flash objects as they appear above the
1484  // lightbox in some browsers.
1485  toggleSelectsFlash: function (state) {
1486    if (state == 'visible') {
1487      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show();
1488    }
1489    else if (state == 'hide') {
1490      $("select:visible, embed:visible, object:visible").not('#lightboxAutoModal select, #lightboxAutoModal embed, #lightboxAutoModal object').addClass("lightbox_hidden");
1491      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide();
1492    }
1493  },
1494
1495
1496  // parseRel()
1497  parseRel: function (link) {
1498    var parts = [];
1499    parts["rel"] = parts["title"] = parts["group"] = parts["style"] = parts["flashvars"] = null;
1500    if (!$(link).attr('rel')) return parts;
1501    parts["rel"] = $(link).attr('rel').match(/\w+/)[0];
1502
1503    if ($(link).attr('rel').match(/\[(.*)\]/)) {
1504      var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|');
1505      parts["group"] = info[0];
1506      parts["style"] = info[1];
1507      if (parts["style"] != undefined && parts["style"].match(/flashvars:\s?(.*?);/)) {
1508        parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1];
1509      }
1510    }
1511    if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) {
1512      parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1];
1513    }
1514    return parts;
1515  },
1516
1517  // setStyles()
1518  setStyles: function(item, styles) {
1519    item.width = Lightbox.iframe_width;
1520    item.height = Lightbox.iframe_height;
1521    item.scrolling = "auto";
1522
1523    if (!styles) return item;
1524    var stylesArray = styles.split(';');
1525    for (var i = 0; i< stylesArray.length; i++) {
1526      if (stylesArray[i].indexOf('width:') >= 0) {
1527        var w = stylesArray[i].replace('width:', '');
1528        item.width = jQuery.trim(w);
1529      }
1530      else if (stylesArray[i].indexOf('height:') >= 0) {
1531        var h = stylesArray[i].replace('height:', '');
1532        item.height = jQuery.trim(h);
1533      }
1534      else if (stylesArray[i].indexOf('scrolling:') >= 0) {
1535        var scrolling = stylesArray[i].replace('scrolling:', '');
1536        item.scrolling = jQuery.trim(scrolling);
1537      }
1538      else if (stylesArray[i].indexOf('overflow:') >= 0) {
1539        var overflow = stylesArray[i].replace('overflow:', '');
1540        item.overflow = jQuery.trim(overflow);
1541      }
1542    }
1543    return item;
1544  },
1545
1546
1547  // togglePlayPause()
1548  // Hide the pause / play button as appropriate.  If pausing the slideshow also
1549  // clear the timers, otherwise move onto the next image.
1550  togglePlayPause: function(hideId, showId) {
1551    if (Lightbox.isSlideshow && hideId == "lightshowPause") {
1552      for (var i = 0; i < Lightbox.slideIdCount; i++) {
1553        window.clearTimeout(Lightbox.slideIdArray[i]);
1554      }
1555    }
1556    $('#' + hideId).hide();
1557    $('#' + showId).show();
1558
1559    if (hideId == "lightshowPlay") {
1560      Lightbox.isPaused = false;
1561      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
1562        Lightbox.end();
1563      }
1564      else if (Lightbox.total > 1) {
1565        Lightbox.changeData(Lightbox.activeImage + 1);
1566      }
1567    }
1568    else {
1569      Lightbox.isPaused = true;
1570    }
1571  },
1572
1573  triggerLightbox: function (rel_type, rel_group) {
1574    if (rel_type.length) {
1575      if (rel_group && rel_group.length) {
1576        $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click");
1577      }
1578      else {
1579        $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click");
1580      }
1581    }
1582  },
1583
1584  detectMacFF2: function() {
1585    var ua = navigator.userAgent.toLowerCase();
1586    if (/firefox[\/\s](\d+\.\d+)/.test(ua)) {
1587      var ffversion = new Number(RegExp.$1);
1588      if (ffversion < 3 && ua.indexOf('mac') != -1) {
1589        return true;
1590      }
1591    }
1592    return false;
1593  },
1594
1595  checkKey: function(keys, key, code) {
1596    return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1);
1597  },
1598
1599  filterXSS: function(str, allowed_tags) {
1600    var output = "";
1601    $.ajax({
1602      url: Drupal.settings.basePath + 'system/lightbox2/filter-xss',
1603      data: {
1604        'string' : str,
1605        'allowed_tags' : allowed_tags
1606      },
1607      type: "POST",
1608      async: false,
1609      dataType:  "json",
1610      success: function(data) {
1611        output = data;
1612      }
1613    });
1614    return output;
1615  }
1616
1617};
1618
1619// Initialize the lightbox.
1620Drupal.behaviors.initLightbox = function (context) {
1621  $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() {
1622    Lightbox.initialize();
1623    return false; // Break the each loop.
1624  });
1625
1626  // Attach lightbox to any links with lightbox rels.
1627  Lightbox.initList(context);
1628  $('#lightboxAutoModal', context).triggerHandler('click');
1629};
1630
1631;
1632
1633/**
1634 * Add MathJax support to HTML using settings variables defined in the module
1635 */
1636Drupal.behaviors.mathjax = function(context) {
1637  var mathjax = Drupal.settings.mathjax;
1638  // From http://www.mathjax.org/resources/docs/?dynamic.html
1639  var script = document.createElement("script");
1640  script.type = "text/javascript";
1641
1642  if (mathjax.path=='cdn') {
1643    script.src  = "https://d3eoax9i5htok0.cloudfront.net/mathjax/1.1-latest/MathJax.js";
1644    // script.src  = "http://cdn.mathjax.org/mathjax/latest/MathJax.js"; // unsafe clear connection
1645  }
1646  else {
1647    script.src = mathjax.path;
1648  }
1649
1650  var config = 'MathJax.Hub.Config({' + 
1651                 'extensions: ["tex2jax.js"],' +
1652                 'jax: ["input/TeX","output/HTML-CSS"],' +
1653                 'tex2jax: {' +
1654                   'inlineMath: [ [\'$\',\'$\'], [\'\\\\(\',\'\\\\)\'] ],' +  // look for $...$ and \(...\) as delimiters for inline math
1655                   'displayMath: [ [\'$$\',\'$$\'], [\'\\\\[\',\'\\\\]\'] ],' + // look for $$...$$ and \[...\] as delimiters for display math
1656                   'processEscapes: true' +
1657                 '}' +
1658               '});' +
1659               'MathJax.Hub.Startup.onload();';
1660
1661  if (window.opera) {
1662    script.innerHTML = config;
1663  }
1664  else {
1665    script.text = config;
1666  }
1667  document.getElementsByTagName("head")[0].appendChild(script);
1668};
1669;
1670
1671/*
1672 * Superfish v1.4.8 - jQuery menu widget
1673 * Copyright (c) 2008 Joel Birch
1674 *
1675 * Dual licensed under the MIT and GPL licenses:
1676 * 	http://www.opensource.org/licenses/mit-license.php
1677 * 	http://www.gnu.org/licenses/gpl.html
1678 *
1679 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
1680 */
1681
1682;(function($){
1683	$.fn.superfish = function(op){
1684
1685		var sf = $.fn.superfish,
1686			c = sf.c,
1687			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
1688			over = function(){
1689				var $$ = $(this), menu = getMenu($$);
1690				clearTimeout(menu.sfTimer);
1691				$$.showSuperfishUl().siblings().hideSuperfishUl();
1692			},
1693			out = function(){
1694				var $$ = $(this), menu = getMenu($$), o = sf.op;
1695				clearTimeout(menu.sfTimer);
1696				menu.sfTimer=setTimeout(function(){
1697					o.retainPath=($.inArray($$[0],o.$path)>-1);
1698					$$.hideSuperfishUl();
1699					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
1700				},o.delay);	
1701			},
1702			getMenu = function($menu){
1703				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
1704				sf.op = sf.o[menu.serial];
1705				return menu;
1706			},
1707			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
1708			
1709		return this.each(function() {
1710			var s = this.serial = sf.o.length;
1711			var o = $.extend({},sf.defaults,op);
1712			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
1713				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
1714					.filter('li:has(ul)').removeClass(o.pathClass);
1715			});
1716			sf.o[s] = sf.op = o;
1717			
1718			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
1719				if (o.autoArrows) addArrow( $('>a:first-child',this) );
1720			})
1721			.not('.'+c.bcClass)
1722				.hideSuperfishUl();
1723			
1724			var $a = $('a',this);
1725			$a.each(function(i){
1726				var $li = $a.eq(i).parents('li');
1727				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
1728			});
1729			o.onInit.call(this);
1730			
1731		}).each(function() {
1732			var menuClasses = [c.menuClass];
1733			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
1734			$(this).addClass(menuClasses.join(' '));
1735		});
1736	};
1737
1738	var sf = $.fn.superfish;
1739	sf.o = [];
1740	sf.op = {};
1741	sf.IE7fix = function(){
1742		var o = sf.op;
1743		if ($.browser.msie && $.browser.version >
1743 6 && o.dropShadows && o.animation.opacity!=undefined)
1744			this.toggleClass(sf.c.shadowClass+'-off');
1745		};
1746	sf.c = {
1747		bcClass     : 'sf-breadcrumb',
1748		menuClass   : 'sf-js-enabled',
1749		anchorClass : 'sf-with-ul',
1750		arrowClass  : 'sf-sub-indicator',
1751		shadowClass : 'sf-shadow'
1752	};
1753	sf.defaults = {
1754		hoverClass	: 'sfHover',
1755		pathClass	: 'overideThisToUse',
1756		pathLevels	: 1,
1757		delay		: 800,
1758		animation	: {opacity:'show'},
1759		speed		: 'normal',
1760		autoArrows	: true,
1761		dropShadows : true,
1762		disableHI	: false,		// true disables hoverIntent detection
1763		onInit		: function(){}, // callback functions
1764		onBeforeShow: function(){},
1765		onShow		: function(){},
1766		onHide		: function(){}
1767	};
1768	$.fn.extend({
1769		hideSuperfishUl : function(){
1770			var o = sf.op,
1771				not = (o.retainPath===true) ? o.$path : '';
1772			o.retainPath = false;
1773			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
1774					.find('>ul').hide().css('visibility','hidden');
1775			o.onHide.call($ul);
1776			return this;
1777		},
1778		showSuperfishUl : function(){
1779			var o = sf.op,
1780				sh = sf.c.shadowClass+'-off',
1781				$ul = this.addClass(o.hoverClass)
1782					.find('>ul:hidden').css('visibility','visible');
1783			sf.IE7fix.call($ul);
1784			o.onBeforeShow.call($ul);
1785			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
1786			return this;
1787		}
1788	});
1789
1790})(jQuery);
1791;
1792/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
1793 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
1794 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
1795 *
1796 * $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $
1797 * $Rev: 2111 $
1798 *
1799 * Version 2.1
1800 */
1801(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};if(!$.browser.version)$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1];})(jQuery);;
1802/**
1803* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
1804* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
1805* 
1806* @param  f  onMouseOver function || An object with configuration options
1807* @param  g  onMouseOut function  || Nothing (use configuration options object)
1808* @author    Brian Cherne <[email protected]>
1809*/
1810(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);;
1811// $Id: nice_menus.js,v 1.21 2010/06/18 06:14:12 vordude Exp $
1812
1813// This uses Superfish 1.4.8
1814// (http://users.tpg.com.au/j_birch/plugins/superfish)
1815
1816// Add Superfish to all Nice menus with some basic options.
1817(function ($) {
1818  $(document).ready(function() {
1819    $('ul.nice-menu').superfish({
1820      // Apply a generic hover class.
1821      hoverClass: 'over',
1822      // Disable generation of arrow mark-up.
1823      autoArrows: false,
1824      // Disable drop shadows.
1825      dropShadows: false,
1826      // Mouse delay.
1827      delay: Drupal.settings.nice_menus_options.delay,
1828      // Animation speed.
1829      speed: Drupal.settings.nice_menus_options.speed
1830    // Add in Brandon Aaron’s bgIframe plugin for IE select issues.
1831    // http://plugins.jquery.com/node/46/release
1832    }).find('ul').bgIframe({opacity:false});
1833    $('ul.nice-menu ul').css('display', 'none');
1834  });
1835})(jQuery);
1836;
1837// $Id: panels.js,v 1.2.4.1 2009/10/05 22:40:35 merlinofchaos Exp $
1838
1839(function ($) {
1840  Drupal.Panels = {};
1841
1842  Drupal.Panels.autoAttach = function() {
1843    if ($.browser.msie) {
1844      // If IE, attach a hover event so we can see our admin links.
1845      $("div.panel-pane").hover(
1846        function() {
1847          $('div.panel-hide', this).addClass("panel-hide-hover"); return true;
1848        },
1849        function() {
1850          $('div.panel-hide', this).removeClass("panel-hide-hover"); return true;
1851        }
1852      );
1853      $("div.admin-links").hover(
1854        function() {
1855          $(this).addClass("admin-links-hover"); return true;
1856        },
1857        function(){
1858          $(this).removeClass("admin-links-hover"); return true;
1859        }
1860      );
1861    }
1862  };
1863
1864  $(Drupal.Panels.autoAttach);
1865})(jQuery);
1866;
1867// $Id: poormanscron.js,v 1.1.2.3 2010/01/17 00:27:52 davereid Exp $
1868(function ($) {
1869
1870/**
1871 * Checks to see if the cron should be automatically run.
1872 */
1873Drupal.behaviors.cronCheck = function(context) {
1874  if (Drupal.settings.cron.runNext || false) {
1875    $('body:not(.cron-check-processed)', context).addClass('cron-check-processed').each(function() {
1876      // Only execute the cron check if its the right time.
1877      if (Math.round(new Date().getTime() / 1000.0) >= Drupal.settings.cron.runNext) {
1878        $.get(Drupal.settings.cron.basePath + '/run-cron-check');
1879      }
1880    });
1881  }
1882};
1883
1884})(jQuery);
1885;
1886/*
1887 * jQuery Cycle Plugin (with Transition Definitions)
1888 * Examples and documentation at: http://jquery.malsup.com/cycle/
1889 * Copyright (c) 2007-2010 M. Alsup
1890 * Version: 2.88 (08-JUN-2010)
1891 * Dual licensed under the MIT and GPL licenses.
1892 * http://jquery.malsup.com/license.html
1893 * Requires: jQuery v1.2.6 or later
1894 */
1895(function($){var ver="2.88";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,(!opts2.rev&&!opts.backwards));},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,(!opts.rev&&!opts.backwards));}}
1895}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevNextEvent);}if(opts.prev){$(opts.prev).unbind(opts.prevNextEvent);}if(opts.pager||opts.pagerAnchorBuilder){$.each(opts.pagerAnchors||[],function(){this.unbind().remove();});}opts.pagerAnchors=null;if(opts.destroy){opts.destroy(opts);}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}else{if(opts.backwards){opts.startingSlide=els.length-1;}}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=1;opts.startingSlide=opts.randomMap[1];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth||e.width||$e.attr("width");}if(!h){h=e.offsetHeight||e.height||$e.attr("height");}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetHeight||this.height||$el.attr("height")||0);this.cycleW=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetWidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="shuffle"?500:250;
1895while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.backwards){opts.nextSlide=opts.startingSlide==0?(els.length-1):opts.startingSlide-1;}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1);});}if(opts.pager||opts.pagerAnchorBuilder){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager||opts.pagerAnchorBuilder){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){debug("manualTrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=false;}if(opts.busy){debug("transition active, ignoring new tx request");return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){changed=true;var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing; currSlide: "+opts.currSlide+"; nextSlide: "+opts.nextSlide);opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}}}if(changed||opts.nextSlide==opts.currSlide){opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];if(opts.nextSlide==opts.currSlide){opts.nextSlide=(opts.currSlide==opts.slideCount-1)?0:opts.currSlide+1;}}else{if(opts.backwards){var roll=(opts.nextSlide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=1;opts.currSlide=0;}else{opts.nextSlide=roll?(els.length-1):opts.nextSlide-1;opts.currSlide=roll?0:opts.nextSlide+1;}}else{var roll=(opts.nextSlide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=els.length-2;opts.currSlide=els.length-1;}else{opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}}}}if(changed&&opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(els[opts.currSlide],els[opts.nextSlide],opts,fwd);}
1895else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}var cb=opts.onPrevNextEvent||opts.prevNextClick;if($.isFunction(cb)){cb(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);debug("pagerAnchorBuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}opts.pagerAnchors=opts.pagerAnchors||[];opts.pagerAnchors.push($a);$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}var cb=opts.onPagerEvent||opts.pagerClick;if($.isFunction(cb)){cb(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);});if(!/^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble){$a.bind("click.cycle",function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){debug("applying clearType background-color hack");function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0}
1895;opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:false};})(jQuery);
1896/*
1897 * jQuery Cycle Plugin Transition Definitions
1898 * This script is a plugin for the jQuery Cycle Plugin
1899 * Examples and documentation at: http://malsup.com/jquery/cycle/
1900 * Copyright (c) 2007-2010 M. Alsup
1901 * Version:	 2.72
1902 * Dual licensed under the MIT and GPL licenses:
1903 * http://www.opensource.org/licenses/mit-license.php
1904 * http://www.gnu.org/licenses/gpl.html
1905 */
1906(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0}
1906;};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);
1906var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);;
1907// $Id: views_slideshow.js,v 1.1.2.1.2.39 2010/07/01 03:29:08 redndahead Exp $
1908
1909/**
1910 *  @file
1911 *  A simple jQuery SingleFrame Div Slideshow Rotator.
1912 */
1913
1914/**
1915 * This will set our initial behavior, by starting up each individual slideshow.
1916 */
1917Drupal.behaviors.viewsSlideshowSingleFrame = function (context) {
1918  $('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() {
1919    var fullId = '#' + $(this).attr('id');
1920    var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId];
1921    settings.targetId = '#' + $(fullId + " :first").attr('id');
1922    settings.paused = false;
1923
1924    settings.opts = {
1925      speed:settings.speed,
1926      timeout:parseInt(settings.timeout),
1927      delay:parseInt(settings.delay),
1928      sync:settings.sync==1,
1929      random:settings.random==1,
1930      pause:false,
1931      allowPagerClickBubble:(settings.pager_hover==1 || settings.pager_click_to_page),
1932      prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.vss_id:null,
1933      next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.vss_id:null,
1934      pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.vss_id:null,
1935      nowrap:parseInt(settings.nowrap),
1936      pagerAnchorBuilder: function(idx, slide) {
1937        var classes = 'pager-item pager-num-' + (idx+1);
1938        if (idx == 0) {
1939          classes += ' first';
1940        }
1941        if ($(slide).siblings().length == idx) {
1942          classes += ' last';
1943        }
1944
1945        if (idx % 2) {
1946          classes += ' odd';
1947        }
1948        else {
1949          classes += ' even';
1950        }
1951        
1952        var theme = 'viewsSlideshowPager' + settings.pager_type;
1953        return Drupal.theme.prototype[theme] ? Drupal.theme(theme, classes, idx, slide, settings) : '';
1954      },
1955      after:function(curr, next, opts) {
1956        // Used for Image Counter.
1957        if (settings.image_count) {
1958          $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.num').html(opts.currSlide + 1);
1959          $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.total').html(opts.slideCount);
1960        }
1961      },
1962      before:function(curr, next, opts) {
1963        // Remember last slide.
1964        if (settings.remember_slide) {
1965          createCookie(settings.vss_id, opts.currSlide + 1, settings.remember_slide_days);
1966        }
1967
1968        // Make variable height.
1969        if (settings.fixed_height == 0) {
1970          //get the height of the current slide
1971          var $ht = $(this).height();
1972          //set the container's height to that of the current slide
1973          $(this).parent().animate({height: $ht});
1974        }
1975      },
1976      cleartype:(settings.ie.cleartype == 'true')? true : false,
1977      cleartypeNoBg:(settings.ie.cleartypenobg == 'true')? true : false
1978    }
1979    
1980    // Set the starting slide if we are supposed to remember the slide
1981    if (settings.remember_slide) {
1982      var startSlide = readCookie(settings.vss_id);
1983      if (startSlide == null) {
1984        startSlide = 0;
1985      }
1986      settings.opts.startingSlide =  startSlide;
1987    }
1988
1989    if (settings.pager_hover == 1) {
1990      settings.opts.pagerEvent = 'mouseover';
1991      settings.opts.pauseOnPagerHover = true;
1992    }
1993
1994    if (settings.effect == 'none') {
1995      settings.opts.speed = 1;
1996    }
1997    else {
1998      settings.opts.fx = settings.effect;
1999    }
2000
2001    // Pause on hover.
2002    if (settings.pause == 1) {
2003      $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).hover(function() {
2004        $(settings.targetId).cycle('pause');
2005      }, function() {
2006        if (settings.paused == false) {
2007          $(settings.targetId).cycle('resume');
2008        }
2009      });
2010    }
2011
2012    // Pause on clicking of the slide.
2013    if (settings.pause_on_click == 1) {
2014      $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).click(function() { 
2015        viewsSlideshowSingleFramePause(settings);
2016      });
2017    }
2018
2019    // Add additional settings.
2020		if (settings.advanced != "\n") {
2021      var advanced = settings.advanced.split("\n");
2022      for (i=0; i<advanced.length; i++) {
2023        var prop = '';
2024        var value = '';
2025        var property = advanced[i].split(":");
2026        for (j=0; j<property.length; j++) {
2027          if (j == 0) {
2028            prop = property[j];
2029          }
2030          else if (j == 1) {
2031            value = property[j];
2032          }
2033          else {
2034            value += ":" + property[j];
2035          }
2036        }
2037
2038        // Need to evaluate so true, false and numerics aren't a string.
2039        if (value == 'true' || value == 'false' || IsNumeric(value)) {
2040          value = eval(value);
2041        }
2042        else {
2043          // Parse strings into functions.
2044          var func = value.match(/function\s*\((.*?)\)\s*\{(.*)\}/i);
2045          if (func) {
2046            value = new Function(func[1].match(/(\w+)/g), func[2]);
2047          }
2048        }
2049	
2050        // Call both functions if prop was set previously.
2051        if (typeof(value) == "function" && prop in settings.opts) {
2052          var callboth = function(before_func, new_func) {
2053            return function() {
2054              before_func.apply(null, arguments);
2055              new_func.apply(null, arguments);
2056            };
2057          };
2058          settings.opts[prop] = callboth(settings.opts[prop], value);
2059        }
2060        else {
2061          settings.opts[prop] = value;
2062        }
2063      }
2064    }
2065    
2066    $(settings.targetId).cycle(settings.opts);
2067
2068    // Start Paused
2069    if (settings.start_paused) {
2070      viewsSlideshowSingleFramePause(settings);
2071    }
2072    
2073    // Pause if hidden.
2074    if (settings.pause_when_hidden) {
2075      var checkPause = function(settings) {
2076        // If the slideshow is visible and it is paused then resume.
2077        // otherwise if the slideshow is not visible and it is not paused then
2078        // pause it.
2079        var visible = viewsSlideshowSingleFrameIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
2080        if (visible && settings.paused) {
2081          viewsSlideshowSingleFrameResume(settings);
2082        }
2083        else if (!visible && !settings.paused) {
2084          viewsSlideshowSingleFramePause(settings);
2085        }
2086      }
2087     
2088      // Check when scrolled.
2089      $(window).scroll(function() {
2090       checkPause(settings);
2091      });
2092      
2093      // Check when the window is resized.
2094      $(window).resize(function() {
2095        checkPause(settings);
2096      });
2097    }
2098
2099    // Show image count for people who have js enabled.
2100    $('#views_slideshow_singleframe_image_count_' + settings.vss_id).show();
2101
2102    if (settings.controls > 0) {
2103      // Show controls for people who have js enabled browsers.
2104      $('#views_slideshow_singleframe_controls_' + settings.vss_id).show();
2105      
2106      $('#views_slideshow_singleframe_playpause_' + settings.vss_id).click(function(e) {
2107      	if (settings.paused) {
2108      	  viewsSlideshowSingleFrameResume(settings);
2109      	}
2110      	else {
2111      	  viewsSlideshowSingleFramePause(settings);
2112      	}
2113        e.preventDefault();
2114      });
2115    }
2116  });
2117}
2118
2119// Pause the slideshow 
2120viewsSlideshowSingleFramePause = function (settings) {
2121  //make Resume translatable
2122  var resume = Drupal.t('Resume');
2123
2124  $(settings.targetId).cycle('pause');
2125  if (settings.controls > 0) {
2126    $('#views_slideshow_singleframe_playpause_' + settings.vss_id)
2127      .addClass('views_slideshow_singleframe_play')
2128      .addClass('views_slideshow_play')
2129      .removeClass('views_slideshow_singleframe_pause')
2130      .removeClass('views_slideshow_pause')
2131      .text(resume);
2132  }
2133  settings.paused = true;
2134}
2135
2136// Resume the slideshow
2137viewsSlideshowSingleFrameResume = function (settings) {
2138  $(settings.targetId).cycle('resume');
2139  if (settings.controls > 0) {
2140    $('#views_slideshow_singleframe_playpause_' + settings.vss_id)
2141      .addClass('views_slideshow_singleframe_pause')
2142      .addClass('views_slideshow_pause')
2143      .removeClass('views_slideshow_singleframe_play')
2144      .removeClass('views_slideshow_play')
2145      .text('Pause');
2146  }
2147  settings.paused = false;
2148}
2149
2150Drupal.theme.prototype.viewsSlideshowPagerThumbnails = function (classes, idx, slide, settings) {
2151  var href = '#';
2152  if (settings.pager_click_to_page) {
2153    href = $(slide).find('a').attr('href');
2154  }
2155  return '<div class="' + classes + '"><a href="' + href + '"><img src="' + $(slide).find('img').attr('src') + '" /></a></div>';
2156}
2157
2158Drupal.theme.prototype.viewsSlideshowPagerNumbered = function (classes, idx, slide, settings) {
2159  var href = '#';
2160  if (settings.pager_click_to_page) {
2161    href = $(slide).find('a').attr('href');
2162  }
2163  return '<div class="' + classes + '"><a href="' + href + '">' + (idx+1) + '</a></div>';
2164}
2165
2166// Verify that the value is a number.
2167function IsNumeric(sText) {
2168  var ValidChars = "0123456789";
2169  var IsNumber=true;
2170  var Char;
2171
2172  for (var i=0; i < sText.length && IsNumber == true; i++) { 
2173    Char = sText.charAt(i); 
2174    if (ValidChars.indexOf(Char) == -1) {
2175      IsNumber = false;
2176    }
2177  }
2178  return IsNumber;
2179}
2180
2181/**
2182 * Cookie Handling Functions
2183 */
2184function createCookie(name,value,days) {
2185  if (days) {
2186    var date = new Date();
2187    date.setTime(date.getTime()+(days*24*60*60*1000));
2188    var expires = "; expires="+date.toGMTString();
2189  }
2190  else {
2191    var expires = "";
2192  }
2193  document.cookie = name+"="+value+expires+"; path=/";
2194}
2195
2196function readCookie(name) {
2197  var nameEQ = name + "=";
2198  var ca = document.cookie.split(';');
2199  for(var i=0;i < ca.length;i++) {
2200    var c = ca[i];
2201    while (c.charAt(0)==' ') c = c.substring(1,c.length);
2202    if (c.indexOf(nameEQ) == 0) {
2203      return c.substring(nameEQ.length,c.length);
2204    }
2205  }
2206  return null;
2207}
2208
2209function eraseCookie(name) {
2210  createCookie(name,"",-1);
2211}
2212
2213/**
2214 * Checks to see if the slide is visible enough.
2215 * elem = element to check.
2216 * type = The way to calculate how much is visible.
2217 * amountVisible = amount that should be visible. Either in percent or px. If
2218 *                it's not defined then all of the slide must be visible.
2219 *
2220 * Returns true or false
2221 */
2222function viewsSlideshowSingleFrameIsVisible(elem, type, amountVisible) {
2223  // Get the top and bottom of the window;
2224  var docViewTop = $(window).scrollTop();
2225  var docViewBottom = docViewTop + $(window).height();
2226  var docViewLeft = $(window).scrollLeft();
2227  var docViewRight = docViewLeft + $(window).width();
2228
2229  // Get the top, bottom, and height of the slide;
2230  var elemTop = $(elem).offset().top;
2231  var elemHeight = $(elem).height();
2232  var elemBottom = elemTop + elemHeight;
2233  var elemLeft = $(elem).offset().left;
2234  var elemWidth = $(elem).width();
2235  var elemRight = elemLeft + elemWidth;
2236  var elemArea = elemHeight * elemWidth;
2237  
2238  // Calculate what's hiding in the slide.
2239  var missingLeft = 0;
2240  var missingRight = 0;
2241  var missingTop = 0;
2242  var missingBottom = 0;
2243  
2244  // Find out how much of the slide is missing from the left.
2245  if (elemLeft < docViewLeft) {
2246    missingLeft = docViewLeft - elemLeft;
2247  }
2248
2249  // Find out how much of the slide is missing from the right.
2250  if (elemRight > docViewRight) {
2251    missingRight = elemRight - docViewRight;
2252  }
2253  
2254  // Find out how much of the slide is missing from the top.
2255  if (elemTop < docViewTop) {
2256    missingTop = docViewTop - elemTop;
2257  }
2258
2259  // Find out how much of the slide is missing from the bottom.
2260  if (elemBottom > docViewBottom) {
2261    missingBottom = elemBottom - docViewBottom;
2262  }
2263  
2264  // If there is no amountVisible defined then check to see if the whole slide
2265  // is visible.
2266  if (type == 'full') {
2267    return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
2268    && (elemBottom <= docViewBottom) &&  (elemTop >= docViewTop)
2269    && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
2270    && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
2271  }
2272  else if(type == 'vertical') {
2273    var verticalShowing = elemHeight - missingTop - missingBottom;
2274    
2275    // If user specified a percentage then find out if the current shown percent
2276    // is larger than the allowed percent.
2277    // Otherwise check to see if the amount of px shown is larger than the
2278    // allotted amount.
2279    if (amountVisible.indexOf('%')) {
2280      return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
2281    }
2282    else {
2283      return (verticalShowing >= parseInt(amountVisible));
2284    }
2285  }
2286  else if(type == 'horizontal') {
2287    var horizontalShowing = elemWidth - missingLeft - missingRight;
2288    
2289    // If user specified a percentage then find out if the current shown percent
2290    // is larger than the allowed percent.
2291    // Otherwise check to see if the amount of px shown is larger than the
2292    // allotted amount.
2293    if (amountVisible.indexOf('%')) {
2294      return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
2295    }
2296    else {
2297      return (horizontalShowing >= parseInt(amountVisible));
2298    }
2299  }
2300  else if(type == 'area') {
2301    var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
2302    
2303    // If user specified a percentage then find out if the current shown percent
2304    // is larger than the allowed percent.
2305    // Otherwise check to see if the amount of px shown is larger than the
2306    // allotted amount.
2307    if (amountVisible.indexOf('%')) {
2308      return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
2309    }
2310    else {
2311      return (areaShowing >= parseInt(amountVisible));
2312    }
2313  }
2314}
2315
2316;
2317// $Id: views_slideshow.js,v 1.1.2.2.2.35 2010/07/01 03:29:08 redndahead Exp $
2318
2319/**
2320 * @file
2321 * A simple jQuery ThumbnailHover Div Slideshow Rotator.
2322 */
2323
2324/**
2325 * This will set our initial behavior, by starting up each individual slideshow.
2326 */
2327Drupal.behaviors.viewsSlideshowThumbnailHover = function (context) {
2328  $('.views_slideshow_thumbnailhover_main:not(.viewsSlideshowThumbnailHover-processed)', context).addClass('viewsSlideshowThumbnailHover-processed').each(function() {
2329    var fullId = '#' + $(this).attr('id');
2330    var settings = Drupal.settings.viewsSlideshowThumbnailHover[fullId];
2331    settings.targetId = '#' + $(fullId + " :first").attr('id');
2332		settings.paused = false;
2333		
2334    settings.opts = {
2335      speed:settings.speed,
2336      timeout:parseInt(settings.timeout),
2337      delay:parseInt(settings.delay),
2338      sync:settings.sync==1,
2339      random:settings.random==1,
2340      pause:false,
2341      allowPagerClickBubble:(settings.pager_event=='click')? false : true,
2342      pager:(settings.pager_event == 'hoverIntent') ? null : '#views_slideshow_breakout_teasers_' + settings.vss_id,
2343      nowrap:parseInt(settings.nowrap),
2344      pagerAnchorBuilder:(settings.pager_event == 'hoverIntent') ? null : function(idx, slide) { 
2345        return '#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + idx; 
2346      },
2347      after:function(curr, next, opts) {
2348        // Used for Image Counter.
2349        if (settings.image_count) {
2350          $('#views_slideshow_thumbnailhover_image_count_' + settings.vss_id + ' span.num').html(opts.currSlide + 1);
2351          $('#views_slideshow_thumbnailhover_image_count_' + settings.vss_id + ' span.total').html(opts.slideCount);
2352        }
2353      },
2354      before:function(current, next, opts) {
2355        // Remember last slide.
2356        if (settings.remember_slide) {
2357          createCookie(settings.view_id, opts.currSlide + 1, settings.remember_slide_days);
2358        }
2359
2360        // Make variable height.
2361        if (settings.fixed_height == 0) {
2362          //get the height of the current slide
2363          var $ht = $(this).height();
2364          //set the container's height to that of the current slide
2365          $(this).parent().animate({height: $ht});
2366        }
2367        
2368        var currId = (currId=$(current).attr('id')).substring(currId.lastIndexOf('_')+1)
2369        var nextId = (nextId=$(next).attr('id')).substring(nextId.lastIndexOf('_')+1)
2370        $('#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + currId).removeClass('activeSlide');
2371        $('#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + nextId).addClass('activeSlide');
2372      },
2373      pagerEvent: (settings.pager_event == 'hoverIntent') ? null : settings.pager_event,
2374      prev:(settings.controls > 0)?'#views_slideshow_thumbnailhover_prev_' + settings.vss_id:null,
2375      next:(settings.controls > 0)?'#views_slideshow_thumbnailhover_next_' + settings.vss_id:null,
2376      cleartype:(settings.ie.cleartype == 'true')? true : false,
2377      cleartypeNoBg:(settings.ie.cleartypenobg == 'true')? true : false
2378    };
2379
2380    // Set the starting slide if we are supposed to remember the slide
2381    if (settings.remember_slide) {
2382      var startSlide = readCookie(settings.view_id);
2383      if (startSlide == null) {
2384        startSlide = 0;
2385      }
2386      settings.opts.startingSlide =  startSlide;
2387    }
2388
2389    if (settings.effect == 'none') {
2390      settings.opts.speed = 1;
2391    }
2392    else {
2393      settings.opts.fx = settings.effect;
2394    }
2395
2396    // Pause on hover.
2397    if (settings.pause == 1) {
2398      $('#views_slideshow_thumbnailhover_teaser_section_' + settings.vss_id).hover(function() {
2399        $(settings.targetId).cycle('pause');
2400      }, function() {
2401        if (settings.paused == false) {
2402          $(settings.targetId).cycle('resume');
2403        }
2404      });
2405    }
2406
2407    // Pause on clicking of the slide.
2408    if (settings.pause_on_click == 1) {
2409      $('#views_slideshow_thumbnailhover_teaser_section_' + settings.vss_id).click(function() { 
2410        viewsSlideshowThumbnailHoverPause(settings);
2411      });
2412    }
2413    
2414    // Add additional settings.
2415		if (settings.advanced != "\n") {
2416      var advanced = settings.advanced.split("\n");
2417      for (i=0; i<advanced.length; i++) {
2418        var prop = '';
2419        var value = '';
2420        var property = advanced[i].split(":");
2421        for (j=0; j<property.length; j++) {
2422          if (j == 0) {
2423            prop = property[j];
2424          }
2425          else if (j == 1) {
2426            value = property[j];
2427          }
2428          else {
2429            value += ":" + property[j];
2430          }
2431        }
2432
2433        // Need to evaluate so true, false and numerics aren't a string.
2434        if (value == 'true' || value == 'false' || IsNumeric(value)) {
2435          value = eval(value);
2436        }
2437        else {
2438          // Parse strings into functions.
2439          var func = value.match(/function\s*\((.*?)\)\s*\{(.*)\}/i);
2440          if (func) {
2441            value = new Function(func[1].match(/(\w+)/g), func[2]);
2442          }
2443        }
2444	
2445        // Call both functions if prop was set previously.
2446        if (typeof(value) == "function" && prop in settings.opts) {
2447          var callboth = function(before_func, new_func) {
2448            return function() {
2449              before_func.apply(null, arguments);
2450              new_func.apply(null, arguments);
2451            };
2452          };
2453          settings.opts[prop] = callboth(settings.opts[prop], value);
2454        }
2455        else {
2456          settings.opts[prop] = value;
2457        }
2458      }
2459    }
2460
2461    $(settings.targetId).cycle(settings.opts);
2462
2463    // Start Paused
2464    if (settings.start_paused) {
2465      viewsSlideshowThumbnailHoverPause(settings);
2466    }
2467    
2468    // Pause if hidden.
2469    if (settings.pause_when_hidden) {
2470      var checkPause = function(settings) {
2471        // If the slideshow is visible and it is paused then resume.
2472        // otherwise if the slideshow is not visible and it is not paused then
2473        // pause it.
2474        var visible = viewsSlideshowThumbnailHoverIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
2475        if (visible && settings.paused) {
2476          viewsSlideshowThumbnailHoverResume(settings);
2477        }
2478        else if (!visible && !settings.paused) {
2479          viewsSlideshowThumbnailHoverPause(settings);
2480        }
2481      }
2482     
2483      // Check when scrolled.
2484      $(window).scroll(function() {
2485       checkPause(settings);
2486      });
2487      
2488      // Check when window is resized.
2489      $(window).resize(function() {
2490        checkPause(settings);
2491      });
2492    }
2493
2494    // Show image count for people who have js enabled.
2495    $('#views_slideshow_thumbnailhover_image_count_' + settings.vss_id).show();
2496    
2497    if (settings.pager_event == 'hoverIntent') {
2498      $('#views_slideshow_thumbnailhover_breakout_teasers_' + settings.vss_id + ' .views_slideshow_thumbnailhover_div_breakout_teaser').each(function(i,obj) {
2499        $(obj).hoverIntent(
2500          function() {
2501            $('.views_slideshow_thumbnailhover_div_breakout_teaser').removeClass('activeSlide');
2502            var id = $(this).attr('id');
2503            id = parseInt(id.substring(id.lastIndexOf('_')+1));
2504            $(settings.targetId).cycle(id);
2505            $('#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + id).addClass('activeSlide');
2506            $(settings.targetId).cycle('stop');
2507          },
2508          function() {
2509            var id = $(this).attr('id');
2510            settings.opts.startingSlide = parseInt(id.substring(id.lastIndexOf('_')+1));
2511            $(settings.targetId).cycle(settings.opts);
2512          }
2513        );
2514      });
2515    }
2516
2517    if (settings.controls > 0) {
2518      // Show controls for people who have js enabled browsers.
2519      $('#views_slideshow_thumbnailhover_controls_' + settings.vss_id).show();
2520      
2521      $('#views_slideshow_thumbnailhover_playpause_' + settings.vss_id).click(function(e) {
2522        if (settings.paused) {
2523          viewsSlideshowThumbnailHoverResume(settings);
2524        }
2525        else {
2526          viewsSlideshowThumbnailHoverPause(settings);
2527        }
2528        e.preventDefault();
2529      });
2530    }
2531  });
2532}
2533
2534// Pause the slideshow 
2535viewsSlideshowThumbnailHoverPause = function (settings) {
2536  //make Resume translatable
2537  var resume = Drupal.t('Resume');
2538
2539  $(settings.targetId).cycle('pause');
2540  if (settings.controls > 0) {
2541    $('#views_slideshow_thumbnailhover_playpause_' + settings.vss_id)
2542      .addClass('views_slideshow_thumbnailhover_play')
2543      .addClass('views_slideshow_play')
2544      .removeClass('views_slideshow_thumbnailhover_pause')
2545      .removeClass('views_slideshow_pause')
2546      .text(resume);
2547  }
2548  settings.paused = true;
2549}
2550
2551// Resume the slideshow
2552viewsSlideshowThumbnailHoverResume = function (settings) {
2553  $(settings.targetId).cycle('resume');
2554  if (settings.controls > 0) {
2555    $('#views_slideshow_thumbnailhover_playpause_' + settings.vss_id)
2556      .addClass('views_slideshow_thumbnailhover_pause')
2557      .addClass('views_slideshow_pause')
2558      .removeClass('views_slideshow_thumbnailhover_play')
2559      .removeClass('views_slideshow_play')
2560      .text('Pause');
2561  }
2562  settings.paused = false;
2563}
2564
2565// Verify that the value is a number.
2566function IsNumeric(sText) {
2567  var ValidChars = "0123456789";
2568  var IsNumber=true;
2569  var Char;
2570
2571  for (var i=0; i < sText.length && IsNumber == true; i++) { 
2572    Char = sText.charAt(i); 
2573    if (ValidChars.indexOf(Char) == -1) {
2574      IsNumber = false;
2575    }
2576  }
2577  return IsNumber;
2578}
2579
2580/**
2581 * Cookie Handling Functions
2582 */
2583function createCookie(name,value,days) {
2584  if (days) {
2585    var date = new Date();
2586    date.setTime(date.getTime()+(days*24*60*60*1000));
2587    var expires = "; expires="+date.toGMTString();
2588  }
2589  else {
2590    var expires = "";
2591  }
2592  document.cookie = name+"="+value+expires+"; path=/";
2593}
2594
2595function readCookie(name) {
2596  var nameEQ = name + "=";
2597  var ca = document.cookie.split(';');
2598  for(var i=0;i < ca.length;i++) {
2599    var c = ca[i];
2600    while (c.charAt(0)==' ') c = c.substring(1,c.length);
2601    if (c.indexOf(nameEQ) == 0) {
2602      return c.substring(nameEQ.length,c.length);
2603    }
2604  }
2605  return null;
2606}
2607
2608function eraseCookie(name) {
2609  createCookie(name,"",-1);
2610}
2611
2612/**
2613 * Checks to see if the slide is visible enough.
2614 * elem = element to check.
2615 * amountVisible = amount that should be visible. Either in percent or px. If
2616 *                it's not defined then all of the slide must be visible.
2617 *
2618 * Returns true or false
2619 */
2620function viewsSlideshowThumbnailHoverIsVisible(elem, type, amountVisible) {
2621  // Get the top and bottom of the window;
2622  var docViewTop = $(window).scrollTop();
2623  var docViewBottom = docViewTop + $(window).height();
2624  var docViewLeft = $(window).scrollLeft();
2625  var docViewRight = docViewLeft + $(window).width();
2626
2627  // Get the top, bottom, and height of the slide;
2628  var elemTop = $(elem).offset().top;
2629  var elemHeight = $(elem).height();
2630  var elemBottom = elemTop + elemHeight;
2631  var elemLeft = $(elem).offset().left;
2632  var elemWidth = $(elem).width();
2633  var elemRight = elemLeft + elemWidth;
2634  var elemArea = elemHeight * elemWidth;
2635  
2636  // Calculate what's hiding in the slide.
2637  var missingLeft = 0;
2638  var missingRight = 0;
2639  var missingTop = 0;
2640  var missingBottom = 0;
2641  
2642  // Find out how much of the slide is missing from the left.
2643  if (elemLeft < docViewLeft) {
2644    missingLeft = docViewLeft - elemLeft;
2645  }
2646
2647  // Find out how much of the slide is missing from the right.
2648  if (elemRight > docViewRight) {
2649    missingRight = elemRight - docViewRight;
2650  }
2651  
2652  // Find out how much of the slide is missing from the top.
2653  if (elemTop < docViewTop) {
2654    missingTop = docViewTop - elemTop;
2655  }
2656
2657  // Find out how much of the slide is missing from the bottom.
2658  if (elemBottom > docViewBottom) {
2659    missingBottom = elemBottom - docViewBottom;
2660  }
2661  
2662  // If there is no amountVisible defined then check to see if the whole slide
2663  // is visible.
2664  if (type == 'full') {
2665    return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
2666    && (elemBottom <= docViewBottom) &&  (elemTop >= docViewTop)
2667    && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
2668    && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
2669  }
2670  else if(type == 'vertical') {
2671    var verticalShowing = elemHeight - missingTop - missingBottom;
2672    
2673    // If user specified a percentage then find out if the current shown percent
2674    // is larger than the allowed percent.
2675    // Otherwise check to see if the amount of px shown is larger than the
2676    // allotted amount.
2677    if (amountVisible.indexOf('%')) {
2678      return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
2679    }
2680    else {
2681      return (verticalShowing >= parseInt(amountVisible));
2682    }
2683  }
2684  else if(type == 'horizontal') {
2685    var horizontalShowing = elemWidth - missingLeft - missingRight;
2686    
2687    // If user specified a percentage then find out if the current shown percent
2688    // is larger than the allowed percent.
2689    // Otherwise check to see if the amount of px shown is larger than the
2690    // allotted amount.
2691    if (amountVisible.indexOf('%')) {
2692      return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
2693    }
2694    else {
2695      return (horizontalShowing >= parseInt(amountVisible));
2696    }
2697  }
2698  else if(type == 'area') {
2699    var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
2700    
2701    // If user specified a percentage then find out if the current shown percent
2702    // is larger than the allowed percent.
2703    // Otherwise check to see if the amount of px shown is larger than the
2704    // allotted amount.
2705    if (amountVisible.indexOf('%')) {
2706      return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
2707    }
2708    else {
2709      return (areaShowing >= parseInt(amountVisible));
2710    }
2711  }
2712}
2713;
2714// $Id: captcha.js,v 1.2.2.3 2011/02/06 20:45:12 soxofaan Exp $
2715
2716// Javascript behaviors for general CAPTCHA functionality.
2717Drupal.behaviors.captcha = function (context) {
2718
2719  // Turn off autocompletion for the CAPTCHA response field.
2720  // We do it here with Javascript (instead of directly in the markup)
2721  // because this autocomplete attribute is not standard and
2722  // it would break (X)HTML compliance.
2723  $("#edit-captcha-response").attr("autocomplete", "off");
2724
2725};
2726
2727
2728// JavaScript behaviors for the CAPTCHA admin page
2729Drupal.behaviors.captchaAdmin = function (context) {
2730
2731	// Add onclick handler to checkbox for adding a CAPTCHA description
2732	// so that the textfields for the CAPTCHA description are hidden
2733	// when no description should be added.
2734	$("#edit-captcha-add-captcha-description").click(function() {
2735		if ($("#edit-captcha-add-captcha-description").is(":checked")) {
2736			// Show the CAPTCHA description textfield(s).
2737			$("#edit-captcha-description-wrapper").show("slow");
2738		}
2739		else {
2740			// Hide the CAPTCHA description textfield(s).
2741			$("#edit-captcha-description-wrapper").hide("slow");
2742		}
2743	});
2744	// Hide the CAPTCHA description textfields if option is disabled on page load.
2745	if (!$("#edit-captcha-add-captcha-description").is(":checked")) {
2746		$("#edit-captcha-description-wrapper").hide();
2747	}
2748
2749};
2750;
2751
2752/**
2753 * JavaScript behaviors for the front-end display of webforms.
2754 */
2755
2756(function ($) {
2757
2758Drupal.behaviors.webform = function(context) {
2759  // Calendar datepicker behavior.
2760  Drupal.webform.datepicker(context);
2761};
2762
2763Drupal.webform = Drupal.webform || {};
2764
2765Drupal.webform.datepicker = function(context) {
2766  $('div.webform-datepicker').each(function() {
2767    var $webformDatepicker = $(this);
2768    var $calendar = $webformDatepicker.find('input.webform-calendar');
2769    var startYear = $calendar[0].className.replace(/.*webform-calendar-start-(\d+).*/, '$1');
2770    var endYear = $calendar[0].className.replace(/.*webform-calendar-end-(\d+).*/, '$1');
2771    var firstDay = $calendar[0].className.replace(/.*webform-calendar-day-(\d).*/, '$1');
2772
2773    // Ensure that start comes before end for datepicker.
2774    if (startYear > endYear) {
2775      var greaterYear = startYear;
2776      startYear = endYear;
2777      endYear = greaterYear;
2778    }
2779
2780    // Set up the jQuery datepicker element.
2781    $calendar.datepicker({
2782      dateFormat: 'yy-mm-dd',
2783      yearRange: startYear + ':' + endYear,
2784      firstDay: parseInt(firstDay),
2785      onSelect: function(dateText, inst) {
2786        var date = dateText.split('-');
2787        $webformDatepicker.find('select.year, input.year').val(+date[0]);
2788        $webformDatepicker.find('select.month').val(+date[1]);
2789        $webformDatepicker.find('select.day').val(+date[2]);
2790      },
2791      beforeShow: function(input, inst) {
2792        // Get the select list values.
2793        var year = $webformDatepicker.find('select.year, input.year').val();
2794        var month = $webformDatepicker.find('select.month').val();
2795        var day = $webformDatepicker.find('select.day').val();
2796
2797        // If empty, default to the current year/month/day in the popup.
2798        var today = new Date();
2799        year = year ? year : today.getFullYear();
2800        month = month ? month : today.getMonth() + 1;
2801        day = day ? day : today.getDate();
2802
2803        // Make sure that the default year fits in the available options.
2804        year = (year < startYear || year > endYear) ? startYear : year;
2805
2806        // jQuery UI Datepicker will read the input field and base its date off
2807        // of that, even though in our case the input field is a button.
2808        $(input).val(year + '-' + month + '-' + day);
2809      }
2810    });
2811
2812    // Prevent the calendar button from submitting the form.
2813    $calendar.click(function(event) {
2814      $(this).focus();
2815      event.preventDefault();
2816    });
2817  });
2818}
2819
2820})(jQuery);;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.