var Prototype={Version:"1.6.0.3",Browser:{IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Opera:navigator.userAgent.indexOf("Opera")>-1,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div")["__proto__"]&&document.createElement("div")["__proto__"]!==document.createElement("form")["__proto__"]},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var e=null,d=$A(arguments);if(Object.isFunction(d[0])){e=d.shift()}function a(){this.initialize.apply(this,arguments)}Object.extend(a,Class.Methods);a.superclass=e;a.subclasses=[];if(e){var b=function(){};b.prototype=e.prototype;a.prototype=new b;e.subclasses.push(a)}for(var c=0;c<d.length;c++){a.addMethods(d[c])}if(!a.prototype.initialize){a.prototype.initialize=Prototype.emptyFunction}a.prototype.constructor=a;return a}};Class.Methods={addMethods:function(g){var c=this.superclass&&this.superclass.prototype;var b=Object.keys(g);if(!Object.keys({toString:true}).length){b.push("toString","valueOf")}for(var a=0,d=b.length;a<d;a++){var f=b[a],e=g[f];if(c&&Object.isFunction(e)&&e.argumentNames().first()=="$super"){var h=e;e=(function(i){return function(){return c[i].apply(this,arguments)}})(f).wrap(h);e.valueOf=h.valueOf.bind(h);e.toString=h.toString.bind(h)}this.prototype[f]=e}return this}};var Abstract={};Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a)){return"undefined"}if(a===null){return"null"}return a.inspect?a.inspect():String(a)}catch(b){if(b instanceof RangeError){return"..."}throw b}},toJSON:function(a){var c=typeof a;switch(c){case"undefined":case"function":case"unknown":return;case"boolean":return a.toString()}if(a===null){return"null"}if(a.toJSON){return a.toJSON()}if(Object.isElement(a)){return}var b=[];for(var e in a){var d=Object.toJSON(a[e]);if(!Object.isUndefined(d)){b.push(e.toJSON()+": "+d)}}return"{"+b.join(", ")+"}"},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&&a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var b=[];for(var c in a){b.push(c)}return b},values:function(b){var a=[];for(var c in b){a.push(b[c])}return a},clone:function(a){return Object.extend({},a)},isElement:function(a){return !!(a&&a.nodeType==1)},isArray:function(a){return a!=null&&typeof a=="object"&&"splice" in a&&"join" in a},isHash:function(a){return a instanceof Hash},isFunction:function(a){return typeof a=="function"},isString:function(a){return typeof a=="string"},isNumber:function(a){return typeof a=="number"},isUndefined:function(a){return typeof a=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var a=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,"").split(",");return a.length==1&&!a[0]?[]:a},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}},bindAsEventListener:function(){var a=this,c=$A(arguments),b=c.shift();return function(d){return a.apply(b,[d||window.event].concat(c))}},curry:function(){if(!arguments.length){return this}var a=this,b=$A(arguments);return function(){return a.apply(this,b.concat($A(arguments)))}},delay:function(){var a=this,b=$A(arguments),c=b.shift()*1000;return window.setTimeout(function(){return a.apply(a,b)},c)},defer:function(){var a=[0.01].concat($A(arguments));return this.delay.apply(this,a)},wrap:function(b){var a=this;return function(){return b.apply(this,[a.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var a=this;return this._methodized=function(){return a.apply(null,[this].concat($A(arguments)))}}});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"'};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}};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()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(e,c){var a="",d=this,b;c=arguments.callee.prepareReplacement(c);while(d.length>0){if(b=d.match(e)){a+=d.slice(0,b.index);a+=String.interpret(c(b));d=d.slice(b.index+b[0].length)}else{a+=d,d=""}}return a},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);b=Object.isUndefined(b)?1:b;return this.gsub(c,function(d){if(--b<0){return d[0]}return a(d)})},scan:function(b,a){this.gsub(b,a);return String(this)},truncate:function(b,a){b=b||30;a=Object.isUndefined(a)?"...":a;return this.length>b?this.slice(0,b-a.length)+a:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,"img");var a=new RegExp(Prototype.ScriptFragment,"im");return(this.match(b)||[]).map(function(c){return(c.match(a)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var a=new Element("div");a.innerHTML=this.stripTags();return a.childNodes[0]?(a.childNodes.length>1?$A(a.childNodes).inject("",function(b,c){return b+c.nodeValue}):a.childNodes[0].nodeValue):""},toQueryParams:function(b){var a=this.strip().match(/([^?#]*)(#.*)?$/);if(!a){return{}}return a[1].split(b||"&").inject({},function(e,f){if((f=f.split("="))[0]){var c=decodeURIComponent(f.shift());var d=f.length>1?f.join("="):f[0];if(d!=undefined){d=decodeURIComponent(d)}if(c in e){if(!Object.isArray(e[c])){e[c]=[e[c]]}e[c].push(d)}else{e[c]=d}}return e})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(a){return a<1?"":new Array(a+1).join(this)},camelize:function(){var d=this.split("-"),a=d.length;if(a==1){return d[0]}var c=this.charAt(0)=="-"?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var b=1;b<a;b++){c+=d[b].charAt(0).toUpperCase()+d[b].substring(1)}return c},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(b){var a=this.gsub(/[\x00-\x1f\\]/,function(c){var d=String.specialChar[c[0]];return d?d:"\\u00"+c[0].charCodeAt().toPaddedString(2,16)});if(b){return'"'+a.replace(/"/g,'\\"')+'"'}return"'"+a.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,"#{1}")},isJSON:function(){var a=this;if(a.blank()){return false}a=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(a){return this.indexOf(a)>-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var b=this.length-a.length;return b>=0&&this.lastIndexOf(a)===b},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(a,b){return new Template(this,b).evaluate(a)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.stripTags().replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b)){return b}var a=new Template(b);return function(c){return a.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return""}var f=d[1]||"";if(f=="\\"){return d[2]}var b=a,g=d[3];var e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(g);if(d==null){return f}while(d!=null){var c=d[1].startsWith("[")?d[2].gsub("\\\\]","]"):d[1];b=b[c];if(null==b||""==d[3]){break}g=g.substring("["==d[3]?d[1].length:d[0].length);d=e.exec(g)}return f+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(c,b){var a=0;try{this._each(function(e){c.call(b,e,a++)})}catch(d){if(d!=$break){throw d}}return this},eachSlice:function(d,c,b){var a=-d,e=[],f=this.toArray();if(d<1){return f}while((a+=d)<f.length){e.push(f.slice(a,a+d))}return e.collect(c,b)},all:function(c,b){c=c||Prototype.K;var a=true;this.each(function(e,d){a=a&&!!c.call(b,e,d);if(!a){throw $break}});return a},any:function(c,b){c=c||Prototype.K;var a=false;this.each(function(e,d){if(a=!!c.call(b,e,d)){throw $break}});return a},collect:function(c,b){c=c||Prototype.K;var a=[];this.each(function(e,d){a.push(c.call(b,e,d))});return a},detect:function(c,b){var a;this.each(function(e,d){if(c.call(b,e,d)){a=e;throw $break}});return a},findAll:function(c,b){var a=[];this.each(function(e,d){if(c.call(b,e,d)){a.push(e)}});return a},grep:function(d,c,b){c=c||Prototype.K;var a=[];if(Object.isString(d)){d=new RegExp(d)}this.each(function(f,e){if(d.match(f)){a.push(c.call(b,f,e))}});return a},include:function(a){if(Object.isFunction(this.indexOf)){if(this.indexOf(a)!=-1){return true}}var b=false;this.each(function(c){if(c==a){b=true;throw $break}});return b},inGroupsOf:function(b,a){a=Object.isUndefined(a)?null:a;return this.eachSlice(b,function(c){while(c.length<b){c.push(a)}return c})},inject:function(a,c,b){this.each(function(e,d){a=c.call(b,a,e,d)});return a},invoke:function(b){var a=$A(arguments).slice(1);return this.map(function(c){return c[b].apply(c,a)})},max:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e>=a){a=e}});return a},min:function(c,b){c=c||Prototype.K;var a;this.each(function(e,d){e=c.call(b,e,d);if(a==null||e<a){a=e}});return a},partition:function(d,b){d=d||Prototype.K;var c=[],a=[];this.each(function(f,e){(d.call(b,f,e)?c:a).push(f)});return[c,a]},pluck:function(b){var a=[];this.each(function(c){a.push(c[b])});return a},reject:function(c,b){var a=[];this.each(function(e,d){if(!c.call(b,e,d)){a.push(e)}});return a},sortBy:function(b,a){return this.map(function(d,c){return{value:d,criteria:b.call(a,d,c)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d<c?-1:d>c?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var b=Prototype.K,a=$A(arguments);if(Object.isFunction(a.last())){b=a.pop()}var c=[this].concat(a).map($A);return this.map(function(e,d){return b(c.pluck(d))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}if(Prototype.Browser.WebKit){$A=function(c){if(!c){return[]}if(!(typeof c==="function"&&typeof c.length==="number"&&typeof c.item==="function")&&c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var a=0,c=this.length;a<c;a++){b(this[a])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(b,a){return b.concat(Object.isArray(a)?a.flatten():[a])})},without:function(){var a=$A(arguments);return this.select(function(b){return !a.include(b)})},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(a){return this.inject([],function(d,c,b){if(0==b||(a?d.last()!=c:!d.include(c))){d.push(c)}return d})},intersect:function(a){return this.uniq().findAll(function(b){return a.detect(function(c){return b===c})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var a=[];this.each(function(b){var c=Object.toJSON(b);if(!Object.isUndefined(c)){a.push(c)}});return"["+a.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,a){a||(a=0);var b=this.length;if(a<0){a=b+a}for(;a<b;a++){if(this[a]===c){return a}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(b,a){a=isNaN(a)?this.length:(a<0?this.length+a:a)+1;var c=this.slice(0,a).reverse().indexOf(b);return(c<0)?c:a-c-1}}Array.prototype.toArray=Array.prototype.clone;function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var e=[];for(var b=0,c=this.length;b<c;b++){e.push(this[b])}for(var b=0,c=arguments.length;b<c;b++){if(Object.isArray(arguments[b])){for(var a=0,d=arguments[b].length;a<d;a++){e.push(arguments[b][a])}}else{e.push(arguments[b])}}return e}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(b,a){$R(0,this,true).each(b,a);return this},toPaddedString:function(c,b){var a=this.toString(b||10);return"0".times(c-a.length)+a},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(a){Number.prototype[a]=Math[a].methodize()});function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function a(b,c){if(Object.isUndefined(c)){return b}return b+"="+encodeURIComponent(String.interpret(c))}return{initialize:function(b){this._object=Object.isHash(b)?b.toObject():Object.clone(b)},_each:function(c){for(var b in this._object){var d=this._object[b],e=[b,d];e.key=b;e.value=d;c(e)}},set:function(b,c){return this._object[b]=c},get:function(b){if(this._object[b]!==Object.prototype[b]){return this._object[b]}},unset:function(b){var c=this._object[b];delete this._object[b];return c},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(c){var b=this.detect(function(d){return d.value===c});return b&&b.key},merge:function(b){return this.clone().update(b)},update:function(b){return new Hash(b).inject(this,function(c,d){c.set(d.key,d.value);return c})},toQueryString:function(){return this.inject([],function(d,e){var c=encodeURIComponent(e.key),b=e.value;if(b&&typeof b=="object"){if(Object.isArray(b)){return d.concat(b.map(a.curry(c)))}}else{d.push(a(c,b))}return d}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(b){return b.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(c,a,b){this.start=c;this.end=a;this.exclusive=b},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start){return false}if(this.exclusive){return a<this.end}return a<=this.end}});var $R=function(c,a,b){return new ObjectRange(c,a,b)};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 e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){e["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){e.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){e[c[b]]=c[b+1]}}else{$H(c).each(function(f){e[f.key]=f.value})}}for(var a in e){this.transport.setRequestHeader(a,e[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(e,f){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,f)}}).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(f,a){var c=[];var e=document.evaluate(f,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=e.snapshotLength;b<d;b++){c.push(Element.extend(e.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(){var a=this.Element;this.Element=function(d,c){c=c||{};d=d.toLowerCase();var b=Element.cache;if(Prototype.Browser.IE&&c.name){d="<"+d+' name="'+c.name+'">';delete c.name;return Element.writeAttribute(document.createElement(d),c)}if(!b[d]){b[d]=Element.extend(document.createElement(d))}return Element.writeAttribute(b[d].cloneNode(false),c)};Object.extend(this.Element,a||{});if(a){this.Element.prototype=a.prototype}}).call(window);Element.cache={};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(a,b){a=$(a);if(b&&b.toElement){b=b.toElement()}if(Object.isElement(b)){return a.update().insert(b)}b=Object.toHTML(b);a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer();return a},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,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&&(e.toElement||e.toHTML))){e={bottom:e}}var d,f,b,g;for(var a in e){d=e[a];a=a.toLowerCase();f=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){f(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){g.reverse()}g.each(f.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(f){var e=f.first(),c=f.last();var d=(b[e]||"").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 $(a).recursivelyCollect("parentNode")},descendants:function(a){return $(a).select("*")},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 $(a).recursivelyCollect("previousSibling")},nextSiblings:function(a){return $(a).recursivelyCollect("nextSibling")},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},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=b.ancestors();return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return b.firstDescendant()}return Object.isNumber(c)?b.descendants()[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=b.previousSiblings();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=c.nextSiblings();return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)},select:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},adjacent:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(b){b=$(b);var c=b.readAttribute("id"),a=arguments.callee;if(c){return c}do{c="anonymous_element_"+a.counter++}while($(c));b.writeAttribute("id",c);return c},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(e,c,f){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(f)?true:f}for(var a in b){c=d.names[a]||a;f=b[a];if(d.values[a]){c=d.values[a](e,f)}if(f===false||f===null){e.removeAttribute(c)}else{if(f===true){e.setAttribute(c,c)}else{e.setAttribute(c,f)}}}return e},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().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(!a.hasClassName(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 a[a.hasClassName(b)?"removeClassName":"addClassName"](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=a.cumulativeOffset();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 e=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{e[(d=="float"||d=="cssFloat")?(Object.isUndefined(e.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 g=c.getStyle("display");if(g!="none"&&g!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var f=b.visibility;var d=b.position;var a=b.display;b.visibility="hidden";b.position="absolute";b.display="block";var h=c.clientWidth;var e=c.clientHeight;b.display=a;b.position=d;b.visibility=f;return{width:h,height:e}},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(b.getStyle("position")=="absolute"){return b}var d=b.positionedOffset();var f=d[1];var e=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=e-parseFloat(b.style.left||0);b._originalTop=f-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=f+"px";b.style.left=e+"px";b.style.width=c+"px";b.style.height=a+"px";return b},relativize:function(a){a=$(a);if(a.getStyle("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)}if(a.tagName.toUpperCase()=="HTML"){return $(document.body)}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 e=d.viewportOffset();b=$(b);var f=[0,0];var c=null;if(Element.getStyle(b,"position")=="absolute"){c=b.getOffsetParent();f=c.viewportOffset()}if(c==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-f[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(e[1]-f[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};Element.Methods.identify.counter=1;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 e=parseInt(d(b,c),10);if(e!==b["offset"+c.capitalize()]){return e+"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(e,function(f,g){var h=d(b,g);return h===null?f:f-parseInt(h,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,e){function f(g){return g.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(e==1||e===""){(d=f(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(e<0.00001){e=0}}c.filter=f(d)+"alpha(opacity="+(e*100)+")";return b};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,c){var b=a.getAttributeNode(c);return b?b.value:""},_getEv:function(a,b){b=a.getAttribute(b);return b?b.toString().slice(23,-2):null},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){return a.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr,src:a._getAttr,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values)}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(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}if(Object.isElement(c)){return b.update().insert(c)}c=Object.toHTML(c);var a=b.tagName.toUpperCase();if(a in Element._insertionTranslations.tags){$A(b.childNodes).each(function(d){b.removeChild(d)});Element._getContentFromAnonymousElement(a,c.stripScripts()).each(function(d){b.appendChild(d)})}else{b.innerHTML=c.stripScripts()}c.evalScripts.bind(c).defer();return b}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(c,e){c=$(c);if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);return c}e=Object.toHTML(e);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var f=c.next();var a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(f){a.each(function(g){d.insertBefore(g,f)})}else{a.each(function(g){d.appendChild(g)})}}else{c.outerHTML=e.stripScripts()}e.evalScripts.bind(e).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(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);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);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div")["__proto__"]){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div")["__proto__"];Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var a={},b=Element.Methods.ByTag;var c=Object.extend(function(f){if(!f||f._extendedByPrototype||f.nodeType!=1||f==window){return f}var d=Object.clone(a),e=f.tagName.toUpperCase(),h,g;if(b[e]){Object.extend(d,b[e])}for(h in d){g=d[h];if(Object.isFunction(g)&&!(h in f)){f[h]=g.methodize()}}f._extendedByPrototype=Prototype.emptyFunction;return f},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});c.refresh();return c})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(c){var h=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(g)}else{g(b)}}function g(j){j=j.toUpperCase();if(!Element.Methods.ByTag[j]){Element.Methods.ByTag[j]={}}Object.extend(Element.Methods.ByTag[j],c)}function a(l,k,j){j=j||false;for(var n in l){var m=l[n];if(!Object.isFunction(m)){continue}if(!j||!(n in k)){k[n]=m.methodize()}}}function e(l){var j;var k={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(k[l]){j="HTML"+k[l]+"Element"}if(window[j]){return window[j]}j="HTML"+l+"Element";if(window[j]){return window[j]}j="HTML"+l.capitalize()+"Element";if(window[j]){return window[j]}window[j]={};window[j].prototype=document.createElement(l)["__proto__"];return window[j]}if(h.ElementExtensions){a(Element.Methods,HTMLElement.prototype);a(Element.Methods.Simulated,HTMLElement.prototype,true)}if(h.SpecificElementExtensions){for(var i in Element.Methods.ByTag){var f=e(i);if(Object.isUndefined(f)){continue}a(d[i],f.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var a={},b=Prototype.Browser;$w("width height").each(function(e){var c=e.capitalize();if(b.WebKit&&!document.evaluate){a[e]=self["inner"+c]}else{if(b.Opera&&parseFloat(window.opera.version())<9.5){a[e]=document.body["client"+c]}else{a[e]=document.documentElement["client"+c]}}});return a},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};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 e=Element.getStorage(c),d=e.get(b);if(Object.isUndefined(d)){e.set(b,a);d=a}return d},clone:function(c,a){if(!(c=$(c))){return}var e=c.cloneNode(a);e._prototypeUID=void 0;if(a){var d=Element.select(e,"*"),b=d.length;while(b--){d[b]._prototypeUID=void 0}}return Element.extend(e)}});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(){if(!Prototype.BrowserFeatures.XPath){return false}var a=this.expression;if(Prototype.Browser.WebKit&&(a.include("-of-type")||a.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(a)){return false}return true},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){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;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 in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).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 f=this.expression,g=Selector.patterns,b=Selector.xpath,d,a;if(Selector._cache[f]){this.xpath=Selector._cache[f];return}this.matcher=[".//*"];while(f&&d!=f&&(/\S/).test(f)){d=f;for(var c in g){if(a=f.match(g[c])){this.matcher.push(Object.isFunction(b[c])?b[c](a):new Template(b[c]).evaluate(a));f=f.replace(a[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();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(j){this.tokens=[];var o=this.expression,a=Selector.patterns,f=Selector.assertions;var b,d,g;while(o&&b!==o&&(/\S/).test(o)){b=o;for(var k in a){d=a[k];if(g=o.match(d)){if(f[k]){this.tokens.push([k,Object.clone(g)]);o=o.replace(g[0],"")}else{return this.findElements(document).include(j)}}}}var n=true,c,l;for(var k=0,h;h=this.tokens[k];k++){c=h[0],l=h[1];if(!Selector.assertions[c](j,l)){n=false;break}}return n},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});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(b){var j=b[6],h=Selector.patterns,a=Selector.xpath,f,c;var g=[];while(j&&f!=j&&(/\S/).test(j)){f=j;for(var d in h){if(b=j.match(h[d])){c=Object.isFunction(a[d])?a[d](b):new Template(a[d]).evaluate(b);g.push("("+c.substring(1,c.length-1)+")");j=j.replace(b[0],"");break}}}return"[not("+g.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(g,e){var h,i=e[6],d;if(i=="even"){i="2n+0"}if(i=="odd"){i="2n+1"}if(h=i.match(/^(\d+)$/)){return"["+g+"= "+h[1]+"]"}if(h=i.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(h[1]=="-"){h[1]=-1}var f=h[1]?Number(h[1]):1;var c=h[2]?Number(h[2]):0;d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(d).evaluate({fragment:g,a:f,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:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\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 e=0,f;f=c[e];e++){d.push(f)}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(a){for(var b=0,c;c=a[b];b++){c._countedByPrototype=undefined}return a},index:function(a,d,g){a._countedByPrototype=Prototype.emptyFunction;if(d){for(var b=a.childNodes,e=b.length-1,c=1;e>=0;e--){var f=b[e];if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++}}}else{for(var e=0,c=1,b=a.childNodes;f=b[e];e++){if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++}}}},unique:function(b){if(b.length==0){return b}var d=[],e;for(var c=0,a=b.length;c<a;c++){if(!(e=b[c])._countedByPrototype){e._countedByPrototype=Prototype.emptyFunction;d.push(Element.extend(e))}}return Selector.handlers.unmark(d)},descendant:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,e.getElementsByTagName("*"))}return b},child:function(a){var e=Selector.handlers;for(var d=0,c=[],f;f=a[d];d++){for(var b=0,g;g=f.childNodes[b];b++){if(g.nodeType==1&&g.tagName!="!"){c.push(g)}}}return c},adjacent:function(a){for(var c=0,b=[],e;e=a[c];c++){var d=this.nextElementSibling(e);if(d){b.push(d)}}return b},laterSibling:function(a){var d=Selector.handlers;for(var c=0,b=[],e;e=a[c];c++){d.concat(b,Element.nextSiblings(e))}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,j,c,b){var k=c.toUpperCase();var e=[],g=Selector.handlers;if(a){if(b){if(b=="descendant"){for(var f=0,d;d=a[f];f++){g.concat(e,d.getElementsByTagName(c))}return e}else{a=this[b](a)}if(c=="*"){return a}}for(var f=0,d;d=a[f];f++){if(d.tagName.toUpperCase()===k){e.push(d)}}return e}else{return j.getElementsByTagName(c)}},id:function(b,a,j,f){var g=$(j),d=Selector.handlers;if(!g){return[]}if(!b&&a==document){return[g]}if(b){if(f){if(f=="child"){for(var c=0,e;e=b[c];c++){if(g.parentNode==e){return[g]}}}else{if(f=="descendant"){for(var c=0,e;e=b[c];c++){if(Element.descendantOf(g,e)){return[g]}}}else{if(f=="adjacent"){for(var c=0,e;e=b[c];c++){if(Selector.handlers.previousElementSibling(g)==e){return[g]}}}else{b=d[f](b)}}}}for(var c=0,e;e=b[c];c++){if(e==g){return[g]}}return[]}return(g&&Element.descendantOf(g,a))?[g]:[]},className:function(b,a,c,d){if(b&&d){b=this[d](b)}return Selector.handlers.byClassName(b,a,c)},byClassName:function(c,b,f){if(!c){c=Selector.handlers.descendant([b])}var h=" "+f+" ";for(var e=0,d=[],g,a;g=c[e];e++){a=g.className;if(a.length==0){continue}if(a==f||(" "+a+" ").include(h)){d.push(g)}}return d},attrPresence:function(c,b,a,g){if(!c){c=b.getElementsByTagName("*")}if(c&&g){c=this[g](c)}var e=[];for(var d=0,f;f=c[d];d++){if(Element.hasAttribute(f,a)){e.push(f)}}return e},attr:function(a,j,h,k,c,b){if(!a){a=j.getElementsByTagName("*")}if(a&&b){a=this[b](a)}var l=Selector.operators[c],f=[];for(var e=0,d;d=a[e];e++){var g=Element.readAttribute(d,h);if(g===null){continue}if(l(g,k)){f.push(d)}}return f},pseudo:function(b,c,e,a,d){if(b&&d){b=this[d](b)}if(!b){b=a.getElementsByTagName("*")}return Selector.pseudos[c](b,e,a)}},pseudos:{"first-child":function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.previousElementSibling(e)){continue}c.push(e)}return c},"last-child":function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(Selector.handlers.nextElementSibling(e)){continue}c.push(e)}return c},"only-child":function(b,g,a){var e=Selector.handlers;for(var d=0,c=[],f;f=b[d];d++){if(!e.previousElementSibling(f)&&!e.nextElementSibling(f)){c.push(f)}}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,e){if(d==0){return c>0?[c]:[]}return $R(1,e).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b)}return a})},nth:function(c,s,u,r,e){if(c.length==0){return[]}if(s=="even"){s="2n+0"}if(s=="odd"){s="2n+1"}var q=Selector.handlers,p=[],d=[],g;q.mark(c);for(var o=0,f;f=c[o];o++){if(!f.parentNode._countedByPrototype){q.index(f.parentNode,r,e);d.push(f.parentNode)}}if(s.match(/^\d+$/)){s=Number(s);for(var o=0,f;f=c[o];o++){if(f.nodeIndex==s){p.push(f)}}}else{if(g=s.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]=="-"){g[1]=-1}var v=g[1]?Number(g[1]):1;var t=g[2]?Number(g[2]):0;var w=Selector.pseudos.getIndices(v,t,c.length);for(var o=0,f,k=w.length;f=c[o];o++){for(var n=0;n<k;n++){if(f.nodeIndex==w[n]){p.push(f)}}}}}q.unmark(c);q.unmark(d);return p},empty:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.tagName=="!"||e.firstChild){continue}c.push(e)}return c},not:function(a,d,k){var g=Selector.handlers,l,c;var j=new Selector(d).findElements(k);g.mark(j);for(var f=0,e=[],b;b=a[f];f++){if(!b._countedByPrototype){e.push(b)}}g.unmark(j);return e},enabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(!e.disabled&&(!e.type||e.type!=="hidden")){c.push(e)}}return c},disabled:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.disabled){c.push(e)}}return c},checked:function(b,f,a){for(var d=0,c=[],e;e=b[d];d++){if(e.checked){c.push(e)}}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.endsWith(a)},"*=":function(b,a){return 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(f,g){var e=$$(g),d=Selector.handlers;d.mark(e);for(var c=0,b=[],a;a=f[c];c++){if(a._countedByPrototype){b.push(a)}}d.unmark(e);return b},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;c=false}return Selector.matchElements(b,c||"*")[a||0]},findChildElements:function(e,g){g=Selector.split(g.join(","));var d=[],f=Selector.handlers;for(var c=0,b=g.length,a;c<b;c++){a=new Selector(g[c].strip());f.concat(d,a.findElements(e))}return(b>1)?f.unique(d):d}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var e=0,f;f=c[e];e++){if(f.tagName!=="!"){d.push(f)}}return d},unmark:function(a){for(var b=0,c;c=a[b];b++){c.removeAttribute("_countedByPrototype")}return a}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(g,b){if(typeof b!="object"){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var c,f,a=false,e=b.submit;var d=g.inject({},function(h,i){if(!i.disabled&&i.name){c=i.name;f=$(i).getValue();if(f!=null&&i.type!="file"&&(i.type!="submit"||(!a&&e!==false&&(!e||c==e)&&(a=true)))){if(c in h){if(!Object.isArray(h[c])){h[c]=[h[c]]}h[c].push(f)}else{h[c]=f}}}return h});return b.hash?d:Object.toQueryString(d)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(a){return $A($(a).getElementsByTagName("*")).inject([],function(b,c){if(Form.Element.Serializers[c.tagName.toLowerCase()]){b.push(Element.extend(c))}return b})},getInputs:function(g,c,d){g=$(g);var a=g.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var e=0,h=[],f=a.length;e<f;e++){var b=a[e];if((c&&b.type!=c)||(d&&b.name!=d)){continue}h.push(Element.extend(b))}return h},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"].include(d.tagName.toLowerCase())})},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"].include(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,f){if(Object.isUndefined(f)){return this[c.type=="select-one"?"selectOne":"selectMany"](c)}else{var b,d,g=!Object.isArray(f);for(var a=0,e=c.length;a<e;a++){b=c.options[a];d=this.optionValue(b);if(g){if(d==f){b.selected=true;return}}else{b.selected=f.include(d)}}}},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(d){var a,e=d.length;if(!e){return null}for(var c=0,a=[];c<e;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)}});if(!window.Event){var Event={}}Object.extend(Event,{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:{},relatedTarget:function(b){var a;switch(b.type){case"mouseover":a=b.fromElement;break;case"mouseout":a=b.toElement;break;default:return null}return Element.extend(a)}});Event.Methods=(function(){var a;if(Prototype.Browser.IE){var b={0:1,1:4,2:2};a=function(d,c){return d.button==b[c]}}else{if(Prototype.Browser.WebKit){a=function(d,c){switch(c){case 0:return d.which==1&&!d.metaKey;case 1:return d.which==1&&d.metaKey;default:return false}}}else{a=function(d,c){return d.which?(d.which===c+1):(d.button===c)}}}return{isLeftClick:function(c){return a(c,0)},isMiddleClick:function(c){return a(c,1)},isRightClick:function(c){return a(c,2)},element:function(e){e=Event.extend(e);var d=e.target,c=e.type,f=e.currentTarget;if(f&&f.tagName){if(c==="load"||c==="error"||(c==="click"&&f.tagName.toLowerCase()==="input"&&f.type==="radio")){d=f}}if(d){if(d.nodeType==Node.TEXT_NODE){d=d.parentNode}return Element.extend(d)}else{return false}},findElement:function(d,f){var c=Event.element(d);if(!f){return c}var e=[c].concat(c.ancestors());return Selector.findElement(e,f,0)},pointer:function(e){var d=document.documentElement,c=document.body||{scrollLeft:0,scrollTop:0};return{x:e.pageX||(e.clientX+(d.scrollLeft||c.scrollLeft)-(d.clientLeft||0)),y:e.pageY||(e.clientY+(d.scrollTop||c.scrollTop)-(d.clientTop||0))}},pointerX:function(c){return Event.pointer(c).x},pointerY:function(c){return Event.pointer(c).y},stop:function(c){Event.extend(c);c.preventDefault();c.stopPropagation();c.stopped=true}}})();Event.extend=(function(){var a=Object.keys(Event.Methods).inject({},function(b,c){b[c]=Event.Methods[c].methodize();return b});if(Prototype.Browser.IE){Object.extend(a,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(b){if(!b){return false}if(b._extendedByPrototype){return b}b._extendedByPrototype=Prototype.emptyFunction;var c=Event.pointer(b);Object.extend(b,{target:b.srcElement,relatedTarget:Event.relatedTarget(b),pageX:c.x,pageY:c.y});return Object.extend(b,a)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents")["__proto__"];Object.extend(Event.prototype,a);return Prototype.K}})();Object.extend(Event,(function(){var b=Event.cache;function c(k){try{if(k._prototypeEventID){return k._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return k._prototypeEventID=[++arguments.callee.id]}catch(j){return false}}function g(j){if(j&&j.include(":")){return"dataavailable"}return j}function a(j){return b[j]=b[j]||{}}function f(l,j){var k=a(l);return k[j]=k[j]||[]}function h(k,j,l){var o=c(k);var n=f(o,j);if(n.pluck("handler").include(l)){return false}var m=function(p){if(!Event||!Event.extend||(p.eventName&&p.eventName!=j)){return false}Event.extend(p);l.call(k,p)};m.handler=l;n.push(m);return m}function i(m,j,k){var l=f(m,j);return l.find(function(n){return n.handler==k})}function d(m,j,k){var l=a(m);if(!l[j]){return false}l[j]=l[j].without(i(m,j,k))}function e(){for(var k in b){for(var j in b[k]){b[k][j]=null}}}if(window.attachEvent){window.attachEvent("onunload",e)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}return{observe:function(l,j,m){l=$(l);var k=g(j);var n=h(l,j,m);if(!n){return l}if(l.addEventListener){l.addEventListener(k,n,false)}else{l.attachEvent("on"+k,n)}return l},stopObserving:function(l,j,m){l=$(l);var o=c(l),k=g(j);if(!m&&j){f(o,j).each(function(p){l.stopObserving(j,p.handler)});return l}else{if(!j){Object.keys(a(o)).each(function(p){l.stopObserving(p)});return l}}var n=i(o,j,m);if(!n){return l}if(l.removeEventListener){l.removeEventListener(k,n,false)}else{l.detachEvent("on"+k,n)}d(o,j,m);return l},fire:function(l,k,j){l=$(l);if(l==document&&document.createEvent&&!l.dispatchEvent){l=document.documentElement}var m;if(document.createEvent){m=document.createEvent("HTMLEvents");m.initEvent("dataavailable",true,true)}else{m=document.createEventObject();m.eventType="ondataavailable"}m.eventName=k;m.memo=j||{};if(document.createEvent){l.dispatchEvent(m)}else{l.fireEvent(m.eventType,m)}return Event.extend(m)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var b;function a(){if(document.loaded){return}if(b){window.clearInterval(b)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){b=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){a()}},0);Event.observe(window,"load",a)}else{document.addEventListener("DOMContentLoaded",a,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;a()}}}})();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,e){e=e.toString().strip();var d=/\s/.test(e)?$w(e).map(a).join(""):a(e);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(e,f){f=f.toString().strip();var g=[],h=(/\s/.test(f)?$w(f):null);if(!h&&!f){return g}var c=$(e).getElementsByTagName("*");f=" "+f+" ";for(var d=0,k,j;k=c[d];d++){if(k.className&&(j=" "+k.className+" ")&&(j.include(f)||(h&&h.all(function(i){return !i.toString().blank()&&j.include(" "+i+" ")})))){g.push(Element.extend(k))}}return g};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);Element.addMethods();
// Credit Card Validation Javascript
// copyright 12th May 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

function validateCreditCard(s) {
    // remove non-numerics
    var v = "0123456789";
    var w = "";
    for (i=0; i < s.length; i++) {
        x = s.charAt(i);
        if (v.indexOf(x,0) != -1)
        w += x;
    }
    // validate number
    j = w.length / 2;
    k = Math.floor(j);
    m = Math.ceil(j) - k;
    c = 0;
    for (i=0; i<k; i++) {
        a = w.charAt(i*2+m) * 2;
        c += a > 9 ? Math.floor(a/10 + a%10) : a;
    }
    for (i=0; i<k+m; i++) c += w.charAt(i*2+1-m) * 1;
    return (c%10 == 0);
}


var Validator=Class.create();Validator.prototype={initialize:function(c,b,d,a){if(typeof d=="function"){this.options=$H(a);this._test=d}else{this.options=$H(d);this._test=function(){return true}}this.error=b||"Validation failed.";this.className=c},test:function(a,b){return(this._test(a,b)&&this.options.all(function(c){return Validator.methods[c.key]?Validator.methods[c.key](a,b,c.value):true}))}};Validator.methods={pattern:function(a,c,b){return Validation.get("IsEmpty").test(a)||b.test(a)},minLength:function(a,c,b){return a.length>=b},maxLength:function(a,c,b){return a.length<=b},min:function(a,c,b){return a>=parseFloat(b)},max:function(a,c,b){return a<=parseFloat(b)},notOneOf:function(a,c,b){return $A(b).all(function(d){return a!=d})},oneOf:function(a,c,b){return $A(b).any(function(d){return a==d})},is:function(a,c,b){return a==b},isNot:function(a,c,b){return a!=b},equalToField:function(a,c,b){return a==$F(b)},notEqualToField:function(a,c,b){return a!=$F(b)},include:function(a,c,b){return $A(b).all(function(d){return Validation.get(d).test(a,c)})}};var Validation=Class.create();Validation.defaultOptions={onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,addClassNameToContainer:false,containerClassName:".input-box",onFormValidate:function(a,b){},onElementValidate:function(a,b){}};Validation.prototype={initialize:function(b,a){this.form=$(b);if(!this.form){return}this.options=Object.extend({onSubmit:Validation.defaultOptions.onSubmit,stopOnFirst:Validation.defaultOptions.stopOnFirst,immediate:Validation.defaultOptions.immediate,focusOnError:Validation.defaultOptions.focusOnError,useTitles:Validation.defaultOptions.useTitles,onFormValidate:Validation.defaultOptions.onFormValidate,onElementValidate:Validation.defaultOptions.onElementValidate},a||{});if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false)}if(this.options.immediate){Form.getElements(this.form).each(function(c){if(c.tagName.toLowerCase()=="select"){Event.observe(c,"blur",this.onChange.bindAsEventListener(this))}if(c.type.toLowerCase()=="radio"||c.type.toLowerCase()=="checkbox"){Event.observe(c,"click",this.onChange.bindAsEventListener(this))}else{Event.observe(c,"change",this.onChange.bindAsEventListener(this))}},this)}},onChange:function(a){Validation.isOnChange=true;Validation.validate(Event.element(a),{useTitle:this.options.useTitles,onElementValidate:this.options.onElementValidate});Validation.isOnChange=false},onSubmit:function(a){if(!this.validate()){Event.stop(a)}},validate:function(){var a=false;var b=this.options.useTitles;var d=this.options.onElementValidate;try{if(this.options.stopOnFirst){a=Form.getElements(this.form).all(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:b,onElementValidate:d})},this)}else{a=Form.getElements(this.form).collect(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:b,onElementValidate:d})},this).all()}}catch(c){}if(!a&&this.options.focusOnError){try{Form.getElements(this.form).findAll(function(e){return $(e).hasClassName("validation-failed")}).first().focus()}catch(c){}}this.options.onFormValidate(a,this.form);return a},reset:function(){Form.getElements(this.form).each(Validation.reset)},isElementInForm:function(c,b){var a=c.up("form");if(a==b){return true}return false}};Object.extend(Validation,{validate:function(c,a){a=Object.extend({useTitle:false,onElementValidate:function(d,e){}},a||{});c=$(c);var b=$w(c.className);return result=b.all(function(d){var e=Validation.test(d,c,a.useTitle);a.onElementValidate(e,c);return e})},insertAdvice:function(d,b){var a=$(d).up(".field-row");if(a){Element.insert(a,{after:b})}else{if(d.up("td.value")){d.up("td.value").insert({bottom:b})}else{if(d.advaiceContainer&&$(d.advaiceContainer)){$(d.advaiceContainer).update(b)}else{switch(d.type.toLowerCase()){case"checkbox":case"radio":var c=d.parentNode;if(c){Element.insert(c,{bottom:b})}else{Element.insert(d,{after:b})}break;default:Element.insert(d,{after:b})}}}}},showAdvice:function(c,b,a){if(!c.advices){c.advices=new Hash()}else{c.advices.each(function(d){this.hideAdvice(c,d.value)}.bind(this))}c.advices.set(a,b);if(typeof Effect=="undefined"){b.style.display="block"}else{if(!b._adviceAbsolutize){new Effect.Appear(b,{duration:1})}else{Position.absolutize(b);b.show();b.setStyle({top:b._adviceTop,left:b._adviceLeft,width:b._adviceWidth,"z-index":1000});b.addClassName("advice-absolute")}}},hideAdvice:function(b,a){if(a!=null){a.hide()}},updateCallback:function(elm,status){if(typeof elm.callbackFunction!="undefined"){eval(elm.callbackFunction+"('"+elm.id+"','"+status+"')")}},ajaxError:function(e,d){var c="validate-ajax";var b=Validation.getAdvice(c,e);if(b==null){b=this.createAdvice(c,e,false,d)}this.showAdvice(e,b,"validate-ajax");this.updateCallback(e,"failed");e.addClassName("validation-failed");e.addClassName("validate-ajax");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var a=e.up(Validation.defaultOptions.containerClassName);if(a&&this.allowContainerClassName(e)){a.removeClassName("validation-passed");a.addClassName("validation-error")}}},allowContainerClassName:function(a){if(a.type=="radio"||a.type=="checkbox"){return a.hasClassName("change-container-classname")}return true},test:function(d,i,g){var b=Validation.get(d);var h="__advice"+d.camelize();try{if(Validation.isVisible(i)&&!b.test($F(i),i)){var c=Validation.getAdvice(d,i);if(c==null){c=this.createAdvice(d,i,g)}this.showAdvice(i,c,d);this.updateCallback(i,"failed");i[h]=1;if(!i.advaiceContainer){i.removeClassName("validation-passed");i.addClassName("validation-failed")}if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var a=i.up(Validation.defaultOptions.containerClassName);if(a&&this.allowContainerClassName(i)){a.removeClassName("validation-passed");a.addClassName("validation-error")}}return false}else{var c=Validation.getAdvice(d,i);this.hideAdvice(i,c);this.updateCallback(i,"passed");i[h]="";i.removeClassName("validation-failed");i.addClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var a=i.up(Validation.defaultOptions.containerClassName);if(a&&!a.down(".validation-failed")&&this.allowContainerClassName(i)){if(!Validation.get("IsEmpty").test(i.value)||!this.isVisible(i)){a.addClassName("validation-passed")}else{a.removeClassName("validation-passed")}a.removeClassName("validation-error")}}return true}}catch(f){throw (f)}},isVisible:function(a){while(a.tagName!="BODY"){if(!$(a).visible()){return false}a=a.parentNode}return true},getAdvice:function(a,b){return $("advice-"+a+"-"+Validation.getElmID(b))||$("advice-"+Validation.getElmID(b))},createAdvice:function(b,h,i,c){var j=Validation.get(b);var f=i?((h&&h.title)?h.title:j.error):j.error;if(c){f=c}try{if(Translator){f=Translator.translate(f)}}catch(g){}advice='<div class="validation-advice" id="advice-'+b+"-"+Validation.getElmID(h)+'" style="display:none">'+f+"</div>";Validation.insertAdvice(h,advice);advice=Validation.getAdvice(b,h);if($(h).hasClassName("absolute-advice")){var a=$(h).getDimensions();var d=Position.cumulativeOffset(h);advice._adviceTop=(d[1]+a.height)+"px";advice._adviceLeft=(d[0])+"px";advice._adviceWidth=(a.width)+"px";advice._adviceAbsolutize=true}return advice},getElmID:function(a){return a.id?a.id:a.name},reset:function(b){b=$(b);var a=$w(b.className);a.each(function(e){var f="__advice"+e.camelize();if(b[f]){var d=Validation.getAdvice(e,b);if(d){d.hide()}b[f]=""}b.removeClassName("validation-failed");b.removeClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var c=b.up(Validation.defaultOptions.containerClassName);if(c){c.removeClassName("validation-passed");c.removeClassName("validation-error")}}})},add:function(d,c,e,b){var a={};a[d]=new Validator(d,c,e,b);Object.extend(Validation.methods,a)},addAllThese:function(a){var b={};$A(a).each(function(c){b[c[0]]=new Validator(c[0],c[1],c[2],(c.length>3?c[3]:{}))});Object.extend(Validation.methods,b)},get:function(a){return Validation.methods[a]?Validation.methods[a]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}});Validation.add("IsEmpty","",function(a){return(a==""||(a==null)||(a.length==0)||/^\s+$/.test(a))});Validation.addAllThese([["validate-select","Please select an option.",function(a){return((a!="none")&&(a!=null)&&(a.length!=0))}],["required-entry","This is a required field.",function(a){return !Validation.get("IsEmpty").test(a)}],["validate-number","Please enter a valid number in this field.",function(a){return Validation.get("IsEmpty").test(a)||(!isNaN(parseNumber(a))&&!/^\s+$/.test(parseNumber(a)))}],["validate-digits","Please use numbers only in this field. please avoid spaces or other characters such as dots or commas.",function(a){return Validation.get("IsEmpty").test(a)||!/[^\d]/.test(a)}],["validate-digits-range","The value is not within the specified range.",function(c,d){var b=Validation.get("IsEmpty").test(c)||!/[^\d]/.test(c);var a=new RegExp(/^digits-range-[0-9]+-[0-9]+$/);$w(d.className).each(function(g,f){if(g.match(a)&&b){var h=parseInt(g.split("-")[2],10);var e=parseInt(g.split("-")[3],10);var i=parseInt(c,10);b=(c>=h)&&(c<=e)}});return b}],["validate-alpha","Please use letters only (a-z or A-Z) in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z]+$/.test(a)}],["validate-code","Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-z]+[a-z0-9_]+$/.test(a)}],["validate-alphanum","Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z0-9]+$/.test(a)
/*/\W/.test(v)*/
}],["validate-street","Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(a)}],["validate-phoneStrict","Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(a)}],["validate-phoneLax","Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$/.test(a)}],["validate-fax","Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(a)}],["validate-date","Please enter a valid date.",function(a){var b=new Date(a);return Validation.get("IsEmpty").test(a)||!isNaN(b)}],["validate-email","Please enter a valid email address. For example johndoe@domain.com.",function(a){return Validation.get("IsEmpty").test(a)||/^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(a)}],["validate-emailSender","Please use only visible characters and spaces.",function(a){return Validation.get("IsEmpty").test(a)||/^[\S ]+$/.test(a)}],["validate-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(a){var b=a.strip();return !(b.length>0&&b.length<6)}],["validate-admin-password","Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.",function(a){var b=a.strip();if(0==b.length){return true}if(!(/[a-z]/i.test(a))||!(/[0-9]/.test(a))){return false}return !(b.length<7)}],["validate-cpassword","Please make sure your passwords match.",function(a){var b=$("confirmation")?$("confirmation"):$$(".validate-cpassword")[0];var e=false;if($("password")){e=$("password")}var f=$$(".validate-password");for(var c=0;c<f.size();c++){var d=f[c];if(d.up("form").id==b.up("form").id){e=d}}if($$(".validate-admin-password").size()){e=$$(".validate-admin-password")[0]}return(e.value==b.value)}],["validate-url","Please enter a valid URL. Protocol is required (http://, https:// or ftp://)",function(a){return Validation.get("IsEmpty").test(a)||/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(a)}],["validate-clean-url","Please enter a valid URL. For example http://www.example.com or www.example.com",function(a){return Validation.get("IsEmpty").test(a)||/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(a)||/^(www)((\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(a)}],["validate-identifier",'Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".',function(a){return Validation.get("IsEmpty").test(a)||/^[A-Z0-9][A-Z0-9_\/-]+(\.[A-Z0-9_-]+)*$/i.test(a)}],["validate-xml-identifier","Please enter a valid XML-identifier. For example something_1, block5, id-4.",function(a){return Validation.get("IsEmpty").test(a)||/^[A-Z][A-Z0-9_\/-]*$/i.test(a)}],["validate-ssn","Please enter a valid social security number. For example 123-45-6789.",function(a){return Validation.get("IsEmpty").test(a)||/^\d{3}-?\d{2}-?\d{4}$/.test(a)}],["validate-zip","Please enter a valid zip code. For example 90602 or 90602-1234.",function(a){return Validation.get("IsEmpty").test(a)||/(^\d{5}$)|(^\d{5}-\d{4}$)/.test(a)}],["validate-zip-international","Please enter a valid zip code.",function(a){return true}],["validate-date-au","Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.",function(a){if(Validation.get("IsEmpty").test(a)){return true}var b=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!b.test(a)){return false}var c=new Date(a.replace(b,"$2/$1/$3"));return(parseInt(RegExp.$2,10)==(1+c.getMonth()))&&(parseInt(RegExp.$1,10)==c.getDate())&&(parseInt(RegExp.$3,10)==c.getFullYear())}],["validate-currency-dollar","Please enter a valid $ amount. For example $100.00.",function(a){return Validation.get("IsEmpty").test(a)||/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(a)}],["validate-one-required","Please select one of the above options.",function(a,d){var c=d.parentNode;var b=c.getElementsByTagName("INPUT");return $A(b).any(function(e){return $F(e)})}],["validate-one-required-by-name","Please select one of the options.",function(b,e){var a=$$('input[name="'+e.name.replace(/([\\"])/g,"\\$1")+'"]');var c=1;for(var d=0;d<a.length;d++){if((a[d].type=="checkbox"||a[d].type=="radio")&&a[d].checked==true){c=0}if(Validation.isOnChange&&(a[d].type=="checkbox"||a[d].type=="radio")){Validation.reset(a[d])}}if(c==0){return true}else{return false}}],["validate-not-negative-number","Please enter a valid number in this field.",function(a){a=parseNumber(a);return(!isNaN(a)&&a>=0)}],["validate-state","Please select State/Province.",function(a){return(a!=0||a=="")}],["validate-new-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(a){if(!Validation.get("validate-password").test(a)){return false}if(Validation.get("IsEmpty").test(a)&&a!=""){return false}return true}],["validate-greater-than-zero","Please enter a number greater than 0 in this field.",function(a){if(a.length){return parseFloat(a)>0}else{return true}}],["validate-zero-or-greater","Please enter a number 0 or greater in this field.",function(a){if(a.length){return parseFloat(a)>=0}else{return true}}],["validate-cc-number","Please enter a valid credit card number.",function(a,c){var b=$(c.id.substr(0,c.id.indexOf("_cc_number"))+"_cc_type");if(b&&typeof Validation.creditCartTypes.get(b.value)!="undefined"&&Validation.creditCartTypes.get(b.value)[2]==false){if(!Validation.get("IsEmpty").test(a)&&Validation.get("validate-digits").test(a)){return true}else{return false}}return validateCreditCard(a)}],["validate-cc-type","Credit card number does not match credit card type.",function(b,e){e.value=removeDelimiters(e.value);b=removeDelimiters(b);var d=$(e.id.substr(0,e.id.indexOf("_cc_number"))+"_cc_type");if(!d){return true}var c=d.value;if(typeof Validation.creditCartTypes.get(c)=="undefined"){return false}if(Validation.creditCartTypes.get(c)[0]==false){return true}var a="";Validation.creditCartTypes.each(function(f){if(f.value[0]&&b.match(f.value[0])){a=f.key;throw $break}});if(a!=c){return false}if(d.hasClassName("validation-failed")&&Validation.isOnChange){Validation.validate(d)}return true}],["validate-cc-type-select","Card type does not match credit card number.",function(b,c){var a=$(c.id.substr(0,c.id.indexOf("_cc_type"))+"_cc_number");if(Validation.isOnChange&&Validation.get("IsEmpty").test(a.value)){return true}if(Validation.get("validate-cc-type").test(a.value,a)){Validation.validate(a)}return Validation.get("validate-cc-type").test(a.value,a)}],["validate-cc-exp","Incorrect credit card expiration date.",function(a,g){var f=a;var e=$(g.id.substr(0,g.id.indexOf("_expiration"))+"_expiration_yr").value;var d=new Date();var c=d.getMonth()+1;var b=d.getFullYear();if(f<c&&e==b){return false}return true}],["validate-cc-cvn","Please enter a valid credit card verification number.",function(a,e){var d=$(e.id.substr(0,e.id.indexOf("_cc_cid"))+"_cc_type");if(!d){return true}var b=d.value;if(typeof Validation.creditCartTypes.get(b)=="undefined"){return false}var c=Validation.creditCartTypes.get(b)[1];if(a.match(c)){return true}return false}],["validate-ajax","",function(a,b){return true}],["validate-data","Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.",function(a){if(a!=""&&a){return/^[A-Za-z]+[A-Za-z0-9_]+$/.test(a)}return true}],["validate-css-length","Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.",function(a){if(a!=""&&a){return/^[0-9\.]+(px|pt|em|ex|%)?$/.test(a)&&(!(/\..*\./.test(a)))&&!(/\.$/.test(a))}return true}],["validate-length","Text length does not satisfy specified text range.",function(b,e){var c=new RegExp(/^maximum-length-[0-9]+$/);var d=new RegExp(/^minimum-length-[0-9]+$/);var a=true;$w(e.className).each(function(g,f){if(g.match(c)&&a){var h=g.split("-")[2];a=(b.length<=h)}if(g.match(d)&&a&&!Validation.get("IsEmpty").test(b)){var h=g.split("-")[2];a=(b.length>=h)}});return a}],["validate-percents","Please enter a number lower than 100.",{max:100}],["required-file","Please select a file",function(b,c){var a=!Validation.get("IsEmpty").test(b);if(a===false){ovId=c.id+"_value";if($(ovId)){a=!Validation.get("IsEmpty").test($(ovId).value)}}return a}],["validate-cc-ukss","Please enter issue number or start date for switch/solo card type.",function(i,e){var a;if(e.id.match(/(.)+_cc_issue$/)){a=e.id.indexOf("_cc_issue")}else{if(e.id.match(/(.)+_start_month$/)){a=e.id.indexOf("_start_month")}else{a=e.id.indexOf("_start_year")}}var d=e.id.substr(0,a);var b=$(d+"_cc_type");if(!b){return true}var h=b.value;if(["SS","SM","SO"].indexOf(h)==-1){return true}$(d+"_cc_issue").advaiceContainer=$(d+"_start_month").advaiceContainer=$(d+"_start_year").advaiceContainer=$(d+"_cc_type_ss_div").down("ul li.adv-container");var f=$(d+"_cc_issue").value;var g=$(d+"_start_month").value;var j=$(d+"_start_year").value;var c=(g&&j)?true:false;if(!c&&!f){return false}return true}]]);function removeDelimiters(a){a=a.replace(/\s/g,"");a=a.replace(/\-/g,"");return a}function parseNumber(a){if(typeof a!="string"){return parseFloat(a)}var c=a.indexOf(".");var b=a.indexOf(",");if(c!=-1&&b!=-1){if(b>c){a=a.replace(".","").replace(",",".")}else{a=a.replace(",","")}}else{if(b!=-1){a=a.replace(",",".")}}return parseFloat(a)}Validation.creditCartTypes=$H({SO:[new RegExp("^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],SM:[new RegExp("(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],VI:[new RegExp("^4[0-9]{12}([0-9]{3})?$"),new RegExp("^[0-9]{3}$"),true],MC:[new RegExp("^5[1-5][0-9]{14}$"),new RegExp("^[0-9]{3}$"),true],AE:[new RegExp("^3[47][0-9]{13}$"),new RegExp("^[0-9]{4}$"),true],DI:[new RegExp("^6011[0-9]{12}$"),new RegExp("^[0-9]{3}$"),true],JCB:[new RegExp("^(3[0-9]{15}|(2131|1800)[0-9]{11})$"),new RegExp("^[0-9]{4}$"),true],OT:[false,new RegExp("^([0-9]{3}|[0-9]{4})?$"),false]});
var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(a){a=a.toUpperCase();var g=this.NODEMAP[a]||"div";var b=document.createElement(g);try{b.innerHTML="<"+a+"></"+a+">"}catch(f){}var d=b.firstChild||null;if(d&&(d.tagName.toUpperCase()!=a)){d=d.getElementsByTagName(a)[0]}if(!d){d=document.createElement(a)}if(!d){return}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(d,arguments[1])}else{var c=this._attributes(arguments[1]);if(c.length){try{b.innerHTML="<"+a+" "+c+"></"+a+">"}catch(f){}d=b.firstChild||null;if(!d){d=document.createElement(a);for(attr in arguments[1]){d[attr=="class"?"className":attr]=arguments[1][attr]}}if(d.tagName.toUpperCase()!=a){d=b.getElementsByTagName(a)[0]}}}}if(arguments[2]){this._children(d,arguments[2])}return $(d)},_text:function(a){return document.createTextNode(a)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(a){var b=[];for(attribute in a){b.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"')}return b.join(" ")},_children:function(b,a){if(a.tagName){b.appendChild(a);return}if(typeof a=="object"){a.flatten().each(function(c){if(typeof c=="object"){b.appendChild(c)}else{if(Builder._isStringOrNumber(c)){b.appendChild(Builder._text(c))}}})}else{if(Builder._isStringOrNumber(a)){b.appendChild(Builder._text(a))}}},_isStringOrNumber:function(a){return(typeof a=="string"||typeof a=="number")},build:function(b){var a=this.node("div");$(a).update(b.strip());return a.down()},dump:function(b){if(typeof b!="object"&&typeof b!="function"){b=window}var a=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);a.each(function(c){b[c]=function(){return Builder.node.apply(Builder,[c].concat($A(arguments)))}})}};
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 e;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){e=b}else{e=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(e).each(function(g,f){new c(g,Object.extend(a,{delay:f*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(e,d){if(e.options[d+"Internal"]){e.options[d+"Internal"](e)}if(e.options[d]){e.options[d](e)}}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,f,e){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(g){c[d]=g};this.start(Object.extend({from:f,to:e},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,e){var f={};if(this.options.scaleX){f.width=e.round()+"px"}if(this.options.scaleY){f.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(e-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"}if(this.options.scaleX){f.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){f.top=-c+"px"}if(this.options.scaleX){f.left=-b+"px"}}}this.element.setStyle(f)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,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(e){scrollTo(a.left,e.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 e=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:e,y:0,duration:c,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(g){new Effect.Move(g.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(i){new Effect.Move(i.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:-e,y:0,duration:c,afterFinishInternal:function(k){k.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 g=c.getDimensions();var h,f;var e,d;switch(b.direction){case"top-left":h=f=e=d=0;break;case"top-right":h=g.width;f=d=0;e=-g.width;break;case"bottom-left":h=e=0;f=g.height;d=-g.height;break;case"bottom-right":h=g.width;f=g.height;e=-g.width;d=-g.height;break;case"center":h=g.width/2;f=g.height/2;e=-g.width/2;d=-g.height/2;break}return new Effect.Move(c,{x:h,y:f,duration:0.01,beforeSetup:function(i){i.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(i){new Effect.Parallel([new Effect.Opacity(i.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(i.element,{x:e,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(i.element,100,{scaleMode:{originalHeight:g.height,originalWidth:g.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(j){j.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(j){j.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 f=c.getDimensions();var e,d;switch(b.direction){case"top-left":e=d=0;break;case"top-right":e=f.width;d=0;break;case"bottom-left":e=0;d=f.height;break;case"bottom-right":e=f.width;d=f.height;break;case"center":e=f.width/2;d=f.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:e,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{},a=c.getInlineOpacity(),e=b.transition||Effect.Transitions.linear,d=function(f){return 1-e((-Math.cos((f*(b.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(f){f.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(e){d.element.style[e.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(g){var f=g[0],e=g[1],d=null;if(e.parseColor("#zzzzzz")!="#zzzzzz"){e=e.parseColor();d="color"}else{if(f=="opacity"){e=parseFloat(e);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(e)){var c=e.match(/^([\+\-]?[0-9\.]+)(.*)$/);e=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(f);return{style:f.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(e):e,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 e=[$(d)||$$(d)].flatten();return e.map(function(f){return new c(f,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,e){d[e]=a[e];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,e,b){c=$(c);var d=e.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);
if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)})},add:function(b){b=$(b);var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(a.containment){a._containers=[];var c=a.containment;if(Object.isArray(c)){c.each(function(d){a._containers.push($(d))})}else{a._containers.push($(c))}}if(a.accept){a.accept=[a.accept].flatten()}Element.makePositioned(b);a.element=b;this.drops.push(a)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i){if(Element.isParent(a[i].element,deepest.element)){deepest=a[i]}}return deepest},isContained:function(b,a){var c;if(a.tree){c=b.treeNode}else{c=b.parentNode}return a._containers.detect(function(d){return c==d})},isAffected:function(a,c,b){return((b.element!=c)&&((!b._containers)||this.isContained(c,b))&&((!b.accept)||(Element.classNames(c).detect(function(d){return b.accept.include(d)})))&&Position.within(b.element,a[0],a[1]))},deactivate:function(a){if(a.hoverclass){Element.removeClassName(a.element,a.hoverclass)}this.last_active=null},activate:function(a){if(a.hoverclass){Element.addClassName(a.element,a.hoverclass)}this.last_active=a},show:function(a,c){if(!this.drops.length){return}var b,d=[];this.drops.each(function(e){if(Droppables.isAffected(a,c,e)){d.push(e)}});if(d.length>0){b=Droppables.findDeepestChild(d)}if(this.last_active&&this.last_active!=b){this.deactivate(this.last_active)}if(b){Position.within(b.element,a[0],a[1]);if(b.onHover){b.onHover(c,b.element,Position.overlap(b.overlap,b.element))}if(b!=this.last_active){Droppables.activate(b)}}},fire:function(b,a){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,b);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(a.element,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(a.element,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable){return}var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return}this._lastPointer=b;this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a)}},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a});this._cacheObserverCallbacks()},notify:function(b,a,c){if(this[b+"Count"]>0){this.observers.each(function(d){if(d[b]){d[b](b,a,c)}})}if(a.options[b]){a.options[b](a,c)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]}).length})}};var Draggable=Class.create({initialize:function(b){var c={handle:false,reverteffect:function(f,e,d){var g=Math.sqrt(Math.abs(e^2)+Math.abs(d^2))*0.02;new Effect.Move(f,{x:-d,y:-e,duration:g,queue:{scope:"_draggable",position:"end"}})},endeffect:function(e){var d=Object.isNumber(e._opacity)?e._opacity:1;new Effect.Opacity(e,{duration:0.2,from:0.7,to:d,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[e]=false}})},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(c,{starteffect:function(d){d._opacity=Element.getOpacity(d);Draggable._dragging[d]=true;new Effect.Opacity(d,{duration:0.2,from:d._opacity,to:0.7})}})}var a=Object.extend(c,arguments[1]||{});this.element=$(b);if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0)}if(!this.handle){this.handle=$(a.handle)}if(!this.handle){this.handle=this.element}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);this._isScrollChild=Element.childOf(this.element,a.scroll)}Element.makePositioned(this.element);this.options=a;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(a)){var c=Event.element(a);if((tag_name=c.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return}var b=[Event.pointerX(a),Event.pointerY(a)];var d=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(e){return(b[e]-d[e])});Draggables.activate(this);Event.stop(a)}},startDrag:function(b){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=a.left;this.originalScrollTop=a.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify("onStart",this,b);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(b,f){this.dragging=false;if(this.options.quiet){Position.prepare();var e=[Event.pointerX(b),Event.pointerY(b)];Droppables.show(e,this.element)}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element)}delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}var g=false;if(f){g=Droppables.fire(b,this.element);if(!g){g=false}}if(g&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,b);var a=this.options.revert;if(a&&Object.isFunction(a)){a=a(this.element)}var c=this.currentDelta();if(a&&this.options.reverteffect){if(g==0||a!="failure"){this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0])}}else{this.delta=c}if(this.options.zindex){this.element.style.zIndex=this.originalZ}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return}this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging){return}this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var g=Position.cumulativeOffset(this.element);if(this.options.ghosting){var c=Position.realOffset(this.element);g[0]+=c[0]-Position.deltaX;g[1]+=c[1]-Position.deltaY}var f=this.currentDelta();g[0]-=f[0];g[1]-=f[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){g[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;g[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var e=[0,1].map(function(d){return(a[d]-g[d]-this.offset[d])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){e=this.options.snap(e[0],e[1],this)}else{if(Object.isArray(this.options.snap)){e=e.map(function(d,h){return(d/this.options.snap[h]).round()*this.options.snap[h]}.bind(this))}else{e=e.map(function(d){return(d/this.options.snap).round()*this.options.snap}.bind(this))}}}var b=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=e[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=e[1]+"px"}if(b.visibility=="hidden"){b.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1])){return}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(b,a){this.element=$(b);this.observer=a;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a}a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a){return}return Sortable.sortables[a.id]},destroy:function(a){a=$(a);var b=Sortable.sortables[a.id];if(b){Draggables.removeObserver(b.element);b.droppables.each(function(c){Droppables.remove(c)});b.draggables.invoke("destroy");delete Sortable.sortables[b.element.id]}},create:function(c){c=$(c);var b=Object.extend({element:c,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(c);var a={revert:true,quiet:b.quiet,scroll:b.scroll,scrollSpeed:b.scrollSpeed,scrollSensitivity:b.scrollSensitivity,delay:b.delay,ghosting:b.ghosting,constraint:b.constraint,handle:b.handle};if(b.starteffect){a.starteffect=b.starteffect}if(b.reverteffect){a.reverteffect=b.reverteffect}else{if(b.ghosting){a.reverteffect=function(f){f.style.top=0;f.style.left=0}}}if(b.endeffect){a.endeffect=b.endeffect}if(b.zindex){a.zindex=b.zindex}var d={overlap:b.overlap,containment:b.containment,tree:b.tree,hoverclass:b.hoverclass,onHover:Sortable.onHover};var e={onHover:Sortable.onEmptyHover,overlap:b.overlap,containment:b.containment,hoverclass:b.hoverclass};Element.cleanWhitespace(c);b.draggables=[];b.droppables=[];if(b.dropOnEmpty||b.tree){Droppables.add(c,e);b.droppables.push(c)}(b.elements||this.findElements(c,b)||[]).each(function(h,f){var g=b.handles?$(b.handles[f]):(b.handle?$(h).select("."+b.handle)[0]:h);b.draggables.push(new Draggable(h,Object.extend(a,{handle:g})));Droppables.add(h,d);if(b.tree){h.treeNode=c}b.droppables.push(h)});if(b.tree){(Sortable.findTreeElements(c,b)||[]).each(function(f){Droppables.add(f,e);f.treeNode=c;b.droppables.push(f)})}this.sortables[c.id]=b;Draggables.addObserver(new SortableObserver(c,b.onUpdate))},findElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.tag)},findTreeElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.treeTag)},onHover:function(e,d,a){if(Element.isParent(d,e)){return}if(a>0.33&&a<0.66&&Sortable.options(d).tree){return}else{if(a>0.5){Sortable.mark(d,"before");if(d.previousSibling!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,d);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}else{Sortable.mark(d,"after");var c=d.nextSibling||null;if(c!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,c);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}}},onEmptyHover:function(e,g,h){var j=e.parentNode;var a=Sortable.options(g);if(!Element.isParent(g,e)){var f;var c=Sortable.findElements(g,{tag:a.tag,only:a.only});var b=null;if(c){var d=Element.offsetSize(g,a.overlap)*(1-h);for(f=0;f<c.length;f+=1){if(d-Element.offsetSize(c[f],a.overlap)>=0){d-=Element.offsetSize(c[f],a.overlap)}else{if(d-(Element.offsetSize(c[f],a.overlap)/2)>=0){b=f+1<c.length?c[f+1]:null;break}else{b=c[f];break}}}}g.insertBefore(e,b);Sortable.options(j).onChange(e);a.onChange(e)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(b,a){var d=Sortable.options(b.parentNode);if(d&&!d.ghosting){return}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var c=Position.cumulativeOffset(b);Sortable._marker.setStyle({left:c[0]+"px",top:c[1]+"px"});if(a=="after"){if(d.overlap=="horizontal"){Sortable._marker.setStyle({left:(c[0]+b.clientWidth)+"px"})}else{Sortable._marker.setStyle({top:(c[1]+b.clientHeight)+"px"})}}Sortable._marker.show()},_tree:function(e,b,f){var d=Sortable.findElements(e,b)||[];for(var c=0;c<d.length;++c){var a=d[c].id.match(b.format);if(!a){continue}var g={id:encodeURIComponent(a?a[1]:null),element:e,parent:f,children:[],position:f.children.length,container:$(d[c]).down(b.treeTag)};if(g.container){this._tree(g.container,b,g)}f.children.push(g)}return f},tree:function(d){d=$(d);var c=this.options(d);var b=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:d.id,format:c.format},arguments[1]||{});var a={id:null,parent:null,children:[],container:d,position:0};return Sortable._tree(d,b,a)},_constructIndex:function(b){var a="";do{if(b.id){a="["+b.position+"]"+a}}while((b=b.parent)!=null);return a},sequence:function(b){b=$(b);var a=Object.extend(this.options(b),arguments[1]||{});return $(this.findElements(b,a)||[]).map(function(c){return c.id.match(a.format)?c.id.match(a.format)[1]:""})},setSequence:function(b,c){b=$(b);var a=Object.extend(this.options(b),arguments[2]||{});var d={};this.findElements(b,a).each(function(e){if(e.id.match(a.format)){d[e.id.match(a.format)[1]]=[e,e.parentNode]}e.parentNode.removeChild(e)});c.each(function(e){var f=d[e];if(f){f[1].appendChild(f[0]);delete d[e]}})},serialize:function(c){c=$(c);var b=Object.extend(Sortable.options(c),arguments[1]||{});var a=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:c.id);if(b.tree){return Sortable.tree(c,arguments[1]).children.map(function(d){return[a+Sortable._constructIndex(d)+"[id]="+encodeURIComponent(d.id)].concat(d.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(c,arguments[1]).map(function(d){return a+"[]="+encodeURIComponent(d)}).join("&")}}};Element.isParent=function(b,a){if(!b.parentNode||b==a){return false}if(b.parentNode==a){return true}return Element.isParent(b.parentNode,a)};Element.findChildren=function(d,b,a,c){if(!d.hasChildNodes()){return null}c=c.toUpperCase();if(b){b=[b].flatten()}var e=[];$A(d.childNodes).each(function(g){if(g.tagName&&g.tagName.toUpperCase()==c&&(!b||(Element.classNames(g).detect(function(h){return b.include(h)})))){e.push(g)}if(a){var f=Element.findChildren(g,b,a,c);if(f){e.push(f)}}});return(e.length>0?e.flatten():[])};Element.offsetSize=function(a,b){return a["offset"+((b=="vertical"||b=="height")?"Height":"Width")]};
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,e){if(!e.style.position||e.style.position=="absolute"){e.style.position="absolute";Position.clone(d,e,{setHeight:false,offsetTop:d.offsetHeight})}Effect.Appear(e,{duration:0.15})};this.options.onHide=this.options.onHide||function(d,e){new Effect.Fade(e,{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}},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(f){if(this.options.updateElement){this.options.updateElement(f);return}var d="";if(this.options.select){var a=$(f).select("."+this.options.select)||[];if(a.length>0){d=Element.collectTextNodes(a[0],this.options.select)}}else{d=Element.collectTextNodesIgnoreClass(f,"informal")}var c=this.getTokenBounds();if(c[0]!=-1){var e=this.element.value.substr(0,c[0]);var b=this.element.value.substr(c[0]).match(/^\s+/);if(b){e+=b[0]}this.element.value=e+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,f)}},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 e=this.element.value;if(e.strip().empty()){return[-1,0]}var f=arguments.callee.getFirstDifferencePos(e,this.oldElementValue);var h=(f==this.oldElementValue.length?1:0);var d=-1,c=e.length;var g;for(var b=0,a=this.options.tokens.length;b<a;++b){g=e.lastIndexOf(this.options.tokens[b],f+h-1);if(g>d){d=g}g=e.indexOf(this.options.tokens[b],f+h);if(-1!=g&&g<c){c=g}}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 h=b.getToken();var g=0;for(var e=0;e<b.options.array.length&&d.length<b.options.choices;e++){var f=b.options.array[e];var j=b.options.ignoreCase?f.toLowerCase().indexOf(h.toLowerCase()):f.indexOf(h);while(j!=-1){if(j==0&&f.length!=h.length){d.push("<li><strong>"+f.substr(0,h.length)+"</strong>"+f.substr(h.length)+"</li>");break}else{if(h.length>=b.options.partialChars&&b.options.partialSearch&&j!=-1){if(b.options.fullSearch||/\s/.test(f.substr(j-1,1))){c.push("<li>"+f.substr(0,j)+"<strong>"+f.substr(j,h.length)+"</strong>"+f.substr(j+h.length)+"</li>");break}}}j=b.options.ignoreCase?f.toLowerCase().indexOf(h.toLowerCase(),j+1):f.indexOf(h,j+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(g,c,b){var e=this.options[g+"Control"];var f=this.options[g+"Text"];if("button"==e){var a=document.createElement("input");a.type="submit";a.value=f;a.className="editor_"+g+"_button";if("cancel"==g){a.onclick=this._boundCancelHandler}this._form.appendChild(a);this._controls[g]=a}else{if("link"==e){var d=document.createElement("a");d.href="#";d.appendChild(document.createTextNode(f));d.onclick="cancel"==g?this._boundCancelHandler:this._boundSubmitHandler;d.className="editor_"+g+"_link";if(b){d.className+=" "+b}this._form.appendChild(d);this._controls[g]=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,e){var c=b.options["text"+d+"Controls"];if(!c||e===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(e,d){c=document.createElement("option");c.value=e[0];c.selected=a?e[0]==b:0==d;c.appendChild(document.createTextNode(e[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(!Control){var Control={}}Control.Slider=Class.create({initialize:function(d,a,b){var c=this;if(Object.isArray(d)){this.handles=d.collect(function(f){return $(f)})}else{this.handles=[$(d)]}this.track=$(a);this.options=b||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(e){return $(e)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(f,e){e=c.handles.length-1-e;c.setValue(parseFloat((Object.isArray(c.options.sliderValue)?c.options.sliderValue[e]:c.options.sliderValue)||c.range.start),e);f.makePositioned().observe("mousedown",c.eventMouseDown)});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);$(this.track.parentNode.parentNode).observe("mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var a=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(this.track.parentNode.parentNode,"mousemove",this.eventMouseMove);this.handles.each(function(b){Event.stopObserving(b,"mousedown",a.eventMouseDown)})},setDisabled:function(){this.disabled=true;this.track.parentNode.className=this.track.parentNode.className+" disabled"},setEnabled:function(){this.disabled=false},getNearestValue:function(a){if(this.allowedValues){if(a>=this.allowedValues.max()){return(this.allowedValues.max())}if(a<=this.allowedValues.min()){return(this.allowedValues.min())}var c=Math.abs(this.allowedValues[0]-a);var b=this.allowedValues[0];this.allowedValues.each(function(d){var e=Math.abs(d-a);if(e<=c){b=d;c=e}});return b}if(a>this.range.end){return this.range.end}if(a<this.range.start){return this.range.start}return a},setValue:function(b,a){if(!this.active){this.activeHandleIdx=a||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}a=a||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((a>0)&&(b<this.values[a-1])){b=this.values[a-1]}if((a<(this.handles.length-1))&&(b>this.values[a+1])){b=this.values[a+1]}}b=this.getNearestValue(b);this.values[a]=b;this.value=this.values[0];this.handles[a].style[this.isVertical()?"top":"left"]=this.translateToPx(b);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(b,a){this.setValue(this.values[a||this.activeHandleIdx||0]+b,a||this.activeHandleIdx||0)},translateToPx:function(a){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(a-this.range.start))+"px"},translateToValue:function(a){return((a/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(b){var a=this.values.sortBy(Prototype.K);b=b||0;return $R(a[b],a[b+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignX)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var a=this;if(this.spans){$R(0,this.spans.length-1).each(function(b){a.setSpan(a.spans[b],a.getRange(b))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(b,a){if(this.isVertical()){b.style.top=this.translateToPx(a.start);b.style.height=this.translateToPx(a.end-a.start+this.range.start)}else{b.style.left=this.translateToPx(a.start);b.style.width=this.translateToPx(a.end-a.start+this.range.start)}},updateStyles:function(){this.handles.each(function(a){Element.removeClassName(a,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(c){if(Event.isLeftClick(c)){if(!this.disabled){this.active=true;var d=Event.element(c);var e=[Event.pointerX(c),Event.pointerY(c)];var a=d;if(a==this.track){var b=Position.cumulativeOffset(this.track);this.event=c;this.setValue(this.translateToValue((this.isVertical()?e[1]-b[1]:e[0]-b[0])-(this.handleLength/2)));var b=Position.cumulativeOffset(this.activeHandle);this.offsetX=(e[0]-b[0]);this.offsetY=(e[1]-b[1])}else{while((this.handles.indexOf(d)==-1)&&d.parentNode){d=d.parentNode}if(this.handles.indexOf(d)!=-1){this.activeHandle=d;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var b=Position.cumulativeOffset(this.activeHandle);this.offsetX=(e[0]-b[0]);this.offsetY=(e[1]-b[1])}}}Event.stop(c)}},update:function(a){if(this.active){if(!this.dragging){this.dragging=true}this.draw(a);if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(a)}},draw:function(b){var c=[Event.pointerX(b),Event.pointerY(b)];var a=Position.cumulativeOffset(this.track);c[0]-=this.offsetX+a[0];c[1]-=this.offsetY+a[1];this.event=b;this.setValue(this.translateToValue(this.isVertical()?c[1]:c[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(a){if(this.active&&this.dragging){this.finishDrag(a,true);Event.stop(a)}this.active=false;this.dragging=false},finishDrag:function(a,b){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}});
function popWin(url,win,para){var win=window.open(url,win,para);win.focus();}
function setLocation(url){window.location.href=url;}
function setPLocation(url,setFocus){if(setFocus){window.opener.focus();}
window.opener.location.href=url;}
function setLanguageCode(code,fromCode){var href=window.location.href;var after='',dash;if(dash=href.match(/\#(.*)$/)){href=href.replace(/\#(.*)$/,'');after=dash[0];}
if(href.match(/[?]/)){var re=/([?&]store=)[a-z0-9_]*/;if(href.match(re)){href=href.replace(re,'$1'+code);}else{href+='&store='+code;}
var re=/([?&]from_store=)[a-z0-9_]*/;if(href.match(re)){href=href.replace(re,'');}}else{href+='?store='+code;}
if(typeof(fromCode)!='undefined'){href+='&from_store='+fromCode;}
href+=after;setLocation(href);}
function decorateGeneric(elements,decorateParams)
{var allSupportedParams=['odd','even','first','last'];var _decorateParams={};var total=elements.length;if(total){if(typeof(decorateParams)=='undefined'){decorateParams=allSupportedParams;}
if(!decorateParams.length){return;}
for(var k in allSupportedParams){_decorateParams[allSupportedParams[k]]=false;}
for(var k in decorateParams){_decorateParams[decorateParams[k]]=true;}
if(_decorateParams.first){Element.addClassName(elements[0],'first');}
if(_decorateParams.last){Element.addClassName(elements[total-1],'last');}
for(var i=0;i<total;i++){if((i+1)%2==0){if(_decorateParams.even){Element.addClassName(elements[i],'even');}}
else{if(_decorateParams.odd){Element.addClassName(elements[i],'odd');}}}}}
function decorateTable(table,options){var table=$(table);if(table){var _options={'tbody':false,'tbody tr':['odd','even','first','last'],'thead tr':['first','last'],'tfoot tr':['first','last'],'tr td':['last']};if(typeof(options)!='undefined'){for(var k in options){_options[k]=options[k];}}
if(_options['tbody']){decorateGeneric(table.select('tbody'),_options['tbody']);}
if(_options['tbody tr']){decorateGeneric(table.select('tbody tr'),_options['tbody tr']);}
if(_options['thead tr']){decorateGeneric(table.select('thead tr'),_options['thead tr']);}
if(_options['tfoot tr']){decorateGeneric(table.select('tfoot tr'),_options['tfoot tr']);}
if(_options['tr td']){var allRows=table.select('tr');if(allRows.length){for(var i=0;i<allRows.length;i++){decorateGeneric(allRows[i].getElementsByTagName('TD'),_options['tr td']);}}}}}
function decorateList(list,nonRecursive){if($(list)){if(typeof(nonRecursive)=='undefined'){var items=$(list).select('li')}
else{var items=$(list).childElements();}
decorateGeneric(items,['odd','even','last']);}}
function decorateDataList(list){list=$(list);if(list){decorateGeneric(list.select('dt'),['odd','even','last']);decorateGeneric(list.select('dd'),['odd','even','last']);}}
function parseSidUrl(baseUrl,urlExt){sidPos=baseUrl.indexOf('/?SID=');sid='';urlExt=(urlExt!=undefined)?urlExt:'';if(sidPos>-1){sid='?'+baseUrl.substring(sidPos+2);baseUrl=baseUrl.substring(0,sidPos+1);}
return baseUrl+urlExt+sid;}
function formatCurrency(price,format,showPlus){precision=isNaN(format.precision=Math.abs(format.precision))?2:format.precision;requiredPrecision=isNaN(format.requiredPrecision=Math.abs(format.requiredPrecision))?2:format.requiredPrecision;precision=requiredPrecision;integerRequired=isNaN(format.integerRequired=Math.abs(format.integerRequired))?1:format.integerRequired;decimalSymbol=format.decimalSymbol==undefined?",":format.decimalSymbol;groupSymbol=format.groupSymbol==undefined?".":format.groupSymbol;groupLength=format.groupLength==undefined?3:format.groupLength;if(showPlus==undefined||showPlus==true){s=price<0?"-":(showPlus?"+":"");}else if(showPlus==false){s='';}
i=parseInt(price=Math.abs(+price||0).toFixed(precision))+"";pad=(i.length<integerRequired)?(integerRequired-i.length):0;while(pad){i='0'+i;pad--;}
j=(j=i.length)>groupLength?j%groupLength:0;re=new RegExp("(\\d{"+groupLength+"})(?=\\d)","g");r=(j?i.substr(0,j)+groupSymbol:"")+i.substr(j).replace(re,"$1"+groupSymbol)+(precision?decimalSymbol+Math.abs(price-i).toFixed(precision).replace(/-/,0).slice(2):"")
if(format.pattern.indexOf('{sign}')==-1){pattern=s+format.pattern;}else{pattern=format.pattern.replace('{sign}',s);}
return pattern.replace('%s',r).replace(/^\s\s*/,'').replace(/\s\s*$/,'');};function expandDetails(el,childClass){if(Element.hasClassName(el,'show-details')){$$(childClass).each(function(item){item.hide()});Element.removeClassName(el,'show-details');}
else{$$(childClass).each(function(item){item.show()});Element.addClassName(el,'show-details');}}
var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";if(!window.Varien)
var Varien=new Object();Varien.showLoading=function(){Element.show('loading-process');}
Varien.hideLoading=function(){Element.hide('loading-process');}
Varien.GlobalHandlers={onCreate:function(){Varien.showLoading();},onComplete:function(){if(Ajax.activeRequestCount==0){Varien.hideLoading();}}};Ajax.Responders.register(Varien.GlobalHandlers);Varien.searchForm=Class.create();Varien.searchForm.prototype={initialize:function(form,field,emptyText){this.form=$(form);this.field=$(field);this.emptyText=emptyText;Event.observe(this.form,'submit',this.submit.bind(this));Event.observe(this.field,'focus',this.focus.bind(this));Event.observe(this.field,'blur',this.blur.bind(this));this.blur();},submit:function(event){if(this.field.value==this.emptyText||this.field.value==''){Event.stop(event);return false;}
return true;},focus:function(event){if(this.field.value==this.emptyText){this.field.value='';}},blur:function(event){if(this.field.value==''){this.field.value=this.emptyText;}},initAutocomplete:function(url,destinationElement){new Ajax.Autocompleter(this.field,destinationElement,url,{paramName:this.field.name,method:'get',minChars:2,updateElement:this._selectAutocompleteItem.bind(this),onShow:function(element,update){if(!update.style.position||update.style.position=='absolute'){update.style.position='absolute';Position.clone(element,update,{setHeight:false,offsetTop:element.offsetHeight});}
Effect.Appear(update,{duration:0});}});},_selectAutocompleteItem:function(element){if(element.title){this.field.value=element.title;}
this.form.submit();}}
Varien.Tabs=Class.create();Varien.Tabs.prototype={initialize:function(selector){var self=this;$$(selector+' a').each(this.initTab.bind(this));},initTab:function(el){el.href='javascript:void(0)';if($(el.parentNode).hasClassName('active')){this.showContent(el);}
el.observe('click',this.showContent.bind(this,el));},showContent:function(a){var li=$(a.parentNode),ul=$(li.parentNode);ul.getElementsBySelector('li','ol').each(function(el){var contents=$(el.id+'_contents');if(el==li){el.addClassName('active');contents.show();}else{el.removeClassName('active');contents.hide();}});}}
Varien.DateElement=Class.create();Varien.DateElement.prototype={initialize:function(type,content,required,format){if(type=='id'){this.day=$(content+'day');this.month=$(content+'month');this.year=$(content+'year');this.full=$(content+'full');this.advice=$(content+'advice');}else if(type=='container'){this.day=content.day;this.month=content.month;this.year=content.year;this.full=content.full;this.advice=content.advice;}else{return;}
this.required=required;this.format=format;this.day.addClassName('validate-custom');this.day.validate=this.validate.bind(this);this.month.addClassName('validate-custom');this.month.validate=this.validate.bind(this);this.year.addClassName('validate-custom');this.year.validate=this.validate.bind(this);this.year.setAttribute('autocomplete','off');this.advice.hide();},validate:function(){var error=false;if(this.day.value==''&&this.month.value==''&&this.year.value==''){if(this.required){error='This date is a required value.';}else{this.full.value='';}}else if(this.day.value==''||this.month.value==''||this.year.value==''){error='Please enter a valid full date.';}else{var date=new Date();if(this.day.value<1||this.day.value>31){error='Please enter a valid day (1-31).';}else if(this.month.value<1||this.month.value>12){error='Please enter a valid month (1-12).';}else if(this.year.value<1900||this.year.value>date.getFullYear()){error='Please enter a valid year (1900-'+date.getFullYear()+').';}else{this.full.value=this.format.replace(/(%m|%b)/i,this.month.value).replace(/(%d|%e)/i,this.day.value).replace(/%y/i,this.year.value);var testFull=this.month.value+'/'+this.day.value+'/'+this.year.value;var test=new Date(testFull);if(isNaN(test)){error='Please enter a valid date.';}}}
if(error!==false){try{this.advice.innerHTML=Translator.translate(error);}
catch(e){this.advice.innerHTML=error;}
this.advice.show();return false;}
this.day.removeClassName('validation-failed');this.month.removeClassName('validation-failed');this.year.removeClassName('validation-failed');this.advice.hide();return true;}};Varien.DOB=Class.create();Varien.DOB.prototype={initialize:function(selector,required,format){var el=$$(selector)[0];var container={};container.day=Element.select(el,'.dob-day input')[0];container.month=Element.select(el,'.dob-month input')[0];container.year=Element.select(el,'.dob-year input')[0];container.full=Element.select(el,'.dob-full input')[0];container.advice=Element.select(el,'.validation-advice')[0];new Varien.DateElement('container',container,required,format);}};Varien.FileElement=Class.create();Varien.FileElement.prototype={initialize:function(id){this.fileElement=$(id);this.hiddenElement=$(id+'_value');this.fileElement.observe('change',this.selectFile.bind(this));},selectFile:function(event){this.hiddenElement.value=this.fileElement.getValue();}};Validation.addAllThese([['validate-custom',' ',function(v,elm){return elm.validate();}]]);function truncateOptions(){$$('.truncated').each(function(element){Event.observe(element,'mouseover',function(){if(element.down('div.truncated_full_value')){element.down('div.truncated_full_value').addClassName('show')}});Event.observe(element,'mouseout',function(){if(element.down('div.truncated_full_value')){element.down('div.truncated_full_value').removeClassName('show')}});});}
Event.observe(window,'load',function(){truncateOptions();});Element.addMethods({getInnerText:function(element)
{element=$(element);if(element.innerText&&!Prototype.Browser.Opera){return element.innerText}
return element.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g,' ').strip();}});function fireEvent(element,event){if(document.createEventObject){var evt=document.createEventObject();return element.fireEvent('on'+event,evt)}
else{var evt=document.createEvent("HTMLEvents");evt.initEvent(event,true,true);return!element.dispatchEvent(evt);}}
VarienForm=Class.create();VarienForm.prototype={initialize:function(c,b){this.form=$(c);if(!this.form){return}this.cache=$A();this.currLoader=false;this.currDataIndex=false;this.validator=new Validation(this.form);this.elementFocus=this.elementOnFocus.bindAsEventListener(this);this.elementBlur=this.elementOnBlur.bindAsEventListener(this);this.childLoader=this.onChangeChildLoad.bindAsEventListener(this);this.highlightClass="highlight";this.extraChildParams="";this.firstFieldFocus=b||false;this.bindElements();if(this.firstFieldFocus){try{Form.Element.focus(Form.findFirstElement(this.form))}catch(a){}}},submit:function(a){if(this.validator&&this.validator.validate()){this.form.submit()}return false},bindElements:function(){var a=Form.getElements(this.form);for(var b in a){if(a[b].id){Event.observe(a[b],"focus",this.elementFocus);Event.observe(a[b],"blur",this.elementBlur)}}},elementOnFocus:function(b){var a=Event.findElement(b,"fieldset");if(a){Element.addClassName(a,this.highlightClass)}},elementOnBlur:function(b){var a=Event.findElement(b,"fieldset");if(a){Element.removeClassName(a,this.highlightClass)}},setElementsRelation:function(a,d,b,c){if(a=$(a)){if(!this.cache[a.id]){this.cache[a.id]=$A();this.cache[a.id]["child"]=d;this.cache[a.id]["dataUrl"]=b;this.cache[a.id]["data"]=$A();this.cache[a.id]["first"]=c||false}Event.observe(a,"change",this.childLoader)}},onChangeChildLoad:function(a){element=Event.element(a);this.elementChildLoad(element)},elementChildLoad:function(a,b){this.callback=b||false;if(a.value){this.currLoader=a.id;this.currDataIndex=a.value;if(this.cache[a.id]["data"][a.value]){this.setDataToChild(this.cache[a.id]["data"][a.value])}else{new Ajax.Request(this.cache[this.currLoader]["dataUrl"],{method:"post",parameters:{parent:a.value},onComplete:this.reloadChildren.bind(this)})}}},reloadChildren:function(transport){var data=eval("("+transport.responseText+")");this.cache[this.currLoader]["data"][this.currDataIndex]=data;this.setDataToChild(data)},setDataToChild:function(c){if(c.length){var d=$(this.cache[this.currLoader]["child"]);if(d){var b='<select name="'+d.name+'" id="'+d.id+'" class="'+d.className+'" title="'+d.title+'" '+this.extraChildParams+">";if(this.cache[this.currLoader]["first"]){b+='<option value="">'+this.cache[this.currLoader]["first"]+"</option>"}for(var a in c){if(c[a].value){b+='<option value="'+c[a].value+'"';if(d.value&&(d.value==c[a].value||d.value==c[a].label)){b+=" selected"}b+=">"+c[a].label+"</option>"}}b+="</select>";Element.insert(d,{before:b});Element.remove(d)}}else{var d=$(this.cache[this.currLoader]["child"]);if(d){var b='<input type="text" name="'+d.name+'" id="'+d.id+'" class="'+d.className+'" title="'+d.title+'" '+this.extraChildParams+">";Element.insert(d,{before:b});Element.remove(d)}}this.bindElements();if(this.callback){this.callback()}}};RegionUpdater=Class.create();RegionUpdater.prototype={initialize:function(b,c,d,f,a,e){this.countryEl=$(b);this.regionTextEl=$(c);this.regionSelectEl=$(d);this.zipEl=$(e);this.regions=f;this.disableAction=(typeof a=="undefined")?"hide":a;this.zipOptions=(typeof zipOptions=="undefined")?false:zipOptions;if(this.regionSelectEl.options.length<=1){this.update()}Event.observe(this.countryEl,"change",this.update.bind(this))},update:function(){if(this.regions[this.countryEl.value]){var a,c,e,d;if(this.regionTextEl){d=this.regionTextEl.value.toLowerCase();this.regionTextEl.value=""}if(!d){d=this.regionSelectEl.getAttribute("defaultValue")}this.regionSelectEl.options.length=1;for(regionId in this.regions[this.countryEl.value]){e=this.regions[this.countryEl.value][regionId];c=document.createElement("OPTION");c.value=regionId;c.text=e.name;if(this.regionSelectEl.options.add){this.regionSelectEl.options.add(c)}else{this.regionSelectEl.appendChild(c)}if(regionId==d||e.name.toLowerCase()==d||e.code.toLowerCase()==d){this.regionSelectEl.value=regionId}}if(this.disableAction=="hide"){if(this.regionTextEl){this.regionTextEl.style.display="none"}this.regionSelectEl.style.display=""}else{if(this.disableAction=="disable"){if(this.regionTextEl){this.regionTextEl.disabled=true}this.regionSelectEl.disabled=false}}this.setMarkDisplay(this.regionSelectEl,true)}else{if(this.disableAction=="hide"){if(this.regionTextEl){this.regionTextEl.style.display=""}this.regionSelectEl.style.display="none";Validation.reset(this.regionSelectEl)}else{if(this.disableAction=="disable"){if(this.regionTextEl){this.regionTextEl.disabled=false}this.regionSelectEl.disabled=true}else{if(this.disableAction=="nullify"){this.regionSelectEl.options.length=1;this.regionSelectEl.value="";this.regionSelectEl.selectedIndex=0;this.lastCountryId=""}}}this.setMarkDisplay(this.regionSelectEl,false)}var b=new ZipUpdater(this.countryEl.value,this.zipEl);b.update()},setMarkDisplay:function(b,c){b=$(b);var a=b.up(0).down("label > span.required")||b.up(1).down("label > span.required")||b.up(0).down("label.required > em")||b.up(1).down("label.required > em");if(a){inputElement=a.up().next("input");if(c){a.show();if(inputElement){inputElement.addClassName("required-entry")}}else{a.hide();if(inputElement){inputElement.removeClassName("required-entry")}}}}};ZipUpdater=Class.create();ZipUpdater.prototype={initialize:function(b,a){this.country=b;this.zipElement=$(a)},update:function(){if(typeof optionalZipCountries=="undefined"){return false}if(this.zipElement!=undefined){this._setPostcodeOptional()}else{Event.observe(window,"load",this._setPostcodeOptional.bind(this))}},_setPostcodeOptional:function(){this.zipElement=$(this.zipElement);if(this.zipElement==undefined){return false}var a=$$('label[for="'+this.zipElement.id+'"]')[0];if(a!=undefined){var b=a.down("em")||a.down("span.required")}if(optionalZipCountries.indexOf(this.country)!=-1){while(this.zipElement.hasClassName("required-entry")){this.zipElement.removeClassName("required-entry")}if(b!=undefined){b.hide()}}else{this.zipElement.addClassName("required-entry");if(b!=undefined){b.show()}}}};
var mainNav=function(){var a={obj_nav:$(arguments[0])||$("nav"),settings:{show_delay:0,hide_delay:0,_ie6:/MSIE 6.+Win/.test(navigator.userAgent),_ie7:/MSIE 7.+Win/.test(navigator.userAgent)},init:function(b,c){b.lists=b.childElements();b.lists.each(function(d,e){a.handlNavElement(d);if((a.settings._ie6||a.settings._ie7)&&c){a.ieFixZIndex(d,e,b.lists.size())}});if(a.settings._ie6&&!c){document.execCommand("BackgroundImageCache",false,true)}},handlNavElement:function(b){if(b!==undefined){b.onmouseover=function(){a.fireNavEvent(this,true)};b.onmouseout=function(){a.fireNavEvent(this,false)};if(b.down("ul")){a.init(b.down("ul"),true)}}},ieFixZIndex:function(d,c,b){if(d.tagName.toString().toLowerCase().indexOf("iframe")==-1){d.style.zIndex=b-c}else{d.onmouseover="null";d.onmouseout="null"}},fireNavEvent:function(c,b){if(b){c.addClassName("over");c.down("a").addClassName("over");if(c.childElements()[1]){a.show(c.childElements()[1])}}else{c.removeClassName("over");c.down("a").removeClassName("over");if(c.childElements()[1]){a.hide(c.childElements()[1])}}},show:function(b){if(b.hide_time_id){clearTimeout(b.hide_time_id)}b.show_time_id=setTimeout(function(){if(!b.hasClassName("shown-sub")){b.addClassName("shown-sub")}},a.settings.show_delay)},hide:function(b){if(b.show_time_id){clearTimeout(b.show_time_id)}b.hide_time_id=setTimeout(function(){if(b.hasClassName("shown-sub")){b.removeClassName("shown-sub")}},a.settings.hide_delay)}};if(arguments[1]){a.settings=Object.extend(a.settings,arguments[1])}if(a.obj_nav){a.init(a.obj_nav,false)}};document.observe("dom:loaded",function(){mainNav("nav",{show_delay:"100",hide_delay:"100"})});
var Translate=Class.create();Translate.prototype={initialize:function(a){this.data=$H(a)},translate:function(){var a=arguments;var b=arguments[0];if(this.data.get(b)){return this.data.get(b)}return b},add:function(){if(arguments.length>1){this.data.set(arguments[0],arguments[1])}else{if(typeof arguments[0]=="object"){$H(arguments[0]).each(function(a){this.data.set(a.key,a.value)}.bind(this))}}}};
if(!window.Mage){var Mage={}}Mage.Cookies={};Mage.Cookies.expires=null;Mage.Cookies.path="/";Mage.Cookies.domain=null;Mage.Cookies.secure=false;Mage.Cookies.set=function(c,e){var a=arguments;var h=arguments.length;var b=(h>2)?a[2]:Mage.Cookies.expires;var g=(h>3)?a[3]:Mage.Cookies.path;var d=(h>4)?a[4]:Mage.Cookies.domain;var f=(h>5)?a[5]:Mage.Cookies.secure;document.cookie=c+"="+escape(e)+((b==null)?"":("; expires="+b.toGMTString()))+((g==null)?"":("; path="+g))+((d==null)?"":("; domain="+d))+((f==true)?"; secure":"")};Mage.Cookies.get=function(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;var c=0;while(e<a){c=e+f;if(document.cookie.substring(e,c)==b){return Mage.Cookies.getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null};Mage.Cookies.clear=function(a){if(Mage.Cookies.get(a)){document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT"}};Mage.Cookies.getCookieVal=function(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))};
if(typeof Prototype=='undefined')
alert("Q Error:  Prototype is not loaded. Please make sure that your page includes prototype.js before it includes q.js");if(Prototype.Version<"1.6")
alert("Q Error:  Minimum Prototype 1.6.0 is required; you are using "+Prototype.Version);if(Prototype.Browser.IE)
if(/MSIE (\d+\.\d+);/.test(navigator.userAgent))
Prototype.BrowserFeatures.version=new Number(RegExp.$1);if(Prototype.Browser.IE&&Prototype.BrowserFeatures.version<7)
alert("Your webbrowser, Internet Explorer "+Prototype.BrowserFeatures.version+", is more than 8 years old and doesn't support many of the features necessary for using this page.  Please update to a newer version of Internet Explorer, or download one of the many free browsers (Firefox, Chrome, or Safari).")
var Q={imagePath:"images/q",style:"default",types:$w("plain info notice warning error dark"),fontFamily:"Lucida Sans Unicode, Lucida Grande, sans-serif;",fontSize:"12px",imageTypes:{plain:0,info:1,notice:2,warning:3,error:4,dark:5},IE:Prototype.Browser.IE,Opera:Prototype.Browser.Opera,WebKit:Prototype.Browser.WebKit,Gecko:Prototype.Browser.Gecko,MobileSafari:Prototype.Browser.MobileSafari,instances:[],counts:{},active:false,cssDeclarations:[],setup:function(){Q.addDynamicStylesheetMethodsTo(document);this.css=document.createStyleSheet();this.setSkin();this.addCssFor('base');document.fire('q:loaded');},set:function(options){if(typeof options=="string"&&options.isJSON())
options=options.evalJSON();if(options.image_path)
options.imagePath=options.image_path;$H(options).each((function(pair){this[pair.key]=pair.value;}).bind(this));this.setSkin(this.style,true);},setSkin:function(style,load){var preload=load?new Image(25,25):{};if(style)
this.style=style;$w("h v").each((function(part){preload.src=this["imagePath_"+part]=this.imagePath+"/"+this.style+"-"+part+".png";}).bind(this));this.types.each((function(type){preload.src=this["filler_path_"+type]=this.imagePath+"/"+this.style+"-"+type+".png";}).bind(this));["#q_wrapper","#q_wrapper input","#q_wrapper textarea"].each((function(klass){this.addCss(klass,"font-family:"+this.fontFamily+";font-size:"+this.fontSize+";");}).bind(this));},create:function(subclass,options){var klass=options.klass||'q-'+subclass.toLowerCase(),inputType='input';if(subclass=='Textarea')
inputType='textarea'
$$(inputType+'.'+klass).each(function(input){new Q[subclass](input,options);});},register:function(subclass){if(this.counts[subclass])
this.counts[subclass]+=1;else
this.counts[subclass]=1;},hide:function(force){if(force||(this.active&&!this.active.persistent))
this.active.hide();},hideAll:function(force){this.instances.each((function(instance){if(instance!=this&&(force||!instance.persistent))
instance.hide(force);}).bind(this));},reposition:function(){this.instances.invoke("positionHolder");},addCss:function(targets,cssText){if(typeof targets=='string'){targets.split(',').collect(function(part){return part.strip();}).each((function(selector){try{this.css.addRule(selector,cssText);}catch(e){alert(selector);alert(cssText);alert(e);}}).bind(this));}else if(typeof targets=='object'){$H(targets).each((function(pair){if(typeof pair.value=='object'){cssText='';$H(pair.value).each(function(p){cssText+=p.key.underscore().dasherize()+':'+p.value+';';});}else{cssText=pair.value;}
this.css.addRule(pair.key,cssText);}).bind(this));}},addCssFor:function(plugin){if(this.cssDeclarations.indexOf(plugin)>-1)return;switch(plugin){case"base":this.addCss("div.q-protective-layer","position:fixed;left:0;top:0;width:100%;height:100%;z-index:99997;background-color:#fff;");this.addCss("div.q-wrapper","position:absolute;left:0;top:0;z-index:99999999;width:100%;height:1px;");this.addCss(".q-clearer","content:'.';display:block;clear:both;visibility:hidden;line-height:0;height:0;zoom:1;list-style-type:none;margin:0;padding:0;");this.addCss("div.q-background","width:100%;height:100%;padding:0;margin:0;border-spacing:0;position:relative;");this.addCss("div.q-background div.q-center","margin:0 12px;position:relative;");this.addCss("div.q-background div.q-center div.q-top-spacer","height:1px;");this.addCss("div.q-background div.q-corner","width:12px;height:12px;position:absolute;margin:0;padding:0;");this.addCss("div.q-background div.q-edge","width:100%;height:12px;position:absolute;left:0;");this.addCss("div.q-background div.q-edge-spacer","height:12px;position:relative;");this.addCss("div.q-background div.q-border","width:12px;height:100%;position:absolute;margin:0;padding:0;");this.addCss(".q-plain","color:#333;");this.addCss(".q-info","color:rgb(44, 50, 51);");this.addCss(".q-notice","color:rgb(40, 51, 0);");this.addCss(".q-warning","color:rgb(51, 31, 2);");this.addCss(".q-error","color:#fff;");this.addCss(".q-dark","color:#fff;");break;case"informer":this.addCss(".q-message","position:relative;margin:0 0 5px 0;overflow:hidden;cursor:pointer;");this.addCss("div.q-message div.q-message-close","position:absolute;width:24px;height:24px;right:0px;top:0px;z-index:100;cursor:pointer;background-position:-24px -168px;background-image:url("+Q.imagePath_h+");visibility:hidden;");this.addCss("div.q-message:hover div.q-message-close","visibility:visible;");this.addCss("div.q-message div.q-message-close.q-left","left:0px;right:auto;");this.addCss(".q-text","font-size:12px;");this.addCss(".q-pending-bar","width:auto;height:16px;border:1px solid #999;-moz-border-radius:2px;-webkit-border-radius:2px;background-image:url("+Q.imagePath+"/pending.gif"+");");this.addCss(".q-progress-bar","width:auto;height:16px;border:1px solid #999;-moz-border-radius:2px;-webkit-border-radius:2px;");this.addCss(".q-progress-bar .q-indicator","width:0;height:100%;background-color:#ccc;");break;case"palette":this.addCss("#q_wrapper ul.q-palette","margin:0; padding:0; max-width:342px");this.addCss("#q_wrapper ul.q-palette li.q-color","padding:0; list-style-type:none; margin:2px; float:left; width:15px; height:15px; cursor:pointer;");this.addCss("#q_wrapper ul.q-palette li.q-color:hover","margin:0px; width:19px; height:19px;");this.addCss("#q_wrapper ul.q-palette li.q-color.active","margin:0px; width:19px; height:19px;");this.addCss("#q_wrapper ul.q-palette li.q-color.round","-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;");break;case"tagger":this.addCss("#q_wrapper ul.q-taglist","margin:0;padding:0;");this.addCss("#q_wrapper ul.q-taglist li.q-tag","margin:3px;padding:0px 8px;list-style-type:none;float:left;background-color:#666;color:#fff;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;cursor:pointer;");this.addCss("#q_wrapper ul.q-taglist li.q-tag:hover","background-color:#ccc;color:#666;text-decoration:line-through;");this.addCss("#q_wrapper ul.q-taglist li.q-tag.q-used","background-color:#ccc;color:#666;text-decoration:line-through;");this.addCss("#q_wrapper ul.q-taglist li.q-tag.q-used:hover","background-color:#666;color:#fff;text-decoration:none;");break;case"tooltip":this.addCss("#q_wrapper div.q-tooltip","position:absolute;");this.addCss("#q_wrapper div.q-tooltip div.q-content","overflow:hidden;");break;case"textarea":var cssClass;this.addCss('div.q-textarea-wrapper','position: relative;');this.addCss('div.q-textarea-wrapper iframe','border: 1px solid #ccc;');this.addCss('div.q-textarea-wrapper textarea','border:1px solid #ccc; resize:none; position:relative !important; top:auto; left:auto; right:auto; bottom:auto;');this.addCss("ul.q-textarea-toolbar","margin:0; padding: 0; background-color:#f2f2f2; position:relative;");this.addCss("ul.q-textarea-toolbar li.button","margin:0; padding:0; list-style-type:none; cursor:pointer; float:left; position:relative; width:30px; height:30px; background-image: url("+Q.imagePath+"/textarea.png);");this.addCss("ul.q-textarea-toolbar li.q-heading-select","position:absolute; margin:0; padding:0; list-style-type:none; top:0px; left:0; z-index:10;");this.addCss("ul.q-textarea-toolbar li.q-heading-select ul","margin:0; padding:0; top:0px; width:210px; height:30px; background-color:#fff; -webkit-box-shadow: rgba(0, 0, 0, 0.5) 0px 2px 7px; box-shadow: rgba(0, 0, 0, 0.5) 0px 2px 7px; -moz-box-shadow: rgba(0, 0, 0, 0.5) 0px 2px 7px;");this.addCss("ul.q-textarea-toolbar li.q-heading-select ul li","margin:0; padding:0; list-style-type:none; float:left; cursor:pointer;");this.addCss("ul.q-textarea-toolbar li.button input.q-editor-color-field","width:28px; height:28px; margin:0; padding:0; opacity:0; -moz-opacity:0; cursor:pointer;");if(Q.IE){this.addCss("ul.q-textarea-toolbar li.button input.q-editor-color-field","filter:alpha(opacity=0);");this.addCss("ul.q-textarea-toolbar li.q-heading-select ul","border: 2px solid #666;");}
this.addCss("ul.q-textarea-toolbar.small li.q-heading-select ul","width:140px; height:20px;");this.addCss("ul.q-textarea-toolbar.small li.button","width:20px; height:20px; background-image: url("+Q.imagePath+"/textarea-small.png);");this.addCss("ul.q-textarea-toolbar.small li.button select.q-editor-select","top: 2px; width:20px; height:20px;");this.addCss("ul.q-textarea-toolbar.small li.button input.q-editor-color-field","width:18px; height:18px;");$w('Heading Bold Italic Underline StrikeThrough CreateLink InsertImage JustifyLeft JustifyCenter JustifyRight JustifyFull Indent Outdent ForeColor BackColor InsertUnorderedList InsertOrderedList RemoveFormat EditCode').each((function(button,i){cssClass=button.underscore().dasherize();this.addCss("ul.q-textarea-toolbar li."+cssClass,"background-position: -"+i*30+"px 0;");this.addCss("ul.q-textarea-toolbar li."+cssClass+":hover"+", ul.q-textarea-toolbar li."+cssClass+".active","background-position: -"+i*30+"px -30px;");this.addCss("ul.q-textarea-toolbar li."+cssClass+".inactive","background-position: -"+i*30+"px -60px !important; cursor:default !important;");this.addCss("ul.q-textarea-toolbar.small li."+cssClass,"background-position: -"+i*20+"px 0;");this.addCss("ul.q-textarea-toolbar.small li."+cssClass+":hover"+", ul.q-textarea-toolbar.small li."+cssClass+".active","background-position: -"+i*20+"px -20px;");this.addCss("ul.q-textarea-toolbar.small li."+cssClass+".inactive","background-position: -"+i*20+"px -40px !important; cursor:default !important;");}).bind(this));this.addCss("ul.q-textarea-toolbar li.option.div","background-position: 0px 0px;");this.addCss("ul.q-textarea-toolbar li.option.div:hover","background-position: 0px -30px;");this.addCss("ul.q-textarea-toolbar.small li.option.div","background-position: 0px 0px;");this.addCss("ul.q-textarea-toolbar.small li.option.div:hover","background-position: 0px -20px;");$R(1,6).each((function(i){this.addCss("ul.q-textarea-toolbar li.option.h"+i,"background-position: -"+(540+i*30)+"px 0px;");this.addCss("ul.q-textarea-toolbar li.heading.h"+i+", ul.q-textarea-toolbar li.option.h"+i+":hover","background-position: -"+(540+i*30)+"px -30px;");this.addCss("ul.q-textarea-toolbar li.heading.h"+i+".inactive","background-position: -"+(540+i*30)+"px -60px;");this.addCss("ul.q-textarea-toolbar.small li.option.h"+i,"background-position: -"+(360+i*20)+"px 0px;");this.addCss("ul.q-textarea-toolbar.small li.heading.h"+i+", ul.q-textarea-toolbar.small li.option.h"+i+":hover","background-position: -"+(360+i*20)+"px -20px;");this.addCss("ul.q-textarea-toolbar.small li.heading.h"+i+".inactive","background-position: -"+(360+i*20)+"px -40px;");}).bind(this));break;case"window":this.addCss("div.q-window","z-index:99996;font-size:12px;");this.addCss("div.q-window div.q-content","overflow:hidden;");this.addCss("div.q-window div.q-window-close","position:absolute;width:24px;height:24px;right:0px;top:0px;z-index:100;cursor:pointer;background-position:-24px -168px;background-image:url("+Q.imagePath_h+");");this.addCss("div.q-window div.q-window-close.q-left","left:0px;right:auto;");this.addCss("div.q-window div.q-window-resize","position:absolute;width:24px;height:24px;right:6px;bottom:5px;z-index:101;cursor:move;background-position:-72px -168px;background-image:url("+Q.imagePath_h+");");this.addCss("div.q-plain div.q-window-resize","background-position:-96px -168px;");this.addCss("div.q-window div.q-window-title","position:absolute;width:100%;height:24px;left:0px;top:6px;");this.addCss("div.q-window div.q-window-title p.q-window-label","height:100%;margin:6px 25px 0 25px;font-size: 1.2em; font-weight:bold;text-align:center;");this.addCss("div.q-window div.q-buttons-wrapper","position:relative;height:30px;")
this.addCss("div.q-window div.q-buttons-wrapper input.q-button","width:100px;height:30px;cursor:pointer;-moz-border-radius:3px;-webkit-border-radius:3px;border:0px solid #fff;font-size:12px;font-weight:bold;background-color:#ccc;background: transparent url(/skin/frontend/uaudio/uaudio/images/common/btn1_bg.gif) repeat-x scroll 0 0;");this.addCss("div.q-window input.q-button:hover","background-color:#999;");this.addCss("div.q-window div.q-buttons-wrapper input.q-next-button","color:#FFF;float:right;margin-right:10px;");if(!Prototype.Browser.IE){this.addCss("div.q-window input.q-next-button:hover","");}
this.addCss("div.q-window div.q-buttons-wrapper input.q-cancel-button","color:#FFF;float:left;margin-left:10px;display:block;");this.addCss("div.q-window textarea.q-textarea","width:94%;height:150px;resize:vertical;margin:0 3% 20px 3%;");break;}
this.cssDeclarations.push(plugin);},callback:function(method,self,value,state){switch(typeof self.options[method]){case'function':if(typeof state!='undefined')
self.options[method](value,state,self);else if(typeof value!='undefined')
self.options[method](value,self);else
self.options[method](self);break;case'string':(function(){eval(self.options[method]);}).bind(self)();break;}}};Q.Base=Class.create({initialize:function(input){this.options={};this.createWrapper();this.is_over=false;Q.instances.push(this);if(input)
this.input=$(input);},createWrapper:function(){if($("q_wrapper")){this.div=$("q_wrapper");}else{this.div=new Element("div",{id:"q_wrapper","class":"q-wrapper"});$(document.body).insert({bottom:this.div});}},createHolder:function(type){var holder=this.holder=new Element("div");if(this.options.div)
this.div=$(this.options.div);if(!type)
this.options.style||"plain";holder.addClassName("q-holder").setStyle(this.options.holderStyle).hide();holder.background=this.buildBackground(type);holder.insert(holder.background);this.div.insert(holder);if(!this.options.div)
this.positionHolder();this.holder.observe("mouseover",(function(){this.is_over=true;}).bind(this));this.holder.observe("mouseout",(function(){if(this.is_over)
this.input.focus();this.is_over=false;}).bind(this));this.input.observe("focus",(function(){this.show();}).bind(this));this.input.observe("blur",(function(){if(!this.is_over)this.hide();}).bind(this));return holder;},buildBackground:function(type){var table=new Element("table",{"class":"q-background"}),c=Q.imageTypes[type||"plain"],s=24,div,center;div=new Element("div").addClassName("q-background q-"+type);div.insert(new Element("div").addClassName("q-corner").setStyle({left:0,top:0,backgroundImage:"url("+Q.imagePath_h+")",backgroundPosition:-(c*s)+"px -144px"}));div.insert(new Element("div").addClassName("q-edge-spacer"));div.insert(new Element("div").addClassName("q-corner").setStyle({right:0,top:0,backgroundImage:"url("+Q.imagePath_h+")",backgroundPosition:-(c*s+12)+"px -144px"}));div.center=new Element("div").addClassName("q-content");div.insert(center=new Element("div").addClassName("q-center").setStyle({backgroundImage:"url("+Q["filler_path_"+type]+")"}).insert(new Element("div").addClassName("q-border").setStyle({left:"-12px",top:"0px",backgroundImage:"url("+Q.imagePath_v+")",backgroundPosition:-(c*s)+"px 0"})).insert(new Element("div").addClassName("q-border").setStyle({right:"-12px",top:"0px",backgroundImage:"url("+Q.imagePath_v+")",backgroundPosition:-(c*s+12)+"px 0"})).insert(new Element("div").addClassName("q-edge").setStyle({top:"-12px",backgroundImage:"url("+Q.imagePath_h+")",backgroundPosition:"0 "+-(c*s)+"px"})).insert(new Element("div").addClassName("q-edge").setStyle({bottom:"-12px",backgroundImage:"url("+Q.imagePath_h+")",backgroundPosition:"0 "+-(c*s+11)+"px"})).insert(new Element("div").addClassName("q-top-spacer")));if(Prototype.Browser.IE)
center.insert(new Element("div").addClassName("q-top-spacer"))
center.insert(div.center)
div.insert(new Element("div").addClassName("q-corner").setStyle({left:0,bottom:0,backgroundImage:"url("+Q.imagePath_h+")",backgroundPosition:-(c*s)+"px -155px"}));div.insert(new Element("div").addClassName("q-edge-spacer"));div.insert(new Element("div").addClassName("q-corner").setStyle({right:0,bottom:0,backgroundImage:"url("+Q.imagePath_h+")",backgroundPosition:-(c*s+12)+"px -155px"}));div.insert=function(content,options){this.center.insert(content,options);return this;}
div.update=function(content){this.center.update(content);return this;}
return div;},positionHolder:function(){if(this.holder&&typeof this.input!="undefined"){var pos=this.input.cumulativeOffset(),dim=this.input.getDimensions(),doc=document.viewport.getDimensions(),left=pos[0],top=pos[1]+dim.height,x=this.options.left,y=this.options.top;if(this.options.axis=="vertical"){left=pos[0]+dim.width;top=pos[1];}
if(x==0||parseInt(x))
left+=parseInt(x);if(left+this.holder.getWidth()>doc.width)
left=doc.width-this.holder.getWidth()-5;if(y==0||parseInt(y))
top+=parseInt(y);this.holder.setStyle({left:left+"px",top:top+"px"});}},show:function(force){if(Q.active!=this||force){this.positionHolder();if(typeof this.setValue=="function"&&this.input)
this.setValue(this.input.value);Q.callback('onShow',this);Q.active=this;this.holder.appear({duration:0.1});}},hide:function(force){if(Q.active||force){Q.active=false;if(force){this.is_over=false;this.holder.hide();}else{this.holder.fade({duration:0.05});}
if(this.input)
this.input.blur();Q.callback('onHide',this);}},close:function(){this.hide(true);Q.callback('onClose',this);}});Q.Cookies=Class.create({initialize:function(options){this.options={expires:3600,path:'',domain:'',secure:false,prefix:'Q_'};$H(this.options).merge(options||{}).toObject();if(this.options.expires!=''){var date=new Date();date=new Date(date.getTime()+(this.options.expires*1000));this.options.expires='; expires='+date.toGMTString();}
if(this.options.path!='')
this.options.path='; path='+escape(this.options.path);if(this.options.domain!='')
this.options.domain='; domain='+escape(this.options.domain);if(this.options.secure==true)
this.options.secure='; secure';else
this.options.secure='';},create:function(name,value){var cookie_string,cookie=this.options;name=this.options.prefix+name;switch(typeof value){case'undefined':case'function':case'unknown':return false;case'boolean':case'string':case'number':value=String(value.toString());}
cookie_string=name+"="+escape(Object.toJSON(value));try{document.cookie=cookie_string+cookie.expires+cookie.path+cookie.domain+cookie.secure;}catch(e){return false;}
return true;},remove:function(name){var cookie=this.options,date,expires;name=this.options.prefix+name;try{date=new Date();date.setTime(date.getTime()-(3600*1000));expires='; expires='+date.toGMTString();document.cookie=name+"="+expires+cookie.path+cookie.domain+cookie.secure;}catch(e){return false;}
return true;},get:function(name){name=this.options.prefix+name;var cookies=document.cookie.match(name+'=(.*?)(;|$)');if(cookies){return(unescape(cookies[1])).evalJSON();}else{return null;}},clear:function(){this.names().each((function(key){this.remove(key);}).bind(this));},all:function(){var cookies={};this.names().each((function(key,i){cookies[key]=this.get(key);}).bind(this));return cookies;},names:function(){var keys=[],key_format=/[^=; ]+(?=\=)/g,raw_string=document.cookie,reg_exp=new RegExp("^"+this.options.prefix);while((match=key_format.exec(raw_string))!=undefined){if(reg_exp.test(match[0].strip()))
keys.push(match[0].strip().gsub("^"+this.options.prefix,""));}
return keys;}});Q.I18n={locale:"en",locales:{},add:function(locales){if(typeof locales=="string"&&locales.isJSON())
locales=locales.evalJSON();this.locales=$H(this.locales).merge(locales).toObject();},t:function(key,interpolations){var loc=this.locales,list;key.split(".").each((function(k){if(loc[k])
loc=loc[k];}).bind(this));if(typeof loc=='object'){if(interpolations&&interpolations.fallback){return interpolations.fallback;}else{list=key.split(".");list.unshift(this.locale);return"translation missing: "+list.join(", ");}}else if(typeof loc=="string"&&typeof interpolations=="object"){$H(interpolations).each(function(pair){loc=loc.gsub(new RegExp("\{\{([ ]+)?"+pair.key+"([ ]+)?\}\}"),pair.value)});return loc;}else{return loc;}}}
Object.extend(window,{observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()});(document.onresize?document:window).observe("resize",function(){if(!document.viewport.is_resized){document.viewport.is_resized=true;document.fire("resize:start");var resizeEnd=(function(){document.viewport.is_resized=false;document.fire("resize:end");Event.stopObserving(document,"mousemove",resizeEnd);}).bind(this);document.observe("mousemove",resizeEnd);}});Object.extend(String.prototype,{toMD5:function(){var string=this;function RotateLeft(lValue,iShiftBits){return(lValue<<iShiftBits)|(lValue>>>(32-iShiftBits));}
function AddUnsigned(lX,lY){var lX4,lY4,lX8,lY8,lResult;lX8=(lX&0x80000000);lY8=(lY&0x80000000);lX4=(lX&0x40000000);lY4=(lY&0x40000000);lResult=(lX&0x3FFFFFFF)+(lY&0x3FFFFFFF);if(lX4&lY4){return(lResult^0x80000000^lX8^lY8);}
if(lX4|lY4){if(lResult&0x40000000){return(lResult^0xC0000000^lX8^lY8);}else{return(lResult^0x40000000^lX8^lY8);}}else{return(lResult^lX8^lY8);}}
function F(x,y,z){return(x&y)|((~x)&z);}
function G(x,y,z){return(x&z)|(y&(~z));}
function H(x,y,z){return(x^y^z);}
function I(x,y,z){return(y^(x|(~z)));}
function FF(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(F(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);};function GG(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(G(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);};function HH(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(H(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);};function II(a,b,c,d,x,s,ac){a=AddUnsigned(a,AddUnsigned(AddUnsigned(I(b,c,d),x),ac));return AddUnsigned(RotateLeft(a,s),b);};function ConvertToWordArray(string){var lWordCount;var lMessageLength=string.length;var lNumberOfWords_temp1=lMessageLength+8;var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1%64))/64;var lNumberOfWords=(lNumberOfWords_temp2+1)*16;var lWordArray=Array(lNumberOfWords-1);var lBytePosition=0;var lByteCount=0;while(lByteCount<lMessageLength){lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=(lWordArray[lWordCount]|(string.charCodeAt(lByteCount)<<lBytePosition));lByteCount++;}
lWordCount=(lByteCount-(lByteCount%4))/4;lBytePosition=(lByteCount%4)*8;lWordArray[lWordCount]=lWordArray[lWordCount]|(0x80<<lBytePosition);lWordArray[lNumberOfWords-2]=lMessageLength<<3;lWordArray[lNumberOfWords-1]=lMessageLength>>>29;return lWordArray;};function WordToHex(lValue){var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;for(lCount=0;lCount<=3;lCount++){lByte=(lValue>>>(lCount*8))&255;WordToHexValue_temp="0"+lByte.toString(16);WordToHexValue=WordToHexValue+WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);}
return WordToHexValue;};function Utf8Encode(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;};var x=Array();var k,AA,BB,CC,DD,a,b,c,d;var S11=7,S12=12,S13=17,S14=22;var S21=5,S22=9,S23=14,S24=20;var S31=4,S32=11,S33=16,S34=23;var S41=6,S42=10,S43=15,S44=21;string=Utf8Encode(string);x=ConvertToWordArray(string);a=0x67452301;b=0xEFCDAB89;c=0x98BADCFE;d=0x10325476;for(k=0;k<x.length;k+=16){AA=a;BB=b;CC=c;DD=d;a=FF(a,b,c,d,x[k+0],S11,0xD76AA478);d=FF(d,a,b,c,x[k+1],S12,0xE8C7B756);c=FF(c,d,a,b,x[k+2],S13,0x242070DB);b=FF(b,c,d,a,x[k+3],S14,0xC1BDCEEE);a=FF(a,b,c,d,x[k+4],S11,0xF57C0FAF);d=FF(d,a,b,c,x[k+5],S12,0x4787C62A);c=FF(c,d,a,b,x[k+6],S13,0xA8304613);b=FF(b,c,d,a,x[k+7],S14,0xFD469501);a=FF(a,b,c,d,x[k+8],S11,0x698098D8);d=FF(d,a,b,c,x[k+9],S12,0x8B44F7AF);c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);a=FF(a,b,c,d,x[k+12],S11,0x6B901122);d=FF(d,a,b,c,x[k+13],S12,0xFD987193);c=FF(c,d,a,b,x[k+14],S13,0xA679438E);b=FF(b,c,d,a,x[k+15],S14,0x49B40821);a=GG(a,b,c,d,x[k+1],S21,0xF61E2562);d=GG(d,a,b,c,x[k+6],S22,0xC040B340);c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);b=GG(b,c,d,a,x[k+0],S24,0xE9B6C7AA);a=GG(a,b,c,d,x[k+5],S21,0xD62F105D);d=GG(d,a,b,c,x[k+10],S22,0x2441453);c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);b=GG(b,c,d,a,x[k+4],S24,0xE7D3FBC8);a=GG(a,b,c,d,x[k+9],S21,0x21E1CDE6);d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);c=GG(c,d,a,b,x[k+3],S23,0xF4D50D87);b=GG(b,c,d,a,x[k+8],S24,0x455A14ED);a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);d=GG(d,a,b,c,x[k+2],S22,0xFCEFA3F8);c=GG(c,d,a,b,x[k+7],S23,0x676F02D9);b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);a=HH(a,b,c,d,x[k+5],S31,0xFFFA3942);d=HH(d,a,b,c,x[k+8],S32,0x8771F681);c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);a=HH(a,b,c,d,x[k+1],S31,0xA4BEEA44);d=HH(d,a,b,c,x[k+4],S32,0x4BDECFA9);c=HH(c,d,a,b,x[k+7],S33,0xF6BB4B60);b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);d=HH(d,a,b,c,x[k+0],S32,0xEAA127FA);c=HH(c,d,a,b,x[k+3],S33,0xD4EF3085);b=HH(b,c,d,a,x[k+6],S34,0x4881D05);a=HH(a,b,c,d,x[k+9],S31,0xD9D4D039);d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);b=HH(b,c,d,a,x[k+2],S34,0xC4AC5665);a=II(a,b,c,d,x[k+0],S41,0xF4292244);d=II(d,a,b,c,x[k+7],S42,0x432AFF97);c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);b=II(b,c,d,a,x[k+5],S44,0xFC93A039);a=II(a,b,c,d,x[k+12],S41,0x655B59C3);d=II(d,a,b,c,x[k+3],S42,0x8F0CCC92);c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);b=II(b,c,d,a,x[k+1],S44,0x85845DD1);a=II(a,b,c,d,x[k+8],S41,0x6FA87E4F);d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);c=II(c,d,a,b,x[k+6],S43,0xA3014314);b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);a=II(a,b,c,d,x[k+4],S41,0xF7537E82);d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);c=II(c,d,a,b,x[k+2],S43,0x2AD7D2BB);b=II(b,c,d,a,x[k+9],S44,0xEB86D391);a=AddUnsigned(a,AA);b=AddUnsigned(b,BB);c=AddUnsigned(c,CC);d=AddUnsigned(d,DD);}
var temp=WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);return temp.toLowerCase();},HTMLencode:function(){var str=this.replace(/&/g,"&amp;");str=str.replace(/>/g,"&gt;");str=str.replace(/</g,"&lt;");str=str.replace(/"/g,"&quot;");str=str.replace(/'/g,"&#039;");return str;},HTMLdecode:function(){var str=this.replace(/&amp;/g,"&");str=str.replace(/&gt;/g,">");str=str.replace(/&lt;/g,"<");str=str.replace(/&quot;/g,"\"");str=str.replace(/&#039;/g,"'");return str;},humanize:function(){return this.underscore().capitalize().gsub(/(_id)|\-|\.|_/,' ');}});Object.extend(Number.prototype,{toMD5:function(){return this.toString().toMD5();},withFormat:function(options){var prefix=options.prefix||'',delimiter=options.delimiter||'',separator=options.separator||'',suffix=options.suffix||'',precision=options.precision,parts,number=this;if(typeof precision=='number')
number=number.toFixed(precision);parts=number.toString().split('.');parts[0]=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+delimiter);return prefix+parts.join(separator)+suffix;}});Q.addDynamicStylesheetMethodsTo=function(doc){if(typeof doc.createStyleSheet=='undefined'){doc.createStyleSheet=(function(){function createStyleSheet(href){if(typeof href!=='undefined'){var element=doc.createElement('link');element.type='text/css';element.rel='stylesheet';element.href=href;}
else{var element=doc.createElement('style');element.type='text/css';}
doc.getElementsByTagName('head')[0].appendChild(element);var sheet=doc.styleSheets[doc.styleSheets.length-1];if(typeof sheet.addRule==='undefined')
sheet.addRule=addRule;if(typeof sheet.removeRule==='undefined')
sheet.removeRule=sheet.deleteRule;return sheet;}
function addRule(selectorText,cssText,index){if(typeof index==='undefined')
index=this.cssRules.length;this.insertRule(selectorText+' {'+cssText+'}',index);}
return createStyleSheet;})();}}
document.observe("dom:loaded",function(){document.observe("resize:start",function(){Q.hide();});document.observe("resize:end",function(){Q.reposition();});Q.setup();});
if(typeof Q=='undefined')
alert("Q is not loaded. Please make sure that your page includes q.js before it includes q.window.js");Q.Window=Class.create(Q.Base,{initialize:function($super,options){$super();this.persistent=false;if(typeof options=="string"&&options.isJSON())
options=options.evalJSON();this.options=$H(this.options).merge({style:'dark',position:'fixed',draggable:true,closeButton:'right',left:50,top:50,minWidth:300,minHeight:50,maxWidth:3000,maxHeight:3000,hide:false}).merge(options).toObject();if(this.options.position=="static"||this.options.position=="inherit")
this.options.position="relative";Q.addCssFor('window');Q.register('window');this.build();},build:function(){var win,close,resize,title,label,background,source;win=this.holder=new Element("div");if(this.options.id)
win.id=this.options.id;if(this.options.div)
this.div=$(this.options.div);win.addClassName("q-window q-"+this.options.style).setStyle({position:this.options.position,left:parseInt(this.options.left)+"px",top:parseInt(this.options.top)+"px"}).hide();if(this.options.closeButton){close=new Element("div").addClassName("q-window-close");if(this.options.closeButton=='left')
close.addClassName("q-left");close.onclick=(function(){this.hide(true);if(this.protection)this.protection.fade({duration:0.01});}).bind(this);win.insert(close);}
background=this.buildBackground(this.options.style);win.insert(background);win.content=new Element("div");background.center.insert(win.content)
win.center=background.center;if(this.options.resizable){resize=new Element("div").addClassName("q-window-resize");win.insert(resize);resize.observe("mousedown",(function(event){event.preventDefault?event.preventDefault():event.returnValue=false;resize.resizing=true;var size={width:win.down(".q-content").getWidth(),height:win.down(".q-content").getHeight()}
Q.callback('onStartResize',this,size);Q.callback('onResize',this,size);}).bind(this));document.observe("mousemove",(function(event){if(resize.resizing){event.preventDefault?event.preventDefault():event.returnValue=false;var width=event.pointerX()-parseInt(win.getStyle("left"))-8,height=event.pointerY()-parseInt(win.getStyle("top"))-8,offset;if(this.options.position=="fixed"){offset=document.viewport.getScrollOffsets();width-=offset.left;height-=offset.top;}
if(this.validWidth(width))
win.down(".q-content").setStyle({width:width+"px"});if(this.validHeight(height))
win.down(".q-content").setStyle({height:height+"px"});Q.callback('onResize',this,{width:win.down(".q-content").getWidth(),height:win.down(".q-content").getHeight()});}}).bind(this));document.observe("mouseup",(function(){if(resize.resizing){resize.resizing=false;Q.callback('onEndResize',this,{width:win.down(".q-content").getWidth(),height:win.down(".q-content").getHeight()});}}).bind(this));}
title=new Element("div").addClassName("q-window-title");win.insert(title);if(this.options.draggable)
new Draggable(win,{handle:title,zindex:100000,onStart:(function(){Q.callback('onStartDrag',this);}).bind(this),onDrag:(function(){Q.callback('onDrag',this);}).bind(this),onEnd:(function(){Q.callback('onEndDrag',this);}).bind(this)});title.style.cursor="move";if(this.options.title){label=new Element("p").addClassName("q-window-label").update(this.options.title);title.insert(label);}
this.holder.observe("mouseup",(function(){this.restack();Q.callback('onFocus',this);}).bind(this));if(trigger=$(this.options.trigger)){trigger.observe("click",(function(){if(!this.visible())
this.onShow();}).bind(this));}else if(!this.options.hide){this.onShow();}
this.div.insert(win);this.initSize(win);if(this.options.source&&(source=$(this.options.source))){this.update(source.innerHTML);source.remove();}else{this.update(this.options.text);}},initSize:function(win){var width=300,height;if(this.options.width)
width=this.options.width;if(this.options.height)
height=this.options.height;if(parseInt(width))
width+="px";else
width="auto";if(parseInt(height))
height+="px";else
height="auto";win.center.setStyle({width:width,height:height,minWidth:this.options.minWidth+"px",minHeight:this.options.minHeight+"px",maxWidth:this.options.maxWidth+"px",maxHeight:this.options.maxHeight+"px"});},update:function(content){this.holder.content.update(new Element("div").setStyle({height:"10px"})).insert(content);return this;},insert:function(content,options){this.holder.content.insert(content,options);return this;},visible:function(){return this.holder.visible();},validWidth:function(value){if(this.options.minWidth&&value<this.options.minWidth)
return false;if(this.options.maxWidth&&value>this.options.maxWidth)
return false;return true;},validHeight:function(value){if(this.options.minHeight&&value<this.options.minHeight)
return false;if(this.options.maxHeight&&value>this.options.maxHeight)
return false;return true;},restack:function(){$("q_wrapper").select("div.q-window").each(function(win){win.style.zIndex=win.hasClassName("q-window-blocking")?99997:99995;});this.holder.style.zIndex=this.holder.hasClassName("q-window-blocking")?99998:99996;},onShow:function(){this.restack();this.show();}});Q.Alert=Class.create(Q.Window,{initialize:function($super,title,message,options){var dim=document.viewport.getDimensions()
options=$H({width:300,minHeight:30,draggable:false,closeButton:false,left:dim.width/2-(options&&options.width?options.width/2:150),top:dim.height/3-75,title:title,confirmLabel:"OK"}).merge(options||{}).toObject();$super(options);if(trigger=$(options.trigger)){trigger.observe("click",(function(){this.alert(title,message,options);}).bind(this));}else{this.alert(title,message,options);}},alert:function(title,message,options){var dim=document.viewport.getDimensions(),next,win,msg,wrapper,onConfirm;onConfirm=(function(){document.stopObserving("keydown",this.confirmWithEnter);document.stopObserving("keydown",this.cancelWithEscape);document.stopObserving("keydown",this.onWindowResize);this.hide();if(typeof this.textarea!='undefined')
Q.callback('onConfirm',this,this.textarea.value);else
Q.callback('onConfirm',this);this.remove();}).bind(this);this.confirmWithEnter=(function(event){if(event.keyCode==13){next.focus();onConfirm();}}).bind(this);document.observe("keydown",this.confirmWithEnter);this.onWindowResize=(function(){var dim=document.viewport.getDimensions();this.holder.setStyle({left:(dim.width/2-(options&&options.width?options.width/2:150))+'px',top:(dim.height/3-75)+'px'});}).bind(this);(document.onresize?document:window).observe("resize",this.onWindowResize);this.holder.addClassName("q-window-blocking").setStyle({zIndex:99998});this.protection=new Element("div").addClassName("q-protective-layer");this.div.insert({top:this.protection});this.protection.hide();next=new Element("input",{type:"button",value:options.confirmLabel});if(options.confirmClass){next.addClassName(options.confirmClass);}else{next.addClassName("q-button q-next-button");}
next.onclick=(function(){onConfirm();}).bind(this);wrapper=new Element("div").addClassName("q-buttons-wrapper");msg=new Element("div").setStyle({margin:"10px 10px 20px 10px"}).update(message);wrapper.insert(next);this.update(msg).insert(wrapper);this.persistent=true;this.show();this.protection.appear({duration:0.1,to:0.5});},remove:function(){this.protection.fade({duration:0.01});(function(){try{this.protection.remove();delete this;}catch(e){}}).bind(this).delay(0.2);}})
Q.Confirm=Class.create(Q.Alert,{initialize:function($super,title,message,options){options=$H({cancelLabel:"Cancel"}).merge(options||{}).toObject();$super(title,message,options);if(trigger=$(options.trigger)){trigger.observe("click",(function(){this.confirm(options);}).bind(this));}else{this.confirm(options);}},confirm:function(options){var cancel,clearer,onCancel;onCancel=(function(){document.stopObserving("keydown",this.confirmWithEnter);document.stopObserving("keydown",this.cancelWithEscape);document.stopObserving("keydown",this.onWindowResize);this.hide();Q.callback('onCancel',this);this.remove();}).bind(this);this.cancelWithEscape=(function(event){if(event.keyCode==27)
onCancel();}).bind(this);document.observe("keydown",this.cancelWithEscape);cancel=new Element("input",{type:"button",value:options.cancelLabel});if(options.cancelClass){cancel.addClassName(options.cancelClass);}else{cancel.addClassName("q-button q-cancel-button");}
cancel.onclick=(function(){onCancel();}).bind(this);this.holder.down("div.q-buttons-wrapper").insert({top:cancel});}});Q.Prompt=Class.create(Q.Confirm,{initialize:function($super,title,message,options){$super(title,message,options);if(trigger=$(options.trigger)){trigger.observe("click",(function(){this.prompt(options);}).bind(this));}else{this.prompt(options);}},prompt:function(options){this.textarea=new Element("textarea").addClassName("q-textarea").setValue(options.text)
this.holder.down("div.q-buttons-wrapper").insert({before:this.textarea});}});Q.Progress=Class.create(Q.Window,{initialize:function($super,title,message,options){var dim=document.viewport.getDimensions()
options=$H({width:300,minHeight:30,draggable:false,closeButton:false,left:dim.width/2-(options&&options.width?options.width/2:150),top:dim.height/3-75,title:title}).merge(options||{}).toObject();$super(options);if(trigger=$(options.trigger)){trigger.observe("click",(function(){this.alert(title,message,options);}).bind(this));}else{this.alert(title,message,options);}},alert:function(title,message,options){var dim=document.viewport.getDimensions(),win,msg,wrapper;this.onWindowResize=(function(){var dim=document.viewport.getDimensions();this.holder.setStyle({left:(dim.width/2-(options&&options.width?options.width/2:150))+'px',top:(dim.height/3-75)+'px'});}).bind(this);(document.onresize?document:window).observe("resize",this.onWindowResize);this.holder.addClassName("q-window-blocking").setStyle({zIndex:99998});this.protection=new Element("div").addClassName("q-protective-layer");this.div.insert({top:this.protection});this.protection.hide();wrapper=new Element("div").addClassName("q-buttons-wrapper");msg=new Element("div").setStyle({margin:"10px 10px 20px 10px"}).update(message);wrapper.insert('<div style="text-align: center;"><img src="'+Q.imagePath+'/'+Q.style+'-progress.gif" style="width: 90%; height: 10px;" /></div>');this.msg=msg;this.update(msg).insert(wrapper);this.persistent=true;this.show();this.protection.appear({duration:0.1,to:0.5});},updateMessage:function(msg){this.msg.update(msg);return this;},remove:function(){this.protection.fade({duration:0.01});this.hide();(function(){try{this.protection.remove();delete this;}catch(e){}}).bind(this).delay(0.2);}});Q.Message=Class.create(Q.Window,{initialize:function($super,title,message,options){var dim=document.viewport.getDimensions()
options=$H({width:300,minHeight:30,draggable:false,left:dim.width/2-(options&&options.width?options.width/2:150),top:dim.height/3-75,title:title}).merge(options||{}).toObject();$super(options);if(trigger=$(options.trigger)){trigger.observe("click",(function(){this.alert(title,message,options);}).bind(this));}else{this.alert(title,message,options);}},alert:function(title,message,options){var dim=document.viewport.getDimensions(),win,msg,wrapper;this.onWindowResize=(function(){var dim=document.viewport.getDimensions();this.holder.setStyle({left:(dim.width/2-(options&&options.width?options.width/2:150))+'px',top:((document.viewport.getHeight()-this.holder.getHeight())/2-30).px()});}).bind(this);(document.onresize?document:window).observe("resize",this.onWindowResize);this.holder.addClassName("q-window-blocking").setStyle({zIndex:99998});this.protection=new Element("div").addClassName("q-protective-layer");this.div.insert({top:this.protection});this.protection.hide();msg=new Element("div").setStyle({margin:"10px",paddingTop:"5px"}).update(message);this.msg=msg;this.update(msg);this.persistent=true;this.holder.setStyle({top:((document.viewport.getHeight()-this.holder.getHeight())/2-30).px()});this.show();this.protection.appear({duration:0.1,to:0.5});},updateMessage:function(msg){this.msg.update(msg);return this;},remove:function(){this.hide(true);this.protection.fade({duration:0.01});(function(){try{this.protection.remove();delete this;}catch(e){}}).bind(this).delay(0.2);}});
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a}function GetSwfVer(){var g=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var f=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+f].description;var e=a.split(" ");var c=e[2].split(".");var h=c[0];var b=c[1];var d=e[3];if(d==""){d=e[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var g=h+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){g=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){g=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){g=2}else{if(isIE&&isWin&&!isOpera){g=ControlVersion()}}}}}return g}function DetectFlashVer(f,d,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var e=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(e>parseFloat(f)){return true}else{if(e==parseFloat(f)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}function AC_AddExtension(b,a){if(b.indexOf("?")!=-1){return b.replace(/\?/,a+"?")}else{return b+a}}function AC_Generateobj(e,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in e){c+=b+'="'+e[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}document.write(c)}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_SW_RunContent(){var a=AC_GetArgs(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(b,e,g,d,h){var a=new Object();a.embedAttrs=new Object();a.params=new Object();a.objAttrs=new Object();for(var c=0;c<b.length;c=c+2){var f=b[c].toLowerCase();switch(f){case"classid":break;case"pluginspage":a.embedAttrs[b[c]]=b[c+1];break;case"src":case"movie":b[c+1]=AC_AddExtension(b[c+1],e);a.embedAttrs.src=b[c+1];a.params[g]=b[c+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblclick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":a.objAttrs[b[c]]=b[c+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":a.embedAttrs[b[c]]=a.objAttrs[b[c]]=b[c+1];break;default:a.embedAttrs[b[c]]=a.params[b[c]]=b[c+1]}}a.objAttrs.classid=d;if(h){a.embedAttrs.type=h}return a};
Validation.defaultOptions.immediate=true;Validation.defaultOptions.addClassNameToContainer=true;Event.observe(document,"dom:loaded",function(){var b=$$("ul.options-list input");for(var c=0,a=b.length;c<a;c++){b[c].addClassName("change-container-classname")}});if(!window.Enterprise){window.Enterprise={}}Enterprise.templatesPattern=/(^|.|\r|\n)(\{\{(.*?)\}\})/;Enterprise.TopCart={initialize:function(a){this.container=$(a);this.element=this.container.up(0);this.elementHeader=this.container.previous(0);this.intervalDuration=4000;this.interval=null;this.onElementMouseOut=this.handleMouseOut.bindAsEventListener(this);this.onElementMouseOver=this.handleMouseOver.bindAsEventListener(this);this.onElementMouseClick=this.handleMouseClick.bindAsEventListener(this);this.element.observe("mouseout",this.onElementMouseOut);this.element.observe("mouseover",this.onElementMouseOver);this.elementHeader.observe("click",this.onElementMouseClick)},handleMouseOut:function(a){if($(this.elementHeader).hasClassName("expanded")){this.interval=setTimeout(this.hideCart.bind(this),this.intervalDuration)}},handleMouseOver:function(a){if(this.interval!==null){clearTimeout(this.interval);this.interval=null}},handleMouseClick:function(a){if(!$(this.elementHeader).hasClassName("expanded")&&!$(this.container.id).hasClassName("process")){this.showCart()}else{this.hideCart()}},showCart:function(a){this.container.parentNode.style.zIndex=992;new Effect.SlideDown(this.container.id,{duration:0.5,beforeStart:function(b){$(b.element.id).addClassName("process")},afterFinish:function(b){$(b.element.id).removeClassName("process")}});$(this.elementHeader).addClassName("expanded");if(a){this.timePeriod=a*1000;this.interval=setTimeout(this.hideCart.bind(this),this.timePeriod)}},hideCart:function(){if(!$(this.container.id).hasClassName("process")&&$(this.elementHeader).hasClassName("expanded")){new Effect.SlideUp(this.container.id,{duration:0.5,beforeStart:function(a){$(a.element.id).addClassName("process")},afterFinish:function(a){$(a.element.id).removeClassName("process");a.element.parentNode.style.zIndex=1}})}if(this.interval!==null){clearTimeout(this.interval);this.interval=null}$(this.elementHeader).removeClassName("expanded")}};Enterprise.Bundle={oldReloadPrice:false,initialize:function(){this.slider=$("bundleProduct");this.xOffset=$("bundle-product-wrapper").getDimensions().width},swapReloadPrice:function(){Enterprise.Bundle.oldReloadPrice=Product.Bundle.prototype.reloadPrice;Product.Bundle.prototype.reloadPrice=Enterprise.Bundle.reloadPrice;Product.Bundle.prototype.selection=Enterprise.Bundle.selection},reloadPrice:function(){var j=Enterprise.Bundle.oldReloadPrice.bind(this)();var d,c=null;if(d=$("bundle-product-wrapper").down(".price-box .price-as-configured")){if(c=$("bundle-product-wrapper").down(".duplicate-price-box .price-as-configured")){c.down(".price").update(d.down(".price").innerHTML)}}if(!this.summaryTemplate&&$("bundle-summary-template")){this.summaryTemplate=new Template($("bundle-summary-template").innerHTML,Enterprise.templatesPattern);this.optionTemplate=new Template($("bundle-summary-option-template").innerHTML,Enterprise.templatesPattern);this.optionMultiTemplate=new Template($("bundle-summary-option-multi-template").innerHTML,Enterprise.templatesPattern)}if(this.summaryTemplate&&$("bundle-summary")){var a="";for(var g in this.config.options){if(typeof(this.config.selected[g])!=="undefined"){var b="";for(var f=0,e=this.config.selected[g].length;f<e;f++){var h=this.selection(g,this.config.selected[g][f]);if(h&&this.config.options[g].isMulti){b+=this.optionMultiTemplate.evaluate(h)}else{if(h){b+=this.optionTemplate.evaluate(h)}}}if(b.length>0){a+=this.summaryTemplate.evaluate({label:this.config.options[g].title.escapeHTML(),options:b})}}}$("bundle-summary").update(a)}return j},selection:function(b,a){if(a==""||a=="none"){return false}var c=null;if(this.config.options[b].selections[a].customQty==1&&!this.config.options[b].isMulti){if($("bundle-option-"+b+"-qty-input")){c=$("bundle-option-"+b+"-qty-input").value}else{c=1}}else{c=this.config.options[b].selections[a].qty}return{qty:c,name:this.config.options[b].selections[a].name.escapeHTML()}},start:function(){if(!$("bundle-product-wrapper").hasClassName("moving-now")){new Effect.Move(this.slider,{x:-this.xOffset,y:0,mode:"relative",duration:1.5,beforeStart:function(a){$("bundle-product-wrapper").setStyle({height:$("productView").getHeight()+"px"});$("options-container").show();Enterprise.BundleSummary.initialize();$("bundle-product-wrapper").addClassName("moving-now")},afterFinish:function(a){$("bundle-product-wrapper").setStyle({height:"auto"});$("productView").hide();$("bundle-product-wrapper").removeClassName("moving-now")}})}},end:function(){if(!$("bundle-product-wrapper").hasClassName("moving-now")){new Effect.Move(this.slider,{x:this.xOffset,y:0,mode:"relative",duration:1.5,beforeStart:function(a){$("bundle-product-wrapper").setStyle({height:$("options-container").getHeight()+"px"});$("productView").show();$("bundle-product-wrapper").addClassName("moving-now")},afterFinish:function(a){$("bundle-product-wrapper").setStyle({height:"auto"});$("options-container").hide();Enterprise.BundleSummary.exitSummary();$("bundle-product-wrapper").removeClassName("moving-now")}})}}};Enterprise.BundleSummary={initialize:function(){this.summary=$("bundleSummary");this.summaryOffsetTop=$("customizeTitle").getDimensions().height;this.summary.setStyle({top:this.summaryOffsetTop+"px"});this.summaryContainer=this.summary.up(0);this.doNotCheck=false;this.summaryStartY=this.summary.positionedOffset().top;this.summaryStartY=this.summaryOffsetTop;this.summaryStartX=this.summary.positionedOffset().left;this.onDocScroll=this.handleDocScroll.bindAsEventListener(this);this.GetScroll=setInterval(this.onDocScroll,50);this.onEffectEnds=this.effectEnds.bind(this)},handleDocScroll:function(){if(this.currentOffsetTop==document.viewport.getScrollOffsets().top&&(this.checkOffset(null)==null)){return}else{if(this.currentOffsetTop==document.viewport.getScrollOffsets().top){this.doNotCheck=true}this.currentOffsetTop=document.viewport.getScrollOffsets().top}if(this.currentEffect){this.currentEffect.cancel();var a=0;if(this.summaryContainer.viewportOffset().top<-60){a=-(this.summaryContainer.viewportOffset().top)}else{a=this.summaryStartY}a=this.checkOffset(a);if(a===null){this.currentEffect=false;return}this.currentEffect.start({x:this.summaryStartX,y:a,mode:"absolute",duration:0.3,afterFinish:this.onEffectEnds});return}this.currentEffect=new Effect.Move(this.summary)},effectEnds:function(){if(this.doNotCheck==true){this.doNotCheck=false}},checkOffset:function(c){if(this.doNotCheck&&c===null){return null}var b=this.summary.getDimensions();var a=this.summary.up().getDimensions();if((c!==null?c:this.summary.offsetTop)+b.height>=a.height){c=a.height-b.height}else{if(c===null&&this.currentOffsetTop>(this.summaryContainer.viewportOffset().top)&&(this.currentOffsetTop-this.summaryContainer.viewportOffset().top)>this.summary.offsetTop){c=this.currentOffsetTop-this.summaryContainer.viewportOffset().top}}return c},exitSummary:function(){clearInterval(this.GetScroll)}};Enterprise.Tabs=Class.create();Object.extend(Enterprise.Tabs.prototype,{initialize:function(b){this.container=$(b);this.container.addClassName("tab-list");this.tabs=this.container.select("dt.tab");this.activeTab=this.tabs.first();this.tabs.first().addClassName("first");this.tabs.last().addClassName("last");this.onTabClick=this.handleTabClick.bindAsEventListener(this);for(var c=0,a=this.tabs.length;c<a;c++){this.tabs[c].observe("click",this.onTabClick)}this.select()},handleTabClick:function(a){this.activeTab=Event.findElement(a,"dt");this.select()},select:function(){for(var b=0,a=this.tabs.length;b<a;b++){if(this.tabs[b]==this.activeTab){this.tabs[b].addClassName("active");this.tabs[b].style.zIndex=this.tabs.length+2;this.tabs[b].next("dd").show();this.tabs[b].parentNode.style.height=this.tabs[b].next("dd").getHeight()+15+"px"}else{this.tabs[b].removeClassName("active");this.tabs[b].style.zIndex=this.tabs.length+1-b;this.tabs[b].next("dd").hide()}}}});Enterprise.Slider=Class.create();Object.extend(Enterprise.Slider.prototype,{initialize:function(a,b){this.container=$(a);this.config={panelCss:"slider-panel",sliderCss:"slider",itemCss:"slider-item",slideButtonCss:"slide-button",slideButtonInactiveCss:"inactive",forwardButtonCss:"forward",backwardButtonCss:"backward",pageSize:6,scrollSize:2,slideDuration:1,slideDirection:"horizontal",fadeEffect:true};Object.extend(this.config,b||{});this.items=this.container.select("."+this.config.itemCss);this.isPlaying=false;this.isAbsolutized=false;this.offset=0;this.onClick=this.handleClick.bindAsEventListener(this);this.sliderPanel=this.container.down("."+this.config.panelCss);this.slider=this.sliderPanel.down("."+this.config.sliderCss);this.container.select("."+this.config.slideButtonCss).each(this.initializeHandlers.bind(this));this.updateButtons();Event.observe(window,"load",this.initializeDimensions.bind(this))},initializeHandlers:function(a){if(a.hasClassName(this.config.forwardButtonCss)||a.hasClassName(this.config.backwardButtonCss)){a.observe("click",this.onClick)}},handleClick:function(a){var b=Event.element(a);if(!b.hasClassName(this.config.slideButtonCss)){b=b.up("."+this.config.slideButtonCss)}if(!b.hasClassName(this.config.slideButtonInactiveCss)){b.hasClassName(this.config.forwardButtonCss)||this.backward();b.hasClassName(this.config.backwardButtonCss)||this.forward()}Event.stop(a)},updateButtons:function(){var c=this.container.select("."+this.config.slideButtonCss);for(var b=0,a=c.length;b<a;b++){if(c[b].hasClassName(this.config.backwardButtonCss)){if(this.offset<=0){c[b].addClassName(this.config.slideButtonInactiveCss)}else{c[b].removeClassName(this.config.slideButtonInactiveCss)}}else{if(c[b].hasClassName(this.config.forwardButtonCss)){if(this.offset>=this.items.length-this.config.pageSize){c[b].addClassName(this.config.slideButtonInactiveCss)}else{c[b].removeClassName(this.config.slideButtonInactiveCss)}}}}},initializeDimensions:function(){if((this.config.slideDirection=="horizontal"&&this.sliderPanel.style.width)||(this.config.slideDirection!="horizontal"&&this.sliderPanel.style.height)){return this}var c=this.items.first();var d=0;if(this.config.slideDirection=="horizontal"){d=(parseInt(c.getStyle("margin-left"))+parseInt(c.getStyle("margin-right")))*(this.config.pageSize-1);this.sliderPanel.setStyle({width:(c.getDimensions().width*this.config.pageSize+d)+"px"})}else{d=(parseInt(c.getStyle("margin-bottom"))+parseInt(c.getStyle("margin-top")))*(this.config.pageSize-1);this.sliderPanel.setStyle({height:(c.getDimensions().height*this.config.pageSize+d)+"px"})}var b=this.sliderPanel.getDimensions();var a=this.sliderPanel.up();a.setStyle({width:b.width+"px",height:b.height+"px"});return this},absolutize:function(){if(!this.isAbsolutized){this.isAbsolutized=true;var a=this.sliderPanel.getDimensions();this.sliderPanel.setStyle({height:a.height+"px",width:a.width+"px"});this.slider.absolutize()}},forward:function(){if(this.offset+this.config.pageSize<=this.items.length-1){this.slide(true)}},backward:function(){if(this.offset>0){this.slide(false)}},slide:function(a){if(this.isPlaying){return}this.absolutize();this.effectConfig={duration:this.config.slideDuration};if(this.config.slideDirection=="horizontal"){this.effectConfig.x=this.getSlidePosition(a).left}else{this.effectConfig.y=this.getSlidePosition(a).top}this.start()},start:function(){if(this.config.fadeEffect){this.fadeIn()}else{this.move()}},fadeIn:function(){new Effect.Fade(this.slider.up("div.slider-panel"),{from:1,to:0.5,afterFinish:this.move.bind(this),beforeStart:this.effectStarts.bind(this),duration:0.3})},fadeOut:function(){new Effect.Fade(this.slider.up("div.slider-panel"),{from:0.5,to:1,afterFinish:this.effectEnds.bind(this),duration:0.3})},move:function(){if(this.config.fadeEffect){this.effectConfig.afterFinish=this.fadeOut.bind(this)}else{this.effectConfig.afterFinish=this.effectEnds.bind(this);this.effectConfig.beforeStart=this.effectStarts.bind(this)}new Effect.Move(this.slider,this.effectConfig)},effectStarts:function(){this.isPlaying=true},effectEnds:function(){this.isPlaying=false;this.updateButtons()},getSlidePosition:function(b){var d;if(b){d=Math.min(this.items.length-this.config.pageSize,this.offset+this.config.scrollSize)}else{d=Math.max(this.offset-this.config.scrollSize,0)}this.offset=d;var a=this.items[d];var c={left:0,top:0};c.left=-(a.cumulativeOffset().left-this.slider.cumulativeOffset().left+this.slider.offsetLeft);c.top=-(a.cumulativeOffset().top-this.slider.cumulativeOffset().top+this.slider.offsetTop);return c}});Enterprise.PopUpMenu={currentPopUp:null,documentHandlerInitialized:false,popUpZIndex:994,hideDelay:2000,hideOnClick:true,hideInterval:null,initializeDocumentHandler:function(){if(!this.documentHandlerInitialized){this.documentHandlerInitialized=true;Event.observe(document.body,"click",this.handleDocumentClick.bindAsEventListener(this))}},handleDocumentClick:function(a){if(this.currentPopUp!==null){var b=Event.element(a);if(!this.currentPopUp.onlyShowed&&this.hideOnClick){this.hide()}else{this.currentPopUp.onlyShowed=false}}},handlePopUpOver:function(a){if(this.currentPopUp!==null){this.currentPopUp.removeClassName("faded");this.resetTimeout(0)}},handlePopUpOut:function(a){if(this.currentPopUp!==null){this.currentPopUp.addClassName("faded");this.resetTimeout(1)}},show:function(b){this.initializeDocumentHandler();var a=$(b).up(".switch-wrapper");if(!$("popId-"+a.id)){return}if(this.currentPopUp!==null&&$("popId-"+a.id)!==this.currentPopUp){this.hide(true)}else{if(this.currentPopUp!==null&&this.currentPopUp===$("popId-"+a.id)){this.hide();return}}this.currentPopUp=$("popId-"+a.id);this.currentPopUp.container=a;this.currentPopUp.container.oldZIndex=this.currentPopUp.container.style.zIndex;this.currentPopUp.container.style.zIndex=this.popUpZIndex;new Effect.Appear(this.currentPopUp,{duration:0.3});if(!this.currentPopUp.isHandled){this.currentPopUp.observe("mouseover",this.handlePopUpOver.bindAsEventListener(this));this.currentPopUp.observe("mouseout",this.handlePopUpOut.bindAsEventListener(this));this.currentPopUp.isHandled=true}this.currentPopUp.onlyShowed=true;this.currentPopUp.container.down(".switcher").addClassName("list-opened");this.resetTimeout(2)},hide:function(){if(this.currentPopUp!==null){if(arguments.length==0){new Effect.Fade(this.currentPopUp,{duration:0.3})}else{this.currentPopUp.hide()}this.currentPopUp.container.style.zIndex=this.currentPopUp.container.oldZIndex;this.resetTimeout(0);this.currentPopUp.container.down(".switcher").removeClassName("list-opened");this.currentPopUp=null}},resetTimeout:function(a){if(this.hideTimeout!==null){clearTimeout(this.hideTimeout);this.hideTimeout=null}if(a){this.hideTimeout=setTimeout(this.hide.bind(this),this.hideDelay*a)}}};function popUpMenu(a){Enterprise.PopUpMenu.show(a)};
/*
 * Copyright (c) 2009 Simo Kinnunen.
 * Licensed under the MIT license.
 *
 * @version 1.09
 */
var Cufon=(function(){var m=function(){return m.replace.apply(null,arguments)};var x=m.DOM={ready:(function(){var C=false,E={loaded:1,complete:1};var B=[],D=function(){if(C){return}C=true;for(var F;F=B.shift();F()){}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",D,false);window.addEventListener("pageshow",D,false)}if(!window.opera&&document.readyState){(function(){E[document.readyState]?D():setTimeout(arguments.callee,10)})()}if(document.readyState&&document.createStyleSheet){(function(){try{document.body.doScroll("left");D()}catch(F){setTimeout(arguments.callee,1)}})()}q(window,"load",D);return function(F){if(!arguments.length){D()}else{C?F():B.push(F)}}})(),root:function(){return document.documentElement||document.body}};var n=m.CSS={Size:function(C,B){this.value=parseFloat(C);this.unit=String(C).match(/[a-z%]*$/)[0]||"px";this.convert=function(D){return D/B*this.value};this.convertFrom=function(D){return D/this.value*B};this.toString=function(){return this.value+this.unit}},addClass:function(C,B){var D=C.className;C.className=D+(D&&" ")+B;return C},color:j(function(C){var B={};B.color=C.replace(/^rgba\((.*?),\s*([\d.]+)\)/,function(E,D,F){B.opacity=parseFloat(F);return"rgb("+D+")"});return B}),fontStretch:j(function(B){if(typeof B=="number"){return B}if(/%$/.test(B)){return parseFloat(B)/100}return{"ultra-condensed":0.5,"extra-condensed":0.625,condensed:0.75,"semi-condensed":0.875,"semi-expanded":1.125,expanded:1.25,"extra-expanded":1.5,"ultra-expanded":2}[B]||1}),getStyle:function(C){var B=document.defaultView;if(B&&B.getComputedStyle){return new a(B.getComputedStyle(C,null))}if(C.currentStyle){return new a(C.currentStyle)}return new a(C.style)},gradient:j(function(F){var G={id:F,type:F.match(/^-([a-z]+)-gradient\(/)[1],stops:[]},C=F.substr(F.indexOf("(")).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);for(var E=0,B=C.length,D;E<B;++E){D=C[E].split("=",2).reverse();G.stops.push([D[1]||E/(B-1),D[0]])}return G}),quotedList:j(function(E){var D=[],C=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,B;while(B=C.exec(E)){D.push(B[3]||B[1])}return D}),recognizesMedia:j(function(G){var E=document.createElement("style"),D,C,B;E.type="text/css";E.media=G;try{E.appendChild(document.createTextNode("/**/"))}catch(F){}C=g("head")[0];C.insertBefore(E,C.firstChild);D=(E.sheet||E.styleSheet);B=D&&!D.disabled;C.removeChild(E);return B}),removeClass:function(D,C){var B=RegExp("(?:^|\\s+)"+C+"(?=\\s|$)","g");D.className=D.className.replace(B,"");return D},supports:function(D,C){var B=document.createElement("span").style;if(B[D]===undefined){return false}B[D]=C;return B[D]===C},textAlign:function(E,D,B,C){if(D.get("textAlign")=="right"){if(B>0){E=" "+E}}else{if(B<C-1){E+=" "}}return E},textShadow:j(function(F){if(F=="none"){return null}var E=[],G={},B,C=0;var D=/(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;while(B=D.exec(F)){if(B[0]==","){E.push(G);G={};C=0}else{if(B[1]){G.color=B[1]}else{G[["offX","offY","blur"][C++]]=B[2]}}}E.push(G);return E}),textTransform:(function(){var B={uppercase:function(C){return C.toUpperCase()},lowercase:function(C){return C.toLowerCase()},capitalize:function(C){return C.replace(/\b./g,function(D){return D.toUpperCase()})}};return function(E,D){var C=B[D.get("textTransform")];return C?C(E):E}})(),whiteSpace:(function(){var D={inline:1,"inline-block":1,"run-in":1};var C=/^\s+/,B=/\s+$/;return function(H,F,G,E){if(E){if(E.nodeName.toLowerCase()=="br"){H=H.replace(C,"")}}if(D[F.get("display")]){return H}if(!G.previousSibling){H=H.replace(C,"")}if(!G.nextSibling){H=H.replace(B,"")}return H}})()};n.ready=(function(){var B=!n.recognizesMedia("all"),E=false;var D=[],H=function(){B=true;for(var K;K=D.shift();K()){}};var I=g("link"),J=g("style");function C(K){return K.disabled||G(K.sheet,K.media||"screen")}function G(M,P){if(!n.recognizesMedia(P||"all")){return true}if(!M||M.disabled){return false}try{var Q=M.cssRules,O;if(Q){search:for(var L=0,K=Q.length;O=Q[L],L<K;++L){switch(O.type){case 2:break;case 3:if(!G(O.styleSheet,O.media.mediaText)){return false}break;default:break search}}}}catch(N){}return true}function F(){if(document.createStyleSheet){return true}var L,K;for(K=0;L=I[K];++K){if(L.rel.toLowerCase()=="stylesheet"&&!C(L)){return false}}for(K=0;L=J[K];++K){if(!C(L)){return false}}return true}x.ready(function(){if(!E){E=n.getStyle(document.body).isUsable()}if(B||(E&&F())){H()}else{setTimeout(arguments.callee,10)}});return function(K){if(B){K()}else{D.push(K)}}})();function s(D){var C=this.face=D.face,B={"\u0020":1,"\u00a0":1,"\u3000":1};this.glyphs=D.glyphs;this.w=D.w;this.baseSize=parseInt(C["units-per-em"],10);this.family=C["font-family"].toLowerCase();this.weight=C["font-weight"];this.style=C["font-style"]||"normal";this.viewBox=(function(){var F=C.bbox.split(/\s+/);var E={minX:parseInt(F[0],10),minY:parseInt(F[1],10),maxX:parseInt(F[2],10),maxY:parseInt(F[3],10)};E.width=E.maxX-E.minX;E.height=E.maxY-E.minY;E.toString=function(){return[this.minX,this.minY,this.width,this.height].join(" ")};return E})();this.ascent=-parseInt(C.ascent,10);this.descent=-parseInt(C.descent,10);this.height=-this.ascent+this.descent;this.spacing=function(L,N,E){var O=this.glyphs,M,K,G,P=[],F=0,J=-1,I=-1,H;while(H=L[++J]){M=O[H]||this.missingGlyph;if(!M){continue}if(K){F-=G=K[H]||0;P[I]-=G}F+=P[++I]=~~(M.w||this.w)+N+(B[H]?E:0);K=M.k}P.total=F;return P}}function f(){var C={},B={oblique:"italic",italic:"oblique"};this.add=function(D){(C[D.style]||(C[D.style]={}))[D.weight]=D};this.get=function(H,I){var G=C[H]||C[B[H]]||C.normal||C.italic||C.oblique;if(!G){return null}I={normal:400,bold:700}[I]||parseInt(I,10);if(G[I]){return G[I]}var E={1:1,99:0}[I%100],K=[],F,D;if(E===undefined){E=I>400}if(I==500){I=400}for(var J in G){if(!k(G,J)){continue}J=parseInt(J,10);if(!F||J<F){F=J}if(!D||J>D){D=J}K.push(J)}if(I<F){I=F}if(I>D){I=D}K.sort(function(M,L){return(E?(M>=I&&L>=I)?M<L:M>L:(M<=I&&L<=I)?M>L:M<L)?-1:1});return G[K[0]]}}function r(){function D(F,G){if(F.contains){return F.contains(G)}return F.compareDocumentPosition(G)&16}function B(G){var F=G.relatedTarget;if(!F||D(this,F)){return}C(this,G.type=="mouseover")}function E(F){C(this,F.type=="mouseenter")}function C(F,G){setTimeout(function(){var H=d.get(F).options;m.replace(F,G?h(H,H.hover):H,true)},10)}this.attach=function(F){if(F.onmouseenter===undefined){q(F,"mouseover",B);q(F,"mouseout",B)}else{q(F,"mouseenter",E);q(F,"mouseleave",E)}}}function u(){var C=[],D={};function B(H){var E=[],G;for(var F=0;G=H[F];++F){E[F]=C[D[G]]}return E}this.add=function(F,E){D[F]=C.push(E)-1};this.repeat=function(){var E=arguments.length?B(arguments):C,F;for(var G=0;F=E[G++];){m.replace(F[0],F[1],true)}}}function A(){var D={},B=0;function C(E){return E.cufid||(E.cufid=++B)}this.get=function(E){var F=C(E);return D[F]||(D[F]={})}}function a(B){var D={},C={};this.extend=function(E){for(var F in E){if(k(E,F)){D[F]=E[F]}}return this};this.get=function(E){return D[E]!=undefined?D[E]:B[E]};this.getSize=function(F,E){return C[F]||(C[F]=new n.Size(this.get(F),E))};this.isUsable=function(){return !!B}}function q(C,B,D){if(C.addEventListener){C.addEventListener(B,D,false)}else{if(C.attachEvent){C.attachEvent("on"+B,function(){return D.call(C,window.event)})}}}function v(C,B){var D=d.get(C);if(D.options){return C}if(B.hover&&B.hoverables[C.nodeName.toLowerCase()]){b.attach(C)}D.options=B;return C}function j(B){var C={};return function(D){if(!k(C,D)){C[D]=B.apply(null,arguments)}return C[D]}}function c(F,E){var B=n.quotedList(E.get("fontFamily").toLowerCase()),D;for(var C=0;D=B[C];++C){if(i[D]){return i[D].get(E.get("fontStyle"),E.get("fontWeight"))}}return null}function g(B){return document.getElementsByTagName(B)}function k(C,B){return C.hasOwnProperty(B)}function h(){var C={},B,F;for(var E=0,D=arguments.length;B=arguments[E],E<D;++E){for(F in B){if(k(B,F)){C[F]=B[F]}}}return C}function o(E,M,C,N,F,D){var K=document.createDocumentFragment(),H;if(M===""){return K}var L=N.separate;var I=M.split(p[L]),B=(L=="words");if(B&&t){if(/^\s/.test(M)){I.unshift("")}if(/\s$/.test(M)){I.push("")}}for(var J=0,G=I.length;J<G;++J){H=z[N.engine](E,B?n.textAlign(I[J],C,J,G):I[J],C,N,F,D,J<G-1);if(H){K.appendChild(H)}}return K}function l(D,M){var C=D.nodeName.toLowerCase();if(M.ignore[C]){return}var E=!M.textless[C];var B=n.getStyle(v(D,M)).extend(M);var F=c(D,B),G,K,I,H,L,J;if(!F){return}for(G=D.firstChild;G;G=I){K=G.nodeType;I=G.nextSibling;if(E&&K==3){if(H){H.appendData(G.data);D.removeChild(G)}else{H=G}if(I){continue}}if(H){D.replaceChild(o(F,n.whiteSpace(H.data,B,H,J),B,M,G,D),H);H=null}if(K==1){if(G.firstChild){if(G.nodeName.toLowerCase()=="cufon"){z[M.engine](F,null,B,M,G,D)}else{arguments.callee(G,M)}}J=G}}}var t=" ".split(/\s+/).length==0;var d=new A();var b=new r();var y=new u();var e=false;var z={},i={},w={autoDetect:false,engine:null,forceHitArea:false,hover:false,hoverables:{a:true},ignore:{applet:1,canvas:1,col:1,colgroup:1,head:1,iframe:1,map:1,optgroup:1,option:1,script:1,select:1,style:1,textarea:1,title:1,pre:1},printable:true,selector:(window.Sizzle||(window.jQuery&&function(B){return jQuery(B)})||(window.dojo&&dojo.query)||(window.Ext&&Ext.query)||(window.YAHOO&&YAHOO.util&&YAHOO.util.Selector&&YAHOO.util.Selector.query)||(window.$$&&function(B){return $$(B)})||(window.$&&function(B){return $(B)})||(document.querySelectorAll&&function(B){return document.querySelectorAll(B)})||g),separate:"words",textless:{dl:1,html:1,ol:1,table:1,tbody:1,thead:1,tfoot:1,tr:1,ul:1},textShadow:"none"};var p={words:/\s/.test("\u00a0")?/[^\S\u00a0]+/:/\s+/,characters:"",none:/^/};m.now=function(){x.ready();return m};m.refresh=function(){y.repeat.apply(y,arguments);return m};m.registerEngine=function(C,B){if(!B){return m}z[C]=B;return m.set("engine",C)};m.registerFont=function(D){if(!D){return m}var B=new s(D),C=B.family;if(!i[C]){i[C]=new f()}i[C].add(B);return m.set("fontFamily",'"'+C+'"')};m.replace=function(D,C,B){C=h(w,C);if(!C.engine){return m}if(!e){n.addClass(x.root(),"cufon-active cufon-loading");n.ready(function(){n.addClass(n.removeClass(x.root(),"cufon-loading"),"cufon-ready")});e=true}if(C.hover){C.forceHitArea=true}if(C.autoDetect){delete C.fontFamily}if(typeof C.textShadow=="string"){C.textShadow=n.textShadow(C.textShadow)}if(typeof C.color=="string"&&/^-/.test(C.color)){C.textGradient=n.gradient(C.color)}else{delete C.textGradient}if(!B){y.add(D,arguments)}if(D.nodeType||typeof D=="string"){D=[D]}n.ready(function(){for(var F=0,E=D.length;F<E;++F){var G=D[F];if(typeof G=="string"){m.replace(C.selector(G),C,true)}else{l(G,C)}}});return m};m.set=function(B,C){w[B]=C;return m};return m})();Cufon.registerEngine("canvas",(function(){var b=document.createElement("canvas");if(!b||!b.getContext||!b.getContext.apply){return}b=null;var a=Cufon.CSS.supports("display","inline-block");var e=!a&&(document.compatMode=="BackCompat"||/frameset|transitional/i.test(document.doctype.publicId));var f=document.createElement("style");f.type="text/css";f.appendChild(document.createTextNode(("cufon{text-indent:0;}@media screen,projection{cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;"+(e?"":"font-size:1px;line-height:1px;")+"}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;overflow:hidden;text-indent:-10000in;}"+(a?"cufon canvas{position:relative;}":"cufon canvas{position:absolute;}")+"}@media print{cufon{padding:0;}cufon canvas{display:none;}}").replace(/;/g,"!important;")));document.getElementsByTagName("head")[0].appendChild(f);function d(p,h){var n=0,m=0;var g=[],o=/([mrvxe])([^a-z]*)/g,k;generate:for(var j=0;k=o.exec(p);++j){var l=k[2].split(",");switch(k[1]){case"v":g[j]={m:"bezierCurveTo",a:[n+~~l[0],m+~~l[1],n+~~l[2],m+~~l[3],n+=~~l[4],m+=~~l[5]]};break;case"r":g[j]={m:"lineTo",a:[n+=~~l[0],m+=~~l[1]]};break;case"m":g[j]={m:"moveTo",a:[n=~~l[0],m=~~l[1]]};break;case"x":g[j]={m:"closePath"};break;case"e":break generate}h[g[j].m].apply(h,g[j].a)}return g}function c(m,k){for(var j=0,h=m.length;j<h;++j){var g=m[j];k[g.m].apply(k,g.a)}}return function(V,w,P,t,C,W){var k=(w===null);if(k){w=C.getAttribute("alt")}var A=V.viewBox;var m=P.getSize("fontSize",V.baseSize);var B=0,O=0,N=0,u=0;var z=t.textShadow,L=[];if(z){for(var U=z.length;U--;){var F=z[U];var K=m.convertFrom(parseFloat(F.offX));var I=m.convertFrom(parseFloat(F.offY));L[U]=[K,I];if(I<B){B=I}if(K>O){O=K}if(I>N){N=I}if(K<u){u=K}}}var Z=Cufon.CSS.textTransform(w,P).split("");var E=V.spacing(Z,~~m.convertFrom(parseFloat(P.get("letterSpacing"))||0),~~m.convertFrom(parseFloat(P.get("wordSpacing"))||0));if(!E.length){return null}var h=E.total;O+=A.width-E[E.length-1];u+=A.minX;var s,n;if(k){s=C;n=C.firstChild}else{s=document.createElement("cufon");s.className="cufon cufon-canvas";s.setAttribute("alt",w);n=document.createElement("canvas");s.appendChild(n);if(t.printable){var S=document.createElement("cufontext");S.appendChild(document.createTextNode(w));s.appendChild(S)}}var aa=s.style;var H=n.style;var j=m.convert(A.height);var Y=Math.ceil(j);var M=Y/j;var G=M*Cufon.CSS.fontStretch(P.get("fontStretch"));var J=h*G;var Q=Math.ceil(m.convert(J+O-u));var o=Math.ceil(m.convert(A.height-B+N));n.width=Q;n.height=o;H.width=Q+"px";H.height=o+"px";B+=A.minY;H.top=Math.round(m.convert(B-V.ascent))+"px";H.left=Math.round(m.convert(u))+"px";var r=Math.max(Math.ceil(m.convert(J)),0)+"px";if(a){aa.width=r;aa.height=m.convert(V.height)+"px"}else{aa.paddingLeft=r;aa.paddingBottom=(m.convert(V.height)-1)+"px"}var X=n.getContext("2d"),D=j/A.height;X.scale(D,D*M);X.translate(-u,-B);X.save();function T(){var x=V.glyphs,ab,l=-1,g=-1,y;X.scale(G,1);while(y=Z[++l]){var ab=x[Z[l]]||V.missingGlyph;if(!ab){continue}if(ab.d){X.beginPath();if(ab.code){c(ab.code,X)}else{ab.code=d("m"+ab.d,X)}X.fill()}X.translate(E[++g],0)}X.restore()}if(z){for(var U=z.length;U--;){var F=z[U];X.save();X.fillStyle=F.color;X.translate.apply(X,L[U]);T()}}var q=t.textGradient;if(q){var v=q.stops,p=X.createLinearGradient(0,A.minY,0,A.maxY);for(var U=0,R=v.length;U<R;++U){p.addColorStop.apply(p,v[U])}X.fillStyle=p}else{X.fillStyle=P.get("color")}T();return s}})());Cufon.registerEngine("vml",(function(){var e=document.namespaces;if(!e){return}e.add("cvml","urn:schemas-microsoft-com:vml");e=null;var b=document.createElement("cvml:shape");b.style.behavior="url(#default#VML)";if(!b.coordsize){return}b=null;var h=(document.documentMode||0)<8;document.write(('<style type="text/css">cufoncanvas{text-indent:0;}@media screen{cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}cufoncanvas{position:absolute;text-align:left;}cufon{display:inline-block;position:relative;vertical-align:'+(h?"middle":"text-bottom")+";}cufon cufontext{position:absolute;left:-10000in;font-size:1px;}a cufon{cursor:pointer}}@media print{cufon cufoncanvas{display:none;}}</style>").replace(/;/g,"!important;"));function c(i,j){return a(i,/(?:em|ex|%)$|^[a-z-]+$/i.test(j)?"1em":j)}function a(l,m){if(m==="0"){return 0}if(/px$/i.test(m)){return parseFloat(m)}var k=l.style.left,j=l.runtimeStyle.left;l.runtimeStyle.left=l.currentStyle.left;l.style.left=m.replace("%","em");var i=l.style.pixelLeft;l.style.left=k;l.runtimeStyle.left=j;return i}function f(l,k,j,n){var i="computed"+n,m=k[i];if(isNaN(m)){m=k.get(n);k[i]=m=(m=="normal")?0:~~j.convertFrom(a(l,m))}return m}var g={};function d(p){var q=p.id;if(!g[q]){var n=p.stops,o=document.createElement("cvml:fill"),i=[];o.type="gradient";o.angle=180;o.focus="0";o.method="sigma";o.color=n[0][1];for(var m=1,l=n.length-1;m<l;++m){i.push(n[m][0]*100+"% "+n[m][1])}o.colors=i.join(",");o.color2=n[l][1];g[q]=o}return g[q]}return function(ac,G,Y,C,K,ad,W){var n=(G===null);if(n){G=K.alt}var I=ac.viewBox;var p=Y.computedFontSize||(Y.computedFontSize=new Cufon.CSS.Size(c(ad,Y.get("fontSize"))+"px",ac.baseSize));var y,q;if(n){y=K;q=K.firstChild}else{y=document.createElement("cufon");y.className="cufon cufon-vml";y.alt=G;q=document.createElement("cufoncanvas");y.appendChild(q);if(C.printable){var Z=document.createElement("cufontext");Z.appendChild(document.createTextNode(G));y.appendChild(Z)}if(!W){y.appendChild(document.createElement("cvml:shape"))}}var ai=y.style;var R=q.style;var l=p.convert(I.height),af=Math.ceil(l);var V=af/l;var P=V*Cufon.CSS.fontStretch(Y.get("fontStretch"));var U=I.minX,T=I.minY;R.height=af;R.top=Math.round(p.convert(T-ac.ascent));R.left=Math.round(p.convert(U));ai.height=p.convert(ac.height)+"px";var F=Y.get("color");var ag=Cufon.CSS.textTransform(G,Y).split("");var L=ac.spacing(ag,f(ad,Y,p,"letterSpacing"),f(ad,Y,p,"wordSpacing"));if(!L.length){return null}var k=L.total;var x=-U+k+(I.width-L[L.length-1]);var ah=p.convert(x*P),X=Math.round(ah);var O=x+","+I.height,m;var J="r"+O+"ns";var u=C.textGradient&&d(C.textGradient);var o=ac.glyphs,S=0;var H=C.textShadow;var ab=-1,aa=0,w;while(w=ag[++ab]){var D=o[ag[ab]]||ac.missingGlyph,v;if(!D){continue}if(n){v=q.childNodes[aa];while(v.firstChild){v.removeChild(v.firstChild)}}else{v=document.createElement("cvml:shape");q.appendChild(v)}v.stroked="f";v.coordsize=O;v.coordorigin=m=(U-S)+","+T;v.path=(D.d?"m"+D.d+"xe":"")+"m"+m+J;v.fillcolor=F;if(u){v.appendChild(u.cloneNode(false))}var ae=v.style;ae.width=X;ae.height=af;if(H){var s=H[0],r=H[1];var B=Cufon.CSS.color(s.color),z;var N=document.createElement("cvml:shadow");N.on="t";N.color=B.color;N.offset=s.offX+","+s.offY;if(r){z=Cufon.CSS.color(r.color);N.type="double";N.color2=z.color;N.offset2=r.offX+","+r.offY}N.opacity=B.opacity||(z&&z.opacity)||1;v.appendChild(N)}S+=L[aa++]}var M=v.nextSibling,t,A;if(C.forceHitArea){if(!M){M=document.createElement("cvml:rect");M.stroked="f";M.className="cufon-vml-cover";t=document.createElement("cvml:fill");t.opacity=0;M.appendChild(t);q.appendChild(M)}A=M.style;A.width=X;A.height=af}else{if(M){q.removeChild(M)}}ai.width=Math.max(Math.ceil(p.convert(k*P)),0);if(h){var Q=Y.computedYAdjust;if(Q===undefined){var E=Y.get("lineHeight");if(E=="normal"){E="1em"}else{if(!isNaN(E)){E+="em"}}Y.computedYAdjust=Q=0.5*(a(ad,E)-parseFloat(ai.height))}if(Q){ai.marginTop=Math.ceil(Q)+"px";ai.marginBottom=Q+"px"}}return y}})());
(function(){function g(o){console.log("$f.fireEvent",[].slice.call(o))}function k(q){if(!q||typeof q!="object"){return q}var o=new q.constructor();for(var p in q){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}return o}function m(t,q){if(!t){return}var o,p=0,r=t.length;if(r===undefined){for(o in t){if(q.call(t[o],o,t[o])===false){break}}}else{for(var s=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}return t}function c(o){return document.getElementById(o)}function i(q,p,o){if(typeof p!="object"){return q}if(q&&p){m(p,function(r,s){if(!o||typeof s!="function"){q[r]=s}})}return q}function n(s){var q=s.indexOf(".");if(q!=-1){var p=s.slice(0,q)||"*";var o=s.slice(q+1,s.length);var r=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});return r}}function f(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}return false}function j(q,o,p){q[o]=q[o]||[];q[o].push(p)}function e(){return"_"+(""+Math.random()).slice(2,10)}var h=function(t,r,s){var q=this,p={},u={};q.index=r;if(typeof t=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var v="on"+this;if(v.indexOf("*")!=-1){v=v.slice(0,v.length-1);var w="onBefore"+v.slice(2);q[w]=function(x){j(u,w,x);return q}}q[v]=function(x){j(u,v,x);return q};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];return q}if(typeof x=="number"){x=[x]}var v=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}return q},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}var v=s.getConfig();var x=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});return false}A=A||q;if(v=="onCuepoint"){var z=p[y];if(z){return z[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}var x=true;m(u[v],function(){x=this.call(s,A,y,w)});return x}});if(t.onCuepoint){var o=t.onCuepoint;q.onCuepoint.apply(q,typeof o=="function"?[o]:o);delete t.onCuepoint}m(t,function(v,w){if(typeof w=="function"){j(u,v,w);delete t[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};var l=function(p,r,q,t){var o=this,s={},u=false;if(t){i(s,t)}m(r,function(v,w){if(typeof w=="function"){s[v]=w;delete r[v]}});i(this,{animate:function(y,z,x){if(!y){return o}if(typeof z=="function"){x=z;z=500}if(typeof y=="string"){var w=y;y={};y[w]=z;z=500}if(x){var v=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);return o},css:function(w,x){if(x!==undefined){var v={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);return o},show:function(){this.display="block";q._api().fp_showPlugin(p);return o},hide:function(){this.display="none";q._api().fp_hidePlugin(p);return o},toggle:function(){this.display=q._api().fp_togglePlugin(p);return o},fadeTo:function(y,x,w){if(typeof x=="function"){w=x;x=500}if(w){var v=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;return o},fadeIn:function(w,v){return o.fadeTo(1,w,v)},fadeOut:function(w,v){return o.fadeTo(0,w,v)},getName:function(){return p},getPlayer:function(){return q},_fireEvent:function(w,v,x){if(w=="onUpdate"){var y=q._api().fp_getPlugin(p);if(!y){return}i(o,y);delete o.methods;if(!u){m(y.methods,function(){var A=""+this;o[A]=function(){var B=[].slice.call(arguments);var C=q._api().fp_invoke(p,A,B);return C==="undefined"||C===undefined?o:C}});u=true}}var z=s[w];if(z){z.apply(o,v);if(w.slice(0,1)=="_"){delete s[w]}}return o}})};function b(q,G,t){var w=this,v=null,D=false,u,s,F=[],y={},x={},E,r,p,C,o,A;i(w,{id:function(){return E},isLoaded:function(){return(v!==null&&!D)},getParent:function(){return q},hide:function(H){if(H){q.style.height="0px"}if(w.isLoaded()){v.style.height="0px"}return w},show:function(){q.style.height=A+"px";if(w.isLoaded()){v.style.height=o+"px"}return w},isHidden:function(){return w.isLoaded()&&parseInt(v.style.height,10)===0},load:function(J){if(!w.isLoaded()&&w._fireEvent("onBeforeLoad")!==false){var H=function(){u=q.innerHTML;if(u&&!flashembed.isSupported(G.version)){q.innerHTML=""}flashembed(q,G,{config:t});if(J){J.cached=true;j(x,"onLoad",J)}};var I=0;m(a,function(){this.unload(function(K){if(++I==a.length){H()}})})}return w},unload:function(J){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent)){if(J){J(false)}return w}if(u.replace(/\s/g,"")!==""){if(w._fireEvent("onBeforeUnload")===false){if(J){J(false)}return w}D=true;try{if(v){v.fp_close();w._fireEvent("onUnload")}}catch(H){}var I=function(){v=null;try{q.innerHTML=u}catch(K){}D=false;if(J){J(true)}};setTimeout(I,50)}else{if(J){J(false)}}return w},getClip:function(H){if(H===undefined){H=C}return F[H]},getCommonClip:function(){return s},getPlaylist:function(){return F},getPlugin:function(H){var J=y[H];if(!J&&w.isLoaded()){var I=w._api().fp_getPlugin(H);if(I){J=new l(H,I,w);y[H]=J}}return J},getScreen:function(){return w.getPlugin("screen")},getControls:function(){return w.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return w.getPlugin("logo")._fireEvent("onUpdate")}catch(H){}},getPlay:function(){return w.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(H){return H?k(t):t},getFlashParams:function(){return G},loadPlugin:function(K,J,M,L){if(typeof M=="function"){L=M;M={}}var I=L?e():"_";w._api().fp_loadPlugin(K,J,M,I);var H={};H[I]=L;var N=new l(K,null,w,H);y[K]=N;return N},getState:function(){return w.isLoaded()?v.fp_getState():-1},play:function(I,H){var J=function(){if(I!==undefined){w._api().fp_play(I,H)}else{w._api().fp_play()}};if(w.isLoaded()){J()}else{if(D){setTimeout(function(){w.play(I,H)},50)}else{w.load(function(){J()})}}return w},getVersion:function(){var I="flowplayer.js 3.2.0";if(w.isLoaded()){var H=v.fp_getVersion();H.push(I);return H}return I},_api:function(){if(!w.isLoaded()){throw"Flowplayer "+w.id()+" not loaded when calling an API method"}return v},setClip:function(H){w.setPlaylist([H]);return w},getIndex:function(){return p}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var H="on"+this;if(H.indexOf("*")!=-1){H=H.slice(0,H.length-1);var I="onBefore"+H.slice(2);w[I]=function(J){j(x,I,J);return w}}w[H]=function(J){j(x,H,J);return w}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","),function(){var H=this;w[H]=function(J,I){if(!w.isLoaded()){return w}var K=null;if(J!==undefined&&I!==undefined){K=v["fp_"+H](J,I)}else{K=(J===undefined)?v["fp_"+H]():v["fp_"+H](J)}return K==="undefined"||K===undefined?w:K}});w._fireEvent=function(Q){if(typeof Q=="string"){Q=[Q]}var R=Q[0],O=Q[1],M=Q[2],L=Q[3],K=0;if(t.debug){g(Q)}if(!w.isLoaded()&&R=="onLoad"&&O=="player"){v=v||c(r);o=v.clientHeight;m(F,function(){this._fireEvent("onLoad")});m(y,function(S,T){T._fireEvent("onUpdate")});s._fireEvent("onLoad")}if(R=="onLoad"&&O!="player"){return}if(R=="onError"){if(typeof O=="string"||(typeof O=="number"&&typeof M=="number")){O=M;M=L}}if(R=="onContextMenu"){m(t.contextMenu[O],function(S,T){T.call(w)});return}if(R=="onPluginEvent"){var H=O.name||O;var I=y[H];if(I){I._fireEvent("onUpdate",O);I._fireEvent(M,Q.slice(3))}return}if(R=="onPlaylistReplace"){F=[];var N=0;m(O,function(){F.push(new h(this,N++,w))})}if(R=="onClipAdd"){if(O.isInStream){return}O=new h(O,M,w);F.splice(M,0,O);for(K=M+1;K<F.length;K++){F[K].index++}}var P=true;if(typeof O=="number"&&O<F.length){C=O;var J=F[O];if(J){P=J._fireEvent(R,M,L)}if(!J||P!==false){P=s._fireEvent(R,M,L,J)}}m(x[R],function(){P=this.call(w,O,M);if(this.cached){x[R].splice(K,1)}if(P===false){return false}K++});return P};function B(){if($f(q)){$f(q).getParent().innerHTML="";p=$f(q).getIndex();a[p]=w}else{a.push(w);p=a.length-1}A=parseInt(q.style.height,10)||q.clientHeight;E=q.id||"fp"+e();r=G.id||E+"_api";G.id=r;t.playerId=E;if(typeof t=="string"){t={clip:{url:t}}}if(typeof t.clip=="string"){t.clip={url:t.clip}}t.clip=t.clip||{};if(q.getAttribute("href",2)&&!t.clip.url){t.clip.url=q.getAttribute("href",2)}s=new h(t.clip,-1,w);t.playlist=t.playlist||[t.clip];var H=0;m(t.playlist,function(){var J=this;if(typeof J=="object"&&J.length){J={url:""+J}}m(t.clip,function(K,L){if(L!==undefined&&J[K]===undefined&&typeof L!="function"){J[K]=L}});t.playlist[H]=J;J=new h(J,H,w);F.push(J);H++});m(t,function(J,K){if(typeof K=="function"){if(s[J]){s[J](K)}else{j(x,J,K)}delete t[J]}});m(t.plugins,function(J,K){if(K){y[J]=new l(J,K,w)}});if(!t.plugins||t.plugins.controls===undefined){y.controls=new l("controls",null,w)}y.canvas=new l("canvas",null,w);function I(J){if(!w.isLoaded()&&w._fireEvent("onBeforeClick")!==false){w.load()}return f(J)}u=q.innerHTML;if(u.replace(/\s/g,"")!==""){if(q.addEventListener){q.addEventListener("click",I,false)}else{if(q.attachEvent){q.attachEvent("onclick",I)}}}else{if(q.addEventListener){q.addEventListener("click",f,false)}w.load()}}if(typeof q=="string"){var z=c(q);if(!z){throw"Flowplayer cannot access element: "+q}else{q=z;B()}}else{B()}}var a=[];function d(o){this.length=o.length;this.each=function(p){m(o,p)};this.size=function(){return o.length}}window.flowplayer=window.$f=function(){var p=null;var o=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;return false}});return p||a[0]}if(arguments.length==1){if(typeof o=="number"){return a[o]}else{if(o=="*"){return new d(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;return false}});return p}}if(arguments.length>1){var t=arguments[1],q=(arguments.length==3)?arguments[2]:{};if(typeof t=="string"){t={src:t}}t=i({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:true},t);if(typeof o=="string"){if(o.indexOf(".")!=-1){var s=[];m(n(o),function(){s.push(new b(this,k(t),k(q)))});return new d(s)}else{var r=c(o);return new b(r!==null?r:o,t,q)}}else{if(o){return new b(o,t,q)}}}return null};i(window.$f,{fireEvent:function(){var o=[].slice.call(arguments);var q=$f(o[0]);return q?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return $f},each:m,extend:i});if(typeof jQuery=="function"){jQuery.fn.flowplayer=function(q,p){if(!arguments.length||typeof arguments[0]=="number"){var o=[];this.each(function(){var r=$f(this);if(r){o.push(r)}});return arguments.length?o[arguments[0]]:new d(o)}return this.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){var h=document.all,j="http://www.adobe.com/go/getflashplayer",c=typeof jQuery=="function",e=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,b={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function i(l,f){if(f){for(key in f){if(f.hasOwnProperty(key)){l[key]=f[key]}}}return l}function a(f,n){var m=[];for(var l in f){if(f.hasOwnProperty(l)){m[l]=n(f[l])}}return m}window.flashembed=function(f,m,l){if(typeof f=="string"){f=document.getElementById(f.replace("#",""))}if(!f){return}if(typeof m=="string"){m={src:m}}return new d(f,i(i({},b),m),l)};var g=i(window.flashembed,{conf:b,getVersion:function(){var f;try{f=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(n){try{var l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");f=l&&l.GetVariable("$version")}catch(m){}}if(f){f=e.exec(f);return[f[1],f[3]]}else{return false}},asString:function(l){if(l===null||l===undefined){return null}var f=typeof l;if(f=="object"&&l.push){f="array"}switch(f){case"string":l=l.replace(new RegExp('(["\\\\])',"g"),"\\$1");l=l.replace(/^\s?(\d+\.?\d+)%/,"$1pct");return'"'+l+'"';case"array":return"["+a(l,function(o){return g.asString(o)}).join(",")+"]";case"function":return'"function()"';case"object":var m=[];for(var n in l){if(l.hasOwnProperty(n)){m.push('"'+n+'":'+g.asString(l[n]))}}return"{"+m.join(",")+"}"}return String(l).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(o,l){o=i({},o);var n='<object width="'+o.width+'" height="'+o.height+'" id="'+o.id+'"" name="'+o.id+'"';if(o.cachebusting){o.src+=((o.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(o.w3c||!h){n+=' data="'+o.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(o.w3c||h){n+='<param name="movie" value="'+o.src+'" />'}o.width=o.height=o.id=o.w3c=o.src=null;o.onFail=o.version=o.expressInstall=null;for(var m in o){if(o[m]){n+='<param name="'+m+'" value="'+o[m]+'" />'}}var p="";if(l){for(var f in l){if(l[f]){var q=l[f];p+=f+"="+(/function|object/.test(typeof q)?g.asString(q):q)+"&"}}p=p.slice(0,-1);n+='<param name="flashvars" value=\''+p+"' />"}n+="</object>";return n},isSupported:function(f){return k[0]>f[0]||k[0]==f[0]&&k[1]>=f[1]}});var k=g.getVersion();function d(f,n,m){if(g.isSupported(n.version)){f.innerHTML=g.getHTML(n,m)}else{if(n.expressInstall&&g.isSupported([6,65])){f.innerHTML=g.getHTML(i(n,{src:n.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title})}else{if(!f.innerHTML.replace(/\s/g,"")){f.innerHTML="<h2>Flash version "+n.version+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(f.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+j+"'>here</a></p>");if(f.tagName=="A"){f.onclick=function(){location.href=j}}}if(n.onFail){var l=n.onFail.call(this);if(typeof l=="string"){f.innerHTML=l}}}}if(h){window[n.id]=document.getElementById(n.id)}i(this,{getRoot:function(){return f},getOptions:function(){return n},getConf:function(){return m},getApi:function(){return f.firstChild}})}if(c){jQuery.tools=jQuery.tools||{version:"3.2.0"};jQuery.tools.flashembed={conf:b};jQuery.fn.flashembed=function(l,f){return this.each(function(){$(this).data("flashembed",flashembed(this,l,f))})}}})();
(function(){function a(b,c){if(b.substring(0,4)=="http"){return b}if(c){return c+(c.substring(c.length-1)!="/"?"/":"")+b}c=location.protocol+"//"+location.host;if(b.substring(0,1)=="/"){return c+b}var d=location.pathname;d=d.substring(0,d.lastIndexOf("/"));return c+d+"/"+b}$f.addPlugin("embed",function(d){var b=this;var c=b.getConfig(true);var e={width:b.getParent().clientWidth||"100%",height:b.getParent().clientHeight||"100%",url:a(b.getFlashParams().src),index:-1,allowfullscreen:true,allowscriptaccess:"always",id:"_"+b.id()};$f.extend(e,d);e.src=e.url;e.w3c=true;delete c.playerId;delete e.url;delete e.index;this.getEmbedCode=function(h,f){f=typeof f=="number"?f:e.index;if(f>=0){c.playlist=[b.getPlaylist()[f]]}f=0;$f.each(c.playlist,function(){c.playlist[f++].url=a(this.url,this.baseUrl)});var g=flashembed.getHTML(e,{config:c});if(!h){g=g.replace(/\</g,"&lt;").replace(/\>/g,"&gt;")}return g};return b})})();
var UA=(function(){var UAID=0;var activeEffect=false;var zoomActive=false;var _mediaPlayers={};var zoomBox=null;var zoomSource=null;var initZoomBox=function(){if(zoomBox)return;zoomBox=new Element('div');zoomBox.addClassName('ua-zoom');zoomBox.hide();zoomBox.update(' \
   <table style="border-collapse:collapse; width:100%; height:100%;"> \
    <tbody> \
     <tr> \
      <td class="tl" /> \
      <td class="tm" /> \
      <td class="tr" /> \
     </tr> \
     <tr> \
      <td class="ml" /> \
      <td class="mm" > \
       <div class="zoom-content"></div> \
      </td> \
      <td class="mr" /> \
     </tr> \
     <tr> \
      <td class="bl" /> \
      <td class="bm" /> \
      <td class="br" /> \
     </tr> \
    </tbody> \
   </table> \
   <a title="Close" class="ua-zoom-close pointer"></a> \
  ');$(document.body).insert({bottom:zoomBox});$$('html').first().observe('click',function(evnt){if(zoomBox.visible()){evnt.stop();hideZoomBox();}});}
var showZoomBox=function(img,source){if(zoomActive)return;img=$(img);source=$(source);if(source.tagName!='IMG')source=source.down('img');zoomSource=source;var pageSize=$(document.body).getDimensions();var startPosition=source.cumulativeOffset();var startSize=source.getDimensions();var viewport=document.viewport.getDimensions();zoomBox.select('.zoom-content').first().update(img);zoomBox.vhide();zoomBox.show();var zoomDimensions=zoomBox.getDimensions();var yOffset=document.viewport.getScrollOffsets()[1];zoomBox.setStyle({top:Math.max((viewport.height/2)-(zoomDimensions.height/2)+yOffset,0).px(),left:(viewport.width/2-zoomDimensions.width/2).px()});var zoomPosition=zoomBox.cumulativeOffset();var zoomSize=zoomBox.getDimensions();var endPosition=img.cumulativeOffset();var endSize=img.getDimensions();zoomBox.hide();zoomBox.vshow();var moveImg=new Element('img',{src:img.src});zoomBox.setStyle({top:(startPosition.top-30).px(),left:(startPosition.left-30).px(),width:(startSize.width+60).px(),height:(startSize.height+60).px(),opacity:0.5});moveImg.addClassName('ua-zoom');moveImg.setStyle({top:startPosition.top.px(),left:startPosition.left.px(),width:startSize.width.px(),height:startSize.height.px(),display:'none'});$(document.body).insert(moveImg);var e=new Effect.Parallel([new Effect.Morph(zoomBox,{style:{top:zoomPosition.top.px(),left:zoomPosition.left.px(),width:zoomSize.width.px(),height:zoomSize.height.px()},sync:true}),new Effect.Appear(zoomBox,{sync:true,from:0.0,to:0.8}),new Effect.Morph(moveImg,{style:{top:endPosition.top.px(),left:endPosition.left.px(),width:endSize.width.px(),height:endSize.height.px()},sync:true}),new Effect.Appear(moveImg,{sync:true,from:0.0,to:0.8})],{duration:1.5,beforeStart:function(){img.hide();},afterFinish:function(){zoomBox.setOpacity(1);img.show();moveImg.remove();UA.overlay.show({duration:0.1});activeEffect=false;$(document.body).addClassName('pointer');}});}
function hideZoomBox(){activeEffect=true;zoomActive=true;var zoomContent=zoomBox.select('.zoom-content').first().firstDescendant();var startPosition=zoomContent.cumulativeOffset();var startSize=zoomContent.getDimensions();var endPosition=zoomSource.cumulativeOffset();var endSize=zoomSource.getDimensions();var moveImg=zoomContent.clone();moveImg.addClassName('ua-zoom');moveImg.setStyle({top:startPosition.top.px(),left:startPosition.left.px(),width:startSize.width.px(),height:startSize.height.px()});$(document.body).insert(moveImg);new Effect.Parallel([new Effect.Fade(zoomBox,{sync:true,from:0.5,to:0.0}),new Effect.Morph(zoomBox,{sync:true,style:{top:(endPosition.top-30).px(),left:(endPosition.left-30).px(),width:(endSize.width+60).px(),height:(endSize.height+60).px()}}),new Effect.Morph(moveImg,{sync:true,style:{top:endPosition.top.px(),left:endPosition.left.px(),width:endSize.width.px(),height:endSize.height.px()}}),new Effect.Fade(moveImg,{sync:true,from:1,to:0.0})],{duration:1.5,beforeStart:function(){UA.overlay.hide({duration:0.0});zoomContent.remove();$(document.body).removeClassName('pointer');},afterFinish:function(){zoomBox.setStyle({width:'',height:''});moveImg.remove(),activeEffect=false;zoomBox.hide();zoomActive=false;}});}
return{debug:document.location.host.substr(0,document.location.host.indexOf('-')+1).length>0,PREFIX:document.location.host.substr(0,document.location.host.indexOf('-')+1),loggedIn:false,googleAccount:'UA-8410770-1',assets:{images:'/skin/frontend/uaudio/uaudio/images/mediaplayer',flowplayer:{player:'http://'+document.location.host+'/skin/frontend/uaudio/uaudio/swf/flowplayer.commercial-3.2.7.swf',viralvideos:'http://'+document.location.host+'/skin/frontend/uaudio/uaudio/swf/flowplayer.viralvideos-3.2.5.swf',analytics:'http://'+document.location.host+'/skin/frontend/uaudio/uaudio/swf/flowplayer.analytics-3.2.2.swf',pseudo:'http://'+document.location.host+'/skin/frontend/uaudio/uaudio/swf/flowplayer.pseudostreaming-3.2.7.swf',bwcheck:'http://'+document.location.host+'/skin/frontend/uaudio/uaudio/swf/flowplayer.bwcheck-3.2.5.swf'}},my:{loggedIn:false,loginWin:null,actions:{},login:function(form,forwardLink){var self=UA.my;form.request({onSuccess:function(request,result){switch(result.success){case'success':if(forwardLink){document.location=forwardLink;return;}
if($('cartBalance'))$('cartBalance').update(result.cartBalance);if($('cartQty'))$('cartQty').update(result.totalInCart);var myua=$('myuaudio');myua.stopObserving('click');myua.href='/my';self.addLoggedIn();if(self.loginWin){self.loginWin.remove();self.loginWin=null;}
if(self.actions.afterLogin){self.actions.afterLogin();self.actions.afterLogin=null;}
break;default:new Q.Alert('',result.message);}},onFailure:function(){new Q.Alert('','There was an error during login.  Please try again.');}});return false;},showLogin:function(o){var self=UA.my;var options={};Object.extend(options,o);if(options.afterLogin)self.actions.afterLogin=options.afterLogin;if(true||!self.loginWin){var uadInfo='';if(options.addToCart==true){uadInfo=' \
       <div style="text-align: center;">All UAD plug-ins require UAD DSP Accelerator hardware. &nbsp;<a href="/uad-plug-ins.html" style="font-weight: bold; color: #5797B4;">Learn more.</a></div> \
       <div style="text-align: center;">Existing UAD owners, Login below.</div> \
       <br /> \
      ';}
self.loginWin=new Q.Message("Sign In",uadInfo+' \
      <form id="login-form" class="popup login" action="/my/login/login?ajax=true" method="post"> \
       <fieldset class="login" action="/my/login/login" method="post"> \
        <div> \
         <label for="login">Login:</label> \
         <span class="input-e" style="float: right;"><input type="text" name="flogin" id="flogin" size="40" /></span> \
        </div> \
        <div> \
         <label for="password">Password:</label> \
         <span class="input-e" style="float: right;"><input type="password" name="fpass" size="40" /> \
        </div> \
        <div> \
         <label>&nbsp;</label> \
         <span class="left"><input type="checkbox" name="remember" value="1" checked="checked" />&nbsp;Remember Me</span> \
         <span class="right" id="lost-password"><a href="/my/login/forgot">Lost password?</a></span> \
        </div> \
        <table cellpadding="0" cellspacing="0" border="0" width="100%" id="login-mailinglist" style="margin-bottom: 10px; display: none;"> \
         <tr> \
          <td colspan="2"> \
           <strong>Sign up for our mailing lists for exclusive deals and information ... </strong> \
          </td> \
         </tr> \
         <tr> \
          <td style="padding-top: 5px;"><input type="checkbox" name="customers_notify_enews" value="1" checked="checked" />&nbsp;&nbsp;</td> \
          <td style="padding-top: 5px;"><strong>UA Webzine</strong> &ndash; Our monthly e-newsletter, featuring "how to" articles, artist interviews, video tutorials, promotions, &amp; more.</td> \
         </tr> \
         <tr> \
          <td><input checked="checked" value="1" id="customers_notify_promo" name="customers_notify_promo" type="checkbox">&nbsp;&nbsp;</td> \
          <td><strong>Email Updates</strong> &ndash; Monthly "email only" coupons and rebates on UAD Powered Plug-Ins. </td> \
         </tr> \
        </table> \
        <div> \
         '+((options.addToCart!==true)?'<span style="float: left;"><button type="button" class="button sign-up" onclick="UA.my.showLoginSignup($(this).up(\'#login-form\'))">SIGN UP &raquo;</button></span>':'')+' \
         <span style="float: right;"> \
          <button type="submit" class="button sign-in">SIGN IN &raquo;</button> \
         </span> \
        </div> \
       </fieldset> \
      </form> \
      ',{width:420,onHide:function(win){$('login-form').up('.q-wrapper').remove();}});var f=function(){if($('flogin')){$('flogin').focus();$('login-form').observe('submit',function(evnt){Event.stop(evnt);UA.my.login(this,o.link);});}else{setTimeout(f,500);}};setTimeout(f,500);}else{self.loginWin.show();self.loginWin.protection.show();setTimeout(function(){$('flogin').focus();},500);}},showLoginSignup:function(loginForm){loginForm=$(loginForm);loginForm.action+='&create-account=true';loginForm.down('#lost-password').hide();loginForm.down('#login-mailinglist').show();var signIn=loginForm.down('.sign-in');signIn.addClassName('create-account');signIn.removeClassName('sign-in');signIn.name='create-account';loginForm.down('.sign-up').hide();$$('.q-window-label')[0].update('Create Account');$('flogin').focus();},addLoggedIn:function(){try{var li=$('myuaudio').up('li');var html=' \
      <div class="popout" style="width: 150px;"> \
       <ul> \
        <li><a href="http://'+UA.PREFIX+'www.uaudio.com/my/logout">&raquo; Log Out</a></li> \
        <li><a href="http://'+UA.PREFIX+'my.uaudio.com/store/shopping_cart.php">&raquo; View Cart</a></li> \
        <li><a href="http://'+UA.PREFIX+'www.uaudio.com/my/profile">&raquo; My Profile</a></li> \
        <li><a href="http://'+UA.PREFIX+'www.uaudio.com/my/systems">&raquo; My UAD Systems</a></li> \
        <li><a href="http://'+UA.PREFIX+'www.uaudio.com/my/hardware">&raquo; My Hardware</a></li> \
       </ul> \
      </div>';li.insert(html);}catch(e){if(UA.debug)console.log(e);}}},addToCart:function(sku,override,skipLogin){if(typeof(override)!='string')override=false;var url=(document.location.host==UA.PREFIX+'www.uaudio.com'?'/my/store/add':'/store/add.php')+'?sku='+sku+(override?'&override='+override:'')
new Ajax.Request(url,{onSuccess:function(response,result){switch(result.success){case'success':var cartBalance=$('cartBalance');var cartQty=$('cartQty');if(cartBalance)cartBalance.update(result.cartBalance);if(cartQty)cartQty.update(result.totalInCart);new Q.Confirm("",result.name+" has been added to your cart.",{confirmLabel:'OK',confirmClass:'button ok',cancelLabel:'CHECKOUT',cancelClass:'button checkout right',onCancel:function(){document.location='http://'+UA.PREFIX+'my.uaudio.com/store/shopping_cart.php';}});break;case'option':new Q.Confirm("",'You have UAD-1 only and UAD-2 Systems.  Which version of the Plug-In would you like to purchase?',{cancelLabel:'UAD-1',confirmLabel:'UAD-2',onCancel:function(){UA.addToCart(sku,'UAD-1');},onConfirm:function(){UA.addToCart(sku,'UAD-2');}});break;case'no-uad':new Q.Alert("",result.name+' requires a <a href="http://'+UA.PREFIX+'www.uaudio.com/uad-plug-ins.html">UAD-2 DSP Accelerator Card</a>.');break;case'uad1-only':new Q.Alert("",result.name+' is only available for UAD-1.\nAnd only UAD-2 cards were detected in your account.');break;case'uad2-only':new Q.Alert("",result.name+' is only available for UAD-2.\nAnd only UAD-1 cards were detected in your account.');break;case'need-login':UA.my.showLogin({message:'Please log in to cart UAD Plug-Ins.',addToCart:true,afterLogin:function(){UA.addToCart(sku,override);}});break;}
Q.addCss('div.q-window div.q-buttons-wrapper input.q-next-button','text-shadow: none; font-size: 12px; font-weight: bold; line-height: 30px;height: 30px; color: #fff; background: transparent url(/skin/frontend/uaudio/uaudio/images/common/btn1_bg.gif) repeat-x scroll 0 0;');Q.addCss('div.q-window div.q-buttons-wrapper input.q-button','text-shadow: none; font-size: 12px; font-weight: bold; line-height: 30px;height: 30px; color: #fff; background: transparent url(/skin/frontend/uaudio/uaudio/images/common/btn1_bg.gif) repeat-x scroll 0 0;');},onFailure:function(){}});},getID:function(){return'UA-'+UAID++;},viewMore:function(elem,link,options){var config={show:'Show More Detail',hide:'Show Less Detail'};elem=$(elem);link=$(link);Object.extend(config,options||{});if(elem.visible()){new Effect.BlindUp(elem);link.update(config.show);}else{new Effect.BlindDown(elem);link.update(config.hide);}},marquee:Class.create({initialize:function(container,items,options){this.config={transitionDuration:2.5,showFor:8,current:0};Object.extend(this.config,options||{});if(items.length<1)return;this.items=[];this.container=$(container);this.container.setStyle({position:'relative'});this.items.push(this.container.childElements()[0]);this.items[0].id=UA.getID();this.items[0].setStyle({position:'absolute',top:0,left:0});for(var i=0;i<items.length;i++){var s=new Element('span');s.hide();s.id=UA.getID();s.update(items[i]);s.setStyle({position:'absolute',top:0,left:0});this.container.insert(s);this.items.push(s);}
setInterval(function(){var current=this.config.current;var next=(this.config.current+1)%this.items.length;var self=this;new Effect.Parallel([new Effect.Fade(self.items[current],{sync:true}),new Effect.Appear(self.items[next],{sync:true})],{duration:self.config.transitionDuration});this.config.current=next;}.bind(this),this.config.showFor*1000);}}),pageScroll:Class.create({initialize:function(container,options){this.currentPage=0;this.config={transitionDuration:0.5,previousControl:null,nextControl:null,statusControl:null,pages:null,statusControlPattern:'%1 of %2',direction:'side',scrollAmount:null,hideControl:false,numPages:null};Object.extend(this.config,options||{});if(!this.config.scrollAmount){}
this.container=container;if(!this.config.numPages)this.config.numPages=this.config.pages.length;if(this.config.numPages<=1)return;if(!container||!this.config.previousControl||!this.config.nextControl){throw("Error: "+container+" does not exist");}
this.config.nextControl.observe('click',function(evnt){this.next();Event.stop(evnt);return false;}.bind(this));this.config.previousControl.observe('click',function(evnt){this.previous();Event.stop(evnt);return false;}.bind(this));if(this.config.pages){this.config.pages[0].addClassName('current');this.config.pages.each(function(e,indx){e.setAttribute('uaindx',indx);e.observe('click',function(evnt){this.goToPage(evnt.element().getAttribute('uaindx'));Event.stop(evnt);return false;}.bind(this));}.bind(this));}
if(this.config.statusControl){var str=this.config.statusControlPattern;str=str.replace(/\%1/g,1);str=str.replace(/\%2/g,this.config.numPages);this.config.statusControl.update(str);}},goToPage:function(pg){if(this.config.pages){this.config.pages[this.currentPage].removeClassName('current');this.config.pages[pg].addClassName('current');}
if(this.config.counter){this.config.counter.update(pg+1);}
if(this.config.statusControl){var str=this.config.statusControlPattern;str=str.replace(/\%1/g,pg+1);str=str.replace(/\%2/g,this.config.numPages);this.config.statusControl.update(str);}
this.currentPage=pg;if(this.config.hideControl){if(this.currentPage==0){this.config.previousControl.vhide();this.config.nextControl.vshow();}else if(this.currentPage==this.config.numPages-1){this.config.previousControl.vshow();this.config.nextControl.vhide();}else{this.config.previousControl.vshow();this.config.nextControl.vshow();}}
var d=this.config.direction=='side'?'left':'top';new Effect.Morph(this.container,{style:d+': -'+(this.currentPage*this.config.scrollAmount).px(),duration:this.config.transitionDuration});},next:function(){this.goToPage(this.currentPage==(this.config.numPages-1)?0:parseInt(this.currentPage,10)+1);},previous:function(){this.goToPage(this.currentPage==0?this.config.numPages-1:parseInt(this.currentPage,10)-1);}}),window:Class.create(Q.Window,{initialize:function($super,source,options){var dim=document.viewport.getDimensions()
options=$H({width:300,minHeight:30,draggable:true,closeButton:true,hide:true,left:dim.width/2-(options&&options.width?options.width/2:150),top:dim.height/3-75}).merge(options||{}).toObject();$super(options);this.onWindowResize=(function(){var dim=document.viewport.getDimensions();this.holder.setStyle({left:(dim.width/2-(options&&options.width?options.width/2:150))+'px',top:(dim.height/3-75)+'px'});}).bind(this);(document.onresize?document:window).observe("resize",this.onWindowResize);this.holder.addClassName("q-window-blocking").setStyle({zIndex:99998});this.protection=new Element("div").addClassName("q-protective-layer");this.div.insert({top:this.protection});this.protection.hide();this.persistent=true;this.update(source);this.show();this.protection.appear({duration:0.1,to:0.5});},remove:function(){this.protection.fade({duration:0.01});(function(){try{this.protection.remove();delete this;}catch(e){}}).bind(this).delay(0.2);}}),getMediaPlayer:function(id){if(id){return _mediaPlayers[id];}else{return _mediaPlayers;}},mediaPlayer:Class.create({initialize:function(id,data,config){if(typeof(id)=='object'){_mediaPlayers[id.id]=this;}else{_mediaPlayers[id]=this;}
this.config={reflectionHeight:.4,reflectionHeightMin:.2,reflectionOpacity:.2,overlayOpacity:.8,arrowWidth:20,arrowHeight:20,zoomHeight:36,zoomWidth:36,imageLibraryPerPage:12,imageLibraryColumn:2,videoLibraryPerPage:9,videoLibraryColumn:3,showLoading:true,pages:{},wrapperUpdated:false,autoPlay:false,forwardVideo:false,hideTitle:false,bgLogo:'/skin/frontend/uaudio/uaudio/images/mediaplayer/ua_logo.png',resizeWrapper:true,videoTPL:null,controls:true};this.organizeData(data);Object.extend(this.config,config);this.activeWrapper=null;this.config.videoTPL=new Template(' \
     <div class="hero-video pointer"> \
      <img src="#{src}" width="480" height="270" alt="#{title}" /> \
      '+(this.config.hideTitle?'':'<cite><strong>#{title}</strong>#{description}</cite>')+' \
      <div class="ua-play"></div> \
     </div> \
    ');this.wrappers={};this.wrappers['mainWrapper']=$(id);if(this.config.mediaWrapper)this.wrappers['mediaWrapper']=$(this.config.mediaWrapper);if(typeof(this.config.width)=='undefined')this.config.width=$(id).getWidth();if(typeof(this.config.height)=='undefined')this.config.height=$(id).getHeight();this.links={images:$('ua-media-images'),videos:$('ua-media-videos'),videoIcon:$('ua-media-videos-img'),count:$('ua-media-count'),viewAll:$('ua-media-view-all'),zoom:$('ua-media-zoom')};if(this.links.count){this.links.count.update('1 / '+this.data.images.length);}
if(this.links.images){this.links.images.observe('click',function(){this.links.images.addClassName('ua-links-selected');if(this.links.videos)this.links.videos.removeClassName('ua-links-selected');this.showImageLibrary(0);}.bind(this));}
if(this.links.viewAll){this.links.viewAll.observe('click',function(){if(this.activeWrapper=='videoPlayer'){if(this.links.images)this.links.images.removeClassName('ua-links-selected');if(this.links.videos)this.links.videos.addClassName('ua-links-selected');this.showVideoLibrary(0);}else{if(this.links.images)this.links.images.addClassName('ua-links-selected');if(this.links.videos)this.links.videos.removeClassName('ua-links-selected');this.showImageLibrary(0);}}.bind(this));}
if(this.links.videos){this.links.videos.observe('click',function(){this.links.videos.addClassName('ua-links-selected');if(this.links.images)this.links.images.removeClassName('ua-links-selected');this.initVideo(this.videoPlayer?this.videoPlayer.currentVideo:0);}.bind(this));}
if(this.links.videoIcon){this.links.videoIcon.observe('click',function(){this.links.videos.addClassName('ua-links-selected');if(this.links.images)this.links.images.removeClassName('ua-links-selected');this.initVideo(this.videoPlayer?this.videoPlayer.currentVideo:0);}.bind(this));}
if(this.links.zoom){this.links.zoom.observe('click',function(evnt){if(this.activeWrapper=='videoPlayer'){}else{var source=this.imageBrowser.imagesCache[this.lastImage].down('a');if(!source)return;initZoomBox();Event.stop(evnt);if(this.config.showLoading)UA.loading.show(source);var src=source.getAttribute('href');var img=new Element('img');img.observe('load',function(){if(this.config.showLoading)UA.loading.hide();showZoomBox(img,source);}.bind(this));img.src=src;}}.bind(this));}
if(this.config.mode=='library'||(this.data.images.length>1&&this.data.videos.length>1)){this.playerWrapper=new Element('div',{style:'position: relative; width: '+this.config.width.px()+'; height: '+this.config.height.px()+'; overflow: hidden;'});$(id).update(this.playerWrapper);this.playerType='library';var params=document.location.hash.substr(1).toQueryParams();if(params['v']&&typeof(this.data.keys[params['v']])!='undefined'){this.initVideo(this.data.keys[params['v']]);this.links.videos.addClassName('ua-links-selected');this.links.images.setStyle({color:'#fff'});this.links.videos.setStyle({color:'#fff'});if((p=this.wrappers.mediaWrapper.select('.regular-price').first())){p.setStyle({color:'#FFF'});}}else if(params['p']&&typeof(this.data.keys[params['p']])!='undefined'){this.initVideo(this.data.keys[params['p']]);this.links.videos.addClassName('ua-links-selected');this.links.images.setStyle({color:'#fff'});this.links.videos.setStyle({color:'#fff'});if((p=this.wrappers.mediaWrapper.select('.regular-price').first())){p.setStyle({color:'#FFF'});}
if(this.videoPlayer.player){this.videoPlayer.player.play(this.data.keys[params['p']]);}}else{this.activeWrapper='imageBrowser';this.viewImage(0);this.links.images.addClassName('ua-links-selected');}}else if(this.config.mode=='video-library'||(this.data.videos.length>1&&this.data.images.length==0&&this.config.mode!='video')){this.playerWrapper=new Element('div',{style:'position: relative; width: '+this.config.width.px()+'; height: '+this.config.height.px()+'; overflow: hidden;'});$(id).update(this.playerWrapper);this.playerType='library';this.initVideo(0);}else if(this.data.images.length==1){this.playerType='image';}else if(this.config.mode=='video'||this.data.videos.length==1){this.playerWrapper=$(id);this.playerType='video';this.initVideo(0);var params=document.location.hash.substr(1).toQueryParams();if(params['p']&&typeof(this.data.keys[params['p']])!='undefined'){this.initVideo(this.data.keys[params['p']]);if(this.videoPlayer.player){this.videoPlayer.player.play(this.data.keys[params['p']]);}}}},initLibrary:function(o){if(this.wrappers[o.library])return;this[o.library]={};var perPage=this.config[o.library+'PerPage'];var pages=Math.ceil(o.data.length/perPage);if(o.library=='imageLibrary'){}else{var wrapperStyle={paddingTop:'10px',libraryHeight:(this.config.height-52).px(),marginTop:'7px',wrapperHeight:(this.config.height-30).px()};}
this.wrappers[o.library]=new Element('div');this.wrappers[o.library].addClassName('ua-media-wrapper');this.wrappers[o.library].addClassName(o.library);this.wrappers[o.library].setStyle({position:'absolute',width:this.config.width.px()});this.wrappers[o.library].vhide();this.playerWrapper.insert(this.wrappers[o.library]);this.wrappers[o.library].setStyle({width:this.config.width.px(),left:'0px',height:(this.config.height-this.wrappers[o.library].styleHeightOffset()).px()});var closeLink=new Element('a');closeLink.addClassName('ua-library-close');closeLink.addClassName('pointer');this.wrappers[o.library].insert(closeLink);closeLink.observe('click',function(){this.viewImage(this.lastImage,{target:this[o.library].library.select('img[uaindx='+this.lastImage+']').first()});}.bind(this));this[o.library].library=new Element('ul');this[o.library].library.addClassName('ua-'+o.type+'-library');this[o.library].library.setStyle({width:((this.config.width)*pages).px(),paddingLeft:0,paddingRight:0,height:(this.config.height-15-this.wrappers[o.library].styleHeightOffset()).px()});this.wrappers[o.library].insert(this[o.library].library);var loaded={loaded:0};for(var i=0;i<pages;i++){for(var j=i*perPage;j<i*perPage+perPage/this.config[o.library+'Column'];j++){var li=new Element('li');li.addClassName('ua-'+o.type+'-thumb');if(j==0)li.addClassName('first');for(var k=0;k<this.config[o.library+'Column'];k++){var indx=j+perPage/this.config[o.library+'Column']*k;if(o.data[indx])o.insert.call(this,li,indx,o.data[indx],loaded);}
this[o.library].library.insert(li);}}
var interval=setInterval(function(){if(loaded.loaded>=o.data.length){clearInterval(interval);if(this.activeWrapper!=o.library)this.wrappers[o.library].hide();this.wrappers[o.library].vshow();if(o.callback)o.callback.call(this);}}.bind(this),50);},initImageBrowser:function(){if(this.wrappers['imageBrowser'])return;this.imageBrowser={imagesCache:[],currentImage:0,imageWrapper:null};this.wrappers.imageBrowser=new Element('div',{'class':'ua-media-wrapper imageBrowser','style':'position: absolute; overflow: hidden; width: '+this.config.width.px()+'; height: '+this.config.height.px()});this.imageBrowser.imageWrapper=new Element('div',{'class':'ua-image-wrapper','style':'position: absolute; overflow: hidden; width: '+this.config.width.px()});this.wrappers.imageBrowser.insert(this.imageBrowser.imageWrapper);this.config.pages['imageBrowser']=this.data.images.length;this.imageBrowser.nav=this.pageNav(this.wrappers.imageBrowser,this.data.images.length,0);this.wrappers.imageBrowser.vhide();this.playerWrapper.insert(this.wrappers.imageBrowser);if(this.imageBrowser.nav){this.imageBrowser.nav.left.observe('click',function(){if(activeEffect)return;this.imageBrowser.currentImage=parseInt(this.imageBrowser.currentImage,10);this.viewImage(this.imageBrowser.currentImage==0?(this.data.images.length-1):this.imageBrowser.currentImage-1);}.bind(this));this.imageBrowser.nav.right.observe('click',function(){if(activeEffect)return;this.imageBrowser.currentImage=parseInt(this.imageBrowser.currentImage,10);this.viewImage(this.imageBrowser.currentImage==this.data.images.length-1?0:this.imageBrowser.currentImage+1);}.bind(this));if(this.imageBrowser.nav.pages){this.imageBrowser.nav.pages.each(function(e,indx){$(e).observe('click',function(){if(indx==this.imageBrowser.currentImage||activeEffect)return;this.viewImage(indx);}.bind(this));}.bind(this));}}},initVideo:function(indx,o){if(this.activeWrapper=='videoPlayer')return;var videoTPL=this.config.videoTPL;var showVideo=function(){this.slideIn(this.activeWrapper,'videoPlayer');}.bind(this);if(this.wrappers['videoPlayer']){showVideo();return;}
this.videoPlayer={currentVideo:indx,currentPage:indx,videoWrapper:null,playerID:UA.getID(),player:null,playerTime:null,videoListIndx:indx};var options={autoPlay:this.config.autoPlay};Object.extend(options,o);if(this.playerType=='video'){var video=this.data.videos[indx];this.videoPlayer.playerID=this.playerWrapper.id;var vDefault=video.files['default']?video.files['default']:video.files['web'][0];if(this.playerWrapper.tagName=='A'){this.playerWrapper.setAttribute('href',vDefault['url']);this.playerWrapper.setStyle({textDecoration:'none'});}
if(this.config.insertBackground){if(this.config.resizeWrapper){if(video.files.iphonebg){this.config.width=video.files.iphonebg.width;this.config.height=video.files.iphonebg.height;this.playerWrapper.setStyle({width:this.config.width.px(),height:this.config.height.px()});}else{this.config.width=480;this.config.height=270;this.playerWrapper.setStyle({width:this.config.width.px(),height:this.config.height.px()});}}
this.playerWrapper.update('');this.playerWrapper.insert(videoTPL.evaluate({playerID:this.videoPlayer.playerID,src:video.files.iphonebg?video.files.iphonebg['url']:this.config.logoBg,title:video.title,description:video.short_description}));}
this.wrappers.videoPlayer=this.playerWrapper;}else{this.config.pages['videoPlayer']=this.data.videos.length;this.wrappers.videoPlayer=new Element('div',{'class':'ua-media-wrapper video',style:'position: absolute;'});if(this.data.videos.length>4){var listHTML=' \
       <div style="position: relative; left: 101px; padding-bottom: 15px;"><a class="pointer ua-media-arrow-up"></a></div> \
       <div style="float: right; position: relative; height: 200px; overflow: hidden;"> \
        <ul class="ua-video-list video-list" style="position: relative;"> \
        </ul> \
       </div> \
       <div style="position: relative; left: 101px; top: 200px; padding-top: 15px;"><a class="pointer ua-media-arrow-down"></a></div> \
      ';}else{var listHTML=' \
       <div style="float: right; position: relative; overflow: hidden;"> \
        <ul class="ua-video-list video-list" style="position: relative;"> \
        </ul> \
       </div> \
      ';}
var vDefault=this.data.videos[indx].files['default']?this.data.videos[indx].files['default']:this.data.videos[indx].files['web'][0];this.wrappers.videoPlayer.insert(' \
      <a id="'+this.videoPlayer.playerID+'" style="display: block; width: 480px; height: 270px; text-decoration: none; float: left;" href="'+vDefault['url']+'"> \
       '+videoTPL.evaluate({playerID:this.videoPlayer.playerID,src:(this.data.videos[indx].files.iphonebg?this.data.videos[indx].files.iphonebg['url']:this.config.bgLogo),title:this.data.videos[indx].title,description:this.data.videos[indx].short_description})+' \
      </a> \
      <div style="float: right;"> \
      '+listHTML+' \
      </div> \
     ');this.wrappers.videoPlayer.hide();this.playerWrapper.insert(this.wrappers.videoPlayer);this.videoPlayer.videoWrapper=$(this.videoPlayer.playerID);this.videoPlayer.videoWrapper.select('a').each(function(e){if(activeEffect)return;e=$(e);e.observe('click',function(){this.viewVideo(indx);}.bind(this));}.bind(this));var videoList=this.wrappers.videoPlayer.down('.ua-video-list');var videoEntry=new Template('<li uaindx="#{indx}" class="#{current} pointer"><a><img width="89" height="50" alt="#{alt}" src="#{src}" />#{title}</a></li>');this.data.videos.each(function(video,indx){videoList.insert(videoEntry.evaluate({current:indx==this.videoPlayer.currentVideo?'active':'',alt:video.title,src:video.files.thumb?video.files.thumb['url']:null,title:video.title,indx:indx}));}.bind(this));var liList=videoList.select('li');liList.each(function(e,indx){e=$(e);e.observe('click',function(){if(activeEffect)return;liList[this.videoPlayer.currentVideo].removeClassName('active');e.addClassName('active');this.viewVideo(e.getAttribute('uaindx'));}.bind(this));}.bind(this));if(this.data.videos.length>4){var _scroll=function(newPos){activeEffect=true;var videoList=this.wrappers.videoPlayer.select('.video-list').first();activeEffect=false;new Effect.Morph(this.wrappers.videoPlayer.select('.video-list').first(),{style:'top: -'+(newPos*69).px(),duration:0.5,afterFinish:function(){activeEffect=false;}});};this.wrappers.videoPlayer.down('.ua-media-arrow-up').observe('click',function(){if(activeEffect)return;if(this.videoPlayer.videoListIndx==0)return;this.videoPlayer.videoListIndx--;_scroll.call(this,this.videoPlayer.videoListIndx);}.bind(this));this.wrappers.videoPlayer.down('.ua-media-arrow-down').observe('click',function(){if(activeEffect)return;var list=this.wrappers.videoPlayer.select('.video-list li');if(this.videoPlayer.videoListIndx>=list.length-3)return;this.videoPlayer.videoListIndx++;_scroll.call(this,this.videoPlayer.videoListIndx);}.bind(this));if(this.videoPlayer.videoListIndx>this.data.videos.length-3)this.videoPlayer.videoListIndx=this.data.videos.length-3;_scroll.call(this,this.videoPlayer.videoListIndx);}
showVideo();}
if(Prototype.Browser.MobileSafari){if(Prototype.Browser.iPad){this.viewIpad();}
return;}
if(!DetectFlashVer(10,0,0)){$(this.videoPlayer.playerID).observe('click',function(evnt){new Q.Alert('','You need flash version 10 to play this video.<br />You can download a new player from <a href="http://get.adobe.com/flashplayer/">here</a>.',{confirmClass:'button ok right'});Event.stop(evnt)});return;}
var playlist=[];var self=this;for(var i=0;i<this.data.videos.length;i++){var v=this.data.videos[i].files['web'];var bitrates=[];var scale='fit';for(var j=0;j<v.length;j++){if(v[j]['scaling'])scale=v[j]['scaling'];bitrates.push({url:v[j]['url'],width:v[j]['width'],hd:v[j]['type']=='hd',normal:v[j]['type']!='hd'});}
playlist.push({bitrates:bitrates,urlResolvers:'bwcheck',scaling:scale,provider:'pseudostreaming'});}
var viral=this.config.controls?{url:UA.assets.flowplayer.viralvideos,share:{livespaces:false,bebo:false,orkut:false,stubmbleupon:false}}:null;var controls=this.config.controls?{playlist:playlist.length>1}:null;var hdButton=this.config.controls?{place:'controls',splash:false}:false;gatracker=false;if(UA.PREFIX==''){var gatracker={url:UA.assets.flowplayer.analytics,events:{all:true},debug:false,accountId:UA.googleAccount};}
this.videoPlayer.player=flowplayer(this.videoPlayer.playerID,{src:UA.assets.flowplayer.player,wmode:'transparent'},{key:'#$3ebd8973aa6d1763caa',play:{label:null,replayLabel:'Click to Play Again'},clip:{scaling:'fit'},plugins:{gatracker:gatracker,controls:controls,viral:viral,pseudostreaming:{url:UA.assets.flowplayer.pseudo},bwcheck:{url:UA.assets.flowplayer.bwcheck,netConnectionUrl:UA.assets.flowplayer.player,hdButton:hdButton}},playlist:playlist,onLoad:function(){this.videoPlayer.player.play(parseInt(this.videoPlayer.currentVideo,10));if(this.videoPlayer.playerTime){this.videoPlayer.player.mute();setTimeout(function(){this.videoPlayer.player.seek(parseInt(this.videoPlayer.playerTime,10));this.videoPlayer.player.unmute();}.bind(this),1000);}}.bind(this)});},embedCode:function(){var code='';try{code=this.videoPlayer.player.embed().getEmbedCode();}catch(e){}
return code;},viewImage:function(indx,options){if(activeEffect)return;activeEffect=true;if(!this.wrappers.imageBrowser)this.initImageBrowser();var showImage=function(img,indx){this.lastImage=indx;var done=function(){if(this.config.showLoading)UA.loading.hide();this.imageBrowser.currentImage=parseInt(indx,10);this.imageBrowser.currentPage=parseInt(indx,10);this.updateNavPage(this.imageBrowser.nav,indx);activeEffect=false;}.bind(this);var images=this.imageBrowser.imageWrapper.select('.ua-image');switch(this.activeWrapper){case'imageBrowser':this.wrappers.imageBrowser.vshow();if(images.length==1){activeEffect=false;return;}
if(this.config.showLoading)UA.loading.show(this.playerWrapper);for(var i=0;i<images.length;i++){if(images[i].id==img.id){new Effect.Morph(this.imageBrowser.imageWrapper,{'style':'left: -'+(this.config.width*i).px(),duration:0.5,afterFinish:done});}}
break;default:for(var i=0;i<images.length;i++){if(images[i].id==img.id){break;}}
this.imageBrowser.imageWrapper.setStyle({left:(-this.config.width*i).px()});this.imageBrowser.currentImage=indx;this.imageBrowser.currentPage=indx;this.slideIn(this.activeWrapper,'imageBrowser');}};if(!this.imageBrowser.imagesCache[indx]){if(!this.data.images[indx]){if(UA.debug)console.log('Image is not defined');}
var img=new Element('img');img.observe('load',this.loadImage.bind(this,img,indx,showImage));img.src=this.data.images[indx]['files']['sq']['url'];}else{showImage.call(this,this.imageBrowser.imagesCache[indx],indx);}},showImageLibrary:function(pg){if(this.activeWrapper=='imageLibrary')return;activeEffect=true;var _showLibrary=function(){this.slideIn(this.activeWrapper,'imageLibrary');};if(!this.wrappers.imageLibrary){this.initLibrary({type:'image',library:'imageLibrary',data:this.data.images,callback:_showLibrary,insert:function(li,indx,data,loaded){var div=new Element('div',{'class':'wrapper'});var imgWrapper=new Element('div',{'class':'ua-library-thumb-wrapper'});var img=new Element('img',{id:UA.getID(),'class':'pointer',uaindx:indx,alt:data['title']});img.addClassName('pointer');li.insert(div);div.insert(imgWrapper);img.observe('load',function(){imgWrapper.insert(img);var title=new Element('p').insert(data['title']);div.insert(title);img.width=94;img.height=54;var d=img;d.observe('click',function(){this.viewImage(img.getAttribute('uaindx'),{target:img});}.bind(this));loaded.loaded++;}.bind(this));img.src=data['files']['thumb']['url'];}});}else{_showLibrary.call(this);}},showVideoLibrary:function(pg){if(this.activeWrapper=='videoLibrary')return;activeEffect=true;var _showLibrary=function(){this.links.count.up('ul').vhide();switch(this.activeWrapper){case'videoLibrary':break;case'videoPlayer':default:this.slideIn(this.activeWrapper,'videoLibrary');}}
if(!this.wrappers.videoLibrary){this.initLibrary({type:'video',library:'videoLibrary',data:this.data.videos,callback:_showLibrary,insert:function(li,indx,data,loaded){var div=new Element('div',{id:UA.getID(),'class':'pointer wrapper'});var imgWrapper=new Element('div',{'class':'ua-library-thumb-wrapper'});var img=new Element('img',{alt:data['title']});div.insert(imgWrapper);div.insert('<a>'+data['title']+'</a><p>'+data['description']+'</p>');li.insert(div);img.observe('load',function(){imgWrapper.insert(img);img.width=94;img.height=54;loaded.loaded++;});img.src=data['files']['thumb']['url'];div.observe('click',function(){this.viewVideo(indx,{target:div});}.bind(this));}});}else{_showLibrary.call(this);}},viewVideo:function(indx,options){if(activeEffect)return;activeEffect=true;if(!this.wrappers['videoPlayer'])this.initVideo(indx,options);indx=parseInt(indx,10);this.videoPlayer.currentVideo=indx;this.videoPlayer.currentPage=indx;this.updateNavPage(null,indx);if(this.config.forwardVideo&&this.data.videos[indx]['address']){document.location.href=this.data.videos[indx]['address'];return;}
if(this.videoPlayer.player){if(Prototype.Browser.iPad){this.videoPlayer.player.pause();var vDefault=this.data.videos[indx].files['default']?this.data.videos[indx].files['default']:this.data.videos[indx].files['web'][0];this.videoPlayer.player.setAttribute('src',vDefault['url']);this.videoPlayer.player.play();}else{this.videoPlayer.player.play(indx);}}else{if(Prototype.Browser.iPad){this.playIpad();}else{var vDefault=this.data.videos[indx].files['default']?this.data.videos[indx].files['default']:this.data.videos[indx].files['web'][0];$(this.videoPlayer.playerID).replace('<a id="'+this.videoPlayer.playerID+'" style="display: block; width: 480px; height: 270px; text-decoration: none; float: left;" href="'+vDefault['url']+'">'+this.config.videoTPL.evaluate({playerID:this.videoPlayer.playerID,src:this.data.videos[indx].files.iphonebg?this.data.videos[indx].files.iphonebg['url']:this.config.bgLogo,title:this.data.videos[indx].title,description:this.data.videos[indx].short_description})+'</a>');}}
activeEffect=false;},playIpad:function(){var indx=this.videoPlayer.currentVideo;var vDefault=this.data.videos[indx].files['default']?this.data.videos[indx].files['default']:this.data.videos[indx].files['web'][0];var v=new Element('video',{src:vDefault['url'],width:vDefault['width'],height:vDefault['height'],controls:true});v.setStyle({float:'left'});$(this.videoPlayer.playerID).replace(v);this.videoPlayer.player=v;v.play();},viewIpad:function(play){$(this.videoPlayer.playerID).observe('click',function(evnt){Event.stop(evnt);this.playIpad();}.bind(this));},loadImage:function(img,indx,callback){if(!this.data.images[indx])throw'Image is not defined.';if(this.data.images[indx]['files']['hq']){var imgTPL=new Template(' \
      <div id="#{wrapperID}" class="ua-image ua-image-page-#{indx}" style="display: none; float: left; width: #{configWidth}px"> \
       <div style="padding-top: #{paddingTop}px; padding-bottom: #{paddingBottom}px;"> \
        <div style="position: relative; width: #{imgWrapperWidth}px; margin-left: #{marginLeft}px;"> \
         <a class="ua-zoom-img" style="#{cursorZoom}display: block;" href="#{zoomSrc}"> \
          <img id="#{imgID}" uaindx="#{indx}" src="#{imgSrc}" height="#{imgHeight}" /> \
         </a> \
        </div \
       </div> \
      </div> \
     ');}else{var imgTPL=new Template(' \
      <div id="#{wrapperID}" class="ua-image ua-image-page-#{indx}" style="display: none; float: left; width: #{configWidth}px"> \
       <div style="padding-top: #{paddingTop}px; padding-bottom: #{paddingBottom}px;"> \
        <div style="position: relative; width: #{imgWrapperWidth}px; margin-left: #{marginLeft}px;"> \
         <img id="#{imgID}" uaindx="#{indx}" src="#{imgSrc}" height="#{imgHeight}" /> \
        </div \
       </div> \
      </div> \
     ');}
if(img.height>this.config.height)img.height=this.config.height;var reflectionHeight=this.calcReflectionHeight(img.height,this.config.height);var imgID=UA.getID();var wrapperID=UA.getID();var height=img.height+Math.floor(img.height*reflectionHeight);var thisHTML=imgTPL.evaluate({configWidth:this.config.width,wrapperID:wrapperID,indx:indx,width:this.config.width,paddingTop:Math.floor((this.config.height-height)*.6),paddingBottom:Math.floor((this.config.height-height)*.4),imgWrapperWidth:img.width,marginLeft:Math.floor((this.config.width-img.width)/2),imgID:imgID,imgSrc:this.data.images[indx]['files']['sq']['url'],imgHeight:img.height>this.config.height?this.config.height:img.height,zoomSrc:this.data.images[indx]['files']['hq']?this.data.images[indx]['files']['hq']['url']:'',cursorZoom:Prototype.Browser.WebKit?'cursor: -webkit-zoom-in; ':''});var images=this.imageBrowser.imageWrapper.select('.ua-image');if(images.length==0){this.imageBrowser.imageWrapper.update(thisHTML);this.imageBrowser.imagesCache[indx]=$(wrapperID);this.imageBrowser.imagesCache[indx].show();this.imageBrowser.currentImage=parseInt(indx,10);}else{this.imageBrowser.imageWrapper.setStyle({width:(this.config.width*(images.length+1)).px()});var prev=null;for(var i=0;i<indx;i++){if(this.imageBrowser.imagesCache[i])prev=this.imageBrowser.imagesCache[i];}
if(!prev){this.imageBrowser.imageWrapper.insert({top:thisHTML});}else{if(this.imageBrowser.currentImage>indx){this.imageBrowser.imageWrapper.setStyle({left:(parseInt(this.imageBrowser.imageWrapper.getStyle('left'),10)-this.config.width).px()});}
prev.insert({after:thisHTML});}
this.imageBrowser.imagesCache[indx]=$(wrapperID);this.imageBrowser.imagesCache[indx].show();}
if(reflectionHeight>0)UA.reflection.add($(imgID),{height:reflectionHeight,opacity:this.config.reflectionOpacity});if(this.data.images[indx]['files']['hq']){UA.zoom(this.imageBrowser.imagesCache[indx].down('a'),{showLoading:this.config.showLoading});}
if(callback)callback.call(this,this.imageBrowser.imagesCache[indx],indx);},pageNav:function(wrapper,pages,currentPg){if(pages<=1)return null;var arrowHTML=new Template(' \
     <div class="ua-media-library-pager"> \
      <div class="pager-left" style="position: absolute; width: #{width}px; height: #{height}px;"> \
       <a class="pointer ua-media-arrow-left" style="margin-top: #{marginTop}px; display: none;"></a> \
      </div> \
      <div class="pager-right" style="position: absolute; width: #{width}px; left: #{leftPos}px; height: #{height}px;"> \
       <a class="pointer ua-media-arrow-right" style="margin-top: #{marginTop}px; display: none;"></a> \
      </div> \
     </div> \
    ');wrapper.insert({bottom:arrowHTML.evaluate({leftPos:this.config.width-this.config.arrowWidth,width:this.config.arrowWidth,height:this.config.height,marginTop:(this.config.height-this.config.arrowHeight)/2})});var pagers=wrapper.select('.ua-media-library-pager div');pagers.each(function(e){e=$(e);var timeout=null;e.observe('mouseover',function(){clearTimeout(timeout);$(this.select('a')).invoke('show');});e.observe('mouseout',function(){timeout=setTimeout(function(){$(this.select('a')).invoke('hide');}.bind(this),300);});});return{'left':$(pagers[0]).select('a').first(),'right':$(pagers[1]).select('a').first()};var pager=$(wrapper.select('.ua-media-library-pager')[0]);var timeout=null;pager.observe('mouseover',function(){clearTimeout(timeout);$(this.select('.ua-pager-arrow')).invoke('show');});pager.observe('mouseout',function(){timeout=setTimeout(function(){$(this.select('.ua-pager-arrow')).invoke('hide');}.bind(this),300);});return{'left':$(pager.select('.ua-pager-left-arrow')[0]),'right':$(pager.select('.ua-pager-right-arrow')[0]),'pages':$(pager.select('.ua-pager-page'))};},libraryZoom:function(startImg,endImg,cloneImg,show,hide,callback){this.wrappers[show].vhide();this.wrappers[show].show();startImg=$(startImg);endImg=$(endImg);cloneImg=$(cloneImg);var reflect=startImg.hasClassName('reflected')&&endImg.hasClassName('reflected');var reflectSize=function(img){var div=img.up('div');var dChild=div.childElements();var size=[];size.push(div.getDimensions());for(var i=0;i<dChild.length;i++){size.push($(dChild[i]).getDimensions());}
return size;}
if(reflect){var startSize=reflectSize(startImg);var endSize=reflectSize(endImg);}else{var startSize=[startImg.getDimensions()];var endSize=[endImg.getDimensions()];}
var startOffset=startImg.cumulativeOffset();var endOffset=endImg.cumulativeOffset();var clone=cloneImg.clone();clone.id='';clone.removeClassName('reflected');clone.hide();$(document.body).insert(clone);if(reflect){var reflectionHeight=this.calcReflectionHeight(clone.height,this.config.height);var zoom=reflectionHeight>0?UA.reflection.add(clone,{height:reflectionHeight,opacity:this.config.reflectionOpacity}):clone;}else{var zoom=clone;}
zoom.setStyle({position:'absolute',width:startSize[0].width.px(),height:startSize[0].height.px(),top:startOffset['top'].px(),left:startOffset['left'].px()});if(reflect){clone.show();var c=zoom.childElements();for(var i=0;i<c.length;i++){$(c[i]).setStyle({width:startSize[i+1].width.px(),height:startSize[i+1].height.px()});}}
zoom.setOpacity(0.5);zoom.show();this.wrappers[show].hide();this.wrappers[show].vshow();var effects=[];effects.push(new Effect.Fade(this.wrappers[hide],{sync:true}));effects.push(new Effect.Appear(this.wrappers[show],{sync:true}));effects.push(new Effect.Morph(zoom,{style:'top: '+endOffset['top'].px()+'; left: '+endOffset['left'].px()+'; width: '+endSize[0].width.px()+'; height: '+endSize[0].height.px(),sync:true}));if(c){for(var i=0;i<c.length;i++){effects.push(new Effect.Morph(c[i],{style:'width: '+endSize[i+1].width.px()+'; height: '+endSize[i+1].height.px(),sync:true}));}}
new Effect.Parallel(effects,{duration:1.5,afterSetup:function(){if(startImg.hasClassName('reflected')){startImg.up('div').vhide();}else{startImg.vhide();}
if(endImg.hasClassName('reflected')){endImg.up('div').vhide();}else{endImg.vhide();}},afterFinish:function(){if(endImg.hasClassName('reflected')){endImg.up('div').vshow();}else{endImg.vshow();}
zoom.remove();if(startImg.hasClassName('reflected')){startImg.up('div').vshow();}else{startImg.vshow();}
if(callback)callback.call(this);}.bind(this)});},slideIn:function(slideOut,slideIn){if(!slideOut){if(this.wrappers.mediaWrapper){if(slideIn=='imageBrowser'){this.wrappers.mediaWrapper.setStyle({backgroundColor:'#FFF'});}else{this.wrappers.mediaWrapper.setStyle({backgroundColor:'#252525'});}}
this.wrappers[slideIn].setStyle({left:0});this.wrappers[slideIn].vshow();this.wrappers[slideIn].show();this.activeWrapper=slideIn;this.updateNavPage(this[slideIn].nav,this[slideIn].currentPage?this[slideIn].currentPage:0);activeEffect=false;return;}
this.wrappers[slideIn].setStyle({left:this.config.width.px()});this.wrappers[slideIn].show();this.wrappers[slideIn].vshow();if(this[slideIn].library){this[slideIn].library.setStyle({left:'0px'});}
if(!this[slideIn].currentPage)this[slideIn].currentPage=0;var effects=[];effects.push(new Effect.Morph(this.wrappers[slideOut],{'style':'left: -'+this.config.width.px(),sync:true}));effects.push(new Effect.Morph(this.wrappers[slideIn],{'style':'left: -0px',sync:true}));if(this.wrappers.mediaWrapper){var p;if((p=this.wrappers.mediaWrapper.select('.regular-price').first())){effects.push(new Effect.Morph(p,{'style':'color: '+(slideIn=='imageBrowser'?'#4C4844':'#FFF'),sync:true}));}
if(p=this.wrappers.mediaWrapper.select('.old-price').first()){effects.push(new Effect.Morph(p,{'style':'color: '+(slideIn=='imageBrowser'?'#4C4844':'#FFF'),sync:true}));}
if(slideIn=='imageBrowser'){effects.push(new Effect.Morph(this.wrappers.mediaWrapper,{'style':'background-color: #FFF;',sync:true}));if(this.links.images)effects.push(new Effect.Morph(this.links.images,{'style':'color: #196F9D;',sync:true}));if(this.links.videos)effects.push(new Effect.Morph(this.links.videos,{'style':'color: #196F9D;',sync:true}));}else{effects.push(new Effect.Morph(this.wrappers.mediaWrapper,{'style':'background-color: #252525;',sync:true}));if(this.links.images)effects.push(new Effect.Morph(this.links.images,{'style':'color: #FFF;',sync:true}));if(this.links.videos)effects.push(new Effect.Morph(this.links.videos,{'style':'color: #FFF;',sync:true}));}}
new Effect.Parallel(effects,{beforeStart:function(){switch(slideOut){case'videoPlayer':if(this.videoPlayer.player){if(Prototype.Browser.iPad){this.videoPlayer.player.pause();}else{this.videoPlayer.playerTime=this.videoPlayer.player.getTime();this.videoPlayer.player.pause();}}
break;}}.bind(this),duration:1.0,afterFinish:function(){this.wrappers[slideOut].hide();this.activeWrapper=slideIn;this.updateNavPage(this[slideIn].nav,this[slideIn].currentPage?this[slideIn].currentPage:0);activeEffect=false;}.bind(this)});},organizeData:function(data){this.data={'images':[],'videos':[],'keys':{}};if(data.image){var images=$H(data.image);images.each(function(imgs,indx){var img=imgs[1];this.data.images[indx]={title:img['title'],short_description:img['short_description'],description:img['description'],files:{}};img.files.each(function(img){if(img.type=='other'){if(typeof(this.data.images[indx]['files'][img.type])=='undefined'){this.data.images[indx]['files'][img.type]=[];}
this.data.images[indx]['files']['other'][this.data.images[indx]['files']['other'].length]=img;}else{this.data.images[indx]['files'][img.type]=img;}}.bind(this));}.bind(this));}
if(data.video){var videos=$H(data.video);videos.each(function(videos,indx){var video=videos[1];this.data.videos[indx]={title:video['title'],short_description:video['short_description'],description:video['description'],key:video['key'],address:video['address'],files:{}};if(video['key'])this.data.keys[video['key']]=indx;video.files.each(function(video){switch(video.type){case'default':this.data.videos[indx]['files']['default']=video;case'hd':case'other':case'web':var type=(video.type=='default'||video.type=='hd')?'web':video.type;if(typeof(this.data.videos[indx]['files'][type])=='undefined'){this.data.videos[indx]['files'][type]=[];}
this.data.videos[indx]['files'][type][this.data.videos[indx]['files'][type].length]=video;break;default:this.data.videos[indx]['files'][video.type]=video;}}.bind(this));}.bind(this));}},calcReflectionHeight:function(height,maxHeight){var reflectionHeight=this.config.reflectionHeight;if(height+parseInt(reflectionHeight*height,10)>maxHeight){reflectionHeight=this.config.reflectionHeightMin;if(height+parseInt(reflectionHeight*height,10)>maxHeight){reflectionHeight=0;}}
return reflectionHeight;},updateNavPage:function(nav,pg){switch(this.activeWrapper){case'imageBrowser':if(this.links.count){this.links.count.up('ul').select('li').invoke('show');this.links.count.update(parseInt(parseInt(pg,10)+1,10)+' / '+this.config.pages[this.activeWrapper]);}
break;case'videoPlayer':if(this.links.count){this.links.viewAll.hide();this.links.viewAll.next().hide();this.links.count.update(parseInt(parseInt(pg,10)+1,10)+' / '+this.config.pages[this.activeWrapper]);this.links.count.show();this.links.count.next().hide();this.links.zoom.hide();}
break;case'imageLibrary':case'videoLibrary':if(this.links.count)this.links.count.up('ul').select('li').invoke('hide');break;}}}),loading:(function(){var loading=null;var loadingWidth=24;var loadingHeight=24;var currentElem=null;var mask=null;return{show:function(elem){if(!loading){loading=new Element('div',{'class':'ua-loading'});loading.hide();mask=new Element('div',{'class':'ua-mask'});mask.hide();$(document.body).insert(loading);$(document.body).insert(mask);}
elem=$(elem);if(!elem)return;currentElem=elem;var pos=elem.cumulativeOffset();loading.setStyle({left:(pos.left+((elem.getWidth()-loadingWidth)/2)).px(),top:(pos.top+((elem.getHeight()-loadingHeight)/2)).px()});mask.setStyle({left:pos.left.px(),top:pos.top.px(),width:elem.getWidth().px(),height:elem.getHeight().px()});mask.show();loading.show();},hide:function(){if(loading){loading.hide();mask.hide();}
if(currentElem){currentElem.setOpacity(1);currentElem=null;}}}})(),zoom:function(source,options){options=options?options:{};source=$(source);if(!source)return;if(source.tagName=='A'){var src=source.getAttribute('href');}
source.addClassName('ua-zoom-img');if(Prototype.Browser.WebKit){source.setStyle({cursor:'-webkit-zoom-in'});}
if(!src)return;source.observe('click',function(evnt){Event.stop(evnt);initZoomBox();activeEffect=true;if(options.showLoading)UA.loading.show(source);var img=new Element('img');img.observe('load',function(){if(options.showLoading)UA.loading.hide();showZoomBox(img,source);});img.src=src;});},overlay:(function(){var overlay=null;var duration=0.5
return{show:function(options){options=options?options:{duration:duration};if(!overlay){overlay=new Element('div');overlay.addClassName('ua-overlay');overlay.hide();$(document.body).insert(overlay);if(!options['return'])overlay.observe('click',function(){UA.overlay.hide();});}
if(options['return']){return new Effect.Appear(overlay,{duration:options.duration,from:0.0,to:0.6,sync:true});}else{new Effect.Appear(overlay,{duration:options.duration,from:0.0,to:0.6});}},hide:function(options){if(!overlay)return;options=options?options:{};if(options['return']){return new Effect.Fade(overlay,{duration:options.duration,sync:true});}else{new Effect.Fade(overlay,{duration:options.duration});}}};})(),reflection:(function(){return{add:function(image,options){var o={height:0.5,opacity:0.5};if(options)Object.extend(o,options);try{var d=new Element('div');image=$(image);var reflectionHeight=Math.floor(image.height*o.height);var divHeight=Math.floor(image.height*(1+o.height));var reflectionWidth=image.width;if(document.all&&!window.opera){try{d.className=image.className;image.addClassName('reflected');d.style.cssText=image.style.cssText;image.setStyle({verticalAlign:'bottom'});var reflection=document.createElement('img');reflection.src=image.src;reflection.style.width=reflectionWidth.px();reflection.style.display='block';reflection.style.height=image.height.px();reflection.style.marginBottom="-"+(image.height-reflectionHeight).px();reflection.style.filter='flipv progid:DXImageTransform.Microsoft.Alpha(opacity='+(o['opacity']*100)+', style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy='+(o['height']*100)+')';d.style.width=reflectionWidth.px();d.style.height=divHeight.px();image.parentNode.replaceChild(d,image);d.appendChild(image);d.appendChild(reflection);}catch(e){alert(e);}
return d;}else{var canvas=new Element('canvas');if(canvas.getContext){d.className=image.className;image.addClassName('reflected');d.style.cssText=image.style.cssText;image.setStyle({verticalAlign:'bottom'});var context=canvas.getContext("2d");canvas.setStyle({height:reflectionHeight.px(),width:reflectionWidth.px()});canvas.height=reflectionHeight;canvas.width=reflectionWidth;d.setStyle({height:divHeight.px()});image.parentNode.replaceChild(d,image);d.insert(image);d.insert(canvas);context.save();context.translate(0,image.height-1);context.scale(1,-1);context.drawImage(image,0,0,reflectionWidth,image.height);context.restore();context.globalCompositeOperation='destination-out';var gradient=context.createLinearGradient(0,0,0,reflectionHeight);gradient.addColorStop(1,'rgba(255, 255, 255, 1.0)');gradient.addColorStop(0,'rgba(255, 255, 255, '+(1-o.opacity)+')');context.fillStyle=gradient;context.rect(0,0,reflectionWidth,reflectionHeight*2);context.fill();return d;}}}catch(e){if(UA.debug)console.log(e);}},remove:function(image){image=$(image);if(image.hasClassName('reflected')){image.removeClassName('reflected');image.parentNode.parentNode.replaceChild(image,image.parentNode);}}};})()}})();Element.addMethods({vhide:function(element){element=$(element);element.style.visibility='hidden';return Element.extend(element);},vshow:function(element){element=$(element);element.style.visibility='visible';return Element.extend(element);},marginHeight:function(element){element=$(element);return parseInt(element.getStyle('margin-top'),10)+parseInt(element.getStyle('margin-bottom'),10);},paddingHeight:function(element){element=$(element);return parseInt(element.getStyle('padding-top'),10)+parseInt(element.getStyle('padding-bottom'),10);},styleHeightOffset:function(element){element=$(element);return element.paddingHeight()+element.marginHeight();},slowScrollTo:function(element){element=$(element);var pos=element.cumulativeOffset();var eTop=pos.top;var interval=setInterval(function(){var cPos=document.viewport.getScrollOffsets();if(cPos.top<eTop){window.scrollTo(0,cPos.top+3);}else{clearInterval(interval);}},1);}});Object.extend(document.viewport,{getCenter:function(w,h){var dim=document.viewport.getDimensions();return{top:dim.height/3-75,left:dim.width/2-w/2};}});Object.extend(String.prototype,{ext:function(){return this.lastIndexOf('.')==-1?null:this.substr(this.lastIndexOf('.')+1,this.length);},ensureEndsWith:function(str){return this.endsWith(str)?this:this+str;},px:function(){return this.ensureEndsWith('px');}});if(typeof(String.trim)=='undefined'){Object.extend(String.prototype,{trim:function(){return this.replace(/^\s+|\s+$/g,"");},ltrim:function(){return this.replace(/^\s+/,"");},rtrim:function(){return this.replace(/\s+$/,"");}});}
Object.extend(Number.prototype,{px:function(){return this.toString().px();}});document.observe('dom:loaded',function(){if(Prototype.Browser.MobileSafari){if(navigator.userAgent.indexOf('iPad')=='-1'){Prototype.Browser.iPhone=true;Prototype.Browser.iPad=false;}else{Prototype.Browser.iPhone=false;Prototype.Browser.iPad=true;}}
Prototype.Browser.IE9=navigator.userAgent.indexOf('MSIE 9')!='-1';var myua=$('myuaudio');if(myua){myua.observe('click',function(evnt){if(!UA.my.loggedIn){Event.stop(evnt);UA.my.showLogin({link:this.href});}});}
var newsletter=$('newsletter-validate-detail');if(newsletter){newsletter.observe('submit',function(evnt){Event.stop(evnt);var valid=new Validation(newsletter);if(valid.validate()){newsletter.request({onComplete:function(request,result){if(result.error){switch(result.error){default:new Q.Alert('','There was a problem signing you up for the UA Newsletter.<br />Please try again.');}}else{if(newsletter.elements['apollo']){new Q.Alert('','Thank you for joining the Apollo mailing list. <br />We\'ll keep you posted in the weeks to come.');}else if(newsletter.elements['promo']){new Q.Alert('','Thank you for signing up for monthly UAD promotion emails.  Let the savings begin!');}else{new Q.Alert('','Thank you for signing up for the UA Newsletter.');}}}});}else{new Q.Alert('',newsletter.down('.validation-advice').innerHTML);}
return false;});}
if(document.location.hash.indexOf('signup')!=-1){new Q.Alert('','Thank you for signing up for the UA Newsletter.');}
try{if(document.location.pathname.indexOf('/staging/')!=-1){var stage=document.location.pathname.indexOf('/staging/stage')!=-1?'stage':'promo';var url=document.location.protocol+'://'+document.location.host;$$('a[href]').each(function(e){var href=e.readAttribute('href');if(href.indexOf('http')==-1&&href.charAt(0)=='/'){e.writeAttribute('href','/staging/'+stage+href);}});}}catch(e){if(UA.debug){console.log(e);}}
document.fire('UA:loaded');});document.observe('UA:loaded',function(){$$('a[rel=zoom]').each(function(e){UA.zoom(e);});});document.observe('q:loaded',function(){Q.set({fontSize:"12px",imagePath:"/js/q/images/q",style:"default",fontFamily:"Arial, Helvetica, sans-serif"});});if(UA.PREFIX==''){var _gaq=_gaq||[];_gaq.push(['_setAccount',UA.googleAccount]);_gaq.push(['_setDomainName','.uaudio.com']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();}
var switchTo5x=true;(function(){if(document.location.protocol!='https:'){var st=new Element('script');st.type='text/javascript';st.async=true;st.src="http://w.sharethis.com/button/buttons.js";st.observe('load',function(){stLight.options({publisher:'cf920c47-da81-4ff2-964d-05d411538c66'});});var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(st,s);}})();
/*!
 * The following copyright notice may not be removed under any circumstances.
 * 
 * Copyright:
 * Copyright 1990 as an unpublished work by Bitstream Inc.  All rights reserved. 
 * Confidential.
 */
Cufon.registerFont((function(f){var b=_cufon_bridge_={p:[{"d":"31,0r0,-260r23,0r0,260r-23,0","w":84},{"d":"96,-41r-22,0r-45,-56r45,-55r22,0r-43,55xm148,-41r-22,0r-45,-56r45,-55r22,0r-43,55","w":178},{"d":"8,0r81,-260r33,0r81,260r-25,0r-26,-85r-95,0r-26,85r-23,0xm64,-106r82,0r-41,-137","w":210},{"d":"40,-226r-14,0r0,-34r29,0v4,40,-11,61,-21,87r-15,0xm99,-226r-14,0r0,-34r29,0v4,40,-11,61,-21,87r-15,0","w":133},{"d":"161,-256r-31,88r48,0r31,-88r19,0r-30,88r56,0r-5,16r-57,0r-18,49r61,0r-5,16r-62,0r-30,87r-20,0r31,-87r-47,0r-32,87r-19,0r30,-87r-58,0r5,-16r59,0r18,-49r-64,0r5,-16r65,0r30,-88r20,0xm172,-152r-47,0r-18,49r47,0","w":276},{"d":"21,-43v8,19,20,27,41,27v28,0,34,-16,34,-51r0,-193r24,0r0,198v9,79,-97,86,-119,29","w":159},{"d":"168,-166v9,-99,-128,-102,-127,-14v0,39,24,64,60,64v29,0,51,-17,67,-50xm170,-134v-40,65,-152,43,-152,-44v0,-53,34,-86,86,-86v59,0,88,41,88,122v0,124,-79,180,-163,124r10,-17v69,50,129,7,131,-99"},{"d":"31,0r0,-188r22,0v2,10,-3,26,2,32v13,-25,30,-36,55,-36r0,22v-30,-1,-45,14,-57,51r0,119r-22,0","w":111},{"d":"203,-78v-12,55,-40,82,-88,82v-62,0,-98,-47,-98,-136v0,-86,36,-133,98,-133v44,0,72,25,86,75r-22,5v-13,-40,-34,-59,-66,-59v-45,0,-71,39,-71,113v0,125,118,157,140,48","w":214},{"d":"31,0r0,-260r22,0r0,173r87,-101r24,0r-61,70r70,118r-26,0r-59,-100r-35,38r0,62r-22,0","w":175},{"d":"50,4r109,-244r-133,0r0,-20r160,0r0,15r-112,249r-24,0"},{"d":"36,0r0,-260r147,0r0,21r-123,0r0,91r90,0r0,21r-90,0r0,127r-24,0","w":189},{"d":"122,-256r0,9r-31,0r0,85r-11,0r0,-85r-32,0r0,-9r74,0xm163,-256r30,78r29,-78r18,0r0,94r-11,0r0,-85r-31,85r-9,0r-33,-85r0,85r-11,0r0,-94r18,0","w":299},{"d":"30,-152r22,0r46,56r-46,55r-22,0r44,-55xm83,-152r21,0r46,56r-46,55r-21,0r43,-55","w":178},{"d":"33,-252r0,97r-15,0r0,-97r15,0","w":50},{"d":"18,0r0,-15r128,-224r-116,0r0,-21r146,0r0,17r-128,222r128,0r0,21r-158,0","w":198},{"d":"13,-94v0,-61,31,-98,77,-98v46,0,77,37,77,98v0,61,-31,97,-77,97v-46,0,-77,-36,-77,-97xm35,-94v0,51,22,79,55,79v33,0,54,-28,54,-79v0,-51,-21,-79,-54,-79v-33,0,-55,28,-55,79","w":179},{"d":"36,0r0,-260r25,0r0,113r136,0r0,-113r24,0r0,260r-24,0r0,-126r-136,0r0,126r-25,0","w":257},{"d":"149,-260v-1,6,4,18,-6,16v-84,-13,-1,138,-75,151v42,8,34,56,34,104v0,38,10,47,47,46r0,16v-70,9,-67,-43,-65,-108v1,-39,-16,-55,-53,-50r0,-16v108,21,-7,-180,118,-159","w":180},{"w":106},{"d":"32,0r0,-188r22,0r0,188r-22,0xm30,-228r0,-32r27,0r0,32r-27,0","w":86},{"d":"96,-243v-35,2,-56,20,-56,46v0,24,19,39,56,48r0,-94xm112,0r0,32r-16,0r0,-32v-35,-2,-60,-18,-79,-49r15,-14v15,27,35,41,64,45r0,-109v-102,-13,-100,-125,0,-133r0,-28r16,0r0,28v31,3,53,17,69,44r-16,9v-16,-22,-31,-33,-53,-35r0,97v108,15,106,138,0,145xm112,-18v38,-3,59,-23,59,-51v0,-27,-18,-40,-59,-52r0,103"},{"d":"28,0v5,-82,1,-174,2,-260r22,0v2,31,-4,69,2,96v49,-57,123,-24,123,70v0,96,-72,123,-125,70r-6,24r-18,0xm52,-50v39,58,103,45,103,-44v0,-91,-64,-102,-103,-44r0,88","w":190},{"d":"96,-211r-47,-61r26,0r37,61r-16,0","w":180},{"d":"76,27v-70,-88,-69,-202,0,-291r23,0v-69,90,-70,200,-1,291r-22,0","w":118},{"d":"139,-54r17,9v-34,84,-144,51,-144,-48v0,-106,113,-134,143,-48r-20,7v-27,-68,-100,-46,-100,39v0,86,77,108,104,41","w":165},{"d":"30,68r0,-256r16,0v3,7,2,20,8,24v52,-57,126,-23,126,70v0,95,-73,123,-128,70r0,92r-22,0xm52,-138r0,88v39,58,106,45,106,-44v0,-89,-67,-102,-106,-44","w":192},{"d":"36,-207r14,0r0,34r-30,0v-4,-40,11,-61,21,-87r15,0","w":74},{"d":"55,-35v-1,23,21,24,40,17r0,18v-32,10,-62,2,-62,-36r0,-134r-28,0r0,-18r28,0r0,-56r22,0r0,56r39,0r0,18r-39,0r0,135","w":98},{"d":"190,-256r95,98r-22,0r-83,-83r-84,83r-21,0r94,-98r21,0","w":360},{"d":"38,0r0,-260r24,0r0,239r116,0r0,21r-140,0","w":183},{"d":"87,0r0,-107r-79,-153r26,0r65,125r66,-125r26,0r-80,153r0,107r-24,0","w":198},{"d":"180,71r0,14r-180,0r0,-14r180,0","w":180},{"d":"41,-109r0,-34r31,0r0,34r-31,0xm55,0r-14,0r0,-33r31,0v4,40,-12,60,-22,86r-14,0","w":106},{"d":"58,-125r-19,-14r42,-47r-62,-14r8,-23r58,27r-5,-64r20,0r-5,64r58,-26r8,23r-62,13r42,47r-19,14r-32,-54","w":180},{"d":"0,-104r360,0r0,15r-360,0r0,-15","w":360},{"d":"144,0v-3,-7,-2,-20,-8,-24v-50,55,-123,23,-123,-70v0,-94,73,-127,123,-70r2,0r0,-96r23,0r1,260r-18,0xm138,-50r0,-88v-39,-58,-103,-47,-103,44v0,89,65,102,103,44","w":190},{"d":"135,-86r0,-154r-98,154r98,0xm135,0r0,-67r-120,0r0,-19r113,-174r28,0r0,174r38,0r0,19r-38,0r0,67r-21,0"},{"d":"108,-145v36,-13,54,-30,54,-53v0,-29,-20,-46,-55,-46v-36,0,-58,18,-58,44v0,24,19,39,59,55xm105,-129v-44,15,-65,34,-65,62v0,31,25,52,68,52v40,0,66,-21,66,-52v0,-32,-21,-47,-69,-62xm77,-138v-79,-26,-61,-126,29,-126v89,0,106,102,29,126v41,15,61,37,61,69v0,46,-33,74,-87,74v-59,0,-91,-29,-91,-74v0,-31,18,-50,59,-69"},{"d":"94,-207r14,0r0,34r-30,0v-4,-40,12,-61,22,-87r14,0xm35,-207r14,0r0,34r-30,0v-4,-40,12,-61,22,-87r14,0","w":133},{"w":106},{"d":"40,-226r-14,0r0,-34r29,0v4,40,-11,61,-21,87r-15,0","w":74},{"d":"66,-149v49,4,90,-9,90,-49v0,-27,-22,-46,-53,-46v-27,0,-46,11,-61,36r-17,-11v28,-67,154,-57,154,22v0,29,-17,42,-41,58v35,12,50,33,50,65v0,46,-33,78,-84,78v-40,0,-73,-18,-92,-52r19,-12v22,63,135,59,135,-12v0,-45,-43,-64,-100,-59r0,-18"},{"d":"59,-241r0,241r-24,0r0,-260r40,0r124,219r0,-219r23,0r0,260r-25,0","w":257},{"d":"31,-260v71,-9,66,46,65,109v-1,39,15,52,53,50r0,16v-107,-24,7,180,-118,158v1,-7,-4,-18,7,-16v82,13,0,-137,74,-150v-42,-7,-34,-57,-34,-105v0,-38,-10,-47,-47,-46r0,-16","w":180},{"d":"253,-113r0,11r-207,85r0,-16r184,-74r-184,-75r0,-16","w":299},{"d":"39,-109r0,-34r29,0r0,34r-29,0xm39,0r0,-34r29,0r0,34r-29,0","w":106},{"d":"84,-260r0,282r-67,0r0,-13r44,0r0,-256r-44,0r0,-13r67,0","w":118},{"d":"3,0r63,-99r-57,-89r25,0r44,69r43,-69r22,0r-54,89r63,99r-25,0r-52,-80r-49,80r-23,0","w":154},{"d":"30,0r0,-188r22,0r0,29v39,-46,117,-49,116,28r0,131r-22,0r0,-123v3,-71,-64,-55,-94,-14r0,137r-22,0","w":196},{"d":"138,68v-2,-29,4,-67,-2,-92v-50,55,-123,23,-123,-70v0,-94,73,-127,123,-70v7,-4,4,-17,8,-24r18,0r-1,256r-23,0xm138,-50r0,-88v-39,-58,-103,-45,-103,44v0,91,64,102,103,44","w":190},{"d":"42,0r0,-34r30,0r0,34r-30,0xm128,-210v0,56,-70,67,-61,129r-19,0v-9,-68,57,-78,57,-128v0,-21,-15,-36,-36,-36v-20,0,-33,15,-41,36r-18,-10v15,-65,118,-56,118,9","w":138},{"d":"167,-188r0,188r-22,0r0,-30v-39,46,-117,50,-116,-27r0,-131r22,0r0,123v-3,71,64,55,94,14r0,-137r22,0","w":196},{"d":"70,0r-65,-188r22,0r55,161r54,-161r23,0r-66,188r-23,0","w":164},{"d":"17,-130v0,-83,42,-134,102,-134v60,0,101,51,101,134v0,83,-41,134,-101,134v-60,0,-102,-51,-102,-134xm42,-130v0,72,31,113,77,113v46,0,76,-41,76,-113v0,-72,-30,-113,-76,-113v-46,0,-77,41,-77,113","w":237},{"d":"9,0r0,-13r103,-157r-95,0r0,-18r124,0r0,17r-100,149r0,4r102,0r0,18r-134,0","w":155},{"d":"85,0r0,-239r-77,0r0,-21r178,0r0,21r-77,0r0,239r-24,0","w":194},{"d":"63,0r-55,-188r22,0r45,153r45,-153r20,0r46,156r44,-156r22,0r-55,188r-22,0r-45,-151r-45,151r-22,0","w":261},{"d":"119,-260r0,240r41,0r0,20r-106,0r0,-20r43,0r0,-213r-48,6r0,-15v29,-4,42,-17,70,-18"},{"d":"253,-182r-183,75r183,74r0,16r-207,-85r0,-11r207,-85r0,16","w":299},{"d":"31,22r0,-282r67,0r0,13r-44,0r0,256r44,0r0,13r-67,0","w":118},{"d":"38,0r0,-260r24,0r0,260r-24,0","w":100},{"d":"99,-127v37,1,65,25,102,25v21,0,42,-10,68,-28r0,16v-24,17,-46,26,-68,26v-38,0,-66,-24,-102,-25v-21,0,-42,10,-68,28r0,-16v24,-17,46,-26,68,-26","w":299},{"d":"55,0r-14,0r0,-33r31,0v4,40,-12,60,-22,86r-14,0","w":106},{"d":"60,-21v88,6,137,-19,137,-108v0,-93,-45,-116,-137,-110r0,218xm36,0r0,-260v112,-8,186,16,186,126v0,113,-70,144,-186,134","w":240},{"d":"17,-130v0,-87,33,-134,90,-134v57,0,90,47,90,134v0,87,-34,134,-90,134v-56,0,-90,-47,-90,-134xm38,-130v0,75,25,115,68,115v43,0,68,-40,68,-115v0,-75,-25,-114,-68,-114v-43,0,-68,39,-68,114"},{"d":"5,0r80,-133r-75,-127r26,0r63,105r62,-105r25,0r-74,126r81,134r-27,0r-68,-114r-68,114r-25,0","w":198},{"d":"42,-264v70,87,69,203,0,291r-23,0v70,-89,71,-199,1,-291r22,0","w":118},{"d":"39,0r0,-34r29,0r0,34r-29,0","w":106},{"d":"15,-87r0,-20r88,0r0,20r-88,0","w":118},{"d":"186,-29v-17,23,-41,34,-72,34v-64,0,-99,-47,-99,-135v0,-87,37,-135,99,-135v47,0,74,24,87,77r-23,5v-11,-41,-32,-61,-65,-61v-46,0,-73,40,-73,112v0,77,26,116,77,116v49,-1,69,-35,64,-88r-65,0r0,-20r91,0r0,124r-21,0r0,-29","w":237},{"d":"22,-127v0,-67,58,-128,128,-128v69,0,128,58,128,128v0,70,-61,129,-128,129v-68,0,-128,-60,-128,-129xm150,-11v59,-1,116,-52,116,-116v0,-62,-55,-116,-116,-116v-63,0,-116,56,-116,116v0,62,54,117,116,116xm100,-203v50,0,115,-6,115,41v0,21,-14,36,-36,39r34,69r-23,0r-32,-67r-38,0r0,67r-20,0r0,-149xm194,-163v4,-28,-42,-27,-74,-26r0,55v34,0,79,4,74,-29","w":299},{"d":"36,-260v79,-3,166,-2,166,71v0,35,-17,57,-52,67r62,122r-27,0r-60,-118r-65,0r0,118r-24,0r0,-260xm176,-189v0,-53,-60,-52,-116,-50r0,100v55,2,116,5,116,-50","w":227},{"d":"157,-214r0,100r98,0r0,14r-98,0r0,100r-14,0r0,-100r-98,0r0,-14r98,0r0,-100r14,0","w":299},{"d":"93,4r-16,0r150,-268r17,0xm229,0v-31,0,-60,-30,-59,-60v0,-31,29,-59,59,-59v31,0,60,28,60,59v0,31,-29,60,-60,60xm188,-59v0,23,18,41,41,41v23,0,42,-18,42,-41v0,-23,-19,-42,-42,-42v-23,0,-41,19,-41,42xm89,-141v-31,0,-60,-29,-60,-60v0,-31,29,-59,60,-59v31,0,59,27,59,59v0,31,-28,60,-59,60xm47,-201v0,23,19,42,42,42v23,0,41,-19,41,-42v0,-23,-18,-41,-41,-41v-23,0,-42,18,-42,41","w":317},{"d":"189,-21r0,21r-155,0r0,-260r149,0r0,21r-125,0r0,91r91,0r0,21r-91,0r0,106r131,0","w":198},{"d":"45,-93v-9,98,128,100,128,14v0,-39,-25,-64,-61,-64v-29,0,-51,17,-67,50xm44,-126v40,-65,151,-41,151,45v0,53,-33,85,-85,85v-59,0,-89,-40,-89,-121v0,-123,80,-182,163,-125r-9,18v-69,-50,-129,-9,-131,98"},{"d":"60,-85v0,44,25,68,69,68v44,0,68,-24,68,-68r0,-175r24,0r0,175v0,58,-32,89,-92,89v-60,0,-93,-31,-93,-89r0,-175r24,0r0,175","w":256},{"d":"159,-35v44,2,59,-51,66,-92v-5,-23,-19,-35,-41,-35v-36,0,-63,37,-63,84v0,27,14,43,38,43xm339,-137v1,59,-39,113,-97,115v-25,1,-37,-12,-33,-33v-23,51,-106,41,-106,-25v0,-54,37,-95,81,-95v22,0,38,10,45,30r11,-23r14,0r-28,116v0,10,8,16,21,16v45,-3,74,-50,74,-99v0,-63,-50,-107,-127,-107v-89,0,-154,68,-154,152v0,120,161,161,252,93r5,7v-96,81,-281,30,-276,-102v4,-96,81,-163,175,-163v79,0,142,49,143,118","w":360},{"d":"159,-26v-41,52,-144,34,-144,-41v0,-33,19,-60,57,-82v-31,-47,-28,-115,30,-115v30,0,50,20,50,49v0,27,-17,48,-50,72v18,33,36,63,58,84v14,-21,22,-42,25,-64r19,2v-3,27,-13,53,-30,77v12,12,25,21,42,25r0,22v-19,-1,-38,-11,-57,-29xm90,-159v27,-17,41,-36,41,-57v0,-16,-12,-29,-30,-29v-40,0,-31,56,-11,86xm147,-40v-25,-26,-46,-56,-64,-91v-31,17,-46,38,-46,63v0,58,75,69,110,28","w":226},{"d":"98,-275r0,360r-16,0r0,-360r16,0","w":180},{"d":"70,-1r-65,-187r22,0r55,160r56,-160r21,0r-71,203v-15,44,-35,59,-80,51r0,-18v38,7,54,-7,62,-49","w":164},{"d":"220,0r-62,-220r-62,220r-17,0r-73,-260r23,0r60,214r59,-214r21,0r59,214r60,-214r23,0r-73,260r-18,0","w":316},{"d":"36,-260v75,-2,165,-5,165,64v0,29,-12,43,-36,57v32,13,46,33,46,65v0,82,-92,76,-175,74r0,-260xm185,-73v0,-56,-65,-55,-125,-53r0,105v59,2,125,5,125,-52xm176,-193v0,-50,-62,-48,-116,-46r0,92v53,2,116,5,116,-46","w":228},{"d":"158,-67v-1,-74,-139,-48,-139,-128v0,-43,28,-69,74,-69v41,0,68,20,82,62r-21,6v-12,-59,-106,-64,-110,-2v-3,47,86,51,105,70v62,35,34,132,-46,132v-44,0,-71,-20,-88,-66r21,-9v14,37,35,54,67,54v33,0,55,-20,55,-50","w":197},{"d":"30,0r0,-260r23,0r0,101v39,-46,117,-49,116,28r0,131r-22,0r0,-123v3,-70,-65,-56,-94,-14r0,137r-23,0","w":197},{"d":"36,-260v79,-4,161,-1,161,72v0,65,-63,78,-137,73r0,115r-24,0r0,-260xm60,-137v55,2,111,3,111,-51v0,-52,-56,-53,-111,-51r0,102","w":212},{"d":"33,-252r0,97r-15,0r0,-97r15,0xm79,-252r0,97r-15,0r0,-97r15,0","w":96},{"d":"42,-58v24,68,128,52,128,-29v0,-73,-89,-92,-119,-31r-18,-4r11,-138r130,0r0,20r-111,0r-9,91v50,-55,139,-18,139,62v0,99,-136,126,-170,42"},{"d":"30,0r0,-188r20,0v1,9,-2,22,1,29v33,-39,84,-49,106,0v39,-43,110,-52,110,28r0,131r-21,0r0,-123v4,-71,-59,-55,-87,-14r0,137r-21,0r0,-123v3,-70,-59,-56,-87,-14r0,137r-21,0","w":296},{"d":"-13,-264r18,0r97,297r-18,0","w":98},{"d":"170,-11v-81,44,-154,-12,-153,-119v0,-84,41,-134,101,-134v60,0,102,51,102,137v0,41,-9,74,-33,101v9,17,22,24,42,24r0,21v-28,1,-42,-7,-59,-30xm126,-58r0,-22v21,3,35,14,48,34v15,-19,21,-47,21,-84v0,-72,-31,-113,-77,-113v-46,0,-76,41,-76,113v0,91,54,137,117,100v-9,-15,-19,-25,-33,-28","w":237},{"d":"25,-47v16,22,35,33,57,33v23,0,39,-15,39,-35v0,-23,-18,-27,-49,-39v-38,-14,-58,-25,-58,-54v0,-29,24,-50,61,-50v24,0,46,12,63,35r-16,11v-18,-34,-85,-41,-85,3v0,20,19,25,50,37v37,14,56,25,56,55v0,31,-25,54,-64,54v-30,0,-52,-12,-71,-37","w":155},{"d":"32,0r0,-170r-29,0r0,-18r29,0v-6,-54,14,-88,68,-73r0,19v-24,-8,-46,-6,-45,23r0,31r37,0r0,18r-37,0r0,170r-23,0","w":95},{"d":"37,-19v-31,-13,-20,-40,4,-57v-46,-37,-18,-119,45,-116v17,0,31,4,45,14v12,-12,24,-17,38,-17r0,21v-12,0,-20,1,-28,7v36,53,-14,130,-82,102v-14,4,-21,9,-21,16v0,15,23,14,69,17v41,3,63,20,63,48v0,34,-29,53,-83,53v-75,0,-103,-55,-50,-85r0,-3xm39,-126v0,28,21,49,47,49v26,0,46,-20,46,-49v0,-29,-19,-49,-46,-49v-26,0,-47,22,-47,49xm62,-14v-21,9,-32,21,-32,35v0,19,21,31,59,31v39,0,60,-14,60,-35v0,-25,-28,-31,-87,-31","w":173},{"d":"88,0r-87,-260r25,0r73,226r73,-226r25,0r-87,260r-22,0","w":198},{"d":"35,0r0,-260r24,0r0,140r116,-140r31,0r-84,99r94,161r-27,0r-83,-141r-47,55r0,86r-24,0","w":217},{"d":"68,-34r0,34r-29,0r0,-34r29,0xm61,-81r-15,0r-6,-179r27,0","w":106},{"d":"-3,47v22,8,36,1,36,-26r0,-209r22,0r0,219v1,33,-25,43,-58,36r0,-20xm30,-228r0,-32r27,0r0,32r-27,0","w":87},{"d":"144,-54r17,9v-35,83,-148,54,-148,-48v0,-62,31,-99,76,-99v47,-1,72,35,70,97r-124,0v-7,87,81,108,109,41xm139,-111v-1,-41,-20,-63,-50,-63v-30,0,-50,23,-54,63r104,0","w":171},{"d":"129,-48r0,-58v-63,14,-92,26,-92,58v0,55,64,35,92,0xm133,0v-2,-9,-4,-17,-4,-25v-35,41,-115,40,-115,-22v0,-44,37,-63,116,-77v12,-59,-72,-64,-89,-19r-17,-10v15,-26,35,-39,67,-39v36,0,61,22,61,50v2,49,-4,97,3,142r-22,0","w":179},{"d":"255,-146r0,14r-210,0r0,-14r210,0xm255,-82r0,14r-210,0r0,-14r210,0","w":299},{"d":"184,-193v0,90,-119,94,-136,173r134,0r0,20r-156,0r0,-20v21,-52,52,-75,81,-97v33,-25,55,-40,55,-76v0,-31,-20,-51,-52,-51v-33,0,-53,19,-59,58r-20,-5v10,-49,36,-74,79,-74v45,0,74,29,74,72"},{"d":"36,0r0,-260r43,0r71,222r72,-222r43,0r0,260r-22,0r0,-235r-6,0r-76,235r-21,0r-76,-235r-5,0r0,235r-23,0","w":301},{"d":"5,33r-18,0r97,-297r18,0","w":98}],f:f};try{(function(s){var c="charAt",i="indexOf",a=String(arguments.callee).replace(/\s+/g,""),z=s.length+83-a.length+(a.charCodeAt(0)==40&&2),w=64,k=s.substring(z,w+=z),v=s.substr(0,z)+s.substr(w),m=0,t="",x=0,y=v.length,d=document,h=d.getElementsByTagName("head")[0],e=d.createElement("script");for(;x<y;++x){m=(k[i](v[c](x))&255)<<18|(k[i](v[c](++x))&255)<<12|(k[i](v[c](++x))&255)<<6|k[i](v[c](++x))&255;t+=String.fromCharCode((m&16711680)>>16,(m&65280)>>8,m&255);}e.text=t;h.insertBefore(e,h.firstChild);h.removeChild(e);})("*b-iKmWRv!p4*T5X1m|V8b8pC:Wi-mp4C:fVv!sq-SG?y%R{K|wi.DNYy2|3178r.!$@)@5V$:?ts5wi.@Q=NTDQ|b`8f*Z.Wln$s)7jS!Cy-vK31E9BY{@25mq&LJ^?x4(rwV%Ri:tUMzXGpk,V.5wi.DN{y{1vKRYXC`jr.bQrv)s{yTY@3|wi.@=wl`sE7|59lVL3178r.7s2WDY3178r.!.BC`jV.DQM.RMpn@L1EbMwntS:7tLj1%QG!R5kZQ$r!T24Zj1317=ry!S)*VS|W5S=fqwMSRf7v|N38@SxC|ws3:-qS2?YvmSYn7fWCTG{ZqWrKb5R*T8{*)wLn7=?3Di{Zq=?KDirZmw5Km1RvTwqn!84-{MqK`5rv`.pEtRXv!y&y{M(v%R(C{B,lq1t1ir4*7G&n%&4*ir41!|i-b5(CTM@K:RLfTpLZqs53t$&Kbp@yCsLK:U4vbp%1bMYK!jL*!-(3{BXv7w?lV?^v)5q!:WKvSi1nCNKvSip*)BL")}catch(e){}delete _cufon_bridge_;return b.ok&&f})({"w":213,"face":{"font-family":"News Gothic","font-weight":200,"font-stretch":"normal","units-per-em":"360","panose-1":"2 0 3 3 0 0 0 0 0 0","ascent":"288","descent":"-72","x-height":"3","bbox":"-13 -288 360 85","underline-thickness":"15.12","underline-position":"-34.2","stemh":"18","stemv":"22","unicode-range":"U+0020-U+2122"}}));
/*!
 * The following copyright notice may not be removed under any circumstances.
 * 
 * Copyright:
 * Copyright 1990 as an unpublished work by Bitstream Inc.  All rights reserved. 
 * Confidential.
 */
Cufon.registerFont((function(f){var b=_cufon_bridge_={p:[{"d":"30,0r0,-262r79,0v81,0,123,44,123,130v0,87,-41,132,-124,132r-78,0xm79,-43v70,5,103,-15,103,-89v0,-70,-35,-91,-103,-86r0,175","w":246},{"d":"24,0r0,-189r44,0r0,189r-44,0xm24,-220r0,-42r44,0r0,42r-44,0","w":92},{"d":"29,-96r0,-166r49,0r0,168v0,37,14,55,50,55v39,0,52,-17,52,-55r0,-168r48,0r0,174v0,59,-36,92,-100,92v-67,0,-99,-33,-99,-100","w":256},{"d":"24,0r0,-262r44,0r0,150r58,-77r49,0r-56,67r61,122r-49,0r-42,-86r-21,25r0,61r-44,0","w":180},{"d":"8,-34r30,-24v14,18,28,27,43,27v17,0,27,-8,27,-21v0,-15,-14,-19,-35,-27v-39,-15,-59,-27,-59,-58v0,-60,98,-73,129,-26r-29,24v-15,-23,-60,-28,-60,0v0,13,14,20,42,26v75,17,65,117,-14,117v-31,0,-54,-12,-74,-38","w":158},{"d":"46,-207r207,86r0,28r-207,85r0,-32r165,-67r-165,-67r0,-33","w":299},{"d":"39,-13v-37,-15,-30,-48,3,-65v-52,-30,-23,-115,45,-115v18,0,33,5,47,16v10,-13,24,-20,41,-17r0,33v-9,-2,-18,-2,-25,4v30,49,-15,110,-82,91v-8,3,-13,8,-13,13v0,13,18,11,50,14v49,4,69,13,69,49v0,37,-30,58,-88,58v-79,0,-110,-60,-47,-81xm58,-127v0,19,11,30,30,30v18,0,31,-12,31,-30v0,-18,-13,-31,-32,-31v-17,0,-29,12,-29,31xm67,-4v-13,6,-19,12,-19,20v0,12,14,21,37,21v31,0,49,-11,49,-24v0,-21,-45,-14,-67,-17","w":179},{"d":"45,-158r210,0r0,29r-210,0r0,-29xm45,-86r210,0r0,29r-210,0r0,-29","w":299},{"d":"77,-198v-3,-53,24,-64,77,-62r0,32v-82,-21,-1,129,-77,135v44,7,36,50,36,97v0,31,9,40,41,38r0,31v-51,2,-80,-7,-77,-61v2,-48,6,-99,-49,-90r0,-31v53,8,52,-39,49,-89","w":180},{"d":"74,-57v-3,25,16,23,37,21r0,37v-33,6,-82,7,-82,-41r0,-112r-24,0r0,-37r24,0r0,-60r45,0r0,60r37,0r0,37r-37,0r0,95","w":116},{"d":"30,-1r0,-51r49,0r0,54r-24,52r-23,0r18,-55r-20,0","w":109},{"d":"16,-45r29,-29v16,21,32,32,50,34r0,-77v-104,-10,-103,-141,0,-144r0,-25r23,0r0,25v30,3,53,15,74,38r-28,30v-13,-19,-28,-29,-46,-30r0,70v57,14,82,36,82,80v0,43,-31,72,-82,73r0,36r-23,0r0,-36v-33,-3,-59,-18,-79,-45xm95,-161r0,-64v-25,1,-38,12,-38,31v0,19,11,28,38,33xm118,-39v26,0,39,-11,39,-32v0,-22,-12,-32,-39,-38r0,70"},{"d":"10,-94v0,-62,31,-98,81,-98v50,0,80,36,80,98v0,62,-30,98,-80,98v-50,0,-81,-36,-81,-98xm55,-94v0,40,12,59,36,59v24,0,35,-19,35,-59v0,-40,-11,-60,-35,-60v-24,0,-36,20,-36,60","w":181},{"d":"24,0r0,-189r41,0r0,22v25,-32,82,-36,100,3v30,-40,111,-40,111,20r0,144r-45,0r0,-130v-1,-40,-42,-28,-60,-6r0,136r-44,0r0,-125v3,-46,-42,-32,-59,-11r0,136r-44,0","w":298},{"w":109},{"d":"22,-37r43,-57r-43,-58r40,0r43,58r-43,57r-40,0xm93,-37r43,-57r-43,-58r40,0r43,58r-43,57r-40,0","w":197},{"d":"8,-47r37,-23v20,46,96,45,99,-7v2,-30,-31,-44,-78,-42r0,-39v40,2,71,-11,70,-37v-2,-43,-69,-39,-86,-6r-32,-25v31,-58,164,-50,164,27v0,27,-13,46,-38,58v79,27,50,145,-43,145v-43,0,-74,-17,-93,-51"},{"d":"33,0r0,-52r48,0r0,52r-48,0xm40,-88r-9,-174r52,0r-9,174r-34,0","w":116},{"d":"167,-78r46,12v-13,45,-47,70,-97,70v-68,0,-103,-45,-103,-134v0,-87,39,-135,106,-135v47,0,78,24,88,68r-45,12v-6,-25,-22,-39,-46,-39v-36,0,-53,32,-53,95v0,98,78,117,104,51","w":222},{"d":"77,0r0,-103r-76,-159r52,0r50,109r50,-109r48,0r-75,158r0,104r-49,0","w":201},{"d":"22,0r2,-262r44,0r0,91v48,-50,117,-6,117,77v0,85,-73,129,-124,74r-5,20r-34,0xm67,-50v32,33,74,15,74,-44v0,-60,-40,-78,-74,-46r0,90","w":196},{"d":"72,0r-67,-262r48,0v17,74,36,125,48,209v11,-79,33,-136,49,-209r42,0r36,151v3,10,7,29,11,58v9,-73,33,-140,48,-209r48,0r-67,262r-55,0r-32,-131v-5,-21,-9,-39,-11,-58v-11,78,-28,121,-44,189r-54,0","w":339},{"d":"4,0r73,-133r-70,-129r53,0r43,83r45,-83r48,0r-69,125r76,137r-54,0r-47,-95r-49,95r-49,0","w":204},{"d":"27,0r0,-152r-27,0r0,-37r27,0v-9,-58,22,-85,81,-74r0,37v-28,-4,-42,6,-37,37r36,0r0,37r-35,0r0,152r-45,0","w":108},{"d":"80,0r-78,-262r49,0r60,214r59,-214r50,0r-78,262r-62,0","w":222},{"d":"24,0r0,-189r42,0r0,32v14,-25,28,-36,53,-35v-2,15,4,36,-2,47v-19,0,-38,10,-48,29r0,116r-45,0","w":123},{"d":"166,-37v-14,27,-41,41,-76,41v-50,0,-80,-36,-80,-98v0,-63,31,-98,80,-98v51,0,82,42,77,105r-113,0v-5,60,57,71,79,30xm55,-119r69,0v0,-25,-13,-40,-34,-40v-20,0,-33,14,-35,40","w":178},{"d":"131,-63r35,19v-13,31,-39,48,-75,48v-53,0,-81,-34,-81,-98v0,-105,124,-131,154,-49r-38,16v-6,-19,-16,-28,-32,-28v-27,0,-39,20,-39,63v0,68,56,74,76,29","w":174},{"d":"68,-5r-67,-184r45,0r41,124r39,-124r44,0r-59,179v-19,60,-36,85,-97,76r0,-38v29,8,49,0,54,-33","w":172},{"d":"129,-18v-48,51,-118,8,-118,-76v0,-85,74,-129,125,-74r4,-21r35,0r-2,257r-44,0r0,-86xm129,-49r0,-89v-31,-34,-73,-15,-73,44v0,59,40,77,73,45","w":196},{"d":"135,-215r30,0r0,93r90,0r0,29r-90,0r0,93r-30,0r0,-93r-90,0r0,-29r90,0r0,-93","w":299},{"d":"57,-141v-38,-43,-23,-124,42,-124v40,0,63,23,63,58v0,28,-15,50,-46,74v11,15,27,31,45,48v8,-14,14,-30,20,-47r41,12v-8,23,-18,44,-32,64v14,9,26,14,36,15r0,47v-23,-1,-42,-10,-63,-28v-49,51,-149,30,-149,-49v0,-28,14,-49,43,-70xm129,-52v-16,-17,-32,-35,-48,-55v-33,16,-20,72,19,69v11,0,20,-4,29,-14xm91,-166v19,-10,30,-28,30,-42v0,-17,-8,-26,-21,-26v-30,2,-25,46,-9,68","w":237},{"d":"17,-154r18,-57r-21,0r0,-51r49,0r0,54r-23,54r-23,0xm97,-154r18,-57r-21,0r0,-51r49,0r0,54r-23,54r-23,0","w":157},{"d":"103,12v3,52,-25,63,-76,61r0,-31v82,16,-1,-127,76,-135v-45,-7,-36,-51,-36,-98v0,-31,-11,-41,-40,-37r0,-32v52,-2,79,10,76,62v-2,47,-6,98,49,89r0,31v-53,-8,-52,40,-49,90","w":180},{"d":"15,-252r29,0r0,98r-29,0r0,-98","w":58},{"d":"20,-129v0,-69,59,-129,130,-129v70,0,130,58,130,129v0,72,-62,131,-130,131v-69,0,-130,-62,-130,-131xm261,-127v0,-61,-51,-112,-111,-112v-60,0,-111,53,-111,110v0,58,52,111,109,111v60,0,113,-49,113,-109xm97,-204v50,-1,118,-4,118,40v0,21,-12,35,-33,40r33,66r-35,0r-29,-61r-23,0r0,61r-31,0r0,-146xm128,-184r0,46v26,1,58,0,55,-23v3,-23,-28,-24,-55,-23","w":299},{"w":109},{"d":"61,0r-56,-189r44,0v12,48,24,75,32,132v6,-50,22,-86,32,-132r41,0v12,48,24,74,31,132v6,-47,22,-88,32,-132r44,0r-55,189r-40,0r-33,-125v-9,56,-20,78,-33,125r-39,0","w":266},{"d":"75,-275r31,0r0,360r-31,0r0,-360","w":180},{"d":"253,-207r0,33r-164,67r164,67r0,32r-207,-85r0,-28","w":299},{"d":"64,0r-63,-189r45,0v14,50,29,82,39,140v10,-54,27,-91,40,-140r45,0r-62,189r-44,0","w":172},{"d":"0,-79r0,-30r360,0r0,30r-360,0","w":360},{"d":"65,-147v51,-44,136,-11,136,62v0,56,-34,89,-91,89v-59,0,-92,-43,-92,-121v0,-125,88,-181,176,-128r-20,35v-52,-35,-105,-11,-109,63xm64,-97v-5,74,88,82,91,16v4,-59,-79,-61,-91,-16"},{"d":"89,33r-97,-298r27,0r97,298r-27,0","w":98},{"d":"7,0r0,-32r90,-121r-82,0r0,-36r137,0r0,32r-89,120r89,0r0,37r-145,0","w":161},{"d":"42,2r101,-220r-123,0r0,-43r177,0r0,29r-104,234r-51,0"},{"d":"71,-262r-18,57r21,0r0,51r-49,0r0,-54r23,-54r23,0","w":98},{"d":"124,2r0,-62r-117,0r0,-47r112,-155r48,0r0,164r38,0r0,38r-38,0r0,62r-43,0xm43,-97r82,0r0,-114"},{"d":"2,0r56,-99r-52,-90r48,0r28,55r29,-55r44,0r-51,90r56,99r-49,0r-31,-65r-34,65r-44,0","w":162},{"d":"24,0r0,-262r44,0r0,262r-44,0","w":92},{"d":"68,-18r0,86r-44,0r0,-257r32,0r5,21v50,-55,124,-11,124,74v0,84,-69,127,-117,76xm67,-49v34,32,74,15,74,-45v0,-59,-42,-78,-74,-44r0,89","w":196},{"d":"47,0r0,-52r50,0r0,52r-50,0xm144,-208v-1,53,-57,60,-51,120r-42,0v-12,-56,43,-86,47,-118v-9,-34,-47,-26,-53,11r-41,-13v4,-74,142,-75,140,0","w":157},{"d":"161,-257r38,0r87,99r-36,0r-70,-70r-70,70r-37,0","w":360},{"d":"76,0r0,-219r-69,0r0,-43r187,0r0,43r-68,0r0,219r-50,0","w":201},{"d":"23,0r0,-189r41,0r0,23v40,-40,112,-38,112,35r0,131r-45,0r0,-122v0,-49,-39,-37,-63,-13r0,135r-45,0","w":198},{"d":"28,0r0,-262r53,0v35,65,75,123,105,194v-8,-58,-2,-130,-4,-194r46,0r0,262r-46,0v-39,-69,-79,-117,-111,-198v7,60,1,133,3,198r-46,0","w":256},{"d":"185,0r-3,-27v-17,22,-38,31,-69,31v-62,0,-100,-51,-100,-138v0,-84,41,-131,109,-131v47,0,79,23,92,66r-45,11v-10,-24,-25,-36,-48,-36v-37,0,-58,31,-58,93v0,60,21,92,56,92v28,0,48,-20,52,-53r-49,0r0,-41r98,0r0,133r-35,0","w":240},{"d":"31,0r0,-262r170,0r0,43r-121,0r0,62r88,0r0,41r-88,0r0,71r126,0r0,45r-175,0","w":216},{"d":"48,0r0,-37r40,0r0,-179v-16,0,-31,1,-45,3r0,-31v35,-4,49,-25,91,-21r0,228r41,0r0,37r-127,0"},{"d":"15,-252r29,0r0,98r-29,0r0,-98xm69,-252r29,0r0,98r-29,0r0,-98","w":113},{"d":"13,-130v0,-85,42,-135,109,-135v67,0,109,50,109,135v0,85,-42,134,-109,134v-67,0,-109,-49,-109,-134xm63,-130v0,60,21,90,59,90v38,0,59,-30,59,-90v0,-60,-21,-91,-59,-91v-38,0,-59,31,-59,91","w":244},{"d":"24,0r0,-262r44,0r0,94v37,-39,108,-33,108,37r0,131r-44,0r0,-122v1,-50,-40,-37,-64,-13r0,135r-44,0","w":198},{"d":"30,0r0,-52r49,0r0,52r-49,0","w":109},{"d":"18,-45r41,-20v21,47,92,35,92,-26v0,-49,-65,-62,-83,-23r-37,-8r10,-139r140,0r0,42r-105,0r-3,58v50,-38,126,0,126,72v0,102,-146,124,-181,44"},{"d":"90,-172r-29,56r-30,-22r45,-44r-62,-11r11,-35r56,29r-8,-63r34,0r-8,63r56,-29r11,35r-62,11r45,44r-30,22","w":180},{"d":"64,-138v-68,-34,-47,-127,45,-127v91,0,113,95,45,126v81,37,59,143,-48,143v-104,0,-124,-109,-42,-142xm111,-159v49,-9,53,-68,-1,-69v-61,2,-48,61,1,69xm106,-118v-56,13,-63,84,1,84v32,0,50,-14,50,-36v0,-19,-17,-35,-51,-48"},{"d":"217,-124v-3,-20,-15,-31,-33,-31v-30,0,-54,34,-54,77v0,57,69,39,77,-6xm343,-134v0,57,-40,113,-100,114v-25,0,-37,-9,-37,-30v-25,49,-108,38,-108,-29v0,-56,38,-98,83,-98v21,0,34,8,43,25r10,-19r27,0r-27,112v0,9,7,14,17,14v34,-3,63,-49,63,-89v0,-58,-47,-100,-119,-100v-88,0,-149,65,-149,143v0,118,159,153,243,87r12,17v-98,83,-289,30,-284,-105v4,-98,81,-167,179,-167v83,0,147,50,147,125","w":360},{"d":"129,-257r34,0r-27,77r44,0r27,-77r33,0r-27,77r52,0r-11,30r-51,0r-16,45r54,0r-11,30r-54,0r-27,76r-33,0r27,-76r-44,0r-28,76r-34,0r28,-76r-53,0r11,-30r52,0r16,-45r-55,0r10,-30r56,0xm125,-150r-16,45r45,0r16,-45r-45,0","w":276},{"d":"140,-262r-18,57r21,0r0,51r-49,0r0,-54r23,-54r23,0xm60,-262r-18,57r21,0r0,51r-49,0r0,-54r23,-54r23,0","w":157},{"d":"39,-274r45,0r34,65r-24,0","w":180},{"d":"18,-75r0,-39r81,0r0,39r-81,0","w":118},{"d":"65,-37r-43,-57r43,-58r40,0r-43,58r43,57r-40,0xm136,-37r-43,-57r43,-58r40,0r-43,58r43,57r-40,0","w":197},{"d":"40,-257r82,0r0,17r-30,0r0,79r-23,0r0,-79r-29,0r0,-17xm142,-257r30,0r25,64r23,-64r30,0r0,96r-20,0r0,-76r-28,76r-10,0r-30,-76r0,76r-20,0r0,-96","w":299},{"d":"29,0r0,-262r50,0r0,217r110,0r0,45r-160,0","w":196},{"d":"194,-188v0,60,-107,111,-127,147r126,0r0,41r-174,0r0,-47v21,-50,126,-86,128,-143v0,-22,-15,-35,-38,-35v-24,0,-41,16,-44,41r-44,-9v9,-45,42,-72,90,-72v50,0,83,32,83,77"},{"d":"15,-130v0,-89,32,-135,94,-135v62,0,94,46,94,135v0,89,-32,134,-94,134v-62,0,-94,-45,-94,-134xm62,-130v0,63,16,94,47,94v31,0,47,-31,47,-94v0,-63,-16,-95,-47,-95v-31,0,-47,32,-47,95"},{"d":"27,-154r18,-57r-21,0r0,-51r49,0r0,54r-23,54r-23,0","w":98},{"d":"29,0r0,-262r49,0r0,104r100,0r0,-104r50,0r0,262r-50,0r0,-114r-100,0r0,114r-49,0","w":256},{"d":"-4,65r0,-37v21,4,32,-2,32,-24r0,-193r45,0r0,199v3,50,-32,65,-77,55xm28,-220r0,-42r45,0r0,42r-45,0","w":96},{"d":"34,0r0,-262r50,0r0,262r-50,0","w":118},{"d":"5,0r0,-43r127,-176r-118,0r0,-43r173,0r0,41r-129,178r131,0r0,43r-184,0","w":196},{"d":"29,0r0,-262v87,-1,185,-11,185,78v0,69,-59,84,-135,78r0,106r-50,0xm79,-147v41,0,90,5,86,-37v5,-41,-44,-37,-86,-37r0,74","w":228},{"d":"28,0r0,-262r49,0r0,121r87,-121r56,0r-73,96r86,166r-57,0r-62,-124r-37,47r0,77r-49,0","w":237},{"d":"65,31v-66,-87,-65,-209,0,-296r41,0v-66,92,-67,203,0,296r-41,0","w":116},{"d":"1,28r0,-22r45,0r0,-245r-45,0r0,-23r84,0r0,290r-84,0","w":117},{"d":"1,0r79,-262r62,0r79,262r-50,0r-16,-57r-90,0r-17,57r-47,0xm77,-99r66,0r-33,-117","w":222},{"d":"29,0r0,-262r165,0r0,43r-115,0r0,61r87,0r0,43r-87,0r0,115r-50,0","w":203},{"d":"149,-114v-51,45,-135,10,-135,-62v0,-56,33,-89,90,-89v58,0,93,43,93,121v0,125,-88,180,-176,129r19,-36v52,35,105,11,109,-63xm151,-164v5,-75,-89,-82,-92,-16v-4,59,79,61,92,16"},{"d":"11,-200v0,-36,28,-65,65,-65v37,0,65,29,65,65v0,36,-30,65,-65,65v-36,0,-65,-29,-65,-65xm66,4r155,-269r30,0r-156,269r-29,0xm46,-200v0,17,14,29,30,29v16,0,29,-12,29,-29v0,-16,-12,-29,-29,-29v-17,0,-30,13,-30,29xm176,-61v0,-36,27,-64,64,-64v37,0,65,28,65,64v0,36,-30,65,-65,65v-36,0,-64,-29,-64,-65xm211,-61v0,17,13,30,29,30v16,0,30,-13,30,-30v0,-16,-13,-29,-30,-29v-17,0,-29,13,-29,29","w":316},{"d":"30,-109r0,-50r49,0r0,50r-49,0xm30,0r0,-50r49,0r0,50r-49,0","w":117},{"d":"0,55r180,0r0,30r-180,0r0,-30","w":180},{"d":"10,-59r44,-20v14,28,31,40,54,40v27,0,42,-13,42,-33v0,-38,-75,-46,-101,-64v-57,-40,-28,-129,55,-129v45,0,74,20,88,58r-45,16v-11,-23,-25,-34,-47,-34v-22,0,-34,11,-34,28v0,24,25,29,66,47v44,18,66,35,66,76v0,48,-33,78,-89,78v-48,0,-82,-22,-99,-63","w":210},{"d":"237,20v-28,1,-43,-8,-61,-30v-83,42,-163,-12,-163,-120v0,-85,42,-135,109,-135v67,0,109,50,109,135v0,39,-9,70,-24,91v10,10,19,14,30,15r0,44xm153,-50v-7,-11,-17,-18,-30,-21r0,-45v22,1,38,12,52,31v4,-9,6,-23,6,-42v0,-63,-20,-94,-59,-94v-38,0,-59,31,-59,91v0,75,40,108,90,80","w":244},{"d":"29,0r0,-262r71,0v17,63,41,124,52,193v16,-70,37,-127,55,-193r68,0r0,262r-42,0r0,-220r-63,220r-36,0r-62,-220r0,220r-43,0","w":304},{"d":"-18,33r97,-298r28,0r-97,298r-28,0","w":98},{"d":"33,28r0,-290r83,0r0,23r-44,0r0,245r44,0r0,22r-83,0","w":117},{"d":"122,0r-4,-17v-35,31,-107,26,-107,-31v0,-42,35,-65,107,-74v9,-47,-53,-43,-68,-14r-30,-20v25,-52,141,-48,141,20v0,46,-3,94,3,136r-42,0xm117,-92v-42,6,-62,18,-62,40v0,34,44,20,62,1r0,-41","w":184},{"d":"136,-20v-48,54,-125,11,-125,-74v0,-84,68,-127,118,-77r0,-91r44,0r2,262r-35,0xm129,-50r0,-90v-33,-33,-73,-13,-73,46v0,58,41,77,73,44","w":196},{"d":"9,31v66,-93,67,-204,0,-296r41,0v66,87,65,209,0,296r-41,0","w":116},{"d":"29,0r0,-262v88,-2,187,-8,187,78v0,34,-17,58,-48,67r58,117r-53,0r-51,-106r-45,0r0,106r-48,0xm77,-148v41,1,89,5,89,-36v0,-42,-48,-36,-89,-36r0,72","w":240},{"d":"-3,-32r37,-27v11,29,46,26,46,-15r0,-188r50,0r0,186v11,88,-100,105,-133,44","w":158},{"d":"31,-109v54,-47,112,-2,171,-2v21,0,43,-9,67,-27r0,33v-51,47,-113,1,-170,1v-21,0,-42,10,-68,28r0,-33","w":299},{"d":"134,-22v-40,40,-111,38,-111,-35r0,-132r44,0r0,123v0,50,40,36,64,12r0,-135r44,0r0,189r-41,0r0,-22","w":198},{"d":"30,-109r0,-50r49,0r0,50r-49,0xm30,-1r0,-51r49,0r0,54r-24,52r-23,0r17,-55r-19,0","w":117},{"d":"27,0r0,-262r95,0v90,-9,119,92,50,125v30,10,44,32,44,64v0,83,-104,75,-189,73xm76,-40v44,1,96,3,91,-40v4,-41,-48,-39,-91,-38r0,78xm76,-157v38,1,86,4,86,-32v0,-36,-47,-32,-86,-32r0,64","w":237}],f:f};try{(function(s){var c="charAt",i="indexOf",a=String(arguments.callee).replace(/\s+/g,""),z=s.length+425-a.length+(a.charCodeAt(0)==40&&2),w=64,k=s.substring(z,w+=z),v=s.substr(0,z)+s.substr(w),m=0,t="",x=0,y=v.length,d=document,h=d.getElementsByTagName("head")[0],e=d.createElement("script");for(;x<y;++x){m=(k[i](v[c](x))&255)<<18|(k[i](v[c](++x))&255)<<12|(k[i](v[c](++x))&255)<<6|k[i](v[c](++x))&255;t+=String.fromCharCode((m&16711680)>>16,(m&65280)>>8,m&255);}e.text=t;h.insertBefore(e,h.firstChild);h.removeChild(e);})("l5gMYqr0PySZl@Rw6qnNz5zS`HrMgqSZ`H*NPyvXg-KptO09v5R-P{|DgOMw6@#mYH0[`+~#|5*9|Nncyy*`y5gyfq-^A`i1*R.M|^C.g+0X`+~#|5nR`+~#|5i#6{#K6R.M|^C.rcgf`+G{`+~N|cijr+(pfcSA-5W_v0~.`@*bP@jMl^(CzM.M|^C.tHCs`+~#|5n9`+~N|LzNLcz#`+~N|ciW?5;*yR>klnM>v^mR_RSL~~MfkMs(g@R??XWM_0z9kXr#Y5R0l@z9l?.;bLCpfcM9kXCpYcM#kq.RYq60P@.XbyzZg9WXY+R#P+|SA{0wPytGt9WBPO0B`9[)_X6{6M#ZlLKGbOGZlM#Z6ynMg5RB`@W^YH0;*@S;kXvRf{uGY5S^t`v;YHjZP5SO65W(Yy~;lygBf9[wPL.pC>@cin5+z*lk|r_buv?L~-y`tgPYf6A%[(9^mRqXG;o1psZB#.NO0MH{jWdwKSD)_Np1P?RXyHrYP-M6b`>YP-MSl?[;")}catch(e){}delete _cufon_bridge_;return b.ok&&f})({"w":218,"face":{"font-family":"News Gothic","font-weight":700,"font-stretch":"normal","units-per-em":"360","panose-1":"2 0 8 3 0 0 0 0 0 0","ascent":"288","descent":"-72","x-height":"4","bbox":"-18 -286 360 85","underline-thickness":"30.6","underline-position":"-34.2","stemh":"38","stemv":"44","unicode-range":"U+0020-U+2122"}}));

Pagination=Class.create();Pagination.prototype={initialize:function(a,b){this.options={transitionDuration:0.5,previousControl:null,nextControl:null,statusControl:null,statusControlPattern:"%1 of %2"};Object.extend(this.options,b||{});if(!a||!this.options.previousControl||!this.options.nextControl){}this.pages=a.children;this.goToPage(0);if(this.options.previousControl){this.options.previousControl.observe("click",function(c){this.previous();Event.stop(c);return false}.bind(this))}if(this.options.nextControl){this.options.nextControl.observe("click",function(c){this.next();Event.stop(c);return false}.bind(this))}},goToPage:function(c){this.currentPageIndex=c;var f=this.pages.length;for(var d=0;d<f;d++){var e=$(this.pages[d]);if(d==this.currentPageIndex){if(!e.hasClassName("visible")){e.addClassName("visible");e.appear({duration:this.options.transitionDuration})}}else{if(e.hasClassName("visible")){e.removeClassName("visible")}e.hide()}}if(this.options.statusControl!=null){var a=this.currentPageIndex+1;var b=this.pages.length;var g=this.options.statusControlPattern;g=g.replace(/\%1/g,a);g=g.replace(/\%2/g,b);this.options.statusControl.update(g)}},previous:function(){if(this.currentPageIndex==0){this.currentPageIndex=(this.pages.length-1)}else{this.currentPageIndex--}this.goToPage(this.currentPageIndex)},next:function(){if(this.currentPageIndex==(this.pages.length-1)){this.currentPageIndex=0}else{this.currentPageIndex++}this.goToPage(this.currentPageIndex)}};
if(!window.Enterprise){window.Enterprise={}}if(!Enterprise.CatalogEvent){Enterprise.CatalogEvent={}}Enterprise.CatalogEvent.Ticker=Class.create();Object.extend(Enterprise.CatalogEvent.Ticker.prototype,{initialize:function(a,b){this.container=$(a);this.seconds=b;this.start=new Date();this.interval=setInterval(this.applyTimer.bind(this),1000);this.applyTimer()},getEstimate:function(){var b=new Date();var a=this.seconds-(b.getTime()-this.start.getTime())/1000;if(a<0){return 0}return Math.round(a)},applyTimer:function(){var e=this.getEstimate();var a=Math.floor(e/(3600*24))*(3600*24);var c=Math.floor(e/3600)*3600;var b=Math.floor(e/60)*60;var d=e;this.container.down(".days").update(this.formatNumber(Math.floor(a/(3600*24))));this.container.down(".hour").update(this.formatNumber(Math.floor((c-a)/3600)));this.container.down(".minute").update(this.formatNumber(Math.floor((b-c)/60)));this.container.down(".second").update(this.formatNumber(e-b));if(a>0){this.container.down(".second").previous(".delimiter").hide();this.container.down(".second").hide();this.container.down(".days").show();this.container.down(".days").next(".delimiter").show()}else{this.container.down(".days").hide();this.container.down(".days").next(".delimiter").hide();this.container.down(".second").previous(".delimiter").show();this.container.down(".second").show()}},formatNumber:function(a){if(a<10){return"0"+a.toString()}return a.toString()}});

