/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

var Prototype={Version:'1.6.0.2',Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,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,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(x){return x}};if(Prototype.Browser.MobileSafari)Prototype.BrowserFeatures.SpecificElementExtensions=false;var Class={create:function(){var a=null,properties=$A(arguments);if(Object.isFunction(properties[0]))a=properties.shift();function klass(){this.initialize.apply(this,arguments)}Object.extend(klass,Class.Methods);klass.superclass=a;klass.subclasses=[];if(a){var b=function(){};b.prototype=a.prototype;klass.prototype=new b;a.subclasses.push(klass)}for(var i=0;i<properties.length;i++)klass.addMethods(properties[i]);if(!klass.prototype.initialize)klass.prototype.initialize=Prototype.emptyFunction;klass.prototype.constructor=klass;return klass}};Class.Methods={addMethods:function(a){var b=this.superclass&&this.superclass.prototype;var c=Object.keys(a);if(!Object.keys({toString:true}).length)c.push("toString","valueOf");for(var i=0,length=c.length;i<length;i++){var d=c[i],value=a[d];if(b&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var e=value,value=Object.extend((function(m){return function(){return b[m].apply(this,arguments)}})(d).wrap(e),{valueOf:function(){return e},toString:function(){return e.toString()}})}this.prototype[d]=value}return this}};var Abstract={};Object.extend=function(a,b){for(var c in b)a[c]=b[c];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(e){if(e instanceof RangeError)return'...';throw e;}},toJSON:function(a){var b=typeof a;switch(b){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 c=[];for(var d in a){var e=Object.toJSON(a[d]);if(!Object.isUndefined(e))c.push(d.toJSON()+': '+e)}return'{'+c.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(a){var b=[];for(var c in a)b.push(a[c]);return b},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].split(",").invoke("strip");return a.length==1&&!a[0]?[]:a},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var a=this,args=$A(arguments),object=args.shift();return function(){return a.apply(object,args.concat($A(arguments)))}},bindAsEventListener:function(){var b=this,args=$A(arguments),object=args.shift();return function(a){return b.apply(object,[a||window.event].concat(args))}},curry:function(){if(!arguments.length)return this;var a=this,args=$A(arguments);return function(){return a.apply(this,args.concat($A(arguments)))}},delay:function(){var a=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return a.apply(a,args)},timeout)},wrap:function(a){var b=this;return function(){return a.apply(this,[b.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)))}}});Function.prototype.defer=Function.prototype.delay.curry(0.01);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 a;for(var i=0,length=arguments.length;i<length;i++){var b=arguments[i];try{a=b();break}catch(e){}}return a}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1')};var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}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(a,b){var c='',source=this,match;b=arguments.callee.prepareReplacement(b);while(source.length>0){if(match=source.match(a)){c+=source.slice(0,match.index);c+=String.interpret(b(match));source=source.slice(match.index+match[0].length)}else{c+=source,source=''}}return c},sub:function(b,c,d){c=this.gsub.prepareReplacement(c);d=Object.isUndefined(d)?1:d;return this.gsub(b,function(a){if(--d<0)return a[0];return c(a)})},scan:function(a,b){this.gsub(a,b);return String(this)},truncate:function(a,b){a=a||30;b=Object.isUndefined(b)?'...':b;return this.length>a?this.slice(0,a-b.length)+b: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 c=new RegExp(Prototype.ScriptFragment,'im');return(this.match(b)||[]).map(function(a){return(a.match(c)||['',''])[1]})},evalScripts:function(){return this.extractScripts().map(function(a){return eval(a)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var c=new Element('div');c.innerHTML=this.stripTags();return c.childNodes[0]?(c.childNodes.length>1?$A(c.childNodes).inject('',function(a,b){return a+b.nodeValue}):c.childNodes[0].nodeValue):''},toQueryParams:function(e){var f=this.strip().match(/([^?#]*)(#.*)?$/);if(!f)return{};return f[1].split(e||'&').inject({},function(a,b){if((b=b.split('='))[0]){var c=decodeURIComponent(b.shift());var d=b.length>1?b.join('='):b[0];if(d!=undefined)d=decodeURIComponent(d);if(c in a){if(!Object.isArray(a[c]))a[c]=[a[c]];a[c].push(d)}else a[c]=d}return a})},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 a=this.split('-'),len=a.length;if(len==1)return a[0];var b=this.charAt(0)=='-'?a[0].charAt(0).toUpperCase()+a[0].substring(1):a[0];for(var i=1;i<len;i++)b+=a[i].charAt(0).toUpperCase()+a[i].substring(1);return b},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(c){var d=this.gsub(/[\x00-\x1f\\]/,function(a){var b=String.specialChar[a[0]];return b?b:'\\u00'+a[0].charCodeAt().toPaddedString(2,16)});if(c)return'"'+d.replace(/"/g,'\\"')+'"';return"'"+d.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(a){var b=this.unfilterJSON();try{if(!a||b.isJSON())return eval('('+b+')')}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 d=this.length-a.length;return d>=0&&this.lastIndexOf(a)===d},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.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>')}});String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b))return b;var c=new Template(b);return function(a){return c.evaluate(a)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement('div'),text:document.createTextNode('')});with(String.prototype.escapeHTML)div.appendChild(text);var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(f){if(Object.isFunction(f.toTemplateReplacements))f=f.toTemplateReplacements();return this.template.gsub(this.pattern,function(a){if(f==null)return'';var b=a[1]||'';if(b=='\\')return a[2];var c=f,expr=a[3];var d=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;a=d.exec(expr);if(a==null)return b;while(a!=null){var e=a[1].startsWith('[')?a[2].gsub('\\\\]',']'):a[1];c=c[e];if(null==c||''==a[3])break;expr=expr.substring('['==a[3]?a[1].length:a[0].length);a=d.exec(expr)}return b+String.interpret(c)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(b,c){var d=0;b=b.bind(c);try{this._each(function(a){b(a,d++)})}catch(e){if(e!=$break)throw e;}return this},eachSlice:function(a,b,c){b=b?b.bind(c):Prototype.K;var d=-a,slices=[],array=this.toArray();while((d+=a)<array.length)slices.push(array.slice(d,d+a));return slices.collect(b,c)},all:function(c,d){c=c?c.bind(d):Prototype.K;var e=true;this.each(function(a,b){e=e&&!!c(a,b);if(!e)throw $break;});return e},any:function(c,d){c=c?c.bind(d):Prototype.K;var e=false;this.each(function(a,b){if(e=!!c(a,b))throw $break;});return e},collect:function(c,d){c=c?c.bind(d):Prototype.K;var e=[];this.each(function(a,b){e.push(c(a,b))});return e},detect:function(c,d){c=c.bind(d);var e;this.each(function(a,b){if(c(a,b)){e=a;throw $break;}});return e},findAll:function(c,d){c=c.bind(d);var e=[];this.each(function(a,b){if(c(a,b))e.push(a)});return e},grep:function(c,d,e){d=d?d.bind(e):Prototype.K;var f=[];if(Object.isString(c))c=new RegExp(c);this.each(function(a,b){if(c.match(a))f.push(d(a,b))});return f},include:function(b){if(Object.isFunction(this.indexOf))if(this.indexOf(b)!=-1)return true;var c=false;this.each(function(a){if(a==b){c=true;throw $break;}});return c},inGroupsOf:function(b,c){c=Object.isUndefined(c)?null:c;return this.eachSlice(b,function(a){while(a.length<b)a.push(c);return a})},inject:function(c,d,e){d=d.bind(e);this.each(function(a,b){c=d(c,a,b)});return c},invoke:function(b){var c=$A(arguments).slice(1);return this.map(function(a){return a[b].apply(a,c)})},max:function(c,d){c=c?c.bind(d):Prototype.K;var e;this.each(function(a,b){a=c(a,b);if(e==null||a>=e)e=a});return e},min:function(c,d){c=c?c.bind(d):Prototype.K;var e;this.each(function(a,b){a=c(a,b);if(e==null||a<e)e=a});return e},partition:function(c,d){c=c?c.bind(d):Prototype.K;var e=[],falses=[];this.each(function(a,b){(c(a,b)?e:falses).push(a)});return[e,falses]},pluck:function(b){var c=[];this.each(function(a){c.push(a[b])});return c},reject:function(c,d){c=c.bind(d);var e=[];this.each(function(a,b){if(!c(a,b))e.push(a)});return e},sortBy:function(e,f){e=e.bind(f);return this.map(function(a,b){return{value:a,criteria:e(a,b)}}).sort(function(c,d){var a=c.criteria,b=d.criteria;return a<b?-1:a>b?1:0}).pluck('value')},toArray:function(){return this.map()},zip:function(){var c=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last()))c=args.pop();var d=[this].concat(args).map($A);return this.map(function(a,b){return c(d.pluck(b))})},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(a){if(!a)return[];if(a.toArray)return a.toArray();var b=a.length||0,results=new Array(b);while(b--)results[b]=a[b];return results}if(Prototype.Browser.WebKit){$A=function(a){if(!a)return[];if(!(Object.isFunction(a)&&a=='[object NodeList]')&&a.toArray)return a.toArray();var b=a.length||0,results=new Array(b);while(b--)results[b]=a[b];return results}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(a){for(var i=0,length=this.length;i<length;i++)a(this[i])},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(a,b){return a.concat(Object.isArray(b)?b.flatten():[b])})},without:function(){var b=$A(arguments);return this.select(function(a){return!b.include(a)})},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(d){return this.inject([],function(a,b,c){if(0==c||(d?a.last()!=b:!a.include(b)))a.push(b);return a})},intersect:function(c){return this.uniq().findAll(function(b){return c.detect(function(a){return b===a})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']'},toJSON:function(){var c=[];this.each(function(a){var b=Object.toJSON(a);if(!Object.isUndefined(b))c.push(b)});return'['+c.join(', ')+']'}});if(Object.isFunction(Array.prototype.forEach))Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,i){i||(i=0);var b=this.length;if(i<0)i=b+i;for(;i<b;i++)if(this[i]===a)return i;return-1};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(a,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(a);return(n<0)?n:i-n-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 a=[];for(var i=0,length=this.length;i<length;i++)a.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)a.push(arguments[i][j])}else{a.push(arguments[i])}}return a}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this},toPaddedString:function(a,b){var c=this.toString(b||10);return'0'.times(a-c.length)+c},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 toQueryPair(a,b){if(Object.isUndefined(b))return a;return a+'='+encodeURIComponent(String.interpret(b))}return{initialize:function(a){this._object=Object.isHash(a)?a.toObject():Object.clone(a)},_each:function(a){for(var b in this._object){var c=this._object[b],pair=[b,c];pair.key=b;pair.value=c;a(pair)}},set:function(a,b){return this._object[a]=b},get:function(a){return this._object[a]},unset:function(a){var b=this._object[a];delete this._object[a];return b},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck('key')},values:function(){return this.pluck('value')},index:function(b){var c=this.detect(function(a){return a.value===b});return c&&c.key},merge:function(a){return this.clone().update(a)},update:function(c){return new Hash(c).inject(this,function(a,b){a.set(b.key,b.value);return a})},toQueryString:function(){return this.map(function(a){var b=encodeURIComponent(a.key),values=a.value;if(values&&typeof values=='object'){if(Object.isArray(values))return values.map(toQueryPair.curry(b)).join('&')}return toQueryPair(b,values)}).join('&')},inspect:function(){return'#<Hash:{'+this.map(function(a){return a.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(a,b,c){this.start=a;this.end=b;this.exclusive=c},_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(a,b,c){return new ObjectRange(a,b,c)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a))this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(b,c,d,f){this.each(function(a){if(Object.isFunction(a[b])){try{a[b].apply(a,[c,d,f])}catch(e){}}})}};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,c){$super(c);this.transport=Ajax.getTransport();this.request(b)},request:function(a){this.url=a;this.method=this.options.method;var b=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){b['_method']=this.method;this.method='post'}this.parameters=b;if(b=Object.toQueryString(b)){if(this.method=='get')this.url+=(this.url.include('?')?'&':'?')+b;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))b+='&_='}try{var c=new Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(c);Ajax.Responders.dispatch('onCreate',this,c);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||b):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)this.onStateChange()}catch(e){this.dispatchException(e)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete))this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var b={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){b['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)b['Connection']='close'}if(typeof this.options.requestHeaders=='object'){var c=this.options.requestHeaders;if(Object.isFunction(c.push))for(var i=0,length=c.length;i<length;i+=2)b[c[i]]=c[i+1];else $H(c).each(function(a){b[a.key]=a.value})}for(var d in b)this.transport.setRequestHeader(d,b[d])},success:function(){var a=this.getStatus();return!a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(e){return 0}},respondToReadyState:function(a){var b=Ajax.Request.Events[a],response=new Ajax.Response(this);if(b=='Complete'){try{this._complete=true;(this.options['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(response,response.headerJSON)}catch(e){this.dispatchException(e)}var c=response.getHeader('Content-type');if(this.options.evalJS=='force'||(this.options.evalJS&&this.isSameOrigin()&&c&&c.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))this.evalResponse()}try{(this.options['on'+b]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch('on'+b,this,response,response.headerJSON)}catch(e){this.dispatchException(e)}if(b=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return!m||(m[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(e){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(a){this.request=a;var b=this.transport=a.transport,readyState=this.readyState=b.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(b.responseText);this.headerJSON=this._getHeaderJSON()}if(readyState==4){var c=b.responseXML;this.responseXML=Object.isUndefined(c)?null:c;this.responseJSON=this._getResponseJSON()}},status:0,statusText:'',getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||''}catch(e){return''}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(e){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(e){this.request.dispatchException(e)}},_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(e){this.request.dispatchException(e)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,d,e,f){this.container={success:(d.success||d),failure:(d.failure||(d.success?null:d))};f=Object.clone(f);var g=f.onComplete;f.onComplete=(function(a,b){this.updateContent(a.responseText);if(Object.isFunction(g))g(a,b)}).bind(this);$super(e,f)},updateContent:function(a){var b=this.container[this.success()?'success':'failure'],options=this.options;if(!options.evalScripts)a=a.stripScripts();if(b=$(b)){if(options.insertion){if(Object.isString(options.insertion)){var c={};c[options.insertion]=a;b.insert(c)}else options.insertion(b,a)}else b.update(a)}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,c,d){$super(d);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=b;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 $(a){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)elements.push($(arguments[i]));return elements}if(Object.isString(a))a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(a,b){var c=[];var d=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=d.snapshotLength;i<length;i++)c.push(Element.extend(d.snapshotItem(i)));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 d=this.Element;this.Element=function(a,b){b=b||{};a=a.toLowerCase();var c=Element.cache;if(Prototype.Browser.IE&&b.name){a='<'+a+' name="'+b.name+'">';delete b.name;return Element.writeAttribute(document.createElement(a),b)}if(!c[a])c[a]=Element.extend(document.createElement(a));return Element.writeAttribute(c[a].cloneNode(false),b)};Object.extend(this.Element,d||{})}).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).style.display='none';return a},show:function(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(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();else if(!Object.isElement(b)){b=Object.toHTML(b);var c=a.ownerDocument.createRange();c.selectNode(a);b.evalScripts.bind(b).defer();b=c.createContextualFragment(b.stripScripts())}a.parentNode.replaceChild(b,a);return a},insert:function(a,b){a=$(a);if(Object.isString(b)||Object.isNumber(b)||Object.isElement(b)||(b&&(b.toElement||b.toHTML)))b={bottom:b};var c,insert,tagName,childNodes;for(var d in b){c=b[d];d=d.toLowerCase();insert=Element._insertionTranslations[d];if(c&&c.toElement)c=c.toElement();if(Object.isElement(c)){insert(a,c);continue}c=Object.toHTML(c);tagName=((d=='before'||d=='after')?a.parentNode:a).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,c.stripScripts());if(d=='top'||d=='after')childNodes.reverse();childNodes.each(insert.curry(a));c.evalScripts.bind(c).defer()}return a},wrap:function(a,b,c){a=$(a);if(Object.isElement(b))$(b).writeAttribute(c||{});else if(Object.isString(b))b=new Element(b,c);else b=new Element('div',b);if(a.parentNode)a.parentNode.replaceChild(b,a);b.appendChild(a);return b},inspect:function(d){d=$(d);var e='<'+d.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(a){var b=a.first(),attribute=a.last();var c=(d[b]||'').toString();if(c)e+=' '+attribute+'='+c.inspect(true)});return e+'>'},recursivelyCollect:function(a,b){a=$(a);var c=[];while(a=a[b])if(a.nodeType==1)c.push(Element.extend(a));return c},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(a,b){if(Object.isString(b))b=new Selector(b);return b.match($(a))},up:function(a,b,c){a=$(a);if(arguments.length==1)return $(a.parentNode);var d=a.ancestors();return Object.isNumber(b)?d[b]:Selector.findElement(d,b,c)},down:function(a,b,c){a=$(a);if(arguments.length==1)return a.firstDescendant();return Object.isNumber(b)?a.descendants()[b]:a.select(b)[c||0]},previous:function(a,b,c){a=$(a);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(a));var d=a.previousSiblings();return Object.isNumber(b)?d[b]:Selector.findElement(d,b,c)},next:function(a,b,c){a=$(a);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(a));var d=a.nextSiblings();return Object.isNumber(b)?d[b]:Selector.findElement(d,b,c)},select:function(){var a=$A(arguments),element=$(a.shift());return Selector.findChildElements(element,a)},adjacent:function(){var a=$A(arguments),element=$(a.shift());return Selector.findChildElements(element.parentNode,a).without(element)},identify:function(a){a=$(a);var b=a.readAttribute('id'),self=arguments.callee;if(b)return b;do{b='anonymous_element_'+self.counter++}while($(b));a.writeAttribute('id',b);return b},readAttribute:function(a,b){a=$(a);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[b])return t.values[b](a,b);if(t.names[b])b=t.names[b];if(b.include(':')){return(!a.attributes||!a.attributes[b])?null:a.attributes[b].value}}return a.getAttribute(b)},writeAttribute:function(a,b,c){a=$(a);var d={},t=Element._attributeTranslations.write;if(typeof b=='object')d=b;else d[b]=Object.isUndefined(c)?true:c;for(var e in d){b=t.names[e]||e;c=d[e];if(t.values[e])b=t.values[e](a,c);if(c===false||c===null)a.removeAttribute(b);else if(c===true)a.setAttribute(b,b);else a.setAttribute(b,c)}return a},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(a){a=$(a);var b=a.firstChild;while(b){var c=b.nextSibling;if(b.nodeType==3&&!/\S/.test(b.nodeValue))a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,c){b=$(b),c=$(c);var d=c;if(b.compareDocumentPosition)return(b.compareDocumentPosition(c)&8)===8;if(b.sourceIndex&&!Prototype.Browser.Opera){var e=b.sourceIndex,a=c.sourceIndex,nextAncestor=c.nextSibling;if(!nextAncestor){do{c=c.parentNode}while(!(nextAncestor=c.nextSibling)&&c.parentNode)}if(nextAncestor&&nextAncestor.sourceIndex)return(e>a&&e<nextAncestor.sourceIndex)}while(b=b.parentNode)if(b==d)return true;return false},scrollTo:function(a){a=$(a);var b=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);b=b=='float'?'cssFloat':b.camelize();var c=a.style[b];if(!c){var d=document.defaultView.getComputedStyle(a,null);c=d?d[b]:null}if(b=='opacity')return c?parseFloat(c):1.0;return c=='auto'?null:c},getOpacity:function(a){return $(a).getStyle('opacity')},setStyle:function(a,b){a=$(a);var c=a.style,match;if(Object.isString(b)){a.style.cssText+=';'+b;return b.include('opacity')?a.setOpacity(b.match(/opacity:\s*(\d?\.?\d*)/)[1]):a}for(var d in b)if(d=='opacity')a.setOpacity(b[d]);else c[(d=='float'||d=='cssFloat')?(Object.isUndefined(c.styleFloat)?'cssFloat':'styleFloat'):d]=b[d];return a},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==='')?'':(b<0.00001)?0:b;return a},getDimensions:function(a){a=$(a);var b=$(a).getStyle('display');if(b!='none'&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};var c=a.style;var d=c.visibility;var e=c.position;var f=c.display;c.visibility='hidden';c.position='absolute';c.display='block';var g=a.clientWidth;var h=a.clientHeight;c.display=f;c.position=e;c.visibility=d;return{width:g,height:h}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,'position');if(b=='static'||!b){a._madePositioned=true;a.style.position='relative';if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=''}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=Element.getStyle(a,'overflow')||'auto';if(a._overflow!=='hidden')a.style.overflow='hidden';return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=a._overflow=='auto'?'':a._overflow;a._overflow=null;return a},cumulativeOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent}while(a);return Element._returnOffset(valueL,b)},positionedOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent;if(a){if(a.tagName=='BODY')break;var p=Element.getStyle(a,'position');if(p!=='static')break}}while(a);return Element._returnOffset(valueL,b)},absolutize:function(a){a=$(a);if(a.getStyle('position')=='absolute')return;var b=a.positionedOffset();var c=b[1];var d=b[0];var e=a.clientWidth;var f=a.clientHeight;a._originalLeft=d-parseFloat(a.style.left||0);a._originalTop=c-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position='absolute';a.style.top=c+'px';a.style.left=d+'px';a.style.width=e+'px';a.style.height=f+'px';return a},relativize:function(a){a=$(a);if(a.getStyle('position')=='relative')return;a.style.position='relative';var b=parseFloat(a.style.top||0)-(a._originalTop||0);var c=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=b+'px';a.style.left=c+'px';a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(a){var b=0,valueL=0;do{b+=a.scrollTop||0;valueL+=a.scrollLeft||0;a=a.parentNode}while(a);return Element._returnOffset(valueL,b)},getOffsetParent:function(a){if(a.offsetParent)return $(a.offsetParent);if(a==document.body)return $(a);while((a=a.parentNode)&&a!=document.body)if(Element.getStyle(a,'position')!='static')return $(a);return $(document.body)},viewportOffset:function(a){var b=0,valueL=0;var c=a;do{b+=c.offsetTop||0;valueL+=c.offsetLeft||0;if(c.offsetParent==document.body&&Element.getStyle(c,'position')=='absolute')break}while(c=c.offsetParent);c=a;do{if(!Prototype.Browser.Opera||c.tagName=='BODY'){b-=c.scrollTop||0;valueL-=c.scrollLeft||0}}while(c=c.parentNode);return Element._returnOffset(valueL,b)},clonePosition:function(a,b){var c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});b=$(b);var p=b.viewportOffset();a=$(a);var d=[0,0];var e=null;if(Element.getStyle(a,'position')=='absolute'){e=a.getOffsetParent();d=e.viewportOffset()}if(e==document.body){d[0]-=document.body.offsetLeft;d[1]-=document.body.offsetTop}if(c.setLeft)a.style.left=(p[0]-d[0]+c.offsetLeft)+'px';if(c.setTop)a.style.top=(p[1]-d[1]+c.offsetTop)+'px';if(c.setWidth)a.style.width=b.offsetWidth+'px';if(c.setHeight)a.style.height=b.offsetHeight+'px';return a}};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,e,f){switch(f){case'left':case'top':case'right':case'bottom':if(d(e,'position')==='static')return null;case'height':case'width':if(!Element.visible(e))return null;var g=parseInt(d(e,f),10);if(g!==e['offset'+f.capitalize()])return g+'px';var h;if(f==='height'){h=['border-top-width','padding-top','padding-bottom','border-bottom-width']}else{h=['border-left-width','padding-left','padding-right','border-right-width']}return h.inject(g,function(a,b){var c=d(e,b);return c===null?a:a-parseInt(c,10)})+'px';default:return d(e,f)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(a,b,c){if(c==='title')return b.title;return a(b,c)})}else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(a,b){b=$(b);var c=b.getStyle('position');if(c!=='static')return a(b);b.setStyle({position:'relative'});var d=a(b);b.setStyle({position:c});return d});$w('positionedOffset viewportOffset').each(function(f){Element.Methods[f]=Element.Methods[f].wrap(function(a,b){b=$(b);var c=b.getStyle('position');if(c!=='static')return a(b);var d=b.getOffsetParent();if(d&&d.getStyle('position')==='fixed')d.setStyle({zoom:1});b.setStyle({position:'relative'});var e=a(b);b.setStyle({position:c});return e})});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.0}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,c){function stripAlpha(a){return a.replace(/alpha\([^\)]*\)/gi,'')}b=$(b);var d=b.currentStyle;if((d&&!d.hasLayout)||(!d&&b.style.zoom=='normal'))b.style.zoom=1;var e=b.getStyle('filter'),style=b.style;if(c==1||c===''){(e=stripAlpha(e))?style.filter=e:style.removeAttribute('filter');return b}else if(c<0.00001)c=0;style.filter=stripAlpha(e)+'alpha(opacity='+(c*100)+')';return b};Element._attributeTranslations={read:{names:{'class':'className','for':'htmlFor'},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,b){var c=a.getAttributeNode(b);return c?c.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').each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._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=='IMG'&&a.width){a.width++;a.width--}else try{var n=document.createTextNode(' ');a.appendChild(n);a.removeChild(n)}catch(e){}return a};Element.Methods.cumulativeOffset=function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,'position')=='absolute')break;a=a.offsetParent}while(a);return Element._returnOffset(valueL,b)}}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 d=b.tagName.toUpperCase();if(d in Element._insertionTranslations.tags){$A(b.childNodes).each(function(a){b.removeChild(a)});Element._getContentFromAnonymousElement(d,c.stripScripts()).each(function(a){b.appendChild(a)})}else b.innerHTML=c.stripScripts();c.evalScripts.bind(c).defer();return b}}if('outerHTML'in document.createElement('div')){Element.Methods.replace=function(b,c){b=$(b);if(c&&c.toElement)c=c.toElement();if(Object.isElement(c)){b.parentNode.replaceChild(c,b);return b}c=Object.toHTML(c);var d=b.parentNode,tagName=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var e=b.next();var f=Element._getContentFromAnonymousElement(tagName,c.stripScripts());d.removeChild(b);if(e)f.each(function(a){d.insertBefore(a,e)});else f.each(function(a){d.appendChild(a)})}else b.outerHTML=c.stripScripts();c.evalScripts.bind(c).defer();return b}}Element._returnOffset=function(l,t){var a=[l,t];a.left=l;a.top=t;return a};Element._getContentFromAnonymousElement=function(a,b){var c=new Element('div'),t=Element._insertionTranslations.tags[a];if(t){c.innerHTML=t[0]+b+t[1];t[2].times(function(){c=c.firstChild})}else c.innerHTML=b;return $A(c.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,b){b=Element._attributeTranslations.has[b]||b;var c=$(a).getAttributeNode(b);return c&&c.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 c={},ByTag=Element.Methods.ByTag;var d=Object.extend(function(a){if(!a||a._extendedByPrototype||a.nodeType!=1||a==window)return a;var b=Object.clone(c),tagName=a.tagName,property,value;if(ByTag[tagName])Object.extend(b,ByTag[tagName]);for(property in b){value=b[property];if(Object.isFunction(value)&&!(property in a))a[property]=value.methodize()}a._extendedByPrototype=Prototype.emptyFunction;return a},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(c,Element.Methods);Object.extend(c,Element.Methods.Simulated)}}});d.refresh();return d})();Element.hasAttribute=function(a,b){if(a.hasAttribute)return a.hasAttribute(b);return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(f){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!f){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)})}if(arguments.length==2){var g=f;f=arguments[1]}if(!g)Object.extend(Element.Methods,f||{});else{if(Object.isArray(g))g.each(extend);else extend(g)}function extend(a){a=a.toUpperCase();if(!Element.Methods.ByTag[a])Element.Methods.ByTag[a]={};Object.extend(Element.Methods.ByTag[a],f)}function copy(a,b,c){c=c||false;for(var d in a){var e=a[d];if(!Object.isFunction(e))continue;if(!c||!(d in b))b[d]=e.methodize()}}function findDOMClass(a){var b;var c={"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(c[a])b='HTML'+c[a]+'Element';if(window[b])return window[b];b='HTML'+a+'Element';if(window[b])return window[b];b='HTML'+a.capitalize()+'Element';if(window[b])return window[b];window[b]={};window[b].prototype=document.createElement(a).__proto__;return window[b]}if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true)}if(F.SpecificElementExtensions){for(var h in Element.Methods.ByTag){var i=findDOMClass(h);if(Object.isUndefined(i))continue;copy(T[h],i.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh)Element.extend.refresh();Element.cache={}};document.viewport={getDimensions:function(){var a={};var B=Prototype.Browser;$w('width height').each(function(d){var D=d.capitalize();a[d]=(B.WebKit&&!document.evaluate)?self['inner'+D]:(B.Opera)?document.body['client'+D]:document.documentElement['client'+D]});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)}};var Selector=Class.create({initialize:function(a){this.expression=a.strip();this.compileMatcher()},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath)return false;var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty")))return false;if((/(\[[\w-]*?:|:checked)/).test(this.expression))return false;return true},compileMatcher:function(){if(this.shouldUseXPath())return this.compileXPathMatcher();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 e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return}this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],'');break}}}this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;if(this.xpath)return document._getElementsByXPath(this.xpath,a);return this.matcher(a)},match:function(a){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var b,p,m;while(e&&b!==e&&(/\S/).test(e)){b=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],'')}else{return this.findElements(document).include(a)}}}}var c=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](a,matches)){c=false;break}}return c},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(m){if(m[1]=='*')return'';return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m)},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m)},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(Object.isFunction(h))return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m)},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 or translate(text(), ' \t\r\n', '') = '')]",'checked':"[@checked]",'disabled':"[@disabled]",'enabled':"[not(@disabled)]",'not':function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var a=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);a.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],'');break}}}return"[not("+a.join(" and ")+")]"},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m)},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m)},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m)},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m)},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m)},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m)},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m)+p['last-of-type'](m)},nth:function(c,m){var d,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(d=formula.match(/^(\d+)$/))return'['+c+"= "+d[1]+']';if(d=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(d[1]=="-")d[1]=-1;var a=d[1]?Number(d[1]):1;var b=d[2]?Number(d[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:c,a:a,b:b})}}}},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(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m)},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m)},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]+)\]/,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(a,b){var c=Element.readAttribute(a,b[1]);return c&&Selector.operators[b[2]](c,b[5]||b[6])}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)a.push(node);return a},mark:function(a){var b=Prototype.emptyFunction;for(var i=0,node;node=a[i];i++)node._countedByPrototype=b;return a},unmark:function(a){for(var i=0,node;node=a[i];i++)node._countedByPrototype=undefined;return a},index:function(a,b,c){a._countedByPrototype=Prototype.emptyFunction;if(b){for(var d=a.childNodes,i=d.length-1,j=1;i>=0;i--){var e=d[i];if(e.nodeType==1&&(!c||e._countedByPrototype))e.nodeIndex=j++}}else{for(var i=0,j=1,d=a.childNodes;e=d[i];i++)if(e.nodeType==1&&(!c||e._countedByPrototype))e.nodeIndex=j++}},unique:function(a){if(a.length==0)return a;var b=[],n;for(var i=0,l=a.length;i<l;i++)if(!(n=a[i])._countedByPrototype){n._countedByPrototype=Prototype.emptyFunction;b.push(Element.extend(n))}return Selector.handlers.unmark(b)},descendant:function(a){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++)h.concat(results,node.getElementsByTagName('*'));return results},child:function(a){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++){for(var j=0,child;child=node.childNodes[j];j++)if(child.nodeType==1&&child.tagName!='!')results.push(child)}return results},adjacent:function(a){for(var i=0,results=[],node;node=a[i];i++){var b=this.nextElementSibling(node);if(b)results.push(b)}return results},laterSibling:function(a){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++)h.concat(results,Element.nextSiblings(node));return results},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,b,c,d){var e=c.toUpperCase();var f=[],h=Selector.handlers;if(a){if(d){if(d=="descendant"){for(var i=0,node;node=a[i];i++)h.concat(f,node.getElementsByTagName(c));return f}else a=this[d](a);if(c=="*")return a}for(var i=0,node;node=a[i];i++)if(node.tagName.toUpperCase()===e)f.push(node);return f}else return b.getElementsByTagName(c)},id:function(a,b,c,d){var e=$(c),h=Selector.handlers;if(!e)return[];if(!a&&b==document)return[e];if(a){if(d){if(d=='child'){for(var i=0,node;node=a[i];i++)if(e.parentNode==node)return[e]}else if(d=='descendant'){for(var i=0,node;node=a[i];i++)if(Element.descendantOf(e,node))return[e]}else if(d=='adjacent'){for(var i=0,node;node=a[i];i++)if(Selector.handlers.previousElementSibling(e)==node)return[e]}else a=h[d](a)}for(var i=0,node;node=a[i];i++)if(node==e)return[e];return[]}return(e&&Element.descendantOf(e,b))?[e]:[]},className:function(a,b,c,d){if(a&&d)a=this[d](a);return Selector.handlers.byClassName(a,b,c)},byClassName:function(a,b,c){if(!a)a=Selector.handlers.descendant([b]);var d=' '+c+' ';for(var i=0,results=[],node,nodeClassName;node=a[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==c||(' '+nodeClassName+' ').include(d))results.push(node)}return results},attrPresence:function(a,b,c,d){if(!a)a=b.getElementsByTagName("*");if(a&&d)a=this[d](a);var e=[];for(var i=0,node;node=a[i];i++)if(Element.hasAttribute(node,c))e.push(node);return e},attr:function(a,b,c,d,e,f){if(!a)a=b.getElementsByTagName("*");if(a&&f)a=this[f](a);var g=Selector.operators[e],results=[];for(var i=0,node;node=a[i];i++){var h=Element.readAttribute(node,c);if(h===null)continue;if(g(h,d))results.push(node)}return results},pseudo:function(a,b,c,d,e){if(a&&e)a=this[e](a);if(!a)a=d.getElementsByTagName("*");return Selector.pseudos[b](a,c,d)}},pseudos:{'first-child':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node)}return results},'last-child':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node)}return results},'only-child':function(a,b,c){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++)if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))results.push(node);return results},'nth-child':function(a,b,c){return Selector.pseudos.nth(a,b,c)},'nth-last-child':function(a,b,c){return Selector.pseudos.nth(a,b,c,true)},'nth-of-type':function(a,b,c){return Selector.pseudos.nth(a,b,c,false,true)},'nth-last-of-type':function(a,b,c){return Selector.pseudos.nth(a,b,c,true,true)},'first-of-type':function(a,b,c){return Selector.pseudos.nth(a,"1",c,false,true)},'last-of-type':function(a,b,c){return Selector.pseudos.nth(a,"1",c,true,true)},'only-of-type':function(a,b,c){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](a,b,c),b,c)},getIndices:function(a,b,d){if(a==0)return b>0?[b]:[];return $R(1,d).inject([],function(c,i){if(0==(i-b)%a&&(i-b)/a>=0)c.push(i);return c})},nth:function(c,d,e,f,g){if(c.length==0)return[];if(d=='even')d='2n+0';if(d=='odd')d='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(c);for(var i=0,node;node=c[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,f,g);indexed.push(node.parentNode)}}if(d.match(/^\d+$/)){d=Number(d);for(var i=0,node;node=c[i];i++)if(node.nodeIndex==d)results.push(node)}else if(m=d.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]=-1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var k=Selector.pseudos.getIndices(a,b,c.length);for(var i=0,node,l=k.length;node=c[i];i++){for(var j=0;j<l;j++)if(node.nodeIndex==k[j])results.push(node)}}h.unmark(c);h.unmark(indexed);return results},'empty':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++){if(node.tagName=='!'||(node.firstChild&&!node.innerHTML.match(/^\s*$/)))continue;results.push(node)}return results},'not':function(a,b,c){var h=Selector.handlers,selectorType,m;var d=new Selector(b).findElements(c);h.mark(d);for(var i=0,results=[],node;node=a[i];i++)if(!node._countedByPrototype)results.push(node);h.unmark(d);return results},'enabled':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++)if(!node.disabled)results.push(node);return results},'disabled':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++)if(node.disabled)results.push(node);return results},'checked':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++)if(node.checked)results.push(node);return results}},operators:{'=':function(a,v){return a==v},'!=':function(a,v){return a!=v},'^=':function(a,v){return a.startsWith(v)},'$=':function(a,v){return a.endsWith(v)},'*=':function(a,v){return a.include(v)},'~=':function(a,v){return(' '+a+' ').include(' '+v+' ')},'|=':function(a,v){return('-'+a.toUpperCase()+'-').include('-'+v.toUpperCase()+'-')}},split:function(a){var b=[];a.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){b.push(m[1].strip())});return b},matchElements:function(a,b){var c=$$(b),h=Selector.handlers;h.mark(c);for(var i=0,results=[],element;element=a[i];i++)if(element._countedByPrototype)results.push(element);h.unmark(c);return results},findElement:function(a,b,c){if(Object.isNumber(b)){c=b;b=false}return Selector.matchElements(a,b||'*')[c||0]},findChildElements:function(a,b){b=Selector.split(b.join(','));var c=[],h=Selector.handlers;for(var i=0,l=b.length,selector;i<l;i++){selector=new Selector(b[i].strip());h.concat(c,selector.findElements(a))}return(l>1)?h.unique(c):c}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++)if(node.tagName!=="!")a.push(node);return a},unmark:function(a){for(var i=0,node;node=a[i];i++)node.removeAttribute('_countedByPrototype');return a}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(c,d){if(typeof d!='object')d={hash:!!d};else if(Object.isUndefined(d.hash))d.hash=true;var e,value,submitted=false,submit=d.submit;var f=c.inject({},function(a,b){if(!b.disabled&&b.name){e=b.name;value=$(b).getValue();if(value!=null&&(b.type!='submit'||(!submitted&&submit!==false&&(!submit||e==submit)&&(submitted=true)))){if(e in a){if(!Object.isArray(a[e]))a[e]=[a[e]];a[e].push(value)}else a[e]=value}}return a});return d.hash?f:Object.toQueryString(f)}};Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(c){return $A($(c).getElementsByTagName('*')).inject([],function(a,b){if(Form.Element.Serializers[b.tagName.toLowerCase()])a.push(Element.extend(b));return a})},getInputs:function(a,b,c){a=$(a);var d=a.getElementsByTagName('input');if(!b&&!c)return $A(d).map(Element.extend);for(var i=0,matchingInputs=[],length=d.length;i<length;i++){var e=d[i];if((b&&e.type!=b)||(c&&e.name!=c))continue;matchingInputs.push(Element.extend(e))}return matchingInputs},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(a){return'hidden'!=a.type&&!a.disabled});var d=c.findAll(function(a){return a.hasAttribute('tabIndex')&&a.tabIndex>=0}).sortBy(function(a){return a.tabIndex}).first();return d?d:c.find(function(a){return['input','select','textarea'].include(a.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(a,b){a=$(a),b=Object.clone(b||{});var c=b.parameters,action=a.readAttribute('action')||'';if(action.blank())action=window.location.href;b.parameters=a.serialize(true);if(c){if(Object.isString(c))c=c.toQueryParams();Object.extend(b.parameters,c)}if(a.hasAttribute('method')&&!b.method)b.method=a.method;return new Ajax.Request(action,b)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var 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(e){}return a},disable:function(a){a=$(a);a.blur();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(a,b){if(Object.isUndefined(b))return this[a.type=='select-one'?'selectOne':'selectMany'](a);else{var c,value,single=!Object.isArray(b);for(var i=0,length=a.length;i<length;i++){c=a.options[i];value=this.optionValue(c);if(single){if(value==b){c.selected=true;return}}else c.selected=b.include(value)}}},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,length=a.length;if(!length)return null;for(var i=0,b=[];i<length;i++){var c=a.options[i];if(c.selected)b.push(this.optionValue(c))}return b},optionValue:function(a){return Element.extend(a).hasAttribute('value')?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,d){$super(d,c);this.element=$(b);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(a){var b;switch(a.type){case'mouseover':b=a.fromElement;break;case'mouseout':b=a.toElement;break;default:return null}return Element.extend(b)}});Event.Methods=(function(){var e;if(Prototype.Browser.IE){var f={0:1,1:4,2:2};e=function(a,b){return a.button==f[b]}}else if(Prototype.Browser.WebKit){e=function(a,b){switch(b){case 0:return a.which==1&&!a.metaKey;case 1:return a.which==1&&a.metaKey;default:return false}}}else{e=function(a,b){return a.which?(a.which===b+1):(a.button===b)}}return{isLeftClick:function(a){return e(a,0)},isMiddleClick:function(a){return e(a,1)},isRightClick:function(a){return e(a,2)},element:function(a){var b=Event.extend(a).target;return Element.extend(b.nodeType==Node.TEXT_NODE?b.parentNode:b)},findElement:function(a,b){var c=Event.element(a);if(!b)return c;var d=[c].concat(c.ancestors());return Selector.findElement(d,b,0)},pointer:function(a){return{x:a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}},pointerX:function(a){return Event.pointer(a).x},pointerY:function(a){return Event.pointer(a).y},stop:function(a){Event.extend(a);a.preventDefault();a.stopPropagation();a.stopped=true}}})();Event.extend=(function(){var c=Object.keys(Event.Methods).inject({},function(m,a){m[a]=Event.Methods[a].methodize();return m});if(Prototype.Browser.IE){Object.extend(c,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(a){if(!a)return false;if(a._extendedByPrototype)return a;a._extendedByPrototype=Prototype.emptyFunction;var b=Event.pointer(a);Object.extend(a,{target:a.srcElement,relatedTarget:Event.relatedTarget(a),pageX:b.x,pageY:b.y});return Object.extend(a,c)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,c);return Prototype.K}})();Object.extend(Event,(function(){var h=Event.cache;function getEventID(a){if(a._prototypeEventID)return a._prototypeEventID[0];arguments.callee.id=arguments.callee.id||1;return a._prototypeEventID=[++arguments.callee.id]}function getDOMEventName(a){if(a&&a.include(':'))return"dataavailable";return a}function getCacheForID(a){return h[a]=h[a]||{}}function getWrappersForEventName(a,b){var c=getCacheForID(a);return c[b]=c[b]||[]}function createWrapper(b,d,e){var f=getEventID(b);var c=getWrappersForEventName(f,d);if(c.pluck("handler").include(e))return false;var g=function(a){if(!Event||!Event.extend||(a.eventName&&a.eventName!=d))return false;Event.extend(a);e.call(b,a)};g.handler=e;c.push(g);return g}function findWrapper(b,d,e){var c=getWrappersForEventName(b,d);return c.find(function(a){return a.handler==e})}function destroyWrapper(a,b,d){var c=getCacheForID(a);if(!c[b])return false;c[b]=c[b].without(findWrapper(a,b,d))}function destroyCache(){for(var a in h)for(var b in h[a])h[a][b]=null}if(window.attachEvent){window.attachEvent("onunload",destroyCache)}return{observe:function(a,b,c){a=$(a);var d=getDOMEventName(b);var e=createWrapper(a,b,c);if(!e)return a;if(a.addEventListener){a.addEventListener(d,e,false)}else{a.attachEvent("on"+d,e)}return a},stopObserving:function(b,c,d){b=$(b);var e=getEventID(b),name=getDOMEventName(c);if(!d&&c){getWrappersForEventName(e,c).each(function(a){b.stopObserving(c,a.handler)});return b}else if(!c){Object.keys(getCacheForID(e)).each(function(a){b.stopObserving(a)});return b}var f=findWrapper(e,c,d);if(!f)return b;if(b.removeEventListener){b.removeEventListener(name,f,false)}else{b.detachEvent("on"+name,f)}destroyWrapper(e,c,d);return b},fire:function(a,b,c){a=$(a);if(a==document&&document.createEvent&&!a.dispatchEvent)a=document.documentElement;var d;if(document.createEvent){d=document.createEvent("HTMLEvents");d.initEvent("dataavailable",true,true)}else{d=document.createEventObject();d.eventType="ondataavailable"}d.eventName=b;d.memo=c||{};if(document.createEvent){a.dispatchEvent(d)}else{a.fireEvent(d.eventType,d)}return Event.extend(d)}}})());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 a;function fireContentLoadedEvent(){if(document.loaded)return;if(a)window.clearInterval(a);document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){a=window.setInterval(function(){if(/loaded|complete/.test(document.readyState))fireContentLoadedEvent()},0);Event.observe(window,"load",fireContentLoadedEvent)}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent()}}}})();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(a,x,y){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,x,y);this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(a);return(y>=this.offset[1]&&y<this.offset[1]+a.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+a.offsetWidth)},withinIncludingScrolloffsets:function(a,x,y){var b=Element.cumulativeScrollOffset(a);this.xcomp=x+b[0]-this.deltaX;this.ycomp=y+b[1]-this.deltaY;this.offset=Element.cumulativeOffset(a);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth)},overlap:function(a,b){if(!a)return 0;if(a=='vertical')return((this.offset[1]+b.offsetHeight)-this.ycomp)/b.offsetHeight;if(a=='horizontal')return((this.offset[0]+b.offsetWidth)-this.xcomp)/b.offsetWidth},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(a,b,c){c=c||{};return Element.clonePosition(b,a,c)}};if(!document.getElementsByClassName)document.getElementsByClassName=function(f){function iter(a){return a.blank()?null:"[contains(concat(' ', @class, ' '), ' "+a+" ')]"}f.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(a,b){b=b.toString().strip();var c=/\s/.test(b)?$w(b).map(iter).join(''):iter(b);return c?document._getElementsByXPath('.//*'+c,a):[]}:function(b,c){c=c.toString().strip();var d=[],classNames=(/\s/.test(c)?$w(c):null);if(!classNames&&!c)return d;var e=$(b).getElementsByTagName('*');c=' '+c+' ';for(var i=0,child,cn;child=e[i];i++){if(child.className&&(cn=' '+child.className+' ')&&(cn.include(c)||(classNames&&classNames.all(function(a){return!a.toString().blank()&&cn.include(' '+a+' ')}))))d.push(Element.extend(child))}return d};return function(a,b){return $(b||document.body).getElementsByClassName(a)}}(Element.Methods);Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(b){this.element.className.split(/\s+/).select(function(a){return a.length>0})._each(b)},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();

