/*  Prototype JavaScript framework, version 1.6.1
 *  (c) 2005-2009 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
 *--------------------------------------------------------------------------*/
var Prototype={Version:"1.6.1",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 c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a
}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var h=null,g=$A(arguments);if(Object.isFunction(g[0])){h=g.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=h;d.subclasses=[];if(h){a.prototype=h.prototype;d.prototype=new a;
h.subclasses.push(d)}for(var f=0;f<g.length;f++){d.addMethods(g[f])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(l){var g=this.superclass&&this.superclass.prototype;var f=Object.keys(l);if(!Object.keys({toString:true}).length){if(l.toString!=Object.prototype.toString){f.push("toString")}if(l.valueOf!=Object.prototype.valueOf){f.push("valueOf")}}for(var d=0,h=f.length;d<h;d++){var k=f[d],j=l[k];if(g&&Object.isFunction(j)&&j.argumentNames().first()=="$super"){var m=j;
j=(function(n){return function(){return g[n].apply(this,arguments)}})(k).wrap(m);j.valueOf=m.valueOf.bind(m);j.toString=m.toString.bind(m)}this.prototype[k]=j}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function k(s,u){for(var t in u){s[t]=u[t]}return s}function n(s){try{if(f(s)){return"undefined"}if(s===null){return"null"}return s.inspect?s.inspect():String(s)}catch(t){if(t instanceof RangeError){return"..."}throw t}}function m(s){var u=typeof s;
switch(u){case"undefined":case"function":case"unknown":return;case"boolean":return s.toString()}if(s===null){return"null"}if(s.toJSON){return s.toJSON()}if(j(s)){return}var t=[];for(var w in s){var v=m(s[w]);if(!f(v)){t.push(w.toJSON()+": "+v)}}return"{"+t.join(", ")+"}"}function c(s){return $H(s).toQueryString()}function g(s){return s&&s.toHTML?s.toHTML():String.interpret(s)}function q(s){var t=[];for(var u in s){t.push(u)}return t}function o(s){var t=[];for(var u in s){t.push(s[u])}return t}function l(s){return k({},s)
}function j(s){return !!(s&&s.nodeType==1)}function h(s){return d.call(s)=="[object Array]"}function r(s){return s instanceof Hash}function b(s){return typeof s==="function"}function a(s){return d.call(s)=="[object String]"}function p(s){return d.call(s)=="[object Number]"}function f(s){return typeof s==="undefined"}k(Object,{extend:k,inspect:n,toJSON:m,toQueryString:c,toHTML:g,keys:q,values:o,clone:l,isElement:j,isArray:h,isHash:r,isFunction:b,isString:a,isNumber:p,isUndefined:f})})();Object.extend(Function.prototype,(function(){var m=Array.prototype.slice;
function d(q,n){var p=q.length,o=n.length;while(o--){q[p+o]=n[o]}return q}function k(o,n){o=m.call(o,0);return d(o,n)}function h(){var n=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return n.length==1&&!n[0]?[]:n}function j(p){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var n=this,o=m.call(arguments,1);return function(){var q=k(o,arguments);return n.apply(p,q)}}function g(p){var n=this,o=m.call(arguments,1);
return function(r){var q=d([r||window.event],o);return n.apply(p,q)}}function l(){if(!arguments.length){return this}var n=this,o=m.call(arguments,0);return function(){var p=k(o,arguments);return n.apply(this,p)}}function f(p){var n=this,o=m.call(arguments,1);p=p*1000;return window.setTimeout(function(){return n.apply(n,o)},p)}function a(){var n=d([0.01],arguments);return this.delay.apply(this,n)}function c(o){var n=this;return function(){var p=d([n.bind(this)],arguments);return o.apply(this,p)}}function b(){if(this._methodized){return this._methodized
}var n=this;return this._methodized=function(){var o=d([this],arguments);return n.apply(null,o)}}return{argumentNames:h,bind:j,bindAsEventListener:g,curry:l,delay:f,defer:a,wrap:c,methodize:b}})());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(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;
this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){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(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")
}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());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.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)
});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(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}
})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return(d[1]+"")}var g=d[1]||"";if(g=="\\"){return d[2]}var b=a,h=d[3];var f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=f.exec(h);if(d==null){return g}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];
b=b[c];if(null==b||""==d[3]){break}h=h.substring("["==d[3]?d[1].length:d[0].length);d=f.exec(h)}return g+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(A,z){var y=0;try{this._each(function(C){A.call(z,C,y++)})}catch(B){if(B!=$break){throw B}}return this}function t(B,A,z){var y=-B,C=[],D=this.toArray();if(B<1){return D}while((y+=B)<D.length){C.push(D.slice(y,y+B))}return C.collect(A,z)}function b(A,z){A=A||Prototype.K;var y=true;
this.each(function(C,B){y=y&&!!A.call(z,C,B);if(!y){throw $break}});return y}function k(A,z){A=A||Prototype.K;var y=false;this.each(function(C,B){if(y=!!A.call(z,C,B)){throw $break}});return y}function l(A,z){A=A||Prototype.K;var y=[];this.each(function(C,B){y.push(A.call(z,C,B))});return y}function v(A,z){var y;this.each(function(C,B){if(A.call(z,C,B)){y=C;throw $break}});return y}function j(A,z){var y=[];this.each(function(C,B){if(A.call(z,C,B)){y.push(C)}});return y}function h(B,A,z){A=A||Prototype.K;
var y=[];if(Object.isString(B)){B=new RegExp(RegExp.escape(B))}this.each(function(D,C){if(B.match(D)){y.push(A.call(z,D,C))}});return y}function a(y){if(Object.isFunction(this.indexOf)){if(this.indexOf(y)!=-1){return true}}var z=false;this.each(function(A){if(A==y){z=true;throw $break}});return z}function s(z,y){y=Object.isUndefined(y)?null:y;return this.eachSlice(z,function(A){while(A.length<z){A.push(y)}return A})}function n(y,A,z){this.each(function(C,B){y=A.call(z,y,C,B)});return y}function x(z){var y=$A(arguments).slice(1);
return this.map(function(A){return A[z].apply(A,y)})}function r(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C>=y){y=C}});return y}function p(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C<y){y=C}});return y}function f(B,z){B=B||Prototype.K;var A=[],y=[];this.each(function(D,C){(B.call(z,D,C)?A:y).push(D)});return[A,y]}function g(z){var y=[];this.each(function(A){y.push(A[z])});return y}function d(A,z){var y=[];this.each(function(C,B){if(!A.call(z,C,B)){y.push(C)
}});return y}function o(z,y){return this.map(function(B,A){return{value:B,criteria:z.call(y,B,A)}}).sort(function(D,C){var B=D.criteria,A=C.criteria;return B<A?-1:B>A?1:0}).pluck("value")}function q(){return this.map()}function u(){var z=Prototype.K,y=$A(arguments);if(Object.isFunction(y.last())){z=y.pop()}var A=[this].concat(y).map($A);return this.map(function(C,B){return z(A.pluck(B))})}function m(){return this.toArray().length}function w(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:c,eachSlice:t,all:b,every:b,any:k,some:k,collect:l,map:l,detect:v,findAll:j,select:j,filter:j,grep:h,include:a,member:a,inGroupsOf:s,inject:n,invoke:x,max:r,min:p,partition:f,pluck:g,reject:d,sortBy:o,toArray:q,entries:q,zip:u,size:m,inspect:w,find:v}
})();function $A(c){if(!c){return[]}if("toArray" in Object(c)){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var u=Array.prototype,o=u.slice,q=u.forEach;function b(y){for(var x=0,z=this.length;x<z;x++){y(this[x])}}if(!q){q=b}function n(){this.length=0;return this}function d(){return this[0]}function h(){return this[this.length-1]}function k(){return this.select(function(x){return x!=null
})}function w(){return this.inject([],function(y,x){if(Object.isArray(x)){return y.concat(x.flatten())}y.push(x);return y})}function j(){var x=o.call(arguments,0);return this.select(function(y){return !x.include(y)})}function g(x){return(x!==false?this:this.toArray())._reverse()}function m(x){return this.inject([],function(A,z,y){if(0==y||(x?A.last()!=z:!A.include(z))){A.push(z)}return A})}function r(x){return this.uniq().findAll(function(y){return x.detect(function(z){return y===z})})}function s(){return o.call(this,0)
}function l(){return this.length}function v(){return"["+this.map(Object.inspect).join(", ")+"]"}function t(){var x=[];this.each(function(y){var z=Object.toJSON(y);if(!Object.isUndefined(z)){x.push(z)}});return"["+x.join(", ")+"]"}function a(z,x){x||(x=0);var y=this.length;if(x<0){x=y+x}for(;x<y;x++){if(this[x]===z){return x}}return -1}function p(y,x){x=isNaN(x)?this.length:(x<0?this.length+x:x)+1;var z=this.slice(0,x).reverse().indexOf(y);return(z<0)?z:x-z-1}function c(){var C=o.call(this,0),A;for(var y=0,z=arguments.length;
y<z;y++){A=arguments[y];if(Object.isArray(A)&&!("callee" in A)){for(var x=0,B=A.length;x<B;x++){C.push(A[x])}}else{C.push(A)}}return C}Object.extend(u,Enumerable);if(!u._reverse){u._reverse=u.reverse}Object.extend(u,{_each:q,clear:n,first:d,last:h,compact:k,flatten:w,without:j,reverse:g,uniq:m,intersect:r,clone:s,toArray:s,size:l,inspect:v,toJSON:t});var f=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(f){u.concat=c}if(!u.indexOf){u.indexOf=a}if(!u.lastIndexOf){u.lastIndexOf=p}})();function $H(a){return new Hash(a)
}var Hash=Class.create(Enumerable,(function(){function f(s){this._object=Object.isHash(s)?s.toObject():Object.clone(s)}function g(t){for(var s in this._object){var u=this._object[s],v=[s,u];v.key=s;v.value=u;t(v)}}function m(s,t){return this._object[s]=t}function c(s){if(this._object[s]!==Object.prototype[s]){return this._object[s]}}function p(s){var t=this._object[s];delete this._object[s];return t}function r(){return Object.clone(this._object)}function q(){return this.pluck("key")}function o(){return this.pluck("value")
}function h(t){var s=this.detect(function(u){return u.value===t});return s&&s.key}function k(s){return this.clone().update(s)}function d(s){return new Hash(s).inject(this,function(t,u){t.set(u.key,u.value);return t})}function b(s,t){if(Object.isUndefined(t)){return s}return s+"="+encodeURIComponent(String.interpret(t))}function a(){return this.inject([],function(u,v){var t=encodeURIComponent(v.key),s=v.value;if(s&&typeof s=="object"){if(Object.isArray(s)){return u.concat(s.map(b.curry(t)))}}else{u.push(b(t,s))
}return u}).join("&")}function n(){return"#<Hash:{"+this.map(function(s){return s.map(Object.inspect).join(": ")}).join(", ")+"}>"}function l(){return Object.toJSON(this.toObject())}function j(){return new Hash(this)}return{initialize:f,_each:g,set:m,get:c,unset:p,toObject:r,toTemplateReplacements:r,keys:q,values:o,index:h,merge:k,update:d,toQueryString:a,inspect:n,toJSON:l,clone:j}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function f(){return this+1
}function a(m,l){$R(0,this,true).each(m,l);return this}function b(n,m){var l=this.toString(m||10);return"0".times(n-l.length)+l}function g(){return isFinite(this)?this.toString():"null"}function k(){return Math.abs(this)}function j(){return Math.round(this)}function h(){return Math.ceil(this)}function c(){return Math.floor(this)}return{toColorPart:d,succ:f,times:a,toPaddedString:b,toJSON:g,abs:k,round:j,ceil:h,floor:c}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(g,d,f){this.start=g;
this.end=d;this.exclusive=f}function c(d){var f=this.start;while(this.include(f)){d(f);f=f.succ()}}function a(d){if(d<this.start){return false}if(this.exclusive){return d<this.end}return d<=this.end}return{initialize:b,_each:c,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(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};
Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.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,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;
var d=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){d._method=this.method;this.method="post"}this.parameters=d;if(d=Object.toQueryString(d)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+d}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+="&_="}}}try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)
}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;
if(Object.isFunction(c.push)){for(var b=0,d=c.length;b<d;b+=2){f[c[b]]=c[b+1]}}else{$H(c).each(function(g){f[g.key]=g.value})}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)
}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);
return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)
}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()
}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null
}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};
b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(f,g){this.updateContent(f.responseText);if(Object.isFunction(d)){d(f,g)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);
this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var c=[];var f=document.evaluate(g,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var b=0,d=f.snapshotLength;b<d;b++){c.push(Element.extend(f.snapshotItem(b)))}return c}}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(c){var b=(function(){var g=document.createElement("form");var f=document.createElement("input");
var d=document.documentElement;f.setAttribute("name","test");g.appendChild(f);d.appendChild(g);var h=g.elements?(typeof g.elements.test=="undefined"):null;d.removeChild(g);g=f=null;return h})();var a=c.Element;c.Element=function(g,f){f=f||{};g=g.toLowerCase();var d=Element.cache;if(b&&f.name){g="<"+g+' name="'+f.name+'">';delete f.name;return Element.writeAttribute(document.createElement(g),f)}if(!d[g]){d[g]=Element.extend(document.createElement(g))}return Element.writeAttribute(d[g].cloneNode(false),f)
};Object.extend(c.Element,a||{});if(a){c.Element.prototype=a.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 f=document.createElement("select"),g=true;
f.innerHTML='<option value="test">test</option>';if(f.options&&f.options[0]){g=f.options[0].nodeName.toUpperCase()!=="OPTION"}f=null;return g})();var a=(function(){try{var f=document.createElement("table");if(f&&f.tBodies){f.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var h=typeof f.tBodies[0]=="undefined";f=null;return h}}catch(g){return true}})();var d=(function(){var f=document.createElement("script"),h=false;try{f.appendChild(document.createTextNode(""));h=!f.firstChild||f.firstChild&&f.firstChild.nodeType!==3
}catch(g){h=true}f=null;return h})();function c(g,h){g=$(g);if(h&&h.toElement){h=h.toElement()}if(Object.isElement(h)){return g.update().insert(h)}h=Object.toHTML(h);var f=g.tagName.toUpperCase();if(f==="SCRIPT"&&d){g.text=h;return g}if(b||a){if(f in Element._insertionTranslations.tags){while(g.firstChild){g.removeChild(g.firstChild)}Element._getContentFromAnonymousElement(f,h.stripScripts()).each(function(j){g.appendChild(j)})}else{g.innerHTML=h.stripScripts()}}else{g.innerHTML=h.stripScripts()}h.evalScripts.bind(h).defer();
return g}return c})(),replace:function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,f){c=$(c);if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}}var d,g,b,h;for(var a in f){d=f[a];a=a.toLowerCase();g=Element._insertionTranslations[a];
if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){g(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){h.reverse()}h.each(g.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)
}c.appendChild(b);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var f=g.first(),c=g.last();var d=(b[f]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;
while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(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(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=Element.ancestors(b);return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]},previous:function(b,d,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))}var c=Element.previousSiblings(b);return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)
},next:function(c,d,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))}var a=Element.nextSiblings(c);return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)},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
}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(f,c,g){f=$(f);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(g)?true:g
}for(var a in b){c=d.names[a]||a;g=b[a];if(d.values[a]){c=d.values[a](f,g)}if(g===false||g===null){f.removeAttribute(c)}else{if(g===true){f.setAttribute(c,c)}else{f.setAttribute(c,g)}}}return f},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))
},addClassName:function(a,b){if(!(a=$(a))){return}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)
}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);
d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,c){b=$(b);var f=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{f[(d=="float"||d=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);
a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},getDimensions:function(c){c=$(c);var h=Element.getStyle(c,"display");if(h!="none"&&h!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var g=b.visibility;var d=b.position;var a=b.display;b.visibility="hidden";if(d!="fixed"){b.position="absolute"}b.display="block";var j=c.clientWidth;var f=c.clientHeight;b.display=a;b.position=d;b.visibility=g;return{width:j,height:f}},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(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return Element._returnOffset(c,a)},positionedOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName.toUpperCase()=="BODY"){break}var c=Element.getStyle(b,"position");if(c!=="static"){break}}}while(b);return Element._returnOffset(d,a)},absolutize:function(b){b=$(b);
if(Element.getStyle(b,"position")=="absolute"){return b}var d=Element.positionedOffset(b);var g=d[1];var f=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=f-parseFloat(b.style.left||0);b._originalTop=g-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=g+"px";b.style.left=f+"px";b.style.width=c+"px";b.style.height=a+"px";return b},relativize:function(a){a=$(a);if(Element.getStyle(a,"position")=="relative"){return a
}a.style.position="relative";var c=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=c+"px";a.style.left=b+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return Element._returnOffset(c,a)},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(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body&&Element.getStyle(b,"position")=="absolute"){break}}while(b=b.offsetParent);b=d;do{if(!Prototype.Browser.Opera||(b.tagName&&(b.tagName.toUpperCase()=="BODY"))){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return Element._returnOffset(c,a)},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
d=$(d);var f=Element.viewportOffset(d);b=$(b);var g=[0,0];var c=null;if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);g=Element.viewportOffset(c)}if(c==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(f[0]-g[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(f[1]-g[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});
Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"left":case"top":case"right":case"bottom":if(d(b,"position")==="static"){return null}case"height":case"width":if(!Element.visible(b)){return null}var f=parseInt(d(b,c),10);if(f!==b["offset"+c.capitalize()]){return f+"px"}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]
}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(f,function(g,h){var j=d(b,h);return j===null?g:g-parseInt(j,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);try{b.offsetParent}catch(f){return $(document.body)}var a=b.getStyle("position");
if(a!=="static"){return c(b)}b.setStyle({position:"relative"});var d=c(b);b.setStyle({position:a});return d});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(f,c){c=$(c);try{c.offsetParent}catch(h){return Element._returnOffset(0,0)}var b=c.getStyle("position");if(b!=="static"){return f(c)}var d=c.getOffsetParent();if(d&&d.getStyle("position")==="fixed"){d.setStyle({zoom:1})}c.setStyle({position:"relative"});var g=f(c);c.setStyle({position:b});
return g})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(b,a){try{a.offsetParent}catch(c){return Element._returnOffset(0,0)}return b(a)});Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"
}return null}return c};Element.Methods.setOpacity=function(b,f){function g(h){return h.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(f==1||f===""){(d=g(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(f<0.00001){f=0}}c.filter=g(d)+"alpha(opacity="+(f*100)+")";return b};Element._attributeTranslations=(function(){var b="className";var a="for";var c=document.createElement("div");
c.setAttribute(b,"x");if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x"){b="class"}}c=null;c=document.createElement("label");c.setAttribute(a,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x"){a="htmlFor"}}c=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(d,f){return d.getAttribute(f)},_getAttr2:function(d,f){return d.getAttribute(f,2)},_getAttrNode:function(d,g){var f=d.getAttributeNode(g);return f?f.value:""
},_getEv:(function(){var d=document.createElement("div");d.onclick=Prototype.emptyFunction;var h=d.getAttribute("onclick");var g;if(String(h).indexOf("{")>-1){g=function(f,j){j=f.getAttribute(j);if(!j){return null}j=j.toString();j=j.split("{")[1];j=j.split("}")[0];return j.strip()}}else{if(h===""){g=function(f,j){j=f.getAttribute(j);if(!j){return null}return j.strip()}}}d=null;return g})(),_flag:function(d,f){return $(d).hasAttribute(f)?f:null},style:function(d){return d.style.cssText.toLowerCase()
},title:function(d){return d.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;
Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})
})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(f){var b=f.getElementsByTagName("*"),d=[];for(var c=0,g;g=b[c];c++){if(g.tagName!=="!"){d.push(g)}}return d}Element.Methods.down=function(c,d,b){c=$(c);if(arguments.length==1){return c.firstDescendant()}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[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 d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a};Element.Methods.cumulativeOffset=function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break
}}b=b.offsetParent}while(b);return Element._returnOffset(c,a)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,f){c=$(c);if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){c.parentNode.replaceChild(f,c);return c}f=Object.toHTML(f);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var g=c.next();var a=Element._getContentFromAnonymousElement(b,f.stripScripts());d.removeChild(c);if(g){a.each(function(h){d.insertBefore(h,g)
})}else{a.each(function(h){d.appendChild(h)})}}else{c.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(c,b){var d=new Element("div"),a=Element._insertionTranslations.tags[c];if(a){d.innerHTML=a[0]+b+a[1];a[2].times(function(){d=d.firstChild})}else{d.innerHTML=b}return $A(d.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)
},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;
var b=$(a).getAttributeNode(c);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function c(h){if(typeof window.Element!="undefined"){var k=window.Element.prototype;if(k){var m="_"+(Math.random()+"").slice(2);
var j=document.createElement(h);k[m]="x";var l=(j[m]!=="x");delete k[m];j=null;return l}}return false}function b(j,h){for(var l in h){var k=h[l];if(Object.isFunction(k)&&!(l in j)){j[l]=k.methodize()}}}var d=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(j){if(j&&typeof j._extendedByPrototype=="undefined"){var h=j.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){b(j,Element.Methods);b(j,Element.Methods.Simulated);b(j,Element.Methods.ByTag[h.toUpperCase()])
}}return j}}return Prototype.K}var a={},f=Element.Methods.ByTag;var g=Object.extend(function(k){if(!k||typeof k._extendedByPrototype!="undefined"||k.nodeType!=1||k==window){return k}var h=Object.clone(a),j=k.tagName.toUpperCase();if(f[j]){Object.extend(h,f[j])}b(k,h);k._extendedByPrototype=Prototype.emptyFunction;return k},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});g.refresh();return g})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)
}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var k=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})
}else{if(Object.isArray(b)){b.each(h)}else{h(b)}}function h(m){m=m.toUpperCase();if(!Element.Methods.ByTag[m]){Element.Methods.ByTag[m]={}}Object.extend(Element.Methods.ByTag[m],c)}function a(o,n,m){m=m||false;for(var q in o){var p=o[q];if(!Object.isFunction(p)){continue}if(!m||!(q in n)){n[q]=p.methodize()}}}function f(p){var m;var o={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(o[p]){m="HTML"+o[p]+"Element"}if(window[m]){return window[m]}m="HTML"+p+"Element";if(window[m]){return window[m]}m="HTML"+p.capitalize()+"Element";if(window[m]){return window[m]}var n=document.createElement(p);var q=n.__proto__||n.constructor.prototype;n=null;return q}var j=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(k.ElementExtensions){a(Element.Methods,j);a(Element.Methods.Simulated,j,true)}if(k.SpecificElementExtensions){for(var l in Element.Methods.ByTag){var g=f(l);if(Object.isUndefined(g)){continue
}a(d[l],g.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(b){var h=Prototype.Browser,f=document,c,d={};
function a(){if(h.WebKit&&!f.evaluate){return document}if(h.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function g(j){if(!c){c=a()}d[j]="client"+j;b["get"+j]=function(){return c[d[j]]};return b["get"+j]()}b.getWidth=g.curry("Width");b.getHeight=g.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(b){if(!(b=$(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=[Element.Storage.UID++]
}a=b._prototypeUID[0]}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(b,a,c){if(!(b=$(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,c)}return b},retrieve:function(c,b,a){if(!(c=$(c))){return}var f=Element.getStorage(c),d=f.get(b);if(Object.isUndefined(d)){f.set(b,a);d=a}return d},clone:function(c,a){if(!(c=$(c))){return}var f=c.cloneNode(a);f._prototypeUID=void 0;if(a){var d=Element.select(f,"*"),b=d.length;
while(b--){d[b]._prototypeUID=void 0}}return Element.extend(f)}});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 f=false;if(document.evaluate&&window.XPathResult){var d=document.createElement("div");d.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";
var c=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var b=document.evaluate(c,d,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);f=(b.snapshotLength!==2);d=null}return f})();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 h=this.expression,j=Selector.patterns,c=Selector.xpath,g,b,a=j.length,d;if(Selector._cache[h]){this.xpath=Selector._cache[h];return}this.matcher=[".//*"];while(h&&g!=h&&(/\S/).test(h)){g=h;
for(var f=0;f<a;f++){d=j[f].name;if(b=h.match(j[f].re)){this.matcher.push(Object.isFunction(c[d])?c[d](b):new Template(c[d]).evaluate(b));h=h.replace(b[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;var c=this.expression,b;switch(this.mode){case"selectorsAPI":if(a!==document){var d=a.id,f=$(a).identify();f=f.replace(/([\.:])/g,"\\$1");c="#"+f+" "+c}b=$A(a.querySelectorAll(c)).map(Element.extend);a.id=d;return b;case"xpath":return document._getElementsByXPath(this.xpath,a);
default:return this.matcher(a)}},match:function(k){this.tokens=[];var q=this.expression,a=Selector.patterns,f=Selector.assertions;var b,d,g,o=a.length,c;while(q&&b!==q&&(/\S/).test(q)){b=q;for(var j=0;j<o;j++){d=a[j].re;c=a[j].name;if(g=q.match(d)){if(f[c]){this.tokens.push([c,Object.clone(g)]);q=q.replace(g[0],"")}else{return this.findElements(document).include(k)}}}}var n=true,c,l;for(var j=0,h;h=this.tokens[j];j++){c=h[0],l=h[1];if(!Selector.assertions[c](k,l)){n=false;break}}return n},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 c=document.createElement("div"),a=document.createElement("span");c.id="prototype_test_id";a.className="Test";c.appendChild(a);var b=(c.querySelector("#prototype_test_id .test")!==null);c=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(f){var j=f[6],c=Selector.patterns,k=Selector.xpath,a,l,h=c.length,b;
var d=[];while(j&&a!=j&&(/\S/).test(j)){a=j;for(var g=0;g<h;g++){b=c[g].name;if(f=j.match(c[g].re)){l=Object.isFunction(k[b])?k[b](f):new Template(k[b]).evaluate(f);d.push("("+l.substring(1,l.length-1)+")");j=j.replace(f[0],"");break}}}return"[not("+d.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(h,f){var j,k=f[6],d;if(k=="even"){k="2n+0"}if(k=="odd"){k="2n+1"}if(j=k.match(/^(\d+)$/)){return"["+h+"= "+j[1]+"]"
}if(j=k.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(j[1]=="-"){j[1]=-1}var g=j[1]?Number(j[1]):1;var c=j[2]?Number(j[2]):0;d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(d).evaluate({fragment:h,a:g,b:c})}}}},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,c){var a=Element.readAttribute(b,c[1]);return a&&Selector.operators[c[2]](a,c[5]||c[6])}},handlers:{concat:function(d,c){for(var f=0,g;g=c[f];f++){d.push(g)}return d},mark:function(a){var d=Prototype.emptyFunction;for(var b=0,c;c=a[b];b++){c._countedByPrototype=d}return a},unmark:(function(){var a=(function(){var b=document.createElement("div"),f=false,d="_countedByPrototype",c="x";
b[d]=c;f=(b.getAttribute(d)===c);b=null;return f})();return a?function(b){for(var c=0,d;d=b[c];c++){d.removeAttribute("_countedByPrototype")}return b}:function(b){for(var c=0,d;d=b[c];c++){d._countedByPrototype=void 0}return b}})(),index:function(a,d,h){a._countedByPrototype=Prototype.emptyFunction;if(d){for(var b=a.childNodes,f=b.length-1,c=1;f>=0;f--){var g=b[f];if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=c++}}}else{for(var f=0,c=1,b=a.childNodes;g=b[f];f++){if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=c++
}}}},unique:function(b){if(b.length==0){return b}var d=[],f;for(var c=0,a=b.length;c<a;c++){if(typeof(f=b[c])._countedByPrototype=="undefined"){f._countedByPrototype=Prototype.emptyFunction;d.push(Element.extend(f))}}return Selector.handlers.unmark(d)},descendant:function(a){var d=Selector.handlers;for(var c=0,b=[],f;f=a[c];c++){d.concat(b,f.getElementsByTagName("*"))}return b},child:function(a){var f=Selector.handlers;for(var d=0,c=[],g;g=a[d];d++){for(var b=0,k;k=g.childNodes[b];b++){if(k.nodeType==1&&k.tagName!="!"){c.push(k)
}}}return c},adjacent:function(a){for(var c=0,b=[],f;f=a[c];c++){var d=this.nextElementSibling(f);if(d){b.push(d)}}return b},laterSibling:function(a){var d=Selector.handlers;for(var c=0,b=[],f;f=a[c];c++){d.concat(b,Element.nextSiblings(f))}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,k,c,b){var l=c.toUpperCase();var f=[],j=Selector.handlers;
if(a){if(b){if(b=="descendant"){for(var g=0,d;d=a[g];g++){j.concat(f,d.getElementsByTagName(c))}return f}else{a=this[b](a)}if(c=="*"){return a}}for(var g=0,d;d=a[g];g++){if(d.tagName.toUpperCase()===l){f.push(d)}}return f}else{return k.getElementsByTagName(c)}},id:function(a,m,b,c){var l=$(b),k=Selector.handlers;if(m==document){if(!l){return[]}if(!a){return[l]}}else{if(!m.sourceIndex||m.sourceIndex<1){var a=m.getElementsByTagName("*");for(var f=0,d;d=a[f];f++){if(d.id===b){return[d]}}}}if(a){if(c){if(c=="child"){for(var g=0,d;
d=a[g];g++){if(l.parentNode==d){return[l]}}}else{if(c=="descendant"){for(var g=0,d;d=a[g];g++){if(Element.descendantOf(l,d)){return[l]}}}else{if(c=="adjacent"){for(var g=0,d;d=a[g];g++){if(Selector.handlers.previousElementSibling(l)==d){return[l]}}}else{a=k[c](a)}}}}for(var g=0,d;d=a[g];g++){if(d==l){return[l]}}return[]}return(l&&Element.descendantOf(l,m))?[l]:[]},className:function(b,a,c,d){if(b&&d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,g){if(!c){c=Selector.handlers.descendant([b])
}var j=" "+g+" ";for(var f=0,d=[],h,a;h=c[f];f++){a=h.className;if(a.length==0){continue}if(a==g||(" "+a+" ").include(j)){d.push(h)}}return d},attrPresence:function(c,b,a,h){if(!c){c=b.getElementsByTagName("*")}if(c&&h){c=this[h](c)}var f=[];for(var d=0,g;g=c[d];d++){if(Element.hasAttribute(g,a)){f.push(g)}}return f},attr:function(a,k,j,l,c,b){if(!a){a=k.getElementsByTagName("*")}if(a&&b){a=this[b](a)}var m=Selector.operators[c],g=[];for(var f=0,d;d=a[f];f++){var h=Element.readAttribute(d,j);if(h===null){continue
}if(m(h,l)){g.push(d)}}return g},pseudo:function(b,c,f,a,d){if(b&&d){b=this[d](b)}if(!b){b=a.getElementsByTagName("*")}return Selector.pseudos[c](b,f,a)}},pseudos:{"first-child":function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(Selector.handlers.previousElementSibling(f)){continue}c.push(f)}return c},"last-child":function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(Selector.handlers.nextElementSibling(f)){continue}c.push(f)}return c},"only-child":function(b,j,a){var f=Selector.handlers;for(var d=0,c=[],g;
g=b[d];d++){if(!f.previousElementSibling(g)&&!f.nextElementSibling(g)){c.push(g)}}return c},"nth-child":function(b,c,a){return Selector.pseudos.nth(b,c,a)},"nth-last-child":function(b,c,a){return Selector.pseudos.nth(b,c,a,true)},"nth-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true)},"nth-last-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true)},"first-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,false,true)},"last-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,true,true)
},"only-of-type":function(b,d,a){var c=Selector.pseudos;return c["last-of-type"](c["first-of-type"](b,d,a),d,a)},getIndices:function(d,c,f){if(d==0){return c>0?[c]:[]}return $R(1,f).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b)}return a})},nth:function(c,t,v,s,f){if(c.length==0){return[]}if(t=="even"){t="2n+0"}if(t=="odd"){t="2n+1"}var r=Selector.handlers,q=[],d=[],k;r.mark(c);for(var p=0,g;g=c[p];p++){if(!g.parentNode._countedByPrototype){r.index(g.parentNode,s,f);d.push(g.parentNode)
}}if(t.match(/^\d+$/)){t=Number(t);for(var p=0,g;g=c[p];p++){if(g.nodeIndex==t){q.push(g)}}}else{if(k=t.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(k[1]=="-"){k[1]=-1}var w=k[1]?Number(k[1]):1;var u=k[2]?Number(k[2]):0;var x=Selector.pseudos.getIndices(w,u,c.length);for(var p=0,g,n=x.length;g=c[p];p++){for(var o=0;o<n;o++){if(g.nodeIndex==x[o]){q.push(g)}}}}}r.unmark(c);r.unmark(d);return q},empty:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(f.tagName=="!"||f.firstChild){continue}c.push(f)}return c
},not:function(a,d,l){var j=Selector.handlers,n,c;var k=new Selector(d).findElements(l);j.mark(k);for(var g=0,f=[],b;b=a[g];g++){if(!b._countedByPrototype){f.push(b)}}j.unmark(k);return f},enabled:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(!f.disabled&&(!f.type||f.type!=="hidden")){c.push(f)}}return c},disabled:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(f.disabled){c.push(f)}}return c},checked:function(b,g,a){for(var d=0,c=[],f;f=b[d];d++){if(f.checked){c.push(f)}}return c}},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(c){a.push(c[1].strip())});return a},matchElements:function(g,j){var f=$$(j),d=Selector.handlers;
d.mark(f);for(var c=0,b=[],a;a=g[c];c++){if(a._countedByPrototype){b.push(a)}}d.unmark(f);return b},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;c=false}return Selector.matchElements(b,c||"*")[a||0]},findChildElements:function(f,j){j=Selector.split(j.join(","));var d=[],g=Selector.handlers;for(var c=0,b=j.length,a;c<b;c++){a=new Selector(j[c].strip());g.concat(d,a.findElements(f))}return(b>1)?g.unique(d):d}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var f=0,g;
g=c[f];f++){if(g.tagName!=="!"){d.push(g)}}return d}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(h,b){if(typeof b!="object"){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var c,g,a=false,f=b.submit;var d=h.inject({},function(j,k){if(!k.disabled&&k.name){c=k.name;g=$(k).getValue();if(g!=null&&k.type!="file"&&(k.type!="submit"||(!a&&f!==false&&(!f||c==f)&&(a=true)))){if(c in j){if(!Object.isArray(j[c])){j[c]=[j[c]]
}j[c].push(g)}else{j[c]=g}}}return j});return b.hash?d:Object.toQueryString(d)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(f){var g=$(f).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;for(var b=0;d=g[b];b++){a.push(d)}return a.inject([],function(h,j){if(c[j.tagName.toLowerCase()]){h.push(Element.extend(j))}return h})},getInputs:function(h,c,d){h=$(h);var a=h.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)
}for(var f=0,j=[],g=a.length;f<g;f++){var b=a[f];if((c&&b.type!=c)||(d&&b.name!=d)){continue}j.push(Element.extend(b))}return j},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex
}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)
}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";
return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={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(c,g){if(Object.isUndefined(g)){return this[c.type=="select-one"?"selectOne":"selectMany"](c)}else{var b,d,h=!Object.isArray(g);for(var a=0,f=c.length;a<f;a++){b=c.options[a];d=this.optionValue(b);if(h){if(d==g){b.selected=true;return}}else{b.selected=g.include(d)
}}}},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,f=d.length;if(!f){return null}for(var c=0,a=[];c<f;c++){var b=d.options[c];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();
if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));
break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var x={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 f=document.documentElement;var y="onmouseenter" in f&&"onmouseleave" in f;
var q;if(Prototype.Browser.IE){var j={0:1,1:4,2:2};q=function(A,z){return A.button===j[z]}}else{if(Prototype.Browser.WebKit){q=function(A,z){switch(z){case 0:return A.which==1&&!A.metaKey;case 1:return A.which==1&&A.metaKey;default:return false}}}else{q=function(A,z){return A.which?(A.which===z+1):(A.button===z)}}}function t(z){return q(z,0)}function s(z){return q(z,1)}function m(z){return q(z,2)}function c(B){B=x.extend(B);var A=B.target,z=B.type,C=B.currentTarget;if(C&&C.tagName){if(z==="load"||z==="error"||(z==="click"&&C.tagName.toLowerCase()==="input"&&C.type==="radio")){A=C
}}if(A.nodeType==Node.TEXT_NODE){A=A.parentNode}return Element.extend(A)}function o(A,C){var z=x.element(A);if(!C){return z}var B=[z].concat(z.ancestors());return Selector.findElement(B,C,0)}function r(z){return{x:b(z),y:a(z)}}function b(B){var A=document.documentElement,z=document.body||{scrollLeft:0};return B.pageX||(B.clientX+(A.scrollLeft||z.scrollLeft)-(A.clientLeft||0))}function a(B){var A=document.documentElement,z=document.body||{scrollTop:0};return B.pageY||(B.clientY+(A.scrollTop||z.scrollTop)-(A.clientTop||0))
}function p(z){x.extend(z);z.preventDefault();z.stopPropagation();z.stopped=true}x.Methods={isLeftClick:t,isMiddleClick:s,isRightClick:m,element:c,findElement:o,pointer:r,pointerX:b,pointerY:a,stop:p};var v=Object.keys(x.Methods).inject({},function(z,A){z[A]=x.Methods[A].methodize();return z});if(Prototype.Browser.IE){function h(A){var z;switch(A.type){case"mouseover":z=A.fromElement;break;case"mouseout":z=A.toElement;break;default:return null}return Element.extend(z)}Object.extend(v,{stopPropagation:function(){this.cancelBubble=true
},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});x.extend=function(A,z){if(!A){return false}if(A._extendedByPrototype){return A}A._extendedByPrototype=Prototype.emptyFunction;var B=x.pointer(A);Object.extend(A,{target:A.srcElement||z,relatedTarget:h(A),pageX:B.x,pageY:B.y});return Object.extend(A,v)}}else{x.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(x.prototype,v);x.extend=Prototype.K}function n(D,C,E){var B=Element.retrieve(D,"prototype_event_registry");
if(Object.isUndefined(B)){d.push(D);B=Element.retrieve(D,"prototype_event_registry",$H())}var z=B.get(C);if(Object.isUndefined(z)){z=[];B.set(C,z)}if(z.pluck("handler").include(E)){return false}var A;if(C.include(":")){A=function(F){if(Object.isUndefined(F.eventName)){return false}if(F.eventName!==C){return false}x.extend(F,D);E.call(D,F)}}else{if(!y&&(C==="mouseenter"||C==="mouseleave")){if(C==="mouseenter"||C==="mouseleave"){A=function(G){x.extend(G,D);var F=G.relatedTarget;while(F&&F!==D){try{F=F.parentNode
}catch(H){F=D}}if(F===D){return}E.call(D,G)}}}else{A=function(F){x.extend(F,D);E.call(D,F)}}}A.handler=E;z.push(A);return A}function g(){for(var z=0,A=d.length;z<A;z++){x.stopObserving(d[z]);d[z]=null}}var d=[];if(Prototype.Browser.IE){window.attachEvent("onunload",g)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var l=Prototype.K;if(!y){l=function(A){var z={mouseenter:"mouseover",mouseleave:"mouseout"};return A in z?z[A]:A}}function u(C,B,D){C=$(C);
var A=n(C,B,D);if(!A){return C}if(B.include(":")){if(C.addEventListener){C.addEventListener("dataavailable",A,false)}else{C.attachEvent("ondataavailable",A);C.attachEvent("onfilterchange",A)}}else{var z=l(B);if(C.addEventListener){C.addEventListener(z,A,false)}else{C.attachEvent("on"+z,A)}}return C}function k(E,C,F){E=$(E);var B=Element.retrieve(E,"prototype_event_registry");if(Object.isUndefined(B)){return E}if(C&&!F){var D=B.get(C);if(Object.isUndefined(D)){return E}D.each(function(G){Element.stopObserving(E,C,G.handler)
});return E}else{if(!C){B.each(function(I){var G=I.key,H=I.value;H.each(function(J){Element.stopObserving(E,G,J.handler)})});return E}}var D=B.get(C);if(!D){return}var A=D.find(function(G){return G.handler===F});if(!A){return E}var z=l(C);if(C.include(":")){if(E.removeEventListener){E.removeEventListener("dataavailable",A,false)}else{E.detachEvent("ondataavailable",A);E.detachEvent("onfilterchange",A)}}else{if(E.removeEventListener){E.removeEventListener(z,A,false)}else{E.detachEvent("on"+z,A)}}B.set(C,D.without(A));
return E}function w(C,B,A,z){C=$(C);if(Object.isUndefined(z)){z=true}if(C==document&&document.createEvent&&!C.dispatchEvent){C=document.documentElement}var D;if(document.createEvent){D=document.createEvent("HTMLEvents");D.initEvent("dataavailable",true,true)}else{D=document.createEventObject();D.eventType=z?"ondataavailable":"onfilterchange"}D.eventName=B;D.memo=A||{};if(document.createEvent){C.dispatchEvent(D)}else{C.fireEvent(D.eventType,D)}return x.extend(D)}Object.extend(x,x.Methods);Object.extend(x,{fire:w,observe:u,stopObserving:k});
Element.addMethods({fire:w,observe:u,stopObserving:k});Object.extend(document,{fire:w.methodize(),observe:u.methodize(),stopObserving:k.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,x)}else{window.Event=x}})();(function(){var d;function a(){if(document.loaded){return}if(d){window.clearTimeout(d)}document.loaded=true;document.fire("dom:loaded")}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);a()}}function b(){try{document.documentElement.doScroll("left")
}catch(f){d=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",c);if(window==top){d=b.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})
},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;
this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0
}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};
return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,f){f=f.toString().strip();var d=/\s/.test(f)?$w(f).map(a).join(""):a(f);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(f,g){g=g.toString().strip();var h=[],j=(/\s/.test(g)?$w(g):null);if(!j&&!g){return h}var c=$(f).getElementsByTagName("*");
g=" "+g+" ";for(var d=0,l,k;l=c[d];d++){if(l.className&&(k=" "+l.className+" ")&&(k.include(g)||(j&&j.all(function(m){return !m.toString().blank()&&k.include(" "+m+" ")})))){h.push(Element.extend(l))}}return h};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(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);
/*
// script.aculo.us scriptaculous.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008

// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// For details, see the script.aculo.us web site: http://script.aculo.us/
*/
var Scriptaculous={Version:"1.8.2",require:function(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')
},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function a(b){var c=b.replace(/_.*|\./g,"");c=parseInt(c+"0".times(4-c.length));return b.indexOf("_")>-1?c-1:c}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(a(Prototype.Version)<a(Scriptaculous.REQUIRED_PROTOTYPE))){throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE)}}};Scriptaculous.load();
/*
// script.aculo.us effects.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008

// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
//  Justin Palmer (http://encytemedia.com/)
//  Mark Pilgrim (http://diveintomark.org/)
//  Martin Bialasinki
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
*/
String.prototype.parseColor=function(){var a="#";
if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))
}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);
var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5
},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)
});Element.remove(c)}})},multiple:function(b,c){var f;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){f=b}else{f=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(f).each(function(h,g){new c(h,Object.extend(a,{delay:g*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);c=(c||"appear").toLowerCase();var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});
Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;
d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();
for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(a){function b(d,c){return((d[c+"Internal"]?"this.options."+c+"Internal(this);":"")+(d[c]?"this.options."+c+"(this);":""))}if(a&&a.transition===false){a.transition=Effect.Transitions.linear
}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function c(f,d){if(f.options[d+"Internal"]){f.options[d+"Internal"](f)}if(f.options[d]){f.options[d](f)}}return function(d){if(this.state==="idle"){this.state="running";
c(this,"beforeSetup");if(this.setup){this.setup()}c(this,"afterSetup")}if(this.state==="running"){d=(this.options.transition(d)*this.fromToDelta)+this.options.from;this.position=d;c(this,"beforeUpdate");if(this.update){this.update(d)}c(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");
if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();
for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(c,g,f){c=Object.isString(c)?$(c):c;
var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(h){c[d]=h};this.start(Object.extend({from:g,to:f},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)
}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))
};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]
}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]
}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,f){var g={};if(this.options.scaleX){g.width=f.round()+"px"
}if(this.options.scaleY){g.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(f-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){g.top=this.originalTop-c+"px"}if(this.options.scaleX){g.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){g.top=-c+"px"}if(this.options.scaleX){g.left=-b+"px"}}}this.element.setStyle(g)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")
}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))
}});Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),d=$(c).cumulativeOffset();if(b.offset){d[1]+=b.offset}return new Effect.Tween(null,a.top,d[1],b,function(f){scrollTo(a.left,f.round())})};Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);
var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)
},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})
}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(d){d=$(d);var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});
var f=parseFloat(b.distance);var c=parseFloat(b.duration)/10;var a={top:d.getStyle("top"),left:d.getStyle("left")};return new Effect.Move(d,{x:f,y:0,duration:c,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:-f,y:0,duration:c,afterFinishInternal:function(m){m.element.undoPositioned().setStyle(a)
}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()
},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var h=c.getDimensions();var j,g;var f,d;switch(b.direction){case"top-left":j=g=f=d=0;break;case"top-right":j=h.width;
g=d=0;f=-h.width;break;case"bottom-left":j=f=0;g=h.height;d=-h.height;break;case"bottom-right":j=h.width;g=h.height;f=-h.width;d=-h.height;break;case"center":j=h.width/2;g=h.height/2;f=-h.width/2;d=-h.height/2;break}return new Effect.Move(c,{x:j,y:g,duration:0.01,beforeSetup:function(k){k.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(k){new Effect.Parallel([new Effect.Opacity(k.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(k.element,{x:f,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(k.element,100,{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(l){l.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(l){l.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var g=c.getDimensions();var f,d;switch(b.direction){case"top-left":f=d=0;
break;case"top-right":f=g.width;d=0;break;case"bottom-left":f=0;d=g.height;break;case"bottom-right":f=g.width;d=g.height;break;case"center":f=g.width/2;d=g.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:f,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(h){h.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(h){h.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{},a=c.getInlineOpacity(),f=b.transition||Effect.Transitions.linear,d=function(g){return 1-f((-Math.cos((g*(b.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:a})}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);
var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);var b=this.element.getStyles();this.style=this.style.reject(function(d){return d.value==b[d.key]});a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);d.transforms.each(function(f){d.element.style[f.style]=""
})}}}this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(h){var g=h[0],f=h[1],d=null;if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();d="color"}else{if(g=="opacity"){f=parseFloat(f);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(f)){var c=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);
f=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(g);return{style:g.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(f):f,unit:d}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)
}this.element.setStyle(d,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");var f=[$(d)||$$(d)].flatten();return f.map(function(g){return new c(g,Object.extend({sync:true},b))
})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])
}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];return c})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(d,f){d[f]=a[f];return d});if(!c.opacity){c.opacity=b.getOpacity()}return c}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));
return a},visualEffect:function(c,f,b){c=$(c);var d=f.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);new Effect[a](c,b);return c},highlight:function(b,a){b=$(b);new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]
});Element.addMethods(Effect.Methods);
/*
//  Prototip 1.2.3.1 - 21-03-2008

//  Copyright (c) 2008 Nick Stakenburg (http://www.nickstakenburg.com)
//
//  Permission is hereby granted, free of charge, to any person obtaining
//  a copy of this software and associated documentation files (the
//  "Software"), to deal in the Software without restriction, including
//  without limitation the rights to use, copy, modify, merge, publish,
//  distribute, sublicense, and/or sell copies of the Software, and to
//  permit persons to whom the Software is furnished to do so, subject to
//  the following conditions:
//
//  The above copyright notice and this permission notice shall be
//  included in all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
//  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
//  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
//  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
//  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
//  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

//  More information on this project:
//  http://www.nickstakenburg.com/projects/prototip/
*/
var Prototip={Version:"1.2.3.1",REQUIRED_Prototype:"1.6.0.2",REQUIRED_Scriptaculous:"1.8.1",start:function(){this.require("Prototype");
Tips.initialize();Element.observe(window,"unload",this.unload)},require:function(a){if((typeof window[a]=="undefined")||(this.convertVersionString(window[a].Version)<this.convertVersionString(this["REQUIRED_"+a]))){throw ("Lightview requires "+a+" >= "+this["REQUIRED_"+a])}},convertVersionString:function(a){var b=a.replace(/_.*|\./g,"");b=parseInt(b+"0".times(4-b.length));return a.indexOf("_")>-1?b-1:b},capture:function(a){if(!Prototype.Browser.IE){a=a.wrap(function(d,c){var b=c.relatedTarget,f=c.currentTarget;
if(b&&b.nodeType==Node.TEXT_NODE){b=b.parentNode}if(b&&b!=f&&b.descendantOf&&!(b.descendantOf(f))){d(c)}})}return a},unload:function(){Tips.removeAll()}};var Tips={closeButtons:false,zIndex:1200,tips:[],visible:[],initialize:function(){this.zIndexTop=this.zIndex},useEvent:(function(a){return{mouseover:(a?"mouseenter":"mouseover"),mouseout:(a?"mouseleave":"mouseout"),mouseenter:(a?"mouseenter":"mouseover"),mouseleave:(a?"mouseleave":"mouseout")}})(Prototype.Browser.IE),fixIE:(function(b){var a=new RegExp("MSIE ([\\d.]+)").exec(b);
return a?(parseFloat(a[1])<7):false})(navigator.userAgent),add:function(a){this.tips.push(a)},remove:function(a){var b=this.tips.find(function(c){return c.element==$(a)});if(b){b.deactivate();if(b.tooltip){b.wrapper.remove();if(Tips.fixIE){b.iframeShim.remove()}}this.tips=this.tips.without(b)}},removeAll:function(){this.tips.each(function(a){this.remove(a.element)}.bind(this))},raise:function(b){if(b.highest){return}if(this.visible.length==0){this.zIndexTop=this.zIndex;for(var a=0;a<this.tips.length;
a++){this.tips[a].wrapper.style.zIndex=this.zIndex}}b.style.zIndex=this.zIndexTop++;for(var a=0;a<this.tips.length;a++){this.tips[a].wrapper.highest=false}b.highest=true},addVisibile:function(a){this.removeVisible(a);this.visible.push(a)},removeVisible:function(a){this.visible=this.visible.without(a)}};var Tip=Class.create({initialize:function(a,b){this.element=$(a);Tips.remove(this.element);this.content=b;var d=(arguments[2]&&arguments[2].hook);var c=(arguments[2]&&arguments[2].showOn=="click");
this.options=Object.extend({className:"default",closeButton:Tips.closeButtons,delay:!c?0.2:false,duration:0.3,effect:false,hideAfter:false,hideOn:"mouseleave",hook:false,offset:d?{x:0,y:0}:{x:16,y:16},fixed:d?true:false,showOn:"mousemove",target:this.element,title:false,viewport:d?false:true},arguments[2]||{});this.target=$(this.options.target);this.setup();if(this.options.effect){Prototip.require("Scriptaculous");this.queue={position:"end",limit:1,scope:this.wrapper.identify()}}Tips.add(this);this.activate()
},setup:function(){this.wrapper=new Element("div",{className:"prototip"}).setStyle({display:"none",zIndex:Tips.zIndex});this.wrapper.identify();if(Tips.fixIE){this.iframeShim=new Element("iframe",{className:"iframeShim",src:"javascript:false;",frameBorder:0}).setStyle({display:"none",zIndex:Tips.zIndex-1})}this.tip=new Element("div",{className:"content"}).insert(this.content);this.tip.insert(new Element("div").setStyle({clear:"both"}));if(this.options.closeButton||(this.options.hideOn.element&&this.options.hideOn.element=="closeButton")){this.closeButton=new Element("a",{href:"#",className:"close"})
}},build:function(){if(Tips.fixIE){document.body.appendChild(this.iframeShim).setOpacity(0)}var d="wrapper";if(this.options.effect){this.effectWrapper=this.wrapper.appendChild(new Element("div",{className:"effectWrapper"}));d="effectWrapper"}this.tooltip=this[d].appendChild(new Element("div",{className:"tooltip "+this.options.className}));if(this.options.title||this.options.closeButton){this.toolbar=this.tooltip.appendChild(new Element("div",{className:"toolbar"}));this.title=this.toolbar.appendChild(new Element("div",{className:"title"}).update(this.options.title||" "))
}this.tooltip.insert(this.tip);document.body.appendChild(this.wrapper);var a=(this.options.effect)?[this.wrapper,this.effectWrapper]:[this.wrapper];if(Tips.fixIE){a.push(this.iframeShim)}var c=this.wrapper.getWidth();a.invoke("setStyle",{width:c+"px"});if(this.toolbar){this.wrapper.setStyle({visibility:"hidden"}).show();this.toolbar.setStyle({width:this.toolbar.getWidth()+"px"});this.wrapper.hide().setStyle({visibility:"visible"})}if(this.closeButton){this.title.insert({top:this.closeButton}).insert(new Element("div").setStyle({clear:"both"}))
}var b=this.wrapper.getHeight();a.invoke("setStyle",{width:c+"px",height:b+"px"});this[this.options.effect?d:"tooltip"].hide()},activate:function(){this.eventShow=this.showDelayed.bindAsEventListener(this);this.eventHide=this.hide.bindAsEventListener(this);if(this.options.fixed&&this.options.showOn=="mousemove"){this.options.showOn="mouseover"}if(this.options.showOn==this.options.hideOn){this.eventToggle=this.toggle.bindAsEventListener(this);this.element.observe(this.options.showOn,this.eventToggle)
}var c={element:this.eventToggle?[]:[this.element],target:this.eventToggle?[]:[this.target],tip:this.eventToggle?[]:[this.wrapper],closeButton:[],none:[]};var a=this.options.hideOn.element;this.hideElement=a||(!this.options.hideOn?"none":"element");this.hideTargets=c[this.hideElement];if(!this.hideTargets&&a&&Object.isString(a)){this.hideTargets=this.tip.select(a)}var d={mouseenter:"mouseover",mouseleave:"mouseout"};$w("show hide").each(function(h){var g=h.capitalize();var f=(this.options[h+"On"].event||this.options[h+"On"]);
this[h+"Action"]=f;if(["mouseenter","mouseleave","mouseover","mouseout"].include(f)){this[h+"Action"]=(Tips.useEvent[f]||f);this["event"+g]=Prototip.capture(this["event"+g])}}.bind(this));if(!this.eventToggle){this.element.observe(this.options.showOn,this.eventShow)}if(this.hideTargets){this.hideTargets.invoke("observe",this.hideAction,this.eventHide)}if(!this.options.fixed&&this.options.showOn=="click"){this.eventPosition=this.position.bindAsEventListener(this);this.element.observe("mousemove",this.eventPosition)
}this.buttonEvent=this.hide.wrap(function(g,f){f.stop();g(f)}).bindAsEventListener(this);if(this.closeButton){this.closeButton.observe("click",this.buttonEvent)}if(this.options.showOn!="click"&&(this.hideElement!="element")){this.eventCheckDelay=Prototip.capture(function(){this.clearTimer("show")}).bindAsEventListener(this);this.element.observe(Tips.useEvent.mouseout,this.eventCheckDelay)}var b=[this.element,this.wrapper];this.activityEnter=Prototip.capture(function(){Tips.raise(this.wrapper);this.cancelHideAfter()
}).bindAsEventListener(this);this.activityLeave=Prototip.capture(this.hideAfter).bindAsEventListener(this);b.invoke("observe",Tips.useEvent.mouseover,this.activityEnter);b.invoke("observe",Tips.useEvent.mouseout,this.activityLeave)},deactivate:function(){if(this.options.showOn==this.options.hideOn){this.element.stopObserving(this.options.showOn,this.eventToggle)}else{this.element.stopObserving(this.options.showOn,this.eventShow);if(this.hideTargets){this.hideTargets.invoke("stopObserving")}}if(this.eventPosition){this.element.stopObserving("mousemove",this.eventPosition)
}if(this.closeButton){this.closeButton.stopObserving()}if(this.eventCheckDelay){this.element.stopObserving("mouseout",this.eventCheckDelay)}this.wrapper.stopObserving();this.element.stopObserving(Tips.useEvent.mouseover,this.activityEnter);this.element.stopObserving(Tips.useEvent.mouseout,this.activityLeave)},showDelayed:function(a){if(!this.tooltip){this.build()}this.position(a);if(this.wrapper.visible()){return}this.clearTimer("show");this.showTimer=this.show.bind(this).delay(this.options.delay)
},clearTimer:function(a){if(this[a+"Timer"]){clearTimeout(this[a+"Timer"])}},show:function(){if(this.wrapper.visible()&&this.options.effect!="appear"){return}if(Tips.fixIE){this.iframeShim.show()}Tips.addVisibile(this.wrapper);this.wrapper.show();if(!this.options.effect){this.tooltip.show()}else{if(this.activeEffect){Effect.Queues.get(this.queue.scope).remove(this.activeEffect)}this.activeEffect=Effect[Effect.PAIRS[this.options.effect][0]](this.effectWrapper,{duration:this.options.duration,queue:this.queue})
}},hideAfter:function(a){if(!this.options.hideAfter){return}this.cancelHideAfter();this.hideAfterTimer=this.hide.bind(this).delay(this.options.hideAfter)},cancelHideAfter:function(){if(this.options.hideAfter){this.clearTimer("hideAfter")}},hide:function(){this.clearTimer("show");if(!this.wrapper.visible()){return}if(!this.options.effect){if(Tips.fixIE){this.iframeShim.hide()}this.tooltip.hide();this.wrapper.hide();Tips.removeVisible(this.wrapper)}else{if(this.activeEffect){Effect.Queues.get(this.queue.scope).remove(this.activeEffect)
}this.activeEffect=Effect[Effect.PAIRS[this.options.effect][1]](this.effectWrapper,{duration:this.options.duration,queue:this.queue,afterFinish:function(){if(Tips.fixIE){this.iframeShim.hide()}this.wrapper.hide();Tips.removeVisible(this.wrapper)}.bind(this)})}},toggle:function(a){if(this.wrapper&&this.wrapper.visible()){this.hide(a)}else{this.showDelayed(a)}},position:function(a){Tips.raise(this.wrapper);var f={left:this.options.offset.x,top:this.options.offset.y};var g=Position.cumulativeOffset(this.target);
var b=this.wrapper.getDimensions();var k={left:(this.options.fixed)?g[0]:Event.pointerX(a),top:(this.options.fixed)?g[1]:Event.pointerY(a)};k.left+=f.left;k.top+=f.top;if(this.options.hook){var m={target:this.target.getDimensions(),tip:b};var n={target:Position.cumulativeOffset(this.target),tip:Position.cumulativeOffset(this.target)};for(var j in n){switch(this.options.hook[j]){case"topRight":n[j][0]+=m[j].width;break;case"topMiddle":n[j][0]+=(m[j].width/2);break;case"rightMiddle":n[j][0]+=m[j].width;
n[j][1]+=(m[j].height/2);break;case"bottomLeft":n[j][1]+=m[j].height;break;case"bottomRight":n[j][0]+=m[j].width;n[j][1]+=m[j].height;break;case"bottomMiddle":n[j][0]+=(m[j].width/2);n[j][1]+=m[j].height;break;case"leftMiddle":n[j][1]+=(m[j].height/2);break}}k.left+=-1*(n.tip[0]-n.target[0]);k.top+=-1*(n.tip[1]-n.target[1])}if(!this.options.fixed&&this.element!==this.target){var c=Position.cumulativeOffset(this.element);k.left+=-1*(c[0]-g[0]);k.top+=-1*(c[1]-g[1])}if(this.options.viewport){var l=document.viewport.getScrollOffsets();
var h=document.viewport.getDimensions();var d={left:"width",top:"height"};for(var j in d){overshoot=(k[j]+b[d[j]]-l[j])-h[d[j]];if(overshoot>0){if(this.options.fixed){k[j]=k[j]-(overshoot+50)-2*f[j]}else{k[j]=k[j]-b[d[j]]-2*f[j]}}}}var o={left:k.left+"px",top:k.top+"px"};this.wrapper.setStyle(o);if(Tips.fixIE){this.iframeShim.setStyle(o)}}});Prototip.start();
/*
// script.aculo.us controls.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008

// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//           (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
//           (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
// Contributors:
//  Richard Livsey
//  Rahul Bhargava
//  Rob Wills
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
*/
if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")
}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(b,c,a){b=$(b);this.element=b;this.update=$(c);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(a)}else{this.options=a||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;
this.options.onShow=this.options.onShow||function(d,f){if(!f.style.position||f.style.position=="absolute"){f.style.position="absolute";Position.clone(d,f,{setHeight:false,offsetTop:d.offsetHeight})}Effect.Appear(f,{duration:0.15})};this.options.onHide=this.options.onHide||function(d,f){new Effect.Fade(f,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;
this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)
}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(a);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(a);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(a);return}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&a.keyCode==0)){return
}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(b){var a=Event.findElement(b,"LI");if(this.index!=a.autocompleteIndex){this.index=a.autocompleteIndex;this.render()}Event.stop(b)},onClick:function(b){var a=Event.findElement(b,"LI");this.index=a.autocompleteIndex;this.selectEntry();
this.hide()},onBlur:function(a){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var a=0;a<this.entryCount;a++){this.index==a?Element.addClassName(this.getEntry(a),"selected"):Element.removeClassName(this.getEntry(a),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)
},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(a){return this.update.firstChild.childNodes[a]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(g){if(this.options.updateElement){this.options.updateElement(g);return}var d="";if(this.options.select){var a=$(g).select("."+this.options.select)||[];
if(a.length>0){d=Element.collectTextNodes(a[0],this.options.select)}}else{d=Element.collectTextNodesIgnoreClass(g,"informal")}var c=this.getTokenBounds();if(c[0]!=-1){var f=this.element.value.substr(0,c[0]);var b=this.element.value.substr(c[0]).match(/^\s+/);if(b){f+=b[0]}this.element.value=f+d+this.element.value.substr(c[1])}else{this.element.value=d}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,g)}},updateChoices:function(c){if(!this.changed&&this.hasFocus){this.update.innerHTML=c;
Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var a=0;a<this.entryCount;a++){var b=this.getEntry(a);b.autocompleteIndex=a;this.addObservers(b)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(a){Event.observe(a,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(a,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var a=this.getTokenBounds();return this.element.value.substring(a[0],a[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var f=this.element.value;if(f.strip().empty()){return[-1,0]
}var g=arguments.callee.getFirstDifferencePos(f,this.oldElementValue);var j=(g==this.oldElementValue.length?1:0);var d=-1,c=f.length;var h;for(var b=0,a=this.options.tokens.length;b<a;++b){h=f.lastIndexOf(this.options.tokens[b],g+j-1);if(h>d){d=h}h=f.indexOf(this.options.tokens[b],g+j);if(-1!=h&&h<c){c=h}}return(this.tokenBounds=[d+1,c])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(c,a){var d=Math.min(c.length,a.length);for(var b=0;b<d;++b){if(c[b]!=a[b]){return b
}}return d};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(c,d,b,a){this.baseInitialize(c,d,a);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=b},getUpdatedChoices:function(){this.startIndicator();var a=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,a):a;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams
}new Ajax.Request(this.url,this.options)},onComplete:function(a){this.updateChoices(a.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(b,d,c,a){this.baseInitialize(b,d,a);this.options.array=c},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(a){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(b){var d=[];var c=[];var j=b.getToken();var h=0;
for(var f=0;f<b.options.array.length&&d.length<b.options.choices;f++){var g=b.options.array[f];var k=b.options.ignoreCase?g.toLowerCase().indexOf(j.toLowerCase()):g.indexOf(j);while(k!=-1){if(k==0&&g.length!=j.length){d.push("<li><strong>"+g.substr(0,j.length)+"</strong>"+g.substr(j.length)+"</li>");break}else{if(j.length>=b.options.partialChars&&b.options.partialSearch&&k!=-1){if(b.options.fullSearch||/\s/.test(g.substr(k-1,1))){c.push("<li>"+g.substr(0,k)+"<strong>"+g.substr(k,j.length)+"</strong>"+g.substr(k+j.length)+"</li>");
break}}}k=b.options.ignoreCase?g.toLowerCase().indexOf(j.toLowerCase(),k+1):g.indexOf(j,k+1)}}if(c.length){d=d.concat(c.slice(0,b.options.choices-d.length))}return"<ul>"+d.join("")+"</ul>"}},a||{})}});Field.scrollFreeActivate=function(a){setTimeout(function(){Field.activate(a)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(c,b,a){this.url=b;this.element=c=$(c);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(a);Object.extend(this.options,a||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";
if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);
this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(a){if(!this._editing||a.ctrlKey||a.altKey||a.shiftKey){return}if(Event.KEY_ESC==a.keyCode){this.handleFormCancellation(a)}else{if(Event.KEY_RETURN==a.keyCode){this.handleFormSubmission(a)}}},createControl:function(h,c,b){var f=this.options[h+"Control"];var g=this.options[h+"Text"];if("button"==f){var a=document.createElement("input");
a.type="submit";a.value=g;a.className="editor_"+h+"_button";if("cancel"==h){a.onclick=this._boundCancelHandler}this._form.appendChild(a);this._controls[h]=a}else{if("link"==f){var d=document.createElement("a");d.href="#";d.appendChild(document.createTextNode(g));d.onclick="cancel"==h?this._boundCancelHandler:this._boundSubmitHandler;d.className="editor_"+h+"_link";if(b){d.className+=" "+b}this._form.appendChild(d);this._controls[h]=d}}},createEditField:function(){var c=(this.options.loadTextURL?this.options.loadingText:this.getText());
var b;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){b=document.createElement("input");b.type="text";var a=this.options.size||this.options.cols||0;if(0<a){b.size=a}}else{b=document.createElement("textarea");b.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);b.cols=this.options.cols||40}b.name=this.options.paramName;b.value=c;b.className="editor_field";if(this.options.submitOnBlur){b.onblur=this._boundSubmitHandler}this._controls.editor=b;if(this.options.loadTextURL){this.loadExternalText()
}this._form.appendChild(this._controls.editor)},createForm:function(){var b=this;function a(d,f){var c=b.options["text"+d+"Controls"];if(!c||f===false){return}b._form.appendChild(document.createTextNode(c))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))
}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}a("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);a("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");a("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();
this.unregisterListeners()},enterEditMode:function(a){if(this._saving||this._editing){return}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(a){Event.stop(a)}},enterHover:function(a){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)
}if(this._saving){return}this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(a){this.triggerCallback("onFailure",a);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(a){this.wrapUp();if(a){Event.stop(a)}},handleFormSubmission:function(d){var b=this._form;var c=$F(this._controls.editor);this.prepareSubmission();var f=this.options.callback(b,c)||"";if(Object.isString(f)){f=f.toQueryParams()
}f.editorId=this.element.id;if(this.options.htmlResponse){var a=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,a)}else{var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,a)}if(d){Event.stop(d)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);
this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(a){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);
this._controls.editor.disabled=true;var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(c){this._form.removeClassName(this.options.loadingClassName);var b=c.responseText;if(this.options.stripLoadedTextTags){b=b.stripTags()}this._controls.editor.value=b;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});
new Ajax.Request(this.options.loadTextURL,a)},postProcessEditField:function(){var a=this.options.fieldPostCreation;if(a){$(this._controls.editor)["focus"==a?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(a){Object.extend(this.options,a)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();
this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var a;$H(Ajax.InPlaceEditor.Listeners).each(function(b){a=this[b.value].bind(this);this._listeners[b.key]=a;if(!this.options.externalControlOnly){this.element.observe(b.key,a)}if(this.options.externalControl){this.options.externalControl.observe(b.key,a)}}.bind(this))},removeForm:function(){if(!this._form){return}this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;
this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(b,a){if("function"==typeof this.options[b]){this.options[b](this,a)}},unregisterListeners:function(){$H(this._listeners).each(function(a){if(!this.options.externalControlOnly){this.element.stopObserving(a.key,a.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(a.key,a.value)
}}.bind(this))},wrapUp:function(a){this.leaveEditMode();this._boundComplete(a,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,c,b,a){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(c,b,a)},createEditField:function(){var a=document.createElement("select");a.name=this.options.paramName;a.size=1;this._controls.editor=a;this._collection=this.options.collection||[];
if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();
if(!/^\[.*\]$/.test(js)){throw ("Server returned an invalid collection representation.")}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(b){this._controls.editor.disabled=true;var a=this._controls.editor.firstChild;if(!a){a=document.createElement("option");a.value="";this._controls.editor.appendChild(a);a.selected=true}a.update((b||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();
if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(b){this._text=b.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,a)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);
this._collection=this._collection.map(function(d){return 2===d.length?d:[d,d].flatten()});var b=("value" in this.options)?this.options.value:this._text;var a=this._collection.any(function(d){return d[0]==b}.bind(this));this._controls.editor.update("");var c;this._collection.each(function(f,d){c=document.createElement("option");c.value=f[0];c.selected=a?f[0]==b:0==d;c.appendChild(document.createTextNode(f[1]));this._controls.editor.appendChild(c)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)
}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(a){if(!a){return}function b(c,d){if(c in a||d===undefined){return}a[c]=d}b("cancelControl",(a.cancelLink?"link":(a.cancelButton?"button":a.cancelLink==a.cancelButton==false?false:undefined)));b("okControl",(a.okLink?"link":(a.okButton?"button":a.okLink==a.okButton==false?false:undefined)));b("highlightColor",a.highlightcolor);b("highlightEndColor",a.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(a){return Form.serialize(a)
},onComplete:function(b,a){new Effect.Highlight(a,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(a){a.element.style.backgroundColor=a.options.highlightColor;if(a._effect){a._effect.cancel()}},onFailure:function(b,a){alert("Error communication with the server: "+b.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(a){a._effect=new Effect.Highlight(a.element,{startcolor:a.options.highlightColor,endcolor:a.options.highlightEndColor,restorecolor:a._originalBackground,keepBackgroundImage:true})
}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(b,a,c){this.delay=a||0.5;this.element=$(b);this.callback=c;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(a){if(this.lastValue==$F(this.element)){return
}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});if(!window.console){var console={isVisible:false,init:function(){console.s=""},draw:function(){if(!console.d){console.d=document.createElement("div");console.d.setAttribute("id","jsconsole");console.d.setAttribute("style","display:none");document.body.appendChild(console.d);
console.hide()}},hide:function(){this.isVisible=false;console.d.style.display="none"},show:function(){this.isVisible=true;console.d.style.display="block";console.d.innerHTML='<a href="javascript:console.hide()">close</a> <a href="javascript:console.clear()">clear</a><br />'+console.s},log:function(a){console.s+="<br />"+a;if(this.isVisible){console.d.innerHTML='<a href="javascript:console.hide()">close</a> <a href="javascript:console.clear()">clear</a><br />'+console.s}},clear:function(){console.d.parentNode.removeChild(console.d);
console.init();console.draw();console.show()},addLoadEvent:function(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){if(b){b()}a()}}}};if(logjs){console.addLoadEvent(console.draw);console.init()}}var $logjs={event:{name:[],time:[],delta:[]},log:function(c,a,b){this.event.name.push(c);this.event.time.push(a);this.event.delta.push(b);this.filter(c,a)},filter:function(c,a){if(c=="[ dom:loaded ]"){var b=new Element("li",{id:"dom_load"}).update(a);
$("DBUG").appendChild(b)}if(c=="[ window.load ]"){var b=new Element("li",{id:"window_load"}).update(a);$("DBUG").appendChild(b)}}};var aJsLogTimes=new Array();function logJsProgress(c){if(logjs){aJsLogTimes.push(new Date().getTime());var b=(aJsLogTimes[aJsLogTimes.length-1]-aJsLogTimes[aJsLogTimes.length-2])/1000;var a=(aJsLogTimes[aJsLogTimes.length-1]-aJsLogTimes[0])/1000;while(b.toString().length<5){b=b.toString()+0}while(a.toString().length<5){a=a.toString()+0}console.log(b+" : "+a+" : "+c);$logjs.log(c,a,b)
}}logJsProgress("[ init ]");var MIN_FLASH_VER="9.0.115";var EXPRESS_INSTALL_SWF="/resources/flash/swfobject/expressInstall.swf";function swfobjCallback(a){if(!a.success&&$(a.id)){$(a.id).style.visibility="visible";$(a.id).innerHTML='<div class="noflash"><b></b><p>You do not have the latest Adobe Flash Player installed for your browser.</p><a href="http://get.adobe.com/flashplayer/" target="_blank" title="Get Adobe Flash Player">Click to Download</a></div>'}}
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
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,f=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),j=c?/win/.test(c):/win/.test(f),l=c?/mac/.test(c):/mac/.test(f),h=/webkit/.test(f)?parseFloat(f.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",g=[0,0,0],m=null;
if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){m=aB.plugins[ab].description;if(m&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;m=m.replace(/^.*\s+(\S+\s+\S+$)/,"$1");g[0]=parseInt(m.replace(/^(.*)\..*$/,"$1"),10);g[1]=parseInt(m.replace(/^.*\.(.*)\s.*$/,"$1"),10);g[2]=/[a-zA-Z]/.test(m)?parseInt(m.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var k=new ActiveXObject(X);if(k){m=k.GetVariable("$version");if(m){d=true;
m=m.split(" ")[1].split(",");g=[parseInt(m[0],10),parseInt(m[1],10),parseInt(m[2],10)]}}}catch(b){}}}return{w3:a,pv:g,wk:h,ie:d,win:j,mac:l}}(),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 d=Z.length;for(var c=0;c<d;c++){Z[c]()}}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 d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){try{var f=a.GetVariable("$version")
}catch(g){}if(f){f=f.split(" ")[1].split(",");ah.pv=[parseInt(f[0],10),parseInt(f[1],10),parseInt(f[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var h=aG.length;if(h>0){for(var j=0;j<h;j++){var c=aG[j].id;var n=aG[j].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var k=aS(c);if(k){if(ao(aG[j].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(n){a.success=true;a.ref=av(c);n(a)}}else{if(aG[j].expressInstall&&au()){var f={};
f.data=aG[j].expressInstall;f.width=k.getAttribute("width")||"0";f.height=k.getAttribute("height")||"0";if(k.getAttribute("class")){f.styleclass=k.getAttribute("class")}if(k.getAttribute("align")){f.align=k.getAttribute("align")}var g={};var d=k.getElementsByTagName("param");var m=d.length;for(var l=0;l<m;l++){if(d[l].getAttribute("name").toLowerCase()!="movie"){g[d[l].getAttribute("name")]=d[l].getAttribute("value")}}ae(f,g,c,n)}else{aF(k);if(n){n(a)}}}}}else{ay(c,true);if(n){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;
a.ref=b}n(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(g,d,j,f){aU=true;ap=f||null;at={success:false,id:j};var a=aS(j);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=j}g.id=ac;if(typeof g.width==aq||(!/%$/.test(g.width)&&parseInt(g.width,10)<310)){g.width="310"}if(typeof g.height==aq||(!/%$/.test(g.height)&&parseInt(g.height,10)<137)){g.height="137"
}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var h=ar("div");j+="SWFObjectNew";h.setAttribute("id",j);a.parentNode.insertBefore(h,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)
}})()}aA(g,d,j)}}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 d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var f=b.getElementsByTagName(aD)[0];if(f){var a=f.childNodes;if(a){var g=a.length;for(var c=0;c<g;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))
}}}}}return d}function aA(f,h,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof f.id==aq){f.id=c}if(ah.ie&&ah.win){var g="";for(var k in f){if(f[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){h.movie=f[k]}else{if(k.toLowerCase()=="styleclass"){g+=' class="'+f[k]+'"'}else{if(k.toLowerCase()!="classid"){g+=" "+k+'="'+f[k]+'"'}}}}}var j="";for(var l in h){if(h[l]!=Object.prototype[l]){j+='<param name="'+l+'" value="'+h[l]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+g+">"+j+"</object>";
ag[ag.length]=f.id;d=aS(f.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var m in f){if(f[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){b.setAttribute("class",f[m])}else{if(m.toLowerCase()!="classid"){b.setAttribute(m,f[m])}}}}for(var n in h){if(h[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){aQ(b,n,h[n])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);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 c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.pv,c=a.split(".");
c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false}function az(b,g,a,c){if(ah.ie&&ah.mac){return}var f=aL.getElementsByTagName("head")[0];if(!f){return}var h=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=h){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",h);aH=f.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]
}an=h}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,g)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+g+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&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 d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var f in ah){ah[f]=null}ah=null;for(var g in swfobject){swfobject[g]=null}swfobject=null})}}();return{registerObject:function(a,f,c,b){if(ah.w3&&a&&f){var d={};d.id=a;d.swfVersion=f;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(m,f,j,g,c,a,b,k,h,l){var d={success:false,id:f};
if(ah.w3&&!(ah.wk&&ah.wk<312)&&m&&f&&j&&g&&c){ay(f,false);aj(function(){j+="";g+="";var s={};if(h&&typeof h===aD){for(var q in h){s[q]=h[q]}}s.data=m;s.width=j;s.height=g;var p={};if(k&&typeof k===aD){for(var r in k){p[r]=k[r]}}if(b&&typeof b===aD){for(var n in b){if(typeof p.flashvars!=aq){p.flashvars+="&"+n+"="+b[n]}else{p.flashvars=n+"="+b[n]}}}if(ao(c)){var o=aA(s,p,f);if(s.id==f){ay(f,true)}d.success=true;d.ref=o}else{if(a&&au()){s.data=a;ae(s,p,f,l);return}else{ay(f,true)}}if(l){l(d)}})}else{if(l){l(d)
}}},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,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},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 c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].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}}}}();Prototype.Browser.Chrome=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;
Prototype.Browser.IE7=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;function $extend(a){for(i=1;i<arguments.length;i++){Object.extend(a,arguments[i])}return a}function $clone(c){var a={};for(var b in c){var d=c[b];switch(typeof d){case"object":a[b]=!d?d:d.clone?d.clone():$clone(d);break;default:a[b]=d;break}}return a}function $defined(a){return(a!=undefined)}function $splat(a){return Object.isArray(a)?a:[a]}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b)
}function $chk(a){return a?true:a==0}var $log=logJsProgress;$extend(Hash.prototype,{insist:function(b,c){var a;if((a=this.get(b))){return a}return this.set(b,new c())},parseSubKeys:function(b,a){var c=this;c.each(function(f){var d=f[1];if(b&&Object.isFunction(d)){d=d.bind(b);c[f[0]]=d}f[0].split(",").each(function(g){a(g.strip(),d)})})}});$extend(Array.prototype,{forEach:function(d,c){for(var b=0,a=this.length;b<a;b++){if(!!d.call(c,this[b],b)){break}}return this},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null
},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1)}}return this},punch:function(a){var b=this.indexOf(a);return b==-1?this.push(a)-1:b},insist:function(b,c){var a;if(!(a=this[b])){a=new c();this[b]=a}return a},insert:function(b,a){this.splice(b,0,a)},contains:Array.prototype.contains||Array.prototype.member,every:Array.prototype.every||Array.prototype.all,filter:Array.prototype.filter||Array.prototype.findAll,some:Array.prototype.some||Array.prototype.any});$extend(String.prototype,{contains:function(){for(var a=0;
a<arguments.length;a++){if(this.include(arguments[a])){return true}}return false},evalScripts:function(){return this.extractScripts().map(function(script){try{return eval(script)}catch(ex){if(Dtv){Dtv.debug(ex,"Error within evalScripts(): script = "+script)}throw e}})}});$extend(Class,{supers:function(b){var a=[b];var c=b.superclass;if(c){do{a.push(c)}while(c=c.superclass)}return a}});$extend(Event,{observeEvents:function(c,b,a){$(c);$H(b).parseSubKeys(a,function(d,f){Event.observe(c,d,f)})},stopObservingEvents:function(b,a){$(b);
$H(a).parseSubKeys(null,function(c,d){Event.stopObserving(b,c,d)})},mouseWheelDelta:function(a){return(a.wheelDelta<0||a.detail>0)?1:(a.wheelDelta>0||a.detail<0)?-1:0}});(function(){function b(d){var g;if(d.className=="string"){g=d.innerHTML}else{try{g=("{v:"+(d.innerHTML||"null")+"}").evalJSON().v}catch(f){Dtv.debug(f,"Error raised trying to parse var value.")}}if(g&&Object.isString(g)){g=g.unescapeHTML()}return g}Element.addMethods({getVars:function(d){var f={};$el.childElementsByTagName(d,"var").each(function(g){f[g.title]=b(g)
});return f},getVar:function(g,f){var d=g.down("var[title='"+f+"']");return d?b(d):null},setVar:function(g,f,h){var d=g.down("var[title='"+f+"']");if(d){d.innerHTML=h;return true}return false},observeEvents:function(g,f,d){Event.observeEvents(g,f,d);return g},stopObservingEvents:function(f,d){Event.stopObservingEvents(f,d);return f},getSiblingIndex:function(d){return $(d).up(0).childElements().indexOf(d)},disable:function(d){if(!d.className){d.className="disabled"}else{$(d).classNames().each(function(f){switch(f){case"btn-sm-act":case"btn-sm-actaltdk":case"btn-sm-actalt":d.addClassName("btn-sm-inact");
break;case"btn-mid-act":case"btn-mid-actalt":case"btn-mid-actaltdk":d.addClassName("btn-mid-inact");break;case"btn-sm-em":case"btn-sm-std":case"btn-sm-stdact":d.addClassName("btn-sm-deact");break;case"btn-mid-em":case"btn-mid-std":case"btn-mid-stdact":d.addClassName("btn-mid-deact");break;default:d.addClassName("disabled");break}})}d.disabled=true},enable:function(d){$(d).classNames().each(function(f){switch(f){case"btn-sm-inact":case"btn-mid-inact":case"btn-sm-deact":case"btn-mid-deact":case"disabled":d.removeClassName(f);
break;case"btn-sm-std":d.removeClassName("cep-btn-gray");break}});d.disabled=false},disableSelection:function(d){d.unselectable="on";$(d).setStyle({MozUserSelect:"none"})},getStyleAsInt:function(f,d){var g=$(f).getStyle(d);if(!g){return 0}return parseInt(g.replace("px","").replace("em","").replace("pt",""))},getStylesAsInt:function(f){var d=$A(arguments);var g=0;for(i=1;i<d.length;i++){g+=Element.getStyleAsInt(f,d[i])}return g},getOuterWidth:function(d){return $(d).getWidth()+d.getStylesAsInt("marginLeft","marginRight")
},getOuterHeight:function(d){return $(d).getHeight()+d.getStylesAsInt("marginTop","marginBottom")},getOuterDimensions:function(d){return{width:this.getOuterWidth(d),height:this.getOuterHeight(d)}},getInnerWidth:function(d){return $(d).getWidth()-d.getStylesAsInt("paddingLeft","paddingRight")},getInnerHeight:function(d){return $(d).getHeight()-d.getStylesAsInt("paddingTop","paddingBottom")},getInnerDimensions:function(d){return{width:this.getInnerWidth(d),height:this.getInnerHeight(d)}},childElementsByTagName:function(g,d){var f=d.toLowerCase().split(",");
return $(g).childElements().select(function(h){return f.contains(h.tagName.toLowerCase())})},childElementAt:function(g,d){var f=$(g).childElements();if(f.length>d){return f[d]}return null},selectChildElements:function(f,g){var d=[];$(f).childElements().each(function(h){if(h.match(g)){d.push(h)}});return d},append:Element.Methods.insert,appendTo:function(f,d){$(d).append(f);return f},before:function(d,f){f.insert({before:d});return d},after:function(d,f){f.insert({after:d});return d},toHtml:function(f){var d=new Element("div");
d.append(f.clone(true));return d.innerHTML},first:function(h,g,d){var f=$(h).down(g);if(f){return d?f[d]:f}return null},addCssEvents:function(f,g,d){f=$(f);$H(g).parseSubKeys(null,function(h,j){Event.observe(f,h,function(k){if(d&&(f.disabled||f.hasClassName("disabled"))){return}if(!Object.isString(j)){f.setStyle(j);return}j.split("|").each(function(m,l){m=m.strip();switch(m.charAt(0)){case"{":f.setStyle(m.evalJSON());break;case"~":f.morph({style:m.substring(1)});case"!":f.removeClassName(m.substring(1));
break;default:f.addClassName(m);break}})})});return f},behavior:function(g,h,f,j){g=$(g);var d=Dtv.behaviors.getBehaviorName(h);Dtv.behaviors.applyBehavior(g,d,null,f,j);return g.behaviors[d]},getBehavior:function(h,j,k){h=$(h);if(h.behaviors){if(!j){return h.behaviors.first()}else{if(Object.isNumber(j)){return h.behaviors[j]}}var f=Dtv.behaviors.getBehaviorName(j);var d=h.behaviors[f];if(!!d||!k){return d}else{if(Dtv.behaviors.isCompiled(f)){var g=Dtv.behaviors.getBehaviorType(j);h.behaviors.forEach(function(l){if(Class.supers(Dtv.behaviors[l.behaviorName]).contains(g)){d=l;
return true}});return d}}}return null},hasBehavior:function(d,f,g){if(!f||Object.isNumber(f)){return null}return !!Element.getBehavior(d,f,g)},parentBehavior:function(f,g,h){var d=f.up(),j=null;while(!(j=Element.getBehavior(d,g,h))&&d.tagName.toLowerCase()!="body"){d=d.up()}return j},findBehavior:function(d,f,g){d=$(d);return Element.getBehavior(d,f,g)||Element.parentBehavior(d,f,g)}});var c;window.$el=function(d){if(typeof d=="string"){if(d.charAt(0)!="<"){return new Element(d)}if(!c){c=new Element("div")
}c.innerHTML=d;return c.down(0)}return $(d)};$extend($el,Element.Methods);var a;$extend(window.location,{getParams:function(){if(!a){a=window.location.search.toQueryParams()}return a},getParam:function(d){return window.location.getParams()[d]},getPathRoot:function(){return window.location.protocol+"//"+window.location.host+"/"}})})();(function(){var c=$profile("DTV namespace","Initialization of DTV namespace");var a="initializing";var d;window.Dtv={STATUS_CODE:{completed:"completed",initializing:"initializing"},data:new Hash(),debugEnabled:false,debug:$log,debugInfo:{},getConsole:function(){if(!d){d=window.console;
if(!d||!d.debug){d=window.firebug?window.firebug.d.console.cmd:null}}return d},getStatus:function(){return a}};function f(g,h){$log("running stack: "+g);Dtv.stack(g).pull(true,h);$log("finished running stack: "+g)}$extend(Dtv,(function(){var h=$H();var j=Class.create({initialize:function(){this.items=[]},push:function(k){if(!k||!Object.isFunction(k)){throw new Error("Invalid argument")}this.items.push(k)},pull:function(l,n){if(l){while(this.pull(false,n)){}return false}if(this.items.length>0){var m=this.items.shift(),k=this.pull.bind(this);
n?m.defer(k):m(k);return this.items.length>0}return false}});Dtv.debugInfo.stacks=h;function g(k,l){a==Dtv.STATUS_CODE.completed?l.defer():Dtv.stack(k).push(l)}return{stack:function(k){return h.insist(k,j)},defer:g.curry("defer"),expedite:g.curry("expedite"),ready:g.curry("ready"),load:g.curry("load")}})());$extend(Dtv,(function(){function g(){var j=0;if(window.innerHeight&&window.scrollMaxY){j=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){j=document.body.scrollHeight
}else{j=document.body.offsetHeight}}return j}return{tealeaf:{invoke:function(h){try{TeaLeaf.Client[h].call(window,$A(arguments).slice(1))}catch(j){Dtv.debug(j,"Failed to call Tealeaf method: "+h)}}},UI:{dimmerDuration:0,disableScreen:function(h){if(this._screenDisabled){return}if(Prototype.Browser.IE6){this.iframeShim=new Element("iframe",{src:'javascript:"";',frameBorder:0}).setStyle({left:0,top:0,position:"absolute",zIndex:1000,width:"100%",opacity:0}).setOpacity(0);this.iframeShim.style.height=g()+"px";
this.iframeShim.appendTo(document.body)}if(this.iframeShim){this.iframeShim.show()}if(!this._dimmerEl){this._dimmerEl=$el("<div id='lb-dimmer'></div>").appendTo(document.body);this._dimmerEl.setStyle({backgroundColor:"#000",left:0,top:0,position:"absolute",zIndex:1000,width:"100%",opacity:0})}if(this._dimmerFx){this._dimmerFx.cancel()}this._dimmerEl.style.height=g()+"px";this._dimmerFx=new Effect.Appear(this._dimmerEl,{from:0,to:0.8,duration:h||this.dimmerDuration});this._screenDisabled=true;$(document.body).fire("DTV:disablescreen")
},enableScreen:function(h){if(this.iframeShim){this.iframeShim.hide()}if(this._dimmerEl){if(this._dimmerFx){this._dimmerFx.cancel()}this._dimmerFx=new Effect.Fade(this._dimmerEl,{duration:h||this.dimmerDuration})}this._screenDisabled=false},showThinking:function(n,k){if(!this._thinkingEl){this._thinkingEl=$el('<div class="ajax-thinking"><img alt="Thinking" src="/images/global/ajax/loading_large.gif"/><h4></h4></div>').appendTo(document.body).hide()}var h=this._thinkingEl.down("h4");if(n&&n!=""){h.update(n).show()
}else{h.hide()}var m=document.viewport.getDimensions();var l=document.viewport.getScrollOffsets();var j=$el.getOuterDimensions(this._thinkingEl);this._thinkingEl.setStyle({left:((m.width-j.width)/2)+"px",top:(((m.height-j.height)/2)+l.top)+"px",opacity:0});this._thinkingEl._fx=new Effect.Appear(this._thinkingEl,{duration:0.2,delay:k||0,to:0.8})},hideThinking:function(){if(this._thinkingEl._fx){this._thinkingEl._fx.cancel()}this._thinkingEl.hide()},waitButton:function(h){h=$(h);h.disable();h.addClassName("btn-spinner");
h.classNames().each(function(j){switch(j){case"btn-sm-act":case"btn-sm-actaltdk":case"btn-sm-actalt":case"btn-sm-em":case"btn-sm-std":case"btn-sm-stdact":h.addClassName("btn-sm-ajax");break;case"btn-mid-act":case"btn-mid-actalt":case"btn-mid-actaltdk":case"btn-mid-em":case"btn-mid-std":case"btn-mid-stdact":h.addClassName("btn-mid-ajax");break}});if(!Dtv.UI._waitingButtons){Dtv.UI._waitingButtons=[]}Dtv.UI._waitingButtons.punch(h)},unwaitButton:function(h){h=$(h);h.enable();h.removeClassName("btn-spinner");
h.removeClassName("btn-sm-ajax").removeClassName("btn-mid-ajax");if(Dtv.UI._waitingButtons){Dtv.UI._waitingButtons.erase(h)}},unwaitButtons:function(h){(h||this._waitingButtons||[]).each(this.unwaitButton)}}}})());function b(m){var k=$profile("applying event selectors: ",m);var h=[];var g="";$log("applyEventSelectors start");for(var j=0;j<document.styleSheets.length;j++){var o=document.styleSheets[j].rules?document.styleSheets[j].rules:document.styleSheets[j].cssRules;for(var l=0;l<o.length;l++){var n=o[l].selectorText;
if(n){n.split(",").each(function(s){s=s.strip();var q=s.indexOf("."+m);if(q>0){var p=s.substring(0,q);var r=p.charAt(p.length-1);if(p.length>0&&(r==":"||r==".")){p=p.substring(0,p.length-1)}if(!h.contains(p)){if(g.length>0){g+=","}g+=p;h.push(p)}}})}}}if(g.length>0){$log("applyEventSelectors add handlers");$$(g).each(function(p){p.observe("mouseenter",p.addClassName.bind(p,m));p.observe("mouseleave",p.removeClassName.bind(p,m))})}if(!Dtv.debugInfo.appliedEventSelectors){Dtv.debugInfo.appliedEventSelectors={}
}Dtv.debugInfo.appliedEventSelectors[m]=h;if(k){k.stop()}$log("applyEventSelectors end")}document.observe("dom:loaded",function(){if($profile.loggers.waitingReady){$profile.loggers.waitingReady.stop()}var h=$profile("DTV ready script");f("expedite");var g=$profile("DTV Behaviors");Dtv.behaviors.applyMappings();if(g){g.stop()}f("ready");if(h){h.stop()}$profile.loggers.readyloaded=$profile("DOM ready, waiting for document to finish loading","The time difference between when the DOM became ready and the time the document was loaded","olive")
});Event.observe(window,"load",function(){if($profile.loggers.readyloaded){$profile.loggers.readyloaded.stop()}f("load");var g=$profile("DTV$loaded","DTV script fired on window load. This script block is defered.");if(Prototype.Browser.IE6){Dtv.defer(b.curry("hover"))}if($profile.showResults){Dtv.defer(function(){if(g){g.stop()}$profile.showResults()});Dtv.perf=$profile}f.defer("defer",true);a=Dtv.STATUS_CODE.completed});if(c){c.stop()}})();(function(){$log("RequestManager setup start");Dtv.RequestManager=(function(){var c={activeRequests:[],defaultTimeout:60,onTimeout:function(g){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.openCancelProcessingLightbox()
}g._timedOut=true},onComplete:function(g){window.clearTimeout(g._timeoutId);if(g._timedOut){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.hideCancelProcessingLightbox()}}},setTimeout:function(g){var h=Object.isNumber(g.options.timeout)?g.options.timeout:c.defaultTimeout;g._timeoutId=(g.options.onTimeout||c.onTimeout).delay(h,g)},cancel:function(h){if(h._complete){return}try{h.cancelled=true;h.transport.abort()}catch(g){Dtv.debug(g,"Dtv.RequestManager.cancel")}},cancelAll:function(g){this.activeRequests.each(function(h){if(!g||!!h._timeoutId){Dtv.RequestManager.cancel(h)
}})},resetTimeout:function(){this.activeRequests.each(function(g){if(!!g._timedOut){Dtv.RequestManager.setTimeout(g)}})}};function b(g,h){Dtv.debug(g,"RequestManager responder error: "+h)}function a(g){var h="tealeafid="+dtvUniqueId();if(g.options.method=="get"){g.url+=(g.url.include("?")?"&":"?")+h}else{if(g.options.postBody){g.options.postBody+=(g.options.postBody.include("&")?"&":"")+h}else{if(g.options.parameters){g.options.parameters=Object.extend(g.options.parameters,h.toQueryParams());g.options.postBody=$H(g.options.parameters).toQueryString()
}}}}function d(g){if(typeof pepKeepAliveCount!="undefined"&&g.url.indexOf("/DTVAPP/new_customer/component/keepAlive.jsp")==-1){pepKeepAliveCount=0}}function f(g){g.options.onSuccess=(g.options.onSuccess||Prototype.emptyFunction).wrap(function(k,j,h){if(j.request.cancelled){if(j.request.options.onCancel){j.request.options.onCancel(j,h)}}else{k(j,h)}})}Ajax.Responders.register({onCreate:function(h){try{c.activeRequests.push(h);if(h.options.timeout){c.setTimeout(h)}a(h);d(h);f(h)}catch(g){b(g,"onCreate")
}},onComplete:function(j,g){try{c.onComplete(j);if(g&&g.responseJSON&&g.responseJSON.pepSessionWarning){openPepSessionWarningLightbox()}c.activeRequests.erase(j)}catch(h){b(h,"onComplete")}},onException:function(h,g){try{Dtv.debug(g,"Request exception: "+h.url)}catch(g){b(g,"onException")}}});return c})();$log("RequestManager setup end")})();Dtv.behaviors=(function(){var d=new Hash(),c=false,b=new Hash();window.$consts=function(f){return b.get(Dtv.behaviors.getBehaviorName(f)).consts};var a=Class.create({isInitialized:false,initialize:function(h,f){try{var g=$profile(this.behaviorName,"<b>initialize()</b>","#444444");
if(this.constructor.definition.options){f=$extend($clone(this.constructor.definition.options),f||{})}else{f=f||{}}this.el=$el(h||f.el);this.options=f;if(!this.el.behaviors){this.el.behaviors=[]}else{if(this.el.behaviors[this.behaviorName]){throw new Error("Behavior '"+this.behaviorName+"' has already been applied to element")}}this.el.behaviors[this.behaviorName]=this;this.el.behaviors.push(this);Dtv.behaviors.instances.push(this);Dtv.behaviors[this.behaviorName].instances.push(this);if(this.el.id){this.id=this.el.id
}this._callInitMethods(g);if(g){g.stop()}}catch(j){this.debug(j);throw j}},_callInitMethods:function(g){var f=function(k){try{var h=this[k];if(h){if(g){g.log(h.bind(this),k)}else{h.apply(this)}}}catch(j){this.debug(j,k+"() failed")}}.bind(this);f("_init");f("_initLayout");if(this.options&&this._onOptionSet){$H(this.options).each(function(h){this._onOptionSet(h.key,h.value)}.bind(this))}f("_initEvents");f("_initDefaultState");this.isInitialized=true;this.fireEvent("initialized");$log("Behavior "+this.behaviorName+" initialized")
},debug:function(g,h){var f=Dtv.debug(g,"Behavior Name: "+this.behaviorName+(h?(" - "+h):""));if(f){if(f.msg){f.behavior=this;if(!this._log){this._log=[]}this._log.push(f)}else{if(!this._errors){this._errors=[]}this._errors.push(f)}}return this},dispose:function(){var f=this.behaviorName;try{Dtv.behaviors[f].instances.erase(this);Dtv.behaviors.instances.erase(this);this.el.behaviors.erase(this);delete this.el.behaviors[f];this.stopObservers();$H(this).each(function(h){this[h.key]=null}.bind(this));
this.isDisposed=true}catch(g){Dtv.debug(g,"Failed to dispose behavior "+f);throw g}$log("Behavior "+f+" disposed")},stopObservers:function(){if(!this._observersRegistry){return false}this._observersRegistry.each(function(f){if(f.el===document){if(f.eventName=="scroll"&&Prototype.Browser.IE){window.detachEvent("onscroll",f.eventHandler)}else{document.stopObserving(f.eventName,f.eventHandler)}}else{Element.stopObserving(f.el,f.eventName,f.eventHandler)}delete f.el;delete f.eventName;delete f.eventHandler
});delete this._observersRegistry;return true},observe:function(h,f,g){Event.observe(h,f,g);if(!this._observersRegistry){this._observersRegistry=[]}this._observersRegistry.push({el:h,eventName:f,eventHandler:g})},bindEvent:function(f,g){this.observe(this.el,this.behaviorName+":"+f,g||Prototype.emptyFunction);return this},bindEvents:function(h,g){var f=this;$H(h).parseSubKeys(g||this,function(j,k){f.bindEvent(j,k)})},fireEvent:function(g,f){this.el.fire(this.behaviorName+":"+g,$extend(f||{},{behavior:this}));
return this},disableTextSelection:function(){if(Prototype.Browser.IE){this.el.descendants().invoke("disableSelection")}else{this.el.disableSelection()}},enable:function(){this.disabled=false;this.el.select("a").invoke("enable")},disable:function(){this.disabled=true;this.el.select("a").invoke("disable")},getOption:function(f){return this.options?this.options[f]:undefined},setOption:function(f,g){if(!this.options){this.options={}}if(this.options[f]!==g){if(this._onOptionSet){this._onOptionSet(f,g,this.options[f])
}this.options[f]=g}},setOptions:function(g){if(!g){return false}var f=this;$H(g).each(function(h){f.setOption(h.key,h.value)})},bindAction:function(f,h,g){f=$(f);if(!f.href||f.href==""){f.href="#"}if(h){f.rel=this.behaviorName+":"+h}if(f.actionBindings){if(f.actionBindings.indexOf(this)>-1){return f}}else{f.actionBindings=[]}f.actionBindings.push(this);f.observe(g||"click",function(j){if(!Prototype.Browser.IE&&!Event.isLeftClick(j)){return}if(f.disabled){return false}var k=(f.rel||"").split(":");
if(this.behaviorName==k[0]){j.stop();this.handleAction(k.last(),f,j)}}.bind(this));Dtv.tealeaf.invoke("tlProcessNode",f,true);return f},handleAction:function(h,g,l){Dtv.debug(h,"Action Handled");var m=h.split("."),k=this,f=this,j=false;m.forEach(function(o,n){var p=k;k=k[o];if(n==m.length-1){if(p!=f&&p.behaviorName&&p.handleAction){j=p.handleAction(o,g,l)}else{if(k){k.call(p);j=true}}}});return j}});a.name="AbstractBehavior";Dtv.expedite(function(){b.each(function(g){var f=g.value;if(f.forceCompile){Dtv.behaviors.compile(f.name)
}})});return{instances:[],debugInfo:{definitions:b},define:function(g){var f=function(h){return new Error("Could not define behavior with definition: "+Object.toJSON(g)+(h?(" - reason: "+h):""))};if(!g){throw f()}if(!g.name){throw f("no name defined")}if(b.get(g.name)){throw f("definition already defined")}if(!g.methods&&!g.inherits){throw f("no methods defined")}else{if(!g.methods){g.methods={}}}if(g.inherits&&!Object.isString(g.inherits)){throw f("inherits property must be a string")}if(g.selectors){if(!Object.isArray(g.selectors)){g.selectors=[g.selectors]
}}else{g.selectors=[]}b.set(g.name,g);this[g.name]=g.name},compile:function(f){try{if(this[f]&&!Object.isString(this[f])){throw'Behavior "'+f+'" has already been compiled.'}var g=b.get(f);if(!g){throw'Behavior "'+f+'" has not been defined.'}if(g.inherits){g.inherits=this.getBehaviorType(g.inherits);if(g.inherits.definition.options){g.options=$extend($clone(g.inherits.definition.options),g.options||{})}if(g.inherits.definition.consts){g.consts=$extend($clone(g.inherits.definition.consts),g.consts||{})
}}g.methods.behaviorName=f;this[f]=Class.create(g.inherits||a,g.methods,g.consts?g.consts:{});this[f].instances=$A();this[f].name=f;this[f].definition=g;if(g.consts){$extend(this[f],g.consts)}$extend(this[f],{getDefault:function(){return Dtv.behaviors[f].instances.first()}},g.statics);if(g.stylesheet){Dtv.defer(Dtv.utils.addStylesheet.curry(g.stylesheet))}if(this[f]._init){this[f]._init()}}catch(h){Dtv.debug(h,"Failed to compile behavior: "+f)}return this[f]},purge:function(h,f){try{if(h.isDisposed){return false
}if(h.__supressGC){return false}if(f&&h.el.parentNode){h.el.remove()}h.dispose();return true}catch(g){Dtv.debug(g,"Failed to purge behavior "+h.behaviorName)}},collectOrphans:function(){var f=$A();$A(arguments.length>0?arguments:[Dtv.behaviors]).each(function(h){try{if(Object.isString(h)){h=Dtv.behaviors[h]}if(!h.instances){Dtv.debug("could not purge orphaned behaviors for scope "+h);return}h.instances.each(function(j){if(!j.el.parentNode){f.push(j)}})}catch(g){Dtv.debug(g,"Failed to collect orphan")
}});return f},purgeOrphans:function(){this.collectOrphans.apply(this,arguments).each(Dtv.behaviors.purge)},applyBehavior:function(g,f,n,o,k){var l=[];var j=this.getBehaviorName(f);var m=this.getBehaviorType(j);if(m){if(n){var h=(n=="body")?[$(document.body)]:$(g||document.body).select(n);h.each(function(p){if(!(p.behaviors&&p.behaviors[j])){l.push(new m(p,o))}else{if(k&&o){p.behaviors[j].setOptions(o)}}})}else{if(!(g.behaviors&&g.behaviors[j])){l.push(new m(g,o))}}}else{Dtv.debug("Could not apply behavior '"+j+"' - type could not be found")
}return l},applyMappings:function(g){var f=[];b.each(function(k){try{var h=k.value;h.selectors.each(function(l){var m=null;options=null;if(Object.isString(l)){m=l}else{if(!l.test||l.test()){m=l.expr;options=l.options}}if(m){if(l.defer&&!c){Dtv.defer(Dtv.behaviors.applyBehavior.bind(Dtv.behaviors,g,h.name,m,options))}else{f=f.concat(Dtv.behaviors.applyBehavior(g,h.name,m,options))}}})}catch(j){Dtv.debug(j,"applyMappings failure to "+k.key)}});c=true;return f},getBehaviorName:function(g){var f=g&&g.definition?g.definition.name:g;
if(!Dtv.behaviors[f]){throw"Behavior "+f+" is not defined"}return f},isCompiled:function(h){var f=this.getBehaviorName(h);var g=this[f];if(!g){throw"Behavior "+f+" is not defined"}else{if(Object.isString(g)){return false}}return true},getBehaviorType:function(g){var f=this.getBehaviorName(g);return this.isCompiled(f)?this[f]:this.compile(f)},get:function(f){return this.isCompiled(f)?this[this.getBehaviorName(f)]:this.compile(f)},utils:{isContentPage:function(){var f=document.location.href.toLowerCase();
return(f.indexOf("/content/")!=-1)}}}})();$profile.loggers.globaljs=$profile("global.js");if(logjs){Event.observe(document,"dom:loaded",function(){$log("[ dom:loaded ]")});Event.observe(window,"load",function(){$log("[ window.load ]")})}Event.observe(document,"click",function(h){if(!Prototype.Browser.IE&&!Event.isLeftClick(h)){return}var f=h.findElement("a");if(!f){if(h.element().hasClassName("js-action")){f=h.element()}else{return}}if(f.disabled){h.stop();return false}if(f.hasClassName("js-action")){if(f.rel&&f.rel.indexOf(":")>-1){var j=f.rel.split(":");
var g=f.findBehavior(j[0],true);if(g){g.bindAction(f);g.handleAction(j[1],f,h)}}h.stop();return false}else{if(f.hasClassName("js-submit")){var c;if(f.rel){var a=$(f.rel);if(a){c=a.up("form")}}else{c=f.up("form")}if(c&&c.getController){var d=c.getController();if(d){d.bindTrigger(f);d.handleTrigger(f)}else{Dtv.debug("js-submit element click ignored: found form el but no form controller.")}}else{Dtv.debug("js-submit element click ignored: could not find form el.")}h.stop();return false}else{var b=false;
$A(f.classNames()).forEach(function(k){if(k=="js_processing_timeout"||(k.startsWith("js-")&&(k.endsWith("-opener")||k.endsWith("-link")))){b=true;return true}});if(b||f.href=="#"||f.href==window.location.href+"#"){h.stop();return false}}}});var SUPPRESS_SURVEY_LIGHTBOX=false;Dtv.expedite(function(){$log("fireDtvDomLoadedEvents start");var a=$profile("fireDtvDomLoadedEvents");try{document.execCommand("BackgroundImageCache",false,true)}catch(b){$log("BackgroundImageCache failed: "+b)}try{initializeHeaderStyles()
}catch(b){$log("initializeHeaderStyles failed: "+b)}try{initializePromo()}catch(b){$log("initializePromo failed: "+b)}$log("fireDtvDomLoadedEvents end");if(a){a.stop()}});var DIRECTV=DIRECTV?DIRECTV:new Object();function initializeTypeAheadSearch(){try{if($("seach_autocomplete_items")){var a=$("dtv_topnav_search_input");a.hasFocus=false;Event.observe(a,"blur",function(){$("dtv_topnav_search_input").hasFocus=false});Event.observe(a,"focus",function(){$("dtv_topnav_search_input").hasFocus=true});var d=function(){$("searchForm").submit()
};DIRECTV.Search=DIRECTV.Search?DIRECTV.Search:new Object();var b=new Autocompleter.Local("dtv_topnav_search_input","seach_autocomplete_items",[],{minChars:1,frequency:0.2,indicator:"search_wait_proc",afterUpdateElement:d});b.dictCache={};b.dictRequests={};b.dictShown={};b.newListRendered=false;b.options.cdnUrl=$("typeAheadCdnUrl").innerHTML;b.getUpdatedChoices=function(){this.startIndicator();var f=this.getToken().slice(0,1).toLowerCase();if(/\w|\d/.match(f)){if(!this.dictCache[f]){if(!this.dictRequests[f]){this.dictRequests[f]=f;
this.getDict(f);this.options.array=[]}}else{this.dictShown[f]=true;this.options.array=this.dictCache[f];this.stopIndicator();this.newListRendered=true;this.updateChoices(this.options.selector(this))}}else{this.stopIndicator()}};b.getDict=function(h){var g=document.getElementsByTagName("head").item(0);var f=document.createElement("script");f.setAttribute("type","text/javascript");f.setAttribute("src",this.options.cdnUrl+"/csf/typeahead/"+h+".js");g.appendChild(f)};b.loadDict=function(g,f){this.dictCache[g]=f;
if(!this.dictShown[g]){this.dictShown[g]=true;this.newListRendered=true;this.getUpdatedChoices()}};b.oldRender=b.render;b.render=function(){if(this.newListRendered){this.index=-1;this.newListRendered=false}this.oldRender()};b.selectEntry=function(){this.active=false;this.element.value=this.getCurrentEntry().innerHTML.stripTags();$("searchForm").submit()};b.markPrevious=function(){this.index=(this.index>=0)?this.index:0;if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(false);
this.element.value=this.getCurrentEntry().innerHTML.stripTags()};b.oldMarkNext=b.markNext;b.markNext=function(){this.oldMarkNext();this.element.value=this.getCurrentEntry().innerHTML.stripTags()};DIRECTV.Search.typeAhead=b}}catch(c){$log("type ahead search init: "+c)}}document.observe("dom:loaded",initializeTypeAheadSearch);function dtvUniqueId(){return new Date().getTime()+"."+Math.random()+"."+Math.random()}function appendParamsAndReloadPage(d,b){var c=document.location.href;c=c.replace(/#/i,"");
if(c.indexOf("?")!=-1&&c.indexOf("?")<c.length){var a=c.substring(c.indexOf("?")+1).toQueryParams();d=Object.extend(a,d);c=c.substring(0,c.indexOf("?"))}c+="?"+Object.toQueryString(d);if(b!=undefined&&b=="true"){c=c.replace(/http/i,"https")}document.location.href=c;return false}function scrollWithOffset(a,b){a=$(a);if(!a){return}var c=a.cumulativeOffset();c.top-=b;if(c.top<0){c.top=0}window.scrollTo(c.left,c.top)}function isVisible(d,g){d=$(d);if(!d){$log("element with id '"+d+"' does not exist in isVisible()");
return false}var a=document.viewport.getScrollOffsets().top;var c=a+document.viewport.getDimensions().height;var b=d.cumulativeOffset().top;var f=b+d.getHeight();if(parseInt(g)==NaN){g=0}b-=g;return(b>=a&&f<=c)}function initHoverMenu(a,b){showHoverMenu=false;var a=$(a);var b=$(b);a.observe("click",function(){showHoverMenu=false;a.addClassName("active");b.addClassName("active")});a.observe("mouseover",function(){showHoverMenu=true});a.observe("mouseout",function(){showHoverMenu=false;setTimeout(function(){if(!showHoverMenu){a.removeClassName("active");
b.removeClassName("active")}},200)});b.observe("mouseout",function(){showHoverMenu=false;setTimeout(function(){if(!showHoverMenu){a.removeClassName("active");b.removeClassName("active")}},200)});b.select("li").each(function(c){c.observe("mouseover",function(){a.addClassName("active");showHoverMenu=true})})}function addBookmark(){if(window.sidebar){window.sidebar.addPanel(document.title,document.location.href,"")}else{if(window.external){window.external.AddFavorite(document.location.href,document.title)
}}return false}function goToUrl(b){if(!b){return false}if(b.toLowerCase().indexOf("http")!=0){var a="";if(document.location.port&&document.location.port!=80&&document.location.protocol!="https:"){a=":"+document.location.port}b=document.location.protocol+"//"+document.location.hostname+a+b}document.location.href=b;return false}var EVENT_AJAX_SUBMIT_CLICKED="dtv:ajaxSubmit";var EVENT_AJAX_SUCCESS="dtv:ajaxSuccess";var EVENT_AJAX_FAILURE="dtv:ajaxFailure";var EVENT_CAROUSEL_ITEM_SELECTED="itemselected";
var EVENT_CAROUSEL_ITEM_UNSELECTED="itemunselected";var EVENT_COMMON_SENSE_IFRAME_LOADED="dtv:commonSenseIframeLoaded";var EVENT_LIGHTBOX_RENDERED="dtv:lightboxRendered";var EVENT_LISTING_CONTRACTED="dtv:listingContracted";var EVENT_LISTING_EXPANDED="dtv:listingExpanded";function initializeHeaderStyles(){$$("h1.solid-header span").each(function(a){a.innerHTML=a.innerHTML+"<span>"+a.innerHTML+"<span>"+a.innerHTML+"</span></span>";a.addClassName("shadow")})}function cursorHelper(a){function b(g,h,d,c){g=$(g);
if(!(g.hasClassName(h))||g.value.length<c){return}var f=g.up().select("."+d);if(f.length>0){f[0].focus()}}b(a,"areaCode","num3",3);b(a,"num3","num4",3);b(a,"sin1","sin2",3);b(a,"sin2","sin3",2)}function enterKeySubmit(a){if(window.event&&window.event.keyCode==13){$(a).click();return false}}function openPositionedWindow(a,b,d,n,l,k,g,h,m,c){var j="width="+d+",height="+n+",screenX="+l+",screenY="+k+",left="+l+",top="+k+((g)?",status":"")+",scrollbars"+((h)?"=yes":"=no")+((m)?","+m:"");var f=openWindow(a,b,j,c);
return f}function openCenteredWindow(a,b,c,l,f,g,k,d){var j,h=0;if(screen){j=(screen.availWidth-c)/2;h=(screen.availHeight-l)/2}if(!f){f=""}if(!d){d=""}return openPositionedWindow(a,b,c,l,j,h,f,g,k,d)}function openWindow(c,b,d,a){var f=window.open(c,b,d);if(a){top.name=a}return f}function MoreInfoPopup(a){openCenteredWindow(a.href,"moreInfo",382,232,true,false,"","opener");return false}function openWindowFromSelect(b){b=$(b);if(!b||!b.match("select")){$log("Invalid select object");return}var a=b.options[b.selectedIndex].value;
if(a.length>0){openWindow(a)}}function shareLinkPopup(a){var b="";if(a=="buzzup"){b="http://buzz.yahoo.com/buzz?src=addthis&targetUrl="+encodeURIComponent(document.location.href)+"&headline="+encodeURIComponent(document.title)}else{if(a=="delicious"){b="http://del.icio.us/post?url="+encodeURIComponent(document.location.href)+"&title="+encodeURIComponent(document.title)}else{if(a=="digg"){b="http://digg.com/submit?phase=2&url="+encodeURIComponent(document.location.href)}else{if(a=="facebook"){b="http://www.facebook.com/sharer.php?u="+encodeURIComponent(document.location.href)+"&t="+encodeURIComponent(document.title)
}else{if(a=="twitter"){b="http://twitter.com/home?status="+encodeURIComponent(document.location.href)}}}}}if(b){openCenteredWindow(b,"shareWindow",800,600,true,true)}return false}var emailSignupUrl="/DTVAPP/emailsignup/emailSignup.jsp";function saveEmail(){var c=new Array();var a=document.forms.signupForm.emailField.value;c.push("email="+escape(a));var b=new Ajax.Request(emailSignupUrl,{method:"get",parameters:c.join("&"),onComplete:function(d){processResult(d)}})}function processResult(a){$("default").hide();
if(a.responseText.match(/success/)){$("fr").hide();$("success").toggle();$("validation").hide();$("error").hide();emailSignupPopup()}else{if(a.responseText.match(/exception/)){$("validation").hide();$("error").show();$("error").setStyle({color:"red"});if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}}else{$("error").hide();$("validation").show();$("validation").setStyle({color:"red"});if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()
}}}}function emailSignupPopup(a){if(!a){a=document.forms.signupForm.emailField.value}var b="/DTVAPP/emailsignup/interest.jsp?email="+a;openCenteredWindow(b,"details",382,450,true,false,"","opener");return false}function emailSignupSuccessCallback(c){var b=$("email_signup_email_address1");var a=$("email_signup_email_address2");var f=$("email_signup_email_input");if(b&&a&&f){b.innerHTML=f.value;a.innerHTML=f.value}if(c.preferencesUpdated){$("email_signup_form_container").hide();$("email_signup_confirmation").show();
return}var d=$("email_signup_not_signed_up");if(d){d.remove()}$("email_signup_signed_up").show()}function initializeEmailSignup(){var a=$("email_signup_submit");if(a){var d={subContentDiv:"content_page_email_content",hitboxEvent:"Email Signup Viewed",successCallback:emailSignupSuccessCallback};var b=new GenericWatcherHandlers(d);var c={successHandler:b.success.bind(b),failureHandler:b.failure.bind(b)};new SubmitWatcher(a,"email_signup_form",c)}}var _transitionEffect=null;function transition(a,b){b=$(b);
if(!b){$log("div with id '"+b+"' does not exist in transition()");return}if(_transitionEffect!=null){_transitionEffect.cancel()}_transitionEffect=Effect.Appear(b,{afterFinish:_transitionComplete});a=$(a);a.hide();closeTooltipsByDiv(a)}function _transitionComplete(a){_transitionEffect=null}_PROCESSING_NOTIFICATION_DIV='<div class="overlay-div-content"><div class="overlay-div-bg"></div><img src="/images/global/ajax/loading_40px.gif" alt="Processing" width="40" height="40" class="processing" /></div>';
function displayOverlay(b){b=$(b);$("dtv_tup").addClassName("hide-dropdowns");b.setOpacity(0.5);var a=new Element("div").setOpacity(0).setStyle({position:"absolute"}).addClassName("overlay-div");a.clonePosition(b);$(document.body).insert(a);a.update(_PROCESSING_NOTIFICATION_DIV);return new Effect.Opacity(a,{from:0,to:0.9,duration:0.2})}function removeOverlay(b,a){b=$(b);a=$(a);a.setStyle({width:b.getWidth()+"px",height:b.getHeight()+"px"});new Effect.Opacity(a,{from:a.getStyle("opacity"),to:0,duration:0.3,afterFinish:function(){a.remove()
}});b.setOpacity(1);$("dtv_tup").removeClassName("hide-dropdowns")}function appearContent(d,f,b,c){d=$(d);if(!d){$log("Unable to find target element in appearContent");return}var g=d.down("div");if(!g){$log(d.identify()+" does not contain a div element");return}var a=new Element("div").addClassName(b).setStyle({display:"none"});g.insert(a);a.update(f);a.setOpacity(0);d.show();a.show();c=c||{};a.appear(c);if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors(d)
}}var SubmitWatcher=Class.create();SubmitWatcher.prototype={initialize:function(c,a,b){this.formObj=$(a);this.submitObj=$(c);if(!this.submitObj){$log("submitObj with id '"+this.submitObj+"' does not exist in SubmitWatcher.initialize()");return}if(!this.formObj){$log("formObj with id '"+this.formObj+"' does not exist in SubmitWatcher.initialize()");return}this.setOptions(b);if(this.options.eventType=="change"){this.submitObj.onchange=this.hijackNode.bindAsEventListener(this)}else{this.submitObj.onclick=this.hijackNode.bindAsEventListener(this)
}this.formObj.onsubmit=this.hijackNode.bindAsEventListener(this)},setOptions:function(a){this.options={successHandler:null,failureHandler:null,createHandler:null,jsonErrorHandler:null,returnValue:false,eventType:"click"};Object.extend(this.options,a||{})},hijackNode:function(){$log("SubmitWatcher.hijackNode");if(this.options.createHandler!=null){var h=this.options.createHandler(this.formObj,this.submitObj);if(!h){return this.options.returnValue}}this.active=true;var g=this;var a=$(this.formObj);var b={hash:false};
if(this.submitObj&&(this.submitObj.type=="submit"||this.submitObj.type=="image")){b.submit=this.submitObj.name}var d=Form.serialize(a,b);this.onAfterFormSerialize();var c=null;var f={requestHeaders:{Accept:"application/json"},method:"post",postBody:d,mimetype:"application/json",timeout:this.options.timeout,onTimeout:this.options.timeoutHandler,onSuccess:function(k){try{$log("SubmitWatcher: onSuccess");g._applyJsonErrorHandler(k.responseText);c=k.responseJSON;g.onRequestComplete(c);a.fire(EVENT_AJAX_SUCCESS,c);
g._applyHandler(g.options.successHandler,c);g.active=false}catch(j){Dtv.debugInfo.transport=k;Dtv.debug(j,"SubmitWatcher: onSuccess")}},onCancel:function(j){$log("SubmitWatcher: onCancel");c={success:false,errors:[],errorFields:[]};g.onRequestComplete(c);a.fire(EVENT_AJAX_SUCCESS,c);g._applyHandler(g.options.cancelHandler||g.options.successHandler,c);g.active=false},onFailure:function(k){try{$log("SubmitWatcher: onFailure");g.onRequestComplete(c);a.fire(EVENT_AJAX_FAILURE,c);g._applyJsonErrorHandler(k.responseText);
g._applyHandler(g.options.failureHandler,k.responseText.evalJSON());g.active=false}catch(j){Dtv.debugInfo.transport=k;Dtv.debug(j,"SubmitWatcher: onFailure")}}};new Ajax.Request(a.action,f);a.fire(EVENT_AJAX_SUBMIT_CLICKED);return this.options.returnValue},_applyHandler:function(b,a){if(b==null){return}$log("SubmitWatcher._applyHandler");b(this.formObj,a)},_applyJsonErrorHandler:function(a){if(this.options.jsonErrorHandler==null){return}$log("SubmitWatcher._applyJsonErrorHandler");processJSONErrors(this.options.jsonErrorHandler.containerDiv,this.options.jsonErrorHandler.errorClass,a.evalJSON())
},onAfterFormSerialize:Prototype.emptyFunction,onRequestComplete:Prototype.emptyFunction};var GenericWatcherHandlers=Class.create({initialize:function(a){this._setHandlerOptions(a)},_setHandlerOptions:function(a){this.handlerOptions=Object.extend({subContentDiv:null,hitboxEvent:null,forcePageReload:false,forceLightboxClose:false,forceRedirect:false,successCallback:null,failureCallback:null},a||{})},success:function(a,b){if(!b.success){return this.failure(a,b)}$log("GenericWatcherHandler.success");
if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}if(this.handlerOptions.successCallback!=null&&this.handlerOptions.successCallback!=""){this.handlerOptions.successCallback(b)}if(this.handlerOptions.forceRedirect){if(b.redirectUrl!=null){window.location.href=b.redirectUrl;return true}b.errors.push("nextUrl not specified");return this.failure(a,b)}processJSONErrors(this.handlerOptions.subContentDiv,"ajaxError",b);if(b.messages){displayMessages(this.handlerOptions.subContentDiv,b.messages,b.messageLevel)
}if(this.handlerOptions.forceLightboxClose){closeLightbox()}if(this.handlerOptions.forcePageReload){window.location.reload(true)}return true},failure:function(a,b){$log("GenericWatcherHandler.failure");processJSONErrors(this.handlerOptions.subContentDiv,"ajaxError",b);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}if(this.handlerOptions.failureCallback!=null&&this.handlerOptions.failureCallback!=""){this.handlerOptions.failureCallback(b)}if(this.handlerOptions.hitboxEvent!=null){hitboxCustomEvent(this.handlerOptions.hitboxEvent,null)
}return false}});function ajaxFormSubmitAndPopulate(g,b,f,h,k,c,j){var d=$(g).up("form");if(!d){$log("No parent form found for "+$(g).identify());return}var a=Form.serialize(d);ajaxRequestAndPopulate(b,f,a,h,k,c)}function ajaxRequestAndPopulate(b,f,a,g,j,d,h){if(d>=0){scrollWithOffset(b,d)}var k=displayOverlay(b);var c={method:"post",evalScripts:true,postBody:a,onComplete:_ajaxRequestAndPopulateComplete.curry(b,g,k,j,h)};new Ajax.Request(f,c)}function _ajaxRequestAndPopulateComplete(h,g,f,c,a,b,d){if(f.state!="finished"){setTimeout(_ajaxRequestAndPopulateComplete.curry(h,g,f,c,a,b,d),100);
return}if(b.status<200||b.status>300){$(h).update(g)}else{$(h).update(b.responseText)}if(!a&&Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.reset()}if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors()}removeOverlay(h,f.element);if(c instanceof Function){c()}}function displayLightbox(c,b){var a=$(document.body);if(!a.hasBehavior(Dtv.behaviors.LegacyLightbox)){setTimeout(displayLightbox.curry(c,b),300)}else{var d=a.behavior(Dtv.behaviors.LegacyLightbox);
d.create(c,b)}}function closeLightbox(){var a=$(document.body);var b=a.behavior(Dtv.behaviors.LegacyLightbox);if(b._currentLightboxWindow.length==0){$log("closeLightbox() called when no lightbox is open");return}closeTooltipsByDiv(b._currentLightboxContentDiv[0]);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}b.closeLightboxMinimal()}function openDtvLightbox(j,f,h,g,d,a){if(!document.loaded){document.observe("dom:loaded",openDtvLightbox.curry(arguments));
return}var b=new Element("div");b.setStyle({display:"none"});$(document.body).insert(b);var c=$(b).identify();new Ajax.Updater(c,"/DTVAPP/global/lightbox/lightboxAjaxContent.jsp",{onComplete:_openDtvLightbox.curry(c,arguments)})}function _openDtvLightbox(c,a){if(a.length<2){$log("_openDtvLightbox called without title and lightboxContent arguments");return}var l=(a.length>=2)?a[2]:true;var j=(a.length>=3)?a[3]:false;var b=(a.length>=4)?a[4]:false;var g=(a.length>=5)?a[5]:false;var k=a[0];var d=a[1];
contentOptions={contentDiv:c,suppressHitbox:true};$(c).down(".lb-header").update("<span>"+k+"</span>");var f=$(c).down(".js-ajax-content");if(l){f.addClassName("dtv-lightbox-overflow")}function h(p,n,o){var m=new Element("a",{href:"javascript:void(0)","class":n}).update("<span>"+p+"</span>");m.observe("click",o);lightboxButtonDiv.insert(m)}lightboxButtonDiv=$(c).down(".js_ajax_buttons");if(g){h(g==true?"Print":g,"btn-sm-std",printLightboxContent.curry($(f).identify()))}if(j){h(j==true?"OK":j,"btn-sm-stdact",closeLightbox)
}if(b){h(b==true?"Cancel":b,"btn-sm-std",closeLightbox)}if($(d)){$(f).update($(d).innerHTML);displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}else{new Ajax.Updater(f,d,{onComplete:displayLightbox.curry(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS),method:"get"})}hitboxCustomEvent(k+" Lightbox","global")}function printLightboxContent(a){printWindow=openCenteredWindow("","printWindow",600,600,false,true,"","");printWindow.document.open();printWindow.document.write($(a).innerHTML);printWindow.document.close();
printWindow.print()}function hitboxCustomEvent(d,c){var f="Lightbox+with+no+page+name+set";if(d!=null&&d!=""){f=d.replace(/\s/g,"+")}else{if(hbx.pn!=null&&hbx.pn!=""){f=hbx.pn+"+Lightbox"}}try{var a=_mlc;if(c){_hbPageView(f,c.replace(/\s/g,"+"))}else{if(hbx.mlc!=null&&hbx.mlc!=""){_hbPageView(f,hbx.mlc)}else{_hbPageView(f,_mlc)}}_mlc=a}catch(b){}}function hitboxCommerceReport(h,b,f,c){var d=$("dtv_custom_hitbox");if(!($(d))){d=new Element("div",{id:"dtv_custom_hitbox"});$(d).setStyle({width:"1px",height:"1px",overflow:"hidden"});
$(document.body).insert(d)}var a="/DTVAPP/includes/hitboxIFrame.jsp";a+="?hitboxPageType="+h.replace(/\s/g,"+");a+="&hitboxSubsystem="+b.replace(/\s/g,"+");a+="&hitboxPageName="+f.replace(/\s/g,"+");a+="&hitboxCategory="+c.replace(/\s/g,"+");var g=new Element("iframe");g.src=a;$(d).update();$(d).insert(g)}function transitionToAjaxContent(){var b=$("lb_thinking");if(!b||!b.visible()){setTimeout(transitionToAjaxContent,200);return}setTimeout(transition.curry("lb_thinking","lb_ajax"),300);if(Dtv.behaviors.isCompiled("GenericRollover")&&Dtv.behaviors.GenericRollover.resetRollovers){Dtv.behaviors.GenericRollover.resetRollovers()
}if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors()}Dtv.behaviors.applyBehavior("lb_ajax","CollapsibleTab",".js-collapsible-tabs");if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.reset()}var a=$("lb_ajax").select("div");if(a!=null&&a.length>0){childId=a[0].id;if(childId!=null){hitboxDiv=$(childId+"_hitbox");if(hitboxDiv!=null&&hitboxDiv.title!=null){hitboxCustomEvent(hitboxDiv.title)}}}$("lb_ajax").fire(EVENT_LIGHTBOX_RENDERED)
}function displayGenericErrorLightbox(a){contentOptions={callback:"dtv:lightboxErrorOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_generic_error",hitboxPageName:"Generic+Error+Lightbox"};displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS);if(a.errors==null||a.errors.length==0){a.addError("An unknown error has occurred.")}processJSONErrors("lb_generic_error","ajaxError",a)}function displayLoginLightbox(b){var a=Dtv.behaviors.AjaxLightbox.show("/DTVAPP/global/lightbox/lightboxLogin.jsp",{hitboxEvent:"Login Lightbox",forceLightboxClose:false,onAjaxSuccess:function(c){if(c.redirectUrl!=null){window.location.href=c.redirectUrl;
return}if(b){b()}else{a.hide()}}})}function displayTermsAndConditionsLightbox(a,b){Dtv.behaviors.AjaxLightbox.show("/DTVAPP/global/lightbox/lightboxTermsAndConditions.jsp",{hitboxEvent:"Terms and Conditions Lightbox",forceLightboxClose:false,onInit:function(){$("toc_inner").update($(a).innerHTML);if(!b){b="Terms &amp; Conditions"}Dtv.behaviors.AjaxLightbox.instances[0].el.down(".lb-header").update("<span>"+b+"</span>")}})}function displayInterstitial(g,d){var a='<div class="thinking"><img src="/images/global/icons/dtv_logo_animated_blue.gif" alt="Thinking" width="105" height="108" /></div>';
a+=g;var b=new Element("div",{id:"dtv_interstitial",style:"display:none"}).update(a);$(document.body).insert(b);var c={className:"dtv_interstitial",width:500,height:250,top:100};var f={callback:"dtv:interstitialLightboxLoginOpened",contentDiv:"dtv_interstitial",suppressHitbox:true};if($("overlay_modal")&&$("overlay_modal").hasClassName("overlay_directv-alert")){$("overlay_modal").removeClassName("overlay_directv-alert");$("overlay_modal").addClassName("overlay_dtv_interstitial")}displayLightbox(f,c);
if(d!=undefined){_interstitialCallback(d)}}function _interstitialCallback(a){if(!($("overlay_modal"))||$("overlay_modal").getStyle("opacity")<0.99){setTimeout(_interstitialCallback.curry(a),300);return}setTimeout(a,500)}function suppressExternalLightboxes(){SUPPRESS_SURVEY_LIGHTBOX=true}function allowExternalLightboxes(){SUPPRESS_SURVEY_LIGHTBOX=false}function processJSONErrors(c,b,a){clearErrors(c,b);if(a==null){return}displayMessages(c,a.errors,a.errorLevel);a.errorFields.each(function(d){applyFieldError(b,d,c)
})}function applyFieldError(b,a,c){elementObj=$(a);if(!elementObj){elementObj=$(c||document.body).first('input[name="'+a+'"]')}if(!elementObj){$log("No field with element ID: "+a);return}Element.addClassName(elementObj,b);Element.addClassName(elementObj.identify()+"Label",b);Element.addClassName(elementObj.identify()+"Icon",b)}function clearErrors(b,a){$(b).select("."+a).invoke("removeClassName",a);$(b).select(".js_message_wrapper").invoke("hide")}function displayMessages(k,d,f,o){if(o==undefined){o=false
}if(!$(k)){$log("messageContainerDiv with id '"+k+"' does not exist in displayMessages()");return}var m={ERROR:"error-message",WARN:"warning-message",INFO:"info-message"};for(var b in m){var c=m[b];var j=$(k).select("."+c)[0];if(!$(j)){$log("wrapperDiv with id '"+j+"' does not exist in displayMessages()");return}$(j).hide();if(d==null||d.length<=0){continue}var n=$(j).select(".js_message_content")[0];if(!$(n)){$log("messageDiv with id '"+n+"' does not exist in displayMessages()");return}var a="";
if(o){var h=$(n).select("li");for(var g=0;g<h.length;g++){var l=h[g].innerHTML;if(l.length>0){a+="<li>"+l+"</li>"}}}if(b==f){for(var g=0;g<d.length;g++){a+="<li>"+d[g]+"</li>"}}$(n).update(a);if(b==f||(o&&a!="")){$(j).show()}}}function timeoutWarning(){var b={contentDiv:"lightboxTimeoutDiv",callback:"dtv:lightboxTimeoutOpened",hitboxPageName:"Session Timeout Warning Lightbox",hitboxPageCategory:"/global",suppressSessionRefresh:true};var a={width:598,height:330,top:100};displayLightbox(b,a);return false
}function executeDtvTimeout(a){self.location=self.location.protocol+"//"+self.location.host+a+"?reason=timeout&lastVisited="+self.location.pathname+self.location.search}function refreshSession(){var a="/DTVAPP/global/touch.jsp";new Ajax.Request(a,{method:"get"})}function openPepSessionWarningLightbox(){try{if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}Dtv.behaviors.AjaxLightbox.show("lightboxPepSessionWarning.jsp",{hitboxEvent:"PEPOD Session Warning Lightbox",forcePageReload:true})
}catch(a){Dtv.debug(a,"Failed to open pep session warning lightbox");throw a}}function closeTooltipsByDiv(a){if(Dtv.behaviors.BusinessInfoPop&&Dtv.behaviors.BusinessInfoPop.instances){Dtv.behaviors.BusinessInfoPop.instances.invoke("hide")}}function initializePromo(){var g="customer";var a=""+document.cookie;var b=a.indexOf(g);if(b==-1||g==""){var d=$("prospect-promo");if(d!=null){d.toggle()}}else{var f=$("customer-promo");if(f!=null){f.toggle()}}}function killFlash(){if(document.getElementById("flashcontent")!=null){document.getElementById("flashcontent").innerHTML=""
}fo=null}var DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS={width:598,height:330,top:50};var DEFAULT_CEP_LIGHTBOX_OPTIONS={width:794,height:330,top:50};function toggleFaqAnswer(b){var a=$(b).next(".faq_toggle_content");if($(b).hasClassName("faq_toggle_heading_active")){new Effect.BlindUp(a,{duration:0.5})}else{new Effect.BlindDown(a,{duration:0.5})}$(b).toggleClassName("faq_toggle_heading_active")}function displayFaqCategory(a){$("faq_page").select(".js_faq_entry").each(function(b){$(b).hide()});$(a).show()
}function initializeFaqPage(b,a){if(!($(b))){b="faq_1"}displayFaqCategory(b);if($(a)){$(a).scrollTo()}else{a=$(b).down("h4")}toggleFaqAnswer(a)}var scheduleInstallationHandlerOptions={subContentDiv:"lb_schedule_installation",hitboxEvent:"Select Installation Appointment Lightbox",forceRedirect:true};var scheduleInstallationHandlers=new GenericWatcherHandlers(scheduleInstallationHandlerOptions);function initializeScheduleInstallLightbox(){transitionToAjaxContent()}function displayScheduleInstallLightbox(){contentOptions={callback:"dtv:lightboxScheduleInstallOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_schedule_installation",hitboxPageName:"Schedule Installation Lightbox"};
displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}var _availableScheduleInstallTimes=new Array();var _availableScheduleInstallDates=new Array();var _scheduleInstallTimes={E:"6-8 AM",A:"8 AM-Noon",P:"Noon-4 PM",L:"4-8 PM"};function initializeScheduleInstallCalendar(l){if($("scheduleInstallationSubmit")){new SubmitWatcher("scheduleInstallationSubmit","scheduleInstallationForm",{successHandler:scheduleInstallationHandlers.success.bind(scheduleInstallationHandlers),failureHandler:scheduleInstallationHandlers.failure.bind(scheduleInstallationHandlers)})
}_availableScheduleInstallTimes=new Array();var f=new Date();f.setDate(1);if(l!=null&&l.length>0){var h=l.split(",");for(var d=0;d<h.length;d++){var k=h[d].split(":");var n=k[0].split("/");var g=new Number(n[0]).valueOf();var m=new Number(n[1]).valueOf();var j=new Number(n[2]).valueOf();if(_availableScheduleInstallTimes[g]==null){_availableScheduleInstallTimes[g]=new Array()}_availableScheduleInstallTimes[g][m]=k[1];if(d==0){f.setDate(m);f.setMonth(g-1);f.setYear(j)}}}if($("installCalendarCurrent")&&$("installCalendarNext")){var c={embedded:true,onchange:scheduleInstallClick.curry("installCalendarCurrentInput"),month_year:"label",buttons:false,valid_date_check:isValidScheduleInstallDate,date:f.toString()};
new CalendarDateSelect($("installCalendarCurrentInput"),c);var a=new Date();a.setDate(1);if(f.getMonth()<11){a.setMonth(f.getMonth()+1);a.setYear(f.getFullYear())}else{a.setMonth(0);a.setYear(f.getFullYear()+1)}var b={embedded:true,onchange:scheduleInstallClick.curry("installCalendarNextInput"),month_year:"label",buttons:false,valid_date_check:isValidScheduleInstallDate,date:a.toString()};new CalendarDateSelect($("installCalendarNextInput"),b)}}function isValidScheduleInstallDate(b){var c=b.getMonth()+1;
var a=b.getDate();return(_availableScheduleInstallTimes[c]!=null&&_availableScheduleInstallTimes[c][a]!=null)}function scheduleInstallClick(b){var a=new Date($(b).value);$("installYear").value=a.getFullYear();$("installMonth").value=a.getMonth()+1;$("installDay").value=a.getDate();updateScheduleInstallTimes(a.getMonth()+1,a.getDate());$("scheduleInstallDateLabel").update($(b).value);if($(b).id=="installCalendarNextInput"){$("installCalendarCurrent").select(".cds_footer span")[0].update("&#160;")}else{$("installCalendarNext").select(".cds_footer span")[0].update("&#160;")
}}function updateScheduleInstallTimes(f,b){var a=_availableScheduleInstallTimes[f][b];if(a==null){return}var g=$("installWindow");g.options.length=0;g.options[0]=new Option("Select a time","");for(var c=0;c<a.length;c++){var d=a.charAt(c);g.options[c+1]=new Option(_scheduleInstallTimes[d],d)}}function lightboxScheduleLater(b){closeLightbox();if(!($("checkout-error"))){return}if($("checkout-error").innerHTML.indexOf(b)!=-1){return}var a=new Array();a[0]=b;displayMessages("checkout-error",a,"WARN",true)
}function viewPrintablePackagePage(a){if(a==""){return}openCenteredWindow(a,"printPackage",700,600,true,true)}function fixMissingChannelLogo(a){a.src="/images/channel_call_sign/GENERIC.gif";a.onerror="";return true}function createCookie(c,d,f){if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var f=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var g=a[d];
while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}
/*
 transitions.js
 Based on Easing Equations v2.0
 (c) 2003 Robert Penner, all rights reserved.
 This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html
 Adapted for Scriptaculous by Ken Snyder (kendsnyder ~at~ gmail ~dot~ com) June 2006
 */
