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// $Id: drupal.js,v 1.41.2.4 2009/07/21 08:59:10 goba Exp $ 21 22var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} }; 23 24/** 25 * Set the variable that indicates if JavaScript behaviors should be applied 26 */ 27Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById; 28 29/** 30 * Attach all registered behaviors to a page element. 31 * 32 * Behaviors are event-triggered actions that attach to page elements, enhancing 33 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors 34 * object as follows: 35 * @code 36 * Drupal.behaviors.behaviorName = function () { 37 * ... 38 * }; 39 * @endcode 40 * 41 * Drupal.attachBehaviors is added below to the jQuery ready event and so 42 * runs on initial page load. Developers implementing AHAH/AJAX in their 43 * solutions should also call this function after new page content has been 44 * loaded, feeding in an element to be processed, in order to attach all 45 * behaviors to the new content. 46 * 47 * Behaviors should use a class in the form behaviorName-processed to ensure 48 * the behavior is attached only once to a given element. (Doing so enables 49 * the reprocessing of given elements, which may be needed on occasion despite 50 * the ability to limit behavior attachment to a particular element.) 51 * 52 * @param context 53 * An element to attach behaviors to. If none is given, the document element 54 * is used. 55 */ 56Drupal.attachBehaviors = function(context) { 57 context = context || document; 58 if (Drupal.jsEnabled) { 59 // Execute all of them. 60 jQuery.each(Drupal.behaviors, function() { 61 this(context); 62 }); 63 } 64}; 65 66/** 67 * Encode special characters in a plain-text string for display as HTML. 68 */ 69Drupal.checkPlain = function(str) { 70 str = String(str); 71 var replace = { '&': '&', '"': '"', '<': '<', '>': '>' }; 72 for (var character in replace) { 73 var regex = new RegExp(character, 'g'); 74 str = str.replace(regex, replace[character]); 75 } 76 return str; 77}; 78 79/** 80 * Translate strings to the page language or a given language. 81 * 82 * See the documentation of the server-side t() function for further details. 83 * 84 * @param str 85 * A string containing the English string to translate. 86 * @param args 87 * An object of replacements pairs to make after translation. Incidences 88 * of any key in this array are replaced with the corresponding value. 89 * Based on the first character of the key, the value is escaped and/or themed: 90 * - !variable: inserted as is 91 * - @variable: escape plain text to HTML (Drupal.checkPlain) 92 * - %variable: escape text and theme as a placeholder for user-submitted 93 * content (checkPlain + Drupal.theme('placeholder')) 94 * @return 95 * The translated string. 96 */ 97Drupal.t = function(str, args) { 98 // Fetch the localized version of the string. 99 if (Drupal.locale.strings && Drupal.locale.strings[str]) { 100 str = Drupal.locale.strings[str]; 101 } 102 103 if (args) { 104 // Transform arguments before inserting them 105 for (var key in args) { 106 switch (key.charAt(0)) { 107 // Escaped only 108 case '@': 109 args[key] = Drupal.checkPlain(args[key]); 110 break; 111 // Pass-through 112 case '!': 113 break; 114 // Escaped and placeholder 115 case '%': 116 default: 117 args[key] = Drupal.theme('placeholder', args[key]); 118 break; 119 } 120 str = str.replace(key, args[key]); 121 } 122 } 123 return str; 124}; 125 126/** 127 * Format a string containing a count of items. 128 * 129 * This function ensures that the string is pluralized correctly. Since Drupal.t() is 130 * called by this function, make sure not to pass already-localized strings to it. 131 * 132 * See the documentation of the server-side format_plural() function for further details. 133 * 134 * @param count 135 * The item count to display. 136 * @param singular 137 * The string for the singular case. Please make sure it is clear this is 138 * singular, to ease translation (e.g. use "1 new comment" instead of "1 new"). 139 * Do not use @count in the singular string. 140 * @param plural 141 * The string for the plural case. Please make sure it is clear this is plural, 142 * to ease translation. Use @count in place of the item count, as in "@count 143 * new comments". 144 * @param args 145 * An object of replacements pairs to make after translation. Incidences 146 * of any key in this array are replaced with the corresponding value. 147 * Based on the first character of the key, the value is escaped and/or themed: 148 * - !variable: inserted as is 149 * - @variable: escape plain text to HTML (Drupal.checkPlain) 150 * - %variable: escape text and theme as a placeholder for user-submitted 151 * content (checkPlain + Drupal.theme('placeholder')) 152 * Note that you do not need to include @count in this array.
153 * This replacement is done automatically for the plural case. 154 * @return 155 * A translated string. 156 */ 157Drupal.formatPlural = function(count, singular, plural, args) { 158 var args = args || {}; 159 args['@count'] = count; 160 // Determine the index of the plural form. 161 var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1); 162 163 if (index == 0) { 164 return Drupal.t(singular, args); 165 } 166 else if (index == 1) { 167 return Drupal.t(plural, args); 168 } 169 else { 170 args['@count['+ index +']'] = args['@count']; 171 delete args['@count']; 172 return Drupal.t(plural.replace('@count', '@count['+ index +']')); 173 } 174}; 175 176/** 177 * Generate the themed representation of a Drupal object. 178 * 179 * All requests for themed output must go through this function. It examines 180 * the request and routes it to the appropriate theme function. If the current 181 * theme does not provide an override function, the generic theme function is 182 * called. 183 * 184 * For example, to retrieve the HTML that is output by theme_placeholder(text), 185 * call Drupal.theme('placeholder', text). 186 * 187 * @param func 188 * The name of the theme function to call. 189 * @param ... 190 * Additional arguments to pass along to the theme function. 191 * @return 192 * Any data the theme function returns. This could be a plain HTML string, 193 * but also a complex object. 194 */ 195Drupal.theme = function(func) { 196 for (var i = 1, args = []; i < arguments.length; i++) { 197 args.push(arguments[i]); 198 } 199 200 return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args); 201}; 202 203/** 204 * Parse a JSON response. 205 * 206 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message. 207 */ 208Drupal.parseJson = function (data) { 209 if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) { 210 return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') }; 211 } 212 return eval('(' + data + ');'); 213}; 214 215/** 216 * Freeze the current body height (as minimum height). Used to prevent 217 * unnecessary upwards scrolling when doing DOM manipulations. 218 */ 219Drupal.freezeHeight = function () { 220 Drupal.unfreezeHeight(); 221 var div = document.createElement('div'); 222 $(div).css({ 223 position: 'absolute', 224 top: '0px', 225 left: '0px', 226 width: '1px', 227 height: $('body').css('height') 228 }).attr('id', 'freeze-height'); 229 $('body').append(div); 230}; 231 232/** 233 * Unfreeze the body height 234 */ 235Drupal.unfreezeHeight = function () { 236 $('#freeze-height').remove(); 237}; 238 239/** 240 * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of 241 * drupal_urlencode() in PHP). This function should only be used on paths, not 242 * on query string arguments. 243 */ 244Drupal.encodeURIComponent = function (item, uri) { 245 uri = uri || location.href; 246 item = encodeURIComponent(item).replace(/%2F/g, '/'); 247 return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F'); 248}; 249 250/** 251 * Get the text selection in a textarea. 252 */ 253Drupal.getSelection = function (element) { 254 if (typeof(element.selectionStart) != 'number' && document.selection) { 255 // The current selection 256 var range1 = document.selection.createRange(); 257 var range2 = range1.duplicate(); 258 // Select all text. 259 range2.moveToElementText(element); 260 // Now move 'dummy' end point to end point of original range. 261 range2.setEndPoint('EndToEnd', range1); 262 // Now we can calculate start and end points. 263 var start = range2.text.length - range1.text.length; 264 var end = start + range1.text.length; 265 return { 'start': start, 'end': end }; 266 } 267 return { 'start': element.selectionStart, 'end': element.selectionEnd }; 268}; 269 270/** 271 * Build an error message from ahah response. 272 */ 273Drupal.ahahError = function(xmlhttp, uri) { 274 if (xmlhttp.status == 200) { 275 if (jQuery.trim($(xmlhttp.responseText).text())) { 276 var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText }); 277 } 278 else { 279 var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText }); 280 } 281 } 282 else { 283 var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status }); 284 } 285 return message; 286} 287 288// Global Killswitch on the <html> element 289if (Drupal.jsEnabled) { 290 // Global Killswitch on the <html> element 291 $(document.documentElement).addClass('js'); 292 // 'js enabled' cookie 293 document.cookie = 'has_js=1; path=/'; 294 // Attach all behaviors. 295 $(document).ready(function() { 296 Drupal.attachBehaviors(this); 297 }); 298} 299 300/** 301 * The default themes. 302 */ 303Drupal.theme.prototype = { 304 305 /** 306 * Formats text for emphasized display in a placeholder inside a sentence. 307 * 308 * @param str 309 * The text to format (plain-text). 310 * @return 311 * The formatted text (html). 312 */ 313 placeholder: function(str) { 314 return '<em>' + Drupal.checkPlain(str) + '</em>'; 315 } 316}; 317; 318// $Id: collapse.js,v 1.17 2008/01/29 10:58:25 goba Exp $ 319 320/** 321 * Toggle the visibility of a fieldset using smooth animations 322 */ 323Drupal.toggleFieldset = function(fieldset) { 324 if ($(fieldset).is('.collapsed')) { 325 // Action div containers are processed separately because of a IE bug 326 // that alters the default submit button behavior. 327 var content = $('> div:not(.action)', fieldset); 328 $(fieldset).removeClass('collapsed'); 329 content.hide(); 330 content.slideDown( { 331 duration: 'fast', 332 easing: 'linear', 333 complete: function() { 334 Drupal.collapseScrollIntoView(this.parentNode); 335 this.parentNode.animating = false;
336 $('div.action', fieldset).show(); 337 }, 338 step: function() { 339 // Scroll the fieldset into view 340 Drupal.collapseScrollIntoView(this.parentNode); 341 } 342 }); 343 } 344 else { 345 $('div.action', fieldset).hide(); 346 var content = $('> div:not(.action)', fieldset).slideUp('fast', function() { 347 $(this.parentNode).addClass('collapsed'); 348 this.parentNode.animating = false; 349 }); 350 } 351}; 352 353/** 354 * Scroll a given fieldset into view as much as possible. 355 */ 356Drupal.collapseScrollIntoView = function (node) { 357 var h = self.innerHeight || document.documentElement.clientHeight || $('body')[0].clientHeight || 0; 358 var offset = self.pageYOffset || document.documentElement.scrollTop || $('body')[0].scrollTop || 0; 359 var posY = $(node).offset().top; 360 var fudge = 55; 361 if (posY + node.offsetHeight + fudge > h + offset) { 362 if (node.offsetHeight > h) { 363 window.scrollTo(0, posY); 364 } else { 365 window.scrollTo(0, posY + node.offsetHeight - h + fudge); 366 } 367 } 368}; 369 370Drupal.behaviors.collapse = function (context) { 371 $('fieldset.collapsible > legend:not(.collapse-processed)', context).each(function() { 372 var fieldset = $(this.parentNode); 373 // Expand if there are errors inside 374 if ($('input.error, textarea.error, select.error', fieldset).size() > 0) { 375 fieldset.removeClass('collapsed'); 376 } 377 378 // Turn the legend into a clickable link and wrap the contents of the fieldset 379 // in a div for easier animation 380 var text = this.innerHTML; 381 $(this).empty().append($('<a href="#">
381'+ text +'</a>').click(function() { 382 var fieldset = $(this).parents('fieldset:first')[0]; 383 // Don't animate multiple times 384 if (!fieldset.animating) { 385 fieldset.animating = true; 386 Drupal.toggleFieldset(fieldset); 387 } 388 return false; 389 })) 390 .after($('<div class="fieldset-wrapper"></div>') 391 .append(fieldset.children(':not(legend):not(.action)'))) 392 .addClass('collapse-processed'); 393 }); 394}; 395; 396// $Id: jstools.js,v 1.26 2008/04/03 17:59:37 nedjo Exp $ 397 398Drupal.preventSelect = function (elt) { 399 // IE hack to prevent selection of the text when users click. 400 if (document.onselectstart) { 401 elt.onselectstart = function () { 402 return false; 403 } 404 } 405 else { 406 $(elt).mousedown(function () { 407 return false; 408 }); 409 } 410}; 411 412Drupal.url = function (path, query, fragment) { 413 query = query ? query : ''; 414 fragment = fragment ? '#' + fragment : ''; 415 var base = Drupal.settings.basePath; 416 if (!Drupal.settings.jstools.cleanurls) { 417 if (query) { 418 return base + '?q=' + path + '&' + query + fragment; 419 } 420 else { 421 return base + '?q=' + path + fragment; 422 } 423 } 424 else { 425 if (query) { 426 return base + path + '?' + query + fragment; 427 } 428 else { 429 return base + path + fragment; 430 } 431 } 432}; 433 434/** 435 * Return the Drupal path portion of an href. 436 */ 437Drupal.getPath = function (href) { 438 href = Drupal.pathPortion(href); 439 // 3 is the length of the '?q=' added to the url without clean urls. 440 href = href.substring(Drupal.settings.basePath.length + (Drupal.settings.jstools.cleanurls ? 0 : 3), href.length); 441 var chars = ['#', '?', '&']; 442 for (i in chars) { 443 if (href.indexOf(chars[i]) > -1) { 444 href = href.substr(0, href.indexOf(chars[i])); 445 } 446 } 447 return href; 448}; 449 450/** 451 * Add a segment to the beginning of a path. 452 */ 453Drupal.prependPath = function (href, segment) { 454 href = Drupal.pathPortion(href); 455 // 3 is the length of the '?q=' added to the url without clean urls. 456 var baseLength = Drupal.settings.jstools.basePath.length + (Drupal.settings.jstools.cleanurls ? 0 : 3); 457 var base = href.substring(0, baseLength); 458 return base + segment + '/' + href.substring(baseLength, href.length); 459}; 460 461/** 462 * Strip off the protocol plus domain from an href. 463 */ 464Drupal.pathPortion = function (href) { 465 // Remove e.g. http://example.com if present. 466 var protocol = window.location.protocol; 467 if (href.substring(0, protocol.length) == protocol) { 468 // 2 is the length of the '//' that normally follows the protocol 469 href = href.substring(href.indexOf('/', protocol.length + 2)); 470 } 471 return href; 472}; 473 474/** 475 * Scroll to a given element's vertical page position. 476 */ 477Drupal.scrollTo = function(el) { 478 var pos = Drupal.absolutePosition(el); 479 window.scrollTo(0, pos.y); 480}; 481 482Drupal.elementChildren = function (element) { 483 var children = []; 484 for (i in element) { 485 if (i.substr(0, 1) != '#') { 486 children[children.length] = i; 487 } 488 } 489 return children; 490}; 491 492Drupal.elementProperties = function (element) { 493 var properties = []; 494 for (i in element) { 495 if (i.substr(0, 1) == '#') { 496 properties[properties.length] = i; 497 } 498 } 499 return properties; 500}; 501 502Drupal.parseQueryString = function (href) { 503 query = Drupal.getQueryString(href); 504 var args = {}; 505 var pairs = query.split("&"); 506 for(var i = 0; i < pairs.length; i++) { 507 var pos = pairs[i].indexOf('='); 508 if (pos == -1) continue; 509 var argname = pairs[i].substring(0, pos); 510 var value = pairs[i].substring(pos + 1); 511 args[argname] = unescape(value.replace(/\+/g, " ")); 512 } 513 return args; 514}; 515 516Drupal.getQueryString = function (href) { 517 if (href) { 518 var index = href.indexOf('?'); 519 href = (index == -1) ? '' : href.substring(index + 1); 520 } 521 query = href ? href : location.search.substring(1); 522 if (!Drupal.settings.jstools.cleanurls) { 523 var index = query.indexOf('&'); 524 query = (index == -1) ? '' : query.substring(index + 1); 525 } 526 return query; 527}; 528 529Drupal.pathMatch = function (path, paths, type) { 530 // Convert paths into a regular expression. 531 paths = '^' + paths + '$'; 532 paths = paths.replace(/\n/g, '$|^'); 533 paths = paths.replace(/\*/g, '.*'); 534 var search = path.search(new RegExp(paths)) > -1 ? true : false;
535 return (type == 0) ? search : !search; 536}; 537 538/** 539 * Retrieves the absolute position of an element on the screen 540 */ 541Drupal.absolutePosition = function (el) { 542 var sLeft = 0, sTop = 0; 543 var isDiv = /^div$/i.test(el.tagName); 544 if (isDiv && el.scrollLeft) { 545 sLeft = el.scrollLeft; 546 } 547 if (isDiv && el.scrollTop) { 548 sTop = el.scrollTop; 549 } 550 var r = { x: el.offsetLeft - sLeft, y: el.offsetTop - sTop }; 551 if (el.offsetParent) { 552 var tmp = Drupal.absolutePosition(el.offsetParent); 553 r.x += tmp.x; 554 r.y += tmp.y; 555 } 556 return r; 557}; 558 559/** 560 * Returns the position of the mouse cursor based on the event object passed 561 */ 562Drupal.mousePosition = function(e) { 563 return { x: e.clientX + document.documentElement.scrollLeft, y: e.clientY + document.documentElement.scrollTop }; 564};; 565// $Id: collapsiblock.js,v 1.8 2010/10/02 00:42:28 gagarine Exp $ 566 567Drupal.Collapsiblock = Drupal.Collapsiblock || {}; 568 569Drupal.behaviors.collapsiblock = function (context) { 570 var cookieData = Drupal.Collapsiblock.getCookieData(); 571 var slidetype = Drupal.settings.collapsiblock.slide_type; 572 var defaultState = Drupal.settings.collapsiblock.default_state; 573 var slidespeed = parseInt(Drupal.settings.collapsiblock.slide_speed); 574 var title = Drupal.settings.collapsiblock.block_title; 575 var block = Drupal.settings.collapsiblock.block; 576 var block_content = Drupal.settings.collapsiblock.block_content; 577 $(block + ':not(.collapsiblock-processed)', context).addClass('collapsiblock-processed').each(function () { 578 var id = this.id; 579 var titleElt = $(title, this).not($('.content :header',this)); 580 if (titleElt.size()) { 581 titleElt = titleElt[0]; 582 // Status values: 1 = not collapsible, 2 = collapsible and expanded, 3 = collapsible and collapsed, 4 = always collapsed 583 var stat = Drupal.settings.collapsiblock.blocks[this.id] ? Drupal.settings.collapsiblock.blocks[this.id] : defaultState; 584 if (stat == 1) { 585 return; 586 } 587 588 titleElt.target = $(this).find(block_content); 589 $(titleElt) 590 .wrapInner('<a href="#" role="link" />') 591 .addClass('collapsiblock') 592 .click(function (e) { 593 var st = Drupal.Collapsiblock.getCookieData(); 594 if ($(this).is('.collapsiblockCollapsed')) { 595 $(this).removeClass('collapsiblockCollapsed'); 596 if (slidetype == 1) { 597 $(this.target).slideDown(slidespeed).attr('aria-hidden', false); ; 598 } 599 else { 600 $(this.target).animate({ 601 height:'show', 602 opacity:'show' 603 }, slidespeed); 604 } 605 606 // Don't save cookie data if the block is always collapsed. 607 if (stat != 4) { 608 st[id] = 1; 609 } 610 } 611 else { 612 $(this).addClass('collapsiblockCollapsed'); 613 if (slidetype == 1) { 614 $(this.target).slideUp(slidespeed).attr('aria-hidden', true); 615 } 616 else { 617 $(this.target).animate({ 618 height:'hide', 619 opacity:'hide' 620 }, slidespeed); 621 } 622 623 // Don't save cookie data if the block is always collapsed. 624 if (stat != 4) { 625 st[id] = 0; 626 } 627 } 628 // Stringify the object in JSON format for saving in the cookie. 629 var cookieString = '{ '; 630 var cookieParts = []; 631 $.each(st, function (id, setting) { 632 cookieParts[cookieParts.length] = ' "' + id + '": ' + setting; 633 }); 634 cookieString += cookieParts.join(', ') + ' }'; 635 $.cookie('collapsiblock', cookieString, { 636 path: Drupal.settings.basePath 637 }); 638 e.preventDefault(); 639 }); 640 // Leave active blocks uncollapsed. If the block is expanded, do nothing. 641 if (stat == 4 || (cookieData[id] == 0 || (stat == 3 && cookieData[id] == undefined)) && !$(this).find('a.active').size()) { 642 $(titleElt).addClass('collapsiblockCollapsed'); 643 $(titleElt.target).hide(); 644 } 645 } 646 }); 647}; 648 649Drupal.Collapsiblock.getCookieData = function () { 650 var cookieString = $.cookie('collapsiblock'); 651 return cookieString ? Drupal.parseJson(cookieString) : {}; 652}; 653 654 655 656; 657/** 658 * Cookie plugin 659 * 660 * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 661 * Dual licensed under the MIT and GPL licenses: 662 * http://www.opensource.org/licenses/mit-license.php 663 * http://www.gnu.org/licenses/gpl.html 664 * 665 */ 666 667/** 668 * Create a cookie with the given name and value and other optional parameters. 669 * 670 * @example $.cookie('the_cookie', 'the_value'); 671 * @desc Set the value of a cookie. 672 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); 673 * @desc Create a cookie with all available options. 674 * @example $.cookie('the_cookie', 'the_value'); 675 * @desc Create a session cookie. 676 * @example $.cookie('the_cookie', null); 677 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain 678 * used when the cookie was set. 679 * 680 * @param String name The name of the cookie. 681 * @param String value The value of the cookie. 682 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 683 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 684 * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 685 * If set to null or omitted, the cookie will be a session cookie and will not be retained 686 * when the the browser exits. 687 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 688 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 689 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 690 * require a secure protocol (like HTTPS). 691 * @type undefined 692 * 693 * @name $.cookie 694 * @cat Plugins/Cookie 695 * @author Klaus Hartl/[email protected] 696 */ 697 698/** 699 * Get the value of a cookie with the given name. 700 * 701 * @example $.cookie('the_cookie'); 702 * @desc Get the value of a cookie. 703 * 704 * @param String name The name of the cookie. 705 * @return The value of the cookie.
706 * @type String 707 * 708 * @name $.cookie 709 * @cat Plugins/Cookie 710 * @author Klaus Hartl/[email protected] 711 */ 712jQuery.cookie = function(name, value, options) { 713 if (typeof value != 'undefined') { // name and value given, set cookie 714 options = options || {}; 715 if (value === null) { 716 value = ''; 717 options.expires = -1; 718 } 719 var expires = ''; 720 if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 721 var date; 722 if (typeof options.expires == 'number') { 723 date = new Date(); 724 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 725 } else { 726 date = options.expires; 727 } 728 expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 729 } 730 // CAUTION: Needed to parenthesize options.path and options.domain 731 // in the following expressions, otherwise they evaluate to undefined 732 // in the packed version for some reason... 733 var path = options.path ? '; path=' + (options.path) : ''; 734 var domain = options.domain ? '; domain=' + (options.domain) : ''; 735 var secure = options.secure ? '; secure' : ''; 736 document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 737 } else { // only name given, get cookie 738 var cookieValue = null; 739 if (document.cookie && document.cookie != '') { 740 var cookies = document.cookie.split(';'); 741 for (var i = 0; i < cookies.length; i++) { 742 var cookie = jQuery.trim(cookies[i]); 743 // Does this cookie string begin with the name we want? 744 if (cookie.substring(0, name.length + 1) == (name + '=')) { 745 cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 746 break; 747 } 748 } 749 } 750 return cookieValue; 751 } 752};; 753/** 754 * Modified Star Rating - jQuery plugin 755 * 756 * Copyright (c) 2006 Wil Stuckey 757 * 758 * Original source available: http://sandbox.wilstuckey.com/jquery-ratings/ 759 * Extensively modified by Lullabot: http://www.lullabot.com 760 * 761 * Dual licensed under the MIT and GPL licenses: 762 * http://www.opensource.org/licenses/mit-license.php 763 * http://www.gnu.org/licenses/gpl.html 764 */ 765 766/** 767 * Create a degradeable star rating interface out of a simple form structure. 768 * Returns a modified jQuery object containing the new interface. 769 * 770 * @example jQuery('form.rating').fivestar(); 771 * @cat plugin 772 * @type jQuery 773 * 774 */ 775(function($){ // Create local scope. 776 /** 777 * Takes the form element, builds the rating interface and attaches the proper events. 778 * @param {Object} $obj 779 */ 780 var buildRating = function($obj){ 781 var $widget = buildInterface($obj), 782 $stars = $('.star', $widget), 783 $cancel = $('.cancel', $widget), 784 $summary = $('.fivestar-summary', $obj), 785 feedbackTimerId = 0, 786 summaryText = $summary.html(), 787 summaryHover = $obj.is('.fivestar-labels-hover'), 788 currentValue = $("select", $obj).val(), 789 cancelTitle = $('label', $obj).html(), 790 voteTitle = cancelTitle != Drupal.settings.fivestar.titleAverage ? cancelTitle : Drupal.settings.fivestar.titleUser, 791 voteChanged = false; 792 793 // Record star display. 794 if ($obj.is('.fivestar-user-stars')) { 795 var starDisplay = 'user'; 796 } 797 else if ($obj.is('.fivestar-average-stars')) { 798 var starDisplay = 'average'; 799 currentValue = $("input[name=vote_average]", $obj).val(); 800 } 801 else if ($obj.is('.fivestar-combo-stars')) { 802 var starDisplay = 'combo'; 803 } 804 else { 805 var starDisplay = 'none'; 806 } 807 808 // Smart is intentionally separate, so the average will be set if necessary. 809 if ($obj.is('.fivestar-smart-stars')) { 810 var starDisplay = 'smart'; 811 } 812 813 // Record text display. 814 if ($summary.size()) { 815 var textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_'); 816 } 817 else { 818 var textDisplay = 'none'; 819 } 820 821 // Add hover and focus events. 822 $stars 823 .mouseover(function(){ 824 event.drain(); 825 event.fill(this); 826 }) 827 .mouseout(function(){ 828 event.drain(); 829 event.reset(); 830 }); 831 $stars.children() 832 .focus(function(){ 833 event.drain(); 834 event.fill(this.parentNode) 835 }) 836 .blur(function(){ 837 event.drain(); 838 event.reset(); 839 }).end(); 840 841 // Cancel button events. 842 $cancel 843 .mouseover(function(){ 844 event.drain(); 845 $(this).addClass('on') 846 }) 847 .mouseout(function(){ 848 event.reset(); 849 $(this).removeClass('on') 850 }); 851 $cancel.children() 852 .focus(function(){ 853 event.drain(); 854 $(this.parentNode).addClass('on') 855 }) 856 .blur(function(){ 857 event.reset(); 858 $(this.parentNode).removeClass('on') 859 }).end(); 860 861 // Click events. 862 $cancel.click(function(){ 863 currentValue = 0; 864 event.reset(); 865 voteChanged = false;
866 // Inform a user that his vote is being processed 867 if ($("input.fivestar-path", $obj).size() && $summary.is('.fivestar-feedback-enabled')) { 868 setFeedbackText(Drupal.settings.fivestar.feedbackDeletingVote); 869 } 870 // Save the currentValue in a hidden field. 871 $("select", $obj).val(0); 872 // Update the title. 873 cancelTitle = starDisplay != 'smart' ? cancelTitle : Drupal.settings.fivestar.titleAverage; 874 $('label', $obj).html(cancelTitle); 875 // Update the smart classes on the widget if needed. 876 if ($obj.is('.fivestar-smart-text')) { 877 $obj.removeClass('fivestar-user-text').addClass('fivestar-average-text'); 878 $summary[0].className = $summary[0].className.replace(/-user/, '-average'); 879 textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_'); 880 } 881 if ($obj.is('.fivestar-smart-stars')) { 882 $obj.removeClass('fivestar-user-stars').addClass('fivestar-average-stars'); 883 } 884 // Submit the form if needed. 885 $("input.fivestar-path", $obj).each(function() { 886 var token = $("input.fivestar-token", $obj).val(); 887 $.ajax({ 888 type: 'GET', 889 data: { token: token }, 890 dataType: 'xml', 891 url: this.value + '/' + 0, 892 success: voteHook 893 }); 894 }); 895 return false; 896 }); 897 $stars.click(function(){ 898 currentValue = $('select option', $obj).get($stars.index(this) + $cancel.size() + 1).value; 899 // Save the currentValue to the hidden select field. 900 $("select", $obj).val(currentValue); 901 // Update the display of the stars. 902 voteChanged = true; 903 event.reset(); 904 // Inform a user that his vote is being processed. 905 if ($("input.fivestar-path", $obj).size() && $summary.is('.fivestar-feedback-enabled')) { 906 setFeedbackText(Drupal.settings.fivestar.feedbackSavingVote); 907 } 908 // Update the smart classes on the widget if needed. 909 if ($obj.is('.fivestar-smart-text')) { 910 $obj.removeClass('fivestar-average-text').addClass('fivestar-user-text'); 911 $summary[0].className = $summary[0].className.replace(/-average/, '-user'); 912 textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_'); 913 } 914 if ($obj.is('.fivestar-smart-stars')) { 915 $obj.removeClass('fivestar-average-stars').addClass('fivestar-user-stars'); 916 } 917 // Submit the form if needed. 918 $("input.fivestar-path", $obj).each(function () { 919 var token = $("input.fivestar-token", $obj).val(); 920 $.ajax({ 921 type: 'GET', 922 data: { token: token }, 923 dataType: 'xml', 924 url: this.value + '/' + currentValue, 925 success: voteHook 926 }); 927 }); 928 return false; 929 }); 930 931 var event = { 932 fill: function(el){ 933 // Fill to the current mouse position. 934 var index = $stars.index(el) + 1; 935 $stars 936 .children('a').css('width', '100%').end() 937 .filter(':lt(' + index + ')').addClass('hover').end(); 938 // Update the description text and label. 939 if (summaryHover && !feedbackTimerId) { 940 var summary = $("select option", $obj)[index + $cancel.size()].text; 941 var value = $("select option", $obj)[index + $cancel.size()].value; 942 $summary.html(summary != index + 1 ? summary : ' '); 943 $('label', $obj).html(voteTitle); 944 } 945 }, 946 drain: function() { 947 // Drain all the stars. 948 $stars 949 .filter('.on').removeClass('on').end() 950 .filter('.hover').removeClass('hover').end(); 951 // Update the description text. 952 if (summaryHover && !feedbackTimerId) { 953 var cancelText = $("select option", $obj)[1].text;
954 $summary.html(($cancel.size() && cancelText != 0) ? cancelText : ' '); 955 if (!voteChanged) { 956 $('label', $obj).html(cancelTitle); 957 } 958 } 959 }, 960 reset: function(){ 961 // Reset the stars to the default index. 962 var starValue = currentValue/100 * $stars.size(); 963 var percent = (starValue - Math.floor(starValue)) * 100; 964 $stars.filter(':lt(' + Math.floor(starValue) + ')').addClass('on').end(); 965 if (percent > 0) { 966 $stars.eq(Math.floor(starValue)).addClass('on').children('a').css('width', percent + "%").end().end(); 967 } 968 // Restore the summary text and original title. 969 if (summaryHover && !feedbackTimerId) { 970 $summary.html(summaryText ? summaryText : ' '); 971 } 972 if (voteChanged) { 973 $('label', $obj).html(voteTitle); 974 } 975 else { 976 $('label', $obj).html(cancelTitle); 977 } 978 } 979 }; 980 981 var setFeedbackText = function(text) { 982 // Kill previous timer if it isn't finished yet so that the text we 983 // are about to set will not get cleared too early. 984 feedbackTimerId = 1; 985 $summary.html(text); 986 }; 987 988 /** 989 * Checks for the presence of a javascript hook 'fivestarResult' to be 990 * called upon completion of a AJAX vote request. 991 */ 992 var voteHook = function(data) { 993 var returnObj = { 994 result: { 995 count: $("result > count", data).text(), 996 average: $("result > average", data).text(), 997 summary: { 998 average: $("summary average", data).text(), 999 average_count: $("summary average_count", data).text(), 1000 user: $("summary user", data).text(), 1001 user_count: $("summary user_count", data).text(), 1002 combo: $("summary combo", data).text(), 1003 count: $("summary count", data).text() 1004 } 1005 }, 1006 vote: { 1007 id: $("vote id", data).text(), 1008 tag: $("vote tag", data).text(), 1009 type: $("vote type", data).text(), 1010 value: $("vote value", data).text() 1011 }, 1012 display: { 1013 stars: starDisplay, 1014 text: textDisplay 1015 } 1016 }; 1017 // Check for a custom callback. 1018 if (window.fivestarResult) { 1019 fivestarResult(returnObj); 1020 } 1021 // Use the default. 1022 else { 1023 fivestarDefaultResult(returnObj); 1024 } 1025 // Update the summary text. 1026 summaryText = returnObj.result.summary[returnObj.display.text]; 1027 if ($(returnObj.result.summary.average).is('.fivestar-feedback-enabled')) { 1028 // Inform user that his/her vote has been processed. 1029 if (returnObj.vote.value != 0) { // check if vote has been saved or deleted 1030 setFeedbackText(Drupal.settings.fivestar.feedbackVoteSaved); 1031 } 1032 else { 1033 setFeedbackText(Drupal.settings.fivestar.feedbackVoteDeleted); 1034 } 1035 // Setup a timer to clear the feedback text after 3 seconds. 1036 feedbackTimerId = setTimeout(function() { clearTimeout(feedbackTimerId); feedbackTimerId = 0; $summary.html(returnObj.result.summary[returnObj.display.text]); }, 2000); 1037 } 1038 // Update the current star currentValue to the previous average. 1039 if (returnObj.vote.value == 0 && (starDisplay == 'average' || starDisplay == 'smart')) { 1040 currentValue = returnObj.result.average; 1041 event.reset(); 1042 } 1043 }; 1044 1045 event.reset(); 1046 return $widget; 1047 }; 1048 1049 /** 1050 * Accepts jQuery object containing a single fivestar widget. 1051 * Returns the proper div structure for the star interface. 1052 * 1053 * @return jQuery 1054 * @param {Object} $widget 1055 * 1056 */ 1057 var buildInterface = function($widget){
1058 var $container = $('<div class="fivestar-widget clear-block"></div>'); 1059 var $options = $("select option", $widget); 1060 var size = $('option', $widget).size() - 1; 1061 var cancel = 1; 1062 for (var i = 1, option; option = $options[i]; i++){ 1063 if (option.value == "0") { 1064 cancel = 0; 1065 $div = $('<div class="cancel"><a href="#0" title="' + option.text + '">' + option.text + '</a></div>'); 1066 } 1067 else { 1068 var zebra = (i + cancel - 1) % 2 == 0 ? 'even' : 'odd'; 1069 var count = i + cancel - 1; 1070 var first = count == 1 ? ' star-first' : ''; 1071 var last = count == size + cancel - 1 ? ' star-last' : ''; 1072 $div = $('<div class="star star-' + count + ' star-' + zebra + first + last + '"><a href="#' + option.value + '" title="' + option.text + '">' + option.text + '</a></div>'); 1073 } 1074 $container.append($div[0]); 1075 } 1076 $container.addClass('fivestar-widget-' + (size + cancel - 1)); 1077 // Attach the new widget and hide the existing widget. 1078 $('select', $widget).after($container).css('display', 'none'); 1079 return $container; 1080 }; 1081 1082 /** 1083 * Standard handler to update the average rating when a user changes their 1084 * vote. This behavior can be overridden by implementing a fivestarResult 1085 * function in your own module or theme. 1086 * @param object voteResult 1087 * Object containing the following properties from the vote result: 1088 * voteResult.result.count The current number of votes for this item. 1089 * voteResult.result.average The current average of all votes for this item. 1090 * voteResult.result.summary.average The textual description of the average. 1091 * voteResult.result.summary.user The textual description of the user's current vote. 1092 * voteResult.vote.id The id of the item the vote was placed on (such as the nid) 1093 * voteResult.vote.type The type of the item the vote was placed on (such as 'node') 1094 * voteResult.vote.tag The multi-axis tag the vote was placed on (such as 'vote') 1095 * voteResult.vote.average The average of the new vote saved 1096 * voteResult.display.stars The type of star display we're using. Either 'average', 'user', or 'combo'. 1097 * voteResult.display.text The type of text display we're using. Either 'average', 'user', or 'combo'. 1098 */ 1099 function fivestarDefaultResult(voteResult) { 1100 // Update the summary text. 1101 $('div.fivestar-summary-'+voteResult.vote.tag+'-'+voteResult.vote.id).html(voteResult.result.summary[voteResult.display.text]); 1102 // If this is a combo display, update the average star display. 1103 if (voteResult.display.stars == 'combo') { 1104 $('div.fivestar-form-'+voteResult.vote.id).each(function() { 1105 // Update stars. 1106 var $stars = $('.fivestar-widget-static .star span', this); 1107 var average = voteResult.result.average/100 * $stars.size(); 1108 var index = Math.floor(average); 1109 $stars.removeClass('on').addClass('off').css('width', 'auto'); 1110 $stars.filter(':lt(' + (index + 1) + ')').removeClass('off').addClass('on'); 1111 $stars.eq(index).css('width', ((average - index) * 100) + "%"); 1112 // Update summary. 1113 var $summary = $('.fivestar-static-form-item .fivestar-summary', this); 1114 if ($summary.size()) { 1115 var textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_'); 1116 $summary.html(voteResult.result.summary[textDisplay]); 1117 } 1118 }); 1119 } 1120 }; 1121 1122 /** 1123 * Set up the plugin 1124 */ 1125 $.fn.fivestar = function() { 1126 var stack = []; 1127 this.each(function() { 1128 var ret = buildRating($(this)); 1129 stack.push(ret); 1130 }); 1131 return stack; 1132 }; 1133 1134 // Fix ie6 background flicker problem. 1135 if ($.browser.msie == true) { 1136 try {
1137 document.execCommand('BackgroundImageCache', false, true); 1138 } catch(err) {} 1139 } 1140 1141 Drupal.behaviors.fivestar = function(context) { 1142 $('div.fivestar-form-item:not(.fivestar-processed)', context).addClass('fivestar-processed').fivestar(); 1143 $('input.fivestar-submit', context).css('display', 'none'); 1144 } 1145 1146})(jQuery);; 1147// $Id: googleanalytics.js,v 1.9.2.4 2010/09/19 11:39:20 hass Exp $ 1148 1149$(document).ready(function() { 1150 1151 // Attach onclick event to document only and catch clicks on all elements. 1152 $(document.body).click(function(event) { 1153 // Catch only the first parent link of a clicked element. 1154 $(event.target).parents("a:first,area:first").andSelf().filter("a,area").each(function() { 1155 1156 var ga = Drupal.settings.googleanalytics; 1157 // Expression to check for absolute internal links. 1158 var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i"); 1159 // Expression to check for special links like gotwo.module /go/* links. 1160 var isInternalSpecial = new RegExp("(\/go\/.*)$", "i"); 1161 // Expression to check for download links. 1162 var isDownload = new RegExp("\\.(" + ga.trackDownloadExtensions + ")$", "i"); 1163 1164 // Is the clicked URL internal? 1165 if (isInternal.test(this.href)) { 1166 // Is download tracking activated and the file extension configured for download tracking? 1167 if (ga.trackDownload && isDownload.test(this.href)) { 1168 // Download link clicked. 1169 var extension = isDownload.exec(this.href); 1170 _gaq.push(["_trackEvent", "Downloads", extension[1].toUpperCase(), this.href.replace(isInternal, '')]); 1171 } 1172 else if (isInternalSpecial.test(this.href)) { 1173 // Keep the internal URL for Google Analytics website overlay intact. 1174 _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]); 1175 } 1176 } 1177 else { 1178 if (ga.trackMailto && $(this).is("a[href^=mailto:],area[href^=mailto:]")) { 1179 // Mailto link clicked. 1180 _gaq.push(["_trackEvent", "Mails", "Click", this.href.substring(7)]); 1181 } 1182 else if (ga.trackOutgoing && this.href) { 1183 // External link clicked. 1184 _gaq.push(["_trackEvent", "Outgoing links", "Click", this.href]); 1185 } 1186 } 1187 1188 }); 1189 }); 1190}); 1191; 1192/* $Id: lightbox.js,v 1.5.2.6.2.136 2010/09/24 08:39:40 snpower Exp $ */ 1193 1194/** 1195 * jQuery Lightbox 1196 * @author 1197 * Stella Power, <http://drupal.org/user/66894> 1198 * 1199 * Based on Lightbox v2.03.3 by Lokesh Dhakar 1200 * <http://www.huddletogether.com/projects/lightbox2/> 1201 * Also partially based on the jQuery Lightbox by Warren Krewenki 1202 * <http://warren.mesozen.com> 1203 * 1204 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module 1205 * maintainers to distribute this file via Drupal.org 1206 * Under GPL license. 1207 * 1208 * Slideshow, iframe and video functionality added by Stella Power. 1209 */ 1210 1211var Lightbox = { 1212 auto_modal : false, 1213 overlayOpacity : 0.8, // Controls transparency of shadow overlay. 1214 overlayColor : '000', // Controls colour of shadow overlay. 1215 disableCloseClick : true, 1216 // Controls the order of the lightbox resizing animation sequence. 1217 resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width. 1218 resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation. 1219 fadeInSpeed: 'normal', // Controls the speed of the image appearance. 1220 slideDownSpeed: 'slow', // Controls the speed of the image details appearance. 1221 minWidth: 240, 1222 borderSize : 10, 1223 boxColor : 'fff', 1224 fontColor : '000', 1225 topPosition : '', 1226 infoHeight: 20, 1227 alternative_layout : false, 1228 imageArray : [], 1229 imageNum : null, 1230 total : 0, 1231 activeImage : null, 1232 inprogress : false, 1233 disableResize : false, 1234 disableZoom : false, 1235 isZoomedIn : false, 1236 rtl : false, 1237 loopItems : false, 1238 keysClose : ['c', 'x', 27], 1239 keysPrevious : ['p', 37], 1240 keysNext : ['n', 39], 1241 keysZoom : ['z'], 1242 keysPlayPause : [32], 1243 1244 // Slideshow options. 1245 slideInterval : 5000, // In milliseconds. 1246 showPlayPause : true, 1247 autoStart : true, 1248 autoExit : true, 1249 pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked. 1250 pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked. 1251 slideIdArray : [], 1252 slideIdCount : 0, 1253 isSlideshow : false, 1254 isPaused : false, 1255 loopSlides : false, 1256 1257 // Iframe options. 1258 isLightframe : false, 1259 iframe_width : 600, 1260 iframe_height : 400, 1261 iframe_border : 1, 1262 1263 // Video and modal options. 1264 enableVideo : false, 1265 flvPlayer : '/flvplayer.swf', 1266 flvFlashvars : '', 1267 isModal : false, 1268 isVideo : false, 1269 videoId : false, 1270 modalWidth : 400,
1271 modalHeight : 400, 1272 modalHTML : null, 1273 1274 1275 // initialize() 1276 // Constructor runs on completion of the DOM loading. 1277 // The function inserts html at the bottom of the page which is used 1278 // to display the shadow overlay and the image container. 1279 initialize: function() { 1280 1281 var s = Drupal.settings.lightbox2; 1282 Lightbox.overlayOpacity = s.overlay_opacity; 1283 Lightbox.overlayColor = s.overlay_color; 1284 Lightbox.disableCloseClick = s.disable_close_click; 1285 Lightbox.resizeSequence = s.resize_sequence; 1286 Lightbox.resizeSpeed = s.resize_speed; 1287 Lightbox.fadeInSpeed = s.fade_in_speed; 1288 Lightbox.slideDownSpeed = s.slide_down_speed; 1289 Lightbox.borderSize = s.border_size; 1290 Lightbox.boxColor = s.box_color; 1291 Lightbox.fontColor = s.font_color; 1292 Lightbox.topPosition = s.top_position; 1293 Lightbox.rtl = s.rtl; 1294 Lightbox.loopItems = s.loop_items; 1295 Lightbox.keysClose = s.keys_close.split(" "); 1296 Lightbox.keysPrevious = s.keys_previous.split(" "); 1297 Lightbox.keysNext = s.keys_next.split(" "); 1298 Lightbox.keysZoom = s.keys_zoom.split(" "); 1299 Lightbox.keysPlayPause = s.keys_play_pause.split(" "); 1300 Lightbox.disableResize = s.disable_resize; 1301 Lightbox.disableZoom = s.disable_zoom; 1302 Lightbox.slideInterval = s.slideshow_interval; 1303 Lightbox.showPlayPause = s.show_play_pause; 1304 Lightbox.showCaption = s.show_caption; 1305 Lightbox.autoStart = s.slideshow_automatic_start; 1306 Lightbox.autoExit = s.slideshow_automatic_exit; 1307 Lightbox.pauseOnNextClick = s.pause_on_next_click; 1308 Lightbox.pauseOnPrevClick = s.pause_on_previous_click; 1309 Lightbox.loopSlides = s.loop_slides; 1310 Lightbox.alternative_layout = s.use_alt_layout; 1311 Lightbox.iframe_width = s.iframe_width; 1312 Lightbox.iframe_height = s.iframe_height; 1313 Lightbox.iframe_border = s.iframe_border; 1314 Lightbox.enableVideo = s.enable_video; 1315 if (s.enable_video) { 1316 Lightbox.flvPlayer = s.flvPlayer; 1317 Lightbox.flvFlashvars = s.flvFlashvars; 1318 } 1319 1320 // Make the lightbox divs. 1321 var layout_class = (s.use_alt_layout ? 'lightbox2-alt-layout' : 'lightbox2-orig-layout'); 1322 var output = '<div id="lightbox2-overlay" style="display: none;"></div>\ 1323 <div id="lightbox" style="display: none;" class="' + layout_class + '">\ 1324 <div id="outerImageContainer"></div>\ 1325 <div id="imageDataContainer" class="clearfix">\ 1326 <div id="imageData"></div>\ 1327 </div>\ 1328 </div>'; 1329 var loading = '<div id="loading"><a href="#" id="loadingLink"></a></div>'; 1330 var modal = '<div id="modalContainer" style="display: none;"></div>'; 1331 var frame = '<div id="frameContainer" style="display: none;"></div>'; 1332 var imageContainer = '<div id="imageContainer" style="display: none;"></div>'; 1333 var details = '<div id="imageDetails"></div>'; 1334 var bottomNav = '<div id="bottomNav"></div>'; 1335 var image = '<img id="lightboxImage" alt="" />'; 1336 var hoverNav = '<div id="hoverNav"><a id="prevLink" href="#"></a><a id="nextLink" href="#"></a></div>'; 1337 var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" href="#"></a><a id="frameNextLink" href="#"></a></div>'; 1338 var hoverNav = '<div id="hoverNav"><a id="prevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="nextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>'; 1339 var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="frameNextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>'; 1340 var caption = '<span id="caption"></span>'; 1341 var numberDisplay = '<span id="numberDisplay"></span>'; 1342 var close = '<a id="bottomNavClose" title="' + Drupal.t('Close') + '" href="#"></a>'; 1343 var zoom = '<a id="bottomNavZoom" href="#"></a>'; 1344 var zoomOut = '<a id="bottomNavZoomOut" href="#"></a>'; 1345 var pause = '<a id="lightshowPause" title="' + Drupal.t('Pause Slideshow') + '" href="#" style="display: none;"></a>'; 1346 var play = '<a id="lightshowPlay" title="' + Drupal.t('Play Slideshow') + '" href="#" style="display: none;"></a>'; 1347 1348 $("body").append(output); 1349 $('#outerImageContainer').append(modal + frame + imageContainer + loading); 1350 if (!s.use_alt_layout) { 1351 $('#imageContainer').append(image + hoverNav);
1352 $('#imageData').append(details + bottomNav); 1353 $('#imageDetails').append(caption + numberDisplay); 1354 $('#bottomNav').append(frameNav + close + zoom + zoomOut + pause + play); 1355 } 1356 else { 1357 $('#outerImageContainer').append(bottomNav); 1358 $('#imageContainer').append(image); 1359 $('#bottomNav').append(close + zoom + zoomOut); 1360 $('#imageData').append(hoverNav + details); 1361 $('#imageDetails').append(caption + numberDisplay + pause + play); 1362 } 1363 1364 // Setup onclick handlers. 1365 if (Lightbox.disableCloseClick) { 1366 $('#lightbox2-overlay').click(function() { Lightbox.end(); return false; } ).hide(); 1367 } 1368 $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } ); 1369 $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } ); 1370 $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } ); 1371 $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } ); 1372 $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } ); 1373 $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } ); 1374 $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } ); 1375 1376 // Fix positioning. 1377 $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'}); 1378 $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'}); 1379 $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor}); 1380 if (Lightbox.alternative_layout) { 1381 $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'}); 1382 } 1383 else if (Lightbox.rtl == 1 && $.browser.msie) { 1384 $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'}); 1385 } 1386 1387 // Force navigation links to always be displayed 1388 if (s.force_show_nav) { 1389 $('#prevLink, #nextLink').addClass("force_show_nav"); 1390 } 1391 1392 }, 1393 1394 // initList() 1395 // Loops through anchor tags looking for 'lightbox', 'lightshow' and 1396 // 'lightframe', etc, references and applies onclick events to appropriate 1397 // links. You can rerun after dynamically adding images w/ajax. 1398 initList : function(context) { 1399 1400 if (context == undefined || context == null) { 1401 context = document; 1402 } 1403 1404 // Attach lightbox to any links with rel 'lightbox', 'lightshow' or 1405 // 'lightframe', etc. 1406 $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 1407 if (Lightbox.disableCloseClick) { 1408 $('#lightbox').unbind('click'); 1409 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 1410 } 1411 Lightbox.start(this, false, false, false, false); 1412 if (e.preventDefault) { e.preventDefault(); } 1413 return false; 1414 }); 1415 $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 1416 if (Lightbox.disableCloseClick) { 1417 $('#lightbox').unbind('click'); 1418 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 1419 } 1420 Lightbox.start(this, true, false, false, false); 1421 if (e.preventDefault) { e.preventDefault(); } 1422 return false; 1423 }); 1424 $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 1425 if (Lightbox.disableCloseClick) { 1426 $('#lightbox').unbind('click'); 1427 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 1428 } 1429 Lightbox.start(this, false, true, false, false); 1430 if (e.preventDefault) { e.preventDefault(); } 1431 return false;
1432 }); 1433 if (Lightbox.enableVideo) { 1434 $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 1435 if (Lightbox.disableCloseClick) { 1436 $('#lightbox').unbind('click'); 1437 $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); 1438 } 1439 Lightbox.start(this, false, false, true, false); 1440 if (e.preventDefault) { e.preventDefault(); } 1441 return false; 1442 }); 1443 } 1444 $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 1445 $('#lightbox').unbind('click'); 1446 // Add classes from the link to the lightbox div - don't include lightbox-processed 1447 $('#lightbox').addClass($(this).attr('class')); 1448 $('#lightbox').removeClass('lightbox-processed'); 1449 Lightbox.start(this, false, false, false, true); 1450 if (e.preventDefault) { e.preventDefault(); } 1451 return false; 1452 }); 1453 $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { 1454 Lightbox.auto_modal = true; 1455 $('#lightbox').unbind('click'); 1456 Lightbox.start(this, false, false, false, true); 1457 if (e.preventDefault) { e.preventDefault(); } 1458 return false; 1459 }); 1460 }, 1461 1462 // start() 1463 // Display overlay and lightbox. If image is part of a set, add siblings to 1464 // imageArray. 1465 start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) { 1466 1467 Lightbox.isPaused = !Lightbox.autoStart; 1468 1469 // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2. 1470 Lightbox.toggleSelectsFlash('hide'); 1471 1472 // Stretch overlay to fill page and fade in. 1473 var arrayPageSize = Lightbox.getPageSize(); 1474 $("#lightbox2-overlay").hide().css({ 1475 'width': '100%', 1476 'zIndex': '10090', 1477 'height': arrayPageSize[1] + 'px', 1478 'backgroundColor' : '#' + Lightbox.overlayColor 1479 }); 1480 // Detect OS X FF2 opacity + flash issue. 1481 if (lightvideo && this.detectMacFF2()) { 1482 $("#lightbox2-overlay").removeClass("overlay_default"); 1483 $("#lightbox2-overlay").addClass("overlay_macff2"); 1484 $("#lightbox2-overlay").css({'opacity' : null}); 1485 } 1486 else { 1487 $("#lightbox2-overlay").removeClass("overlay_macff2"); 1488 $("#lightbox2-overlay").addClass("overlay_default"); 1489 $("#lightbox2-overlay").css({'opacity' : Lightbox.overlayOpacity}); 1490 } 1491 $("#lightbox2-overlay").fadeIn(Lightbox.fadeInSpeed); 1492 1493 1494 Lightbox.isSlideshow = slideshow; 1495 Lightbox.isLightframe = lightframe; 1496 Lightbox.isVideo = lightvideo; 1497 Lightbox.isModal = lightmodal; 1498 Lightbox.imageArray = []; 1499 Lightbox.imageNum = 0; 1500 1501 var anchors = $(imageLink.tagName); 1502 var anchor = null; 1503 var rel_parts = Lightbox.parseRel(imageLink); 1504 var rel = rel_parts["rel"]; 1505 var rel_group = rel_parts["group"]; 1506 var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title); 1507 var rel_style = null; 1508 var i = 0; 1509 1510 if (rel_parts["flashvars"]) { 1511 Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"]; 1512 } 1513 1514 // Set the title for image alternative text. 1515 var alt = imageLink.title; 1516 if (!alt) { 1517 var img = $(imageLink).find("img"); 1518 if (img && $(img).attr("alt")) { 1519 alt = $(img).attr("alt"); 1520 } 1521 else { 1522 alt = title; 1523 } 1524 } 1525 1526 if ($(imageLink).attr('id') == 'lightboxAutoModal') { 1527 rel_style = rel_parts["style"]; 1528 Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]); 1529 } 1530 else { 1531 // Handle lightbox images with no grouping. 1532 if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) { 1533 Lightbox.imageArray.push([imageLink.href, title, alt]); 1534 } 1535 1536 // Handle other items with no grouping. 1537 else if (!rel_group) { 1538 rel_style = rel_parts["style"]; 1539 Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]); 1540 } 1541 1542 // Handle grouped items. 1543 else { 1544 1545 // Loop through anchors and add them to imageArray. 1546 for (i = 0; i < anchors.length; i++) { 1547 anchor = anchors[i]; 1548 if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) { 1549 var rel_data = Lightbox.parseRel(anchor); 1550 var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title); 1551 img_alt = anchor.title; 1552 if (!img_alt) { 1553 var anchor_img = $(anchor).find("img"); 1554 if (anchor_img && $(anchor_img).attr("alt")) { 1555 img_alt = $(anchor_img).attr("alt"); 1556 } 1557 else { 1558 img_alt = title; 1559 } 1560 } 1561 if (rel_data["rel"] == rel) { 1562 if (rel_data["group"] == rel_group) { 1563 if (Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) { 1564 rel_style = rel_data["style"]; 1565 } 1566 Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]); 1567 } 1568 } 1569 } 1570 } 1571 1572 // Remove duplicates. 1573 for (i = 0; i < Lightbox.imageArray.length; i++) { 1574 for (j = Lightbox.imageArray.length-1; j > i; j--) { 1575 if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) { 1576 Lightbox.imageArray.splice(j,1); 1577 } 1578 } 1579 } 1580 while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) { 1581 Lightbox.imageNum++; 1582 } 1583 } 1584 } 1585 1586 if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) { 1587 $('#lightshowPlay').show(); 1588 $('#lightshowPause').hide(); 1589 } 1590 1591 // Calculate top and left offset for the lightbox. 1592 var arrayPageScroll = Lightbox.getPageScroll(); 1593 var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; 1594 var lightboxLeft = arrayPageScroll[0]; 1595 $('#frameContainer, #modalContainer, #lightboxImage').hide();
1596 $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); 1597 $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); 1598 $('#outerImageContainer').css({'width': '250px', 'height': '250px'}); 1599 $('#lightbox').css({ 1600 'zIndex': '10500', 1601 'top': lightboxTop + 'px', 1602 'left': lightboxLeft + 'px' 1603 }).show(); 1604 1605 Lightbox.total = Lightbox.imageArray.length; 1606 Lightbox.changeData(Lightbox.imageNum); 1607 }, 1608 1609 // changeData() 1610 // Hide most elements and preload image in preparation for resizing image 1611 // container. 1612 changeData: function(imageNum, zoomIn) { 1613 1614 if (Lightbox.inprogress === false) { 1615 if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) { 1616 if (imageNum >= Lightbox.total) imageNum = 0; 1617 if (imageNum < 0) imageNum = Lightbox.total - 1; 1618 } 1619 1620 if (Lightbox.isSlideshow) { 1621 for (var i = 0; i < Lightbox.slideIdCount; i++) { 1622 window.clearTimeout(Lightbox.slideIdArray[i]); 1623 } 1624 } 1625 Lightbox.inprogress = true; 1626 Lightbox.activeImage = imageNum; 1627 1628 if (Lightbox.disableResize && !Lightbox.isSlideshow) { 1629 zoomIn = true; 1630 } 1631 Lightbox.isZoomedIn = zoomIn; 1632 1633 1634 // Hide elements during transition. 1635 $('#loading').css({'zIndex': '10500'}).show(); 1636 if (!Lightbox.alternative_layout) { 1637 $('#imageContainer').hide(); 1638 } 1639 $('#frameContainer, #modalContainer, #lightboxImage').hide(); 1640 $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); 1641 $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); 1642 1643 // Preload image content, but not iframe pages. 1644 if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) { 1645 $("#lightbox #imageDataContainer").removeClass('lightbox2-alt-layout-data'); 1646 imgPreloader = new Image(); 1647 imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); }; 1648 1649 imgPreloader.onload = function() { 1650 var photo = document.getElementById('lightboxImage'); 1651 photo.src = Lightbox.imageArray[Lightbox.activeImage][0]; 1652 photo.alt = Lightbox.imageArray[Lightbox.activeImage][2]; 1653 1654 var imageWidth = imgPreloader.width; 1655 var imageHeight = imgPreloader.height; 1656 1657 // Resize code. 1658 var arrayPageSize = Lightbox.getPageSize(); 1659 var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) }; 1660 var orig = { w:imgPreloader.width, h:imgPreloader.height }; 1661 1662 // Image is very large, so show a smaller version of the larger image 1663 // with zoom button. 1664 if (zoomIn !== true) { 1665 var ratio = 1.0; // Shrink image with the same aspect. 1666 $('#bottomNavZoomOut, #bottomNavZoom').hide(); 1667 if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { 1668 ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h; 1669 if (!Lightbox.disableZoom && !Lightbox.isSlideshow) { 1670 $('#bottomNavZoom').css({'zIndex': '10500'}).show(); 1671 } 1672 } 1673 1674 imageWidth = Math.floor(orig.w * ratio); 1675 imageHeight = Math.floor(orig.h * ratio); 1676 } 1677 1678 else { 1679 $('#bottomNavZoom').hide();
1680 // Only display zoom out button if the image is zoomed in already. 1681 if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { 1682 // Only display zoom out button if not a slideshow and if the 1683 // buttons aren't disabled. 1684 if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) { 1685 $('#bottomNavZoomOut').css({'zIndex': '10500'}).show(); 1686 } 1687 } 1688 } 1689 1690 photo.style.width = (imageWidth) + 'px'; 1691 photo.style.height = (imageHeight) + 'px'; 1692 Lightbox.resizeContainer(imageWidth, imageHeight); 1693 1694 // Clear onLoad, IE behaves irratically with animated gifs otherwise. 1695 imgPreloader.onload = function() {}; 1696 }; 1697 1698 imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0]; 1699 imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2]; 1700 } 1701 1702 // Set up frame size, etc. 1703 else if (Lightbox.isLightframe) { 1704 $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); 1705 var src = Lightbox.imageArray[Lightbox.activeImage][0]; 1706 $('#frameContainer').html('<iframe id="lightboxFrame" style="display: none;" src="'+src+'"></iframe>'); 1707 1708 // Enable swf support in Gecko browsers. 1709 if ($.browser.mozilla && src.indexOf('.swf') != -1) { 1710 setTimeout(function () { 1711 document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; 1712 }, 1000); 1713 } 1714 1715 if (!Lightbox.iframe_border) { 1716 $('#lightboxFrame').css({'border': 'none'}); 1717 $('#lightboxFrame').attr('frameborder', '0'); 1718 } 1719 var iframe = document.getElementById('lightboxFrame'); 1720 var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3]; 1721 iframe = Lightbox.setStyles(iframe, iframeStyles); 1722 Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10)); 1723 } 1724 else if (Lightbox.isVideo || Lightbox.isModal) { 1725 $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data'); 1726 var container = document.getElementById('modalContainer'); 1727 var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3]; 1728 container = Lightbox.setStyles(container, modalStyles); 1729 if (Lightbox.isVideo) { 1730 Lightbox.modalHeight = parseInt(container.height, 10) - 10; 1731 Lightbox.modalWidth = parseInt(container.width, 10) - 10; 1732 Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]); 1733 } 1734 Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10)); 1735 } 1736 } 1737 }, 1738 1739 // imgNodeLoadingError() 1740 imgNodeLoadingError: function(image) { 1741 var s = Drupal.settings.lightbox2; 1742 var original_image = Lightbox.imageArray[Lightbox.activeImage][0]; 1743 if (s.display_image_size !== "") { 1744 original_image = original_image.replace(new RegExp("."+s.display_image_size), ""); 1745 } 1746 Lightbox.imageArray[Lightbox.activeImage][0] = original_image; 1747 image.onerror = function() { Lightbox.imgLoadingError(image); }; 1748 image.src = original_image; 1749 }, 1750 1751 // imgLoadingError() 1752 imgLoadingError: function(image) { 1753 var s = Drupal.settings.lightbox2; 1754 Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image; 1755 image.src = s.default_image; 1756 }, 1757 1758 // resizeContainer() 1759 resizeContainer: function(imgWidth, imgHeight) { 1760 1761 imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth); 1762 1763 this.widthCurrent = $('#outerImageContainer').width(); 1764 this.heightCurrent = $('#outerImageContainer').height(); 1765 1766 var widthNew = (imgWidth + (Lightbox.borderSize * 2)); 1767 var heightNew = (imgHeight + (Lightbox.borderSize * 2)); 1768 1769 // Scalars based on change from old to new. 1770 this.xScale = ( widthNew / this.widthCurrent) * 100; 1771 this.yScale = ( heightNew / this.heightCurrent) * 100; 1772 1773 // Calculate size difference between new and old image, and resize if 1774 // necessary. 1775 wDiff = this.widthCurrent - widthNew; 1776 hDiff = this.heightCurrent - heightNew; 1777 1778 $('#modalContainer').css({'width': imgWidth, 'height': imgHeight}); 1779 // Detect animation sequence. 1780 if (Lightbox.resizeSequence) { 1781 var animate1 = {width: widthNew}; 1782 var animate2 = {height: heightNew}; 1783 if (Lightbox.resizeSequence == 2) { 1784 animate1 = {height: heightNew}; 1785 animate2 = {width: widthNew}; 1786 } 1787 $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); 1788 } 1789 // Simultaneous. 1790 else { 1791 $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); 1792 } 1793 1794 // If new and old image are same size and no scaling transition is necessary 1795 // do a quick pause to prevent image flicker. 1796 if ((hDiff === 0) && (wDiff === 0)) { 1797 if ($.browser.msie) { 1798 Lightbox.pause(250); 1799 } 1800 else { 1801 Lightbox.pause(100); 1802 } 1803 } 1804 1805 var s = Drupal.settings.lightbox2; 1806 if (!s.use_alt_layout) { 1807 $('#prevLink, #nextLink').css({'height': imgHeight + 'px'}); 1808 } 1809 $('#imageDataContainer').css({'width': widthNew + 'px'}); 1810 }, 1811 1812 // showData() 1813 // Display image and begin preloading neighbors. 1814 showData: function() { 1815 $('#loading').hide(); 1816 1817 if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) { 1818 Lightbox.updateDetails(); 1819 if (Lightbox.isLightframe) { 1820 $('#frameContainer').show(); 1821 if ($.browser.safari || Lightbox.fadeInSpeed === 0) { 1822 $('#lightboxFrame').css({'zIndex': '10500'}).show(); 1823 } 1824 else { 1825 $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); 1826 } 1827 } 1828 else { 1829 if (Lightbox.isVideo) { 1830 $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show(); 1831 } 1832 else { 1833 var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]); 1834 if (Lightbox.imageArray[Lightbox.activeImage][4]) { 1835 $(src).appendTo("#modalContainer"); 1836 $('#modalContainer').css({'zIndex': '10500'}).show(); 1837 } 1838 else { 1839 // Use a callback to show the new image, otherwise you get flicker. 1840 $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();}); 1841 } 1842 $('#modalContainer').unbind('click'); 1843 } 1844 // This might be needed in the Lightframe section above. 1845 //$('#modalContainer').css({'zIndex': '10500'}).show(); 1846 } 1847 } 1848 1849 // Handle display of image content. 1850 else { 1851 $('#imageContainer').show(); 1852 if ($.browser.safari || Lightbox.fadeInSpeed === 0) { 1853 $('#lightboxImage').css({'zIndex': '10500'}).show(); 1854 } 1855 else { 1856 $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); 1857 } 1858 Lightbox.updateDetails(); 1859 this.preloadNeighborImages(); 1860 } 1861 Lightbox.inprogress = false;
1862 1863 // Slideshow specific stuff. 1864 if (Lightbox.isSlideshow) { 1865 if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { 1866 if (Lightbox.autoExit) { 1867 Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval); 1868 } 1869 } 1870 else { 1871 if (!Lightbox.isPaused && Lightbox.total > 1) { 1872 Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval); 1873 } 1874 } 1875 if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) { 1876 $('#lightshowPause').show(); 1877 $('#lightshowPlay').hide(); 1878 } 1879 else if (Lightbox.showPlayPause && Lightbox.total > 1) { 1880 $('#lightshowPause').hide(); 1881 $('#lightshowPlay').show(); 1882 } 1883 } 1884 1885 // Adjust the page overlay size. 1886 var arrayPageSize = Lightbox.getPageSize(); 1887 var arrayPageScroll = Lightbox.getPageScroll(); 1888 var pageHeight = arrayPageSize[1]; 1889 if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) { 1890 var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; 1891 pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop; 1892 } 1893 $('#lightbox2-overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'}); 1894 1895 // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as 1896 // expected. 1897 if ($.browser.mozilla) { 1898 if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) { 1899 setTimeout(function () { 1900 document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; 1901 }, 1000); 1902 } 1903 } 1904 }, 1905 1906 // updateDetails() 1907 // Display caption, image number, and bottom nav. 1908 updateDetails: function() { 1909 1910 $("#imageDataContainer").hide(); 1911 1912 var s = Drupal.settings.lightbox2; 1913 1914 if (s.show_caption) { 1915 var caption = Lightbox.filterXSS(Lightbox.imageArray[Lightbox.activeImage][1]); 1916 if (!caption) caption = ''; 1917 $('#caption').html(caption).css({'zIndex': '10500'}).show(); 1918 } 1919 1920 // If image is part of set display 'Image x of x'. 1921 var numberDisplay = null; 1922 if (s.image_count && Lightbox.total > 1) { 1923 var currentImage = Lightbox.activeImage + 1; 1924 if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) { 1925 numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 1926 } 1927 else if (Lightbox.isVideo) { 1928 numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 1929 } 1930 else { 1931 numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); 1932 }
1933 $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show(); 1934 } 1935 else { 1936 $('#numberDisplay').hide(); 1937 } 1938 1939 $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() { 1940 $("#bottomNav").show(); 1941 }); 1942 if (Lightbox.rtl == 1) { 1943 $("#bottomNav").css({'float': 'left'}); 1944 } 1945 Lightbox.updateNav(); 1946 }, 1947 1948 // updateNav() 1949 // Display appropriate previous and next hover navigation. 1950 updateNav: function() { 1951 1952 $('#hoverNav').css({'zIndex': '10500'}).show(); 1953 var prevLink = '#prevLink'; 1954 var nextLink = '#nextLink'; 1955 1956 // Slideshow is separated as we need to show play / pause button. 1957 if (Lightbox.isSlideshow) { 1958 if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) { 1959 $(prevLink).css({'zIndex': '10500'}).show().click(function() { 1960 if (Lightbox.pauseOnPrevClick) { 1961 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 1962 } 1963 Lightbox.changeData(Lightbox.activeImage - 1); return false; 1964 }); 1965 } 1966 else { 1967 $(prevLink).hide(); 1968 } 1969 1970 // If not last image in set, display next image button. 1971 if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) { 1972 $(nextLink).css({'zIndex': '10500'}).show().click(function() { 1973 if (Lightbox.pauseOnNextClick) { 1974 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 1975 } 1976 Lightbox.changeData(Lightbox.activeImage + 1); return false; 1977 }); 1978 } 1979 // Safari browsers need to have hide() called again. 1980 else { 1981 $(nextLink).hide(); 1982 } 1983 } 1984 1985 // All other types of content. 1986 else { 1987 1988 if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) { 1989 $('#frameHoverNav').css({'zIndex': '10500'}).show(); 1990 $('#hoverNav').css({'zIndex': '10500'}).hide(); 1991 prevLink = '#framePrevLink'; 1992 nextLink = '#frameNextLink'; 1993 } 1994 1995 // If not first image in set, display prev image button. 1996 if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) { 1997 // Unbind any other click handlers, otherwise this adds a new click handler 1998 // each time the arrow is clicked. 1999 $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() { 2000 Lightbox.changeData(Lightbox.activeImage - 1); return false; 2001 }); 2002 } 2003 // Safari browsers need to have hide() called again. 2004 else { 2005 $(prevLink).hide(); 2006 } 2007 2008 // If not last image in set, display next image button. 2009 if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) { 2010 // Unbind any other click handlers, otherwise this adds a new click handler 2011 // each time the arrow is clicked. 2012 $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() { 2013 Lightbox.changeData(Lightbox.activeImage + 1); return false; 2014 }); 2015 } 2016 // Safari browsers need to have hide() called again. 2017 else { 2018 $(nextLink).hide(); 2019 } 2020 } 2021 2022 // Don't enable keyboard shortcuts so forms will work. 2023 if (!Lightbox.isModal) { 2024 this.enableKeyboardNav(); 2025 } 2026 }, 2027 2028 2029 // enableKeyboardNav() 2030 enableKeyboardNav: function() { 2031 $(document).bind("keydown", this.keyboardAction); 2032 }, 2033 2034 // disableKeyboardNav() 2035 disableKeyboardNav: function() { 2036 $(document).unbind("keydown", this.keyboardAction); 2037 }, 2038 2039 // keyboardAction() 2040 keyboardAction: function(e) { 2041 if (e === null) { // IE. 2042 keycode = event.keyCode; 2043 escapeKey = 27; 2044 } 2045 else { // Mozilla. 2046 keycode = e.keyCode; 2047 escapeKey = e.DOM_VK_ESCAPE; 2048 } 2049 2050 key = String.fromCharCode(keycode).toLowerCase(); 2051 2052 // Close lightbox. 2053 if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) { 2054 Lightbox.end('forceClose'); 2055 } 2056 // Display previous image (p, <-). 2057 else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) { 2058 if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) { 2059 Lightbox.changeData(Lightbox.activeImage - 1); 2060 } 2061 2062 } 2063 // Display next image (n, ->). 2064 else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) { 2065 if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) { 2066 Lightbox.changeData(Lightbox.activeImage + 1); 2067 } 2068 } 2069 // Zoom in. 2070 else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) { 2071 if (Lightbox.isZoomedIn) { 2072 Lightbox.changeData(Lightbox.activeImage, false); 2073 } 2074 else if (!Lightbox.isZoomedIn) { 2075 Lightbox.changeData(Lightbox.activeImage, true); 2076 } 2077 return false;
2078 } 2079 // Toggle play / pause (space). 2080 else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) { 2081 2082 if (Lightbox.isPaused) { 2083 Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); 2084 } 2085 else { 2086 Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); 2087 } 2088 return false; 2089 } 2090 }, 2091 2092 preloadNeighborImages: function() { 2093 2094 if ((Lightbox.total - 1) > Lightbox.activeImage) { 2095 preloadNextImage = new Image(); 2096 preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0]; 2097 } 2098 if (Lightbox.activeImage > 0) { 2099 preloadPrevImage = new Image(); 2100 preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0]; 2101 } 2102 2103 }, 2104 2105 end: function(caller) { 2106 var closeClick = (caller == 'slideshow' ? false : true); 2107 if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) { 2108 return; 2109 } 2110 // To prevent double clicks on navigation links. 2111 if (Lightbox.inprogress === true && caller != 'forceClose') { 2112 return; 2113 } 2114 Lightbox.disableKeyboardNav(); 2115 $('#lightbox').hide(); 2116 $("#lightbox2-overlay").fadeOut(); 2117 Lightbox.isPaused = true; 2118 Lightbox.inprogress = false; 2119 // Replaces calls to showSelectBoxes() and showFlash() in original 2120 // lightbox2. 2121 Lightbox.toggleSelectsFlash('visible'); 2122 if (Lightbox.isSlideshow) { 2123 for (var i = 0; i < Lightbox.slideIdCount; i++) { 2124 window.clearTimeout(Lightbox.slideIdArray[i]); 2125 } 2126 $('#lightshowPause, #lightshowPlay').hide(); 2127 } 2128 else if (Lightbox.isLightframe) { 2129 $('#frameContainer').empty().hide(); 2130 } 2131 else if (Lightbox.isVideo || Lightbox.isModal) { 2132 if (!Lightbox.auto_modal) { 2133 $('#modalContainer').hide().html(""); 2134 } 2135 Lightbox.auto_modal = false; 2136 } 2137 }, 2138 2139 2140 // getPageScroll() 2141 // Returns array with x,y page scroll values. 2142 // Core code from - quirksmode.com. 2143 getPageScroll : function() { 2144 2145 var xScroll, yScroll; 2146 2147 if (self.pageYOffset || self.pageXOffset) { 2148 yScroll = self.pageYOffset; 2149 xScroll = self.pageXOffset; 2150 } 2151 else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) { // Explorer 6 Strict. 2152 yScroll = document.documentElement.scrollTop; 2153 xScroll = document.documentElement.scrollLeft; 2154 } 2155 else if (document.body) {// All other Explorers. 2156 yScroll = document.body.scrollTop; 2157 xScroll = document.body.scrollLeft; 2158 } 2159 2160 arrayPageScroll = [xScroll,yScroll]; 2161 return arrayPageScroll; 2162 }, 2163 2164 // getPageSize() 2165 // Returns array with page width, height and window width, height. 2166 // Core code from - quirksmode.com. 2167 // Edit for Firefox by pHaez. 2168 2169 getPageSize : function() { 2170 2171 var xScroll, yScroll; 2172 2173 if (window.innerHeight && window.scrollMaxY) { 2174 xScroll = window.innerWidth + window.scrollMaxX; 2175 yScroll = window.innerHeight + window.scrollMaxY; 2176 } 2177 else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac. 2178 xScroll = document.body.scrollWidth; 2179 yScroll = document.body.scrollHeight; 2180 } 2181 else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. 2182 xScroll = document.body.offsetWidth; 2183 yScroll = document.body.offsetHeight; 2184 } 2185 2186 var windowWidth, windowHeight; 2187 2188 if (self.innerHeight) { // All except Explorer. 2189 if (document.documentElement.clientWidth) { 2190 windowWidth = document.documentElement.clientWidth; 2191 } 2192 else { 2193 windowWidth = self.innerWidth; 2194 } 2195 windowHeight = self.innerHeight; 2196 } 2197 else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode. 2198 windowWidth = document.documentElement.clientWidth; 2199 windowHeight = document.documentElement.clientHeight; 2200 } 2201 else if (document.body) { // Other Explorers. 2202 windowWidth = document.body.clientWidth; 2203 windowHeight = document.body.clientHeight; 2204 } 2205 // For small pages with total height less than height of the viewport. 2206 if (yScroll < windowHeight) { 2207 pageHeight = windowHeight; 2208 } 2209 else { 2210 pageHeight = yScroll; 2211 } 2212 // For small pages with total width less than width of the viewport. 2213 if (xScroll < windowWidth) { 2214 pageWidth = xScroll; 2215 } 2216 else { 2217 pageWidth = windowWidth; 2218 } 2219 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); 2220 return arrayPageSize; 2221 }, 2222 2223 2224 // pause(numberMillis) 2225 pause : function(ms) { 2226 var date = new Date(); 2227 var curDate = null; 2228 do { curDate = new Date(); } 2229 while (curDate - date < ms); 2230 }, 2231 2232 2233 // toggleSelectsFlash() 2234 // Hide / unhide select lists and flash objects as they appear above the 2235 // lightbox in some browsers. 2236 toggleSelectsFlash: function (state) { 2237 if (state == 'visible') { 2238 $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show(); 2239 } 2240 else if (state == 'hide') { 2241 $("select:visible, embed:visible, object:visible").not('#lightboxAutoModal select, #lightboxAutoModal embed, #lightboxAutoModal object').addClass("lightbox_hidden"); 2242 $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide(); 2243 } 2244 }, 2245 2246 2247 // parseRel() 2248 parseRel: function (link) { 2249 var parts = []; 2250 parts["rel"] = parts["title"] = parts["group"] = parts["style"] = parts["flashvars"] = null; 2251 if (!$(link).attr('rel')) return parts; 2252 parts["rel"] = $(link).attr('rel').match(/\w+/)[0]; 2253 2254 if ($(link).attr('rel').match(/\[(.*)\]/)) { 2255 var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|'); 2256 parts["group"] = info[0]; 2257 parts["style"] = info[1]; 2258 if (parts["style"] != undefined && parts["style"].match(/flashvars:\s?(.*?);/)) { 2259 parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1]; 2260 } 2261 } 2262 if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) { 2263 parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1]; 2264 } 2265 return parts; 2266 }, 2267 2268 // setStyles() 2269 setStyles: function(item, styles) { 2270 item.width = Lightbox.iframe_width; 2271 item.height = Lightbox.iframe_height; 2272 item.scrolling = "auto"; 2273 2274 if (!styles) return item; 2275 var stylesArray = styles.split(';'); 2276 for (var i = 0; i< stylesArray.length; i++) { 2277 if (stylesArray[i].indexOf('width:') >= 0) { 2278 var w = stylesArray[i].replace('width:', ''); 2279 item.width = jQuery.trim(w); 2280 } 2281 else if (stylesArray[i].indexOf('height:') >= 0) { 2282 var h = stylesArray[i].replace('height:', ''); 2283 item.height = jQuery.trim(h); 2284 } 2285 else if (stylesArray[i].indexOf('scrolling:') >= 0) { 2286 var scrolling = stylesArray[i].replace('scrolling:', ''); 2287 item.scrolling = jQuery.trim(scrolling); 2288 } 2289 else if (stylesArray[i].indexOf('overflow:') >= 0) { 2290 var overflow = stylesArray[i].replace('overflow:', ''); 2291 item.overflow = jQuery.trim(overflow); 2292 } 2293 } 2294 return item; 2295 }, 2296 2297 2298 // togglePlayPause() 2299 // Hide the pause / play button as appropriate. If pausing the slideshow also 2300 // clear the timers, otherwise move onto the next image. 2301 togglePlayPause: function(hideId, showId) { 2302 if (Lightbox.isSlideshow && hideId == "lightshowPause") { 2303 for (var i = 0; i < Lightbox.slideIdCount; i++) { 2304 window.clearTimeout(Lightbox.slideIdArray[i]); 2305 } 2306 } 2307 $('#' + hideId).hide(); 2308 $('#' + showId).show(); 2309 2310 if (hideId == "lightshowPlay") { 2311 Lightbox.isPaused = false;
2312 if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { 2313 Lightbox.end(); 2314 } 2315 else if (Lightbox.total > 1) { 2316 Lightbox.changeData(Lightbox.activeImage + 1); 2317 } 2318 } 2319 else { 2320 Lightbox.isPaused = true; 2321 } 2322 }, 2323 2324 triggerLightbox: function (rel_type, rel_group) { 2325 if (rel_type.length) { 2326 if (rel_group && rel_group.length) { 2327 $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click"); 2328 } 2329 else { 2330 $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click"); 2331 } 2332 } 2333 }, 2334 2335 detectMacFF2: function() { 2336 var ua = navigator.userAgent.toLowerCase(); 2337 if (/firefox[\/\s](\d+\.\d+)/.test(ua)) { 2338 var ffversion = new Number(RegExp.$1); 2339 if (ffversion < 3 && ua.indexOf('mac') != -1) { 2340 return true; 2341 } 2342 } 2343 return false; 2344 }, 2345 2346 checkKey: function(keys, key, code) { 2347 return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1); 2348 }, 2349 2350 filterXSS: function(str, allowed_tags) { 2351 var output = ""; 2352 $.ajax({ 2353 url: Drupal.settings.basePath + 'system/lightbox2/filter-xss', 2354 data: { 2355 'string' : str, 2356 'allowed_tags' : allowed_tags 2357 }, 2358 type: "POST", 2359 async: false, 2360 dataType: "json", 2361 success: function(data) { 2362 output = data; 2363 } 2364 }); 2365 return output; 2366 } 2367 2368}; 2369 2370// Initialize the lightbox. 2371Drupal.behaviors.initLightbox = function (context) { 2372 $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() { 2373 Lightbox.initialize(); 2374 return false; // Break the each loop. 2375 }); 2376 2377 // Attach lightbox to any links with lightbox rels. 2378 Lightbox.initList(context); 2379 $('#lightboxAutoModal', context).triggerHandler('click'); 2380}; 2381 2382; 2383 2384/* 2385 * Superfish v1.4.8 - jQuery menu widget 2386 * Copyright (c) 2008 Joel Birch 2387 * 2388 * Dual licensed under the MIT and GPL licenses: 2389 * http://www.opensource.org/licenses/mit-license.php 2390 * http://www.gnu.org/licenses/gpl.html 2391 * 2392 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt 2393 */ 2394 2395;(function($){ 2396 $.fn.superfish = function(op){ 2397 2398 var sf = $.fn.superfish, 2399 c = sf.c, 2400 $arrow = $(['<span class="',c.arrowClass,'"> »</span>'].join('')), 2401 over = function(){ 2402 var $$ = $(this), menu = getMenu($$); 2403 clearTimeout(menu.sfTimer); 2404 $$.showSuperfishUl().siblings().hideSuperfishUl(); 2405 }, 2406 out = function(){ 2407 var $$ = $(this), menu = getMenu($$), o = sf.op; 2408 clearTimeout(menu.sfTimer); 2409 menu.sfTimer=setTimeout(function(){ 2410 o.retainPath=($.inArray($$[0],o.$path)>-1); 2411 $$.hideSuperfishUl(); 2412 if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} 2413 },o.delay); 2414 }, 2415 getMenu = function($menu){ 2416 var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; 2417 sf.op = sf.o[menu.serial]; 2418 return menu; 2419 }, 2420 addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; 2421 2422 return this.each(function() { 2423 var s = this.serial = sf.o.length; 2424 var o = $.extend({},sf.defaults,op); 2425 o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ 2426 $(this).addClass([o.hoverClass,c.bcClass].join(' ')) 2427 .filter('li:has(ul)').removeClass(o.pathClass); 2428 }); 2429 sf.o[s] = sf.op = o; 2430 2431 $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { 2432 if (o.autoArrows) addArrow( $('>a:first-child',this) ); 2433 }) 2434 .not('.'+c.bcClass) 2435 .hideSuperfishUl(); 2436 2437 var $a = $('a',this); 2438 $a.each(function(i){ 2439 var $li = $a.eq(i).parents('li'); 2440 $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); 2441 }); 2442 o.onInit.call(this); 2443 2444 }).each(function() { 2445 var menuClasses = [c.menuClass]; 2446 if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); 2447 $(this).addClass(menuClasses.join(' ')); 2448 }); 2449 }; 2450 2451 var sf = $.fn.superfish; 2452 sf.o = []; 2453 sf.op = {}; 2454 sf.IE7fix = function(){ 2455 var o = sf.op; 2456 if ($.browser.msie && $.browser.version >
2456 6 && o.dropShadows && o.animation.opacity!=undefined) 2457 this.toggleClass(sf.c.shadowClass+'-off'); 2458 }; 2459 sf.c = { 2460 bcClass : 'sf-breadcrumb', 2461 menuClass : 'sf-js-enabled', 2462 anchorClass : 'sf-with-ul', 2463 arrowClass : 'sf-sub-indicator', 2464 shadowClass : 'sf-shadow' 2465 }; 2466 sf.defaults = { 2467 hoverClass : 'sfHover', 2468 pathClass : 'overideThisToUse', 2469 pathLevels : 1, 2470 delay : 800, 2471 animation : {opacity:'show'}, 2472 speed : 'normal', 2473 autoArrows : true, 2474 dropShadows : true, 2475 disableHI : false, // true disables hoverIntent detection 2476 onInit : function(){}, // callback functions 2477 onBeforeShow: function(){}, 2478 onShow : function(){}, 2479 onHide : function(){} 2480 }; 2481 $.fn.extend({ 2482 hideSuperfishUl : function(){ 2483 var o = sf.op, 2484 not = (o.retainPath===true) ? o.$path : ''; 2485 o.retainPath = false; 2486 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 2487 .find('>ul').hide().css('visibility','hidden'); 2488 o.onHide.call($ul); 2489 return this; 2490 }, 2491 showSuperfishUl : function(){ 2492 var o = sf.op, 2493 sh = sf.c.shadowClass+'-off', 2494 $ul = this.addClass(o.hoverClass) 2495 .find('>ul:hidden').css('visibility','visible'); 2496 sf.IE7fix.call($ul); 2497 o.onBeforeShow.call($ul); 2498 $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); 2499 return this; 2500 } 2501 }); 2502 2503})(jQuery); 2504; 2505/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) 2506 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 2507 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 2508 * 2509 * $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $ 2510 * $Rev: 2111 $ 2511 * 2512 * Version 2.1 2513 */ 2514(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);; 2515/** 2516* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ 2517* <http://cherne.net/brian/resources/jquery.hoverIntent.html> 2518* 2519* @param f onMouseOver function || An object with configuration options 2520* @param g onMouseOut function || Nothing (use configuration options object) 2521* @author Brian Cherne <[email protected]> 2522*/ 2523(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);; 2524// $Id: nice_menus.js,v 1.21 2010/06/18 06:14:12 vordude Exp $ 2525 2526// This uses Superfish 1.4.8 2527// (http://users.tpg.com.au/j_birch/plugins/superfish) 2528 2529// Add Superfish to all Nice menus with some basic options. 2530(function ($) { 2531 $(document).ready(function() { 2532 $('ul.nice-menu').superfish({ 2533 // Apply a generic hover class. 2534 hoverClass: 'over', 2535 // Disable generation of arrow mark-up.
2536 autoArrows: false, 2537 // Disable drop shadows. 2538 dropShadows: false, 2539 // Mouse delay. 2540 delay: Drupal.settings.nice_menus_options.delay, 2541 // Animation speed. 2542 speed: Drupal.settings.nice_menus_options.speed 2543 // Add in Brandon Aaron’s bgIframe plugin for IE select issues. 2544 // http://plugins.jquery.com/node/46/release 2545 }).find('ul').bgIframe({opacity:false}); 2546 $('ul.nice-menu ul').css('display', 'none'); 2547 }); 2548})(jQuery); 2549; 2550// $Id: poormanscron.js,v 1.1.2.3 2010/01/17 00:27:52 davereid Exp $ 2551(function ($) { 2552 2553/** 2554 * Checks to see if the cron should be automatically run. 2555 */ 2556Drupal.behaviors.cronCheck = function(context) { 2557 if (Drupal.settings.cron.runNext || false) { 2558 $('body:not(.cron-check-processed)', context).addClass('cron-check-processed').each(function() { 2559 // Only execute the cron check if its the right time. 2560 if (Math.round(new Date().getTime() / 1000.0) >= Drupal.settings.cron.runNext) { 2561 $.get(Drupal.settings.cron.basePath + '/run-cron-check'); 2562 } 2563 }); 2564 } 2565}; 2566 2567})(jQuery); 2568; 2569/* $Id $ */ 2570 2571$(document).ready(function() { 2572 // Add signwriter-hover class to the menus that signwriter is being used for. 2573 $('img.signwriter-hover') 2574 .parents('ul.menu') 2575 .addClass('signwriter-hover'); 2576 2577 $('img.signwriter-hover') 2578 2579 set_signwriter_active_top(); 2580 2581 // Add over class so it will work in IE. 2582 $('ul.menu.signwriter-hover li a:not(.active)').hover(function() { 2583 $(this).addClass('over'); 2584 set_signwriter_over_top(this); 2585 }, function() { 2586 $(this).removeClass('over'); 2587 $(this).children('img.signwriter-hover').css('top', 0); 2588 }); 2589 2590 // Set css top values for hover images based on the height of the image 2591 function set_signwriter_over_top(elem) { 2592 var image_height = $(elem).height(); 2593 var over_top = 0 - image_height; 2594 2595 $(elem).children('img.signwriter-hover').css('top', over_top); 2596 } 2597 2598 // Set css top values for active images based on the height of the image 2599 function set_signwriter_active_top() { 2600 var image_height = $('a.active img.signwriter-hover').height(); 2601 var active_top = 0 - ((image_height / 3) * 2); 2602 2603 $('ul.menu.signwriter-hover').find('a.active img.signwriter-hover').css('top', active_top); 2604 } 2605});; 2606/* 2607 * jQuery Cycle Plugin (with Transition Definitions) 2608 * Examples and documentation at: http://jquery.malsup.com/cycle/ 2609 * Copyright (c) 2007-2010 M. Alsup 2610 * Version: 2.88 (08-JUN-2010) 2611 * Dual licensed under the MIT and GPL licenses. 2612 * http://jquery.malsup.com/license.html 2613 * Requires: jQuery v1.2.6 or later 2614 */ 2615(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={};}
2615if(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));}}}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;
2615while((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);}
2615else{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}
2615;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); 2616/* 2617 * jQuery Cycle Plugin Transition Definitions 2618 * This script is a plugin for the jQuery Cycle Plugin 2619 * Examples and documentation at: http://malsup.com/jquery/cycle/ 2620 * Copyright (c) 2007-2010 M. Alsup 2621 * Version: 2.72 2622 * Dual licensed under the MIT and GPL licenses: 2623 * http://www.opensource.org/licenses/mit-license.php 2624 * http://www.gnu.org/licenses/gpl.html 2625 */ 2626(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}
2626;};$.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);
2626var 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);; 2627// $Id: views_slideshow.js,v 1.1.2.1.2.39 2010/07/01 03:29:08 redndahead Exp $ 2628 2629/** 2630 * @file 2631 * A simple jQuery SingleFrame Div Slideshow Rotator. 2632 */ 2633 2634/** 2635 * This will set our initial behavior, by starting up each individual slideshow. 2636 */ 2637Drupal.behaviors.viewsSlideshowSingleFrame = function (context) { 2638 $('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() { 2639 var fullId = '#' + $(this).attr('id'); 2640 var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId]; 2641 settings.targetId = '#' + $(fullId + " :first").attr('id'); 2642 settings.paused = false; 2643 2644 settings.opts = { 2645 speed:settings.speed, 2646 timeout:parseInt(settings.timeout), 2647 delay:parseInt(settings.delay), 2648 sync:settings.sync==1, 2649 random:settings.random==1, 2650 pause:false, 2651 allowPagerClickBubble:(settings.pager_hover==1 || settings.pager_click_to_page), 2652 prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.vss_id:null, 2653 next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.vss_id:null, 2654 pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.vss_id:null, 2655 nowrap:parseInt(settings.nowrap), 2656 pagerAnchorBuilder: function(idx, slide) { 2657 var classes = 'pager-item pager-num-' + (idx+1); 2658 if (idx == 0) { 2659 classes += ' first'; 2660 } 2661 if ($(slide).siblings().length == idx) { 2662 classes += ' last'; 2663 } 2664 2665 if (idx % 2) { 2666 classes += ' odd'; 2667 } 2668 else { 2669 classes += ' even'; 2670 } 2671 2672 var theme = 'viewsSlideshowPager' + settings.pager_type; 2673 return Drupal.theme.prototype[theme] ? Drupal.theme(theme, classes, idx, slide, settings) : ''; 2674 }, 2675 after:function(curr, next, opts) { 2676 // Used for Image Counter. 2677 if (settings.image_count) { 2678 $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.num').html(opts.currSlide + 1); 2679 $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.total').html(opts.slideCount); 2680 } 2681 }, 2682 before:function(curr, next, opts) { 2683 // Remember last slide. 2684 if (settings.remember_slide) { 2685 createCookie(settings.vss_id, opts.currSlide + 1, settings.remember_slide_days); 2686 } 2687 2688 // Make variable height. 2689 if (settings.fixed_height == 0) { 2690 //get the height of the current slide 2691 var $ht = $(this).height(); 2692 //set the container's height to that of the current slide 2693 $(this).parent().animate({height: $ht}); 2694 } 2695 }, 2696 cleartype:(settings.ie.cleartype == 'true')? true : false, 2697 cleartypeNoBg:(settings.ie.cleartypenobg == 'true')? true : false 2698 } 2699 2700 // Set the starting slide if we are supposed to remember the slide 2701 if (settings.remember_slide) { 2702 var startSlide = readCookie(settings.vss_id); 2703 if (startSlide == null) { 2704 startSlide = 0; 2705 } 2706 settings.opts.startingSlide = startSlide; 2707 } 2708 2709 if (settings.pager_hover == 1) { 2710 settings.opts.pagerEvent = 'mouseover'; 2711 settings.opts.pauseOnPagerHover = true; 2712 } 2713 2714 if (settings.effect == 'none') { 2715 settings.opts.speed = 1; 2716 } 2717 else { 2718 settings.opts.fx = settings.effect; 2719 } 2720 2721 // Pause on hover. 2722 if (settings.pause == 1) { 2723 $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).hover(function() { 2724 $(settings.targetId).cycle('pause'); 2725 }, function() { 2726 if (settings.paused == false) { 2727 $(settings.targetId).cycle('resume'); 2728 } 2729 }); 2730 } 2731 2732 // Pause on clicking of the slide. 2733 if (settings.pause_on_click == 1) { 2734 $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).click(function() { 2735 viewsSlideshowSingleFramePause(settings); 2736 }); 2737 } 2738 2739 // Add additional settings. 2740 if (settings.advanced != "\n") { 2741 var advanced = settings.advanced.split("\n"); 2742 for (i=0; i<advanced.length; i++) { 2743 var prop = ''; 2744 var value = ''; 2745 var property = advanced[i].split(":"); 2746 for (j=0; j<property.length; j++) { 2747 if (j == 0) { 2748 prop = property[j]; 2749 } 2750 else if (j == 1) { 2751 value = property[j]; 2752 } 2753 else { 2754 value += ":" + property[j]; 2755 } 2756 } 2757 2758 // Need to evaluate so true, false and numerics aren't a string. 2759 if (value == 'true' || value == 'false' || IsNumeric(value)) { 2760 value = eval(value); 2761 } 2762 else { 2763 // Parse strings into functions. 2764 var func = value.match(/function\s*\((.*?)\)\s*\{(.*)\}/i); 2765 if (func) { 2766 value = new Function(func[1].match(/(\w+)/g), func[2]); 2767 } 2768 } 2769 2770 // Call both functions if prop was set previously. 2771 if (typeof(value) == "function" && prop in settings.opts) {
2772 var callboth = function(before_func, new_func) { 2773 return function() { 2774 before_func.apply(null, arguments); 2775 new_func.apply(null, arguments); 2776 }; 2777 }; 2778 settings.opts[prop] = callboth(settings.opts[prop], value); 2779 } 2780 else { 2781 settings.opts[prop] = value; 2782 } 2783 } 2784 } 2785 2786 $(settings.targetId).cycle(settings.opts); 2787 2788 // Start Paused 2789 if (settings.start_paused) { 2790 viewsSlideshowSingleFramePause(settings); 2791 } 2792 2793 // Pause if hidden. 2794 if (settings.pause_when_hidden) { 2795 var checkPause = function(settings) { 2796 // If the slideshow is visible and it is paused then resume. 2797 // otherwise if the slideshow is not visible and it is not paused then 2798 // pause it. 2799 var visible = viewsSlideshowSingleFrameIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible); 2800 if (visible && settings.paused) { 2801 viewsSlideshowSingleFrameResume(settings); 2802 } 2803 else if (!visible && !settings.paused) { 2804 viewsSlideshowSingleFramePause(settings); 2805 } 2806 } 2807 2808 // Check when scrolled. 2809 $(window).scroll(function() { 2810 checkPause(settings); 2811 }); 2812 2813 // Check when the window is resized. 2814 $(window).resize(function() { 2815 checkPause(settings); 2816 }); 2817 } 2818 2819 // Show image count for people who have js enabled. 2820 $('#views_slideshow_singleframe_image_count_' + settings.vss_id).show(); 2821 2822 if (settings.controls > 0) { 2823 // Show controls for people who have js enabled browsers. 2824 $('#views_slideshow_singleframe_controls_' + settings.vss_id).show(); 2825 2826 $('#views_slideshow_singleframe_playpause_' + settings.vss_id).click(function(e) { 2827 if (settings.paused) { 2828 viewsSlideshowSingleFrameResume(settings); 2829 } 2830 else { 2831 viewsSlideshowSingleFramePause(settings); 2832 } 2833 e.preventDefault(); 2834 }); 2835 } 2836 }); 2837} 2838 2839// Pause the slideshow 2840viewsSlideshowSingleFramePause = function (settings) { 2841 //make Resume translatable 2842 var resume = Drupal.t('Resume'); 2843 2844 $(settings.targetId).cycle('pause'); 2845 if (settings.controls > 0) { 2846 $('#views_slideshow_singleframe_playpause_' + settings.vss_id) 2847 .addClass('views_slideshow_singleframe_play') 2848 .addClass('views_slideshow_play') 2849 .removeClass('views_slideshow_singleframe_pause') 2850 .removeClass('views_slideshow_pause') 2851 .text(resume); 2852 } 2853 settings.paused = true; 2854} 2855 2856// Resume the slideshow 2857viewsSlideshowSingleFrameResume = function (settings) { 2858 $(settings.targetId).cycle('resume'); 2859 if (settings.controls > 0) { 2860 $('#views_slideshow_singleframe_playpause_' + settings.vss_id) 2861 .addClass('views_slideshow_singleframe_pause') 2862 .addClass('views_slideshow_pause') 2863 .removeClass('views_slideshow_singleframe_play') 2864 .removeClass('views_slideshow_play') 2865 .text('Pause'); 2866 } 2867 settings.paused = false; 2868} 2869 2870Drupal.theme.prototype.viewsSlideshowPagerThumbnails = function (classes, idx, slide, settings) { 2871 var href = '#'; 2872 if (settings.pager_click_to_page) { 2873 href = $(slide).find('a').attr('href'); 2874 } 2875 return '<div class="' + classes + '"><a href="' + href + '"><img src="' + $(slide).find('img').attr('src') + '" /></a></div>'; 2876} 2877 2878Drupal.theme.prototype.viewsSlideshowPagerNumbered = function (classes, idx, slide, settings) { 2879 var href = '#'; 2880 if (settings.pager_click_to_page) { 2881 href = $(slide).find('a').attr('href'); 2882 } 2883 return '<div class="' + classes + '"><a href="' + href + '">' + (idx+1) + '</a></div>'; 2884} 2885 2886// Verify that the value is a number. 2887function IsNumeric(sText) { 2888 var ValidChars = "0123456789"; 2889 var IsNumber=true; 2890 var Char; 2891 2892 for (var i=0; i < sText.length && IsNumber == true; i++) { 2893 Char = sText.charAt(i); 2894 if (ValidChars.indexOf(Char) == -1) { 2895 IsNumber = false; 2896 } 2897 } 2898 return IsNumber; 2899} 2900 2901/** 2902 * Cookie Handling Functions 2903 */ 2904function createCookie(name,value,days) { 2905 if (days) { 2906 var date = new Date(); 2907 date.setTime(date.getTime()+(days*24*60*60*1000)); 2908 var expires = "; expires="+date.toGMTString(); 2909 } 2910 else { 2911 var expires = ""; 2912 } 2913 document.cookie = name+"="+value+expires+"; path=/"; 2914} 2915 2916function readCookie(name) { 2917 var nameEQ = name + "="; 2918 var ca = document.cookie.split(';'); 2919 for(var i=0;i < ca.length;i++) { 2920 var c = ca[i]; 2921 while (c.charAt(0)==' ') c = c.substring(1,c.length); 2922 if (c.indexOf(nameEQ) == 0) { 2923 return c.substring(nameEQ.length,c.length); 2924 } 2925 } 2926 return null; 2927} 2928
2929function eraseCookie(name) { 2930 createCookie(name,"",-1); 2931} 2932 2933/** 2934 * Checks to see if the slide is visible enough. 2935 * elem = element to check. 2936 * type = The way to calculate how much is visible. 2937 * amountVisible = amount that should be visible. Either in percent or px. If 2938 * it's not defined then all of the slide must be visible. 2939 * 2940 * Returns true or false 2941 */ 2942function viewsSlideshowSingleFrameIsVisible(elem, type, amountVisible) { 2943 // Get the top and bottom of the window; 2944 var docViewTop = $(window).scrollTop(); 2945 var docViewBottom = docViewTop + $(window).height(); 2946 var docViewLeft = $(window).scrollLeft(); 2947 var docViewRight = docViewLeft + $(window).width(); 2948 2949 // Get the top, bottom, and height of the slide; 2950 var elemTop = $(elem).offset().top; 2951 var elemHeight = $(elem).height(); 2952 var elemBottom = elemTop + elemHeight; 2953 var elemLeft = $(elem).offset().left; 2954 var elemWidth = $(elem).width(); 2955 var elemRight = elemLeft + elemWidth; 2956 var elemArea = elemHeight * elemWidth; 2957 2958 // Calculate what's hiding in the slide. 2959 var missingLeft = 0; 2960 var missingRight = 0; 2961 var missingTop = 0; 2962 var missingBottom = 0; 2963 2964 // Find out how much of the slide is missing from the left. 2965 if (elemLeft < docViewLeft) { 2966 missingLeft = docViewLeft - elemLeft; 2967 } 2968 2969 // Find out how much of the slide is missing from the right. 2970 if (elemRight > docViewRight) { 2971 missingRight = elemRight - docViewRight; 2972 } 2973 2974 // Find out how much of the slide is missing from the top. 2975 if (elemTop < docViewTop) { 2976 missingTop = docViewTop - elemTop; 2977 } 2978 2979 // Find out how much of the slide is missing from the bottom. 2980 if (elemBottom > docViewBottom) { 2981 missingBottom = elemBottom - docViewBottom; 2982 } 2983 2984 // If there is no amountVisible defined then check to see if the whole slide 2985 // is visible. 2986 if (type == 'full') { 2987 return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) 2988 && (elemBottom <= docViewBottom) && (elemTop >= docViewTop) 2989 && (elemLeft >= docViewLeft) && (elemRight <= docViewRight) 2990 && (elemLeft <= docViewRight) && (elemRight >= docViewLeft)); 2991 } 2992 else if(type == 'vertical') { 2993 var verticalShowing = elemHeight - missingTop - missingBottom; 2994 2995 // If user specified a percentage then find out if the current shown percent 2996 // is larger than the allowed percent. 2997 // Otherwise check to see if the amount of px shown is larger than the 2998 // allotted amount. 2999 if (amountVisible.indexOf('%')) { 3000 return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible)); 3001 } 3002 else { 3003 return (verticalShowing >= parseInt(amountVisible)); 3004 } 3005 } 3006 else if(type == 'horizontal') { 3007 var horizontalShowing = elemWidth - missingLeft - missingRight; 3008 3009 // If user specified a percentage then find out if the current shown percent 3010 // is larger than the allowed percent. 3011 // Otherwise check to see if the amount of px shown is larger than the 3012 // allotted amount. 3013 if (amountVisible.indexOf('%')) { 3014 return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible)); 3015 } 3016 else { 3017 return (horizontalShowing >= parseInt(amountVisible)); 3018 } 3019 } 3020 else if(type == 'area') { 3021 var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom); 3022 3023 // If user specified a percentage then find out if the current shown percent 3024 // is larger than the allowed percent. 3025 // Otherwise check to see if the amount of px shown is larger than the 3026 // allotted amount. 3027 if (amountVisible.indexOf('%')) { 3028 return (((areaShowing/elemArea)*100) >= parseInt(amountVisible)); 3029 } 3030 else { 3031 return (areaShowing >= parseInt(amountVisible)); 3032 } 3033 } 3034} 3035 3036; 3037// $Id: views_slideshow.js,v 1.1.2.2.2.35 2010/07/01 03:29:08 redndahead Exp $ 3038 3039/** 3040 * @file 3041 * A simple jQuery ThumbnailHover Div Slideshow Rotator. 3042 */ 3043 3044/** 3045 * This will set our initial behavior, by starting up each individual slideshow. 3046 */ 3047Drupal.behaviors.viewsSlideshowThumbnailHover = function (context) { 3048 $('.views_slideshow_thumbnailhover_main:not(.viewsSlideshowThumbnailHover-processed)', context).addClass('viewsSlideshowThumbnailHover-processed').each(function() { 3049 var fullId = '#' + $(this).attr('id'); 3050 var settings = Drupal.settings.viewsSlideshowThumbnailHover[fullId]; 3051 settings.targetId = '#' + $(fullId + " :first").attr('id'); 3052 settings.paused = false;
3053 3054 settings.opts = { 3055 speed:settings.speed, 3056 timeout:parseInt(settings.timeout), 3057 delay:parseInt(settings.delay), 3058 sync:settings.sync==1, 3059 random:settings.random==1, 3060 pause:false, 3061 allowPagerClickBubble:(settings.pager_event=='click')? false : true, 3062 pager:(settings.pager_event == 'hoverIntent') ? null : '#views_slideshow_breakout_teasers_' + settings.vss_id, 3063 nowrap:parseInt(settings.nowrap), 3064 pagerAnchorBuilder:(settings.pager_event == 'hoverIntent') ? null : function(idx, slide) { 3065 return '#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + idx; 3066 }, 3067 after:function(curr, next, opts) { 3068 // Used for Image Counter. 3069 if (settings.image_count) { 3070 $('#views_slideshow_thumbnailhover_image_count_' + settings.vss_id + ' span.num').html(opts.currSlide + 1); 3071 $('#views_slideshow_thumbnailhover_image_count_' + settings.vss_id + ' span.total').html(opts.slideCount); 3072 } 3073 }, 3074 before:function(current, next, opts) { 3075 // Remember last slide. 3076 if (settings.remember_slide) { 3077 createCookie(settings.view_id, opts.currSlide + 1, settings.remember_slide_days); 3078 } 3079 3080 // Make variable height. 3081 if (settings.fixed_height == 0) { 3082 //get the height of the current slide 3083 var $ht = $(this).height(); 3084 //set the container's height to that of the current slide 3085 $(this).parent().animate({height: $ht}); 3086 } 3087 3088 var currId = (currId=$(current).attr('id')).substring(currId.lastIndexOf('_')+1) 3089 var nextId = (nextId=$(next).attr('id')).substring(nextId.lastIndexOf('_')+1) 3090 $('#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + currId).removeClass('activeSlide'); 3091 $('#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + nextId).addClass('activeSlide'); 3092 }, 3093 pagerEvent: (settings.pager_event == 'hoverIntent') ? null : settings.pager_event, 3094 prev:(settings.controls > 0)?'#views_slideshow_thumbnailhover_prev_' + settings.vss_id:null, 3095 next:(settings.controls > 0)?'#views_slideshow_thumbnailhover_next_' + settings.vss_id:null, 3096 cleartype:(settings.ie.cleartype == 'true')? true : false, 3097 cleartypeNoBg:(settings.ie.cleartypenobg == 'true')? true : false 3098 }; 3099 3100 // Set the starting slide if we are supposed to remember the slide 3101 if (settings.remember_slide) { 3102 var startSlide = readCookie(settings.view_id); 3103 if (startSlide == null) { 3104 startSlide = 0; 3105 } 3106 settings.opts.startingSlide = startSlide; 3107 } 3108 3109 if (settings.effect == 'none') { 3110 settings.opts.speed = 1; 3111 } 3112 else { 3113 settings.opts.fx = settings.effect; 3114 } 3115 3116 // Pause on hover. 3117 if (settings.pause == 1) { 3118 $('#views_slideshow_thumbnailhover_teaser_section_' + settings.vss_id).hover(function() { 3119 $(settings.targetId).cycle('pause'); 3120 }, function() { 3121 if (settings.paused == false) { 3122 $(settings.targetId).cycle('resume'); 3123 } 3124 }); 3125 } 3126 3127 // Pause on clicking of the slide. 3128 if (settings.pause_on_click == 1) { 3129 $('#views_slideshow_thumbnailhover_teaser_section_' + settings.vss_id).click(function() { 3130 viewsSlideshowThumbnailHoverPause(settings); 3131 }); 3132 } 3133 3134 // Add additional settings. 3135 if (settings.advanced != "\n") { 3136 var advanced = settings.advanced.split("\n"); 3137 for (i=0; i<advanced.length; i++) { 3138 var prop = ''; 3139 var value = ''; 3140 var property = advanced[i].split(":"); 3141 for (j=0; j<property.length; j++) { 3142 if (j == 0) { 3143 prop = property[j]; 3144 } 3145 else if (j == 1) { 3146 value = property[j]; 3147 } 3148 else { 3149 value += ":" + property[j]; 3150 } 3151 } 3152 3153 // Need to evaluate so true, false and numerics aren't a string. 3154 if (value == 'true' || value == 'false' || IsNumeric(value)) { 3155 value = eval(value); 3156 } 3157 else { 3158 // Parse strings into functions. 3159 var func = value.match(/function\s*\((.*?)\)\s*\{(.*)\}/i); 3160 if (func) { 3161 value = new Function(func[1].match(/(\w+)/g), func[2]); 3162 } 3163 } 3164 3165 // Call both functions if prop was set previously. 3166 if (typeof(value) == "function" && prop in settings.opts) {
3167 var callboth = function(before_func, new_func) { 3168 return function() { 3169 before_func.apply(null, arguments); 3170 new_func.apply(null, arguments); 3171 }; 3172 }; 3173 settings.opts[prop] = callboth(settings.opts[prop], value); 3174 } 3175 else { 3176 settings.opts[prop] = value; 3177 } 3178 } 3179 } 3180 3181 $(settings.targetId).cycle(settings.opts); 3182 3183 // Start Paused 3184 if (settings.start_paused) { 3185 viewsSlideshowThumbnailHoverPause(settings); 3186 } 3187 3188 // Pause if hidden. 3189 if (settings.pause_when_hidden) { 3190 var checkPause = function(settings) { 3191 // If the slideshow is visible and it is paused then resume. 3192 // otherwise if the slideshow is not visible and it is not paused then 3193 // pause it. 3194 var visible = viewsSlideshowThumbnailHoverIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible); 3195 if (visible && settings.paused) { 3196 viewsSlideshowThumbnailHoverResume(settings); 3197 } 3198 else if (!visible && !settings.paused) { 3199 viewsSlideshowThumbnailHoverPause(settings); 3200 } 3201 } 3202 3203 // Check when scrolled. 3204 $(window).scroll(function() { 3205 checkPause(settings); 3206 }); 3207 3208 // Check when window is resized. 3209 $(window).resize(function() { 3210 checkPause(settings); 3211 }); 3212 } 3213 3214 // Show image count for people who have js enabled. 3215 $('#views_slideshow_thumbnailhover_image_count_' + settings.vss_id).show(); 3216 3217 if (settings.pager_event == 'hoverIntent') { 3218 $('#views_slideshow_thumbnailhover_breakout_teasers_' + settings.vss_id + ' .views_slideshow_thumbnailhover_div_breakout_teaser').each(function(i,obj) { 3219 $(obj).hoverIntent( 3220 function() { 3221 $('.views_slideshow_thumbnailhover_div_breakout_teaser').removeClass('activeSlide'); 3222 var id = $(this).attr('id'); 3223 id = parseInt(id.substring(id.lastIndexOf('_')+1)); 3224 $(settings.targetId).cycle(id); 3225 $('#views_slideshow_thumbnailhover_div_breakout_teaser_' + settings.vss_id + '_' + id).addClass('activeSlide'); 3226 $(settings.targetId).cycle('stop'); 3227 }, 3228 function() { 3229 var id = $(this).attr('id'); 3230 settings.opts.startingSlide = parseInt(id.substring(id.lastIndexOf('_')+1)); 3231 $(settings.targetId).cycle(settings.opts); 3232 } 3233 ); 3234 }); 3235 } 3236 3237 if (settings.controls > 0) { 3238 // Show controls for people who have js enabled browsers. 3239 $('#views_slideshow_thumbnailhover_controls_' + settings.vss_id).show(); 3240 3241 $('#views_slideshow_thumbnailhover_playpause_' + settings.vss_id).click(function(e) { 3242 if (settings.paused) { 3243 viewsSlideshowThumbnailHoverResume(settings); 3244 } 3245 else { 3246 viewsSlideshowThumbnailHoverPause(settings); 3247 } 3248 e.preventDefault(); 3249 }); 3250 } 3251 }); 3252} 3253 3254// Pause the slideshow 3255viewsSlideshowThumbnailHoverPause = function (settings) { 3256 //make Resume translatable 3257 var resume = Drupal.t('Resume'); 3258 3259 $(settings.targetId).cycle('pause'); 3260 if (settings.controls > 0) { 3261 $('#views_slideshow_thumbnailhover_playpause_' + settings.vss_id) 3262 .addClass('views_slideshow_thumbnailhover_play') 3263 .addClass('views_slideshow_play') 3264 .removeClass('views_slideshow_thumbnailhover_pause') 3265 .removeClass('views_slideshow_pause') 3266 .text(resume); 3267 } 3268 settings.paused = true; 3269} 3270 3271// Resume the slideshow 3272viewsSlideshowThumbnailHoverResume = function (settings) { 3273 $(settings.targetId).cycle('resume'); 3274 if (settings.controls > 0) { 3275 $('#views_slideshow_thumbnailhover_playpause_' + settings.vss_id) 3276 .addClass('views_slideshow_thumbnailhover_pause') 3277 .addClass('views_slideshow_pause') 3278 .removeClass('views_slideshow_thumbnailhover_play') 3279 .removeClass('views_slideshow_play') 3280 .text('Pause'); 3281 } 3282 settings.paused = false; 3283} 3284 3285// Verify that the value is a number. 3286function IsNumeric(sText) { 3287 var ValidChars = "0123456789"; 3288 var IsNumber=true; 3289 var Char; 3290 3291 for (var i=0; i < sText.length && IsNumber == true; i++) { 3292 Char = sText.charAt(i); 3293 if (ValidChars.indexOf(Char) == -1) { 3294 IsNumber = false;
3295 } 3296 } 3297 return IsNumber; 3298} 3299 3300/** 3301 * Cookie Handling Functions 3302 */ 3303function createCookie(name,value,days) { 3304 if (days) { 3305 var date = new Date(); 3306 date.setTime(date.getTime()+(days*24*60*60*1000)); 3307 var expires = "; expires="+date.toGMTString(); 3308 } 3309 else { 3310 var expires = ""; 3311 } 3312 document.cookie = name+"="+value+expires+"; path=/"; 3313} 3314 3315function readCookie(name) { 3316 var nameEQ = name + "="; 3317 var ca = document.cookie.split(';'); 3318 for(var i=0;i < ca.length;i++) { 3319 var c = ca[i]; 3320 while (c.charAt(0)==' ') c = c.substring(1,c.length); 3321 if (c.indexOf(nameEQ) == 0) { 3322 return c.substring(nameEQ.length,c.length); 3323 } 3324 } 3325 return null; 3326} 3327 3328function eraseCookie(name) { 3329 createCookie(name,"",-1); 3330} 3331 3332/** 3333 * Checks to see if the slide is visible enough. 3334 * elem = element to check. 3335 * amountVisible = amount that should be visible. Either in percent or px. If 3336 * it's not defined then all of the slide must be visible. 3337 * 3338 * Returns true or false 3339 */ 3340function viewsSlideshowThumbnailHoverIsVisible(elem, type, amountVisible) { 3341 // Get the top and bottom of the window; 3342 var docViewTop = $(window).scrollTop(); 3343 var docViewBottom = docViewTop + $(window).height(); 3344 var docViewLeft = $(window).scrollLeft(); 3345 var docViewRight = docViewLeft + $(window).width(); 3346 3347 // Get the top, bottom, and height of the slide; 3348 var elemTop = $(elem).offset().top; 3349 var elemHeight = $(elem).height(); 3350 var elemBottom = elemTop + elemHeight; 3351 var elemLeft = $(elem).offset().left; 3352 var elemWidth = $(elem).width(); 3353 var elemRight = elemLeft + elemWidth; 3354 var elemArea = elemHeight * elemWidth; 3355 3356 // Calculate what's hiding in the slide. 3357 var missingLeft = 0; 3358 var missingRight = 0; 3359 var missingTop = 0; 3360 var missingBottom = 0; 3361 3362 // Find out how much of the slide is missing from the left. 3363 if (elemLeft < docViewLeft) { 3364 missingLeft = docViewLeft - elemLeft; 3365 } 3366 3367 // Find out how much of the slide is missing from the right. 3368 if (elemRight > docViewRight) { 3369 missingRight = elemRight - docViewRight; 3370 } 3371 3372 // Find out how much of the slide is missing from the top. 3373 if (elemTop < docViewTop) { 3374 missingTop = docViewTop - elemTop; 3375 } 3376 3377 // Find out how much of the slide is missing from the bottom. 3378 if (elemBottom > docViewBottom) { 3379 missingBottom = elemBottom - docViewBottom; 3380 } 3381 3382 // If there is no amountVisible defined then check to see if the whole slide 3383 // is visible. 3384 if (type == 'full') { 3385 return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) 3386 && (elemBottom <= docViewBottom) && (elemTop >= docViewTop) 3387 && (elemLeft >= docViewLeft) && (elemRight <= docViewRight) 3388 && (elemLeft <= docViewRight) && (elemRight >= docViewLeft)); 3389 } 3390 else if(type == 'vertical') { 3391 var verticalShowing = elemHeight - missingTop - missingBottom; 3392 3393 // If user specified a percentage then find out if the current shown percent 3394 // is larger than the allowed percent. 3395 // Otherwise check to see if the amount of px shown is larger than the 3396 // allotted amount. 3397 if (amountVisible.indexOf('%')) { 3398 return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible)); 3399 } 3400 else { 3401 return (verticalShowing >= parseInt(amountVisible)); 3402 } 3403 } 3404 else if(type == 'horizontal') { 3405 var horizontalShowing = elemWidth - missingLeft - missingRight; 3406 3407 // If user specified a percentage then find out if the current shown percent 3408 // is larger than the allowed percent. 3409 // Otherwise check to see if the amount of px shown is larger than the 3410 // allotted amount. 3411 if (amountVisible.indexOf('%')) { 3412 return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible)); 3413 } 3414 else { 3415 return (horizontalShowing >= parseInt(amountVisible)); 3416 } 3417 } 3418 else if(type == 'area') { 3419 var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom); 3420 3421 // If user specified a percentage then find out if the current shown percent 3422 // is larger than the allowed percent. 3423 // Otherwise check to see if the amount of px shown is larger than the 3424 // allotted amount. 3425 if (amountVisible.indexOf('%')) { 3426 return (((areaShowing/elemArea)*100) >= parseInt(amountVisible)); 3427 } 3428 else { 3429 return (areaShowing >= parseInt(amountVisible)); 3430 } 3431 } 3432} 3433;
3434// $Id: base.js,v 1.11.2.1 2010/03/10 20:08:58 merlinofchaos Exp $ 3435/** 3436 * @file base.js 3437 * 3438 * Some basic behaviors and utility functions for Views. 3439 */ 3440 3441Drupal.Views = {}; 3442 3443/** 3444 * jQuery UI tabs, Views integration component 3445 */ 3446Drupal.behaviors.viewsTabs = function (context) { 3447 $('#views-tabset:not(.views-processed)').addClass('views-processed').each(function() { 3448 new Drupal.Views.Tabs($(this), {selectedClass: 'active'}); 3449 }); 3450 3451 $('a.views-remove-link') 3452 .addClass('views-processed') 3453 .click(function() { 3454 var id = $(this).attr('id').replace('views-remove-link-', ''); 3455 $('#views-row-' + id).hide(); 3456 $('#views-removed-' + id).attr('checked', true); 3457 return false; 3458 }); 3459} 3460 3461/** 3462 * For IE, attach some javascript so that our hovers do what they're supposed 3463 * to do. 3464 */ 3465Drupal.behaviors.viewsHoverlinks = function() { 3466 if ($.browser.msie) { 3467 // If IE, attach a hover event so we can see our admin links. 3468 $("div.view:not(.views-hover-processed)").addClass('views-hover-processed').hover( 3469 function() { 3470 $('div.views-hide', this).addClass("views-hide-hover"); return true; 3471 }, 3472 function(){ 3473 $('div.views-hide', this).removeClass("views-hide-hover"); return true; 3474 } 3475 ); 3476 $("div.views-admin-links:not(.views-hover-processed)") 3477 .addClass('views-hover-processed') 3478 .hover( 3479 function() { 3480 $(this).addClass("views-admin-links-hover"); return true; 3481 }, 3482 function(){ 3483 $(this).removeClass("views-admin-links-hover"); return true; 3484 } 3485 ); 3486 } 3487} 3488 3489/** 3490 * Helper function to parse a querystring. 3491 */ 3492Drupal.Views.parseQueryString = function (query) { 3493 var args = {}; 3494 var pos = query.indexOf('?'); 3495 if (pos != -1) { 3496 query = query.substring(pos + 1); 3497 } 3498 var pairs = query.split('&'); 3499 for(var i in pairs) { 3500 var pair = pairs[i].split('='); 3501 // Ignore the 'q' path argument, if present. 3502 if (pair[0] != 'q' && pair[1]) { 3503 args[pair[0]] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); 3504 } 3505 } 3506 return args; 3507}; 3508 3509/** 3510 * Helper function to return a view's arguments based on a path. 3511 */ 3512Drupal.Views.parseViewArgs = function (href, viewPath) { 3513 var returnObj = {}; 3514 var path = Drupal.Views.getPath(href); 3515 // Ensure we have a correct path. 3516 if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') { 3517 var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length)); 3518 returnObj.view_args = args; 3519 returnObj.view_path = path; 3520 } 3521 return returnObj; 3522}; 3523 3524/** 3525 * Strip off the protocol plus domain from an href. 3526 */ 3527Drupal.Views.pathPortion = function (href) { 3528 // Remove e.g. http://example.com if present. 3529 var protocol = window.location.protocol; 3530 if (href.substring(0, protocol.length) == protocol) { 3531 // 2 is the length of the '//' that normally follows the protocol 3532 href = href.substring(href.indexOf('/', protocol.length + 2)); 3533 } 3534 return href; 3535}; 3536 3537/** 3538 * Return the Drupal path portion of an href. 3539 */ 3540Drupal.Views.getPath = function (href) { 3541 href = Drupal.Views.pathPortion(href); 3542 href = href.substring(Drupal.settings.basePath.length, href.length); 3543 // 3 is the length of the '?q=' added to the url without clean urls. 3544 if (href.substring(0, 3) == '?q=') { 3545 href = href.substring(3, href.length); 3546 } 3547 var chars = ['#', '?', '&']; 3548 for (i in chars) { 3549 if (href.indexOf(chars[i]) > -1) { 3550 href = href.substr(0, href.indexOf(chars[i])); 3551 } 3552 } 3553 return href; 3554}; 3555; 3556// $Id: dependent.js,v 1.9.2.1 2009/11/18 02:43:47 merlinofchaos Exp $ 3557/** 3558 * @file dependent.js 3559 * 3560 * Written by dmitrig01 (Dmitri Gaskin) for Views; this provides dependent 3561 * visibility for form items in Views' ajax forms. 3562 * 3563 * To your $form item definition add: 3564 * - '#process' => array('views_process_dependency'), 3565 * - Add '#dependency' => array('id-of-form-item' => array(list, of, values, that, 3566 make, this, item, show), 3567 * 3568 * Special considerations: 3569 * - radios are harder. Because Drupal doesn't give radio groups individual ids, 3570 * use 'radio:name-of-radio' 3571 * 3572 * - Checkboxes don't have their own id, so you need to add one in a div 3573 * around the checkboxes via #prefix and #suffix. You actually need to add TWO 3574 * divs because it's the parent that gets hidden. Also be sure to retain the 3575 * 'expand_checkboxes' in the #process array, because the views process will 3576 * override it. 3577 */ 3578 3579Drupal.Views = Drupal.Views || {}; 3580 3581Drupal.Views.dependent = { bindings: {}, activeBindings: {}, activeTriggers: [] }; 3582 3583Drupal.Views.dependent.inArray = function(array, search_term) { 3584 var i = array.length; 3585 if (i > 0) { 3586 do { 3587 if (array[i] == search_term) { 3588 return true; 3589 } 3590 } while (i--); 3591 } 3592 return false;
3593} 3594 3595 3596Drupal.Views.dependent.autoAttach = function() { 3597 // Clear active bindings and triggers. 3598 for (i in Drupal.Views.dependent.activeTriggers) { 3599 jQuery(Drupal.Views.dependent.activeTriggers[i]).unbind('change'); 3600 } 3601 Drupal.Views.dependent.activeTriggers = []; 3602 Drupal.Views.dependent.activeBindings = {}; 3603 Drupal.Views.dependent.bindings = {}; 3604 3605 if (!Drupal.settings.viewsAjax) { 3606 return; 3607 } 3608 3609 // Iterate through all relationships 3610 for (id in Drupal.settings.viewsAjax.formRelationships) { 3611 3612 // Drupal.Views.dependent.activeBindings[id] is a boolean, 3613 // whether the binding is active or not. Defaults to no. 3614 Drupal.Views.dependent.activeBindings[id] = 0; 3615 // Iterate through all possible values 3616 for(bind_id in Drupal.settings.viewsAjax.formRelationships[id].values) { 3617 // This creates a backward relationship. The bind_id is the ID 3618 // of the element which needs to change in order for the id to hide or become shown. 3619 // The id is the ID of the item which will be conditionally hidden or shown. 3620 // Here we're setting the bindings for the bind 3621 // id to be an empty array if it doesn't already have bindings to it 3622 if (!Drupal.Views.dependent.bindings[bind_id]) { 3623 Drupal.Views.dependent.bindings[bind_id] = []; 3624 } 3625 // Add this ID 3626 Drupal.Views.dependent.bindings[bind_id].push(id); 3627 // Big long if statement. 3628 // Drupal.settings.viewsAjax.formRelationships[id].values[bind_id] holds the possible values 3629 3630 if (bind_id.substring(0, 6) == 'radio:') { 3631 var trigger_id = "input[name='" + bind_id.substring(6) + "']"; 3632 } 3633 else { 3634 var trigger_id = '#' + bind_id; 3635 } 3636 3637 Drupal.Views.dependent.activeTriggers.push(trigger_id); 3638 3639 if (jQuery(trigger_id).attr('type') == 'checkbox') { 3640 $(trigger_id).parent().addClass('hidden-options'); 3641 } 3642 3643 var getValue = function(item, trigger) { 3644 if (item.substring(0, 6) == 'radio:') { 3645 var val = jQuery(trigger + ':checked').val(); 3646 } 3647 else { 3648 switch (jQuery(trigger).attr('type')) { 3649 case 'checkbox': 3650 var val = jQuery(trigger).attr('checked') || 0; 3651 3652 if (val) { 3653 $(trigger).parent().removeClass('hidden-options').addClass('expanded-options'); 3654 } 3655 else { 3656 $(trigger).parent().removeClass('expanded-options').addClass('hidden-options'); 3657 } 3658 3659 break; 3660 default: 3661 var val = jQuery(trigger).val(); 3662 } 3663 } 3664 return val; 3665 } 3666 3667 var setChangeTrigger = function(trigger_id, bind_id) { 3668 // Triggered when change() is clicked. 3669 var changeTrigger = function() { 3670 var val = getValue(bind_id, trigger_id); 3671 3672 for (i in Drupal.Views.dependent.bindings[bind_id]) { 3673 var id = Drupal.Views.dependent.bindings[bind_id][i]; 3674 3675 // Fix numerous errors 3676 if (typeof id != 'string') { 3677 continue; 3678 } 3679 3680 // This bit had to be rewritten a bit because two properties on the 3681 // same set caused the counter to go up and up and up. 3682 if (!Drupal.Views.dependent.activeBindings[id]) { 3683 Drupal.Views.dependent.activeBindings[id] = {}; 3684 } 3685 3686 if (Drupal.Views.dependent.inArray(Drupal.settings.viewsAjax.formRelationships[id].values[bind_id], val)) { 3687 Drupal.Views.dependent.activeBindings[id][bind_id] = 'bind'; 3688 } 3689 else { 3690 delete Drupal.Views.dependent.activeBindings[id][bind_id]; 3691 } 3692 3693 var len = 0; 3694 for (i in Drupal.Views.dependent.activeBindings[id]) { 3695 len++; 3696 } 3697 3698 var object = jQuery('#' + id + '-wrapper'); 3699 if (!object.size()) { 3700 object = jQuery('#' + id).parent(); 3701 } 3702 3703 var rel_num = Drupal.settings.viewsAjax.formRelationships[id].num; 3704 if (typeof rel_num === 'object') { 3705 rel_num = Drupal.settings.viewsAjax.formRelationships[id].num[0]; 3706 } 3707 3708 if (rel_num <= len) { 3709 // Show if the element if criteria is matched 3710 object.show(0); 3711 object.addClass('dependent-options'); 3712 } 3713 else { 3714 // Otherwise hide 3715 object.hide(0); 3716 } 3717 } 3718 } 3719 3720 jQuery(trigger_id).change(function() {
3721 // Trigger the internal change function 3722 // the attr('id') is used because closures are more confusing 3723 changeTrigger(trigger_id, bind_id); 3724 }); 3725 // Trigger initial reaction 3726 changeTrigger(trigger_id, bind_id); 3727 } 3728 setChangeTrigger(trigger_id, bind_id); 3729 } 3730 } 3731} 3732 3733Drupal.behaviors.viewsDependent = function (context) { 3734 Drupal.Views.dependent.autoAttach(); 3735 3736 // Really large sets of fields are too slow with the above method, so this 3737 // is a sort of hacked one that's faster but much less flexible. 3738 $("select.views-master-dependent:not(.views-processed)") 3739 .addClass('views-processed') 3740 .change(function() { 3741 var val = $(this).val(); 3742 if (val == 'all') { 3743 $('.views-dependent-all').show(0); 3744 } 3745 else { 3746 $('.views-dependent-all').hide(0); 3747 $('.views-dependent-' + val).show(0); 3748 } 3749 }) 3750 .trigger('change'); 3751} 3752; 3753/* 3754 * jqModal - Minimalist Modaling with jQuery 3755 * (http://dev.iceburg.net/jquery/jqModal/) 3756 * 3757 * Copyright (c) 2007,2008 Brice Burgess <[email protected]> 3758 * Dual licensed under the MIT and GPL licenses: 3759 * http://www.opensource.org/licenses/mit-license.php 3760 * http://www.gnu.org/licenses/gpl.html 3761 * 3762 * $Version: 07/06/2008 +r13 3763 */ 3764(function($) { 3765$.fn.jqm=function(o){ 3766var p={ 3767overlay: 50, 3768overlayClass: 'jqmOverlay', 3769closeClass: 'jqmClose', 3770trigger: '.jqModal', 3771ajax: F, 3772ajaxText: '', 3773target: F, 3774modal: F, 3775toTop: F, 3776onShow: F, 3777onHide: F, 3778onLoad: F 3779}; 3780return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s; 3781H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s}; 3782if(p.trigger)$(this).jqmAddTrigger(p.trigger); 3783});}; 3784 3785$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');}; 3786$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');}; 3787$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t);});}; 3788$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)});}; 3789 3790$.jqm = { 3791hash:{}, 3792open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z); 3793 if(c.modal) {if(!A[0])L('bind');A.push(s);} 3794 else if(c.overlay > 0)h.w.jqmAddClose(o); 3795 else o=F; 3796 3797 h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F; 3798 if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}} 3799 3800 if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u; 3801 r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});} 3802 else if(cc)h.w.jqmAddClose($(cc,h.w)); 3803 3804 if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o); 3805 (c.onShow)?c.onShow(h):h.w.show();e(h);return F; 3806}, 3807close:function(s){var h=H[s];if(!h.a)return F;h.a=F; 3808 if(A[0]){A.pop();if(!A[0])L('unbind');} 3809 if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove(); 3810 if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F; 3811}, 3812params:{}}; 3813var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false, 3814i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}), 3815e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);}, 3816f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}}, 3817L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);}, 3818m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;}, 3819hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() { 3820 if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});}; 3821})(jQuery);; 3822jQuery(document).ready(function(){ 3823 /** get settings **/ 3824 var bText = Drupal.settings.uc_ajax_cart.text ; 3825 var disabled = Drupal.settings.uc_ajax_cart.disable ; 3826 var bclass = Drupal.settings.uc_ajax_cart.bclass ; 3827 3828 jQuery(this).find('input.ajax-submit-form,button.ajax-submit-form').bind('click',function(e){ 3829 var $form = jQuery(this).parents('form').eq(0); 3830 var callbackID = $form.attr('id'); 3831 if ( $form.find('input[@name=uc-ajax-cart-callback]').length == 0 ) 3832 { 3833 $form.append('<input type="hidden" value="'+callbackID+'" name="uc-ajax-cart-callback" />') 3834 } 3835 var d = $form.formToArray(); 3836 var tagName = this.tagName ; 3837 var button = jQuery(this); 3838 if ( bText != false ) 3839 { 3840 if ( tagName == "BUTTON" ) 3841 { 3842 button.attr('oldTitle',button.html()); 3843 button.html(bText); 3844 } 3845 else 3846 { 3847 button.attr('oldTitle',button.attr("value")); 3848 button.attr('value',bText); 3849 } 3850 } 3851 button.addClass(bclass); 3852 if ( disabled == 1 ) 3853 { 3854 button.css({display : 'none'}); 3855 button.after('<div class="ajax-cart-msg">' + bText + '</div>'); 3856 } 3857 jQuery.getJSON( Drupal.settings.basePath + 'cart/ajax/update',d,updateAjaxCart); 3858 return false;
3859 }); 3860}) 3861 3862function showAjaxCartMessage(content) 3863{ 3864 if ( jQuery('#ucAjaxCartErrorMsg').length == 0 ) 3865 { 3866 jQuery('body').append('<div class="jqmWindow" id="ucAjaxCartErrorMsg"></div>') ; 3867 } 3868 jQuery('#ucAjaxCartErrorMsg').empty().append(content).jqm().jqmShow(); 3869} 3870 3871function updateAjaxCart(data,responseType) 3872{ 3873 var $uEle = jQuery('#ajaxCartUpdate').eq(0); 3874 var form_id = data.form_id; 3875 var bText = Drupal.settings.uc_ajax_cart.text ; 3876 var bclass = Drupal.settings.uc_ajax_cart.bclass ; 3877 3878 var effects = Drupal.settings.uc_ajax_cart.effects; 3879 if ( typeof collapsed_block != "undefined" 3880 && collapsed_block == true) 3881 { 3882 cart_block_toggle(); 3883 } 3884 3885 jQuery('#' + form_id).find('div.ajax-cart-msg').remove(); 3886 jQuery('#' + form_id).find('input.ajax-submit-form,button.ajax-submit-form').eq(0).show().removeClass(bclass).removeAttr('disabled').each(function(){ 3887 if ( bText != false ) 3888 { 3889 if ( this.tagName == "INPUT" ) this.value = jQuery(this).attr('oldTitle'); 3890 else jQuery(this).html(jQuery(this).attr('oldTitle')); 3891 } 3892 }); 3893 if ( data.success == false ) 3894 { 3895 showAjaxCartMessage(data.content); 3896 return ; 3897 } 3898 if ( effects == true ) 3899 { 3900 jQuery('#ajaxCartUpdate').effect('highlight',{},500); 3901 } 3902 $uEle.empty().html(data.content); 3903 jQuery('body').css({cursor : 'default'}); 3904} 3905; 3906/*! 3907* jQuery Form Plugin 3908* version: 2.43 (12-MAR-2010) 3909* @requires jQuery v1.3.2 or later 3910* 3911* Examples and documentation at: http://malsup.com/jquery/form/ 3912* Dual licensed under the MIT and GPL licenses: 3913* http://www.opensource.org/licenses/mit-license.php 3914* http://www.gnu.org/licenses/gpl.html 3915*/ 3916(function(b){function o(){if(b.fn.ajaxSubmit.debug){var a="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log)window.console.log(a);else window.opera&&window.opera.postError&&window.opera.postError(a)}}b.fn.ajaxSubmit=function(a){function d(){function r(){var p=h.attr("target"),n=h.attr("action");j.setAttribute("target",z);j.getAttribute("method")!="POST"&&j.setAttribute("method","POST");j.getAttribute("action")!=g.url&&j.setAttribute("action",g.url);g.skipEncodingOverride|| 3917h.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});g.timeout&&setTimeout(function(){C=true;s()},g.timeout);var m=[];try{if(g.extraData)for(var u in g.extraData)m.push(b('<input type="hidden" name="'+u+'" value="'+g.extraData[u]+'" />').appendTo(j)[0]);t.appendTo("body");t.data("form-plugin-onload",s);j.submit()}finally{j.setAttribute("action",n);p?j.setAttribute("target",p):h.removeAttr("target");b(m).remove()}}function s(){if(!D){var p=true;try{if(C)throw"timeout";var n,m;m=v.contentWindow? 3918v.contentWindow.document:v.contentDocument?v.contentDocument:v.document;var u=g.dataType=="xml"||m.XMLDocument||b.isXMLDoc(m);o("isXml="+u);if(!u&&(m.body==null||m.body.innerHTML=="")){if(--G){o("requeing onLoad callback, DOM not available");setTimeout(s,250);return}o("Could not access iframe DOM after 100 tries.");return}o("response detected");D=true;i.responseText=m.body?m.body.innerHTML:null;i.responseXML=m.XMLDocument?m.XMLDocument:m;i.getResponseHeader=function(H){return{"content-type":g.dataType}[H]}; 3919if(g.dataType=="json"||g.dataType=="script"){var E=m.getElementsByTagName("textarea")[0];if(E)i.responseText=E.value;else{var F=m.getElementsByTagName("pre")[0];if(F)i.responseText=F.innerHTML}}else if(g.dataType=="xml"&&!i.responseXML&&i.responseText!=null)i.responseXML=A(i.responseText);n=b.httpData(i,g.dataType)}catch(B){o("error caught:",B);p=false;i.error=B;b.handleError(g,i,"error",B)}if(p){g.success(n,"success");w&&b.event.trigger("ajaxSuccess",[i,g])}w&&b.event.trigger("ajaxComplete",[i,g]); 3920w&&!--b.active&&b.event.trigger("ajaxStop");if(g.complete)g.complete(i,p?"success":"error");setTimeout(function(){t.removeData("form-plugin-onload");t.remove();i.responseXML=null},100)}}function A(p,n){if(window.ActiveXObject){n=new ActiveXObject("Microsoft.XMLDOM");n.async="false";n.loadXML(p)}else n=(new DOMParser).parseFromString(p,"text/xml");return n&&n.documentElement&&n.documentElement.tagName!="parsererror"?n:null}var j=h[0];if(b(":input[name=submit]",j).length)alert('Error: Form elements must not be named "submit".'); 3921else{var g=b.extend({},b.ajaxSettings,a),q=b.extend(true,{},b.extend(true,{},b.ajaxSettings),g),z="jqFormIO"+(new Date).getTime(),t=b('<iframe id="'+z+'" name="'+z+'" src="'+g.iframeSrc+'" onload="(jQuery(this).data(\'form-plugin-onload\'))()" />'),v=t[0];t.css({position:"absolute",top:"-1000px",left:"-1000px"});var i={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted= 39221;t.attr("src",g.iframeSrc)}},w=g.global;
3922w&&!b.active++&&b.event.trigger("ajaxStart");w&&b.event.trigger("ajaxSend",[i,g]);if(q.beforeSend&&q.beforeSend(i,q)===false)q.global&&b.active--;else if(!i.aborted){var D=false,C=0;if(q=j.clk){var y=q.name;if(y&&!q.disabled){g.extraData=g.extraData||{};g.extraData[y]=q.value;if(q.type=="image"){g.extraData[y+".x"]=j.clk_x;g.extraData[y+".y"]=j.clk_y}}}g.forceSync?r():setTimeout(r,10);var G=100}}}if(!this.length){o("ajaxSubmit: skipping submit process - no element selected"); 3923return this}if(typeof a=="function")a={success:a};var e=b.trim(this.attr("action"));if(e)e=(e.match(/^([^#]+)/)||[])[1];e=e||window.location.href||"";a=b.extend({url:e,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},a||{});e={};this.trigger("form-pre-serialize",[this,a,e]);if(e.veto){o("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(a.beforeSerialize&&a.beforeSerialize(this,a)===false){o("ajaxSubmit: submit aborted via beforeSerialize callback"); 3924return this}var f=this.formToArray(a.semantic);if(a.data){a.extraData=a.data;for(var c in a.data)if(a.data[c]instanceof Array)for(var l in a.data[c])f.push({name:c,value:a.data[c][l]});else f.push({name:c,value:a.data[c]})}if(a.beforeSubmit&&a.beforeSubmit(f,this,a)===false){o("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[f,this,a,e]);if(e.veto){o("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}c=b.param(f);if(a.type.toUpperCase()== 3925"GET"){a.url+=(a.url.indexOf("?")>=0?"&":"?")+c;a.data=null}else a.data=c;var h=this,k=[];a.resetForm&&k.push(function(){h.resetForm()});a.clearForm&&k.push(function(){h.clearForm()});if(!a.dataType&&a.target){var x=a.success||function(){};k.push(function(r){var s=a.replaceTarget?"replaceWith":"html";b(a.target)[s](r).each(x,arguments)})}else a.success&&k.push(a.success);a.success=function(r,s,A){for(var j=0,g=k.length;j<g;j++)k[j].apply(a,[r,s,A||h,h])};c=b("input:file",this).fieldValue();l=false; 3926for(e=0;e<c.length;e++)if(c[e])l=true;if(c.length&&a.iframe!==false||a.iframe||l||0)a.closeKeepAlive?b.get(a.closeKeepAlive,d):d();else b.ajax(a);this.trigger("form-submit-notify",[this,a]);return this};b.fn.ajaxForm=function(a){return this.ajaxFormUnbind().bind("submit.form-plugin",function(d){d.preventDefault();b(this).ajaxSubmit(a)}).bind("click.form-plugin",function(d){var e=d.target,f=b(e);if(!f.is(":submit,input:image")){e=f.closest(":submit");if(e.length==0)return;e=e[0]}var c=this;c.clk=e; 3927if(e.type=="image")if(d.offsetX!=undefined){c.clk_x=d.offsetX;c.clk_y=d.offsetY}else if(typeof b.fn.offset=="function"){f=f.offset();c.clk_x=d.pageX-f.left;c.clk_y=d.pageY-f.top}else{c.clk_x=d.pageX-e.offsetLeft;c.clk_y=d.pageY-e.offsetTop}setTimeout(function(){c.clk=c.clk_x=c.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(a){var d=[];if(this.length==0)return d;var e=this[0],f=a?e.getElementsByTagName("*"):e.elements; 3928if(!f)return d;for(var c=0,l=f.length;c<l;c++){var h=f[c],k=h.name;if(k)if(a&&e.clk&&h.type=="image"){if(!h.disabled&&e.clk==h){d.push({name:k,value:b(h).val()});d.push({name:k+".x",value:e.clk_x},{name:k+".y",value:e.clk_y})}}else if((h=b.fieldValue(h,true))&&h.constructor==Array)for(var x=0,r=h.length;x<r;x++)d.push({name:k,value:h[x]});else h!==null&&typeof h!="undefined"&&d.push({name:k,value:h})}if(!a&&e.clk){a=b(e.clk);f=a[0];if((k=f.name)&&!f.disabled&&f.type=="image"){d.push({name:k,value:a.val()}); 3929d.push({name:k+".x",value:e.clk_x},{name:k+".y",value:e.clk_y})}}return d};b.fn.formSerialize=function(a){return b.param(this.formToArray(a))};b.fn.fieldSerialize=function(a){var d=[];this.each(function(){var e=this.name;if(e){var f=b.fieldValue(this,a);if(f&&f.constructor==Array)for(var c=0,l=f.length;c<l;c++)d.push({name:e,value:f[c]});else f!==null&&typeof f!="undefined"&&d.push({name:this.name,value:f})}});return b.param(d)};b.fn.fieldValue=function(a){for(var d=[],e=0,f=this.length;e<f;e++){var c= 3930b.fieldValue(this[e],a);c===null||typeof c=="undefined"||c.constructor==Array&&!c.length||(c.constructor==Array?b.merge(d,c):d.push(c))}return d};b.fieldValue=function(a,d){var e=a.name,f=a.type,c=a.tagName.toLowerCase();if(typeof d=="undefined")d=true;if(d&&(!e||a.disabled||f=="reset"||f=="button"||(f=="checkbox"||f=="radio")&&!a.checked||(f=="submit"||f=="image")&&a.form&&a.form.clk!=a||c=="select"&&a.selectedIndex==-1))return null;if(c=="select"){c=a.selectedIndex;if(c<0)return null;d=[];a=a.options; 3931e=(f=f=="select-one")?c+1:a.length;for(c=f?c:0;c<e;c++){var l=a[c];if(l.selected){var h=l.value;h||(h=l.attributes&&l.attributes.value&&!l.attributes.value.specified?l.text:l.value);if(f)return h;d.push(h)}}return d}return a.value};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var a=this.type,d=this.tagName.toLowerCase();if(a=="text"||a=="password"||d=="textarea")this.value= 3932"";else if(a=="checkbox"||a=="radio")this.checked=false;else if(d=="select")this.selectedIndex=-1})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};
3932b.fn.enable=function(a){if(a==undefined)a=true;return this.each(function(){this.disabled=!a})};b.fn.selected=function(a){if(a==undefined)a=true;return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio")this.checked=a;else if(this.tagName.toLowerCase()== 3933"option"){d=b(this).parent("select");a&&d[0]&&d[0].type=="select-one"&&d.find("option").selected(false);this.selected=a}})}})(jQuery); 3934;
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.