window.onload = function() {
		//flashGal();



       // var top_brand = $('top_brand').onclick = function() {
        Event.observe($('hbo1'), 'click', function(ev) {

					window.open('http://mycar.bg/hbo/mysound', 'gaga');
        });

         Event.observe($('hbo2'), 'click', function(ev) {

					window.open('http://mycar.bg/hbo/mysound', 'gaga');
        });

         Event.observe($('hbo3'), 'click', function(ev) {

					window.open('http://mycar.bg/hbo/mysound', 'gaga');
        });



         Event.observe($('div_header'), 'click', function(ev) {

					window.open('http://mycar.bg/hbo/mysound', 'gaga');
        });
}

function checkFlashSearchForm(){
//	var sf = new SWFObject("flash/search.swf", "form_search", "310", "38", "8");
//	sf.addParam("wmode", "transparent");
//	sf.write("form_search");
}

function more_events(id) {
	$('info_'+id).toggle();
}

/*add to social network*/
function addToFavorites(urlAddress, pageName){
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(pageName, urlAddress,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( urlAddress, pageName);
	} else { alert("Sorry! Your browser doesn't support this function."); }
}

var networkTimeout = 0;
function show_network(){
	clearTimeout(networkTimeout);
	$('networks').show();
}
function hide_network(){
	networkTimeout = setTimeout('close_butt()', 3000);
}
function show_more(){
	$('net_buttons').setStyle({'width': '360px'});
	$('more_links').show();
	$('more_net').hide();
	$('close_net').show();
}
function close_butt(){
	$('networks').hide();
	$('net_buttons').setStyle({'width': '240px'});
	$('more_links').hide();
	$('more_net').show();
	$('close_net').hide();
}

