1/* 2 * Shadowbox.js, version 3.0.3 3 * http://shadowbox-js.com/ 4 * 5 * Copyright 2007-2010, Michael J. I. Jackson 6 * Date: 2011-05-14 08:08:40 +0000 7 */ 8(function(au,k){var Q={version:"3.0.3"};var J=navigator.userAgent.toLowerCase();if(J.indexOf("windows")>-1||J.indexOf("win32")>-1){Q.isWindows=true}else{if(J.indexOf("macintosh")>-1||J.indexOf("mac os x")>-1){Q.isMac=true}else{if(J.indexOf("linux")>-1){Q.isLinux=true}}}Q.isIE=J.indexOf("msie")>-1;Q.isIE6=J.indexOf("msie 6")>-1;Q.isIE7=J.indexOf("msie 7")>-1;Q.isGecko=J.indexOf("gecko")>-1&&J.indexOf("safari")==-1;Q.isWebKit=J.indexOf("applewebkit/")>-1;var ab=/#(.+)$/,af=/^(light|shadow)box\[(.*?)\]/i,az=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,f=/[0-9a-z]+$/i,aD=/(.+\/)shadowbox\.js/i;var A=false,a=false,l={},z=0,R,ap;Q.current=-1;Q.dimensions=null;Q.ease=function(K){return 1+Math.pow(K-1,3)};Q.errorInfo={fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}};Q.gallery=[];Q.onReady=aj;Q.path=null;Q.player=null;Q.playerId="sb-player";Q.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:aj,onClose:aj,onFinish:aj,onOpen:aj,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};Q.getCurrent=function(){return Q.current>-1?Q.gallery[Q.current]:null};Q.hasNext=function(){return Q.gallery.length>1&&(Q.current!=Q.gallery.length-1||Q.options.continuous)};Q.isOpen=function(){return A};Q.isPaused=function(){return ap=="pause"};Q.applyOptions=function(K){l=aC({},Q.options);aC(Q.options,K)};Q.revertOptions=function(){aC(Q.options,l)};Q.init=function(aG,aJ){if(a){return}a=true;if(Q.skin.options){aC(Q.options,Q.skin.options)}if(aG){aC(Q.options,aG)}if(!Q.path){var aI,S=document.getElementsByTagName("script");for(var aH=0,K=S.length;aH<K;++aH){aI=aD.exec(S[aH].src);if(aI){Q.path=aI[1];break}}}if(aJ){Q.onReady=aJ}P()};Q.open=function(S){if(A){return}var K=Q.makeGallery(S);Q.gallery=K[0];Q.current=K[1];S=Q.getCurrent();if(S==null){return}Q.applyOptions(S.options||{});G();if(Q.gallery.length){S=Q.getCurrent();if(Q.options.onOpen(S)===false){return}A=true;Q.skin.onOpen(S,c)}};Q.close=function(){if(!A){return}A=false;if(Q.player){Q.player.remove();Q.player=null}if(typeof ap=="number"){clearTimeout(ap);ap=null}z=0;aq(false);Q.options.onClose(Q.getCurrent());Q.skin.onClose();Q.revertOptions()};Q.play=function(){if(!Q.hasNext()){return}if(!z){z=Q.options.slideshowDelay*1000}if(z){R=aw();ap=setTimeout(function(){z=R=0;Q.next()},z);if(Q.skin.onPlay){Q.skin.onPlay()}}};Q.pause=function(){if(typeof ap!="number"){return}z=Math.max(0,z-(aw()-R));if(z){clearTimeout(ap);ap="pause";if(Q.skin.onPause){Q.skin.onPause()}}};Q.change=function(K){if(!(K in Q.gallery)){if(Q.options.continuous){K=(K<0?Q.gallery.length+K:0);if(!(K in Q.gallery)){return}}else{return}}Q.current=K;if(typeof ap=="number"){clearTimeout(ap);ap=null;z=R=0}Q.options.onChange(Q.getCurrent());c(true)};Q.next=function(){Q.change(Q.current+1)};Q.previous=function(){Q.change(Q.current-1)};Q.setDimensions=function(aS,aJ,aQ,aR,aI,K,aO,aL){var aN=aS,aH=aJ;var aM=2*aO+aI;if(aS+aM>aQ){aS=aQ-aM}var aG=2*aO+K;if(aJ+aG>aR){aJ=aR-aG}var S=(aN-aS)/aN,aP=(aH-aJ)/aH,aK=(S>0||aP>0);if(aL&&aK){if(S>aP){aJ=Math.round((aH/aN)*aS)}else{if(aP>S){aS=Math.round((aN/aH)*aJ)}}}Q.dimensions={height:aS+aI,width:aJ+K,innerHeight:aS,innerWidth:aJ,top:Math.floor((aQ-(aS+aM))/2+aO),left:Math.floor((aR-(aJ+aG))/2+aO),oversized:aK};return Q.dimensions};Q.makeGallery=function(aI){var K=[],aH=-1;if(typeof aI=="string"){aI=[aI]}if(typeof aI.length=="number"){aF(aI,function(aK,aL){if(aL.content){K[aK]=aL}else{K[aK]={content:aL}}});aH=0}else{if(aI.tagName){var S=Q.getCache(aI);aI=S?S:Q.makeObject(aI)}if(aI.gallery){K=[];var aJ;for(var aG in Q.cache){aJ=Q.cache[aG];if(aJ.gallery&&aJ.gallery==aI.gallery){if(aH==-1&&aJ.content==aI.content){aH=K.length}K.push(aJ)}}if(aH==-1){K.unshift(aI);aH=0}}else{K=[aI];aH=0}}aF(K,function(aK,aL){K[aK]=aC({},aL)});return[K,aH]};Q.makeObject=function(aH,aG){var aI={content:aH.href,title:aH.getAttribute("title")||"",link:aH};if(aG){aG=aC({},aG);aF(["player","title","height","width","gallery"],function(aJ,aK){if(typeof aG[aK]!="undefined"){aI[aK]=aG[aK];delete aG[aK]}});aI.options=aG}else{aI.options={}}if(!aI.player){aI.player=Q.getPlayer(aI.content)}var K=aH.getAttribute("rel");if(K){var S=K.match(af);if(S){aI.gallery=escape(S[2])}aF(K.split(";"),function(aJ,aK){S=aK.match(az);if(S){aI[S[1]]=S[2]}})}return aI};Q.getPlayer=function(aG){if(aG.indexOf("#")>-1&&aG.indexOf(document.location.href)==0){return"inline"}var aH=aG.indexOf("?");if(aH>-1){aG=aG.substring(0,aH)}var S,K=aG.match(f);if(K){S=K[0].toLowerCase()}if(S){if(Q.img&&Q.img.ext.indexOf(S)>-1){return"img"}if(Q.swf&&Q.swf.ext.indexOf(S)>-1){return"swf"}if(Q.flv&&Q.flv.ext.indexOf(S)>-1){return"flv"}if(Q.qt&&Q.qt.ext.indexOf(S)>-1){if(Q.wmp&&Q.wmp.ext.indexOf(S)>-1){return"qtwmp"}else{return"qt"}}if(Q.wmp&&Q.wmp.ext.indexOf(S)>-1){return"wmp"}}return"iframe"};function G(){var aH=Q.errorInfo,aI=Q.plugins,aK,aL,aO,aG,aN,S,aM,K;for(var aJ=0;aJ<Q.gallery.length;++aJ){aK=Q.gallery[aJ];aL=false;aO=null;switch(aK.player){case"flv":case"swf":if(!aI.fla){aO="fla"}break;case"qt":if(!aI.qt){aO="qt"}break;
8case"wmp":if(Q.isMac){if(aI.qt&&aI.f4m){aK.player="qt"}else{aO="qtf4m"}}else{if(!aI.wmp){aO="wmp"}}break;case"qtwmp":if(aI.qt){aK.player="qt"}else{if(aI.wmp){aK.player="wmp"}else{aO="qtwmp"}}break}if(aO){if(Q.options.handleUnsupported=="link"){switch(aO){case"qtf4m":aN="shared";S=[aH.qt.url,aH.qt.name,aH.f4m.url,aH.f4m.name];break;case"qtwmp":aN="either";S=[aH.qt.url,aH.qt.name,aH.wmp.url,aH.wmp.name];break;default:aN="single";S=[aH[aO].url,aH[aO].name]}aK.player="html";aK.content='<div class="sb-message">'+s(Q.lang.errors[aN],S)+"</div>"}else{aL=true}}else{if(aK.player=="inline"){aG=ab.exec(aK.content);if(aG){aM=ad(aG[1]);if(aM){aK.content=aM.innerHTML}else{aL=true}}else{aL=true}}else{if(aK.player=="swf"||aK.player=="flv"){K=(aK.options&&aK.options.flashVersion)||Q.options.flashVersion;if(Q.flash&&!Q.flash.hasFlashPlayerVersion(K)){aK.width=310;aK.height=177}}}}if(aL){Q.gallery.splice(aJ,1);if(aJ<Q.current){--Q.current}else{if(aJ==Q.current){Q.current=aJ>0?aJ-1:aJ}}--aJ}}}function aq(K){if(!Q.options.enableKeys){return}(K?F:M)(document,"keydown",an)}function an(aG){if(aG.metaKey||aG.shiftKey||aG.altKey||aG.ctrlKey){return}var S=v(aG),K;switch(S){case 81:case 88:case 27:K=Q.close;break;case 37:K=Q.previous;break;case 39:K=Q.next;break;case 32:K=typeof ap=="number"?Q.pause:Q.play;break}if(K){n(aG);K()}}function c(aK){aq(false);var aJ=Q.getCurrent();var aG=(aJ.player=="inline"?"html":aJ.player);if(typeof Q[aG]!="function"){throw"unknown player "+aG}if(aK){Q.player.remove();Q.revertOptions();Q.applyOptions(aJ.options||{})}Q.player=new Q[aG](aJ,Q.playerId);if(Q.gallery.length>1){var aH=Q.gallery[Q.current+1]||Q.gallery[0];if(aH.player=="img"){var S=new Image();S.src=aH.content}var aI=Q.gallery[Q.current-1]||Q.gallery[Q.gallery.length-1];if(aI.player=="img"){var K=new Image();K.src=aI.content}}Q.skin.onLoad(aK,W)}function W(){if(!A){return}if(typeof Q.player.ready!="undefined"){var K=setInterval(function(){if(A){if(Q.player.ready){clearInterval(K);K=null;Q.skin.onReady(e)}}else{clearInterval(K);K=null}},10)}else{Q.skin.onReady(e)}}function e(){if(!A){return}Q.player.append(Q.skin.body,Q.dimensions);Q.skin.onShow(I)}function I(){if(!A){return}if(Q.player.onLoad){Q.player.onLoad()}Q.options.onFinish(Q.getCurrent());if(!Q.isPaused()){Q.play()}aq(true)}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(S,aG){var K=this.length>>>0;aG=aG||0;if(aG<0){aG+=K}for(;aG<K;++aG){if(aG in this&&this[aG]===S){return aG}}return -1}}function aw(){return(new Date).getTime()}function aC(K,aG){for(var S in aG){K[S]=aG[S]}return K}function aF(aH,aI){var S=0,K=aH.length;for(var aG=aH[0];S<K&&aI.call(aG,S,aG)!==false;aG=aH[++S]){}}function s(S,K){return S.replace(/\{(\w+?)\}/g,function(aG,aH){return K[aH]})}function aj(){}function ad(K){return document.getElementById(K)}function C(K){K.parentNode.removeChild(K)}var h=true,x=true;function d(){var K=document.body,S=document.createElement("div");h=typeof S.style.opacity==="string";S.style.position="fixed";S.style.margin=0;S.style.top="20px";K.appendChild(S,K.firstChild);x=S.offsetTop==20;K.removeChild(S)}Q.getStyle=(function(){var K=/opacity=([^)]*)/,S=document.defaultView&&document.defaultView.getComputedStyle;return function(aJ,aI){var aH;if(!h&&aI=="opacity"&&aJ.currentStyle){aH=K.test(aJ.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return aH===""?"1":aH}if(S){var aG=S(aJ,null);if(aG){aH=aG[aI]}if(aI=="opacity"&&aH==""){aH="1"}}else{aH=aJ.currentStyle[aI]}return aH}})();Q.appendHTML=function(aG,S){if(aG.insertAdjacentHTML){aG.insertAdjacentHTML("BeforeEnd",S)}else{if(aG.lastChild){var K=aG.ownerDocument.createRange();K.setStartAfter(aG.lastChild);var aH=K.createContextualFragment(S);aG.appendChild(aH)}else{aG.innerHTML=S}}};Q.getWindowSize=function(K){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+K]}return document.body["client"+K]};Q.setOpacity=function(aG,K){var S=aG.style;if(h){S.opacity=(K==1?"":K)}else{S.zoom=1;if(K==1){if(typeof S.filter=="string"&&(/alpha/i).test(S.filter)){S.filter=S.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")}}else{S.filter=(S.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alph
8a(opacity="+(K*100)+")"}}};Q.clearOpacity=function(K){Q.setOpacity(K,1)};function o(S){var K=S.target?S.target:S.srcElement;return K.nodeType==3?K.parentNode:K}function V(S){var K=S.pageX||(S.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),aG=S.pageY||(S.clientY+(document.documentElement.scrollTop||document.body.scrollTop));return[K,aG]}function n(K){K.preventDefault()}function v(K){return K.which?K.which:K.keyCode}function F(aH,aG,S){if(aH.addEventListener){aH.addEventListener(aG,S,false)}else{if(aH.nodeType===3||aH.nodeType===8){return}if(aH.setInterval&&(aH!==au&&!aH.frameElement)){aH=au}if(!S.__guid){S.__guid=F.guid++}if(!aH.events){aH.events={}}var K=aH.events[aG];if(!K){K=aH.events[aG]={};if(aH["on"+aG]){K[0]=aH["on"+aG]}}K[S.__guid]=S;aH["on"+aG]=F.handleEvent}}F.guid=1;F.handleEvent=function(aH){var K=true;aH=aH||F.fixEvent(((this.ownerDocument||this.document||this).parentWindow||au).event);var S=this.events[aH.type];for(var aG in S){this.__handleEvent=S[aG];if(this.__handleEvent(aH)===false){K=false}}return K};F.preventDefault=function(){this.returnValue=false};F.stopPropagation=function(){this.cancelBubble=true};F.fixEvent=function(K){K.preventDefault=F.preventDefault;K.stopPropagation=F.stopPropagation;return K};function M(aG,S,K){if(aG.removeEventListener){aG.removeEventListener(S,K,false)}else{if(aG.events&&aG.events[S]){delete aG.events[S][K.__guid]}}}var y=false,al;if(document.addEventListener){al=function(){document.removeEventListener("DOMContentLoaded",al,false);Q.load()}}else{if(document.attachEvent){al=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",al);Q.load()}}}}function g(){if(y){return}try{document.documentElement.doScroll("left")}catch(K){setTimeout(g,1);return}Q.load()}function P(){if(document.readyState==="complete"){return Q.load()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",al,false);au.addEventListener("load",Q.load,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",al);au.attachEvent("onload",Q.load);var K=false;try{K=au.frameElement===null}catch(S){}if(document.documentElement.doScroll&&K){g()}}}}Q.load=function(){if(y){return}if(!document.body){return setTimeout(Q.load,13)}y=true;d();Q.onReady();if(!Q.options.skipSetup){Q.setup()}Q.skin.init()};Q.plugins={};if(navigator.plugins&&navigator.plugins.length){var w=[];aF(navigator.plugins,function(K,S){w.push(S.name)});w=w.join(",");var ai=w.indexOf("Flip4Mac")>-1;Q.plugins={fla:w.indexOf("Shockwave Flash")>-1,qt:w.indexOf("QuickTime")>-1,wmp:!ai&&w.indexOf("Windows Media")>-1,f4m:ai}}else{var p=function(K){var S;try{S=new ActiveXObject(K)}catch(aG){}return !!S};Q.plugins={fla:p("ShockwaveFlash.ShockwaveFlash"),qt:p("QuickTime.QuickTime"),wmp:p("wmplayer.ocx"),f4m:false}}var X=/^(light|shadow)box/i,am="shadowboxCacheKey",b=1;Q.cache={};Q.select=function(S){var aG=[];if(!S){var K;aF(document.getElementsByTagName("a"),function(aJ,aK){K=aK.getAttribute("rel");if(K&&X.test(K)){aG.push(aK)}})}else{var aI=S.length;if(aI){if(typeof S=="string"){if(Q.find){aG=Q.find(S)}}else{if(aI==2&&typeof S[0]=="string"&&S[1].nodeType){if(Q.find){aG=Q.find(S[0],S[1])}}else{for(var aH=0;aH<aI;++aH){aG[aH]=S[aH]}}}}else{aG.push(S)}}return aG};Q.setup=function(K,S){aF(Q.select(K),function(aG,aH){Q.addCache(aH,S)})};Q.teardown=function(K){aF(Q.select(K),function(S,aG){Q.removeCache(aG)})};Q.addCache=function(aG,K){var S=aG[am];if(S==k){S=b++;aG[am]=S;F(aG,"click",u)}Q.cache[S]=Q.makeObject(aG,K)};Q.removeCache=function(K){M(K,"click",u);delete Q.cache[K[am]];K[am]=null};Q.getCache=function(S){var K=S[am];return(K in Q.cache&&Q.cache[K])};Q.clearCache=function(){for(var K in Q.cache){Q.removeCache(Q.cache[K].link)}Q.cache={}};function u(K){Q.open(this);if(Q.gallery.length){n(K)}} 9/* 10 * Sizzle CSS Selector Engine - v1.0 11 * Copyright 2009, The Dojo Foundation 12 * Released under the MIT, BSD, and GPL Licenses. 13 * More information: http://sizzlejs.com/ 14 * 15 * Modified for inclusion in Shadowbox.js 16 */ 17Q.find=(function(){var aP=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,aQ=0,aS=Object.prototype.toString,aK=false,aJ=true;[0,0].sort(function(){aJ=false;return 0});var aG=function(a1,aW,a4,a5){a4=a4||[];var a7=aW=aW||document;if(aW.nodeType!==1&&aW.nodeType!==9){return[]}
17if(!a1||typeof a1!=="string"){return a4}var a2=[],aY,a9,bc,aX,a0=true,aZ=aH(aW),a6=a1;while((aP.exec(""),aY=aP.exec(a6))!==null){a6=aY[3];a2.push(aY[1]);if(aY[2]){aX=aY[3];break}}if(a2.length>1&&aL.exec(a1)){if(a2.length===2&&aM.relative[a2[0]]){a9=aT(a2[0]+a2[1],aW)}else{a9=aM.relative[a2[0]]?[aW]:aG(a2.shift(),aW);while(a2.length){a1=a2.shift();if(aM.relative[a1]){a1+=a2.shift()}a9=aT(a1,a9)}}}else{if(!a5&&a2.length>1&&aW.nodeType===9&&!aZ&&aM.match.ID.test(a2[0])&&!aM.match.ID.test(a2[a2.length-1])){var a8=aG.find(a2.shift(),aW,aZ);aW=a8.expr?aG.filter(a8.expr,a8.set)[0]:a8.set[0]}if(aW){var a8=a5?{expr:a2.pop(),set:aO(a5)}:aG.find(a2.pop(),a2.length===1&&(a2[0]==="~"||a2[0]==="+")&&aW.parentNode?aW.parentNode:aW,aZ);a9=a8.expr?aG.filter(a8.expr,a8.set):a8.set;if(a2.length>0){bc=aO(a9)}else{a0=false}while(a2.length){var bb=a2.pop(),ba=bb;if(!aM.relative[bb]){bb=""}else{ba=a2.pop()}if(ba==null){ba=aW}aM.relative[bb](bc,ba,aZ)}}else{bc=a2=[]}}if(!bc){bc=a9}if(!bc){throw"Syntax error, unrecognized expression: "+(bb||a1)}if(aS.call(bc)==="[object Array]"){if(!a0){a4.push.apply(a4,bc)}else{if(aW&&aW.nodeType===1){for(var a3=0;bc[a3]!=null;a3++){if(bc[a3]&&(bc[a3]===true||bc[a3].nodeType===1&&aN(aW,bc[a3]))){a4.push(a9[a3])}}}else{for(var a3=0;bc[a3]!=null;a3++){if(bc[a3]&&bc[a3].nodeType===1){a4.push(a9[a3])}}}}}else{aO(bc,a4)}if(aX){aG(aX,a7,a4,a5);aG.uniqueSort(a4)}return a4};aG.uniqueSort=function(aX){if(aR){aK=aJ;aX.sort(aR);if(aK){for(var aW=1;aW<aX.length;aW++){if(aX[aW]===aX[aW-1]){aX.splice(aW--,1)}}}}return aX};aG.matches=function(aW,aX){return aG(aW,null,null,aX)};aG.find=function(a3,aW,a4){var a2,a0;if(!a3){return[]}for(var aZ=0,aY=aM.order.length;aZ<aY;aZ++){var a1=aM.order[aZ],a0;if((a0=aM.leftMatch[a1].exec(a3))){var aX=a0[1];a0.splice(1,1);if(aX.substr(aX.length-1)!=="\\"){a0[1]=(a0[1]||"").replace(/\\/g,"");a2=aM.find[a1](a0,aW,a4);if(a2!=null){a3=a3.replace(aM.match[a1],"");break}}}}if(!a2){a2=aW.getElementsByTagName("*")}return{set:a2,expr:a3}};aG.filter=function(a6,a5,a9,aZ){var aY=a6,bb=[],a3=a5,a1,aW,a2=a5&&a5[0]&&aH(a5[0]);while(a6&&a5.length){for(var a4 in aM.filter){if((a1=aM.match[a4].exec(a6))!=null){var aX=aM.filter[a4],ba,a8;aW=false;if(a3===bb){bb=[]}if(aM.preFilter[a4]){a1=aM.preFilter[a4](a1,a3,a9,bb,aZ,a2);if(!a1){aW=ba=true}else{if(a1===true){continue}}}if(a1){for(var a0=0;
17(a8=a3[a0])!=null;a0++){if(a8){ba=aX(a8,a1,a0,a3);var a7=aZ^!!ba;if(a9&&ba!=null){if(a7){aW=true}else{a3[a0]=false}}else{if(a7){bb.push(a8);aW=true}}}}}if(ba!==k){if(!a9){a3=bb}a6=a6.replace(aM.match[a4],"");if(!aW){return[]}break}}}if(a6===aY){if(aW==null){throw"Syntax error, unrecognized expression: "+a6}else{break}}aY=a6}return a3};var aM=aG.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\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(aW){return aW.getAttribute("href")}},relative:{"+":function(a2,aX){var aZ=typeof aX==="string",a1=aZ&&!/\W/.test(aX),a3=aZ&&!a1;if(a1){aX=aX.toLowerCase()}for(var aY=0,aW=a2.length,a0;aY<aW;aY++){if((a0=a2[aY])){while((a0=a0.previousSibling)&&a0.nodeType!==1){}a2[aY]=a3||a0&&a0.nodeName.toLowerCase()===aX?a0||false:a0===aX}}if(a3){aG.filter(aX,a2,true)}},">":function(a2,aX){var a0=typeof aX==="string";if(a0&&!/\W/.test(aX)){aX=aX.toLowerCase();for(var aY=0,aW=a2.length;aY<aW;aY++){var a1=a2[aY];if(a1){var aZ=a1.parentNode;a2[aY]=aZ.nodeName.toLowerCase()===aX?aZ:false}}}else{for(var aY=0,aW=a2.length;aY<aW;aY++){var a1=a2[aY];if(a1){a2[aY]=a0?a1.parentNode:a1.parentNode===aX}}if(a0){aG.filter(aX,a2,true)}}},"":function(aZ,aX,a1){var aY=aQ++,aW=aU;if(typeof aX==="string"&&!/\W/.test(aX)){var a0=aX=aX.toLowerCase();aW=K}aW("parentNode",aX,aY,aZ,a0,a1)},"~":function(aZ,aX,a1){var aY=aQ++,aW=aU;if(typeof aX==="string"&&!/\W/.test(aX)){var a0=aX=aX.toLowerCase();aW=K}aW("previousSibling",aX,aY,aZ,a0,a1)}},find:{ID:function(aX,aY,aZ){if(typeof aY.getElementById!=="undefined"&&!aZ){var aW=aY.getElementById(aX[1]);return aW?[aW]:[]}},NAME:function(aY,a1){if(typeof a1.getElementsByName!=="undefined"){var aX=[],a0=a1.getElementsByName(aY[1]);for(var aZ=0,aW=a0.length;aZ<aW;aZ++){if(a0[aZ].getAttribute("name")===aY[1]){aX.push(a0[aZ])}}return aX.length===0?null:aX}},TAG:function(aW,aX){return aX.getElementsByTagName(aW[1])}},preFilter:{CLASS:function(aZ,aX,aY,aW,a2,a3){aZ=" "+aZ[1].replace(/\\/g,"")+" ";if(a3){return aZ}for(var a0=0,a1;(a1=aX[a0])!=null;a0++){if(a1){if(a2^(a1.className&&(" "+a1.className+" ").replace(/[\t\n]/g," ").indexOf(aZ)>=0)){if(!aY){aW.push(a1)}}else{if(aY){aX[a0]=false}}}}return false},ID:function(aW){return aW[1].replace(/\\/g,"")},TAG:function(aX,aW){return aX[1].toLowerCase()},CHILD:function(aW){if(aW[1]==="nth"){var aX=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(aW[2]==="even"&&"2n"||aW[2]==="odd"&&"2n+1"||!/\D/.test(aW[2])&&"0n+"+aW[2]||aW[2]);aW[2]=(aX[1]+(aX[2]||1))-0;aW[3]=aX[3]-0}aW[0]=aQ++;return aW},ATTR:function(a0,aX,aY,aW,a1,a2){var aZ=a0[1].replace(/\\/g,"");if(!a2&&aM.attrMap[aZ]){a0[1]=aM.attrMap[aZ]}if(a0[2]==="~="){a0[4]=" "+a0[4]+" "}return a0},PSEUDO:function(a0,aX,aY,aW,a1){if(a0[1]==="not"){if((aP.exec(a0[3])||"").length>1||/^\w/.test(a0[3])){a0[3]=aG(a0[3],null,null,aX)}else{var aZ=aG.filter(a0[3],aX,aY,true^a1);if(!aY){aW.push.apply(aW,aZ)}return false}}else{if(aM.match.POS.test(a0[0])||aM.match.CHILD.test(a0[0])){return true}}return a0},POS:function(aW){aW.unshift(true);return aW}},filters:{enabled:function(aW){return aW.disabled===false&&aW.type!=="hidden"},disabled:function(aW){return aW.disabled===true},checked:function(aW){return aW.checked===true},selected:function(aW){aW.parentNode.selectedIndex;return aW.selected===true},parent:function(aW){return !!aW.firstChild},empty:function(aW){return !aW.firstChild},has:function(aY,aX,aW){return !!aG(aW[3],aY).length},header:function(aW){return/h\d/i.test(aW.nodeName)},text:function(aW){return"text"===aW.type},radio:function(aW){return"radio"===aW.type},checkbox:function(aW){return"checkbox"===aW.type},file:function(aW){return"file"===aW.type},password:function(aW){return"password"===aW.type},submit:function(aW){return"submit"===aW.type},image:function(aW){return"image"===aW.type},reset:function(aW){return"reset"===aW.type},button:function(aW){return"button"===aW.type||aW.nodeName.toLowerCase()==="button"},input:function(aW){return/input|select|textarea|button/i.test(aW.nodeName)}},setFilters:{first:function(aX,aW){return aW===0},last:function(aY,aX,aW,aZ){return aX===aZ.length-1},even:function(aX,aW){return aW%2===0},odd:function(aX,aW){return aW%2===1},lt:function(aY,aX,aW){return aX<aW[3]-0},gt:function(aY,aX,aW){return aX>aW[3]-0},nth:function(aY,aX,aW){return aW[3]-0===aX},eq:function(aY,aX,aW){return aW[3]-0===aX}},filter:{PSEUDO:function(a2,aY,aZ,a3){var aX=aY[1],a0=aM.filters[aX];if(a0){return a0(a2,aZ,aY,a3)}else{if(aX==="contains"){return(a2.textContent||a2.innerText||S([a2])||"").indexOf(aY[3])>=0}else{if(aX==="not"){var a1=aY[3];for(var aZ=0,aW=a1.length;aZ<aW;aZ++){if(a1[aZ]===a2){return false}}return true}else{throw"Syntax error, unrecognized expression: "+aX}}}},CHILD:function(aW,aZ){var a2=aZ[1],aX=aW;switch(a2){case"only":case"first":while((aX=aX.previousSibling)){if(aX.nodeType===1){return false}}if(a2==="first"){return true}aX=aW;case"last":while((aX=aX.nextSibling)){if(aX.nodeType===1){return false}}return true;case"nth":var aY=aZ[2],a5=aZ[3];if(aY===1&&a5===0){return true}var a1=aZ[0],a4=aW.parentNode;if(a4&&(a4.sizcache!==a1||!aW.nodeIndex)){var a0=0;for(aX=a4.firstChild;aX;aX=aX.nextSibling){if(aX.nodeType===1){aX.nodeIndex=++a0}}a4.sizcache=a1}var a3=aW.nodeIndex-a5;if(aY===0){return a3===0}else{return(a3%aY===0&&a3/aY>=0)}}},ID:function(aX,aW){return aX.nodeType===1&&aX.getAttribute("id")===aW},TAG:function(aX,aW){return(aW==="*"&&aX.nodeType===1)||aX.nodeName.toLowerCase()===aW}
17,CLASS:function(aX,aW){return(" "+(aX.className||aX.getAttribute("class"))+" ").indexOf(aW)>-1},ATTR:function(a1,aZ){var aY=aZ[1],aW=aM.attrHandle[aY]?aM.attrHandle[aY](a1):a1[aY]!=null?a1[aY]:a1.getAttribute(aY),a2=aW+"",a0=aZ[2],aX=aZ[4];return aW==null?a0==="!=":a0==="="?a2===aX:a0==="*="?a2.indexOf(aX)>=0:a0==="~="?(" "+a2+" ").indexOf(aX)>=0:!aX?a2&&aW!==false:a0==="!="?a2!==aX:a0==="^="?a2.indexOf(aX)===0:a0==="$="?a2.substr(a2.length-aX.length)===aX:a0==="|="?a2===aX||a2.substr(0,aX.length+1)===aX+"-":false},POS:function(a0,aX,aY,a1){var aW=aX[2],aZ=aM.setFilters[aW];if(aZ){return aZ(a0,aY,aX,a1)}}}};var aL=aM.match.POS;for(var aI in aM.match){aM.match[aI]=new RegExp(aM.match[aI].source+/(?![^\[]*\])(?![^\(]*\))/.source);aM.leftMatch[aI]=new RegExp(/(^(?:.|\r|\n)*?)/.source+aM.match[aI].source)}var aO=function(aX,aW){aX=Array.prototype.slice.call(aX,0);if(aW){aW.push.apply(aW,aX);return aW}return aX};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(aV){aO=function(a0,aZ){var aX=aZ||[];if(aS.call(a0)==="[object Array]"){Array.prototype.push.apply(aX,a0)}else{if(typeof a0.length==="number"){for(var aY=0,aW=a0.length;aY<aW;aY++){aX.push(a0[aY])}}else{for(var aY=0;a0[aY];aY++){aX.push(a0[aY])}}}return aX}}var aR;if(document.documentElement.compareDocumentPosition){aR=function(aX,aW){if(!aX.compareDocumentPosition||!aW.compareDocumentPosition){if(aX==aW){aK=true}return aX.compareDocumentPosition?-1:1}var aY=aX.compareDocumentPosition(aW)&4?-1:aX===aW?0:1;if(aY===0){aK=true}return aY}}else{if("sourceIndex" in document.documentElement){aR=function(aX,aW){if(!aX.sourceIndex||!aW.sourceIndex){if(aX==aW){aK=true}return aX.sourceIndex?-1:1}var aY=aX.sourceIndex-aW.sourceIndex;if(aY===0){aK=true}return aY}}else{if(document.createRange){aR=function(aZ,aX){if(!aZ.ownerDocument||!aX.ownerDocument){if(aZ==aX){aK=true}return aZ.ownerDocument?-1:1}var aY=aZ.ownerDocument.createRange(),aW=aX.ownerDocument.createRange();aY.setStart(aZ,0);aY.setEnd(aZ,0);aW.setStart(aX,0);aW.setEnd(aX,0);var a0=aY.compareBoundaryPoints(Range.START_TO_END,aW);if(a0===0){aK=true}return a0}}}}function S(aW){var aX="",aZ;for(var aY=0;aW[aY];aY++){aZ=aW[aY];if(aZ.nodeType===3||aZ.nodeType===4){aX+=aZ.nodeValue}else{if(aZ.nodeType!==8){aX+=S(aZ.childNodes)}}}return aX}(function(){var aX=document.createElement("div"),aY="script"+(new Date).getTime();aX.innerHTML="<a name='"+aY+"'/>";var aW=document.documentElement;aW.insertBefore(aX,aW.firstChild);if(document.getElementById(aY)){aM.find.ID=function(a0,a1,a2){if(typeof a1.getElementById!=="undefined"&&!a2){var aZ=a1.getElementById(a0[1]);return aZ?aZ.id===a0[1]||typeof aZ.getAttributeNode!=="undefined"&&aZ.getAttributeNode("id").nodeValue===a0[1]?[aZ]:k:[]}};aM.filter.ID=function(a1,aZ){var a0=typeof a1.getAttributeNode!=="undefined"&&a1.getAttributeNode("id");return a1.nodeType===1&&a0&&a0.nodeValue===aZ}}aW.removeChild(aX);aW=aX=null})();(function(){var aW=document.createElement("div");aW.appendChild(document.createComment(""));if(aW.getElementsByTagName("*").length>0){aM.find.TAG=function(aX,a1){var a0=a1.getElementsByTagName(aX[1]);if(aX[1]==="*"){var aZ=[];for(var aY=0;a0[aY];aY++){if(a0[aY].nodeType===1){aZ.push(a0[aY])}}a0=aZ}return a0}}aW.innerHTML="<a href='#'></a>";if(aW.firstChild&&typeof aW.firstChild.getAttribute!=="undefined"&&aW.firstChild.getAttribute("href")!=="#"){aM.attrHandle.href=function(aX){return aX.getAttribute("href",2)}}aW=null})();if(document.querySelectorAll){(function(){var aW=aG,aY=document.createElement("div");aY.innerHTML="<p class='TEST'></p>";if(aY.querySelectorAll&&aY.querySelectorAll(".TEST").length===0){return}aG=function(a2,a1,aZ,a0){a1=a1||document;if(!a0&&a1.nodeType===9&&!aH(a1)){try{return aO(a1.querySelectorAll(a2),aZ)}catch(a3){}}return aW(a2,a1,aZ,a0)};for(var aX in aW){aG[aX]=aW[aX]}aY=null})()}(function(){var aW=document.createElement("div");aW.innerHTML="<div class='test e'></div><div class='test'></div>";if(!aW.getElementsByClassName||aW.getElementsByClassName("e").length===0){return}aW.lastChild.className="e";if(aW.getElementsByClassName("e").length===1){return}aM.order.splice(1,0,"CLASS");aM.find.CLASS=function(aX,aY,aZ){if(typeof aY.getElementsByClassName!=="undefined"&&!aZ){return aY.getElementsByClassName(aX[1])}};aW=null})();function K(aX,a2,a1,a5,a3,a4){for(var aZ=0,aY=a5.length;aZ<aY;aZ++){var aW=a5[aZ];if(aW){aW=aW[aX];var a0=false;while(aW){if(aW.sizcache===a1){a0=a5[aW.sizset];break}
17if(aW.nodeType===1&&!a4){aW.sizcache=a1;aW.sizset=aZ}if(aW.nodeName.toLowerCase()===a2){a0=aW;break}aW=aW[aX]}a5[aZ]=a0}}}function aU(aX,a2,a1,a5,a3,a4){for(var aZ=0,aY=a5.length;aZ<aY;aZ++){var aW=a5[aZ];if(aW){aW=aW[aX];var a0=false;while(aW){if(aW.sizcache===a1){a0=a5[aW.sizset];break}if(aW.nodeType===1){if(!a4){aW.sizcache=a1;aW.sizset=aZ}if(typeof a2!=="string"){if(aW===a2){a0=true;break}}else{if(aG.filter(a2,[aW]).length>0){a0=aW;break}}}aW=aW[aX]}a5[aZ]=a0}}}var aN=document.compareDocumentPosition?function(aX,aW){return aX.compareDocumentPosition(aW)&16}:function(aX,aW){return aX!==aW&&(aX.contains?aX.contains(aW):true)};var aH=function(aW){var aX=(aW?aW.ownerDocument||aW:0).documentElement;return aX?aX.nodeName!=="HTML":false};var aT=function(aW,a3){var aZ=[],a0="",a1,aY=a3.nodeType?[a3]:a3;while((a1=aM.match.PSEUDO.exec(aW))){a0+=a1[0];aW=aW.replace(aM.match.PSEUDO,"")}aW=aM.relative[aW]?aW+"*":aW;for(var a2=0,aX=aY.length;a2<aX;a2++){aG(aW,aY[a2],aZ)}return aG.filter(a0,aZ)};return aG})();Q.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};var D,at="sb-drag-proxy",E,j,ag;function ax(){E={x:0,y:0,startX:null,startY:null}}function aA(){var K=Q.dimensions;aC(j.style,{height:K.innerHeight+"px",width:K.innerWidth+"px"})}function O(){ax();var K=["position:absolute","cursor:"+(Q.isGecko?"-moz-grab":"move"),"background-color:"+(Q.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");Q.appendHTML(Q.skin.body,'<div id="'+at+'" style="'+K+'"></div>');j=ad(at);aA();F(j,"mousedown",L)}function B(){if(j){M(j,"mousedown",L);C(j);j=null}ag=null}function L(S){n(S);var K=V(S);E.startX=K[0];E.startY=K[1];ag=ad(Q.player.id);F(document,"mousemove",H);F(document,"mouseup",i);if(Q.isGecko){j.style.cursor="-moz-grabbing"}}function H(aI){var K=Q.player,aJ=Q.dimensions,aH=V(aI);var aG=aH[0]-E.startX;E.startX+=aG;E.x=Math.max(Math.min(0,E.x+aG),aJ.innerWidth-K.width);var S=aH[1]-E.startY;E.startY+=S;E.y=Math.max(Math.min(0,E.y+S),aJ.innerHeight-K.height);aC(ag.style,{left:E.x+"px",top:E.y+"px"})}function i(){M(document,"mousemove",H);M(document,"mouseup",i);if(Q.isGecko){j.style.cursor="-moz-grab"}}Q.img=function(S,aG){this.obj=S;this.id=aG;this.ready=false;var K=this;D=new Image();D.onload=function(){K.height=S.height?parseInt(S.height,10):D.height;K.width=S.width?parseInt(S.width,10):D.width;K.ready=true;D.onload=null;D=null};D.src=S.content};Q.img.ext=["bmp","gif","jpg","jpeg","png"];Q.img.prototype={append:function(S,aI){var aG=document.createElement("img");aG.id=this.id;aG.src=this.obj.content;aG.style.position="absolute";var K,aH;if(aI.oversized&&Q.options.handleOversize=="resize"){K=aI.innerHeight;aH=aI.innerWidth}else{K=this.height;aH=this.width}aG.setAttribute("height",K);aG.setAttribute("width",aH);S.appendChild(aG)},remove:function(){var K=ad(this.id);if(K){C(K)}B();if(D){D.onload=null;D=null}},onLoad:function(){var K=Q.dimensions;if(K.oversized&&Q.options.handleOversize=="drag"){O()}},onWindowResize:function(){var aH=Q.dimensions;switch(Q.options.handleOversize){case"resize":var K=ad(this.id);K.height=aH.innerHeight;K.width=aH.innerWidth;break;case"drag":if(ag){var aG=parseInt(Q.getStyle(ag,"top")),S=parseInt(Q.getStyle(ag,"left"));if(aG+this.height<aH.innerHeight){ag.style.top=aH.innerHeight-this.height+"px"}if(S+this.width<aH.innerWidth){ag.style.left=aH.innerWidth-this.width+"px"}aA()}break}}};Q.iframe=function(S,aG){this.obj=S;this.id=aG;var K=ad("sb-overlay");this.height=S.height?parseInt(S.height,10):K.offsetHeight;this.width=S.width?parseInt(S.width,10):K.offsetWidth};Q.iframe.prototype={append:function(K,aG){var S='<iframe id="'+this.id+'" name="'+this.id+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" style="visibility:hidden" onload="this.style.visibility=\'visible\'" scrolling="auto"';if(Q.isIE){S+=' allowtransparency="true"';if(Q.isIE6){S+=" src=\"javascript:false;document.write('');\""}}S+="></iframe>";K.innerHTML=S},remove:function(){var K=ad(this.id);if(K){C(K);if(Q.isGecko){delete au.frames[this.id]}}},onLoad:function(){var K=Q.isIE?ad(this.id).contentWindow:au.frames[this.id];K.location.href=this.obj.content}};Q.html=function(K,S){this.obj=K;this.id=S;this.height=K.height?parseInt(K.height,10):300;this.width=K.width?parseInt(K.width,10):500};Q.html.prototype={append:function(K,S){var aG=document.createElement("div");aG.id=this.id;aG.className="html";aG.innerHTML=this.obj.content;K.appendChild(aG)},remove:function(){var K=ad(this.id);if(K){C(K)}}};var ao=false,Y=[],q=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],aa,ae,Z,m=true;function N(aG,aQ,aN,aL,aR){var K=(aQ=="opacity"),aM=K?Q.setOpacity:function(aS,aT){aS.style[aQ]=""+aT+"px"};if(aL==0||(!K&&!Q.options.animate)||(K&&!Q.options.animateFade)){aM(aG,aN);if(aR){aR()}return}var aO=parseFloat(Q.getStyle(aG,aQ))||0;var aP=aN-aO;if(aP==0){if(aR){aR()}return}aL*=1000;var aH=aw(),aK=Q.ease,aJ=aH+aL,aI;var S=setInterval(function(){aI=aw();if(aI>=aJ){clearInterval(S);S=null;aM(aG,aN);if(aR){aR()}}else{aM(aG,aO+aK((aI-aH)/aL)*aP)}},10)}function aB(){aa.style.height=Q.getWindowSize("Height")+"px";aa.style.width=Q.getWindowSize("Width")+"px"}function aE(){aa.style.top=document.documentElement.scrollTop+"px";aa.style.left=document.documentElement.scrollLeft+"px"}function ay(K){if(K){aF(Y,function(S,aG){aG[0].style.visibility=aG[1]||""})}else{Y=[];aF(Q.options.troubleElements,function(aG,S){aF(document.getElementsByTagName(S),function(aH,aI){Y.push([aI,aI.style.visibility]);aI.style.visibility="hidden"})})}}function r(aG,K){var S=ad("sb-nav-"+aG);if(S){S.style.display=K?"":"none"}}function ah(K,aJ){var aI=ad("sb-loading"),aG=Q.getCurrent().player,aH=(aG=="img"||aG=="html");if(K){Q.setOpacity(aI,0);aI.style.display="block";var S=function(){Q.clearOpacity(aI);if(aJ){aJ()}};if(aH){N(aI,"opacity",1,Q.options.fadeDuration,S)}else{S()}}else{var S=function(){aI.style.display="none";Q.clearOpacity(aI);if(aJ){aJ()}};if(aH){N(aI,"opacity",0,Q.options.fadeDuration,S)}else{S()}}}function t(aO){var aJ=Q.getCurrent();ad("sb-title-inner").innerHTML=aJ.title||"";var aP,aL,S,aQ,aM;if(Q.options.displayNav){aP=true;var aN=Q.gallery.length;if(aN>1){if(Q.options.continuous){aL=aM=true}else{aL=(aN-1)>Q.current;aM=Q.current>0}}if(Q.options.slideshowDelay>0&&Q.hasNext()){aQ=!Q.isPaused();S=!aQ}}else{aP=aL=S=aQ=aM=false}r("close",aP);r("next",aL);r("play",S);r("pause",aQ);r("previous",aM);var K="";if(Q.options.displayCounter&&Q.gallery.length>1){var aN=Q.gallery.length;if(Q.options.counterType=="skip"){var aI=0,aH=aN,aG=parseInt(Q.options.counterLimit)||0;
17if(aG<aN&&aG>2){var aK=Math.floor(aG/2);aI=Q.current-aK;if(aI<0){aI+=aN}aH=Q.current+(aG-aK);if(aH>aN){aH-=aN}}while(aI!=aH){if(aI==aN){aI=0}K+='<a onclick="Shadowbox.change('+aI+');"';if(aI==Q.current){K+=' class="sb-counter-current"'}K+=">"+(++aI)+"</a>"}}else{K=[Q.current+1,Q.lang.of,aN].join(" ")}}ad("sb-counter").innerHTML=K;aO()}function U(aH){var K=ad("sb-title-inner"),aG=ad("sb-info-inner"),S=0.35;K.style.visibility=aG.style.visibility="";if(K.innerHTML!=""){N(K,"marginTop",0,S)}N(aG,"marginTop",0,S,aH)}function av(aG,aM){var aK=ad("sb-title"),K=ad("sb-info"),aH=aK.offsetHeight,aI=K.offsetHeight,aJ=ad("sb-title-inner"),aL=ad("sb-info-inner"),S=(aG?0.35:0);N(aJ,"marginTop",aH,S);N(aL,"marginTop",aI*-1,S,function(){aJ.style.visibility=aL.style.visibility="hidden";aM()})}function ac(K,aH,S,aJ){var aI=ad("sb-wrapper-inner"),aG=(S?Q.options.resizeDuration:0);N(Z,"top",aH,aG);N(aI,"height",K,aG,aJ)}function ar(K,aH,S,aI){var aG=(S?Q.options.resizeDuration:0);N(Z,"left",aH,aG);N(Z,"width",K,aG,aI)}function ak(aM,aG){var aI=ad("sb-body-inner"),aM=parseInt(aM),aG=parseInt(aG),S=Z.offsetHeight-aI.offsetHeight,K=Z.offsetWidth-aI.offsetWidth,aK=ae.offsetHeight,aL=ae.offsetWidth,aJ=parseInt(Q.options.viewportPadding)||20,aH=(Q.player&&Q.options.handleOversize!="drag");return Q.setDimensions(aM,aG,aK,aL,S,K,aJ,aH)}var T={};T.markup='<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-wrapper-inner"><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="sb-loading-inner"><span>{loading}</span></div></div></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div></div></div></div></div>';T.options={animSequence:"sync",counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.5,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]};T.init=function(){Q.appendHTML(document.body,s(T.markup,Q.lang));T.body=ad("sb-body-inner");aa=ad("sb-container");ae=ad("sb-overlay");Z=ad("sb-wrapper");if(!x){aa.style.position="absolute"}if(!h){var aG,K,S=/url\("(.*\.png)"\)/;aF(q,function(aI,aJ){aG=ad(aJ);if(aG){K=Q.getStyle(aG,"backgroundImage").match(S);if(K){aG.style.backgroundImage="none";aG.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+K[1]+",sizingMethod=scale);"}}})}var aH;F(au,"resize",function(){if(aH){clearTimeout(aH);aH=null}if(A){aH=setTimeout(T.onWindowResize,10)}})};T.onOpen=function(K,aG){m=false;aa.style.display="block";aB();var S=ak(Q.options.initialHeight,Q.options.initialWidth);ac(S.innerHeight,S.top);ar(S.width,S.left);if(Q.options.showOverlay){ae.style.backgroundColor=Q.options.overlayColor;Q.setOpacity(ae,0);if(!Q.options.modal){F(ae,"click",Q.close)}ao=true}if(!x){aE();F(au,"scroll",aE)}ay();aa.style.visibility="visible";if(ao){N(ae,"opacity",Q.options.overlayOpacity,Q.options.fadeDuration,aG)}else{aG()}};T.onLoad=function(S,K){ah(true);while(T.body.firstChild){C(T.body.firstChild)}av(S,function(){if(!A){return}if(!S){Z.style.visibility="visible"}t(K)})};T.onReady=function(aH){if(!A){return}var S=Q.player,aG=ak(S.height,S.width);var K=function(){U(aH)};switch(Q.options.animSequence){case"hw":ac(aG.innerHeight,aG.top,true,function(){ar(aG.width,aG.left,true,K)});break;case"wh":ar(aG.width,aG.left,true,function(){ac(aG.innerHeight,aG.top,true,K)});break;default:ar(aG.width,aG.left,true);ac(aG.innerHeight,aG.top,true,K)}};T.onShow=function(K){ah(false,K);m=true};T.onClose=function(){if(!x){M(au,"scroll",aE)}M(ae,"click",Q.close);Z.style.visibility="hidden";var K=function(){aa.style.visibility="hidden";aa.style.display="none";ay(true)};if(ao){N(ae,"opacity",0,Q.options.fadeDuration,K)}else{K()}};T.onPlay=function(){r("play",false);r("pause",true)};T.onPause=function(){r("pause",false);r("play",true)};T.onWindowResize=function(){if(!m){return}aB();var K=Q.player,S=ak(K.height,K.width);ar(S.width,S.left);ac(S.innerHeight,S.top);if(K.onWindowResize){K.onWindowResize()}};Q.skin=T;au.Shadowbox=Q})(window);; 18(function ($) { 19 20/** 21 * Provides Ajax page updating via jQuery $.ajax (Asynchronous JavaScript and XML). 22 * 23 * Ajax is a method of making a request via JavaScript while viewing an HTML 24 * page. The request returns an array of commands encoded in JSON, which is 25 * then executed to make any changes that are necessary to the page. 26 * 27 * Drupal uses this file to enhance form elements with #ajax['path'] and 28 * #ajax['wrapper'] properties. If set, this file will automatically be included 29 * to provide Ajax capabilities. 30 */ 31 32Drupal.ajax = Drupal.ajax || {}; 33 34Drupal.settings.urlIsAjaxTrusted = Drupal.settings.urlIsAjaxTrusted || {}; 35 36/** 37 * Attaches the Ajax behavior to each Ajax form element. 38 */ 39Drupal.behaviors.AJAX = { 40 attach: function (context, settings) { 41 // Load all Ajax behaviors specified in the settings. 42 for (var base in settings.ajax) { 43 if (!$('#' + base + '.ajax-processed').length) { 44 var element_settings = settings.ajax[base]; 45 46 if (typeof element_settings.selector == 'undefined') { 47 element_settings.selector = '#' + base; 48 } 49 $(element_settings.selector).each(function () { 50 element_settings.element = this; 51 Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); 52 }); 53 54 $('#' + base).addClass('ajax-processed'); 55 } 56 } 57 58 // Bind Ajax behaviors to all items showing the class.
59 $('.use-ajax:not(.ajax-processed)').addClass('ajax-processed').each(function () { 60 var element_settings = {}; 61 // Clicked links look better with the throbber than the progress bar. 62 element_settings.progress = { 'type': 'throbber' }; 63 64 // For anchor tags, these will go to the target of the anchor rather 65 // than the usual location. 66 if ($(this).attr('href')) { 67 element_settings.url = $(this).attr('href'); 68 element_settings.event = 'click'; 69 } 70 var base = $(this).attr('id'); 71 Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); 72 }); 73 74 // This class means to submit the form to the action using Ajax. 75 $('.use-ajax-submit:not(.ajax-processed)').addClass('ajax-processed').each(function () { 76 var element_settings = {}; 77 78 // Ajax submits specified in this manner automatically submit to the 79 // normal form action. 80 element_settings.url = $(this.form).attr('action'); 81 // Form submit button clicks need to tell the form what was clicked so 82 // it gets passed in the POST request. 83 element_settings.setClick = true; 84 // Form buttons use the 'click' event rather than mousedown. 85 element_settings.event = 'click'; 86 // Clicked form buttons look better with the throbber than the progress bar. 87 element_settings.progress = { 'type': 'throbber' }; 88 89 var base = $(this).attr('id'); 90 Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); 91 }); 92 } 93}; 94 95/** 96 * Ajax object. 97 * 98 * All Ajax objects on a page are accessible through the global Drupal.ajax 99 * object and are keyed by the submit button's ID. You can access them from 100 * your module's JavaScript file to override properties or functions. 101 * 102 * For example, if your Ajax enabled button has the ID 'edit-submit', you can 103 * redefine the function that is called to insert the new content like this 104 * (inside a Drupal.behaviors attach block): 105 * @code 106 * Drupal.behaviors.myCustomAJAXStuff = { 107 * attach: function (context, settings) { 108 * Drupal.ajax['edit-submit'].commands.insert = function (ajax, response, status) { 109 * new_content = $(response.data); 110 * $('#my-wrapper').append(new_content); 111 * alert('New content was appended to #my-wrapper'); 112 * } 113 * } 114 * }; 115 * @endcode 116 */ 117Drupal.ajax = function (base, element, element_settings) { 118 var defaults = { 119 url: 'system/ajax', 120 event: 'mousedown', 121 keypress: true, 122 selector: '#' + base, 123 effect: 'none', 124 speed: 'none', 125 method: 'replaceWith', 126 progress: { 127 type: 'throbber', 128 message: Drupal.t('Please wait...') 129 }, 130 submit: { 131 'js': true 132 } 133 }; 134 135 $.extend(this, defaults, element_settings); 136 137 this.element = element; 138 this.element_settings = element_settings; 139 140 // Replacing 'nojs' with 'ajax' in the URL allows for an easy method to let 141 // the server detect when it needs to degrade gracefully. 142 // There are five scenarios to check for: 143 // 1. /nojs/ 144 // 2. /nojs$ - The end of a URL string. 145 // 3. /nojs? - Followed by a query (with clean URLs enabled). 146 // E.g.: path/nojs?destination=foobar 147 // 4. /nojs& - Followed by a query (without clean URLs enabled). 148 // E.g.: ?q=path/nojs&destination=foobar 149 // 5. /nojs# - Followed by a fragment. 150 // E.g.: path/nojs#myfragment 151 this.url = element_settings.url.replace(/\/nojs(\/|$|\?|&|#)/g, '/ajax$1'); 152 // If the 'nojs' version of the URL is trusted, also trust the 'ajax' version. 153 if (Drupal.settings.urlIsAjaxTrusted[element_settings.url]) { 154 Drupal.settings.urlIsAjaxTrusted[this.url] = true; 155 } 156 157 this.wrapper = '#' + element_settings.wrapper; 158 159 // If there isn't a form, jQuery.ajax() will be used instead, allowing us to 160 // bind Ajax to links as well. 161 if (this.element.form) { 162 this.form = $(this.element.form); 163 } 164 165 // Set the options for the ajaxSubmit function. 166 // The 'this' variable will not persist inside of the options object. 167 var ajax = this; 168 ajax.options = { 169 url: ajax.url, 170 data: ajax.submit, 171 beforeSerialize: function (element_settings, options) { 172 return ajax.beforeSerialize(element_settings, options); 173 }, 174 beforeSubmit: function (form_values, element_settings, options) { 175 ajax.ajaxing = true; 176 return ajax.beforeSubmit(form_values, element_settings, options); 177 }, 178 beforeSend: function (xmlhttprequest, options) { 179 ajax.ajaxing = true; 180 return ajax.beforeSend(xmlhttprequest, options); 181 }, 182 success: function (response, status, xmlhttprequest) { 183 // Sanity check for browser support (object expected). 184 // When using iFrame uploads, responses must be returned as a string. 185 if (typeof response == 'string') { 186 response = $.parseJSON(response); 187 } 188 189 // Prior to invoking the response's commands, verify that they can be 190 // trusted by checking for a response header. See 191 // ajax_set_verification_header() for details. 192 // - Empty responses are harmless so can bypass verification. This avoids 193 // an alert message for server-generated no-op responses that skip Ajax 194 // rendering. 195 // - Ajax objects with trusted URLs (e.g., ones defined server-side via 196 // #ajax) can bypass header verification. This is especially useful for 197 // Ajax with multipart forms. Because IFRAME transport is used, the 198 // response headers cannot be accessed for verification. 199 if (response !== null && !Drupal.settings.urlIsAjaxTrusted[ajax.url]) { 200 if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { 201 var customMessage = Drupal.t("The response failed verification so will not be processed."); 202 return ajax.error(xmlhttprequest, ajax.url, customMessage); 203 } 204 } 205 206 return ajax.success(response, status); 207 }, 208 complete: function (xmlhttprequest, status) { 209 ajax.ajaxing = false;
210 if (status == 'error' || status == 'parsererror') { 211 return ajax.error(xmlhttprequest, ajax.url); 212 } 213 }, 214 dataType: 'json', 215 type: 'POST' 216 }; 217 218 // Bind the ajaxSubmit function to the element event. 219 $(ajax.element).bind(element_settings.event, function (event) { 220 if (!Drupal.settings.urlIsAjaxTrusted[ajax.url] && !Drupal.urlIsLocal(ajax.url)) { 221 throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', {'!url': ajax.url})); 222 } 223 return ajax.eventResponse(this, event); 224 }); 225 226 // If necessary, enable keyboard submission so that Ajax behaviors 227 // can be triggered through keyboard input as well as e.g. a mousedown 228 // action. 229 if (element_settings.keypress) { 230 $(ajax.element).keypress(function (event) { 231 return ajax.keypressResponse(this, event); 232 }); 233 } 234 235 // If necessary, prevent the browser default action of an additional event. 236 // For example, prevent the browser default action of a click, even if the 237 // AJAX behavior binds to mousedown. 238 if (element_settings.prevent) { 239 $(ajax.element).bind(element_settings.prevent, false); 240 } 241}; 242 243/** 244 * Handle a key press. 245 * 246 * The Ajax object will, if instructed, bind to a key press response. This 247 * will test to see if the key press is valid to trigger this event and 248 * if it is, trigger it for us and prevent other keypresses from triggering. 249 * In this case we're handling RETURN and SPACEBAR keypresses (event codes 13 250 * and 32. RETURN is often used to submit a form when in a textfield, and 251 * SPACE is often used to activate an element without submitting. 252 */ 253Drupal.ajax.prototype.keypressResponse = function (element, event) { 254 // Create a synonym for this to reduce code confusion. 255 var ajax = this; 256 257 // Detect enter key and space bar and allow the standard response for them, 258 // except for form elements of type 'text' and 'textarea', where the 259 // spacebar activation causes inappropriate activation if #ajax['keypress'] is 260 // TRUE. On a text-type widget a space should always be a space. 261 if (event.which == 13 || (event.which == 32 && element.type != 'text' && element.type != 'textarea')) { 262 $(ajax.element_settings.element).trigger(ajax.element_settings.event); 263 return false; 264 } 265}; 266 267/** 268 * Handle an event that triggers an Ajax response. 269 * 270 * When an event that triggers an Ajax response happens, this method will 271 * perform the actual Ajax call. It is bound to the event using 272 * bind() in the constructor, and it uses the options specified on the 273 * ajax object. 274 */ 275Drupal.ajax.prototype.eventResponse = function (element, event) { 276 // Create a synonym for this to reduce code confusion. 277 var ajax = this; 278 279 // Do not perform another ajax command if one is already in progress. 280 if (ajax.ajaxing) { 281 return false; 282 } 283 284 try { 285 if (ajax.form) { 286 // If setClick is set, we must set this to ensure that the button's 287 // value is passed. 288 if (ajax.setClick) { 289 // Mark the clicked button. 'form.clk' is a special variable for 290 // ajaxSubmit that tells the system which element got clicked to 291 // trigger the submit. Without it there would be no 'op' or 292 // equivalent. 293 element.form.clk = element; 294 } 295 296 ajax.form.ajaxSubmit(ajax.options); 297 } 298 else { 299 ajax.beforeSerialize(ajax.element, ajax.options); 300 $.ajax(ajax.options); 301 } 302 } 303 catch (e) { 304 // Unset the ajax.ajaxing flag here because it won't be unset during 305 // the complete response. 306 ajax.ajaxing = false; 307 alert("An error occurred while attempting to process " + ajax.options.url + ": " + e.message); 308 } 309 310 // For radio/checkbox, allow the default event. On IE, this means letting 311 // it actually check the box. 312 if (typeof element.type != 'undefined' && (element.type == 'checkbox' || element.type == 'radio')) { 313 return true; 314 } 315 else { 316 return false; 317 } 318 319}; 320 321/** 322 * Handler for the form serialization. 323 * 324 * Runs before the beforeSend() handler (see below), and unlike that one, runs 325 * before field data is collected. 326 */ 327Drupal.ajax.prototype.beforeSerialize = function (element, options) { 328 // Allow detaching behaviors to update field values before collecting them. 329 // This is only needed when field values are added to the POST data, so only 330 // when there is a form such that this.form.ajaxSubmit() is used instead of 331 // $.ajax(). When there is no form and $.ajax() is used, beforeSerialize() 332 // isn't called, but don't rely on that: explicitly check this.form. 333 if (this.form) { 334 var settings = this.settings || Drupal.settings; 335 Drupal.detachBehaviors(this.form, settings, 'serialize'); 336 } 337 338 // Prevent duplicate HTML ids in the returned markup. 339 // @see drupal_html_id() 340 options.data['ajax_html_ids[]'] = []; 341 $('[id]').each(function () { 342 options.data['ajax_html_ids[]'].push(this.id); 343 }); 344 345 // Allow Drupal to return new JavaScript and CSS files to load without 346 // returning the ones already loaded. 347 // @see ajax_base_page_theme() 348 // @see drupal_get_css() 349 // @see drupal_get_js() 350 options.data['ajax_page_state[theme]'] = Drupal.settings.ajaxPageState.theme; 351 options.data['ajax_page_state[theme_token]'] = Drupal.settings.ajaxPageState.theme_token; 352 for (var key in Drupal.settings.ajaxPageState.css) { 353 options.data['ajax_page_state[css][' + key + ']'] = 1; 354 } 355 for (var key in Drupal.settings.ajaxPageState.js) { 356 options.data['ajax_page_state[js][' + key + ']'] = 1; 357 } 358}; 359 360/** 361 * Modify form values prior to form submission. 362 */ 363Drupal.ajax.prototype.beforeSubmit = function (form_values, element, options) { 364 // This function is left empty to make it simple to override for modules 365 // that wish to add functionality here. 366}; 367 368/** 369 * Prepare the Ajax request before it is sent. 370 */ 371Drupal.ajax.prototype.beforeSend = function (xmlhttprequest, options) { 372 // For forms without file inputs, the jQuery Form plugin serializes the form 373 // values, and then calls jQuery's $.ajax() function, which invokes this 374 // handler. In this circumstance, options.extraData is never used. For forms 375 // with file inputs, the jQuery Form plugin uses the browser's normal form 376 // submission mechanism, but captures the response in a hidden IFRAME. In this 377 // circumstance, it calls this handler first, and then appends hidden fields 378 // to the form to submit the values in options.extraData. There is no simple 379 // way to know which submission mechanism will be used, so we add to extraData 380 // regardless, and allow it to be ignored in the former case. 381 if (this.form) { 382 options.extraData = options.extraData || {}; 383 384 // Let the server know when the IFRAME submission mechanism is used. The 385 // server can use this information to wrap the JSON response in a TEXTAREA, 386 // as per http://jquery.malsup.com/form/#file-upload. 387 options.extraData.ajax_iframe_upload = '1'; 388 389 // The triggering element is about to be disabled (see below), but if it 390 // contains a value (e.g., a checkbox, textfield, select, etc.), ensure that 391 // value is included in the submission. As per above, submissions that use 392 // $.ajax() are already serialized prior to the element being disabled, so 393 // this is only needed for IFRAME submissions. 394 var v = $.fieldValue(this.element); 395 if (v !== null) { 396 options.extraData[this.element.name] = Drupal.checkPlain(v); 397 } 398 } 399 400 // Disable the element that received the change to prevent user interface 401 // interaction while the Ajax request is in progress. ajax.ajaxing prevents 402 // the element from triggering a new request, but does not prevent the user 403 // from changing its value. 404 $(this.element).addClass('progress-disabled').attr('disabled', true); 405 406 // Insert progressbar or throbber. 407 if (this.progress.type == 'bar') { 408 var progressBar = new Drupal.progressBar('ajax-progress-' + this.element.i
408d, eval(this.progress.update_callback), this.progress.method, eval(this.progress.error_callback)); 409 if (this.progress.message) { 410 progressBar.setProgress(-1, this.progress.message); 411 } 412 if (this.progress.url) { 413 progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); 414 } 415 this.progress.element = $(progressBar.element).addClass('ajax-progress ajax-progress-bar'); 416 this.progress.object = progressBar; 417 $(this.element).after(this.progress.element); 418 } 419 else if (this.progress.type == 'throbber') { 420 this.progress.element = $('<div class="ajax-progress ajax-progress-throbber"><div class="throbber"> </div></div>'); 421 if (this.progress.message) { 422 $('.throbber', this.progress.element).after('<div class="message">' + this.progress.message + '</div>'); 423 } 424 $(this.element).after(this.progress.element); 425 } 426}; 427 428/** 429 * Handler for the form redirection completion. 430 */ 431Drupal.ajax.prototype.success = function (response, status) { 432 // Remove the progress element. 433 if (this.progress.element) { 434 $(this.progress.element).remove(); 435 } 436 if (this.progress.object) { 437 this.progress.object.stopMonitoring(); 438 } 439 $(this.element).removeClass('progress-disabled').removeAttr('disabled'); 440 441 Drupal.freezeHeight(); 442 443 for (var i in response) { 444 if (response.hasOwnProperty(i) && response[i]['command'] && this.commands[response[i]['command']]) { 445 this.commands[response[i]['command']](this, response[i], status); 446 } 447 } 448 449 // Reattach behaviors, if they were detached in beforeSerialize(). The 450 // attachBehaviors() called on the new content from processing the response 451 // commands is not sufficient, because behaviors from the entire form need 452 // to be reattached. 453 if (this.form) { 454 var settings = this.settings || Drupal.settings; 455 Drupal.attachBehaviors(this.form, settings); 456 } 457 458 Drupal.unfreezeHeight(); 459 460 // Remove any response-specific settings so they don't get used on the next 461 // call by mistake. 462 this.settings = null; 463}; 464 465/** 466 * Build an effect object which tells us how to apply the effect when adding new HTML. 467 */ 468Drupal.ajax.prototype.getEffect = function (response) { 469 var type = response.effect || this.effect; 470 var speed = response.speed || this.speed; 471 472 var effect = {}; 473 if (type == 'none') { 474 effect.showEffect = 'show'; 475 effect.hideEffect = 'hide'; 476 effect.showSpeed = ''; 477 } 478 else if (type == 'fade') { 479 effect.showEffect = 'fadeIn'; 480 effect.hideEffect = 'fadeOut'; 481 effect.showSpeed = speed; 482 } 483 else { 484 effect.showEffect = type + 'Toggle'; 485 effect.hideEffect = type + 'Toggle'; 486 effect.showSpeed = speed; 487 } 488 489 return effect; 490}; 491 492/** 493 * Handler for the form redirection error. 494 */ 495Drupal.ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { 496 Drupal.displayAjaxError(Drupal.ajaxError(xmlhttprequest, uri, customMessage)); 497 // Remove the progress element. 498 if (this.progress.element) { 499 $(this.progress.element).remove(); 500 } 501 if (this.progress.object) { 502 this.progress.object.stopMonitoring(); 503 } 504 // Undo hide. 505 $(this.wrapper).show(); 506 // Re-enable the element. 507 $(this.element).removeClass('progress-disabled').removeAttr('disabled'); 508 // Reattach behaviors, if they were detached in beforeSerialize(). 509 if (this.form) { 510 var settings = this.settings || Drupal.settings; 511 Drupal.attachBehaviors(this.form, settings); 512 } 513}; 514 515/** 516 * Provide a series of commands that the server can request the client perform. 517 */ 518Drupal.ajax.prototype.commands = { 519 /** 520 * Command to insert new content into the DOM. 521 */ 522 insert: function (ajax, response, status) { 523 // Get information from the response. If it is not there, default to 524 // our presets. 525 var wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); 526 var method = response.method || ajax.method; 527 var effect = ajax.getEffect(response); 528 529 // We don't know what response.data contains: it might be a string of text 530 // without HTML, so don't rely on jQuery correctly iterpreting 531 // $(response.data) as new HTML rather than a CSS selector. Also, if 532 // response.data contains top-level text nodes, they get lost with either 533 // $(response.data) or $('<div></div>').replaceWith(response.data). 534 var new_content_wrapped = $('<div></div>').html(response.data); 535 var new_content = new_content_wrapped.contents(); 536 537 // For legacy reasons, the effects processing code assumes that new_content 538 // consists of a single top-level element. Also, it has not been 539 // sufficiently tested whether attachBehaviors() can be successfully called 540 // with a context object that includes top-level text nodes. However, to 541 // give developers full control of the HTML appearing in the page, and to 542 // enable Ajax content to be inserted in places where DIV elements are not 543 // allowed (e.g., within TABLE, TR, and SPAN parents), we check if the new 544 // content satisfies the requirement of a single top-level element, and 545 // only use the container DIV created above when it doesn't. For more 546 // information, please see http://drupal.org/node/736066. 547 if (new_content.length != 1 || new_content.get(0).nodeType != 1) { 548 new_content = new_content_wrapped; 549 } 550 551 // If removing content from the wrapper, detach behaviors first. 552 switch (method) { 553 case 'html': 554 case 'replaceWith': 555 case 'replaceAll': 556 case 'empty': 557 case 'remove': 558 var settings = response.settings || ajax.settings || Drupal.settings; 559 Drupal.detachBehaviors(wrapper, settings); 560 } 561 562 // Add the new content to the page. 563 wrapper[method](new_content); 564 565 // Immediately hide the new content if we're using any effects. 566 if (effect.showEffect != 'show') { 567 new_content.hide(); 568 } 569 570 // Determine which effect to use and what content will receive the 571 // effect, then show the new content. 572 if ($('.ajax-new-content', new_content).length > 0) { 573 $('.ajax-new-content', new_content).hide(); 574 new_content.show(); 575 $('.ajax-new-content', new_content)[effect.showEffect](effect.showSpeed); 576 } 577 else if (effect.showEffect != 'show') { 578 new_content[effect.showEffect](effect.showSpeed); 579 } 580 581 // Attach all JavaScript behaviors to the new content, if it was successfully 582 // added to the page, this if statement allows #ajax['wrapper'] to be 583 // optional. 584 if (new_content.parents('html').length > 0) { 585 // Apply any settings from the returned JSON if available. 586 var settings = response.settings || ajax.settings || Drupal.settings; 587 Drupal.attachBehaviors(new_content, settings); 588 } 589 }, 590 591 /** 592 * Command to remove a chunk from the page. 593 */ 594 remove: function (ajax, response, status) { 595 var settings = response.settings || ajax.settings || Drupal.settings; 596 Drupal.detachBehaviors($(response.selector), settings); 597 $(response.selector).remove(); 598 }, 599 600 /** 601 * Command to mark a chunk changed. 602 */ 603 changed: function (ajax, response, status) { 604 if (!$(response.selector).hasClass('ajax-changed')) { 605 $(response.selector).addClass('ajax-changed'); 606 if (response.asterisk) { 607 $(response.selector).find(response.asterisk).append(' <span class="ajax-changed">*</span> '); 608 } 609 } 610 }, 611 612 /** 613 * Command to provide an alert. 614 */ 615 alert: function (ajax, response, status) { 616 alert(response.text, response.title); 617 }, 618 619 /** 620 * Command to provide the jQuery css() function. 621 */ 622 css: function (ajax, response, status) { 623 $(response.selector).css(response.argument); 624 }, 625 626 /** 627 * Command to set the settings that will be used for other commands in this response. 628 */ 629 settings: function (ajax, response, status) { 630 if (response.merge) { 631 $.extend(true, Drupal.settings, response.settings); 632 } 633 else { 634 ajax.settings = response.settings; 635 } 636 }, 637 638 /** 639 * Command to attach data using jQuery's data API. 640 */ 641 data: function (ajax, response, status) { 642 $(response.selector).data(response.name, response.value); 643 }, 644 645 /** 646 * Command to apply a jQuery method. 647 */ 648 invoke: function (ajax, response, status) { 649 var $element = $(response.selector); 650 $element[response.method].apply($element, response.arguments); 651 }, 652 653 /** 654 * Command to restripe a table. 655 */ 656 restripe: function (ajax, response, status) { 657 // :even and :odd are reversed because jQuery counts from 0 and 658 // we count from 1, so we're out of sync. 659 // Match immediate children of the parent element to allow nesting. 660 $('> tbody > tr:visible, > tr:visible', $(response.selector)) 661 .removeClass('odd even') 662 .filter(':even').addClass('odd').end() 663 .filter(':odd').addClass('even'); 664 }, 665 666 /** 667 * Command to add css. 668 * 669 * Uses the proprietary addImport method if available as browsers which 670 * support that method ignore @import statements in dynamically added 671 * stylesheets. 672 */ 673 add_css: function (ajax, response, status) { 674 // Add the styles in the normal way. 675 $('head').prepend(response.data); 676 // Add imports in the styles using the addImport method if available. 677 var match, importMatch = /^@import url\("(.*)"\);$/igm; 678 if (document.styleSheets[0].addImport && importMatch.test(response.data)) { 679 importMatch.lastIndex = 0; 680 while (match = importMatch.exec(response.data)) { 681 document.styleSheets[0].addImport(match[1]); 682 } 683 } 684 }, 685 686 /** 687 * Command to update a form's build ID. 688 */ 689 updateBuildId: function(ajax, response, status) { 690 $('input[name="form_build_id"][value="' + response['old'] + '"]').val(response['new']); 691 } 692}; 693 694})(jQuery); 695; 696(function (D) { 697 var beforeSerialize = D.ajax.prototype.beforeSerialize;
698 D.ajax.prototype.beforeSerialize = function (element, options) { 699 beforeSerialize.call(this, element, options); 700 options.data['ajax_page_state[jquery_version]'] = D.settings.ajaxPageState.jquery_version; 701 } 702})(Drupal); 703;
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.