var Prototype={Version:"1.6.1_rc3",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.*Safari/.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 f=document.createElement("div");var b=document.createElement("form");var a=false;if(f.__proto__&&(f.__proto__!==b.__proto__)){a=true}f=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 Abstract={};var Try={these:function(){var b;for(var f=0,a=arguments.length;f<a;f++){var g=arguments[f];try{b=g();break}catch(h){}}return b}};var Class=(function(){function f(){}function b(){var h=null,j=$A(arguments);if(Object.isFunction(j[0])){h=j.shift()}function g(){this.initialize.apply(this,arguments)}Object.extend(g,Class.Methods);g.superclass=h;g.subclasses=[];if(h){f.prototype=h.prototype;g.prototype=new f;h.subclasses.push(g)}for(var k=0;k<j.length;k++){g.addMethods(j[k])}if(!g.prototype.initialize){g.prototype.initialize=Prototype.emptyFunction}g.prototype.constructor=g;return g}function a(h){var l=this.superclass&&this.superclass.prototype;var k=Object.keys(h);if(!Object.keys({toString:true}).length){if(h.toString!=Object.prototype.toString){k.push("toString")}if(h.valueOf!=Object.prototype.valueOf){k.push("valueOf")}}for(var m=0,j=k.length;m<j;m++){var g=k[m],n=h[g];if(l&&Object.isFunction(n)&&n.argumentNames().first()=="$super"){var o=n;n=(function(p){return function(){return l[p].apply(this,arguments)}})(g).wrap(o);n.valueOf=o.valueOf.bind(o);n.toString=o.toString.bind(o)}this.prototype[g]=n}return this}return{create:b,Methods:{addMethods:a}}})();(function(){function p(w){return Object.prototype.toString.call(w).match(/^\[object\s(.*)\]$/)[1]}function a(y,x){for(var w in x){y[w]=x[w]}return y}function r(w){try{if(f(w)){return"undefined"}if(w===null){return"null"}return w.inspect?w.inspect():String(w)}catch(x){if(x instanceof RangeError){return"..."}throw x}}function v(y){var A=typeof y;switch(A){case"undefined":case"function":case"unknown":return;case"boolean":return y.toString()}if(y===null){return"null"}if(y.toJSON){return y.toJSON()}if(l(y)){return}var x=[];for(var w in y){var B=v(y[w]);if(!f(B)){x.push(w.toJSON()+": "+B)}}return"{"+x.join(", ")+"}"}function j(w){return $H(w).toQueryString()}function g(w){return w&&w.toHTML?w.toHTML():String.interpret(w)}function s(y){var x=[];for(var w in y){x.push(w)}return x}function q(y){var x=[];for(var w in y){x.push(y[w])}return x}function m(w){return a({},w)}function l(w){return !!(w&&w.nodeType==1)}function h(w){return p(w)==="Array"}function n(w){return w instanceof Hash}function b(w){return typeof w==="function"}function k(w){return p(w)==="String"}function o(w){return p(w)==="Number"}function f(w){return typeof w==="undefined"}a(Object,{extend:a,inspect:r,toJSON:v,toQueryString:j,toHTML:g,keys:s,values:q,clone:m,isElement:l,isArray:h,isHash:n,isFunction:b,isString:k,isNumber:o,isUndefined:f})})();Object.extend(Function.prototype,(function(){var o=Array.prototype.slice;function g(s,q){var r=s.length,p=q.length;while(p--){s[r+p]=q[p]}return s}function n(q,p){q=o.call(q,0);return g(q,p)}function f(){var p=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return p.length==1&&!p[0]?[]:p}function l(q){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var r=this,p=o.call(arguments,1);return function(){var s=n(p,arguments);return r.apply(q,s)}}function j(q){var r=this,p=o.call(arguments,1);return function(v){var s=g([v||window.event],p);return r.apply(q,s)}}function m(){if(!arguments.length){return this}var q=this,p=o.call(arguments,0);return function(){var r=n(p,arguments);return q.apply(this,r)}}function h(p){var r=this,q=o.call(arguments,1);p=p*1000;return window.setTimeout(function(){return r.apply(r,q)},p)}function a(){var p=g([0.01],arguments);return this.delay.apply(this,p)}function b(q){var p=this;return function(){var r=g([p.bind(this)],arguments);return q.apply(this,r)}}function k(){if(this._methodized){return this._methodized}var p=this;return this._methodized=function(){var q=g([this],arguments);return p.apply(null,q)}}return{argumentNames:f,bind:l,bindAsEventListener:j,curry:m,delay:h,defer:a,wrap:b,methodize:k}})());Date.prototype.toJSON=function(){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"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;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()}catch(a){}finally{this.currentlyExecuting=false}}}});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(){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");var 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(){escapeHTML.text.data=this;return escapeHTML.div.innerHTML}function unescapeHTML(){var div=document.createElement("div");div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):""}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());var 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(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()}function dasherize(){return this.gsub(/_/,"-")}function inspect(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:"\\u00"+match[0].charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.sub(filter||Prototype.JSONFilter,"#{1}")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===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?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,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);if("<\n>".escapeHTML()!=="&lt;\n&gt;"){String.prototype.escapeHTML=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}if("&lt;\n&gt;".unescapeHTML()!=="<\n>"){String.prototype.unescapeHTML=function(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}}var Template=Class.create({initialize:function(b,a){this.template=b.toString();this.pattern=a||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(j){if(a==null){return(j[1]+"")}var f=j[1]||"";if(f=="\\"){return j[2]}var g=a,k=j[3];var b=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;j=b.exec(k);if(j==null){return f}while(j!=null){var h=j[1].startsWith("[")?j[2].gsub("\\\\]","]"):j[1];g=g[h];if(null==g||""==j[3]){break}k=k.substring("["==j[3]?j[1].length:j[0].length);j=b.exec(k)}return f+String.interpret(g)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function g(F,E){var D=0;try{this._each(function(H){F.call(E,H,D++)})}catch(G){if(G!=$break){throw G}}return this}function s(D,G,F){var E=-D,H=[],I=this.toArray();if(D<1){return I}while((E+=D)<I.length){H.push(I.slice(E,E+D))}return H.collect(G,F)}function f(E,D){E=E||Prototype.K;var F=true;this.each(function(H,G){F=F&&!!E.call(D,H,G);if(!F){throw $break}});return F}function m(E,D){E=E||Prototype.K;var F=false;this.each(function(H,G){if(F=!!E.call(D,H,G)){throw $break}});return F}function n(F,E){F=F||Prototype.K;var D=[];this.each(function(H,G){D.push(F.call(E,H,G))});return D}function q(E,D){var F;this.each(function(H,G){if(E.call(D,H,G)){F=H;throw $break}});return F}function b(F,E){var D=[];this.each(function(H,G){if(F.call(E,H,G)){D.push(H)}});return D}function l(D,G,F){G=G||Prototype.K;var E=[];if(Object.isString(D)){D=new RegExp(RegExp.escape(D))}this.each(function(I,H){if(D.match(I)){E.push(G.call(F,I,H))}});return E}function a(D){if(Object.isFunction(this.indexOf)){if(this.indexOf(D)!=-1){return true}}var E=false;this.each(function(F){if(F==D){E=true;throw $break}});return E}function v(D,E){E=Object.isUndefined(E)?null:E;return this.eachSlice(D,function(F){while(F.length<D){F.push(E)}return F})}function B(D,F,E){this.each(function(H,G){D=F.call(E,D,H,G)});return D}function o(E){var D=$A(arguments).slice(1);return this.map(function(F){return F[E].apply(F,D)})}function w(E,D){E=E||Prototype.K;var F;this.each(function(H,G){H=E.call(D,H,G);if(F==null||H>=F){F=H}});return F}function r(E,D){E=E||Prototype.K;var F;this.each(function(H,G){H=E.call(D,H,G);if(F==null||H<F){F=H}});return F}function h(G,E){G=G||Prototype.K;var F=[],D=[];this.each(function(I,H){(G.call(E,I,H)?F:D).push(I)});return[F,D]}function j(D){var E=[];this.each(function(F){E.push(F[D])});return E}function k(F,E){var D=[];this.each(function(H,G){if(!F.call(E,H,G)){D.push(H)}});return D}function A(E,D){return this.map(function(G,F){return{value:G,criteria:E.call(D,G,F)}}).sort(function(I,H){var G=I.criteria,F=H.criteria;return G<F?-1:G>F?1:0}).pluck("value")}function x(){return this.map()}function y(){var E=Prototype.K,D=$A(arguments);if(Object.isFunction(D.last())){E=D.pop()}var F=[this].concat(D).map($A);return this.map(function(H,G){return E(F.pluck(G))})}function p(){return this.toArray().length}function C(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:g,eachSlice:s,all:f,every:f,any:m,some:m,collect:n,map:n,detect:q,findAll:b,select:b,filter:b,grep:l,include:a,member:a,inGroupsOf:v,inject:B,invoke:o,max:w,min:r,partition:h,pluck:j,reject:k,sortBy:A,toArray:x,entries:x,zip:y,size:p,inspect:C,find:q}})();function $A(f){if(!f){return[]}if("toArray" in Object(f)){return f.toArray()}var a=f.length||0,b=new Array(a);while(a--){b[a]=f[a]}return b}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var q=Array.prototype,v=q.slice,x=q.forEach;function b(E){for(var D=0,C=this.length;D<C;D++){E(this[D])}}if(!x){x=b}function r(){this.length=0;return this}function g(){return this[0]}function k(){return this[this.length-1]}function n(){return this.select(function(C){return C!=null})}function m(){return this.inject([],function(D,C){if(Object.isArray(C)){return D.concat(C.flatten())}D.push(C);return D})}function l(){var C=v.call(arguments,0);return this.select(function(D){return !C.include(D)})}function j(C){return(C!==false?this:this.toArray())._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 y(C){return this.uniq().findAll(function(D){return C.detect(function(E){return D===E})})}function A(){return v.call(this,0)}function o(){return this.length}function B(){return"["+this.map(Object.inspect).join(", ")+"]"}function s(){var C=[];this.each(function(D){var E=Object.toJSON(D);if(!Object.isUndefined(E)){C.push(E)}});return"["+C.join(", ")+"]"}function a(E,D){D||(D=0);var C=this.length;if(D<0){D=C+D}for(;D<C;D++){if(this[D]===E){return D}}return -1}function w(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 f(){var H=v.call(this,0),F;for(var E=0,C=arguments.length;E<C;E++){F=arguments[E];if(Object.isArray(F)&&!("callee" in F)){for(var D=0,G=F.length;D<G;D++){H.push(F[D])}}else{H.push(F)}}return H}Object.extend(q,Enumerable);if(!q._reverse){q._reverse=q.reverse}Object.extend(q,{_each:x,clear:r,first:g,last:k,compact:n,flatten:m,without:l,reverse:j,uniq:p,intersect:y,clone:A,toArray:A,size:o,inspect:B,toJSON:s});var h=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(h){q.concat=f}if(!q.indexOf){q.indexOf=a}if(!q.lastIndexOf){q.lastIndexOf=w}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function g(w){this._object=Object.isHash(w)?w.toObject():Object.clone(w)}function h(x){for(var w in this._object){var y=this._object[w],A=[w,y];A.key=w;A.value=y;x(A)}}function o(w,x){return this._object[w]=x}function b(w){if(this._object[w]!==Object.prototype[w]){return this._object[w]}}function v(w){var x=this._object[w];delete this._object[w];return x}function n(){return Object.clone(this._object)}function s(){return this.pluck("key")}function q(){return this.pluck("value")}function k(x){var w=this.detect(function(y){return y.value===x});return w&&w.key}function m(w){return this.clone().update(w)}function f(w){return new Hash(w).inject(this,function(x,y){x.set(y.key,y.value);return x})}function a(w,x){if(Object.isUndefined(x)){return w}return w+"="+encodeURIComponent(String.interpret(x))}function j(){return this.inject([],function(x,A){var w=encodeURIComponent(A.key),y=A.value;if(y&&typeof y=="object"){if(Object.isArray(y)){return x.concat(y.map(a.curry(w)))}}else{x.push(a(w,y))}return x}).join("&")}function p(){return"#<Hash:{"+this.map(function(w){return w.map(Object.inspect).join(": ")}).join(", ")+"}>"}function r(){return Object.toJSON(this.toObject())}function l(){return new Hash(this)}return{initialize:g,_each:h,set:o,get:b,unset:v,toObject:n,toTemplateReplacements:n,keys:s,values:q,index:k,merge:m,update:f,toQueryString:j,inspect:p,toJSON:r,clone:l}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function g(){return this.toPaddedString(2,16)}function h(){return this+1}function a(o,n){$R(0,this,true).each(o,n);return this}function b(n,p){var o=this.toString(p||10);return"0".times(n-o.length)+o}function l(){return isFinite(this)?this.toString():"null"}function m(){return Math.abs(this)}function k(){return Math.round(this)}function j(){return Math.ceil(this)}function f(){return Math.floor(this)}return{toColorPart:g,succ:h,times:a,toPaddedString:b,toJSON:l,abs:m,round:k,ceil:j,floor:f}})());function $R(f,a,b){return new ObjectRange(f,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(j,g,h){this.start=j;this.end=g;this.exclusive=h}function f(g){var h=this.start;while(this.include(h)){g(h);h=h.succ()}}function a(g){if(g<this.start){return false}if(this.exclusive){return g<this.end}return g<=this.end}return{initialize:b,_each:f,include:a}})());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(f,b,g,a){this.each(function(h){if(Object.isFunction(h[f])){try{h[f].apply(h,[b,g,a])}catch(j){}}})}};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.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,a,b){$super(b);this.transport=Ajax.getTransport();this.request(a)},request:function(a){this.url=a;this.method=this.options.method;var g=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){g._method=this.method;this.method="post"}this.parameters=g;if(g=Object.toQueryString(g)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+g}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){g+="&_="}}}try{var b=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(b)}Ajax.Responders.dispatch("onCreate",this,b);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||g):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(f){this.dispatchException(f)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var h={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){h["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){h.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var b=this.options.requestHeaders;if(Object.isFunction(b.push)){for(var g=0,a=b.length;g<a;g+=2){h[b[g]]=b[g+1]}}else{$H(b).each(function(j){h[j.key]=j.value})}}for(var f in h){this.transport.setRequestHeader(f,h[f])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var f=Ajax.Request.Events[a],b=new Ajax.Response(this);if(f=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(h){this.dispatchException(h)}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"+f]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+f,this,b,b.headerJSON)}catch(h){this.dispatchException(h)}if(f=="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(f){this.request=f;var g=this.transport=f.transport,a=this.readyState=g.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(g.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=g.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,f,a,b){this.container={success:(f.success||f),failure:(f.failure||(f.success?null:f))};b=Object.clone(b);var g=b.onComplete;b.onComplete=(function(j,h){this.updateContent(j.responseText);if(Object.isFunction(g)){g(j,h)}}).bind(this);$super(a,b)},updateContent:function(g){var b=this.container[this.success()?"success":"failure"],f=this.options;if(!f.evalScripts){g=g.stripScripts()}if(b=$(b)){if(f.insertion){if(Object.isString(f.insertion)){var a={};a[f.insertion]=g;b.insert(a)}else{f.insertion(b,g)}}else{b.update(g)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,f,a,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=f;this.url=a;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 $(f){if(arguments.length>1){for(var g=0,a=[],b=arguments.length;g<b;g++){a.push($(arguments[g]))}return a}if(Object.isString(f)){f=document.getElementById(f)}return Element.extend(f)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(j,g){var f=[];var h=document.evaluate(j,$(g)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,a=h.snapshotLength;b<a;b++){f.push(Element.extend(h.snapshotItem(b)))}return f}}if(!window.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(a){var b=(function(){var h=document.createElement("form");var j=document.createElement("input");var g=document.documentElement;j.setAttribute("name","test");h.appendChild(j);g.appendChild(h);var k=h.elements?(typeof h.elements.test=="undefined"):null;g.removeChild(h);h=j=null;return k})();var f=a.Element;a.Element=function(j,h){h=h||{};j=j.toLowerCase();var g=Element.cache;if(b&&h.name){j="<"+j+' name="'+h.name+'">';delete h.name;return Element.writeAttribute(document.createElement(j),h)}if(!g[j]){g[j]=Element.extend(document.createElement(j))}return Element.writeAttribute(g[j].cloneNode(false),h)};Object.extend(a.Element,f||{});if(f){a.Element.prototype=f.prototype}})(this);Element.cache={};Element.idCounter=1;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 b=(function(){var h=document.createElement("select"),j=true;h.innerHTML='<option value="test">test</option>';if(h.options&&h.options[0]){j=h.options[0].nodeName.toUpperCase()!=="OPTION"}h=null;return j})();var a=(function(){try{var h=document.createElement("table");if(h&&h.tBodies){h.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var k=typeof h.tBodies[0]=="undefined";h=null;return k}}catch(j){return true}})();var g=(function(){var h=document.createElement("script"),k=false;try{h.appendChild(document.createTextNode(""));k=!h.firstChild||h.firstChild&&h.firstChild.nodeType!==3}catch(j){k=true}h=null;return k})();function f(j,k){j=$(j);if(k&&k.toElement){k=k.toElement()}if(Object.isElement(k)){return j.update().insert(k)}k=Object.toHTML(k);var h=j.tagName.toUpperCase();if(h==="SCRIPT"&&g){j.text=k;return j}if(b||a){if(h in Element._insertionTranslations.tags){while(j.firstChild){j.removeChild(j.firstChild)}Element._getContentFromAnonymousElement(h,k.stripScripts()).each(function(l){j.appendChild(l)})}else{j.innerHTML=k.stripScripts()}}else{j.innerHTML=k.stripScripts()}k.evalScripts.bind(k).defer();return j}return f})(),replace:function(b,f){b=$(b);if(f&&f.toElement){f=f.toElement()}else{if(!Object.isElement(f)){f=Object.toHTML(f);var a=b.ownerDocument.createRange();a.selectNode(b);f.evalScripts.bind(f).defer();f=a.createContextualFragment(f.stripScripts())}}b.parentNode.replaceChild(f,b);return b},insert:function(g,j){g=$(g);if(Object.isString(j)||Object.isNumber(j)||Object.isElement(j)||(j&&(j.toElement||j.toHTML))){j={bottom:j}}var h,b,f,k;for(var a in j){h=j[a];a=a.toLowerCase();b=Element._insertionTranslations[a];if(h&&h.toElement){h=h.toElement()}if(Object.isElement(h)){b(g,h);continue}h=Object.toHTML(h);f=((a=="before"||a=="after")?g.parentNode:g).tagName.toUpperCase();k=Element._getContentFromAnonymousElement(f,h.stripScripts());if(a=="top"||a=="after"){k.reverse()}k.each(b.curry(g));h.evalScripts.bind(h).defer()}return g},wrap:function(b,f,a){b=$(b);if(Object.isElement(f)){$(f).writeAttribute(a||{})}else{if(Object.isString(f)){f=new Element(f,a)}else{f=new Element("div",f)}}if(b.parentNode){b.parentNode.replaceChild(f,b)}f.appendChild(b);return f},inspect:function(a){a=$(a);var b="<"+a.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(j){var f=j.first(),g=j.last();var h=(a[f]||"").toString();if(h){b+=" "+g+"="+h.inspect(true)}});return b+">"},recursivelyCollect:function(f,b){f=$(f);var a=[];while(f=f[b]){if(f.nodeType==1){a.push(Element.extend(f))}}return a},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(a){if(!(a=$(a).firstChild)){return[]}while(a&&a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat($(a).nextSiblings())}return[]},previousSiblings:function(a){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){if(Object.isString(a)){a=new Selector(a)}return a.match($(b))},up:function(f,g,b){f=$(f);if(arguments.length==1){return $(f.parentNode)}var a=Element.ancestors(f);return Object.isNumber(g)?a[g]:Selector.findElement(a,g,b)},down:function(b,f,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(f)?Element.descendants(b)[f]:Element.select(b,f)[a||0]},previous:function(b,g,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))}var f=Element.previousSiblings(b);return Object.isNumber(g)?f[g]:Selector.findElement(f,g,a)},next:function(b,g,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(b))}var f=Element.nextSiblings(b);return Object.isNumber(g)?f[g]:Selector.findElement(f,g,a)},select:function(b){var a=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(b,a)},adjacent:function(b){var a=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}b="anonymous_element_"+new Date().getTime();Element.writeAttribute(a,"id",b);return b},readAttribute:(function(){var a=(function(){var b=document.createElement("iframe"),g=false;document.documentElement.appendChild(b);try{b.getAttribute("type",2)}catch(f){g=true}document.documentElement.removeChild(b);b=null;return g})();return function(f,b){f=$(f);if(a&&b==="type"&&f.tagName.toUpperCase()=="IFRAME"){return f.getAttribute("type")}if(Prototype.Browser.IE){var g=Element._attributeTranslations.read;if(g.values[b]){return g.values[b](f,b)}if(g.names[b]){b=g.names[b]}if(b.include(":")){return(!f.attributes||!f.attributes[b])?null:f.attributes[b].value}}return f.getAttribute(b)}})(),writeAttribute:function(g,f,j){g=$(g);var b={},h=Element._attributeTranslations.write;if(typeof f=="object"){b=f}else{b[f]=Object.isUndefined(j)?true:j}for(var a in b){f=h.names[a]||a;j=b[a];if(h.values[a]){f=h.values[a](g,j)}if(j===false||j===null){g.removeAttribute(f)}else{if(j===true){g.setAttribute(f,f)}else{g.setAttribute(f,j)}}}return g},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(b,a){if(!(b=$(b))){return}var f=b.className;return(f.length>0&&(f==a||new RegExp("(^|\\s)"+a+"(\\s|$)").test(f)))},addClassName:function(b,a){if(!(b=$(b))){return}if(!Element.hasClassName(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClassName:function(b,a){if(!(b=$(b))){return}b.className=b.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ").strip();return b},toggleClassName:function(b,a){if(!(b=$(b))){return}return Element[Element.hasClassName(b,a)?"removeClassName":"addClassName"](b,a)},cleanWhitespace:function(b){b=$(b);var f=b.firstChild;while(f){var a=f.nextSibling;if(f.nodeType==3&&!/\S/.test(f.nodeValue)){b.removeChild(f)}f=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(a,f){a=$(a);f=f=="float"?"cssFloat":f.camelize();var g=a.style[f];if(!g||g=="auto"){var b=document.defaultView.getComputedStyle(a,null);g=b?b[f]:null}if(f=="opacity"){return g?parseFloat(g):1}return g=="auto"?null:g},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(h,f){h=$(h);var b=h.style,g;if(Object.isString(f)){h.style.cssText+=";"+f;return f.include("opacity")?h.setOpacity(f.match(/opacity:\s*(\d?\.?\d*)/)[1]):h}for(var a in f){if(a=="opacity"){h.setOpacity(f[a])}else{b[(a=="float"||a=="cssFloat")?(Object.isUndefined(b.styleFloat)?"cssFloat":"styleFloat"):a]=f[a]}}return h},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},getDimensions:function(f){f=$(f);var k=Element.getStyle(f,"display");if(k!="none"&&k!=null){return{width:f.offsetWidth,height:f.offsetHeight}}var h=f.style;var a=h.visibility;var b=h.position;var g=h.display;h.visibility="hidden";if(b!="fixed"){h.position="absolute"}h.display="block";var l=f.clientWidth;var j=f.clientHeight;h.display=g;h.position=b;h.visibility=a;return{width:l,height:j}},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},cumulativeOffset:function(a){var b=0,f=0;do{b+=a.offsetTop||0;f+=a.offsetLeft||0;a=a.offsetParent}while(a);return Element._returnOffset(f,b)},positionedOffset:function(a){var b=0,g=0;do{b+=a.offsetTop||0;g+=a.offsetLeft||0;a=a.offsetParent;if(a){if(a.tagName.toUpperCase()=="BODY"){break}var f=Element.getStyle(a,"position");if(f!=="static"){break}}}while(a);return Element._returnOffset(g,b)},absolutize:function(b){b=$(b);if(Element.getStyle(b,"position")=="absolute"){return b}var a=Element.positionedOffset(b);var j=a[1];var h=a[0];var f=b.clientWidth;var g=b.clientHeight;b._originalLeft=h-parseFloat(b.style.left||0);b._originalTop=j-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=j+"px";b.style.left=h+"px";b.style.width=f+"px";b.style.height=g+"px";return b},relativize:function(a){a=$(a);if(Element.getStyle(a,"position")=="relative"){return a}a.style.position="relative";var f=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=f+"px";a.style.left=b+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(a){var b=0,f=0;do{b+=a.scrollTop||0;f+=a.scrollLeft||0;a=a.parentNode}while(a);return Element._returnOffset(f,b)},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)}if(a==document.body){return $(a)}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return $(a)}}return $(document.body)},viewportOffset:function(f){var b=0,g=0;var a=f;do{b+=a.offsetTop||0;g+=a.offsetLeft||0;if(a.offsetParent==document.body&&Element.getStyle(a,"position")=="absolute"){break}}while(a=a.offsetParent);a=f;do{if(!Prototype.Browser.Opera||(a.tagName&&(a.tagName.toUpperCase()=="BODY"))){b-=a.scrollTop||0;g-=a.scrollLeft||0}}while(a=a.parentNode);return Element._returnOffset(g,b)},clonePosition:function(f,a){var g=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});a=$(a);var h=Element.viewportOffset(a);f=$(f);var j=[0,0];var b=null;if(Element.getStyle(f,"position")=="absolute"){b=Element.getOffsetParent(f);j=Element.viewportOffset(b)}if(b==document.body){j[0]-=document.body.offsetLeft;j[1]-=document.body.offsetTop}if(g.setLeft){f.style.left=(h[0]-j[0]+g.offsetLeft)+"px"}if(g.setTop){f.style.top=(h[1]-j[1]+g.offsetTop)+"px"}if(g.setWidth){f.style.width=a.offsetWidth+"px"}if(g.setHeight){f.style.height=a.offsetHeight+"px"}return f}};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(a,f,g){switch(g){case"left":case"top":case"right":case"bottom":if(a(f,"position")==="static"){return null}case"height":case"width":if(!Element.visible(f)){return null}var h=parseInt(a(f,g),10);if(h!==f["offset"+g.capitalize()]){return h+"px"}var b;if(g==="height"){b=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{b=["border-left-width","padding-left","padding-right","border-right-width"]}return b.inject(h,function(k,j){var l=a(f,j);return l===null?k:k-parseInt(l,10)})+"px";default:return a(f,g)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(a,b,f){if(f==="title"){return b.title}return a(b,f)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(b,f){f=$(f);try{f.offsetParent}catch(h){return $(document.body)}var a=f.getStyle("position");if(a!=="static"){return b(f)}f.setStyle({position:"relative"});var g=b(f);f.setStyle({position:a});return g});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(f,g){g=$(g);try{g.offsetParent}catch(k){return Element._returnOffset(0,0)}var b=g.getStyle("position");if(b!=="static"){return f(g)}var h=g.getOffsetParent();if(h&&h.getStyle("position")==="fixed"){h.setStyle({zoom:1})}g.setStyle({position:"relative"});var j=f(g);g.setStyle({position:b});return j})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(a,b){try{b.offsetParent}catch(f){return Element._returnOffset(0,0)}return a(b)});Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var f=a.style[b];if(!f&&a.currentStyle){f=a.currentStyle[b]}if(b=="opacity"){if(f=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(f[1]){return parseFloat(f[1])/100}}return 1}if(f=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return f};Element.Methods.setOpacity=function(f,h){function j(k){return k.replace(/alpha\([^\)]*\)/gi,"")}f=$(f);var b=f.currentStyle;if((b&&!b.hasLayout)||(!b&&f.style.zoom=="normal")){f.style.zoom=1}var a=f.getStyle("filter"),g=f.style;if(h==1||h===""){(a=j(a))?g.filter=a:g.removeAttribute("filter");return f}else{if(h<0.00001){h=0}}g.filter=j(a)+"alpha(opacity="+(h*100)+")";return f};Element._attributeTranslations=(function(){var f="className";var b="for";var a=document.createElement("div");a.setAttribute(f,"x");if(a.className!=="x"){a.setAttribute("class","x");if(a.className==="x"){f="class"}}a=null;a=document.createElement("label");a.setAttribute(b,"x");if(a.htmlFor!=="x"){a.setAttribute("htmlFor","x");if(a.htmlFor==="x"){b="htmlFor"}}a=null;return{read:{names:{"class":f,className:f,"for":b,htmlFor:b},values:{_getAttr:function(g,h){return g.getAttribute(h,2)},_getAttrNode:function(g,j){var h=g.getAttributeNode(j);return h?h.value:""},_getEv:(function(){var g=document.createElement("div");g.onclick=Prototype.emptyFunction;var j=g.getAttribute("onclick");var h;if(String(j).indexOf("{")>-1){h=function(k,l){l=k.getAttribute(l);if(!l){return null}l=l.toString();l=l.split("{")[1];l=l.split("}")[0];return l.strip()}}else{if(j===""){h=function(k,l){l=k.getAttribute(l);if(!l){return null}return l.strip()}}}g=null;return h})(),_flag:function(g,h){return $(g).hasAttribute(h)?h:null},style:function(g){return g.style.cssText.toLowerCase()},title:function(g){return g.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._getAttr,src:a._getAttr,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("*"),h=[];for(var g=0,j;j=b[g];g++){if(j.tagName!=="!"){h.push(j)}}return h}Element.Methods.down=function(f,g,b){f=$(f);if(arguments.length==1){return f.firstDescendant()}return Object.isNumber(g)?a(f)[g]:Element.select(f,g)[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 g=document.createTextNode(" ");a.appendChild(g);a.removeChild(g)}catch(f){}}}return a};Element.Methods.cumulativeOffset=function(a){var b=0,f=0;do{b+=a.offsetTop||0;f+=a.offsetLeft||0;if(a.offsetParent==document.body){if(Element.getStyle(a,"position")=="absolute"){break}}a=a.offsetParent}while(a);return Element._returnOffset(f,b)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(h,j){h=$(h);if(j&&j.toElement){j=j.toElement()}if(Object.isElement(j)){h.parentNode.replaceChild(j,h);return h}j=Object.toHTML(j);var f=h.parentNode,g=f.tagName.toUpperCase();if(Element._insertionTranslations.tags[g]){var b=h.next();var a=Element._getContentFromAnonymousElement(g,j.stripScripts());f.removeChild(h);if(b){a.each(function(k){f.insertBefore(k,b)})}else{a.each(function(k){f.appendChild(k)})}}else{h.outerHTML=j.stripScripts()}j.evalScripts.bind(j).defer();return h}}Element._returnOffset=function(a,b){var f=[a,b];f.left=a;f.top=b;return f};Element._getContentFromAnonymousElement=function(a,f){var g=new Element("div"),b=Element._insertionTranslations.tags[a];if(b){g.innerHTML=b[0]+f+b[1];b[2].times(function(){g=g.firstChild})}else{g.innerHTML=f}return $A(g.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,f){f=Element._attributeTranslations.has[f]||f;var b=$(a).getAttributeNode(f);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 f(l){if(typeof window.Element!="undefined"){var n=window.Element.prototype;if(n){var p="_"+(Math.random()+"").slice(2);var m=document.createElement(l);n[p]="x";var o=(m[p]!=="x");delete n[p];m=null;return o}}return false}function b(n,m){for(var l in m){var o=m[l];if(Object.isFunction(o)&&!(l in n)){n[l]=o.methodize()}}}var a=f("object");var j=f("applet");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(a&&j){return function(l){if(l&&typeof l._extendedByPrototype=="undefined"){var m=l.tagName;if(m&&(/^(?:object|applet|embed)$/i.test(m))){b(l,Element.Methods);b(l,Element.Methods.Simulated);b(l,Element.Methods.ByTag[m.toUpperCase()])}}return l}}return Prototype.K}var h={},g=Element.Methods.ByTag;var k=Object.extend(function(n){if(!n||typeof n._extendedByPrototype!="undefined"||n.nodeType!=1||n==window){return n}var l=Object.clone(h),m=n.tagName.toUpperCase();if(g[m]){Object.extend(l,g[m])}b(n,l);n._extendedByPrototype=Prototype.emptyFunction;return n},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(h,Element.Methods);Object.extend(h,Element.Methods.Simulated)}}});k.refresh();return k})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(f){var m=Prototype.BrowserFeatures,g=Element.Methods.ByTag;if(!f){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)})}if(arguments.length==2){var j=f;f=arguments[1]}if(!j){Object.extend(Element.Methods,f||{})}else{if(Object.isArray(j)){j.each(a)}else{a(j)}}function a(o){o=o.toUpperCase();if(!Element.Methods.ByTag[o]){Element.Methods.ByTag[o]={}}Object.extend(Element.Methods.ByTag[o],f)}function b(p,s,r){r=r||false;for(var o in p){var q=p[o];if(!Object.isFunction(q)){continue}if(!r||!(o in s)){s[o]=q.methodize()}}}function h(q){var o;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[q]){o="HTML"+r[q]+"Element"}if(window[o]){return window[o]}o="HTML"+q+"Element";if(window[o]){return window[o]}o="HTML"+q.capitalize()+"Element";if(window[o]){return window[o]}var p=document.createElement(q);var s=p.__proto__||p.constructor.prototype;p=null;return s}var l=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(m.ElementExtensions){b(Element.Methods,l);b(Element.Methods.Simulated,l,true)}if(m.SpecificElementExtensions){for(var n in Element.Methods.ByTag){var k=h(n);if(Object.isUndefined(k)){continue}b(g[n],k.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(f){var k=Prototype.Browser,j=document,g,b={};function a(){if(k.WebKit&&!j.evaluate){return document}if(k.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function h(l){if(!g){g=a()}b[l]="client"+l;f["get"+l]=function(){return g[b[l]]};return f["get"+l]()}f.getWidth=h.curry("Width");f.getHeight=h.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(a){if(!(a=$(a))){return}var b;if(a===window){b=0}else{if(typeof a._prototypeUID==="undefined"){a._prototypeUID=[Element.Storage.UID++]}b=a._prototypeUID[0]}if(!Element.Storage[b]){Element.Storage[b]=$H()}return Element.Storage[b]},store:function(a,b,f){if(!(a=$(a))){return}if(arguments.length===2){Element.getStorage(a).update(b)}else{Element.getStorage(a).set(b,f)}return a},retrieve:function(a,b,f){if(!(a=$(a))){return}var h=Element.getStorage(a),g=h.get(b);if(Object.isUndefined(g)){h.set(b,f);g=f}return g},clone:function(b,a){if(!(b=$(b))){return}var h=b.cloneNode(a);h._prototypeUID=void 0;if(a){var g=Element.select(h,"*"),f=g.length;while(f--){g[f]._prototypeUID=void 0}}return Element.extend(h)}});var Selector=Class.create({initialize:function(a){this.expression=a.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:(function(){var a=(function(){var h=false;if(document.evaluate&&window.XPathResult){var f=document.createElement("div");f.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var b=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var g=document.evaluate(b,f,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);h=(g.snapshotLength!==2);f=null}return h})();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var b=this.expression;if(Prototype.Browser.WebKit&&(b.include("-of-type")||b.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(b)){return false}if(a){return false}return true}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(a){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var k=this.expression,l=Selector.patterns,f=Selector.xpath,j,b,a=l.length,g;if(Selector._cache[k]){this.xpath=Selector._cache[k];return}this.matcher=[".//*"];while(k&&j!=k&&(/\S/).test(k)){j=k;for(var h=0;h<a;h++){g=l[h].name;if(b=k.match(l[h].re)){this.matcher.push(Object.isFunction(f[g])?f[g](b):new Template(f[g]).evaluate(b));k=k.replace(b[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;var f=this.expression,b;switch(this.mode){case"selectorsAPI":if(a!==document){var g=a.id,h=$(a).identify();h=h.replace(/[\.:]/g,"\\$0");f="#"+h+" "+f}b=$A(a.querySelectorAll(f)).map(Element.extend);a.id=g;return b;case"xpath":return document._getElementsByXPath(this.xpath,a);default:return this.matcher(a)}},match:function(l){this.tokens=[];var s=this.expression,b=Selector.patterns,j=Selector.assertions;var a,g,h,r=b.length,f;while(s&&a!==s&&(/\S/).test(s)){a=s;for(var n=0;n<r;n++){g=b[n].re;f=b[n].name;if(h=s.match(g)){if(j[f]){this.tokens.push([f,Object.clone(h)]);s=s.replace(h[0],"")}else{return this.findElements(document).include(l)}}}}var q=true,f,o;for(var n=0,k;k=this.tokens[n];n++){f=k[0],o=k[1];if(!Selector.assertions[f](l,o)){q=false;break}}return q},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var f=document.createElement("div"),a=document.createElement("span");f.id="prototype_test_id";a.className="Test";f.appendChild(a);var b=(f.querySelector("#prototype_test_id .test")!==null);f=a=null;return b})()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*"){return""}return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(a){a[1]=a[1].toLowerCase();return new Template("[@#{1}]").evaluate(a)},attr:function(a){a[1]=a[1].toLowerCase();a[3]=a[5]||a[6];return new Template(Selector.xpath.operators[a[2]]).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b){return""}if(Object.isFunction(b)){return b(a)}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(h){var l=h[6],f=Selector.patterns,n=Selector.xpath,a,o,k=f.length,b;var g=[];while(l&&a!=l&&(/\S/).test(l)){a=l;for(var j=0;j<k;j++){b=f[j].name;if(h=l.match(f[j].re)){o=Object.isFunction(n[b])?n[b](h):new Template(n[b]).evaluate(h);g.push("("+o.substring(1,o.length-1)+")");l=l.replace(h[0],"");break}}}return"[not("+g.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(j,g){var n,l=g[6],k;if(l=="even"){l="2n+0"}if(l=="odd"){l="2n+1"}if(n=l.match(/^(\d+)$/)){return"["+j+"= "+n[1]+"]"}if(n=l.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(n[1]=="-"){n[1]=-1}var h=n[1]?Number(n[1]):1;var f=n[2]?Number(n[2]):0;k="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(k).evaluate({fragment:j,a:h,b:f})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(a){a[3]=(a[5]||a[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(a)},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(a)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(b,f){var a=Element.readAttribute(b,f[1]);return a&&Selector.operators[f[2]](a,f[5]||f[6])}},handlers:{concat:function(g,f){for(var h=0,j;j=f[h];h++){g.push(j)}return g},mark:function(a){var g=Prototype.emptyFunction;for(var b=0,f;f=a[b];b++){f._countedByPrototype=g}return a},unmark:(function(){var a=(function(){var f=document.createElement("div"),h=false,b="_countedByPrototype",g="x";f[b]=g;h=(f.getAttribute(b)===g);f=null;return h})();return a?function(b){for(var f=0,g;g=b[f];f++){g.removeAttribute("_countedByPrototype")}return b}:function(b){for(var f=0,g;g=b[f];f++){g._countedByPrototype=void 0}return b}})(),index:function(k,f,l){k._countedByPrototype=Prototype.emptyFunction;if(f){for(var a=k.childNodes,g=a.length-1,b=1;g>=0;g--){var h=a[g];if(h.nodeType==1&&(!l||h._countedByPrototype)){h.nodeIndex=b++}}}else{for(var g=0,b=1,a=k.childNodes;h=a[g];g++){if(h.nodeType==1&&(!l||h._countedByPrototype)){h.nodeIndex=b++}}}},unique:function(b){if(b.length==0){return b}var g=[],h;for(var f=0,a=b.length;f<a;f++){if(typeof(h=b[f])._countedByPrototype=="undefined"){h._countedByPrototype=Prototype.emptyFunction;g.push(Element.extend(h))}}return Selector.handlers.unmark(g)},descendant:function(a){var g=Selector.handlers;for(var f=0,b=[],j;j=a[f];f++){g.concat(b,j.getElementsByTagName("*"))}return b},child:function(a){var k=Selector.handlers;for(var g=0,f=[],l;l=a[g];g++){for(var b=0,m;m=l.childNodes[b];b++){if(m.nodeType==1&&m.tagName!="!"){f.push(m)}}}return f},adjacent:function(a){for(var f=0,b=[],h;h=a[f];f++){var g=this.nextElementSibling(h);if(g){b.push(g)}}return b},laterSibling:function(a){var g=Selector.handlers;for(var f=0,b=[],j;j=a[f];f++){g.concat(b,Element.nextSiblings(j))}return b},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a}}return null},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a}}return null},tagName:function(a,m,k,l){var n=k.toUpperCase();var g=[],j=Selector.handlers;if(a){if(l){if(l=="descendant"){for(var f=0,b;b=a[f];f++){j.concat(g,b.getElementsByTagName(k))}return g}else{a=this[l](a)}if(k=="*"){return a}}for(var f=0,b;b=a[f];f++){if(b.tagName.toUpperCase()===n){g.push(b)}}return g}else{return m.getElementsByTagName(k)}},id:function(a,o,b,m){var n=$(b),l=Selector.handlers;if(o==document){if(!n){return[]}if(!a){return[n]}}else{if(!o.sourceIndex||o.sourceIndex<1){var a=o.getElementsByTagName("*");for(var g=0,f;f=a[g];g++){if(f.id===b){return[f]}}}}if(a){if(m){if(m=="child"){for(var k=0,f;f=a[k];k++){if(n.parentNode==f){return[n]}}}else{if(m=="descendant"){for(var k=0,f;f=a[k];k++){if(Element.descendantOf(n,f)){return[n]}}}else{if(m=="adjacent"){for(var k=0,f;f=a[k];k++){if(Selector.handlers.previousElementSibling(n)==f){return[n]}}}else{a=l[m](a)}}}}for(var k=0,f;f=a[k];k++){if(f==n){return[n]}}return[]}return(n&&Element.descendantOf(n,o))?[n]:[]},className:function(g,b,f,a){if(g&&a){g=this[a](g)}return Selector.handlers.byClassName(g,b,f)},byClassName:function(f,a,b){if(!f){f=Selector.handlers.descendant([a])}var l=" "+b+" ";for(var h=0,g=[],k,j;k=f[h];h++){j=k.className;if(j.length==0){continue}if(j==b||(" "+j+" ").include(l)){g.push(k)}}return g},attrPresence:function(g,f,a,b){if(!g){g=f.getElementsByTagName("*")}if(g&&b){g=this[b](g)}var j=[];for(var h=0,k;k=g[h];h++){if(Element.hasAttribute(k,a)){j.push(k)}}return j},attr:function(a,m,l,n,k,j){if(!a){a=m.getElementsByTagName("*")}if(a&&j){a=this[j](a)}var o=Selector.operators[k],g=[];for(var f=0,b;b=a[f];f++){var h=Element.readAttribute(b,l);if(h===null){continue}if(o(h,n)){g.push(b)}}return g},pseudo:function(f,g,h,b,a){if(f&&a){f=this[a](f)}if(!f){f=b.getElementsByTagName("*")}return Selector.pseudos[g](f,h,b)}},pseudos:{"first-child":function(b,j,a){for(var g=0,f=[],h;h=b[g];g++){if(Selector.handlers.previousElementSibling(h)){continue}f.push(h)}return f},"last-child":function(b,j,a){for(var g=0,f=[],h;h=b[g];g++){if(Selector.handlers.nextElementSibling(h)){continue}f.push(h)}return f},"only-child":function(b,l,a){var j=Selector.handlers;for(var g=0,f=[],k;k=b[g];g++){if(!j.previousElementSibling(k)&&!j.nextElementSibling(k)){f.push(k)}}return f},"nth-child":function(b,f,a){return Selector.pseudos.nth(b,f,a)},"nth-last-child":function(b,f,a){return Selector.pseudos.nth(b,f,a,true)},"nth-of-type":function(b,f,a){return Selector.pseudos.nth(b,f,a,false,true)},"nth-last-of-type":function(b,f,a){return Selector.pseudos.nth(b,f,a,true,true)},"first-of-type":function(b,f,a){return Selector.pseudos.nth(b,"1",a,false,true)},"last-of-type":function(b,f,a){return Selector.pseudos.nth(b,"1",a,true,true)},"only-of-type":function(b,g,a){var f=Selector.pseudos;return f["last-of-type"](f["first-of-type"](b,g,a),g,a)},getIndices:function(g,f,h){if(g==0){return f>0?[f]:[]}return $R(1,h).inject([],function(a,b){if(0==(b-f)%g&&(b-f)/g>=0){a.push(b)}return a})},nth:function(f,g,A,x,w){if(f.length==0){return[]}if(g=="even"){g="2n+0"}if(g=="odd"){g="2n+1"}var v=Selector.handlers,s=[],k=[],o;v.mark(f);for(var r=0,n;n=f[r];r++){if(!n.parentNode._countedByPrototype){v.index(n.parentNode,x,w);k.push(n.parentNode)}}if(g.match(/^\d+$/)){g=Number(g);for(var r=0,n;n=f[r];r++){if(n.nodeIndex==g){s.push(n)}}}else{if(o=g.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(o[1]=="-"){o[1]=-1}var B=o[1]?Number(o[1]):1;var y=o[2]?Number(o[2]):0;var C=Selector.pseudos.getIndices(B,y,f.length);for(var r=0,n,p=C.length;n=f[r];r++){for(var q=0;q<p;q++){if(n.nodeIndex==C[q]){s.push(n)}}}}}v.unmark(f);v.unmark(k);return s},empty:function(b,j,a){for(var g=0,f=[],h;h=b[g];g++){if(h.tagName=="!"||h.firstChild){continue}f.push(h)}return f},not:function(a,g,o){var l=Selector.handlers,p,f;var n=new Selector(g).findElements(o);l.mark(n);for(var k=0,j=[],b;b=a[k];k++){if(!b._countedByPrototype){j.push(b)}}l.unmark(n);return j},enabled:function(b,j,a){for(var g=0,f=[],h;h=b[g];g++){if(!h.disabled&&(!h.type||h.type!=="hidden")){f.push(h)}}return f},disabled:function(b,j,a){for(var g=0,f=[],h;h=b[g];g++){if(h.disabled){f.push(h)}}return f},checked:function(b,j,a){for(var g=0,f=[],h;h=b[g];g++){if(h.checked){f.push(h)}}return f}},operators:{"=":function(b,a){return b==a},"!=":function(b,a){return b!=a},"^=":function(b,a){return b==a||b&&b.startsWith(a)},"$=":function(b,a){return b==a||b&&b.endsWith(a)},"*=":function(b,a){return b==a||b&&b.include(a)},"~=":function(b,a){return(" "+b+" ").include(" "+a+" ")},"|=":function(b,a){return("-"+(b||"").toUpperCase()+"-").include("-"+(a||"").toUpperCase()+"-")}},split:function(b){var a=[];b.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(f){a.push(f[1].strip())});return a},matchElements:function(a,l){var k=$$(l),j=Selector.handlers;j.mark(k);for(var g=0,f=[],b;b=a[g];g++){if(b._countedByPrototype){f.push(b)}}j.unmark(k);return f},findElement:function(a,f,b){if(Object.isNumber(f)){b=f;f=false}return Selector.matchElements(a,f||"*")[b||0]},findChildElements:function(f,m){m=Selector.split(m.join(","));var j=[],k=Selector.handlers;for(var g=0,b=m.length,a;g<b;g++){a=new Selector(m[g].strip());k.concat(j,a.findElements(f))}return(b>1)?k.unique(j):j}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(g,f){for(var h=0,j;j=f[h];h++){if(j.tagName!=="!"){g.push(j)}}return g}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(f,h){if(typeof h!="object"){h={hash:!!h}}else{if(Object.isUndefined(h.hash)){h.hash=true}}var g,k,b=false,a=h.submit;var j=f.inject({},function(m,l){if(!l.disabled&&l.name){g=l.name;k=$(l).getValue();if(k!=null&&l.type!="file"&&(l.type!="submit"||(!b&&a!==false&&(!a||g==a)&&(b=true)))){if(g in m){if(!Object.isArray(m[g])){m[g]=[m[g]]}m[g].push(k)}else{m[g]=k}}}return m});return h.hash?j:Object.toQueryString(j)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(j){var b=$(j).getElementsByTagName("*"),g,a=[],f=Form.Element.Serializers;for(var h=0;g=b[h];h++){a.push(g)}return a.inject([],function(k,l){if(f[l.tagName.toLowerCase()]){k.push(Element.extend(l))}return k})},getInputs:function(k,h,f){k=$(k);var j=k.getElementsByTagName("input");if(!h&&!f){return $A(j).map(Element.extend)}for(var g=0,l=[],a=j.length;g<a;g++){var b=j[g];if((h&&b.type!=h)||(f&&b.name!=f)){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(f){var a=$(f).getElements().findAll(function(g){return"hidden"!=g.type&&!g.disabled});var b=a.findAll(function(g){return g.hasAttribute("tabIndex")&&g.tabIndex>=0}).sortBy(function(g){return g.tabIndex}).first();return b?b:a.find(function(g){return/^(?:input|select|textarea)$/i.test(g.tagName)})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(f,b){f=$(f),b=Object.clone(b||{});var g=b.parameters,a=f.readAttribute("action")||"";if(a.blank()){a=window.location.href}b.parameters=f.serialize(true);if(g){if(Object.isString(g)){g=g.toQueryParams()}Object.extend(b.parameters,g)}if(f.hasAttribute("method")&&!b.method){b.method=f.method}return new Ajax.Request(a,b)}};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 f={};f[a.name]=b;return Object.toQueryString(f)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var f=a.tagName.toLowerCase();Form.Element.Serializers[f](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={input:function(a,b){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null}else{a.checked=!!b}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value}else{a.value=b}},select:function(b,j){if(Object.isUndefined(j)){return this[b.type=="select-one"?"selectOne":"selectMany"](b)}else{var g,h,k=!Object.isArray(j);for(var f=0,a=b.length;f<a;f++){g=b.options[f];h=this.optionValue(g);if(k){if(h==j){g.selected=true;return}}else{g.selected=j.include(h)}}}},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(b){var h,a=b.length;if(!a){return null}for(var g=0,h=[];g<a;g++){var f=b.options[g];if(f.selected){h.push(this.optionValue(f))}}return h},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,f,b){$super(b,f);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 D={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 k=document.documentElement;var q="onmouseenter" in k&&"onmouseleave" in k;var x;if(Prototype.Browser.IE){var m={0:1,1:4,2:2};x=function(F,E){return F.button===m[E]}}else{if(Prototype.Browser.WebKit){x=function(F,E){switch(E){case 0:return F.which==1&&!F.metaKey;case 1:return F.which==1&&F.metaKey;default:return false}}}else{x=function(F,E){return F.which?(F.which===E+1):(F.button===E)}}}function v(E){return x(E,0)}function w(E){return x(E,1)}function p(E){return x(E,2)}function n(G){G=D.extend(G);var F=G.target,E=G.type,H=G.currentTarget;if(H&&H.tagName){if(E==="load"||E==="error"||(E==="click"&&H.tagName.toLowerCase()==="input"&&H.type==="radio")){F=H}}if(F.nodeType==Node.TEXT_NODE){F=F.parentNode}return Element.extend(F)}function B(G,H){var F=D.element(G);if(!H){return F}var E=[F].concat(F.ancestors());return Selector.findElement(E,H,0)}function y(E){return{x:g(E),y:f(E)}}function g(G){var F=document.documentElement,E=document.body||{scrollLeft:0};return G.pageX||(G.clientX+(F.scrollLeft||E.scrollLeft)-(F.clientLeft||0))}function f(G){var F=document.documentElement,E=document.body||{scrollTop:0};return G.pageY||(G.clientY+(F.scrollTop||E.scrollTop)-(F.clientTop||0))}function s(E){D.extend(E);E.preventDefault();E.stopPropagation();E.stopped=true}D.Methods={isLeftClick:v,isMiddleClick:w,isRightClick:p,element:n,findElement:B,pointer:y,pointerX:g,pointerY:f,stop:s};var A=Object.keys(D.Methods).inject({},function(E,F){E[F]=D.Methods[F].methodize();return E});if(Prototype.Browser.IE){function j(F){var E;switch(F.type){case"mouseover":E=F.fromElement;break;case"mouseout":E=F.toElement;break;default:return null}return Element.extend(E)}Object.extend(A,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});D.extend=function(F,E){if(!F){return false}if(F._extendedByPrototype){return F}F._extendedByPrototype=Prototype.emptyFunction;var G=D.pointer(F);Object.extend(F,{target:F.srcElement||E,relatedTarget:j(F),pageX:G.x,pageY:G.y});return Object.extend(F,A)}}else{D.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(D.prototype,A);D.extend=Prototype.K}function b(F,E,I){var H=Element.retrieve(F,"prototype_event_registry");if(Object.isUndefined(H)){h.push(F);H=Element.retrieve(F,"prototype_event_registry",$H())}var J=H.get(E);if(Object.isUndefined(J)){J=[];H.set(E,J)}if(J.pluck("handler").include(I)){return false}var G;if(E.include(":")){G=function(K){if(Object.isUndefined(K.eventName)){return false}if(K.eventName!==E){return false}D.extend(K,F);I.call(F,K)}}else{if(!q&&(E==="mouseenter"||E==="mouseleave")){if(E==="mouseenter"||E==="mouseleave"){G=function(L){D.extend(L,F);var K=L.relatedTarget;while(K&&K!==F){try{K=K.parentNode}catch(M){K=F}}if(K===F){return}I.call(F,L)}}}else{G=function(K){D.extend(K,F);I.call(F,K)}}}G.handler=I;J.push(G);return G}function l(){for(var F=0,E=h.length;F<E;F++){D.stopObserving(h[F]);h[F]=null}}var h=[];if(Prototype.Browser.IE){window.attachEvent("onunload",l)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var a=Prototype.K;if(!q){a=function(E){var F={mouseenter:"mouseover",mouseleave:"mouseout"};return E in F?F[E]:E}}function r(F,E,I){F=$(F);var H=b(F,E,I);if(!H){return F}if(E.include(":")){if(F.addEventListener){F.addEventListener("dataavailable",H,false)}else{F.attachEvent("ondataavailable",H);F.attachEvent("onfilterchange",H)}}else{var G=a(E);if(F.addEventListener){F.addEventListener(G,H,false)}else{F.attachEvent("on"+G,H)}}return F}function o(F,E,K){F=$(F);var J=Element.retrieve(F,"prototype_event_registry");if(Object.isUndefined(J)){return F}if(E&&!K){var G=J.get(E);if(Object.isUndefined(G)){return F}G.each(function(L){Element.stopObserving(F,E,L.handler)});return F}else{if(!E){J.each(function(N){var L=N.key,M=N.value;M.each(function(O){Element.stopObserving(F,L,O.handler)})});return F}}var G=J.get(E);if(!G){return}var I=G.find(function(L){return L.handler===K});if(!I){return F}var H=a(E);if(E.include(":")){if(F.removeEventListener){F.removeEventListener("dataavailable",I,false)}else{F.detachEvent("ondataavailable",I);F.detachEvent("onfilterchange",I)}}else{if(F.removeEventListener){F.removeEventListener(H,I,false)}else{F.detachEvent("on"+H,I)}}J.set(E,G.without(I));return F}function C(G,F,E,I){G=$(G);if(Object.isUndefined(I)){I=true}if(G==document&&document.createEvent&&!G.dispatchEvent){G=document.documentElement}var H;if(document.createEvent){H=document.createEvent("HTMLEvents");H.initEvent("dataavailable",true,true)}else{H=document.createEventObject();H.eventType=I?"ondataavailable":"onfilterchange"}H.eventName=F;H.memo=E||{};if(document.createEvent){G.dispatchEvent(H)}else{G.fireEvent(H.eventType,H)}return D.extend(H)}Object.extend(D,D.Methods);Object.extend(D,{fire:C,observe:r,stopObserving:o});Element.addMethods({fire:C,observe:r,stopObserving:o});Object.extend(document,{fire:C.methodize(),observe:r.methodize(),stopObserving:o.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,D)}else{window.Event=D}})();(function(){var g;function a(){if(document.loaded){return}if(g){window.clearTimeout(g)}document.loaded=true;document.fire("dom:loaded")}function f(){if(document.readyState==="complete"){document.stopObserving("readystatechange",f);a()}}function b(){try{document.documentElement.doScroll("left")}catch(h){g=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",f);if(window==top){g=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,f){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,f)}this.xcomp=a;this.ycomp=f;this.offset=Element.cumulativeOffset(b);return(f>=this.offset[1]&&f<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,g){var f=Element.cumulativeScrollOffset(b);this.xcomp=a+f[0]-this.deltaX;this.ycomp=g+f[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(a,f,b){b=b||{};return Element.clonePosition(f,a,b)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(f){return f.blank()?null:"[contains(concat(' ', @class, ' '), ' "+f+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(g,f){f=f.toString().strip();var h=/\s/.test(f)?$w(f).map(a).join(""):a(f);return h?document._getElementsByXPath(".//*"+h,g):[]}:function(j,h){h=h.toString().strip();var f=[],l=(/\s/.test(h)?$w(h):null);if(!l&&!h){return f}var g=$(j).getElementsByTagName("*");h=" "+h+" ";for(var k=0,n,m;n=g[k];k++){if(n.className&&(m=" "+n.className+" ")&&(m.include(h)||(l&&l.all(function(o){return !o.toString().blank()&&m.include(" "+o+" ")})))){f.push(Element.extend(n))}}return f};return function(f,g){return $(g||document.body).getElementsByClassName(f)}}(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);Protoload={timeUntilShow:150,opacity:0.8,startWaiting:function(b,a,g){if(typeof b=="string"){b=document.getElementById(b)}if(a==undefined){a="waiting"}if(g==undefined){g=Protoload.timeUntilShow}b._waiting=true;if(!b._loading){var f=document.createElement("div");(b.offsetParent||document.body).appendChild(b._loading=f);f.style.position="absolute";try{f.style.opacity=Protoload.opacity}catch(f){}try{f.style.MozOpacity=Protoload.opacity}catch(f){}try{f.style.filter="alpha(opacity="+Math.round(Protoload.opacity*100)+")"}catch(f){}try{f.style.KhtmlOpacity=Protoload.opacity}catch(f){}}b._loading.className=a;window.setTimeout((function(){if(this._waiting){var n=this.offsetLeft,m=this.offsetTop,j=this.offsetWidth,k=this.offsetHeight,h=this._loading;h.style.left=n+"px";h.style.top=m+"px";h.style.width=j+"px";h.style.height=k+"px";h.style.display="inline"}}).bind(b),g)},stopWaiting:function(a){if(a._waiting){a._waiting=false;a._loading.parentNode.removeChild(a._loading);a._loading=null}}};if(Prototype){Element.addMethods(Protoload);Object.extend(Element,Protoload)}if(typeof Prototype=="undefined"||!Prototype.Version.match("1.6")){throw ("Prototype-UI library require Prototype library >= 1.6.0")}(function(f){var a=f.Browser,g=navigator;if(a.WebKit){a.WebKitVersion=parseFloat(g.userAgent.match(/AppleWebKit\/([\d\.\+]*)/)[1]);a.Safari2=(a.WebKitVersion<420)}if(a.IE){a.IEVersion=parseFloat(g.appVersion.split(";")[1].strip().split(" ")[1]);a.IE6=a.IEVersion==6;a.IE7=a.IEVersion==7}f.falseFunction=function(){return false};f.trueFunction=function(){return true}})(Prototype);var UI={Abstract:{},Ajax:{}};Object.extend(Class.Methods,{extend:Object.extend.methodize(),addMethods:Class.Methods.addMethods.wrap(function(b,a){if(!a){return this}if(!a.hasOwnProperty("methodsAdded")){return b(a)}var f=a.methodsAdded;delete a.methodsAdded;b(a);f.call(a,this);a.methodsAdded=f;return this}),addMethod:function(b,f){var a={};a[b]=f;return this.addMethods(a)},method:function(a){return this.prototype[a].valueOf()},classMethod:function(){$A(arguments).flatten().each(function(a){this[a]=(function(){return this[a].apply(this,arguments)}).bind(this.prototype)},this);return this},undefMethod:function(a){this.prototype[a]=undefined;return this},removeMethod:function(a){delete this.prototype[a];return this},aliasMethod:function(a,b){this.prototype[a]=this.prototype[b];return this},aliasMethodChain:function(b,a){a=a.camelcase();this.aliasMethod(b+"Without"+a,b);this.aliasMethod(b,b+"With"+a);return this}});Object.extend(Number.prototype,{snap:function(a){return parseInt(a==1?this:(this/a).floor()*a)}});Object.extend(String.prototype,{camelcase:function(){var a=this.dasherize().camelize();return a.charAt(0).toUpperCase()+a.slice(1)},makeElement:function(){var a=new Element("div");a.innerHTML=this;return a.down()}});Object.extend(Array.prototype,{isEmpty:function(){return !this.length},at:function(a){return this[a<0?this.length+a:a]},removeAt:function(a){if(-a>this.length){return}return this.splice(a,1)[0]},removeIf:function(g,f){for(var b=this.length-1,a=[];b>=0;b--){if(g.call(f,this[b],b)){a.push(this.removeAt(b))}}return a.reverse()},remove:function(a){return this.removeIf(function(b){return b===a}).length},insert:function(a){if(a>this.length){this.length=a}else{if(a<0){a=this.length+a+1}}this.splice.apply(this,[a,0].concat($A(arguments).slice(1)));return this}});Array.prototype.empty=Array.prototype.isEmpty;Element.addMethods({getScrollDimensions:function(a){a=$(a);return{width:a.scrollWidth,height:a.scrollHeight}},getScrollOffset:function(a){a=$(a);return Element._returnOffset(a.scrollLeft,a.scrollTop)},setScrollOffset:function(a,b){a=$(a);if(arguments.length==3){b={left:b,top:arguments[2]}}a.scrollLeft=b.left;a.scrollTop=b.top;return a},getNumStyle:function(a,b){var f=parseFloat($(a).getStyle(b));return isNaN(f)?null:f},appendText:function(a,b){a=$(a);a.appendChild(document.createTextNode(String.interpret(b)));return a}});document.whenReady=(function(){var a=[];document.observe("dom:loaded",function(){a.invoke("call",document);a.clear();document.whenReady=function(b){b.bind(document).defer()}});return function(b){a.push(b)}})();Object.extend(document.viewport,{getScrollOffset:document.viewport.getScrollOffsets,setScrollOffset:function(a){Element.setScrollOffset(Prototype.Browser.WebKit?document.body:document.documentElement,a)},getScrollDimensions:function(){return Element.getScrollDimensions(Prototype.Browser.WebKit?document.body:document.documentElement)}});document.whenReady(function(){window.$head=$(document.getElementsByTagName("head")[0]);window.$body=$(document.body)});(function(){UI.Options={methodsAdded:function(b){b.classMethod($w(" setOptions allOptions optionsGetter optionsSetter optionsAccessor "))},setOptions:function(b){if(!this.hasOwnProperty("options")){this.options=this.allOptions()}this.options=Object.extend(this.options,b||{})},allOptions:function(){var f=this.constructor.superclass,b=f&&f.prototype;return(b&&b.allOptions)?Object.extend(b.allOptions(),this.options):Object.clone(this.options)},optionsGetter:function(){a(this,arguments,false)},optionsSetter:function(){a(this,arguments,true)},optionsAccessor:function(){this.optionsGetter.apply(this,arguments);this.optionsSetter.apply(this,arguments)}};function a(f,g,b){g=$A(g).flatten();if(g.empty()){g=Object.keys(f.allOptions())}g.each(function(h){var j=(b?"set":"get")+h.camelcase();f[j]=f[j]||(b?function(k){return this.options[h]=k}:function(){return this.options[h]})})}})();var CSS=(function(){function h(){a.apply(this,$A(arguments).concat(k))}function a(){var m=$A(arguments);var n=m.pop();var l=$A(document.styleSheets);if(m.length>0){l=l.select(function(o){return m.any(function(p){return o.href&&o.href.match(p)})})}l.each(function(o){j.call(this,o,n)})}function j(n,o){if(n.imports){$A(n.imports).each(j)}var m=n.href||document.location.href;var l=m.substr(0,m.lastIndexOf("/"));$A(n.rules||n.cssRules).each(function(p){o.call(this,p,l)})}var f='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="#{src}",sizingMethod="#{method}")';function k(o,n){var m=o.style.backgroundImage;if(m&&m!="none"&&m.match(/^url[("']+(.*\.png)[)"']+$/i)){var p=RegExp.$1;var l=o.style.backgroundRepeat;if(p[0]!="/"){p=n+"/"+p}o.style.filter=f.interpolate({src:p,method:l=="no-repeat"?"crop":"scale"});o.style.backgroundImage="none"}}var b=new Hash();function g(o,m){var l=o.style.backgroundImage;if(l&&l!="none"&&l!="initial"){if(!b.get(l)){l.match(/^url[("']+(.*)[)"']+$/i);var p=RegExp.$1;if(!(p[0]=="/"||p.match(/^file:/)||p.match(/^https?:/))){p=m+"/"+p}b.set(l,true);var n=new Image();n.src=p}}}return{fixPNG:(Prototype.Browser.IE&&Prototype.Browser.IEVersion<7)?h:Prototype.emptyFunction,addRule:function(l){var m=new Element("style",{type:"text/css",media:"screen"});$head.insert(m);if(m.styleSheet){m.styleSheet.cssText=l}else{m.appendText(l)}return m},preloadImages:function(){a.apply(this,$A(arguments).concat(g))}}})();Object.extend(Date.prototype,{addDays:function(a){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+a,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())},succ:function(){return this.addDays(1)},firstOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},endOfMonth:function(){return new Date(this.getFullYear(),this.getMonth()+1,0)},getDayOfYear:function(){return Math.ceil((this-new Date(this.getFullYear(),0,1))/86400000)},strftime:function(a){var g={},f=Date.default_i18n;var b=function(j,h){switch(h){case"a":return f.WEEKDAYS_MEDIUM[j.getDay()];case"A":return f.WEEKDAYS[j.getDay()];case"b":case"h":return f.MONTHS_SHORT[j.getMonth()];case"B":return f.MONTHS[j.getMonth()];case"C":return Math.floor(j.getFullYear()/100);case"d":return j.getDate().toPaddedString(2);case"e":return j.getDate();case"j":return j.getDayOfYear();case"m":return(j.getMonth()+1).toPaddedString(2);case"u":return j.getDay()||7;case"w":return j.getDay();case"y":return j.getFullYear().toString().substring(2);case"Y":return j.getFullYear();case"H":return j.getHours().toPaddedString(2);case"I":return(j.getHours()%12).toPaddedString(2);case"M":return j.getMinutes().toPaddedString(2);case"p":return j.getHours()<12?"am":"pm";case"S":return j.getSeconds().toPaddedString(2);case"n":return"\n";case"t":return"\t";case"D":return j.strftime("%m/%d/%y");case"r":return j.strftime("%I:%M:%S %p");case"R":return j.strftime("%H:%M:%S");case"T":return j.strftime("%H:%M:%S");case"c":return j.strftime(f.FORMAT_DATETIME);case"x":return j.strftime(f.FORMAT_DATE);case"X":return j.strftime(f.FORMAT_TIME)}};a.scan(/\w+/,function(j){var h=j.first();g[h]=b(this,h)}.bind(this));return a.interpolate(g,Date.STRFT_GRAMMER)},equalsDate:function(a){return(this.getMonth()==a.getMonth()&&this.getDate()==a.getDate()&&this.getFullYear()==a.getFullYear())}});Object.extend(Date,{STRFT_GRAMMER:/(^|.|\r|\n)(\%(\w+))/,default_i18n:{MONTHS_SHORT:$w("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"),MONTHS:$w("January February March April May June July August September October November December"),WEEKDAYS_MEDIUM:$w("Sun Mon Tue Wed Thu Fri Sat"),WEEKDAYS:$w("Sunday Monday Tuesday Wednesday Thursday Friday Saturday"),FORMAT_DATE:"%m/%d/%Y",FORMAT_TIME:"%H:%M:%S",FORMAT_DATETIME:"%x %X"},parseString:function(b,h){var a=new Date(),f=Date.default_i18n;h=h.replace("%D","%m/%d/%y");h=h.replace("%T","%H:%M:%S").replace("%r","%I:%M:%S %p").replace("%R","%H:%M:%S");h=h.replace("%c",f.FORMAT_DATETIME).replace("%x",f.FORMAT_DATE).replace("%X",f.FORMAT_TIME);var g=h.match(/%./g);b.split(/[^A-Za-z0-9\u00A1-\uFFFF]+/).each(function(l,j){switch(g[j]){case"%a":case"%A":case"%u":case"%w":break;case"%b":case"%h":a.setMonth(f.MONTHS_SHORT.indexOf(l));break;case"%B":a.setMonth(f.MONTHS.indexOf(l));break;case"%C":break;case"%d":case"%e":a.setDate(parseInt(l,10));break;case"%j":break;case"%m":a.setMonth(parseInt(l,10)-1);break;case"%w":a.setDay(parseInt(l,10));break;case"%y":var k=parseInt(l,10);if(k<50){k+=2000}if(k<100){k+=1900}a.setYear(k);break;case"%Y":a.setFullYear(parseInt(l,10));break;case"%H":a.setHours(parseInt(l,10));break;case"%I":a.setHours(parseInt(l,10));break;case"%M":a.setMinutes(parseInt(l,10));break;case"%p":if(l=="pm"){a.setHours(a.getHours()+12)}break;case"%S":a.setSeconds(parseInt(l,10));break}});return a}});Element.addMethods({enableDrag:function(a){return $(a).writeAttribute("draggable")},disableDrag:function(a){return $(a).writeAttribute("draggable",null)},isDraggable:function(a){return $(a).hasAttribute("draggable")}});(function(){var b,k;document.observe("mousedown",function(m){if(k=f(m.element())){m.preventDefault();b=m.pointer();document.observe("mousemove",j);document.observe("mouseup",a)}});function f(m){while(m&&m!==document){if(m.hasAttribute("draggable")){return m}m=$(m.parentNode)}}function j(m){document.stopObserving("mousemove",j).stopObserving("mouseup",a).observe("mousemove",h).observe("mouseup",l);g("drag:started",m)}function a(m){document.stopObserving("mousemove",j).stopObserving("mouseup",a)}function h(m){g("drag:updated",m)}function l(m){document.stopObserving("mousemove",h).stopObserving("mouseup",l);g("drag:ended",m)}function g(m,n){var o=n.pointer();k.fire(m,{dx:o.x-b.x,dy:o.y-b.y,mouseEvent:n})}})();UI.Abstract.Logger=Class.create({level:"debug"});(function(){var a=$w(" debug info warn error ");a.each(function(f,b){UI.Abstract.Logger.addMethod(f,function(g){if(b>=a.indexOf(this.level)){this._log({level:f,message:g,date:new Date()})}})})})();UI.NullLogger=Class.create(UI.Abstract.Logger,{_log:Prototype.emptyFunction});UI.MemLogger=Class.create(UI.Abstract.Logger,{initialize:function(){this.logs=[]},_log:function(a){this.logs.push(a)}});UI.ConsoleLogger=Class.create(UI.Abstract.Logger,{_log:function(a){console[a.level](a.message)}});UI.ElementLogger=Class.create(UI.Abstract.Logger,{initialize:function(a){this.element=$(a)},format:'<p>(<span class="date">#{date}</span>) <span class="level">#{level}</span> : <span class="message">#{message}</span></p>',_log:function(a){var b=this.format.interpolate({level:a.level.toUpperCase(),message:a.message.escapeHTML(),date:a.date.toLocaleTimeString()});this.element.insert({top:b})}});document.whenReady(function(){if($("log")){UI.logger=new UI.ElementLogger("log")}else{if(window.console){UI.logger=new UI.ConsoleLogger()}else{UI.logger=new UI.MemLogger()}}});UI.Shadow=Class.create(UI.Options,{options:{theme:"mac_shadow",focus:false,zIndex:100},initialize:function(a,b){this.setOptions(b);this.element=$(a);this.create();this.iframe=Prototype.Browser.IE?new UI.IframeShim():null;if(Object.isElement(this.element.parentNode)){this.render()}},destroy:function(){if(this.shadow.parentNode){this.remove()}},setPosition:function(f,b){if(this.shadowSize){var a=this.shadow.style;f=parseInt(f)-this.shadowSize.top+this.shadowShift.top;b=parseInt(b)-this.shadowSize.left+this.shadowShift.left;a.top=f+"px";a.left=b+"px";if(this.iframe){this.iframe.setPosition(f,b)}}return this},setSize:function(f,g){if(this.shadowSize){try{var a=Math.max(0,parseInt(f)+this.shadowSize.width-this.shadowShift.width)+"px";this.shadow.style.width=a;var b=Math.max(0,parseInt(g)-this.shadowShift.height)+"px";this.shadowContents[1].childElements().each(function(h){h.style.height=b});this.shadowContents.each(function(h){h.style.width=a});if(this.iframe){this.iframe.setSize(f+this.shadowSize.width-this.shadowShift.width,g+this.shadowSize.height-this.shadowShift.height)}}catch(j){}}return this},setBounds:function(a){return this.setPosition(a.top,a.left).setSize(a.width,a.height)},setZIndex:function(a){this.shadow.style.zIndex=a;return this},show:function(){this.render();this.shadow.show();if(this.iframe){this.iframe.show()}return this},hide:function(){this.shadow.hide();if(this.iframe){this.iframe.hide()}return this},remove:function(){this.shadow.remove();return this},focus:function(){this.options.focus=true;this.updateShadow();return this},blur:function(){this.options.focus=false;this.updateShadow();return this},render:function(){if(this.element.parentNode&&!Object.isElement(this.shadow.parentNode)){this.element.parentNode.appendChild(this.shadow);this.computeSize();this.setBounds(Object.extend(this.element.getDimensions(),this.getElementPosition()));this.shadow.show()}return this},create:function(){var a=this.element.getStyle("zIndex");if(!a){this.element.setStyle({zIndex:this.options.zIndex})}a=(a||this.options.zIndex)-1;this.shadowContents=new Array(3);this.shadowContents[0]=new Element("div").insert(new Element("div",{className:"shadow_center_wrapper"}).insert(new Element("div",{className:"n_shadow"}))).insert(new Element("div",{className:"shadow_right ne_shadow"})).insert(new Element("div",{className:"shadow_left nw_shadow"}));this.shadowContents[1]=new Element("div").insert(new Element("div",{className:"shadow_center_wrapper c_shadow"})).insert(new Element("div",{className:"shadow_right e_shadow"})).insert(new Element("div",{className:"shadow_left w_shadow"}));this.centerElements=this.shadowContents[1].childElements();this.shadowContents[2]=new Element("div").insert(new Element("div",{className:"shadow_center_wrapper"}).insert(new Element("div",{className:"s_shadow"}))).insert(new Element("div",{className:"shadow_right se_shadow"})).insert(new Element("div",{className:"shadow_left sw_shadow"}));this.shadow=new Element("div",{className:"shadow_container "+this.options.theme,style:"position:absolute; top:-10000px; left:-10000px; display:none; z-index:"+a}).insert(this.shadowContents[0]).insert(this.shadowContents[1]).insert(this.shadowContents[2])},computeSize:function(){if(this.focusedShadowShift){return}this.shadow.show();var a=this.shadowContents[1].select("div.c_shadow").first();this.unfocusedShadowShift={};this.focusedShadowShift={};$w("top left bottom right").each(function(b){this.unfocusedShadowShift[b]=a.getNumStyle("padding-"+b)||0}.bind(this));this.unfocusedShadowShift.width=this.unfocusedShadowShift.left+this.unfocusedShadowShift.right;this.unfocusedShadowShift.height=this.unfocusedShadowShift.top+this.unfocusedShadowShift.bottom;$w("top left bottom right").each(function(b){this.focusedShadowShift[b]=a.getNumStyle("margin-"+b)||0}.bind(this));this.focusedShadowShift.width=this.focusedShadowShift.left+this.focusedShadowShift.right;this.focusedShadowShift.height=this.focusedShadowShift.top+this.focusedShadowShift.bottom;this.shadowShift=this.options.focus?this.focusedShadowShift:this.unfocusedShadowShift;this.shadowSize={top:this.shadowContents[0].childElements()[1].getNumStyle("height"),left:this.shadowContents[0].childElements()[1].getNumStyle("width"),bottom:this.shadowContents[2].childElements()[1].getNumStyle("height"),right:this.shadowContents[0].childElements()[2].getNumStyle("width")};this.shadowSize.width=this.shadowSize.left+this.shadowSize.right;this.shadowSize.height=this.shadowSize.top+this.shadowSize.bottom;a.setStyle("padding:0; margin:0");this.shadow.hide()},updateShadow:function(){this.shadowShift=this.options.focus?this.focusedShadowShift:this.unfocusedShadowShift;var g=this.shadow.style,j=this.getElementPosition(),b=this.element.getDimensions();g.top=j.top-this.shadowSize.top+this.shadowShift.top+"px";g.left=j.left-this.shadowSize.left+this.shadowShift.left+"px";g.width=b.width+this.shadowSize.width-this.shadowShift.width+"px";var f=b.height-this.shadowShift.height+"px";this.centerElements.each(function(h){h.style.height=f});var a=b.width+this.shadowSize.width-this.shadowShift.width+"px";this.shadowContents.each(function(h){h.style.width=a})},getElementPosition:function(){return{top:this.element.getNumStyle("top"),left:this.element.getNumStyle("left")}}});Element.addMethods({getAttributeDimensions:function(a,f){var b=$w("top bottom left right").inject({},function(h,g){h[g]=a.getNumStyle(f+"-"+g+(f=="border"?"-width":""));return h});b.width=b.left+b.right;b.height=b.top+b.bottom;return b},getBorderDimensions:function(a){return a.getAttributeDimensions("border")},getMarginDimensions:function(a){return a.getAttributeDimensions("margin")},getPaddingDimensions:function(a){return a.getAttributeDimensions("padding")}});Object.extend(Date.prototype,{addDays:function(a){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+a,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())},succ:function(){return this.addDays(1)},firstOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},endOfMonth:function(){return new Date(this.getFullYear(),this.getMonth()+1,0)},getDayOfYear:function(){return Math.ceil((this-new Date(this.getFullYear(),0,1))/86400000)},strftime:function(a){var g={},f=Date.default_i18n;var b=function(j,h){switch(h){case"a":return f.WEEKDAYS_MEDIUM[j.getDay()];case"A":return f.WEEKDAYS[j.getDay()];case"b":case"h":return f.MONTHS_SHORT[j.getMonth()];case"B":return f.MONTHS[j.getMonth()];case"C":return Math.floor(j.getFullYear()/100);case"d":return j.getDate().toPaddedString(2);case"e":return j.getDate();case"j":return j.getDayOfYear();case"m":return(j.getMonth()+1).toPaddedString(2);case"u":return j.getDay()||7;case"w":return j.getDay();case"y":return j.getFullYear().toString().substring(2);case"Y":return j.getFullYear();case"H":return j.getHours().toPaddedString(2);case"I":return(j.getHours()%12).toPaddedString(2);case"M":return j.getMinutes().toPaddedString(2);case"p":return j.getHours()<12?"am":"pm";case"S":return j.getSeconds().toPaddedString(2);case"n":return"\n";case"t":return"\t";case"D":return j.strftime("%m/%d/%y");case"r":return j.strftime("%I:%M:%S %p");case"R":return j.strftime("%H:%M:%S");case"T":return j.strftime("%H:%M:%S");case"c":return j.strftime(f.FORMAT_DATETIME);case"x":return j.strftime(f.FORMAT_DATE);case"X":return j.strftime(f.FORMAT_TIME)}};a.scan(/\w+/,function(j){var h=j.first();g[h]=b(this,h)}.bind(this));return a.interpolate(g,Date.STRFT_GRAMMER)},equalsDate:function(a){return(this.getMonth()==a.getMonth()&&this.getDate()==a.getDate()&&this.getFullYear()==a.getFullYear())}});Object.extend(Date,{STRFT_GRAMMER:/(^|.|\r|\n)(\%(\w+))/,default_i18n:{MONTHS_SHORT:$w("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"),MONTHS:$w("January February March April May June July August September October November December"),WEEKDAYS_MEDIUM:$w("Sun Mon Tue Wed Thu Fri Sat"),WEEKDAYS:$w("Sunday Monday Tuesday Wednesday Thursday Friday Saturday"),FORMAT_DATE:"%m/%d/%Y",FORMAT_TIME:"%H:%M:%S",FORMAT_DATETIME:"%x %X"},parseString:function(b,h){var a=new Date(),f=Date.default_i18n;h=h.replace("%D","%m/%d/%y");h=h.replace("%T","%H:%M:%S").replace("%r","%I:%M:%S %p").replace("%R","%H:%M:%S");h=h.replace("%c",f.FORMAT_DATETIME).replace("%x",f.FORMAT_DATE).replace("%X",f.FORMAT_TIME);var g=h.match(/%./g);b.split(/[^A-Za-z0-9\u00A1-\uFFFF]+/).each(function(l,j){switch(g[j]){case"%a":case"%A":case"%u":case"%w":break;case"%b":case"%h":a.setMonth(f.MONTHS_SHORT.indexOf(l));break;case"%B":a.setMonth(f.MONTHS.indexOf(l));break;case"%C":break;case"%d":case"%e":a.setDate(parseInt(l,10));break;case"%j":break;case"%m":a.setMonth(parseInt(l,10)-1);break;case"%w":a.setDay(parseInt(l,10));break;case"%y":var k=parseInt(l,10);if(k<50){k+=2000}if(k<100){k+=1900}a.setYear(k);break;case"%Y":a.setFullYear(parseInt(l,10));break;case"%H":a.setHours(parseInt(l,10));break;case"%I":a.setHours(parseInt(l,10));break;case"%M":a.setMinutes(parseInt(l,10));break;case"%p":if(l=="pm"){a.setHours(a.getHours()+12)}break;case"%S":a.setSeconds(parseInt(l,10));break}});return a}});Element.addMethods({center:function(g,a){a=$(a);g=$(g);var f=g.borderDimensions(),l=a.borderDimensions();var h=g.getHeight()-(f.top+f.bottom);var b=g.getWidth()-(f.left+f.right);var k=((b-a.getWidth()-(l.left+l.right))/2);var j=((h-a.getHeight()-(l.top+l.bottom))/2);k=(k<0)?0:k;j=(j<0)?0:j;g.relativize();return a.setStyle({top:j+"px",left:k+"px"})},borderDimensions:function(a){return $w("top bottom left right").inject({},function(f,b){f[b]=parseFloat(a.getStyle("border-"+b+"-width")||0);return f})}});UI.Carousel=Class.create(UI.Options,{options:{direction:"horizontal",previousButton:".previous-button",nextButton:".next-button",container:".container",scrollInc:"auto",disabledButtonSuffix:"-disabled",overButtonSuffix:"-over"},initialize:function(a,b){this.setOptions(b);this.element=$(a);this.id=this.element.id;this.container=this.element.down(this.options.container).firstDescendant();this.elements=this.container.childElements();this.previousButton=this.options.previousButton==false?null:this.element.down(this.options.previousButton);this.nextButton=this.options.nextButton==false?null:this.element.down(this.options.nextButton);this.posAttribute=(this.options.direction=="horizontal"?"left":"top");this.dimAttribute=(this.options.direction=="horizontal"?"width":"height");this.elementSize=this.computeElementSize();this.nbVisible=this.currentSize()/this.elementSize;var f=this.options.scrollInc;if(f=="auto"){f=Math.floor(this.nbVisible)}[this.previousButton,this.nextButton].each(function(h){if(!h){return}var g=(h==this.nextButton?"next-button":"previous-button")+this.options.overButtonSuffix;h.clickHandler=this.scroll.bind(this,(h==this.nextButton?-1:1)*f*this.elementSize);h.observe("click",h.clickHandler).observe("mouseover",function(){h.addClassName(g)}.bind(this)).observe("mouseout",function(){h.removeClassName(g)}.bind(this))},this);this.updateButtons()},destroy:function($super){[this.previousButton,this.nextButton].each(function(a){if(!a){return}a.stopObserving("click",a.clickHandler)},this);this.element.remove();this.fire("destroyed")},fire:function(b,a){a=a||{};a.carousel=this;return this.element.fire("carousel:"+b,a)},observe:function(a,b){this.element.observe("carousel:"+a,b.bind(this));return this},stopObserving:function(a,b){this.element.stopObserving("carousel:"+a,b);return this},checkScroll:function(a,g){if(a>0){a=0}else{var b=this.elements.last().positionedOffset()[this.posAttribute]+this.elementSize;var f=this.currentSize();if(a+b<f){a+=f-(a+b)}a=Math.min(a,0)}if(g){this.container.style[this.posAttribute]=a+"px"}return a},scroll:function(b){if(this.animating){return this}var a=this.currentPosition()+b;a=this.checkScroll(a,false);b=a-this.currentPosition();if(b!=0){this.animating=true;this.fire("scroll:started");var f=this;this.container.morph("opacity:0.5",{duration:0.2,afterFinish:function(){f.container.morph(f.posAttribute+": "+a+"px",{duration:0.4,delay:0.2,afterFinish:function(){f.container.morph("opacity:1",{duration:0.2,afterFinish:function(){f.animating=false;f.updateButtons().fire("scroll:ended",{shift:b/f.currentSize()})}})}})}})}return this},scrollTo:function(a){if(this.animating||a<0||a>this.elements.length||a==this.currentIndex()||isNaN(parseInt(a))){return this}return this.scroll((this.currentIndex()-a)*this.elementSize)},updateButtons:function(){this.updatePreviousButton();this.updateNextButton();return this},updatePreviousButton:function(){if(!this.previousButton){return}var a=this.currentPosition();var b="previous-button"+this.options.disabledButtonSuffix;if(this.previousButton.hasClassName(b)&&a!=0){this.previousButton.removeClassName(b);this.fire("previousButton:enabled")}if(!this.previousButton.hasClassName(b)&&a==0){this.previousButton.addClassName(b);this.fire("previousButton:disabled")}},updateNextButton:function(){if(!this.nextButton){return}var f=this.currentLastPosition();var a=this.currentSize();var b="next-button"+this.options.disabledButtonSuffix;if(this.nextButton.hasClassName(b)&&f!=a){this.nextButton.removeClassName(b);this.fire("nextButton:enabled")}if(!this.nextButton.hasClassName(b)&&f==a){this.nextButton.addClassName(b);this.fire("nextButton:disabled")}},computeElementSize:function(){return this.elements.first().getDimensions()[this.dimAttribute]},currentIndex:function(){return -this.currentPosition()/this.elementSize},currentLastPosition:function(){if(this.container.childElements().empty()){return 0}return this.currentPosition()+this.elements.last().positionedOffset()[this.posAttribute]+this.elementSize},currentPosition:function(){return this.container.getNumStyle(this.posAttribute)},currentSize:function(){return this.container.parentNode.getDimensions()[this.dimAttribute]},updateSize:function(){this.nbVisible=this.currentSize()/this.elementSize;var a=this.options.scrollInc;if(a=="auto"){a=Math.floor(this.nbVisible)}[this.previousButton,this.nextButton].each(function(b){if(!b){return}b.stopObserving("click",b.clickHandler);b.clickHandler=this.scroll.bind(this,(b==this.nextButton?-1:1)*a*this.elementSize);b.observe("click",b.clickHandler)},this);this.checkScroll(this.currentPosition(),true);this.updateButtons().fire("sizeUpdated");return this}});UI.Ajax.Carousel=Class.create(UI.Carousel,{options:{elementSize:-1,url:null},initialize:function($super,a,b){if(!b.url){throw ("url option is required for UI.Ajax.Carousel")}if(!b.elementSize){throw ("elementSize option is required for UI.Ajax.Carousel")}$super(a,b);this.endIndex=0;this.hasMore=true;this.updateHandler=this.update.bind(this);this.updateAndScrollHandler=function(g,h,f){this.update(h,f);this.scroll(g)}.bind(this);this.runRequest.bind(this).defer({parameters:{from:0,to:Math.ceil(this.nbVisible)-1},onSuccess:this.updateHandler})},runRequest:function(a){this.requestRunning=true;new Ajax.Request(this.options.url,Object.extend({method:"GET"},a));this.fire("request:started");return this},scroll:function($super,a){if(this.animating||this.requestRunning){return this}var b=(-a)/this.elementSize;if(this.hasMore&&b>0&&this.currentIndex()+this.nbVisible+b-1>this.endIndex){var g=this.endIndex+1;var f=Math.ceil(g+this.nbVisible-1);this.runRequest({parameters:{from:g,to:f},onSuccess:this.updateAndScrollHandler.curry(a).bind(this)});return this}else{$super(a)}},update:function(b,a){this.requestRunning=false;this.fire("request:ended");if(!a){a=b.responseJSON}this.hasMore=a.more;this.endIndex=Math.max(this.endIndex,a.to);this.elements=this.container.insert({bottom:a.html}).childElements();return this.updateButtons()},computeElementSize:function(){return this.options.elementSize},updateSize:function($super){var b=this.nbVisible;$super();if(Math.floor(this.nbVisible)-Math.floor(b)>=1&&this.hasMore){if(this.currentIndex()+Math.floor(this.nbVisible)>=this.endIndex){var a=Math.floor(this.currentIndex()+Math.floor(this.nbVisible)-this.endIndex);this.runRequest({parameters:{from:this.endIndex+1,to:this.endIndex+a},onSuccess:this.updateHandler})}}return this},updateNextButton:function($super){if(!this.nextButton){return}var f=this.currentLastPosition();var a=this.currentSize();var b="next-button"+this.options.disabledButtonSuffix;if(this.nextButton.hasClassName(b)&&f!=a){this.nextButton.removeClassName(b);this.fire("nextButton:enabled")}if(!this.nextButton.hasClassName(b)&&f==a&&!this.hasMore){this.nextButton.addClassName(b);this.fire("nextButton:disabled")}}});UI.Window=Class.create(UI.Options,{options:{theme:null,shadowTheme:null,id:null,windowManager:null,top:null,left:null,width:200,height:300,minHeight:100,minWidth:200,maxHeight:null,maxWidth:null,altitude:"front",resizable:true,draggable:true,wired:false,show:Element.show,hide:Element.hide,superflousEffects:!Object.isUndefined(window.Effect),shadow:false,activeOnClick:true,gridX:1,gridY:1,close:"destroy",minimize:"toggleFold",maximize:"toggleMaximize"},initialize:function(a){this.setOptions(a);this.windowManager=this.options.windowManager||UI.defaultWM;this.create();this.id=this.element.id;this.windowManager.register(this);this.render();if(this.options.activeOnClick){this.overlay.setStyle({zIndex:this.lastZIndex+1}).show()}},destroy:function($super){this.hide();if(this.centerOptions){Event.stopObserving(this.windowManager.scrollContainer,"scroll",this.centerOptions.handler)}this.windowManager.unregister(this);this.fire("destroyed")},fire:function(b,a){a=a||{};a.window=this;return(this.savedElement||this.element).fire("window:"+b,a)},observe:function(a,b){this.element.observe("window:"+a,b.bind(this));return this},show:function(a){if(this.visible){return this}this.fire("showing");this.effect("show");if(a){this.windowManager.startModalSession(this);this.modalSession=true}this.addElements();this.visible=true;new PeriodicalExecuter(function(b){if(!this.element.visible()){return}this.fire("shown");b.stop()}.bind(this),0.1);return this},hide:function(){if(!this.visible){return this}this.fire("hiding");this.effect("hide");if(this.modalSession){this.windowManager.endModalSession(this);this.modalSession=false}this.windowManager.hide(this);new PeriodicalExecuter(function(a){if(this.element.visible()){return}this.visible=false;this.element.remove();this.fire("hidden");a.stop()}.bind(this),0.1);return this},close:function(){return this.action("close")},activate:function(){return this.bringToFront().focus()},bringToFront:function(){return this.setAltitude("front")},sendToBack:function(){return this.setAltitude("back")},focus:function(){if(this.focused){return this}this.windowManager.focus(this);this.overlay.hide();this.element.addClassName(this.options.theme+"_focused");this.focused=true;this.fire("focused");return this},blur:function(){if(!this.focused){return this}this.windowManager.blur(this);this.element.removeClassName(this.options.theme+"_focused");if(this.options.activeOnClick){this.overlay.setStyle({zIndex:this.lastZIndex+1}).show()}this.focused=false;this.fire("blurred");return this},maximize:function(){if(this.maximized){return this}var b=this.getBounds();if(this.windowManager.maximize(this)){this.disableButton("minimize").setResizable(false).setDraggable(false);this.activate();this.maximized=true;this.savedArea=b;var a=Object.extend(this.windowManager.viewport.getDimensions(),{top:0,left:0});this[this.options.superflousEffects&&!Prototype.Browser.IE?"morph":"setBounds"](a);this.fire("maximized");return this}},restore:function(){if(!this.maximized){return this}if(this.windowManager.restore(this)){this[this.options.superflousEffects&&!Prototype.Browser.IE?"morph":"setBounds"](this.savedArea);this.enableButton("minimize").setResizable(true).setDraggable(true);this.maximized=false;this.fire("restored");return this}},toggleMaximize:function(){return this.maximized?this.restore():this.maximize()},adapt:function(){var a=this.content.getScrollDimensions();if(this.options.superflousEffects){this.morph(a,true)}else{this.setSize(a.width,a.height,true)}return this},fold:function(){if(!this.folded){var a=this.getSize(true);this.folded=true;this.savedInnerHeight=a.height;if(this.options.superflousEffects){this.morph({width:a.width,height:0},true)}else{this.setSize(a.width,0,true)}this.setResizable(false);this.fire("fold")}return this},unfold:function(){if(this.folded){var a=this.getSize(true);this.folded=false;if(this.options.superflousEffects){this.morph({width:a.width,height:this.savedInnerHeight},true)}else{this.setSize(a.width,this.savedInnerHeight,true)}this.setResizable(true);this.fire("unfold")}return this},toggleFold:function(){return this.folded?this.unfold():this.fold()},setHeader:function(a){this.header.update(a);return this},setContent:function(a){this.content.update(a);return this},setFooter:function(a){this.footer.update(a);return this},setAjaxContent:function(a,b){if(!b){b={}}Object.keys(b).each(function(g){if(Object.isFunction(b[g])){b[g]=b[g].bind(this)}},this);var f=b.onComplete;b.onComplete=(function(h,g){this.setContent(h.responseText);if(Object.isFunction(f)){f(h,g)}}).bind(this);new Ajax.Request(a,b);return this},getPosition:function(){return{left:this.options.left,top:this.options.top}},setPosition:function(f,b){var g=this.computePosition(f,b);this.options.top=g.top;this.options.left=g.left;var a=this.element.style;a.top=g.top+"px";a.left=g.left+"px";this.fire("position:changed");return this},center:function(f){var b=this.getSize(),g=this.windowManager,a=g.viewport;viewportArea=a.getDimensions(),offset=a.getScrollOffset();if(f&&f.auto){this.centerOptions=Object.extend({handler:this.recenter.bind(this)},f);Event.observe(this.windowManager.scrollContainer,"scroll",this.centerOptions.handler);Event.observe(window,"resize",this.centerOptions.handler)}f=Object.extend({top:(viewportArea.height-b.height)/2,left:(viewportArea.width-b.width)/2},f||{});return this.setPosition(f.top+offset.top,f.left+offset.left)},getSize:function(a){if(a){return{width:this.options.width-this.borderSize.width,height:this.options.height-this.borderSize.height}}else{return{width:this.options.width,height:this.options.height}}},setSize:function(h,j,g){var f=this.computeSize(h,j,g);var a=this.element.style,b=this.content.style;this.options.width=f.outerWidth;this.options.height=f.outerHeight;a.width=f.outerWidth+"px",a.height=f.outerHeight+"px";b.width=f.innerWidth+"px",b.height=f.innerHeight+"px";this.overlay.style.height=f.innerHeight+"px";this.fire("size:changed");return this},getBounds:function(a){return Object.extend(this.getPosition(),this.getSize(a))},setBounds:function(a,b){return this.setPosition(a.top,a.left).setSize(a.width,a.height,b)},morph:function(a,b){a=Object.extend(this.getBounds(b),a||{});if(this.centerOptions&&this.centerOptions.auto){a=Object.extend(a,this.computeRecenter(a))}if(b){a.width+=this.borderSize.width;a.height+=this.borderSize.height}this.animating=true;new UI.Window.Effects.Morph(this,a,{duration:0.5,afterFinish:function(){this.animating=false}.bind(this)});Object.extend(this.options,a);return this},getAltitude:function(){return this.windowManager.getAltitude(this)},setAltitude:function(a){if(this.windowManager.setAltitude(this,a)){this.fire("altitude:changed")}return this},setResizable:function(a){this.options.resizable=a;var b=(a?"add":"remove")+"ClassName";this.element[b]("resizable").select("div:[class*=_sizer]").invoke(a?"show":"hide");if(a){this.createResizeHandles()}this.element.select("div.se").first()[b]("se_resize_handle");return this},setDraggable:function(a){this.options.draggable=a;this.element[(a?"add":"remove")+"ClassName"]("draggable");return this},getTheme:function(){return this.options.theme||this.windowManager.getTheme()},setTheme:function(b,a){this.element.removeClassName(this.getTheme()).addClassName(b);if(!a){this.options.theme=b}return this},getShadowTheme:function(){return this.options.shadowTheme||this.windowManager.getShadowTheme()}});UI.Window.addMethods(UI.Window.Buttons);UI.Window.addMethods(UI.Window.Shadow);UI.Window.optionsAccessor($w(" minWidth minHeight maxWidth maxHeight gridX gridY altitude "));UI.Window.addMethods({style:"position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;",action:function(b){var a=this.options[b];if(a){Object.isString(a)?this[a]():a.call(this,this)}},create:function(){function b(h,j){return new Element("div",Object.extend({className:h},j))}this.element=b("ui-window "+this.getTheme(),{id:this.options.id,style:"top:-10000px; left:-10000px"});this.header=b("n move_handle").enableDrag();this.content=b("content").appendText(" ");this.footer=b("s move_handle").enableDrag();var g=b("nw").insert(b("ne").insert(this.header));var a=b("w").insert(b("e",{style:"position:relative"}).insert(this.content));var f=b("sw").insert(b("se"+(this.options.resizable?" se_resize_handle":"")).insert(this.footer));this.element.insert(g).insert(a).insert(f).identify("ui-window");this.header.observe("mousedown",this.activate.bind(this));this.setDraggable(this.options.draggable);this.setResizable(this.options.resizable);this.overlay=new Element("div",{style:this.style+"display: none"}).observe("mousedown",this.activate.bind(this));if(this.options.activeOnClick){this.content.insert({before:this.overlay})}},createWiredElement:function(){this.wiredElement=this.wiredElement||new Element("div",{className:this.getTheme()+"_wired",style:"display: none; position: absolute; top: 0; left: 0"})},createResizeHandles:function(){$w(" n  w  e  s  nw  ne  sw  se ").each(function(a){this.insert(new Element("div",{className:a+"_sizer resize_handle",drag_prefix:a}).enableDrag())},this.element);this.createResizeHandles=Prototype.emptyFunction},render:function(){this.addElements();this.computeBorderSize();this.updateButtonsOrder();this.element.hide().remove();return this.setBounds(this.options)},addElements:function(){this.windowManager.container.appendChild(this.element)},setZIndex:function(a){if(this.zIndex!=a){this.zIndex=a;[this.element].concat(this.element.childElements()).each(function(b){b.style.zIndex=a++});this.lastZIndex=a}return this},effect:function(f,b,g){var a=this.options[f]||Prototype.emptyFunction;a(b||this.element,g||{})},computeBorderSize:function(){if(this.element){if(Prototype.Browser.IEVersion>=7){this.content.style.width="100%"}var a=this.element.getDimensions(),b=this.content.positionedOffset();this.borderSize={top:b[1],bottom:a.height-b[1]-this.content.getHeight(),left:b[0],right:a.width-b[0]-this.content.getWidth()};this.borderSize.width=this.borderSize.left+this.borderSize.right;this.borderSize.height=this.borderSize.top+this.borderSize.bottom;if(Prototype.Browser.IEVersion>=7){this.content.style.width="auto"}}},computeSize:function(f,h,b){var a,k,j,g;if(b){j=f+this.borderSize.width;g=h+this.borderSize.height}else{j=f;g=h}if(!this.animating){j=j.snap(this.options.gridX);g=g.snap(this.options.gridY);if(!this.folded){if(j<this.options.minWidth){j=this.options.minWidth}if(g<this.options.minHeight){g=this.options.minHeight}}if(this.options.maxWidth&&j>this.options.maxWidth){j=this.options.maxWidth}if(this.options.maxHeight&&g>this.options.maxHeight){g=this.options.maxHeight}}if(this.centerOptions&&this.centerOptions.auto){this.recenter()}a=j-this.borderSize.width;k=g-this.borderSize.height;return{innerWidth:a,innerHeight:k,outerWidth:j,outerHeight:g}},computePosition:function(b,a){if(this.centerOptions&&this.centerOptions.auto){return this.computeRecenter(this.getSize())}return{top:this.animating?b:b.snap(this.options.gridY),left:this.animating?a:a.snap(this.options.gridX)}},computeRecenter:function(b){var a=this.windowManager.viewport,f=a.getDimensions(),h=a.getScrollOffset(),g={top:Object.isUndefined(this.centerOptions.top)?(f.height-b.height)/2:this.centerOptions.top,left:Object.isUndefined(this.centerOptions.left)?(f.width-b.width)/2:this.centerOptions.left};return{top:parseInt(g.top+h.top),left:parseInt(g.left+h.left)}},recenter:function(a){var b=this.computeRecenter(this.getSize());this.setPosition(b.top,b.left)}});UI.Window.addMethods({startDrag:function(a){this.initBounds=this.getBounds();this.activate();if(this.options.wired){this.createWiredElement();this.wiredElement.style.cssText=this.element.style.cssText;this.element.hide();this.saveElement=this.element;this.windowManager.container.appendChild(this.wiredElement);this.element=this.wiredElement}a.hasClassName("resize_handle")?this.startResize(a):this.startMove()},endDrag:function(){this.element.hasClassName("resized")?this.endResize():this.endMove();if(this.options.wired){this.saveElement.style.cssText=this.wiredElement.style.cssText;this.wiredElement.remove();this.element=this.saveElement;this.saveElement=false}},startMove:function(){this.drag=this.moveDrag;this.element.addClassName("moved");this.fire("move:started")},endMove:function(){this.element.removeClassName("moved");this.fire("move:ended")},startResize:function(a){this.drag=this[a.readAttribute("drag_prefix")+"Drag"];this.element.addClassName("resized");this.fire("resize:started")},endResize:function(){this.element.removeClassName("resized");this.fire("resize:ended")},moveDrag:function(b,a){this.setPosition(this.initBounds.top+a,this.initBounds.left+b)},swDrag:function(f,a){var b=this.initBounds;this.setSize(b.width-f,b.height+a).setPosition(b.top,b.left+(b.width-this.getSize().width))},seDrag:function(b,a){this.setSize(this.initBounds.width+b,this.initBounds.height+a)},nwDrag:function(f,a){var b=this.initBounds;this.setSize(b.width-f,b.height-a).setPosition(b.top+(b.height-this.getSize().height),b.left+(b.width-this.getSize().width))},neDrag:function(f,a){var b=this.initBounds;this.setSize(b.width+f,b.height-a).setPosition(b.top+(b.height-this.getSize().height),b.left)},wDrag:function(f,a){var b=this.initBounds;this.setSize(b.width-f,b.height).setPosition(b.top,b.left+(b.width-this.getSize().width))},eDrag:function(b,a){this.setSize(this.initBounds.width+b,this.initBounds.height)},nDrag:function(f,a){var b=this.initBounds;this.setSize(b.width,b.height-a).setPosition(b.top+(b.height-this.getSize().height),b.left)},sDrag:function(b,a){this.setSize(this.initBounds.width,this.initBounds.height+a)}});UI.Window.addMethods({methodsAdded:function(a){a.aliasMethodChain("create","buttons");a.aliasMethodChain("destroy","buttons")},createWithButtons:function(){this.createWithoutButtons();if(!this.options.resizable){this.options.minimize=false;this.options.maximize=false}this.buttons=new Element("div",{className:"buttons"}).observe("click",this.onButtonsClick.bind(this)).observe("mouseover",this.onButtonsHover.bind(this)).observe("mouseout",this.onButtonsOut.bind(this));this.element.insert(this.buttons);this.defaultButtons.each(function(a){if(this.options[a]!==false){this.addButton(a)}},this)},destroyWithButtons:function(){this.buttons.stopObserving();this.destroyWithoutButtons()},defaultButtons:$w(" minimize maximize close "),getButtonElement:function(a){return this.buttons.down("."+a)},addButton:function(b,a){this.buttons.insert(new Element("a",{className:b,href:"#"}));if(a){this.options[b]=a}return this},removeButton:function(a){this.getButtonElement(a).remove();return this},disableButton:function(a){this.getButtonElement(a).addClassName("disabled");return this},enableButton:function(a){this.getButtonElement(a).removeClassName("disabled");return this},onButtonsClick:function(b){var a=b.findElement("a:not(.disabled)");if(a){this.action(a.className)}b.stop()},onButtonsHover:function(a){this.buttons.addClassName("over")},onButtonsOut:function(a){this.buttons.removeClassName("over")},updateButtonsOrder:function(){var a=this.buttons.childElements();a.inject(new Array(a.length),function(f,b){f[parseInt(b.getStyle("padding-top"))]=b.setStyle("padding: 0");return f}).each(function(b){this.buttons.insert(b)},this)}});UI.Window.addMethods({methodsAdded:function(a){(function(b){$w(b).each(function(f){a.aliasMethodChain(f,"shadow")})})(" create addElements setZIndex setPosition setSize setBounds ")},showShadow:function(){if(this.shadow){this.shadow.hide();this.effect("show",this.shadow.shadow)}},hideShadow:function(){if(this.shadow){this.effect("hide",this.shadow.shadow)}},removeShadow:function(){if(this.shadow){this.shadow.remove()}},focusShadow:function(){if(this.shadow){this.shadow.focus()}},blurShadow:function(){if(this.shadow){this.shadow.blur()}},createWithShadow:function(){this.createWithoutShadow();this.observe("showing",this.showShadow).observe("hiding",this.hideShadow).observe("hidden",this.removeShadow).observe("focused",this.focusShadow).observe("blurred",this.blurShadow);if(this.options.shadow){this.shadow=new UI.Shadow(this.element,{theme:this.getShadowTheme()})}},addElementsWithShadow:function(){this.addElementsWithoutShadow();if(this.shadow){this.shadow.setBounds(this.options).render()}},setZIndexWithShadow:function(a){if(this.zIndex!=a){if(this.shadow){this.shadow.setZIndex(a-1)}this.setZIndexWithoutShadow(a);this.zIndex=a}return this},setPositionWithShadow:function(b,a){this.setPositionWithoutShadow(b,a);if(this.shadow){var f=this.getPosition();this.shadow.setPosition(f.top,f.left)}return this},setSizeWithShadow:function(f,g,b){this.setSizeWithoutShadow(f,g,b);if(this.shadow){var a=this.getSize();this.shadow.setSize(a.width,a.height)}return this},setBoundsWithShadow:function(a,b){this.setBoundsWithoutShadow(a,b);if(this.shadow){this.shadow.setBounds(this.getBounds())}}});UI.WindowManager=Class.create(UI.Options,{options:{container:null,zIndex:0,theme:"alphacube",shadowTheme:"mac_shadow",showOverlay:Element.show,hideOverlay:Element.hide,positionningStrategy:function(b,a){UI.WindowManager.DumbPositionningStrategy(b,a)}},initialize:function(a){this.setOptions(a);this.container=$(this.options.container||document.body);if(this.container===$(document.body)){this.viewport=document.viewport;this.scrollContainer=window}else{this.viewport=this.scrollContainer=this.container}this.container.observe("drag:started",this.onStartDrag.bind(this)).observe("drag:updated",this.onDrag.bind(this)).observe("drag:ended",this.onEndDrag.bind(this));this.stack=new UI.WindowManager.Stack();this.modalSessions=0;this.createOverlays();this.resizeEvent=this.resize.bind(this);Event.observe(window,"resize",this.resizeEvent)},destroy:function(){this.windows().invoke("destroy");this.stack.destroy();Event.stopObserving(window,"resize",this.resizeEvent)},setTheme:function(a){this.stack.windows.select(function(b){return !b.options.theme}).invoke("setTheme",a,true);this.options.theme=a;return this},register:function(a){if(this.getWindow(a.id)){return}this.handlePosition(a);this.stack.add(a);this.restartZIndexes()},unregister:function(a){this.stack.remove(a);if(a==this.focusedWindow){this.focusedWindow=null}},getWindow:function(a){a=$(a);if(!a){return}if(!a.hasClassName("ui-window")){a=a.up(".ui-window")}var b=a.id;return this.stack.windows.find(function(f){return f.id==b})},windows:function(){return this.stack.windows.clone()},getFocusedWindow:function(){return this.focusedWindow},startModalSession:function(a){if(!this.modalSessions){this.removeOverflow();this.modalOverlay.className=a.getTheme()+"_overlay";this.container.appendChild(this.modalOverlay);if(!this.modalOverlay.opacity){this.modalOverlay.opacity=this.modalOverlay.getOpacity()}this.modalOverlay.setStyle("height: "+this.viewport.getHeight()+"px");this.options.showOverlay(this.modalOverlay,{from:0,to:this.modalOverlay.opacity})}this.modalOverlay.setStyle({zIndex:a.zIndex-1});this.modalSessions++},endModalSession:function(a){this.modalSessions--;if(this.modalSessions){this.modalOverlay.setStyle({zIndex:this.stack.getPreviousWindow(a).zIndex-1})}else{this.resetOverflow();this.options.hideOverlay(this.modalOverlay,{from:this.modalOverlay.opacity,to:0})}},moveHandleSelector:".ui-window.draggable .move_handle",resizeHandleSelector:".ui-window.resizable .resize_handle",onStartDrag:function(g){var a=g.element(),f=a.match(this.moveHandleSelector),b=a.match(this.resizeHandleSelector);if(b||f){g.stop();var h=this.getWindow(g.findElement(".ui-window"));this.container.insert(this.dragOverlay.setStyle({zIndex:this.getLastZIndex()}));h.startDrag(a);this.draggedWindow=h}},onDrag:function(a){if(this.draggedWindow){a.stop();this.draggedWindow.drag(a.memo.dx,a.memo.dy)}},onEndDrag:function(a){if(this.draggedWindow){a.stop();this.dragOverlay.remove();this.draggedWindow.endDrag();this.draggedWindow=null}},maximize:function(a){this.removeOverflow();this.maximizedWindow=a;return true},restore:function(a){if(this.maximizedWindow){this.resetOverflow();this.maximizedWindow=false}return true},removeOverflow:function(){var a=this.container;a.savedOverflow=a.style.overflow||"auto";a.savedOffset=this.viewport.getScrollOffset();a.style.overflow="hidden";this.viewport.setScrollOffset({top:0,left:0});if(this.container==document.body&&Prototype.Browser.IE){this.cssRule=CSS.addRule("html { overflow: hidden }")}},resetOverflow:function(){var a=this.container;if(a.savedOverflow){if(this.container==document.body&&Prototype.Browser.IE){this.cssRule.remove()}a.style.overflow=a.savedOverflow;this.viewport.setScrollOffset(a.savedOffset);a.savedOffset=a.savedOverflow=null}},hide:function(b){var a=this.stack.getPreviousWindow(b);if(a){a.focus()}},restartZIndexes:function(){var a=this.getZIndex()+1;this.stack.windows.each(function(b){b.setZIndex(a);a=b.lastZIndex+1})},getLastZIndex:function(){return this.stack.getFrontWindow().lastZIndex+1},overlayStyle:"position: absolute; top: 0; left: 0; display: none; width: 100%;",createOverlays:function(){this.modalOverlay=new Element("div",{style:this.overlayStyle});this.dragOverlay=new Element("div",{style:this.overlayStyle+"height: 100%"})},focus:function(a){if(this.focusedWindow){this.focusedWindow.blur()}this.focusedWindow=a},blur:function(a){if(a==this.focusedWindow){this.focusedWindow=null}},setAltitude:function(f,b){var a=this.stack;if(b==="front"){if(a.getFrontWindow()===f){return}a.bringToFront(f)}else{if(b==="back"){if(a.getBackWindow()===f){return}a.sendToBack(f)}else{if(a.getPosition(f)==b){return}a.setPosition(f,b)}}this.restartZIndexes();return true},getAltitude:function(a){return this.stack.getPosition(a)},resize:function(b){var a=this.viewport.getDimensions();if(this.maximizedWindow){this.maximizedWindow.setSize(a.width,a.height)}if(this.modalOverlay.visible()){this.modalOverlay.setStyle("height:"+a.height+"px")}},handlePosition:function(b){if(Object.isNumber(b.options.top)&&Object.isNumber(b.options.left)){return}var f=this.options.positionningStrategy,a=this.viewport.getDimensions();Object.isFunction(f)?f(b,a):f.position(b,a)}});UI.WindowManager.DumbPositionningStrategy=function(g,a){size=g.getSize();var f=a.height-size.height,b=a.width-size.width;f=f<0?0:Math.random()*f;b=b<0?0:Math.random()*b;g.setPosition(f,b)};UI.WindowManager.optionsAccessor("zIndex","theme","shadowTheme");UI.WindowManager.Stack=Class.create(Enumerable,{initialize:function(){this.windows=[]},each:function(a){this.windows.each(a)},add:function(b,a){this.windows.splice(a||this.windows.length,0,b)},remove:function(a){this.windows=this.windows.without(a)},sendToBack:function(a){this.remove(a);this.windows.unshift(a)},bringToFront:function(a){this.remove(a);this.windows.push(a)},getPosition:function(a){return this.windows.indexOf(a)},setPosition:function(b,a){this.remove(b);this.windows.splice(a,0,b)},getFrontWindow:function(){return this.windows.last()},getBackWindow:function(){return this.windows.first()},getPreviousWindow:function(a){return(a==this.windows.first())?null:this.windows[this.windows.indexOf(a)-1]}});document.whenReady(function(){UI.defaultWM=new UI.WindowManager()});String.prototype.trim=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")};var gthis=(function(){return this})();var clientHeight=700;Event.observe(document,"dom:loaded",loadWinManager);function loadWinManager(){clientHeight=getClientHeight();if(typeof UI!="undefined"){UI.Window.setOptions({windowManager:new UI.WindowManager({zIndex:1000})})}}var lightboxWin;function openLightbox(a,l,k,f,g,j,h){windowBrowserFix=false;var b={minimize:windowBrowserFix,maximize:windowBrowserFix,resizable:windowBrowserFix,draggable:false,superflousEffects:false};if(!Object.isUndefined(f)){b.width=f}if(!Object.isUndefined(g)){b.height=g}if(!Object.isUndefined(j)){b.top=j}if(!Object.isUndefined(h)){b.left=h}lightboxWin=new UI.Window(b).show(true).focus();lightboxWin.observe("position:changed",function(){if(lightboxWin.getPosition().top>200){lightboxWin.setPosition(190,lightboxWin.getPosition().left)}});if(Object.isUndefined(j)&&Object.isUndefined(h)){lightboxWin.center()}lightboxWin.setAjaxContent(a,{onComplete:function(){this.adapt().center()}});if(!Prototype.Browser.IE){lightboxWin.observe("hidden",function(){j-=20;h-=20})}return lightboxWin}var lightboxWinLarge;function openLightboxLarge(a,f,b){openLightbox(a,f,b)}var lightboxWinMedium;function openLightboxMedium(a,f,b){openLightbox(a,f,b)}var lightboxWinSmall;function openLightboxSmall(a,f,b){openLightbox(a,f,b)}var alertWin;function openLightboxAlert(a){source="/inc/ui/alert.php";var b;if(a==""){a="Your request has been completed"}windowBrowserFix=false;alertWin=new UI.Window({width:420,minimize:windowBrowserFix,maximize:windowBrowserFix,resizable:windowBrowserFix,draggable:false}).show(true).center().focus().setAjaxContent(source,{method:"POST",parameters:{header:"Message",body:a},onCreate:function(){this.setContent('<div class="message">Please wait...</div><div class="spinner"></div>')},onComplete:function(){this.adapt()}});if(!Prototype.Browser.IE){alertWin.observe("hidden",function(){top-=20;b-=20})}}var imgWin=null;function openLightboxImage(a,f,g,b,j){if(typeof f==="undefined"){f=700}if(typeof g==="undefined"){g=400}if(typeof b!=="undefined"){centerOptions={top:b}}lleft=Math.max((window.innerWidth-f)/2,0);if(typeof j==="undefined"){j=""}markup='<img src="'+a+'" alt="'+j+'" title="'+j+'" />';windowBrowserFix=false;if(imgWin!==null&&imgWin.visible){imgWin.hide()}imgWin=new UI.Window({top:b,left:lleft,width:f,height:g,minimize:windowBrowserFix,maximize:windowBrowserFix,resizable:windowBrowserFix,draggable:true}).show(true).focus().setContent(markup);var h;if(!Prototype.Browser.IE){imgWin.observe("hidden",function(){top-=20;h-=20})}}var spinnerWin;function openLightboxSpinner(){source="/inc/ui/automashup_spinner.php";windowBrowserFix=false;var a=420;var b=280;spinnerWin=new UI.Window({width:a,height:b,minimize:windowBrowserFix,maximize:windowBrowserFix,resizable:windowBrowserFix,draggable:false,close:false}).show(true).focus();var g=Math.max((window.innerHeight-b)/2,0);g=Math.min(g,200);var f=Math.max((window.innerWidth-a)/2,0);spinnerWin.setPosition(g,f);spinnerWin.setAjaxContent(source,{method:"GET",parameters:{header:"Message"}});if(!Prototype.Browser.IE){spinnerWin.observe("hidden",function(){g-=20;f-=20})}}var videoWin;function openLightboxVideo(a){var b;height=(clientHeight<500)?clientHeight:500;windowBrowserFix=false;source="/inc/ui/video_player.php";videoWin=new UI.Window({width:height,height:500,top:100,minimize:windowBrowserFix,maximize:windowBrowserFix,resizable:windowBrowserFix,draggable:false}).show().center().setAjaxContent(source,{method:"GET",parameters:{url:a},onCreate:function(){this.setContent('<div class="message">Please wait...</div><div class="spinner"></div>')}});if(!Prototype.Browser.IE){videoWin.observe("hidden",function(){top-=20;b-=20})}}function ajaxUpdate(url,target){$(target).startWaiting();new Ajax.Updater(target,url,{onComplete:function(response){$(target).stopWaiting();if($("evalJS")){eval($("evalJS").innerHTML)}},method:"post"})}function ajaxFormSubmit(a,b){openLightboxLoading();$(a).request({onComplete:function(f){response=f.responseText;if(b=="reload"){window.parent.location.reload()}else{closeLightboxLoading();window.parent.openLightboxAlert(f.responseText)}}})}function getClientWidth(){return document.compatMode=="CSS1Compat"&&!window.opera?document.documentElement.clientWidth:document.body.clientWidth}function getClientHeight(){return document.compatMode=="CSS1Compat"&&!window.opera?document.documentElement.clientHeight:document.body.clientHeight}var loadingWin;function openLightboxLoading(){$("lb_wrapper").offsetParent.startWaiting()}function closeLightboxLoading(){$("lb_wrapper").offsetParent.stopWaiting()}function showButtons(a){for(i=0;i<a.length;i++){a[i].show()}}function hideButtons(a){for(i=0;i<a.length;i++){a[i].hide()}}function isEmail(f){var b=f.trim();var g=/^([-A-Z0-9_]+\.)*[-A-Z0-9_]+\@([A-Z0-9][-A-Z0-9]*\.)+[A-Z]{2,4}$/i;if(b==""){return"You must provide an email address"}else{if(g.test(b)==false){return"The given email address is not formatted correctly"}else{return""}}}function isDate(b){var g=/^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;var f=b.match(g);if(f==null){alert("Please enter date as either mm/dd/yyyy or mm-dd-yyyy.");$("byear").value="";return false}month=f[1];day=f[3];year=f[5];if(month<1||month>12){alert("Month must be between 1 and 12.");$("bmonth").value="";return false}if(day<1||day>31){alert("Day must be between 1 and 31.");$("bday").value="";return false}if((month==4||month==6||month==9||month==11)&&day==31){alert("Month "+month+" doesn`t have 31 days!");$("bday").value="";return false}if(month==2){var a=(year%4==0&&(year%100!=0||year%400==0));if(day>29||(day==29&&!a)){alert("February "+year+" doesn`t have "+day+" days!");$("bday").value="";return false}}return true}function validZip(a){if(a.match(/^[0-9]{5}$/)){return true}if(a.match(/^[0-9]{9}$/)){return true}a=a.toUpperCase();if(a.match(/^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$/)){return true}if(a.match(/^[A-Z][0-9][A-Z].[0-9][A-Z][0-9]$/)){return true}if(a==""){return true}return false}function trace(a){if(typeof(jsTrace)!="undefined"){jsTrace.send(a)}}function rollmeover(a){src=$(a).src;if(src.indexOf(".gif")>0){$(a).src=$(a).src.replace(".gif","_over.gif")}else{if(src.indexOf(".png")>0){$(a).src=$(a).src.replace(".png","_over.png")}else{if(src.indexOf(".jpg")>0){$(a).src=$(a).src.replace(".jpg","_over.jpg")}}}}function rollmeout(a){$(a).src=$(a).src.replace("_over","")}function restore(){}function dynamicJsLoad(b){var a=$$("head")[0];if(a){if(!$(b)){var f=new Element("script",{type:"text/javascript",src:b,id:b});a.appendChild(f)}}}function dynamicCssLoad(b){var a=$$("head")[0];if(a){if(!$(b)){var f=new Element("link",{type:"text/css",href:b,id:b,rel:"stylesheet"});a.appendChild(f)}}}function facebookLogin(a,b){if(b==undefined){b=facebook_onlogin_ready}FB.login(b,{scope:a});checkFBLogin()}function facebookLoginFromLightbox(a){new Ajax.Request("/inc/app/open_fb_login.php",{method:"post",parameters:{},onSuccess:function(b){window.parent.location.reload()}})}function facebookLogout(){FB.getLoginStatus(function(a){if(a.AuthResponse){FB.logout(function(b){window.parent.location="/inc/app/logout.php"})}else{window.parent.location="/inc/app/logout.php"}})}function checkFBLogin(){new Ajax.Request("/inc/app/fblogincheck.php",{method:"post",parameters:{},onSuccess:function(b){var a=b.responseText||"no response text";if(a=="logging into FB"){return false}}})}function loadSwfJs(a){dynamicJsLoad(a+"swfobject/swfobject.js");dynamicJsLoad(a+"swfobject/swfformfix.js");dynamicJsLoad(a+"swfsound/swfsound.js")}function loadUploadJs(a){dynamicJsLoad(a+"js/upload.js");dynamicJsLoad(a+"js/ajaxUpload.js")}function setVideoUrl(b,a){url="http://www.youtube.com/v/"+a+"&hl=en&fs=1&";html='<object width="425" height="344"><param name="movie" value="'+url+'"/><param name="allowFullScreen" value="true"/><param name="allowscriptaccess" value="always"/><param name="wmode" value="transparent"/><embed src="'+url+'" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>';$(b).innerHTML=html}function browserdetect(){var a=navigator.userAgent.toLowerCase();this.isIE=a.indexOf("msie")>-1;this.ieVer=this.isIE?/msie\s(\d\.\d)/.exec(a)[1]:0;this.isMoz=a.indexOf("firefox")!=-1;this.isSafari=a.indexOf("safari")!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf("BackCompat")>-1);this.isOp=window.opera?true:false;this.isWebKit=a.indexOf("webkit")!=-1;if(this.isIE){this.get_style=function(g,j){if(!(j in g.currentStyle)){return""}var f=/^([\d.]+)(\w*)/.exec(g.currentStyle[j]);if(!f){return g.currentStyle[j]}if(f[1]==0){return"0"}if(f[2]&&f[2]!=="px"){var b=g.style.left;var h=g.runtimeStyle.left;g.runtimeStyle.left=g.currentStyle.left;g.style.left=f[1]+f[2];f[0]=g.style.pixelLeft;g.style.left=b;g.runtimeStyle.left=h}return f[0]}}else{this.get_style=function(b,f){f=f.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(b,"").getPropertyValue(f)}}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}function curvyCnrSpec(a){this.selectorText=a;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=true}curvyCnrSpec.prototype.setcorner=function(a,b,g,f){if(!a){this.tlR=this.trR=this.blR=this.brR=parseInt(g);this.tlu=this.tru=this.blu=this.bru=f}else{propname=a.charAt(0)+b.charAt(0);this[propname+"R"]=parseInt(g);this[propname+"u"]=f}};curvyCnrSpec.prototype.get=function(g){if(/^(t|b)(l|r)(R|u)$/.test(g)){return this[g]}if(/^(t|b)(l|r)Ru$/.test(g)){var b=g.charAt(0)+g.charAt(1);return this[b+"R"]+this[b+"u"]}if(/^(t|b)Ru?$/.test(g)){var a=g.charAt(0);a+=this[a+"lR"]>this[a+"rR"]?"l":"r";var f=this[a+"R"];if(g.length===3&&g.charAt(2)==="u"){f+=this[a="u"]}return f}throw new Error("Don't recognize property "+g)};curvyCnrSpec.prototype.radiusdiff=function(a){if(a!=="t"&&a!=="b"){throw new Error("Param must be 't' or 'b'")}return Math.abs(this[a+"lR"]-this[a+"rR"])};curvyCnrSpec.prototype.setfrom=function(a){this.tlu=this.tru=this.blu=this.bru="px";if("tl" in a){this.tlR=a.tl.radius}if("tr" in a){this.trR=a.tr.radius}if("bl" in a){this.blR=a.bl.radius}if("br" in a){this.brR=a.br.radius}if("antiAlias" in a){this.antiAlias=a.antiAlias}};curvyCnrSpec.prototype.cloneOn=function(k){var h=["tl","tr","bl","br"];var l=0;var f,a;for(f in h){if(!isNaN(f)){a=this[h[f]+"u"];if(a!==""&&a!=="px"){l=new curvyCnrSpec;break}}}if(!l){l=this}else{var b,g,j=curvyBrowser.get_style(k,"left");for(f in h){if(!isNaN(f)){b=h[f];a=this[b+"u"];g=this[b+"R"];if(a!=="px"){var j=k.style.left;k.style.left=g+a;g=k.style.pixelLeft;k.style.left=j}l[b+"R"]=g;l[b+"u"]="px"}}k.style.left=j}return l};curvyCnrSpec.prototype.radiusSum=function(a){if(a!=="t"&&a!=="b"){throw new Error("Param must be 't' or 'b'")}return this[a+"lR"]+this[a+"rR"]};curvyCnrSpec.prototype.radiusCount=function(a){var b=0;if(this[a+"lR"]){++b}if(this[a+"rR"]){++b}return b};curvyCnrSpec.prototype.cornerNames=function(){var a=[];if(this.tlR){a.push("tl")}if(this.trR){a.push("tr")}if(this.blR){a.push("bl")}if(this.brR){a.push("br")}return a};function operasheet(f){var a=document.styleSheets.item(f).ownerNode.text;a=a.replace(/\/\*(\n|\r|.)*?\*\//g,"");var g=new RegExp("^s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var k;this.rules=[];while((k=g.exec(a))!==null){var j=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var h,b=new curvyCnrSpec(k[1]);while((h=j.exec(k[2]))!==null){if(h[1]!=="z-"){b.setcorner(h[3],h[4],h[5],h[6])}}this.rules.push(b)}}operasheet.contains_border_radius=function(a){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(a).ownerNode.text)};function curvyCorners(){var m,k,g,b,o;if(typeof arguments[0]!=="object"){throw curvyCorners.newError("First parameter of curvyCorners() must be an object.")}if(arguments[0] instanceof curvyCnrSpec){b=arguments[0];if(!b.selectorText&&typeof arguments[1]==="string"){b.selectorText=arguments[1]}}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string"){throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.")}k=arguments[1];if(typeof k!=="string"){k=""}if(k!==""&&k.charAt(0)!=="."&&"autoPad" in arguments[0]){k="."+k}b=new curvyCnrSpec(k);b.setfrom(arguments[0])}if(b.selectorText){o=0;var n=b.selectorText.replace(/\s+$/,"").split(/,\s*/);g=new Array;function f(q){var j=q.split("#");return(j.length===2?"#":"")+j.pop()}for(m=0;m<n.length;++m){var p=f(n[m]);var a=p.split(" ");switch(p.charAt(0)){case"#":k=a.length===1?p:a[0];k=document.getElementById(k.substr(1));if(a.length===1){g.push(k)}else{g=g.concat(curvyCorners.getElementsByClass(a[1],k))}break;default:if(a.length===1){g=g.concat(curvyCorners.getElementsByClass(p))}else{var h=curvyCorners.getElementsByClass(a[0]);for(k=0;k<h.length;++k){g=g.concat(curvyCorners.getElementsByClass(a[1],h))}}}}}else{o=1;g=arguments}for(m=o,k=g.length;m<k;++m){if(g[m]&&(!("IEborderRadius" in g[m].style)||g[m].style.IEborderRadius!="set")){if(g[m].className&&g[m].className.indexOf("curvyRedraw")!==-1){if(typeof curvyCorners.redrawList==="undefined"){curvyCorners.redrawList=new Array}curvyCorners.redrawList.push({node:g[m],spec:b,copy:g[m].cloneNode(false)})}g[m].style.IEborderRadius="set";var l=new curvyObject(b,g[m]);l.applyCorners()}}}curvyCorners.prototype.applyCornersToAll=function(){curvyCorners.alert("This function is now redundant. Just call curvyCorners(). See documentation.")};curvyCorners.redraw=function(){if(!curvyBrowser.isOp&&!curvyBrowser.isIE){return}if(!curvyCorners.redrawList){throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.")}var g=curvyCorners.bock_redraw;curvyCorners.block_redraw=true;for(var b in curvyCorners.redrawList){if(isNaN(b)){continue}var h=curvyCorners.redrawList[b];if(!h.node.clientWidth){continue}var f=h.copy.cloneNode(false);for(var a=h.node.firstChild;a!=null;a=a.nextSibling){if(a.className==="autoPadDiv"){break}}if(!a){curvyCorners.alert("Couldn't find autoPad DIV");break}h.node.parentNode.replaceChild(f,h.node);while(a.firstChild){f.appendChild(a.removeChild(a.firstChild))}h=new curvyObject(h.spec,h.node=f);h.applyCorners()}curvyCorners.block_redraw=g};curvyCorners.adjust=function(obj,prop,newval){if(curvyBrowser.isOp||curvyBrowser.isIE){if(!curvyCorners.redrawList){throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.")}var i,j=curvyCorners.redrawList.length;for(i=0;i<j;++i){if(curvyCorners.redrawList[i].node===obj){break}}if(i===j){throw curvyCorners.newError("Object not redrawable")}obj=curvyCorners.redrawList[i].copy}if(prop.indexOf(".")===-1){obj[prop]=newval}else{eval("obj."+prop+"='"+newval+"'")}};curvyCorners.handleWinResize=function(){if(!curvyCorners.block_redraw){curvyCorners.redraw()}};curvyCorners.setWinResize=function(a){curvyCorners.block_redraw=!a};curvyCorners.newError=function(a){return new Error("curvyCorners Error:\n"+a)};curvyCorners.alert=function(a){if(typeof curvyCornersVerbose==="undefined"||curvyCornersVerbose){alert(a)}};function curvyObject(){var C;this.box=arguments[1];this.settings=arguments[0];this.topContainer=this.bottomContainer=this.shell=C=null;var h=this.box.clientWidth;if(!h&&curvyBrowser.isIE){this.box.style.zoom=1;h=this.box.clientWidth}if(!h){if(!this.box.parentNode){throw this.newError("box has no parent!")}for(C=this.box;;C=C.parentNode){if(!C||C.tagName==="BODY"){this.applyCorners=function(){};curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return}if(C.style.display==="none"){break}}C.style.display="block";h=this.box.clientWidth}if(arguments[0] instanceof curvyCnrSpec){this.spec=arguments[0].cloneOn(this.box)}else{this.spec=new curvyCnrSpec("");this.spec.setfrom(this.settings)}var J=curvyBrowser.get_style(this.box,"borderTopWidth");var p=curvyBrowser.get_style(this.box,"borderBottomWidth");var j=curvyBrowser.get_style(this.box,"borderLeftWidth");var b=curvyBrowser.get_style(this.box,"borderRightWidth");var o=curvyBrowser.get_style(this.box,"borderTopColor");var m=curvyBrowser.get_style(this.box,"borderBottomColor");var r=curvyBrowser.get_style(this.box,"borderLeftColor");var k=curvyBrowser.get_style(this.box,"backgroundColor");var g=curvyBrowser.get_style(this.box,"backgroundImage");var G=curvyBrowser.get_style(this.box,"backgroundRepeat");if(this.box.currentStyle&&this.box.currentStyle.backgroundPositionX){var x=curvyBrowser.get_style(this.box,"backgroundPositionX");var w=curvyBrowser.get_style(this.box,"backgroundPositionY")}else{var x=curvyBrowser.get_style(this.box,"backgroundPosition");x=x.split(" ");var w=x[1];x=x[0]}var a=curvyBrowser.get_style(this.box,"position");var y=curvyBrowser.get_style(this.box,"paddingTop");var v=curvyBrowser.get_style(this.box,"paddingBottom");var H=curvyBrowser.get_style(this.box,"paddingLeft");var I=curvyBrowser.get_style(this.box,"paddingRight");var F=curvyBrowser.get_style(this.box,"border");filter=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,"filter"):null;var n=this.spec.get("tR");var f=this.spec.get("bR");var D=function(L){if(typeof L==="number"){return L}if(typeof L!=="string"){throw new Error("unexpected styleToNPx type "+typeof L)}var K=/^[-\d.]([a-z]+)$/.exec(L);if(K&&K[1]!="px"){throw new Error("Unexpected unit "+K[1])}if(isNaN(L=parseInt(L))){L=0}return L};var B=function(K){return K<=0?"0":K+"px"};try{this.borderWidth=D(J);this.borderWidthB=D(p);this.borderWidthL=D(j);this.borderWidthR=D(b);this.boxColour=curvyObject.format_colour(k);this.topPadding=D(y);this.bottomPadding=D(v);this.leftPadding=D(H);this.rightPadding=D(I);this.boxWidth=h;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(o);this.borderColourB=curvyObject.format_colour(m);this.borderColourL=curvyObject.format_colour(r);this.borderString=this.borderWidth+"px solid "+this.borderColour;this.borderStringB=this.borderWidthB+"px solid "+this.borderColourB;this.backgroundImage=((g!="none")?g:"");this.backgroundRepeat=G}catch(E){throw this.newError("getMessage" in E?E.getMessage():E.message)}var l=this.boxHeight;var A=h;if(curvyBrowser.isOp){x=D(x);w=D(w);if(x){var s=A+this.borderWidthL+this.borderWidthR;if(x>s){x=s}x=(s/x*100)+"%"}if(w){var s=l+this.borderWidth+this.borderWidthB;if(w>s){w=s}w=(s/w*100)+"%"}}if(curvyBrowser.quirksMode){}else{this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding}this.contentContainer=document.createElement("div");if(filter){this.contentContainer.style.filter=filter}while(this.box.firstChild){this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild))}if(a!="absolute"){this.box.style.position="relative"}this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=(A+this.borderWidthL+this.borderWidthR)+"px";this.box.style.height=(l+this.borderWidth+this.borderWidthB)+"px";var q=document.createElement("div");q.style.position="absolute";if(filter){q.style.filter=filter}if(curvyBrowser.quirksMode){q.style.width=(A+this.borderWidthL+this.borderWidthR)+"px"}else{q.style.width=A+"px"}q.style.height=B(l+this.borderWidth+this.borderWidthB-n-f);q.style.padding="0";q.style.top=n+"px";q.style.left="0";if(this.borderWidthL){q.style.borderLeft=this.borderWidthL+"px solid "+this.borderColourL}if(this.borderWidth&&!n){q.style.borderTop=this.borderWidth+"px solid "+this.borderColour}if(this.borderWidthR){q.style.borderRight=this.borderWidthR+"px solid "+this.borderColourL}if(this.borderWidthB&&!f){q.style.borderBottom=this.borderWidthB+"px solid "+this.borderColourB}q.style.backgroundColor=k;q.style.backgroundImage=this.backgroundImage;q.style.backgroundRepeat=this.backgroundRepeat;this.shell=this.box.appendChild(q);h=curvyBrowser.get_style(this.shell,"width");if(h===""||h==="auto"||h.indexOf("%")!==-1){throw this.newError("Shell width is "+h)}this.boxWidth=(h!=""&&h!="auto"&&h.indexOf("%")==-1)?parseInt(h):this.shell.clientWidth;this.applyCorners=function(){if(this.backgroundObject){var K=function(aq,au,at){if(aq===0){return 0}var ar;if(aq==="right"||aq==="bottom"){return at-au}if(aq==="center"){return(at-au)/2}if(aq.indexOf("%")>0){return(at-au)*100/parseInt(aq)}return D(aq)};this.backgroundPosX=K(x,this.backgroundObject.width,A);this.backgroundPosY=K(w,this.backgroundObject.height,l)}else{if(this.backgroundImage){this.backgroundPosX=D(x);this.backgroundPosY=D(w)}}if(n){Z=document.createElement("div");Z.style.width=this.boxWidth+"px";Z.style.fontSize="1px";Z.style.overflow="hidden";Z.style.position="absolute";Z.style.paddingLeft=this.borderWidth+"px";Z.style.paddingRight=this.borderWidth+"px";Z.style.height=n+"px";Z.style.top=-n+"px";Z.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(Z)}if(f){var Z=document.createElement("div");Z.style.width=this.boxWidth+"px";Z.style.fontSize="1px";Z.style.overflow="hidden";Z.style.position="absolute";Z.style.paddingLeft=this.borderWidthB+"px";Z.style.paddingRight=this.borderWidthB+"px";Z.style.height=f+"px";Z.style.bottom=-f+"px";Z.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(Z)}var af=this.spec.cornerNames();for(var ai in af){if(!isNaN(ai)){var ad=af[ai];var ap=this.spec[ad+"R"];var an,al,Q,am;if(ad=="tr"||ad=="tl"){an=this.borderWidth;al=this.borderColour;am=this.borderWidth}else{an=this.borderWidthB;al=this.borderColourB;am=this.borderWidthB}Q=ap-am;var M=document.createElement("div");M.style.height=this.spec.get(ad+"Ru");M.style.width=this.spec.get(ad+"Ru");M.style.position="absolute";M.style.fontSize="1px";M.style.overflow="hidden";var Y,X,T;var U=filter?parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]):100;for(Y=0;Y<ap;++Y){var S=(Y+1>=Q)?-1:Math.floor(Math.sqrt(Math.pow(Q,2)-Math.pow(Y+1,2)))-1;if(Q!=ap){var R=(Y>=Q)?-1:Math.ceil(Math.sqrt(Math.pow(Q,2)-Math.pow(Y,2)));var O=(Y+1>=ap)?-1:Math.floor(Math.sqrt(Math.pow(ap,2)-Math.pow((Y+1),2)))-1}var L=(Y>=ap)?-1:Math.ceil(Math.sqrt(Math.pow(ap,2)-Math.pow(Y,2)));if(S>-1){this.drawPixel(Y,0,this.boxColour,U,(S+1),M,true,ap)}if(Q!=ap){if(this.spec.antiAlias){for(X=S+1;X<R;++X){if(this.backgroundImage!=""){var P=curvyObject.pixelFraction(Y,X,Q)*100;this.drawPixel(Y,X,al,U,1,M,P>=30,ap)}else{if(this.boxColour!=="transparent"){var ao=curvyObject.BlendColour(this.boxColour,al,curvyObject.pixelFraction(Y,X,Q));this.drawPixel(Y,X,ao,U,1,M,false,ap)}else{this.drawPixel(Y,X,al,U>>1,1,M,false,ap)}}}if(O>=R){if(R==-1){R=0}this.drawPixel(Y,R,al,U,(O-R+1),M,false,0)}T=al;X=O}else{if(O>S){this.drawPixel(Y,(S+1),al,U,(O-S),M,false,0)}}}else{T=this.boxColour;X=S}if(this.spec.antiAlias){while(++X<L){this.drawPixel(Y,X,T,(curvyObject.pixelFraction(Y,X,ap)*U),1,M,am<=0,ap)}}}for(var ab=0,ah=M.childNodes.length;ab<ah;++ab){var N=M.childNodes[ab];var ak=parseInt(N.style.top);var ag=parseInt(N.style.left);var ae=parseInt(N.style.height);if(ad=="tl"||ad=="bl"){N.style.left=(ap-ag-1)+"px"}if(ad=="tr"||ad=="tl"){N.style.top=(ap-ae-ak)+"px"}N.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage){switch(ad){case"tr":N.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL+ap-A-ag)+"px "+(this.backgroundPosY+ae+ak+this.borderWidth-ap)+"px";break;case"tl":N.style.backgroundPosition=(this.backgroundPosX-ap+ag+this.borderWidthL)+"px "+(this.backgroundPosY-ap+ae+ak+this.borderWidth)+"px";break;case"bl":N.style.backgroundPosition=(this.backgroundPosX-ap+ag+1+this.borderWidthL)+"px "+(this.backgroundPosY-l-this.borderWidth+(curvyBrowser.quirksMode?ak:-ak)+ap)+"px";break;case"br":if(curvyBrowser.quirksMode){N.style.backgroundPosition=(this.backgroundPosX+this.borderWidthL-A+ap-ag)+"px "+(this.backgroundPosY-l-this.borderWidth+ak+ap)+"px"}else{N.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL-A+ap-ag)+"px "+(this.backgroundPosY-l-this.borderWidth+ap-ak)+"px"}}}}switch(ad){case"tl":M.style.top=M.style.left="0";this.topContainer.appendChild(M);break;case"tr":M.style.top=M.style.right="0";this.topContainer.appendChild(M);break;case"bl":M.style.bottom=M.style.left="0";this.bottomContainer.appendChild(M);break;case"br":M.style.bottom=M.style.right="0";this.bottomContainer.appendChild(M)}}}var aa={t:this.spec.radiusdiff("t"),b:this.spec.radiusdiff("b")};for(z in aa){if(typeof z==="function"){continue}if(!this.spec.get(z+"R")){continue}if(aa[z]){if(this.backgroundImage&&this.spec.radiusSum(z)!==aa[z]){var aj=(this.spec[z+"lR"]<this.spec[z+"rR"])?z+"l":z+"r"}var W=document.createElement("div");W.style.height=aa[z]+"px";W.style.width=this.spec.get(aj+"Ru");W.style.position="absolute";W.style.fontSize="1px";W.style.overflow="hidden";W.style.backgroundColor=this.boxColour;switch(aj){case"tl":W.style.bottom=W.style.left="0";W.style.borderLeft=this.borderString;this.topContainer.appendChild(W);break;case"tr":W.style.bottom=W.style.right="0";W.style.borderRight=this.borderString;this.topContainer.appendChild(W);break;case"bl":W.style.top=W.style.left="0";W.style.borderLeft=this.borderStringB;this.bottomContainer.appendChild(W);break;case"br":W.style.top=W.style.right="0";W.style.borderRight=this.borderStringB;this.bottomContainer.appendChild(W)}}var V=document.createElement("div");if(filter){V.style.filter=filter}V.style.position="relative";V.style.fontSize="1px";V.style.overflow="hidden";V.style.width=this.fillerWidth(z);V.style.backgroundColor=this.boxColour;V.style.backgroundImage=this.backgroundImage;V.style.backgroundRepeat=this.backgroundRepeat;switch(z){case"t":if(this.topContainer){if(curvyBrowser.quirksMode){V.style.height=100+n+"px"}else{V.style.height=100+n-this.borderWidth+"px"}V.style.marginLeft=this.spec.tlR?(this.spec.tlR-this.borderWidthL)+"px":"0";V.style.borderTop=this.borderString;if(this.backgroundImage){var ac=this.spec.tlR?(this.backgroundPosX-(n-this.borderWidthL))+"px ":"0 ";V.style.backgroundPosition=ac+this.backgroundPosY+"px";this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-n+this.borderWidthL)+"px"}this.topContainer.appendChild(V)}break;case"b":if(this.bottomContainer){if(curvyBrowser.quirksMode){V.style.height=f+"px"}else{V.style.height=f-this.borderWidthB+"px"}V.style.marginLeft=this.spec.blR?(this.spec.blR-this.borderWidthL)+"px":"0";V.style.borderBottom=this.borderStringB;if(this.backgroundImage){var ac=this.spec.blR?(this.backgroundPosX+this.borderWidthL-f)+"px ":this.backgroundPosX+"px ";V.style.backgroundPosition=ac+(this.backgroundPosY-l-this.borderWidth+f)+"px"}this.bottomContainer.appendChild(V)}}}this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";z=A;if(!curvyBrowser.quirksMode){z-=this.leftPadding+this.rightPadding}this.contentContainer.style.width=z+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,"textAlign");this.box.style.textAlign="left";this.box.appendChild(this.contentContainer);if(C){C.style.display="none"}};if(this.backgroundImage){x=this.backgroundCheck(x);w=this.backgroundCheck(w);if(this.backgroundObject){this.backgroundObject.holdingElement=this;this.dispatch=this.applyCorners;this.applyCorners=function(){if(this.backgroundObject.complete){this.dispatch()}else{this.backgroundObject.onload=new Function("curvyObject.dispatch(this.holdingElement);")}}}}}curvyObject.prototype.backgroundCheck=function(b){if(b==="top"||b==="left"||parseInt(b)===0){return 0}if(!(/^[-\d.]+px$/.test(b))&&!this.backgroundObject){this.backgroundObject=new Image;var a=function(g){var f=/url\("?([^'"]+)"?\)/.exec(g);return(f?f[1]:g)};this.backgroundObject.src=a(this.backgroundImage)}return b};curvyObject.dispatch=function(a){if("dispatch" in a){a.dispatch()}else{throw a.newError("No dispatch function")}};curvyObject.prototype.drawPixel=function(n,m,j,h,l,k,b,g){var a=document.createElement("div");a.style.height=l+"px";a.style.width="1px";a.style.position="absolute";a.style.fontSize="1px";a.style.overflow="hidden";var f=this.spec.get("tR");a.style.backgroundColor=j;if(b&&this.backgroundImage!=""){a.style.backgroundImage=this.backgroundImage;a.style.backgroundPosition="-"+(this.boxWidth-(g-n)+this.borderWidth)+"px -"+((this.boxHeight+f+m)-this.borderWidth)+"px"}if(h!=100){curvyObject.setOpacity(a,h)}a.style.top=m+"px";a.style.left=n+"px";k.appendChild(a)};curvyObject.prototype.fillerWidth=function(a){var b=curvyBrowser.quirksMode?0:this.spec.radiusCount(a)*this.borderWidthL;return(this.boxWidth-this.spec.radiusSum(a)+b)+"px"};curvyObject.prototype.errmsg=function(b,g){var f="\ntag: "+this.box.tagName;if(this.box.id){f+="\nid: "+this.box.id}if(this.box.className){f+="\nclass: "+this.box.className}var a;if((a=this.box.parentNode)===null){f+="\n(box has no parent)"}else{f+="\nParent tag: "+a.tagName;if(a.id){f+="\nParent ID: "+a.id}if(a.className){f+="\nParent class: "+a.className}}if(g===undefined){g="warning"}return"curvyObject "+g+":\n"+b+f};curvyObject.prototype.newError=function(a){return new Error(this.errmsg(a,"exception"))};curvyObject.IntToHex=function(b){var a=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];return a[b>>>4]+""+a[b&15]};curvyObject.BlendColour=function(p,o,f){if(p==="transparent"||o==="transparent"){throw this.newError("Cannot blend with transparent")}if(p.charAt(0)!=="#"){p=curvyObject.format_colour(p)}if(o.charAt(0)!=="#"){o=curvyObject.format_colour(o)}var h=parseInt(p.substr(1,2),16);var m=parseInt(p.substr(3,2),16);var k=parseInt(p.substr(5,2),16);var g=parseInt(o.substr(1,2),16);var n=parseInt(o.substr(3,2),16);var j=parseInt(o.substr(5,2),16);if(f>1||f<0){f=1}var a=Math.round((h*f)+(g*(1-f)));if(a>255){a=255}if(a<0){a=0}var b=Math.round((m*f)+(n*(1-f)));if(b>255){b=255}if(b<0){b=0}var l=Math.round((k*f)+(j*(1-f)));if(l>255){l=255}if(l<0){l=0}return"#"+curvyObject.IntToHex(a)+curvyObject.IntToHex(b)+curvyObject.IntToHex(l)};curvyObject.pixelFraction=function(l,k,a){var n;var g=a*a;var j=new Array(2);var f=new Array(2);var m=0;var h="";var b=Math.sqrt(g-Math.pow(l,2));if(b>=k&&b<(k+1)){h="Left";j[m]=0;f[m]=b-k;++m}b=Math.sqrt(g-Math.pow(k+1,2));if(b>=l&&b<(l+1)){h+="Top";j[m]=b-l;f[m]=1;++m}b=Math.sqrt(g-Math.pow(l+1,2));if(b>=k&&b<(k+1)){h+="Right";j[m]=1;f[m]=b-k;++m}b=Math.sqrt(g-Math.pow(k,2));if(b>=l&&b<(l+1)){h+="Bottom";j[m]=b-l;f[m]=0}switch(h){case"LeftRight":n=Math.min(f[0],f[1])+((Math.max(f[0],f[1])-Math.min(f[0],f[1]))/2);break;case"TopRight":n=1-(((1-j[0])*(1-f[1]))/2);break;case"TopBottom":n=Math.min(j[0],j[1])+((Math.max(j[0],j[1])-Math.min(j[0],j[1]))/2);break;case"LeftBottom":n=f[0]*j[1]/2;break;default:n=1}return n};curvyObject.rgb2Array=function(b){var a=b.substring(4,b.indexOf(")"));return a.split(", ")};curvyObject.rgb2Hex=function(g){try{var b=curvyObject.rgb2Array(g);var k=parseInt(b[0]);var h=parseInt(b[1]);var a=parseInt(b[2]);var f="#"+curvyObject.IntToHex(k)+curvyObject.IntToHex(h)+curvyObject.IntToHex(a)}catch(j){var l="getMessage" in j?j.getMessage():j.message;throw new Error("Error ("+l+") converting RGB value to Hex in rgb2Hex")}return f};curvyObject.setOpacity=function(j,f){f=(f==100)?99.999:f;if(curvyBrowser.isSafari&&j.tagName!="IFRAME"){var b=curvyObject.rgb2Array(j.style.backgroundColor);var h=parseInt(b[0]);var g=parseInt(b[1]);var a=parseInt(b[2]);j.style.backgroundColor="rgba("+h+", "+g+", "+a+", "+f/100+")"}else{if(typeof j.style.opacity!=="undefined"){j.style.opacity=f/100}else{if(typeof j.style.MozOpacity!=="undefined"){j.style.MozOpacity=f/100}else{if(typeof j.style.filter!="undefined"){j.style.filter="alpha(opacity="+f+")"}else{if(typeof j.style.KHTMLOpacity!="undefined"){j.style.KHTMLOpacity=f/100}}}}}};function addEvent(g,a,b,f){if(g.addEventListener){g.addEventListener(a,b,f);return true}if(g.attachEvent){return g.attachEvent("on"+a,b)}g["on"+a]=b;return false}curvyObject.getComputedColour=function(j){var h=document.createElement("DIV");h.style.backgroundColor=j;document.body.appendChild(h);if(window.getComputedStyle){var g=document.defaultView.getComputedStyle(h,null).getPropertyValue("background-color");h.parentNode.removeChild(h);if(g.substr(0,3)==="rgb"){g=curvyObject.rgb2Hex(g)}return g}else{var a=document.body.createTextRange();a.moveToElementText(h);a.execCommand("ForeColor",false,j);var b=a.queryCommandValue("ForeColor");var f="rgb("+(b&255)+", "+((b&65280)>>8)+", "+((b&16711680)>>16)+")";h.parentNode.removeChild(h);a=null;return curvyObject.rgb2Hex(f)}};curvyObject.format_colour=function(a){if(a!=""&&a!="transparent"){if(a.substr(0,3)==="rgb"){a=curvyObject.rgb2Hex(a)}else{if(a.charAt(0)!=="#"){a=curvyObject.getComputedColour(a)}else{if(a.length===4){a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)}}}}return a};curvyCorners.getElementsByClass=function(f,l){var k=new Array;if(l===undefined){l=document}f=f.split(".");var b="*";if(f.length===1){b=f[0];f=false}else{if(f[0]){b=f[0]}f=f[1]}var h,g,j;if(b.charAt(0)==="#"){g=document.getElementById(b.substr(1));if(g){k.push(g)}}else{g=l.getElementsByTagName(b);j=g.length;if(f){var a=new RegExp("(^|\\s)"+f+"(\\s|$)");for(h=0;h<j;++h){if(a.test(g[h].className)){k.push(g[h])}}}else{for(h=0;h<j;++h){k.push(g[h])}}}return k};if(curvyBrowser.isMoz||curvyBrowser.isWebKit){curvyCornersNoAutoScan=true}else{curvyCorners.scanStyles=function(){function b(j){var k=/^[\d.]+(\w+)$/.exec(j);return k[1]}var h,g,f;if(curvyBrowser.isIE){function a(p){var n=p.style;if(curvyBrowser.ieVer>6){var l=n["-webkit-border-radius"]||0;var o=n["-webkit-border-top-right-radius"]||0;var j=n["-webkit-border-top-left-radius"]||0;var k=n["-webkit-border-bottom-right-radius"]||0;var q=n["-webkit-border-bottom-left-radius"]||0}else{var l=n["webkit-border-radius"]||0;var o=n["webkit-border-top-right-radius"]||0;var j=n["webkit-border-top-left-radius"]||0;var k=n["webkit-border-bottom-right-radius"]||0;var q=n["webkit-border-bottom-left-radius"]||0}if(l||j||o||k||q){var m=new curvyCnrSpec(p.selectorText);if(l){m.setcorner(null,null,parseInt(l),b(l))}else{if(o){m.setcorner("t","r",parseInt(o),b(o))}if(j){m.setcorner("t","l",parseInt(j),b(j))}if(q){m.setcorner("b","l",parseInt(q),b(q))}if(k){m.setcorner("b","r",parseInt(k),b(k))}}curvyCorners(m)}}for(h=0;h<document.styleSheets.length;++h){if(document.styleSheets[h].imports&&document.styleSheets[h].href.indexOf("mashuparts.com")>0){for(g=0;g<document.styleSheets[h].imports.length;++g){for(f=0;f<document.styleSheets[h].imports[g].rules.length;++f){a(document.styleSheets[h].imports[g].rules[f])}}}else{}if(document.styleSheets[h].href.indexOf("mashuparts.com")>0){for(g=0;g<document.styleSheets[h].rules.length;++g){a(document.styleSheets[h].rules[g])}}}}else{if(curvyBrowser.isOp){for(h=0;h<document.styleSheets.length;++h){if(operasheet.contains_border_radius(h)){f=new operasheet(h);for(g in f.rules){if(!isNaN(g)){curvyCorners(f.rules[g])}}}}}else{curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox")}}};curvyCorners.init=function(){if(arguments.callee.done){return}arguments.callee.done=true;if(curvyBrowser.isWebKit&&curvyCorners.init.timer){clearInterval(curvyCorners.init.timer);curvyCorners.init.timer=null}curvyCorners.scanStyles()}}if(typeof curvyCornersNoAutoScan==="undefined"||curvyCornersNoAutoScan===false){if(curvyBrowser.isOp){document.addEventListener("DOMContentLoaded",curvyCorners.init,false)}else{addEvent(window,"load",curvyCorners.init,false)}}function fbs_click(a,b){u=a;t=b;window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"facebook","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function tweet_click(a,b){u=a;t=b;window.open("http://twitter.com/home?status="+encodeURIComponent(u),"twitter","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function myspace_click(g,f,b,a){c="<center><a href='"+b+"'><img src='"+f+"' /></a><p>This card is a unique mix of images, video, sound, and creative writing that was made created using <a href='http://www.mashuparts.com' target='_blank'>MashupArt.com</a></p></center>";window.open("http://www.myspace.com/index.cfm?fuseaction=postto&t="+encodeURIComponent(g)+"&c="+encodeURIComponent(c)+"&u="+encodeURIComponent(b)+"&l="+a,"myspace","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function digg_click(b,f,a){d="Check Out My MashupArts Video Card";media="VIDEO";window.open("http://digg.com/submit?url="+encodeURIComponent(b)+"&title="+encodeURIComponent(f)+"&bodytext="+encodeURIComponent(d)+"&media="+media,"digg","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function delicious(a,f,b){notes="MashupArts Video Card Created By "+b;window.open("http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url="+encodeURIComponent(a)+"&title="+encodeURIComponent(f)+"&notes="+notes,"delicious","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function stumbleupon(a,b){window.open("http://www.stumbleupon.com/submit?url="+encodeURIComponent(a)+"&title="+encodeURIComponent(b),"stumbleupon","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,h=aB.userAgent.toLowerCase(),f=aB.platform.toLowerCase(),l=f?/win/.test(f):/win/.test(h),n=f?/mac/.test(f):/mac/.test(h),k=/webkit/.test(h)?parseFloat(h.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,g=!+"\v1",j=[0,0,0],o=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){o=aB.plugins[ab].description;if(o&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;g=false;o=o.replace(/^.*\s+(\S+\s+\S+$)/,"$1");j[0]=parseInt(o.replace(/^(.*)\..*$/,"$1"),10);j[1]=parseInt(o.replace(/^.*\.(.*)\s.*$/,"$1"),10);j[2]=/[a-zA-Z]/.test(o)?parseInt(o.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var m=new ActiveXObject(X);if(m){o=m.GetVariable("$version");if(o){g=true;o=o.split(" ")[1].split(",");j=[parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10)]}}}catch(b){}}}return{w3:a,pv:j,wk:k,ie:g,win:l,mac:n}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var g=Z.length;for(var f=0;f<g;f++){Z[f]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var g=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=g.appendChild(b);if(a){var f=0;(function(){if(typeof a.GetVariable!=aq){var h=a.GetVariable("$version");if(h){h=h.split(" ")[1].split(",");ah.pv=[parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)]}}else{if(f<10){f++;setTimeout(arguments.callee,10);return}}g.removeChild(b);a=null;am()})()}else{am()}}function am(){var k=aG.length;if(k>0){for(var l=0;l<k;l++){var f=aG[l].id;var p=aG[l].callbackFn;var a={success:false,id:f};if(ah.pv[0]>0){var m=aS(f);if(m){if(ao(aG[l].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(f,true);if(p){a.success=true;a.ref=av(f);p(a)}}else{if(aG[l].expressInstall&&au()){var h={};h.data=aG[l].expressInstall;h.width=m.getAttribute("width")||"0";h.height=m.getAttribute("height")||"0";if(m.getAttribute("class")){h.styleclass=m.getAttribute("class")}if(m.getAttribute("align")){h.align=m.getAttribute("align")}var j={};var g=m.getElementsByTagName("param");var o=g.length;for(var n=0;n<o;n++){if(g[n].getAttribute("name").toLowerCase()!="movie"){j[g[n].getAttribute("name")]=g[n].getAttribute("value")}}ae(h,j,f,p)}else{aF(m);if(p){p(a)}}}}}else{ay(f,true);if(p){var b=av(f);if(b&&typeof b.SetVariable!=aq){a.success=true;a.ref=b}p(a)}}}}}function av(b){var g=null;var f=aS(b);if(f&&f.nodeName=="OBJECT"){if(typeof f.SetVariable!=aq){g=f}else{var a=f.getElementsByTagName(aD)[0];if(a){g=a}}}return g}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(j,g,l,h){aU=true;ap=h||null;at={success:false,id:l};var a=aS(l);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=l}j.id=ac;if(typeof j.width==aq||(!/%$/.test(j.width)&&parseInt(j.width,10)<310)){j.width="310"}if(typeof j.height==aq||(!/%$/.test(j.height)&&parseInt(j.height,10)<137)){j.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",f="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof g.flashvars!=aq){g.flashvars+="&"+f}else{g.flashvars=f}if(ah.ie&&ah.win&&a.readyState!=4){var k=ar("div");l+="SWFObjectNew";k.setAttribute("id",l);a.parentNode.insertBefore(k,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}aA(j,g,l)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var g=ar("div");if(ah.win&&ah.ie){g.innerHTML=b.innerHTML}else{var h=b.getElementsByTagName(aD)[0];if(h){var a=h.childNodes;if(a){var j=a.length;for(var f=0;f<j;f++){if(!(a[f].nodeType==1&&a[f].nodeName=="PARAM")&&!(a[f].nodeType==8)){g.appendChild(a[f].cloneNode(true))}}}}}return g}function aA(h,k,f){var g,a=aS(f);if(ah.wk&&ah.wk<312){return g}if(a){if(typeof h.id==aq){h.id=f}if(ah.ie&&ah.win){var j="";for(var m in h){if(h[m]!=Object.prototype[m]){if(m.toLowerCase()=="data"){k.movie=h[m]}else{if(m.toLowerCase()=="styleclass"){j+=' class="'+h[m]+'"'}else{if(m.toLowerCase()!="classid"){j+=" "+m+'="'+h[m]+'"'}}}}}var l="";for(var n in k){if(k[n]!=Object.prototype[n]){l+='<param name="'+n+'" value="'+k[n]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+j+">"+l+"</object>";ag[ag.length]=h.id;g=aS(h.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var o in h){if(h[o]!=Object.prototype[o]){if(o.toLowerCase()=="styleclass"){b.setAttribute("class",h[o])}else{if(o.toLowerCase()!="classid"){b.setAttribute(o,h[o])}}}}for(var p in k){if(k[p]!=Object.prototype[p]&&p.toLowerCase()!="movie"){aQ(b,p,k[p])}}a.parentNode.replaceChild(b,a);g=b}}return g}function aQ(b,g,f){var a=ar("param");a.setAttribute("name",g);a.setAttribute("value",f);b.appendChild(a)}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var f in b){if(typeof b[f]=="function"){b[f]=null}}b.parentNode.removeChild(b)}}function aS(a){var f=null;try{f=aL.getElementById(a)}catch(b){}return f}function ar(a){return aL.createElement(a)}function aM(a,f,b){a.attachEvent(f,b);al[al.length]=[a,f,b]}function ao(a){var b=ah.pv,f=a.split(".");f[0]=parseInt(f[0],10);f[1]=parseInt(f[1],10)||0;f[2]=parseInt(f[2],10)||0;return(b[0]>f[0]||(b[0]==f[0]&&b[1]>f[1])||(b[0]==f[0]&&b[1]==f[1]&&b[2]>=f[2]))?true:false}function az(b,j,a,f){if(ah.ie&&ah.mac){return}var h=aL.getElementsByTagName("head")[0];if(!h){return}var k=(a&&typeof a=="string")?a:"screen";if(f){aH=null;an=null}if(!aH||an!=k){var g=ar("style");g.setAttribute("type","text/css");g.setAttribute("media",k);aH=h.appendChild(g);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=k}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,j)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+j+"}"))}}}function ay(a,f){if(!aI){return}var b=f?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var f=a.exec(b)!=null;return f&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var g=ag.length;for(var f=0;f<g;f++){aw(ag[f])}for(var h in ah){ah[h]=null}ah=null;for(var j in swfobject){swfobject[j]=null}swfobject=null})}}();return{registerObject:function(a,h,f,b){if(ah.w3&&a&&h){var g={};g.id=a;g.swfVersion=h;g.expressInstall=f;g.callbackFn=b;aG[aG.length]=g;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(o,h,l,j,f,a,b,m,k,n){var g={success:false,id:h};if(ah.w3&&!(ah.wk&&ah.wk<312)&&o&&h&&l&&j&&f){ay(h,false);aj(function(){l+="";j+="";var w={};if(k&&typeof k===aD){for(var s in k){w[s]=k[s]}}w.data=o;w.width=l;w.height=j;var r={};if(m&&typeof m===aD){for(var v in m){r[v]=m[v]}}if(b&&typeof b===aD){for(var p in b){if(typeof r.flashvars!=aq){r.flashvars+="&"+p+"="+b[p]}else{r.flashvars=p+"="+b[p]}}}if(ao(f)){var q=aA(w,r,h);if(w.id==h){ay(h,true)}g.success=true;g.ref=q}else{if(a&&au()){w.data=a;ae(w,r,h,n);return}else{ay(h,true)}}if(n){n(g)}})}else{if(n){n(g)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,f){if(ah.w3){return aA(a,b,f)}else{return undefined}},showExpressInstall:function(b,a,g,f){if(ah.w3&&au()){ae(b,a,g,f)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,f,g){if(ah.w3){az(b,a,f,g)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var f=a.split("&");for(var g=0;g<f.length;g++){if(f[g].substring(0,f[g].indexOf("="))==b){return ai(f[g].substring((f[g].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();SWFFormFixAuto=function(){if(navigator.appName.toLowerCase()!="microsoft internet explorer"){return true}var a=document.getElementsByTagName("object");if(a.length==0){return true}for(i=0;i<a.length;i++){if(a[i].classid=="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"){window[a[i].id]=a[i]}}var b="";return true};SWFFormFix=function(b){if(navigator.appName.toLowerCase()!="microsoft internet explorer"){return false}var a="SWFFormFixTESTER";document.write('<div id="'+a+'" onclick="SWFFormFixCallback(this,\''+b+'\');return false;" style="display:none">&nbsp;</div>');document.getElementById(a).onclick()};SWFFormFixCallback=function(h,g){var f=document;var b=false;var a=h;while(h=h.parentNode){if(h.nodeName.toLowerCase()=="form"){if(h.name!=undefined&&h.name!=null&&h.name.length>0){f=f.forms[h.name]}else{alert("Error: one of your forms does not have a name!");b=true}}}a.parentNode.removeChild(a);if(b){return false}window[g]=f[g];return true}
/* SWFSound v1.1 <http://code.google.com/p/swfsound/>
	Copyright (c) 2009 Frank Baumgartner, www.b-nm.at
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>

	*** Requires SWFObject 2.1 or higher ! ***
	*** Requires Flash Player 8.0 or higher! ***
	
	History:	
	===================================
	xx.01.2009 	- v1.0 - Initial release
	14.03.2009 	- v1.1 - Added "pause" feature
	30.03.2009  - v1.2 - Added some fine-tuning by Ben Long (shift.insert@gmail.com)
*/
;var swfsound=function(){return{pauseStatus:new Array,embedSWF:function(g){if(g==undefined){g="/inc/modules/swfsound/swfsound.swf"}var b=false;var a={id:"swfSound_Flash"};var j={menu:"false",wmode:"transparent",swLiveConnect:"true",allowScriptAccess:"always"};var h=document,k;k=h.createElement("div");k.id="swfSound_Flash_div";k.style.position="absolute";k.style.left=0;k.style.top=0;h.getElementsByTagName("body")[0].appendChild(k);try{swfobject.embedSWF(g,"swfSound_Flash_div","1","1","8.0.0","/inc/modules/swfsound/expressInstall.swf",b,j,a)}catch(f){alert("Seems like you are missing swfobject! - Please include the swfobject javascript into your HTML!")}},loadSound:function(a,h,g,b){if(h==undefined){h=false}if(g==undefined){g=null}if(b==undefined){b=null}var f=document.getElementById("swfSound_Flash");return f.loadSound(a,h,g,b)},startSound:function(b,g,a,f){if(g==undefined){g=0}if(f==undefined){f=null}if(a==undefined){a=1}var h=document.getElementById("swfSound_Flash");h.startSound(b,g,a,f);return true},stopSound:function(a){var b=document.getElementById("swfSound_Flash");b.stopSound(a);return true},pauseSound:function(a){var b=document.getElementById("swfSound_Flash");var f=swfsound.pauseStatus[a];if(f==true){swfsound.startSound(a,swfsound.getPosition(a)/1000);swfsound.pauseStatus[a]=false}else{swfsound.stopSound(a);swfsound.pauseStatus[a]=true}return swfsound.pauseStatus[a]},setVolume:function(b,a){var f=document.getElementById("swfSound_Flash");f.setVolume(b,a);return true},getVolume:function(a){var b=document.getElementById("swfSound_Flash");return b.getVolume(a)},getDuration:function(a){var b=document.getElementById("swfSound_Flash");return b.getDuration(a)},getPosition:function(a){var b=document.getElementById("swfSound_Flash");return b.getPosition(a)},getID3:function(a){var b=document.getElementById("swfSound_Flash");return b.getID3(a)},setPan:function(b,a){var f=document.getElementById("swfSound_Flash");f.setPan(b,a);return true},getPan:function(a){var b=document.getElementById("swfSound_Flash");return b.getPan(a)},getBytesLoaded:function(a){var b=document.getElementById("swfSound_Flash");return b.getBytesLoaded(a)},getBytesTotal:function(a){var b=document.getElementById("swfSound_Flash");return b.getBytesTotal(a)}}}();function fbs_click(a,b){u=a;t=b;window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"facebook","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function tweet_click(a,b){u=a;t=b;window.open("http://twitter.com/home?status="+encodeURIComponent(u),"twitter","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function myspace_click(g,f,b,a){c="<center><a href='"+b+"'><img src='"+f+"' /></a><p>This card is a unique mix of images, video, sound, and creative writing that was made created using <a href='http://www.mashuparts.com' target='_blank'>MashupArt.com</a></p></center>";window.open("http://www.myspace.com/index.cfm?fuseaction=postto&t="+encodeURIComponent(g)+"&c="+encodeURIComponent(c)+"&u="+encodeURIComponent(b)+"&l="+a,"myspace","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function digg_click(b,f,a){d="Check Out My MashupArts Video Card";media="VIDEO";window.open("http://digg.com/submit?url="+encodeURIComponent(b)+"&title="+encodeURIComponent(f)+"&bodytext="+encodeURIComponent(d)+"&media="+media,"digg","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function delicious(a,f,b){notes="MashupArts Video Card Created By "+b;window.open("http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url="+encodeURIComponent(a)+"&title="+encodeURIComponent(f)+"&notes="+notes,"delicious","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function stumbleupon(a,b){window.open("http://www.stumbleupon.com/submit?url="+encodeURIComponent(a)+"&title="+encodeURIComponent(b),"stumbleupon","toolbar=0, status=0, width=626, height=436, scrollbars=1");return false}function mashupPaginate(k,h,j,f,b,g,a){$(k).startWaiting();url="/inc/ui/mashup_paginate.php";new Ajax.Updater(k,url,{method:"post",parameters:{test:"this is a post variable",target:k,page:h,method:j,argument:f,filters:b,template:g,perpage:a},onComplete:function(l){$(k).stopWaiting()}})}function flagMashup(a){if(confirm("Are you sure you want to flag this mashup?")){new Ajax.Request("/inc/app/flag_mashup.php",{method:"post",parameters:{mashupid:a},onSuccess:function(f){var b=f.responseText||"no response text";openLightboxAlert("The mashup has been flagged")}})}}function regenerateThumb(a){new Ajax.Request("/inc/app/regeneratethumb.php",{method:"post",parameters:{mashupid:a},onSuccess:function(f){var b=f.responseText||"no response text"}})}function load_quick_card(b,a,f){if(f){fb_loader_card(f)}else{fb_loader_card_lightbox()}new Ajax.Request("/inc/app/create_facebook.php",{method:"post",parameters:{friend:b},onSuccess:function(h){var g=h.responseText||"false";window.location.href=a+(g=="false"?"":"?"+g)}})}function fb_loader_card_lightbox(){openLightboxSpinner()}function fb_loader_card(a){$(a).innerHTML='<div id="quick_card_ajax_image"><img src="/themes/default/images/small64colorspatterndither.gif" border="0" height="100" /></div><div id="quick_card_ajax_comments" class="quick_card_ajax_text"></div>';rotator_fb_loader_comments()}function rotator_fb_loader_comments(){new Ajax.Request("/inc/app/ajax_loader_comments.php",{method:"post",parameters:{},onSuccess:function(b){var a=b.responseText||"";document.getElementById("quick_card_ajax_comments").innerHTML=a;setTimeout("rotator_fb_loader_comments()",10000)}})}function fb_loader(a){$(a).innerHTML='<center><img src="/themes/default/images/ajax-loader.gif" border="0" /></center>'}function rotator_reviews(){fb_loader("update_text");new Ajax.Request("/inc/app/review_rotator.php",{method:"post",parameters:{},onSuccess:function(b){var a=b.responseText||"";document.getElementById("update_text").innerHTML=a;setTimeout("rotator_reviews()",10000)}})}function update_fb_slider(g,b,a,f){url="/inc/app/fb_friends_birthdays.php?count="+a+"&infb="+f;new Ajax.Updater(g,url,{method:"post",params:{signed_request:b,count:a,infb:f}})};