function vote_down(where, params){
	//var params  = 'article='+article;
	//var url = 'modules/news/votes.php';
	var pars = params+'&vote=down';

	if(where == 'interview'){
		//var url = rooturl_new+'/bg/interviews/vote';
		var url = 'modules/interviews/votes.php';
	}
	else if(where == 'news'){
		var url = 'modules/news/votes.php';
	}

	new Ajax.Request( url, {
			method: "get",
			parameters: pars,
			onSuccess: function(transport) {
				$('vote').update(transport.responseText);
				//$('down').addClassName('inactive');
				$('down').setAttribute('onclick', '');
				$("vote_mark").hide();
			}
		}
	);
	return false;
}
function vote_up(where, params){

	var pars = params+'&vote=up';

	if(where == 'interview'){
		//var url = rooturl_new+'/bg/interviews/vote';
		var url = 'modules/interviews/votes.php';
	}
	else if(where == 'news'){
		var url = 'modules/news/votes.php';
	}

	new Ajax.Request( url, {
			method: "get",
			parameters: pars,
			onSuccess: function(transport) {
				$('vote').update(transport.responseText);
				//$('up').addClassName('inactive');
				$('up').setAttribute('onclick', '');
				$("vote_mark").hide();
			},
			onException: function(request, exception) {
		    	console.log("test="+exception);
		    }
		}
	);
	return false;
}


