/* * jQuery 1.2.6 - New Wave Javascript * * Copyright (c) 2008 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * $Date: 2008/06/23 22:58:52 $ * $Rev: 5685 $ */ (function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,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(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();;// $Id: drupal.js,v 1.41.2.3 2008/06/25 09:06:57 goba Exp $ var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} }; /** * Set the variable that indicates if JavaScript behaviors should be applied */ Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById; /** * Attach all registered behaviors to a page element. * * Behaviors are event-triggered actions that attach to page elements, enhancing * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors * object as follows: * @code * Drupal.behaviors.behaviorName = function () { * ... * }; * @endcode * * Drupal.attachBehaviors is added below to the jQuery ready event and so * runs on initial page load. Developers implementing AHAH/AJAX in their * solutions should also call this function after new page content has been * loaded, feeding in an element to be processed, in order to attach all * behaviors to the new content. * * Behaviors should use a class in the form behaviorName-processed to ensure * the behavior is attached only once to a given element. (Doing so enables * the reprocessing of given elements, which may be needed on occasion despite * the ability to limit behavior attachment to a particular element.) * * @param context * An element to attach behaviors to. If none is given, the document element * is used. */ Drupal.attachBehaviors = function(context) { context = context || document; if (Drupal.jsEnabled) { // Execute all of them. jQuery.each(Drupal.behaviors, function() { this(context); }); } }; /** * Encode special characters in a plain-text string for display as HTML. */ Drupal.checkPlain = function(str) { str = String(str); var replace = { '&': '&', '"': '"', '<': '<', '>': '>' }; for (var character in replace) { var regex = new RegExp(character, 'g'); str = str.replace(regex, replace[character]); } return str; }; /** * Translate strings to the page language or a given language. * * See the documentation of the server-side t() function for further details. * * @param str * A string containing the English string to translate. * @param args * An object of replacements pairs to make after translation. Incidences * of any key in this array are replaced with the corresponding value. * Based on the first character of the key, the value is escaped and/or themed: * - !variable: inserted as is * - @variable: escape plain text to HTML (Drupal.checkPlain) * - %variable: escape text and theme as a placeholder for user-submitted * content (checkPlain + Drupal.theme('placeholder')) * @return * The translated string. */ Drupal.t = function(str, args) { // Fetch the localized version of the string. if (Drupal.locale.strings && Drupal.locale.strings[str]) { str = Drupal.locale.strings[str]; } if (args) { // Transform arguments before inserting them for (var key in args) { switch (key.charAt(0)) { // Escaped only case '@': args[key] = Drupal.checkPlain(args[key]); break; // Pass-through case '!': break; // Escaped and placeholder case '%': default: args[key] = Drupal.theme('placeholder', args[key]); break; } str = str.replace(key, args[key]); } } return str; }; /** * Format a string containing a count of items. * * This function ensures that the string is pluralized correctly. Since Drupal.t() is * called by this function, make sure not to pass already-localized strings to it. * * See the documentation of the server-side format_plural() function for further details. * * @param count * The item count to display. * @param singular * The string for the singular case. Please make sure it is clear this is * singular, to ease translation (e.g. use "1 new comment" instead of "1 new"). * Do not use @count in the singular string. * @param plural * The string for the plural case. Please make sure it is clear this is plural, * to ease translation. Use @count in place of the item count, as in "@count * new comments". * @param args * An object of replacements pairs to make after translation. Incidences * of any key in this array are replaced with the corresponding value. * Based on the first character of the key, the value is escaped and/or themed: * - !variable: inserted as is * - @variable: escape plain text to HTML (Drupal.checkPlain) * - %variable: escape text and theme as a placeholder for user-submitted * content (checkPlain + Drupal.theme('placeholder')) * Note that you do not need to include @count in this array. * This replacement is done automatically for the plural case. * @return * A translated string. */ Drupal.formatPlural = function(count, singular, plural, args) { var args = args || {}; args['@count'] = count; // Determine the index of the plural form. var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1); if (index == 0) { return Drupal.t(singular, args); } else if (index == 1) { return Drupal.t(plural, args); } else { args['@count['+ index +']'] = args['@count']; delete args['@count']; return Drupal.t(plural.replace('@count', '@count['+ index +']')); } }; /** * Generate the themed representation of a Drupal object. * * All requests for themed output must go through this function. It examines * the request and routes it to the appropriate theme function. If the current * theme does not provide an override function, the generic theme function is * called. * * For example, to retrieve the HTML that is output by theme_placeholder(text), * call Drupal.theme('placeholder', text). * * @param func * The name of the theme function to call. * @param ... * Additional arguments to pass along to the theme function. * @return * Any data the theme function returns. This could be a plain HTML string, * but also a complex object. */ Drupal.theme = function(func) { for (var i = 1, args = []; i < arguments.length; i++) { args.push(arguments[i]); } return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args); }; /** * Parse a JSON response. * * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message. */ Drupal.parseJson = function (data) { if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) { return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') }; } return eval('(' + data + ');'); }; /** * Freeze the current body height (as minimum height). Used to prevent * unnecessary upwards scrolling when doing DOM manipulations. */ Drupal.freezeHeight = function () { Drupal.unfreezeHeight(); var div = document.createElement('div'); $(div).css({ position: 'absolute', top: '0px', left: '0px', width: '1px', height: $('body').css('height') }).attr('id', 'freeze-height'); $('body').append(div); }; /** * Unfreeze the body height */ Drupal.unfreezeHeight = function () { $('#freeze-height').remove(); }; /** * Wrapper to address the mod_rewrite url encoding bug * (equivalent of drupal_urlencode() in PHP). */ Drupal.encodeURIComponent = function (item, uri) { uri = uri || location.href; item = encodeURIComponent(item).replace(/%2F/g, '/'); return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F'); }; /** * Get the text selection in a textarea. */ Drupal.getSelection = function (element) { if (typeof(element.selectionStart) != 'number' && document.selection) { // The current selection var range1 = document.selection.createRange(); var range2 = range1.duplicate(); // Select all text. range2.moveToElementText(element); // Now move 'dummy' end point to end point of original range. range2.setEndPoint('EndToEnd', range1); // Now we can calculate start and end points. var start = range2.text.length - range1.text.length; var end = start + range1.text.length; return { 'start': start, 'end': end }; } return { 'start': element.selectionStart, 'end': element.selectionEnd }; }; /** * Build an error message from ahah response. */ Drupal.ahahError = function(xmlhttp, uri) { if (xmlhttp.status == 200) { if (jQuery.trim($(xmlhttp.responseText).text())) { var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText }); } else { var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText }); } } else { var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status }); } return message; } // Global Killswitch on the element if (Drupal.jsEnabled) { // Global Killswitch on the element $(document.documentElement).addClass('js'); // 'js enabled' cookie document.cookie = 'has_js=1; path=/'; // Attach all behaviors. $(document).ready(function() { Drupal.attachBehaviors(this); }); } /** * The default themes. */ Drupal.theme.prototype = { /** * Formats text for emphasized display in a placeholder inside a sentence. * * @param str * The text to format (plain-text). * @return * The formatted text (html). */ placeholder: function(str) { return '' + Drupal.checkPlain(str) + ''; } }; ;// $Id: progress.js,v 1.20 2008/01/04 11:53:21 goba Exp $ /** * A progressbar object. Initialized with the given id. Must be inserted into * the DOM afterwards through progressBar.element. * * method is the function which will perform the HTTP request to get the * progress bar state. Either "GET" or "POST". * * e.g. pb = new progressBar('myProgressBar'); * some_element.appendChild(pb.element); */ Drupal.progressBar = function (id, updateCallback, method, errorCallback) { var pb = this; this.id = id; this.method = method || "GET"; this.updateCallback = updateCallback; this.errorCallback = errorCallback; this.element = document.createElement('div'); this.element.id = id; this.element.className = 'progress'; $(this.element).html('
'+ '
'+ '
 
'); }; /** * Set the percentage and status message for the progressbar. */ Drupal.progressBar.prototype.setProgress = function (percentage, message) { if (percentage >= 0 && percentage <= 100) { $('div.filled', this.element).css('width', percentage +'%'); $('div.percentage', this.element).html(percentage +'%'); } $('div.message', this.element).html(message); if (this.updateCallback) { this.updateCallback(percentage, message, this); } }; /** * Start monitoring progress via Ajax. */ Drupal.progressBar.prototype.startMonitoring = function (uri, delay) { this.delay = delay; this.uri = uri; this.sendPing(); }; /** * Stop monitoring progress via Ajax. */ Drupal.progressBar.prototype.stopMonitoring = function () { clearTimeout(this.timer); // This allows monitoring to be stopped from within the callback this.uri = null; }; /** * Request progress data from server. */ Drupal.progressBar.prototype.sendPing = function () { if (this.timer) { clearTimeout(this.timer); } if (this.uri) { var pb = this; // When doing a post request, you need non-null data. Otherwise a // HTTP 411 or HTTP 406 (with Apache mod_security) error may result. $.ajax({ type: this.method, url: this.uri, data: '', dataType: 'json', success: function (progress) { // Display errors if (progress.status == 0) { pb.displayError(progress.data); return; } // Update display pb.setProgress(progress.percentage, progress.message); // Schedule next timer pb.timer = setTimeout(function() { pb.sendPing(); }, pb.delay); }, error: function (xmlhttp) { pb.displayError(Drupal.ahahError(xmlhttp, pb.uri)); } }); } }; /** * Display errors on the page. */ Drupal.progressBar.prototype.displayError = function (string) { var error = document.createElement('div'); error.className = 'error'; error.innerHTML = string; $(this.element).before(error).hide(); if (this.errorCallback) { this.errorCallback(this); } }; ;/* $Id: auto_image_handling.js,v 1.1.4.27 2009/08/07 08:53:00 snpower Exp $ */ // Image Node Auto-Format with Auto Image Grouping. // Original version by Steve McKenzie. // Altered by Stella Power for jQuery version. function parse_url(url, param) { param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); url = url.replace(/&/, "&"); var regexS = "[\\?&]"+param+"=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(url); if (results === null) { return ""; } else { return results[1]; } } function lightbox2_init_triggers(classes, rel_type, custom_class) { if (classes == '' || rel_type == 0) { return; } var settings = Drupal.settings.lightbox2; var link_target = ""; if (settings.node_link_target !== 0) { link_target = 'target="'+ settings.node_link_target +'"'; } $("a:has("+classes+")").each(function(i) { if ((!settings.disable_for_gallery_lists && !settings.disable_for_acidfree_gallery_lists) || (!$(this).parents("td.giAlbumCell").attr("class") && !$(this).parents(".galleries").length && !$(this).parents(".acidfree-folder").length && !$(this).parents(".acidfree-list").length) || ($(this).parents(".galleries").length && !settings.disable_for_gallery_lists) || (($(this).parents(".acidfree-folder").length || $(this).parents(".acidfree-list").length) && !settings.disable_for_acidfree_gallery_lists)) { var child = $(this).find(classes); // Ensure the child has a class attribute we can work with. if ($(child).attr("class") && !$(this).parents("div.acidfree-video").length) { // Set the alt text. var alt = $(child).attr("alt"); if (!alt) { alt = ""; } // Set the image node link text. var link_text = settings.node_link_text; var download_link_text = settings.download_link_text; var rewrite = 1; // Set the rel attribute. var rel = "lightbox"; var lightframe = false; if (rel_type == "lightframe_ungrouped") { rel = "lightframe[]"; lightframe = true; } else if (rel_type == "lightframe") { lightframe = true; } else if (rel_type == "lightbox_ungrouped") { rel = "lightbox[]"; } if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") { rel = rel_type + "[" + $(child).attr("class") + "]"; } // Set the basic href attribute - need to ensure there's no language // string (e.g. /en) prepended to the URL. var id = null; var href = $(child).attr("src"); var download = null; var orig_href = $(this).attr("href"); var pattern = new RegExp(settings.file_path); if (orig_href.match(pattern)) { var lang_pattern = new RegExp(Drupal.settings.basePath + "\\w\\w\\/"); orig_href = orig_href.replace(lang_pattern, Drupal.settings.basePath); } var frame_href = orig_href; // Handle flickr images. if ($(child).attr("class").match("flickr-photo-img") || $(child).attr("class").match("flickr-photoset-img")) { href = $(child).attr("src").replace("_s.", ".").replace("_t.", ".").replace("_m.", ".").replace("_b.", "."); if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") { rel = rel_type + "[flickr]"; if ($(child).parents("div.block-flickr").attr("class")) { id = $(child).parents("div.block-flickr").attr("id"); rel = rel_type + "["+ id +"]"; } } } // Handle "image-img_assist_custom" images. else if ($(child).attr("class").match("image-img_assist_custom")) { // Image assist uses "+" signs for spaces which doesn't work for // normal links. if (settings.display_image_size != "original") { orig_href = orig_href.replace(/\+/, " "); href = $(child).attr("src").replace(new RegExp("\\.img_assist_custom"), ((settings.display_image_size === "")?settings.display_image_size:"."+ settings.display_image_size)); if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") { rel = rel_type + "[node_images]"; } if (lightframe) { frame_href = orig_href + "/lightbox2"; } } else { rewrite = 0; } } // Handle "inline" images. else if ($(child).attr("class").match("inline")) { href = orig_href; } // Handle gallery2 block images. else if ($(child).attr("class").match("ImageFrame_image") || $(child).attr("class").match("ImageFrame_none")) { var thumb_id = parse_url(href, "g2_itemId"); var new_id = parse_url(orig_href, "g2_itemId"); if (new_id && thumb_id) { var g2pattern = new RegExp("g2_itemId="+thumb_id); var replacement = "g2_itemId="+ new_id; href = href.replace(g2pattern, replacement); } rel = rel_type + "[gallery2]"; if ($(child).parents("div.block-gallery").attr("class")) { id = $(child).parents("div.block-gallery").attr("id"); rel = rel_type + "["+ id +"]"; } download = href; } // Set the href attribute. else if (settings.image_node_sizes != '()' && !custom_class) { if (settings.display_image_size != "original") { href = $(child).attr("src").replace(new RegExp(settings.image_node_sizes), ((settings.display_image_size === "")?settings.display_image_size:"."+ settings.display_image_size)).replace(/(image\/view\/\d+)(\/[\w\-]*)/, ((settings.display_image_size === "")?"$1/_original":"$1/"+ settings.display_image_size)); if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") { rel = rel_type + "[node_images]"; if ($(child).parents("div.block-multiblock,div.block-image").attr("class")) { id = $(child).parents("div.block-multiblock,div.block-image").attr("id"); rel = rel_type + "["+ id +"]"; } } download = $(child).attr("src").replace(new RegExp(settings.image_node_sizes), "").replace(/(image\/view\/\d+)(\/[\w\-]*)/, "$1/_original"); if (lightframe) { frame_href = orig_href + "/lightbox2"; } } else { rewrite = 0; } } // Modify the image url. var img_title = $(child).attr("title"); if (!img_title) { img_title = $(this).attr("title"); if (!img_title) { img_title = $(child).attr("alt"); } $(child).attr({title: img_title}); } if (lightframe) { href = frame_href; } if (rewrite) { if (!custom_class) { var title_link = ""; if (link_text.length) { title_link = "

"+ link_text + ""; } if (download_link_text.length && download) { title_link = title_link + " - " + download_link_text + ""; } rel = rel + "[" + alt + title_link + "]"; $(this).attr({ rel: rel, href: href }); } else { if (rel_type != "lightbox_ungrouped" && rel_type != "lightframe_ungrouped") { rel = rel_type + "[" + $(child).attr("class") + "]"; if ($(child).parents("div.block-image").attr("class")) { id = $(child).parents("div.block-image").attr("id"); rel = rel_type + "["+ id +"]"; } } rel = rel + "[" + alt + "]"; $(this).attr({ rel: rel, href: orig_href }); } } } } }); } function lightbox2_init_acidfree_video() { var settings = Drupal.settings.lightbox2; var link_target = ""; if (settings.node_link_target !== 0) { link_target = 'target="'+ settings.node_link_target +'"'; } var link_text = settings.node_link_text; var rel = "lightframe"; $("div.acidfree-video a").each(function(i) { if (!settings.disable_for_acidfree_gallery_lists || (!$(this).parents(".acidfree-folder").length && !$(this).parents(".acidfree-list").length) || (($(this).parents(".acidfree-folder").length || $(this).parents(".acidfree-list").length) && !settings.disable_for_acidfree_gallery_lists)) { var orig_href = $(this).attr("href"); var href = orig_href + "/lightframevideo"; var title = $(this).attr("title"); var title_link = ""; if (link_text.length) { title_link = "
"+ link_text + ""; } $(this).attr({ rel: rel, title: title + title_link, href: href }); } }); } function lightbox2_image_nodes() { var settings = Drupal.settings.lightbox2; // Don't do it on the image assist popup selection screen. var img_assist = document.getElementById("img_assist_thumbs"); if (!img_assist) { // Select the enabled image types. lightbox2_init_triggers(settings.trigger_lightbox_classes, "lightbox_ungrouped"); lightbox2_init_triggers(settings.custom_trigger_classes, settings.custom_class_handler, true); lightbox2_init_triggers(settings.trigger_lightbox_group_classes, "lightbox"); lightbox2_init_triggers(settings.trigger_slideshow_classes, "lightshow"); lightbox2_init_triggers(settings.trigger_lightframe_classes, "lightframe_ungrouped"); lightbox2_init_triggers(settings.trigger_lightframe_group_classes, "lightframe"); if (settings.enable_acidfree_videos) { lightbox2_init_acidfree_video(); } } } Drupal.behaviors.initAutoLightbox = function (context) { lightbox2_image_nodes(); }; ;/* $Id: lightbox_video.js,v 1.1.4.13 2009/01/05 01:12:34 snpower Exp $ */ /** * Lightbox video * @author * Stella Power, */ var Lightvideo = { // startVideo() startVideo: function (href) { if (Lightvideo.checkKnownVideos(href)) { return; } else if (href.match(/\.mov/i)) { if (navigator.plugins && navigator.plugins.length) { Lightbox.modalHTML =''; } else { Lightbox.modalHTML = ''; } } else if (href.match(/\.wmv/i) || href.match(/\.asx/i)) { Lightbox.modalHTML = ''; } else { Lightbox.videoId = href; href = Lightbox.flvPlayer + '?file=' + href; if (Lightbox.flvFlashvars.length) { variables = Lightbox.flvFlashvars; href = href + '&' + Lightbox.flvFlashvars; } Lightvideo.createEmbed(href, "flvplayer", "#ffffff", variables); } }, // createEmbed() createEmbed: function(href, id, color, variables) { var bgcolor = 'bgcolor="' + color + '"'; var flashvars = ''; if (variables) { flashvars = 'flashvars="' + variables + '"'; } Lightbox.modalHTML = ''; }, // checkKnownVideos() checkKnownVideos: function(href) { if (Lightvideo.checkYouTubeVideo(href) || Lightvideo.checkGoogleVideo(href) || Lightvideo.checkMySpaceVideo(href) || Lightvideo.checkLiveVideo(href) || Lightvideo.checkMetacafeVideo(href) || Lightvideo.checkIFilmSpikeVideo(href) ) { return true; } return false; }, // checkYouTubeVideo() checkYouTubeVideo: function(href) { var patterns = [ 'youtube.com/v/([^"&]+)', 'youtube.com/watch\\?v=([^"&]+)', 'youtube.com/\\?v=([^"&]+)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; var href = "http://www.youtube.com/v/"+Lightbox.videoId; var variables = 'fs=1'; if (Lightbox.flvFlashvars.length) { variables = variables + '&' + Lightbox.flvFlashvars; href = href + '&' + variables; } Lightvideo.createEmbed(href, "flvvideo", "#ffffff", variables); return true; } } return false; }, // checkGoogleVideo() checkGoogleVideo: function(href) { var patterns = [ 'http://video.google.[a-z]{2,4}/googleplayer.swf\\?docId=(-?\\d*)', 'http://video.google.[a-z]{2,4}/videoplay\\?docid=([^&]*)&', 'http://video.google.[a-z]{2,4}/videoplay\\?docid=(.*)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; var href = "http://video.google.com/googleplayer.swf?docId="+Lightbox.videoId+"&hl=en"; var variables = 'fs=true'; if (Lightbox.flvFlashvars.length) { variables = variables + '&' + Lightbox.flvFlashvars; href = href + '&' + variables; } Lightvideo.createEmbed(href, "flvvideo", "#ffffff", variables); return true; } } return false; }, // checkMetacafeVideo() checkMetacafeVideo: function(href) { var patterns = [ 'metacafe.com/watch/(\.[^/]*)/(\.[^/]*)/', 'metacafe.com/watch/(\.[^/]*)/(\.*)', 'metacafe.com/fplayer/(\.[^/]*)/(\.[^.]*).' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://www.metacafe.com/fplayer/"+Lightbox.videoId+"/.swf", "flvvideo", "#ffffff"); return true; } } return false; }, // checkIFilmSpikeVideo() checkIFilmSpikeVideo: function(href) { var patterns = [ 'spike.com/video/[^/&"]*?/(\\d+)', 'ifilm.com/video/[^/&"]*?/(\\d+)', 'spike.com/video/([^/&"]*)', 'ifilm.com/video/([^/&"]*)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://www.spike.com/efp", "flvvideo", "#000", "flvbaseclip="+Lightbox.videoId+"&"); return true; } } return false; }, // checkMySpaceVideo() checkMySpaceVideo: function(href) { var patterns = [ 'src="myspace.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)', 'myspace.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)', 'src="myspacetv.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)"', 'myspacetv.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://lads.myspace.com/videos/vplayer.swf", "flvvideo", "#ffffff", "m="+Lightbox.videoId); return true; } } return false; }, // checkLiveVideo() checkLiveVideo: function(href) { var patterns = [ 'livevideo.com/flvplayer/embed/([^"]*)"', 'livevideo.com/video/[^/]*?/([^/]*)/', 'livevideo.com/video/([^/]*)/' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://www.livevideo.com/flvplayer/embed/"+Lightbox.videoId, "flvvideo", "#ffffff"); return true; } } return false; } }; ;/* $Id: lightbox.js,v 1.5.2.6.2.121 2010/03/07 17:32:30 snpower Exp $ */ /** * jQuery Lightbox * @author * Stella Power, * * Based on Lightbox v2.03.3 by Lokesh Dhakar * * Also partially based on the jQuery Lightbox by Warren Krewenki * * * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module * maintainers to distribute this file via Drupal.org * Under GPL license. * * Slideshow, iframe and video functionality added by Stella Power. */ var Lightbox = { auto_modal : false, overlayOpacity : 0.8, // Controls transparency of shadow overlay. overlayColor : '000', // Controls colour of shadow overlay. disableCloseClick : true, // Controls the order of the lightbox resizing animation sequence. resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width. resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation. fadeInSpeed: 'normal', // Controls the speed of the image appearance. slideDownSpeed: 'slow', // Controls the speed of the image details appearance. minWidth: 240, borderSize : 10, boxColor : 'fff', fontColor : '000', topPosition : '', infoHeight: 20, alternative_layout : false, imageArray : [], imageNum : null, total : 0, activeImage : null, inprogress : false, disableResize : false, disableZoom : false, isZoomedIn : false, rtl : false, loopItems : false, keysClose : ['c', 'x', 27], keysPrevious : ['p', 37], keysNext : ['n', 39], keysZoom : ['z'], keysPlayPause : [32], // Slideshow options. slideInterval : 5000, // In milliseconds. showPlayPause : true, autoStart : true, autoExit : true, pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked. pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked. slideIdArray : [], slideIdCount : 0, isSlideshow : false, isPaused : false, loopSlides : false, // Iframe options. isLightframe : false, iframe_width : 600, iframe_height : 400, iframe_border : 1, // Video and modal options. enableVideo : false, flvPlayer : '/flvplayer.swf', flvFlashvars : '', isModal : false, isVideo : false, videoId : false, modalWidth : 400, modalHeight : 400, modalHTML : null, // initialize() // Constructor runs on completion of the DOM loading. // The function inserts html at the bottom of the page which is used // to display the shadow overlay and the image container. initialize: function() { var s = Drupal.settings.lightbox2; Lightbox.overlayOpacity = s.overlay_opacity; Lightbox.overlayColor = s.overlay_color; Lightbox.disableCloseClick = s.disable_close_click; Lightbox.resizeSequence = s.resize_sequence; Lightbox.resizeSpeed = s.resize_speed; Lightbox.fadeInSpeed = s.fade_in_speed; Lightbox.slideDownSpeed = s.slide_down_speed; Lightbox.borderSize = s.border_size; Lightbox.boxColor = s.box_color; Lightbox.fontColor = s.font_color; Lightbox.topPosition = s.top_position; Lightbox.rtl = s.rtl; Lightbox.loopItems = s.loop_items; Lightbox.keysClose = s.keys_close.split(" "); Lightbox.keysPrevious = s.keys_previous.split(" "); Lightbox.keysNext = s.keys_next.split(" "); Lightbox.keysZoom = s.keys_zoom.split(" "); Lightbox.keysPlayPause = s.keys_play_pause.split(" "); Lightbox.disableResize = s.disable_resize; Lightbox.disableZoom = s.disable_zoom; Lightbox.slideInterval = s.slideshow_interval; Lightbox.showPlayPause = s.show_play_pause; Lightbox.autoStart = s.slideshow_automatic_start; Lightbox.autoExit = s.slideshow_automatic_exit; Lightbox.pauseOnNextClick = s.pause_on_next_click; Lightbox.pauseOnPrevClick = s.pause_on_previous_click; Lightbox.loopSlides = s.loop_slides; Lightbox.alternative_layout = s.use_alt_layout; Lightbox.iframe_width = s.iframe_width; Lightbox.iframe_height = s.iframe_height; Lightbox.iframe_border = s.iframe_border; Lightbox.enableVideo = s.enable_video; if (s.enable_video) { Lightbox.flvPlayer = s.flvPlayer; Lightbox.flvFlashvars = s.flvFlashvars; } // Make the lightbox divs. var output = '\ '; var loading = '
'; var modal = ''; var frame = ''; var imageContainer = ''; var details = '
'; var bottomNav = '
'; var image = ''; var hoverNav = '
'; var frameNav = '
'; var caption = ''; var numberDisplay = ''; var close = ''; var zoom = ''; var zoomOut = ''; var pause = ''; var play = ''; $("body").append(output); $('#outerImageContainer').append(modal + frame + imageContainer + loading); if (!s.use_alt_layout) { $('#imageContainer').append(image + hoverNav); $('#imageData').append(frameNav + details + bottomNav); $('#imageDetails').append(caption + numberDisplay); $('#bottomNav').append(close + zoom + zoomOut + pause + play); } else { $('#outerImageContainer').append(bottomNav); $('#imageContainer').append(image); $('#bottomNav').append(close + zoom + zoomOut); $('#imageData').append(hoverNav + details); $('#imageDetails').append(caption + numberDisplay + pause + play); } // Setup onclick handlers. if (Lightbox.disableCloseClick) { $('#overlay').click(function() { Lightbox.end(); return false; } ).hide(); } $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } ); $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } ); $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } ); $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } ); $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } ); $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } ); $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } ); // Fix positioning. $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'}); $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'}); $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor}); if (Lightbox.alternative_layout) { $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'}); } else if (Lightbox.rtl == 1 && $.browser.msie) { $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'}); } // Force navigation links to always be displayed if (s.force_show_nav) { $('#prevLink, #nextLink').addClass("force_show_nav"); } }, // initList() // Loops through anchor tags looking for 'lightbox', 'lightshow' and // 'lightframe', etc, references and applies onclick events to appropriate // links. You can rerun after dynamically adding images w/ajax. initList : function(context) { if (context == undefined || context == null) { context = document; } // Attach lightbox to any links with rel 'lightbox', 'lightshow' or // 'lightframe', etc. $("a[rel^='lightbox']:not(.lightbox-processed), area[rel^='lightbox']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, false, false, false, false); if (e.preventDefault) { e.preventDefault(); } return false; }); $("a[rel^='lightshow']:not(.lightbox-processed), area[rel^='lightshow']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, true, false, false, false); if (e.preventDefault) { e.preventDefault(); } return false; }); $("a[rel^='lightframe']:not(.lightbox-processed), area[rel^='lightframe']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, false, true, false, false); if (e.preventDefault) { e.preventDefault(); } return false; }); if (Lightbox.enableVideo) { $("a[rel^='lightvideo']:not(.lightbox-processed), area[rel^='lightvideo']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { if (Lightbox.disableCloseClick) { $('#lightbox').unbind('click'); $('#lightbox').click(function() { Lightbox.end('forceClose'); } ); } Lightbox.start(this, false, false, true, false); if (e.preventDefault) { e.preventDefault(); } return false; }); } $("a[rel^='lightmodal']:not(.lightbox-processed), area[rel^='lightmodal']:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { $('#lightbox').unbind('click'); Lightbox.start(this, false, false, false, true); if (e.preventDefault) { e.preventDefault(); } return false; }); $("#lightboxAutoModal:not(.lightbox-processed)", context).addClass('lightbox-processed').click(function(e) { Lightbox.auto_modal = true; $('#lightbox').unbind('click'); Lightbox.start(this, false, false, false, true); if (e.preventDefault) { e.preventDefault(); } return false; }); }, // start() // Display overlay and lightbox. If image is part of a set, add siblings to // imageArray. start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) { Lightbox.isPaused = !Lightbox.autoStart; // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2. Lightbox.toggleSelectsFlash('hide'); // Stretch overlay to fill page and fade in. var arrayPageSize = Lightbox.getPageSize(); $("#overlay").hide().css({ 'width': '100%', 'zIndex': '10090', 'height': arrayPageSize[1] + 'px', 'backgroundColor' : '#' + Lightbox.overlayColor }); // Detect OS X FF2 opacity + flash issue. if (lightvideo && this.detectMacFF2()) { $("#overlay").removeClass("overlay_default"); $("#overlay").addClass("overlay_macff2"); $("#overlay").css({'opacity' : null}); } else { $("#overlay").removeClass("overlay_macff2"); $("#overlay").addClass("overlay_default"); $("#overlay").css({'opacity' : Lightbox.overlayOpacity}); } $("#overlay").fadeIn(Lightbox.fadeInSpeed); Lightbox.isSlideshow = slideshow; Lightbox.isLightframe = lightframe; Lightbox.isVideo = lightvideo; Lightbox.isModal = lightmodal; Lightbox.imageArray = []; Lightbox.imageNum = 0; var anchors = $(imageLink.tagName); var anchor = null; var rel_parts = Lightbox.parseRel(imageLink); var rel = rel_parts["rel"]; var rel_group = rel_parts["group"]; var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title); var rel_style = null; var i = 0; // Set the title for image alternative text. var alt = imageLink.title; if (!alt) { var img = $(imageLink).find("img"); if (img && $(img).attr("alt")) { alt = $(img).attr("alt"); } else { alt = title; } } if ($(imageLink).attr('id') == 'lightboxAutoModal') { rel_style = rel_parts["style"]; Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]); } else { // Handle lightbox images with no grouping. if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) { Lightbox.imageArray.push([imageLink.href, title, alt]); } // Handle other items with no grouping. else if (!rel_group) { rel_style = rel_parts["style"]; Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]); } // Handle grouped items. else { // Loop through anchors and add them to imageArray. for (i = 0; i < anchors.length; i++) { anchor = anchors[i]; if (anchor.href && typeof(anchor.href) == "string" && $(anchor).attr('rel')) { var rel_data = Lightbox.parseRel(anchor); var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title); img_alt = anchor.title; if (!img_alt) { var anchor_img = $(anchor).find("img"); if (anchor_img && $(anchor_img).attr("alt")) { img_alt = $(anchor_img).attr("alt"); } else { img_alt = title; } } if (rel_data["rel"] == rel) { if (rel_data["group"] == rel_group) { if (Lightbox.isLightframe || Lightbox.isModal) { rel_style = rel_data["style"]; } Lightbox.imageArray.push([anchor.href, anchor_title, img_alt, rel_style]); } } } } // Remove duplicates. for (i = 0; i < Lightbox.imageArray.length; i++) { for (j = Lightbox.imageArray.length-1; j > i; j--) { if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) { Lightbox.imageArray.splice(j,1); } } } while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) { Lightbox.imageNum++; } } } if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) { $('#lightshowPlay').show(); $('#lightshowPause').hide(); } // Calculate top and left offset for the lightbox. var arrayPageScroll = Lightbox.getPageScroll(); var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; var lightboxLeft = arrayPageScroll[0]; $('#frameContainer, #modalContainer, #lightboxImage').hide(); $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); $('#outerImageContainer').css({'width': '250px', 'height': '250px'}); $('#lightbox').css({ 'zIndex': '10500', 'top': lightboxTop + 'px', 'left': lightboxLeft + 'px' }).show(); Lightbox.total = Lightbox.imageArray.length; Lightbox.changeData(Lightbox.imageNum); }, // changeData() // Hide most elements and preload image in preparation for resizing image // container. changeData: function(imageNum, zoomIn) { if (Lightbox.inprogress === false) { if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) { if (imageNum >= Lightbox.total) imageNum = 0; if (imageNum < 0) imageNum = Lightbox.total - 1; } if (Lightbox.isSlideshow) { for (var i = 0; i < Lightbox.slideIdCount; i++) { window.clearTimeout(Lightbox.slideIdArray[i]); } } Lightbox.inprogress = true; Lightbox.activeImage = imageNum; if (Lightbox.disableResize && !Lightbox.isSlideshow) { zoomIn = true; } Lightbox.isZoomedIn = zoomIn; // Hide elements during transition. $('#loading').css({'zIndex': '10500'}).show(); if (!Lightbox.alternative_layout) { $('#imageContainer').hide(); } $('#frameContainer, #modalContainer, #lightboxImage').hide(); $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide(); $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide(); // Preload image content, but not iframe pages. if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) { imgPreloader = new Image(); imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); }; imgPreloader.onload = function() { var photo = document.getElementById('lightboxImage'); photo.src = Lightbox.imageArray[Lightbox.activeImage][0]; photo.alt = Lightbox.imageArray[Lightbox.activeImage][2]; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; // Resize code. var arrayPageSize = Lightbox.getPageSize(); var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) }; var orig = { w:imgPreloader.width, h:imgPreloader.height }; // Image is very large, so show a smaller version of the larger image // with zoom button. if (zoomIn !== true) { var ratio = 1.0; // Shrink image with the same aspect. $('#bottomNavZoomOut, #bottomNavZoom').hide(); if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h; if (!Lightbox.disableZoom && !Lightbox.isSlideshow) { $('#bottomNavZoom').css({'zIndex': '10500'}).show(); } } imageWidth = Math.floor(orig.w * ratio); imageHeight = Math.floor(orig.h * ratio); } else { $('#bottomNavZoom').hide(); // Only display zoom out button if the image is zoomed in already. if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) { // Only display zoom out button if not a slideshow and if the // buttons aren't disabled. if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) { $('#bottomNavZoomOut').css({'zIndex': '10500'}).show(); } } } photo.style.width = (imageWidth) + 'px'; photo.style.height = (imageHeight) + 'px'; Lightbox.resizeContainer(imageWidth, imageHeight); // Clear onLoad, IE behaves irratically with animated gifs otherwise. imgPreloader.onload = function() {}; }; imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0]; imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2]; } // Set up frame size, etc. else if (Lightbox.isLightframe) { var src = Lightbox.imageArray[Lightbox.activeImage][0]; $('#frameContainer').html(''); // Enable swf support in Gecko browsers. if ($.browser.mozilla && src.indexOf('.swf') != -1) { setTimeout(function () { document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; }, 1000); } if (!Lightbox.iframe_border) { $('#lightboxFrame').css({'border': 'none'}); $('#lightboxFrame').attr('frameborder', '0'); } var iframe = document.getElementById('lightboxFrame'); var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3]; iframe = Lightbox.setStyles(iframe, iframeStyles); Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10)); } else if (Lightbox.isVideo || Lightbox.isModal) { var container = document.getElementById('modalContainer'); var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3]; container = Lightbox.setStyles(container, modalStyles); if (Lightbox.isVideo) { Lightbox.modalHeight = parseInt(container.height, 10); Lightbox.modalWidth = parseInt(container.width, 10); Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]); } Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10)); } } }, // imgNodeLoadingError() imgNodeLoadingError: function(image) { var s = Drupal.settings.lightbox2; var original_image = Lightbox.imageArray[Lightbox.activeImage][0]; if (s.display_image_size !== "") { original_image = original_image.replace(new RegExp("."+s.display_image_size), ""); } Lightbox.imageArray[Lightbox.activeImage][0] = original_image; image.onerror = function() { Lightbox.imgLoadingError(image); }; image.src = original_image; }, // imgLoadingError() imgLoadingError: function(image) { var s = Drupal.settings.lightbox2; Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image; image.src = s.default_image; }, // resizeContainer() resizeContainer: function(imgWidth, imgHeight) { imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth); this.widthCurrent = $('#outerImageContainer').width(); this.heightCurrent = $('#outerImageContainer').height(); var widthNew = (imgWidth + (Lightbox.borderSize * 2)); var heightNew = (imgHeight + (Lightbox.borderSize * 2)); // Scalars based on change from old to new. this.xScale = ( widthNew / this.widthCurrent) * 100; this.yScale = ( heightNew / this.heightCurrent) * 100; // Calculate size difference between new and old image, and resize if // necessary. wDiff = this.widthCurrent - widthNew; hDiff = this.heightCurrent - heightNew; $('#modalContainer').css({'width': imgWidth, 'height': imgHeight}); // Detect animation sequence. if (Lightbox.resizeSequence) { var animate1 = {width: widthNew}; var animate2 = {height: heightNew}; if (Lightbox.resizeSequence == 2) { animate1 = {height: heightNew}; animate2 = {width: widthNew}; } $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); } // Simultaneous. else { $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); }); } // If new and old image are same size and no scaling transition is necessary // do a quick pause to prevent image flicker. if ((hDiff === 0) && (wDiff === 0)) { if ($.browser.msie) { Lightbox.pause(250); } else { Lightbox.pause(100); } } var s = Drupal.settings.lightbox2; if (!s.use_alt_layout) { $('#prevLink, #nextLink').css({'height': imgHeight + 'px'}); } $('#imageDataContainer').css({'width': widthNew + 'px'}); }, // showData() // Display image and begin preloading neighbors. showData: function() { $('#loading').hide(); if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) { Lightbox.updateDetails(); if (Lightbox.isLightframe) { $('#frameContainer').show(); if ($.browser.safari) { $('#lightboxFrame').css({'zIndex': '10500'}).show(); } else { $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); } } else { if (Lightbox.isVideo) { $("#modalContainer").html(Lightbox.modalHTML).click(function(){return false;}).css('zIndex', '10500').show(); } else { var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]); if (Lightbox.imageArray[Lightbox.activeImage][4]) { $(src).appendTo("#modalContainer"); } else { // Use a callback to show the new image, otherwise you get flicker. $("#modalContainer").hide().load(src, function () {$('#modalContainer').css({'zIndex': '10500'}).show();}); } $('#modalContainer').unbind('click'); } // This might be needed in the Lightframe section above. //$('#modalContainer').css({'zIndex': '10500'}).show(); } } // Handle display of image content. else { $('#imageContainer').show(); if ($.browser.safari) { $('#lightboxImage').css({'zIndex': '10500'}).show(); } else { $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed); } Lightbox.updateDetails(); this.preloadNeighborImages(); } Lightbox.inprogress = false; // Slideshow specific stuff. if (Lightbox.isSlideshow) { if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { if (Lightbox.autoExit) { Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval); } } else { if (!Lightbox.isPaused && Lightbox.total > 1) { Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval); } } if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) { $('#lightshowPause').show(); $('#lightshowPlay').hide(); } else if (Lightbox.showPlayPause && Lightbox.total > 1) { $('#lightshowPause').hide(); $('#lightshowPlay').show(); } } // Adjust the page overlay size. var arrayPageSize = Lightbox.getPageSize(); var arrayPageScroll = Lightbox.getPageScroll(); var pageHeight = arrayPageSize[1]; if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) { var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1; pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop; } // begin Jon changes - removed one line and added others // to fix issue with firefox having scroll bars in the window // $('#overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'}); if ($.browser.mozilla) { $('#overlay').css({'height': pageHeight + 'px', 'width': '100%'}); } else { $('#overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'}); } // end Jon changes // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as // expected. if ($.browser.mozilla) { if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) { setTimeout(function () { document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0]; }, 1000); } } }, // updateDetails() // Display caption, image number, and bottom nav. updateDetails: function() { $("#imageDataContainer").hide(); var caption = Lightbox.imageArray[Lightbox.activeImage][1]; if (!caption) caption = ' '; $('#caption').html(caption).css({'zIndex': '10500'}).show(); // If image is part of set display 'Image x of x'. var s = Drupal.settings.lightbox2; var numberDisplay = null; if (Lightbox.total > 1) { var currentImage = Lightbox.activeImage + 1; if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) { numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } else if (Lightbox.isVideo) { numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } else { numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total); } $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show(); } $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() { $("#bottomNav").show(); }); if (Lightbox.rtl == 1) { $("#bottomNav").css({'float': 'left'}); } Lightbox.updateNav(); }, // updateNav() // Display appropriate previous and next hover navigation. updateNav: function() { $('#hoverNav').css({'zIndex': '10500'}).show(); var prevLink = '#prevLink'; var nextLink = '#nextLink'; // Slideshow is separated as we need to show play / pause button. if (Lightbox.isSlideshow) { if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) { $(prevLink).css({'zIndex': '10500'}).show().click(function() { if (Lightbox.pauseOnPrevClick) { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); } Lightbox.changeData(Lightbox.activeImage - 1); return false; }); } else { $(prevLink).hide(); } // If not last image in set, display next image button. if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) { $(nextLink).css({'zIndex': '10500'}).show().click(function() { if (Lightbox.pauseOnNextClick) { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); } Lightbox.changeData(Lightbox.activeImage + 1); return false; }); } // Safari browsers need to have hide() called again. else { $(nextLink).hide(); } } // All other types of content. else { if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) { $('#frameHoverNav').css({'zIndex': '10500'}).show(); $('#hoverNav').css({'zIndex': '10500'}).hide(); prevLink = '#framePrevLink'; nextLink = '#frameNextLink'; } // If not first image in set, display prev image button. if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) { // Unbind any other click handlers, otherwise this adds a new click handler // each time the arrow is clicked. $(prevLink).css({'zIndex': '10500'}).show().unbind().click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; }); } // Safari browsers need to have hide() called again. else { $(prevLink).hide(); } // If not last image in set, display next image button. if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) { // Unbind any other click handlers, otherwise this adds a new click handler // each time the arrow is clicked. $(nextLink).css({'zIndex': '10500'}).show().unbind().click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; }); } // Safari browsers need to have hide() called again. else { $(nextLink).hide(); } } // Don't enable keyboard shortcuts so forms will work. if (!Lightbox.isModal) { this.enableKeyboardNav(); } }, // enableKeyboardNav() enableKeyboardNav: function() { $(document).bind("keydown", this.keyboardAction); }, // disableKeyboardNav() disableKeyboardNav: function() { $(document).unbind("keydown", this.keyboardAction); }, // keyboardAction() keyboardAction: function(e) { if (e === null) { // IE. keycode = event.keyCode; escapeKey = 27; } else { // Mozilla. keycode = e.keyCode; escapeKey = e.DOM_VK_ESCAPE; } key = String.fromCharCode(keycode).toLowerCase(); // Close lightbox. if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) { Lightbox.end('forceClose'); } // Display previous image (p, <-). else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) { if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) { Lightbox.changeData(Lightbox.activeImage - 1); } } // Display next image (n, ->). else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) { if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) { Lightbox.changeData(Lightbox.activeImage + 1); } } // Zoom in. else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) { if (Lightbox.isZoomedIn) { Lightbox.changeData(Lightbox.activeImage, false); } else if (!Lightbox.isZoomedIn) { Lightbox.changeData(Lightbox.activeImage, true); } return false; } // Toggle play / pause (space). else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) { if (Lightbox.isPaused) { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); } else { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); } return false; } }, preloadNeighborImages: function() { if ((Lightbox.total - 1) > Lightbox.activeImage) { preloadNextImage = new Image(); preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0]; } if (Lightbox.activeImage > 0) { preloadPrevImage = new Image(); preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0]; } }, end: function(caller) { var closeClick = (caller == 'slideshow' ? false : true); if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) { return; } // To prevent double clicks on navigation links. if (Lightbox.inprogress === true && caller != 'forceClose') { return; } Lightbox.disableKeyboardNav(); $('#lightbox').hide(); $("#overlay").fadeOut(); Lightbox.isPaused = true; Lightbox.inprogress = false; // Replaces calls to showSelectBoxes() and showFlash() in original // lightbox2. Lightbox.toggleSelectsFlash('visible'); if (Lightbox.isSlideshow) { for (var i = 0; i < Lightbox.slideIdCount; i++) { window.clearTimeout(Lightbox.slideIdArray[i]); } $('#lightshowPause, #lightshowPlay').hide(); } else if (Lightbox.isLightframe) { $('#frameContainer').empty().hide(); } else if (Lightbox.isVideo || Lightbox.isModal) { if (!Lightbox.auto_modal) { $('#modalContainer').hide().html(""); } Lightbox.auto_modal = false; } }, // getPageScroll() // Returns array with x,y page scroll values. // Core code from - quirksmode.com. getPageScroll : function() { var xScroll, yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict. yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// All other Explorers. yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } arrayPageScroll = [xScroll,yScroll]; return arrayPageScroll; }, // getPageSize() // Returns array with page width, height and window width, height. // Core code from - quirksmode.com. // Edit for Firefox by pHaez. getPageSize : function() { var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac. xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari. xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // All except Explorer. if (document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode. windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // Other Explorers. windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // For small pages with total height less than height of the viewport. if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; } // For small pages with total width less than width of the viewport. if (xScroll < windowWidth) { pageWidth = xScroll; } else { pageWidth = windowWidth; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight); return arrayPageSize; }, // pause(numberMillis) pause : function(ms) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while (curDate - date < ms); }, // toggleSelectsFlash() // Hide / unhide select lists and flash objects as they appear above the // lightbox in some browsers. toggleSelectsFlash: function (state) { if (state == 'visible') { $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show(); } else if (state == 'hide') { $("select:visible, embed:visible, object:visible").addClass("lightbox_hidden"); $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide(); } }, // parseRel() parseRel: function (link) { var parts = []; parts["rel"] = parts["title"] = parts["group"] = parts["style"] = null; if (!$(link).attr('rel')) return parts; parts["rel"] = $(link).attr('rel').match(/\w+/)[0]; if ($(link).attr('rel').match(/\[(.*)\]/)) { var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|'); parts["group"] = info[0]; parts["style"] = info[1]; } if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) { parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1]; } return parts; }, // setStyles() setStyles: function(item, styles) { item.width = Lightbox.iframe_width; item.height = Lightbox.iframe_height; item.scrolling = "auto"; if (!styles) return item; var stylesArray = styles.split(';'); for (var i = 0; i< stylesArray.length; i++) { if (stylesArray[i].indexOf('width:') >= 0) { var w = stylesArray[i].replace('width:', ''); item.width = jQuery.trim(w); } else if (stylesArray[i].indexOf('height:') >= 0) { var h = stylesArray[i].replace('height:', ''); item.height = jQuery.trim(h); } else if (stylesArray[i].indexOf('scrolling:') >= 0) { var scrolling = stylesArray[i].replace('scrolling:', ''); item.scrolling = jQuery.trim(scrolling); } else if (stylesArray[i].indexOf('overflow:') >= 0) { var overflow = stylesArray[i].replace('overflow:', ''); item.overflow = jQuery.trim(overflow); } } return item; }, // togglePlayPause() // Hide the pause / play button as appropriate. If pausing the slideshow also // clear the timers, otherwise move onto the next image. togglePlayPause: function(hideId, showId) { if (Lightbox.isSlideshow && hideId == "lightshowPause") { for (var i = 0; i < Lightbox.slideIdCount; i++) { window.clearTimeout(Lightbox.slideIdArray[i]); } } $('#' + hideId).hide(); $('#' + showId).show(); if (hideId == "lightshowPlay") { Lightbox.isPaused = false; if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) { Lightbox.end(); } else if (Lightbox.total > 1) { Lightbox.changeData(Lightbox.activeImage + 1); } } else { Lightbox.isPaused = true; } }, triggerLightbox: function (rel_type, rel_group) { if (rel_type.length) { if (rel_group && rel_group.length) { $("a[rel^='" + rel_type +"\[" + rel_group + "\]'], area[rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click"); } else { $("a[rel^='" + rel_type +"'], area[rel^='" + rel_type +"']").eq(0).trigger("click"); } } }, detectMacFF2: function() { var ua = navigator.userAgent.toLowerCase(); if (/firefox[\/\s](\d+\.\d+)/.test(ua)) { var ffversion = new Number(RegExp.$1); if (ffversion < 3 && ua.indexOf('mac') != -1) { return true; } } return false; }, checkKey: function(keys, key, code) { return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1); } }; // Initialize the lightbox. Drupal.behaviors.initLightbox = function (context) { $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() { Lightbox.initialize(); return false; // Break the each loop. }); // Attach lightbox to any links with lightbox rels. Lightbox.initList(context); $('#lightboxAutoModal', context).triggerHandler('click'); }; ;/* SWFObject v2.2 is released under the MIT License */ var audioplayer_swfobject=function(){var d="undefined",R="object",s="Shockwave Flash",w="ShockwaveFlash.ShockwaveFlash",Q="application/x-shockwave-flash",r="SWFObjectExprInst",X="onreadystatechange",o=window,J=document,T=navigator,t=false,u=[H],O=[],n=[],i=[],L,q,e,b,j=false,A=false,N,g,M=true,m=function(){var AA=typeof J.getElementById!=d&&typeof J.getElementsByTagName!=d&&typeof J.createElement!=d,AH=T.userAgent.toLowerCase(),y=T.platform.toLowerCase(),AE=y?/win/.test(y):/win/.test(AH),AC=y?/mac/.test(y):/mac/.test(AH),AF=/webkit/.test(AH)?parseFloat(AH.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,x=!+"\v1",AG=[0,0,0],AB=null;if(typeof T.plugins!=d&&typeof T.plugins[s]==R){AB=T.plugins[s].description;if(AB&&!(typeof T.mimeTypes!=d&&T.mimeTypes[Q]&&!T.mimeTypes[Q].enabledPlugin)){t=true;x=false;AB=AB.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AG[0]=parseInt(AB.replace(/^(.*)\..*$/,"$1"),10);AG[1]=parseInt(AB.replace(/^.*\.(.*)\s.*$/,"$1"),10);AG[2]=/[a-zA-Z]/.test(AB)?parseInt(AB.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof o.ActiveXObject!=d){try{var AD=new ActiveXObject(w);if(AD){AB=AD.GetVariable("$version");if(AB){x=true;AB=AB.split(" ")[1].split(",");AG=[parseInt(AB[0],10),parseInt(AB[1],10),parseInt(AB[2],10)]}}}catch(z){}}}return{w3:AA,pv:AG,wk:AF,ie:x,win:AE,mac:AC}}(),K=function(){if(!m.w3){return }if((typeof J.readyState!=d&&J.readyState=="complete")||(typeof J.readyState==d&&(J.getElementsByTagName("body")[0]||J.body))){F()}if(!j){if(typeof J.addEventListener!=d){J.addEventListener("DOMContentLoaded",F,false)}if(m.ie&&m.win){J.attachEvent(X,function(){if(J.readyState=="complete"){J.detachEvent(X,arguments.callee);F()}});if(o==top){(function(){if(j){return }try{J.documentElement.doScroll("left")}catch(x){setTimeout(arguments.callee,0);return }F()})()}}if(m.wk){(function(){if(j){return }if(!/loaded|complete/.test(J.readyState)){setTimeout(arguments.callee,0);return }F()})()}S(F)}}();function F(){if(j){return }try{var z=J.getElementsByTagName("body")[0].appendChild(c("span"));z.parentNode.removeChild(z)}catch(AA){return }j=true;var x=u.length;for(var y=0;y0){for(var AF=0;AF0){var AE=C(y);if(AE){if(f(O[AF].swfVersion)&&!(m.wk&&m.wk<312)){W(y,true);if(AB){AA.success=true;AA.ref=Z(y);AB(AA)}}else{if(O[AF].expressInstall&&a()){var AI={};AI.data=O[AF].expressInstall;AI.width=AE.getAttribute("width")||"0";AI.height=AE.getAttribute("height")||"0";if(AE.getAttribute("class")){AI.styleclass=AE.getAttribute("class")}if(AE.getAttribute("align")){AI.align=AE.getAttribute("align")}var AH={};var x=AE.getElementsByTagName("param");var AC=x.length;for(var AD=0;AD'}}AA.outerHTML='"+AF+"";n[n.length]=AI.id;x=C(AI.id)}else{var z=c(R);z.setAttribute("type",Q);for(var AC in AI){if(AI[AC]!=Object.prototype[AC]){if(AC.toLowerCase()=="styleclass"){z.setAttribute("class",AI[AC])}else{if(AC.toLowerCase()!="classid"){z.setAttribute(AC,AI[AC])}}}}for(var AB in AG){if(AG[AB]!=Object.prototype[AB]&&AB.toLowerCase()!="movie"){E(z,AB,AG[AB])}}AA.parentNode.replaceChild(z,AA);x=z}}return x}function E(z,x,y){var AA=c("param");AA.setAttribute("name",x);AA.setAttribute("value",y);z.appendChild(AA)}function Y(y){var x=C(y);if(x&&x.nodeName=="OBJECT"){if(m.ie&&m.win){x.style.display="none";(function(){if(x.readyState==4){B(y)}else{setTimeout(arguments.callee,10)}})()}else{x.parentNode.removeChild(x)}}}function B(z){var y=C(z);if(y){for(var x in y){if(typeof y[x]=="function"){y[x]=null}}y.parentNode.removeChild(y)}}function C(z){var x=null;try{x=J.getElementById(z)}catch(y){}return x}function c(x){return J.createElement(x)}function I(z,x,y){z.attachEvent(x,y);i[i.length]=[z,x,y]}function f(z){var y=m.pv,x=z.split(".");x[0]=parseInt(x[0],10);x[1]=parseInt(x[1],10)||0;x[2]=parseInt(x[2],10)||0;return(y[0]>x[0]||(y[0]==x[0]&&y[1]>x[1])||(y[0]==x[0]&&y[1]==x[1]&&y[2]>=x[2]))?true:false}function V(AC,y,AD,AB){if(m.ie&&m.mac){return }var AA=J.getElementsByTagName("head")[0];if(!AA){return }var x=(AD&&typeof AD=="string")?AD:"screen";if(AB){N=null;g=null}if(!N||g!=x){var z=c("style");z.setAttribute("type","text/css");z.setAttribute("media",x);N=AA.appendChild(z);if(m.ie&&m.win&&typeof J.styleSheets!=d&&J.styleSheets.length>0){N=J.styleSheets[J.styleSheets.length-1]}g=x}if(m.ie&&m.win){if(N&&typeof N.addRule==R){N.addRule(AC,y)}}else{if(N&&typeof J.createTextNode!=d){N.appendChild(J.createTextNode(AC+" {"+y+"}"))}}}function W(z,x){if(!M){return }var y=x?"visible":"hidden";if(j&&C(z)){C(z).style.visibility=y}else{V("#"+z,"visibility:"+y)}}function l(y){var z=/[\\\"<>\.;]/;var x=z.exec(y)!=null;return x&&typeof encodeURIComponent!=d?encodeURIComponent(y):y}var D=function(){if(m.ie&&m.win){window.attachEvent("onunload",function(){var AC=i.length;for(var AB=0;AB
'); $('#TB_overlay').click(tb_remove); } } else { //all others if (document.getElementById('TB_overlay') === null) { $('body').append('
'); $('#TB_overlay').click(tb_remove); } } if ($.browserextra.macfirefox) { $('#TB_overlay').addClass('TB_overlayMacFFBGHack'); //use png overlay so hide flash } else { $('#TB_overlay').addClass('TB_overlayBG'); //use background and opacity } if (caption===null) {caption='';} $('body').append('
'); //add loader to the page $('#TB_load').show(); //show loader var baseURL; if (url.indexOf('?')!==-1) { //ff there is a query string involved baseURL = url.substr(0, url.indexOf('?')); } else { baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp') { //code to show images TB_PrevCaption = ''; TB_PrevURL = ''; TB_PrevHTML = ''; TB_NextCaption = ''; TB_NextURL = ''; TB_NextHTML = ''; TB_imageCount = ''; TB_FoundURL = false; if (imageGroup) { TB_TempArray = $('a[rel=' + imageGroup + ']').get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === '')); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = '  ' + settings.next + ''; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = '  ' + settings.prev + ''; } } else { TB_FoundURL = true; TB_imageCount = settings.image_count.replace(/\!current/, (TB_Counter + 1)).replace(/\!total/, TB_TempArray.length); } } } // Modified to preload previous and next image. imgPreloader = new Image(); prevImg = new Image(); nextImg = new Image(); imgPreloader.onload = function() { imgPreloader.onload = null; var TB_Links = $('a[class*="thickbox"]'); var i = -1; TB_Links.each(function(n) { if (this.href == imgPreloader.src) { i = n; } }); if (i != -1) { if (i > 0) { prevImg.src = TB_Links[i - 1].href; } if (i + 1 < TB_Links.length) { nextImg.src = TB_Links[i + 1].href; } } // Resizing large images - orginal by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 100; var y = pagesize[1] - 100; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth < 320 ? 350 : imageWidth + 30; TB_HEIGHT = imageHeight + 60; $('#TB_window').append('' + caption + '
' + caption + '
' + TB_imageCount + TB_PrevHTML + TB_NextHTML + '
' + settings.close + ' ' + settings.esc_key + '
'); $('#TB_closeWindowButton').click(tb_remove); if (!(TB_PrevHTML === '')) { function goPrev() { if ($(document).unbind('click',goPrev)) {$(document).unbind('click',goPrev);} $('#TB_window').remove(); $('body').append('
'); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } $('#TB_prev').click(goPrev); } if (!(TB_NextHTML === '')) { function goNext() { $('#TB_window').remove(); $('body').append('
'); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } $('#TB_next').click(goNext); $('#TB_ImageOff').click(goNext); } else { $('#TB_ImageOff').click(tb_remove); } document.onkeydown = function(e) { if (e == null) { // ie keycode = event.keyCode; escapeKey = 27; } else if ($.browser.safari) { // safari keycode = e.which; escapeKey = 27; } else { // mozilla keycode = e.keyCode; escapeKey = e.DOM_VK_ESCAPE; } key = String.fromCharCode(keycode).toLowerCase(); if (key == 'x' || key == 'c' || keycode == escapeKey) { // close tb_remove(); } else if (key == 'n' || keycode == 39) { // display previous image if (!(TB_NextHTML == '')) { document.onkeydown = ''; goNext(); } } else if (key == 'p' || keycode == 37) { // display next image if (!(TB_PrevHTML == '')) { document.onkeydown = ''; goPrev(); } } }; tb_position(); $('#TB_load').remove(); $('#TB_window').css({display:'block', opacity: 0}).animate({opacity: 1}, 400); //for safari using css instead of show }; imgPreloader.src = url; } else { //code to show html var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if (url.indexOf('TB_iframe') != -1) { // either iframe or ajax window urlNoQuery = url.split('TB_'); $('#TB_iframeContent').remove(); if (params['modal'] != 'true') { //iframe no modal $('#TB_window').append('
' + caption + '
' + settings.close + ' ' + settings.esc_key + '
'); } else { //iframe modal $('#TB_overlay').unbind(); $('#TB_window').append(''); } } else { // not an iframe, ajax if ($('#TB_window').css('display') != 'block') { if (params['modal'] != 'true') { //ajax no modal $('#TB_window').append('
' + caption + '
' + settings.close + ' ' + settings.esc_key + '
'); window.setTimeout("tb_focusFirstFormElement()", 1000); } else { //ajax modal $('#TB_overlay').unbind(); $('#TB_window').append('
'); } } else { //this means the window is already up, we are just loading new content via ajax $('#TB_ajaxContent')[0].style.width = ajaxContentW + 'px'; $('#TB_ajaxContent')[0].style.height = ajaxContentH + 'px'; $('#TB_ajaxContent')[0].scrollTop = 0; $('#TB_ajaxWindowTitle').html(caption); } } $('#TB_closeWindowButton').click(tb_remove); if (url.indexOf('TB_inline') != -1) { $('#TB_ajaxContent').append($('#' + params['inlineId']).children()); $('#TB_window').unload(function () { $('#' + params['inlineId']).append($('#TB_ajaxContent').children()); // move elements back when you're finished }); tb_position(); $('#TB_load').remove(); $('#TB_window').css({display:'block', opacity: 0}).animate({opacity: 1}, 400); } else if (url.indexOf('TB_iframe') != -1) { tb_position(); if ($.browser.safari || $.browserextra.iphone) { //safari needs help because it will not fire iframe onload $('#TB_load').remove(); $('#TB_window').css({display:'block', opacity: 0}).animate({opacity: 1}, 400); } } else { $('#TB_ajaxContent').load(url += '&random=' + (new Date().getTime()),function() { //to do a post change this load method tb_position(); $('#TB_load').remove(); Drupal.attachBehaviors('#TB_ajaxContent a.thickbox'); $('#TB_window').css({display:'block', opacity: 0}).animate({opacity: 1}, 400); }); } } if (!params['modal']) { document.onkeyup = function(e) { if (e == null) { // ie keycode = event.keyCode; escapeKey = 27; } else if ($.browser.safari) { // safari keycode = e.which; escapeKey = 27; } else { // mozilla keycode = e.keyCode; escapeKey = e.DOM_VK_ESCAPE; } key = String.fromCharCode(keycode).toLowerCase(); if (keycode == escapeKey) { // close tb_remove(); } }; } } catch(e) { //nothing here } } //helper functions below function tb_showIframe() { $('#TB_load').remove(); $('#TB_window').css({display:'block', opacity: 0}).animate({opacity: 1}, 400); } function tb_remove() { $('#TB_imageOff').unbind('click'); $('#TB_overlay').unbind('click'); $('#TB_closeWindowButton').unbind('click'); $('#TB_window').fadeOut(400,function() {$('#TB_window,#TB_overlay,#TB_HideSelect').trigger('unload').unbind().remove();}); $('#TB_load').remove(); if (typeof document.body.style.maxHeight == 'undefined') { //if IE 6 $('body','html').css({height: 'auto', width: 'auto'}); $('html').css('overflow',''); } document.onkeydown = ''; document.onkeyup = ''; return false; } function tb_position() { $('#TB_window').css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if (!($.browserextra.msie6)) { // take away IE6 $('#TB_window').css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } function tb_parseQuery ( query ) { var Params = {}; if ( ! query ) {return Params;}// return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) {continue;} var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize() { var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } function tb_setBrowserExtra() { // Add iPhone, IE 6 and Mac Firefox browser detection. // msie6 fixes the fact that IE 7 now reports itself as MSIE 6.0 compatible var userAgent = navigator.userAgent.toLowerCase(); $.browserextra = { iphone: /iphone/.test( userAgent ), msie6: /msie/.test( userAgent ) && !/opera/.test( userAgent ) && /msie 6\.0/.test( userAgent ) && !/msie 7\.0/.test( userAgent ), macfirefox: /mac/.test( userAgent ) && /firefox/.test( userAgent ) }; } function tb_focusFirstFormElement() { $('#TB_window form input[type=text]:first').focus(); } ;// $Id: quicktabs.js,v 1.3.2.16 2009/03/16 20:35:31 katbailey Exp $ Drupal.settings.views = Drupal.settings.views || {'ajax_path': 'views/ajax'}; Drupal.behaviors.quicktabs = function (context) { $('.quicktabs_wrapper:not(.quicktabs-processed)', context).addClass('quicktabs-processed').each(function(){ Drupal.quicktabs.prepare(this); }); }; Drupal.quicktabs = Drupal.quicktabs || {}; // setting up the inital behaviours Drupal.quicktabs.prepare = function(el) { var i = 0; var qtid = el.id.split('-')[1]; $(el).find('ul.quicktabs_tabs li a').each(function(){ this.myTabIndex = i++; this.qtid = qtid; $(this).bind('click', quicktabsClick); }); // Search for the active tab. var $active_tab = $(el).children('.quicktabs_tabs').find('li.active a'); if ($active_tab.hasClass('qt_tab') || $active_tab.hasClass('qt_ajax_tab')) { $active_tab.trigger('click'); } else { // Click on the first tab. $(el).children('.quicktabs_tabs').find('li.first a').trigger('click'); } return false; } // constructor for an individual tab Drupal.quicktabs.tab = function (el) { this.element = el; this.tabIndex = el.myTabIndex; this.qtid = el.qtid; var qtKey = 'qt_' + this.qtid; var i = 0; for (var key in Drupal.settings.quicktabs[qtKey].tabs) { if (i == this.tabIndex) { this.tabObj = Drupal.settings.quicktabs[qtKey].tabs[key]; this.tabKey = key; } i++; } this.tabpage_id = 'quicktabs_tabpage_' + this.qtid + '_' + this.tabKey; this.container = $('#quicktabs_container_' + this.qtid); this.tabpage = this.container.find('#' + this.tabpage_id); // The 'this' variable will not persist inside of the options object. var tab = this; this.options = { success: function(response) { return tab.success(response); }, complete: function(response) { return tab.complete(); } } } // ajax callback for non-views tabs Drupal.quicktabs.tab.prototype.success = function(response) { var result = Drupal.parseJson(response.data); this.container.append(Drupal.theme('quicktabsResponse', this, result)); Drupal.attachBehaviors(this.container); } // function to call on completed ajax call // for non-views tabs Drupal.quicktabs.tab.prototype.complete = function() { // stop the progress bar this.stopProgress(); } Drupal.quicktabs.tab.prototype.stopProgress = function () { if (this.progress.element) { $(this.progress.element).remove(); } $(this.element).removeClass('progress-disabled').attr('disabled', false); } Drupal.quicktabs.tab.prototype.startProgress = function () { var progressBar = new Drupal.progressBar('qt-progress-' + this.element.id, null, null, null); progressBar.setProgress(-1, Drupal.t('Loading')); this.progress = {}; this.progress.element = $(progressBar.element).addClass('qt-progress qt-progress-bar'); this.container.prepend(this.progress.element); } Drupal.quicktabs.tab.prototype.quicktabsAjaxView = function() { // Create an empty div for the tabpage. The generated view will be inserted into this. var tab = this; tab.container.append(Drupal.theme('quicktabsResponse', this, null)); var target; target = $('#' + tab.tabpage_id + ' > div'); var ajax_path = Drupal.settings.views.ajax_path; //If there are multiple views this might've ended up showing up multiple times. if (ajax_path.constructor.toString().indexOf("Array") != -1) { ajax_path = ajax_path[0]; } var args; if (tab.tabObj.args != '') { args = tab.tabObj.args.join('/'); } else { args = ''; } var viewData = { 'view_name': tab.tabObj.vid, 'view_display_id': tab.tabObj.display, 'view_args': args } $.ajax({ url: ajax_path, type: 'GET', data: viewData, success: function(response) { // Call all callbacks. if (response.__callbacks) { $.each(response.__callbacks, function(i, callback) { eval(callback)(target, response); }); } }, complete: function() { tab.stopProgress(); }, error: function() { alert(Drupal.t("An error occurred at @path.", {'@path': ajax_path})); }, dataType: 'json' }); } var quicktabsClick = function() { var tab = new Drupal.quicktabs.tab(this); // Set clicked tab to active. $(this).parents('li').siblings().removeClass('active'); $(this).parents('li').addClass('active'); // Hide all tabpages. tab.container.children().hide(); // Show the active tabpage. if (tab.tabpage.hasClass('quicktabs_tabpage')) { tab.tabpage.show(); } else { if ($(this).hasClass('qt_ajax_tab')) { tab.startProgress(); // Construct the ajax tabpage. if (tab.tabObj.type != 'view') { // construct the ajax path to retrieve the content, depending on type var qtAjaxPath = Drupal.settings.basePath + 'quicktabs/ajax/' + tab.tabObj.type + '/'; switch (tab.tabObj.type) { case 'node': qtAjaxPath += tab.tabObj.nid + '/' + tab.tabObj.teaser + '/' + tab.tabObj.hide_title; break; case 'block': qtAjaxPath += tab.tabObj.bid + '/' + tab.tabObj.hide_title; break; case 'qtabs': qtAjaxPath += tab.tabObj.qtid; break; } $.ajax({ url: qtAjaxPath, type: 'GET', data: null, success: tab.options.success, complete: tab.options.complete, dataType: 'json' }); } else { // special treatment for views tab.quicktabsAjaxView(); } } } return false; } // theme function for ajax response Drupal.theme.prototype.quicktabsResponse = function(tab, result) { var newDiv = tab.tabObj.type == 'view' ? '
' : '
' + result['data'] + '
'; return newDiv; }; ;/** * @author Alexander Farkas * v. 1.1 */ (function($){ if(!document.defaultView || !document.defaultView.getComputedStyle){ var oldCurCSS = jQuery.curCSS; jQuery.curCSS = function(elem, name, force){ if(name !== 'backgroundPosition' || !elem.currentStyle || elem.currentStyle[ name ]){ return oldCurCSS.apply(this, arguments); } var style = elem.style; if ( !force && style && style[ name ] ){ return style[ name ]; } return oldCurCSS(elem, 'backgroundPositionX', force) +' '+ oldCurCSS(elem, 'backgroundPositionY', force); }; } })(jQuery); (function($) { function toArray(strg){ strg = strg.replace(/left|top/g,'0px'); strg = strg.replace(/right|bottom/g,'100%'); strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2"); var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/); return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]; } $.fx.step. backgroundPosition = function(fx) { if (!fx.bgPosReady) { var start = $.curCSS(fx.elem,'backgroundPosition'); if(!start){//FF2 no inline-style fallback start = '0px 0px'; } start = toArray(start); fx.start = [start[0],start[2]]; var end = toArray(fx.options.curAnim.backgroundPosition); fx.end = [end[0],end[2]]; fx.unit = [end[1],end[3]]; fx.bgPosReady = true; } var nowPosX = []; nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0]; nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1]; fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1]; }; })(jQuery);;/* * Superfish v1.4.1 - jQuery menu widget * Copyright (c) 2008 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt */ (function($){ $.superfish = {}; $.superfish.o = []; $.superfish.op = {}; $.superfish.defaults = { hoverClass : 'sfHover', pathClass : 'overideThisToUse', delay : 0, animation : {opacity:'show'}, speed : 200, oldJquery : false, /* set to true if using jQuery version below 1.2 */ disableHI : false, /* set to true to disable hoverIntent usage */ // callback functions: onInit : function(){}, onBeforeShow: function(){}, onShow : function(){}, /* note this name changed ('onshow' to 'onShow') from version 1.4 onward */ onHide : function(){} }; $.fn.superfish = function(op){ var bcClass = 'sfbreadcrumb', over = function(){ var $$ = $(this), menu = getMenu($$); getOpts(menu,true); clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl(); }, out = function(){ var $$ = $(this), menu = getMenu($$); var o = getOpts(menu,true); clearTimeout(menu.sfTimer); if ( !$$.is('.'+bcClass) ) { menu.sfTimer=setTimeout(function(){ $$.hideSuperfishUl(); if (o.$path.length){over.call(o.$path);} },o.delay); } }, getMenu = function($el){ return $el.parents('ul.superfish:first')[0]; }, getOpts = function(el,menuFound){ el = menuFound ? el : getMenu(el); return $.superfish.op = $.superfish.o[el.serial]; }, hasUl = function(){ return $.superfish.op.oldJquery ? 'li[ul]' : 'li:has(ul)'; }; return this.each(function() { var s = this.serial = $.superfish.o.length; var o = $.extend({},$.superfish.defaults,op); o.$path = $('li.'+o.pathClass,this).each(function(){ $(this).addClass(o.hoverClass+' '+bcClass) .filter(hasUl()).removeClass(o.pathClass); }); $.superfish.o[s] = $.superfish.op = o; $(hasUl(),this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out) .not('.'+bcClass) .hideSuperfishUl(); var $a = $('a',this); $a.each(function(i){ var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); }); o.onInit.call(this); }).addClass('superfish'); }; $.fn.extend({ hideSuperfishUl : function(){ var o = $.superfish.op, $ul = $('li.'+o.hoverClass,this).add(this).removeClass(o.hoverClass) .find('>ul').hide().css('visibility','hidden'); o.onHide.call($ul); return this; }, showSuperfishUl : function(){ var o = $.superfish.op, $ul = this.addClass(o.hoverClass) .find('>ul:hidden').css('visibility','visible'); o.onBeforeShow.call($ul); $ul.animate(o.animation,o.speed,function(){ o.onShow.call(this); }); return this; } }); $(window).unload(function(){ $('ul.superfish').each(function(){ $('li',this).unbind('mouseover','mouseout','mouseenter','mouseleave'); }); }); })(jQuery);; sfHover = function() { var sfEls = document.getElementById("primary-links").getElementsByTagName("li"); for (var i=0; i