Effect.Transitions.easeFromTo=function(a){if((a/=0.5)<1){return 0.5*Math.pow(a,4)
}return -0.5*((a-=2)*Math.pow(a,3)-2)};Effect.Transitions.easeFrom=function(a){return Math.pow(a,4)};Effect.Transitions.easeTo=function(a){return Math.pow(a,0.25)};function pngFix(a){if(a&&Prototype.Browser.IE6){if(a.src.toLowerCase().indexOf(".png")>-1){a.style.width=a.getWidth()+"px";a.style.height=a.getHeight()+"px";a.style.background="none";a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"',sizingMethod='scale')";a.src="/images/spacer.gif"}}}Dtv.util={};Dtv.util.getStyleValue=function(a){if(!a){return 0
}return Object.isString(a)?a:(a+"px")};if($profile.loggers.globaljs){$profile.loggers.globaljs.stop()}function printContingencyWarningMessage(){var j=document.getElementsByTagName("body")[0];if(!document.cookie||document.cookie.indexOf("JSESSIONID")==-1){document.write('<div id="contingency_warn">You must enable cookies in order to use the directv.com web site.</div>')}else{if(!window.XMLHttpRequest&&document.cookie.indexOf("oldbrowser")==-1){var g=document.createElement("div");var h=document.createTextNode("Your browser is not optimized for DIRECTV.com. We have a few recommendations for improving your experience online. ");
var b=document.createElement("a");var f=document.createTextNode("Learn More");var a=document.createElement("span");a.setAttribute("class","btn-close-warning");a.className="btn-close-warning";a.setAttribute("title","Close");a.onclick=function(){var l=document.getElementById("contingency_warn");l.parentNode.removeChild(l);j.style.backgroundPosition="0 0";j.style.paddingTop="0";createCookie("oldbrowser","1")};g.setAttribute("id","contingency_warn");b.setAttribute("href","/DTVAPP/content/site_requirements");
b.setAttribute("title","System requirements for DIRECTV.com");b.appendChild(f);g.appendChild(h);g.appendChild(b);g.appendChild(a);j.insertBefore(g,j.firstChild)}else{return}}var d=$("contingency_warn");var c=13;var k=c+d.offsetHeight+parseInt(d.getStyle("margin-bottom"));j.style.backgroundPosition="0 "+k+"px";j.style.paddingTop=c+"px"}var iCurrentListIndex=0;var iCurrentClipIndex=0;var bUserClicked=false;var bDomLoaded=false;Event.observe(document,"dom:loaded",function(){bDomLoaded=true;if($("dtvfilmstrip_tup")){try{displayPlaylist(0)
}catch(b){}var a=0;$("home_video_playlist_tabs").select("ul li a").each(function(c){c.iIndex=a++;c.observe("click",function(){loadPlaylistTabData(this.iIndex)})});initPlaylistHovers();$$("#home_news ul li").each(function(c){c.observe("mouseover",function(){c.addClassName("hover")});c.observe("mouseout",function(){c.removeClassName("hover")})})}});function initPlaylistHovers(){var a=0;$("home_video_playlist").select("ul").each(function(c){c.iIndex=a++;var b=0;c.select("li").each(function(d){d.iIndex=b++;
d.observe("mouseover",function(){d.addClassName("hover")});d.observe("mouseout",function(){d.removeClassName("hover")});d.observe("dtvplaylist:click",function(){removePlaylistClipActiveStates();d.addClassName("active");var f=formatMetaData(d);$("dtvplayer").playClipFromMeta(f);iCurrentListIndex=c.iIndex;iCurrentClipIndex=d.iIndex;if(!bUserClicked){c.scrollTop=d.offsetTop-d.offsetHeight*0.8}bUserClicked=false;return false});d.observe("click",function(){bUserClicked=true;d.fire("dtvplaylist:click")
})})})}function loadPlaylistTabData(a){if(a>0){if($("home_video_playlist_dynamic").className.indexOf("content-loaded")==-1){new Ajax.Updater("home_video_playlist_dynamic","/DTVAPP/home/component/homeVideoPlaylistDynamic.jsp",{method:"get",onSuccess:function(c){var b=setInterval(function(){clearInterval(b);displayPlaylist(a);initPlaylistHovers()},100)},onFailure:function(){}});$("home_video_playlist_dynamic").addClassName("content-loaded")}else{displayPlaylist(a)}}else{displayPlaylist(a)}}function displayPlaylist(a){$("home_video_playlist_tabs").select("ul li").each(function(b){b.removeClassName("active")
});$("home_video_playlist").select("ul").each(function(b){b.removeClassName("active")});$("home_video_playlist_tabs").select("ul li")[a].addClassName("active");$("home_video_playlist").select("ul")[a].addClassName("active")}function removePlaylistClipActiveStates(){$("home_video_playlist").select("ul li").each(function(a){a.removeClassName("active")})}function formatMetaData(b){var a="";a+="<flv>"+b.select("a")[0].name+"</flv>";a+="<title>"+b.select("h4")[0].innerHTML+"</title>";a+="<linktext>"+b.select("a")[0].title+" </linktext>";
a+="<linkurl>"+b.select("a")[0].href+"</linkurl>";a+="<stillframe>"+b.select("img")[0].title+"</stillframe>";return a}function clipFinishedPlaying(){if(iCurrentClipIndex+1>$("home_video_playlist").select("ul")[iCurrentListIndex].select("li").length-1){var a=0}else{var a=iCurrentClipIndex+1}$("home_video_playlist").select("ul")[iCurrentListIndex].select("li")[a].fire("dtvplaylist:click")}function playFirstClip(){if(bDomLoaded){var b=readCookie("dtv_home_player");if(b){var a=Math.floor($("home_video_playlist").select("ul")[0].select("li").length*Math.random());
$("home_video_playlist").select("ul")[0].select("li")[a].fire("dtvplaylist:click")}else{$("home_video_playlist").select("ul")[0].select("li")[0].fire("dtvplaylist:click");createCookie("dtv_home_player","played",0.5)}}else{setTimeout(playFirstClip,50)}}function hitboxLinkFromFlash(d,b,a){try{Reporting.UserActionManager.reportFlashLinkData(d,b,a)}catch(c){}if(b==null||b=="null"){b=""}if(a==null||a=="null"){a=""}try{if(typeof(_hbLink)=="function"){_hbLink(d,b,a)}else{var f=setInterval(function(){clearInterval(f);
hitboxLinkFromFlash(d,b,a)},1000)}}catch(c){$log("hitboxLinkFromFlash failed: "+c)}}function fireDtvDomLoadedEvents(){}swfobject.registerObject("dtvfilmstrip","9.0.115","/resources/flash/swfobject/expressInstall.swf",swfobjCallback);Dtv.behaviors.define({name:"CartNotification",selectors:"#global_header_notification",methods:{_init:function(){this.el.observeEvents({mouseenter:this.clearCloseTimeout.bind(this),mouseleave:this.setCloseTimeout.bind(this)}).appear();this.setCloseTimeout()},clearCloseTimeout:function(){if(this._timeout){window.clearTimeout(this._timeout)
}},setCloseTimeout:function(){this._timeout=window.setTimeout(this.close.bind(this),15000)},close:function(){this.el.fade()}}});
/*
 * Tooltip code based on http://www.wildbit.com/labs/cooltips/ by Andrew Okonetchnikov.  Licensed under the MIT license.
 *
 * Copyright (c) 2006-2007 Andrey Okonetchnikov
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
(function(){Dtv.behaviors.define({name:"GenericRollover",selectors:[{expr:"body",test:function(){var a=document.location.href.toLowerCase();
return(a.indexOf("/content/")!=-1||a.indexOf("/cep/")!=-1||a.indexOf("/compare/")!=-1||a.indexOf("/search/")!=-1||a.indexOf("/new_customer/")!=-1||a.indexOf(":7001")!=-1)},defer:true},{expr:".js-tooltip-container",defer:true}],statics:{resetRollovers:function(){var a=this.getDefault();if(a){a._reset()}},addRollovers:function(b){var a=this.getDefault();if(a){$(b).select(".js_rollover").each(function(c){a.openers.push(c);c.observe("mouseenter",a._show.bindAsEventListener(a,c))})}}},methods:{_init:function(){this.visibleRollover="";
this.openers=this.el.select(".js_rollover");this.rollovers=new Array(this.openers.length);this.openerPositions=new Array(this.openers.length)},_initEvents:function(){this.updateEvent=this._update.bindAsEventListener(this);this.openers.each(function(a){a.observe("mouseenter",this._show.bindAsEventListener(this,a))},this)},_reset:function(){this.openers.each(function(a){a.stopObserving("mouseenter")});this._init();this._initEvents()},_show:function(c,b){try{if(this.visibleRollover==b){return}if(b.disabled){return
}this.observe(b,"mouseleave",this._hide.bindAsEventListener(this,b));this.visibleRollover=b;this._buildTooltip(b);this._setPosition(b,{xCord:Event.pointerX(c)});this._setPosition(b,{yCord:Event.pointerY(c)});this._appear(b)}catch(a){Dtv.debug(a,"Failed to show rollover")}},_buildTooltip:function(h){try{if(this._getRollover(h)){return}var l=h.title?$(h.title):h.first(".dtv-rollover-tup");h.title="";if(l){h.select("img").each(function(m){m.alt=""});l=l.remove();$(document.body).insertBefore(l,$(document.body).childNodes[0]);
var a=l.getDimensions();var c=a.width+10;var k=a.height;this._setPosition(h,{width:c});this._setPosition(h,{height:k});l.style.width=c+"px"}var b=this._getOpenerIndex(h);this.rollovers[b]=l;if(this.openerPositions[b]){var f=this.openerPositions[b].openerWidth;var j=this.openerPositions[b].openerHeight;if(!f||!j){var d=h.getDimensions();this._setPosition(h,{openerWidth:d.width});this._setPosition(h,{openerHeight:d.height})}}}catch(g){Dtv.debug(g,"Failed to build Tooltip - exception will be ignored")
}},_hide:function(c,b){b.stopObserving("mouseleave");b.stopObserving("mousemove",this.updateEvent);if(this.visibleRollover!=b){return}this.visibleRollover="";if(this.appearingFX){this.appearingFX.cancel()}var a=this._getRollover(b);if(a){a.hide()}},_appear:function(b){this._setup(b);b.observe("mousemove",this.updateEvent);var a=this._getRollover(b);if(a){a.show()}},_setup:function(g){var d=this._getOpenerIndex(g);var b=this.openerPositions[d].xCord;var h=this.openerPositions[d].yCord;var c=this.openerPositions[d].width;
var a=this.openerPositions[d].height;if(b+c>=Element.getWidth(document.body)){b=b-c+20;this._setPosition(g,{xCord:b})}var f=this._getRollover(g);if(f){f.setStyle({left:(b-7)+"px",top:(h-a-7)+"px"})}},_update:function(b){var a=this.visibleRollover;if(!a){this.debug("Update called when no tooltip opener is visible")}this._setPosition(a,{xCord:Event.pointerX(b)});this._setPosition(a,{yCord:Event.pointerY(b)});this._setup(this.visibleRollover)},_getRollover:function(b){var a=this._getOpenerIndex(b);return this.rollovers[a]
},_getOpenerIndex:function(b){for(var a=0;a<this.openers.length;a++){if(this.openers[a]==b){return a}}throw"opener not found in _getOpenerIndex"},_setPosition:function(c,d){var b=this._getOpenerIndex(c);var a=this.openerPositions[b]||{};a=Object.extend(a,d);this.openerPositions[b]=a}}});Dtv.behaviors.define({name:"GenericTooltip",options:{TOOLTIP_OPTIONS:{className:"dtv_tooltip",effect:"appear",duration:0.1,hook:{target:"topRight",tip:"bottomLeft"},offset:{x:-25,y:0},showOn:"click",hideOn:{element:".close",event:"click"},closeButton:false,viewport:true}},methods:{_init:function(){this.openers=this.el.select("a.js_tooltip");
this.openers.each(function(a){var b=$(a.title);if(b){this._initializeTooltip(a,b)}a.title=""},this)},_initializeTooltip:function(a,b){var c=b.innerHTML;new Tip(a,c,this.options.TOOLTIP_OPTIONS)}}});Dtv.behaviors.define({name:"BusinessTooltip",inherits:Dtv.behaviors.GenericTooltip,selectors:[{expr:"body",test:function(){var a=document.location.href.toLowerCase();return(a.indexOf("/theguide.jsp")==-1)},defer:true},{expr:".js-tooltip-container",defer:true}],methods:{_init:function(){this.openers=this.el.select("a.js_tooltip_link");
this.openers.each(function(a){if(a.title){a.href="#";a.onclick=function(){return false};var b="<div class='dtv_tooltip_top'></div><div class='dtv_tooltip_content_wrapper'><div class='dtv_tooltip_content'><div class='dtv_tooltip_close close'></div>"+a.title+"</div></div><div class='dtv_tooltip_bottom'></div>";new Tip(a,b,this.options.TOOLTIP_OPTIONS);a.title=""}},this)}}})})();(function(){var b={AUTO:"auto",POSITIONING:{AROUND:"around",CENTERED:"centered",RELATIVE:"relative",ABSOLUTE:"absolute"},EVENTS:{CONTENT_UPDATED:"contentupdated",SHOW:"show",HIDE:"hide"}};
var a=Class.create({initialize:function(g,f){this.openEventName="click";this.lightbox=g;if(f){$extend(this,f)}this._openers=[]},addOpeners:function(f){if(!f){throw"Cannot add openers: openers argument cannot be null"}(Object.isString(f)?$$(f):f).each(this.addOpener.bind(this))},addOpener:function(f){if(this._openers.contains(f)){return false}f.observe(this.openEventName,function(g){g.stop();return this.open(f,g)&&false}.bind(this));this._openers.push(f);return true},open:function(f,g){if(f.disabled){return false
}var h={connector:this,opener:f,cancel:false,data:null};if(this.onBeforeOpen){this.onBeforeOpen(g,h);if(h.cancel){return false}}this.opener=f;this.lightbox.opener=f;this.onOpen(g,{connector:this,data:h.data});return true},onOpen:function(g,f){this.lightbox.show()}});Dtv.behaviors.define({name:"Lightbox",forceCompile:true,consts:b,options:{width:b.AUTO,height:b.AUTO,top:0,left:0,zIndex:1002,positioning:b.POSITIONING.CENTERED,effectDuration:0.1,effectQueue:"end",relElement:null,buttons:null,contentSelectors:{header:".ipop-header",body:".ipop-content"},closeSelector:".js-lb-close",modal:true,hideOnBlur:false,hideOnClick:false},statics:{allInstances:[],visibleInstances:[],modalInstances:[],_notifyEvent:function(f,h,g){switch(h){case b.EVENTS.SHOW:this.visibleInstances.push(f);
if(f.options.modal){this.modalInstances.push(f);if(this.modalInstances.length==1){Dtv.UI.disableScreen()}}break;case b.EVENTS.HIDE:this.visibleInstances.erase(f);if(this.modalInstances.length>0){this.modalInstances.erase(f);if(this.modalInstances.length==0){Dtv.UI.enableScreen()}}break}}},methods:{_init:function(){Dtv.behaviors.Lightbox.allInstances.push(this);if(this._initConnectors){this._initConnectors()}},_initLayout:function(){if(Prototype.Browser.IE6){this.iframeShim=new Element("iframe",{src:'javascript:"";',frameBorder:0}).setStyle({position:"absolute",display:"none",zIndex:this.options.zIndex,top:0,left:0}).setOpacity(0);
this.iframeShim.appendTo(document.body)}this.el.setStyle({position:"absolute",display:"none",zIndex:this.options.zIndex,top:0,left:0});this.el.appendTo(document.body)},_initEvents:function(){var f=this;f.el.select(f.options.closeSelector).each(function(g){f.observe(g,"click",function(h){f.hide();h.stop();return false})});f.observe(document,"click",function(j){try{var h=j.element();if(f.el.visible()&&f.options.hideOnBlur&&h.ancestors().indexOf(f.el)==-1){if(f.ignoreNextBlur){f.ignoreNextBlur=false
}else{f.hide()}}}catch(g){f.debug(g,"Failed to handle document click event")}});f.observe(f.el,"click",function(g){if(f.options.hideOnClick&&g.element().tagName!="A"){f.hide()}})},createConnector:function(f){return new a(this,f)},show:function(){this.refreshLayout();if(this.visible()){return false}this.el.appear({duration:this.options.effectDuration,queue:this.options.effectQueue,afterFinish:this._afterShow.bind(this)});this.fireEvent(b.EVENTS.SHOW,{lightbox:this});$$(".dtv-rollover-tup").invoke("hide");
return true},hide:function(){if(!this.visible()){return false}this.el.fade({duration:this.options.effectDuration,queue:"start",afterFinish:this._afterHide.bind(this)});this.fireEvent(b.EVENTS.HIDE,{lightbox:this});this._showSelectBoxes.bind(this).defer();$$(".dtv-rollover-tup").invoke("hide");return true},_afterShow:function(){this._hideSelectBoxes.bind(this).defer()},_afterHide:Prototype.emptyFunction,visible:function(){return this.el.visible()},fireEvent:function($super,g,f){$super(g,f);Dtv.behaviors.Lightbox._notifyEvent(this,g,f)
},getBounds:function(){var f=$el.getDimensions(this.el);f.left=$el.getStylesAsInt(this.el,"left");f.top=$el.getStylesAsInt(this.el,"top");return f},setContent:function(h,g){if(Object.isString(h)){if(c(this.getContentEl(h),g)){if(this.isInitialized){this.fireEvent(b.EVENTS.CONTENT_UPDATED,{contentType:h,content:g})}return true}return false}else{var f=false;$H(h).each(function(j){if(this.setContent(j.key,j.value)){f=true}}.bind(this));return f}},getContentEl:function(f){return this.el.first(this.options.contentSelectors[f])
},_hideSelectBoxes:function(){if(this.iframeShim){var f=this.el;var g=$el.getOuterDimensions(f);while(g.width==0||g.height==0){f=f.down("div");if(!f){break}g=$el.getOuterDimensions(f)}this.iframeShim.setStyle({width:g.width+"px",height:g.height+"px",top:this.el.style.top,left:this.el.style.left});this.iframeShim.show()}},_showSelectBoxes:function(){if(this.iframeShim){this.iframeShim.hide()}},_getBaseStyle:function(){return{width:Dtv.util.getStyleValue(this.options.width),height:Dtv.util.getStyleValue(this.options.height)}
},_adjustLayoutStyle:null,_getLayoutStyle:function(){var g=this.visible();this.el.setStyle({display:"block",visibility:"hidden"});this.el.setStyle(this._getBaseStyle());var f={display:g?"block":"none",visibility:"visible"};switch(this.options.positioning){case b.POSITIONING.AROUND:var j=d(),n=d(this._getRelatedEl()),k=$el.getOuterDimensions(this.el);n.top=this._getRelatedEl().viewportOffset()[1]-$(document.body).viewportOffset()[1];k.width=k.width||this.el.offsetWidth||this.el.down().getWidth();k.height=k.height||this.el.offsetHeight||this.el.down().getHeight();
k.left=n.left+this.options.left+((n.width-k.width)/2);k.top=n.top+this.options.top-k.height;k.right=k.left+k.width;j.right=j.left+j.width;if(k.right>j.right){k.left-=(k.right-j.right)}if(j.left>k.left){k.left=j.left}if(j.top>k.top){k.top+=(n.height+k.height)-(this.options.top*2)}f.left=k.left;f.top=k.top;break;case b.POSITIONING.CENTERED:var j=d(this._getRelatedEl()),m=$el.getOuterDimensions(this.el);var o=this._getRelatedEl();if(o){j.top=o.viewportOffset()[1]-$(document.body).viewportOffset()[1]
}var l=(j.width-m.width)/2;var h=(j.height-m.height)/2;f.left=Math.max(0,j.left+l+this.options.left);f.top=Math.max(0,j.top+h+this.options.top);break;case b.POSITIONING.RELATIVE:var j=d(this._getRelatedEl());f.left=j.left+this.options.left;f.top=j.top+this.options.top;break;case b.POSITIONING.ABSOLUTE:f.left=this.options.left;f.top=this.options.top;break}if(this._adjustLayoutStyle){this._adjustLayoutStyle(f)}f.left+="px";f.top+="px";return f},_getRelatedEl:function(){return this.relElement||this.options.relElement
},refreshLayout:function(){this.el.setStyle(this._getLayoutStyle())}}});function d(f){return $extend(f?$el.getOuterDimensions(f):document.viewport.getDimensions(),f?$el.cumulativeOffset(f):document.viewport.getScrollOffsets())}function c(f,g){if(!f){return false}if(Object.isElement(g)){f.update().append(g)}else{f.update(g)}return true}})();(function(){var b={EVENTS:{CONTENT_READY:"contentready"}};var a=Class.create({forceLightboxClose:true,forcePageReload:false,hitboxEvent:null,initialize:function(f,g,d){this.lightbox=f;
this.formController=g;$extend(this,d);var c=this;$H(c).each(function(h){if(Object.isFunction(h.value)){c[h.key]=h.value.bind(c)}}.bind(this))},failureHandler:function(d,c){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}this.lightbox.refreshLayout();if(this.onAjaxFailure){this.onAjaxFailure(c)}},successHandler:function(d,c){try{if(c.success){Dtv.behaviors.ProcessingWatcher.stop();if(this.hitboxEvent){hitboxCustomEvent(this.hitboxEvent)}if(this.forceRedirect){if(c.redirectUrl!=null){window.location.href=c.redirectUrl;
return true}c.errors.push("redirectUrl not specified");return this.failure(formObj,c)}if(!this.forceLightboxClose){this.formController.handleJsonResponse(c)}this.lightbox.refreshLayout();if(this.onAjaxSuccess){this.onAjaxSuccess(c)}if(this.forceLightboxClose){this.lightbox.hide()}if(this.forcePageReload){window.location.reload(true)}}else{this.failureHandler(d,c)}}catch(f){this.lightbox.debug(f,"Failed to process json success handler")}},createHandler:function(){return this.onAjaxCreate?this.onAjaxCreate():true
}});Dtv.behaviors.define({name:"AjaxLightbox",inherits:Dtv.behaviors.Lightbox,selectors:"#ajaxLightboxDiv",consts:b,options:{baseUrl:"/DTVAPP/global/lightbox/",effectQueue:"",defaultConfig:{autoFocusField:true}},statics:{_contentCache:{},show:function(d,c,f){this.instances[0].show(d,c,f)},showZipCodeLightbox:function(g,c,d){var h=this.getDefault();var f=false;if(!c){c=function(j){h.hide();document.location.reload()}}this.show("/DTVAPP/global/lightbox/lightboxZipCode.jsp?pepodMode="+g,{hitboxEvent:"Epg Zip Code Lightbox",forceLightboxClose:false,actions:{hide:function(){h.hide();
if(g&&f){document.location.reload()}}},onAjaxSuccess:function(l){var j=$("zipCode");j.readOnly=false;f=false;if(l.countyCodes!=null){f=true;if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}j.readOnly=true;$("countyDiv").show();var m=$("countySelect");m.options.length=0;m.options[0]=new Option("County","");for(var k=0;k<l.countyCodes.length;k++){m.options[k+1]=new Option(l.countyNames[k],l.countyCodes[k])}}else{if(c){c(l)}}},onAjaxFailure:function(j){$("zipCode").readOnly=false
},onHide:d})},showModifyEmailLightbox:function(){this.show("lightboxModifyEmail.jsp",{hitboxEvent:"Modify Email Lightbox",forcePageReload:true})}},methods:{_initConnectors:function(){this.connector=this.createConnector({onOpen:this._onOpen.bind(this)});var c=this;$$(".js-ajax-opener").each(function(d){if(d.rel){d.href=d.rel}c.connector.addOpener(d)},this)},showWaiting:function(){Dtv.UI.disableScreen();Dtv.UI.showThinking()},hideWaiting:function(){Dtv.UI.hideThinking()},show:function($super,j,d,k){suppressExternalLightboxes();
if(!j){$super();return}var c=this;this.showWaiting();this.config=$extend(this.options.defaultConfig,d||{});if(j.charAt(0)!="/"&&!j.include("://")){j=this.options.baseUrl+j}this.url=j;var g="";if(this.config.enableCaching){g=Dtv.behaviors.AjaxLightbox._contentCache[j]}if(!g){new Ajax.Request(j,{onSuccess:function(l){g=l.responseText;f()},onCancel:function(l){c.debug("ajax request cancelled");h()},onFailure:function(l){c.debug(new Error("Ajax update failed: "+l.responseText));h()}})}else{this.el.update(g);
f()}function h(){c.hideWaiting();if(Dtv.behaviors.Lightbox.modalInstances.length==0){Dtv.UI.enableScreen()}}function f(){if(c.config.enableCaching){Dtv.behaviors.AjaxLightbox._contentCache[j]=g}c.hideWaiting();c.el.update(g);try{c._initContent();c.refreshLayout.bind(c).defer()}catch(l){c.debug(l,"Failed to init ajax lightbox content")}$super();if(k){k()}}},hide:function($super){allowExternalLightboxes();if(Dtv.behaviors.BusinessInfoPop&&Dtv.behaviors.BusinessInfoPop.instances){Dtv.behaviors.BusinessInfoPop.instances.invoke("hide")
}if($super()){if(this.config.onHide){this.config.onHide.call(this)}return true}return false},_afterShow:function($super){$super();if(this.config.autoFocusField){var d=this.el.down(Object.isString(this.config.autoFocusField)?"#"+this.config.autoFocusField:"input[type='text'], input[type='password']");if(d){try{d.focus()}catch(c){}}}if(this.config.onAfterShow){this.config.onAfterShow.call(this)}},_afterHide:function($super){$super();if(this.config.onAfterHide){this.config.onAfterHide.call(this)}},_onOpen:function(c,d){this.show(this.opener.href,this.opener.rel)
},_initContent:function(){this._resetFormControllers();this.contentBehaviors=Dtv.behaviors.applyMappings(this.el);if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors(this.el)}if(Dtv.behaviors.isCompiled("GenericRollover")&&Dtv.behaviors.GenericRollover.addRollovers){Dtv.behaviors.GenericRollover.addRollovers(this.el)}Dtv.tealeaf.invoke("tlProcessNode",this.el);if(this.config.onInit){this.config.onInit.call(this)}this.fireEvent(b.EVENTS.CONTENT_READY,{lightbox:this})
},_resetFormControllers:function(){if(this.formControllers){this.formControllers.each(function(c){Dtv.FormController.instances.erase(c)})}this.formControllers=[];this.el.select("form").each(this._initFormController.bind(this))},_initFormController:function(c){var f=c.getController?c.getController():null;if(!f){f=new Dtv.FormController(c);f.findMessageContainer(this.el);if(f.submitEls){var d=Dtv.behaviors.ProcessingWatcher.instances[0];f.submitEls.each(function(g){if(g.hasClassName("js_processing")||g.hasClassName("js_processing_timeout")){g.observe("click",d.showEvent.bind(d))
}})}f.setWatcherOptions(new a(this,f,this._getWatcherOptions(f)))}this.formControllers.push(f);return f},_getWatcherOptions:function(c){return $clone(this.config.watchersConfig?this.config.watchersConfig[c.el.id]:this.config)},handleAction:function($super,d,c,f){if(this.config.actions&&this.config.actions[d]){f.returnValue=false;return this.config.actions[d].call(this)&&true}switch(d){case"submit":f.element().up("form").getController().submit();return true;default:return $super(d,c,f)}},_getBaseStyle:function($super){var c=this.el.down();
if(!c){return $super()}return{width:c.getStyle("width"),height:c.getStyle("height")}}}})})();