function delayedNewsArchive(page){
	$('news_list').setStyle({opacity:0.1});

	$('news_archive_preloader').show();
	setTimeout('newsArchive('+page+')', 2000);
	return false;
}

function newsArchive(page){
	$('news_archive_preloader').hide();
	new Ajax.Updater('news_archive', '/updater.php?act=news&upg='+page, { method: 'get' });
	$('news_list').setStyle({opacity:1});
}

/* function setInterviewBlock (){
	new Ajax.Request('/interviews.php', {
		method: 'get',
		onSuccess: function(transport) {
			$('interview_block').update(transport.responseText);
			if($$('ul.panel-tabs').length)
			{
				interviews_list();
//				setEventsBlock();
				init_tabs();
				set_tab(current_tab);
				if($('video-tabs'))
				{
					var sv = new SWFObject("/flash/videotabs.swf", "vtabs", "300", "328", "9", "#000000");
					sv.addVariable('xmlPath',escape("./?act=video-xml&do=player"));
					sv.addVariable('siteURL',"http://www.mysound.bg/");
					sv.write("video-tabs");
				}
			}
		}
	});
} */

/* function setEventsBlock (){
	new Ajax.Updater('events_block', '../modules/events/calendar.php', { method: 'get' });
} */

function calendar(year,month, prev_next){
		var url = 'modules/events/calendar.php';
		var pars = 'month='+month+'&year='+ year+'&pn='+ prev_next;

		new Ajax.Updater(
		'events_block',
			url,
			{
				method: 'get',
				parameters: pars,
				onFailure: showError
			});

}

function showError(request)
{
	alert("Грешка " + Math.floor(Math.random()*1000, 3));
}

function interviews_list(){
	lis = $$('ul#person li');
	lis.shift();
	lis.each(function(e){
		e.className = 'close';
	});
}

function newsletter(user, word){

	var the_form = document.forms.letter;
	var mail = /^(([\w_\-]+)\.?)+@(([\w_\-]+)\.?)+\.[a-zA-Z]{2,4}$/;

	if(the_form.mail.value == '' ){
		document.getElementById('warning').innerHTML = 'Моля въведете e-mail';
		the_form.mail.focus();
		return false;
	}
	if (mail.test(the_form.mail.value)==false){
		document.getElementById('warning').innerHTML = 'Моля въведете коректен e-mail';
		the_form.mail.focus();
		return false;
	}
	if (the_form.keywords.value == ''){
		document.getElementById('warning').innerHTML = 'Моля въведете ключова дума';
		the_form.keywords.focus();
		return false;
	}

	document.getElementById('description').innerHTML = '';

	document.getElementById('warning').innerHTML = '';
	new Ajax.Updater('newsletter', 'newsletter.php?act=newsletter&user='+user+'&word='+word, { method: 'get' });
}


function videoListPreloader(page){
	$('news_list').setStyle({opacity:0.1});
	$('news_archive_preloader').show();
	setTimeout('newsArchive('+page+')', 2000);
	return false;
}

function videoList(page){
	$('news_archive_preloader').hide();
	new Ajax.Updater('news_archive', '/updater.php?act=news&upg='+page, { method: 'get' });
	$('news_list').setStyle({opacity:1});
}



/**
 * FONT SIZE
 */

var min=8;
var max=18;

function increaseFontSize() {
   var p = document.getElementById('text_action');

   		if(p.style.fontSize){
   			var s = parseInt(p.style.fontSize.replace("px",""));}
		else { var s = 11; }

		if(s!=max) { s += 1; }
		p.style.fontSize = s+"px"
}

function decreaseFontSize() {

	var p = document.getElementById('text_action');

      if(p.style.fontSize) {
      	var s = parseInt(p.style.fontSize.replace("px",""));}
      else { var s = 11; }

      if(s!=min) {s -= 1;}
      p.style.fontSize = s+"px"
}

function validate(){
	if(document.getElementById('messages')){
		document.getElementById('messages').innerHTML = '';
	}
	var the_form = document.forms.hello;
	var mail = /^(([\w_\-]+)\.?)+@(([\w_\-]+)\.?)+\.[a-zA-Z]{2,4}$/;

	if(the_form.name.value == ''){
		document.getElementById('warning').innerHTML = 'Моля въведете име';
		the_form.name.focus();
		return false;
	}
	if(the_form.mail.value == '' ){
		document.getElementById('warning').innerHTML = 'Моля въведете ел. поща';
		the_form.mail.focus();
		return false;
	}
	if (mail.test(the_form.mail.value)==false){
		document.getElementById('warning').innerHTML = 'Моля въведете коректен e-mail';
		the_form.mail.focus();
		return false;
	}


	if($('style')!=null){
		var count = 0;
		var chks = document.getElementsByName('styles[]');

	    var hasChecked = false;
	    for (var i = 0; i < chks.length; i++){
	    	if (chks[i].checked){
	    		count=count+1;
	    		break;
	    	}
	    }
		if(count==0){
	    	document.getElementById('warning').innerHTML = 'Моля изберете стил';
			return false;
		}
	}

	if(tinyMCE)
	{
		if(tinyMCE.getContent() == '' ){
			document.getElementById('warning').innerHTML = 'Моля въведете текст';
			return false;
		}
	}
	if (the_form.code.value == ''){
		document.getElementById('warning').innerHTML = 'Моля въведете защитния код';
		the_form.code.focus();
		return false;
	}
	 var children = the_form.childNodes;
        for (var i = 0; i < children.length; i++) {
            if ((children[i].nodeName == 'TEXTAREA')) {
                alert(children[i].value);
            }
        }


	the_form.submit();
}



