PageSourceSearch

https://www.gruppostudium.it/sites/default/files/js/js_05f809c024537cc14043f0b92a9033f6.js

js gruppostudium.it collected 2026-09-24 11:54:14 UTC 232,669 bytes, 3,839 lines download raw bytes

1/*
2 * jQuery JavaScript Library v1.3.2
3 * http://jquery.com/
4 *
5 * Copyright (c) 2009 John Resig
6 * Dual licensed under the MIT and GPL licenses.
7 * http://docs.jquery.com/License
8 *
9 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
10 * Revision: 6246
11 */
12(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})}
12,css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})}
12,remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?
120:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];
12if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
13/*
14 * Sizzle CSS Selector Engine - v0.9.3
15 *  Copyright 2009, The Dojo Foundation
16 *  Released under the MIT, BSD, and GPL Licenses.
17 *  More information: http://sizzlejs.com/
18 */
19(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*
19)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}
19if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCo
19de clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}
19o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();
19if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["o
19pacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;
19if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.
19clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();;
20
21/**
22 * Override jQuery.fn.init to guard against XSS attacks.
23 *
24 * See http://bugs.jquery.com/ticket/9521
25 */
26(function () {
27  var jquery_init = jQuery.fn.init;
28  jQuery.fn.init = function (selector, context, rootjQuery) {
29    // If the string contains a "#" before a "<", treat it as invali
29d HTML.
30    if (selector && typeof selector === 'string') {
31      var hash_position = selector.indexOf('#');
32      if (hash_position >= 0) {
33        var bracket_position = selector.indexOf('<');
34        if (bracket_position > hash_position) {
35          throw 'Syntax error, unrecognized expression: ' + selector;
36        }
37      }
38    }
39    return jquery_init.call(this, selector, context, rootjQuery);
40  };
41  jQuery.fn.init.prototype = jquery_init.prototype;
42})();
43
44var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
45
46/**
47 * Set the variable that indicates if JavaScript behaviors should be applied
48 */
49Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;
50
51/**
52 * Attach all registered behaviors to a page element.
53 *
54 * Behaviors are event-triggered actions that attach to page elements, enhancing
55 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
56 * object as follows:
57 * @code
58 *    Drupal.behaviors.behaviorName = function () {
59 *      ...
60 *    };
61 * @endcode
62 *
63 * Drupal.attachBehaviors is added below to the jQuery ready event and so
64 * runs on initial page load. Developers implementing AHAH/AJAX in their
65 * solutions should also call this function after new page content has been
66 * loaded, feeding in an element to be processed, in order to attach all
67 * behaviors to the new content.
68 *
69 * Behaviors should use a class in the form behaviorName-processed to ensure
70 * the behavior is attached only once to a given element. (Doing so enables
71 * the reprocessing of given elements, which may be needed on occasion despite
72 * the ability to limit behavior attachment to a particular element.)
73 *
74 * @param context
75 *   An element to attach behaviors to. If none is given, the document element
76 *   is used.
77 */
78Drupal.attachBehaviors = function(context) {
79  context = context || document;
80  if (Drupal.jsEnabled) {
81    // Execute all of them.
82    jQuery.each(Drupal.behaviors, function() {
83      this(context);
84    });
85  }
86};
87
88/**
89 * Encode special characters in a plain-text string for display as HTML.
90 */
91Drupal.checkPlain = function(str) {
92  str = String(str);
93  var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
94  for (var character in replace) {
95    var regex = new RegExp(character, 'g');
96    str = str.replace(regex, replace[character]);
97  }
98  return str;
99};
100
101/**
102 * Translate strings to the page language or a given language.
103 *
104 * See the documentation of the server-side t() function for further details.
105 *
106 * @param str
107 *   A string containing the English string to translate.
108 * @param args
109 *   An object of replacements pairs to make after translation. Incidences
110 *   of any key in this array are replaced with the corresponding value.
111 *   Based on the first character of the key, the value is escaped and/or themed:
112 *    - !variable: inserted as is
113 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
114 *    - %variable: escape text and theme as a placeholder for user-submitted
115 *      content (checkPlain + Drupal.theme('placeholder'))
116 * @return
117 *   The translated string.
118 */
119Drupal.t = function(str, args) {
120  // Fetch the localized version of the string.
121  if (Drupal.locale.strings && Drupal.locale.strings[str]) {
122    str = Drupal.locale.strings[str];
123  }
124
125  if (args) {
126    // Transform arguments before inserting them
127    for (var key in args) {
128      switch (key.charAt(0)) {
129        // Escaped only
130        case '@':
131          args[key] = Drupal.checkPlain(args[key]);
132        break;
133        // Pass-through
134        case '!':
135          break;
136        // Escaped and placeholder
137        case '%':
138        default:
139          args[key] = Drupal.theme('placeholder', args[key]);
140          break;
141      }
142      str = str.replace(key, args[key]);
143    }
144  }
145  return str;
146};
147
148/**
149 * Format a string containing a count of items.
150 *
151 * This function ensures that the string is pluralized correctly. Since Drupal.t() is
152 * called by this function, make sure not to pass already-localized strings to it.
153 *
154 * See the documentation of the server-side format_plural() function for further details.
155 *
156 * @param count
157 *   The item count to display.
158 * @param singular
159 *   The string for the singular case. Please make sure it is clear this is
160 *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
161 *   Do not use @count in the singular string.
162 * @param plural
163 *   The string for the plural case. Please make sure it is clear this is plural,
164 *   to ease translation. Use @count in place of the item count, as in "@count
165 *   new comments".
166 * @param args
167 *   An object of replacements pairs to make after translation. Incidences
168 *   of any key in this array are replaced with the corresponding value.
169 *   Based on the first character of the key, the value is escaped and/or themed:
170 *    - !variable: inserted as is
171 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
172 *    - %variable: escape text and theme as a placeholder for user-submitted
173 *      content (checkPlain + Drupal.theme('placeholder'))
174 *   Note that you do not need to include @count in this array.
175 *   This replacement is done automatically for the plural case.
176 * @return
177 *   A translated string.
178 */
179Drupal.formatPlural = function(count, singular, plural, args) {
180  var args = args || {};
181  args['@count'] = count;
182  // Determine the index of the plural form.
183  var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
184
185  if (index == 0) {
186    return Drupal.t(singular, args);
187  }
188  else if (index == 1) {
189    return Drupal.t(plural, args);
190  }
191  else {
192    args['@count['+ index +']'] = args['@count'];
193    delete args['@count'];
194    return Drupal.t(plural.replace('@count', '@count['+ index +']'), args);
195  }
196};
197
198/**
199 * Generate the themed representation of a Drupal object.
200 *
201 * All requests for themed output must go through this function. It examines
202 * the request and routes it to the appropriate theme function. If the current
203 * theme does not provide an override function, the generic theme function is
204 * called.
205 *
206 * For example, to retrieve the HTML that is output by theme_placeholder(text),
207 * call Drupal.theme('placeholder', text).
208 *
209 * @param func
210 *   The name of the theme function to call.
211 * @param ...
212 *   Additional arguments to pass along to the theme function.
213 * @return
214 *   Any data the theme function returns. This could be a plain HTML string,
215 *   but also a complex object.
216 */
217Drupal.theme = function(func) {
218  for (var i = 1, args = []; i < arguments.length; i++) {
219    args.push(arguments[i]);
220  }
221
222  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
223};
224
225/**
226 * Parse a JSON response.
227 *
228 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
229 */
230Drupal.parseJson = function (data) {
231  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
232    return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') };
233  }
234  return eval('(' + data + ');');
235};
236
237/**
238 * Freeze the current body height (as minimum height). Used to prevent
239 * unnecessary upwards scrolling when doing DOM manipulations.
240 */
241Drupal.freezeHeight = function () {
242  Drupal.unfreezeHeight();
243  var div = document.createElement('div');
244  $(div).css({
245    position: 'absolute',
246    top: '0px',
247    left: '0px',
248    width: '1px',
249    height: $('body').css('height')
250  }).attr('id', 'freeze-height');
251  $('body').append(div);
252};
253
254/**
255 * Unfreeze the body height
256 */
257Drupal.unfreezeHeight = function () {
258  $('#freeze-height').remove();
259};
260
261/**
262 * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of
263 * drupal_urlencode() in PHP). This function should only be used on paths, not
264 * on query string arguments.
265 */
266Drupal.encodeURIComponent = function (item, uri) {
267  uri = uri || location.href;
268  item = encodeURIComponent(item).replace(/%2F/g, '/');
269  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
270};
271
272/**
273 * Get the text selection in a textarea.
274 */
275Drupal.getSelection = function (element) {
276  if (typeof(element.selectionStart) != 'number' && document.selection) {
277    // The current selection
278    var range1 = document.selection.createRange();
279    var range2 = range1.duplicate();
280    // Select all text.
281    range2.moveToElementText(element);
282    // Now move 'dummy' end point to end point of original range.
283    range2.setEndPoint('EndToEnd', range1);
284    // Now we can calculate start and end points.
285    var start = range2.text.length - range1.text.length;
286    var end = start + range1.text.length;
287    return { 'start': start, 'end': end };
288  }
289  return { 'start': element.selectionStart, 'end': element.selectionEnd };
290};
291
292/**
293 * Build an error message from ahah response.
294 */
295Drupal.ahahError = function(xmlhttp, uri) {
296  if (xmlhttp.status == 200) {
297    if (jQuery.trim($(xmlhttp.responseText).text())) {
298      var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText });
299    }
300    else {
301      var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText });
302    }
303  }
304  else {
305    var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
306  }
307  return message;
308}
309
310// Global Killswitch on the <html> element
311if (Drupal.jsEnabled) {
312  // Global Killswitch on the <html> element
313  $(document.documentElement).addClass('js');
314  // 'js enabled' cookie
315  document.cookie = 'has_js=1; path=/';
316  // Attach all behaviors.
317  $(document).ready(function() {
318    Drupal.attachBehaviors(this);
319  });
320}
321
322/**
323 * The default themes.
324 */
325Drupal.theme.prototype = {
326
327  /**
328   * Formats text for emphasized display in a placeholder inside a sentence.
329   *
330   * @param str
331   *   The text to format (plain-text).
332   * @return
333   *   The formatted text (html).
334   */
335  placeholder: function(str) {
336    return '<em>' + Drupal.checkPlain(str) + '</em>';
337  }
338};
339;
340Drupal.locale = { 'pluralFormula': function($n) { return Number(($n!=1)); }, 'strings': { "Cancel": "Annulla", "Edit": "Modifica", "none": "nessuno", "Upload": "Upload", "Your server has been successfully tested to support this feature.": "Il vostro server ha superato con successo il test per supportare questa funzione.", "Your system configuration does not currently support this feature. The \x3ca href=\"http://drupal.org/node/15365\"\x3ehandbook page on Clean URLs\x3c/a\x3e has additional troubleshooting information.": "La configurazione del vostro sistema attualmente non supporta questa funzione. La pagina del \x3ca href=\"http://drupal.org/node/15365\"\x3emanuale sugli URL semplificati\x3c/a\x3e c
340ontiene informazioni aggiuntive per la soluzione dei problemi.", "Testing clean URLs...": "Controllo degli URL semplificati in corso...", "Only files with the following extensions are allowed: %files-allowed.": "Sono consentiti solo i file con le seguenti estensioni: %files-allowed.", "Select all rows in this table": "Seleziona tutte le righe in questa tabella", "Deselect all rows in this table": "Deseleziona tutte le righe in questa tabella", "Join summary": "Unisci il sommario", "Split summary at cursor": "Dividi il sommario nella posizione del cursore", "Drag to re-order": "Trascina per riordinare", "Changes made in this table will not be saved until the form is submitted.": "I cambiamenti fatti a questa tabella non saranno salvati finchè il form non viene inviato.", "Unspecified error": "Errore non specificato", "Continue": "Continua", "The changes to these blocks will not be saved until the \x3cem\x3eSave blocks\x3c/em\x3e button is clicked.": "I cambiamenti a questi blocchi non saranno salvati finché il bottone \x3cem\x3eSalva blocchi\x3c/em\x3e è cliccato.", "Disable": "Disabilita", "Next": "Avanti", "An error occurred at @path.": "Si è verificato un errore in @path.", "jQuery UI Tabs: Mismatching fragment identifier.": "UI Schede jQuery: indentificatore frammenti discrepanti.", "jQuery UI Tabs: Not enough arguments to add tab.": "UI Schede jQuery: non ci sono argomenti a sufficienza per aggiungere una scheda.", "Save and send": "Salva ed invia", "Save and send test": "Salva e invia Email di prova", "Directory": "Cartella", "Close": "Chiudi", "unlimited": "illimitati", "Are you sure you want to remove this item?": "Sicuro di voler rimuovere questa voce?", "Per favore aggiorna i costi di spedizione, cliccando sull\\\'apposito pulsante.": "Per favore aggiorna i costi di spedizione, cliccando sull\' apposito pulsante. ", "Out of stock": "Prodotto esaurito" } };;
341/* $Id: lightbox.js,v 1.1 2012/01/13 16:42:10 fabiola.bellio Exp $ */
342
343/**
344 * jQuery Lightbox
345 * @author
346 *   Stella Power, <http://drupal.org/user/66894>
347 *
348 * Based on Lightbox v2.03.3 by Lokesh Dhakar
349 * <http://www.huddletogether.com/projects/lightbox2/>
350 * Also partially based on the jQuery Lightbox by Warren Krewenki
351 *   <http://warren.mesozen.com>
352 *
353 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module
354 * maintainers to distribute this file via Drupal.org
355 * Under GPL license.
356 *
357 * Slideshow, iframe and video functionality added by Stella Power.
358 */
359
360var Lightbox = {
361  auto_modal : false,
362  overlayOpacity : 0.8, // Controls transparency of shadow overlay.
363  overlayColor : '000', // Controls colour of shadow overlay.
364  disableCloseClick : true,
365  // Controls the order of the lightbox resizing animation sequence.
366  resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width.
367  resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation.
368  fadeInSpeed: 'normal', // Controls the speed of the image appearance.
369  slideDownSpeed: 'slow', // Controls the speed of the image details appearance.
370  minWidth: 240,
371  borderSize : 10,
372  boxColor : 'fff',
373  fontColor : '000',
374  topPosition : '',
375  infoHeight: 20,
376  alternative_layout : false,
377  imageArray : [],
378  imageNum : null,
379  total : 0,
380  activeImage : null,
381  inprogress : false,
382  disableResize : false,
383  disableZoom : false,
384  isZoomedIn : false,
385  rtl : false,
386  loopItems : false,
387  keysClose : ['c', 'x', 27],
388  keysPrevious : ['p', 37],
389  keysNext : ['n', 39],
390  keysZoom : ['z'],
391  keysPlayPause : [32],
392
393  // Slideshow options.
394  slideInterval : 5000, // In milliseconds.
395  showPlayPause : true,
396  autoStart : true,
397  autoExit : true,
398  pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked.
399  pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked.
400  slideIdArray : [],
401  slideIdCount : 0,
402  isSlideshow : false,
403  isPaused : false,
404  loopSlides : false,
405
406  // Iframe options.
407  isLightframe : false,
408  iframe_width : 600,
409  iframe_height : 400,
410  iframe_border : 1,
411
412  // Video and modal options.
413  enableVideo : false,
414  flvPlayer : '/flvplayer.swf',
415  flvFlashvars : '',
416  isModal : false,
417  isVideo : false,
418  videoId : false,
419  modalWidth : 400,
420  modalHeight : 400,
421  modalHTML : null,
422
423
424  // initialize()
425  // Constructor runs on completion of the DOM loading.
426  // The function inserts html at the bottom of the page which is used
427  // to display the shadow overlay and the image container.
428  initialize: function() {
429
430    var s = Drupal.settings.lightbox2;
431    Lightbox.overlayOpacity = s.overlay_opacity;
432    Lightbox.overlayColor = s.overlay_color;
433    Lightbox.disableCloseClick = s.disable_close_click;
434    Lightbox.resizeSequence = s.resize_sequence;
435    Lightbox.resizeSpeed = s.resize_speed;
436    Lightbox.fadeInSpeed = s.fade_in_speed;
437    Lightbox.slideDownSpeed = s.slide_down_speed;
438    Lightbox.borderSize = s.border_size;
439    Lightbox.boxColor = s.box_color;
440    Lightbox.fontColor = s.font_color;
441    Lightbox.topPosition = s.top_position;
442    Lightbox.rtl = s.rtl;
443    Lightbox.loopItems = s.loop_items;
444    Lightbox.keysClose = s.keys_close.split(" ");
445    Lightbox.keysPrevious = s.keys_previous.split(" ");
446    Lightbox.keysNext = s.keys_next.split(" ");
447    Lightbox.keysZoom = s.keys_zoom.split(" ");
448    Lightbox.keysPlayPause = s.keys_play_pause.split(" ");
449    Lightbox.disableResize = s.disable_resize;
450    Lightbox.disableZoom = s.disable_zoom;
451    Lightbox.slideInterval = s.slideshow_interval;
452    Lightbox.showPlayPause = s.show_play_pause;
453    Lightbox.showCaption = s.show_caption;
454    Lightbox.autoStart = s.slideshow_automatic_start;
455    Lightbox.autoExit = s.slideshow_automatic_exit;
456    Lightbox.pauseOnNextClick = s.pause_on_next_click;
457    Lightbox.pauseOnPrevClick = s.pause_on_previous_click;
458    Lightbox.loopSlides = s.loop_slides;
459    Lightbox.alternative_layout = s.use_alt_layout;
460    Lightbox.iframe_width = s.iframe_width;
461    Lightbox.iframe_height = s.iframe_height;
462    Lightbox.iframe_border = s.iframe_border;
463    Lightbox.enableVideo = s.enable_video;
464    if (s.enable_video) {
465      Lightbox.flvPlayer = s.flvPlayer;
466      Lightbox.flvFlashvars = s.flvFlashvars;
467    }
468
469    // Make the lightbox divs.
470    var layout_class = (s.use_alt_layout ? 'lightbox2-alt-layout' : 'lightbox2-orig-layout');
471    var output = '<div id="lightbox2-overlay" style="display: none;"></div>\
472      <div id="lightbox" style="display: none;" class="' + layout_class + '">\
473        <div id="outerImageContainer"></div>\
474        <div id="imageDataContainer" class="clearfix">\
475          <div id="imageData"></div>\
476        </div>\
477      </div>';
478    var loading = '<div id="loading"><a href="#" id="loadingLink"></a></div>';
479    var modal = '<div id="modalContainer" style="display: none;"></div>';
480    var frame = '<div id="frameContainer" style="display: none;"></div>';
481    var imageContainer = '<div id="imageContainer" style="display: none;"></div>';
482    var details = '<div id="imageDetails"></div>';
483    var bottomNav = '<div id="bottomNav"></div>';
484    var image = '<img id="lightboxImage" alt="" />';
485    var hoverNav = '<div id="hoverNav"><a id="prevLink" href="#"></a><a id="nextLink" href="#"></a></div>';
486    var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" href="#"></a><a id="frameNextLink" href="#"></a></div>';
487    var hoverNav = '<div id="hoverNav"><a id="prevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="nextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>';
488    var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" title="' + Drupal.t('Previous') + '" href="#"></a><a id="frameNextLink" title="' + Drupal.t('Next') + '" href="#"></a></div>';
489    var caption = '<span id="caption"></span>';
490    var numberDisplay = '<span id="numberDisplay"></span>';
491    var close = '<a id="bottomNavClose" title="' + Drupal.t('Close') + '" href="#"></a>';
492    var zoom = '<a id="bottomNavZoom" href="#"></a>';
493    var zoomOut = '<a id="bottomNavZoomOut" href="#"></a>';
494    var pause = '<a id="lightshowPause" title="' + Drupal.t('Pause Slideshow') + '" href="#" style="display: none;"></a>';
495    var play = '<a id="lightshowPlay" title="' + Drupal.t('Play Slideshow') + '" href="#" style="display: none;"></a>';
496
497    $("body").append(output);
498    $('#outerImageContainer').append(modal + frame + imageContainer + loading);
499    if (!s.use_alt_layout) {
500      $('#imageContainer').append(image + hoverNav);
501      $('#imageData').append(details + bottomNav);
502      $('#imageDetails').append(caption + numberDisplay);
503      $('#bottomNav').append(frameNav + close + zoom + zoomOut + pause + play);
504    }
505    else {
506      $('#outerImageContainer').append(bottomNav);
507      $('#imageContainer').append(image);
508      $('#bottomNav').append(close + zoom + zoomOut);
509      $('#imageData').append(hoverNav + details);
510      $('#imageDetails').append(caption + numberDisplay + pause + play);
511    }
512
513    // Setup onclick handlers.
514    if (Lightbox.disableCloseClick) {
515      $('#lightbox2-overlay').click(function() { Lightbox.end(); return false; } ).hide();
516    }
517    $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } );
518    $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } );
519    $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } );
520    $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } );
521    $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } );
522    $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } );
523    $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } );
524
525    // Fix positioning.
526    $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'});
527    $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'});
528    $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor});
529    if (Lightbox.alternative_layout) {
530      $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'});
531    }
532    else if (Lightbox.rtl == 1 && $.browser.msie) {
533      $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'});
534    }
535
536    // Force navigation links to always be displayed
537    if (s.force_show_nav) {
538      $('#prevLink, #nextLink').addClass("force_show_nav");
539    }
540
541  },
542
543  // initList()
544  // Loops through anchor tags looking for 'lightbox', 'lightshow' and
545  // 'lightframe', etc, references and applies onclick events to appropriate
546  // links. You can rerun after dynamically adding images w/ajax.
547  initList : function(context) {
548
549    if (context == undefined || context == null) {
550      context = document;
551    }
552
553    // Attach lightbox to any links with rel 'lightbox', 'lightshow' or
554    // 'lightframe', etc.
555    $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
556      if (Lightbox.disableCloseClick) {
557        $('#lightbox').unbind('click');
558        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
559      }
560      Lightbox.start(this, false, false, false, false);
561      if (e.preventDefault) { e.preventDefault(); }
562      return false;
563    });
564    $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
565      if (Lightbox.disableCloseClick) {
566        $('#lightbox').unbind('click');
567        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
568      }
569      Lightbox.start(this, true, false, false, false);
570      if (e.preventDefault) { e.preventDefault(); }
571      return false;
572    });
573    $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
574      if (Lightbox.disableCloseClick) {
575        $('#lightbox').unbind('click');
576        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
577      }
578      Lightbox.start(this, false, true, false, false);
579      if (e.preventDefault) { e.preventDefault(); }
580      return false;
581    });
582    if (Lightbox.enableVideo) {
583      $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
584        if (Lightbox.disableCloseClick) {
585          $('#lightbox').unbind('click');
586          $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
587        }
588        Lightbox.start(this, false, false, true, false);
589        if (e.preventDefault) { e.preventDefault(); }
590        return false;
591      });
592    }
593    $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
594      $('#lightbox').unbind('click');
595      // Add classes from the link to the lightbox div - don't include lightbox-processed
596      $('#lightbox').addClass($(this).attr('class'));
597      $('#lightbox').removeClass('lightbox-processed');
598      Lightbox.start(this, false, false, false, true);
599      if (e.preventDefault) { e.preventDefault(); }
600      return false;
601    });
602    $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) {
603      Lightbox.auto_modal = true;
604      $('#lightbox').unbind('click');
605      Lightbox.start(this, false, false, false, true);
606      if (e.preventDefault) { e.preventDefault(); }
607      return false;
608    });
609  },
610
611  // start()
612  // Display overlay and lightbox. If image is part of a set, add siblings to
613  // imageArray.
614  start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) {
615
616    Lightbox.isPaused = !Lightbox.autoStart;
617
618    // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2.
619    Lightbox.toggleSelectsFlash('hide');
620
621    // Stretch overlay to fill page and fade in.
622    var arrayPageSize = Lightbox.getPageSize();
623    $("#lightbox2-overlay").hide().css({
624      'width': '100%',
625      'zIndex': '10090',
626      'height': arrayPageSize[1] + 'px',
627      'backgroundColor' : '#' + Lightbox.overlayColor
628    });
629    // Detect OS X FF2 opacity + flash issue.
630    if (lightvideo && this.detectMacFF2()) {
631      $("#lightbox2-overlay").removeClass("overlay_default");
632      $("#lightbox2-overlay").addClass("overlay_macff2");
633      $("#lightbox2-overlay").css({'opacity' : null});
634    }
635    else {
636      $("#lightbox2-overlay").removeClass("overlay_macff2");
637      $("#lightbox2-overlay").addClass("overlay_default");
638      $("#lightbox2-overlay").css({'opacity' : Lightbox.overlayOpacity});
639    }
640    $("#lightbox2-overlay").fadeIn(Lightbox.fadeInSpeed);
641
642
643    Lightbox.isSlideshow = slideshow;
644    Lightbox.isLightframe = lightframe;
645    Lightbox.isVideo = lightvideo;
646    Lightbox.isModal = lightmodal;
647    Lightbox.imageArray = [];
648    Lightbox.imageNum = 0;
649
650    var anchors = $(imageLink.tagName);
651    var anchor = null;
652    var rel_parts = Lightbox.parseRel(imageLink);
653    var rel = rel_parts["rel"];
654    var rel_group = rel_parts["group"];
655    var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title);
656    var rel_style = null;
657    var i = 0;
658
659    if (rel_parts["flashvars"]) {
660      Lightbox.flvFlashvars = Lightbox.flvFlashvars + '&' + rel_parts["flashvars"];
661    }
662
663    // Set the title for image alternative text.
664    var alt = imageLink.title;
665    if (!alt) {
666      var img = $(imageLink).find("img");
667      if (img && $(img).attr("alt")) {
668        alt = $(img).attr("alt");
669      }
670      else {
671        alt = title;
672      }
673    }
674
675    if ($(imageLink).attr('id') == 'lightboxAutoModal') {
676      rel_style = rel_parts["style"];
677      Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]);
678    }
679    else {
680      // Handle lightbox images with no grouping.
681      if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {
682        Lightbox.imageArray.push([imageLink.href, title, alt]);
683      }
684
685      // Handle other items with no grouping.
686      else if (!rel_group) {
687        rel_style = rel_parts["style"];
688        Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
689      }
690
691      // Handle grouped items.
692      else {
693
694        // Loop through anchors and add them to imageArray.
695        for (i = 0; i < anchors.length; i++) {
696          anchor = anchors[i];
697          if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) {
698            var rel_data = Lightbox.parseRel(anchor);
699            var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title);
700            img_alt = anchor.title;
701            if (!img_alt) {
702              var anchor_img = $(anchor).find("img");
703              if (anchor_img && $(anchor_img).attr("alt")) {
704                img_alt = $(anchor_img).attr("alt");
705              }
706              else {
707                img_alt = title;
708              }
709            }
710            if (rel_data["rel"] == rel) {
711              if (rel_data["group"] == rel_group) {
712                if (Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) {
713                  rel_style = rel_data["style"];
714                }
715                Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]);
716              }
717            }
718          }
719        }
720
721        // Remove duplicates.
722        for (i = 0; i < Lightbox.imageArray.length; i++) {
723          for (j = Lightbox.imageArray.length-1; j > i; j--) {
724            if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) {
725              Lightbox.imageArray.splice(j,1);
726            }
727          }
728        }
729        while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) {
730          Lightbox.imageNum++;
731        }
732      }
733    }
734
735    if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) {
736      $('#lightshowPlay').show();
737      $('#lightshowPause').hide();
738    }
739
740    // Calculate top and left offset for the lightbox.
741    var arrayPageScroll = Lightbox.getPageScroll();
742    var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
743    var lightboxLeft = arrayPageScroll[0];
744    $('#frameContainer, #modalContainer, #lightboxImage').hide();
745    $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
746    $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();
747    $('#outerImageContainer').css({'width': '250px', 'height': '250px'});
748    $('#lightbox').css({
749      'zIndex': '10500',
750      'top': lightboxTop + 'px',
751      'left': lightboxLeft + 'px'
752    }).show();
753
754    Lightbox.total = Lightbox.imageArray.length;
755    Lightbox.changeData(Lightbox.imageNum);
756  },
757
758  // changeData()
759  // Hide most elements and preload image in preparation for resizing image
760  // container.
761  changeData: function(imageNum, zoomIn) {
762
763    if (Lightbox.inprogress === false) {
764      if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) {
765        if (imageNum >= Lightbox.total) imageNum = 0;
766        if (imageNum < 0) imageNum = Lightbox.total - 1;
767      }
768
769      if (Lightbox.isSlideshow) {
770        for (var i = 0; i < Lightbox.slideIdCount; i++) {
771          window.clearTimeout(Lightbox.slideIdArray[i]);
772        }
773      }
774      Lightbox.inprogress = true;
775      Lightbox.activeImage = imageNum;
776
777      if (Lightbox.disableResize && !Lightbox.isSlideshow) {
778        zoomIn = true;
779      }
780      Lightbox.isZoomedIn = zoomIn;
781
782
783      // Hide elements during transition.
784      $('#loading').css({'zIndex': '10500'}).show();
785      if (!Lightbox.alternative_layout) {
786        $('#imageContainer').hide();
787      }
788      $('#frameContainer, #modalContainer, #lightboxImage').hide();
789      $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
790      $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();
791
792      // Preload image content, but not iframe pages.
793      if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) {
794        $("#lightbox #imageDataContainer").removeClass('lightbox2-alt-layout-data');
795        imgPreloader = new Image();
796        imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); };
797
798        imgPreloader.onload = function() {
799          var photo = document.getElementById('lightboxImage');
800          photo.src = Lightbox.imageArray[Lightbox.activeImage][0];
801          photo.alt = Lightbox.imageArray[Lightbox.activeImage][2];
802
803          var imageWidth = imgPreloader.width;
804          var imageHeight = imgPreloader.height;
805
806          // Resize code.
807          var arrayPageSize = Lightbox.getPageSize();
808          var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) };
809          var orig = { w:imgPreloader.width, h:imgPreloader.height };
810
811          // Image is very large, so show a smaller version of the larger image
812          // with zoom button.
813          if (zoomIn !== true) {
814            var ratio = 1.0; // Shrink image with the same aspect.
815            $('#bottomNavZoomOut, #bottomNavZoom').hide();
816            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
817              ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h;
818              if (!Lightbox.disableZoom && !Lightbox.isSlideshow) {
819                $('#bottomNavZoom').css({'zIndex': '10500'}).show();
820              }
821            }
822
823            imageWidth  = Math.floor(orig.w * ratio);
824            imageHeight = Math.floor(orig.h * ratio);
825          }
826
827          else {
828            $('#bottomNavZoom').hide();
829            // Only display zoom out button if the image is zoomed in already.
830            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
831              // Only display zoom out button if not a slideshow and if the
832              // buttons aren't disabled.
833              if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) {
834                $('#bottomNavZoomOut').css({'zIndex': '10500'}).show();
835              }
836            }
837          }
838
839          photo.style.width = (imageWidth) + 'px';
840          photo.style.height = (imageHeight) + 'px';
841          Lightbox.resizeContainer(imageWidth, imageHeight);
842
843          // Clear onLoad, IE behaves irratically with animated gifs otherwise.
844          imgPreloader.onload = function() {};
845        };
846
847        imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
848        imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2];
849      }
850
851      // Set up frame size, etc.
852      else if (Lightbox.isLightframe) {
853        $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data');
854        var src = Lightbox.imageArray[Lightbox.activeImage][0];
855        $('#frameContainer').html('<iframe id="lightboxFrame" style="display: none;" src="'+src+'"></iframe>');
856
857        // Enable swf support in Gecko browsers.
858        if ($.browser.mozilla && src.indexOf('.swf') != -1) {
859          setTimeout(function () {
860            document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
861          }, 1000);
862        }
863
864        if (!Lightbox.iframe_border) {
865          $('#lightboxFrame').css({'border': 'none'});
866          $('#lightboxFrame').attr('frameborder', '0');
867        }
868        var iframe = document.getElementById('lightboxFrame');
869        var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3];
870        iframe = Lightbox.setStyles(iframe, iframeStyles);
871        Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));
872      }
873      else if (Lightbox.isVideo || Lightbox.isModal) {
874        $("#lightbox #imageDataContainer").addClass('lightbox2-alt-layout-data');
875        var container = document.getElementById('modalContainer');
876        var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3];
877        container = Lightbox.setStyles(container, modalStyles);
878        if (Lightbox.isVideo) {
879          Lightbox.modalHeight =  parseInt(container.height, 10) - 10;
880          Lightbox.modalWidth =  parseInt(container.width, 10) - 10;
881          Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]);
882        }
883        Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10));
884      }
885    }
886  },
887
888  // imgNodeLoadingError()
889  imgNodeLoadingError: function(image) {
890    var s = Drupal.settings.lightbox2;
891    var original_image = Lightbox.imageArray[Lightbox.activeImage][0];
892    if (s.display_image_size !== "") {
893      original_image = original_image.replace(new RegExp("."+s.display_image_size), "");
894    }
895    Lightbox.imageArray[Lightbox.activeImage][0] = original_image;
896    image.onerror = function() { Lightbox.imgLoadingError(image); };
897    image.src = original_image;
898  },
899
900  // imgLoadingError()
901  imgLoadingError: function(image) {
902    var s = Drupal.settings.lightbox2;
903    Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image;
904    image.src = s.default_image;
905  },
906
907  // resizeContainer()
908  resizeContainer: function(imgWidth, imgHeight) {
909
910    imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth);
911
912    this.widthCurrent = $('#outerImageContainer').width();
913    this.heightCurrent = $('#outerImageContainer').height();
914
915    var widthNew = (imgWidth  + (Lightbox.borderSize * 2));
916    var heightNew = (imgHeight  + (Lightbox.borderSize * 2));
917
918    // Scalars based on change from old to new.
919    this.xScale = ( widthNew / this.widthCurrent) * 100;
920    this.yScale = ( heightNew / this.heightCurrent) * 100;
921
922    // Calculate size difference between new and old image, and resize if
923    // necessary.
924    wDiff = this.widthCurrent - widthNew;
925    hDiff = this.heightCurrent - heightNew;
926
927    $('#modalContainer').css({'width': imgWidth, 'height': imgHeight});
928    // Detect animation sequence.
929    if (Lightbox.resizeSequence) {
930      var animate1 = {width: widthNew};
931      var animate2 = {height: heightNew};
932      if (Lightbox.resizeSequence == 2) {
933        animate1 = {height: heightNew};
934        animate2 = {width: widthNew};
935      }
936      $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
937    }
938    // Simultaneous.
939    else {
940      $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
941    }
942
943    // If new and old image are same size and no scaling transition is necessary
944    // do a quick pause to prevent image flicker.
945    if ((hDiff === 0) && (wDiff === 0)) {
946      if ($.browser.msie) {
947        Lightbox.pause(250);
948      }
949      else {
950        Lightbox.pause(100);
951      }
952    }
953
954    var s = Drupal.settings.lightbox2;
955    if (!s.use_alt_layout) {
956      $('#prevLink, #nextLink').css({'height': imgHeight + 'px'});
957    }
958    $('#imageDataContainer').css({'width': widthNew + 'px'});
959  },
960
961  // showData()
962  // Display image and begin preloading neighbors.
963  showData: function() {
964    $('#loading').hide();
965
966    if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) {
967      Lightbox.updateDetails();
968      if (Lightbox.isLightframe) {
969        $('#frameContainer').show();
970        if ($.browser.safari || Lightbox.fadeInSpeed === 0) {
971          $('#lightboxFrame').css({'zIndex': '10500'}).show();
972        }
973        else {
974          $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
975        }
976      }
977      else {
978        if (Lightbox.isVideo) {
979          $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show();
980        }
981        else {
982          var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);
983          if (Lightbox.imageArray[Lightbox.activeImage][4]) {
984            $(src).appendTo("#modalContainer");
985            $('#modalContainer').css({'zIndex': '10500'}).show();
986          }
987          else {
988            // Use a callback to show the new image, otherwise you get flicker.
989            $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();});
990          }
991          $('#modalContainer').unbind('click');
992        }
993        // This might be needed in the Lightframe section above.
994        //$('#modalContainer').css({'zIndex': '10500'}).show();
995      }
996    }
997
998    // Handle display of image content.
999    else {
1000      $('#imageContainer').show();
1001      if ($.browser.safari || Lightbox.fadeInSpeed === 0) {
1002        $('#lightboxImage').css({'zIndex': '10500'}).show();
1003      }
1004      else {
1005        $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
1006      }
1007      Lightbox.updateDetails();
1008      this.preloadNeighborImages();
1009    }
1010    Lightbox.inprogress = false;
1011
1012    // Slideshow specific stuff.
1013    if (Lightbox.isSlideshow) {
1014      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
1015        if (Lightbox.autoExit) {
1016          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval);
1017        }
1018      }
1019      else {
1020        if (!Lightbox.isPaused && Lightbox.total > 1) {
1021          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval);
1022        }
1023      }
1024      if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) {
1025        $('#lightshowPause').show();
1026        $('#lightshowPlay').hide();
1027      }
1028      else if (Lightbox.showPlayPause && Lightbox.total > 1) {
1029        $('#lightshowPause').hide();
1030        $('#lightshowPlay').show();
1031      }
1032    }
1033
1034    // Adjust the page overlay size.
1035    var arrayPageSize = Lightbox.getPageSize();
1036    var arrayPageScroll = Lightbox.getPageScroll();
1037    var pageHeight = arrayPageSize[1];
1038    if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) {
1039      var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
1040      pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop;
1041    }
1042    $('#lightbox2-overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'});
1043
1044    // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as
1045    // expected.
1046    if ($.browser.mozilla) {
1047      if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) {
1048        setTimeout(function () {
1049          document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
1050        }, 1000);
1051      }
1052    }
1053  },
1054
1055  // updateDetails()
1056  // Display caption, image number, and bottom nav.
1057  updateDetails: function() {
1058
1059    $("#imageDataContainer").hide();
1060
1061    var s = Drupal.settings.lightbox2;
1062
1063    if (s.show_caption) {
1064      var caption = Lightbox.filterXSS(Lightbox.imageArray[Lightbox.activeImage][1]);
1065      if (!caption) caption = '';
1066      $('#caption').html(caption).css({'zIndex': '10500'}).show();
1067    }
1068
1069    // If image is part of set display 'Image x of x'.
1070    var numberDisplay = null;
1071    if (s.image_count && Lightbox.total > 1) {
1072      var currentImage = Lightbox.activeImage + 1;
1073      if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) {
1074        numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1075      }
1076      else if (Lightbox.isVideo) {
1077        numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1078      }
1079      else {
1080        numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1081      }
1082      $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show();
1083    }
1084    else {
1085      $('#numberDisplay').hide();
1086    }
1087
1088    $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() {
1089      $("#bottomNav").show();
1090    });
1091    if (Lightbox.rtl == 1) {
1092      $("#bottomNav").css({'float': 'left'});
1093    }
1094    Lightbox.updateNav();
1095  },
1096
1097  // updateNav()
1098  // Display appropriate previous and next hover navigation.
1099  updateNav: function() {
1100
1101    $('#hoverNav').css({'zIndex': '10500'}).show();
1102    var prevLink = '#prevLink';
1103    var nextLink = '#nextLink';
1104
1105    // Slideshow is separated as we need to show play / pause button.
1106    if (Lightbox.isSlideshow) {
1107      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) {
1108        $(prevLink).css({'zIndex': '10500'}).show().click(function() {
1109          if (Lightbox.pauseOnPrevClick) {
1110            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1111          }
1112          Lightbox.changeData(Lightbox.activeImage - 1); return false;
1113        });
1114      }
1115      else {
1116        $(prevLink).hide();
1117      }
1118
1119      // If not last image in set, display next image button.
1120      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) {
1121        $(nextLink).css({'zIndex': '10500'}).show().click(function() {
1122          if (Lightbox.pauseOnNextClick) {
1123            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1124          }
1125          Lightbox.changeData(Lightbox.activeImage + 1); return false;
1126        });
1127      }
1128      // Safari browsers need to have hide() called again.
1129      else {
1130        $(nextLink).hide();
1131      }
1132    }
1133
1134    // All other types of content.
1135    else {
1136
1137      if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) {
1138        $('#frameHoverNav').css({'zIndex': '10500'}).show();
1139        $('#hoverNav').css({'zIndex': '10500'}).hide();
1140        prevLink = '#framePrevLink';
1141        nextLink = '#frameNextLink';
1142      }
1143
1144      // If not first image in set, display prev image button.
1145      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) {
1146        // Unbind any other click handlers, otherwise this adds a new click handler
1147        // each time the arrow is clicked.
1148        $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() {
1149          Lightbox.changeData(Lightbox.activeImage - 1); return false;
1150        });
1151      }
1152      // Safari browsers need to have hide() called again.
1153      else {
1154        $(prevLink).hide();
1155      }
1156
1157      // If not last image in set, display next image button.
1158      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) {
1159        // Unbind any other click handlers, otherwise this adds a new click handler
1160        // each time the arrow is clicked.
1161        $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() {
1162          Lightbox.changeData(Lightbox.activeImage + 1); return false;
1163        });
1164      }
1165      // Safari browsers need to have hide() called again.
1166      else {
1167        $(nextLink).hide();
1168      }
1169    }
1170
1171    // Don't enable keyboard shortcuts so forms will work.
1172    if (!Lightbox.isModal) {
1173      this.enableKeyboardNav();
1174    }
1175  },
1176
1177
1178  // enableKeyboardNav()
1179  enableKeyboardNav: function() {
1180    $(document).bind("keydown", this.keyboardAction);
1181  },
1182
1183  // disableKeyboardNav()
1184  disableKeyboardNav: function() {
1185    $(document).unbind("keydown", this.keyboardAction);
1186  },
1187
1188  // keyboardAction()
1189  keyboardAction: function(e) {
1190    if (e === null) { // IE.
1191      keycode = event.keyCode;
1192      escapeKey = 27;
1193    }
1194    else { // Mozilla.
1195      keycode = e.keyCode;
1196      escapeKey = e.DOM_VK_ESCAPE;
1197    }
1198
1199    key = String.fromCharCode(keycode).toLowerCase();
1200
1201    // Close lightbox.
1202    if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) {
1203      Lightbox.end('forceClose');
1204    }
1205    // Display previous image (p, <-).
1206    else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) {
1207      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) {
1208        Lightbox.changeData(Lightbox.activeImage - 1);
1209      }
1210
1211    }
1212    // Display next image (n, ->).
1213    else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) {
1214      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) {
1215        Lightbox.changeData(Lightbox.activeImage + 1);
1216      }
1217    }
1218    // Zoom in.
1219    else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) {
1220      if (Lightbox.isZoomedIn) {
1221        Lightbox.changeData(Lightbox.activeImage, false);
1222      }
1223      else if (!Lightbox.isZoomedIn) {
1224        Lightbox.changeData(Lightbox.activeImage, true);
1225      }
1226      return false;
1227    }
1228    // Toggle play / pause (space).
1229    else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) {
1230
1231      if (Lightbox.isPaused) {
1232        Lightbox.togglePlayPause("lightshowPlay", "lightshowPause");
1233      }
1234      else {
1235        Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1236      }
1237      return false;
1238    }
1239  },
1240
1241  preloadNeighborImages: function() {
1242
1243    if ((Lightbox.total - 1) > Lightbox.activeImage) {
1244      preloadNextImage = new Image();
1245      preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0];
1246    }
1247    if (Lightbox.activeImage > 0) {
1248      preloadPrevImage = new Image();
1249      preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0];
1250    }
1251
1252  },
1253
1254  end: function(caller) {
1255    var closeClick = (caller == 'slideshow' ? false : true);
1256    if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) {
1257      return;
1258    }
1259    // To prevent double clicks on navigation links.
1260    if (Lightbox.inprogress === true && caller != 'forceClose') {
1261      return;
1262    }
1263    Lightbox.disableKeyboardNav();
1264    $('#lightbox').hide();
1265    $("#lightbox2-overlay").fadeOut();
1266    Lightbox.isPaused = true;
1267    Lightbox.inprogress = false;
1268    // Replaces calls to showSelectBoxes() and showFlash() in original
1269    // lightbox2.
1270    Lightbox.toggleSelectsFlash('visible');
1271    if (Lightbox.isSlideshow) {
1272      for (var i = 0; i < Lightbox.slideIdCount; i++) {
1273        window.clearTimeout(Lightbox.slideIdArray[i]);
1274      }
1275      $('#lightshowPause, #lightshowPlay').hide();
1276    }
1277    else if (Lightbox.isLightframe) {
1278      $('#frameContainer').empty().hide();
1279    }
1280    else if (Lightbox.isVideo || Lightbox.isModal) {
1281      if (!Lightbox.auto_modal) {
1282        $('#modalContainer').hide().html("");
1283      }
1284      Lightbox.auto_modal = false;
1285    }
1286  },
1287
1288
1289  // getPageScroll()
1290  // Returns array with x,y page scroll values.
1291  // Core code from - quirksmode.com.
1292  getPageScroll : function() {
1293
1294    var xScroll, yScroll;
1295
1296    if (self.pageYOffset || self.pageXOffset) {
1297      yScroll = self.pageYOffset;
1298      xScroll = self.pageXOffset;
1299    }
1300    else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {  // Explorer 6 Strict.
1301      yScroll = document.documentElement.scrollTop;
1302      xScroll = document.documentElement.scrollLeft;
1303    }
1304    else if (document.body) {// All other Explorers.
1305      yScroll = document.body.scrollTop;
1306      xScroll = document.body.scrollLeft;
1307    }
1308
1309    arrayPageScroll = [xScroll,yScroll];
1310    return arrayPageScroll;
1311  },
1312
1313  // getPageSize()
1314  // Returns array with page width, height and window width, height.
1315  // Core code from - quirksmode.com.
1316  // Edit for Firefox by pHaez.
1317
1318  getPageSize : function() {
1319
1320    var xScroll, yScroll;
1321
1322    if (window.innerHeight && window.scrollMaxY) {
1323      xScroll = window.innerWidth + window.scrollMaxX;
1324      yScroll = window.innerHeight + window.scrollMaxY;
1325    }
1326    else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac.
1327      xScroll = document.body.scrollWidth;
1328      yScroll = document.body.scrollHeight;
1329    }
1330    else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari.
1331      xScroll = document.body.offsetWidth;
1332      yScroll = document.body.offsetHeight;
1333    }
1334
1335    var windowWidth, windowHeight;
1336
1337    if (self.innerHeight) { // All except Explorer.
1338      if (document.documentElement.clientWidth) {
1339        windowWidth = document.documentElement.clientWidth;
1340      }
1341      else {
1342        windowWidth = self.innerWidth;
1343      }
1344      windowHeight = self.innerHeight;
1345    }
1346    else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode.
1347      windowWidth = document.documentElement.clientWidth;
1348      windowHeight = document.documentElement.clientHeight;
1349    }
1350    else if (document.body) { // Other Explorers.
1351      windowWidth = document.body.clientWidth;
1352      windowHeight = document.body.clientHeight;
1353    }
1354    // For small pages with total height less than height of the viewport.
1355    if (yScroll < windowHeight) {
1356      pageHeight = windowHeight;
1357    }
1358    else {
1359      pageHeight = yScroll;
1360    }
1361    // For small pages with total width less than width of the viewport.
1362    if (xScroll < windowWidth) {
1363      pageWidth = xScroll;
1364    }
1365    else {
1366      pageWidth = windowWidth;
1367    }
1368    arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
1369    return arrayPageSize;
1370  },
1371
1372
1373  // pause(numberMillis)
1374  pause : function(ms) {
1375    var date = new Date();
1376    var curDate = null;
1377    do { curDate = new Date(); }
1378    while (curDate - date < ms);
1379  },
1380
1381
1382  // toggleSelectsFlash()
1383  // Hide / unhide select lists and flash objects as they appear above the
1384  // lightbox in some browsers.
1385  toggleSelectsFlash: function (state) {
1386    if (state == 'visible') {
1387      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show();
1388    }
1389    else if (state == 'hide') {
1390      $("select:visible, embed:visible, object:visible").not('#lightboxAutoModal select, #lightboxAutoModal embed, #lightboxAutoModal object').addClass("lightbox_hidden");
1391      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide();
1392    }
1393  },
1394
1395
1396  // parseRel()
1397  parseRel: function (link) {
1398    var parts = [];
1399    parts["rel"] = parts["title"] = parts["group"] = parts["style"] = parts["flashvars"] = null;
1400    if (!$(link).attr('rel')) return parts;
1401    parts["rel"] = $(link).attr('rel').match(/\w+/)[0];
1402
1403    if ($(link).attr('rel').match(/\[(.*)\]/)) {
1404      var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|');
1405      parts["group"] = info[0];
1406      parts["style"] = info[1];
1407      if (parts["style"] != undefined && parts["style"].match(/flashvars:\s?(.*?);/)) {
1408        parts["flashvars"] = parts["style"].match(/flashvars:\s?(.*?);/)[1];
1409      }
1410    }
1411    if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) {
1412      parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1];
1413    }
1414    return parts;
1415  },
1416
1417  // setStyles()
1418  setStyles: function(item, styles) {
1419    item.width = Lightbox.iframe_width;
1420    item.height = Lightbox.iframe_height;
1421    item.scrolling = "auto";
1422
1423    if (!styles) return item;
1424    var stylesArray = styles.split(';');
1425    for (var i = 0; i< stylesArray.length; i++) {
1426      if (stylesArray[i].indexOf('width:') >= 0) {
1427        var w = stylesArray[i].replace('width:', '');
1428        item.width = jQuery.trim(w);
1429      }
1430      else if (stylesArray[i].indexOf('height:') >= 0) {
1431        var h = stylesArray[i].replace('height:', '');
1432        item.height = jQuery.trim(h);
1433      }
1434      else if (stylesArray[i].indexOf('scrolling:') >= 0) {
1435        var scrolling = stylesArray[i].replace('scrolling:', '');
1436        item.scrolling = jQuery.trim(scrolling);
1437      }
1438      else if (stylesArray[i].indexOf('overflow:') >= 0) {
1439        var overflow = stylesArray[i].replace('overflow:', '');
1440        item.overflow = jQuery.trim(overflow);
1441      }
1442    }
1443    return item;
1444  },
1445
1446
1447  // togglePlayPause()
1448  // Hide the pause / play button as appropriate.  If pausing the slideshow also
1449  // clear the timers, otherwise move onto the next image.
1450  togglePlayPause: function(hideId, showId) {
1451    if (Lightbox.isSlideshow && hideId == "lightshowPause") {
1452      for (var i = 0; i < Lightbox.slideIdCount; i++) {
1453        window.clearTimeout(Lightbox.slideIdArray[i]);
1454      }
1455    }
1456    $('#' + hideId).hide();
1457    $('#' + showId).show();
1458
1459    if (hideId == "lightshowPlay") {
1460      Lightbox.isPaused = false;
1461      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
1462        Lightbox.end();
1463      }
1464      else if (Lightbox.total > 1) {
1465        Lightbox.changeData(Lightbox.activeImage + 1);
1466      }
1467    }
1468    else {
1469      Lightbox.isPaused = true;
1470    }
1471  },
1472
1473  triggerLightbox: function (rel_type, rel_group) {
1474    if (rel_type.length) {
1475      if (rel_group && rel_group.length) {
1476        $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click");
1477      }
1478      else {
1479        $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click");
1480      }
1481    }
1482  },
1483
1484  detectMacFF2: function() {
1485    var ua = navigator.userAgent.toLowerCase();
1486    if (/firefox[\/\s](\d+\.\d+)/.test(ua)) {
1487      var ffversion = new Number(RegExp.$1);
1488      if (ffversion < 3 && ua.indexOf('mac') != -1) {
1489        return true;
1490      }
1491    }
1492    return false;
1493  },
1494
1495  checkKey: function(keys, key, code) {
1496    return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1);
1497  },
1498
1499  filterXSS: function(str, allowed_tags) {
1500    var output = "";
1501    $.ajax({
1502      url: Drupal.settings.basePath + 'system/lightbox2/filter-xss',
1503      data: {
1504        'string' : str,
1505        'allowed_tags' : allowed_tags
1506      },
1507      type: "POST",
1508      async: false,
1509      dataType:  "json",
1510      success: function(data) {
1511        output = data;
1512      }
1513    });
1514    return output;
1515  }
1516
1517};
1518
1519// Initialize the lightbox.
1520Drupal.behaviors.initLightbox = function (context) {
1521  $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() {
1522    Lightbox.initialize();
1523    return false; // Break the each loop.
1524  });
1525
1526  // Attach lightbox to any links with lightbox rels.
1527  Lightbox.initList(context);
1528  $('#lightboxAutoModal', context).triggerHandler('click');
1529};
1530
1531;
1532/**
1533 * Modified Star Rating - jQuery plugin
1534 *
1535 * Copyright (c) 2006 Wil Stuckey
1536 *
1537 * Original source available: http://sandbox.wilstuckey.com/jquery-ratings/
1538 * Extensively modified by Lullabot: http://www.lullabot.com
1539 *
1540 * Dual licensed under the MIT and GPL licenses:
1541 *   http://www.opensource.org/licenses/mit-license.php
1542 *   http://www.gnu.org/licenses/gpl.html
1543 */
1544
1545/**
1546 * Create a degradeable star rating interface out of a simple form structure.
1547 * Returns a modified jQuery object containing the new interface.
1548 *   
1549 * @example jQuery('form.rating').fivestar();
1550 * @cat plugin
1551 * @type jQuery 
1552 *
1553 */
1554(function($){ // Create local scope.
1555    /**
1556     * Takes the form element, builds the rating interface and attaches the proper events.
1557     * @param {Object} $obj
1558     */
1559    var buildRating = function($obj){
1560        var $widget = buildInterface($obj),
1561            $stars = $('.star', $widget),
1562            $cancel = $('.cancel', $widget),
1563            $summary = $('.fivestar-summary', $obj),
1564            feedbackTimerId = 0,
1565            summaryText = $summary.html(),
1566            summaryHover = $obj.is('.fivestar-labels-hover'),
1567            currentValue = $("select", $obj).val(),
1568            cancelTitle = $('label', $obj).html(),
1569            voteTitle = cancelTitle != Drupal.settings.fivestar.titleAverage ? cancelTitle : Drupal.settings.fivestar.titleUser,
1570            voteChanged = false;
1571
1572        // Record star display.
1573        if ($obj.is('.fivestar-user-stars')) {
1574          var starDisplay = 'user';
1575        }
1576        else if ($obj.is('.fivestar-average-stars')) {
1577          var starDisplay = 'average';
1578          currentValue = $("input[name=vote_average]", $obj).val();
1579        }
1580        else if ($obj.is('.fivestar-combo-stars')) {
1581          var starDisplay = 'combo';
1582        }
1583        else {
1584          var starDisplay = 'none';
1585        }
1586
1587        // Smart is intentionally separate, so the average will be set if necessary.
1588        if ($obj.is('.fivestar-smart-stars')) {
1589          var starDisplay = 'smart';
1590        }
1591
1592        // Record text display.
1593        if ($summary.size()) {
1594          var textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_');
1595        }
1596        else {
1597          var textDisplay = 'none';
1598        }
1599
1600        // Add hover and focus events.
1601        $stars
1602            .mouseover(function(){
1603                event.drain();
1604                event.fill(this);
1605            })
1606            .mouseout(function(){
1607                event.drain();
1608                event.reset();
1609            });
1610        $stars.children()
1611            .focus(function(){
1612                event.drain();
1613                event.fill(this.parentNode)
1614            })
1615            .blur(function(){
1616                event.drain();
1617                event.reset();
1618            }).end();
1619
1620        // Cancel button events.
1621        $cancel
1622            .mouseover(function(){
1623                event.drain();
1624                $(this).addClass('on')
1625            })
1626            .mouseout(function(){
1627                event.reset();
1628                $(this).removeClass('on')
1629            });
1630        $cancel.children()
1631            .focus(function(){
1632                event.drain();
1633                $(this.parentNode).addClass('on')
1634            })
1635            .blur(function(){
1636                event.reset();
1637                $(this.parentNode).removeClass('on')
1638            }).end();
1639
1640        // Click events.
1641        $cancel.click(function(){
1642            currentValue = 0;
1643            event.reset();
1644            voteChanged = false;
1645            // Inform a user that his vote is being processed
1646            if ($("input.fivestar-path", $obj).size() && $summary.is('.fivestar-feedback-enabled')) {
1647              setFeedbackText(Drupal.settings.fivestar.feedbackDeletingVote);
1648            }
1649            // Save the currentValue in a hidden field.
1650            $("select", $obj).val(0);
1651            // Update the title.
1652            cancelTitle = starDisplay != 'smart' ? cancelTitle : Drupal.settings.fivestar.titleAverage;
1653            $('label', $obj).html(cancelTitle);
1654            // Update the smart classes on the widget if needed.
1655            if ($obj.is('.fivestar-smart-text')) {
1656              $obj.removeClass('fivestar-user-text').addClass('fivestar-average-text');
1657              $summary[0].className = $summary[0].className.replace(/-user/, '-average');
1658              textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_');
1659            }
1660            if ($obj.is('.fivestar-smart-stars')) {
1661              $obj.removeClass('fivestar-user-stars').addClass('fivestar-average-stars');
1662            }
1663            // Submit the form if needed.
1664            $("input.fivestar-path", $obj).each(function() {
1665              var token = $("input.fivestar-token", $obj).val();
1666              $.ajax({
1667                type: 'GET',
1668                data: { token: token },
1669                dataType: 'xml',
1670                url: this.value + '/' + 0,
1671                success: voteHook
1672              });
1673            });
1674            return false;
1675        });
1676        $stars.click(function(){
1677            currentValue = $('select option', $obj).get($stars.index(this) + $cancel.size() + 1).value;
1678            // Save the currentValue to the hidden select field.
1679            $("select", $obj).val(currentValue);
1680            // Update the display of the stars.
1681            voteChanged = true;
1682            event.reset();
1683            // Inform a user that his vote is being processed.
1684            if ($("input.fivestar-path", $obj).size() && $summary.is('.fivestar-feedback-enabled')) {
1685              setFeedbackText(Drupal.settings.fivestar.feedbackSavingVote);
1686            }
1687            // Update the smart classes on the widget if needed.
1688            if ($obj.is('.fivestar-smart-text')) {
1689              $obj.removeClass('fivestar-average-text').addClass('fivestar-user-text');
1690              $summary[0].className = $summary[0].className.replace(/-average/, '-user');
1691              textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_');
1692            }
1693            if ($obj.is('.fivestar-smart-stars')) {
1694              $obj.removeClass('fivestar-average-stars').addClass('fivestar-user-stars');
1695            }
1696            // Submit the form if needed.
1697            $("input.fivestar-path", $obj).each(function () {
1698              var token = $("input.fivestar-token", $obj).val();
1699              $.ajax({
1700                type: 'GET',
1701                data: { token: token },
1702                dataType: 'xml',
1703                url: this.value + '/' + currentValue,
1704                success: voteHook
1705              });
1706            });
1707            return false;
1708        });
1709
1710        var event = {
1711            fill: function(el){
1712              // Fill to the current mouse position.
1713              var index = $stars.index(el) + 1;
1714              $stars
1715                .children('a').css('width', '100%').end()
1716                .filter(':lt(' + index + ')').addClass('hover').end();
1717              // Update the description text and label.
1718              if (summaryHover && !feedbackTimerId) {
1719                var summary = $("select option", $obj)[index + $cancel.size()].text;
1720                var value = $("select option", $obj)[index + $cancel.size()].value;
1721                $summary.html(summary != index + 1 ? summary : '&nbsp;');
1722                $('label', $obj).html(voteTitle);
1723              }
1724            },
1725            drain: function() {
1726              // Drain all the stars.
1727              $stars
1728                .filter('.on').removeClass('on').end()
1729                .filter('.hover').removeClass('hover').end();
1730              // Update the description text.
1731              if (summaryHover && !feedbackTimerId) {
1732                var cancelText = $("select option", $obj)[1].text;
1733                $summary.html(($cancel.size() && cancelText != 0) ? cancelText : '&nbsp');
1734                if (!voteChanged) {
1735                  $('label', $obj).html(cancelTitle);
1736                }
1737              }
1738            },
1739            reset: function(){
1740              // Reset the stars to the default index.
1741              var starValue = currentValue/100 * $stars.size();
1742              var percent = (starValue - Math.floor(starValue)) * 100;
1743              $stars.filter(':lt(' + Math.floor(starValue) + ')').addClass('on').end();
1744              if (percent > 0) {
1745                $stars.eq(Math.floor(starValue)).addClass('on').children('a').css('width', percent + "%").end().end();
1746              }
1747              // Restore the summary text and original title.
1748              if (summaryHover && !feedbackTimerId) {
1749                $summary.html(summaryText ? summaryText : '&nbsp;');
1750              }
1751              if (voteChanged) {
1752                $('label', $obj).html(voteTitle);
1753              }
1754              else {
1755                $('label', $obj).html(cancelTitle);
1756              }
1757            }
1758        };
1759
1760        var setFeedbackText = function(text) {
1761          // Kill previous timer if it isn't finished yet so that the text we
1762          // are about to set will not get cleared too early.
1763          feedbackTimerId = 1;
1764          $summary.html(text);
1765        };
1766
1767        /**
1768         * Checks for the presence of a javascript hook 'fivestarResult' to be
1769         * called upon completion of a AJAX vote request.
1770         */
1771        var voteHook = function(data) {
1772          var returnObj = {
1773            result: {
1774              count: $("result > count", data).text(),
1775              average: $("result > average", data).text(),
1776              summary: {
1777                average: $("summary average", data).text(),
1778                average_count: $("summary average_count", data).text(),
1779                user: $("summary user", data).text(),
1780                user_count: $("summary user_count", data).text(),
1781                combo: $("summary combo", data).text(),
1782                count: $("summary count", data).text()
1783              }
1784            },
1785            vote: {
1786              id: $("vote id", data).text(),
1787              tag: $("vote tag", data).text(),
1788              type: $("vote type", data).text(),
1789              value: $("vote value", data).text()
1790            },
1791            display: {
1792              stars: starDisplay,
1793              text: textDisplay
1794            }
1795          };
1796          // Check for a custom callback.
1797          if (window.fivestarResult) {
1798            fivestarResult(returnObj);
1799          }
1800          // Use the default.
1801          else {
1802            fivestarDefaultResult(returnObj);
1803          }
1804          // Update the summary text.
1805          summaryText = returnObj.result.summary[returnObj.display.text];
1806          if ($(returnObj.result.summary.average).is('.fivestar-feedback-enabled')) {
1807            // Inform user that his/her vote has been processed.
1808            if (returnObj.vote.value != 0) { // check if vote has been saved or deleted 
1809              setFeedbackText(Drupal.settings.fivestar.feedbackVoteSaved);
1810            }
1811            else {
1812              setFeedbackText(Drupal.settings.fivestar.feedbackVoteDeleted);
1813            }
1814            // Setup a timer to clear the feedback text after 3 seconds.
1815            feedbackTimerId = setTimeout(function() { clearTimeout(feedbackTimerId); feedbackTimerId = 0; $summary.html(returnObj.result.summary[returnObj.display.text]); }, 2000);
1816          }
1817          // Update the current star currentValue to the previous average.
1818          if (returnObj.vote.value == 0 && (starDisplay == 'average' || starDisplay == 'smart')) {
1819            currentValue = returnObj.result.average;
1820            event.reset();
1821          }
1822        };
1823
1824        event.reset();
1825        return $widget;
1826    };
1827    
1828    /**
1829     * Accepts jQuery object containing a single fivestar widget.
1830     * Returns the proper div structure for the star interface.
1831     * 
1832     * @return jQuery
1833     * @param {Object} $widget
1834     * 
1835     */
1836    var buildInterface = function($widget){
1837        var $container = $('<div class="fivestar-widget clear-block"></div>');
1838        var $options = $("select option", $widget);
1839        var size = $('option', $widget).size() - 1;
1840        var cancel = 1;
1841        for (var i = 1, option; option = $options[i]; i++){
1842            if (option.value == "0") {
1843              cancel = 0;
1844              $div = $('<div class="cancel"><a href="#0" title="' + option.text + '">' + option.text + '</a></div>');
1845            }
1846            else {
1847              var zebra = (i + cancel - 1) % 2 == 0 ? 'even' : 'odd';
1848              var count = i + cancel - 1;
1849              var first = count == 1 ? ' star-first' : '';
1850              var last = count == size + cancel - 1 ? ' star-last' : '';
1851              $div = $('<div class="star star-' + count + ' star-' + zebra + first + last + '"><a href="#' + option.value + '" title="' + option.text + '">' + option.text + '</a></div>');
1852            }
1853            $container.append($div[0]);
1854        }
1855        $container.addClass('fivestar-widget-' + (size + cancel - 1));
1856        // Attach the new widget and hide the existing widget.
1857        $('select', $widget).after($container).css('display', 'none');
1858        return $container;
1859    };
1860
1861    /**
1862     * Standard handler to update the average rating when a user changes their
1863     * vote. This behavior can be overridden by implementing a fivestarResult
1864     * function in your own module or theme.
1865     * @param object voteResult
1866     * Object containing the following properties from the vote result:
1867     * voteResult.result.count The current number of votes for this item.
1868     * voteResult.result.average The current average of all votes for this item.
1869     * voteResult.result.summary.average The textual description of the average.
1870     * voteResult.result.summary.user The textual description of the user's current vote.
1871     * voteResult.vote.id The id of the item the vote was placed on (such as the nid)
1872     * voteResult.vote.type The type of the item the vote was placed on (such as 'node')
1873     * voteResult.vote.tag The multi-axis tag the vote was placed on (such as 'vote')
1874     * voteResult.vote.average The average of the new vote saved
1875     * voteResult.display.stars The type of star display we're using. Either 'average', 'user', or 'combo'.
1876     * voteResult.display.text The type of text display we're using. Either 'average', 'user', or 'combo'.
1877     */
1878    function fivestarDefaultResult(voteResult) {
1879      // Update the summary text.
1880      $('div.fivestar-summary-'+voteResult.vote.tag+'-'+voteResult.vote.id).html(voteResult.result.summary[voteResult.display.text]);
1881      // If this is a combo display, update the average star display.
1882      if (voteResult.display.stars == 'combo') {
1883        $('div.fivestar-form-'+voteResult.vote.id).each(function() {
1884          // Update stars.
1885          var $stars = $('.fivestar-widget-static .star span', this);
1886          var average = voteResult.result.average/100 * $stars.size();
1887          var index = Math.floor(average);
1888          $stars.removeClass('on').addClass('off').css('width', 'auto');
1889          $stars.filter(':lt(' + (index + 1) + ')').removeClass('off').addClass('on');
1890          $stars.eq(index).css('width', ((average - index) * 100) + "%");
1891          // Update summary.
1892          var $summary = $('.fivestar-static-form-item .fivestar-summary', this);
1893          if ($summary.size()) {
1894            var textDisplay = $summary.attr('class').replace(/.*?fivestar-summary-([^ ]+).*/, '$1').replace(/-/g, '_');
1895            $summary.html(voteResult.result.summary[textDisplay]);
1896          }
1897        });
1898      }
1899    };
1900
1901    /**
1902     * Set up the plugin
1903     */
1904    $.fn.fivestar = function() {
1905      var stack = [];
1906      this.each(function() {
1907          var ret = buildRating($(this));
1908          stack.push(ret);
1909      });
1910      return stack;
1911    };
1912
1913  // Fix ie6 background flicker problem.
1914  if ($.browser.msie == true) {
1915    try {
1916      document.execCommand('BackgroundImageCache', false, true);
1917    } catch(err) {}
1918  }
1919
1920  Drupal.behaviors.fivestar = function(context) {
1921    $('div.fivestar-form-item:not(.fivestar-processed)', context).addClass('fivestar-processed').fivestar();
1922    $('input.fivestar-submit', context).css('display', 'none');
1923  }
1924
1925})(jQuery);;
1926
1927/*
1928 * Superfish v1.4.8 - jQuery menu widget
1929 * Copyright (c) 2008 Joel Birch
1930 *
1931 * Dual licensed under the MIT and GPL licenses:
1932 * 	http://www.opensource.org/licenses/mit-license.php
1933 * 	http://www.gnu.org/licenses/gpl.html
1934 *
1935 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
1936 */
1937
1938;(function($){
1939	$.fn.superfish = function(op){
1940
1941		var sf = $.fn.superfish,
1942			c = sf.c,
1943			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
1944			over = function(){
1945				var $$ = $(this), menu = getMenu($$);
1946				clearTimeout(menu.sfTimer);
1947				$$.showSuperfishUl().siblings().hideSuperfishUl();
1948			},
1949			out = function(){
1950				var $$ = $(this), menu = getMenu($$), o = sf.op;
1951				clearTimeout(menu.sfTimer);
1952				menu.sfTimer=setTimeout(function(){
1953					o.retainPath=($.inArray($$[0],o.$path)>-1);
1954					$$.hideSuperfishUl();
1955					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
1956				},o.delay);	
1957			},
1958			getMenu = function($menu){
1959				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
1960				sf.op = sf.o[menu.serial];
1961				return menu;
1962			},
1963			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
1964			
1965		return this.each(function() {
1966			var s = this.serial = sf.o.length;
1967			var o = $.extend({},sf.defaults,op);
1968			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
1969				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
1970					.filter('li:has(ul)').removeClass(o.pathClass);
1971			});
1972			sf.o[s] = sf.op = o;
1973			
1974			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
1975				if (o.autoArrows) addArrow( $('>a:first-child',this) );
1976			})
1977			.not('.'+c.bcClass)
1978				.hideSuperfishUl();
1979			
1980			var $a = $('a',this);
1981			$a.each(function(i){
1982				var $li = $a.eq(i).parents('li');
1983				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
1984			});
1985			o.onInit.call(this);
1986			
1987		}).each(function() {
1988			var menuClasses = [c.menuClass];
1989			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
1990			$(this).addClass(menuClasses.join(' '));
1991		});
1992	};
1993
1994	var sf = $.fn.superfish;
1995	sf.o = [];
1996	sf.op = {};
1997	sf.IE7fix = function(){
1998		var o = sf.op;
1999		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
2000			this.toggleClass(sf.c.shadowClass+'-off');
2001		};
2002	sf.c = {
2003		bcClass     : 'sf-breadcrumb',
2004		menuClass   : 'sf-js-enabled',
2005		anchorClass : 'sf-with-ul',
2006		arrowClass  : 'sf-sub-indicator',
2007		shadowClass : 'sf-shadow'
2008	};
2009	sf.defaults = {
2010		hoverClass	: 'sfHover',
2011		pathClass	: 'overideThisToUse',
2012		pathLevels	: 1,
2013		delay		: 800,
2014		animation	: {opacity:'show'},
2015		speed		: 'normal',
2016		autoArrows	: true,
2017		dropShadows : true,
2018		disableHI	: false,		// true disables hoverIntent detection
2019		onInit		: function(){}, // callback functions
2020		onBeforeShow: function(){},
2021		onShow		: function(){},
2022		onHide		: function(){}
2023	};
2024	$.fn.extend({
2025		hideSuperfishUl : function(){
2026			var o = sf.op,
2027				not = (o.retainPath===true) ? o.$path : '';
2028			o.retainPath = false;
2029			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
2030					.find('>ul').hide().css('visibility','hidden');
2031			o.onHide.call($ul);
2032			return this;
2033		},
2034		showSuperfishUl : function(){
2035			var o = sf.op,
2036				sh = sf.c.shadowClass+'-off',
2037				$ul = this.addClass(o.hoverClass)
2038					.find('>ul:hidden').css('visibility','visible');
2039			sf.IE7fix.call($ul);
2040			o.onBeforeShow.call($ul);
2041			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
2042			return this;
2043		}
2044	});
2045
2046})(jQuery);
2047;
2048/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
2049 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
2050 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
2051 *
2052 * $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $
2053 * $Rev: 2111 $
2054 *
2055 * Version 2.1
2056 */
2057(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);;
2058/**
2059* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
2060* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
2061* 
2062* @param  f  onMouseOver function || An object with configuration options
2063* @param  g  onMouseOut function  || Nothing (use configuration options object)
2064* @author    Brian Cherne <[email protected]>
2065*/
2066(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]);};
2066var 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);;
2067// $Id: nice_menus.js,v 1.1 2012/01/30 07:34:00 fabiola.bellio Exp $
2068
2069// This uses Superfish 1.4.8
2070// (http://users.tpg.com.au/j_birch/plugins/superfish)
2071
2072// Add Superfish to all Nice menus with some basic options.
2073(function ($) {
2074  $(document).ready(function() {
2075    $('ul.nice-menu').superfish({
2076      // Apply a generic hover class.
2077      hoverClass: 'over',
2078      // Disable generation of arrow mark-up.
2079      autoArrows: false,
2080      // Disable drop shadows.
2081      dropShadows: false,
2082      // Mouse delay.
2083      delay: Drupal.settings.nice_menus_options.delay,
2084      // Animation speed.
2085      speed: Drupal.settings.nice_menus_options.speed
2086    // Add in Brandon Aaron’s bgIframe plugin for IE select issues.
2087    // http://plugins.jquery.com/node/46/release
2088    }).find('ul').bgIframe({opacity:false});
2089    $('ul.nice-menu ul').css('display', 'none');
2090  });
2091})(jQuery);
2092;
2093/*
2094 * jQuery Cycle Plugin (with Transition Definitions)
2095 * Examples and documentation at: http://jquery.malsup.com/cycle/
2096 * Copyright (c) 2007-2010 M. Alsup
2097 * Version: 2.88 (08-JUN-2010)
2098 * Dual licensed under the MIT and GPL licenses.
2099 * http://jquery.malsup.com/license.html
2100 * Requires: jQuery v1.2.6 or later
2101 */
2102(function($){var ver="2.88";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,(!opts2.rev&&!opts.backwards));},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,(!opts.rev&&!opts.backwards));}}}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);}
2102else{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;while((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];
2102if(!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);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));},ms);}}
2102$.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}
2102;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);
2103/*
2104 * jQuery Cycle Plugin Transition Definitions
2105 * This script is a plugin for the jQuery Cycle Plugin
2106 * Examples and documentation at: http://malsup.com/jquery/cycle/
2107 * Copyright (c) 2007-2010 M. Alsup
2108 * Version:	 2.72
2109 * Dual licensed under the MIT and GPL licenses:
2110 * http://www.opensource.org/licenses/mit-license.php
2111 * http://www.gnu.org/licenses/gpl.html
2112 */
2113(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}
2113;};$.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);
2113var 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);;
2114// $Id: views_slideshow.js,v 1.1 2011/10/25 10:41:38 mattia.fort Exp $
2115
2116/**
2117 *  @file
2118 *  A simple jQuery SingleFrame Div Slideshow Rotator.
2119 */
2120
2121/**
2122 * This will set our initial behavior, by starting up each individual slideshow.
2123 */
2124Drupal.behaviors.viewsSlideshowSingleFrame = function (context) {
2125  $('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() {
2126    var fullId = '#' + $(this).attr('id');
2127    var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId];
2128    settings.targetId = '#' + $(fullId + " :first").attr('id');
2129    settings.paused = false;
2130
2131    settings.opts = {
2132      speed:settings.speed,
2133      timeout:parseInt(settings.timeout),
2134      delay:parseInt(settings.delay),
2135      sync:settings.sync==1,
2136      random:settings.random==1,
2137      pause:false,
2138      allowPagerClickBubble:(settings.pager_hover==1 || settings.pager_click_to_page),
2139      prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.vss_id:null,
2140      next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.vss_id:null,
2141      pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.vss_id:null,
2142      nowrap:parseInt(settings.nowrap),
2143      pagerAnchorBuilder: function(idx, slide) {
2144        var classes = 'pager-item pager-num-' + (idx+1);
2145        if (idx == 0) {
2146          classes += ' first';
2147        }
2148        if ($(slide).siblings().length == idx) {
2149          classes += ' last';
2150        }
2151
2152        if (idx % 2) {
2153          classes += ' odd';
2154        }
2155        else {
2156          classes += ' even';
2157        }
2158        
2159        var theme = 'viewsSlideshowPager' + settings.pager_type;
2160        return Drupal.theme.prototype[theme] ? Drupal.theme(theme, classes, idx, slide, settings) : '';
2161      },
2162      after:function(curr, next, opts) {
2163        // Used for Image Counter.
2164        if (settings.image_count) {
2165          $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.num').html(opts.currSlide + 1);
2166          $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.total').html(opts.slideCount);
2167        }
2168      },
2169      before:function(curr, next, opts) {
2170        // Remember last slide.
2171        if (settings.remember_slide) {
2172          createCookie(settings.vss_id, opts.currSlide + 1, settings.remember_slide_days);
2173        }
2174
2175        // Make variable height.
2176        if (settings.fixed_height == 0) {
2177          //get the height of the current slide
2178          var $ht = $(this).height();
2179          //set the container's height to that of the current slide
2180          $(this).parent().animate({height: $ht});
2181        }
2182      },
2183      cleartype:(settings.ie.cleartype == 'true')? true : false,
2184      cleartypeNoBg:(settings.ie.cleartypenobg == 'true')? true : false
2185    }
2186    
2187    // Set the starting slide if we are supposed to remember the slide
2188    if (settings.remember_slide) {
2189      var startSlide = readCookie(settings.vss_id);
2190      if (startSlide == null) {
2191        startSlide = 0;
2192      }
2193      settings.opts.startingSlide =  startSlide;
2194    }
2195
2196    if (settings.pager_hover == 1) {
2197      settings.opts.pagerEvent = 'mouseover';
2198      settings.opts.pauseOnPagerHover = true;
2199    }
2200
2201    if (settings.effect == 'none') {
2202      settings.opts.speed = 1;
2203    }
2204    else {
2205      settings.opts.fx = settings.effect;
2206    }
2207
2208    // Pause on hover.
2209    if (settings.pause == 1) {
2210      $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).hover(function() {
2211        $(settings.targetId).cycle('pause');
2212      }, function() {
2213        if (settings.paused == false) {
2214          $(settings.targetId).cycle('resume');
2215        }
2216      });
2217    }
2218
2219    // Pause on clicking of the slide.
2220    if (settings.pause_on_click == 1) {
2221      $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).click(function() { 
2222        viewsSlideshowSingleFramePause(settings);
2223      });
2224    }
2225
2226    // Add additional settings.
2227		if (settings.advanced != "\n") {
2228      var advanced = settings.advanced.split("\n");
2229      for (i=0; i<advanced.length; i++) {
2230        var prop = '';
2231        var value = '';
2232        var property = advanced[i].split(":");
2233        for (j=0; j<property.length; j++) {
2234          if (j == 0) {
2235            prop = property[j];
2236          }
2237          else if (j == 1) {
2238            value = property[j];
2239          }
2240          else {
2241            value += ":" + property[j];
2242          }
2243        }
2244
2245        // Need to evaluate so true, false and numerics aren't a string.
2246        if (value == 'true' || value == 'false' || IsNumeric(value)) {
2247          value = eval(value);
2248        }
2249        else {
2250          // Parse strings into functions.
2251          var func = value.match(/function\s*\((.*?)\)\s*\{(.*)\}/i);
2252          if (func) {
2253            value = new Function(func[1].match(/(\w+)/g), func[2]);
2254          }
2255        }
2256	
2257        // Call both functions if prop was set previously.
2258        if (typeof(value) == "function" && prop in settings.opts) {
2259          var callboth = function(before_func, new_func) {
2260            return function() {
2261              before_func.apply(null, arguments);
2262              new_func.apply(null, arguments);
2263            };
2264          };
2265          settings.opts[prop] = callboth(settings.opts[prop], value);
2266        }
2267        else {
2268          settings.opts[prop] = value;
2269        }
2270      }
2271    }
2272    
2273    $(settings.targetId).cycle(settings.opts);
2274
2275    // Start Paused
2276    if (settings.start_paused) {
2277      viewsSlideshowSingleFramePause(settings);
2278    }
2279    
2280    // Pause if hidden.
2281    if (settings.pause_when_hidden) {
2282      var checkPause = function(settings) {
2283        // If the slideshow is visible and it is paused then resume.
2284        // otherwise if the slideshow is not visible and it is not paused then
2285        // pause it.
2286        var visible = viewsSlideshowSingleFrameIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
2287        if (visible && settings.paused) {
2288          viewsSlideshowSingleFrameResume(settings);
2289        }
2290        else if (!visible && !settings.paused) {
2291          viewsSlideshowSingleFramePause(settings);
2292        }
2293      }
2294     
2295      // Check when scrolled.
2296      $(window).scroll(function() {
2297       checkPause(settings);
2298      });
2299      
2300      // Check when the window is resized.
2301      $(window).resize(function() {
2302        checkPause(settings);
2303      });
2304    }
2305
2306    // Show image count for people who have js enabled.
2307    $('#views_slideshow_singleframe_image_count_' + settings.vss_id).show();
2308
2309    if (settings.controls > 0) {
2310      // Show controls for people who have js enabled browsers.
2311      $('#views_slideshow_singleframe_controls_' + settings.vss_id).show();
2312      
2313      $('#views_slideshow_singleframe_playpause_' + settings.vss_id).click(function(e) {
2314      	if (settings.paused) {
2315      	  viewsSlideshowSingleFrameResume(settings);
2316      	}
2317      	else {
2318      	  viewsSlideshowSingleFramePause(settings);
2319      	}
2320        e.preventDefault();
2321      });
2322    }
2323  });
2324}
2325
2326// Pause the slideshow 
2327viewsSlideshowSingleFramePause = function (settings) {
2328  //make Resume translatable
2329  var resume = Drupal.t('Resume');
2330
2331  $(settings.targetId).cycle('pause');
2332  if (settings.controls > 0) {
2333    $('#views_slideshow_singleframe_playpause_' + settings.vss_id)
2334      .addClass('views_slideshow_singleframe_play')
2335      .addClass('views_slideshow_play')
2336      .removeClass('views_slideshow_singleframe_pause')
2337      .removeClass('views_slideshow_pause')
2338      .text(resume);
2339  }
2340  settings.paused = true;
2341}
2342
2343// Resume the slideshow
2344viewsSlideshowSingleFrameResume = function (settings) {
2345  $(settings.targetId).cycle('resume');
2346  if (settings.controls > 0) {
2347    $('#views_slideshow_singleframe_playpause_' + settings.vss_id)
2348      .addClass('views_slideshow_singleframe_pause')
2349      .addClass('views_slideshow_pause')
2350      .removeClass('views_slideshow_singleframe_play')
2351      .removeClass('views_slideshow_play')
2352      .text('Pause');
2353  }
2354  settings.paused = false;
2355}
2356
2357Drupal.theme.prototype.viewsSlideshowPagerThumbnails = function (classes, idx, slide, settings) {
2358  var href = '#';
2359  if (settings.pager_click_to_page) {
2360    href = $(slide).find('a').attr('href');
2361  }
2362  return '<div class="' + classes + '"><a href="' + href + '"><img src="' + $(slide).find('img').attr('src') + '" /></a></div>';
2363}
2364
2365Drupal.theme.prototype.viewsSlideshowPagerNumbered = function (classes, idx, slide, settings) {
2366  var href = '#';
2367  if (settings.pager_click_to_page) {
2368    href = $(slide).find('a').attr('href');
2369  }
2370  return '<div class="' + classes + '"><a href="' + href + '">' + (idx+1) + '</a></div>';
2371}
2372
2373// Verify that the value is a number.
2374function IsNumeric(sText) {
2375  var ValidChars = "0123456789";
2376  var IsNumber=true;
2377  var Char;
2378
2379  for (var i=0; i < sText.length && IsNumber == true; i++) { 
2380    Char = sText.charAt(i); 
2381    if (ValidChars.indexOf(Char) == -1) {
2382      IsNumber = false;
2383    }
2384  }
2385  return IsNumber;
2386}
2387
2388/**
2389 * Cookie Handling Functions
2390 */
2391function createCookie(name,value,days) {
2392  if (days) {
2393    var date = new Date();
2394    date.setTime(date.getTime()+(days*24*60*60*1000));
2395    var expires = "; expires="+date.toGMTString();
2396  }
2397  else {
2398    var expires = "";
2399  }
2400  document.cookie = name+"="+value+expires+"; path=/";
2401}
2402
2403function readCookie(name) {
2404  var nameEQ = name + "=";
2405  var ca = document.cookie.split(';');
2406  for(var i=0;i < ca.length;i++) {
2407    var c = ca[i];
2408    while (c.charAt(0)==' ') c = c.substring(1,c.length);
2409    if (c.indexOf(nameEQ) == 0) {
2410      return c.substring(nameEQ.length,c.length);
2411    }
2412  }
2413  return null;
2414}
2415
2416function eraseCookie(name) {
2417  createCookie(name,"",-1);
2418}
2419
2420/**
2421 * Checks to see if the slide is visible enough.
2422 * elem = element to check.
2423 * type = The way to calculate how much is visible.
2424 * amountVisible = amount that should be visible. Either in percent or px. If
2425 *                it's not defined then all of the slide must be visible.
2426 *
2427 * Returns true or false
2428 */
2429function viewsSlideshowSingleFrameIsVisible(elem, type, amountVisible) {
2430  // Get the top and bottom of the window;
2431  var docViewTop = $(window).scrollTop();
2432  var docViewBottom = docViewTop + $(window).height();
2433  var docViewLeft = $(window).scrollLeft();
2434  var docViewRight = docViewLeft + $(window).width();
2435
2436  // Get the top, bottom, and height of the slide;
2437  var elemTop = $(elem).offset().top;
2438  var elemHeight = $(elem).height();
2439  var elemBottom = elemTop + elemHeight;
2440  var elemLeft = $(elem).offset().left;
2441  var elemWidth = $(elem).width();
2442  var elemRight = elemLeft + elemWidth;
2443  var elemArea = elemHeight * elemWidth;
2444  
2445  // Calculate what's hiding in the slide.
2446  var missingLeft = 0;
2447  var missingRight = 0;
2448  var missingTop = 0;
2449  var missingBottom = 0;
2450  
2451  // Find out how much of the slide is missing from the left.
2452  if (elemLeft < docViewLeft) {
2453    missingLeft = docViewLeft - elemLeft;
2454  }
2455
2456  // Find out how much of the slide is missing from the right.
2457  if (elemRight > docViewRight) {
2458    missingRight = elemRight - docViewRight;
2459  }
2460  
2461  // Find out how much of the slide is missing from the top.
2462  if (elemTop < docViewTop) {
2463    missingTop = docViewTop - elemTop;
2464  }
2465
2466  // Find out how much of the slide is missing from the bottom.
2467  if (elemBottom > docViewBottom) {
2468    missingBottom = elemBottom - docViewBottom;
2469  }
2470  
2471  // If there is no amountVisible defined then check to see if the whole slide
2472  // is visible.
2473  if (type == 'full') {
2474    return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
2475    && (elemBottom <= docViewBottom) &&  (elemTop >= docViewTop)
2476    && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
2477    && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
2478  }
2479  else if(type == 'vertical') {
2480    var verticalShowing = elemHeight - missingTop - missingBottom;
2481    
2482    // If user specified a percentage then find out if the current shown percent
2483    // is larger than the allowed percent.
2484    // Otherwise check to see if the amount of px shown is larger than the
2485    // allotted amount.
2486    if (amountVisible.indexOf('%')) {
2487      return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
2488    }
2489    else {
2490      return (verticalShowing >= parseInt(amountVisible));
2491    }
2492  }
2493  else if(type == 'horizontal') {
2494    var horizontalShowing = elemWidth - missingLeft - missingRight;
2495    
2496    // If user specified a percentage then find out if the current shown percent
2497    // is larger than the allowed percent.
2498    // Otherwise check to see if the amount of px shown is larger than the
2499    // allotted amount.
2500    if (amountVisible.indexOf('%')) {
2501      return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
2502    }
2503    else {
2504      return (horizontalShowing >= parseInt(amountVisible));
2505    }
2506  }
2507  else if(type == 'area') {
2508    var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
2509    
2510    // If user specified a percentage then find out if the current shown percent
2511    // is larger than the allowed percent.
2512    // Otherwise check to see if the amount of px shown is larger than the
2513    // allotted amount.
2514    if (amountVisible.indexOf('%')) {
2515      return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
2516    }
2517    else {
2518      return (areaShowing >= parseInt(amountVisible));
2519    }
2520  }
2521}
2522
2523;
2524;(function($) {
2525
2526  Drupal.behaviors.custom_search = function (context) {
2527
2528    if (!Drupal.settings.custom_search.solr) {
2529      // Check if the search box is not empty on submit
2530      $('form.search-form', context).submit(function(){
2531        var box = $(this).find('input.custom-search-box');
2532        if (box.val() != undefined && (box.val() == '' || box.val() == $(this).find('input.default-text').val())) {
2533          $(this).find('input.custom-search-box').addClass('error');
2534          return false;
2535        }
2536        // If basic search is hidden, copy or value to the keys
2537        if ($(this).find('#edit-keys').parents('div.element-invisible').attr('class') == 'element-invisible') {
2538          $(this).find('#edit-keys').val($(this).find('#edit-or').val());
2539          $(this).find('#edit-or').val('');
2540        }
2541        return true;
2542      });
2543    }
2544
2545    // Search from target
2546    $('form.search-form').attr('target', Drupal.settings.custom_search.form_target);
2547
2548    // Clear default text on focus, and put it back on blur. Also displays Popup.
2549    $('input.custom-search-box', context)
2550      .blur(function(e){
2551        var $this = $(this);
2552        var $parentForm = $this.parents('form');
2553        if ($this.val() == '') {
2554          $this.addClass('custom-search-default-value');
2555          $this.val($parentForm.find('input.default-text').val());
2556        }
2557      })
2558      .bind('click focus', function(e){
2559        var $this = $(this);
2560        var $parentForm = $this.parents('form');
2561        if ($this.val() == $parentForm.find('input.default-text').val()) $this.val('');
2562        $this.removeClass('custom-search-default-value');
2563        // check if there's something in the popup and displays it
2564        var popup = $parentForm.find('fieldset.custom_search-popup');
2565        if (popup.find('input,select').length && !popup.hasClass('opened')) popup.fadeIn().addClass('opened');
2566        e.stopPropagation();
2567      }
2568    );
2569    $(document).bind('click focus', function(){
2570      $('fieldset.custom_search-popup').hide().removeClass('opened');
2571    });
2572
2573    // Handle checkboxes
2574    $('.custom-search-selector input:checkbox', context).each(function(){
2575      var el = $(this);
2576      if (el.val() == 'c-all') {
2577        el.change(function(){
2578          $(this).parents('.custom-search-selector').find('input:checkbox[value!=c-all]').attr('checked', false);
2579        });
2580      }
2581      else {
2582        if (el.val().substr(0,2) == 'c-') {
2583          el.change(function(){
2584            $('.custom-search-selector input:checkbox').each(function(){
2585              if ($(this).val().substr(0,2) == 'o-') $(this).attr('checked', false);
2586            });
2587            $(this).parents('.custom-search-selector').find('input:checkbox[value=c-all]').attr('checked', false);
2588          });
2589        } else {
2590          el.change(function(){
2591            $(this).parents('.custom-search-selector').find('input:checkbox[value!='+el.val()+']').attr('checked', false);
2592          });
2593        }
2594      }
2595    });
2596
2597    // Reselect types and terms in advanced search
2598    var edit_keys = $('#edit-keys').val();
2599    if(edit_keys) {
2600      // types
2601      var pos = edit_keys.indexOf('type:');
2602      if (pos) {
2603        var pos2 = edit_keys.indexOf(' ',pos);
2604        if (pos2==-1) pos2 = edit_keys.length;
2605        var types = edit_keys.substring(pos+5,pos2);
2606        types = types.split(',');
2607        for (var i=0; i<types.length; i++) {
2608          $('.search-form input:checkbox[value='+types[i]+']').attr('checked', true);
2609        }
2610      }
2611      // terms
2612      var pos = edit_keys.indexOf('category:');
2613      if (pos) {
2614        var pos2 = edit_keys.indexOf(' ',pos);
2615        if (pos2==-1) pos2 = edit_keys.length;
2616        var terms = edit_keys.substring(pos+9,pos2);
2617        terms = terms.split(',');
2618        for (var i=0; i<terms.length; i++) {
2619          $('.search-form option[value='+terms[i]+']').attr('selected', true);
2620        }
2621      }
2622    }
2623
2624    var popup = $('fieldset.custom_search-popup:not(.custom_search-processed)', context).addClass("custom_search-processed");
2625    popup.click(function(e){
2626      e.stopPropagation();
2627    })
2628    popup.append('<a class="custom_search-popup-close" href="#">' + Drupal.t('Close') + '</a>');
2629    $('a.custom_search-popup-close').click(function(e){
2630      $('fieldset.custom_search-popup.opened').hide().removeClass('opened');
2631      e.preventDefault();
2632    });
2633
2634  }
2635
2636}(jQuery));
2637;
2638
2639/**
2640 * @file
2641 * Adds effects and behaviors to the cart block.
2642 */
2643
2644/**
2645 * Set the behavior to (un)collapse the cart block on a click
2646 */
2647Drupal.behaviors.ucCollapseBlock = function(context) {
2648  $('.cart-block-title-bar:not(.ucCollapseBlock-processed)', context).addClass('ucCollapseBlock-processed').click(
2649    function() {
2650      cart_block_toggle();
2651    }
2652  );
2653}
2654
2655/**
2656 * Collapse the shopping cart block at page load.
2657 */
2658$(document).ready(
2659  function() {
2660    if (Drupal.settings.ucCollapsedBlock == true) {
2661      // Add the appropriate title bar class.
2662      $('.cart-block-title-bar').addClass('cart-block-toggle');
2663
2664      // Add the appropriate arrow class.
2665      $('.cart-block-arrow').removeClass('arrow-down').addClass('arrow-up');
2666    }
2667    else {
2668      // Add the appropriate arrow class.
2669      $('.cart-block-arrow').removeClass('arrow-up').addClass('arrow-down');
2670    }
2671  }
2672);
2673
2674/**
2675 * Toggle the shopping cart block open and closed.
2676 */
2677function cart_block_toggle() {
2678  // Toggle the display of the cart contents table.
2679  $('#cart-block-contents').toggle();
2680
2681  // Toggle the class of the cart block arrow.
2682  if ($('.cart-block-arrow').hasClass('arrow-up')) {
2683    $('.cart-block-arrow').removeClass('arrow-up').addClass('arrow-down');
2684  }
2685  else {
2686    $('.cart-block-arrow').removeClass('arrow-down').addClass('arrow-up');
2687  }
2688}
2689;
2690Drupal.behaviors.ucOutOfStock =  function() {
2691
2692  if(typeof console === "undefined") {
2693    console = {log: function() {}};
2694  };
2695
2696  // Your code here
2697  attrid = 'edit-attributes';
2698
2699  function checkStock(forms) {
2700    var form_ids = new Array();
2701    var node_ids = new Array();
2702    var attr_ids = new Array();
2703    $.each(forms, function(index, form) {
2704      var product = new Object();
2705      var attributes = new Object();
2706
2707      var nid = form.attr('id').match(/(?:uc-product-add-to-cart-form-|catalog-buy-it-now-form-)([0-9]+)/)[1];
2708
2709      attributes.found = new Object();
2710      attributes.value = new Object();
2711
2712      $("[name*=attributes]", form).filter(':input:not(:text):not(:checkbox)').each(function(index){
2713        // We are assuming the value has to be there, seems to be working for radios and checkboxes
2714        id = $(this).attr('name').match(/attributes\[([0-9]*)\]/)[1];
2715        if ($(this).is(':radio')) {
2716          attributes.found['attr'+id] = 1;
2717          if ($(this).is(':checked')) {
2718            if ($(this).val()) {
2719              attributes.value['attr'+id] = 1;
2720              attr_ids.push(nid + ':' + id + ':' + $(this).val());
2721            }
2722          }
2723        }
2724        else if ($(this).is('select')) {
2725          attributes.found['attr'+id] = 1;
2726          if ($(this).val()) {
2727            attributes.value['attr'+id] = 1;
2728            attr_ids.push(nid + ':' + id + ':' + $(this).val());
2729          }
2730        }
2731      });
2732
2733      // find qty
2734      product['qty'] = 1;
2735      qty = $(":input[name=qty]", form).val()
2736      if (qty) {
2737        product['qty'] = qty;
2738      }
2739
2740      // finding if attributes are found with no value
2741      attributes.found.length = attributes.value.length = 0;
2742      for (var i in attributes.found) {
2743        if (i!='length') {
2744          attributes.found.length++;
2745        }
2746      }
2747
2748      for (var i in attributes.value) {
2749          if (i!='length') {
2750          attributes.value.length++;
2751        }
2752      }
2753
2754      if (Drupal.settings.uc_out_of_stock.throbber) {
2755        $(".uc_out_of_stock_throbbing", form).addClass('uc_oos_throbbing');
2756      }
2757      form_ids.push(form.attr('id'));
2758      node_ids.push(nid);
2759    });
2760
2761    if (form_ids.length == 0) {
2762      return;
2763    }
2764
2765    var post = { 'form_ids[]': form_ids, 'node_ids[]': node_ids, 'attr_ids[]': attr_ids }
2766    $.ajax({
2767      type: 'post',
2768      url : Drupal.settings.uc_out_of_stock.path,
2769      data: post,
2770      success : function (data, textStatus) {
2771        $.each(data, function(form_id, stock_level) {
2772          var form = $('#' + form_id);
2773          if (stock_level != null && parseInt(stock_level) <= 0) {
2774            // hide add to cart button
2775            $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).hide();
2776            // hide qty label, field and wrapper if present and if it follows
2777            // default theme output
2778            $("label[for=" + $(":input[name=qty]", form).attr('id') + "]", form).hide();
2779            $(":input[name=qty]", form).hide();
2780            $("#" + $(":input[name=qty]", form).attr('id') + "-wrapper", form).hide();
2781            // Show out of stock message
2782            //$(".uc_out_of_stock_html", form).html(Drupal.settings.uc_out_of_stock.msg);
2783            $(".uc_out_of_stock_html", form).html(Drupal.t('Out of stock'));
2784
2785            if (Drupal.settings.uc_out_of_stock.instock) {
2786              $(".uc-out-of-stock-instock", form).hide();
2787            }
2788          }
2789          else {
2790            // Put back the normal HTML of the add to cart form
2791            $(".uc_out_of_stock_html", form).html('');
2792            // show qty elements
2793            $("label[for=" + $(":input[name=qty]", form).attr('id') + "]", form).show();
2794            $(":input[name=qty]", form).show();
2795            $("#" + $(":input[name=qty]", form).attr('id') + "-wrapper", form).show();
2796            // show add to cart button
2797            //$("input:submit.node-add-to-cart,input:submit.list-add-to-cart", form).show();
2798
2799            //su mp il bottone submit add to cart nel nodo non deve essere visualizzato
2800            $("input:submit.list-add-to-cart", form).show();
2801            if (Drupal.settings.uc_out_of_stock.instock) {
2802              $(".uc-out-of-stock-instock", form).html(Drupal.theme('ucOutOfStockInStock', stock_level));
2803              $(".uc-out-of-stock-instock", form).show();
2804            }
2805          }
2806
2807          if (Drupal.settings.uc_out_of_stock.throbber) {
2808            $(".uc_out_of_stock_throbbing", form).removeClass('uc_oos_throbbing');
2809          }
2810        });
2811      },
2812      error : function (jqXHR, textStatus, errorThrown) {
2813        console.log('uc_out_of_stock: ' + textStatus + ': ' + jqXHR.responseText);
2814        if (Drupal.settings.uc_out_of_stock.throbber) {
2815          $(".uc_out_of_stock_throbbing").removeClass('uc_oos_throbbing');
2816        }
2817      },
2818      dataType: 'json'
2819    });
2820  }
2821
2822  var forms = new Array();
2823  $("form[id*=uc-product-add-to-cart-form], form[id*=uc-catalog-buy-it-now-form]").not('.uc-out-stock-processed').each(function() {
2824    $(this).addClass('uc-out-stock-processed');
2825    forms.push($(this));
2826    if (Drupal.settings.uc_out_of_stock.throbber) {
2827      $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).before('<div class="uc_out_of_stock_throbbing">&nbsp;&nbsp;&nbsp;&nbsp;</div>');
2828    }
2829
2830    if (Drupal.settings.uc_out_of_stock.instock) {
2831      if ($(":input[name=qty]", $(this)).length) {
2832        $(":input[name=qty]", $(this)).after('<div class="uc-out-of-stock-instock"></div>');
2833      }
2834      else {
2835        $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).before('<div class="uc-out-of-stock-instock"></div>');
2836      }
2837    }
2838
2839    $("input:submit.node-add-to-cart,input:submit.list-add-to-cart", $(this)).after('<div class="uc_out_of_stock_html"></div>');
2840    var form = $(this);
2841
2842    $("[name*=attributes]", $(this)).filter(':input:not(:text):not(:checkbox)').change(function(){
2843      checkStock([form]);
2844    });
2845    /* TODO: Feature request - support qty field, would make sense if cart
2846     * contents are checked in the server as well as just stock
2847     */
2848    /*
2849    $(":input[name=qty]", $(this)).keyup(function(){
2850      checkStock(eachForm);
2851    });
2852    */
2853  });
2854
2855  checkStock(forms);
2856};
2857
2858Drupal.theme.prototype.ucOutOfStockInStock = function (stock) {
2859  if (stock == undefined) {
2860    return Drupal.t('In stock');
2861  }
2862  else {
2863    return Drupal.t('@stock in stock', {'@stock' : stock});
2864  }
2865};
2866
2867;
2868
2869/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
2870 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
2871 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
2872 *
2873 * $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $
2874 * $Rev: 2111 $
2875 *
2876 * Version 2.1
2877 */
2878;(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);;
2879
2880;(function($){
2881	/* hoverIntent by Brian Cherne */
2882	$.fn.hoverIntent = function(f,g) {
2883		// default configuration options
2884		var cfg = {
2885			sensitivity: 7,
2886			interval: 100,
2887			timeout: 0
2888		};
2889		// override configuration options with user supplied object
2890		cfg = $.extend(cfg, g ? { over: f, out: g } : f );
2891
2892		// instantiate variables
2893		// cX, cY = current X and Y position of mouse, updated by mousemove event
2894		// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
2895		var cX, cY, pX, pY;
2896
2897		// A private function for getting mouse position
2898		var track = function(ev) {
2899			cX = ev.pageX;
2900			cY = ev.pageY;
2901		};
2902
2903		// A private function for comparing current and previous mouse position
2904		var compare = function(ev,ob) {
2905			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
2906			// compare mouse positions to see if they've crossed the threshold
2907			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
2908				$(ob).unbind("mousemove",track);
2909				// set hoverIntent state to true (so mouseOut can be called)
2910				ob.hoverIntent_s = 1;
2911				return cfg.over.apply(ob,[ev]);
2912			} else {
2913				// set previous coordinates for next time
2914				pX = cX; pY = cY;
2915				// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
2916				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
2917			}
2918		};
2919
2920		// A private function for delaying the mouseOut function
2921		var delay = function(ev,ob) {
2922			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
2923			ob.hoverIntent_s = 0;
2924			return cfg.out.apply(ob,[ev]);
2925		};
2926
2927		// A private function for handling mouse 'hovering'
2928		var handleHover = function(e) {
2929			// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
2930			var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
2931			while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
2932			if ( p == this ) { return false; }
2933
2934			// copy objects to be passed into t (required for event object to be passed in IE)
2935			var ev = jQuery.extend({},e);
2936			var ob = this;
2937
2938			// cancel hoverIntent timer if it exists
2939			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
2940
2941			// else e.type == "onmouseover"
2942			if (e.type == "mouseover") {
2943				// set "previous" X and Y position based on initial entry point
2944				pX = ev.pageX; pY = ev.pageY;
2945				// update "current" X and Y position based on mousemove
2946				$(ob).bind("mousemove",track);
2947				// start polling interval (self-calling timeout) to compare mouse coordinates over time
2948				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
2949
2950			// else e.type == "onmouseout"
2951			} else {
2952				// unbind expensive mousemove event
2953				$(ob).unbind("mousemove",track);
2954				// if hoverIntent state is true, then call the mouseOut function after the specified delay
2955				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
2956			}
2957		};
2958
2959		// bind the function to the two event listeners
2960		return this.mouseover(handleHover).mouseout(handleHover);
2961	};
2962	
2963})(jQuery);;
2964
2965/*
2966 * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget
2967 *
2968 * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him.
2969 * Special thanks to Karl Swedberg for valuable input.
2970 *
2971 * Dual licensed under the MIT and GPL licenses:
2972 * 	http://www.opensource.org/licenses/mit-license.php
2973 * 	http://www.gnu.org/licenses/gpl.html
2974 */
2975
2976(function($){
2977
2978	$.fn.supposition = function(){
2979		var $w = $(window), /*do this once instead of every onBeforeShow call*/
2980			_offset = function(dir) {
2981				return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset']
2982				|| document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft']
2983			    || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft'];
2984			},
2985			onInit = function(){
2986				/* I haven't touched this bit - needs work as there are still z-index issues */
2987				$topNav = $('li',this);
2988				var cZ=parseInt($topNav.css('z-index')) + $topNav.length;
2989				$topNav.each(function() {
2990					$(this).css({zIndex:--cZ});
2991				});
2992			},
2993			onHide = function(){
2994				this.css({marginTop:'',marginLeft:''});
2995			},
2996			onBeforeShow = function(){
2997				this.each(function(){
2998					var $u = $(this);
2999					$u.css('display','block');
3000					var menuWidth = $u.width(),
3001						parentWidth = $u.parents('ul').width(),
3002						totalRight = $w.width() + _offset('x'),
3003						menuRight = $u.offset().left + menuWidth;
3004					if (menuRight > totalRight) {
3005						$u.css('margin-left', ($u.parents('ul').length == 1 ? totalRight - menuRight : -(menuWidth + parentWidth)) + 'px');
3006					}
3007
3008					var windowHeight = $w.height(),
3009						offsetTop = $u.offset().top,
3010						menuHeight = $u.height(),
3011						baseline = windowHeight + _offset('y');
3012					var expandUp = (offsetTop + menuHeight > baseline);
3013					if (expandUp) {
3014						$u.css('margin-top',baseline - (menuHeight + offsetTop));
3015					}
3016					$u.css('display','none');
3017				});
3018			};
3019		
3020		return this.each(function() {
3021			var o = $.fn.superfish.o[this.serial]; /* get this menu's options */
3022			
3023			/* if callbacks already set, store them */
3024			var _onInit = o.onInit,
3025				_onBeforeShow = o.onBeforeShow,
3026				_onHide = o.onHide;
3027				
3028			$.extend($.fn.superfish.o[this.serial],{
3029				onInit		: function() {
3030					onInit.call(this); /* fire our Supposition callback */
3031					_onInit.call(this); /* fire stored callbacks */
3032				},
3033				onBeforeShow: function() {
3034					onBeforeShow.call(this); /* fire our Supposition callback */
3035					_onBeforeShow.call(this); /* fire stored callbacks */
3036				},
3037				onHide		: function() {
3038					onHide.call(this); /* fire our Supposition callback */
3039					_onHide.call(this); /* fire stored callbacks */
3040				}
3041			});
3042		});
3043	};
3044
3045})(jQuery);;
3046
3047/*
3048 * Supersubs v0.2b - jQuery plugin
3049 * Copyright (c) 2008 Joel Birch
3050 *
3051 * Dual licensed under the MIT and GPL licenses:
3052 * 	http://www.opensource.org/licenses/mit-license.php
3053 * 	http://www.gnu.org/licenses/gpl.html
3054 *
3055 *
3056 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
3057 * their longest list item children. If you use this, please expect bugs and report them
3058 * to the jQuery Google Group with the word 'Superfish' in the subject line.
3059 *
3060 */
3061
3062;(function($){ // $ will refer to jQuery within this closure
3063
3064	$.fn.supersubs = function(options){
3065		var opts = $.extend({}, $.fn.supersubs.defaults, options);
3066		// return original object to support chaining
3067		return this.each(function() {
3068			// cache selections
3069			var $$ = $(this);
3070			// support metadata
3071			var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
3072			// get the font size of menu.
3073			// .css('fontSize') returns various results cross-browser, so measure an em dash instead
3074			var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
3075				'padding' : 0,
3076				'position' : 'absolute',
3077				'top' : '-999em',
3078				'width' : 'auto'
3079			}).appendTo($$).width(); //clientWidth is faster, but was incorrect here
3080			// remove em dash
3081			$('#menu-fontsize').remove();
3082			// cache all ul elements
3083			$ULs = $$.find('ul');
3084			// loop through each ul in menu
3085			$ULs.each(function(i) {	
3086				// cache this ul
3087				var $ul = $ULs.eq(i);
3088				// get all (li) children of this ul
3089				var $LIs = $ul.children();
3090				// get all anchor grand-children
3091				var $As = $LIs.children('a');
3092				// force content to one line and save current float property
3093				var liFloat = $LIs.css('white-space','nowrap').css('float');
3094				// remove width restrictions and floats so elements remain vertically stacked
3095				var emWidth = $ul.add($LIs).add($As).css({
3096					'float' : 'none',
3097					'width'	: 'auto'
3098				})
3099				// this ul will now be shrink-wrapped to longest li due to position:absolute
3100				// so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
3101				.end().end()[0].clientWidth / fontsize;
3102				// add more width to ensure lines don't turn over at certain sizes in various browsers
3103				emWidth += o.extraWidth;
3104				// restrict to at least minWidth and at most maxWidth
3105				if (emWidth > o.maxWidth)		{ emWidth = o.maxWidth; }
3106				else if (emWidth < o.minWidth)	{ emWidth = o.minWidth; }
3107				emWidth += 'em';
3108				// set ul to width in ems
3109				$ul.css('width',emWidth);
3110				// restore li floats to avoid IE bugs
3111				// set li width to full width of this ul
3112				// revert white-space to normal
3113				$LIs.css({
3114					'float' : liFloat,
3115					'width' : '100%',
3116					'white-space' : 'normal'
3117				})
3118				// update offset position of descendant ul to reflect new width of parent
3119				.each(function(){
3120					var $childUl = $('>ul',this);
3121					var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
3122					$childUl.css(offsetDirection,emWidth);
3123				});
3124			});
3125			
3126		});
3127	};
3128	// expose defaults
3129	$.fn.supersubs.defaults = {
3130		minWidth		: 9,		// requires em unit.
3131		maxWidth		: 25,		// requires em unit.
3132		extraWidth		: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
3133	};
3134	
3135})(jQuery); // plugin code ends
3136;
3137
3138/*
3139 * Superfish v1.4.8 - jQuery menu widget
3140 * Copyright (c) 2008 Joel Birch
3141 *
3142 * Dual licensed under the MIT and GPL licenses:
3143 * 	http://www.opensource.org/licenses/mit-license.php
3144 * 	http://www.gnu.org/licenses/gpl.html
3145 *
3146 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
3147 */
3148
3149;(function($){
3150	$.fn.superfish = function(op){
3151
3152		var sf = $.fn.superfish,
3153			c = sf.c,
3154			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
3155			over = function(){
3156				var $$ = $(this), menu = getMenu($$);
3157				clearTimeout(menu.sfTimer);
3158				$$.showSuperfishUl().siblings().hideSuperfishUl();
3159			},
3160			out = function(){
3161				var $$ = $(this), menu = getMenu($$), o = sf.op;
3162				clearTimeout(menu.sfTimer);
3163				menu.sfTimer=setTimeout(function(){
3164					o.retainPath=($.inArray($$[0],o.$path)>-1);
3165					$$.hideSuperfishUl();
3166					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
3167				},o.delay);	
3168			},
3169			getMenu = function($menu){
3170				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
3171				sf.op = sf.o[menu.serial];
3172				return menu;
3173			},
3174			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
3175			
3176		return this.each(function() {
3177			var s = this.serial = sf.o.length;
3178			var o = $.extend({},sf.defaults,op);
3179			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
3180				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
3181					.filter('li:has(ul)').removeClass(o.pathClass);
3182			});
3183			sf.o[s] = sf.op = o;
3184			
3185			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
3186				if (o.autoArrows) addArrow( $('>a:first-child',this) );
3187			})
3188			.not('.'+c.bcClass)
3189				.hideSuperfishUl();
3190			
3191			var $a = $('a',this);
3192			$a.each(function(i){
3193				var $li = $a.eq(i).parents('li');
3194				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
3195			});
3196			o.onInit.call(this);
3197			
3198		}).each(function() {
3199			menuClasses = [c.menuClass];
3200			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
3201			$(this).addClass(menuClasses.join(' '));
3202		});
3203	};
3204
3205	var sf = $.fn.superfish;
3206	sf.o = [];
3207	sf.op = {};
3208	sf.IE7fix = function(){
3209		var o = sf.op;
3210		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
3211			this.toggleClass(sf.c.shadowClass+'-off');
3212		};
3213	sf.c = {
3214		bcClass     : 'sf-breadcrumb',
3215		menuClass   : 'sf-js-enabled',
3216		anchorClass : 'sf-with-ul',
3217		arrowClass  : 'sf-sub-indicator',
3218		shadowClass : 'sf-shadow'
3219	};
3220	sf.defaults = {
3221		hoverClass	: 'sfHover',
3222		pathClass	: 'overideThisToUse',
3223		pathLevels	: 1,
3224		delay		: 800,
3225		animation	: {opacity:'show'},
3226		speed		: 'normal',
3227		autoArrows	: true,
3228		dropShadows : true,
3229		disableHI	: false,		// true disables hoverIntent detection
3230		onInit		: function(){}, // callback functions
3231		onBeforeShow: function(){},
3232		onShow		: function(){},
3233		onHide		: function(){}
3234	};
3235	$.fn.extend({
3236		hideSuperfishUl : function(){
3237			var o = sf.op,
3238				not = (o.retainPath===true) ? o.$path : '';
3239			o.retainPath = false;
3240			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
3241					.find('>ul').hide().css('visibility','hidden');
3242			o.onHide.call($ul);
3243			return this;
3244		},
3245		showSuperfishUl : function(){
3246			var o = sf.op,
3247				sh = sf.c.shadowClass+'-off',
3248				$ul = this.addClass(o.hoverClass)
3249					.find('>ul:hidden').css('visibility','visible');
3250			sf.IE7fix.call($ul);
3251			o.onBeforeShow.call($ul);
3252			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
3253			return this;
3254		}
3255	});
3256
3257})(jQuery);
3258;
3259
3260Drupal.behaviors.fusionEqualheights = function (context) {
3261  if (jQuery().equalHeights) {
3262    $("#header-top-wrapper div.equal-heights div.content").equalHeights();
3263    $("#header-group-wrapper div.equal-heights div.content").equalHeights();
3264    $("#preface-top-wrapper div.equal-heights div.content").equalHeights();
3265    $("#preface-bottom div.equal-heights div.content").equalHeights();
3266    $("#sidebar-first div.equal-heights div.content").equalHeights();
3267    $("#content-top div.equal-heights div.content").equalHeights();
3268    $("#content-region div.equal-heights div.content").equalHeights();
3269    $("#content-bottom div.equal-heights div.content").equalHeights();
3270    $("#node-top div.equal-heights div.content").equalHeights();
3271    $("#node-bottom div.equal-heights div.content").equalHeights();
3272    $("#sidebar-last div.equal-heights div.content").equalHeights();
3273    $("#postscript-top div.equal-heights div.content").equalHeights();
3274    $("#postscript-bottom-wrapper div.equal-heights div.content").equalHeights();
3275    $("#footer-wrapper div.equal-heights div.content").equalHeights();
3276  }
3277};
3278
3279Drupal.behaviors.fusionIE6fixes = function (context) {
3280  // IE6 & less-specific functions
3281  // Add hover class to primary menu li elements on hover
3282  if ($.browser.msie && ($.browser.version < 7)) {
3283    $('form input.form-submit').hover(function() {
3284      $(this).addClass('hover');
3285      }, function() {
3286        $(this).removeClass('hover');
3287    });
3288    $('#primary-menu ul.sf-menu li.expanded').hover(function() {
3289      $(this).addClass('hover');
3290      }, function() {
3291        $(this).removeClass('hover');
3292    });
3293    $('.sf-menu li').hover(function() {
3294      $(this).addClass('hover');
3295      }, function() {
3296        $(this).removeClass('hover');
3297    });
3298    $('#search input#search_header').hover(function() {
3299      $(this).addClass('hover');
3300      }, function() {
3301        $(this).removeClass('hover');
3302    });
3303  };
3304};
3305
3306Drupal.behaviors.fusionOverlabel = function (context) {
3307  if (jQuery().overlabel) {
3308    $("div.fusion-horiz-login label").overlabel();
3309  }
3310};
3311
3312Drupal.behaviors.fusionSuperfish = function (context) {
3313  $("#primary-menu ul.sf-menu").superfish({
3314    hoverClass:  'sfHover',
3315    delay:       250,
3316    animation:   {opacity:'show',height:'show'},
3317    speed:       'fast',
3318    autoArrows:  false,
3319    dropShadows: false,
3320    disableHI:   true
3321  }).supposition();
3322};
3323
3324Drupal.behaviors.fusionSuperfishBlocks = function (context) {
3325  $("div.block ul.sf-menu").superfish({
3326    hoverClass:  'sfHover',
3327    delay:       250,
3328    animation:   {opacity:'show',height:'show'},
3329    speed:       'fast',
3330    autoArrows:  false,
3331    dropShadows: false,
3332    disableHI:   true
3333  }).supposition();
3334};
3335
3336Drupal.behaviors.fusionGridMask = function (context) {
3337  if ($('body.grid-mask-enabled').size() > 0) {
3338    var grid_width_pos = parseInt($('body').attr('class').indexOf('grid-width-')) + 11;
3339    var grid_width = $('body').attr('class').substring(grid_width_pos, grid_width_pos + 2);
3340    var grid = '<div id="grid-mask-overlay" class="full-width"><div class="row">';
3341    for (i = 1; i <= grid_width; i++) {
3342      grid += '<div class="block grid' + grid_width + '-1"><div class="inner"></div></div>';
3343    }
3344    grid += '</div></div>';
3345    $('body.grid-mask-enabled').prepend(grid);
3346    $('#grid-mask-overlay .row').addClass('grid' + grid_width + '-' + grid_width);
3347    $('#grid-mask-overlay .block .inner').height($('body').height());
3348  }
3349};
3350
3351Drupal.behaviors.fusionGridMaskToggle = function (context) {
3352  if ($('body.grid-mask-enabled').size() > 0) {
3353    $('body.grid-mask-enabled').prepend('<div id="grid-mask-toggle">grid</div>');
3354    $('div#grid-mask-toggle')
3355      .toggle( function () {
3356        $(this).toggleClass('grid-on');
3357        $('body').toggleClass('grid-mask');
3358      },
3359      function() {
3360        $(this).toggleClass('grid-on');
3361        $('body').toggleClass('grid-mask');
3362      });
3363  }
3364};
3365
3366Drupal.behaviors.fusionPanelsShowEdit = function (context) {
3367  // Sets parent row and block elements to have "overflow: visible" if editing Panel page
3368  if ($("#panels-edit-display-form").size() > 0 || $("#page-manager-edit").size() > 0) {
3369    $("#panels-edit-display-form").parents('.row, .block').css("overflow", "visible");
3370    $("#page-manager-edit").parents('.row, .block').css("overflow", "visible");
3371  }
3372};
3373
3374Drupal.behaviors.fusionScreenshotpreview = function (context) {
3375  // Displays Skinr previews
3376  if ($('span.preview-icon').size() > 0) {
3377    // configure distance of preview from the cursor
3378    var xOffset = 20;
3379    var yOffset = 0;
3380  
3381    $('span.preview-icon').hover(function(e){
3382      var img_class = this.id;
3383      var caption = $(this).parent().text();
3384      // add preview markup
3385      $('body').append('<div id="screenshot">' +
3386                       '<div class="screenshot-preview ' + img_class + '" alt="preview"></div>' + 
3387                       '<div class="screenshot-caption">' + caption + '</div>' +
3388                       '</div>');
3389      $("#screenshot").hide();  // hide preview until dimensions are set
3390      $("#screenshot").css("left", (e.pageX + xOffset) + "px").css("top", (e.pageY + yOffset) + "px");  // set initial preview position
3391      // load image in order to set preview dimensions
3392      var img = new Image();
3393      img.onload = function() {
3394        var caption_height = parseFloat($("#screenshot .screenshot-caption").css("height"));
3395        $("#screenshot").css("height", img.height + caption_height);
3396        $("#screenshot").css("width", img.width);
3397        $("#screenshot ." + img_class).css("height", img.height);
3398        $("#screenshot ." + img_class).css("width", img.width);
3399        $("#screenshot .screenshot-caption").css("width", img.width - 10);
3400        $("#screenshot").fadeIn("fast");  // now show preview
3401      }
3402      img.src = $("." + img_class).css("background-image").replace(/^url|[\(\)\"]/g, '');
3403    },
3404    function(){
3405      $("#screenshot").remove();
3406    });
3407    // adjust preview position with cursor movement
3408    $("span.preview-icon").mousemove(function(e){
3409      $("#screenshot").css("left", (e.pageX + xOffset) + "px").css("top", (e.pageY + yOffset) + "px");
3410    });
3411  }
3412};
3413;
3414/**
3415 * Equal Heights Plugin
3416 * Equalize the heights of elements. Great for columns or any elements
3417 * that need to be the same size (floats, etc).
3418 *
3419 * Version 1.0
3420 * Updated 12/10/2008
3421 *
3422 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com)
3423 *
3424 * Usage: $(object).equalHeights([minHeight], [maxHeight]);
3425 *
3426 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
3427 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
3428 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
3429 * than 300 pixels tall. Elements with too much content will gain a scrollbar.
3430 *
3431 */
3432
3433(function($) {
3434	$.fn.equalHeights = function(minHeight, maxHeight) {
3435		tallest = (minHeight) ? minHeight : 0;
3436		this.each(function() {
3437			if($(this).height() > tallest) {
3438				tallest = $(this).height();
3439			}
3440		});
3441		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
3442		return this.each(function() {
3443			$(this).height(tallest).css("overflow","auto");
3444		});
3445	}
3446})(jQuery);
3447
3448
3449;
3450/**
3451 * Logica javascript (miscellanea) del progetto 
3452 */
3453
3454var marcianum = (function( $ ) {
3455	
3456	var css3_supported = $.support.opacity;
3457	
3458	Drupal.behaviors.dropdown_selects = function( context ) {
3459		
3460		// abbellisco form di ricerca, riciclando il js del dropdown select
3461		// devo fare qualcosa solo in caso ci sia il plugin aggiunto dal modulo
3462		if ( undefined !== $.fn.msDropDown ) {
3463			// @TODO: sono queste settings corrette per ogni dropdown del sito?
3464			var msddSettings = Drupal.settings.langDropdown.jsWidget;
3465		    $( 'select.dropdown-select:not(.processed)', context ).msDropDown({
3466		      visibleRows: msddSettings.visibleRows,
3467		      rowHeight: msddSettings.rowHeight,
3468		      animStyle: msddSettings.animStyle
3469		    }).addClass( 'processed' );
3470		    
3471		}
3472	    
3473	};
3474	
3475	// realizza la logica show/hide dei widget di login e del carrello
3476	$(document).ready( function() {
3477		
3478
3479		
3480		if ($('li#menu-mlid-1235').click(function() {
3481			$('li#menu-mlid-1235 ul.menu').toggle();
3482			$( "#block-menu-menu-marcianum-press-menu li" ).each(function() {
3483				$(this).removeClass('active-trail');
3484			});
3485			$('li#menu-mlid-1235').addClass('active-trail');
3486			$('li#menu-mlid-1235 a').addClass('active');
3487
3488		}));
3489
3490		
3491		if ($('li#menu-mlid-2675').click(function() {
3492			$('li#menu-mlid-2675 ul.menu').toggle();
3493			$( "#block-menu-menu-marcianum-press-menu li" ).each(function() {
3494				$(this).removeClass('active-trail');
3495			});
3496			$('li#menu-mlid-2675').addClass('active-trail');
3497			$('li#menu-mlid-2675 a').addClass('active');
3498
3499		}));
3500
3501
3502		if ($('li#menu-mlid-2688').click(function() {
3503			$('li#menu-mlid-2688 ul.menu').toggle();
3504			$( "#block-menu-menu-marcianum-press-menu li" ).each(function() {
3505				$(this).removeClass('active-trail');
3506			});
3507		}));
3508
3509
3510		
3511
3512		
3513		
3514		$('#pid-libri-categorie-catalogo-generale li#menu-mlid-2688').addClass('active-trail');
3515		$('#pid-libri-categorie-catalogo-generale li#menu-mlid-12945').addClass('active-trail');
3516
3517		$('#pid-libri-categorie-catalogo-scientifico li#menu-mlid-2688').addClass('active-trail');
3518		$('#pid-libri-categorie-catalogo-scientifico li#menu-mlid-12947').addClass('active-trail');
3519
3520		$('#pid-libri-categorie-marcianum-young li#menu-mlid-2688').addClass('active-trail');
3521		$('#pid-libri-categorie-marcianum-young li#menu-mlid-12949').addClass('active-trail');
3522		
3523		
3524		$('#pid-libri-categorie-catalogo-generale li#menu-mlid-2675').addClass('active-trail');
3525		$('#pid-libri-categorie-catalogo-generale li#menu-mlid-12944').addClass('active-trail');
3526
3527		$('#pid-libri-categorie-catalogo-scientifico li#menu-mlid-2675').addClass('active-trail');
3528		$('#pid-libri-categorie-catalogo-scientifico li#menu-mlid-12946').addClass('active-trail');
3529
3530		$('#pid-libri-categorie-marcianum-young li#menu-mlid-2675').addClass('active-trail');
3531		$('#pid-libri-categorie-marcianum-young li#menu-mlid-12948').addClass('active-trail');
3532
3533		
3534		
3535		
3536		
3537		
3538		$('#pid-riviste-categorie li#menu-mlid-2716').addClass('active-trail');
3539
3540		$('#pid-riviste-marcianum li#menu-mlid-2716').addClass('active-trail');
3541		$('#pid-riviste-marcianum li#menu-mlid-2723').addClass('active-trail');		
3542		
3543		$('#pid-riviste-ephemerides-iuris-canonici li#menu-mlid-2716').addClass('active-trail');
3544		$('#pid-riviste-ephemerides-iuris-canonici li#menu-mlid-2724').addClass('active-trail');
3545
3546		$('#pid-content-oasis-journal li#menu-mlid-2716').addClass('active-trail');
3547		$('#pid-content-oasis-journal li#menu-mlid-2725').addClass('active-trail');
3548
3549		
3550	
3551		
3552		$('#pid-riviste-categorie li#menu-mlid-2689').addClass('active-trail');
3553
3554		$('#pid-riviste-marcianum li#menu-mlid-2689').addClass('active-trail');
3555		$('#pid-riviste-marcianum li#menu-mlid-2690').addClass('active-trail');		
3556		
3557		$('#pid-riviste-ephemerides-iuris-canonici li#menu-mlid-2689').addClass('active-trail');
3558		$('#pid-riviste-ephemerides-iuris-canonici li#menu-mlid-2691').addClass('active-trail');
3559
3560		$('#pid-content-oasis-journal li#menu-mlid-2689').addClass('active-trail');
3561		$('#pid-content-oasis-journal li#menu-mlid-2692').addClass('active-trail');
3562
3563				
3564		
3565		
3566		
3567		
3568	    if ($('#block-block-138 .content').find("img").length > 0) {
3569	        //creo il popup
3570			$('<div id="popupdiv" class="fancybox-wrap fancybox-desktop fancybox-type-html fancybox-opened" />').html('<div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner">'+ $('#block-block-138 .content').html() + '</div></div><div class="fancybox-item fancybox-close" title="Close"></div></div>'   ).appendTo($('body'));
3571
3572			 var imgWidth =$('#popupdiv').width();
3573			 var imgHeight =$('#popupdiv').height();
3574				
3575			 var styles = {
3576					 "margin-left": -1*imgWidth/2,
3577					 "margin-top": -1*imgHeight/2,
3578					 "left": '50%',
3579					 "top":'50%',
3580					 "position": 'fixed'
3581					 };
3582			
3583			$('#popupdiv').css( styles );
3584			
3585			$('.fancybox-close').click(function(){
3586				$('#popupdiv').remove();
3587			    $('#fancybox-overlay').remove();
3588			});
3589			
3590			$('<div id="fancybox-overlay" style="cursor: pointer; opacity: 0.6;" class="overlay-fixed"></div>').appendTo($('body'));
3591	
3592	      } else {
3593	    	  
3594	    }
3595
3596		
3597
3598		
3599		
3600		var widgets = {};
3601		
3602		function widget( container, close_on_load ) {
3603			var $widget = $( container ),
3604				$open = $widget.find( '.title a' ),
3605				$close = $widget.find( '.closebtn' );
3606			
3607			if ( 0 === $widget.size() ) {
3608				return;
3609			}
3610			
3611			$widget.addClass( 'widget' );
3612			
3613			$open.click( function( ev ) {
3614				ev.preventDefault();
3615				ev.stopPropagation();
3616				
3617				$widget
3618					.toggleClass( 'widget-close' )
3619					.toggleClass( 'widget-open' );
3620				
3621				// chiudi tutti i widget tranne quello corrente
3622				widgets_close( $widget[0] );
3623				
3624			} );
3625			
3626			$close.click( function() {
3627				$open.click();
3628			} );
3629			
3630			// iconcina chiudi
3631			$close
3632				.clone( true )
3633				.addClass( 'ico-close' )
3634				.appendTo( $widget.find( '.content div:first' ) );
3635		}
3636		
3637		function widgets_close( except ) {
3638			$( '.block.widget' ).each( function() {
3639				if ( !except || except != this ) {
3640					$(this)
3641						.removeClass( 'widget-open' )
3642						.addClass( 'widget-close' );
3643				}
3644			} );
3645		}
3646		
3647		function widgets_close_selector( selector ) {
3648			$( '.block.widget' + selector )
3649				.removeClass( 'widget-open' )
3650				.addClass( 'widget-close' );
3651		}
3652		
3653		// widget di login aperto se login errato (evita di riaprire manualmente)
3654		if ( $( '#block-user-0 .error' ).size() > 0 ) {
3655			$( '#block-user-0' ).addClass( 'widget-open' );
3656		}
3657		
3658		// elenco dei widget nel sito
3659		// @TODO: forse sarebbe meglio associare una classe e fare un behavior?
3660		widget( '#block-block-4' );
3661		widget( '#block-uc_cart-0' );
3662		widget( '#block-user-0' );
3663		widget( '#block-marcianum_press-user_profile' );
3664		
3665		$(document.body).click( function( ev ) {
3666			var target = ev.originalTarget || ev.srcElement,
3667				$target = $( target ),
3668				$widget = $target.parents( '.widget' );
3669			
3670			if ( (0 === $widget.size()) && !$target.is( '.widget' ) ) {
3671				// chiudi widget se clicco in altri punti della pagina
3672				widgets_close();
3673			}
3674		} );
3675		
3676		$( '.not-logged-in a.whishlisttoggle' ).click( function( ev ) {
3677			ev.preventDefault();
3678			ev.stopPropagation();
3679			$( 'a.logintoggle' ).click();
3680		} ).parents( '.block' ).addClass( 'widget' );
3681		
3682		widgets_close_selector( ':not(.widget-open)' );
3683		
3684	} );
3685	
3686	var exports = {};	
3687	return exports;
3688	
3689}( jQuery ));;
3690/**
3691 * Logica javascript relativa alle pagine di ecommerce 
3692 */
3693
3694if ( typeof( marcianum ) == 'undefined' ) {
3695	var marcianum = {};
3696}
3697
3698marcianum.shop = (function( $ ) {
3699	
3700	$(document).ready( function() {
3701
3702
3703		
3704		
3705		
3706		var $label = jQuery('#edit-panes-payment-payment-method-paypal-wps-wrapper label');
3707
3708		// Controlliamo che l'elemento esista e abbia del contenuto
3709		if ($label.length > 0 && $label.html() !== null) {
3710			var currentHtml = $label.html();
3711			var newHtml = currentHtml.replace('PayPal', 'Paypal / Carta di credito');
3712			$label.html(newHtml);
3713		}
3714
3715
3716		//var $logo = $label.find('img');
3717		//$label.append($logo);
3718
3719		jQuery('#paypal-includes').prevAll('img').after('<p style="font-size: 16px;">selezionando questa modalità di pagamento si verrà indirizzati al portale PayPal dove sarà possibile <strong>pagare con carta di credito</strong> anche senza essere registrati. Basterà dichiarare di non avere un account PayPal ed inserire le informazioni della propria carta</p>');
3720
3721
3722
3723		$('#extra_information-pane').hide();
3724		
3725		$("#uc-cart-checkout-form input[type='radio']").change(function() {
3726			$('#extra_information-pane').hide();
3727			
3728			if ($("#uc-cart-checkout-form input[type='radio']:checked").val() !== undefined) {
3729				if($("#uc-cart-checkout-form input[type='radio']:checked").val().length>0){
3730					var customclass = $("#uc-cart-checkout-form input[type='radio']:checked").val();
3731					$('.form-radio').addClass(customclass);
3732					/*if(customclass=='buono_scuola'){
3733						$('#extra_information-pane').show();
3734						if($("#uc-cart-checkout-form #edit-panes-extra-information-extra-fields-ucxf-codice-docente-wrapper input[type='text']").val().length<0){
3735							 alert('compilare il campo codice scuola');
3736						}
3737					}*/
3738					
3739				}
3740			}
3741		});
3742		
3743		$("#uc-cart-checkout-form input[type='radio']").trigger("change");
3744		
3745		/*$('#uc-cart-checkout-form').submit(function(e) {
3746			if ($('#edit-panes-extra-information-extra-fields-ucxf-codice-docente').val().length == 0) {
3747			      $(this).parents('p').addClass('warning');
3748			      alert('compilare il campo codice scuola');
3749			      e.preventDefault();
3750			} 
3751		});
3752		
3753		*/
3754		
3755		
3756/*
3757
3758		if ($('.uc-cart-checkout-form').click(function() {
3759			if($("#uc-cart-checkout-form input[type='radio']:checked").val().length>0){
3760				$('.form-radio').addClass(customclass);
3761				alert('aaa'+customclass);s
3762				if(customclass=='buono_scuola'){
3763					if($("#uc-cart-checkout-form #edit-panes-extra-information-extra-fields-ucxf-codice-docente-wrapper input[type='text']").val().length<0){
3764						alert('indicare il codice');
3765					}
3766				}
3767			}
3768		}));*/	
3769		
3770		
3771		// scheda prodotto
3772		if ( $( '#product-details' ).size() > 0 ) {
3773			
3774			// forzo un valore valido per campo quantita'
3775			$( '#product-details .qtyfield input' ).keyup( function( ev ) {
3776
3777				var val = $(this).val();
3778				if($.trim(val)=='') return;
3779				value = parseInt( val, 10 );
3780				
3781				if ( 0 == value || isNaN( value ) ) {
3782					value = 1;
3783				}
3784				
3785				$(this).val( value );
3786
3787				var valore_uno=$('#single_item_sellprice .numbers').text();
3788				var currency = $('#single_item_sellprice .currency').text();
3789				var img=$('.submitlink-add-to-cart .strow img');
3790				
3791				var prezzo = (valore_uno*value).toFixed(2);				
3792				$('.submitlink-add-to-cart .strow').html(' '+prezzo+' '+currency ).prepend(img);				
3793				
3794			} ).change(function(ev){
3795				var val = $(this).val();
3796				value = parseInt( val, 10 );
3797				
3798				if ( 0 == value || isNaN( value ) ) {
3799					value = 1;
3800				}
3801				
3802				$(this).val( value );
3803				
3804				var valore_uno=$('#single_item_sellprice .numbers').text();
3805				var currency = $('#single_item_sellprice .currency').text();
3806				var img=$('.submitlink-add-to-cart .strow img');
3807				
3808				var prezzo = (valore_uno*value).toFixed(2);				
3809				$('.submitlink-add-to-cart .strow').html(' '+prezzo+' '+currency ).prepend(img);
3810				
3811			}); 
3812		}
3813
3814		if ( $( '#uc-cart-checkout-form' ).size() > 0 ) {
3815			// form checkout
3816			$('#edit-continue').click(function(evt){
3817				if($('input[name=quote-form]').val()==''){
3818					evt.preventDefault();
3819					var target_offset = $("a[name=edit-panes-quotes-quote-anchor]").offset();
3820					var target_top = target_offset.top - 50;
3821					//goto that anchor by setting the body scroll top to anchor top
3822					$('html, body').animate({scrollTop:target_top}, 1000);
3823					alert(Drupal.t('Per favore aggiorna i costi di spedizione, cliccando sull\'apposito pulsante.'));
3824				}
3825			});
3826			
3827			if ( $( 'a[name=edit-panes-quotes-quote-anchor]' ).size() == 0 ) {
3828				$('<a name="edit-panes-quotes-quote-anchor"></a>
3828').insertBefore('#quotes-pane');
3829			}
3830			
3831		}
3832		
3833		
3834	} );
3835
3836	var exports = {};
3837	return exports;
3838	
3839}( jQuery ));;

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