var Prototype={Version:"1.7",Browser:(function(){var b=navigator.userAgent;
var a=Object.prototype.toString.call(window.opera)=="[object Opera]";
return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}
})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;
return !!(a&&a.prototype)
})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true
}var c=document.createElement("div"),b=document.createElement("form"),a=false;
if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true
}c=b=null;
return a
})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a
}};
if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false
}var Class=(function(){var e=(function(){for(var f in {toString:1}){if(f==="toString"){return false
}}return true
})();
function a(){}function b(){var l=null,k=$A(arguments);
if(Object.isFunction(k[0])){l=k.shift()
}function f(){this.initialize.apply(this,arguments)
}Object.extend(f,Class.Methods);
f.superclass=l;
f.subclasses=[];
if(l){a.prototype=l.prototype;
f.prototype=new a;
l.subclasses.push(f)
}for(var g=0,n=k.length;
g<n;
g++){f.addMethods(k[g])
}if(!f.prototype.initialize){f.prototype.initialize=Prototype.emptyFunction
}f.prototype.constructor=f;
return f
}function c(p){var k=this.superclass&&this.superclass.prototype,g=Object.keys(p);
if(e){if(p.toString!=Object.prototype.toString){g.push("toString")
}if(p.valueOf!=Object.prototype.valueOf){g.push("valueOf")
}}for(var f=0,l=g.length;
f<l;
f++){var o=g[f],n=p[o];
if(k&&Object.isFunction(n)&&n.argumentNames()[0]=="$super"){var q=n;
n=(function(r){return function(){return k[r].apply(this,arguments)
}
})(o).wrap(q);
n.valueOf=q.valueOf.bind(q);
n.toString=q.toString.bind(q)
}this.prototype[o]=n
}return this
}return{create:b,Methods:{addMethods:c}}
})();
(function(){var K=Object.prototype.toString,J="Null",t="Undefined",D="Boolean",g="Number",A="String",P="Object",B="[object Function]",G="[object Boolean]",k="[object Number]",q="[object String]",l="[object Array]",F="[object Date]",n=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";
function p(R){switch(R){case null:return J;
case (void 0):return t
}var Q=typeof R;
switch(Q){case"boolean":return D;
case"number":return g;
case"string":return A
}return P
}function H(Q,S){for(var R in S){Q[R]=S[R]
}return Q
}function O(Q){try{if(c(Q)){return"undefined"
}if(Q===null){return"null"
}return Q.inspect?Q.inspect():String(Q)
}catch(R){if(R instanceof RangeError){return"..."
}throw R
}}function L(Q){return N("",{"":Q},[])
}function N(Z,W,X){var Y=W[Z],V=typeof Y;
if(p(Y)===P&&typeof Y.toJSON==="function"){Y=Y.toJSON(Z)
}var S=K.call(Y);
switch(S){case k:case G:case q:Y=Y.valueOf()
}switch(Y){case null:return"null";
case true:return"true";
case false:return"false"
}V=typeof Y;
switch(V){case"string":return Y.inspect(true);
case"number":return isFinite(Y)?String(Y):"null";
case"object":for(var R=0,Q=X.length;
R<Q;
R++){if(X[R]===Y){throw new TypeError()
}}X.push(Y);
var U=[];
if(S===l){for(var R=0,Q=Y.length;
R<Q;
R++){var T=N(R,Y,X);
U.push(typeof T==="undefined"?"null":T)
}U="["+U.join(",")+"]"
}else{var ab=Object.keys(Y);
for(var R=0,Q=ab.length;
R<Q;
R++){var Z=ab[R],T=N(Z,Y,X);
if(typeof T!=="undefined"){U.push(Z.inspect(true)+":"+T)
}}U="{"+U.join(",")+"}"
}X.pop();
return U
}}function E(Q){return JSON.stringify(Q)
}function o(Q){return $H(Q).toQueryString()
}function u(Q){return Q&&Q.toHTML?Q.toHTML():String.interpret(Q)
}function z(Q){if(p(Q)!==P){throw new TypeError()
}var R=[];
for(var S in Q){if(Q.hasOwnProperty(S)){R.push(S)
}}return R
}function e(Q){var R=[];
for(var S in Q){R.push(Q[S])
}return R
}function I(Q){return H({},Q)
}function C(Q){return !!(Q&&Q.nodeType==1)
}function r(Q){return K.call(Q)===l
}var b=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});
if(b){r=Array.isArray
}function f(Q){return Q instanceof Hash
}function a(Q){return K.call(Q)===B
}function s(Q){return K.call(Q)===q
}function w(Q){return K.call(Q)===k
}function M(Q){return K.call(Q)===F
}function c(Q){return typeof Q==="undefined"
}H(Object,{extend:H,inspect:O,toJSON:n?E:L,toQueryString:o,toHTML:u,keys:Object.keys||z,values:e,clone:I,isElement:C,isArray:r,isHash:f,isFunction:a,isString:s,isNumber:w,isDate:M,isUndefined:c})
})();
Object.extend(Function.prototype,(function(){var p=Array.prototype.slice;
function e(t,q){var s=t.length,r=q.length;
while(r--){t[s+r]=q[r]
}return t
}function n(r,q){r=p.call(r,0);
return e(r,q)
}function k(){var q=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");
return q.length==1&&!q[0]?[]:q
}function l(s){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this
}var q=this,r=p.call(arguments,1);
return function(){var t=n(r,arguments);
return q.apply(s,t)
}
}function g(s){var q=this,r=p.call(arguments,1);
return function(u){var t=e([u||window.event],r);
return q.apply(s,t)
}
}function o(){if(!arguments.length){return this
}var q=this,r=p.call(arguments,0);
return function(){var s=n(r,arguments);
return q.apply(this,s)
}
}function f(s){var q=this,r=p.call(arguments,1);
s=s*1000;
return window.setTimeout(function(){return q.apply(q,r)
},s)
}function a(){var q=e([0.01],arguments);
return this.delay.apply(this,q)
}function c(r){var q=this;
return function(){var s=e([q.bind(this)],arguments);
return r.apply(this,s)
}
}function b(){if(this._methodized){return this._methodized
}var q=this;
return this._methodized=function(){var r=e([this],arguments);
return q.apply(null,r)
}
}return{argumentNames:k,bind:l,bindAsEventListener:g,curry:o,delay:f,defer:a,wrap:c,methodize:b}
})());
(function(c){function b(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z"
}function a(){return this.toISOString()
}if(!c.toISOString){c.toISOString=b
}if(!c.toJSON){c.toJSON=a
}})(Date.prototype);
RegExp.prototype.match=RegExp.prototype.test;
RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")
};
var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;
this.frequency=a;
this.currentlyExecuting=false;
this.registerCallback()
},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)
},execute:function(){this.callback(this)
},stop:function(){if(!this.timer){return
}clearInterval(this.timer);
this.timer=null
},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;
this.execute();
this.currentlyExecuting=false
}catch(a){this.currentlyExecuting=false;
throw a
}}}});
Object.extend(String,{interpret:function(a){return a==null?"":String(a)
},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;
function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement
}var template=new Template(replacement);
return function(match){return template.evaluate(match)
}
}function gsub(pattern,replacement){var result="",source=this,match;
replacement=prepareReplacement(replacement);
if(Object.isString(pattern)){pattern=RegExp.escape(pattern)
}if(!(pattern.length||pattern.source)){replacement=replacement("");
return replacement+source.split("").join(replacement)+replacement
}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);
result+=String.interpret(replacement(match));
source=source.slice(match.index+match[0].length)
}else{result+=source,source=""
}}return result
}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);
count=Object.isUndefined(count)?1:count;
return this.gsub(pattern,function(match){if(--count<0){return match[0]
}return replacement(match)
})
}function scan(pattern,iterator){this.gsub(pattern,iterator);
return String(this)
}function truncate(length,truncation){length=length||30;
truncation=Object.isUndefined(truncation)?"...":truncation;
return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)
}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")
}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")
}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")
}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");
return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]
})
}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)
})
}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")
}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")
}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);
if(!match){return{}
}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];
if(value!=undefined){value=decodeURIComponent(value)
}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]
}hash[key].push(value)
}else{hash[key]=value
}}return hash
})
}function toArray(){return this.split("")
}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)
}function times(count){return count<1?"":new Array(count+1).join(this)
}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""
})
}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()
}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()
}function dasherize(){return this.replace(/_/g,"-")
}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]
}return"\\u00"+character.charCodeAt().toPaddedString(2,16)
});
if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'
}return"'"+escapedString.replace(/'/g,"\\'")+"'"
}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")
}function isJSON(){var str=this;
if(str.blank()){return false
}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");
str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");
str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");
return(/^[\],:{}\s]*$/).test(str)
}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)
})
}try{if(!sanitize||json.isJSON()){return eval("("+json+")")
}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())
}function parseJSON(){var json=this.unfilterJSON();
return JSON.parse(json)
}function include(pattern){return this.indexOf(pattern)>-1
}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0
}function endsWith(pattern){var d=this.length-pattern.length;
return d>=0&&this.indexOf(pattern,d)===d
}function empty(){return this==""
}function blank(){return/^\s*$/.test(this)
}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)
}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}
})());
var Template=Class.create({initialize:function(a,b){this.template=a.toString();
this.pattern=b||Template.Pattern
},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()
}return this.template.gsub(this.pattern,function(e){if(a==null){return(e[1]+"")
}var g=e[1]||"";
if(g=="\\"){return e[2]
}var b=a,k=e[3],f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
e=f.exec(k);
if(e==null){return g
}while(e!=null){var c=e[1].startsWith("[")?e[2].replace(/\\\\]/g,"]"):e[1];
b=b[c];
if(null==b||""==e[3]){break
}k=k.substring("["==e[3]?e[1].length:e[0].length);
e=f.exec(k)
}return g+String.interpret(b)
})
}});
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={};
var Enumerable=(function(){function c(G,F){var E=0;
try{this._each(function(I){G.call(F,I,E++)
})
}catch(H){if(H!=$break){throw H
}}return this
}function z(H,G,F){var E=-H,I=[],J=this.toArray();
if(H<1){return J
}while((E+=H)<J.length){I.push(J.slice(E,E+H))
}return I.collect(G,F)
}function b(G,F){G=G||Prototype.K;
var E=true;
this.each(function(I,H){E=E&&!!G.call(F,I,H);
if(!E){throw $break
}});
return E
}function n(G,F){G=G||Prototype.K;
var E=false;
this.each(function(I,H){if(E=!!G.call(F,I,H)){throw $break
}});
return E
}function o(G,F){G=G||Prototype.K;
var E=[];
this.each(function(I,H){E.push(G.call(F,I,H))
});
return E
}function B(G,F){var E;
this.each(function(I,H){if(G.call(F,I,H)){E=I;
throw $break
}});
return E
}function l(G,F){var E=[];
this.each(function(I,H){if(G.call(F,I,H)){E.push(I)
}});
return E
}function k(H,G,F){G=G||Prototype.K;
var E=[];
if(Object.isString(H)){H=new RegExp(RegExp.escape(H))
}this.each(function(J,I){if(H.match(J)){E.push(G.call(F,J,I))
}});
return E
}function a(E){if(Object.isFunction(this.indexOf)){if(this.indexOf(E)!=-1){return true
}}var F=false;
this.each(function(G){if(G==E){F=true;
throw $break
}});
return F
}function w(F,E){E=Object.isUndefined(E)?null:E;
return this.eachSlice(F,function(G){while(G.length<F){G.push(E)
}return G
})
}function q(E,G,F){this.each(function(I,H){E=G.call(F,E,I,H)
});
return E
}function D(F){var E=$A(arguments).slice(1);
return this.map(function(G){return G[F].apply(G,E)
})
}function u(G,F){G=G||Prototype.K;
var E;
this.each(function(I,H){I=G.call(F,I,H);
if(E==null||I>=E){E=I
}});
return E
}function s(G,F){G=G||Prototype.K;
var E;
this.each(function(I,H){I=G.call(F,I,H);
if(E==null||I<E){E=I
}});
return E
}function f(H,F){H=H||Prototype.K;
var G=[],E=[];
this.each(function(J,I){(H.call(F,J,I)?G:E).push(J)
});
return[G,E]
}function g(F){var E=[];
this.each(function(G){E.push(G[F])
});
return E
}function e(G,F){var E=[];
this.each(function(I,H){if(!G.call(F,I,H)){E.push(I)
}});
return E
}function r(F,E){return this.map(function(H,G){return{value:H,criteria:F.call(E,H,G)}
}).sort(function(J,I){var H=J.criteria,G=I.criteria;
return H<G?-1:H>G?1:0
}).pluck("value")
}function t(){return this.map()
}function A(){var F=Prototype.K,E=$A(arguments);
if(Object.isFunction(E.last())){F=E.pop()
}var G=[this].concat(E).map($A);
return this.map(function(I,H){return F(G.pluck(H))
})
}function p(){return this.toArray().length
}function C(){return"#<Enumerable:"+this.toArray().inspect()+">"
}return{each:c,eachSlice:z,all:b,every:b,any:n,some:n,collect:o,map:o,detect:B,findAll:l,select:l,filter:l,grep:k,include:a,member:a,inGroupsOf:w,inject:q,invoke:D,max:u,min:s,partition:f,pluck:g,reject:e,sortBy:r,toArray:t,entries:t,zip:A,size:p,inspect:C,find:B}
})();
function $A(c){if(!c){return[]
}if("toArray" in Object(c)){return c.toArray()
}var b=c.length||0,a=new Array(b);
while(b--){a[b]=c[b]
}return a
}function $w(a){if(!Object.isString(a)){return[]
}a=a.strip();
return a?a.split(/\s+/):[]
}Array.from=$A;
(function(){var z=Array.prototype,r=z.slice,t=z.forEach;
function b(E,D){for(var C=0,F=this.length>>>0;
C<F;
C++){if(C in this){E.call(D,this[C],C,this)
}}}if(!t){t=b
}function q(){this.length=0;
return this
}function e(){return this[0]
}function k(){return this[this.length-1]
}function n(){return this.select(function(C){return C!=null
})
}function B(){return this.inject([],function(D,C){if(Object.isArray(C)){return D.concat(C.flatten())
}D.push(C);
return D
})
}function l(){var C=r.call(arguments,0);
return this.select(function(D){return !C.include(D)
})
}function g(C){return(C===false?this.toArray():this)._reverse()
}function p(C){return this.inject([],function(F,E,D){if(0==D||(C?F.last()!=E:!F.include(E))){F.push(E)
}return F
})
}function u(C){return this.uniq().findAll(function(D){return C.detect(function(E){return D===E
})
})
}function w(){return r.call(this,0)
}function o(){return this.length
}function A(){return"["+this.map(Object.inspect).join(", ")+"]"
}function a(E,C){C||(C=0);
var D=this.length;
if(C<0){C=D+C
}for(;
C<D;
C++){if(this[C]===E){return C
}}return -1
}function s(D,C){C=isNaN(C)?this.length:(C<0?this.length+C:C)+1;
var E=this.slice(0,C).reverse().indexOf(D);
return(E<0)?E:C-E-1
}function c(){var H=r.call(this,0),F;
for(var D=0,E=arguments.length;
D<E;
D++){F=arguments[D];
if(Object.isArray(F)&&!("callee" in F)){for(var C=0,G=F.length;
C<G;
C++){H.push(F[C])
}}else{H.push(F)
}}return H
}Object.extend(z,Enumerable);
if(!z._reverse){z._reverse=z.reverse
}Object.extend(z,{_each:t,clear:q,first:e,last:k,compact:n,flatten:B,without:l,reverse:g,uniq:p,intersect:u,clone:w,toArray:w,size:o,inspect:A});
var f=(function(){return[].concat(arguments)[0][0]!==1
})(1,2);
if(f){z.concat=c
}if(!z.indexOf){z.indexOf=a
}if(!z.lastIndexOf){z.lastIndexOf=s
}})();
function $H(a){return new Hash(a)
}var Hash=Class.create(Enumerable,(function(){function f(u){this._object=Object.isHash(u)?u.toObject():Object.clone(u)
}function g(w){for(var u in this._object){var z=this._object[u],A=[u,z];
A.key=u;
A.value=z;
w(A)
}}function o(u,w){return this._object[u]=w
}function c(u){if(this._object[u]!==Object.prototype[u]){return this._object[u]
}}function r(u){var w=this._object[u];
delete this._object[u];
return w
}function t(){return Object.clone(this._object)
}function s(){return this.pluck("key")
}function q(){return this.pluck("value")
}function k(w){var u=this.detect(function(z){return z.value===w
});
return u&&u.key
}function n(u){return this.clone().update(u)
}function e(u){return new Hash(u).inject(this,function(w,z){w.set(z.key,z.value);
return w
})
}function b(u,w){if(Object.isUndefined(w)){return u
}return u+"="+encodeURIComponent(String.interpret(w))
}function a(){return this.inject([],function(B,E){var A=encodeURIComponent(E.key),w=E.value;
if(w&&typeof w=="object"){if(Object.isArray(w)){var D=[];
for(var z=0,u=w.length,C;
z<u;
z++){C=w[z];
D.push(b(A,C))
}return B.concat(D)
}}else{B.push(b(A,w))
}return B
}).join("&")
}function p(){return"#<Hash:{"+this.map(function(u){return u.map(Object.inspect).join(": ")
}).join(", ")+"}>"
}function l(){return new Hash(this)
}return{initialize:f,_each:g,set:o,get:c,unset:r,toObject:t,toTemplateReplacements:t,keys:s,values:q,index:k,merge:n,update:e,toQueryString:a,inspect:p,toJSON:t,clone:l}
})());
Hash.from=$H;
Object.extend(Number.prototype,(function(){function e(){return this.toPaddedString(2,16)
}function b(){return this+1
}function l(o,n){$R(0,this,true).each(o,n);
return this
}function k(p,o){var n=this.toString(o||10);
return"0".times(p-n.length)+n
}function a(){return Math.abs(this)
}function c(){return Math.round(this)
}function f(){return Math.ceil(this)
}function g(){return Math.floor(this)
}return{toColorPart:e,succ:b,times:l,toPaddedString:k,abs:a,round:c,ceil:f,floor:g}
})());
function $R(c,a,b){return new ObjectRange(c,a,b)
}var ObjectRange=Class.create(Enumerable,(function(){function b(g,e,f){this.start=g;
this.end=e;
this.exclusive=f
}function c(e){var f=this.start;
while(this.include(f)){e(f);
f=f.succ()
}}function a(e){if(e<this.start){return false
}if(this.exclusive){return e<this.end
}return e<=this.end
}return{initialize:b,_each:c,include:a}
})());
var Abstract={};
var Try={these:function(){var c;
for(var b=0,f=arguments.length;
b<f;
b++){var a=arguments[b];
try{c=a();
break
}catch(g){}}return c
}};
var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()
},function(){return new ActiveXObject("Msxml2.XMLHTTP")
},function(){return new ActiveXObject("Microsoft.XMLHTTP")
})||false
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)
},register:function(a){if(!this.include(a)){this.responders.push(a)
}},unregister:function(a){this.responders=this.responders.without(a)
},dispatch:function(e,b,c,a){this.each(function(f){if(Object.isFunction(f[e])){try{f[e].apply(f,[b,c,a])
}catch(g){}}})
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++
},onComplete:function(){Ajax.activeRequestCount--
}});
Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};
Object.extend(this.options,a||{});
this.options.method=this.options.method.toLowerCase();
if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()
}}});
Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);
this.transport=Ajax.getTransport();
this.request(b)
},request:function(b){this.url=b;
this.method=this.options.method;
var f=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);
if(!["get","post"].include(this.method)){f+=(f?"&":"")+"_method="+this.method;
this.method="post"
}if(f&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+f
}this.parameters=f.toQueryParams();
try{var a=new Ajax.Response(this);
if(this.options.onCreate){this.options.onCreate(a)
}Ajax.Responders.dispatch("onCreate",this,a);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)
}this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
this.body=this.method=="post"?(this.options.postBody||f):null;
this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()
}}catch(c){this.dispatchException(c)
}},onStateChange:function(){var a=this.transport.readyState;
if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)
}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"
}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;
if(Object.isFunction(c.push)){for(var b=0,e=c.length;
b<e;
b+=2){f[c[b]]=c[b+1]
}}else{$H(c).each(function(g){f[g.key]=g.value
})
}}for(var a in f){this.transport.setRequestHeader(a,f[a])
}},success:function(){var a=this.getStatus();
return !a||(a>=200&&a<300)||a==304
},getStatus:function(){try{if(this.transport.status===1223){return 204
}return this.transport.status||0
}catch(a){return 0
}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);
if(c=="Complete"){try{this._complete=true;
(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)
}catch(f){this.dispatchException(f)
}var g=b.getHeader("Content-type");
if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&g&&g.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()
}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);
Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)
}catch(f){this.dispatchException(f)
}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction
}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);
return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))
},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null
}catch(b){return null
}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())
}catch(e){this.dispatchException(e)
}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);
Ajax.Responders.dispatch("onException",this,a)
}});
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Response=Class.create({initialize:function(c){this.request=c;
var e=this.transport=c.transport,a=this.readyState=e.readyState;
if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();
this.statusText=this.getStatusText();
this.responseText=String.interpret(e.responseText);
this.headerJSON=this._getHeaderJSON()
}if(a==4){var b=e.responseXML;
this.responseXML=Object.isUndefined(b)?null:b;
this.responseJSON=this._getResponseJSON()
}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""
}catch(a){return""
}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()
}catch(a){return null
}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)
},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()
},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");
if(!a){return null
}a=decodeURIComponent(escape(a));
try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())
}catch(b){this.request.dispatchException(b)
}},_getResponseJSON:function(){var a=this.request.options;
if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null
}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())
}catch(b){this.request.dispatchException(b)
}}});
Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};
b=Object.clone(b);
var e=b.onComplete;
b.onComplete=(function(f,g){this.updateContent(f.responseText);
if(Object.isFunction(e)){e(f,g)
}}).bind(this);
$super(c,b)
},updateContent:function(e){var c=this.container[this.success()?"success":"failure"],a=this.options;
if(!a.evalScripts){e=e.stripScripts()
}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};
b[a.insertion]=e;
c.insert(b)
}else{a.insertion(c,e)
}}else{c.update(e)
}}}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=a;
this.url=c;
this.start()
},start:function(){this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent()
},stop:function(){this.updater.options.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments)
},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=a.responseText
}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)
},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)
}});
function $(b){if(arguments.length>1){for(var a=0,e=[],c=arguments.length;
a<c;
a++){e.push($(arguments[a]))
}return e
}if(Object.isString(b)){b=document.getElementById(b)
}return Element.extend(b)
}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var c=[];
var f=document.evaluate(g,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var b=0,e=f.snapshotLength;
b<e;
b++){c.push(Element.extend(f.snapshotItem(b)))
}return c
}
}if(!Node){var Node={}
}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})
}(function(c){function e(g,f){if(g==="select"){return false
}if("type" in f){return false
}return true
}var b=(function(){try{var f=document.createElement('<input name="x">');
return f.tagName.toLowerCase()==="input"&&f.name==="x"
}catch(g){return false
}})();
var a=c.Element;
c.Element=function(k,g){g=g||{};
k=k.toLowerCase();
var f=Element.cache;
if(b&&g.name){k="<"+k+' name="'+g.name+'">';
delete g.name;
return Element.writeAttribute(document.createElement(k),g)
}if(!f[k]){f[k]=Element.extend(document.createElement(k))
}var l=e(k,g)?f[k].cloneNode(false):document.createElement(k);
return Element.writeAttribute(l,g)
};
Object.extend(c.Element,a||{});
if(a){c.Element.prototype=a.prototype
}})(this);
Element.idCounter=1;
Element.cache={};
Element._purgeElement=function(b){var a=b._prototypeUID;
if(a){Element.stopObserving(b);
b._prototypeUID=void 0;
delete Element.Storage[a]
}};
Element.Methods={visible:function(a){return $(a).style.display!="none"
},toggle:function(a){a=$(a);
Element[Element.visible(a)?"hide":"show"](a);
return a
},hide:function(a){a=$(a);
a.style.display="none";
return a
},show:function(a){a=$(a);
a.style.display="";
return a
},remove:function(a){a=$(a);
a.parentNode.removeChild(a);
return a
},update:(function(){var e=(function(){var k=document.createElement("select"),l=true;
k.innerHTML='<option value="test">test</option>';
if(k.options&&k.options[0]){l=k.options[0].nodeName.toUpperCase()!=="OPTION"
}k=null;
return l
})();
var b=(function(){try{var k=document.createElement("table");
if(k&&k.tBodies){k.innerHTML="<tbody><tr><td>test</td></tr></tbody>";
var n=typeof k.tBodies[0]=="undefined";
k=null;
return n
}}catch(l){return true
}})();
var a=(function(){try{var k=document.createElement("div");
k.innerHTML="<link>";
var n=(k.childNodes.length===0);
k=null;
return n
}catch(l){return true
}})();
var c=e||b||a;
var g=(function(){var k=document.createElement("script"),n=false;
try{k.appendChild(document.createTextNode(""));
n=!k.firstChild||k.firstChild&&k.firstChild.nodeType!==3
}catch(l){n=true
}k=null;
return n
})();
function f(p,q){p=$(p);
var k=Element._purgeElement;
var r=p.getElementsByTagName("*"),o=r.length;
while(o--){k(r[o])
}if(q&&q.toElement){q=q.toElement()
}if(Object.isElement(q)){return p.update().insert(q)
}q=Object.toHTML(q);
var n=p.tagName.toUpperCase();
if(n==="SCRIPT"&&g){p.text=q;
return p
}if(c){if(n in Element._insertionTranslations.tags){while(p.firstChild){p.removeChild(p.firstChild)
}Element._getContentFromAnonymousElement(n,q.stripScripts()).each(function(s){p.appendChild(s)
})
}else{if(a&&Object.isString(q)&&q.indexOf("<link")>-1){while(p.firstChild){p.removeChild(p.firstChild)
}var l=Element._getContentFromAnonymousElement(n,q.stripScripts(),true);
l.each(function(s){p.appendChild(s)
})
}else{p.innerHTML=q.stripScripts()
}}}else{p.innerHTML=q.stripScripts()
}q.evalScripts.bind(q).defer();
return p
}return f
})(),replace:function(b,c){b=$(b);
if(c&&c.toElement){c=c.toElement()
}else{if(!Object.isElement(c)){c=Object.toHTML(c);
var a=b.ownerDocument.createRange();
a.selectNode(b);
c.evalScripts.bind(c).defer();
c=a.createContextualFragment(c.stripScripts())
}}b.parentNode.replaceChild(c,b);
return b
},insert:function(c,f){c=$(c);
if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}
}var e,g,b,k;
for(var a in f){e=f[a];
a=a.toLowerCase();
g=Element._insertionTranslations[a];
if(e&&e.toElement){e=e.toElement()
}if(Object.isElement(e)){g(c,e);
continue
}e=Object.toHTML(e);
b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();
k=Element._getContentFromAnonymousElement(b,e.stripScripts());
if(a=="top"||a=="after"){k.reverse()
}k.each(g.curry(c));
e.evalScripts.bind(e).defer()
}return c
},wrap:function(b,c,a){b=$(b);
if(Object.isElement(c)){$(c).writeAttribute(a||{})
}else{if(Object.isString(c)){c=new Element(c,a)
}else{c=new Element("div",c)
}}if(b.parentNode){b.parentNode.replaceChild(c,b)
}c.appendChild(b);
return c
},inspect:function(b){b=$(b);
var a="<"+b.tagName.toLowerCase();
$H({id:"id",className:"class"}).each(function(g){var f=g.first(),c=g.last(),e=(b[f]||"").toString();
if(e){a+=" "+c+"="+e.inspect(true)
}});
return a+">"
},recursivelyCollect:function(a,c,e){a=$(a);
e=e||-1;
var b=[];
while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))
}if(b.length==e){break
}}return b
},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")
},descendants:function(a){return Element.select(a,"*")
},firstDescendant:function(a){a=$(a).firstChild;
while(a&&a.nodeType!=1){a=a.nextSibling
}return $(a)
},immediateDescendants:function(b){var a=[],c=$(b).firstChild;
while(c){if(c.nodeType===1){a.push(Element.extend(c))
}c=c.nextSibling
}return a
},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")
},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")
},siblings:function(a){a=$(a);
return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))
},match:function(b,a){b=$(b);
if(Object.isString(a)){return Prototype.Selector.match(b,a)
}return a.match(b)
},up:function(b,e,a){b=$(b);
if(arguments.length==1){return $(b.parentNode)
}var c=Element.ancestors(b);
return Object.isNumber(e)?c[e]:Prototype.Selector.find(c,e,a)
},down:function(b,c,a){b=$(b);
if(arguments.length==1){return Element.firstDescendant(b)
}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]
},previous:function(b,c,a){b=$(b);
if(Object.isNumber(c)){a=c,c=false
}if(!Object.isNumber(a)){a=0
}if(c){return Prototype.Selector.find(b.previousSiblings(),c,a)
}else{return b.recursivelyCollect("previousSibling",a+1)[a]
}},next:function(b,e,a){b=$(b);
if(Object.isNumber(e)){a=e,e=false
}if(!Object.isNumber(a)){a=0
}if(e){return Prototype.Selector.find(b.nextSiblings(),e,a)
}else{var c=Object.isNumber(a)?a+1:1;
return b.recursivelyCollect("nextSibling",a+1)[a]
}},select:function(a){a=$(a);
var b=Array.prototype.slice.call(arguments,1).join(", ");
return Prototype.Selector.select(b,a)
},adjacent:function(a){a=$(a);
var b=Array.prototype.slice.call(arguments,1).join(", ");
return Prototype.Selector.select(b,a.parentNode).without(a)
},identify:function(a){a=$(a);
var b=Element.readAttribute(a,"id");
if(b){return b
}do{b="anonymous_element_"+Element.idCounter++
}while($(b));
Element.writeAttribute(a,"id",b);
return b
},readAttribute:function(c,a){c=$(c);
if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;
if(b.values[a]){return b.values[a](c,a)
}if(b.names[a]){a=b.names[a]
}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value
}}return c.getAttribute(a)
},writeAttribute:function(f,c,g){f=$(f);
var b={},e=Element._attributeTranslations.write;
if(typeof c=="object"){b=c
}else{b[c]=Object.isUndefined(g)?true:g
}for(var a in b){c=e.names[a]||a;
g=b[a];
if(e.values[a]){c=e.values[a](f,g)
}if(g===false||g===null){f.removeAttribute(c)
}else{if(g===true){f.setAttribute(c,c)
}else{f.setAttribute(c,g)
}}}return f
},getHeight:function(a){return Element.getDimensions(a).height
},getWidth:function(a){return Element.getDimensions(a).width
},classNames:function(a){return new Element.ClassNames(a)
},hasClassName:function(a,b){if(!(a=$(a))){return
}var c=a.className;
return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))
},addClassName:function(a,b){if(!(a=$(a))){return
}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b
}return a
},removeClassName:function(a,b){if(!(a=$(a))){return
}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();
return a
},toggleClassName:function(a,b){if(!(a=$(a))){return
}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)
},cleanWhitespace:function(b){b=$(b);
var c=b.firstChild;
while(c){var a=c.nextSibling;
if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)
}c=a
}return b
},empty:function(a){return $(a).innerHTML.blank()
},descendantOf:function(b,a){b=$(b),a=$(a);
if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8
}if(a.contains){return a.contains(b)&&a!==b
}while(b=b.parentNode){if(b==a){return true
}}return false
},scrollTo:function(a){a=$(a);
var b=Element.cumulativeOffset(a);
window.scrollTo(b[0],b[1]);
return a
},getStyle:function(b,c){b=$(b);
c=c=="float"?"cssFloat":c.camelize();
var e=b.style[c];
if(!e||e=="auto"){var a=document.defaultView.getComputedStyle(b,null);
e=a?a[c]:null
}if(c=="opacity"){return e?parseFloat(e):1
}return e=="auto"?null:e
},getOpacity:function(a){return $(a).getStyle("opacity")
},setStyle:function(b,c){b=$(b);
var f=b.style,a;
if(Object.isString(c)){b.style.cssText+=";"+c;
return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b
}for(var e in c){if(e=="opacity"){b.setOpacity(c[e])
}else{f[(e=="float"||e=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):e]=c[e]
}}return b
},setOpacity:function(a,b){a=$(a);
a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;
return a
},makePositioned:function(a){a=$(a);
var b=Element.getStyle(a,"position");
if(b=="static"||!b){a._madePositioned=true;
a.style.position="relative";
if(Prototype.Browser.Opera){a.style.top=0;
a.style.left=0
}}return a
},undoPositioned:function(a){a=$(a);
if(a._madePositioned){a._madePositioned=undefined;
a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""
}return a
},makeClipping:function(a){a=$(a);
if(a._overflow){return a
}a._overflow=Element.getStyle(a,"overflow")||"auto";
if(a._overflow!=="hidden"){a.style.overflow="hidden"
}return a
},undoClipping:function(a){a=$(a);
if(!a._overflow){return a
}a.style.overflow=a._overflow=="auto"?"":a._overflow;
a._overflow=null;
return a
},clonePosition:function(b,e){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
e=$(e);
var f=Element.viewportOffset(e),g=[0,0],c=null;
b=$(b);
if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);
g=Element.viewportOffset(c)
}if(c==document.body){g[0]-=document.body.offsetLeft;
g[1]-=document.body.offsetTop
}if(a.setLeft){b.style.left=(f[0]-g[0]+a.offsetLeft)+"px"
}if(a.setTop){b.style.top=(f[1]-g[1]+a.offsetTop)+"px"
}if(a.setWidth){b.style.width=e.offsetWidth+"px"
}if(a.setHeight){b.style.height=e.offsetHeight+"px"
}return b
}};
Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});
Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};
if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(e,b,c){switch(c){case"height":case"width":if(!Element.visible(b)){return null
}var f=parseInt(e(b,c),10);
if(f!==b["offset"+c.capitalize()]){return f+"px"
}var a;
if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]
}else{a=["border-left-width","padding-left","padding-right","border-right-width"]
}return a.inject(f,function(g,k){var l=e(b,k);
return l===null?g:g-parseInt(l,10)
})+"px";
default:return e(b,c)
}});
Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title
}return c(a,b)
})
}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);
b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();
var c=a.style[b];
if(!c&&a.currentStyle){c=a.currentStyle[b]
}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100
}}return 1
}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"
}return null
}return c
};
Element.Methods.setOpacity=function(b,f){function g(k){return k.replace(/alpha\([^\)]*\)/gi,"")
}b=$(b);
var a=b.currentStyle;
if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1
}var e=b.getStyle("filter"),c=b.style;
if(f==1||f===""){(e=g(e))?c.filter=e:c.removeAttribute("filter");
return b
}else{if(f<0.00001){f=0
}}c.filter=g(e)+"alpha(opacity="+(f*100)+")";
return b
};
Element._attributeTranslations=(function(){var b="className",a="for",c=document.createElement("div");
c.setAttribute(b,"x");
if(c.className!=="x"){c.setAttribute("class","x");
if(c.className==="x"){b="class"
}}c=null;
c=document.createElement("label");
c.setAttribute(a,"x");
if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");
if(c.htmlFor==="x"){a="htmlFor"
}}c=null;
return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(e,f){return e.getAttribute(f)
},_getAttr2:function(e,f){return e.getAttribute(f,2)
},_getAttrNode:function(e,g){var f=e.getAttributeNode(g);
return f?f.value:""
},_getEv:(function(){var e=document.createElement("div"),k;
e.onclick=Prototype.emptyFunction;
var g=e.getAttribute("onclick");
if(String(g).indexOf("{")>-1){k=function(f,l){l=f.getAttribute(l);
if(!l){return null
}l=l.toString();
l=l.split("{")[1];
l=l.split("}")[0];
return l.strip()
}
}else{if(g===""){k=function(f,l){l=f.getAttribute(l);
if(!l){return null
}return l.strip()
}
}}e=null;
return k
})(),_flag:function(e,f){return $(e).hasAttribute(f)?f:null
},style:function(e){return e.style.cssText.toLowerCase()
},title:function(e){return e.title
}}}}
})();
Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b
},style:function(a,b){a.style.cssText=b?b:""
}}};
Element._attributeTranslations.has={};
$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;
Element._attributeTranslations.has[a.toLowerCase()]=a
});
(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})
})(Element._attributeTranslations.read.values);
if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(f){var b=f.getElementsByTagName("*"),e=[];
for(var c=0,g;
g=b[c];
c++){if(g.tagName!=="!"){e.push(g)
}}return e
}Element.Methods.down=function(c,e,b){c=$(c);
if(arguments.length==1){return c.firstDescendant()
}return Object.isNumber(e)?a(c)[e]:Element.select(c,e)[b||0]
}
})()
}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);
a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;
return a
}
}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);
a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;
if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;
a.width--
}else{try{var f=document.createTextNode(" ");
a.appendChild(f);
a.removeChild(f)
}catch(c){}}}return a
}
}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,f){c=$(c);
if(f&&f.toElement){f=f.toElement()
}if(Object.isElement(f)){c.parentNode.replaceChild(f,c);
return c
}f=Object.toHTML(f);
var e=c.parentNode,b=e.tagName.toUpperCase();
if(Element._insertionTranslations.tags[b]){var g=c.next(),a=Element._getContentFromAnonymousElement(b,f.stripScripts());
e.removeChild(c);
if(g){a.each(function(k){e.insertBefore(k,g)
})
}else{a.each(function(k){e.appendChild(k)
})
}}else{c.outerHTML=f.stripScripts()
}f.evalScripts.bind(f).defer();
return c
}
}Element._returnOffset=function(b,c){var a=[b,c];
a.left=b;
a.top=c;
return a
};
Element._getContentFromAnonymousElement=function(f,e,g){var k=new Element("div"),c=Element._insertionTranslations.tags[f];
var a=false;
if(c){a=true
}else{if(g){a=true;
c=["","",0]
}}if(a){k.innerHTML="&nbsp;"+c[0]+e+c[1];
k.removeChild(k.firstChild);
for(var b=c[2];
b--;
){k=k.firstChild
}}else{k.innerHTML=e
}return $A(k.childNodes)
};
Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)
},top:function(a,b){a.insertBefore(b,a.firstChild)
},bottom:function(a,b){a.appendChild(b)
},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)
},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){var a=Element._insertionTranslations.tags;
Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})
})();
Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;
var b=$(a).getAttributeNode(c);
return !!(b&&b.specified)
}};
Element.Methods.ByTag={};
Object.extend(Element,Element.Methods);
(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};
window.HTMLElement.prototype=a.__proto__;
Prototype.BrowserFeatures.ElementExtensions=true
}a=null
})(document.createElement("div"));
Element.extend=(function(){function c(k){if(typeof window.Element!="undefined"){var n=window.Element.prototype;
if(n){var p="_"+(Math.random()+"").slice(2),l=document.createElement(k);
n[p]="x";
var o=(l[p]!=="x");
delete n[p];
l=null;
return o
}}return false
}function b(l,k){for(var o in k){var n=k[o];
if(Object.isFunction(n)&&!(o in l)){l[o]=n.methodize()
}}}var e=c("object");
if(Prototype.BrowserFeatures.SpecificElementExtensions){if(e){return function(l){if(l&&typeof l._extendedByPrototype=="undefined"){var k=l.tagName;
if(k&&(/^(?:object|applet|embed)$/i.test(k))){b(l,Element.Methods);
b(l,Element.Methods.Simulated);
b(l,Element.Methods.ByTag[k.toUpperCase()])
}}return l
}
}return Prototype.K
}var a={},f=Element.Methods.ByTag;
var g=Object.extend(function(n){if(!n||typeof n._extendedByPrototype!="undefined"||n.nodeType!=1||n==window){return n
}var k=Object.clone(a),l=n.tagName.toUpperCase();
if(f[l]){Object.extend(k,f[l])
}b(n,k);
n._extendedByPrototype=Prototype.emptyFunction;
return n
},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);
Object.extend(a,Element.Methods.Simulated)
}}});
g.refresh();
return g
})();
if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)
}
}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute
}Element.addMethods=function(c){var n=Prototype.BrowserFeatures,e=Element.Methods.ByTag;
if(!c){Object.extend(Form,Form.Methods);
Object.extend(Form.Element,Form.Element.Methods);
Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})
}if(arguments.length==2){var b=c;
c=arguments[1]
}if(!b){Object.extend(Element.Methods,c||{})
}else{if(Object.isArray(b)){b.each(k)
}else{k(b)
}}function k(p){p=p.toUpperCase();
if(!Element.Methods.ByTag[p]){Element.Methods.ByTag[p]={}
}Object.extend(Element.Methods.ByTag[p],c)
}function a(r,q,p){p=p||false;
for(var t in r){var s=r[t];
if(!Object.isFunction(s)){continue
}if(!p||!(t in q)){q[t]=s.methodize()
}}}function f(s){var p;
var r={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};
if(r[s]){p="HTML"+r[s]+"Element"
}if(window[p]){return window[p]
}p="HTML"+s+"Element";
if(window[p]){return window[p]
}p="HTML"+s.capitalize()+"Element";
if(window[p]){return window[p]
}var q=document.createElement(s),t=q.__proto__||q.constructor.prototype;
q=null;
return t
}var l=window.HTMLElement?HTMLElement.prototype:Element.prototype;
if(n.ElementExtensions){a(Element.Methods,l);
a(Element.Methods.Simulated,l,true)
}if(n.SpecificElementExtensions){for(var o in Element.Methods.ByTag){var g=f(o);
if(Object.isUndefined(g)){continue
}a(e[o],g.prototype)
}}Object.extend(Element,Element.Methods);
delete Element.ByTag;
if(Element.extend.refresh){Element.extend.refresh()
}Element.cache={}
};
document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}
},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)
}};
(function(b){var k=Prototype.Browser,f=document,c,e={};
function a(){if(k.WebKit&&!f.evaluate){return document
}if(k.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body
}return document.documentElement
}function g(l){if(!c){c=a()
}e[l]="client"+l;
b["get"+l]=function(){return c[e[l]]
};
return b["get"+l]()
}b.getWidth=g.curry("Width");
b.getHeight=g.curry("Height")
})(document.viewport);
Element.Storage={UID:1};
Element.addMethods({getStorage:function(b){if(!(b=$(b))){return
}var a;
if(b===window){a=0
}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=Element.Storage.UID++
}a=b._prototypeUID
}if(!Element.Storage[a]){Element.Storage[a]=$H()
}return Element.Storage[a]
},store:function(b,a,c){if(!(b=$(b))){return
}if(arguments.length===2){Element.getStorage(b).update(a)
}else{Element.getStorage(b).set(a,c)
}return b
},retrieve:function(c,b,a){if(!(c=$(c))){return
}var f=Element.getStorage(c),e=f.get(b);
if(Object.isUndefined(e)){f.set(b,a);
e=a
}return e
},clone:function(c,a){if(!(c=$(c))){return
}var f=c.cloneNode(a);
f._prototypeUID=void 0;
if(a){var e=Element.select(f,"*"),b=e.length;
while(b--){e[b]._prototypeUID=void 0
}}return Element.extend(f)
},purge:function(c){if(!(c=$(c))){return
}var a=Element._purgeElement;
a(c);
var e=c.getElementsByTagName("*"),b=e.length;
while(b--){a(e[b])
}return null
}});
(function(){function l(D){var C=D.match(/^(\d+)%?$/i);
if(!C){return null
}return(Number(C[1])/100)
}function t(N,O,D){var G=null;
if(Object.isElement(N)){G=N;
N=G.getStyle(O)
}if(N===null){return null
}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(N)){return window.parseFloat(N)
}var I=N.include("%"),E=(D===document.viewport);
if(/\d/.test(N)&&G&&G.runtimeStyle&&!(I&&E)){var C=G.style.left,M=G.runtimeStyle.left;
G.runtimeStyle.left=G.currentStyle.left;
G.style.left=N||0;
N=G.style.pixelLeft;
G.style.left=C;
G.runtimeStyle.left=M;
return N
}if(G&&I){D=D||G.parentNode;
var F=l(N);
var J=null;
var H=G.getStyle("position");
var L=O.include("left")||O.include("right")||O.include("width");
var K=O.include("top")||O.include("bottom")||O.include("height");
if(D===document.viewport){if(L){J=document.viewport.getWidth()
}else{if(K){J=document.viewport.getHeight()
}}}else{if(L){J=$(D).measure("width")
}else{if(K){J=$(D).measure("height")
}}}return(J===null)?0:J*F
}return 0
}function k(C){if(Object.isString(C)&&C.endsWith("px")){return C
}return C+"px"
}function o(D){var C=D;
while(D&&D.parentNode){var E=D.getStyle("display");
if(E==="none"){return false
}D=$(D.parentNode)
}return true
}var e=Prototype.K;
if("currentStyle" in document.documentElement){e=function(C){if(!C.currentStyle.hasLayout){C.style.zoom=1
}return C
}
}function g(C){if(C.include("border")){C=C+"-width"
}return C.camelize()
}Element.Layout=Class.create(Hash,{initialize:function($super,D,C){$super();
this.element=$(D);
Element.Layout.PROPERTIES.each(function(E){this._set(E,null)
},this);
if(C){this._preComputing=true;
this._begin();
Element.Layout.PROPERTIES.each(this._compute,this);
this._end();
this._preComputing=false
}},_set:function(D,C){return Hash.prototype.set.call(this,D,C)
},set:function(D,C){throw"Properties of Element.Layout are read-only."
},get:function($super,D){var C=$super(D);
return C===null?this._compute(D):C
},_begin:function(){if(this._prepared){return
}var G=this.element;
if(o(G)){this._prepared=true;
return
}var I={position:G.style.position||"",width:G.style.width||"",visibility:G.style.visibility||"",display:G.style.display||""};
G.store("prototype_original_styles",I);
var J=G.getStyle("position"),C=G.getStyle("width");
if(C==="0px"||C===null){G.style.display="block";
C=G.getStyle("width")
}var D=(J==="fixed")?document.viewport:G.parentNode;
G.setStyle({position:"absolute",visibility:"hidden",display:"block"});
var E=G.getStyle("width");
var F;
if(C&&(E===C)){F=t(G,"width",D)
}else{if(J==="absolute"||J==="fixed"){F=t(G,"width",D)
}else{var K=G.parentNode,H=$(K).getLayout();
F=H.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")
}}G.setStyle({width:F+"px"});
this._prepared=true
},_end:function(){var D=this.element;
var C=D.retrieve("prototype_original_styles");
D.store("prototype_original_styles",null);
D.setStyle(C);
this._prepared=false
},_compute:function(D){var C=Element.Layout.COMPUTATIONS;
if(!(D in C)){throw"Property not found."
}return this._set(D,C[D].call(this,this.element))
},toObject:function(){var C=$A(arguments);
var D=(C.length===0)?Element.Layout.PROPERTIES:C.join(" ").split(" ");
var E={};
D.each(function(F){if(!Element.Layout.PROPERTIES.include(F)){return
}var G=this.get(F);
if(G!=null){E[F]=G
}},this);
return E
},toHash:function(){var C=this.toObject.apply(this,arguments);
return new Hash(C)
},toCSS:function(){var C=$A(arguments);
var E=(C.length===0)?Element.Layout.PROPERTIES:C.join(" ").split(" ");
var D={};
E.each(function(F){if(!Element.Layout.PROPERTIES.include(F)){return
}if(Element.Layout.COMPOSITE_PROPERTIES.include(F)){return
}var G=this.get(F);
if(G!=null){D[g(F)]=G+"px"
}},this);
return D
},inspect:function(){return"#<Element.Layout>"
}});
Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(E){if(!this._preComputing){this._begin()
}var C=this.get("border-box-height");
if(C<=0){if(!this._preComputing){this._end()
}return 0
}var F=this.get("border-top"),D=this.get("border-bottom");
var H=this.get("padding-top"),G=this.get("padding-bottom");
if(!this._preComputing){this._end()
}return C-F-D-H-G
},width:function(E){if(!this._preComputing){this._begin()
}var D=this.get("border-box-width");
if(D<=0){if(!this._preComputing){this._end()
}return 0
}var H=this.get("border-left"),C=this.get("border-right");
var F=this.get("padding-left"),G=this.get("padding-right");
if(!this._preComputing){this._end()
}return D-H-C-F-G
},"padding-box-height":function(D){var C=this.get("height"),F=this.get("padding-top"),E=this.get("padding-bottom");
return C+F+E
},"padding-box-width":function(C){var D=this.get("width"),E=this.get("padding-left"),F=this.get("padding-right");
return D+E+F
},"border-box-height":function(D){if(!this._preComputing){this._begin()
}var C=D.offsetHeight;
if(!this._preComputing){this._end()
}return C
},"border-box-width":function(C){if(!this._preComputing){this._begin()
}var D=C.offsetWidth;
if(!this._preComputing){this._end()
}return D
},"margin-box-height":function(D){var C=this.get("border-box-height"),E=this.get("margin-top"),F=this.get("margin-bottom");
if(C<=0){return 0
}return C+E+F
},"margin-box-width":function(E){var D=this.get("border-box-width"),F=this.get("margin-left"),C=this.get("margin-right");
if(D<=0){return 0
}return D+F+C
},top:function(C){var D=C.positionedOffset();
return D.top
},bottom:function(C){var F=C.positionedOffset(),D=C.getOffsetParent(),E=D.measure("height");
var G=this.get("border-box-height");
return E-G-F.top
},left:function(C){var D=C.positionedOffset();
return D.left
},right:function(E){var G=E.positionedOffset(),F=E.getOffsetParent(),C=F.measure("width");
var D=this.get("border-box-width");
return C-D-G.left
},"padding-top":function(C){return t(C,"paddingTop")
},"padding-bottom":function(C){return t(C,"paddingBottom")
},"padding-left":function(C){return t(C,"paddingLeft")
},"padding-right":function(C){return t(C,"paddingRight")
},"border-top":function(C){return t(C,"borderTopWidth")
},"border-bottom":function(C){return t(C,"borderBottomWidth")
},"border-left":function(C){return t(C,"borderLeftWidth")
},"border-right":function(C){return t(C,"borderRightWidth")
},"margin-top":function(C){return t(C,"marginTop")
},"margin-bottom":function(C){return t(C,"marginBottom")
},"margin-left":function(C){return t(C,"marginLeft")
},"margin-right":function(C){return t(C,"marginRight")
}}});
if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(D){var E=e(D.getOffsetParent());
var F=D.getBoundingClientRect(),C=E.getBoundingClientRect();
return(C.right-F.right).round()
},bottom:function(D){var E=e(D.getOffsetParent());
var F=D.getBoundingClientRect(),C=E.getBoundingClientRect();
return(C.bottom-F.bottom).round()
}})
}Element.Offset=Class.create({initialize:function(D,C){this.left=D.round();
this.top=C.round();
this[0]=this.left;
this[1]=this.top
},relativeTo:function(C){return new Element.Offset(this.left-C.left,this.top-C.top)
},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)
},toString:function(){return"[#{left}, #{top}]".interpolate(this)
},toArray:function(){return[this.left,this.top]
}});
function z(D,C){return new Element.Layout(D,C)
}function b(C,D){return $(C).getLayout().get(D)
}function s(D){D=$(D);
var H=Element.getStyle(D,"display");
if(H&&H!=="none"){return{width:D.offsetWidth,height:D.offsetHeight}
}var E=D.style;
var C={visibility:E.visibility,position:E.position,display:E.display};
var G={visibility:"hidden",display:"block"};
if(C.position!=="fixed"){G.position="absolute"
}Element.setStyle(D,G);
var F={width:D.offsetWidth,height:D.offsetHeight};
Element.setStyle(D,C);
return F
}function q(C){C=$(C);
if(f(C)||c(C)||r(C)||p(C)){return $(document.body)
}var D=(Element.getStyle(C,"display")==="inline");
if(!D&&C.offsetParent){return $(C.offsetParent)
}while((C=C.parentNode)&&C!==document.body){if(Element.getStyle(C,"position")!=="static"){return p(C)?$(document.body):$(C)
}}return $(document.body)
}function B(D){D=$(D);
var C=0,E=0;
if(D.parentNode){do{C+=D.offsetTop||0;
E+=D.offsetLeft||0;
D=D.offsetParent
}while(D)
}return new Element.Offset(E,C)
}function u(D){D=$(D);
var E=D.getLayout();
var C=0,G=0;
do{C+=D.offsetTop||0;
G+=D.offsetLeft||0;
D=D.offsetParent;
if(D){if(r(D)){break
}var F=Element.getStyle(D,"position");
if(F!=="static"){break
}}}while(D);
G-=E.get("margin-top");
C-=E.get("margin-left");
return new Element.Offset(G,C)
}function a(D){var C=0,E=0;
do{C+=D.scrollTop||0;
E+=D.scrollLeft||0;
D=D.parentNode
}while(D);
return new Element.Offset(E,C)
}function A(G){D=$(D);
var C=0,F=0,E=document.body;
var D=G;
do{C+=D.offsetTop||0;
F+=D.offsetLeft||0;
if(D.offsetParent==E&&Element.getStyle(D,"position")=="absolute"){break
}}while(D=D.offsetParent);
D=G;
do{if(D!=E){C-=D.scrollTop||0;
F-=D.scrollLeft||0
}}while(D=D.parentNode);
return new Element.Offset(F,C)
}function w(C){C=$(C);
if(Element.getStyle(C,"position")==="absolute"){return C
}var G=q(C);
var F=C.viewportOffset(),D=G.viewportOffset();
var H=F.relativeTo(D);
var E=C.getLayout();
C.store("prototype_absolutize_original_styles",{left:C.getStyle("left"),top:C.getStyle("top"),width:C.getStyle("width"),height:C.getStyle("height")});
C.setStyle({position:"absolute",top:H.top+"px",left:H.left+"px",width:E.get("width")+"px",height:E.get("height")+"px"});
return C
}function n(D){D=$(D);
if(Element.getStyle(D,"position")==="relative"){return D
}var C=D.retrieve("prototype_absolutize_original_styles");
if(C){D.setStyle(C)
}return D
}if(Prototype.Browser.IE){q=q.wrap(function(E,D){D=$(D);
if(f(D)||c(D)||r(D)||p(D)){return $(document.body)
}var C=D.getStyle("position");
if(C!=="static"){return E(D)
}D.setStyle({position:"relative"});
var F=E(D);
D.setStyle({position:C});
return F
});
u=u.wrap(function(F,D){D=$(D);
if(!D.parentNode){return new Element.Offset(0,0)
}var C=D.getStyle("position");
if(C!=="static"){return F(D)
}var E=D.getOffsetParent();
if(E&&E.getStyle("position")==="fixed"){e(E)
}D.setStyle({position:"relative"});
var G=F(D);
D.setStyle({position:C});
return G
})
}else{if(Prototype.Browser.Webkit){B=function(D){D=$(D);
var C=0,E=0;
do{C+=D.offsetTop||0;
E+=D.offsetLeft||0;
if(D.offsetParent==document.body){if(Element.getStyle(D,"position")=="absolute"){break
}}D=D.offsetParent
}while(D);
return new Element.Offset(E,C)
}
}}Element.addMethods({getLayout:z,measure:b,getDimensions:s,getOffsetParent:q,cumulativeOffset:B,positionedOffset:u,cumulativeScrollOffset:a,viewportOffset:A,absolutize:w,relativize:n});
function r(C){return C.nodeName.toUpperCase()==="BODY"
}function p(C){return C.nodeName.toUpperCase()==="HTML"
}function f(C){return C.nodeType===Node.DOCUMENT_NODE
}function c(C){return C!==document.body&&!Element.descendantOf(C,document.body)
}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(C){C=$(C);
if(c(C)){return new Element.Offset(0,0)
}var D=C.getBoundingClientRect(),E=document.documentElement;
return new Element.Offset(D.left-E.clientLeft,D.top-E.clientTop)
}})
}})();
window.$$=function(){var a=$A(arguments).join(", ");
return Prototype.Selector.select(a,document)
};
Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')
}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.')
}function e(p,q,l){l=l||0;
var k=Prototype.Selector.match,o=p.length,g=0,n;
for(n=0;
n<o;
n++){if(k(p[n],q)&&l==g++){return Element.extend(p[n])
}}}function f(l){for(var g=0,k=l.length;
g<k;
g++){Element.extend(l[g])
}return l
}var b=Prototype.K;
return{select:a,match:c,find:e,extendElements:(Element.extend===b)?b:f,extendElement:Element.extend}
})();
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var w=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,o=0,f=Object.prototype.toString,t=false,n=true;
[0,0].sort(function(){n=false;
return 0
});
var b=function(M,C,J,E){J=J||[];
var e=C=C||document;
if(C.nodeType!==1&&C.nodeType!==9){return[]
}if(!M||typeof M!=="string"){return J
}var K=[],L,H,Q,P,I,B,A=true,F=u(C),O=M;
while((w.exec(""),L=w.exec(O))!==null){O=L[3];
K.push(L[1]);
if(L[2]){B=L[3];
break
}}if(K.length>1&&p.exec(M)){if(K.length===2&&g.relative[K[0]]){H=k(K[0]+K[1],C)
}else{H=g.relative[K[0]]?[C]:b(K.shift(),C);
while(K.length){M=K.shift();
if(g.relative[M]){M+=K.shift()
}H=k(M,H)
}}}else{if(!E&&K.length>1&&C.nodeType===9&&!F&&g.match.ID.test(K[0])&&!g.match.ID.test(K[K.length-1])){var R=b.find(K.shift(),C,F);
C=R.expr?b.filter(R.expr,R.set)[0]:R.set[0]
}if(C){var R=E?{expr:K.pop(),set:a(E)}:b.find(K.pop(),K.length===1&&(K[0]==="~"||K[0]==="+")&&C.parentNode?C.parentNode:C,F);
H=R.expr?b.filter(R.expr,R.set):R.set;
if(K.length>0){Q=a(H)
}else{A=false
}while(K.length){var D=K.pop(),G=D;
if(!g.relative[D]){D=""
}else{G=K.pop()
}if(G==null){G=C
}g.relative[D](Q,G,F)
}}else{Q=K=[]
}}if(!Q){Q=H
}if(!Q){throw"Syntax error, unrecognized expression: "+(D||M)
}if(f.call(Q)==="[object Array]"){if(!A){J.push.apply(J,Q)
}else{if(C&&C.nodeType===1){for(var N=0;
Q[N]!=null;
N++){if(Q[N]&&(Q[N]===true||Q[N].nodeType===1&&l(C,Q[N]))){J.push(H[N])
}}}else{for(var N=0;
Q[N]!=null;
N++){if(Q[N]&&Q[N].nodeType===1){J.push(H[N])
}}}}}else{a(Q,J)
}if(B){b(B,e,J,E);
b.uniqueSort(J)
}return J
};
b.uniqueSort=function(A){if(c){t=n;
A.sort(c);
if(t){for(var e=1;
e<A.length;
e++){if(A[e]===A[e-1]){A.splice(e--,1)
}}}}return A
};
b.matches=function(e,A){return b(e,null,null,A)
};
b.find=function(G,e,H){var F,D;
if(!G){return[]
}for(var C=0,B=g.order.length;
C<B;
C++){var E=g.order[C],D;
if((D=g.leftMatch[E].exec(G))){var A=D[1];
D.splice(1,1);
if(A.substr(A.length-1)!=="\\"){D[1]=(D[1]||"").replace(/\\/g,"");
F=g.find[E](D,e,H);
if(F!=null){G=G.replace(g.match[E],"");
break
}}}}if(!F){F=e.getElementsByTagName("*")
}return{set:F,expr:G}
};
b.filter=function(J,I,M,C){var B=J,O=[],G=I,E,e,F=I&&I[0]&&u(I[0]);
while(J&&I.length){for(var H in g.filter){if((E=g.match[H].exec(J))!=null){var A=g.filter[H],N,L;
e=false;
if(G==O){O=[]
}if(g.preFilter[H]){E=g.preFilter[H](E,G,M,O,C,F);
if(!E){e=N=true
}else{if(E===true){continue
}}}if(E){for(var D=0;
(L=G[D])!=null;
D++){if(L){N=A(L,E,D,G);
var K=C^!!N;
if(M&&N!=null){if(K){e=true
}else{G[D]=false
}}else{if(K){O.push(L);
e=true
}}}}}if(N!==undefined){if(!M){G=O
}J=J.replace(g.match[H],"");
if(!e){return[]
}break
}}}if(J==B){if(e==null){throw"Syntax error, unrecognized expression: "+J
}else{break
}}B=J
}return G
};
var g=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")
}},relative:{"+":function(G,e,F){var D=typeof e==="string",H=D&&!/\W/.test(e),E=D&&!H;
if(H&&!F){e=e.toUpperCase()
}for(var C=0,B=G.length,A;
C<B;
C++){if((A=G[C])){while((A=A.previousSibling)&&A.nodeType!==1){}G[C]=E||A&&A.nodeName===e?A||false:A===e
}}if(E){b.filter(e,G,true)
}},">":function(F,A,G){var D=typeof A==="string";
if(D&&!/\W/.test(A)){A=G?A:A.toUpperCase();
for(var B=0,e=F.length;
B<e;
B++){var E=F[B];
if(E){var C=E.parentNode;
F[B]=C.nodeName===A?C:false
}}}else{for(var B=0,e=F.length;
B<e;
B++){var E=F[B];
if(E){F[B]=D?E.parentNode:E.parentNode===A
}}if(D){b.filter(A,F,true)
}}},"":function(C,A,E){var B=o++,e=z;
if(!/\W/.test(A)){var D=A=E?A:A.toUpperCase();
e=s
}e("parentNode",A,B,C,D,E)
},"~":function(C,A,E){var B=o++,e=z;
if(typeof A==="string"&&!/\W/.test(A)){var D=A=E?A:A.toUpperCase();
e=s
}e("previousSibling",A,B,C,D,E)
}},find:{ID:function(A,B,C){if(typeof B.getElementById!=="undefined"&&!C){var e=B.getElementById(A[1]);
return e?[e]:[]
}},NAME:function(B,E,F){if(typeof E.getElementsByName!=="undefined"){var A=[],D=E.getElementsByName(B[1]);
for(var C=0,e=D.length;
C<e;
C++){if(D[C].getAttribute("name")===B[1]){A.push(D[C])
}}return A.length===0?null:A
}},TAG:function(e,A){return A.getElementsByTagName(e[1])
}},preFilter:{CLASS:function(C,A,B,e,F,G){C=" "+C[1].replace(/\\/g,"")+" ";
if(G){return C
}for(var D=0,E;
(E=A[D])!=null;
D++){if(E){if(F^(E.className&&(" "+E.className+" ").indexOf(C)>=0)){if(!B){e.push(E)
}}else{if(B){A[D]=false
}}}}return false
},ID:function(e){return e[1].replace(/\\/g,"")
},TAG:function(A,e){for(var B=0;
e[B]===false;
B++){}return e[B]&&u(e[B])?A[1]:A[1].toUpperCase()
},CHILD:function(e){if(e[1]=="nth"){var A=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);
e[2]=(A[1]+(A[2]||1))-0;
e[3]=A[3]-0
}e[0]=o++;
return e
},ATTR:function(D,A,B,e,E,F){var C=D[1].replace(/\\/g,"");
if(!F&&g.attrMap[C]){D[1]=g.attrMap[C]
}if(D[2]==="~="){D[4]=" "+D[4]+" "
}return D
},PSEUDO:function(D,A,B,e,E){if(D[1]==="not"){if((w.exec(D[3])||"").length>1||/^\w/.test(D[3])){D[3]=b(D[3],null,null,A)
}else{var C=b.filter(D[3],A,B,true^E);
if(!B){e.push.apply(e,C)
}return false
}}else{if(g.match.POS.test(D[0])||g.match.CHILD.test(D[0])){return true
}}return D
},POS:function(e){e.unshift(true);
return e
}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"
},disabled:function(e){return e.disabled===true
},checked:function(e){return e.checked===true
},selected:function(e){e.parentNode.selectedIndex;
return e.selected===true
},parent:function(e){return !!e.firstChild
},empty:function(e){return !e.firstChild
},has:function(B,A,e){return !!b(e[3],B).length
},header:function(e){return/h\d/i.test(e.nodeName)
},text:function(e){return"text"===e.type
},radio:function(e){return"radio"===e.type
},checkbox:function(e){return"checkbox"===e.type
},file:function(e){return"file"===e.type
},password:function(e){return"password"===e.type
},submit:function(e){return"submit"===e.type
},image:function(e){return"image"===e.type
},reset:function(e){return"reset"===e.type
},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"
},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)
}},setFilters:{first:function(A,e){return e===0
},last:function(B,A,e,C){return A===C.length-1
},even:function(A,e){return e%2===0
},odd:function(A,e){return e%2===1
},lt:function(B,A,e){return A<e[3]-0
},gt:function(B,A,e){return A>e[3]-0
},nth:function(B,A,e){return e[3]-0==A
},eq:function(B,A,e){return e[3]-0==A
}},filter:{PSEUDO:function(F,B,C,G){var A=B[1],D=g.filters[A];
if(D){return D(F,C,B,G)
}else{if(A==="contains"){return(F.textContent||F.innerText||"").indexOf(B[3])>=0
}else{if(A==="not"){var E=B[3];
for(var C=0,e=E.length;
C<e;
C++){if(E[C]===F){return false
}}return true
}}}},CHILD:function(e,C){var F=C[1],A=e;
switch(F){case"only":case"first":while((A=A.previousSibling)){if(A.nodeType===1){return false
}}if(F=="first"){return true
}A=e;
case"last":while((A=A.nextSibling)){if(A.nodeType===1){return false
}}return true;
case"nth":var B=C[2],I=C[3];
if(B==1&&I==0){return true
}var E=C[0],H=e.parentNode;
if(H&&(H.sizcache!==E||!e.nodeIndex)){var D=0;
for(A=H.firstChild;
A;
A=A.nextSibling){if(A.nodeType===1){A.nodeIndex=++D
}}H.sizcache=E
}var G=e.nodeIndex-I;
if(B==0){return G==0
}else{return(G%B==0&&G/B>=0)
}}},ID:function(A,e){return A.nodeType===1&&A.getAttribute("id")===e
},TAG:function(A,e){return(e==="*"&&A.nodeType===1)||A.nodeName===e
},CLASS:function(A,e){return(" "+(A.className||A.getAttribute("class"))+" ").indexOf(e)>-1
},ATTR:function(E,C){var B=C[1],e=g.attrHandle[B]?g.attrHandle[B](E):E[B]!=null?E[B]:E.getAttribute(B),F=e+"",D=C[2],A=C[4];
return e==null?D==="!=":D==="="?F===A:D==="*="?F.indexOf(A)>=0:D==="~="?(" "+F+" ").indexOf(A)>=0:!A?F&&e!==false:D==="!="?F!=A:D==="^="?F.indexOf(A)===0:D==="$="?F.substr(F.length-A.length)===A:D==="|="?F===A||F.substr(0,A.length+1)===A+"-":false
},POS:function(D,A,B,E){var e=A[2],C=g.setFilters[e];
if(C){return C(D,B,A,E)
}}}};
var p=g.match.POS;
for(var r in g.match){g.match[r]=new RegExp(g.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source);
g.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+g.match[r].source)
}var a=function(A,e){A=Array.prototype.slice.call(A,0);
if(e){e.push.apply(e,A);
return e
}return A
};
try{Array.prototype.slice.call(document.documentElement.childNodes,0)
}catch(q){a=function(D,C){var A=C||[];
if(f.call(D)==="[object Array]"){Array.prototype.push.apply(A,D)
}else{if(typeof D.length==="number"){for(var B=0,e=D.length;
B<e;
B++){A.push(D[B])
}}else{for(var B=0;
D[B];
B++){A.push(D[B])
}}}return A
}
}var c;
if(document.documentElement.compareDocumentPosition){c=function(A,e){if(!A.compareDocumentPosition||!e.compareDocumentPosition){if(A==e){t=true
}return 0
}var B=A.compareDocumentPosition(e)&4?-1:A===e?0:1;
if(B===0){t=true
}return B
}
}else{if("sourceIndex" in document.documentElement){c=function(A,e){if(!A.sourceIndex||!e.sourceIndex){if(A==e){t=true
}return 0
}var B=A.sourceIndex-e.sourceIndex;
if(B===0){t=true
}return B
}
}else{if(document.createRange){c=function(C,A){if(!C.ownerDocument||!A.ownerDocument){if(C==A){t=true
}return 0
}var B=C.ownerDocument.createRange(),e=A.ownerDocument.createRange();
B.setStart(C,0);
B.setEnd(C,0);
e.setStart(A,0);
e.setEnd(A,0);
var D=B.compareBoundaryPoints(Range.START_TO_END,e);
if(D===0){t=true
}return D
}
}}}(function(){var A=document.createElement("div"),B="script"+(new Date).getTime();
A.innerHTML="<a name='"+B+"'/>";
var e=document.documentElement;
e.insertBefore(A,e.firstChild);
if(!!document.getElementById(B)){g.find.ID=function(D,E,F){if(typeof E.getElementById!=="undefined"&&!F){var C=E.getElementById(D[1]);
return C?C.id===D[1]||typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id").nodeValue===D[1]?[C]:undefined:[]
}};
g.filter.ID=function(E,C){var D=typeof E.getAttributeNode!=="undefined"&&E.getAttributeNode("id");
return E.nodeType===1&&D&&D.nodeValue===C
}
}e.removeChild(A);
e=A=null
})();
(function(){var e=document.createElement("div");
e.appendChild(document.createComment(""));
if(e.getElementsByTagName("*").length>0){g.find.TAG=function(A,E){var D=E.getElementsByTagName(A[1]);
if(A[1]==="*"){var C=[];
for(var B=0;
D[B];
B++){if(D[B].nodeType===1){C.push(D[B])
}}D=C
}return D
}
}e.innerHTML="<a href='#'></a>";
if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){g.attrHandle.href=function(A){return A.getAttribute("href",2)
}
}e=null
})();
if(document.querySelectorAll){(function(){var e=b,B=document.createElement("div");
B.innerHTML="<p class='TEST'></p>";
if(B.querySelectorAll&&B.querySelectorAll(".TEST").length===0){return
}b=function(F,E,C,D){E=E||document;
if(!D&&E.nodeType===9&&!u(E)){try{return a(E.querySelectorAll(F),C)
}catch(G){}}return e(F,E,C,D)
};
for(var A in e){b[A]=e[A]
}B=null
})()
}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");
e.innerHTML="<div class='test e'></div><div class='test'></div>";
if(e.getElementsByClassName("e").length===0){return
}e.lastChild.className="e";
if(e.getElementsByClassName("e").length===1){return
}g.order.splice(1,0,"CLASS");
g.find.CLASS=function(A,B,C){if(typeof B.getElementsByClassName!=="undefined"&&!C){return B.getElementsByClassName(A[1])
}};
e=null
})()
}function s(A,F,E,J,G,I){var H=A=="previousSibling"&&!I;
for(var C=0,B=J.length;
C<B;
C++){var e=J[C];
if(e){if(H&&e.nodeType===1){e.sizcache=E;
e.sizset=C
}e=e[A];
var D=false;
while(e){if(e.sizcache===E){D=J[e.sizset];
break
}if(e.nodeType===1&&!I){e.sizcache=E;
e.sizset=C
}if(e.nodeName===F){D=e;
break
}e=e[A]
}J[C]=D
}}}function z(A,F,E,J,G,I){var H=A=="previousSibling"&&!I;
for(var C=0,B=J.length;
C<B;
C++){var e=J[C];
if(e){if(H&&e.nodeType===1){e.sizcache=E;
e.sizset=C
}e=e[A];
var D=false;
while(e){if(e.sizcache===E){D=J[e.sizset];
break
}if(e.nodeType===1){if(!I){e.sizcache=E;
e.sizset=C
}if(typeof F!=="string"){if(e===F){D=true;
break
}}else{if(b.filter(F,[e]).length>0){D=e;
break
}}}e=e[A]
}J[C]=D
}}}var l=document.compareDocumentPosition?function(A,e){return A.compareDocumentPosition(e)&16
}:function(A,e){return A!==e&&(A.contains?A.contains(e):true)
};
var u=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"
};
var k=function(e,G){var C=[],D="",E,B=G.nodeType?[G]:G;
while((E=g.match.PSEUDO.exec(e))){D+=E[0];
e=e.replace(g.match.PSEUDO,"")
}e=g.relative[e]?e+"*":e;
for(var F=0,A=B.length;
F<A;
F++){b(e,B[F],C)
}return b.filter(D,C)
};
window.Sizzle=b
})();
Prototype._original_property=window.Sizzle;
(function(c){var e=Prototype.Selector.extendElements;
function a(f,g){return e(c(f,g||document))
}function b(g,f){return c.matches(f,[g]).length==1
}Prototype.Selector.engine=c;
Prototype.Selector.select=a;
Prototype.Selector.match=b
})(Sizzle);
window.Sizzle=Prototype._original_property;
delete Prototype._original_property;
var Form={reset:function(a){a=$(a);
a.reset();
return a
},serializeElements:function(l,e){if(typeof e!="object"){e={hash:!!e}
}else{if(Object.isUndefined(e.hash)){e.hash=true
}}var f,k,a=false,g=e.submit,b,c;
if(e.hash){c={};
b=function(n,o,p){if(o in n){if(!Object.isArray(n[o])){n[o]=[n[o]]
}n[o].push(p)
}else{n[o]=p
}return n
}
}else{c="";
b=function(n,o,p){return n+(n?"&":"")+encodeURIComponent(o)+"="+encodeURIComponent(p)
}
}return l.inject(c,function(n,o){if(!o.disabled&&o.name){f=o.name;
k=$(o).getValue();
if(k!=null&&o.type!="file"&&(o.type!="submit"||(!a&&g!==false&&(!g||f==g)&&(a=true)))){n=b(n,f,k)
}}return n
})
}};
Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)
},getElements:function(f){var g=$(f).getElementsByTagName("*"),e,a=[],c=Form.Element.Serializers;
for(var b=0;
e=g[b];
b++){a.push(e)
}return a.inject([],function(k,l){if(c[l.tagName.toLowerCase()]){k.push(Element.extend(l))
}return k
})
},getInputs:function(k,c,e){k=$(k);
var a=k.getElementsByTagName("input");
if(!c&&!e){return $A(a).map(Element.extend)
}for(var f=0,l=[],g=a.length;
f<g;
f++){var b=a[f];
if((c&&b.type!=c)||(e&&b.name!=e)){continue
}l.push(Element.extend(b))
}return l
},disable:function(a){a=$(a);
Form.getElements(a).invoke("disable");
return a
},enable:function(a){a=$(a);
Form.getElements(a).invoke("enable");
return a
},findFirstElement:function(b){var c=$(b).getElements().findAll(function(e){return"hidden"!=e.type&&!e.disabled
});
var a=c.findAll(function(e){return e.hasAttribute("tabIndex")&&e.tabIndex>=0
}).sortBy(function(e){return e.tabIndex
}).first();
return a?a:c.find(function(e){return/^(?:input|select|textarea)$/i.test(e.tagName)
})
},focusFirstElement:function(b){b=$(b);
var a=b.findFirstElement();
if(a){a.activate()
}return b
},request:function(b,a){b=$(b),a=Object.clone(a||{});
var e=a.parameters,c=b.readAttribute("action")||"";
if(c.blank()){c=window.location.href
}a.parameters=b.serialize(true);
if(e){if(Object.isString(e)){e=e.toQueryParams()
}Object.extend(a.parameters,e)
}if(b.hasAttribute("method")&&!a.method){a.method=b.method
}return new Ajax.Request(c,a)
}};
Form.Element={focus:function(a){$(a).focus();
return a
},select:function(a){$(a).select();
return a
}};
Form.Element.Methods={serialize:function(a){a=$(a);
if(!a.disabled&&a.name){var b=a.getValue();
if(b!=undefined){var c={};
c[a.name]=b;
return Object.toQueryString(c)
}}return""
},getValue:function(a){a=$(a);
var b=a.tagName.toLowerCase();
return Form.Element.Serializers[b](a)
},setValue:function(a,b){a=$(a);
var c=a.tagName.toLowerCase();
Form.Element.Serializers[c](a,b);
return a
},clear:function(a){$(a).value="";
return a
},present:function(a){return $(a).value!=""
},activate:function(a){a=$(a);
try{a.focus();
if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()
}}catch(b){}return a
},disable:function(a){a=$(a);
a.disabled=true;
return a
},enable:function(a){a=$(a);
a.disabled=false;
return a
}};
var Field=Form.Element;
var $F=Form.Element.Methods.getValue;
Form.Element.Serializers=(function(){function b(l,n){switch(l.type.toLowerCase()){case"checkbox":case"radio":return g(l,n);
default:return f(l,n)
}}function g(l,n){if(Object.isUndefined(n)){return l.checked?l.value:null
}else{l.checked=!!n
}}function f(l,n){if(Object.isUndefined(n)){return l.value
}else{l.value=n
}}function a(o,r){if(Object.isUndefined(r)){return(o.type==="select-one"?c:e)(o)
}var n,p,s=!Object.isArray(r);
for(var l=0,q=o.length;
l<q;
l++){n=o.options[l];
p=this.optionValue(n);
if(s){if(p==r){n.selected=true;
return
}}else{n.selected=r.include(p)
}}}function c(n){var l=n.selectedIndex;
return l>=0?k(n.options[l]):null
}function e(p){var l,q=p.length;
if(!q){return null
}for(var o=0,l=[];
o<q;
o++){var n=p.options[o];
if(n.selected){l.push(k(n))
}}return l
}function k(l){return Element.hasAttribute(l,"value")?l.value:l.text
}return{input:b,inputSelector:g,textarea:f,select:a,selectOne:c,selectMany:e,optionValue:k,button:f}
})();
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);
this.element=$(a);
this.lastValue=this.getValue()
},execute:function(){var a=this.getValue();
if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);
this.lastValue=a
}}});
Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)
}});
Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)
}});
Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);
this.callback=b;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()
}else{this.registerCallback(this.element)
}},onElementEvent:function(){var a=this.getValue();
if(this.lastValue!=a){this.callback(this.element,a);
this.lastValue=a
}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)
},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));
break;
default:Event.observe(a,"change",this.onElementEvent.bind(this));
break
}}}});
Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)
}});
Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)
}});
(function(){var K={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};
var g=document.documentElement;
var L="onmouseenter" in g&&"onmouseleave" in g;
var a=function(M){return false
};
if(window.attachEvent){if(window.addEventListener){a=function(M){return !(M instanceof window.Event)
}
}else{a=function(M){return true
}
}}var z;
function I(N,M){return N.which?(N.which===M+1):(N.button===M)
}var t={0:1,1:4,2:2};
function G(N,M){return N.button===t[M]
}function J(N,M){switch(M){case 0:return N.which==1&&!N.metaKey;
case 1:return N.which==2||(N.which==1&&N.metaKey);
case 2:return N.which==3;
default:return false
}}if(window.attachEvent){if(!window.addEventListener){z=G
}else{z=function(N,M){return a(N)?G(N,M):I(N,M)
}
}}else{if(Prototype.Browser.WebKit){z=J
}else{z=I
}}function D(M){return z(M,0)
}function B(M){return z(M,1)
}function s(M){return z(M,2)
}function e(O){O=K.extend(O);
var N=O.target,M=O.type,P=O.currentTarget;
if(P&&P.tagName){if(M==="load"||M==="error"||(M==="click"&&P.tagName.toLowerCase()==="input"&&P.type==="radio")){N=P
}}if(N.nodeType==Node.TEXT_NODE){N=N.parentNode
}return Element.extend(N)
}function u(N,O){var M=K.element(N);
if(!O){return M
}while(M){if(Object.isElement(M)&&Prototype.Selector.match(M,O)){return Element.extend(M)
}M=M.parentNode
}}function A(M){return{x:c(M),y:b(M)}
}function c(O){var N=document.documentElement,M=document.body||{scrollLeft:0};
return O.pageX||(O.clientX+(N.scrollLeft||M.scrollLeft)-(N.clientLeft||0))
}function b(O){var N=document.documentElement,M=document.body||{scrollTop:0};
return O.pageY||(O.clientY+(N.scrollTop||M.scrollTop)-(N.clientTop||0))
}function w(M){K.extend(M);
M.preventDefault();
M.stopPropagation();
M.stopped=true
}K.Methods={isLeftClick:D,isMiddleClick:B,isRightClick:s,element:e,findElement:u,pointer:A,pointerX:c,pointerY:b,stop:w};
var F=Object.keys(K.Methods).inject({},function(M,N){M[N]=K.Methods[N].methodize();
return M
});
if(window.attachEvent){function n(N){var M;
switch(N.type){case"mouseover":case"mouseenter":M=N.fromElement;
break;
case"mouseout":case"mouseleave":M=N.toElement;
break;
default:return null
}return Element.extend(M)
}var C={stopPropagation:function(){this.cancelBubble=true
},preventDefault:function(){this.returnValue=false
},inspect:function(){return"[object Event]"
}};
K.extend=function(N,M){if(!N){return false
}if(!a(N)){return N
}if(N._extendedByPrototype){return N
}N._extendedByPrototype=Prototype.emptyFunction;
var O=K.pointer(N);
Object.extend(N,{target:N.srcElement||M,relatedTarget:n(N),pageX:O.x,pageY:O.y});
Object.extend(N,F);
Object.extend(N,C);
return N
}
}else{K.extend=Prototype.K
}if(window.addEventListener){K.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;
Object.extend(K.prototype,F)
}function r(Q,P,R){var O=Element.retrieve(Q,"prototype_event_registry");
if(Object.isUndefined(O)){f.push(Q);
O=Element.retrieve(Q,"prototype_event_registry",$H())
}var M=O.get(P);
if(Object.isUndefined(M)){M=[];
O.set(P,M)
}if(M.pluck("handler").include(R)){return false
}var N;
if(P.include(":")){N=function(S){if(Object.isUndefined(S.eventName)){return false
}if(S.eventName!==P){return false
}K.extend(S,Q);
R.call(Q,S)
}
}else{if(!L&&(P==="mouseenter"||P==="mouseleave")){if(P==="mouseenter"||P==="mouseleave"){N=function(T){K.extend(T,Q);
var S=T.relatedTarget;
while(S&&S!==Q){try{S=S.parentNode
}catch(U){S=Q
}}if(S===Q){return
}R.call(Q,T)
}
}}else{N=function(S){K.extend(S,Q);
R.call(Q,S)
}
}}N.handler=R;
M.push(N);
return N
}function l(){for(var M=0,N=f.length;
M<N;
M++){K.stopObserving(f[M]);
f[M]=null
}}var f=[];
if(Prototype.Browser.IE){window.attachEvent("onunload",l)
}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)
}var q=Prototype.K,k={mouseenter:"mouseover",mouseleave:"mouseout"};
if(!L){q=function(M){return(k[M]||M)
}
}function E(P,O,Q){P=$(P);
var N=r(P,O,Q);
if(!N){return P
}if(O.include(":")){if(P.addEventListener){P.addEventListener("dataavailable",N,false)
}else{P.attachEvent("ondataavailable",N);
P.attachEvent("onlosecapture",N)
}}else{var M=q(O);
if(P.addEventListener){P.addEventListener(M,N,false)
}else{P.attachEvent("on"+M,N)
}}return P
}function p(S,P,T){S=$(S);
var O=Element.retrieve(S,"prototype_event_registry");
if(!O){return S
}if(!P){O.each(function(V){var U=V.key;
p(S,U)
});
return S
}var Q=O.get(P);
if(!Q){return S
}if(!T){Q.each(function(U){p(S,P,U.handler)
});
return S
}var R=Q.length,N;
while(R--){if(Q[R].handler===T){N=Q[R];
break
}}if(!N){return S
}if(P.include(":")){if(S.removeEventListener){S.removeEventListener("dataavailable",N,false)
}else{S.detachEvent("ondataavailable",N);
S.detachEvent("onlosecapture",N)
}}else{var M=q(P);
if(S.removeEventListener){S.removeEventListener(M,N,false)
}else{S.detachEvent("on"+M,N)
}}O.set(P,Q.without(N));
return S
}function H(P,O,N,M){P=$(P);
if(Object.isUndefined(M)){M=true
}if(P==document&&document.createEvent&&!P.dispatchEvent){P=document.documentElement
}var Q;
if(document.createEvent){Q=document.createEvent("HTMLEvents");
Q.initEvent("dataavailable",M,true)
}else{Q=document.createEventObject();
Q.eventType=M?"ondataavailable":"onlosecapture"
}Q.eventName=O;
Q.memo=N||{};
if(document.createEvent){P.dispatchEvent(Q)
}else{P.fireEvent(Q.eventType,Q)
}return K.extend(Q)
}K.Handler=Class.create({initialize:function(O,N,M,P){this.element=$(O);
this.eventName=N;
this.selector=M;
this.callback=P;
this.handler=this.handleEvent.bind(this)
},start:function(){K.observe(this.element,this.eventName,this.handler);
return this
},stop:function(){K.stopObserving(this.element,this.eventName,this.handler);
return this
},handleEvent:function(N){var M=K.findElement(N,this.selector);
if(M){this.callback.call(this.element,N,M)
}}});
function o(O,N,M,P){O=$(O);
if(Object.isFunction(M)&&Object.isUndefined(P)){P=M,M=null
}return new K.Handler(O,N,M,P).start()
}Object.extend(K,K.Methods);
Object.extend(K,{fire:H,observe:E,stopObserving:p,on:o});
Element.addMethods({fire:H,observe:E,stopObserving:p,on:o});
Object.extend(document,{fire:H.methodize(),observe:E.methodize(),stopObserving:p.methodize(),on:o.methodize(),loaded:false});
if(window.Event){Object.extend(window.Event,K)
}else{window.Event=K
}})();
(function(){var e;
function a(){if(document.loaded){return
}if(e){window.clearTimeout(e)
}document.loaded=true;
document.fire("dom:loaded")
}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);
a()
}}function b(){try{document.documentElement.doScroll("left")
}catch(f){e=b.defer();
return
}a()
}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)
}else{document.observe("readystatechange",c);
if(window==top){e=b.defer()
}}Event.observe(window,"load",a)
})();
Element.addMethods();
Hash.toQueryString=Object.toQueryString;
var Toggle={display:Element.toggle};
Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(a,b){return Element.insert(a,{before:b})
},Top:function(a,b){return Element.insert(a,{top:b})
},Bottom:function(a,b){return Element.insert(a,{bottom:b})
},After:function(a,b){return Element.insert(a,{after:b})
}};
var $continue=new Error('"throw $continue" is deprecated, use "return" instead');
var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0
},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)
}this.xcomp=a;
this.ycomp=c;
this.offset=Element.cumulativeOffset(b);
return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)
},withinIncludingScrolloffsets:function(b,a,e){var c=Element.cumulativeScrollOffset(b);
this.xcomp=a+c[0]-this.deltaX;
this.ycomp=e+c[1]-this.deltaY;
this.offset=Element.cumulativeOffset(b);
return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)
},overlap:function(b,a){if(!b){return 0
}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight
}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth
}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();
return Element.absolutize(a)
},relativize:function(a){Position.prepare();
return Element.relativize(a)
},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};
return Element.clonePosition(c,b,a)
}};
if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"
}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,f){f=f.toString().strip();
var e=/\s/.test(f)?$w(f).map(a).join(""):a(f);
return e?document._getElementsByXPath(".//*"+e,c):[]
}:function(f,g){g=g.toString().strip();
var k=[],l=(/\s/.test(g)?$w(g):null);
if(!l&&!g){return k
}var c=$(f).getElementsByTagName("*");
g=" "+g+" ";
for(var e=0,o,n;
o=c[e];
e++){if(o.className&&(n=" "+o.className+" ")&&(n.include(g)||(l&&l.all(function(p){return !p.toString().blank()&&n.include(" "+p+" ")
})))){k.push(Element.extend(o))
}}return k
};
return function(e,c){return $(c||document.body).getElementsByClassName(e)
}
}(Element.Methods)
}Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(a){this.element=$(a)
},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0
})._each(a)
},set:function(a){this.element.className=a
},add:function(a){if(this.include(a)){return
}this.set($A(this).concat(a).join(" "))
},remove:function(a){if(!this.include(a)){return
}this.set($A(this).without(a).join(" "))
},toString:function(){return $A(this).join(" ")
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()
},findElements:function(a){return Prototype.Selector.select(this.expression,a)
},match:function(a){return Prototype.Selector.match(a,this.expression)
},toString:function(){return this.expression
},inspect:function(){return"#<Selector: "+this.expression+">"
}});
Object.extend(Selector,{matchElements:function(g,k){var a=Prototype.Selector.match,e=[];
for(var c=0,f=g.length;
c<f;
c++){var b=g[c];
if(a(b,k)){e.push(Element.extend(b))
}}return e
},findElement:function(g,k,b){b=b||0;
var a=0,e;
for(var c=0,f=g.length;
c<f;
c++){e=g[c];
if(Prototype.Selector.match(e,k)&&b===a++){return Element.extend(e)
}}},findChildElements:function(b,c){var a=c.toArray().join(", ");
return Prototype.Selector.select(a,b||document)
}})
})();
var Scriptaculous={Version:"1.9.0",require:function(b){try{document.write('<script type="text/javascript" src="'+b+'"><\/script>')
}catch(c){var a=document.createElement("script");
a.type="text/javascript";
a.src=b;
document.getElementsByTagName("head")[0].appendChild(a)
}},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function a(c){var e=c.replace(/_.*|\./g,"");
e=parseInt(e+"0".times(4-e.length));
return c.indexOf("_")>-1?e-1:e
}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(a(Prototype.Version)<a(Scriptaculous.REQUIRED_PROTOTYPE))){throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE)
}var b=/scriptaculous\.js(\?.*)?$/;
$$("script[src]").findAll(function(c){return c.src.match(b)
}).each(function(e){var f=e.src.replace(b,""),c=e.src.match(/\?.*load=([a-z,]*)/);
(c?c[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(g){Scriptaculous.require(f+g+".js")
})
})
}};
Scriptaculous.load();
String.prototype.parseColor=function(){var a="#";
if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");
var b=0;
do{a+=parseInt(c[b]).toColorPart()
}while(++b<3)
}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;
b<4;
b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()
}}if(this.length==7){a=this.toLowerCase()
}}}return(a.length==7?a:(arguments[0]||this))
};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))
}).flatten().join("")
};
Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))
}).flatten().join("")
};
Element.setContentZoom=function(a,b){a=$(a);
a.setStyle({fontSize:(b/100)+"em"});
if(Prototype.Browser.WebKit){window.scrollBy(0,0)
}return a
};
Element.getInlineOpacity=function(a){return $(a).style.opacity||""
};
Element.forceRerendering=function(a){try{a=$(a);
var c=document.createTextNode(" ");
a.appendChild(c);
a.removeChild(c)
}catch(b){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5
},reverse:function(a){return 1-a
},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;
return a>1?1:a
},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5
},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5
},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))
},none:function(a){return 0
},full:function(a){return 1
}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";
if(Prototype.Browser.IE){b+=";zoom:1"
}a=$(a);
$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(e){a.insertBefore(new Element("span",{style:b}).update(e==" "?String.fromCharCode(160):e),c)
});
Element.remove(c)
}})
},multiple:function(b,c){var f;
if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){f=b
}else{f=$(b).childNodes
}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var e=a.delay;
$A(f).each(function(k,g){new c(k,Object.extend(a,{delay:g*a.speed+e}))
})
},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c,a){b=$(b);
c=(c||"appear").toLowerCase();
return Effect[Effect.PAIRS[c][b.visible()?1:0]](b,Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},a||{}))
}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];
this.interval=null
},_each:function(a){this.effects._each(a)
},add:function(b){var c=new Date().getTime();
var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;
switch(a){case"front":this.effects.findAll(function(f){return f.state=="idle"
}).each(function(f){f.startOn+=b.finishOn;
f.finishOn+=b.finishOn
});
break;
case"with-last":c=this.effects.pluck("startOn").max()||c;
break;
case"end":c=this.effects.pluck("finishOn").max()||c;
break
}b.startOn+=c;
b.finishOn+=c;
if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)
}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)
}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a
});
if(this.effects.length==0){clearInterval(this.interval);
this.interval=null
}},loop:function(){var c=new Date().getTime();
for(var b=0,a=this.effects.length;
b<a;
b++){this.effects[b]&&this.effects[b].loop(c)
}}});
Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a
}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())
}};
Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(a){if(a&&a.transition===false){a.transition=Effect.Transitions.linear
}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.fromToDelta=this.options.to-this.options.from;
this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;
this.render=(function(){function b(e,c){if(e.options[c+"Internal"]){e.options[c+"Internal"](e)
}if(e.options[c]){e.options[c](e)
}}return function(c){if(this.state==="idle"){this.state="running";
b(this,"beforeSetup");
if(this.setup){this.setup()
}b(this,"afterSetup")
}if(this.state==="running"){c=(this.options.transition(c)*this.fromToDelta)+this.options.from;
this.position=c;
b(this,"beforeUpdate");
if(this.update){this.update(c)
}b(this,"afterUpdate")
}}
})();
this.event("beforeStart");
if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)
}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){this.finish()
}this.event("afterFinish");
return
}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();
if(a>this.currentFrame){this.render(b);
this.currentFrame=a
}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)
}this.state="finished"
},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)
}if(this.options[a]){this.options[a](this)
}},inspect:function(){var a=$H();
for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])
}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"
}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];
this.start(arguments[1])
},update:function(a){this.effects.invoke("render",a)
},finish:function(a){this.effects.each(function(b){b.render(1);
b.cancel();
b.event("beforeFinish");
if(b.finish){b.finish(a)
}b.event("afterFinish")
})
}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(c,g,f){c=Object.isString(c)?$(c):c;
var b=$A(arguments),e=b.last(),a=b.length==5?b[3]:null;
this.method=Object.isFunction(e)?e.bind(c):Object.isFunction(c[e])?c[e].bind(c):function(k){c[e]=k
};
this.start(Object.extend({from:g,to:f},a||{}))
},update:function(a){this.method(a)
}});
Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(a)
},update:function(a){this.element.setOpacity(a)
}});
Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(a)
},setup:function(){this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop
}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})
}});
Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))
};
Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});
this.start(a)
},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var a=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);
this.fontSizeType=b
}}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;
if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]
}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]
}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]
}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);
if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})
}this.setDimensions(this.dims[0]*b,this.dims[1]*b)
},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)
}},setDimensions:function(a,e){var f={};
if(this.options.scaleX){f.width=e.round()+"px"
}if(this.options.scaleY){f.height=a.round()+"px"
}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;
var b=(e-this.dims[1])/2;
if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"
}if(this.options.scaleX){f.left=this.originalLeft-b+"px"
}}else{if(this.options.scaleY){f.top=-c+"px"
}if(this.options.scaleX){f.left=-b+"px"
}}}this.element.setStyle(f)
}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(a)
},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();
return
}this.oldStyle={};
if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");
this.element.setStyle({backgroundImage:"none"})
}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")
}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")
}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)
}.bind(this));
this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]
}.bind(this))
},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,e){return b+((this._base[e]+(this._delta[e]*a)).round().toColorPart())
}.bind(this))})
},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))
}});
Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),e=$(c).cumulativeOffset();
if(b.offset){e[1]+=b.offset
}return new Effect.Tween(null,a.top,e[1],b,function(f){scrollTo(a.left,f.round())
})
};
Effect.Fade=function(c){c=$(c);
var a=c.getInlineOpacity();
var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(e){if(e.options.to!=0){return
}e.element.hide().setStyle({opacity:a})
}},arguments[1]||{});
return new Effect.Opacity(c,b)
};
Effect.Appear=function(b){b=$(b);
var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()
},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()
}},arguments[1]||{});
return new Effect.Opacity(b,a)
};
Effect.Puff=function(b){b=$(b);
var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)
},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)
}},arguments[1]||{}))
};
Effect.BlindUp=function(a){a=$(a);
a.makeClipping();
return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()
}},arguments[1]||{}))
};
Effect.BlindDown=function(b){b=$(b);
var a=b.getDimensions();
return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(c){c.element.undoClipping()
}},arguments[1]||{}))
};
Effect.SwitchOff=function(b){b=$(b);
var a=b.getInlineOpacity();
return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(e){e.element.makePositioned().makeClipping()
},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})
}})
}},arguments[1]||{}))
};
Effect.DropOut=function(b){b=$(b);
var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()
},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)
}},arguments[1]||{}))
};
Effect.Shake=function(e){e=$(e);
var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});
var f=parseFloat(b.distance);
var c=parseFloat(b.duration)/10;
var a={top:e.getStyle("top"),left:e.getStyle("left")};
return new Effect.Move(e,{x:f,y:0,duration:c,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(n){new Effect.Move(n.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:-f,y:0,duration:c,afterFinishInternal:function(p){p.element.undoPositioned().setStyle(a)
}})
}})
}})
}})
}})
}})
};
Effect.SlideDown=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");
var b=c.getDimensions();
return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makePositioned();
e.element.down().makePositioned();
if(window.opera){e.element.setStyle({top:""})
}e.element.makeClipping().setStyle({height:"0px"}).show()
},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:(e.dims[0]-e.element.clientHeight)+"px"})
},afterFinishInternal:function(e){e.element.undoClipping().undoPositioned();
e.element.down().undoPositioned().setStyle({bottom:a})
}},arguments[1]||{}))
};
Effect.SlideUp=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");
var b=c.getDimensions();
return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makePositioned();
e.element.down().makePositioned();
if(window.opera){e.element.setStyle({top:""})
}e.element.makeClipping().show()
},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:(e.dims[0]-e.element.clientHeight)+"px"})
},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned();
e.element.down().undoPositioned().setStyle({bottom:a})
}},arguments[1]||{}))
};
Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()
},afterFinishInternal:function(b){b.element.hide().undoClipping()
}})
};
Effect.Grow=function(c){c=$(c);
var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var k=c.getDimensions();
var l,g;
var f,e;
switch(b.direction){case"top-left":l=g=f=e=0;
break;
case"top-right":l=k.width;
g=e=0;
f=-k.width;
break;
case"bottom-left":l=f=0;
g=k.height;
e=-k.height;
break;
case"bottom-right":l=k.width;
g=k.height;
f=-k.width;
e=-k.height;
break;
case"center":l=k.width/2;
g=k.height/2;
f=-k.width/2;
e=-k.height/2;
break
}return new Effect.Move(c,{x:l,y:g,duration:0.01,beforeSetup:function(n){n.element.hide().makeClipping().makePositioned()
},afterFinishInternal:function(n){new Effect.Parallel([new Effect.Opacity(n.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(n.element,{x:f,y:e,sync:true,transition:b.moveTransition}),new Effect.Scale(n.element,100,{scaleMode:{originalHeight:k.height,originalWidth:k.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(o){o.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(o){o.effects[0].element.undoClipping().undoPositioned().setStyle(a)
}},b))
}})
};
Effect.Shrink=function(c){c=$(c);
var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var g=c.getDimensions();
var f,e;
switch(b.direction){case"top-left":f=e=0;
break;
case"top-right":f=g.width;
e=0;
break;
case"bottom-left":f=0;
e=g.height;
break;
case"bottom-right":f=g.width;
e=g.height;
break;
case"center":f=g.width/2;
e=g.height/2;
break
}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:f,y:e,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(k){k.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(k){k.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)
}},b))
};
Effect.Pulsate=function(c){c=$(c);
var b=arguments[1]||{},a=c.getInlineOpacity(),f=b.transition||Effect.Transitions.linear,e=function(g){return 1-f((-Math.cos((g*(b.pulses||5)*2)*Math.PI)/2)+0.5)
};
return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:a})
}},b),{transition:e}))
};
Effect.Fold=function(b){b=$(b);
var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
b.makeClipping();
return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(e){e.element.hide().undoClipping().setStyle(a)
}})
}},arguments[1]||{}))
};
Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({style:{}},arguments[1]||{});
if(!Object.isString(a.style)){this.style=$H(a.style)
}else{if(a.style.include(":")){this.style=a.style.parseStyle()
}else{this.element.addClassName(a.style);
this.style=$H(this.element.getStyles());
this.element.removeClassName(a.style);
var b=this.element.getStyles();
this.style=this.style.reject(function(e){return e.value==b[e.key]
});
a.afterFinishInternal=function(e){e.element.addClassName(e.options.style);
e.transforms.each(function(f){e.element.style[f.style]=""
})
}
}}this.start(a)
},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"
}b=b.parseColor();
return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)
})
}this.transforms=this.style.map(function(k){var g=k[0],f=k[1],e=null;
if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();
e="color"
}else{if(g=="opacity"){f=parseFloat(f);
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}}else{if(Element.CSS_LENGTH.test(f)){var c=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);
f=parseFloat(c[1]);
e=(c.length==3)?c[2]:null
}}}var b=this.element.getStyle(g);
return{style:g.camelize(),originalValue:e=="color"?a(b):parseFloat(b||0),targetValue:e=="color"?a(f):f,unit:e}
}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))
})
},update:function(a){var e={},b,c=this.transforms.length;
while(c--){e[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)
}this.element.setStyle(e,true)
}});
Effect.Transform=Class.create({initialize:function(a){this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(a)
},addTracks:function(a){a.each(function(b){b=$H(b);
var c=b.values().first();
this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))
}.bind(this));
return this
},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var e=a.get("ids"),c=a.get("effect"),b=a.get("options");
var f=[$(e)||$$(e)].flatten();
return f.map(function(g){return new c(g,Object.extend({sync:true},b))
})
}).flatten(),this.options)
}});
Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var b,a=$H();
if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style
}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';
b=String.__parseStyleElement.childNodes[0].style
}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])
}});
if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])
}return a
};
if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);
return Element.CSS_PROPERTIES.inject({},function(c,e){c[e]=a[e];
return c
})
}
}else{Element.getStyles=function(b){b=$(b);
var a=b.currentStyle,c;
c=Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=a[f];
return e
});
if(!c.opacity){c.opacity=b.getOpacity()
}return c
}
}Effect.Methods={morph:function(a,b){a=$(a);
new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));
return a
},visualEffect:function(c,f,b){c=$(c);
var e=f.dasherize().camelize(),a=e.charAt(0).toUpperCase()+e.substring(1);
new Effect[a](c,b);
return c
},highlight:function(b,a){b=$(b);
new Effect.Highlight(b,a);
return b
}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);
Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);
return c
}
});
$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]
});
Element.addMethods(Effect.Methods);
if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")
}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)
})
},add:function(b){b=$(b);
var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});
if(a.containment){a._containers=[];
var c=a.containment;
if(Object.isArray(c)){c.each(function(e){a._containers.push($(e))
})
}else{a._containers.push($(c))
}}if(a.accept){a.accept=[a.accept].flatten()
}Element.makePositioned(b);
a.element=b;
this.drops.push(a)
},findDeepestChild:function(a){deepest=a[0];
for(i=1;
i<a.length;
++i){if(Element.isParent(a[i].element,deepest.element)){deepest=a[i]
}}return deepest
},isContained:function(b,a){var c;
if(a.tree){c=b.treeNode
}else{c=b.parentNode
}return a._containers.detect(function(e){return c==e
})
},isAffected:function(a,c,b){return((b.element!=c)&&((!b._containers)||this.isContained(c,b))&&((!b.accept)||(Element.classNames(c).detect(function(e){return b.accept.include(e)
})))&&Position.within(b.element,a[0],a[1]))
},deactivate:function(a){if(a.hoverclass){Element.removeClassName(a.element,a.hoverclass)
}this.last_active=null
},activate:function(a){if(a.hoverclass){Element.addClassName(a.element,a.hoverclass)
}this.last_active=a
},show:function(a,c){if(!this.drops.length){return
}var b,e=[];
this.drops.each(function(f){if(Droppables.isAffected(a,c,f)){e.push(f)
}});
if(e.length>0){b=Droppables.findDeepestChild(e)
}if(this.last_active&&this.last_active!=b){this.deactivate(this.last_active)
}if(b){Position.within(b.element,a[0],a[1]);
if(b.onHover){b.onHover(c,b.element,Position.overlap(b.overlap,b.element))
}if(b!=this.last_active){Droppables.activate(b)
}}},fire:function(b,a){if(!this.last_active){return
}Position.prepare();
if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,b);
return true
}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)
}}};
var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);
this.eventMouseMove=this.updateDrag.bindAsEventListener(this);
this.eventKeypress=this.keyPress.bindAsEventListener(this);
Event.observe(document,"mouseup",this.eventMouseUp);
Event.observe(document,"mousemove",this.eventMouseMove);
Event.observe(document,"keypress",this.eventKeypress)
}this.drags.push(a)
},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a
});
if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);
Event.stopObserving(document,"mousemove",this.eventMouseMove);
Event.stopObserving(document,"keypress",this.eventKeypress)
}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;
window.focus();
Draggables.activeDraggable=a
}.bind(this),a.options.delay)
}else{window.focus();
this.activeDraggable=a
}},deactivate:function(){this.activeDraggable=null
},updateDrag:function(a){if(!this.activeDraggable){return
}var b=[Event.pointerX(a),Event.pointerY(a)];
if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return
}this._lastPointer=b;
this.activeDraggable.updateDrag(a,b)
},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);
this._timeout=null
}if(!this.activeDraggable){return
}this._lastPointer=null;
this.activeDraggable.endDrag(a);
this.activeDraggable=null
},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a)
}},addObserver:function(a){this.observers.push(a);
this._cacheObserverCallbacks()
},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a
});
this._cacheObserverCallbacks()
},notify:function(b,a,c){if(this[b+"Count"]>0){this.observers.each(function(e){if(e[b]){e[b](b,a,c)
}})
}if(a.options[b]){a.options[b](a,c)
}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]
}).length
})
}};
var Draggable=Class.create({initialize:function(b){var c={handle:false,reverteffect:function(g,f,e){var k=Math.sqrt(Math.abs(f^2)+Math.abs(e^2))*0.02;
new Effect.Move(g,{x:-e,y:-f,duration:k,queue:{scope:"_draggable",position:"end"}})
},endeffect:function(f){var e=Object.isNumber(f._opacity)?f._opacity:1;
new Effect.Opacity(f,{duration:0.2,from:0.7,to:e,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[f]=false
}})
},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};
if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(c,{starteffect:function(e){e._opacity=Element.getOpacity(e);
Draggable._dragging[e]=true;
new Effect.Opacity(e,{duration:0.2,from:e._opacity,to:0.7})
}})
}var a=Object.extend(c,arguments[1]||{});
this.element=$(b);
if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0)
}if(!this.handle){this.handle=$(a.handle)
}if(!this.handle){this.handle=this.element
}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);
this._isScrollChild=Element.childOf(this.element,a.scroll)
}Element.makePositioned(this.element);
this.options=a;
this.dragging=false;
this.eventMouseDown=this.initDrag.bindAsEventListener(this);
Event.observe(this.handle,"mousedown",this.eventMouseDown);
Draggables.register(this)
},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);
Draggables.unregister(this)
},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])
},initDrag:function(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return
}if(Event.isLeftClick(a)){var c=Event.element(a);
if((tag_name=c.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return
}var b=[Event.pointerX(a),Event.pointerY(a)];
var e=this.element.cumulativeOffset();
this.offset=[0,1].map(function(f){return(b[f]-e[f])
});
Draggables.activate(this);
Event.stop(a)
}},startDrag:function(b){this.dragging=true;
if(!this.delta){this.delta=this.currentDelta()
}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);
this.element.style.zIndex=this.options.zindex
}if(this.options.ghosting){this._clone=this.element.cloneNode(true);
this._originallyAbsolute=(this.element.getStyle("position")=="absolute");
if(!this._originallyAbsolute){Position.absolutize(this.element)
}this.element.parentNode.insertBefore(this._clone,this.element)
}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);
this.originalScrollLeft=a.left;
this.originalScrollTop=a.top
}else{this.originalScrollLeft=this.options.scroll.scrollLeft;
this.originalScrollTop=this.options.scroll.scrollTop
}}Draggables.notify("onStart",this,b);
if(this.options.starteffect){this.options.starteffect(this.element)
}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)
}if(!this.options.quiet){Position.prepare();
Droppables.show(pointer,this.element)
}Draggables.notify("onDrag",this,event);
this.draw(pointer);
if(this.options.change){this.options.change(this)
}if(this.options.scroll){this.stopScrolling();
var p;
if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]
}}else{p=Position.page(this.options.scroll).toArray();
p[0]+=this.options.scroll.scrollLeft+Position.deltaX;
p[1]+=this.options.scroll.scrollTop+Position.deltaY;
p.push(p[0]+this.options.scroll.offsetWidth);
p.push(p[1]+this.options.scroll.offsetHeight)
}var speed=[0,0];
if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)
}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)
}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)
}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)
}this.startScrolling(speed)
}if(Prototype.Browser.WebKit){window.scrollBy(0,0)
}Event.stop(event)
},finishDrag:function(b,f){this.dragging=false;
if(this.options.quiet){Position.prepare();
var e=[Event.pointerX(b),Event.pointerY(b)];
Droppables.show(e,this.element)
}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element)
}delete this._originallyAbsolute;
Element.remove(this._clone);
this._clone=null
}var g=false;
if(f){g=Droppables.fire(b,this.element);
if(!g){g=false
}}if(g&&this.options.onDropped){this.options.onDropped(this.element)
}Draggables.notify("onEnd",this,b);
var a=this.options.revert;
if(a&&Object.isFunction(a)){a=a(this.element)
}var c=this.currentDelta();
if(a&&this.options.reverteffect){if(g==0||a!="failure"){this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0])
}}else{this.delta=c
}if(this.options.zindex){this.element.style.zIndex=this.originalZ
}if(this.options.endeffect){this.options.endeffect(this.element)
}Draggables.deactivate(this);
Droppables.reset()
},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return
}this.finishDrag(a,false);
Event.stop(a)
},endDrag:function(a){if(!this.dragging){return
}this.stopScrolling();
this.finishDrag(a,true);
Event.stop(a)
},draw:function(a){var g=this.element.cumulativeOffset();
if(this.options.ghosting){var c=Position.realOffset(this.element);
g[0]+=c[0]-Position.deltaX;
g[1]+=c[1]-Position.deltaY
}var f=this.currentDelta();
g[0]-=f[0];
g[1]-=f[1];
if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){g[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;
g[1]-=this.options.scroll.scrollTop-this.originalScrollTop
}var e=[0,1].map(function(k){return(a[k]-g[k]-this.offset[k])
}.bind(this));
if(this.options.snap){if(Object.isFunction(this.options.snap)){e=this.options.snap(e[0],e[1],this)
}else{if(Object.isArray(this.options.snap)){e=e.map(function(k,l){return(k/this.options.snap[l]).round()*this.options.snap[l]
}.bind(this))
}else{e=e.map(function(k){return(k/this.options.snap).round()*this.options.snap
}.bind(this))
}}}var b=this.element.style;
if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=e[0]+"px"
}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=e[1]+"px"
}if(b.visibility=="hidden"){b.visibility=""
}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);
this.scrollInterval=null;
Draggables._lastScrollPointer=null
}},startScrolling:function(a){if(!(a[0]||a[1])){return
}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];
this.lastScrolled=new Date();
this.scrollInterval=setInterval(this.scroll.bind(this),10)
},scroll:function(){var current=new Date();
var delta=current-this.lastScrolled;
this.lastScrolled=current;
if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;
this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])
}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;
this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000
}Position.prepare();
Droppables.show(Draggables._lastPointer,this.element);
Draggables.notify("onDrag",this);
if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);
Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;
Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;
if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0
}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0
}this.draw(Draggables._lastScrollPointer)
}if(this.options.change){this.options.change(this)
}},_getWindowScroll:function(w){var T,L,W,H;
with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;
L=documentElement.scrollLeft
}else{if(w.document.body){T=body.scrollTop;
L=body.scrollLeft
}}if(w.innerWidth){W=w.innerWidth;
H=w.innerHeight
}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;
H=documentElement.clientHeight
}else{W=body.offsetWidth;
H=body.offsetHeight
}}}return{top:T,left:L,width:W,height:H}
}});
Draggable._dragging={};
var SortableObserver=Class.create({initialize:function(b,a){this.element=$(b);
this.observer=a;
this.lastValue=Sortable.serialize(this.element)
},onStart:function(){this.lastValue=Sortable.serialize(this.element)
},onEnd:function(){Sortable.unmark();
if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)
}}});
var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a
}a=a.parentNode
}},options:function(a){a=Sortable._findRootElement($(a));
if(!a){return
}return Sortable.sortables[a.id]
},destroy:function(a){a=$(a);
var b=Sortable.sortables[a.id];
if(b){Draggables.removeObserver(b.element);
b.droppables.each(function(c){Droppables.remove(c)
});
b.draggables.invoke("destroy");
delete Sortable.sortables[b.element.id]
}},create:function(c){c=$(c);
var b=Object.extend({element:c,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});
this.destroy(c);
var a={revert:true,quiet:b.quiet,scroll:b.scroll,scrollSpeed:b.scrollSpeed,scrollSensitivity:b.scrollSensitivity,delay:b.delay,ghosting:b.ghosting,constraint:b.constraint,handle:b.handle};
if(b.starteffect){a.starteffect=b.starteffect
}if(b.reverteffect){a.reverteffect=b.reverteffect
}else{if(b.ghosting){a.reverteffect=function(g){g.style.top=0;
g.style.left=0
}
}}if(b.endeffect){a.endeffect=b.endeffect
}if(b.zindex){a.zindex=b.zindex
}var e={overlap:b.overlap,containment:b.containment,tree:b.tree,hoverclass:b.hoverclass,onHover:Sortable.onHover};
var f={onHover:Sortable.onEmptyHover,overlap:b.overlap,containment:b.containment,hoverclass:b.hoverclass};
Element.cleanWhitespace(c);
b.draggables=[];
b.droppables=[];
if(b.dropOnEmpty||b.tree){Droppables.add(c,f);
b.droppables.push(c)
}(b.elements||this.findElements(c,b)||[]).each(function(l,g){var k=b.handles?$(b.handles[g]):(b.handle?$(l).select("."+b.handle)[0]:l);
b.draggables.push(new Draggable(l,Object.extend(a,{handle:k})));
Droppables.add(l,e);
if(b.tree){l.treeNode=c
}b.droppables.push(l)
});
if(b.tree){(Sortable.findTreeElements(c,b)||[]).each(function(g){Droppables.add(g,f);
g.treeNode=c;
b.droppables.push(g)
})
}this.sortables[c.identify()]=b;
Draggables.addObserver(new SortableObserver(c,b.onUpdate))
},findElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.tag)
},findTreeElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.treeTag)
},onHover:function(f,e,a){if(Element.isParent(e,f)){return
}if(a>0.33&&a<0.66&&Sortable.options(e).tree){return
}else{if(a>0.5){Sortable.mark(e,"before");
if(e.previousSibling!=f){var b=f.parentNode;
f.style.visibility="hidden";
e.parentNode.insertBefore(f,e);
if(e.parentNode!=b){Sortable.options(b).onChange(f)
}Sortable.options(e.parentNode).onChange(f)
}}else{Sortable.mark(e,"after");
var c=e.nextSibling||null;
if(c!=f){var b=f.parentNode;
f.style.visibility="hidden";
e.parentNode.insertBefore(f,c);
if(e.parentNode!=b){Sortable.options(b).onChange(f)
}Sortable.options(e.parentNode).onChange(f)
}}}},onEmptyHover:function(f,k,l){var n=f.parentNode;
var a=Sortable.options(k);
if(!Element.isParent(k,f)){var g;
var c=Sortable.findElements(k,{tag:a.tag,only:a.only});
var b=null;
if(c){var e=Element.offsetSize(k,a.overlap)*(1-l);
for(g=0;
g<c.length;
g+=1){if(e-Element.offsetSize(c[g],a.overlap)>=0){e-=Element.offsetSize(c[g],a.overlap)
}else{if(e-(Element.offsetSize(c[g],a.overlap)/2)>=0){b=g+1<c.length?c[g+1]:null;
break
}else{b=c[g];
break
}}}}k.insertBefore(f,b);
Sortable.options(n).onChange(f);
a.onChange(f)
}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()
}},mark:function(b,a){var e=Sortable.options(b.parentNode);
if(e&&!e.ghosting){return
}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)
}var c=b.cumulativeOffset();
Sortable._marker.setStyle({left:c[0]+"px",top:c[1]+"px"});
if(a=="after"){if(e.overlap=="horizontal"){Sortable._marker.setStyle({left:(c[0]+b.clientWidth)+"px"})
}else{Sortable._marker.setStyle({top:(c[1]+b.clientHeight)+"px"})
}}Sortable._marker.show()
},_tree:function(f,b,g){var e=Sortable.findElements(f,b)||[];
for(var c=0;
c<e.length;
++c){var a=e[c].id.match(b.format);
if(!a){continue
}var k={id:encodeURIComponent(a?a[1]:null),element:f,parent:g,children:[],position:g.children.length,container:$(e[c]).down(b.treeTag)};
if(k.container){this._tree(k.container,b,k)
}g.children.push(k)
}return g
},tree:function(e){e=$(e);
var c=this.options(e);
var b=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:e.id,format:c.format},arguments[1]||{});
var a={id:null,parent:null,children:[],container:e,position:0};
return Sortable._tree(e,b,a)
},_constructIndex:function(b){var a="";
do{if(b.id){a="["+b.position+"]"+a
}}while((b=b.parent)!=null);
return a
},sequence:function(b){b=$(b);
var a=Object.extend(this.options(b),arguments[1]||{});
return $(this.findElements(b,a)||[]).map(function(c){return c.id.match(a.format)?c.id.match(a.format)[1]:""
})
},setSequence:function(b,c){b=$(b);
var a=Object.extend(this.options(b),arguments[2]||{});
var e={};
this.findElements(b,a).each(function(f){if(f.id.match(a.format)){e[f.id.match(a.format)[1]]=[f,f.parentNode]
}f.parentNode.removeChild(f)
});
c.each(function(f){var g=e[f];
if(g){g[1].appendChild(g[0]);
delete e[f]
}})
},serialize:function(c){c=$(c);
var b=Object.extend(Sortable.options(c),arguments[1]||{});
var a=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:c.id);
if(b.tree){return Sortable.tree(c,arguments[1]).children.map(function(e){return[a+Sortable._constructIndex(e)+"[id]="+encodeURIComponent(e.id)].concat(e.children.map(arguments.callee))
}).flatten().join("&")
}else{return Sortable.sequence(c,arguments[1]).map(function(e){return a+"[]="+encodeURIComponent(e)
}).join("&")
}}};
Element.isParent=function(b,a){if(!b.parentNode||b==a){return false
}if(b.parentNode==a){return true
}return Element.isParent(b.parentNode,a)
};
Element.findChildren=function(e,b,a,c){if(!e.hasChildNodes()){return null
}c=c.toUpperCase();
if(b){b=[b].flatten()
}var f=[];
$A(e.childNodes).each(function(k){if(k.tagName&&k.tagName.toUpperCase()==c&&(!b||(Element.classNames(k).detect(function(l){return b.include(l)
})))){f.push(k)
}if(a){var g=Element.findChildren(k,b,a,c);
if(g){f.push(g)
}}});
return(f.length>0?f.flatten():[])
};
Element.offsetSize=function(a,b){return a["offset"+((b=="vertical"||b=="height")?"Height":"Width")]
};
var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(a){a=a.toUpperCase();
var k=this.NODEMAP[a]||"div";
var b=document.createElement(k);
try{b.innerHTML="<"+a+"></"+a+">"
}catch(g){}var f=b.firstChild||null;
if(f&&(f.tagName.toUpperCase()!=a)){f=f.getElementsByTagName(a)[0]
}if(!f){f=document.createElement(a)
}if(!f){return
}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(f,arguments[1])
}else{var c=this._attributes(arguments[1]);
if(c.length){try{b.innerHTML="<"+a+" "+c+"></"+a+">"
}catch(g){}f=b.firstChild||null;
if(!f){f=document.createElement(a);
for(attr in arguments[1]){f[attr=="class"?"className":attr]=arguments[1][attr]
}}if(f.tagName.toUpperCase()!=a){f=b.getElementsByTagName(a)[0]
}}}}if(arguments[2]){this._children(f,arguments[2])
}return $(f)
},_text:function(a){return document.createTextNode(a)
},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(a){var b=[];
for(attribute in a){b.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"')
}return b.join(" ")
},_children:function(b,a){if(a.tagName){b.appendChild(a);
return
}if(typeof a=="object"){a.flatten().each(function(c){if(typeof c=="object"){b.appendChild(c)
}else{if(Builder._isStringOrNumber(c)){b.appendChild(Builder._text(c))
}}})
}else{if(Builder._isStringOrNumber(a)){b.appendChild(Builder._text(a))
}}},_isStringOrNumber:function(a){return(typeof a=="string"||typeof a=="number")
},build:function(b){var a=this.node("div");
$(a).update(b.strip());
return a.down()
},dump:function(b){if(typeof b!="object"&&typeof b!="function"){b=window
}var a=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
a.each(function(c){b[c]=function(){return Builder.node.apply(Builder,[c].concat($A(arguments)))
}
})
}};
(function(bs,aU){var bd={version:"3.0.3"};
var bj=navigator.userAgent.toLowerCase();
if(bj.indexOf("windows")>-1||bj.indexOf("win32")>-1){bd.isWindows=true
}else{if(bj.indexOf("macintosh")>-1||bj.indexOf("mac os x")>-1){bd.isMac=true
}else{if(bj.indexOf("linux")>-1){bd.isLinux=true
}}}bd.isIE=bj.indexOf("msie")>-1;
bd.isIE6=bj.indexOf("msie 6")>-1;
bd.isIE7=bj.indexOf("msie 7")>-1;
bd.isGecko=bj.indexOf("gecko")>-1&&bj.indexOf("safari")==-1;
bd.isWebKit=bj.indexOf("applewebkit/")>-1;
var bO=/#(.+)$/,bK=/^(light|shadow)box\[(.*?)\]/i,bY=/\s*([a-z_]*?)\s*=\s*(.+)\s*/,aZ=/[0-9a-z]+$/i,bT=/(.+\/)shadowbox\.js/i;
var bz=false,a4=false,aT={},E=0,bc,bA;
bd.current=-1;
bd.dimensions=null;
bd.ease=function(a){return 1+Math.pow(a-1,3)
};
bd.errorInfo={fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}};
bd.gallery=[];
bd.onReady=bG;
bd.path=null;
bd.player=null;
bd.playerId="sb-player";
bd.options={animate:true,animateFade:true,autoplayMovies:true,continuous:false,enableKeys:true,flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",onChange:bG,onClose:bG,onFinish:bG,onOpen:bG,showMovieControls:true,skipSetup:false,slideshowDelay:0,viewportPadding:20};
bd.getCurrent=function(){return bd.current>-1?bd.gallery[bd.current]:null
};
bd.hasNext=function(){return bd.gallery.length>1&&(bd.current!=bd.gallery.length-1||bd.options.continuous)
};
bd.isOpen=function(){return bz
};
bd.isPaused=function(){return bA=="pause"
};
bd.applyOptions=function(a){aT=bV({},bd.options);
bV(bd.options,a)
};
bd.revertOptions=function(){bV(bd.options,aT)
};
bd.init=function(b,e){if(a4){return
}a4=true;
if(bd.skin.options){bV(bd.options,bd.skin.options)
}if(b){bV(bd.options,b)
}if(!bd.path){var f,a=document.getElementsByTagName("script");
for(var g=0,c=a.length;
g<c;
++g){f=bT.exec(a[g].src);
if(f){bd.path=f[1];
break
}}}if(e){bd.onReady=e
}be()
};
bd.open=function(a){if(bz){return
}var b=bd.makeGallery(a);
bd.gallery=b[0];
bd.current=b[1];
a=bd.getCurrent();
if(a==null){return
}bd.applyOptions(a.options||{});
bn();
if(bd.gallery.length){a=bd.getCurrent();
if(bd.options.onOpen(a)===false){return
}bz=true;
bd.skin.onOpen(a,a2)
}};
bd.close=function(){if(!bz){return
}bz=false;
if(bd.player){bd.player.remove();
bd.player=null
}if(typeof bA=="number"){clearTimeout(bA);
bA=null
}E=0;
bx(false);
bd.options.onClose(bd.getCurrent());
bd.skin.onClose();
bd.revertOptions()
};
bd.play=function(){if(!bd.hasNext()){return
}if(!E){E=bd.options.slideshowDelay*1000
}if(E){bc=bo();
bA=setTimeout(function(){E=bc=0;
bd.next()
},E);
if(bd.skin.onPlay){bd.skin.onPlay()
}}};
bd.pause=function(){if(typeof bA!="number"){return
}E=Math.max(0,E-(bo()-bc));
if(E){clearTimeout(bA);
bA="pause";
if(bd.skin.onPause){bd.skin.onPause()
}}};
bd.change=function(a){if(!(a in bd.gallery)){if(bd.options.continuous){a=(a<0?bd.gallery.length+a:0);
if(!(a in bd.gallery)){return
}}else{return
}}bd.current=a;
if(typeof bA=="number"){clearTimeout(bA);
bA=null;
E=bc=0
}bd.options.onChange(bd.getCurrent());
a2(true)
};
bd.next=function(){bd.change(bd.current+1)
};
bd.previous=function(){bd.change(bd.current-1)
};
bd.setDimensions=function(e,s,g,f,a,t,n,q){var o=e,b=s;
var p=2*n+a;
if(e+p>g){e=g-p
}var c=2*n+t;
if(s+c>f){s=f-c
}var l=(o-e)/o,k=(b-s)/b,r=(l>0||k>0);
if(q&&r){if(l>k){s=Math.round((b/o)*e)
}else{if(k>l){e=Math.round((o/b)*s)
}}}bd.dimensions={height:e+a,width:s+t,innerHeight:e,innerWidth:s,top:Math.floor((g-(e+p))/2+n),left:Math.floor((f-(s+c))/2+n),oversized:r};
return bd.dimensions
};
bd.makeGallery=function(f){var c=[],g=-1;
if(typeof f=="string"){f=[f]
}if(typeof f.length=="number"){bS(f,function(l,k){if(k.content){c[l]=k
}else{c[l]={content:k}
}});
g=0
}else{if(f.tagName){var a=bd.getCache(f);
f=a?a:bd.makeObject(f)
}if(f.gallery){c=[];
var e;
for(var b in bd.cache){e=bd.cache[b];
if(e.gallery&&e.gallery==f.gallery){if(g==-1&&e.content==f.content){g=c.length
}c.push(e)
}}if(g==-1){c.unshift(f);
g=0
}}else{c=[f];
g=0
}}bS(c,function(l,k){c[l]=bV({},k)
});
return[c,g]
};
bd.makeObject=function(f,b){var e={content:f.href,title:f.getAttribute("title")||"",link:f};
if(b){b=bV({},b);
bS(["player","title","height","width","gallery"],function(k,g){if(typeof b[g]!="undefined"){e[g]=b[g];
delete b[g]
}});
e.options=b
}else{e.options={}
}if(!e.player){e.player=bd.getPlayer(e.content)
}var c=f.getAttribute("rel");
if(c){var a=c.match(bK);
if(a){e.gallery=escape(a[2])
}bS(c.split(";"),function(k,g){a=g.match(bY);
if(a){e[a[1]]=a[2]
}})
}return e
};
bd.getPlayer=function(b){if(b.indexOf("#")>-1&&b.indexOf(document.location.href)==0){return"inline"
}var e=b.indexOf("?");
if(e>-1){b=b.substring(0,e)
}var a,c=b.match(aZ);
if(c){a=c[0].toLowerCase()
}if(a){if(bd.img&&bd.img.ext.indexOf(a)>-1){return"img"
}if(bd.swf&&bd.swf.ext.indexOf(a)>-1){return"swf"
}if(bd.flv&&bd.flv.ext.indexOf(a)>-1){return"flv"
}if(bd.qt&&bd.qt.ext.indexOf(a)>-1){if(bd.wmp&&bd.wmp.ext.indexOf(a)>-1){return"qtwmp"
}else{return"qt"
}}if(bd.wmp&&bd.wmp.ext.indexOf(a)>-1){return"wmp"
}}return"iframe"
};
function bn(){var b=bd.errorInfo,a=bd.plugins,n,l,f,c,g,e,k,p;
for(var o=0;
o<bd.gallery.length;
++o){n=bd.gallery[o];
l=false;
f=null;
switch(n.player){case"flv":case"swf":if(!a.fla){f="fla"
}break;
case"qt":if(!a.qt){f="qt"
}break;
case"wmp":if(bd.isMac){if(a.qt&&a.f4m){n.player="qt"
}else{f="qtf4m"
}}else{if(!a.wmp){f="wmp"
}}break;
case"qtwmp":if(a.qt){n.player="qt"
}else{if(a.wmp){n.player="wmp"
}else{f="qtwmp"
}}break
}if(f){if(bd.options.handleUnsupported=="link"){switch(f){case"qtf4m":g="shared";
e=[b.qt.url,b.qt.name,b.f4m.url,b.f4m.name];
break;
case"qtwmp":g="either";
e=[b.qt.url,b.qt.name,b.wmp.url,b.wmp.name];
break;
default:g="single";
e=[b[f].url,b[f].name]
}n.player="html";
n.content='<div class="sb-message">'+aM(bd.lang.errors[g],e)+"</div>"
}else{l=true
}}else{if(n.player=="inline"){c=bO.exec(n.content);
if(c){k=bM(c[1]);
if(k){n.content=k.innerHTML
}else{l=true
}}else{l=true
}}else{if(n.player=="swf"||n.player=="flv"){p=(n.options&&n.options.flashVersion)||bd.options.flashVersion;
if(bd.flash&&!bd.flash.hasFlashPlayerVersion(p)){n.width=310;
n.height=177
}}}}if(l){bd.gallery.splice(o,1);
if(o<bd.current){--bd.current
}else{if(o==bd.current){bd.current=o>0?o-1:o
}}--o
}}}function bx(a){if(!bd.options.enableKeys){return
}(a?bq:bh)(document,"keydown",bC)
}function bC(b){if(b.metaKey||b.shiftKey||b.altKey||b.ctrlKey){return
}var a=aJ(b),c;
switch(a){case 81:case 88:case 27:c=bd.close;
break;
case 37:c=bd.previous;
break;
case 39:c=bd.next;
break;
case 32:c=typeof bA=="number"?bd.pause:bd.play;
break
}if(c){aR(b);
c()
}}function a2(e){bx(false);
var f=bd.getCurrent();
var b=(f.player=="inline"?"html":f.player);
if(typeof bd[b]!="function"){throw"unknown player "+b
}if(e){bd.player.remove();
bd.revertOptions();
bd.applyOptions(f.options||{})
}bd.player=new bd[b](f,bd.playerId);
if(bd.gallery.length>1){var k=bd.gallery[bd.current+1]||bd.gallery[0];
if(k.player=="img"){var a=new Image();
a.src=k.content
}var g=bd.gallery[bd.current-1]||bd.gallery[bd.gallery.length-1];
if(g.player=="img"){var c=new Image();
c.src=g.content
}}bd.skin.onLoad(e,a6)
}function a6(){if(!bz){return
}if(typeof bd.player.ready!="undefined"){var a=setInterval(function(){if(bz){if(bd.player.ready){clearInterval(a);
a=null;
bd.skin.onReady(a0)
}}else{clearInterval(a);
a=null
}},10)
}else{bd.skin.onReady(a0)
}}function a0(){if(!bz){return
}bd.player.append(bd.skin.body,bd.dimensions);
bd.skin.onShow(bk)
}function bk(){if(!bz){return
}if(bd.player.onLoad){bd.player.onLoad()
}bd.options.onFinish(bd.getCurrent());
if(!bd.isPaused()){bd.play()
}bx(true)
}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(a,b){var c=this.length>>>0;
b=b||0;
if(b<0){b+=c
}for(;
b<c;
++b){if(b in this&&this[b]===a){return b
}}return -1
}
}function bo(){return(new Date).getTime()
}function bV(c,b){for(var a in b){c[a]=b[a]
}return c
}function bS(f,e){var a=0,c=f.length;
for(var b=f[0];
a<c&&e.call(b,a,b)!==false;
b=f[++a]){}}function aM(a,b){return a.replace(/\{(\w+?)\}/g,function(c,e){return b[e]
})
}function bG(){}function bM(a){return document.getElementById(a)
}function bw(a){a.parentNode.removeChild(a)
}var aX=true,S=true;
function a1(){var b=document.body,a=document.createElement("div");
aX=typeof a.style.opacity==="string";
a.style.position="fixed";
a.style.margin=0;
a.style.top="20px";
b.appendChild(a,b.firstChild);
S=a.offsetTop==20;
b.removeChild(a)
}bd.getStyle=(function(){var b=/opacity=([^)]*)/,a=document.defaultView&&document.defaultView.getComputedStyle;
return function(e,f){var g;
if(!aX&&f=="opacity"&&e.currentStyle){g=b.test(e.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";
return g===""?"1":g
}if(a){var c=a(e,null);
if(c){g=c[f]
}if(f=="opacity"&&g==""){g="1"
}}else{g=e.currentStyle[f]
}return g
}
})();
bd.appendHTML=function(b,a){if(b.insertAdjacentHTML){b.insertAdjacentHTML("BeforeEnd",a)
}else{if(b.lastChild){var c=b.ownerDocument.createRange();
c.setStartAfter(b.lastChild);
var e=c.createContextualFragment(a);
b.appendChild(e)
}else{b.innerHTML=a
}}};
bd.getWindowSize=function(a){if(document.compatMode==="CSS1Compat"){return document.documentElement["client"+a]
}return document.body["client"+a]
};
bd.setOpacity=function(b,c){var a=b.style;
if(aX){a.opacity=(c==1?"":c)
}else{a.zoom=1;
if(c==1){if(typeof a.filter=="string"&&(/alpha/i).test(a.filter)){a.filter=a.filter.replace(/\s*[\w\.]*alpha\([^\)]*\);?/gi,"")
}}else{a.filter=(a.filter||"").replace(/\s*[\w\.]*alpha\([^\)]*\)/gi,"")+" alpha(opacity="+(c*100)+")"
}}};
bd.clearOpacity=function(a){bd.setOpacity(a,1)
};
var a8=Event;
function aQ(a){return a8.element(a)
}function a7(a){return[a8.pointerX(a),a8.pointerY(a)]
}function aR(a){a8.stop(a)
}function aJ(a){return a.keyCode
}function bq(b,a,c){a8.observe(b,a,c)
}function bh(b,a,c){a8.stopObserving(b,a,c)
}var K=false,bE;
if(document.addEventListener){bE=function(){document.removeEventListener("DOMContentLoaded",bE,false);
bd.load()
}
}else{if(document.attachEvent){bE=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",bE);
bd.load()
}}
}}function aY(){if(K){return
}try{document.documentElement.doScroll("left")
}catch(a){setTimeout(aY,1);
return
}bd.load()
}function be(){if(document.readyState==="complete"){return bd.load()
}if(document.addEventListener){document.addEventListener("DOMContentLoaded",bE,false);
bs.addEventListener("load",bd.load,false)
}else{if(document.attachEvent){document.attachEvent("onreadystatechange",bE);
bs.attachEvent("onload",bd.load);
var b=false;
try{b=bs.frameElement===null
}catch(a){}if(document.documentElement.doScroll&&b){aY()
}}}}bd.load=function(){if(K){return
}if(!document.body){return setTimeout(bd.load,13)
}K=true;
a1();
bd.onReady();
if(!bd.options.skipSetup){bd.setup()
}bd.skin.init()
};
bd.plugins={};
if(navigator.plugins&&navigator.plugins.length){var aI=[];
bS(navigator.plugins,function(b,a){aI.push(a.name)
});
aI=aI.join(",");
var bH=aI.indexOf("Flip4Mac")>-1;
bd.plugins={fla:aI.indexOf("Shockwave Flash")>-1,qt:aI.indexOf("QuickTime")>-1,wmp:!bH&&aI.indexOf("Windows Media")>-1,f4m:bH}
}else{var aP=function(c){var a;
try{a=new ActiveXObject(c)
}catch(b){}return !!a
};
bd.plugins={fla:aP("ShockwaveFlash.ShockwaveFlash"),qt:aP("QuickTime.QuickTime"),wmp:aP("wmplayer.ocx"),f4m:false}
}var a5=/^(light|shadow)box/i,bD="shadowboxCacheKey",a3=1;
bd.cache={};
bd.select=function(a){var b=[];
if(!a){var c;
bS(document.getElementsByTagName("a"),function(k,g){c=g.getAttribute("rel");
if(c&&a5.test(c)){b.push(g)
}})
}else{var e=a.length;
if(e){if(typeof a=="string"){if(bd.find){b=bd.find(a)
}}else{if(e==2&&typeof a[0]=="string"&&a[1].nodeType){if(bd.find){b=bd.find(a[0],a[1])
}}else{for(var f=0;
f<e;
++f){b[f]=a[f]
}}}}else{b.push(a)
}}return b
};
bd.setup=function(b,a){bS(bd.select(b),function(c,e){bd.addCache(e,a)
})
};
bd.teardown=function(a){bS(bd.select(a),function(b,c){bd.removeCache(c)
})
};
bd.addCache=function(b,c){var a=b[bD];
if(a==aU){a=a3++;
b[bD]=a;
bq(b,"click",aK)
}bd.cache[a]=bd.makeObject(b,c)
};
bd.removeCache=function(a){bh(a,"click",aK);
delete bd.cache[a[bD]];
a[bD]=null
};
bd.getCache=function(a){var b=a[bD];
return(b in bd.cache&&bd.cache[b])
};
bd.clearCache=function(){for(var a in bd.cache){bd.removeCache(bd.cache[a].link)
}bd.cache={}
};
function aK(a){bd.open(this);
if(bd.gallery.length){aR(a)
}}bd.find=(function(){var l=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,k=0,e=Object.prototype.toString,r=false,t=true;
[0,0].sort(function(){t=false;
return 0
});
var f=function(B,H,R,Q){R=R||[];
var O=H=H||document;
if(H.nodeType!==1&&H.nodeType!==9){return[]
}if(!B||typeof B!=="string"){return R
}var A=[],F,M,I,G,C=true,D=w(H),P=B;
while((l.exec(""),F=l.exec(P))!==null){P=F[3];
A.push(F[1]);
if(F[2]){G=F[3];
break
}}if(A.length>1&&q.exec(B)){if(A.length===2&&p.relative[A[0]]){M=c(A[0]+A[1],H)
}else{M=p.relative[A[0]]?[H]:f(A.shift(),H);
while(A.length){B=A.shift();
if(p.relative[B]){B+=A.shift()
}M=c(B,M)
}}}else{if(!Q&&A.length>1&&H.nodeType===9&&!D&&p.match.ID.test(A[0])&&!p.match.ID.test(A[A.length-1])){var N=f.find(A.shift(),H,D);
H=N.expr?f.filter(N.expr,N.set)[0]:N.set[0]
}if(H){var N=Q?{expr:A.pop(),set:n(Q)}:f.find(A.pop(),A.length===1&&(A[0]==="~"||A[0]==="+")&&H.parentNode?H.parentNode:H,D);
M=N.expr?f.filter(N.expr,N.set):N.set;
if(A.length>0){I=n(M)
}else{C=false
}while(A.length){var J=A.pop(),L=J;
if(!p.relative[J]){J=""
}else{L=A.pop()
}if(L==null){L=H
}p.relative[J](I,L,D)
}}else{I=A=[]
}}if(!I){I=M
}if(!I){throw"Syntax error, unrecognized expression: "+(J||B)
}if(e.call(I)==="[object Array]"){if(!C){R.push.apply(R,I)
}else{if(H&&H.nodeType===1){for(var T=0;
I[T]!=null;
T++){if(I[T]&&(I[T]===true||I[T].nodeType===1&&o(H,I[T]))){R.push(M[T])
}}}else{for(var T=0;
I[T]!=null;
T++){if(I[T]&&I[T].nodeType===1){R.push(M[T])
}}}}}else{n(I,R)
}if(G){f(G,O,R,Q);
f.uniqueSort(R)
}return R
};
f.uniqueSort=function(A){if(g){r=t;
A.sort(g);
if(r){for(var B=1;
B<A.length;
B++){if(A[B]===A[B-1]){A.splice(B--,1)
}}}}return A
};
f.matches=function(B,A){return f(B,null,null,A)
};
f.find=function(J,H,I){var A,C;
if(!J){return[]
}for(var D=0,F=p.order.length;
D<F;
D++){var B=p.order[D],C;
if((C=p.leftMatch[B].exec(J))){var G=C[1];
C.splice(1,1);
if(G.substr(G.length-1)!=="\\"){C[1]=(C[1]||"").replace(/\\/g,"");
A=p.find[B](C,H,I);
if(A!=null){J=J.replace(p.match[B],"");
break
}}}}if(!A){A=H.getElementsByTagName("*")
}return{set:A,expr:J}
};
f.filter=function(O,P,L,D){var F=O,I=[],R=P,B,H,A=P&&P[0]&&w(P[0]);
while(O&&P.length){for(var Q in p.filter){if((B=p.match[Q].exec(O))!=null){var G=p.filter[Q],J,M;
H=false;
if(R===I){I=[]
}if(p.preFilter[Q]){B=p.preFilter[Q](B,R,L,I,D,A);
if(!B){H=J=true
}else{if(B===true){continue
}}}if(B){for(var C=0;
(M=R[C])!=null;
C++){if(M){J=G(M,B,C,R);
var N=D^!!J;
if(L&&J!=null){if(N){H=true
}else{R[C]=false
}}else{if(N){I.push(M);
H=true
}}}}}if(J!==aU){if(!L){R=I
}O=O.replace(p.match[Q],"");
if(!H){return[]
}break
}}}if(O===F){if(H==null){throw"Syntax error, unrecognized expression: "+O
}else{break
}}F=O
}return R
};
var p=f.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(A){return A.getAttribute("href")
}},relative:{"+":function(I,F){var C=typeof F==="string",A=C&&!/\W/.test(F),H=C&&!A;
if(A){F=F.toLowerCase()
}for(var D=0,G=I.length,B;
D<G;
D++){if((B=I[D])){while((B=B.previousSibling)&&B.nodeType!==1){}I[D]=H||B&&B.nodeName.toLowerCase()===F?B||false:B===F
}}if(H){f.filter(F,I,true)
}},">":function(H,F){var B=typeof F==="string";
if(B&&!/\W/.test(F)){F=F.toLowerCase();
for(var D=0,G=H.length;
D<G;
D++){var A=H[D];
if(A){var C=A.parentNode;
H[D]=C.nodeName.toLowerCase()===F?C:false
}}}else{for(var D=0,G=H.length;
D<G;
D++){var A=H[D];
if(A){H[D]=B?A.parentNode:A.parentNode===F
}}if(B){f.filter(F,H,true)
}}},"":function(C,F,A){var D=k++,G=b;
if(typeof F==="string"&&!/\W/.test(F)){var B=F=F.toLowerCase();
G=z
}G("parentNode",F,D,C,B,A)
},"~":function(C,F,A){var D=k++,G=b;
if(typeof F==="string"&&!/\W/.test(F)){var B=F=F.toLowerCase();
G=z
}G("previousSibling",F,D,C,B,A)
}},find:{ID:function(C,B,A){if(typeof B.getElementById!=="undefined"&&!A){var D=B.getElementById(C[1]);
return D?[D]:[]
}},NAME:function(D,A){if(typeof A.getElementsByName!=="undefined"){var F=[],B=A.getElementsByName(D[1]);
for(var C=0,G=B.length;
C<G;
C++){if(B[C].getAttribute("name")===D[1]){F.push(B[C])
}}return F.length===0?null:F
}},TAG:function(B,A){return A.getElementsByTagName(B[1])
}},preFilter:{CLASS:function(C,F,D,G,I,H){C=" "+C[1].replace(/\\/g,"")+" ";
if(H){return C
}for(var B=0,A;
(A=F[B])!=null;
B++){if(A){if(I^(A.className&&(" "+A.className+" ").replace(/[\t\n]/g," ").indexOf(C)>=0)){if(!D){G.push(A)
}}else{if(D){F[B]=false
}}}}return false
},ID:function(A){return A[1].replace(/\\/g,"")
},TAG:function(A,B){return A[1].toLowerCase()
},CHILD:function(B){if(B[1]==="nth"){var A=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(B[2]==="even"&&"2n"||B[2]==="odd"&&"2n+1"||!/\D/.test(B[2])&&"0n+"+B[2]||B[2]);
B[2]=(A[1]+(A[2]||1))-0;
B[3]=A[3]-0
}B[0]=k++;
return B
},ATTR:function(B,F,D,G,A,H){var C=B[1].replace(/\\/g,"");
if(!H&&p.attrMap[C]){B[1]=p.attrMap[C]
}if(B[2]==="~="){B[4]=" "+B[4]+" "
}return B
},PSEUDO:function(B,F,D,G,A){if(B[1]==="not"){if((l.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=f(B[3],null,null,F)
}else{var C=f.filter(B[3],F,D,true^A);
if(!D){G.push.apply(G,C)
}return false
}}else{if(p.match.POS.test(B[0])||p.match.CHILD.test(B[0])){return true
}}return B
},POS:function(A){A.unshift(true);
return A
}},filters:{enabled:function(A){return A.disabled===false&&A.type!=="hidden"
},disabled:function(A){return A.disabled===true
},checked:function(A){return A.checked===true
},selected:function(A){A.parentNode.selectedIndex;
return A.selected===true
},parent:function(A){return !!A.firstChild
},empty:function(A){return !A.firstChild
},has:function(A,B,C){return !!f(C[3],A).length
},header:function(A){return/h\d/i.test(A.nodeName)
},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||A.nodeName.toLowerCase()==="button"
},input:function(A){return/input|select|textarea|button/i.test(A.nodeName)
}},setFilters:{first:function(A,B){return B===0
},last:function(B,C,D,A){return C===A.length-1
},even:function(A,B){return B%2===0
},odd:function(A,B){return B%2===1
},lt:function(A,B,C){return B<C[3]-0
},gt:function(A,B,C){return B>C[3]-0
},nth:function(A,B,C){return C[3]-0===B
},eq:function(A,B,C){return C[3]-0===B
}},filter:{PSEUDO:function(I,D,C,H){var F=D[1],B=p.filters[F];
if(B){return B(I,C,D,H)
}else{if(F==="contains"){return(I.textContent||I.innerText||s([I])||"").indexOf(D[3])>=0
}else{if(F==="not"){var A=D[3];
for(var C=0,G=A.length;
C<G;
C++){if(A[C]===I){return false
}}return true
}else{throw"Syntax error, unrecognized expression: "+F
}}}},CHILD:function(H,D){var A=D[1],G=H;
switch(A){case"only":case"first":while((G=G.previousSibling)){if(G.nodeType===1){return false
}}if(A==="first"){return true
}G=H;
case"last":while((G=G.nextSibling)){if(G.nodeType===1){return false
}}return true;
case"nth":var F=D[2],I=D[3];
if(F===1&&I===0){return true
}var B=D[0],J=H.parentNode;
if(J&&(J.sizcache!==B||!H.nodeIndex)){var C=0;
for(G=J.firstChild;
G;
G=G.nextSibling){if(G.nodeType===1){G.nodeIndex=++C
}}J.sizcache=B
}var L=H.nodeIndex-I;
if(F===0){return L===0
}else{return(L%F===0&&L/F>=0)
}}},ID:function(A,B){return A.nodeType===1&&A.getAttribute("id")===B
},TAG:function(A,B){return(B==="*"&&A.nodeType===1)||A.nodeName.toLowerCase()===B
},CLASS:function(A,B){return(" "+(A.className||A.getAttribute("class"))+" ").indexOf(B)>-1
},ATTR:function(A,C){var D=C[1],G=p.attrHandle[D]?p.attrHandle[D](A):A[D]!=null?A[D]:A.getAttribute(D),H=G+"",B=C[2],F=C[4];
return G==null?B==="!=":B==="="?H===F:B==="*="?H.indexOf(F)>=0:B==="~="?(" "+H+" ").indexOf(F)>=0:!F?H&&G!==false:B==="!="?H!==F:B==="^="?H.indexOf(F)===0:B==="$="?H.substr(H.length-F.length)===F:B==="|="?H===F||H.substr(0,F.length+1)===F+"-":false
},POS:function(B,F,D,A){var G=F[2],C=p.setFilters[G];
if(C){return C(B,D,F,A)
}}}};
var q=p.match.POS;
for(var u in p.match){p.match[u]=new RegExp(p.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);
p.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+p.match[u].source)
}var n=function(A,B){A=Array.prototype.slice.call(A,0);
if(B){B.push.apply(B,A);
return B
}return A
};
try{Array.prototype.slice.call(document.documentElement.childNodes,0)
}catch(a){n=function(A,B){var D=B||[];
if(e.call(A)==="[object Array]"){Array.prototype.push.apply(D,A)
}else{if(typeof A.length==="number"){for(var C=0,F=A.length;
C<F;
C++){D.push(A[C])
}}else{for(var C=0;
A[C];
C++){D.push(A[C])
}}}return D
}
}var g;
if(document.documentElement.compareDocumentPosition){g=function(B,C){if(!B.compareDocumentPosition||!C.compareDocumentPosition){if(B==C){r=true
}return B.compareDocumentPosition?-1:1
}var A=B.compareDocumentPosition(C)&4?-1:B===C?0:1;
if(A===0){r=true
}return A
}
}else{if("sourceIndex" in document.documentElement){g=function(B,C){if(!B.sourceIndex||!C.sourceIndex){if(B==C){r=true
}return B.sourceIndex?-1:1
}var A=B.sourceIndex-C.sourceIndex;
if(A===0){r=true
}return A
}
}else{if(document.createRange){g=function(B,D){if(!B.ownerDocument||!D.ownerDocument){if(B==D){r=true
}return B.ownerDocument?-1:1
}var C=B.ownerDocument.createRange(),F=D.ownerDocument.createRange();
C.setStart(B,0);
C.setEnd(B,0);
F.setStart(D,0);
F.setEnd(D,0);
var A=C.compareBoundaryPoints(Range.START_TO_END,F);
if(A===0){r=true
}return A
}
}}}function s(D){var C="",A;
for(var B=0;
D[B];
B++){A=D[B];
if(A.nodeType===3||A.nodeType===4){C+=A.nodeValue
}else{if(A.nodeType!==8){C+=s(A.childNodes)
}}}return C
}(function(){var B=document.createElement("div"),A="script"+(new Date).getTime();
B.innerHTML="<a name='"+A+"'/>";
var C=document.documentElement;
C.insertBefore(B,C.firstChild);
if(document.getElementById(A)){p.find.ID=function(F,D,H){if(typeof D.getElementById!=="undefined"&&!H){var G=D.getElementById(F[1]);
return G?G.id===F[1]||typeof G.getAttributeNode!=="undefined"&&G.getAttributeNode("id").nodeValue===F[1]?[G]:aU:[]
}};
p.filter.ID=function(D,G){var F=typeof D.getAttributeNode!=="undefined"&&D.getAttributeNode("id");
return D.nodeType===1&&F&&F.nodeValue===G
}
}C.removeChild(B);
C=B=null
})();
(function(){var A=document.createElement("div");
A.appendChild(document.createComment(""));
if(A.getElementsByTagName("*").length>0){p.find.TAG=function(G,B){var C=B.getElementsByTagName(G[1]);
if(G[1]==="*"){var D=[];
for(var F=0;
C[F];
F++){if(C[F].nodeType===1){D.push(C[F])
}}C=D
}return C
}
}A.innerHTML="<a href='#'></a>";
if(A.firstChild&&typeof A.firstChild.getAttribute!=="undefined"&&A.firstChild.getAttribute("href")!=="#"){p.attrHandle.href=function(B){return B.getAttribute("href",2)
}
}A=null
})();
if(document.querySelectorAll){(function(){var C=f,A=document.createElement("div");
A.innerHTML="<p class='TEST'></p>";
if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return
}f=function(I,D,G,F){D=D||document;
if(!F&&D.nodeType===9&&!w(D)){try{return n(D.querySelectorAll(I),G)
}catch(H){}}return C(I,D,G,F)
};
for(var B in C){f[B]=C[B]
}A=null
})()
}(function(){var A=document.createElement("div");
A.innerHTML="<div class='test e'></div><div class='test'></div>";
if(!A.getElementsByClassName||A.getElementsByClassName("e").length===0){return
}A.lastChild.className="e";
if(A.getElementsByClassName("e").length===1){return
}p.order.splice(1,0,"CLASS");
p.find.CLASS=function(D,C,B){if(typeof C.getElementsByClassName!=="undefined"&&!B){return C.getElementsByClassName(D[1])
}};
A=null
})();
function z(G,A,B,I,L,J){for(var D=0,F=I.length;
D<F;
D++){var H=I[D];
if(H){H=H[G];
var C=false;
while(H){if(H.sizcache===B){C=I[H.sizset];
break
}if(H.nodeType===1&&!J){H.sizcache=B;
H.sizset=D
}if(H.nodeName.toLowerCase()===A){C=H;
break
}H=H[G]
}I[D]=C
}}}function b(G,A,B,I,L,J){for(var D=0,F=I.length;
D<F;
D++){var H=I[D];
if(H){H=H[G];
var C=false;
while(H){if(H.sizcache===B){C=I[H.sizset];
break
}if(H.nodeType===1){if(!J){H.sizcache=B;
H.sizset=D
}if(typeof A!=="string"){if(H===A){C=true;
break
}}else{if(f.filter(A,[H]).length>0){C=H;
break
}}}H=H[G]
}I[D]=C
}}}var o=document.compareDocumentPosition?function(A,B){return A.compareDocumentPosition(B)&16
}:function(A,B){return A!==B&&(A.contains?A.contains(B):true)
};
var w=function(B){var A=(B?B.ownerDocument||B:0).documentElement;
return A?A.nodeName!=="HTML":false
};
var c=function(G,H){var C=[],B="",A,D=H.nodeType?[H]:H;
while((A=p.match.PSEUDO.exec(G))){B+=A[0];
G=G.replace(p.match.PSEUDO,"")
}G=p.relative[G]?G+"*":G;
for(var I=0,F=D.length;
I<F;
I++){f(G,D[I],C)
}return f.filter(B,C)
};
return f
})();
bd.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};
var bv,bt="sb-drag-proxy",br,aV,bJ;
function bm(){br={x:0,y:0,startX:null,startY:null}
}function bX(){var a=bd.dimensions;
bV(aV.style,{height:a.innerHeight+"px",width:a.innerWidth+"px"})
}function bf(){bm();
var a=["position:absolute","cursor:"+(bd.isGecko?"-moz-grab":"move"),"background-color:"+(bd.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");
bd.appendHTML(bd.skin.body,'<div id="'+bt+'" style="'+a+'"></div>');
aV=bM(bt);
bX();
bq(aV,"mousedown",bi)
}function by(){if(aV){bh(aV,"mousedown",bi);
bw(aV);
aV=null
}bJ=null
}function bi(a){aR(a);
var b=a7(a);
br.startX=b[0];
br.startY=b[1];
bJ=bM(bd.player.id);
bq(document,"mousemove",bl);
bq(document,"mouseup",aW);
if(bd.isGecko){aV.style.cursor="-moz-grabbing"
}}function bl(f){var c=bd.player,e=bd.dimensions,g=a7(f);
var b=g[0]-br.startX;
br.startX+=b;
br.x=Math.max(Math.min(0,br.x+b),e.innerWidth-c.width);
var a=g[1]-br.startY;
br.startY+=a;
br.y=Math.max(Math.min(0,br.y+a),e.innerHeight-c.height);
bV(bJ.style,{left:br.x+"px",top:br.y+"px"})
}function aW(){bh(document,"mousemove",bl);
bh(document,"mouseup",aW);
if(bd.isGecko){aV.style.cursor="-moz-grab"
}}bd.img=function(a,b){this.obj=a;
this.id=b;
this.ready=false;
var c=this;
bv=new Image();
bv.onload=function(){c.height=a.height?parseInt(a.height,10):bv.height;
c.width=a.width?parseInt(a.width,10):bv.width;
c.ready=true;
bv.onload=null;
bv=null
};
bv.src=a.content
};
bd.img.ext=["bmp","gif","jpg","jpeg","png"];
bd.img.prototype={append:function(a,e){var b=document.createElement("img");
b.id=this.id;
b.src=this.obj.content;
b.style.position="absolute";
var c,f;
if(e.oversized&&bd.options.handleOversize=="resize"){c=e.innerHeight;
f=e.innerWidth
}else{c=this.height;
f=this.width
}b.setAttribute("height",c);
b.setAttribute("width",f);
a.appendChild(b)
},remove:function(){var a=bM(this.id);
if(a){bw(a)
}by();
if(bv){bv.onload=null;
bv=null
}},onLoad:function(){var a=bd.dimensions;
if(a.oversized&&bd.options.handleOversize=="drag"){bf()
}},onWindowResize:function(){var e=bd.dimensions;
switch(bd.options.handleOversize){case"resize":var c=bM(this.id);
c.height=e.innerHeight;
c.width=e.innerWidth;
break;
case"drag":if(bJ){var b=parseInt(bd.getStyle(bJ,"top")),a=parseInt(bd.getStyle(bJ,"left"));
if(b+this.height<e.innerHeight){bJ.style.top=e.innerHeight-this.height+"px"
}if(a+this.width<e.innerWidth){bJ.style.left=e.innerWidth-this.width+"px"
}bX()
}break
}}};
bd.iframe=function(a,b){this.obj=a;
this.id=b;
var c=bM("sb-overlay");
this.height=a.height?parseInt(a.height,10):c.offsetHeight;
this.width=a.width?parseInt(a.width,10):c.offsetWidth
};
bd.iframe.prototype={append:function(c,b){var a='<iframe id="'+this.id+'" name="'+this.id+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" style="visibility:hidden" onload="this.style.visibility=\'visible\'" scrolling="auto"';
if(bd.isIE){a+=' allowtransparency="true"';
if(bd.isIE6){a+=" src=\"javascript:false;document.write('');\""
}}a+="></iframe>";
c.innerHTML=a
},remove:function(){var a=bM(this.id);
if(a){bw(a);
if(bd.isGecko){delete bs.frames[this.id]
}}},onLoad:function(){var a=bd.isIE?bM(this.id).contentWindow:bs.frames[this.id];
a.location.href=this.obj.content
}};
bd.html=function(b,a){this.obj=b;
this.id=a;
this.height=b.height?parseInt(b.height,10):300;
this.width=b.width?parseInt(b.width,10):500
};
bd.html.prototype={append:function(c,a){var b=document.createElement("div");
b.id=this.id;
b.className="html";
b.innerHTML=this.obj.content;
c.appendChild(b)
},remove:function(){var a=bM(this.id);
if(a){bw(a)
}}};
var bB=false,bR=[],aO=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],bP,bL,bQ,aS=true;
function bg(c,f,n,p,e){var s=(f=="opacity"),o=s?bd.setOpacity:function(u,t){u.style[f]=""+t+"px"
};
if(p==0||(!s&&!bd.options.animate)||(s&&!bd.options.animateFade)){o(c,n);
if(e){e()
}return
}var l=parseFloat(bd.getStyle(c,f))||0;
var k=n-l;
if(k==0){if(e){e()
}return
}p*=1000;
var b=bo(),q=bd.ease,r=b+p,a;
var g=setInterval(function(){a=bo();
if(a>=r){clearInterval(g);
g=null;
o(c,n);
if(e){e()
}}else{o(c,l+q((a-b)/p)*k)
}},10)
}function bW(){bP.style.height=bd.getWindowSize("Height")+"px";
bP.style.width=bd.getWindowSize("Width")+"px"
}function bU(){bP.style.top=document.documentElement.scrollTop+"px";
bP.style.left=document.documentElement.scrollLeft+"px"
}function bZ(a){if(a){bS(bR,function(b,c){c[0].style.visibility=c[1]||""
})
}else{bR=[];
bS(bd.options.troubleElements,function(c,b){bS(document.getElementsByTagName(b),function(f,e){bR.push([e,e.style.visibility]);
e.style.visibility="hidden"
})
})
}}function aN(b,c){var a=bM("sb-nav-"+b);
if(a){a.style.display=c?"":"none"
}}function bI(c,e){var f=bM("sb-loading"),b=bd.getCurrent().player,g=(b=="img"||b=="html");
if(c){bd.setOpacity(f,0);
f.style.display="block";
var a=function(){bd.clearOpacity(f);
if(e){e()
}};
if(g){bg(f,"opacity",1,bd.options.fadeDuration,a)
}else{a()
}}else{var a=function(){f.style.display="none";
bd.clearOpacity(f);
if(e){e()
}};
if(g){bg(f,"opacity",0,bd.options.fadeDuration,a)
}else{a()
}}}function aL(k){var r=bd.getCurrent();
bM("sb-title-inner").innerHTML=r.title||"";
var f,o,g,e,n;
if(bd.options.displayNav){f=true;
var l=bd.gallery.length;
if(l>1){if(bd.options.continuous){o=n=true
}else{o=(l-1)>bd.current;
n=bd.current>0
}}if(bd.options.slideshowDelay>0&&bd.hasNext()){e=!bd.isPaused();
g=!e
}}else{f=o=g=e=n=false
}aN("close",f);
aN("next",o);
aN("play",g);
aN("pause",e);
aN("previous",n);
var q="";
if(bd.options.displayCounter&&bd.gallery.length>1){var l=bd.gallery.length;
if(bd.options.counterType=="skip"){var a=0,b=l,c=parseInt(bd.options.counterLimit)||0;
if(c<l&&c>2){var p=Math.floor(c/2);
a=bd.current-p;
if(a<0){a+=l
}b=bd.current+(c-p);
if(b>l){b-=l
}}while(a!=b){if(a==l){a=0
}q+='<a onclick="Shadowbox.change('+a+');"';
if(a==bd.current){q+=' class="sb-counter-current"'
}q+=">"+(++a)+"</a>"
}}else{q=[bd.current+1,bd.lang.of,l].join(" ")
}}bM("sb-counter").innerHTML=q;
k()
}function a9(e){var c=bM("sb-title-inner"),b=bM("sb-info-inner"),a=0.35;
c.style.visibility=b.style.visibility="";
if(c.innerHTML!=""){bg(c,"marginTop",0,a)
}bg(b,"marginTop",0,a,e)
}function bp(c,f){var k=bM("sb-title"),n=bM("sb-info"),b=k.offsetHeight,a=n.offsetHeight,l=bM("sb-title-inner"),g=bM("sb-info-inner"),e=(c?0.35:0);
bg(l,"marginTop",b,e);
bg(g,"marginTop",a*-1,e,function(){l.style.visibility=g.style.visibility="hidden";
f()
})
}function bN(c,g,a,e){var f=bM("sb-wrapper-inner"),b=(a?bd.options.resizeDuration:0);
bg(bQ,"top",g,b);
bg(f,"height",c,b,e)
}function bu(c,f,a,e){var b=(a?bd.options.resizeDuration:0);
bg(bQ,"left",f,b);
bg(bQ,"width",c,b,e)
}function bF(f,c){var a=bM("sb-body-inner"),f=parseInt(f),c=parseInt(c),e=bQ.offsetHeight-a.offsetHeight,n=bQ.offsetWidth-a.offsetWidth,k=bL.offsetHeight,g=bL.offsetWidth,l=parseInt(bd.options.viewportPadding)||20,b=(bd.player&&bd.options.handleOversize!="drag");
return bd.setDimensions(f,c,k,g,e,n,l,b)
}var ba={};
ba.markup='<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-wrapper-inner"><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="sb-loading-inner"><span>{loading}</span></div></div></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div></div></div></div></div>';
ba.options={animSequence:"sync",counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.5,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]};
ba.init=function(){bd.appendHTML(document.body,aM(ba.markup,bd.lang));
ba.body=bM("sb-body-inner");
bP=bM("sb-container");
bL=bM("sb-overlay");
bQ=bM("sb-wrapper");
if(!S){bP.style.position="absolute"
}if(!aX){var b,c,a=/url\("(.*\.png)"\)/;
bS(aO,function(g,f){b=bM(f);
if(b){c=bd.getStyle(b,"backgroundImage").match(a);
if(c){b.style.backgroundImage="none";
b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+c[1]+",sizingMethod=scale);"
}}})
}var e;
bq(bs,"resize",function(){if(e){clearTimeout(e);
e=null
}if(bz){e=setTimeout(ba.onWindowResize,10)
}})
};
ba.onOpen=function(c,b){aS=false;
bP.style.display="block";
bW();
var a=bF(bd.options.initialHeight,bd.options.initialWidth);
bN(a.innerHeight,a.top);
bu(a.width,a.left);
if(bd.options.showOverlay){bL.style.backgroundColor=bd.options.overlayColor;
bd.setOpacity(bL,0);
if(!bd.options.modal){bq(bL,"click",bd.close)
}bB=true
}if(!S){bU();
bq(bs,"scroll",bU)
}bZ();
bP.style.visibility="visible";
if(bB){bg(bL,"opacity",bd.options.overlayOpacity,bd.options.fadeDuration,b)
}else{b()
}};
ba.onLoad=function(a,b){bI(true);
while(ba.body.firstChild){bw(ba.body.firstChild)
}bp(a,function(){if(!bz){return
}if(!a){bQ.style.visibility="visible"
}aL(b)
})
};
ba.onReady=function(e){if(!bz){return
}var a=bd.player,b=bF(a.height,a.width);
var c=function(){a9(e)
};
switch(bd.options.animSequence){case"hw":bN(b.innerHeight,b.top,true,function(){bu(b.width,b.left,true,c)
});
break;
case"wh":bu(b.width,b.left,true,function(){bN(b.innerHeight,b.top,true,c)
});
break;
default:bu(b.width,b.left,true);
bN(b.innerHeight,b.top,true,c)
}};
ba.onShow=function(a){bI(false,a);
aS=true
};
ba.onClose=function(){if(!S){bh(bs,"scroll",bU)
}bh(bL,"click",bd.close);
bQ.style.visibility="hidden";
var a=function(){bP.style.visibility="hidden";
bP.style.display="none";
bZ(true)
};
if(bB){bg(bL,"opacity",0,bd.options.fadeDuration,a)
}else{a()
}};
ba.onPlay=function(){aN("play",false);
aN("pause",true)
};
ba.onPause=function(){aN("pause",false);
aN("play",true)
};
ba.onWindowResize=function(){if(!aS){return
}bW();
var b=bd.player,a=bF(b.height,b.width);
bu(a.width,a.left);
bN(a.innerHeight,a.top);
if(b.onWindowResize){b.onWindowResize()
}};
bd.skin=ba;
bs.Shadowbox=bd
})(window);
is_ie=!!(window.attachEvent&&!window.opera);
if(!Array.prototype.push){Array.prototype.push=function(a){this[this.length]=a
}
}var SitebuilderInfo={url:null,lastContentUpdated:null};
function redirectToGo(a,b){var c="/go/"+a;
c=c+"?goSearchReferer="+encodeURIComponent(window.location);
if(b){c=c+"&goSearchQuery="+b
}window.location=c
}var WRollback=function(b,a,c){this.element=$(b);
this.over=a;
this.out=c;
this.element.onmouseover=a;
this.element.onmouseout=c
};
WRollback.prototype.disable=function(){this.element.onmouseover=null;
this.element.onmouseout=null
};
WRollback.prototype.enable=function(){this.element.onmouseover=this.over;
this.element.onmouseout=this.out
};
var WTogglePopup=function(a,e,b,c){this.button=$(a);
this.div=$(e);
this.duration=0.2;
this.effect="appear";
this.closeOnDocumentClick=b||false;
this.callback=c||function(){};
this.button.onclick=this.toggle.bind(this)
};
WTogglePopup.prototype.toggle=function(){options={duration:this.duration};
if(this.closeOnDocumentClick){options.afterFinish=function(){if(Element.visible(this.div)){document.onclick=this.hideIfVisible.bind(this);
this.callback(true)
}else{document.onclick=null;
this.callback(false)
}}.bind(this)
}else{options.afterFinish=function(){if(Element.visible(this.div)){this.callback(true)
}else{this.callback(false)
}}.bind(this)
}Effect.toggle(this.div,this.effect,options);
return false
};
WTogglePopup.prototype.hideIfVisible=function(){if(Element.visible(this.div)){this.toggle()
}return true
};
cancelDefaultEvents=function(a){if(a.preventDefault){a.preventDefault()
}a.returnValue=false
};
var WCookie=function(b,c,a,e){this.name=b;
this.expires="";
this.path="/";
this.value="";
if(c){this.value=c;
if(a){this.hours=a;
this.expires="; expires="+WCookie._getGMTStringForHoursAhead(a)
}else{this.expires=""
}if(e){this.path=e
}else{this.path="/"
}this.save()
}else{this.value=this.load()
}};
WCookie._getGMTStringForHoursAhead=function(a){var b=new Date();
b.setTime(b.getTime()+(a*60*60*1000));
return b.toGMTString()
};
WCookie.prototype.load=function(){var e=this.name+"=";
var a=document.cookie.split(";");
for(var b=0;
b<a.length;
b++){var f=a[b];
while(f.charAt(0)==" "){f=f.substring(1,f.length)
}if(f.indexOf(e)==0){return f.substring(e.length,f.length)
}}return null
};
WCookie.prototype.save=function(){document.cookie=this.name+"="+this.value+this.expires+"; path="+this.path
};
WCookie.prototype.erase=function(){this.value="";
this.hours=-1;
this.expires="; expires="+WCookie._getGMTStringForHoursAhead(this.hours);
this.save()
};
if(typeof(StringBuilder)=="undefined"){var StringBuilder=function(a){this.strings=new Array("");
this.append(a)
};
StringBuilder.prototype.append=function(a){if(a){this.strings.push(a)
}};
StringBuilder.prototype.clear=function(){this.strings.length=1
};
StringBuilder.prototype.toString=function(){return this.strings.join("")
}
}String.prototype.postEncode=function(){var a=new StringBuilder();
var e=this.length;
for(var b=0;
b<e;
b++){var f=this.charCodeAt(b).toString();
if(f>127){a.append("%26%23");
a.append(f);
a.append("%3B")
}else{a.append(encodeURIComponent(this.substr(b,1)))
}}return a.toString()
};
String.prototype.characterEscape=function(){var a=new StringBuilder();
var e=this.length;
for(var b=0;
b<e;
b++){var f=this.charCodeAt(b).toString();
if(f>127){a.append("&#");
a.append(f);
a.append(";")
}else{a.append(this.substr(b,1))
}}return a.toString()
};
String.prototype.trim=function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")
};
var WForm={postEncode:function(e){var f=Form.getElements($(e));
var c=new Array();
for(var b=0;
b<f.length;
b++){var a=WForm.Element.postEncode(f[b]);
if(a){c.push(a)
}}return c.join("&")
},Element:{postEncode:function(c){c=$(c);
var f=c.tagName.toLowerCase();
var e=Form.Element.Serializers[f](c);
var b=c.name.postEncode();
var a=e.constructor!=Array?[e]:e;
return a.map(function(g){return b+"="+g.postEncode()
}).join("&")
}}};
Ajax.Responders.register({onCreate:function(a){if(a.options.multiComplete){a.options.multiComplete.add(a)
}},onComplete:function(a){if(a.options.multiComplete){a.options.multiComplete.done(a)
}}});
Ajax.MultiCompleter=function(a){var b=Prototype.emptyFunction;
this.onComplete=a.onComplete||b;
this.onSuccess=a.onSuccess||b;
this.onFailure=a.onFailure||b;
this.onLoading=a.onLoading||b;
this.reset();
this.loaded=false;
this.loading=false
};
Ajax.MultiCompleter.prototype={add:function(a){this.tasks.push(a);
if(!this.loading){this.onLoading()
}},done:function(a){this.numberFinished++;
if(this.allAdded){this._checkFinished()
}},finishedAdding:function(){this.allAdded=true;
this._checkFinished()
},_checkFinished:function(){if(this.numberFinished>=this.tasks.length){this.loaded=true;
this.loading=false;
this.onComplete();
var a=false;
$A(this.tasks).each(function(b){if(b.transport.status<200||b.transport.status>=300){a=true;
throw $break
}});
if(a){this.onFailure()
}else{this.onSuccess()
}this.reset()
}},reset:function(){this.tasks=[];
this.numberFinished=0;
this.allAdded=false;
this.fired=false
},onComplete:function(){},onSuccess:function(){},onFailure:function(){}};
Ajax.currentRequests={};
Ajax.Responders.register({onCreate:function(a){if(a.options.onlyLatestOfClass&&Ajax.currentRequests[a.options.onlyLatestOfClass]){try{Ajax.currentRequests[a.options.onlyLatestOfClass].transport.abort()
}catch(b){}}Ajax.currentRequests[a.options.onlyLatestOfClass]=a
},onComplete:function(a){if(a.options.onlyLatestOfClass){Ajax.currentRequests[a.options.onlyLatestOfClass]=null
}}});
Ajax.Responders.register({onException:function(a,b){if(window.console){console.error(b)
}}});
var addEvent=function(c,b,a){Event.observe(c,b,a)
};
var sbrToAbsoluteUrl=function(b){var c=b;
if(c.indexOf(":")<0){var e=""+window.location.href;
var a=document.getElementsByTagName("base");
if(a.length>0){e=a[0].href
}if(c.startsWith("//www2")){c=e.substring(0,e.indexOf(":")+1)+c
}else{if(c.indexOf("/")===0){c=c.substring(1);
e=e.substring(0,e.indexOf("/",7))
}if(e.charAt(e.length-1)!="/"){e+="/"
}c=e+c
}}return c
};
Object.extend(Event,{onDOMReady:function(a){if(document.loaded){a.call()
}else{document.observe("dom:loaded",a)
}}});
Ajax._transformRelativeUrl=function(a){if(a.startsWith("/")&&!a.startsWith("//")){return window.location.protocol+"//"+window.location.host+a
}return a
};
Ajax.Request.prototype.oldinit=Ajax.Request.prototype.initialize;
Ajax.Request.prototype.initialize=function(b,a){arguments[0]=Ajax._transformRelativeUrl(arguments[0]);
this.oldinit.apply(this,arguments)
};
Shadowbox.initialized=false;
var shadowboxOptions={overlayOpacity:0.7,overlayColor:"#fff",viewportPadding:40,counterType:"skip",onOpen:function(){if($("sb-wrapper").firstDescendant().id=="sb-title"){$("sb-info-inner").insert($("sb-counter"));
$("sb-info").insert({after:$("sb-title")});
$("sb-nav-close").remove();
$$("#sb-nav a").reverse().each(function(b){b.parentNode.insert(b)
});
$("sb-nav-next").update("&raquo;");
$("sb-nav-previous").update("&laquo;");
if(!$("sb-wrapper").down(".close-button")){$("sb-wrapper").insert({top:new Element("img",{src:"/static_war/render/images/mediaplayers/closebox.png"}).addClassName("close-button").observe("click",function(){Shadowbox.close()
})})
}}}};
var initShadowbox=function(){if($$("#bodyContent a[rel^=lightbox]").length>0){if(Shadowbox.initialized){Shadowbox.clearCache();
Shadowbox.setup(false,shadowboxOptions)
}else{Shadowbox.initialized=true;
Shadowbox.init(shadowboxOptions)
}}};
Event.onDOMReady(initShadowbox);
var initLightbox=initShadowbox;
function toggleChildren(b,k,g){var a=$("children_"+b);
var e="/sitebuilder2/api/ajax/children.htm?page="+k;
var f=0.3;
if(Element.visible(a)){Element.hide(a);
Element.removeClassName(g,"expanded");
return
}else{var c={asynchronous:true,evalScripts:false,onComplete:function(l){Element.show(a);
Element.addClassName(g,"expanded")
},method:"get"};
new Ajax.Updater(a,e,c)
}}var Sidebar=function(e,a,c){this.id=e;
this.element=$(e);
this.isDragging=false;
this.isHidden=false;
this.leftColumn=$(a);
this.mainColumn=$(c);
this.isDraggingEnabled=true;
var b=Element.getDimensions(this.leftColumn);
this.width=b.width;
this.height=b.height;
this.cookie=new WCookie("sidebarState");
if(this.cookie.value&&this.cookie.value=="hide"){this.hide()
}};
Sidebar.hiddenOnThisPage=false;
Sidebar.HideThreshold=100;
Sidebar.prototype.click=function(){var a=new Date().getTime();
this.timeLastClicked=a;
this.toggle()
};
Sidebar.prototype.mouseDown=function(){if(!this.isDraggingEnabled){return
}this.isDragging=true;
Event.observe(document,"mouseup",this.mouseUp.bindAsEventListener(this));
document.onselectstart=function(){return false
};
document.onmousedown=function(){return false
}
};
Sidebar.prototype.mouseUp=function(){if(!this.isDraggingEnabled){return true
}this.isDragging=false;
document.onselectstart=null;
document.onmousedown=null;
return false
};
Sidebar.prototype.setWidth=function(a){if(!this.isDraggingEnabled){return
}if(a>Sidebar.HideThreshold){var b=(Element.getDimensions(document.body).width)/2;
if(a>b){a=b
}if(this.isHidden){this.show()
}this.leftColumn.style.width=a+"px";
if(typeof(isTableLayout)=="undefined"||!isTableLayout){this.mainColumn.style.marginLeft=(a+20)+"px"
}this.width=a
}else{if(!this.isHidden){this.hide()
}}};
Sidebar.prototype.resetWidth=function(){this.leftColumn.style.width=null;
if(typeof(isTableLayout)=="undefined"||!isTableLayout){this.mainColumn.style.marginLeft=null
}};
Sidebar.prototype.updateMouse=function(f){if(this.isDragging){var c=Event.pointerX(f);
var b=Position.cumulativeOffset(this.leftColumn)[0];
var a=c-b;
this.setWidth(a)
}};
Sidebar.prototype.toggle=function(){navigation.resetWidth();
if(Element.hasClassName("main","collapse")){this.show()
}else{this.hide()
}};
Sidebar.prototype.hide=function(){this.hideForPage();
this.cookie.value="hide";
this.cookie.save()
};
Sidebar.prototype.hideForPage=function(){this.resetWidth();
var a=(Element.getDimensions("outerNavigation").height);
$("outerNavigation").style.height=this.height+"px";
Element.addClassName("main","collapse");
this.isHidden=true
};
Sidebar.prototype.show=function(){Element.removeClassName("main","collapse");
$("outerNavigation").style.height=null;
this.isHidden=false;
this.cookie.value="";
this.cookie.save()
};
var agt=navigator.userAgent.toLowerCase();
var is_ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));
var is_major=parseInt(navigator.appVersion);
var is_ielt7=(is_ie&&(is_major<4||(agt.indexOf("ie 4")!=-1)||(agt.indexOf("ie 5.")!=-1)||(agt.indexOf("ie 6.")!=-1)));
var navigation;
var setupSidebar=function(){if(!$("navigationHandle")||!$("leftContent")||!$("bodyContent")){return
}navigation=new Sidebar("navigationHandle","leftContent","bodyContent");
if(is_ielt7){navigation.isDraggingEnabled=false;
$("navigationHandle").title="Click to toggle"
}else{$("navigationHandle").title="Click to toggle, drag to resize"
}$("navigationHandle").style.visibility="visible";
Event.observe("navigationHandle","mousedown",navigation.mouseDown.bindAsEventListener(navigation));
Event.observe("navigationHandle","click",navigation.click.bindAsEventListener(navigation));
Event.observe(document,"mousemove",navigation.updateMouse.bindAsEventListener(navigation));
if(Sidebar.hiddenOnThisPage){navigation.hideForPage()
}};
Event.onDOMReady(setupSidebar);
if(!NavigableList){var NavigableList=function(a,e,c,b){this.element=a;
this.isSelectFirst=e;
if(b){this.hideShowContainer=b
}else{this.hideShowContainer=this.element
}this.items=getListItems(a);
this.visible=true;
this.listener=c;
this.selectedIndex=-1;
this.selectedElement=null;
c.onblur=this.closeSoon.bindAsEventListener(this);
c.onkeydown=this._handleKeyPress.bindAsEventListener(this);
if(!this.isEmpty()){if(this.isSelectFirst){this._selectFirst()
}this.updateSelectedStyles();
this.registerMouseListeners()
}};
NavigableList.prototype._handleKeyPress=function(a){switch(a.keyCode){case Event.KEY_RETURN:return this.select();
break;
case Event.KEY_ESC:this.close();
break;
case Event.KEY_UP:this.moveUp();
return false;
break;
case Event.KEY_DOWN:this.moveDown();
return false;
break
}};
NavigableList.prototype.select=function(){if(this.visible&&this.selectFunction){return this.selectFunction(this.selectedElement)
}return true
};
NavigableList.prototype.setSelectFunction=function(a){this.selectFunction=a
};
NavigableList.prototype.isEmpty=function(){return(this.element.childNodes.length==0)
};
NavigableList.prototype.moveUp=function(){if(this.isEmpty()){return
}if(this.selectedIndex<=0){this._selectLast()
}else{this.selectedIndex--;
this.selectedElement=this.items[this.selectedIndex]
}this.updateSelectedStyles()
};
NavigableList.prototype.moveDown=function(){if(this.isEmpty()){return
}if(this.selectedIndex>=this.items.length-1){this._selectFirst()
}else{this.selectedIndex++;
this.selectedElement=this.items[this.selectedIndex]
}this.updateSelectedStyles()
};
NavigableList.prototype.open=function(){Element.show(this.hideShowContainer);
this.visible=true
};
NavigableList.prototype.close=function(){Element.hide(this.hideShowContainer);
this.listener.onkeydown=null;
this.visible=false
};
NavigableList.prototype.closeSoon=function(){setTimeout(this.close.bind(this),500)
};
NavigableList.prototype.updateSelectedStyles=function(){var a=this.items;
for(var b=0;
b<a.length;
b++){if(a[b]==this.selectedElement){this.selectedIndex=b
}else{Element.removeClassName(a[b],"selected")
}}Element.addClassName(this.selectedElement,"selected")
};
NavigableList.prototype._selectLast=function(){this.selectedIndex=this.items.length-1;
this.selectedElement=this.items[this.selectedIndex]
};
NavigableList.prototype._selectFirst=function(){this.selectedIndex=0;
this.selectedElement=this.items[0]
};
NavigableList.prototype.destroy=function(){this.element=null;
this.listener=null;
this.selectedElement=null
};
NavigableList.prototype.registerMouseListeners=function(){var a=this.items;
for(var b=0;
b<a.length;
b++){var c=this;
a[b].onmouseover=function(f){c.selectedElement=this;
c.updateSelectedStyles()
};
a[b].onclick=function(f){c.selectedElement=this;
c.select()
}
}};
var getListItems=function(c){var a=new Array();
for(var b=0;
b<c.childNodes.length;
b++){var e=c.childNodes[b];
if(e.tagName=="LI"){a.push(e)
}}return a
};
var nextListItem=function(b){var a=b.nextSibling;
if(!a){return null
}else{if(a.tagName=="LI"){return a
}else{return nextListItem(a)
}}};
var previousListItem=function(b){var a=b.previousSibling;
if(!a){return null
}else{if(a.tagName=="LI"){return a
}else{return previousListItem(a)
}}}
}cancelDefaultEvents=function(a){if(a.preventDefault){a.preventDefault()
}a.returnValue=false
};
var suggestList;
var previousSearchValue="";
var searchSuggestRequest;
var searchRolloverImage=new Image(19,16,"/static_war/render/images/searchsquare_rounded_over.gif");
Event.observe(window,"load",function(a){if($("searchButton")){new WRollback("search",function(b){Element.addClassName("search","hover");
$("searchButton").src="/static_war/render/images/searchsquare_rounded_over.gif"
},function(b){Element.removeClassName("search","hover");
$("searchButton").src="/static_war/render/images/searchsquare_rounded.gif"
})
}if($("searchBox")){addGoSuggest("searchBox","searchForm","searchSuggestions");
$("searchBoxLabel").show();
$("searchBox").observe("focus",function(){$("searchBoxLabel").hide()
});
$("searchBox").observe("blur",function(){if(!$F("searchBox")){$("searchBoxLabel").show()
}})
}});
function addGoSuggest(b,c,a){$(b).setAttribute("autocomplete","off");
Event.observe(b,"keyup",function(f){var g=$F(b).toLowerCase();
var e="http://"+window.location.hostname+"/sitebuilder2/api/go/redirects.htm?maxResults=6&prefix=";
if(g==previousSearchValue){return
}previousSearchValue=g;
if(g==""){if(suggestList){suggestList.close()
}Element.hide(a);
return
}$(b).setAttribute("previousvalue",g);
if(searchSuggestRequest){searchSuggestRequest.transport.abort()
}searchSuggestRequest=new Ajax.Request(e+g,{method:"post",onSuccess:function(k){Element.update(a,k.responseText);
if(suggestList){suggestList.close()
}if($(a).getElementsByTagName("li").length==0){Element.hide(a);
return
}suggestList=new NavigableList($(a).getElementsByTagName("ul")[0],false,$(b),$(a));
suggestList.setSelectFunction(function(o){var l=o.childNodes;
for(i=0;
i<l.length;
i++){if(l[i].className=="redirectpath"){var n=l[i].innerHTML;
redirectToGo(n,$(b).value);
if($(c)){$(c).onsubmit=function(p){return false
}
}return false
}}});
Element.show(a)
}})
})
}Event.onDOMReady(function(f){if(!$(Flyout.tagId)||!$(Flyout.id)){return
}$(Flyout.tagId).style.display="block";
$(Flyout.id).onmouseover=Flyout.onMouseOver;
$(Flyout.id).onmouseout=Flyout.onMouseOut;
$(Flyout.tagId).observe("mouseover",function(g){if(g.pointerX()!=0||g.pointerY()!=0){Flyout.startShowTimer()
}});
$(Flyout.tagId).onmouseout=function(g){Flyout.startHideTimer();
Flyout.cancelShowTimer()
};
$("flyoutCloseButton").onclick=Flyout.flyOut;
$("flyoutCloseButton").title="Click to close";
var a=$(Flyout.id).getElementsByTagName("INPUT");
for(var c=0;
c<a.length;
c++){Event.observe(a[c],"focus",function(g){Flyout.isFormFieldFocused=true
});
Event.observe(a[c],"blur",function(g){Flyout.isFormFieldFocused=false;
if(!Flyout.isMouseOver){Flyout.flyOut()
}})
}var b=$(Flyout.id).getElementsByTagName("SELECT");
for(var c=0;
c<b.length;
c++){Event.observe(b[c],"focus",function(g){Flyout.isFormFieldFocused=true
});
Event.observe(b[c],"blur",function(g){Flyout.isFormFieldFocused=false;
if(!Flyout.isMouseOver){Flyout.flyOut()
}})
}addGoSuggest("flyoutGoInput","","flyoutGoSuggestions")
});
var Flyout=function(){};
Flyout.id="flyout";
Flyout.tagId="flyoutTag";
Flyout.isMouseOver=false;
Flyout.onMouseOver=function(a){Flyout.isMouseOver=true;
Flyout.cancelHideTimer()
};
Flyout.onMouseOut=function(a){if(Flyout.isFlying){return
}Flyout.isMouseOver=false;
Flyout.startHideTimer()
};
Flyout.transitionTime=0.4;
Flyout.isFlying=false;
Flyout.isOut=true;
Flyout.hideTimer=null;
Flyout.showTimer=null;
Flyout.isFormFieldFocused=false;
Flyout.flyTo=function(a,k){if(Flyout.isFlying){return
}Flyout.isFlying=true;
var c=Element.getDimensions(document.body).width;
var b=Element.getDimensions(Flyout.id).width;
var g=a;
var f=k;
var e=Flyout.transitionTime;
new Effect.Move(Flyout.id,{x:g,y:f,position:"absolute",duration:e});
setTimeout(Flyout.resetFlying,e*1020)
};
Flyout.resetFlying=function(){Flyout.isFlying=false;
Flyout.isOut=!Flyout.isOut
};
Flyout.slideX=645;
Flyout.slideY=450;
Flyout.flyIn=function(){if(!Flyout.isOut){return
}Flyout.analytics("flyIn");
Flyout.flyTo(Flyout.slideX,Flyout.slideY);
$("flyoutGoInput").focus();
setTimeout(function(a){Flyout.isFormFieldFocused=false
},100)
};
Flyout.flyOut=function(){if(Flyout.isFormFieldFocused){return
}if(Flyout.isOut){return
}Flyout.flyTo(-Flyout.slideX,-Flyout.slideY)
};
Flyout.toggle=function(){if(!$(Flyout.tagId)||!$(Flyout.id)){return
}if(Flyout.isOut){Flyout.flyIn()
}else{Flyout.flyOut()
}};
Flyout.cancelHideTimer=function(){clearTimeout(Flyout.hideTimer)
};
Flyout.startHideTimer=function(){Flyout.hideTimer=setTimeout(Flyout.flyOut,500)
};
Flyout.cancelShowTimer=function(){clearTimeout(Flyout.showTimer)
};
Flyout.startShowTimer=function(){Flyout.showTimer=setTimeout(function(a){Flyout.flyIn();
Flyout.cancelHideTimer()
},500)
};
Flyout.analytics=function(a){if(window._gaq){_gaq.push(["_trackEvent","Flyout",a])
}};
var CtrlAltShortcuts={F:function(a){Flyout.toggle()
},E:function(a){if(window.editMenu&&!editMenu.isVisible){editMenu.open()
}},L:function(a){navigation.toggle()
},T:function(a){if(typeof(textOnly)!="undefined"&&textOnly==true){window.location.href="?textOnly=false"
}else{window.location.href="?textOnly=true"
}}};
Event.observe(window,"load",function(a){Event.observe(document,"keydown",function(k){var c=(window.event)?event:k;
var b=String.fromCharCode(c.keyCode);
var g=c.altKey;
var f=c.ctrlKey;
if(f&&g&&CtrlAltShortcuts[b]){cancelDefaultEvents(c);
CtrlAltShortcuts[b](k)
}})
});
var Resizables={resizables:[],observers:[],register:function(a){if(this.resizables.length==0){this.eventMouseUp=this.endResize.bindAsEventListener(this);
this.eventMouseMove=this.updateResize.bindAsEventListener(this);
this.eventKeypress=this.keyPress.bindAsEventListener(this);
Event.observe(document,"mouseup",this.eventMouseUp);
Event.observe(document,"mousemove",this.eventMouseMove);
Event.observe(document,"keypress",this.eventKeypress)
}this.resizables.push(a)
},unregister:function(a){this.resizables=this.resizables.reject(function(b){return b==a
});
if(this.resizable.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);
Event.stopObserving(document,"mousemove",this.eventMouseMove);
Event.stopObserving(document,"keypress",this.eventKeypress)
}},activate:function(a){window.focus();
this.activeResizable=a
},deactivate:function(){this.activeResizable=null
},updateResize:function(a){if(!this.activeResizable){return
}var b=[Event.pointerX(a),Event.pointerY(a)];
if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return
}this._lastPointer=b;
this.activeResizable.updateResize(a,b)
},endResize:function(a){if(!this.activeResizable){return
}this._lastPointer=null;
this.activeResizable.endResize(a);
this.activeResizable=null
},keyPress:function(a){if(this.activeResizable){this.activeResizable.keyPress(a)
}},addObserver:function(a){this.observers.push(a);
this._cacheObserverCallbacks()
},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a
});
this._cacheObserverCallbacks()
},notify:function(a,b,c){if(this[a+"Count"]>0){this.observers.each(function(e){if(e[a]){e[a](a,b,c)
}})
}},_cacheObserverCallbacks:function(){["onStart","onEnd","onResize"].each(function(a){Resizables[a+"Count"]=Resizables.observers.select(function(b){return b[a]
}).length
})
}};
var Resizable=Class.create();
Resizable.prototype={initialize:function(b){var a=Object.extend({handle:false,starteffect:function(e){e._opacity=Element.getOpacity(e);
new Effect.Opacity(e,{duration:0.2,from:e._opacity,to:0.7})
},reverteffect:function(k,o,p,l,n,f,g,r,q){var e=k.style;
e.width=p+"px";
e.height=n+"px";
e.left=g+"px";
e.top=q+"px"
},endeffect:function(f){var e=typeof f._opacity=="number"?f._opacity:1;
new Effect.Opacity(f,{duration:0.2,from:0.7,to:e})
},resizeeffect:function(f,k,e,n,l){var g=f.style;
g.width=k;
g.height=e;
g.left=n;
g.top=l
},zindex:1000,revert:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,minSize:[0,0],maxSize:false,edgeWidth:20,constraint:false},arguments[1]||{});
this.element=$(b);
this.originalCursor=this.element.style.cursor;
if(a.handle&&(typeof a.handle=="string")){var c=Element.childrenWithClassName(this.element,a.handle,true);
if(c.length>0){this.handle=c[0]
}}if(!this.handle){this.handle=$(a.handle)
}if(!this.handle){this.handle=this.element
}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll)
}Element.makePositioned(this.element);
this.options=a;
this.resizing=false;
this.eventMouseDown=this.initResize.bindAsEventListener(this);
Event.observe(this.handle,"mousedown",this.eventMouseDown);
this.eventMouseMove=this.setCursor.bindAsEventListener(this);
Event.observe(this.handle,"mousemove",this.eventMouseMove);
this.eventMouseOut=this.unsetCursor.bindAsEventListener(this);
Event.observe(this.handle,"mouseout",this.eventMouseOut);
Resizables.register(this)
},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);
Event.stopObserving(this.handle,"mousemove",this.eventMouseMove);
Resizables.unregister(this)
},getCurrentLT:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])
},getCurrentWH:function(){return([parseInt(Element.getStyle(this.element,"width")||this.element.offsetWidth||"0"),parseInt(Element.getStyle(this.element,"height")||this.element.offsetHeight)||"0"])
},setCursor:function(e){var c=this.element.style;
var a=[Event.pointerX(e),Event.pointerY(e)];
var b=this.findDirection(a);
if(b==""){this.unsetCursor(e)
}else{this.element.style.cursor=b+"-resize"
}},unsetCursor:function(a){this.element.style.cursor=this.originalCursor
},findDirection:function(a){Position.prepare();
if(Position.withinIncludingScrolloffsets(this.element,a[0],a[1])){var c=[Position.overlap("horizontal",this.element),Position.overlap("vertical",this.element)];
var b=this.getCurrentWH();
c=[0,1].map(function(f){return(c[f]*b[f])
});
var e="";
if(((!this.options.constraint)||(this.options.constraint.indexOf("n")>=0))&&b[1]-this.options.edgeWidth<=c[1]){e+="n"
}else{if(((!this.options.constraint)||(this.options.constraint.indexOf("s")>=0))&&c[1]<=this.options.edgeWidth){e+="s"
}}if(((!this.options.constraint)||(this.options.constraint.indexOf("w")>=0))&&b[0]-this.options.edgeWidth<=c[0]){e+="w"
}else{if(((!this.options.constraint)||(this.options.constraint.indexOf("e")>=0))&&c[0]<=this.options.edgeWidth){e+="e"
}}return e
}else{return""
}},initResize:function(b){if(Event.isLeftClick(b)){var c=Event.element(b);
if(c.tagName&&(c.tagName=="INPUT"||c.tagName=="SELECT"||c.tagName=="OPTION"||c.tagName=="BUTTON"||c.tagName=="TEXTAREA")){return
}var a=[Event.pointerX(b),Event.pointerY(b)];
this.originalLT=this.getCurrentLT();
this.originalWH=this.getCurrentWH();
this.currentDirection=this.findDirection(a);
if(!this.currentDirection){return
}if(this.element._revert){this.element._revert.cancel();
this.element._revert=null
}this.startPoint=a;
this.startLT=this.getCurrentLT();
this.startWH=this.getCurrentWH();
Resizables.activate(this);
Event.stop(b)
}},startResize:function(b){this.resizing=true;
if(Element.getStyle(this.element,"position")==""){style.position="relative"
}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);
this.element.style.zIndex=this.options.zindex
}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);
this.originalScrollLeft=a.left;
this.originalScrollTop=a.top
}else{this.originalScrollLeft=this.options.scroll.scrollLeft;
this.originalScrollTop=this.options.scroll.scrollTop
}}Resizables.notify("onStart",this,b);
if(this.options.starteffect){this.options.starteffect(this.element)
}},updateResize:function(event,pointer){if(!this.resizing){this.startResize(event)
}Position.prepare();
Resizables.notify("onResize",this,event);
this.draw(pointer);
if(this.options.scroll){this.stopScrolling();
var p;
if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]
}}else{p=Position.page(this.options.scroll);
p[0]+=this.options.scroll.scrollLeft;
p[1]+=this.options.scroll.scrollTop;
p.push(p[0]+this.options.scroll.offsetWidth);
p.push(p[1]+this.options.scroll.offsetHeight)
}var speed=[0,0];
if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)
}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)
}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)
}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)
}this.startScrolling(speed)
}if(navigator.appVersion.indexOf("AppleWebKit")>0){window.scrollBy(0,0)
}if(this.options.change){this.options.change(this)
}Event.stop(event)
},finishResize:function(e,f){this.resizing=false;
Resizables.notify("onEnd",this,e);
var c=this.options.revert;
if(c&&typeof c=="function"){c=c(this.element)
}var b=this.getCurrentWH();
var a=this.getCurrentLT();
if(c&&this.options.reverteffect){this.options.reverteffect(this.element,b[0],this.originalWH[0],b[1],this.originalWH[1],a[0],this.originalLT[0],a[1],this.originalLT[1])
}else{this.originalWH=b;
this.originalLT=a
}if(this.options.zindex){this.element.style.zIndex=this.originalZ
}if(this.options.endeffect){this.options.endeffect(this.element)
}Resizables.deactivate(this)
},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return
}this.finishResize(a,false);
Event.stop(a)
},endResize:function(a){if(!this.resizing){return
}this.stopScrolling();
this.finishResize(a,true);
this.currentResizeDir="";
Event.stop(a)
},draw:function(a){var g=[0,1].map(function(k){return(a[k]-this.startPoint[k])
}.bind(this));
if(this.options.scroll&&(this.options.scroll!=window)){g[0]+=this.options.scroll.scrollLeft-this.originalScrollLeft;
g[1]+=this.options.scroll.scrollTop-this.originalScrollTop
}var f=[this.startLT[0],this.startLT[1],this.startLT[0]+this.startWH[0],this.startLT[1]+this.startWH[1]];
var e=[0,1,2,3].map(function(k){return(f[k]+((this.currentDirection.indexOf(["w","n","e","s"][k])>=0)?g[k%2]:0))
}.bind(this));
if(this.options.snap){if(typeof this.options.snap=="function"){e=this.options.snap(e,this)
}else{if(this.options.snap instanceof Array){e=e.map(function(k,l){return((this.currentDirection.indexOf(["w","n","e","s"][l])>=0)?Math.round(k/this.options.snap[l%2])*this.options.snap[l%2]:k)
}.bind(this))
}else{e=e.map(function(k,l){return((this.currentDirection.indexOf(["w","n","e","s"][l])>=0)?Math.round(k/this.options.snap)*this.options.snap:k)
}.bind(this))
}}}[0,1].each(function(k){var l=e[k+2]-e[k];
if(this.options.maxSize&&(l>this.options.maxSize[k])){if(this.currentDirection.indexOf(["w","n"][k])>=0){e[k]+=l-this.options.maxSize[k]
}else{e[k+2]-=l-this.options.maxSize[k]
}}if(this.options.minSize&&(l<this.options.minSize[k])){if(this.currentDirection.indexOf(["w","n"][k])>=0){e[k]+=l-this.options.minSize[k]
}else{e[k+2]-=l-this.options.minSize[k]
}}}.bind(this));
e=[0,1,2,3].map(function(k){return((this.currentDirection.indexOf(["w","n","e","s"][k])>=0)?e[k]:f[k])
}.bind(this));
var c=e[2]-e[0];
var b=e[3]-e[1];
this.options.resizeeffect(this.element,c+"px",b+"px",e[0]+"px",e[1]+"px");
if(this.element.style.visibility=="hidden"){this.element.style.visibility=""
}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);
this.scrollInterval=null;
Resizables._lastScrollPointer=null
}},startScrolling:function(a){this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];
this.lastScrolled=new Date();
this.scrollInterval=setInterval(this.scroll.bind(this),10)
},scroll:function(){var current=new Date();
var delta=current-this.lastScrolled;
this.lastScrolled=current;
if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;
this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])
}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;
this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000
}Position.prepare();
Resizables.notify("onResize",this);
this.draw(Resizables._lastPointer);
if(this.options.change){this.options.change(this)
}},_getWindowScroll:function(w){var T,L,W,H;
with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;
L=documentElement.scrollLeft
}else{if(w.document.body){T=body.scrollTop;
L=body.scrollLeft
}}if(w.innerWidth){W=w.innerWidth;
H=w.innerHeight
}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;
H=documentElement.clientHeight
}else{W=body.offsetWidth;
H=body.offsetHeight
}}}return{top:T,left:L,width:W,height:H}
}};
var EmailOwnerForm=Class.create();
EmailOwnerForm.emailOwnerUrl="/sitebuilder2/api/ajax/emailOwner.htm";
EmailOwnerForm.pageUrlPath=null;
EmailOwnerForm.isLoaded=false;
EmailOwnerForm.spinnerImg='<img src="/static_war/images/tab-spinner.gif" align="middle" title="Please wait, loading">';
EmailOwnerForm.isInitialised=false;
EmailOwnerForm.isFrom403=false;
EmailOwnerForm.position="above";
EmailOwnerForm.init=function(a){if(!EmailOwnerForm.isInitialised){EmailOwnerForm.isInitialised=true;
EmailOwnerForm.pageUrlPath=a;
EmailOwnerForm.reposition();
new Draggable("emailOwnerDiv",{handle:"emailOwnerDivInner"});
new Resizable("emailOwnerDiv",{minSize:[400,200],change:EmailOwnerForm.resizeMessageBox})
}};
EmailOwnerForm.show=function(){Element.show("emailOwnerDiv");
EmailOwnerForm.reposition();
if(!EmailOwnerForm.isLoaded){var a=EmailOwnerForm.emailOwnerUrl;
var b="page="+EmailOwnerForm.pageUrlPath+"&seed="+(new Date().getTime());
new Ajax.Updater("emailOwnerDivContent",a,{method:"get",parameters:b,onComplete:function(c){EmailOwnerForm.reposition();
EmailOwnerForm.decorateForm()
},onSuccess:function(c){EmailOwnerForm.isLoaded=true
},onFailure:EmailOwnerForm.reportError,onLoading:EmailOwnerForm.showLoading})
}};
EmailOwnerForm.reposition=function(){var b=$("emailOwnerDiv");
var a=Element.getHeight(b);
var f=Position.cumulativeOffset($("emailOwnerLink"));
var e=f[1];
if(EmailOwnerForm.position=="above"){e-=a
}if(e<0){e=0
}var c=f[0];
if(c<0){c=0
}b.style.top=e+"px";
b.style.left=c+"px"
};
EmailOwnerForm.hide=function(){Element.hide("emailOwnerDiv")
};
EmailOwnerForm.post=function(){var a=EmailOwnerForm.emailOwnerUrl;
var b=WForm.postEncode("emailOwnerForm");
b+="&from403="+(EmailOwnerForm.isFrom403?"true":"false");
$("pageOwnerSubmit").disabled=true;
$("pageOwnerCancel").disabled=true;
new Ajax.Updater("emailOwnerDivContent",a,{method:"post",parameters:b,onComplete:function(){EmailOwnerForm.resizeMessageBox();
EmailOwnerForm.reposition();
EmailOwnerForm.decorateForm()
},onFailure:EmailOwnerForm.reportError})
};
EmailOwnerForm.decorateForm=function(){var a=$("pageOwnerCancel");
var b=document.createElement("input");
b.type="button";
Event.observe(b,"click",function(c){EmailOwnerForm.hide();
Event.stop(c)
});
b.value=a.innerHTML;
a.parentNode.appendChild(b);
a.parentNode.removeChild(a);
b.setAttribute("id","pageOwnerCancel");
Event.observe("pageOwnerSubmit","click",function(c){EmailOwnerForm.post();
Event.stop(c)
})
};
EmailOwnerForm.reportError=function(a){EmailOwnerForm.isLoaded=false;
Element.update("emailOwnerDivContent",'<p>There was a problem loading the email user form.</p><p><a href="#" onclick="showEmailOwnerForm()">Retry</a></p>')
};
EmailOwnerForm.showLoading=function(a){if(!EmailOwnerForm.isLoaded){Element.update("emailOwnerDivContent","<p>Loading... please wait "+EmailOwnerForm.spinnerImg+"</p>")
}};
EmailOwnerForm.resizeMessageBox=function(){var a=Element.getStyle($("emailOwnerDiv"),"height");
a=a.substring(0,a.indexOf("px"));
if(document.getElementById("message")){Element.setStyle($("message"),{height:(a-140)+"px"})
}};
Event.onDOMReady(function(){var a=$("emailOwnerLink");
if(a){Event.observe(a,"click",function(f){var b=SitebuilderInfo.url;
if(!b){var c=(""+a.href).match(/page=(.+)(\b|&)/);
b=unescape(c[1])
}EmailOwnerForm.init(b);
EmailOwnerForm.show();
Event.stop(f)
})
}});
nextListItem=function(b){var a=b.nextSibling;
if(!a){return null
}else{if(a.tagName=="LI"&&findLink(a)){return a
}else{return nextListItem(a)
}}};
previousListItem=function(b){var a=b.previousSibling;
if(!a){return null
}else{if(a.tagName=="LI"&&findLink(a)){return a
}else{return previousListItem(a)
}}};
findLink=function(a){var b=a.getElementsByTagName("A");
if(b.length>0){return b[0]
}else{return null
}};
getListItems=function(c){var a=new Array();
var b=c.firstChild;
while(b){if(b.tagName=="LI"){a.push(b)
}b=b.nextSibling
}return a
};
function EditMenu(c,a){this.id=c;
this.listId=a;
this.currentSelection=null;
this.isVisible=false;
this.closeTimer=null;
Event.observe(this.id,"mouseover",function(f){this.open();
clearTimeout(this.closeTimer);
this.closeTimer=null
}.bind(this));
Event.observe(this.listId,"mouseover",function(f){if(this.closeTimer){clearTimeout(this.closeTimer);
this.closeTimer=null
}}.bind(this));
var b=function(f){if(!this.closeTimer){this.closeTimer=setTimeout(function(){this.close()
}.bind(this),500)
}}.bind(this);
Event.observe(this.id,"mouseout",b);
Event.observe(this.listId,"mouseout",b)
}EditMenu.prototype={moveDown:function(){if(!this.currentSelection){this.selectFirst()
}else{var a=nextListItem(this.currentSelection);
if(a){this.currentSelection=a
}}this.highlightSelection();
this.focusCurrentLink()
},moveUp:function(){if(!this.currentSelection){this.selectLast()
}else{var a=previousListItem(this.currentSelection);
if(a){this.currentSelection=a
}}this.highlightSelection();
this.focusCurrentLink()
},activate:function(){if(!this.currentSelection){return
}this.close()
},open:function(){Element.addClassName(this.id,"sfhover");
Element.addClassName(this.listId,"sfhover");
this.isVisible=true;
this.highlightSelection()
},close:function(){Element.removeClassName(this.id,"sfhover");
Element.removeClassName(this.listId,"sfhover");
this.isVisible=false;
this.currentSelection=null
},selectFirst:function(){var a=document.getElementById(this.listId);
next=a.firstChild;
if(next.tagName!="LI"){next=nextListItem(next)
}this.currentSelection=next
},selectLast:function(){var a=document.getElementById(this.listId);
last=a.lastChild;
if(last.tagName!="LI"){last=previousListItem(last)
}this.currentSelection=last
},highlightSelection:function(){var a=getListItems($(this.listId),true);
for(i=0;
i<a.length;
i++){Element.removeClassName(findLink(a[i]),"hover")
}if(this.currentSelection){Element.addClassName(findLink(this.currentSelection),"hover")
}},focusCurrentLink:function(){if(this.currentSelection){var a=findLink(this.currentSelection);
a.focus()
}}};
if(typeof FlashObject=="undefined"){FlashObject=function(e,g,a,c,b,f){this.swf=e;
this.id=g;
this.width=a;
this.height=c;
this.version=7;
this.align=f;
this.redirect="";
this.sq=document.location.search.split("?")[1]||"";
this.altTxt;
this.bypassTxt="<p>Already have Flash Player? <a href='?detectflash=false&"+this.sq+"'>Click here if you have Flash Player "+this.version+" installed</a>.</p>";
this.params=new Object();
this.variables=new Object();
this.addParam("quality","high");
this.doDetect="false";
this.embedType=b||"flash";
this.addParam("AutoStart","true");
this.addParam("WindowLess","false");
this.addParam("VideoBorderWidth","0");
this.addParam("VideoBorderColor","ffffff");
this.addParam("ShowControls","true")
};
FlashObject.prototype.addParam=function(a,b){this.params[a]=b
};
FlashObject.prototype.getParams=function(){return this.params
};
FlashObject.prototype.getParam=function(a){return this.params[a]
};
FlashObject.prototype.addVariable=function(a,b){this.variables[a]=b
};
FlashObject.prototype.getVariable=function(a){return this.variables[a]
};
FlashObject.prototype.getVariables=function(){return this.variables
};
FlashObject.prototype.getParamTags=function(){var a="";
for(var b in this.getParams()){a+='<param name="'+b+'" value="'+this.getParam(b)+'" />'
}if(a==""){a=null
}return a
};
FlashObject.prototype.getHTML=function(){if(this.embedType=="slideShow"){imageDir=this.getParam("imageDir");
url="http://www2.warwick.ac.uk/sitebuilder2/render/tocImages.xml?sbrPage="+imageDir+"&showGallery=off&rn="+new Date().getTime();
this.addVariable("xmlPath",unescape(url))
}var a="";
if(window.ActiveXObject&&navigator.userAgent.indexOf("Mac")==-1){if(this.embedType=="flash"||this.embedType=="slideShow"){a+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+this.width+'" height="'+this.height+'" id="'+this.id+'">';
a+='<param name="allowScriptAccess" value="sameDomain" />';
a+='<param name="movie" value="'+this.swf+'" />';
a+='<param name="quality" value="high" />';
if(this.getParamTags()!=null){a+=this.getParamTags()
}if(this.getVariablePairs()!=null){a+='<param name="flashVars" value="'+this.getVariablePairs()+'" />'
}a+="</object>"
}else{if(this.embedType=="mediaplayer"){a=this.getMplayerCode()
}else{a+="<p>embed type "+this.embedType+" not recognised!</p>"
}}}else{if(this.embedType=="flash"||this.embedType=="slideShow"){a+='<embed allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+this.swf+'" width="'+this.width+'" height="'+this.height+'" id="'+this.id+'" name="'+this.id+'"';
for(var b in this.getParams()){a+=" "+b+'="'+this.getParam(b)+'"'
}if(this.getVariablePairs()!=null){a+=' flashVars="'+this.getVariablePairs()+'"'
}a+="></embed>"
}else{if(this.embedType=="mediaplayer"){a=this.getMplayerCode()
}else{a+="<p>embed type "+this.embedType+" not recognised!</p>"
}}}if(this.align){a='<div align="'+this.align+'">'+a+"</div>"
}else{a="<div>"+a+"</div>"
}return a
};
FlashObject.prototype.getMplayerCode=function(){var a='<object id="'+this.id+'" ';
a+='width="'+this.width+'" ';
a+='height="'+this.height+'" ';
a+='vspace="0" standby="Loading Microsoft&amp;#65533;Windows&amp;#65533; Media Player components..." ';
a+='codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ';
a+='classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ';
a+='type="application/x-oleobject" ';
a+='hspace="0"> ';
a+='<param name="Filename" value="'+this.swf+'" /> ';
for(var b in this.getParams()){a+='<param name="'+b+'" value="'+this.getParam(b)+' ">'
}a+='<embed name="'+this.id+'" ';
a+='type="application/x-mplayer2" ';
a+='pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" ';
a+="width="+this.width+" ";
a+="height="+this.height+" ";
a+='hspace="0" vspace="0" ';
a+='filename="'+this.swf+'" ';
for(var b in this.getParams()){value=this.getParam(b);
if(value=="true"||value=="false"){a+=b+"="+(value=="true"?"1":"0")+" "
}else{a+=b+"="+value+" "
}}a+="</embed></object>";
return a
};
FlashObject.prototype.getVariablePairs=function(){var b=new Array();
for(var a in this.getVariables()){b.push(a+"="+escape(this.getVariable(a)))
}if(b.length>0){return b.join("&")
}else{return null
}};
FlashObject.prototype.write=function(a){if(detectFlash(this.version)||this.doDetect=="false"){if(a){document.getElementById(a).innerHTML=this.getHTML()
}else{document.write(this.getHTML())
}}else{if(this.redirect!=""){document.location.replace(this.redirect)
}else{if(this.altTxt){if(a){document.getElementById(a).innerHTML=this.altTxt+""+this.bypassTxt
}else{document.write(this.altTxt+""+this.bypassTxt)
}}}}}
}function getFlashVersion(){var c=0;
if(navigator.plugins&&navigator.plugins.length){var a=navigator.plugins["Shockwave Flash"];
if(a){if(a.description){var e=a.description;
c=e.charAt(e.indexOf(".")-1)
}}}else{result=false;
for(var b=15;
b>=3&&result!=true;
b--){execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+b+'"))',"VBScript");
c=b
}}return c
}function detectFlash(a){if(getFlashVersion()>=a){return true
}else{return false
}}function getQueryParamValue(c){var b=document.location.search;
var e=b.indexOf(c);
var a=(b.indexOf("&",e)!=-1)?b.indexOf("&",e):b.length;
if(b.length>1&&e!=-1){return b.substring(b.indexOf("=",e)+1,a)
}else{return""
}}if(Array.prototype.push==null){Array.prototype.push=function(a){this[this.length]=a;
return this.length
}
}if(String.prototype.toAbsoluteUrl==null){String.prototype.toAbsoluteUrl=function(){var b=this;
if(b.indexOf(":")<0){var c=""+window.location.href;
var a=document.getElementsByTagName("base");
if(a.length>0){c=a[0].href
}if(b.startsWith("//www2")){b=c.substring(0,c.indexOf(":")+1)+b
}else{if(b.indexOf("/")===0){b=b.substring(1);
c=c.substring(0,c.indexOf("/",7))
}if(c.charAt(c.length-1)!="/"){c+="/"
}b=c+b
}}return b
}
}if(typeof FlashVersionDetector=="undefined"){var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;
var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;
var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;
var FlashVersionDetector={getActiveXControlVersion:function(){var a;
var b;
var c;
try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
a=b.GetVariable("$version")
}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
a="WIN 6,0,21,0";
b.AllowScriptAccess="always";
a=b.GetVariable("$version")
}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
a=b.GetVariable("$version")
}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
a="WIN 3,0,18,0"
}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
a="WIN 2,0,0,11"
}catch(c){a=-1
}}return a
},getVersion:function(){var k=-1;
if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var g=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";
var a=navigator.plugins["Shockwave Flash"+g].description;
var f=a.split(" ");
var c=f[2].split(".");
var l=c[0];
var b=c[1];
var e=f[3];
if(e==""){e=f[4]
}if(e[0]=="d"){e=e.substring(1)
}else{if(e[0]=="r"){e=e.substring(1);
if(e.indexOf("d")>0){e=e.substring(0,e.indexOf("d"))
}}}var k=l+"."+b+"."+e
}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){k=4
}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){k=3
}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){k=2
}else{if(isIE&&isWin&&!isOpera){k=FlashVersionDetector.getActiveXControlVersion()
}}}}}return k
},isClientHasVersionString:function(a){versionArray=a.replace(/,/g,".").split(".");
if(versionArray.length==3){return FlashVersionDetector.isClientHasVersion(versionArray[0],versionArray[1],versionArray[2])
}else{if(versionArray.length==4){return FlashVersionDetector.isClientHasVersion(versionArray[0],versionArray[1],versionArray[3])
}else{return false
}}},isClientHasVersion:function(g,e,c){versionStr=FlashVersionDetector.getVersion();
if(versionStr==-1){return false
}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");
tempString=tempArray[1];
versionArray=tempString.split(",")
}else{versionArray=versionStr.split(".")
}var f=versionArray[0];
var a=versionArray[1];
var b=versionArray[2];
if(f>parseFloat(g)){return true
}else{if(f==parseFloat(g)){if(a>parseFloat(e)){return true
}else{if(a==parseFloat(e)){if(b>=parseFloat(c)){return true
}}}}}return false
}}}}
}if(typeof WPopupBox=="undefined"){var jsLoadImage=function(b){var a=new Image();
a.src=b;
return a
};
var ie_lt7=/MSIE ((5\.5)|6)/.test(navigator.userAgent)&&navigator.platform=="Win32";
var WPopupBox=function(g,z){if(!g){g={images:{tl:jsLoadImage("/static_war/popup/tl.png"),tr:jsLoadImage("/static_war/popup/tr.png"),bl:jsLoadImage("/static_war/popup/bl.png"),br:jsLoadImage("/static_war/popup/br.png"),t:jsLoadImage("/static_war/popup/t.png"),r:jsLoadImage("/static_war/popup/r.png"),b:jsLoadImage("/static_war/popup/b.png"),l:jsLoadImage("/static_war/popup/l.png"),c:jsLoadImage("/static_war/popup/c.png"),topArr:jsLoadImage("/static_war/popup/toparr.png"),bottArr:jsLoadImage("/static_war/popup/bottarr.png"),leftArr:jsLoadImage("/static_war/popup/leftarr.png"),rightArr:jsLoadImage("/static_war/popup/rightarr.png"),transparent:jsLoadImage("/static_war/popup/shim.gif")},margin:[10,14,20,16],padding:[20,24,0,24],topArr:[38,18],bottArr:[37,20],leftArr:[19,39],rightArr:[20,39]}
}this.config=g;
z=z||{};
this.initialised=false;
this.glassElement=document.createElement("div");
this.glassElement.className="WPopupGlass";
this.width=null;
this.height=null;
this.x=null;
this.y=null;
this.inelastic=z.inelastic;
this.topArrowOn=false;
this.bottomArrowOn=false;
this.leftArrowOn=false;
this.rightArrowOn=false;
this.imageElements={};
this.imageElements.c=document.createElement("img");
this.imageElements.c.className="c";
this._setImage(this.imageElements.c,g.images.c.src);
var k=g.margin;
var q=k[0];
var o=k[1];
var f=k[2];
var p=k[3];
this.extraHeight=q+f+g.padding[0]+g.padding[2];
var n=this.imageElements;
var c=this.glassElement;
n.tl=this._makeDiv("tl alpha",g.images.tl,p,q);
n.tr=this._makeDiv("tr alpha",g.images.tr,o,q);
n.bl=this._makeDiv("bl alpha",g.images.bl,p,f);
n.br=this._makeDiv("br alpha",g.images.br,o,f);
n.t=this._makeEdge("t alpha",g.images.t,p,q);
n.r=this._makeEdge("r alpha",g.images.r,o,q);
n.b=this._makeEdge("b alpha",g.images.b,o,f);
n.l=this._makeEdge("l alpha",g.images.l,p,f);
n.ta=this._makeDiv("tArr alpha",g.images.topArr,g.topArr[0],g.topArr[1]);
n.ba=this._makeDiv("bArr alpha",g.images.bottArr,g.bottArr[0],g.bottArr[1]);
n.la=this._makeDiv("lArr alpha",g.images.leftArr,g.leftArr[0],g.leftArr[1]);
n.ra=this._makeDiv("rArr alpha",g.images.rightArr,g.rightArr[0],g.rightArr[1]);
var w=[n.ta,n.ba,n.la,n.ra];
for(var l=0;
l<w.length;
l++){var u=w[l];
u.style.display="none";
u.style.position="relative"
}var t=[n.tl,n.tr,n.bl,n.br,n.t,n.r,n.b,n.l,n.c,n.ta,n.ba,n.la,n.ra];
for(var l=0;
l<t.length;
l++){var u=t[l];
c.appendChild(u)
}n.t.style.left=this.config.margin[3]+"px";
n.b.style.left=this.config.margin[3]+"px";
n.c.style.left=this.config.margin[3]+"px";
n.l.style.top=this.config.margin[0]+"px";
n.r.style.top=this.config.margin[0]+"px";
n.c.style.top=this.config.margin[0]+"px";
this.contentElement=document.createElement("div");
this.contentElement.className="WPopupBoxContent";
var s=z.element;
if(s){this.rootElement=s;
this.setContentFromElement(s)
}else{this.rootElement=document.createElement("div")
}this.rootElement.className="WPopupBox";
this.hide();
this.rootElement.appendChild(this.glassElement);
this.rootElement.appendChild(this.contentElement);
if(!s){document.body.appendChild(this.rootElement)
}if(z.width){if(z.height){this.setSize(z.width,z.height)
}else{this.setSize(z.width,350);
this.setHeightToFit()
}}else{if(s){this.setSize(450,350);
this.setHeightToFit()
}else{this.setSize(450,350)
}}if(z.x&&z.y){this.setPosition(z.x,z.y)
}var e=this;
addEvent(document,"keydown",function(b){var a=(window.event)?window.event:b;
if(a.keyCode==27){cancelDefaultEvents(a);
e.hide()
}});
this.initialised=true
};
WPopupBox.prototype.setPosition=function(l,f){this.x=l;
this.y=f;
if(this.topArrowOn){f+=this.imageElements.ta.clientHeight
}if(this.leftArrowOn){l+=this.imageElements.la.clientWidth
}function o(){var r=[0,0];
if(typeof window.innerWidth!="undefined"){r=[window.innerWidth,window.innerHeight]
}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!=0){r=[document.documentElement.clientWidth,document.documentElement.clientHeight]
}else{r=[document.getElementsByTagName("body")[0].clientWidth,document.getElementsByTagName("body")[0].clientHeight]
}}return r
}function g(){var r=[0,0];
if(typeof window.pageYOffset!="undefined"){r=[window.pageXOffset,window.pageYOffset]
}else{if(typeof document.documentElement.scrollTop!="undefined"&&document.documentElement.scrollTop>0){r=[document.documentElement.scrollLeft,document.documentElement.scrollTop]
}else{if(typeof document.body.scrollTop!="undefined"){r=[document.body.scrollLeft,document.body.scrollTop]
}}}return r
}var e=o();
var k=g();
var b=e[1]+k[1]-20;
var c=e[0]+k[0]-20;
var p=l+this.width;
var a=f+this.height;
if(p>c){l=c-this.width
}if(l<0){l=0
}if((a-b)>this.height){f-=this.height
}if(f<0){f=0
}this.rootElement.style.left=l+"px";
this.rootElement.style.top=f+"px";
this.contentElement.style.left=(this.config.padding[3])+"px";
this.contentElement.style.top=(this.config.padding[0])+"px";
var n=this.imageElements.ta;
n.style.left=(this.width/2-n.clientWidth/2)+"px";
n.style.bottom="10px";
var q=this.imageElements.la.style;
q.top=(this.height/2-this.imageElements.la.clientHeight/2)+"px";
q.marginLeft="-5px";
q.marginTop="-"+Math.floor(this.config.leftArr[1]/2)+"px";
q=this.imageElements.ba.style;
q.left=((this.width-this.imageElements.ba.clientWidth)/2)+"px";
q.top=this.height+"px";
q.marginTop="-18px"
};
WPopupBox.prototype.setSize=function(a,b){this.width=a;
this.height=b;
this.glassElement.style.width=a+"px";
this.glassElement.style.height=b+"px";
this.contentElement.style.width=(a-this.config.padding[3]-this.config.padding[1])+"px";
if(this.inelastic){this.contentElement.style.height=(this.height-this.extraHeight)+"px";
this.contentElement.style.overflow="auto"
}this._repositionEdges()
};
WPopupBox.prototype.setHeightToFit=function(){if(!this.inelastic){if(this.everShown){var a=this.contentElement.clientHeight;
this.setSize(this.width,a+this.extraHeight)
}else{this.delayedSetHeight=true
}}};
WPopupBox.prototype.hide=function(){this.rootElement.style.display="none";
WPopupBox.showSelectBoxes()
};
WPopupBox.prototype.show=function(){this.rootElement.style.display="block";
if(!this.everShown){this.everShown=true;
this.setSize(this.width,this.height);
if(this.delayedSetHeight){this.setHeightToFit()
}}WPopupBox.hideSelectBoxes()
};
WPopupBox.prototype.toggle=function(){if(this.rootElement.style.display=="block"){this.hide()
}else{this.show()
}};
WPopupBox.prototype.isShowing=function(){return this.rootElement.style.display=="block"
};
WPopupBox.prototype.setContent=function(a){this.contentElement.innerHTML=a;
this._afterContentSet()
};
WPopupBox.prototype.showUrl=function(b,a){a=a||{};
var c=function(f){document.body.style.cursor="auto";
this.show();
this.setContent(f.responseText);
if(setupSubmitDisabling){setupSubmitDisabling()
}if(a.target){var e=a.target;
if(a.position=="right"){this.positionRight(e)
}else{this.positionBelow(e)
}}};
document.body.style.cursor="progress";
if(a.params){new Ajax.Request(b,{method:"post",onComplete:c.bind(this),parameters:a.params})
}else{new Ajax.Request(b,{method:"post",onComplete:c.bind(this)})
}};
WPopupBox.prototype.setContentElement=function(a){this.contentElement.innerHTML="";
this.contentElement.appendChild(a);
this._afterContentSet()
};
WPopupBox.prototype.setContentFromElement=function(a){this.contentElement.innerHTML="";
while(a.firstChild){this.contentElement.appendChild(a.firstChild)
}this._afterContentSet()
};
WPopupBox.prototype._afterContentSet=function(){this.closeButton=document.createElement("a");
this.closeButton.setAttribute("style","cursor:pointer;cursor:hand;");
this.closeButton.onclick=(function(){this.hide();
return false
}).bind(this);
closeImg=document.createElement("img");
closeImg.src="/static_war/popup/close.png";
closeImg.title="Close this popup";
closeImg.border=0;
this.closeButton.className="WPopupCloseButton";
this.closeButton.appendChild(closeImg);
this.glassElement.insertBefore(this.closeButton,this.glassElement.firstChild);
if(this.initialised){this.setHeightToFit()
}};
WPopupBox.prototype._repositionEdges=function(){var a=(this.width-this.config.margin[3]-this.config.margin[1])+"px";
var c=(this.height-this.config.margin[0]-this.config.margin[2])+"px";
var b=this.imageElements;
b.t.style.width=a;
b.b.style.width=a;
b.l.style.height=c;
b.r.style.height=c;
b.c.style.width=a;
b.c.style.height=c
};
WPopupBox.prototype._setImage=function(a,b){var c=c;
if(c){a.src=this.config.images.transparent.src;
a.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"',sizingMethod='scale')"
}else{a.src=b
}};
WPopupBox.prototype._setDivBg=function(c,a){var b=b;
if(b){c.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a+"',sizingMethod='image')"
}else{this._setDivBgNoHack(c,a)
}};
WPopupBox.prototype._setDivBgNoHack=function(b,a){if(!ie_lt7){b.style.backgroundImage="url("+a+")";
b.style.backgroundPosition="top left";
b.style.backgroundRepeat="no-repeat"
}};
WPopupBox.prototype._makeDiv=function(b,f,e,a){var c=document.createElement("div");
c.className=b;
this._setDivBg(c,f.src);
c.style.width=e+"px";
c.style.height=a+"px";
return c
};
WPopupBox.prototype._makeEdge=function(b,f,e,a){var c=document.createElement("img");
this._setImage(c,f.src);
c.className=b;
c.style.width=e+"px";
c.style.height=a+"px";
return c
};
WPopupBox.prototype.setTopArrow=function(){this.imageElements.ta.style.display="block";
this.topArrowOn=true
};
WPopupBox.prototype.setBottomArrow=function(){this.imageElements.ba.style.display="block";
this.bottomArrowOn=true
};
WPopupBox.prototype.setLeftArrow=function(){this.imageElements.la.style.display="block";
this.leftArrowOn=true
};
WPopupBox.prototype.setRightArrow=function(){this.imageElements.ra.style.display="block";
this.rightArrowOn=true
};
WPopupBox.prototype.removeArrows=function(){this.topArrowOn=false;
this.bottomArrowOn=false;
this.leftArrowOn=false;
this.rightArrowOn=false;
this.imageElements.ra.style.display="none";
this.imageElements.la.style.display="none";
this.imageElements.ba.style.display="none";
this.imageElements.ta.style.display="none"
};
WPopupBox.prototype.positionBelow=function(b){this.removeArrows();
this.setTopArrow();
var a=this.getMidpoint(b);
this.setPosition(a.x-((this.width)/2),a.y)
};
WPopupBox.prototype._cumulativeOffset=function(b){var a=0,c=0;
if(b.parentNode){do{a+=b.offsetTop||0;
c+=b.offsetLeft||0;
b=b.offsetParent
}while(b)
}return[c,a]
};
WPopupBox.prototype._camelize=function(a){return a.replace(/-+(.)?/g,function(b,c){return c?c.toUpperCase():""
})
};
WPopupBox.prototype._getStyle=function(b,c){c=c=="float"?"cssFloat":this._camelize(c);
var e=b.style[c];
if(!e||e=="auto"){if(document.defaultView){var a=document.defaultView.getComputedStyle(b,null);
e=a?a[c]:null
}else{e=null
}}if(c=="opacity"){return e?parseFloat(e):1
}return e=="auto"?null:e
};
WPopupBox.prototype._getDimensions=function(b){var f=this._getStyle(b,"display");
if(f&&f!=="none"){return{width:b.offsetWidth,height:b.offsetHeight}
}var c=b.style;
var a={visibility:c.visibility,position:c.position,display:c.display};
b.style.visibility="hidden";
b.style.display="block";
if(a.position!=="fixed"){b.style.position="absolute"
}var e={width:b.offsetWidth,height:b.offsetHeight};
b.style.visibility=a.visibility;
b.style.display=a.display;
b.style.position=a.position;
return e
};
WPopupBox.prototype.getMidpoint=function(f){if(f&&f.x&&f.y){return f
}var k=this._cumulativeOffset(f);
var g=this._getDimensions(f);
var e=g.width;
var a=g.height;
if(this._getStyle(f,"display")=="inline"){var b=f.style;
var c=b.position;
b.position="absolute";
var l=this._getDimensions(f);
b.position=c;
if(g.width!=l.width){a=(l.height+g.height)/2;
e=(l.width+g.width)/2
}}return{x:Math.floor(k[0]+e/2),y:Math.floor(k[1]+a)}
};
WPopupBox.prototype.positionAbove=function(f){this.removeArrows();
this.setBottomArrow();
var e=this.getMidpoint(f);
var b=this._cumulativeOffset(f);
var c=this._getDimensions(f);
var a=e.x-this.width/2;
var g=e.y-this.height-this.config.bottArr[1];
if(g<0){g=0
}this.setPosition(a,g)
};
WPopupBox.prototype.positionRight=function(b,e){if(e){this.removeArrows()
}else{this.setLeftArrow()
}var f=this._cumulativeOffset(b);
var a=this._getDimensions(b);
h=this.height;
x=Math.floor(f[0]+a.width);
y=Math.floor(f[1]-h/2+a.height/2);
this.setPosition(x,y);
var c=this._cumulativeOffset(this.rootElement);
this.imageElements.la.style.top=parseInt((f[1]-c[1])+(a.height/2))+"px"
};
WPopupBox.hideSelectBoxes=function(){if(!ie_lt7){return
}var c=document.getElementsByTagName("select");
for(var b=0;
b<c.length;
b++){var a=c[b];
a.style.visibility="hidden"
}};
WPopupBox.showSelectBoxes=function(){if(!ie_lt7){return
}var c=document.getElementsByTagName("select");
for(var b=0;
b<c.length;
b++){var a=c[b];
a.style.visibility="visible"
}}
}(function(){if(!
/*@cc_on!@*/
0){return
}var e="abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(",");
for(var i=0;
i<e.length;
i++){document.createElement(e[i])
}})();
var ButtonPlayer=function(b,a){this.container=$(a);
this.basename=b.getBasename();
this.container.title=this.basename+" | Click to play";
this.container.addClassName("buttonPlayer");
var e=this.container;
this.playButton=new Element("div",{className:"play button"}).insert(new Element("div",{className:"glyph"}));
e.insert(this.playButton);
this.pauseButton=new Element("div",{className:"pause button"}).insert(new Element("div",{className:"glyph"}));
e.insert(this.pauseButton);
this.progressContainer=new Element("div",{className:"progressContainer"});
e.insert(this.progressContainer);
this.progressLoading=new Element("div",{className:"progressLoading"});
this.progress=new Element("div",{className:"progress"});
this.progressLoading.insert(this.progress);
this.progressContainer.insert(this.progressLoading);
this.stopButton=new Element("div",{className:"stop button"}).insert(new Element("div",{className:"glyph"}));
e.insert(this.stopButton);
this.pauseButton.hide();
this.audio=b;
this.duration=null;
this.executor=null;
Event.observe(this.playButton,"click",function(){this.playButton.hide();
this.pauseButton.show();
this.audio.play();
if(this.executor==null){this.executor=new PeriodicalExecuter(function(c){var g=this.audio.a;
var f=0;
if(g.buffered.length>0){f=parseInt(((g.buffered.end(0)/g.duration)*100))
}$(this.progressLoading).setStyle({width:f+"%"})
}.bind(this),0.4);
Event.observe(this.pauseButton,"click",function(){this.pauseButton.hide();
this.playButton.show();
this.audio.pause()
}.bind(this));
Event.observe(this.stopButton,"click",function(){this.pauseButton.hide();
this.playButton.show();
this.audio.stop()
}.bind(this));
this.audio.observeEnd(function(){this.pauseButton.hide();
this.playButton.show();
$(this.progress).setStyle({width:"0%"})
}.bind(this));
this.audio.observeDurationchange(function(g){this.duration=g;
if(g!=NaN&&g!=Infinity){var c=parseInt(g);
var f="";
new Array("s","m","h").each(function(k){v=c%60;
f=""+v+k+" "+f;
c=(c-v)/60;
if(c<=0){throw $break
}});
this.container.title=this.basename+" | Duration: "+f
}}.bind(this));
this.audio.observeTimeupdate(function(f){if(this.duration!=null){var c=(f*100)/this.duration;
$(this.progress).setStyle({width:c+"%"})
}}.bind(this))
}}.bind(this))
};
var LongPlayer=function(c,b){this.container=$(b);
this.container.addClassName("longPlayer");
this.added=false;
var a=new Element("div",{className:"clicktoplay"}).insert(new Element("div",{className:"playicon"}));
this.container.insert(a);
Event.observe(a,"click",function(f){a.hide();
if(!this.added){c.addSelf(this.container)
}c.a.controls=true;
c.play()
}.bindAsEventListener(this))
};
var NativeAudio=function(a){this.delayedSrc=a
};
NativeAudio.prototype.lazyInit=function(){if(!this.a){this.a=document.createElement("audio");
if(this.delayedSrc){this.a.src=this.delayedSrc;
this.delayedSrc=null
}}};
NativeAudio.prototype.play=function(){this.lazyInit();
this.a.play()
};
NativeAudio.prototype.getBasename=function(){var b=this.delayedSrc||this.a.src;
var a=b.lastIndexOf("/");
if(a>-1&&a<b.length){b=b.substring(a+1)
}return b
};
NativeAudio.prototype.pause=function(){this.lazyInit();
this.a.pause()
};
NativeAudio.prototype.stop=function(){this.a.pause();
this.a.currentTime=0
};
NativeAudio.prototype.seek=function(a){this.lazyInit();
this.a.currentTime=a
};
NativeAudio.prototype.observeTimeupdate=function(a){Event.observe(this.a,"timeupdate",function(){a(this.a.currentTime)
}.bind(this))
};
NativeAudio.prototype.observeDurationchange=function(a){Event.observe(this.a,"durationchange",function(){a(this.a.duration)
}.bind(this))
};
NativeAudio.prototype.observeEnd=function(a){Event.observe(this.a,"ended",a);
Event.observe(this.a,"timeupdate",function(b){if(this.a.currentTime==this.a.duration){a()
}}.bind(this),false)
};
NativeAudio.prototype.addSelf=function(a){this.lazyInit();
a.appendChild(this.a)
};
NativeAudio.canPlayType=function(c){var b=document.createElement("audio");
var e=navigator.userAgent;
var f=/Windows.+Safari/.match(e)&&!/Chrome/.match(e);
return !!(!f&&b.canPlayType&&b.canPlayType(c).replace(/no/,""))
};
NativeAudio.canPlayMp3=function(){return NativeAudio.canPlayType("audio/mpeg;")
};
if(typeof Glossary=="undefined"){var Glossary={APILocation:"/sitebuilder2/api/ajax/glossary.html",Popup:null,load:function(e,a,b){if(Glossary.Popup==null){Glossary.Popup=new WPopupBox()
}var c=Glossary.Popup.getMidpoint(b);
Glossary.Popup.show();
Glossary.Popup.setSize(550,100);
Glossary.Popup.setContent("<span class='loading'><img src='/static_war/images/tab-spinner.gif' title='Loading' alt='Loading'/></span>");
Glossary.Popup.positionBelow(c);
new Ajax.Request(Glossary.APILocation,{method:"get",parameters:{page:e,term:a,rn:Math.round(Math.random()*10000)},evalScripts:true,onComplete:function(f){Glossary.Popup.setContent(f.responseText);
Glossary.Popup.positionBelow(c)
}})
},loadContent:function(b,a){if(Glossary.Popup==null){Glossary.Popup=new WPopupBox()
}var c=Glossary.Popup.getMidpoint(a);
Glossary.Popup.show();
Glossary.Popup.setSize(550,100);
Glossary.Popup.setContent(b);
Glossary.Popup.positionBelow(c)
}}
}if(typeof SortableTables=="undefined"){var SortableTables={DATE_RE:/^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/,FILESIZE_RE:/^\(?([\d\.]+)\s([KM]B)\)?$/,tables:{},init:function(){if(!document.getElementsByTagName){return
}tbls=document.getElementsByTagName("table");
for(ti=0;
ti<tbls.length;
ti++){thisTbl=tbls[ti];
if((" "+thisTbl.className+" ").indexOf("sitebuilder_sortable")!=-1){if(!thisTbl.id){var a="sortableTable_"+Math.floor(Math.random()*100000);
thisTbl.id=a
}SortableTables.tables[thisTbl.id]=new SortableTable(thisTbl)
}}},registerCallback:function(a,b){SortableTables.tables[a.id].callback=b
}};
var SortableTable=function(k){this.table=k;
if(k.rows&&k.rows.length>0){var o=k.rows[0]
}if(!o){return
}var l=function(f,p){return function(){this.resort(f,p);
return false
}.bindAsEventListener(this)
}.bind(this);
for(var g=0;
g<o.cells.length;
g++){var c=o.cells[g];
if((" "+c.className+" ").indexOf("sortable")!=-1){var b=this._getInnerText(c);
var n=(c.title)?c.title:b;
c.title="Click to sort by "+n.toLowerCase();
var e=document.createElement("a");
e.href="#";
e.className="sortheader";
e.onclick=l(e,g);
e.innerHTML=b+'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span>';
c.innerHTML="";
c.appendChild(e)
}}this.callback()
};
Object.extend(SortableTable.prototype,{poundRegex:new RegExp("(\u00A3|&pound;)","g"),resort:function(k,n){var r;
for(var u=0;
u<k.childNodes.length;
u++){if(k.childNodes[u].tagName&&k.childNodes[u].tagName.toLowerCase()=="span"){r=k.childNodes[u]
}}var a=this._getInnerText(r);
var c=k.parentNode;
var e=n||c.cellIndex;
var t=this.table;
if(t.rows.length<=1){return
}var l=this._getInnerText(t.rows[1].cells[e]);
var q=this._sort_caseInsensitive;
if(l.match(/^[\d\.]+$/)){q=this._sort_numeric
}else{if(l.match(this.poundRegex)){q=this._sort_pounds
}}possdate=l.match(SortableTables.DATE_RE);
if(possdate){first=parseInt(possdate[1]);
second=parseInt(possdate[2]);
if(first>12){q=this._sort_ddmm
}else{if(second>12){q=this._sort_mmdd
}else{q=this._sort_ddmm
}}}if((" "+t.rows[0].cells[e].className+" ").indexOf("sortable_filesize")!=-1){q=this._sort_filesize
}this.sortColumn=e;
var f=new Array();
var g=new Array();
for(i=0;
i<t.rows[0].length;
i++){f[i]=t.rows[0][i]
}for(j=1;
j<t.rows.length;
j++){g[j-1]=t.rows[j]
}g.sort(q.bind(this));
var p;
if(r.getAttribute("sortdir")=="down"){p="&nbsp;&nbsp;&uarr;";
g.reverse();
r.setAttribute("sortdir","up");
k.className="sortheader sortup"
}else{p="&nbsp;&nbsp;&darr;";
r.setAttribute("sortdir","down");
k.className="sortheader sortdown"
}for(i=0;
i<g.length;
i++){if(!g[i].className||(g[i].className&&(g[i].className.indexOf("sortbottom")==-1))){t.tBodies[0].appendChild(g[i])
}}for(i=0;
i<g.length;
i++){if(g[i].className&&(g[i].className.indexOf("sortbottom")!=-1)){t.tBodies[0].appendChild(g[i])
}}var o=document.getElementsByTagName("span");
for(var u=0;
u<o.length;
u++){if(o[u].className=="sortarrow"){if(this._getParent(o[u],"table")==this._getParent(k,"table")){o[u].innerHTML="&nbsp;&nbsp;&nbsp;"
}}}var s=this._getParent(k,"tr");
var b=s.getElementsByTagName("a");
for(var u=0;
u<b.length;
u++){if(b[u]!=k){b[u].className="sortheader"
}}r.innerHTML=p;
this.callback()
},_sort_caseInsensitive:function(e,c){aa=this._getInnerText(e.cells[this.sortColumn]).toLowerCase();
bb=this._getInnerText(c.cells[this.sortColumn]).toLowerCase();
if(String.prototype.trim){aa=aa.trim();
bb=bb.trim()
}if(aa==bb){return 0
}if(aa<bb){return -1
}return 1
},_sort_default:function(e,c){aa=this._getInnerText(e.cells[this.sortColumn]);
bb=this._getInnerText(c.cells[this.sortColumn]);
if(aa==bb){return 0
}if(aa<bb){return -1
}return 1
},_sort_numeric:function(e,c){return this._doNumericSort(this._getInnerText(e.cells[this.sortColumn]),this._getInnerText(c.cells[this.sortColumn]))
},_sort_pounds:function(e,c){return this._doNumericSort(this._getInnerText(e.cells[this.sortColumn]).replace(this.poundRegex,"").replace(",",""),this._getInnerText(c.cells[this.sortColumn]).replace(this.poundRegex,"").replace(",",""))
},_sort_ddmm:function(e,c){aa=this._getInnerText(e.cells[this.sortColumn]);
bb=this._getInnerText(c.cells[this.sortColumn]);
mtch=aa.match(SortableTables.DATE_RE);
y=mtch[3];
m=mtch[2];
d=mtch[1];
if(m.length==1){m="0"+m
}if(d.length==1){d="0"+d
}dt1=y+m+d;
mtch=bb.match(SortableTables.DATE_RE);
y=mtch[3];
m=mtch[2];
d=mtch[1];
if(m.length==1){m="0"+m
}if(d.length==1){d="0"+d
}dt2=y+m+d;
if(dt1==dt2){return 0
}if(dt1<dt2){return -1
}return 1
},_sort_mmdd:function(e,c){aa=this._getInnerText(e.cells[this.sortColumn]);
bb=this._getInnerText(c.cells[this.sortColumn]);
mtch=aa.match(SortableTables.DATE_RE);
y=mtch[3];
d=mtch[2];
m=mtch[1];
if(m.length==1){m="0"+m
}if(d.length==1){d="0"+d
}dt1=y+m+d;
mtch=bb.match(SortableTables.DATE_RE);
y=mtch[3];
d=mtch[2];
m=mtch[1];
if(m.length==1){m="0"+m
}if(d.length==1){d="0"+d
}dt2=y+m+d;
if(dt1==dt2){return 0
}if(dt1<dt2){return -1
}return 1
},_sort_filesize:function(e,c){aa=this._getInnerText(e.cells[this.sortColumn]);
bb=this._getInnerText(c.cells[this.sortColumn]);
a_bytes=0;
b_bytes=0;
mtch=aa.match(SortableTables.FILESIZE_RE);
if(mtch){num=mtch[1];
units=mtch[2];
if(units=="MB"){a_bytes=num*1024*1024
}else{a_bytes=num*1024
}}mtch=bb.match(SortableTables.FILESIZE_RE);
if(mtch){num=mtch[1];
units=mtch[2];
if(units=="MB"){b_bytes=num*1024*1024
}else{b_bytes=num*1024
}}return this._doNumericSort(a_bytes,b_bytes)
},_doNumericSort:function(e,c){aa=parseFloat(e);
if(isNaN(aa)){aa=0
}bb=parseFloat(c);
if(isNaN(bb)){bb=0
}return aa-bb
},_getInnerText:function(e){if(typeof e=="string"){return e.trim()
}if(typeof e=="undefined"){return e.trim()
}if(e.innerText){return e.innerText.trim()
}var f="";
var c=e.childNodes;
var a=c.length;
for(var b=0;
b<a;
b++){switch(c[b].nodeType){case 1:f+=this._getInnerText(c[b]);
break;
case 3:f+=c[b].nodeValue;
break
}}return f.trim()
},_getParent:function(b,a){if(b==null){return null
}else{if(b.nodeType==1&&b.tagName.toLowerCase()==a.toLowerCase()){return b
}else{return this._getParent(b.parentNode,a)
}}},_zebraStripe:function(){var b=this.table;
rows=b.getElementsByTagName("tr");
var c=true;
for(var a=0;
a<rows.length;
a++){cells=rows[a].getElementsByTagName("td");
if(cells.length==0){continue
}rows[a].className=c?"odd":"even";
c=!c
}},callback:function(){this._zebraStripe()
}});
Event.onDOMReady(SortableTables.init)
}Event.onDOMReady(function(){var a=$("pageCommentsContainer");
if(a){var e=$("pageCommentsContainer").down(".commentsLink");
var b=Comments.showPageComments;
var c={};
var f=window.location.href.toQueryParams();
if(typeof f.comments!="undefined"){b="no"!=f.comments&&"false"!=f.comments&&"off"!=f.comments
}c.waitForClick=!b;
window.pageComments=Comments.fromLink(e,c)
}});
var Comments=function(c,b,a){this.url=c;
this.div=b;
this.rootList=null;
this.replyTo=null;
this.replyToId=null;
this.link=a;
this.hideDeletedComments=null;
if(!Comments.C){Comments.C={PERMA_REGEX:/^#c([0-9a-f]){16,32}$/,URL:"/sitebuilder2/api/comment"};
Comments.L={SPINNER:'<img src="/static_war/images/tab-spinner.gif" >',LOADING:" Loading comments &hellip;",LOADINGFORM:"Loading form &hellip;",DENIED_MESSAGE:"<span class='permission_denied'>You do not have permission to view these comments.</span>",FAILED_MESSAGE:"<span class='error_unknown'>Sorry, there was a problem loading comments.</span>",REPLY_HEADING:"Reply to comment"}
}};
Comments.showPageComments=false;
Comments.fromLink=function(e,a){a=a||{};
e=$(e);
var f=e.href.toQueryParams().page;
if(f){var l=a.divId||("commentsFor"+f.replace(/[^a-z0-9]+/g,"_"));
var k=document.createElement("div");
k.id=l;
var g=new Comments(f,k,e);
var b=!!((window.location.hash||"").match(Comments.C.PERMA_REGEX));
if(a.waitForClick&&!b&&e){e.observe("click",function(c){Event.stop(c);
g.open();
return false
}.bindAsEventListener(e))
}else{g.open()
}return g
}};
Comments.decorateLinks=function(){$$(".commentsLink").each(Comments.fromLink)
};
Comments.prototype={init:function(){this._loadingMessage();
new Ajax.Request(Comments.C.URL,{method:"get",parameters:this.params({page:this.url,random:this._rand()}),onSuccess:this.initDone.bind(this),onFailure:this.initFail.bind(this)})
},_rand:function(b){if(b){return parseInt(Math.random()*999999999999999)
}var a=(window.SitebuilderInfo||{}).lastUpdated||parseInt(Math.random()*999999999999999);
if(new WCookie("WarwickSSO").value){a+="U"
}return a
},params:function(a){if(typeof this.hideDeletedComments=="boolean"){a.HideDeletedComments=this.hideDeletedComments
}return a
},setHideDeletedComments:function(a){if(a!=this.hideDeletedComments){this.hideDeletedComments=a;
this.init()
}},_loadingMessage:function(){Element.update(this.div,Comments.L.SPINNER+Comments.L.LOADING);
$(this.div).fire("comments:updated")
},initDone:function(a){$(this.div).update(a.responseText);
$(this.div).fire("comments:updated",{refreshCount:true});
if((window.location.hash||"").match(Comments.C.PERMA_REGEX)){window.location.hash=window.location.hash
}this.decorateEverything();
this.initialHeading=this._getFormHolder().down("h2").innerHTML;
this.initialSubmitText=this._getFormHolder().down("input[name=postSubmit]")?this._getFormHolder().down("input[name=postSubmit]").value:null
},initFail:function(a){var b=$(this.div);
if((a.status==301||a.status==302)&&a.getResponseHeader("Location").indexOf("websignon")>-1){b.update(Comments.L.DENIED_MESSAGE)
}else{b.update(Comments.L.FAILED_MESSAGE)
}b.fire("comments:updated")
},previewClick:function(b){var a=Event.element(b);
params=$H(Form.serialize(a.up("form"),true));
if(params.unset){params.set("previewSubmit","Preview");
params.unset("postSubmit")
}else{params.previewSubmit="Preview";
params.remove("postSubmit")
}new Ajax.Request(Comments.C.URL,{method:"post",parameters:params,onSuccess:function(c){var e=c.responseText;
var f=$(this.div).down(".previewContainer");
f.update("<h2>Preview</h2>"+e);
new Effect.Highlight(f);
$(this.div).fire("comments:updated")
}.bind(this)});
Event.stop(b)
},unfollowClick:function(b){var a=Event.element(b);
params=$H(Form.serialize(a.up("form"),true));
new Ajax.Request(Comments.C.URL,{method:"post",parameters:params,onSuccess:function(c){$(this.div).update(c.responseText);
$(this.div).fire("comments:updated",{refreshCount:true});
this.decorateEverything()
}.bind(this)});
Event.stop(b)
},decorateForm:function(){if($(this.div).down("input[name=previewSubmit]")){$(this.div).down("input[name=previewSubmit]").observe("click",this.previewClick.bindAsEventListener(this))
}var b=$(this.div).down("input[name=postSubmit]");
if(b){b.enable();
b.observe("click",this.submitClick.bindAsEventListener(this))
}var a=$(this.div).down("input[name=unfollowSubmit]");
if(a){a.observe("click",this.unfollowClick.bindAsEventListener(this))
}this._reassignFormTabindex()
},resetForm:function(){var a=this._getForm();
if(a){var e=this._getFormHolder();
a.text.value="";
$(this.div).down(".previewContainer").update("");
$(this.div).fire("comments:updated");
a.postSubmit.enable();
a.select(".user_error").each(function(f){f.remove()
});
var c=a.down("input[name=commentId]");
if(c){c.remove()
}var b=e.down(".editReplyText");
if(b){b.remove()
}e.down("h2").update(this.initialHeading);
e.down("input[name=postSubmit]").value=this.initialSubmitText
}this.resetFlags()
},resetFlags:function(){this.editing=null;
this.editingId=null;
this.replyTo=null;
this.replyToId=null
},decorateListWithin:function(a){this.rootList=$(this.div).down("ul");
if($(a)){$(a).select("a.replyLink").each(function(b){var c=$(b).href.toQueryParams().replyTo;
if($(b)){$(b).observe("click",function(f,e){Event.stop(f);
if(e!=this.replyToId){this.resetForm();
this.replyTo=$("pageComment_"+e).up("li");
this.replyToId=e;
this.replyTo.appendChild(this._getFormHolder());
this._getFormHolder().down("h2").update(Comments.L.REPLY_HEADING);
$(this.div).fire("comments:updated")
}return false
}.bindAsEventListener(this,c))
}}.bind(this));
$(a).select("a.permalink").each(function(b){var c=b.href.match(/#(.+)/)[1];
if(c&&$(b)){$(b).observe("click",function(e,f){Event.stop(e);
window.location.hash=f;
return false
}.bindAsEventListener(this,c))
}}.bind(this))
}this._replaceClick(a,"a.deleteLink",true,function(f,c){var b="Are you sure you want to delete this comment? ";
var e=Event.element(f).up("li").getElementsByTagName("li").length;
if(e==1){b+=" one reply will also be deleted."
}else{if(e>1){b+=e+" replies will also be deleted."
}}if(confirm(b)){this.deleteComment(c)
}});
this._replaceClick(a,"a.approveLink",true,function(c,b){if(confirm("Are you sure you want to approve this comment?")){this.approveComment(b)
}});
this._replaceClick(a,"a.showDeletedCommentsLink",false,function(){this.setHideDeletedComments(false)
});
this._replaceClick(a,"a.hideDeletedCommentsLink",false,function(){this.setHideDeletedComments(true)
});
this._replaceClick(this.div,"a.editLink",true,function(c,b){if(b!=this.editingId){this.resetForm();
this.editing=Event.element(c).up("li");
this.editingId=b;
new Ajax.Request(Comments.C.URL,{method:"get",parameters:{commentId:b,random:this._rand(true),page:this._getForm()?this._getForm().page.value:""},onSuccess:function(f){this._getFormHolder().update(f.responseText);
var e=this._getFormHolder().down(".cancelEditingLink");
if(e){e.remove()
}this.decorateForm();
this.editing.appendChild(this._getFormHolder());
var g=this.editing.down("ul");
if(g){this.editing.appendChild(g)
}$(this.div).fire("comments:updated")
}.bind(this)})
}})
},_replaceClick:function(c,b,a,e){if($(c)){$(c).select(b).each(function(f){var g=null;
if(a){var k=$(f).up(".pageComment");
g=this._commentIdFromDiv(k)
}if($(f)){$(f).observe("click",function(n,l){Event.stop(n);
(e.bind(this))(n,l);
return false
}.bindAsEventListener(this,g))
}}.bind(this))
}},decorateList:function(){this.decorateListWithin(this.div)
},decorateEverything:function(){var a=$(this.div).down(".postCommentLink");
if(a){a.observe("click",function(b){}.bindAsEventListener(this))
}this.decorateList();
this.decorateForm()
},deleteComment:function(a){new Ajax.Request(Comments.C.URL,{method:"post",parameters:this.params({action:"delete",commentId:a,page:this._getForm().page.value}),onSuccess:this.onDeleteSuccess.bind(this),onFailure:this.onDeleteFailure.bind(this)})
},onDeleteSuccess:function(a){$(this.div).update(a.responseText);
$(this.div).fire("comments:updated",{refreshCount:true});
this.decorateEverything()
},onDeleteFailure:function(a){},approveComment:function(a){new Ajax.Request(Comments.C.URL,{method:"post",parameters:{action:"approve",commentId:a,page:this._getForm().page.value},onSuccess:this.onApproveSuccess.bind(this),onFailure:this.onApproveFailure.bind(this)})
},onApproveSuccess:function(a){$(this.div).update(a.responseText);
$(this.div).fire("comments:updated",{refreshCount:true});
this.decorateEverything()
},onApproveFailure:function(a){},submitClick:function(b){Event.stop(b);
var a=Event.element(b);
a.disable();
var c=$H(Form.serialize(this._getForm(),true));
c.unset("previewSubmit");
c.set("postSubmit","Submit");
if(this.replyToId){c.set("replyTo",this.replyToId)
}new Ajax.Request(Comments.C.URL,{method:"post",parameters:c,onSuccess:this.onSubmitSuccess.bind(this),onFailure:this.onSubmitFailure.bind(this)});
return false
},onSubmitSuccess:function(a){var b=(a.responseText.indexOf("user_error")!=-1);
if(b){this._getFormHolder().update(a.responseText);
this.decorateForm()
}else{$(this.div).update(a.responseText);
$(this.div).fire("comments:updated",{refreshCount:true});
this.decorateEverything();
this.resetFlags()
}},onSubmitFailure:function(a){this._getFormHolder().update(a.responseText);
this.decorateForm()
},open:function(){if(this.link&&this.link.parentNode&&!this.keepLink){this.link.parentNode.replaceChild(this.div,this.link)
}this.init()
},resetFormPosition:function(){this._insertAfter(this._getListHolder(),this._getFormHolder())
},_commentIdFromDiv:function(a){return a.id.substring("pageComment_".length)
},_greatestTabindex:function(){return $$("[tabindex]").inject(0,function(a,b){return Math.max(a,b.getAttribute("tabindex"))
})
},_reassignFormTabindex:function(){var b=this._greatestTabindex();
if(this._getForm()){var a=this._getForm().select("[tabindex]");
a.each(function(c){c.setAttribute("tabindex",++b)
})
}},_getForm:function(){return $(this.div).down("form")
},_getFormHolder:function(){return $(this.div).down(".comment_form_holder")
},_getListHolder:function(){return $(this.div).down(".comment_list_holder")
},_insertAfter:function(b,a){b.parentNode.insertBefore(a,b.nextSibling)
}};
var map;
var RoomsMap={QUERY_URL:"/ajax/lvsch/rooms.json",popup:null,currentRoom:null,mapElement:null,generateId:function(){return"map"+Math.floor(Math.random()*10000)
},generateMapContainer:function(b,a){if(RoomsMap.mapElement){a.append('<div id="'+b+'Anchor"><div id="'+b+'ContainerWrapper" style="position:relative;"></div></div>')
}else{a.append('<div id="'+b+'Anchor"><div id="'+b+'ContainerWrapper" style="position:relative;"><div id="'+b+'Container" style="position:relative; width:381px; height:260px;">Loading map&hellip;</div></div></div>')
}},loadMapForRoom:function(link,roomName){if(!RoomsMap._loadPopup(link,roomName)){return
}new Ajax.Request(RoomsMap.QUERY_URL,{asynchronous:true,method:"get",parameters:"room="+roomName+"&exactMatch=true",onComplete:function(resp){var rooms=eval("("+resp.responseText+")");
if(rooms.length>1){var content=new StringBuilder("<p>Found more than one room; disambiguation required.</p>");
$A(rooms).each(function(room){RoomsMap._renderRoomDescription(room,content)
});
RoomsMap.popup.setContent(content.toString())
}else{if(rooms.length==1){var content=new StringBuilder("");
var room=rooms[0];
var id=RoomsMap.generateId();
RoomsMap._renderRoomDescription(room,content);
RoomsMap.generateMapContainer(id,content);
content.append("<p>");
if(room.buildingNumber>0){content.append('<a href="http://go.warwick.ac.uk/interactivemap?type=building&num='+room.buildingNumber+'">')
}else{content.append('<a href="http://go.warwick.ac.uk/interactivemap">')
}content.append("View full map");
content.append("</a></p>");
RoomsMap.popup.setContent(content.toString());
RoomsMap._doMap(id,room,"room")
}else{RoomsMap.popup.setContent("<p>The specified room could not be found.</p>")
}}}})
},loadMapForBuilding:function(e,b,a){if(!RoomsMap._loadPopup(e,b)){return
}var c=new StringBuilder("");
RoomsMap._loadMapsData(true,function(){var g=mapData.Buildings.detect(function(n){return n.num==b
});
var f=f||g.title;
var l=RoomsMap.generateId();
var k={buildingNumber:b,buildingName:f};
if(f){c.append("<p>");
if(k.buildingNumber>0){c.append('<a href="http://go.warwick.ac.uk/interactivemap?type=building&num='+k.buildingNumber+'">')
}else{c.append('<a href="http://go.warwick.ac.uk/interactivemap">')
}c.append("<strong>"+f+"</strong></a></p>")
}RoomsMap.generateMapContainer(l,c);
c.append("<p>");
if(k.buildingNumber>0){c.append('<a href="http://go.warwick.ac.uk/interactivemap?type=building&num='+k.buildingNumber+'">')
}else{c.append('<a href="http://go.warwick.ac.uk/interactivemap">')
}c.append("View full map</a></p>");
RoomsMap.popup.setContent(c.toString());
RoomsMap._doMap(l,k,"building")
})
},loadMapForSection:function(c,e,a){if(!RoomsMap._loadPopup(c,e+":"+a)){return
}var b=new StringBuilder("");
RoomsMap._loadMapsData(true,function(){var f=mapData[e].detect(function(k){return k.title==a
});
var g=RoomsMap.generateId();
b.append("<p><strong>"+f.title+"</strong></p>");
if(f.url){b.append('<p><a href="'+f.url+'" class="moreInformation">More information</a></p>')
}RoomsMap.generateMapContainer(g,b);
b.append('<p><a href="http://go.warwick.ac.uk/interactivemap">View full map</a></p>');
RoomsMap.popup.setContent(b.toString());
RoomsMap._doMap(g,f,"other")
})
},_loadMapsData:function(b,k){if(typeof VEMap=="undefined"){var g=["/static_war/apps/livemap/mapControl.js."+SitebuilderInfo.buildTimestamp,"//search.warwick.ac.uk/search/mapData.json?assign=mapData","/static_war/apps/livemap/mapnocontrol.min.js."+SitebuilderInfo.buildTimestamp];
var f=b?"":Math.floor(Math.random()*10000);
var c=document.getElementsByTagName("head")[0];
var a={};
function e(p){var n=g[p];
if(f!=""){n+=f
}var o=document.getElementsByTagName("head")[0];
var l=document.createElement("script");
l.src=n;
a[n]={done:false,script:l};
l.onload=l.onreadystatechange=function(r,q){return function(){if(!a[q].done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){a[q].done=true;
if(r>=g.length-1){k();
return
}else{e(r+1)
}}}
}(p,n);
o.appendChild(a[n].script)
}e(0)
}else{k()
}},_loadPopup:function(a,b){if(RoomsMap.popup==null){RoomsMap.popup=new WPopupBox();
RoomsMap.popup.rootElement.className+=" popupMap";
RoomsMap.popup.rootElement.style.zIndex=50
}else{if(RoomsMap.currentRoom==b){RoomsMap.popup.show();
RoomsMap.popup.positionBelow(a);
return false
}}if(RoomsMap.mapElement){$(RoomsMap.mapElement).remove()
}RoomsMap.currentRoom=b;
RoomsMap.popup.setSize(450,400);
RoomsMap.popup.show();
RoomsMap.popup.setContent("Loading...");
RoomsMap.popup.positionBelow(a);
return true
},_doMap:function(c,b,a){if(RoomsMap.mapElement){$(c+"ContainerWrapper").update();
$(c+"ContainerWrapper").appendChild(RoomsMap.mapElement)
}RoomsMap.popup.setHeightToFit();
RoomsMap._loadMapsData(true,function(){RoomsMap._loadMap(c+"Container",b,a,{containerId:c+"Container",wrapperId:c+"ContainerWrapper",anchorId:c+"Anchor",showMoreInfoOnPopup:false,showInfoBoxOnHighlight:false,roadworksIconsLayer:13,carParksIconsLayer:16,buildingsIconsLayer:16,hallsIconsLayer:16,forcedZoomLevel:16})
})
},_loadMap:function(e,c,b,a){if(map&&$(map.ID)){a.containerId=map.options.containerId;
map.setOptions(a)
}else{if(!$(e)){alert(e+" does not exist")
}map=new VEMap(e);
map.setOptions(a);
map.SetDashboardSize(VEDashboardSize.Tiny);
map.LoadMap(new VELatLong(52.381625,-1.563518),14,"r",false,VEMapMode.Mode2D,false);
map.EnableShapeDisplayThreshold(false);
map.BuildObjectLookup();
map.DrawHideLabels();
map.DrawAllShapeLayers();
map.AttachEvent("onendzoom",map.ZoomOverride);
map.ZoomOverride();
RoomsMap.mapElement=$(map.ID)
}this._focusOn(map,c,b)
},_focusOn:function(f,e,c){if(c&&c=="building"){f.HighlightBuilding(e.buildingNumber)
}else{if(c&&c=="other"){if(e.onsearchselect){var b=e.onsearchselect[0];
var a=e.onsearchselect[1];
(f[b])(e[a])
}}else{f.SelectRoom(e)
}}},_renderRoomDescription:function(a,c){c.append("<p><strong>"+(a.alias||a.name)+"</strong> is a ");
var b=(a.type&&a.type!="None"&&a.type!="Locally timetabled room");
c.append(b?a.type.toLowerCase():"room");
if(a.floor){c.append(" on the ");
c.append(a.floor.toLowerCase());
switch(a.floor){case"1":c.append("st");
break;
case"2":c.append("nd");
break;
case"3":c.append("rd");
break;
case"4":case"5":c.append("th");
break
}c.append(" floor of ")
}else{c.append(" in ")
}if(a.buildingName.indexOf("Building")!=-1){c.append("the ")
}if(a.buildingNumber>0){c.append('<a href="http://go.warwick.ac.uk/interactivemap?type=building&num='+a.buildingNumber+'">')
}else{c.append('<a href="http://go.warwick.ac.uk/interactivemap">')
}c.append("<strong>"+a.buildingName+"</strong></a>");
c.append("</p>")
}};