function changeElement(id) {

	var elem = document.getElementById(id);

	var all_li = document.getElementById("person").getElementsByTagName("div");

	elems = [];
	for(i = 0; i < all_li.length; i++)
	{
		if(all_li[i].parentNode.tagName.toLowerCase() == "li")
			elems[elems.length] = all_li[i];
	}

	for(i = 0; i < elems.length; i++)
	{


		if (elems[i] != elem || elems[i].parentNode.className  == "open"){

			elems[i].parentNode.className = "close";
			elem.className = "open";
		}
		else {

			elems[i].parentNode.className = "open";
		}

	}
}

/*
	LG Start
*/

var act = 0;

function m_over(){
	if(act == 0){
		act = 1;

		$("lgb_act").style.width='477px';
		$("lgb_act").style.height='331px';

		$("lgb_act").style.left='-178px';
		$("lgb").style.backgroundColor='transparent';
		var so = new SWFObject("exp_banner/out2.swf", "mymovie", "477", "331", "8", "#FF9D5C","wmode");
		so.addParam("scaleMode","noscale");
		so.addParam("align","TL");
		so.addParam("wmode","transparent");
		so.write("lgb_act");
	}
}

function m_out(){
	if(act == 1){
		act = 0;

		$("lgb_act").style.width='300px';
		$("lgb_act").style.height='250px';

		$("lgb_act").style.height='250px';
		$("lgb_act").style.left='0px';
		$("lgb").style.backgroundColor='#000000';
		var so = new SWFObject("exp_banner/over.swf", "mymovie", "300", "250", "8", "#000000");
		so.addParam("scaleMode","noscale");
		so.addParam("align","TL");
		so.addParam("wmode","transparent");
		so.write("lgb_act");
	}
}

/*
	LG End
*/

/*
	Tabs Start
*/
function init_tabs(){
	var menu = $$('ul.panel-tabs li a').each(function(tab_link){
		$(tab_link).observe('mouseover', function(ev){
			var e = Event.element(ev);
			var tab_id = $(e).rel;

			$$('ul.panel-tabs li a').each(function(te){
				$(te).removeClassName('tab-active');
			})

			$(e).addClassName('tab-active');

			$$('.tab').each(function(t){
				$(t).removeClassName('active');
			})
			$('tab-' + tab_id).addClassName('active');

			ev.stop();
		});
	});
}

function set_tab(id){
	$$('ul.panel-tabs li a').each(function(te){
		$(te).removeClassName('tab-active');
	})

	$$('a[rel='+id+']')[0].addClassName('tab-active');

	$$('.tab').each(function(t){
		$(t).removeClassName('active');
	})
	$('tab-' + id).addClassName('active');
}

/*
	Tabs End
*/
function ScrollBy(dir){
   	var left = $('xdiv').scrollLeft;
	$('xdiv').scrollLeft = (dir =='left') ? left - 28 : left + 28;
}

function refreshValue(divID,myValue){
	$(divID).value=myValue;

}



if($('photo_1') != null){
	var p1 = new SWFObject("flash/uploader.swf", "photon", "70", "23", "8", "#000000");
		p1.addParam("scaleMode","noscale");
		p1.addParam("wmode","transparent");
		p1.addVariable("buttonPath","flash/uploader.png");
		p1.addVariable("phpPath","http://"+rooturl+"/picupload.php");
		p1.addVariable("div_id","photo1");
		p1.addVariable("file_prefix","http://"+rooturl+"/upload/temp/");
		p1.write("photo_1");


	var p2 = new SWFObject("flash/uploader.swf", "photod", "70", "23", "8", "#000000");
		p2.addParam("scaleMode","noscale");
		p2.addParam("wmode","transparent");
		p2.addVariable("buttonPath","flash/uploader.png");
		p2.addVariable("phpPath","http://"+rooturl+"/picupload.php");
		p2.addVariable("div_id","photo2");
		p2.addVariable("file_prefix","http://"+rooturl+"/upload/temp/");
		p2.write("photo_2");

	var p3 = new SWFObject("flash/uploader.swf", "photo1", "70", "23", "8", "#000000");
		p3.addParam("scaleMode","noscale");
		p3.addParam("wmode","transparent");
		p3.addVariable("buttonPath","flash/uploader.png");
		p3.addVariable("phpPath","http://"+rooturl+"/picupload.php");
		p3.addVariable("div_id","photo3");
		p3.addVariable("file_prefix","http://"+rooturl+"/upload/temp/");
		p3.write("photo_3");

}

var so = new SWFObject("http://mysound.bg/flash/srch.swf", "mymovie", "290", "24", "8", "#000000");
		so.addParam("scaleMode","noscale");
		so.addParam("align","TL");
		so.addParam("xmlPath",rooturl_new+"/xml/xml_styles");
		so.write("flash_search");


/*=:project
  scalable Inman Flash Replacement (sIFR) version 3, revision 398

  =:file
    Copyright: 2006 Mark Wubben.
    Author: Mark Wubben, <http://novemberborn.net/>

  =:history
    * IFR: Shaun Inman
    * sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
    * sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

  =:license
    This software is licensed and provided under the CC-GNU LGPL.
    See <http://creativecommons.org/licenses/LGPL/2.1/>    
*/

var sIFR=new function(){var O=this;var E={ACTIVE:"sIFR-active",UNLOADING:"sIFR-unloading",REPLACED:"sIFR-replaced",IGNORE:"sIFR-ignore",ALTERNATE:"sIFR-alternate",CLASS:"sIFR-class",LAYOUT:"sIFR-layout",FLASH:"sIFR-flash",FIX_FOCUS:"sIFR-fixfocus",DUMMY:"sIFR-dummy"};E.IGNORE_CLASSES=[E.REPLACED,E.IGNORE,E.ALTERNATE];this.MIN_FONT_SIZE=6;this.MAX_FONT_SIZE=126;this.FLASH_PADDING_BOTTOM=5;this.VERSION="398";this.isActive=false;this.isEnabled=true;this.fixHover=true;this.autoInitialize=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomLoaded=true;this.useStyleCheck=false;this.hasFlashClassSet=false;this.repaintOnResize=true;this.replacements=[];var L=0;var R=false;function Y(){}function D(b){function c(d){return d.toLocaleUpperCase()}this.normalize=function(d){return d.replace(/\n|\r|\xA0/g,D.SINGLE_WHITESPACE).replace(/\s+/g,D.SINGLE_WHITESPACE)};this.textTransform=function(d,e){switch(d){case"uppercase":return e.toLocaleUpperCase();case"lowercase":return e.toLocaleLowerCase();case"capitalize":return e.replace(/^\w|\s\w/g,c)}return e};this.toHexString=function(d){if(d.charAt(0)!="#"||d.length!=4&&d.length!=7){return d}d=d.substring(1);return"0x"+(d.length==3?d.replace(/(.)(.)(.)/,"$1$1$2$2$3$3"):d)};this.toJson=function(f,e){var d="";switch(typeof (f)){case"string":d='"'+e(f)+'"';break;case"number":case"boolean":d=f.toString();break;case"object":d=[];for(var g in f){if(f[g]==Object.prototype[g]){continue}d.push('"'+g+'":'+this.toJson(f[g]))}d="{"+d.join(",")+"}";break}return d};this.convertCssArg=function(d){if(!d){return{}}if(typeof (d)=="object"){if(d.constructor==Array){d=d.join("")}else{return d}}var k={};var l=d.split("}");for(var g=0;g<l.length;g++){var h=l[g].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!h||h.length!=3){continue}if(!k[h[1]]){k[h[1]]={}}var f=h[2].split(";");for(var e=0;e<f.length;e++){var m=f[e].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/);if(!m||m.length!=3){continue}k[h[1]][m[1]]=m[2].replace(/\s+$/,"")}}return k};this.extractFromCss=function(f,e,h,d){var g=null;if(f&&f[e]&&f[e][h]){g=f[e][h];if(d){delete f[e][h]}}return g};this.cssToString=function(e){var f=[];for(var d in e){var i=e[d];if(i==Object.prototype[d]){continue}f.push(d,"{");for(var h in i){if(i[h]==Object.prototype[h]){continue}var g=i[h];if(D.UNIT_REMOVAL_PROPERTIES[h]){g=parseInt(g,10)}f.push(h,":",g,";")}f.push("}")}return f.join("")};this.escape=function(d){return escape(d).replace(/\+/g,"%2B")};this.encodeVars=function(d){return d.join("&").replace(/%/g,"%25")};this.copyProperties=function(f,e){for(var d in f){if(e[d]===undefined){e[d]=f[d]}}return e};this.domain=function(){var d="";try{d=document.domain}catch(f){}return d};this.domainMatches=function(g,f){if(f=="*"||f==g){return true}var e=f.lastIndexOf("*");if(e>-1){f=f.substr(e+1);var d=g.lastIndexOf(f);if(d>-1&&(d+f.length)==g.length){return true}}return false};this.uriEncode=function(d){return encodeURI(decodeURIComponent(d))};this.delay=function(e,g,f){var d=Array.prototype.slice.call(arguments,3);setTimeout(function(){g.apply(f,d)},e)}}D.UNIT_REMOVAL_PROPERTIES={leading:true,"margin-left":true,"margin-right":true,"text-indent":true};D.SINGLE_WHITESPACE=" ";function T(d){var c=this;function b(f,h,g){var j=c.getStyleAsInt(f,h,d.ua.ie);if(j==0){j=f[g];for(var e=3;e<arguments.length;e++){j-=c.getStyleAsInt(f,arguments[e],true)}}return j}this.getBody=function(){return document.getElementsByTagName("body")[0]||null};this.querySelectorAll=function(e){return window.parseSelector(e)};this.addClass=function(e,f){if(f){f.className=((f.className||"")==""?"":f.className+" ")+e}};this.removeClass=function(e,f){if(f){f.className=f.className.replace(new RegExp("(^|\\s)"+e+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(e,f){return new RegExp("(^|\\s)"+e+"(\\s|$)").test(f.className)};this.hasOneOfClassses=function(g,f){for(var e=0;e<g.length;e++){if(this.hasClass(g[e],f)){return true}}return false};this.ancestorHasClass=function(f,e){f=f.parentNode;while(f&&f.nodeType==1){if(this.hasClass(e,f)){return true}f=f.parentNode}return false};this.create=function(e,f){var g=document.createElementNS?document.createElementNS(T.XHTML_NS,e):document.createElement(e);if(f){g.className=f}return g};this.getComputedStyle=function(g,h){var e;if(document.defaultView&&document.defaultView.getComputedStyle){var f=document.defaultView.getComputedStyle(g,null);e=f?f[h]:null}else{if(g.currentStyle){e=g.currentStyle[h]}}return e||""};this.getStyleAsInt=function(f,h,e){var g=this.getComputedStyle(f,h);if(e&&!/px$/.test(g)){return 0}return parseInt(g)||0};this.getWidthFromStyle=function(e){return b(e,"width","offsetWidth","paddingRight","paddingLeft","borderRightWidth","borderLeftWidth")};this.getHeightFromStyle=function(e){return b(e,"height","offsetHeight","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth")};this.getDimensions=function(h){var g=h.offsetWidth;var e=h.offsetHeight;if(g==0||e==0){for(var f=0;f<h.childNodes.length;f++){var j=h.childNodes[f];if(j.nodeType!=1){continue}g=Math.max(g,j.offsetWidth);e=Math.max(e,j.offsetHeight)}}return{width:g,height:e}};this.getViewport=function(){return{width:window.innerWidth||document.documentElement.clientWidth||this.getBody().clientWidth,height:window.innerHeight||document.documentElement.clientHeight||this.getBody().clientHeight}};this.blurElement=function(g){try{g.blur();return }catch(h){}var f=this.create("input");f.style.width="0px";f.style.height="0px";g.parentNode.appendChild(f);f.focus();f.blur();f.parentNode.removeChild(f)}}T.XHTML_NS="http://www.w3.org/1999/xhtml";function H(l){var c=navigator.userAgent.toLowerCase();var k=(navigator.product||"").toLowerCase();var d=navigator.platform.toLowerCase();this.parseVersion=function(e){return e.replace(/(^|\D)(\d)(?=\D|$)/g,"$10000$2")};this.macintosh=/^mac/.test(d);this.windows=/^win/.test(d);this.quicktime=false;this.opera=/opera/.test(c);this.konqueror=/konqueror/.test(k);this.ie=false/*@cc_on||true@*/;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(c)/*@cc_on&&@_jscript_version>=5.5@*/;this.ieWin=this.ie&&this.windows/*@cc_on&&@_jscript_version>=5.1@*/;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.ie&&this.macintosh/*@cc_on&&@_jscript_version<5.1@*/;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=/safari/.test(c);this.webkit=!this.konqueror&&/applewebkit/.test(c);this.khtml=this.webkit||this.konqueror;this.gecko=!this.webkit&&k=="gecko";this.ieVersion=this.ie&&/.*msie\s(\d\.\d)/.exec(c)?this.parseVersion(RegExp.$1):"0";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(c)?this.parseVersion(RegExp.$2):"0";this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(c)?this.parseVersion(RegExp.$1):"0";this.geckoVersion=this.gecko&&/.*rv:\s*([^\)]+)\)\s+gecko/.exec(c)?this.parseVersion(RegExp.$1):"0";this.konquerorVersion=this.konqueror&&/.*konqueror\/([\d\.]+).*/.exec(c)?this.parseVersion(RegExp.$1):"0";this.flashVersion=0;if(this.ieWin){var g;var j=false;try{g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(h){try{g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=6;g.AllowScriptAccess="always"}catch(h){j=this.flashVersion==6}if(!j){try{g=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(h){}}}if(!j&&g){this.flashVersion=parseFloat(/([\d,?]+)/.exec(g.GetVariable("$version"))[1].replace(/,/g,"."))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){this.flashVersion=parseFloat(/(\d+\.?\d*)/.exec(navigator.plugins["Shockwave Flash"].description)[1]);var f=0;while(this.flashVersion>=H.MIN_FLASH_VERSION&&f<navigator.mimeTypes.length){var b=navigator.mimeTypes[f];if(b.type=="application/x-shockwave-flash"&&b.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){this.flashVersion=0;this.quicktime=true}f++}}}this.flash=this.flashVersion>=H.MIN_FLASH_VERSION;this.transparencySupport=this.macintosh||this.windows;this.computedStyleSupport=this.ie||!!document.defaultView.getComputedStyle;this.requiresPrefetch=this.ieWin||this.khtml;this.fixFocus=this.gecko&&this.windows;this.nativeDomLoaded=this.gecko||this.webkit&&this.webkitVersion>=this.parseVersion("525")||this.konqueror&&this.konquerorMajor>this.parseVersion("03")||this.opera;this.mustCheckStyle=this.khtml||this.opera;this.forcePageLoad=this.webkit&&this.webkitVersion<this.parseVersion("523");this.properDocument=typeof (document.location)=="object";this.supported=this.flash&&this.properDocument&&(!this.ie||this.ieSupported)&&this.computedStyleSupport&&(!this.opera||this.operaVersion>=this.parseVersion("9.50"))&&(!this.webkit||this.webkitVersion>=this.parseVersion("412"))&&(!this.gecko||this.geckoVersion>=this.parseVersion("1.8.0.12"))&&(!this.konqueror)}H.MIN_FLASH_VERSION=8;function F(b){this.fix=b.ua.ieWin&&window.location.hash!="";var c;this.cache=function(){c=document.title};function d(){document.title=c}this.restore=function(){if(this.fix){setTimeout(d,0)}}}function S(e){var i=null;function f(){try{if(e.ua.ie||document.readyState!="loaded"&&document.readyState!="complete"){document.documentElement.doScroll("left")}}catch(j){return setTimeout(f,10)}b()}function b(){if(e.useStyleCheck){d()}else{if(!e.ua.mustCheckStyle){g(null,true)}}}function d(){i=e.dom.create("div",E.DUMMY);e.dom.getBody().appendChild(i);c()}function c(){if(e.dom.getComputedStyle(i,"marginLeft")=="42px"){h()}else{setTimeout(c,10)}}function h(){if(i&&i.parentNode){i.parentNode.removeChild(i)}i=null;g(null,true)}function g(j,k){e.initialize(k);if(j&&j.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",g,false)}if(window.removeEventListener){window.removeEventListener("load",g,false)}}}this.attach=function(){if(window.addEventListener){window.addEventListener("load",g,false)}else{window.attachEvent("onload",g)}if(!e.useDomLoaded||e.ua.forcePageLoad||e.ua.ie&&window.top!=window){return }if(e.ua.nativeDomLoaded){document.addEventListener("DOMContentLoaded",b,false)}else{if(e.ua.ie||e.ua.khtml){f()}}}}var Q="sifrFetch";function N(b){var d=false;this.fetchMovies=function(f){if(b.setPrefetchCookie&&new RegExp(";?"+Q+"=true;?").test(document.cookie)){return }try{d=true;c(f)}catch(g){if(b.debug){throw g}}if(b.setPrefetchCookie){document.cookie=Q+"=true;path="+b.cookiePath}};this.clear=function(){if(!d){return }try{var f=document.getElementsByTagName("script");for(var g=f.length-1;g>=0;g--){var h=f[g];if(h.type=="sifr/prefetch"){h.parentNode.removeChild(h)}}}catch(j){}};function c(e){for(var f=0;f<e.length;f++){document.write('<script defer type="sifr/prefetch" src="'+e[f].src+'"><\/script>')}}}function K(c,f,e,b,d){this.sIFR=c;this.id=f;this.vars=e;this.movie=null;this.__forceWidth=b;this.__events=d;this.__resizing=0}K.prototype={getFlashElement:function(){return document.getElementById(this.id)},getAlternate:function(){return document.getElementById(this.id+"_alternate")},getAncestor:function(){var b=this.getFlashElement().parentNode;return !this.sIFR.dom.hasClass(E.FIX_FOCUS,b)?b:b.parentNode},available:function(){var b=this.getFlashElement();return b&&b.parentNode},call:function(b){if(!this.available()){return false}var c=this.getFlashElement();try{Function.prototype.apply.call(c[b],c,Array.prototype.slice.call(arguments,1))}catch(d){if(this.sIFR.debug){throw d}return false}return true},updateVars:function(b,d){for(var c=0;c<this.vars.length;c++){if(this.vars[c].split("=")[0]==b){this.vars[c]=b+"="+d;break}}var e=this.sIFR.util.encodeVars(this.vars);this.movie.injectVars(this.getFlashElement(),e);this.movie.injectVars(this.movie.html,e)},storeSize:function(b,c){this.movie.setSize(b,c);this.updateVars(b,c)},fireEvent:function(b){if(this.available()&&this.__events[b]){this.sIFR.util.delay(0,this.__events[b],this,this)}},resizeFlashElement:function(b,c,d){if(!this.available()){return }this.__resizing++;var e=this.getFlashElement();e.setAttribute("height",b);this.updateVars("renderheight",b);this.storeSize("height",b);if(c!==null){e.setAttribute("width",c);this.storeSize("width",c)}if(this.__events.onReplacement){this.sIFR.util.delay(0,this.__events.onReplacement,this,this);delete this.__events.onReplacement}if(d){this.sIFR.util.delay(0,function(){this.call("scaleMovie");this.__resizing--},this)}else{this.__resizing--}},blurFlashElement:function(){if(this.available()){this.sIFR.dom.blurElement(this.getFlashElement())}},resetMovie:function(){this.sIFR.util.delay(0,this.movie.reset,this.movie,this.getFlashElement(),this.getAlternate())},resizeAfterScale:function(){if(this.available()&&this.__resizing==0){this.sIFR.util.delay(0,this.resize,this)}},resize:function(){if(!this.available()){return }this.__resizing++;var f=this.getFlashElement();var e=f.offsetWidth;if(e==0){return }var d=f.getAttribute("width");var j=f.getAttribute("height");var k=this.getAncestor();var m=this.sIFR.dom.getHeightFromStyle(k);f.style.width="1px";f.style.height="1px";k.style.minHeight=m+"px";var b=this.getAlternate().childNodes;var l=[];for(var h=0;h<b.length;h++){var g=b[h].cloneNode(true);l.push(g);k.appendChild(g)}var c=this.sIFR.dom.getWidthFromStyle(k);for(var h=0;h<l.length;h++){k.removeChild(l[h])}f.style.width=f.style.height=k.style.minHeight="";f.setAttribute("width",this.__forceWidth?c:d);f.setAttribute("height",j);if(c!=e){if(this.__forceWidth){this.storeSize("width",c)}this.call("resize",c)}this.__resizing--},replaceText:function(f,h){var c=this.sIFR.util.escape(f);if(!this.call("replaceText",c)){return false}this.updateVars("content",c);var d=this.getAlternate();if(h){while(d.firstChild){d.removeChild(d.firstChild)}for(var b=0;b<h.length;b++){d.appendChild(h[b])}}else{try{d.innerHTML=f}catch(g){}}return true},changeCSS:function(b){b=this.sIFR.util.escape(this.sIFR.util.cssToString(this.sIFR.util.convertCssArg(b)));this.updateVars("css",b);return this.call("changeCSS",b)}};var X=new function(){this.create=function(n,i,h,e,d,f,m,k,g,l){var j=n.ua.ie?c:b;return new j(n,i,h,e,d,f,m,["flashvars",k,"wmode",g,"bgcolor",l,"allowScriptAccess","always","quality","best"])};function b(q,k,g,e,d,f,p,m){var l=q.dom.create("object",E.FLASH);var o=["type","application/x-shockwave-flash","id",e,"name",e,"data",d,"width",f,"height",p];for(var n=0;n<o.length;n+=2){l.setAttribute(o[n],o[n+1])}var h=l;if(g){h=W.create("div",E.FIX_FOCUS);h.appendChild(l)}for(var n=0;n<m.length;n+=2){if(m[n]=="name"){continue}var j=W.create("param");j.setAttribute("name",m[n]);j.setAttribute("value",m[n+1]);l.appendChild(j)}while(k.firstChild){k.removeChild(k.firstChild)}k.appendChild(h);this.html=h.cloneNode(true)}b.prototype={reset:function(d,e){d.parentNode.replaceChild(this.html.cloneNode(true),d)},setSize:function(d,e){this.html.setAttribute(d,e)},injectVars:function(d,f){var g=d.getElementsByTagName("param");for(var e=0;e<g.length;e++){if(g[e].getAttribute("name")=="flashvars"){g[e].setAttribute("value",f);break}}}};function c(n,h,g,e,d,f,m,j){this.dom=n.dom;this.html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+e+'" width="'+f+'" height="'+m+'" class="'+E.FLASH+'"><param name="movie" value="'+d+'"></param></object>';var l="";for(var k=0;k<j.length;k+=2){l+='<param name="'+j[k]+'" value="'+j[k+1]+'"></param>'}this.html=this.html.replace(/(<\/object>)/,l+"$1");h.innerHTML=this.html}c.prototype={reset:function(e,f){var d=e.parentNode;d.innerHTML=this.html;d.appendChild(f)},setSize:function(d,e){this.html=this.html.replace(d=="height"?/(height)="\d+"/:/(width)="\d+"/,'$1="'+e+'"')},injectVars:function(d,e){if(d!=this.html){return }this.html=this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/,"$1"+e)}}};this.errors=new Y(O);var A=this.util=new D(O);var W=this.dom=new T(O);var U=this.ua=new H(O);var G={fragmentIdentifier:new F(O),pageLoad:new S(O),prefetch:new N(O)};var J={kwargs:[],replaceAll:function(c){for(var b=0;b<this.kwargs.length;b++){O.replace(this.kwargs[b])}if(!c){this.kwargs=[]}}};this.activate=function(){if(!U.supported||!this.isEnabled||this.isActive||!C()||a()){return }if(U.requiresPrefetch){G.prefetch.fetchMovies(arguments)}this.isActive=true;this.setFlashClass();G.fragmentIdentifier.cache();if(!this.autoInitialize){return }G.pageLoad.attach();if(U.ie){window.attachEvent("onunload",function(){W.addClass(E.UNLOADING,document.documentElement)})}};this.setFlashClass=function(){if(this.hasFlashClassSet){return }W.addClass(E.ACTIVE,W.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return }W.removeClass(E.ACTIVE,W.getBody());W.removeClass(E.ACTIVE,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(b){if(!this.isActive||!this.isEnabled){return }if(R){if(!b){J.replaceAll(false)}return }R=true;J.replaceAll(b);if(O.repaintOnResize){if(window.addEventListener){window.addEventListener("resize",Z,false)}else{window.attachEvent("onresize",Z)}}G.prefetch.clear()};this.replace=function(v,s){if(!U.supported){return }if(s){v=A.copyProperties(v,s)}if(!R){return J.kwargs.push(v)}if(this.onReplacementStart){this.onReplacementStart(v)}var AK=v.elements||W.querySelectorAll(v.selector);if(AK.length==0){return }var u=M(v.src);var AP=A.convertCssArg(v.css);var t=B(v.filters);var AL=v.forceSingleLine===true;var AQ=v.preventWrap===true&&!AL;var o=AL||(v.fitExactly==null?this.fitExactly:v.fitExactly)===true;var AB=o||(v.forceWidth==null?this.forceWidth:v.forceWidth)===true;var q=v.ratios||[];var AC=v.pixelFont===true;var p=parseInt(v.tuneHeight)||0;var x=!!v.onRelease||!!v.onRollOver||!!v.onRollOut;if(o){A.extractFromCss(AP,".sIFR-root","text-align",true)}var r=A.extractFromCss(AP,".sIFR-root","font-size",true)||"0";var d=A.extractFromCss(AP,".sIFR-root","background-color",true)||"#FFFFFF";var m=A.extractFromCss(AP,".sIFR-root","kerning",true)||"";var AU=A.extractFromCss(AP,".sIFR-root","opacity",true)||"100";var h=A.extractFromCss(AP,".sIFR-root","cursor",true)||"default";var AN=parseInt(A.extractFromCss(AP,".sIFR-root","leading"))||0;var AH=v.gridFitType||(A.extractFromCss(AP,".sIFR-root","text-align")=="right")?"subpixel":"pixel";var g=this.forceTextTransform===false?"none":A.extractFromCss(AP,".sIFR-root","text-transform",true)||"none";r=/^\d+(px)?$/.test(r)?parseInt(r):0;AU=parseFloat(AU)<1?100*parseFloat(AU):AU;var AA=v.modifyCss?"":A.cssToString(AP);var AE=v.wmode||"";if(!AE){if(v.transparent){AE="transparent"}else{if(v.opaque){AE="opaque"}}}if(AE=="transparent"){if(!U.transparencySupport){AE="opaque"}else{d="transparent"}}for(var AT=0;AT<AK.length;AT++){var AD=AK[AT];if(W.hasOneOfClassses(E.IGNORE_CLASSES,AD)||W.ancestorHasClass(AD,E.ALTERNATE)){continue}var AM=W.getDimensions(AD);var e=AM.height;var b=AM.width;var y=W.getComputedStyle(AD,"display");if(!e||!b||!y||y=="none"){continue}b=W.getWidthFromStyle(AD);var k,AF;if(!r){var AJ=I(AD);k=Math.min(this.MAX_FONT_SIZE,Math.max(this.MIN_FONT_SIZE,AJ.fontSize));if(AC){k=Math.max(8,8*Math.round(k/8))}AF=AJ.lines;if(isNaN(AF)||!isFinite(AF)||AF==0){AF=1}if(AF>1&&AN){e+=Math.round((AF-1)*AN)}}else{k=r;AF=1}var c=W.create("span",E.ALTERNATE);var AV=AD.cloneNode(true);AD.parentNode.appendChild(AV);for(var AS=0,AR=AV.childNodes.length;AS<AR;AS++){c.appendChild(AV.childNodes[AS].cloneNode(true))}if(v.modifyContent){v.modifyContent(AV,v.selector)}if(v.modifyCss){AA=v.modifyCss(AP,AV,v.selector)}var n=P(AV,g,v.uriEncode);AV.parentNode.removeChild(AV);if(v.modifyContentString){n.text=v.modifyContentString(n.text,v.selector)}if(n.text==""){continue}e=Math.round(AF*k);var AI=Math.round(AF*V(k,q)*k)+this.FLASH_PADDING_BOTTOM+p;var z=AB?b:"100%";var AG="sIFR_replacement_"+L++;var AO=["id="+AG,"content="+A.escape(n.text),"width="+b,"height="+e,"renderheight="+AI,"link="+A.escape(n.primaryLink.href||""),"target="+A.escape(n.primaryLink.target||""),"size="+k,"css="+A.escape(AA),"cursor="+h,"tunewidth="+(v.tuneWidth||0),"tuneheight="+p,"offsetleft="+(v.offsetLeft||""),"offsettop="+(v.offsetTop||""),"fitexactly="+o,"preventwrap="+AQ,"forcesingleline="+AL,"antialiastype="+(v.antiAliasType||""),"thickness="+(v.thickness||""),"sharpness="+(v.sharpness||""),"kerning="+m,"gridfittype="+AH,"flashfilters="+t,"opacity="+AU,"blendmode="+(v.blendMode||""),"selectable="+(v.selectable==null?"true":v.selectable===true),"fixhover="+(this.fixHover===true),"events="+x,"version="+this.VERSION];var w=A.encodeVars(AO);var f=new K(O,AG,AO,AB,{onReplacement:v.onReplacement,onRollOver:v.onRollOver,onRollOut:v.onRollOut,onRelease:v.onRelease});f.movie=X.create(sIFR,AD,U.fixFocus&&v.fixFocus,AG,u,z,AI,w,AE,d);this.replacements.push(f);this.replacements[AG]=f;if(v.selector){if(!this.replacements[v.selector]){this.replacements[v.selector]=[f]}else{this.replacements[v.selector].push(f)}}c.setAttribute("id",AG+"_alternate");AD.appendChild(c);W.addClass(E.REPLACED,AD)}G.fragmentIdentifier.restore()};this.getReplacementByFlashElement=function(c){for(var b=0;b<O.replacements.length;b++){if(O.replacements[b].id==c.getAttribute("id")){return O.replacements[b]}}};this.redraw=function(){for(var b=0;b<O.replacements.length;b++){O.replacements[b].resetMovie()}};function C(){if(O.domains.length==0){return true}var c=A.domain();for(var b=0;b<O.domains.length;b++){if(A.domainMatches(c,O.domains[b])){return true}}return false}function a(){if(document.location.protocol=="file:"){if(O.debug){O.errors.fire("isFile")}return true}return false}function M(b){if(U.ie&&b.charAt(0)=="/"){b=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+b}return b}function V(c,d){for(var b=0;b<d.length;b+=2){if(c<=d[b]){return d[b+1]}}return d[d.length-1]||1}function B(f){var d=[];for(var c in f){if(f[c]==Object.prototype[c]){continue}var b=f[c];c=[c.replace(/filter/i,"")+"Filter"];for(var e in b){if(b[e]==Object.prototype[e]){continue}c.push(e+":"+A.escape(A.toJson(b[e],A.toHexString)))}d.push(c.join(","))}return A.escape(d.join(";"))}function Z(c){var d=Z.viewport;var b=W.getViewport();if(d&&b.width==d.width&&b.height==d.height){return }Z.viewport=b;if(Z.timer){clearTimeout(Z.timer)}Z.timer=setTimeout(function(){delete Z.timer;for(var e=0;e<O.replacements.length;e++){O.replacements[e].resize()}},200)}function I(f){var g,c;if(!U.ie){g=W.getStyleAsInt(f,"lineHeight");c=Math.floor(W.getStyleAsInt(f,"height")/g)}else{if(U.ie){var g=W.getComputedStyle(f,"fontSize");if(g.indexOf("px")>0){g=parseInt(g)}else{var e=f.innerHTML;f.style.visibility="visible";f.style.overflow="visible";f.style.position="static";f.style.zoom="normal";f.style.writingMode="lr-tb";f.style.width=f.style.height="auto";f.style.maxWidth=f.style.maxHeight=f.style.styleFloat="none";var h=f;var b=f.currentStyle.hasLayout;if(b){f.innerHTML='<div class="'+E.LAYOUT+'">X<br>X<br>X</div>';h=f.firstChild}else{f.innerHTML="X<br>X<br>X"}var d=h.getClientRects();g=d[1].bottom-d[1].top;g=Math.ceil(g*0.8);if(b){f.innerHTML='<div class="'+E.LAYOUT+'">'+e+"</div>";h=f.firstChild}else{f.innerHTML=e}d=h.getClientRects();c=d.length;if(b){f.innerHTML=e}f.style.visibility=f.style.width=f.style.height=f.style.maxWidth=f.style.maxHeight=f.style.overflow=f.style.styleFloat=f.style.position=f.style.zoom=f.style.writingMode=""}}}return{fontSize:g,lines:c}}function P(b,f,r){r=r||A.uriEncode;var p=[],l=[];var j=null;var d=b.childNodes;var n=false,o=false;var h=0;while(h<d.length){var e=d[h];if(e.nodeType==3){var s=A.textTransform(f,A.normalize(e.nodeValue)).replace(/</g,"&lt;");if(n&&o){s=s.replace(/^\s+/,"")}l.push(s);n=/\s$/.test(s);o=false}if(e.nodeType==1){var g=[];var q=e.nodeName.toLowerCase();var m=e.className||"";if(/\s+/.test(m)){if(m.indexOf(E.CLASS)>-1){m=m.match("(\\s|^)"+E.CLASS+"-([^\\s$]*)(\\s|$)")[2]}else{m=m.match(/^([^\s]+)/)[1]}}if(m!=""){g.push('class="'+m+'"')}if(q=="a"){var c=r(e.getAttribute("href")||"");var k=e.getAttribute("target")||"";g.push('href="'+c+'"','target="'+k+'"');if(!j){j={href:c,target:k}}}l.push("<"+q+(g.length>0?" ":"")+g.join(" ")+">");o=true;if(e.hasChildNodes()){p.push(h);h=0;d=e.childNodes;continue}else{if(!/^(br|img)$/i.test(e.nodeName)){l.push("</",e.nodeName.toLowerCase(),">")}}}if(p.length>0&&!e.nextSibling){do{h=p.pop();d=e.parentNode.parentNode.childNodes;e=d[h];if(e){l.push("</",e.nodeName.toLowerCase(),">")}}while(h==d.length-1&&p.length>0)}h++}return{text:l.join("").replace(/^\s+|\s+$|\s*(<br>)\s*/g,"$1"),primaryLink:j||{}}}};
var parseSelector=(function(){var B=/\s*,\s*/;var A=/\s*([\s>+~(),]|^|$)\s*/g;var K=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var E=/^[^\s>+~]/;var J=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function G(P,N){N=N||document.documentElement;var Q=P.split(B),V=[];for(var S=0;S<Q.length;S++){var L=[N],U=F(Q[S]);for(var R=0;R<U.length;){var O=U[R++],M=U[R++],T="";if(U[R]=="("){while(U[R++]!=")"&&R<U.length){T+=U[R]}T=T.slice(0,-1)}L=H(L,O,M,T)}V=V.concat(L)}return V}function F(L){var M=L.replace(A,"$1").replace(K,"$1*$2");if(E.test(M)){M=" "+M}return M.match(J)||[]}function H(L,N,O,M){return(G.selectors[N])?G.selectors[N](L,O,M):[]}var D={toArray:function(M){var L=[];for(var N=0;N<M.length;N++){L.push(M[N])}return L}};var C={isTag:function(M,L){return(L=="*")||(L.toLowerCase()==M.nodeName.toLowerCase())},previousSiblingElement:function(L){do{L=L.previousSibling}while(L&&L.nodeType!=1);return L},nextSiblingElement:function(L){do{L=L.nextSibling}while(L&&L.nodeType!=1);return L},hasClass:function(L,M){return(M.className||"").match("(^|\\s)"+L+"(\\s|$)")},getByTag:function(L,M){return M.getElementsByTagName(L)}};var I={"#":function(L,N){for(var M=0;M<L.length;M++){if(L[M].getAttribute("id")==N){return[L[M]]}}return[]}," ":function(M,O){var L=[];for(var N=0;N<M.length;N++){L=L.concat(D.toArray(C.getByTag(O,M[N])))}return L},">":function(M,P){var L=[];for(var O=0,Q;O<M.length;O++){Q=M[O];for(var N=0,R;N<Q.childNodes.length;N++){R=Q.childNodes[N];if(R.nodeType==1&&C.isTag(R,P)){L.push(R)}}}return L},".":function(M,O){var L=[];for(var N=0,P;N<M.length;N++){P=M[N];if(C.hasClass([O],P)){L.push(P)}}return L},":":function(L,N,M){return(G.pseudoClasses[N])?G.pseudoClasses[N](L,M):[]}};G.selectors=I;G.pseudoClasses={};G.util=D;G.dom=C;return G})();

var myriad = {src: 'flash/myriad.swf'};
sIFR.activate(myriad);
sIFR.replace(myriad, {selector: 'h2.aa',css: ['.sIFR-root { color: #ffffff; font-size: 18px; cursor: pointer; }'],wmode: 'transparent'});
sIFR.replace(myriad, {selector: 'p.aa',css: ['.sIFR-root { color: #ffffff; font-size: 13px; cursor: pointer; }'],wmode: 'transparent'});
sIFR.replace(myriad, {selector: 'ul.main_menu li.aa',css: ['.sIFR-root { color: #ffffff; font-size: 14px; cursor: pointer; text-align: center; margin-left: 1px; }','a {color: #ffffff; text-decoration: none; display: block; line-height: 14px; padding: 13px 10px; padding-bottom: 17px;}','a:hover {color: #FFB047;}'],wmode: 'transparent'});

/* --- BoxOver ---
/* --- v 2.1 17th June 2006
By Oliver Bryant with help of Matthew Tagg
http://boxover.swazz.org */

if (typeof document.attachEvent!='undefined') {
   window.attachEvent('onload',init);
   document.attachEvent('onmousemove',moveMouse);
   document.attachEvent('onclick',checkMove); }
else {
   window.addEventListener('load',init,false);
   document.addEventListener('mousemove',moveMouse,false);
   document.addEventListener('click',checkMove,false);
}

var oDv=document.createElement("div");
var dvHdr=document.createElement("div");
var dvBdy=document.createElement("div");
var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;
boxOpen=false;
ox=10;
oy=10;
lockX=0;
lockY=0;

function init() {
	oDv.appendChild(dvHdr);
	oDv.appendChild(dvBdy);
	oDv.style.position="absolute";
	oDv.style.visibility='hidden';
	document.body.appendChild(oDv);

}

function defHdrStyle() {
	dvHdr.innerHTML='<img  style="vertical-align:middle"  src="info.gif">&nbsp;&nbsp;'+dvHdr.innerHTML;
	dvHdr.style.fontWeight='bold';
	dvHdr.style.width='150px';
	dvHdr.style.fontFamily='arial';
	dvHdr.style.border='1px solid #A5CFE9';
	dvHdr.style.padding='3';
	dvHdr.style.fontSize='11';
	dvHdr.style.color='#4B7A98';
	dvHdr.style.background='#D5EBF9';
	dvHdr.style.filter='alpha(opacity=85)'; // IE
	dvHdr.style.opacity='0.85'; // FF
}

function defBdyStyle() {
	dvBdy.style.borderBottom='1px solid #A5CFE9';
	dvBdy.style.borderLeft='1px solid #A5CFE9';
	dvBdy.style.borderRight='1px solid #A5CFE9';
	dvBdy.style.width='150px';
	dvBdy.style.fontFamily='arial';
	dvBdy.style.fontSize='11';
	dvBdy.style.padding='3';
	dvBdy.style.color='#1B4966';
	dvBdy.style.background='#FFFFFF';
	dvBdy.style.filter='alpha(opacity=85)'; // IE
	dvBdy.style.opacity='0.85'; // FF
}

function checkElemBO(txt) {
if (!txt || typeof(txt) != 'string') return false;
if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1))
   return true;
else
   return false;
}

function scanBO(curNode) {
	  if (checkElemBO(curNode.title)) {
         curNode.boHDR=getParam('header',curNode.title);
         curNode.boBDY=getParam('body',curNode.title);
			curNode.boCSSBDY=getParam('cssbody',curNode.title);
			curNode.boCSSHDR=getParam('cssheader',curNode.title);
			curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false;
			curNode.fixX=parseInt(getParam('fixedrelx',curNode.title));
			curNode.fixY=parseInt(getParam('fixedrely',curNode.title));
			curNode.absX=parseInt(getParam('fixedabsx',curNode.title));
			curNode.absY=parseInt(getParam('fixedabsy',curNode.title));
			curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10;
			curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10;
			curNode.fade=(getParam('fade',curNode.title)=='on')?true:false;
			curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04;
			curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0;
			if (getParam('requireclick',curNode.title)=='on') {
				curNode.requireclick=true;
				document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false);
				document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false);
			}
			else {// Note : if requireclick is on the stop clicks are ignored
   			if (getParam('doubleclickstop',curNode.title)!='off') {
   				document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false);
   			}
   			if (getParam('singleclickstop',curNode.title)=='on') {
   				document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false);
   			}
   		}
			curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true;
			curNode.title='';
			curNode.hasbox=1;
	   }
	   else
	      curNode.hasbox=2;
}


function getParam(param,list) {
	var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');
	var res = reg.exec(list);
	var returnvar;
	if(res)
		return res[2].replace('[[','[').replace(']]',']');
	else
		return '';
}

function Left(elem){
	var x=0;
	if (elem.calcLeft)
		return elem.calcLeft;
	var oElem=elem;
	while(elem){
		 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0))
		 	x+=parseInt(elem.currentStyle.borderLeftWidth);
		 x+=elem.offsetLeft;
		 elem=elem.offsetParent;
	  }
	oElem.calcLeft=x;
	return x;
	}

function Top(elem){
	 var x=0;
	 if (elem.calcTop)
	 	return elem.calcTop;
	 var oElem=elem;
	 while(elem){
	 	 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0))
		 	x+=parseInt(elem.currentStyle.borderTopWidth);
		 x+=elem.offsetTop;
	         elem=elem.offsetParent;
 	 }
 	 oElem.calcTop=x;
 	 return x;

}

var ah,ab;
function applyStyles() {
	if(ab)
		oDv.removeChild(dvBdy);
	if (ah)
		oDv.removeChild(dvHdr);
	dvHdr=document.createElement("div");
	dvBdy=document.createElement("div");
	CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();
	CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();
	dvHdr.innerHTML=CBE.boHDR;
	dvBdy.innerHTML=CBE.boBDY;
	ah=false;
	ab=false;
	if (CBE.boHDR!='') {
		oDv.appendChild(dvHdr);
		ah=true;
	}
	if (CBE.boBDY!=''){
		oDv.appendChild(dvBdy);
		ab=true;
	}
}

var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ;
var ini=false;

// Customised function for inner window dimension
function SHW() {
   if (document.body && (document.body.clientWidth !=0)) {
      width=document.body.clientWidth;
      height=document.body.clientHeight;
   }
   if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) {
      width=document.documentElement.clientWidth;
      height=document.documentElement.clientHeight;
   }
   return [width,height];
}


var ID=null;
function moveMouse(e) {
   //boxMove=true;
	e?evt=e:evt=event;

	CSE=evt.target?evt.target:evt.srcElement;

	if (!CSE.hasbox) {
	   // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement
	   iElem=CSE;
	   while ((iElem.parentNode) && (!iElem.hasbox)) {
	      scanBO(iElem);
	      iElem=iElem.parentNode;
	   }
	}

	if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){
	   if (!CSE.boxItem) {
			iterElem=CSE;
			while ((iterElem.hasbox==2)&&(iterElem.parentNode))
					iterElem=iterElem.parentNode;
			CSE.boxItem=iterElem;
			}
		iterElem=CSE.boxItem;
		if (CSE.boxItem&&(CSE.boxItem.hasbox==1))  {
			LBE=CBE;
			CBE=iterElem;
			if (CBE!=LBE) {
				applyStyles();
				if (!CBE.requireclick)
					if (CBE.fade) {
						if (ID!=null)
							clearTimeout(ID);
						ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay);
					}
					else {
						if (ID!=null)
							clearTimeout(ID);
						COL=1;
						ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay);
					}
				if (CBE.IEbugfix) {hideSelects();}
				fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;
				fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;
				lockX=0;
				lockY=0;
				boxMove=true;
				ox=CBE.offX?CBE.offX:10;
				oy=CBE.offY?CBE.offY:10;
			}
		}
		else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove))	{
			// The conditional here fixes flickering between tables cells.
			if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) {
   			CBE=null;
   			if (ID!=null)
  					clearTimeout(ID);
   			fadeOut();
   			showSelects();
			}
		}
		LSE=CSE;
	}
	else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) {
		totalScrollLeft=0;
		totalScrollTop=0;

		iterElem=CSE;
		while(iterElem) {
			if(!isNaN(parseInt(iterElem.scrollTop)))
				totalScrollTop+=parseInt(iterElem.scrollTop);
			if(!isNaN(parseInt(iterElem.scrollLeft)))
				totalScrollLeft+=parseInt(iterElem.scrollLeft);
			iterElem=iterElem.parentNode;
		}
		if (CBE!=null) {
			boxLeft=Left(CBE)-totalScrollLeft;
			boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;
			boxTop=Top(CBE)-totalScrollTop;
			boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;
			doCheck();
		}
	}

	if (boxMove&&CBE) {
		// This added to alleviate bug in IE6 w.r.t DOCTYPE
		bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
		bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;
		mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;
		mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;
		if ((CBE)&&(CBE.windowLock)) {
			mouseY < -oy?lockY=-mouseY-oy:lockY=0;
			mouseX < -ox?lockX=-mouseX-ox:lockX=0;
			mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY;
			mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX;
		}
		oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";
		oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px";

	}
}

function doCheck() {
	if (   (mouseX < boxLeft)    ||     (mouseX >boxRight)     || (mouseY < boxTop) || (mouseY > boxBottom)) {
		if (!CBE.requireclick)
			fadeOut();
		if (CBE.IEbugfix) {showSelects();}
		CBE=null;
	}
}

function pauseBox(e) {
   e?evt=e:evt=event;
	boxMove=false;
	evt.cancelBubble=true;
}

function showHideBox(e) {
	oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden';
}

function hideBox(e) {
	oDv.style.visibility='hidden';
}

var COL=0;
var stopfade=false;
function fadeIn(fs) {
		ID=null;
		COL=0;
		oDv.style.visibility='visible';
		fadeIn2(fs);
}

function fadeIn2(fs) {
		COL=COL+fs;
		COL=(COL>1)?1:COL;
		oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')';
		oDv.style.opacity=COL;
		if (COL<1)
		 setTimeout("fadeIn2("+fs+")",20);
}


function fadeOut() {
	oDv.style.visibility='hidden';

}

function isChild(s,d) {
	while(s) {
		if (s==d)
			return true;
		s=s.parentNode;
	}
	return false;
}

var cSrc;
function checkMove(e) {
	e?evt=e:evt=event;
	cSrc=evt.target?evt.target:evt.srcElement;
	if ((!boxMove)&&(!isChild(cSrc,oDv))) {
		fadeOut();
		if (CBE&&CBE.IEbugfix) {showSelects();}
		boxMove=true;
		CBE=null;
	}
}

function showSelects(){
   var elements = document.getElementsByTagName("select");
   for (i=0;i< elements.length;i++){
      elements[i].style.visibility='visible';
   }
}

function hideSelects(){
   var elements = document.getElementsByTagName("select");
   for (i=0;i< elements.length;i++){
   elements[i].style.visibility='hidden';
   }
}

// script.aculo.us slider.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008

// Copyright (c) 2005-2007 Marty Haught, Thomas Fuchs 
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/

if (!Control) var Control = { };

// options:
//  axis: 'vertical', or 'horizontal' (default)
//
// callbacks:
//  onChange(value)
//  onSlide(value)
Control.Slider = Class.create({
  initialize: function(handle, track, options) {
    var slider = this;
    
    if (Object.isArray(handle)) {
      this.handles = handle.collect( function(e) { return $(e) });
    } else {
      this.handles = [$(handle)];
    }
    
    this.track   = $(track);
    this.options = options || { };

    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; // assure backwards compat
    this.values    = this.handles.map( function() { return 0 });
    this.spans     = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : 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;

    // Will be used to align the handle onto the track, if necessary
    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();

    // Allowed values array
    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);

    // Initialize handles in reverse (make sure first handle is active)
    this.handles.each( function(h,i) {
      i = slider.handles.length-1-i;
      slider.setValue(parseFloat(
        (Object.isArray(slider.options.sliderValue) ? 
          slider.options.sliderValue[i] : slider.options.sliderValue) || 
         slider.range.start), i);
      h.makePositioned().observe("mousedown", slider.eventMouseDown);
    });
    
    this.track.observe("mousedown", this.eventMouseDown);
    document.observe("mouseup", this.eventMouseUp);
    document.observe("mousemove", this.eventMouseMove);
    
    this.initialized = true;
  },
  dispose: function() {
    var slider = this;    
    Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
    Event.stopObserving(document, "mouseup", this.eventMouseUp);
    Event.stopObserving(document, "mousemove", this.eventMouseMove);
    this.handles.each( function(h) {
      Event.stopObserving(h, "mousedown", slider.eventMouseDown);
    });
  },
  setDisabled: function(){
    this.disabled = true;
  },
  setEnabled: function(){
    this.disabled = false;
  },  
  getNearestValue: function(value){
    if (this.allowedValues){
      if (value >= this.allowedValues.max()) return(this.allowedValues.max());
      if (value <= this.allowedValues.min()) return(this.allowedValues.min());
      
      var offset = Math.abs(this.allowedValues[0] - value);
      var newValue = this.allowedValues[0];
      this.allowedValues.each( function(v) {
        var currentOffset = Math.abs(v - value);
        if (currentOffset <= offset){
          newValue = v;
          offset = currentOffset;
        } 
      });
      return newValue;
    }
    if (value > this.range.end) return this.range.end;
    if (value < this.range.start) return this.range.start;
    return value;
  },
  setValue: function(sliderValue, handleIdx){
    if (!this.active) {
      this.activeHandleIdx = handleIdx || 0;
      this.activeHandle    = this.handles[this.activeHandleIdx];
      this.updateStyles();
    }
    handleIdx = handleIdx || this.activeHandleIdx || 0;
    if (this.initialized && this.restricted) {
      if ((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
        sliderValue = this.values[handleIdx-1];
      if ((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
        sliderValue = this.values[handleIdx+1];
    }
    sliderValue = this.getNearestValue(sliderValue);
    this.values[handleIdx] = sliderValue;
    this.value = this.values[0]; // assure backwards compat
    
    this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = 
      this.translateToPx(sliderValue);
    
    this.drawSpans();
    if (!this.dragging || !this.event) this.updateFinished();
  },
  setValueBy: function(delta, handleIdx) {
    this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, 
      handleIdx || this.activeHandleIdx || 0);
  },
  translateToPx: function(value) {
    return Math.round(
      ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * 
      (value - this.range.start)) + "px";
  },
  translateToValue: function(offset) {
    return ((offset/(this.trackLength-this.handleLength) * 
      (this.range.end-this.range.start)) + this.range.start);
  },
  getRange: function(range) {
    var v = this.values.sortBy(Prototype.K); 
    range = range || 0;
    return $R(v[range],v[range+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 slider = this;
    if (this.spans)
      $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
    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(span, range) {
    if (this.isVertical()) {
      span.style.top = this.translateToPx(range.start);
      span.style.height = this.translateToPx(range.end - range.start + this.range.start);
    } else {
      span.style.left = this.translateToPx(range.start);
      span.style.width = this.translateToPx(range.end - range.start + this.range.start);
    }
  },
  updateStyles: function() {
    this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
    Element.addClassName(this.activeHandle, 'selected');
  },
  startDrag: function(event) {
    if (Event.isLeftClick(event)) {
      if (!this.disabled){
        this.active = true;
        
        var handle = Event.element(event);
        var pointer  = [Event.pointerX(event), Event.pointerY(event)];
        var track = handle;
        if (track==this.track) {
          var offsets  = Position.cumulativeOffset(this.track); 
          this.event = event;
          this.setValue(this.translateToValue( 
           (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
          ));
          var offsets  = Position.cumulativeOffset(this.activeHandle);
          this.offsetX = (pointer[0] - offsets[0]);
          this.offsetY = (pointer[1] - offsets[1]);
        } else {
          // find the handle (prevents issues with Safari)
          while((this.handles.indexOf(handle) == -1) && handle.parentNode) 
            handle = handle.parentNode;
            
          if (this.handles.indexOf(handle)!=-1) {
            this.activeHandle    = handle;
            this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
            this.updateStyles();
            
            var offsets  = Position.cumulativeOffset(this.activeHandle);
            this.offsetX = (pointer[0] - offsets[0]);
            this.offsetY = (pointer[1] - offsets[1]);
          }
        }
      }
      Event.stop(event);
    }
  },
  update: function(event) {
   if (this.active) {
      if (!this.dragging) this.dragging = true;
      this.draw(event);
      if (Prototype.Browser.WebKit) window.scrollBy(0,0);
      Event.stop(event);
   }
  },
  draw: function(event) {
    var pointer = [Event.pointerX(event), Event.pointerY(event)];
    var offsets = Position.cumulativeOffset(this.track);
    pointer[0] -= this.offsetX + offsets[0];
    pointer[1] -= this.offsetY + offsets[1];
    this.event = event;
    this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
    if (this.initialized && this.options.onSlide)
      this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
  },
  endDrag: function(event) {
    if (this.active && this.dragging) {
      this.finishDrag(event, true);
      Event.stop(event);
    }
    this.active = false;
    this.dragging = false;
  },  
  finishDrag: function(event, success) {
    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;
  }
});


