


var MooTools={'version':'1.2.5','build':'008d8f0f2fcc2044e54fdd3635341aaab274e757'};var Native=function(options){options=options||{};var name=options.name;var legacy=options.legacy;var protect=options.protect;var methods=options.implement;var generics=options.generics;var initialize=options.initialize;var afterImplement=options.afterImplement||function(){};var object=initialize||legacy;generics=generics!==false;object.constructor=Native;object.$family={name:'native'};if(legacy&&initialize)object.prototype=legacy.prototype;object.prototype.constructor=object;if(name){var family=name.toLowerCase();object.prototype.$family={name:family};Native.typize(object,family);}
var add=function(obj,name,method,force){if(!protect||force||!obj.prototype[name])obj.prototype[name]=method;if(generics)Native.genericize(obj,name,protect);afterImplement.call(obj,name,method);return obj;};object.alias=function(a1,a2,a3){if(typeof a1=='string'){var pa1=this.prototype[a1];if((a1=pa1))return add(this,a2,a1,a3);}
for(var a in a1)this.alias(a,a1[a],a2);return this;};object.implement=function(a1,a2,a3){if(typeof a1=='string')return add(this,a1,a2,a3);for(var p in a1)add(this,p,a1[p],a2);return this;};if(methods)object.implement(methods);return object;};Native.genericize=function(object,property,check){if((!check||!object[property])&&typeof object.prototype[property]=='function')object[property]=function(){var args=Array.prototype.slice.call(arguments);return object.prototype[property].apply(args.shift(),args);};};Native.implement=function(objects,properties){for(var i=0,l=objects.length;i<l;i++)objects[i].implement(properties);};Native.typize=function(object,family){if(!object.type)object.type=function(item){return($type(item)===family);};};(function(){var natives={'Array':Array,'Date':Date,'Function':Function,'Number':Number,'RegExp':RegExp,'String':String};for(var n in natives)new Native({name:n,initialize:natives[n],protect:true});var types={'boolean':Boolean,'native':Native,'object':Object};for(var t in types)Native.typize(types[t],t);var generics={'Array':["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],'String':["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var g in generics){for(var i=generics[g].length;i--;)Native.genericize(natives[g],generics[g][i],true);}})();var Hash=new Native({name:'Hash',initialize:function(object){if($type(object)=='hash')object=$unlink(object.getClean());for(var key in object)this[key]=object[key];return this;}});Hash.implement({forEach:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key))fn.call(bind,this[key],key,this);}},getClean:function(){var clean={};for(var key in this){if(this.hasOwnProperty(key))clean[key]=this[key];}
return clean;},getLength:function(){var length=0;for(var key in this){if(this.hasOwnProperty(key))length++;}
return length;}});Hash.alias('forEach','each');Array.implement({forEach:function(fn,bind){for(var i=0,l=this.length;i<l;i++)fn.call(bind,this[i],i,this);}});Array.alias('forEach','each');function $A(iterable){if(iterable.item){var l=iterable.length,array=new Array(l);while(l--)array[l]=iterable[l];return array;}
return Array.prototype.slice.call(iterable);};function $arguments(i){return function(){return arguments[i];};};function $chk(obj){return!!(obj||obj===0);};function $clear(timer){clearTimeout(timer);clearInterval(timer);return null;};function $defined(obj){return(obj!=undefined);};function $each(iterable,fn,bind){var type=$type(iterable);((type=='arguments'||type=='collection'||type=='array')?Array:Hash).each(iterable,fn,bind);};function $empty(){};function $extend(original,extended){for(var key in(extended||{}))original[key]=extended[key];return original;};function $H(object){return new Hash(object);};function $lambda(value){return($type(value)=='function')?value:function(){return value;};};function $merge(){var args=Array.slice(arguments);args.unshift({});return $mixin.apply(null,args);};function $mixin(mix){for(var i=1,l=arguments.length;i<l;i++){var object=arguments[i];if($type(object)!='object')continue;for(var key in object){var op=object[key],mp=mix[key];mix[key]=(mp&&$type(op)=='object'&&$type(mp)=='object')?$mixin(mp,op):$unlink(op);}}
return mix;};function $pick(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]!=undefined)return arguments[i];}
return null;};function $random(min,max){return Math.floor(Math.random()*(max-min+1)+min);};function $splat(obj){var type=$type(obj);return(type)?((type!='array'&&type!='arguments')?[obj]:obj):[];};var $time=Date.now||function(){return+new Date;};function $try(){for(var i=0,l=arguments.length;i<l;i++){try{return arguments[i]();}catch(e){}}
return null;};function $type(obj){if(obj==undefined)return false;if(obj.$family)return(obj.$family.name=='number'&&!isFinite(obj))?false:obj.$family.name;if(obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}}else if(typeof obj.length=='number'){if(obj.callee)return'arguments';else if(obj.item)return'collection';}
return typeof obj;};function $unlink(object){var unlinked;switch($type(object)){case'object':unlinked={};for(var p in object)unlinked[p]=$unlink(object[p]);break;case'hash':unlinked=new Hash(object);break;case'array':unlinked=[];for(var i=0,l=object.length;i<l;i++)unlinked[i]=$unlink(object[i]);break;default:return object;}
return unlinked;};var Browser=$merge({Engine:{name:'unknown',version:0},Platform:{name:(window.orientation!=undefined)?'ipod':(navigator.platform.match(/mac|win|linux/i)||['other'])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419);},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var engine in this.Engines){var version=this.Engines[engine]();if(version){this.Engine={name:engine,version:version};this.Engine[engine]=this.Engine[engine+version]=true;break;}}
return{name:engine,version:version};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject('MSXML2.XMLHTTP');},function(){return new ActiveXObject('Microsoft.XMLHTTP');});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var version=($try(function(){return navigator.plugins['Shockwave Flash'].description;},function(){return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');})||'0 r0').match(/\d+/g);return{version:parseInt(version[0]||0+'.'+version[1],10)||0,build:parseInt(version[2],10)||0};})();function $exec(text){if(!text)return text;if(window.execScript){window.execScript(text);}else{var script=document.createElement('script');script.setAttribute('type','text/javascript');script[(Browser.Engine.webkit&&Browser.Engine.version<420)?'innerText':'text']=text;document.head.appendChild(script);document.head.removeChild(script);}
return text;};Native.UID=1;var $uid=(Browser.Engine.trident)?function(item){return(item.uid||(item.uid=[Native.UID++]))[0];}:function(item){return item.uid||(item.uid=Native.UID++);};var Window=new Native({name:'Window',legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(win){$uid(win);if(!win.Element){win.Element=$empty;if(Browser.Engine.webkit)win.document.createElement("iframe");win.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{};}
win.document.window=win;return $extend(win,Window.Prototype);},afterImplement:function(property,value){window[property]=Window.Prototype[property]=value;}});Window.Prototype={$family:{name:'window'}};new Window(window);var Document=new Native({name:'Document',legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(doc){$uid(doc);doc.head=doc.getElementsByTagName('head')[0];doc.html=doc.getElementsByTagName('html')[0];if(Browser.Engine.trident&&Browser.Engine.version<=4)$try(function(){doc.execCommand("BackgroundImageCache",false,true);});if(Browser.Engine.trident)doc.window.attachEvent('onunload',function(){doc.window.detachEvent('onunload',arguments.callee);doc.head=doc.html=doc.window=null;});return $extend(doc,Document.Prototype);},afterImplement:function(property,value){document[property]=Document.Prototype[property]=value;}});Document.Prototype={$family:{name:'document'}};new Document(document);Array.implement({every:function(fn,bind){for(var i=0,l=this.length;i<l;i++){if(!fn.call(bind,this[i],i,this))return false;}
return true;},filter:function(fn,bind){var results=[];for(var i=0,l=this.length;i<l;i++){if(fn.call(bind,this[i],i,this))results.push(this[i]);}
return results;},clean:function(){return this.filter($defined);},indexOf:function(item,from){var len=this.length;for(var i=(from<0)?Math.max(0,len+from):from||0;i<len;i++){if(this[i]===item)return i;}
return-1;},map:function(fn,bind){var results=[];for(var i=0,l=this.length;i<l;i++)results[i]=fn.call(bind,this[i],i,this);return results;},some:function(fn,bind){for(var i=0,l=this.length;i<l;i++){if(fn.call(bind,this[i],i,this))return true;}
return false;},associate:function(keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++)obj[keys[i]]=this[i];return obj;},link:function(object){var result={};for(var i=0,l=this.length;i<l;i++){for(var key in object){if(object[key](this[i])){result[key]=this[i];delete object[key];break;}}}
return result;},contains:function(item,from){return this.indexOf(item,from)!=-1;},extend:function(array){for(var i=0,j=array.length;i<j;i++)this.push(array[i]);return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null;},include:function(item){if(!this.contains(item))this.push(item);return this;},combine:function(array){for(var i=0,l=array.length;i<l;i++)this.include(array[i]);return this;},erase:function(item){for(var i=this.length;i--;i){if(this[i]===item)this.splice(i,1);}
return this;},empty:function(){this.length=0;return this;},flatten:function(){var array=[];for(var i=0,l=this.length;i<l;i++){var type=$type(this[i]);if(!type)continue;array=array.concat((type=='array'||type=='collection'||type=='arguments')?Array.flatten(this[i]):this[i]);}
return array;},hexToRgb:function(array){if(this.length!=3)return null;var rgb=this.map(function(value){if(value.length==1)value+=value;return value.toInt(16);});return(array)?rgb:'rgb('+rgb+')';},rgbToHex:function(array){if(this.length<3)return null;if(this.length==4&&this[3]==0&&!array)return'transparent';var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push((bit.length==1)?'0'+bit:bit);}
return(array)?hex:'#'+hex.join('');}});try{delete Function.prototype.bind;}catch(e){}
Function.implement({extend:function(properties){for(var property in properties)this[property]=properties[property];return this;},create:function(options){var self=this;options=options||{};return function(event){var args=options.arguments;args=(args!=undefined)?$splat(args):Array.slice(arguments,(options.event)?1:0);if(options.event)args=[event||window.event].extend(args);var returns=function(){return self.apply(options.bind||null,args);};if(options.delay)return setTimeout(returns,options.delay);if(options.periodical)return setInterval(returns,options.periodical);if(options.attempt)return $try(returns);return returns();};},run:function(args,bind){return this.apply(bind,$splat(args));},pass:function(args,bind){return this.create({bind:bind,arguments:args});},bind:function(bind,args){return this.create({bind:bind,arguments:args});},bindWithEvent:function(bind,args){return this.create({bind:bind,arguments:args,event:true});},attempt:function(args,bind){return this.create({bind:bind,arguments:args,attempt:true})();},delay:function(delay,bind,args){return this.create({bind:bind,arguments:args,delay:delay})();},periodical:function(periodical,bind,args){return this.create({bind:bind,arguments:args,periodical:periodical})();}});Number.implement({limit:function(min,max){return Math.min(max,Math.max(min,this));},round:function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision;},times:function(fn,bind){for(var i=0;i<this;i++)fn.call(bind,i,this);},toFloat:function(){return parseFloat(this);},toInt:function(base){return parseInt(this,base||10);}});Number.alias('times','each');(function(math){var methods={};math.each(function(name){if(!Number[name])methods[name]=function(){return Math[name].apply(null,[this].concat($A(arguments)));};});Number.implement(methods);})(['abs','acos','asin','atan','atan2','ceil','cos','exp','floor','log','max','min','pow','sin','sqrt','tan']);String.implement({test:function(regex,params){return((typeof regex=='string')?new RegExp(regex,params):regex).test(this);},contains:function(string,separator){return(separator)?(separator+this+separator).indexOf(separator+string+separator)>-1:this.indexOf(string)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,'');},clean:function(){return this.replace(/\s+/g,' ').trim();},camelCase:function(){return this.replace(/-\D/g,function(match){return match.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(match){return('-'+match.charAt(0).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(match){return match.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,'\\$1');},toInt:function(base){return parseInt(this,base||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(array){var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(hex)?hex.slice(1).hexToRgb(array):null;},rgbToHex:function(array){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHex(array):null;},stripScripts:function(option){var scripts='';var text=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){scripts+=arguments[1]+'\n';return'';});if(option===true)$exec(scripts);else if($type(option)=='function')option(scripts,text);return text;},substitute:function(object,regexp){return this.replace(regexp||(/\\?\{([^{}]+)\}/g),function(match,name){if(match.charAt(0)=='\\')return match.slice(1);return(object[name]!=undefined)?object[name]:'';});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(value){for(var key in this){if(this.hasOwnProperty(key)&&this[key]===value)return key;}
return null;},hasValue:function(value){return(Hash.keyOf(this,value)!==null);},extend:function(properties){Hash.each(properties||{},function(value,key){Hash.set(this,key,value);},this);return this;},combine:function(properties){Hash.each(properties||{},function(value,key){Hash.include(this,key,value);},this);return this;},erase:function(key){if(this.hasOwnProperty(key))delete this[key];return this;},get:function(key){return(this.hasOwnProperty(key))?this[key]:null;},set:function(key,value){if(!this[key]||this.hasOwnProperty(key))this[key]=value;return this;},empty:function(){Hash.each(this,function(value,key){delete this[key];},this);return this;},include:function(key,value){if(this[key]==undefined)this[key]=value;return this;},map:function(fn,bind){var results=new Hash;Hash.each(this,function(value,key){results.set(key,fn.call(bind,value,key,this));},this);return results;},filter:function(fn,bind){var results=new Hash;Hash.each(this,function(value,key){if(fn.call(bind,value,key,this))results.set(key,value);},this);return results;},every:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)&&!fn.call(bind,this[key],key))return false;}
return true;},some:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)&&fn.call(bind,this[key],key))return true;}
return false;},getKeys:function(){var keys=[];Hash.each(this,function(value,key){keys.push(key);});return keys;},getValues:function(){var values=[];Hash.each(this,function(value){values.push(value);});return values;},toQueryString:function(base){var queryString=[];Hash.each(this,function(value,key){if(base)key=base+'['+key+']';var result;switch($type(value)){case'object':result=Hash.toQueryString(value,key);break;case'array':var qs={};value.each(function(val,i){qs[i]=val;});result=Hash.toQueryString(qs,key);break;default:result=key+'='+encodeURIComponent(value);}
if(value!=undefined)queryString.push(result);});return queryString.join('&');}});Hash.alias({keyOf:'indexOf',hasValue:'contains'});var Event=new Native({name:'Event',initialize:function(event,win){win=win||window;var doc=win.document;event=event||win.event;if(event.$extended)return event;this.$extended=true;var type=event.type;var target=event.target||event.srcElement;while(target&&target.nodeType==3)target=target.parentNode;if(type.test(/key/)){var code=event.which||event.keyCode;var key=Event.Keys.keyOf(code);if(type=='keydown'){var fKey=code-111;if(fKey>0&&fKey<13)key='f'+fKey;}
key=key||String.fromCharCode(code).toLowerCase();}else if(type.match(/(click|mouse|menu)/i)){doc=(!doc.compatMode||doc.compatMode=='CSS1Compat')?doc.html:doc.body;var page={x:event.pageX||event.clientX+doc.scrollLeft,y:event.pageY||event.clientY+doc.scrollTop};var client={x:(event.pageX)?event.pageX-win.pageXOffset:event.clientX,y:(event.pageY)?event.pageY-win.pageYOffset:event.clientY};if(type.match(/DOMMouseScroll|mousewheel/)){var wheel=(event.wheelDelta)?event.wheelDelta/120:-(event.detail||0)/3;}
var rightClick=(event.which==3)||(event.button==2);var related=null;if(type.match(/over|out/)){switch(type){case'mouseover':related=event.relatedTarget||event.fromElement;break;case'mouseout':related=event.relatedTarget||event.toElement;}
if(!(function(){while(related&&related.nodeType==3)related=related.parentNode;return true;}).create({attempt:Browser.Engine.gecko})())related=false;}}
return $extend(this,{event:event,type:type,page:page,client:client,rightClick:rightClick,wheel:wheel,relatedTarget:related,target:target,code:code,key:key,shift:event.shiftKey,control:event.ctrlKey,alt:event.altKey,meta:event.metaKey});}});Event.Keys=new Hash({'enter':13,'up':38,'down':40,'left':37,'right':39,'esc':27,'space':32,'backspace':8,'tab':9,'delete':46});Event.implement({stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation)this.event.stopPropagation();else this.event.cancelBubble=true;return this;},preventDefault:function(){if(this.event.preventDefault)this.event.preventDefault();else this.event.returnValue=false;return this;}});function Class(params){if(params instanceof Function)params={initialize:params};var newClass=function(){Object.reset(this);if(newClass._prototyping)return this;this._current=$empty;var value=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return value;}.extend(this);newClass.implement(params);newClass.constructor=Class;newClass.prototype.constructor=newClass;return newClass;};Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(object,key){if(key==null){for(var p in object)Object.reset(object,p);return object;}
delete object[key];switch($type(object[key])){case'object':var F=function(){};F.prototype=object[key];var i=new F;object[key]=Object.reset(i);break;case'array':object[key]=$unlink(object[key]);break;}
return object;};new Native({name:'Class',initialize:Class}).extend({instantiate:function(F){F._prototyping=true;var proto=new F;delete F._prototyping;return proto;},wrap:function(self,key,method){if(method._origin)method=method._origin;return function(){if(method._protected&&this._current==null)throw new Error('The method "'+key+'" cannot be called.');var caller=this.caller,current=this._current;this.caller=current;this._current=arguments.callee;var result=method.apply(this,arguments);this._current=current;this.caller=caller;return result;}.extend({_owner:self,_origin:method,_name:key});}});Class.implement({implement:function(key,value){if($type(key)=='object'){for(var p in key)this.implement(p,key[p]);return this;}
var mutator=Class.Mutators[key];if(mutator){value=mutator.call(this,value);if(value==null)return this;}
var proto=this.prototype;switch($type(value)){case'function':if(value._hidden)return this;proto[key]=Class.wrap(this,key,value);break;case'object':var previous=proto[key];if($type(previous)=='object')$mixin(previous,value);else proto[key]=$unlink(value);break;case'array':proto[key]=$unlink(value);break;default:proto[key]=value;}
return this;}});Class.Mutators={Extends:function(parent){this.parent=parent;this.prototype=Class.instantiate(parent);this.implement('parent',function(){var name=this.caller._name,previous=this.caller._owner.parent.prototype[name];if(!previous)throw new Error('The method "'+name+'" has no parent.');return previous.apply(this,arguments);}.protect());},Implements:function(items){$splat(items).each(function(item){if(item instanceof Function)item=Class.instantiate(item);this.implement(item);},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(type,fn,internal){type=Events.removeOn(type);if(fn!=$empty){this.$events[type]=this.$events[type]||[];this.$events[type].include(fn);if(internal)fn.internal=true;}
return this;},addEvents:function(events){for(var type in events)this.addEvent(type,events[type]);return this;},fireEvent:function(type,args,delay){type=Events.removeOn(type);if(!this.$events||!this.$events[type])return this;this.$events[type].each(function(fn){fn.create({'bind':this,'delay':delay,'arguments':args})();},this);return this;},removeEvent:function(type,fn){type=Events.removeOn(type);if(!this.$events[type])return this;if(!fn.internal)this.$events[type].erase(fn);return this;},removeEvents:function(events){var type;if($type(events)=='object'){for(type in events)this.removeEvent(type,events[type]);return this;}
if(events)events=Events.removeOn(events);for(type in this.$events){if(events&&events!=type)continue;var fns=this.$events[type];for(var i=fns.length;i--;i)this.removeEvent(type,fns[i]);}
return this;}});Events.removeOn=function(string){return string.replace(/^on([A-Z])/,function(full,first){return first.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent)return this;for(var option in this.options){if($type(this.options[option])!='function'||!(/^on[A-Z]/).test(option))continue;this.addEvent(option,this.options[option]);delete this.options[option];}
return this;}});var Element=new Native({name:'Element',legacy:window.Element,initialize:function(tag,props){var konstructor=Element.Constructors.get(tag);if(konstructor)return konstructor(props);if(typeof tag=='string')return document.newElement(tag,props);return document.id(tag).set(props);},afterImplement:function(key,value){Element.Prototype[key]=value;if(Array[key])return;Elements.implement(key,function(){var items=[],elements=true;for(var i=0,j=this.length;i<j;i++){var returns=this[i][key].apply(this[i],arguments);items.push(returns);if(elements)elements=($type(returns)=='element');}
return(elements)?new Elements(items):items;});}});Element.Prototype={$family:{name:'element'}};Element.Constructors=new Hash;var IFrame=new Native({name:'IFrame',generics:false,initialize:function(){var params=Array.link(arguments,{properties:Object.type,iframe:$defined});var props=params.properties||{};var iframe=document.id(params.iframe);var onload=props.onload||$empty;delete props.onload;props.id=props.name=$pick(props.id,props.name,iframe?(iframe.id||iframe.name):'IFrame_'+$time());iframe=new Element(iframe||'iframe',props);var onFrameLoad=function(){var host=$try(function(){return iframe.contentWindow.location.host;});if(!host||host==window.location.host){var win=new Window(iframe.contentWindow);new Document(iframe.contentWindow.document);$extend(win.Element.prototype,Element.Prototype);}
onload.call(iframe.contentWindow,iframe.contentWindow.document);};var contentWindow=$try(function(){return iframe.contentWindow;});((contentWindow&&contentWindow.document.body)||window.frames[props.id])?onFrameLoad():iframe.addListener('load',onFrameLoad);return iframe;}});var Elements=new Native({initialize:function(elements,options){options=$extend({ddup:true,cash:true},options);elements=elements||[];if(options.ddup||options.cash){var uniques={},returned=[];for(var i=0,l=elements.length;i<l;i++){var el=document.id(elements[i],!options.cash);if(options.ddup){if(uniques[el.uid])continue;uniques[el.uid]=true;}
if(el)returned.push(el);}
elements=returned;}
return(options.cash)?$extend(elements,this):elements;}});Elements.implement({filter:function(filter,bind){if(!filter)return this;return new Elements(Array.filter(this,(typeof filter=='string')?function(item){return item.match(filter);}:filter,bind));}});(function(){var createElementAcceptsHTML;try{var x=document.createElement('<input name=x>');createElementAcceptsHTML=(x.name=='x');}catch(e){}
var escapeQuotes=function(html){return(''+html).replace(/&/g,'&amp;').replace(/"/g,'&quot;');};Document.implement({newElement:function(tag,props){if(props&&props.checked!=null)props.defaultChecked=props.checked;if(createElementAcceptsHTML&&props){tag='<'+tag;if(props.name)tag+=' name="'+escapeQuotes(props.name)+'"';if(props.type)tag+=' type="'+escapeQuotes(props.type)+'"';tag+='>';delete props.name;delete props.type;}
return this.id(this.createElement(tag)).set(props);},newTextNode:function(text){return this.createTextNode(text);},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var types={string:function(id,nocash,doc){id=doc.getElementById(id);return(id)?types.element(id,nocash):null;},element:function(el,nocash){$uid(el);if(!nocash&&!el.$family&&!(/^object|embed$/i).test(el.tagName)){var proto=Element.Prototype;for(var p in proto)el[p]=proto[p];};return el;},object:function(obj,nocash,doc){if(obj.toElement)return types.element(obj.toElement(doc),nocash);return null;}};types.textnode=types.whitespace=types.window=types.document=$arguments(0);return function(el,nocash,doc){if(el&&el.$family&&el.uid)return el;var type=$type(el);return(types[type])?types[type](el,nocash,doc||document):null;};})()});})();if(window.$==null)Window.implement({$:function(el,nc){return document.id(el,nc,this.document);}});Window.implement({$$:function(selector){if(arguments.length==1&&typeof selector=='string')return this.document.getElements(selector);var elements=[];var args=Array.flatten(arguments);for(var i=0,l=args.length;i<l;i++){var item=args[i];switch($type(item)){case'element':elements.push(item);break;case'string':elements.extend(this.document.getElements(item,true));}}
return new Elements(elements);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(selector,nocash){return document.id(this.getElements(selector,true)[0]||null,nocash);},getElements:function(tags,nocash){tags=tags.split(',');var elements=[];var ddup=(tags.length>1);tags.each(function(tag){var partial=this.getElementsByTagName(tag.trim());(ddup)?elements.extend(partial):elements=partial;},this);return new Elements(elements,{ddup:ddup,cash:!nocash});}});(function(){var collected={},storage={};var props={input:'checked',option:'selected',textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?'innerHTML':'value'};var get=function(uid){return(storage[uid]||(storage[uid]={}));};var clean=function(item,retain){if(!item)return;var uid=item.uid;if(retain!==true)retain=false;if(Browser.Engine.trident){if(item.clearAttributes){var clone=retain&&item.cloneNode(false);item.clearAttributes();if(clone)item.mergeAttributes(clone);}else if(item.removeEvents){item.removeEvents();}
if((/object/i).test(item.tagName)){for(var p in item){if(typeof item[p]=='function')item[p]=$empty;}
Element.dispose(item);}}
if(!uid)return;collected[uid]=storage[uid]=null;};var purge=function(){Hash.each(collected,clean);if(Browser.Engine.trident)$A(document.getElementsByTagName('object')).each(clean);if(window.CollectGarbage)CollectGarbage();collected=storage=null;};var walk=function(element,walk,start,match,all,nocash){var el=element[start||walk];var elements=[];while(el){if(el.nodeType==1&&(!match||Element.match(el,match))){if(!all)return document.id(el,nocash);elements.push(el);}
el=el[walk];}
return(all)?new Elements(elements,{ddup:false,cash:!nocash}):null;};var attributes={'html':'innerHTML','class':'className','for':'htmlFor','defaultValue':'defaultValue','text':(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?'innerText':'textContent'};var bools=['compact','nowrap','ismap','declare','noshade','checked','disabled','readonly','multiple','selected','noresize','defer'];var camels=['value','type','defaultValue','accessKey','cellPadding','cellSpacing','colSpan','frameBorder','maxLength','readOnly','rowSpan','tabIndex','useMap'];bools=bools.associate(bools);Hash.extend(attributes,bools);Hash.extend(attributes,camels.associate(camels.map(String.toLowerCase)));var inserters={before:function(context,element){if(element.parentNode)element.parentNode.insertBefore(context,element);},after:function(context,element){if(!element.parentNode)return;var next=element.nextSibling;(next)?element.parentNode.insertBefore(context,next):element.parentNode.appendChild(context);},bottom:function(context,element){element.appendChild(context);},top:function(context,element){var first=element.firstChild;(first)?element.insertBefore(context,first):element.appendChild(context);}};inserters.inside=inserters.bottom;Hash.each(inserters,function(inserter,where){where=where.capitalize();Element.implement('inject'+where,function(el){inserter(this,document.id(el,true));return this;});Element.implement('grab'+where,function(el){inserter(document.id(el,true),this);return this;});});Element.implement({set:function(prop,value){switch($type(prop)){case'object':for(var p in prop)this.set(p,prop[p]);break;case'string':var property=Element.Properties.get(prop);(property&&property.set)?property.set.apply(this,Array.slice(arguments,1)):this.setProperty(prop,value);}
return this;},get:function(prop){var property=Element.Properties.get(prop);return(property&&property.get)?property.get.apply(this,Array.slice(arguments,1)):this.getProperty(prop);},erase:function(prop){var property=Element.Properties.get(prop);(property&&property.erase)?property.erase.apply(this):this.removeProperty(prop);return this;},setProperty:function(attribute,value){var key=attributes[attribute];if(value==undefined)return this.removeProperty(attribute);if(key&&bools[attribute])value=!!value;(key)?this[key]=value:this.setAttribute(attribute,''+value);return this;},setProperties:function(attributes){for(var attribute in attributes)this.setProperty(attribute,attributes[attribute]);return this;},getProperty:function(attribute){var key=attributes[attribute];var value=(key)?this[key]:this.getAttribute(attribute,2);return(bools[attribute])?!!value:(key)?value:value||null;},getProperties:function(){var args=$A(arguments);return args.map(this.getProperty,this).associate(args);},removeProperty:function(attribute){var key=attributes[attribute];(key)?this[key]=(key&&bools[attribute])?false:'':this.removeAttribute(attribute);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},hasClass:function(className){return this.className.contains(className,' ');},addClass:function(className){if(!this.hasClass(className))this.className=(this.className+' '+className).clean();return this;},removeClass:function(className){this.className=this.className.replace(new RegExp('(^|\\s)'+className+'(?:\\s|$)'),'$1');return this;},toggleClass:function(className){return this.hasClass(className)?this.removeClass(className):this.addClass(className);},adopt:function(){Array.flatten(arguments).each(function(element){element=document.id(element,true);if(element)this.appendChild(element);},this);return this;},appendText:function(text,where){return this.grab(this.getDocument().newTextNode(text),where);},grab:function(el,where){inserters[where||'bottom'](document.id(el,true),this);return this;},inject:function(el,where){inserters[where||'bottom'](this,document.id(el,true));return this;},replaces:function(el){el=document.id(el,true);el.parentNode.replaceChild(this,el);return this;},wraps:function(el,where){el=document.id(el,true);return this.replaces(el).grab(el,where);},getPrevious:function(match,nocash){return walk(this,'previousSibling',null,match,false,nocash);},getAllPrevious:function(match,nocash){return walk(this,'previousSibling',null,match,true,nocash);},getNext:function(match,nocash){return walk(this,'nextSibling',null,match,false,nocash);},getAllNext:function(match,nocash){return walk(this,'nextSibling',null,match,true,nocash);},getFirst:function(match,nocash){return walk(this,'nextSibling','firstChild',match,false,nocash);},getLast:function(match,nocash){return walk(this,'previousSibling','lastChild',match,false,nocash);},getParent:function(match,nocash){return walk(this,'parentNode',null,match,false,nocash);},getParents:function(match,nocash){return walk(this,'parentNode',null,match,true,nocash);},getSiblings:function(match,nocash){return this.getParent().getChildren(match,nocash).erase(this);},getChildren:function(match,nocash){return walk(this,'nextSibling','firstChild',match,true,nocash);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(id,nocash){var el=this.ownerDocument.getElementById(id);if(!el)return null;for(var parent=el.parentNode;parent!=this;parent=parent.parentNode){if(!parent)return null;}
return document.id(el,nocash);},getSelected:function(){return new Elements($A(this.options).filter(function(option){return option.selected;}));},getComputedStyle:function(property){if(this.currentStyle)return this.currentStyle[property.camelCase()];var computed=this.getDocument().defaultView.getComputedStyle(this,null);return(computed)?computed.getPropertyValue([property.hyphenate()]):null;},toQueryString:function(){var queryString=[];this.getElements('input, select, textarea',true).each(function(el){if(!el.name||el.disabled||el.type=='submit'||el.type=='reset'||el.type=='file')return;var value=(el.tagName.toLowerCase()=='select')?Element.getSelected(el).map(function(opt){return opt.value;}):((el.type=='radio'||el.type=='checkbox')&&!el.checked)?null:el.value;$splat(value).each(function(val){if(typeof val!='undefined')queryString.push(el.name+'='+encodeURIComponent(val));});});return queryString.join('&');},clone:function(contents,keepid){contents=contents!==false;var clone=this.cloneNode(contents);var clean=function(node,element){if(!keepid)node.removeAttribute('id');if(Browser.Engine.trident){node.clearAttributes();node.mergeAttributes(element);node.removeAttribute('uid');if(node.options){var no=node.options,eo=element.options;for(var j=no.length;j--;)no[j].selected=eo[j].selected;}}
var prop=props[element.tagName.toLowerCase()];if(prop&&element[prop])node[prop]=element[prop];};if(contents){var ce=clone.getElementsByTagName('*'),te=this.getElementsByTagName('*');for(var i=ce.length;i--;)clean(ce[i],te[i]);}
clean(clone,this);return document.id(clone);},destroy:function(){Element.empty(this);Element.dispose(this);clean(this,true);return null;},empty:function(){$A(this.childNodes).each(function(node){Element.destroy(node);});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(el){el=document.id(el,true);if(!el)return false;if(Browser.Engine.webkit&&Browser.Engine.version<420)return $A(this.getElementsByTagName(el.tagName)).contains(el);return(this.contains)?(this!=el&&this.contains(el)):!!(this.compareDocumentPosition(el)&16);},match:function(tag){return(!tag||(tag==this)||(Element.get(this,'tag')==tag));}});Native.implement([Element,Window,Document],{addListener:function(type,fn){if(type=='unload'){var old=fn,self=this;fn=function(){self.removeListener('unload',fn);old();};}else{collected[this.uid]=this;}
if(this.addEventListener)this.addEventListener(type,fn,false);else this.attachEvent('on'+type,fn);return this;},removeListener:function(type,fn){if(this.removeEventListener)this.removeEventListener(type,fn,false);else this.detachEvent('on'+type,fn);return this;},retrieve:function(property,dflt){var storage=get(this.uid),prop=storage[property];if(dflt!=undefined&&prop==undefined)prop=storage[property]=dflt;return $pick(prop);},store:function(property,value){var storage=get(this.uid);storage[property]=value;return this;},eliminate:function(property){var storage=get(this.uid);delete storage[property];return this;}});window.addListener('unload',purge);})();Element.Properties=new Hash;Element.Properties.style={set:function(style){this.style.cssText=style;},get:function(){return this.style.cssText;},erase:function(){this.style.cssText='';}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};Element.Properties.html=(function(){var wrapper=document.createElement('div');var translations={table:[1,'<table>','</table>'],select:[1,'<select>','</select>'],tbody:[2,'<table><tbody>','</tbody></table>'],tr:[3,'<table><tbody><tr>','</tr></tbody></table>']};translations.thead=translations.tfoot=translations.tbody;var html={set:function(){var html=Array.flatten(arguments).join('');var wrap=Browser.Engine.trident&&translations[this.get('tag')];if(wrap){var first=wrapper;first.innerHTML=wrap[1]+html+wrap[2];for(var i=wrap[0];i--;)first=first.firstChild;this.empty().adopt(first.childNodes);}else{this.innerHTML=html;}}};html.erase=html.set;return html;})();if(Browser.Engine.webkit&&Browser.Engine.version<420)Element.Properties.text={get:function(){if(this.innerText)return this.innerText;var temp=this.ownerDocument.newElement('div',{html:this.innerHTML}).inject(this.ownerDocument.body);var text=temp.innerText;temp.destroy();return text;}};Element.Properties.events={set:function(events){this.addEvents(events);}};Native.implement([Element,Window,Document],{addEvent:function(type,fn){var events=this.retrieve('events',{});events[type]=events[type]||{'keys':[],'values':[]};if(events[type].keys.contains(fn))return this;events[type].keys.push(fn);var realType=type,custom=Element.Events.get(type),condition=fn,self=this;if(custom){if(custom.onAdd)custom.onAdd.call(this,fn);if(custom.condition){condition=function(event){if(custom.condition.call(this,event))return fn.call(this,event);return true;};}
realType=custom.base||realType;}
var defn=function(){return fn.call(self);};var nativeEvent=Element.NativeEvents[realType];if(nativeEvent){if(nativeEvent==2){defn=function(event){event=new Event(event,self.getWindow());if(condition.call(self,event)===false)event.stop();};}
this.addListener(realType,defn);}
events[type].values.push(defn);return this;},removeEvent:function(type,fn){var events=this.retrieve('events');if(!events||!events[type])return this;var pos=events[type].keys.indexOf(fn);if(pos==-1)return this;events[type].keys.splice(pos,1);var value=events[type].values.splice(pos,1)[0];var custom=Element.Events.get(type);if(custom){if(custom.onRemove)custom.onRemove.call(this,fn);type=custom.base||type;}
return(Element.NativeEvents[type])?this.removeListener(type,value):this;},addEvents:function(events){for(var event in events)this.addEvent(event,events[event]);return this;},removeEvents:function(events){var type;if($type(events)=='object'){for(type in events)this.removeEvent(type,events[type]);return this;}
var attached=this.retrieve('events');if(!attached)return this;if(!events){for(type in attached)this.removeEvents(type);this.eliminate('events');}else if(attached[events]){while(attached[events].keys[0])this.removeEvent(events,attached[events].keys[0]);attached[events]=null;}
return this;},fireEvent:function(type,args,delay){var events=this.retrieve('events');if(!events||!events[type])return this;events[type].keys.each(function(fn){fn.create({'bind':this,'delay':delay,'arguments':args})();},this);return this;},cloneEvents:function(from,type){from=document.id(from);var fevents=from.retrieve('events');if(!fevents)return this;if(!type){for(var evType in fevents)this.cloneEvents(from,evType);}else if(fevents[type]){fevents[type].keys.each(function(fn){this.addEvent(type,fn);},this);}
return this;}});try{if(typeof HTMLElement!='undefined')
HTMLElement.prototype.fireEvent=Element.prototype.fireEvent;}catch(e){}
Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var $check=function(event){var related=event.relatedTarget;if(related==undefined)return true;if(related===false)return false;return($type(this)!='document'&&related!=this&&related.prefix!='xul'&&!this.hasChild(related));};Element.Events=new Hash({mouseenter:{base:'mouseover',condition:$check},mouseleave:{base:'mouseout',condition:$check},mousewheel:{base:(Browser.Engine.gecko)?'DOMMouseScroll':'mousewheel'}});})();Element.Properties.styles={set:function(styles){this.setStyles(styles);}};Element.Properties.opacity={set:function(opacity,novisibility){if(!novisibility){if(opacity==0){if(this.style.visibility!='hidden')this.style.visibility='hidden';}else{if(this.style.visibility!='visible')this.style.visibility='visible';}}
if(!this.currentStyle||!this.currentStyle.hasLayout)this.style.zoom=1;if(Browser.Engine.trident)this.style.filter=(opacity==1)?'':'alpha(opacity='+opacity*100+')';this.style.opacity=opacity;this.store('opacity',opacity);},get:function(){return this.retrieve('opacity',1);}};Element.implement({setOpacity:function(value){return this.set('opacity',value,true);},getOpacity:function(){return this.get('opacity');},setStyle:function(property,value){switch(property){case'opacity':return this.set('opacity',parseFloat(value));case'float':property=(Browser.Engine.trident)?'styleFloat':'cssFloat';}
property=property.camelCase();if($type(value)!='string'){var map=(Element.Styles.get(property)||'@').split(' ');value=$splat(value).map(function(val,i){if(!map[i])return'';return($type(val)=='number')?map[i].replace('@',Math.round(val)):val;}).join(' ');}else if(value==String(Number(value))){value=Math.round(value);}
this.style[property]=value;return this;},getStyle:function(property){switch(property){case'opacity':return this.get('opacity');case'float':property=(Browser.Engine.trident)?'styleFloat':'cssFloat';}
property=property.camelCase();var result=this.style[property];if(!$chk(result)){result=[];for(var style in Element.ShortStyles){if(property!=style)continue;for(var s in Element.ShortStyles[style])result.push(this.getStyle(s));return result.join(' ');}
result=this.getComputedStyle(property);}
if(result){result=String(result);var color=result.match(/rgba?\([\d\s,]+\)/);if(color)result=result.replace(color[0],color[0].rgbToHex());}
if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(result,10)))){if(property.test(/^(height|width)$/)){var values=(property=='width')?['left','right']:['top','bottom'],size=0;values.each(function(value){size+=this.getStyle('border-'+value+'-width').toInt()+this.getStyle('padding-'+value).toInt();},this);return this['offset'+property.capitalize()]-size+'px';}
if((Browser.Engine.presto)&&String(result).test('px'))return result;if(property.test(/(border(.+)Width|margin|padding)/))return'0px';}
return result;},setStyles:function(styles){for(var style in styles)this.setStyle(style,styles[style]);return this;},getStyles:function(){var result={};Array.flatten(arguments).each(function(key){result[key]=this.getStyle(key);},this);return result;}});Element.Styles=new Hash({left:'@px',top:'@px',bottom:'@px',right:'@px',width:'@px',height:'@px',maxWidth:'@px',maxHeight:'@px',minWidth:'@px',minHeight:'@px',backgroundColor:'rgb(@, @, @)',backgroundPosition:'@px @px',color:'rgb(@, @, @)',fontSize:'@px',letterSpacing:'@px',lineHeight:'@px',clip:'rect(@px @px @px @px)',margin:'@px @px @px @px',padding:'@px @px @px @px',border:'@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)',borderWidth:'@px @px @px @px',borderStyle:'@ @ @ @',borderColor:'rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)',zIndex:'@','zoom':'@',fontWeight:'@',textIndent:'@px',opacity:'@'});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};['Top','Right','Bottom','Left'].each(function(direction){var Short=Element.ShortStyles;var All=Element.Styles;['margin','padding'].each(function(style){var sd=style+direction;Short[style][sd]=All[sd]='@px';});var bd='border'+direction;Short.border[bd]=All[bd]='@px @ rgb(@, @, @)';var bdw=bd+'Width',bds=bd+'Style',bdc=bd+'Color';Short[bd]={};Short.borderWidth[bdw]=Short[bd][bdw]=All[bdw]='@px';Short.borderStyle[bds]=Short[bd][bds]=All[bds]='@';Short.borderColor[bdc]=Short[bd][bdc]=All[bdc]='rgb(@, @, @)';});(function(){Element.implement({scrollTo:function(x,y){if(isBody(this)){this.getWindow().scrollTo(x,y);}else{this.scrollLeft=x;this.scrollTop=y;}
return this;},getSize:function(){if(isBody(this))return this.getWindow().getSize();return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(isBody(this))return this.getWindow().getScrollSize();return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(isBody(this))return this.getWindow().getScroll();return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var element=this,position={x:0,y:0};while(element&&!isBody(element)){position.x+=element.scrollLeft;position.y+=element.scrollTop;element=element.parentNode;}
return position;},getOffsetParent:function(){var element=this;if(isBody(element))return null;if(!Browser.Engine.trident)return element.offsetParent;while((element=element.parentNode)&&!isBody(element)){if(styleString(element,'position')!='static')return element;}
return null;},getOffsets:function(){if(this.getBoundingClientRect){var bound=this.getBoundingClientRect(),html=document.id(this.getDocument().documentElement),htmlScroll=html.getScroll(),elemScrolls=this.getScrolls(),elemScroll=this.getScroll(),isFixed=(styleString(this,'position')=='fixed');return{x:bound.left.toInt()+elemScrolls.x-elemScroll.x+((isFixed)?0:htmlScroll.x)-html.clientLeft,y:bound.top.toInt()+elemScrolls.y-elemScroll.y+((isFixed)?0:htmlScroll.y)-html.clientTop};}
var element=this,position={x:0,y:0};if(isBody(this))return position;while(element&&!isBody(element)){position.x+=element.offsetLeft;position.y+=element.offsetTop;if(Browser.Engine.gecko){if(!borderBox(element)){position.x+=leftBorder(element);position.y+=topBorder(element);}
var parent=element.parentNode;if(parent&&styleString(parent,'overflow')!='visible'){position.x+=leftBorder(parent);position.y+=topBorder(parent);}}else if(element!=this&&Browser.Engine.webkit){position.x+=leftBorder(element);position.y+=topBorder(element);}
element=element.offsetParent;}
if(Browser.Engine.gecko&&!borderBox(this)){position.x-=leftBorder(this);position.y-=topBorder(this);}
return position;},getPosition:function(relative){if(isBody(this))return{x:0,y:0};var offset=this.getOffsets(),scroll=this.getScrolls();var position={x:offset.x-scroll.x,y:offset.y-scroll.y};var relativePosition=(relative&&(relative=document.id(relative)))?relative.getPosition():{x:0,y:0};return{x:position.x-relativePosition.x,y:position.y-relativePosition.y};},getCoordinates:function(element){if(isBody(this))return this.getWindow().getCoordinates();var position=this.getPosition(element),size=this.getSize();var obj={left:position.x,top:position.y,width:size.x,height:size.y};obj.right=obj.left+obj.width;obj.bottom=obj.top+obj.height;return obj;},computePosition:function(obj){return{left:obj.x-styleNumber(this,'margin-left'),top:obj.y-styleNumber(this,'margin-top')};},setPosition:function(obj){return this.setStyles(this.computePosition(obj));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var win=this.getWindow();return{x:win.innerWidth,y:win.innerHeight};}
var doc=getCompatElement(this);return{x:doc.clientWidth,y:doc.clientHeight};},getScroll:function(){var win=this.getWindow(),doc=getCompatElement(this);return{x:win.pageXOffset||doc.scrollLeft,y:win.pageYOffset||doc.scrollTop};},getScrollSize:function(){var doc=getCompatElement(this),min=this.getSize();return{x:Math.max(doc.scrollWidth,min.x),y:Math.max(doc.scrollHeight,min.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var size=this.getSize();return{top:0,left:0,bottom:size.y,right:size.x,height:size.y,width:size.x};}});var styleString=Element.getComputedStyle;function styleNumber(element,style){return styleString(element,style).toInt()||0;};function borderBox(element){return styleString(element,'-moz-box-sizing')=='border-box';};function topBorder(element){return styleNumber(element,'border-top-width');};function leftBorder(element){return styleNumber(element,'border-left-width');};function isBody(element){return(/^(?:body|html)$/i).test(element.tagName);};function getCompatElement(element){var doc=element.getDocument();return(!doc.compatMode||doc.compatMode=='CSS1Compat')?doc.html:doc.body;};})();Element.alias('setPosition','position');Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});Native.implement([Document,Element],{getElements:function(expression,nocash){expression=expression.split(',');var items,local={};for(var i=0,l=expression.length;i<l;i++){var selector=expression[i],elements=Selectors.Utils.search(this,selector,local);if(i!=0&&elements.item)elements=$A(elements);items=(i==0)?elements:(items.item)?$A(items).concat(elements):items.concat(elements);}
return new Elements(items,{ddup:(expression.length>1),cash:!nocash});}});Element.implement({match:function(selector){if(!selector||(selector==this))return true;var tagid=Selectors.Utils.parseTagAndID(selector);var tag=tagid[0],id=tagid[1];if(!Selectors.Filters.byID(this,id)||!Selectors.Filters.byTag(this,tag))return false;var parsed=Selectors.Utils.parseSelector(selector);return(parsed)?Selectors.Utils.filter(this,parsed,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(item,uniques){if(!uniques)return true;var uid=$uid(item);if(!uniques[uid])return uniques[uid]=true;return false;},parseNthArgument:function(argument){if(Selectors.Cache.nth[argument])return Selectors.Cache.nth[argument];var parsed=argument.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!parsed)return false;var inta=parseInt(parsed[1],10);var a=(inta||inta===0)?inta:1;var special=parsed[2]||false;var b=parseInt(parsed[3],10)||0;if(a!=0){b--;while(b<1)b+=a;while(b>=a)b-=a;}else{a=b;special='index';}
switch(special){case'n':parsed={a:a,b:b,special:'n'};break;case'odd':parsed={a:2,b:0,special:'n'};break;case'even':parsed={a:2,b:1,special:'n'};break;case'first':parsed={a:0,special:'index'};break;case'last':parsed={special:'last-child'};break;case'only':parsed={special:'only-child'};break;default:parsed={a:(a-1),special:'index'};}
return Selectors.Cache.nth[argument]=parsed;},parseSelector:function(selector){if(Selectors.Cache.parsed[selector])return Selectors.Cache.parsed[selector];var m,parsed={classes:[],pseudos:[],attributes:[]};while((m=Selectors.RegExps.combined.exec(selector))){var cn=m[1],an=m[2],ao=m[3],av=m[5],pn=m[6],pa=m[7];if(cn){parsed.classes.push(cn);}else if(pn){var parser=Selectors.Pseudo.get(pn);if(parser)parsed.pseudos.push({parser:parser,argument:pa});else parsed.attributes.push({name:pn,operator:'=',value:pa});}else if(an){parsed.attributes.push({name:an,operator:ao,value:av});}}
if(!parsed.classes.length)delete parsed.classes;if(!parsed.attributes.length)delete parsed.attributes;if(!parsed.pseudos.length)delete parsed.pseudos;if(!parsed.classes&&!parsed.attributes&&!parsed.pseudos)parsed=null;return Selectors.Cache.parsed[selector]=parsed;},parseTagAndID:function(selector){var tag=selector.match(Selectors.RegExps.tag);var id=selector.match(Selectors.RegExps.id);return[(tag)?tag[1]:'*',(id)?id[1]:false];},filter:function(item,parsed,local){var i;if(parsed.classes){for(i=parsed.classes.length;i--;i){var cn=parsed.classes[i];if(!Selectors.Filters.byClass(item,cn))return false;}}
if(parsed.attributes){for(i=parsed.attributes.length;i--;i){var att=parsed.attributes[i];if(!Selectors.Filters.byAttribute(item,att.name,att.operator,att.value))return false;}}
if(parsed.pseudos){for(i=parsed.pseudos.length;i--;i){var psd=parsed.pseudos[i];if(!Selectors.Filters.byPseudo(item,psd.parser,psd.argument,local))return false;}}
return true;},getByTagAndID:function(ctx,tag,id){if(id){var item=(ctx.getElementById)?ctx.getElementById(id,true):Element.getElementById(ctx,id,true);return(item&&Selectors.Filters.byTag(item,tag))?[item]:[];}else{return ctx.getElementsByTagName(tag);}},search:function(self,expression,local){var splitters=[];var selectors=expression.trim().replace(Selectors.RegExps.splitter,function(m0,m1,m2){splitters.push(m1);return':)'+m2;}).split(':)');var items,filtered,item;for(var i=0,l=selectors.length;i<l;i++){var selector=selectors[i];if(i==0&&Selectors.RegExps.quick.test(selector)){items=self.getElementsByTagName(selector);continue;}
var splitter=splitters[i-1];var tagid=Selectors.Utils.parseTagAndID(selector);var tag=tagid[0],id=tagid[1];if(i==0){items=Selectors.Utils.getByTagAndID(self,tag,id);}else{var uniques={},found=[];for(var j=0,k=items.length;j<k;j++)found=Selectors.Getters[splitter](found,items[j],tag,id,uniques);items=found;}
var parsed=Selectors.Utils.parseSelector(selector);if(parsed){filtered=[];for(var m=0,n=items.length;m<n;m++){item=items[m];if(Selectors.Utils.filter(item,parsed,local))filtered.push(item);}
items=filtered;}}
return items;}};Selectors.Getters={' ':function(found,self,tag,id,uniques){var items=Selectors.Utils.getByTagAndID(self,tag,id);for(var i=0,l=items.length;i<l;i++){var item=items[i];if(Selectors.Utils.chk(item,uniques))found.push(item);}
return found;},'>':function(found,self,tag,id,uniques){var children=Selectors.Utils.getByTagAndID(self,tag,id);for(var i=0,l=children.length;i<l;i++){var child=children[i];if(child.parentNode==self&&Selectors.Utils.chk(child,uniques))found.push(child);}
return found;},'+':function(found,self,tag,id,uniques){while((self=self.nextSibling)){if(self.nodeType==1){if(Selectors.Utils.chk(self,uniques)&&Selectors.Filters.byTag(self,tag)&&Selectors.Filters.byID(self,id))found.push(self);break;}}
return found;},'~':function(found,self,tag,id,uniques){while((self=self.nextSibling)){if(self.nodeType==1){if(!Selectors.Utils.chk(self,uniques))break;if(Selectors.Filters.byTag(self,tag)&&Selectors.Filters.byID(self,id))found.push(self);}}
return found;}};Selectors.Filters={byTag:function(self,tag){return(tag=='*'||(self.tagName&&self.tagName.toLowerCase()==tag));},byID:function(self,id){return(!id||(self.id&&self.id==id));},byClass:function(self,klass){return(self.className&&self.className.contains&&self.className.contains(klass,' '));},byPseudo:function(self,parser,argument,local){return parser.call(self,argument,local);},byAttribute:function(self,name,operator,value){var result=Element.prototype.getProperty.call(self,name);if(!result)return(operator=='!=');if(!operator||value==undefined)return true;switch(operator){case'=':return(result==value);case'*=':return(result.contains(value));case'^=':return(result.substr(0,value.length)==value);case'$=':return(result.substr(result.length-value.length)==value);case'!=':return(result!=value);case'~=':return result.contains(value,' ');case'|=':return result.contains(value,'-');}
return false;}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return!(this.innerText||this.textContent||'').length;},not:function(selector){return!Element.match(this,selector);},contains:function(text){return(this.innerText||this.textContent||'').contains(text);},'first-child':function(){return Selectors.Pseudo.index.call(this,0);},'last-child':function(){var element=this;while((element=element.nextSibling)){if(element.nodeType==1)return false;}
return true;},'only-child':function(){var prev=this;while((prev=prev.previousSibling)){if(prev.nodeType==1)return false;}
var next=this;while((next=next.nextSibling)){if(next.nodeType==1)return false;}
return true;},'nth-child':function(argument,local){argument=(argument==undefined)?'n':argument;var parsed=Selectors.Utils.parseNthArgument(argument);if(parsed.special!='n')return Selectors.Pseudo[parsed.special].call(this,parsed.a,local);var count=0;local.positions=local.positions||{};var uid=$uid(this);if(!local.positions[uid]){var self=this;while((self=self.previousSibling)){if(self.nodeType!=1)continue;count++;var position=local.positions[$uid(self)];if(position!=undefined){count=position+count;break;}}
local.positions[uid]=count;}
return(local.positions[uid]%parsed.a==parsed.b);},index:function(index){var element=this,count=0;while((element=element.previousSibling)){if(element.nodeType==1&&++count>index)return false;}
return(count==index);},even:function(argument,local){return Selectors.Pseudo['nth-child'].call(this,'2n+1',local);},odd:function(argument,local){return Selectors.Pseudo['nth-child'].call(this,'2n',local);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false);}});Element.Events.domready={onAdd:function(fn){if(Browser.loaded)fn.call(this);}};(function(){var domready=function(){if(Browser.loaded)return;Browser.loaded=true;window.fireEvent('domready');document.fireEvent('domready');};window.addEvent('load',domready);if(Browser.Engine.trident){var temp=document.createElement('div');(function(){($try(function(){temp.doScroll();return document.id(temp).inject(document.body).set('html','temp').dispose();}))?domready():arguments.callee.delay(50);})();}else if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(['loaded','complete'].contains(document.readyState))?domready():arguments.callee.delay(50);})();}else{document.addEvent('DOMContentLoaded',domready);}})();var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},$replaceChars:function(chr){return JSON.$specialChars[chr]||'\\u00'+Math.floor(chr.charCodeAt()/16).toString(16)+(chr.charCodeAt()%16).toString(16);},encode:function(obj){switch($type(obj)){case'string':return'"'+obj.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case'array':return'['+String(obj.map(JSON.encode).clean())+']';case'object':case'hash':var string=[];Hash.each(obj,function(value,key){var json=JSON.encode(value);if(json)string.push(JSON.encode(key)+':'+json);});return'{'+string+'}';case'number':case'boolean':return String(obj);case false:return'null';}
return null;},decode:function(string,secure){if($type(string)!='string'||!string.length)return null;if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'')))return null;return eval('('+string+')');}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(key,options){this.key=key;this.setOptions(options);},write:function(value){value=encodeURIComponent(value);if(this.options.domain)value+='; domain='+this.options.domain;if(this.options.path)value+='; path='+this.options.path;if(this.options.duration){var date=new Date();date.setTime(date.getTime()+this.options.duration*24*60*60*1000);value+='; expires='+date.toGMTString();}
if(this.options.secure)value+='; secure';this.options.document.cookie=this.key+'='+value;return this;},read:function(){var value=this.options.document.cookie.match('(?:^|;)\\s*'+this.key.escapeRegExp()+'=([^;]*)');return(value)?decodeURIComponent(value[1]):null;},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write('');return this;}});Cookie.write=function(key,value,options){return new Cookie(key,options).write(value);};Cookie.read=function(key){return new Cookie(key).read();};Cookie.dispose=function(key,options){return new Cookie(key,options).dispose();};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:'high',allowScriptAccess:'always',wMode:'transparent',swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;},initialize:function(path,options){this.instance='Swiff_'+$time();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance;var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks;var properties=$extend({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments);};})(callBacks[callBack]);vars[callBack]='Swiff.CallBacks.'+this.instance+'.'+callBack;}
params.flashVars=Hash.toQueryString(vars);if(Browser.Engine.trident){properties.classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';params.movie=path;}else{properties.type='application/x-shockwave-flash';properties.data=path;}
var build='<object id="'+id+'"';for(var property in properties)build+=' '+property+'="'+properties[property]+'"';build+='>';for(var param in params){if(params[param])build+='<param name="'+param+'" value="'+params[param]+'" />';}
build+='</object>';this.object=((container)?container.empty():new Element('div')).set('html',build).firstChild;},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement());return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+'</invoke>');return eval(rs);};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:'ignore'},initialize:function(options){this.subject=this.subject||this;this.setOptions(options);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var wait=this.options.wait;if(wait===false)this.options.link='cancel';},getTransition:function(){return function(p){return-(Math.cos(Math.PI*p)-1)/2;};},step:function(){var time=$time();if(time<this.time+this.options.duration){var delta=this.transition((time-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,delta));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(now){return now;},compute:function(from,to,delta){return Fx.compute(from,to,delta);},check:function(){if(!this.timer)return true;switch(this.options.link){case'cancel':this.cancel();return true;case'chain':this.chain(this.caller.bind(this,arguments));return false;}
return false;},start:function(from,to){if(!this.check(from,to))return this;this.from=from;this.to=to;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer())this.onComplete();return this;},cancel:function(){if(this.stopTimer())this.onCancel();return this;},onStart:function(){this.fireEvent('start',this.subject);},onComplete:function(){this.fireEvent('complete',this.subject);if(!this.callChain())this.fireEvent('chainComplete',this.subject);},onCancel:function(){this.fireEvent('cancel',this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer();return this;},stopTimer:function(){if(!this.timer)return false;this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer)return false;this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(from,to,delta){return(to-from)*delta+from;};Fx.Durations={'short':250,'normal':500,'long':1000};Fx.CSS=new Class({Extends:Fx,prepare:function(element,property,values){values=$splat(values);var values1=values[1];if(!$chk(values1)){values[1]=values[0];values[0]=element.getStyle(property);}
var parsed=values.map(this.parse);return{from:parsed[0],to:parsed[1]};},parse:function(value){value=$lambda(value)();value=(typeof value=='string')?value.split(' '):$splat(value);return value.map(function(val){val=String(val);var found=false;Fx.CSS.Parsers.each(function(parser,key){if(found)return;var parsed=parser.parse(val);if($chk(parsed))found={value:parsed,parser:parser};});found=found||{value:val,parser:Fx.CSS.Parsers.String};return found;});},compute:function(from,to,delta){var computed=[];(Math.min(from.length,to.length)).times(function(i){computed.push({value:from[i].parser.compute(from[i].value,to[i].value,delta),parser:from[i].parser});});computed.$family={name:'fx:css:value'};return computed;},serve:function(value,unit){if($type(value)!='fx:css:value')value=this.parse(value);var returned=[];value.each(function(bit){returned=returned.concat(bit.parser.serve(bit.value,unit));});return returned;},render:function(element,property,value,unit){element.setStyle(property,this.serve(value,unit));},search:function(selector){if(Fx.CSS.Cache[selector])return Fx.CSS.Cache[selector];var to={};Array.each(document.styleSheets,function(sheet,j){var href=sheet.href;if(href&&href.contains('://')&&!href.contains(document.domain))return;var rules=sheet.rules||sheet.cssRules;Array.each(rules,function(rule,i){if(!rule.style)return;var selectorText=(rule.selectorText)?rule.selectorText.replace(/^\w+/,function(m){return m.toLowerCase();}):null;if(!selectorText||!selectorText.test('^'+selector+'$'))return;Element.Styles.each(function(value,style){if(!rule.style[style]||Element.ShortStyles[style])return;value=String(rule.style[style]);to[style]=(value.test(/^rgb/))?value.rgbToHex():value;});});});return Fx.CSS.Cache[selector]=to;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(value){if(value.match(/^#[0-9a-f]{3,6}$/i))return value.hexToRgb(true);return((value=value.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[value[1],value[2],value[3]]:false;},compute:function(from,to,delta){return from.map(function(value,i){return Math.round(Fx.compute(from[i],to[i],delta));});},serve:function(value){return value.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(value,unit){return(unit)?value+unit:value;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);},set:function(property,now){if(arguments.length==1){now=property;property=this.property||this.options.property;}
this.render(this.element,property,now,this.options.unit);return this;},start:function(property,from,to){if(!this.check(property,from,to))return this;var args=Array.flatten(arguments);this.property=this.options.property||args.shift();var parsed=this.prepare(this.element,this.property,args);return this.parent(parsed.from,parsed.to);}});Element.Properties.tween={set:function(options){var tween=this.retrieve('tween');if(tween)tween.cancel();return this.eliminate('tween').store('tween:options',$extend({link:'cancel'},options));},get:function(options){if(options||!this.retrieve('tween')){if(options||!this.retrieve('tween:options'))this.set('tween',options);this.store('tween',new Fx.Tween(this,this.retrieve('tween:options')));}
return this.retrieve('tween');}};Element.implement({tween:function(property,from,to){this.get('tween').start(arguments);return this;},fade:function(how){var fade=this.get('tween'),o='opacity',toggle;how=$pick(how,'toggle');switch(how){case'in':fade.start(o,1);break;case'out':fade.start(o,0);break;case'show':fade.set(o,1);break;case'hide':fade.set(o,0);break;case'toggle':var flag=this.retrieve('fade:flag',this.get('opacity')==1);fade.start(o,(flag)?0:1);this.store('fade:flag',!flag);toggle=true;break;default:fade.start(o,arguments);}
if(!toggle)this.eliminate('fade:flag');return this;},highlight:function(start,end){if(!end){end=this.retrieve('highlight:original',this.getStyle('background-color'));end=(end=='transparent')?'#fff':end;}
var tween=this.get('tween');tween.start('background-color',start||'#ffff88',end).chain(function(){this.setStyle('background-color',this.retrieve('highlight:original'));tween.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);},set:function(now){if(typeof now=='string')now=this.search(now);for(var p in now)this.render(this.element,p,now[p],this.options.unit);return this;},compute:function(from,to,delta){var now={};for(var p in from)now[p]=this.parent(from[p],to[p],delta);return now;},start:function(properties){if(!this.check(properties))return this;if(typeof properties=='string')properties=this.search(properties);var from={},to={};for(var p in properties){var parsed=this.prepare(this.element,p,properties[p]);from[p]=parsed.from;to[p]=parsed.to;}
return this.parent(from,to);}});Element.Properties.morph={set:function(options){var morph=this.retrieve('morph');if(morph)morph.cancel();return this.eliminate('morph').store('morph:options',$extend({link:'cancel'},options));},get:function(options){if(options||!this.retrieve('morph')){if(options||!this.retrieve('morph:options'))this.set('morph',options);this.store('morph',new Fx.Morph(this,this.retrieve('morph:options')));}
return this.retrieve('morph');}};Element.implement({morph:function(props){this.get('morph').start(props);return this;}});Fx.implement({getTransition:function(){var trans=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof trans=='string'){var data=trans.split(':');trans=Fx.Transitions;trans=trans[data[0]]||trans[data[0].capitalize()];if(data[1])trans=trans['ease'+data[1].capitalize()+(data[2]?data[2].capitalize():'')];}
return trans;}});Fx.Transition=function(transition,params){params=$splat(params);return $extend(transition,{easeIn:function(pos){return transition(pos,params);},easeOut:function(pos){return 1-transition(1-pos,params);},easeInOut:function(pos){return(pos<=0.5)?transition(2*pos,params)/2:(2-transition(2*(1-pos),params))/2;}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(transitions){for(var transition in transitions)Fx.Transitions[transition]=new Fx.Transition(transitions[transition]);};Fx.Transitions.extend({Pow:function(p,x){return Math.pow(p,x[0]||6);},Expo:function(p){return Math.pow(2,8*(p-1));},Circ:function(p){return 1-Math.sin(Math.acos(p));},Sine:function(p){return 1-Math.sin((1-p)*Math.PI/2);},Back:function(p,x){x=x[0]||1.618;return Math.pow(p,2)*((x+1)*p-x);},Bounce:function(p){var value;for(var a=0,b=1;1;a+=b,b/=2){if(p>=(7-4*a)/11){value=b*b-Math.pow((11-6*a-11*p)/4,2);break;}}
return value;},Elastic:function(p,x){return Math.pow(2,10*--p)*Math.cos(20*p*Math.PI*(x[0]||1)/3);}});['Quad','Cubic','Quart','Quint'].each(function(transition,i){Fx.Transitions[transition]=new Fx.Transition(function(p){return Math.pow(p,[i+2]);});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:'',data:'',headers:{'X-Requested-With':'XMLHttpRequest','Accept':'text/javascript, text/html, application/xml, text/xml, */*'},async:true,format:false,method:'post',link:'ignore',isSuccess:null,emulation:true,urlEncoded:true,encoding:'utf-8',evalScripts:false,evalResponse:false,noCache:false},initialize:function(options){this.xhr=new Browser.Request();this.setOptions(options);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running)return;this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300));},processScripts:function(text){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader('Content-type')))return $exec(text);return text.stripScripts(this.options.evalScripts);},success:function(text,xml){this.onSuccess(this.processScripts(text),xml);},onSuccess:function(){this.fireEvent('complete',arguments).fireEvent('success',arguments).callChain();},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent('complete').fireEvent('failure',this.xhr);},setHeader:function(name,value){this.headers.set(name,value);return this;},getHeader:function(name){return $try(function(){return this.xhr.getResponseHeader(name);}.bind(this));},check:function(){if(!this.running)return true;switch(this.options.link){case'cancel':this.cancel();return true;case'chain':this.chain(this.caller.bind(this,arguments));return false;}
return false;},send:function(options){if(!this.check(options))return this;this.running=true;var type=$type(options);if(type=='string'||type=='element')options={data:options};var old=this.options;options=$extend({data:old.data,url:old.url,method:old.method},options);var data=options.data,url=String(options.url),method=options.method.toLowerCase();switch($type(data)){case'element':data=document.id(data).toQueryString();break;case'object':case'hash':data=Hash.toQueryString(data);}
if(this.options.format){var format='format='+this.options.format;data=(data)?format+'&'+data:format;}
if(this.options.emulation&&!['get','post'].contains(method)){var _method='_method='+method;data=(data)?_method+'&'+data:_method;method='post';}
if(this.options.urlEncoded&&method=='post'){var encoding=(this.options.encoding)?'; charset='+this.options.encoding:'';this.headers.set('Content-type','application/x-www-form-urlencoded'+encoding);}
if(this.options.noCache){var noCache='noCache='+new Date().getTime();data=(data)?noCache+'&'+data:noCache;}
var trimPosition=url.lastIndexOf('/');if(trimPosition>-1&&(trimPosition=url.indexOf('#'))>-1)url=url.substr(0,trimPosition);if(data&&method=='get'){url=url+(url.contains('?')?'&':'?')+data;data=null;}
this.xhr.open(method.toUpperCase(),url,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(value,key){try{this.xhr.setRequestHeader(key,value);}catch(e){this.fireEvent('exception',[key,value]);}},this);this.fireEvent('request');this.xhr.send(data);if(!this.options.async)this.onStateChange();return this;},cancel:function(){if(!this.running)return this;this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent('cancel');return this;}});(function(){var methods={};['get','post','put','delete','GET','POST','PUT','DELETE'].each(function(method){methods[method]=function(){var params=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(params,{method:method}));};});Request.implement(methods);})();Element.Properties.send={set:function(options){var send=this.retrieve('send');if(send)send.cancel();return this.eliminate('send').store('send:options',$extend({data:this,link:'cancel',method:this.get('method')||'post',url:this.get('action')},options));},get:function(options){if(options||!this.retrieve('send')){if(options||!this.retrieve('send:options'))this.set('send',options);this.store('send',new Request(this.retrieve('send:options')));}
return this.retrieve('send');}};Element.implement({send:function(url){var sender=this.get('send');sender.send({data:this,url:url||sender.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(text){var match=text.match(/<body[^>]*>([\s\S]*?)<\/body>/i);text=(match)?match[1]:text;var container=new Element('div');return $try(function(){var root='<root>'+text+'</root>',doc;if(Browser.Engine.trident){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async=false;doc.loadXML(root);}else{doc=new DOMParser().parseFromString(root,'text/xml');}
root=doc.getElementsByTagName('root')[0];if(!root)return null;for(var i=0,k=root.childNodes.length;i<k;i++){var child=Element.clone(root.childNodes[i],true,true);if(child)container.grab(child);}
return container;})||container.set('html',text);},success:function(text){var options=this.options,response=this.response;response.html=text.stripScripts(function(script){response.javascript=script;});var temp=this.processHTML(response.html);response.tree=temp.childNodes;response.elements=temp.getElements('*');if(options.filter)response.tree=response.elements.filter(options.filter);if(options.update)document.id(options.update).empty().set('html',response.html);else if(options.append)document.id(options.append).adopt(temp.getChildren());if(options.evalScripts)$exec(response.javascript);this.onSuccess(response.tree,response.elements,response.html,response.javascript);}});Element.Properties.load={set:function(options){var load=this.retrieve('load');if(load)load.cancel();return this.eliminate('load').store('load:options',$extend({data:this,link:'cancel',update:this,method:'get'},options));},get:function(options){if(options||!this.retrieve('load')){if(options||!this.retrieve('load:options'))this.set('load',options);this.store('load',new Request.HTML(this.retrieve('load:options')));}
return this.retrieve('load');}};Element.implement({load:function(){this.get('load').send(Array.link(arguments,{data:Object.type,url:String.type}));return this;}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(options){this.parent(options);this.headers.extend({'Accept':'application/json','X-Request':'JSON'});},success:function(text){this.response.json=JSON.decode(text,this.options.secure);this.onSuccess(this.response.json,text);}});MooTools.More={'version':'1.2.4.4','build':'6f6057dc645fdb7547689183b2311063bd653ddf'};Class.Mutators.Binds=function(binds){return binds;};Class.Mutators.initialize=function(initialize){return function(){$splat(this.Binds).each(function(name){var original=this[name];if(original)this[name]=original.bind(this);},this);return initialize.apply(this,arguments);};};Element.implement({measure:function(fn){var vis=function(el){return!!(!el||el.offsetHeight||el.offsetWidth);};if(vis(this))return fn.apply(this);var parent=this.getParent(),restorers=[],toMeasure=[];while(!vis(parent)&&parent!=document.body){toMeasure.push(parent.expose());parent=parent.getParent();}
var restore=this.expose();var result=fn.apply(this);restore();toMeasure.each(function(restore){restore();});return result;},expose:function(){if(this.getStyle('display')!='none')return $empty;var before=this.style.cssText;this.setStyles({display:'block',position:'absolute',visibility:'hidden'});return function(){this.style.cssText=before;}.bind(this);},getDimensions:function(options){options=$merge({computeSize:false},options);var dim={};var getSize=function(el,options){return(options.computeSize)?el.getComputedSize(options):el.getSize();};var parent=this.getParent('body');if(parent&&this.getStyle('display')=='none'){dim=this.measure(function(){return getSize(this,options);});}else if(parent){try{dim=getSize(this,options);}catch(e){}}else{dim={x:0,y:0};}
return $chk(dim.x)?$extend(dim,{width:dim.x,height:dim.y}):$extend(dim,{x:dim.width,y:dim.height});},getComputedSize:function(options){options=$merge({styles:['padding','border'],plains:{height:['top','bottom'],width:['left','right']},mode:'both'},options);var size={width:0,height:0};switch(options.mode){case'vertical':delete size.width;delete options.plains.width;break;case'horizontal':delete size.height;delete options.plains.height;break;}
var getStyles=[];$each(options.plains,function(plain,key){plain.each(function(edge){options.styles.each(function(style){getStyles.push((style=='border')?style+'-'+edge+'-'+'width':style+'-'+edge);});});});var styles={};getStyles.each(function(style){styles[style]=this.getComputedStyle(style);},this);var subtracted=[];$each(options.plains,function(plain,key){var capitalized=key.capitalize();size['total'+capitalized]=size['computed'+capitalized]=0;plain.each(function(edge){size['computed'+edge.capitalize()]=0;getStyles.each(function(style,i){if(style.test(edge)){styles[style]=styles[style].toInt()||0;size['total'+capitalized]=size['total'+capitalized]+styles[style];size['computed'+edge.capitalize()]=size['computed'+edge.capitalize()]+styles[style];}
if(style.test(edge)&&key!=style&&(style.test('border')||style.test('padding'))&&!subtracted.contains(style)){subtracted.push(style);size['computed'+capitalized]=size['computed'+capitalized]-styles[style];}});});});['Width','Height'].each(function(value){var lower=value.toLowerCase();if(!$chk(size[lower]))return;size[lower]=size[lower]+this['offset'+value]+size['computed'+value];size['total'+value]=size[lower]+size['total'+value];delete size['computed'+value];},this);return $extend(styles,size);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(elements,options){this.elements=this.subject=$$(elements);this.parent(options);},compute:function(from,to,delta){var now={};for(var i in from){var iFrom=from[i],iTo=to[i],iNow=now[i]={};for(var p in iFrom)iNow[p]=this.parent(iFrom[p],iTo[p],delta);}
return now;},set:function(now){for(var i in now){var iNow=now[i];for(var p in iNow)this.render(this.elements[i],p,iNow[p],this.options.unit);}
return this;},start:function(obj){if(!this.check(obj))return this;var from={},to={};for(var i in obj){var iProps=obj[i],iFrom=from[i]={},iTo=to[i]={};for(var p in iProps){var parsed=this.prepare(this.elements[i],p,iProps[p]);iFrom[p]=parsed.from;iTo[p]=parsed.to;}}
return this.parent(from,to);}});Fx.Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:'click',initialDisplayFx:true,returnHeightToAuto:true},initialize:function(){var params=Array.link(arguments,{'container':Element.type,'options':Object.type,'togglers':$defined,'elements':$defined});this.parent(params.elements,params.options);this.togglers=$$(params.togglers);this.previous=-1;this.internalChain=new Chain();if(this.options.alwaysHide)this.options.wait=true;if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}
if(this.options.start){this.options.display=false;this.options.show=false;}
this.effects={};if(this.options.opacity)this.effects.opacity='fullOpacity';if(this.options.width)this.effects.width=this.options.fixedWidth?'fullWidth':'offsetWidth';if(this.options.height)this.effects.height=this.options.fixedHeight?'fullHeight':'scrollHeight';for(var i=0,l=this.togglers.length;i<l;i++)this.addSection(this.togglers[i],this.elements[i]);this.elements.each(function(el,i){if(this.options.show===i){this.fireEvent('active',[this.togglers[i],el]);}else{for(var fx in this.effects)el.setStyle(fx,0);}},this);if($chk(this.options.display)||this.options.initialDisplayFx===false)this.display(this.options.display,this.options.initialDisplayFx);if(this.options.fixedHeight!==false)this.options.returnHeightToAuto=false;this.addEvent('complete',this.internalChain.callChain.bind(this.internalChain));},addSection:function(toggler,element){toggler=document.id(toggler);element=document.id(element);var test=this.togglers.contains(toggler);this.togglers.include(toggler);this.elements.include(element);var idx=this.togglers.indexOf(toggler);var displayer=this.display.bind(this,idx);toggler.store('accordion:display',displayer);toggler.addEvent(this.options.trigger,displayer);if(this.options.height)element.setStyles({'padding-top':0,'border-top':'none','padding-bottom':0,'border-bottom':'none'});if(this.options.width)element.setStyles({'padding-left':0,'border-left':'none','padding-right':0,'border-right':'none'});element.fullOpacity=1;if(this.options.fixedWidth)element.fullWidth=this.options.fixedWidth;if(this.options.fixedHeight)element.fullHeight=this.options.fixedHeight;element.setStyle('overflow','hidden');if(!test){for(var fx in this.effects)element.setStyle(fx,0);}
return this;},detach:function(){this.togglers.each(function(toggler){toggler.removeEvent(this.options.trigger,toggler.retrieve('accordion:display'));},this);},display:function(index,useFx){if(!this.check(index,useFx))return this;useFx=$pick(useFx,true);if(this.options.returnHeightToAuto){var prev=this.elements[this.previous];if(prev&&!this.selfHidden){for(var fx in this.effects){prev.setStyle(fx,prev[this.effects[fx]]);}}}
index=($type(index)=='element')?this.elements.indexOf(index):index;if((this.timer&&this.options.wait)||(index===this.previous&&!this.options.alwaysHide))return this;this.previous=index;var obj={};this.elements.each(function(el,i){obj[i]={};var hide;if(i!=index){hide=true;}else if(this.options.alwaysHide&&((el.offsetHeight>0&&this.options.height)||el.offsetWidth>0&&this.options.width)){hide=true;this.selfHidden=true;}
this.fireEvent(hide?'background':'active',[this.togglers[i],el]);for(var fx in this.effects)obj[i][fx]=hide?0:el[this.effects[fx]];},this);this.internalChain.chain(function(){if(this.options.returnHeightToAuto&&!this.selfHidden){var el=this.elements[index];if(el)el.setStyle('height','auto');};}.bind(this));return useFx?this.start(obj):this.set(obj);}});var Accordion=new Class({Extends:Fx.Accordion,initialize:function(){this.parent.apply(this,arguments);var params=Array.link(arguments,{'container':Element.type});this.container=params.container;},addSection:function(toggler,element,pos){toggler=document.id(toggler);element=document.id(element);var test=this.togglers.contains(toggler);var len=this.togglers.length;if(len&&(!test||pos)){pos=$pick(pos,len-1);toggler.inject(this.togglers[pos],'before');element.inject(toggler,'after');}else if(this.container&&!test){toggler.inject(this.container);element.inject(this.container);}
return this.parent.apply(this,arguments);}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);var cancel=this.cancel.bind(this,false);if($type(this.element)!='element')this.element=document.id(this.element.getDocument().body);var stopper=this.element;if(this.options.wheelStops){this.addEvent('start',function(){stopper.addEvent('mousewheel',cancel);},true);this.addEvent('complete',function(){stopper.removeEvent('mousewheel',cancel);},true);}},set:function(){var now=Array.flatten(arguments);if(Browser.Engine.gecko)now=[Math.round(now[0]),Math.round(now[1])];this.element.scrollTo(now[0],now[1]);},compute:function(from,to,delta){return[0,1].map(function(i){return Fx.compute(from[i],to[i],delta);});},start:function(x,y){if(!this.check(x,y))return this;var scrollSize=this.element.getScrollSize(),scroll=this.element.getScroll(),values={x:x,y:y};for(var z in values){var max=scrollSize[z];if($chk(values[z]))values[z]=($type(values[z])=='number')?values[z]:max;else values[z]=scroll[z];values[z]+=this.options.offset[z];}
return this.parent([scroll.x,scroll.y],[values.x,values.y]);},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);},toRight:function(){return this.start('right',false);},toBottom:function(){return this.start(false,'bottom');},toElement:function(el){var position=document.id(el).getPosition(this.element);return this.start(position.x,position.y);},scrollIntoView:function(el,axes,offset){axes=axes?$splat(axes):['x','y'];var to={};el=document.id(el);var pos=el.getPosition(this.element);var size=el.getSize();var scroll=this.element.getScroll();var containerSize=this.element.getSize();var edge={x:pos.x+size.x,y:pos.y+size.y};['x','y'].each(function(axis){if(axes.contains(axis)){if(edge[axis]>scroll[axis]+containerSize[axis])to[axis]=edge[axis]-containerSize[axis];if(pos[axis]<scroll[axis])to[axis]=pos[axis];}
if(to[axis]==null)to[axis]=scroll[axis];if(offset&&offset[axis])to[axis]=to[axis]+offset[axis];},this);if(to.x!=scroll.x||to.y!=scroll.y)this.start(to.x,to.y);return this;},scrollToCenter:function(el,axes,offset){axes=axes?$splat(axes):['x','y'];el=$(el);var to={},pos=el.getPosition(this.element),size=el.getSize(),scroll=this.element.getScroll(),containerSize=this.element.getSize(),edge={x:pos.x+size.x,y:pos.y+size.y};['x','y'].each(function(axis){if(axes.contains(axis)){to[axis]=pos[axis]-(containerSize[axis]-size[axis])/2;}
if(to[axis]==null)to[axis]=scroll[axis];if(offset&&offset[axis])to[axis]=to[axis]+offset[axis];},this);if(to.x!=scroll.x||to.y!=scroll.y)this.start(to.x,to.y);return this;}});Fx.Slide=new Class({Extends:Fx,options:{mode:'vertical',wrapper:false,hideOverflow:true},initialize:function(element,options){this.addEvent('complete',function(){this.open=(this.wrapper['offset'+this.layout.capitalize()]!=0);if(this.open)this.wrapper.setStyle('height','');if(this.open&&Browser.Engine.webkit419)this.element.dispose().inject(this.wrapper);},true);this.element=this.subject=document.id(element);this.parent(options);var wrapper=this.element.retrieve('wrapper');var styles=this.element.getStyles('margin','position','overflow');if(this.options.hideOverflow)styles=$extend(styles,{overflow:'hidden'});if(this.options.wrapper)wrapper=document.id(this.options.wrapper).setStyles(styles);this.wrapper=wrapper||new Element('div',{styles:styles}).wraps(this.element);this.element.store('wrapper',this.wrapper).setStyle('margin',0);this.now=[];this.open=true;},vertical:function(){this.margin='margin-top';this.layout='height';this.offset=this.element.offsetHeight;},horizontal:function(){this.margin='margin-left';this.layout='width';this.offset=this.element.offsetWidth;},set:function(now){this.element.setStyle(this.margin,now[0]);this.wrapper.setStyle(this.layout,now[1]);return this;},compute:function(from,to,delta){return[0,1].map(function(i){return Fx.compute(from[i],to[i],delta);});},start:function(how,mode){if(!this.check(how,mode))return this;this[mode||this.options.mode]();var margin=this.element.getStyle(this.margin).toInt();var layout=this.wrapper.getStyle(this.layout).toInt();var caseIn=[[margin,layout],[0,this.offset]];var caseOut=[[margin,layout],[-this.offset,0]];var start;switch(how){case'in':start=caseIn;break;case'out':start=caseOut;break;case'toggle':start=(layout==0)?caseIn:caseOut;}
return this.parent(start[0],start[1]);},slideIn:function(mode){return this.start('in',mode);},slideOut:function(mode){return this.start('out',mode);},hide:function(mode){this[mode||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(mode){this[mode||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(mode){return this.start('toggle',mode);}});Element.Properties.slide={set:function(options){var slide=this.retrieve('slide');if(slide)slide.cancel();return this.eliminate('slide').store('slide:options',$extend({link:'cancel'},options));},get:function(options){if(options||!this.retrieve('slide')){if(options||!this.retrieve('slide:options'))this.set('slide',options);this.store('slide',new Fx.Slide(this,this.retrieve('slide:options')));}
return this.retrieve('slide');}};Element.implement({slide:function(how,mode){how=how||'toggle';var slide=this.get('slide'),toggle;switch(how){case'hide':slide.hide(mode);break;case'show':slide.show(mode);break;case'toggle':var flag=this.retrieve('slide:flag',slide.open);slide[flag?'slideOut':'slideIn'](mode);this.store('slide:flag',!flag);toggle=true;break;default:slide.start(how,mode);}
if(!toggle)this.eliminate('slide:flag');return this;}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(options,context){context=context||document;this.doc=context.getDocument();var win=context.getWindow();this.parent(this.doc,options);this.links=$$(this.options.links||this.doc.links);var location=win.location.href.match(/^[^#]*/)[0]+'#';this.links.each(function(link){if(link.href.indexOf(location)!=0){return;}
var anchor=link.href.substr(location.length);if(anchor)this.useLink(link,anchor);},this);if(!Browser.Engine.webkit419){this.addEvent('complete',function(){win.location.hash=this.anchor;},true);}},useLink:function(link,anchor){var el;link.addEvent('click',function(event){if(el!==false&&!el)el=document.id(anchor)||this.doc.getElement('a[name='+anchor+']');if(el){event.preventDefault();this.anchor=anchor;this.toElement(el).chain(function(){this.fireEvent('scrolledTo',[link,el]);}.bind(this));link.blur();}}.bind(this));}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:'px',grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:'left',y:'top'}},initialize:function(){var params=Array.link(arguments,{'options':Object.type,'element':$defined});this.element=document.id(params.element);this.document=this.element.getDocument();this.setOptions(params.options||{});var htype=$type(this.options.handle);this.handles=((htype=='array'||htype=='collection')?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={'now':{},'pos':{}};this.value={'start':{},'now':{}};this.selection=(Browser.Engine.trident)?'selectstart':'mousedown';this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent('mousedown',this.bound.start);return this;},detach:function(){this.handles.removeEvent('mousedown',this.bound.start);return this;},start:function(event){if(event.rightClick)return;if(this.options.preventDefault)event.preventDefault();if(this.options.stopPropagation)event.stopPropagation();this.mouse.start=event.page;this.fireEvent('beforeStart',this.element);var limit=this.options.limit;this.limit={x:[],y:[]};for(var z in this.options.modifiers){if(!this.options.modifiers[z])continue;if(this.options.style)this.value.now[z]=this.element.getStyle(this.options.modifiers[z]).toInt();else this.value.now[z]=this.element[this.options.modifiers[z]];if(this.options.invert)this.value.now[z]*=-1;this.mouse.pos[z]=event.page[z]-this.value.now[z];if(limit&&limit[z]){for(var i=2;i--;i){if($chk(limit[z][i]))this.limit[z][i]=$lambda(limit[z][i])();}}}
if($type(this.options.grid)=='number')this.options.grid={x:this.options.grid,y:this.options.grid};this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(event){if(this.options.preventDefault)event.preventDefault();var distance=Math.round(Math.sqrt(Math.pow(event.page.x-this.mouse.start.x,2)+Math.pow(event.page.y-this.mouse.start.y,2)));if(distance>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent('start',[this.element,event]).fireEvent('snap',this.element);}},drag:function(event){if(this.options.preventDefault)event.preventDefault();this.mouse.now=event.page;for(var z in this.options.modifiers){if(!this.options.modifiers[z])continue;this.value.now[z]=this.mouse.now[z]-this.mouse.pos[z];if(this.options.invert)this.value.now[z]*=-1;if(this.options.limit&&this.limit[z]){if($chk(this.limit[z][1])&&(this.value.now[z]>this.limit[z][1])){this.value.now[z]=this.limit[z][1];}else if($chk(this.limit[z][0])&&(this.value.now[z]<this.limit[z][0])){this.value.now[z]=this.limit[z][0];}}
if(this.options.grid[z])this.value.now[z]-=((this.value.now[z]-(this.limit[z][0]||0))%this.options.grid[z]);if(this.options.style){this.element.setStyle(this.options.modifiers[z],this.value.now[z]+this.options.unit);}else{this.element[this.options.modifiers[z]]=this.value.now[z];}}
this.fireEvent('drag',[this.element,event]);},cancel:function(event){this.document.removeEvent('mousemove',this.bound.check);this.document.removeEvent('mouseup',this.bound.cancel);if(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent('cancel',this.element);}},stop:function(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent('mousemove',this.bound.drag);this.document.removeEvent('mouseup',this.bound.stop);if(event)this.fireEvent('complete',[this.element,event]);}});Element.implement({makeResizable:function(options){var drag=new Drag(this,$merge({modifiers:{x:'width',y:'height'}},options));this.store('resizer',drag);return drag.addEvent('drag',function(){this.fireEvent('resize',drag);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(element,options){this.parent(element,options);element=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&$type(this.container)!='element')
this.container=document.id(this.container.getDocument().body);var styles=element.getStyles('left','top','position');if(styles.left=='auto'||styles.top=='auto')
element.setPosition(element.getPosition(element.getOffsetParent()));if(styles.position=='static')
element.setStyle('position','absolute');this.addEvent('start',this.checkDroppables,true);this.overed=null;},start:function(event){if(this.container)this.options.limit=this.calculateLimit();if(this.options.precalculate){this.positions=this.droppables.map(function(el){return el.getCoordinates();});}
this.parent(event);},calculateLimit:function(){var offsetParent=this.element.getOffsetParent(),containerCoordinates=this.container.getCoordinates(offsetParent),containerBorder={},elementMargin={},elementBorder={},containerMargin={},offsetParentPadding={};['top','right','bottom','left'].each(function(pad){containerBorder[pad]=this.container.getStyle('border-'+pad).toInt();elementBorder[pad]=this.element.getStyle('border-'+pad).toInt();elementMargin[pad]=this.element.getStyle('margin-'+pad).toInt();containerMargin[pad]=this.container.getStyle('margin-'+pad).toInt();offsetParentPadding[pad]=offsetParent.getStyle('padding-'+pad).toInt();},this);var width=this.element.offsetWidth+elementMargin.left+elementMargin.right,height=this.element.offsetHeight+elementMargin.top+elementMargin.bottom,left=0,top=0,right=containerCoordinates.right-containerBorder.right-width,bottom=containerCoordinates.bottom-containerBorder.bottom-height;if(this.options.includeMargins){left+=elementMargin.left;top+=elementMargin.top;}else{right+=elementMargin.right;bottom+=elementMargin.bottom;}
if(this.element.getStyle('position')=='relative'){var coords=this.element.getCoordinates(offsetParent);coords.left-=this.element.getStyle('left').toInt();coords.top-=this.element.getStyle('top').toInt();left+=containerBorder.left-coords.left;top+=containerBorder.top-coords.top;right+=elementMargin.left-coords.left;bottom+=elementMargin.top-coords.top;if(this.container!=offsetParent){left+=containerMargin.left+offsetParentPadding.left;top+=(Browser.Engine.trident4?0:containerMargin.top)+offsetParentPadding.top;}}else{left-=elementMargin.left;top-=elementMargin.top;if(this.container==offsetParent){right-=containerBorder.left;bottom-=containerBorder.top;}else{left+=containerCoordinates.left+containerBorder.left;top+=containerCoordinates.top+containerBorder.top;}}
return{x:[left,right],y:[top,bottom]};},checkAgainst:function(el,i){el=(this.positions)?this.positions[i]:el.getCoordinates();var now=this.mouse.now;return(now.x>el.left&&now.x<el.right&&now.y<el.bottom&&now.y>el.top);},checkDroppables:function(){var overed=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=overed){if(this.overed)this.fireEvent('leave',[this.element,this.overed]);if(overed)this.fireEvent('enter',[this.element,overed]);this.overed=overed;}},drag:function(event){this.parent(event);if(this.options.checkDroppables&&this.droppables.length)this.checkDroppables();},stop:function(event){this.checkDroppables();this.fireEvent('drop',[this.element,this.overed,event]);this.overed=null;return this.parent(event);}});Element.implement({makeDraggable:function(options){var drag=new Drag.Move(this,options);this.store('dragger',drag);return drag;}});var Slider=new Class({Implements:[Events,Options],Binds:['clickedElement','draggedKnob','scrolledElement'],options:{onTick:function(position){if(this.options.snap)position=this.toPosition(this.step);this.knob.setStyle(this.property,position);},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:'horizontal'},initialize:function(element,knob,options){this.setOptions(options);this.element=document.id(element);this.knob=document.id(knob);this.previousChange=this.previousEnd=this.step=-1;var offset,limit={},modifiers={'x':false,'y':false};switch(this.options.mode){case'vertical':this.axis='y';this.property='top';offset='offsetHeight';break;case'horizontal':this.axis='x';this.property='left';offset='offsetWidth';}
this.full=this.element.measure(function(){this.half=this.knob[offset]/2;return this.element[offset]-this.knob[offset]+(this.options.offset*2);}.bind(this));this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle('position','relative').setStyle(this.property,this.options.initialStep?this.toPosition(this.options.initialStep):-this.options.offset);modifiers[this.axis]=this.property;limit[this.axis]=[-this.options.offset,this.full-this.options.offset];var dragOptions={snap:0,limit:limit,modifiers:modifiers,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:(function(){this.isDragging=true;}).bind(this),onCancel:function(){this.isDragging=false;}.bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end();}.bind(this)};if(this.options.snap){dragOptions.grid=Math.ceil(this.stepWidth);dragOptions.limit[this.axis][1]=this.full;}
this.drag=new Drag(this.knob,dragOptions);this.attach();},attach:function(){this.element.addEvent('mousedown',this.clickedElement);if(this.options.wheel)this.element.addEvent('mousewheel',this.scrolledElement);this.drag.attach();return this;},detach:function(){this.element.removeEvent('mousedown',this.clickedElement);this.element.removeEvent('mousewheel',this.scrolledElement);this.drag.detach();return this;},set:function(step){if(!((this.range>0)^(step<this.min)))step=this.min;if(!((this.range>0)^(step>this.max)))step=this.max;this.step=Math.round(step);this.checkStep();this.fireEvent('tick',this.toPosition(this.step));this.end();return this;},clickedElement:function(event){if(this.isDragging||event.target==this.knob)return;var dir=this.range<0?-1:1;var position=event.page[this.axis]-this.element.getPosition()[this.axis]-this.half;position=position.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+dir*this.toStep(position));this.checkStep();this.fireEvent('tick',position);this.end();},scrolledElement:function(event){var mode=(this.options.mode=='horizontal')?(event.wheel<0):(event.wheel>0);this.set(mode?this.step-this.stepSize:this.step+this.stepSize);event.stop();},draggedKnob:function(){var dir=this.range<0?-1:1;var position=this.drag.value.now[this.axis];position=position.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+dir*this.toStep(position));this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent('change',this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent('complete',this.step+'');}},toStep:function(position){var step=(position+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(step-=step%this.stepSize):step;},toPosition:function(step){return(this.full*Math.abs(this.min-step))/(this.steps*this.stepSize)-this.options.offset;}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(lists,options){this.setOptions(options);this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(lists)||lists));if(!this.options.clone)this.options.revert=false;if(this.options.revert)this.effect=new Fx.Morph(null,$merge({duration:250,link:'cancel'},this.options.revert));},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(element){this.elements.push(element);var start=element.retrieve('sortables:start',this.start.bindWithEvent(this,element));(this.options.handle?element.getElement(this.options.handle)||element:element).addEvent('mousedown',start);},this);return this;},addLists:function(){Array.flatten(arguments).each(function(list){this.lists.push(list);this.addItems(list.getChildren());},this);return this;},removeItems:function(){return $$(Array.flatten(arguments).map(function(element){this.elements.erase(element);var start=element.retrieve('sortables:start');(this.options.handle?element.getElement(this.options.handle)||element:element).removeEvent('mousedown',start);return element;},this));},removeLists:function(){return $$(Array.flatten(arguments).map(function(list){this.lists.erase(list);this.removeItems(list.getChildren());return list;},this));},getClone:function(event,element){if(!this.options.clone)return new Element('div').inject(document.body);if($type(this.options.clone)=='function')return this.options.clone.call(this,event,element,this.list);var clone=element.clone(true).setStyles({margin:'0px',position:'absolute',visibility:'hidden','width':element.getStyle('width')});if(clone.get('html').test('radio')){clone.getElements('input[type=radio]').each(function(input,i){input.set('name','clone_'+i);});}
return clone.inject(this.list).setPosition(element.getPosition(element.getOffsetParent()));},getDroppables:function(){var droppables=this.list.getChildren();if(!this.options.constrain)droppables=this.lists.concat(droppables).erase(this.list);return droppables.erase(this.clone).erase(this.element);},insert:function(dragging,element){var where='inside';if(this.lists.contains(element)){this.list=element;this.drag.droppables=this.getDroppables();}else{where=this.element.getAllPrevious().contains(element)?'before':'after';}
this.element.inject(element,where);this.fireEvent('sort',[this.element,this.clone]);},start:function(event,element){if(!this.idle)return;this.idle=false;this.element=element;this.opacity=element.get('opacity');this.list=element.getParent();this.clone=this.getClone(event,element);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){event.stop();this.clone.setStyle('visibility','visible');this.element.set('opacity',this.options.opacity||0);this.fireEvent('start',[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,'before');this.drag.start(event);},end:function(){this.drag.detach();this.element.set('opacity',this.opacity);if(this.effect){var dim=this.element.getStyles('width','height');var pos=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:pos.top,left:pos.left,width:dim.width,height:dim.height,opacity:0.25}).chain(this.reset.bind(this));}else{this.reset();}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent('complete',this.element);},serialize:function(){var params=Array.link(arguments,{modifier:Function.type,index:$defined});var serial=this.lists.map(function(list){return list.getChildren().map(params.modifier||function(element){return element.get('id');},this);},this);var index=params.index;if(this.lists.length==1)index=0;return $chk(index)&&index>=0&&index<this.lists.length?serial[index]:serial;}});var Asset={javascript:function(source,properties){properties=$extend({onload:$empty,document:document,check:$lambda(true)},properties);if(properties.onLoad)properties.onload=properties.onLoad;var script=new Element('script',{src:source,type:'text/javascript'});var load=properties.onload.bind(script),check=properties.check,doc=properties.document;delete properties.onload;delete properties.check;delete properties.document;script.addEvents({load:load,readystatechange:function(){if(['loaded','complete'].contains(this.readyState))load();}}).set(properties);if(Browser.Engine.webkit419)var checker=(function(){if(!$try(check))return;$clear(checker);load();}).periodical(50);return script.inject(doc.head);},css:function(source,properties){return new Element('link',$merge({rel:'stylesheet',media:'screen',type:'text/css',href:source},properties)).inject(document.head);},image:function(source,properties){properties=$merge({onload:$empty,onabort:$empty,onerror:$empty},properties);var image=new Image();var element=document.id(image)||new Element('img');['load','abort','error'].each(function(name){var type='on'+name;var cap=name.capitalize();if(properties['on'+cap])properties[type]=properties['on'+cap];var event=properties[type];delete properties[type];image[type]=function(){if(!image)return;if(!element.parentNode){element.width=image.width;element.height=image.height;}
image=image.onload=image.onabort=image.onerror=null;event.delay(1,element,element);element.fireEvent(name,element,1);};});image.src=element.src=source;if(image&&image.complete)image.onload.delay(1);return element.set(properties);},images:function(sources,options){options=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},options);sources=$splat(sources);var images=[];var counter=0;return new Elements(sources.map(function(source){return Asset.image(source,$extend(options.properties,{onload:function(){options.onProgress.call(this,counter,sources.indexOf(source));counter++;if(counter==sources.length)options.onComplete();},onerror:function(){options.onError.call(this,counter,sources.indexOf(source));counter++;if(counter==sources.length)options.onComplete();}}));}));}};var Color=new Native({initialize:function(color,type){if(arguments.length>=3){type='rgb';color=Array.slice(arguments,0,3);}else if(typeof color=='string'){if(color.match(/rgb/))color=color.rgbToHex().hexToRgb(true);else if(color.match(/hsb/))color=color.hsbToRgb();else color=color.hexToRgb(true);}
type=type||'rgb';switch(type){case'hsb':var old=color;color=color.hsbToRgb();color.hsb=old;break;case'hex':color=color.hexToRgb(true);break;}
color.rgb=color.slice(0,3);color.hsb=color.hsb||color.rgbToHsb();color.hex=color.rgbToHex();return $extend(color,this);}});Color.implement({mix:function(){var colors=Array.slice(arguments);var alpha=($type(colors.getLast())=='number')?colors.pop():50;var rgb=this.slice();colors.each(function(color){color=new Color(color);for(var i=0;i<3;i++)rgb[i]=Math.round((rgb[i]/100*(100-alpha))+(color[i]/100*alpha));});return new Color(rgb,'rgb');},invert:function(){return new Color(this.map(function(value){return 255-value;}));},setHue:function(value){return new Color([value,this.hsb[1],this.hsb[2]],'hsb');},setSaturation:function(percent){return new Color([this.hsb[0],percent,this.hsb[2]],'hsb');},setBrightness:function(percent){return new Color([this.hsb[0],this.hsb[1],percent],'hsb');}});var $RGB=function(r,g,b){return new Color([r,g,b],'rgb');};var $HSB=function(h,s,b){return new Color([h,s,b],'hsb');};var $HEX=function(hex){return new Color(hex,'hex');};Array.implement({rgbToHsb:function(){var red=this[0],green=this[1],blue=this[2],hue=0;var max=Math.max(red,green,blue),min=Math.min(red,green,blue);var delta=max-min;var brightness=max/255,saturation=(max!=0)?delta/max:0;if(saturation!=0){var rr=(max-red)/delta;var gr=(max-green)/delta;var br=(max-blue)/delta;if(red==max)hue=br-gr;else if(green==max)hue=2+rr-br;else hue=4+gr-rr;hue/=6;if(hue<0)hue++;}
return[Math.round(hue*360),Math.round(saturation*100),Math.round(brightness*100)];},hsbToRgb:function(){var br=Math.round(this[2]/100*255);if(this[1]==0){return[br,br,br];}else{var hue=this[0]%360;var f=hue%60;var p=Math.round((this[2]*(100-this[1]))/10000*255);var q=Math.round((this[2]*(6000-this[1]*f))/600000*255);var t=Math.round((this[2]*(6000-this[1]*(60-f)))/600000*255);switch(Math.floor(hue/60)){case 0:return[br,t,p];case 1:return[q,br,p];case 2:return[p,br,t];case 3:return[p,q,br];case 4:return[t,p,br];case 5:return[br,p,q];}}
return false;}});String.implement({rgbToHsb:function(){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHsb():null;},hsbToRgb:function(){var hsb=this.match(/\d{1,3}/g);return(hsb)?hsb.hsbToRgb():null;}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={};},addEvent:function(type,fn){this.checker[type]=this.checker[type]||{};this.events[type]=this.events[type]||[];if(this.events[type].contains(fn))return false;else this.events[type].push(fn);this.instances.each(function(instance,i){instance.addEvent(type,this.check.bind(this,[type,instance,i]));},this);return this;},check:function(type,instance,i){this.checker[type][i]=true;var every=this.instances.every(function(current,j){return this.checker[type][j]||false;},this);if(!every)return;this.checker[type]={};this.events[type].each(function(event){event.call(this,this.instances,instance);},this);}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(name,options){this.parent(name,options);this.load();},save:function(){var value=JSON.encode(this.hash);if(!value||value.length>4096)return false;if(value=='{}')this.dispose();else this.write(value);return true;},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this;}});Hash.each(Hash.prototype,function(method,name){if(typeof method=='function')Hash.Cookie.implement(name,function(){var value=method.apply(this.hash,arguments);if(this.options.autoSave)this.save();return value;});});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(x,y){this.element.scrollTo(x,y);},fps:50},initialize:function(element,options){this.setOptions(options);this.element=document.id(element);this.docBody=document.id(this.element.getDocument().body);this.listener=($type(this.element)!='element')?this.docBody:this.element;this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)};},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseout:this.bound.detach});},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseout:this.bound.detach});this.detach();this.timer=$clear(this.timer);},attach:function(){this.listener.addEvent('mousemove',this.bound.getCoords);},detach:function(){this.listener.removeEvent('mousemove',this.bound.getCoords);this.timer=$clear(this.timer);},getCoords:function(event){this.page=(this.listener.get('tag')=='body')?event.client:event.page;if(!this.timer)this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this);},scroll:function(){var size=this.element.getSize(),scroll=this.element.getScroll(),pos=this.element!=this.docBody?this.element.getOffsets():{x:0,y:0},scrollSize=this.element.getScrollSize(),change={x:0,y:0};for(var z in this.page){if(this.page[z]<(this.options.area+pos[z])&&scroll[z]!=0){change[z]=(this.page[z]-this.options.area-pos[z])*this.options.velocity;}else if(this.page[z]+this.options.area>(size[z]+pos[z])&&scroll[z]+size[z]!=scrollSize[z]){change[z]=(this.page[z]-size[z]+this.options.area-pos[z])*this.options.velocity;}}
if(change.y||change.x)this.fireEvent('change',[scroll.x+change.x,scroll.y+change.y]);}});(function(){var read=function(option,element){return(option)?($type(option)=='function'?option(element):element.get(option)):'';};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle('display','block');},onHide:function(){this.tip.setStyle('display','none');},title:'title',text:function(element){return element.get('rel')||element.get('href');},showDelay:100,hideDelay:100,className:'tip-wrap',offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:false},initialize:function(){var params=Array.link(arguments,{options:Object.type,elements:$defined});this.setOptions(params.options);if(params.elements)this.attach(params.elements);this.container=new Element('div',{'class':'tip'});},toElement:function(){if(this.tip)return this.tip;return this.tip=new Element('div',{'class':this.options.className,styles:{position:'absolute',top:0,left:0}}).adopt(new Element('div',{'class':'tip-top'}),this.container,new Element('div',{'class':'tip-bottom'})).inject(document.body);},attach:function(elements){$$(elements).each(function(element){var title=read(this.options.title,element),text=read(this.options.text,element);element.erase('title').store('tip:native',title).retrieve('tip:title',title);element.retrieve('tip:text',text);this.fireEvent('attach',[element]);var events=['enter','leave'];if(!this.options.fixed)events.push('move');events.each(function(value){var event=element.retrieve('tip:'+value);if(!event)event=this['element'+value.capitalize()].bindWithEvent(this,element);element.store('tip:'+value,event).addEvent('mouse'+value,event);},this);},this);return this;},detach:function(elements){$$(elements).each(function(element){['enter','leave','move'].each(function(value){element.removeEvent('mouse'+value,element.retrieve('tip:'+value)).eliminate('tip:'+value);});this.fireEvent('detach',[element]);if(this.options.title=='title'){var original=element.retrieve('tip:native');if(original)element.set('title',original);}},this);return this;},elementEnter:function(event,element){this.container.empty();['title','text'].each(function(value){var content=element.retrieve('tip:'+value);if(content)this.fill(new Element('div',{'class':'tip-'+value}).inject(this.container),content);},this);$clear(this.timer);this.timer=(function(){this.show(this,element);this.position((this.options.fixed)?{page:element.getPosition()}:event);}).delay(this.options.showDelay,this);},elementLeave:function(event,element){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this,element);this.fireForParent(event,element);},fireForParent:function(event,element){element=element.getParent();if(!element||element==document.body)return;if(element.retrieve('tip:enter'))element.fireEvent('mouseenter',event);else this.fireForParent(event,element);},elementMove:function(event,element){this.position(event);},position:function(event){if(!this.tip)document.id(this);var size=window.getSize(),scroll=window.getScroll(),tip={x:this.tip.offsetWidth,y:this.tip.offsetHeight},props={x:'left',y:'top'},obj={};for(var z in props){obj[props[z]]=event.page[z]+this.options.offset[z];if((obj[props[z]]+tip[z]-scroll[z])>size[z]-this.options.windowPadding[z])obj[props[z]]=event.page[z]-this.options.offset[z]-tip[z];}
this.tip.setStyles(obj);},fill:function(element,contents){if(typeof contents=='string')element.set('html',contents);else element.adopt(contents);},show:function(element){if(!this.tip)document.id(this);this.fireEvent('show',[this.tip,element]);},hide:function(element){if(!this.tip)document.id(this);this.fireEvent('hide',[this.tip,element]);}});})();


/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();

	//Duale Nutzung von MooTools
	var j = jQuery.noConflict();
	
	
	//Globale Variablen
	//Tab, der als erstes angezeigt werden soll
	var visible_tab = 'group';
	var tab_category = 'group_';

	var suchProductText = 'Was suchst du?';
	
	j(document).ready(
		function(){
			//Tab (visible_tab) wird geladen
			j("#"+tab_category+visible_tab).css({"display" : "block"});
			
			if( j("#"+tab_category+"tabs_"+visible_tab).hasClass('normalTab')){
				j("#"+tab_category+"tabs_"+visible_tab).removeClass('normalTab').addClass('activeTab');
			}else if( j("#"+tab_category+"tabs_"+visible_tab).hasClass('firstTab')){
				j("#"+tab_category+"tabs_"+visible_tab).removeClass("firstTab").addClass('firstTabActive');
			}else if( j("#"+tab_category+"tabs_"+visible_tab).hasClass('lastTab')){
				j("#"+tab_category+"tabs_"+visible_tab).removeClass("firstTab").addClass('firstTabActive');
			}

			j("#topNavigation a img").mouseover(
				function(){
					if(j(this).is(':animated') == false){
						j(this).fadeTo('fast', 0);
					}
				}
			);
			j("#topNavigation a img").mouseout(
				function(){
					j(this).fadeTo('fast', 1.0);
				}
			);

			//Suchbox
			//text ein und ausblenden
			var suchText = 'Suchbegriff eingeben...';
			j('#searchBox').css({'color':'#7a8077'}).attr({'value':suchText});
			
			//beim fokusieren der searchbox
			j('#searchBox').focus(
				function(){
					if(j(this).attr('value') == suchText){
						j(this).attr({'value':''}).css({'color':'#242622'});
					}else{
						j(this).css({'color':'#242622'});
					}
				}
			);
			
			//beim verlassen der textbox
			j('#searchBox').blur(
				function(){
					if(j(this).attr('value') == ''){
						j(this).attr({'value':suchText}).css({'color':'#7a8077'});
					}
				}
			);
			
			//Suchbox fuer Produktsuche
			//text ein und ausblenden
			if(j('#product_search').attr('value') == ''){
				j('#product_search').css({'color':'#7a8077'}).attr({'value':suchProductText});
			}else{
				j('#product_search').css({'color':'#242622'});
			}
			//beim fokusieren der searchbox
			j('#product_search').focus(
				function(){
					clearProductSearch();
				}
			);
			
			
			//beim verlassen der textbox
			j('#product_search').blur(
				function(){
					if(j(this).attr('value') == ''){
						j(this).attr({'value':suchProductText}).css({'color':'#7a8077'});
					}
				}
			);
		}
	);

	
	function clearProductSearch(){
		if(j('#product_search').attr('value') == suchProductText){
			j('#product_search').attr({'value':''}).css({'color':'#242622'});
		}else{
			j('#product_search').css({'color':'#242622'});
		}
	}
	
	
	//Tabs werden geladen / changed
	function loadGroupTab(tabId) {
		
		if(tabId == visible_tab) {
			return false;
		}
		if(j('#'+tab_category+tabId).is(':empty') == false){
			if( j('#'+tab_category+'tabs_'+tabId).hasClass('normalTab')){
				j('#'+tab_category+'tabs_'+tabId).removeClass('normalTab').addClass('activeTab');
			}else if( j('#'+tab_category+'tabs_'+tabId).hasClass('firstTab')){
				j('#'+tab_category+'tabs_'+tabId).removeClass('firstTab').addClass('firstTabActive');
			}else if( j('#'+tab_category+'tabs_'+tabId).hasClass('lastTab')){
				j('#'+tab_category+'tabs_'+tabId).removeClass('lastTab').addClass('lastTabActive');
			}
			
			j('#'+tab_category+tabId).css({'display':'block'});
			
			if(j('#'+tab_category+tabId).is(':empty') == false) {
				if( j('#'+tab_category+'tabs_'+visible_tab).hasClass('activeTab')){
					j('#'+tab_category+'tabs_'+visible_tab).removeClass('activeTab').addClass('normalTab');
				}
				if( j('#'+tab_category+'tabs_'+visible_tab).hasClass('firstTabActive')){
					j('#'+tab_category+'tabs_'+visible_tab).removeClass('firstTabActive').addClass('firstTab');
				}
				if( j('#'+tab_category+'tabs_'+visible_tab).hasClass('lastTabActive')){
					j('#'+tab_category+'tabs_'+visible_tab).removeClass('lastTabActive').addClass('lastTab');
				}
				j('#'+tab_category+visible_tab).css({'display':'none'});
			}
			visible_tab = tabId;
		}
	}
	
	//Klappmenu	
	function klappMenu(menuId){
		if(j("#"+menuId+"_list").css('display') == "none"){
			j("#"+menuId+"_list").slideDown(); //css({'display':'block'})
			j("#"+menuId).removeClass('plus').addClass('minus');
			
		}else{
			j("#"+menuId+"_list").slideUp();
			j("#"+menuId).removeClass('minus').addClass('plus');
		}
	}




var SocialEngineAPI={version:"0.1.0alpha"
};
SocialEngineAPI.Base=new Class({initialize:function()
{
this.version=SocialEngineAPI.version
},RegisterModule:function(a)
{
a.Base=this
}
});
var SocialEngineAPI={version:"0.1.0alpha"
};
SocialEngineAPI.Base=new Class({initialize:function()
{
this.version=SocialEngineAPI.version
},RegisterModule:function(a)
{
a.Base=this
}
});
SocialEngineAPI.Comments=new Class({Implements:[Options],Base:{
},page:1,total:0,changed:false,isEditing:false,options:{ajaxURL:"misc_js.php",ajaxMethod:"post",ajaxSecure:false,canComment:false,commentHTML:false,commentCode:false,originalHeight:70,type:false,typeIdentifier:false,typeID:false,paginate:false,cpp:false,commentLinks:{reply:false,walltowall:false
},object_owner:false,object_owner_id:false,typeTab:false,typeCol:false,typeTabParent:false,typeColParent:false,typeChild:false
},initialize:function(a)
{
this.setOptions(a);
if(this.options.initialTotal)
{
this.total=this.options.initialTotal
}var b=this;
window.addEvent("domready",function()
{
b.showPostComment();
b.options.originalHeight=textarea_autogrow("comment_body");
b.getComments(1)
})
},showPostComment:function()
{
var c="";
if(this.options.canComment)
{
c+="<div class='sectionHeader'><h1>"+this.Base.Language.Translate(854)+" (<span class='tc' id='"+this.options.type+"_"+this.options.typeID+"_totalcomments'>"+this.total+"</span>)</h1></div>";
}
else
{c+="<div class='sectionHeader sectionHeaderCantComment'><h1>"+this.Base.Language.Translate(854)+" (<span class='tc' id='"+this.options.type+"_"+this.options.typeID+"_totalcomments'>"+this.total+"</span>)</h1></div>";
}
if(this.options.canComment)
{
c+="<div class='commentsInputContainer'><div class='seperatorOuter'><div class='seperatorInner'></div></div><div class='commentsInput'><form action='misc_js.php' method='post' target='ajaxframe' name='comment_post_form'><div class='profile_postcomment'><textarea name='comment_body' id='comment_body' class='comment_area'>"+this.Base.Language.Translate(829)+"</textarea>";
if(this.options.commentHTML)
{
c+="<div class='allowedTags'><p>"+this.Base.Language.TranslateFormatted(1034,[this.options.commentHTML])+"</p></div>"
}
if(this.options.commentCode)
{
	c+="<div class='captchaSubmit'>"
		c+="<div class='captchaImage'>"
			c+="<img src='./images/secure.php' border='0' class='signup_code' height='20' id='secure_image' width='67'>"
		c+="</div>"
		c+="<div class='captchaReload'>"
			c+="<input type='image' src='/images/wlp/buttons/reload_1px.gif' href='javascript:void(0);' onClick=\"this.blur();$('secure_image').src=$('secure_image').src+'?'+(new Date()).getTime(); return false;\" />"
		c+="</div>"
		c+="<div class='captchaInput'>"
			c+="<div class='inputOuterBorder'>"
				c+="<input type='text' id='comment_secure' name='comment_secure' />"
			c+="</div>"
		c+="</div>"
		c+="<div class='captchaTooltip'>"
			c+="<img src='./images/icons/tip.gif' border='0' onmouseout='document.getElementById(\"captchaTooltip\").style.display=\"none\"' onmouseover='document.getElementById(\"captchaTooltip\").style.display=\"block\"' />"
			c+="<div style='display: none;' class='tooltip tooltipRight' id='captchaTooltip'>"
				c+="<div class='tooltipTop'>"
					c+="<p><strong>Hinweis:</strong></p>"
				c+="</div>"
				c+="<div class='tooltipBottom'>"
					c+="<p>"+this.Base.Language.Translate(856)+"</p>"
				c+="</div>"
			c+="</div>"
		c+="</div>"
		c+="<div class='clearer'></div>"
	c+="</div>"
	c+="<div class='clearer'></div>"
}
c+="<div class='commitButton'>"
	c+="<input type='image' id='comment_submit' src='/images/wlp/buttons/entry_comments_2px.gif' />"
	c+="<input type='hidden' name='task' value='comment_post' />"
	c+="<input type='hidden' name='type' value='"+this.options.type+"' />"
	c+="<input type='hidden' name='iden' value='"+this.options.typeIdentifier+"' />"
	c+="<input type='hidden' name='value' value='"+this.options.typeID+"' />"
c+="</div>"
c+="<div class='clearer'></div>";
if(this.options.object_owner&&this.options.object_owner_id)
{
c+='<input type="hidden" name="object_owner" value="'+this.options.object_owner+'" /><input type="hidden" name="object_owner_id" value="'+this.options.object_owner_id+'" />'
}
else
{c+='<input type="hidden" name="user" value="'+this.Base.Owner.user_info.user_username+'" />'
}
if(this.options.typeTab)
{
c+="<input type='hidden' name='tab' value='"+this.options.typeTab+"' />"
}
if(this.options.typeCol)
{
c+="<input type='hidden' name='col' value='"+this.options.typeCol+"' />"
}
if(this.options.typeTabParent)
{
c+='<input type="hidden" name="tab_parent" value="'+this.options.typeTabParent+'" />'
}
if(this.options.typeColParent)
{
c+='<input type="hidden" name="col_parent" value="'+this.options.typeColParent+'" />'
}
if(this.options.typeChild)
{
c+='<input type="hidden" name="child" value="1" />'
}
c+="</div><div class='clearer'></div><div class='errorMessage' id='comment_error' style='display: none;margin-top: 10px;'><div class='messageContainer'><p id='comment_error_message'></p></div></div></div></form>"
}
c+='<div style="display: none;" id="confirmcommentdelete"><div id="TB_contentArea"><div id="TB_noProperties"><p>'+this.Base.Language.Translate(1026)+'</p></div></div><div class="seperatorOuter"><div class="seperatorInner"></div></div><div id="TB_submits"><form action="misc_js.php" method="post" target="ajaxframe"><div class="submit submit1"><input type="image" alt="'+this.Base.Language.Translate(175)+'" src="images/wlp/buttons/delete_2px.gif" onClick="parent.TB_remove();" /></div><div class="submit submit2"><img src="images/wlp/buttons/cancel_2px.gif" onClick="parent.TB_remove();" alt="'+this.Base.Language.Translate(39)+'" onClick="parent.TB_remove();"></div><div class="clearer"></div><input type="hidden" name="task" value="comment_delete" /><input type="hidden" name="comment_id" id="del_comment_id" value="0" /><input type="hidden" name="type" value="'+this.options.type+'" /><input type="hidden" name="iden" value="'+this.options.typeIdentifier+'" /><input type="hidden" name="value" value="'+this.options.typeID+'" />';
if(this.options.object_owner&&this.options.object_owner_id)
{
c+='<input type="hidden" name="object_owner" value="'+this.options.object_owner+'"><input type="hidden" name="object_owner_id" value="'+this.options.object_owner_id+'" />'
}
else
{c+='<input type="hidden" name="user" value="'+this.Base.Owner.user_info.user_username+'" />'
}
if(this.options.typeTab)
{
c+='<input type="hidden" name="tab" value="'+this.options.typeTab+'" />'
}
if(this.options.typeCol)
{
c+='<input type="hidden" name="col" value="'+this.options.typeCol+'" />'
}
if(this.options.typeTabParent)
{
c+='<input type="hidden" name="tab_parent" value="'+this.options.typeTabParent+'" />'
}
if(this.options.typeColParent)
{
c+='<input type="hidden" name="col_parent" value="'+this.options.typeColParent+'" />'
}
if(this.options.typeChild)
{
c+='<input type="hidden" name="child" value="1" />'
}
c+="</form></div></div></div></div>";
var a=$(this.options.type+"_"+this.options.typeID+"_postcomment");
a.innerHTML=c;
var b=this;
if(this.options.canComment)
{
a.getElement("form").addEvent("submit",function(d)
{
b.checkText(d)
});
a.getElement("textarea").addEvent("focus",function()
{
b.removeText(this)
});
a.getElement("textarea").addEvent("blur",function()
{
b.addText(this)
});
a.getElement("form").addEvent("submit",function(d)
{
b.doCommentPost(d)
})
}
},doCommentPost:function(d)
{
var c=new Event(d);
var a={task:"comment_post",type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,tab:this.options.typeTab,col:this.options.typeCol
};
if(this.options.typeTabParent)
{
a.tab_parent=this.options.typeTabParent
}if(this.options.typeColParent)
{
a.col_parent=this.options.typeColParent
}if(this.options.typeChild)
{
a.child=this.options.typeChild
}if(this.options.object_owner&&this.options.object_owner_id)
{
a.object_owner=this.options.object_owner;
a.object_owner_id=this.options.object_owner_id
}
else
{a.user=this.Base.Owner.user_info.user_username
}if($type(document.comment_post_form.comment_body))
{
a.comment_body=document.comment_post_form.comment_body.value
}if($type(document.comment_post_form.comment_secure))
{
a.comment_secure=document.comment_post_form.comment_secure.value
}var f=this;
var b=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:a,onComplete:function(e,g)
{
f.addComment(e.is_error,e.comment_body,e.comment_date)
}
}).send();
c.stop()
},doCommentEdit:function()
{
var a={task:"comment_edit",type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,user:this.Base.Owner.user_info.user_username
};
if($type(document.editCommentForm.comment_id))
{
a.comment_id=document.editCommentForm.comment_id.value
}if($type(document.editCommentForm.comment_edit))
{
a.comment_edit=document.editCommentForm.comment_edit.value
}var c=this;
var b=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:a,onComplete:function(d,e)
{
c.getComments()
}
}).send()
},doCommentDelete:function(f,b)
{
var d=new Event(f);
var a={task:"comment_delete",comment_id:b,type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,tab:this.options.typeTab,col:this.options.typeCol,user:this.Base.Owner.user_info.user_username
};
if(this.options.typeTabParent)
{
a.tab_parent=this.options.typeTabParent
}if(this.options.typeColParent)
{
a.col_parent=this.options.typeColParent
}if(this.options.typeChild)
{
a.child=this.options.typeChild
}if(this.options.object_owner)
{
a.object_owner=this.options.object_owner
}if(this.options.object_owner_id)
{
a.object_owner_id=this.options.object_owner_id
}if(document.commentDeleteForm && document.commentDeleteForm.comment_body && $type(document.commentDeleteForm.comment_body))
{
a.comment_body=document.commentDeleteForm.comment_body.value
}if(document.commentDeleteForm && document.commentDeleteForm.comment_secure && $type(document.commentDeleteForm.comment_secure))
{
a.comment_secure=document.commentDeleteForm.comment_secure.value
}var g=this;
var c=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:a,onComplete:function(e,h)
{
g.getComments()
}
}).send();
d.stop()
},getComments:function(e)
{
if(e=="next")
{
this.page++
}
else
{if(e=="previous")
{
this.page--
}
else
{if($type(e))
{
this.page=e
}
}
}if(this.options.paginate)
{
window.scroll(0,0)
}
else
{this.options.cpp=this.total
}if(this.options.object_owner&&this.options.object_owner_id)
{
var d=this.options.object_owner;
var a=this.options.object_owner_id;
var b=""
}
else
{var d="";
var a="";
var b=this.Base.Owner.user_info.user_username
}var f=this;
var c=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"comment_get",user:b,object_owner:d,object_owner_id:a,type:this.options.type,iden:this.options.typeIdentifier,value:this.options.typeID,cpp:this.options.cpp,p:this.page
},onComplete:function(g,h)
{
f.updateComments(g)
}
});
c.send()
},updateComments:function(b)
{
if($type(b)!="object")
{
alert("There was an error processing the request.");
return false
}
this.total=parseInt(b.total_comments)||0;
this.page=b.p;
var a=b.maxpage;
var n=b.p_start;
var m=b.p_end;
var h=$(this.options.type+"_"+this.options.typeID+"_totalcomments");
var g=$(this.options.type+"_"+this.options.typeID+"_comments");
var u=this.options.typeID;
var k=$H(b.comments);
h.innerHTML=this.total;
var f=document.createElement("div");
g.empty();
var l=this;
if(l.Base.Core.settings.setting_url)
{
var e="?"
}
else
{var e="&"
}
var idx=0;
k.each(function(o,q)
{
idx++;
var r=new Element("div",{id:"comment_"+q
});
var s="<div class='seperatorOuter'><div class='seperatorInner'></div></div>";
if((idx%2)==0)
{
s+="<a name='commentEntry"+q+"'></a><div class=\"entry entryGrey\">";
}
else
{s+="<a name='commentEntry"+q+"'></a><div class='entry'>";
}
if(o.comment_authoruser_id&&o.comment_authoruser_exists&&o.comment_authoruser_photo!="./images/nophoto.gif")
{
o.comment_authoruser_photo_width=60;
o.comment_authoruser_photo_height=60;
s+="<div class='image'><a href='"+o.comment_authoruser_url+"'><img src='"+o.comment_authoruser_photo.replace(".jpg","_thumb.jpg")+"' height='"+o.comment_authoruser_photo_height+"' width='"+o.comment_authoruser_photo_width+"' /></a></div>"
}
else
{s+="<div class='image'><img src='./images/wlp/nophotoThumb.gif' class='photo' width='60' height='60' /></div>"
}
s+="<div class='content'>";
if(!o.comment_authoruser_id)
{
s+="<h1>"+l.Base.Language.Translate(835)+"</h1>"
}
else
{if(!o.comment_authoruser_exists)
{
s+="<h1>"+l.Base.Language.Translate(1071)+"</h1>"
}
else
{s+="<h1><a href='"+o.comment_authoruser_url+"'>"+o.comment_authoruser_displayname+"</a></h1>"
}
}
s+="<p class='time'>"+o.comment_date+"</p>";
r.setProperty("html",o.comment_body);
s+="<p id='profile_comment_body_"+q+"'>"+o.comment_body+"&nbsp;</p>";
s+="";
var p=new Array();
if(l.Base.Viewer.user_exists&&o.comment_authoruser_id&&o.comment_authoruser_exists)
{
if(l.options.commentLinks.reply&&l.Base.Viewer.user_info.user_id==l.Base.Owner.user_info.user_id&&l.Base.Viewer.user_info.user_id!=o.comment_authoruser_id)
{
p.push("<a style='background-image: url(/images/wlp/icons/ico_answer.gif)' href='"+o.comment_authoruser_url+e+"v=comments#comments'>"+l.Base.Language.Translate(787)+"</a>")
}
if(l.options.commentLinks.walltowall&&o.comment_authoruser_id!=l.Base.Owner.user_info.user_id&&o.comment_authoruser_private==false)
{
p.push("<a style='background-image: url(/images/wlp/icons/ico_question.gif)' href=\"javascript:TB_show('"+l.Base.Language.Translate(1032)+"', 'profile_comments.php?user="+l.Base.Owner.user_info.user_username+"&user2="+o.comment_authoruser_username+"&u="+u+"&TB_iframe=true&height=350&width=455', '', '/images/trans.gif');\">"+l.Base.Language.Translate(891)+"</a>")
}
if(o.comment_authoruser_id!=l.Base.Viewer.user_info.user_id)
{
p.push("<a style='background-image: url(/images/wlp/icons/ico_message.gif)' href=\"javascript:TB_show('"+l.Base.Language.Translate(784)+"', 'user_messages_new.php?to_user="+o.comment_authoruser_displayname+"&to_id="+o.comment_authoruser_username+"&TB_iframe=true&height=400&width=450', '', '/images/trans.gif');\">"+l.Base.Language.Translate(834)+"</a>")
}
if(o.comment_authoruser_id==l.Base.Viewer.user_info.user_id)
{
p.push('<a style="background-image: url(/images/wlp/icons/ico_edit.gif)" class="commentEditLink" href="javascript:void(0);" id=\'comment_edit_link_'+q+"'>"+l.Base.Language.Translate(187)+'</a>'+'<a style="background-image: url(/images/wlp/icons/ico_accept.gif);display:none;" class="commentEditLink" href="javascript:void(0);"  id="comment_edit_save_'+q+'">speichern</a>')
}
}
if((o.comment_authoruser_exists&&o.comment_authoruser_id==l.Base.Viewer.user_info.user_id)||(l.Base.Viewer.user_exists&&l.Base.Viewer.user_info.user_id==l.Base.Owner.user_info.user_id))
{

var cdelLink = '<a style="background-image: url(/images/wlp/icons/ico_delete.gif)" class="commentDeleteLink" href="javascript:void(0); " id="comment_delete_link_'+q+'">'+l.Base.Language.Translate(155)+"</a>";
p.push( cdelLink )
}
s+="<p class='options'>"+p.join("")+"<br class='clearer' /></p>";
s+="</div><div class='clearer'></div></div>";
r.setProperty("html",s);
r.inject(g);
if(r.getElement(".commentEditLink"))
{
r.getElement(".commentEditLink").addEvent("click",function()
{
l.editComment(q)
})
}
if(r.getElement(".commentDeleteLink"))
{
r.getElement(".commentDeleteLink").addEvent("click",function()
{
l.confirmDelete(q)
})
}
});
if(this.options.paginate&&this.total>this.options.cpp)
{
var i=new Element("div",{styles:{"text-align":"center"
}
});
var j=new Element("div",{styles:{"text-align":"center"
}
});
if(this.page>1)
{
var d="<a href='javascript:void(0);' id='comment_last_page_top'>&#171;"+l.Base.Language.Translate(182)+"</a>";var c="<a href='javascript:void(0);' id='comment_last_page_bottom'>&#171;"+l.Base.Language.Translate(182)+"</a>"
}
else
{var d="<font class='disabled'>&#171;"+l.Base.Language.Translate(182)+"</font>";var c="<font class='disabled'>&#171;"+l.Base.Language.Translate(182)+"</font>"
}
if(n==m)
{
d+="&nbsp;|&nbsp;"+this.Base.Language.TranslateFormatted(184,[n,this.total])+"&nbsp;|&nbsp;";
c+="&nbsp;|&nbsp;"+this.Base.Language.TranslateFormatted(184,[n,this.total])+"&nbsp;|&nbsp;"
}
else
{d+="&nbsp;|&nbsp;"+this.Base.Language.TranslateFormatted(185,[n,m,this.total])+"&nbsp;|&nbsp;";
c+="&nbsp;|&nbsp;"+this.Base.Language.TranslateFormatted(185,[n,m,this.total])+"&nbsp;|&nbsp;"}
if(this.page!=a)
{
d+="<a href='javascript:void(0);' id='comment_next_page_top'>"+l.Base.Language.Translate(183)+" &#187;</a>";
c+="<a href='javascript:void(0);' id='comment_next_page_bottom'>"+l.Base.Language.Translate(183)+" &#187;</a>"}
else
{d+="<font class='disabled'>"+l.Base.Language.Translate(183)+" &#187;</font>";
c+="<font class='disabled'>"+l.Base.Language.Translate(183)+" &#187;</font>"
}
i.setProperty("html",d);
j.setProperty("html",c);
i.inject(g,"top");
j.inject(g);
if(i.getElement("a[id=comment_last_page_top]"))
{
i.getElement("a[id=comment_last_page_top]").addEvent("click",function()
{
l.getComments("previous")
})
}
if(j.getElement("a[id=comment_last_page_bottom]"))
{
j.getElement("a[id=comment_last_page_bottom]").addEvent("click",function()
{
l.getComments("previous")
})
}
if(i.getElement("a[id=comment_next_page_top]"))
{
i.getElement("a[id=comment_next_page_top]").addEvent("click",function()
{
l.getComments("next")
})
}
if(j.getElement("a[id=comment_next_page_bottom]"))
{
j.getElement("a[id=comment_next_page_bottom]").addEvent("click",function()
{
l.getComments("next")
})
}
}
},addComment:function(c,a,b)
{
if(!this.options.canComment)
{
return false
}if(c)
{
$("comment_error").style.display="block";
if(!a.trim())
{
this.addText($("comment_body"));
$("comment_error_message").innerHTML=this.Base.Language.Translate(831)
}
else
{$("comment_error_message").innerHTML=this.Base.Language.Translate(832)
}$("comment_submit").value=this.Base.Language.Translate(833);
$("comment_submit").disabled=false
}
else
{$("comment_error").style.display="none";
$("comment_error_message").innerHTML="";
$("comment_body").value="";
$("comment_body").style.height=this.options.originalHeight+"px";
this.addText($("comment_body"));
$("comment_submit").value=this.Base.Language.Translate(833);
$("comment_submit").disabled=false;
if($("comment_secure"))
{
$("comment_secure").value="";
$("secure_image").src=$("secure_image").src+"?"+(new Date()).getTime()
}this.page=1;
this.total++;
this.getComments()
}
},editComment:function(c)
{
$('comment_edit_link_'+c).style.display="none";
$('comment_edit_save_'+c).style.display="inline";
var f=this;
if(this.isEditing)
{
return false
}
this.isEditing=true;
var b=$("profile_comment_body_"+c);
var a=b.offsetHeight+10;
var d=b.innerHTML.replace(/<br>/gi,"\r\n").replace(/>/gi,">");
var e="";
e+="<form action='misc_js.php' method='post' target='ajaxframe' name='editCommentForm'>";
e+="<textarea name='comment_edit' id='comment_edit_"+c+"' style='height: "+a+" px;width: 100%;'>"+d+"</textarea>";
e+="<input type='hidden' name='task' value='comment_edit' />";
e+="<input type='hidden' name='comment_id' value='"+c+"' />";
e+="<input type='hidden' name='type' value='"+this.options.type+"' />";
e+="<input type='hidden' name='iden' value='"+this.options.typeIdentifier+"' />";
e+="<input type='hidden' name='value' value='"+this.options.typeID+"' />";
if(this.options.typeTab)
{
e+='<input type="hidden" name="tab" value="'+this.options.typeTab+'" />'
}
if(this.options.typeCol)
{
e+='<input type="hidden" name="col" value="'+this.options.typeCol+'" />'
}
if(this.options.typeTabParent)
{
e+='<input type="hidden" name="tab_parent" value="'+this.options.typeTabParent+'" />'
}
if(this.options.typeColParent)
{
e+='<input type="hidden" name="col_parent" value="'+this.options.typeColParent+'" />'
}
if(this.options.typeChild)
{
e+='<input type="hidden" name="child" value="1" />'
}
e+="</form>";
b.innerHTML=e;
textarea_autogrow("comment_edit_"+c);
$("comment_edit_"+c).focus();
$("comment_edit_"+c).addEvent("blur",function()
{
f.doCommentEdit();
f.isEditing=false
})
},confirmDelete:function(a)
{
$("del_comment_id").value=a;
TB_show(this.Base.Language.Translate(1025),"#TB_inline?height=120&width=300&inlineId=confirmcommentdelete","","/images/trans.gif");
var b=this;
$("TB_window").getElement("form").name="commentDeleteForm";
$("TB_window").getElement("form").addEvent("submit",function(c)
{
b.doCommentDelete(c,a)
})
},removeText:function(a)
{
if(!this.changed)
{
a.value="";
a.style.color="#000000";
this.changed=true
}
},addText:function(a)
{
if(!a.value.trim())
{
a.value=this.Base.Language.Translate(829);
a.style.color="#7A8077";
this.changed=false
}
},checkText:function(a)
{
if(!this.changed)
{
$("comment_body").value=""
}$("comment_submit").value=this.Base.Language.Translate(830);
$("comment_submit").disabled=true
}
});
SocialEngineAPI.Core=new Class({Base:{
},settings:{
},plugins:{
},options:{ajaxURL:"js_api.php"
},initialize:function()
{
},ImportSettings:function(a)
{
this.settings=a
},ImportPlugins:function(a)
{
this.plugins=a
}
});
if(typeof(SocialEngineAPI)=="undefined")
{
var SocialEngineAPI={
}
}SocialEngineAPI.Language=new Class({Base:{
},initialize:function()
{
this.languageVariables=new Hash()
},Translate:function(b)
{
var a=this.languageVariables.get(b)||"Missing Language Variable #"+b;
return a
},TranslateFormatted:function(d,c)
{
var b=this.languageVariables.get(d)||"Missing Language Variable #"+d;
c.unshift(b);
var a=sprintf.run(c);
return a
},Import:function(a)
{
if($type(a)=="object")
{
this.languageVariables.extend(a)
}
}
});
var SocialEngineLanguage=SocialEngineAPI.Language;
SocialEngineAPI.URL=new Class({Base:{
},url_base:null,url_info:{
},initialize:function()
{
},url_create:function(c,a,e,d,b)
{
var f=(SocialEngine.Core.settings.setting_url?this.url_info[c].url_subdirectory:this.url_info[c].url_regular);
if(!f)
{
return false
}f=f.replace("$user",a);
f=f.replace("$id1",e);
f=f.replace("$id2",d);
f=f.replace("$id3",b);
return this.url_base+f
},url_userdir:function(a)
{
return"uploads_user/"+(a+999-((a-1)%1000)).toString()+"/"+a+"/"
},ImportURLBase:function(a)
{
this.url_base=a
},ImportURLInfo:function(a)
{
this.url_info=a
}
});
SocialEngineAPI.User=new Class({Base:{
},user_exists:false,user_displayname:false,user_displayname_short:false,user_info:{
},profile_info:{
},level_info:{
},usersetting_info:{
},options:{ajaxURL:"misc_js.php",ajaxMethod:"post",ajaxSecure:false,displayname_order:"standard"
},user_status:"",user_notify_cookie:{
},user_notify_count:0,initialize:function()
{
},userPhotoFullPath:function()
{
if(!this.Base.URL)
{
return false
}if(!this.user_info.user_photo)
{
return this.Base.URL.url_base+"images/wlp/nophotoThumb.gif"
}return this.Base.URL.url_base+this.Base.URL.url_userdir(this.user_info.user_id)+this.user_info.user_photo
},userStatusChange:function()
{
if(!$('ajax_status'))return false;
var userStatus=this.user_status.replace(/<wbr>/g,'').replace(/&shy;/g,'');
var statusHTML=this.user_displayname_short+" <div class='inputOuterBorder'><input type='text' name='status_new' id='status_new' maxlength='100' value='";
//var statusHTML="<div class='inputOuterBorder'><input type='text' name='status_new' id='status_new' maxlength='100' value='";
statusHTML+=(userStatus==''?this.Base.Language.Translate(744):userStatus);
statusHTML+="' onkeypress='return ((new Event(event)).key==\"enter\" ? SocialEngine.Viewer.userStatusChangeSubmit() : true);'>"+"</div>"+"<p class='option'><a href='javascript:void(0);' onclick='SocialEngine.Viewer.userStatusChangeSubmit();return false;' style='background-image: url(images/wlp/icons/save_personal_message.gif);'>"+this.Base.Language.Translate(746)+"</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:void(0);' onclick='SocialEngine.Viewer.userStatusChangeReturn();return false;' style='background-image: url(images/wlp/icons/icon_save_personal_abort.gif);'>"+this.Base.Language.Translate(747)+"</a></p>";
$('ajax_status').innerHTML=statusHTML;
$('status_new').focus();
$('status_new').select();
},userStatusChangeReturn:function()
{
if(!$('ajax_status'))return false;
if(this.user_status=='')
{
$('ajax_status').innerHTML="<p class='option'><a href='javascript:void(0);' onClick='SocialEngine.Viewer.userStatusChange();return false;' "+"style='background-image: url(images/wlp/icons/edit_personal_message.gif);'> "+this.Base.Language.Translate(743)+"</a></p>";}
else
{$('ajax_status').innerHTML="<p id='ajax_currentstatus_value'>"+this.user_displayname_short+" "+this.user_status+"</p>"+"<p class='option'><a href='javascript:void(0);' style='background-image: url(images/wlp/icons/edit_personal_message.gif);' "+"onClick='SocialEngine.Viewer.userStatusChange();return false;'>"+this.Base.Language.Translate(745)+"</a></p>";
//$('ajax_status').innerHTML="<p id='ajax_currentstatus_value'>"+this.user_status+"</p>"+"<p class='option'><a href='javascript:void(0);' style='background-image: url(images/wlp/icons/edit_personal_message.gif);' "+"onClick='SocialEngine.Viewer.userStatusChange();return false;'>"+this.Base.Language.Translate(745)+"</a></p>";
}
},userStatusChangeSubmit:function()
{
if(!$("ajax_status"))
{
return false
}
var b=this;
var a=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"status_change",status:$("status_new").value
},onComplete:function(c,d)
{
b.user_status=c.status;
b.userStatusChangeReturn()
}
}).send()
},userDelete:function()
{
TB_show(this.Base.Language.Translate(759),"#TB_inline?height=100&width=300&inlineId=confirmdelete","","/images/trans.gif")
},userDeleteConfirm:function(b)
{
var c=this;
var a=new Request.JSON({url:"user_account_delete.php",method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"dodelete",token:b
},onComplete:function(d,e)
{
window.location="home.php"
}
}).send()
},userActionDelete:function(a)
{
var c=this;
var b=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"action_delete",action_id:a
},onComplete:function(d,e)
{
if($("action_"+a))
{
$("action_"+a).style.display="none";
total_actions--;
if(total_actions==0)
{
$("actions").style.display="none"
}
}
}
}).send()
},userNotifyShow:function()
{
this.user_notify_cookie=new Hash.Cookie("se_show_newupdates");
var a=parseInt(this.user_notify_cookie.get("total"));
if(!$type(a))
{
a=0
}
if(a<this.user_notify_count)
{
this.user_notify_cookie.set("total",0);
$("newupdates").style.display="block";
}
},userNotifyPopup:function()
{
TB_show(this.Base.Language.Translate(1198),"#TB_inline?height=150&width=300&inlineId=newupdates_popup","","/images/trans.gif");
ReloadIVWImage();
},userNotifyUpdate:function()
{
var b=this;
var a=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"notify_get"
},onComplete:function(c,d)
{
b.userNotifyGenerate(c);
b.userNotifyShow()
}
}).send()
},userNotifyGenerate:function(a)
{
if(!$type(a.notifys)||a.notifys.length==0||!$("newupdates_popup"))
{
$("notify_total").innerHTML=this.user_notify_count=0;
return
}
$("notify_total").innerHTML=this.user_notify_count=a.total;
var b="<div id='TB_contentArea'>";
b+="<div id='TB_noProperties'>";
b+="<p><strong>"+this.Base.Language.TranslateFormatted(1199,["<span id='notifyscount'>"+this.user_notify_count+"</span>"])+"</strong></p>";
b+="<div class='userNotifyEntries'>";
a.notifys.each(function(c)
{
b+="<div class='userNotifyEntry' id='notify_"+c.notifytype_id+"_"+c.notify_grouped+"'>"
b+="<p><a href='/"+c.notify_url+"' style='background-image: url(/images/icons/"+c.notify_icon+");'>"+c.notify_text_output+"</a></p>"
b+="<a href='javascript:void(0);' onClick=\"SocialEngine.Viewer.userNotifyDelete('"+c.notifytype_id+"', '"+c.notify_grouped+"');\">"
b+="<img src='/images/wlp/icons/ico_decline.gif' alt='' />";
b+="</a>";
b+="<div class='clearer'></div>";
b+="</div>";
});
b+="</div>"
b+="</div>"
b+="</div>"
b+="<div class='seperatorOuter'>"
b+="<div class='seperatorInner'></div>"
b+="</div>"
$("newupdates_popup").innerHTML=b;

},userNotifyDelete:function(a,c)
{
var d=this;
var b=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"notify_delete",notifytype_id:a,notify_grouped:c
},onComplete:function(e,f)
{
$("TB_window").getElements("div[id=notify_"+a+"_"+c+"]").each(function(g)
{
if(g.id=="notify_"+a+"_"+c)
{
g.style.display="none";
d.user_notify_count--
}
});
$("newupdates_popup").getElements("div[id=notify_"+a+"_"+c+"]").each(function(g)
{
if(g.id=="notify_"+a+"_"+c)
{
g.style.display="none"
}
});
$("notify_total").innerHTML=d.user_notify_count;
$("TB_window").getElements("span[id=notifyscount]").each(function(g)
{
if(g.id=="notifyscount")
{
g.innerHTML=d.user_notify_count
}
});
if(d.user_notify_count==0)
{
TB_remove();
$("newupdates").style.display="none"
}
}
}).send()
},userNotifyHide:function()
{
$("newupdates").style.display="none";
this.user_notify_cookie.set("total",this.user_notify_count)
},userPhotoRemove:function()
{
var b=this;
var a=new Request.JSON({url:"user_editprofile_photo.php",method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{task:"remove"
}
}).send();
if($("userEditRemovePhotoLink")&&$("userEditPhotoImg"))
{
$("userEditRemovePhotoLink").destroy();
$("userEditPhotoImg").src="images/wlp/nophotoThumb.gif"
}
else
{window.location.reload(false)
}
},ImportUserInfo:function(a)
{
if(!a||$type(a)!="object"||!a.user_exists)
{
this.user_exists=false;
return
}
this.user_exists=true;
a.user_id=parseInt(a.user_id);
delete a.user_exists;
this.user_info=a;
this.user_info.user_fname=this.user_info.user_fname.trim();
this.user_info.user_lname=this.user_info.user_lname.trim();
if(this.user_info.user_fname&&this.user_info.user_lname)
{
if(this.options.displayname_order=="asian")
{
this.user_displayname_short=this.user_info.user_lname;
this.user_displayname=this.user_info.user_lname+" "+this.user_info.user_fname
}
else
{this.user_displayname_short=this.user_info.user_fname;
this.user_displayname=this.user_info.user_fname+" "+this.user_info.user_lname
}
}
else
{if(this.user_info.user_fname)
{
this.user_displayname=this.user_displayname_short=this.user_info.user_fname
}
else
{if(this.user_info.user_lname)
{
this.user_displayname=this.user_displayname_short=this.user_info.user_lname
}
else
{if(this.user_info.user_username)
{
this.user_displayname=this.user_displayname_short=this.user_info.user_username
}
}
}
}
}
});
SocialEngineAPI.Tags=new Class({Implements:[Options],Base:{
},isTagging:false,newtag:false,tags:[],options:{'ajaxURL':'misc_js.php','ajaxMethod':'post','ajaxSecure':false,'canTag':false,'type':false,'media_id':false,'media_dir':false,'object_owner':false,'object_owner_id':false
},initialize:function(options)
{
this.setOptions(options);
if(this.options.initialTotal)this.total=this.options.initialTotal;
var bind=this;
window.addEvent('domready',function()
{
bind.showTagForm();
});
},showTagForm:function()
{
var innerHTML="";
var bind=this;
if(this.options.canTag)
{
innerHTML+="<div class='media_photo_tagform_titlebar'>"+this.Base.Language.Translate(1212)+"</div>"+"<div class='media_photo_content'>"+"<div class='media_photo_description'>"+"<p style='margin-bottom: 10px;'>W&auml;hle einen Namen aus der Liste aus:</p>"+"</div>"+"<div id='media_photo_friendlist' class='media_photo_friendlist'>";
if(bind.Base.Viewer.user_exists)
{
innerHTML+="<div><a href='javascript:void(0)' id='tag_me'>"+bind.Base.Viewer.user_displayname+bind.Base.Language.Translate(1214)+"</a></div>";
}
innerHTML+="</div>"+"<div class='media_photo_description'>"+"<p style='margin-bottom: 10px;'><strong>...ODER...</strong></p>"+"<p style='margin-bottom: 10px;'>"+this.Base.Language.Translate(1213)+"</p>"+"</div>"+"<div class='media_photo_input'>"+"<input type='text' name='media_photo_tag' id='media_photo_tag' maxlength='40' />"+"</div>"+"<div class='media_photo_submits'>"+"<div class='submit submit1'>"+"<input type='image' alt='"+bind.Base.Language.Translate(1215)+"' name='save' id='tag_save' src='/images/wlp/buttons/save_2px.gif' />"+"</div>"+"<div class='submit submit2'>"+"<input type='image' alt='"+bind.Base.Language.Translate(39)+"' id='tag_cancel' name='cancel' src='/images/wlp/buttons/cancel_2px.gif' />"+"</div>"+"<div class='clearer'></div>"+"</div>"+"</div>";
var newTagForm=new Element('div',{'id':'media_photo_tagform','class':'media_photo_tagform','html':innerHTML
});
var mediaContainer=$('media_photo_div');
newTagForm.inject(mediaContainer);
if(newTagForm.getElement('input[id=tag_cancel]'))newTagForm.getElement('input[id=tag_cancel]').addEvent('click',function()
{
bind.cancelTag();
});
if(newTagForm.getElement('input[id=tag_save]'))newTagForm.getElement('input[id=tag_save]').addEvent('click',function()
{
bind.saveTag(0);
});
if(newTagForm.getElement('a[id=tag_me]'))newTagForm.getElement('a[id=tag_me]').addEvent('click',function()
{
bind.saveTag(bind.Base.Viewer.user_info.user_id);
});
var request=new Request.JSON({url:'misc_js.php?task=friends_all',secure:this.options.ajaxSecure,onComplete:function(jsonObj)
{
bind.addFriendToList(jsonObj.friends);
}
}).send();
}
},addFriendToList:function(friends)
{
var bind=this;
friends.each(function(friend)
{
for(var x in friend)
{
var newDiv=new Element("div",{'id':'friend_div_'+x
});
var newAnchor=new Element("a",{'href':'javascript:void(0)','id':'friend_link_'+x,'html':friend[x]
}).inject(newDiv);
newDiv.inject($('media_photo_friendlist'));
$('friend_link_'+x).addEvent('click',function()
{
bind.saveTag(x);
});
}
});
},insertTag:function(tag_id,tag_link,tag_text,tag_x,tag_y,tag_width,tag_height,tagged_user,tagger_user)
{
var newHTML='';
var bind=this;
if($('media_tags').style.display=='none')
{
$('media_tags').style.display='block';
}else if(bind.tags.length!=0)
{
newHTML='<span id="tag_comma_'+tag_id+'">, </span>';
}
var newSpan=new Element("span",{'id':'full_tag_'+tag_id,'html':newHTML
});
if(tag_link!='')
{
var newAnchor=new Element("a",{'href':tag_link,'id':'tag_link_'+tag_id,'html':tag_text
}).inject(newSpan);
}
else
{var newAnchor=new Element("span",{'id':'tag_link_'+tag_id,'html':tag_text,'styles':{'cursor':'pointer'
}
}).inject(newSpan);
}
if(bind.Base.Viewer.user_exists&&(bind.Base.Viewer.user_info.user_username==tagged_user||bind.Base.Viewer.user_info.user_username==bind.Base.Owner.user_info.user_username||bind.Base.Viewer.user_info.user_id==tagger_user))
{
var media_tags_text=$(newSpan).get('html');
$(newSpan).set('html',media_tags_text,' <a href=\'javascript:void(0);\' id=\'new_removetag_link\'><img src="./images/wlp/icons/action_delete3.gif"></a>');}
newSpan.inject($('media_tags'));
bind.createTag(tag_id,tag_text,tag_x,tag_y,tag_width,tag_height);
$('tag_link_'+tag_id).addEvent('mouseover',function()
{
bind.showTag(tag_id);
});
$('tag_link_'+tag_id).addEvent('mouseout',function()
{
bind.hideTag(tag_id);
});
if($('new_removetag_link'))
{
$('new_removetag_link').addEvent('click',function()
{
bind.removeTag(tag_id);
});
$('new_removetag_link').set('id','removetag_link_'+tag_id);
}
bind.tags.push(tag_id);
},createTag:function(tag_id,label_text,tag_x,tag_y,tag_width,tag_height)
{
var bind=this;
new Element("div",{'id':'tag_'+tag_id,'html':'<img src="/images/trans.gif" width="100%" height="100%" />','class':'tag_div_hidden','styles':{'width':(parseInt(tag_width)-4)+'px','height':(parseInt(tag_height)-4)+'px','top':tag_x+'px','left':tag_y+'px'
}
}).inject($('media_photo_div'));
new Element("div",{'id':'tag_label_'+tag_id,'html':label_text,'class':'tag_label','styles':{'display':'none','top':(parseInt(tag_x)+parseInt(tag_height)+10)+'px','left':tag_y+'px'
}
}).inject($('media_photo_div'));
$('tag_'+tag_id).addEvent('mouseover',function()
{
bind.showTag(tag_id);
});
$('tag_'+tag_id).addEvent('mouseout',function()
{
bind.hideTag(tag_id);
});
},showTag:function(tag_id)
{
$('tag_'+tag_id).className='tag_div';
$('tag_label_'+tag_id).style.display='block';
},hideTag:function(tag_id)
{
$('tag_'+tag_id).className='tag_div_hidden';
$('tag_label_'+tag_id).style.display='none';
},addTag:function()
{
if(!this.isTagging)
{
this.isTagging=true;
this.newtag=new MooCrop('media_photo');
var bind=this;
var indicator=$('media_photo_tagform').inject(bind.newtag.wrapper);
indicator.setStyles({'top':this.newtag.crop.bottom+10,'left':this.newtag.crop.right+10,'display':'block'
});
this.newtag.addEvent('onBegin',function(imgsrc,crop,bound,hanlde)
{
indicator.setStyle('display','none');
});
this.newtag.addEvent('onCrop',function(imgsrc,crop,bound,hanlde)
{
indicator.setStyles({'top':crop.bottom+10,'left':crop.right+10,'display':'none'
});
});
this.newtag.addEvent('onComplete',function(imgsrc,crop,bound,hanlde)
{
indicator.setStyle('display','block');
});
}
},cancelTag:function()
{
if(this.isTagging)
{
$('media_photo_tag').value='';
$('media_photo_tagform').inject('media_photo_div').setStyle('display','none');
var stopTagging=this.newtag.removeOverlay.bind(this.newtag);
stopTagging();
this.isTagging=false;
}
},saveTag:function(mediatag_user_id)
{
if(this.isTagging)
{
if(this.options.object_owner&&this.options.object_owner_id)
{
var object_owner=this.options.object_owner;
var object_owner_id=this.options.object_owner_id;
var user='';
}
else
{var object_owner='';
var object_owner_id='';
var user=this.Base.Owner.user_info.user_username;
}
var bind=this;
var request=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{'task':'tag_do','ajax':true,'mediatag_user_id':mediatag_user_id,'mediatag_text':$('media_photo_tag').value,'mediatag_x':this.newtag.crop.top,'mediatag_y':this.newtag.crop.left,'mediatag_height':this.newtag.crop.height,'mediatag_width':this.newtag.crop.width,'user':user,'object_owner':object_owner,'object_owner_id':object_owner_id,'type':this.options.type,'media_id':this.options.media_id,'media_dir':this.options.media_dir
},onComplete:function(jsonObj)
{
if($type(jsonObj.mediatag_id))
{
bind.insertTag(jsonObj.mediatag_id,jsonObj.mediatag_link,jsonObj.mediatag_text,jsonObj.mediatag_x,jsonObj.mediatag_y,jsonObj.mediatag_width,jsonObj.mediatag_height,jsonObj.mediatag_user_username,bind.Base.Viewer.user_info.user_id);
}
}
}).send();
$('media_photo_tag').value='';
$('media_photo_tagform').inject('media_photo_div').setStyle('display','none');
var stopTagging=this.newtag.removeOverlay.bind(this.newtag);
stopTagging();
this.isTagging=false;
}
},removeTag:function(tag_id)
{
if(this.options.object_owner&&this.options.object_owner_id)
{
var object_owner=this.options.object_owner;
var object_owner_id=this.options.object_owner_id;
var user='';
}
else
{var object_owner='';
var object_owner_id='';
var user=this.Base.Owner.user_info.user_username;
}
var bind=this;
var request=new Request.JSON({url:this.options.ajaxURL,method:this.options.ajaxMethod,secure:this.options.ajaxSecure,data:{'task':'tag_remove','ajax':true,'mediatag_id':tag_id,'user':user,'object_owner':object_owner,'object_owner_id':object_owner_id,'type':this.options.type,'media_id':this.options.media_id
}
}).send();
$('tag_'+tag_id).destroy();
$('tag_label_'+tag_id).destroy();
$('full_tag_'+tag_id).destroy();
if(this.tags.indexOf(tag_id)==0&&$('tag_comma_'+this.tags[1]))
{
$('tag_comma_'+this.tags[1]).destroy();
}
this.tags.splice(this.tags.indexOf(tag_id),1);
if(this.tags.length==0)
{
$('media_tags').style.display='none';
}
}
});
var MooCrop=new Class({Implements : [Options,Events],calculateHandles:true,current:{
},options:{maskColor:'black',maskOpacity:'.3',handleColor:'#FFFFFF',handleWidth:'5px',handleHeight:'5px',cropBorder:'1px dashed #FFFFFF',min:{'width':50,'height':50
},showMask:true,showHandles:false
},initialize:function(el,options)
{
this.setOptions(options);
this.img=$(el);
if(this.img.get('tag')!='img')return false;
this.resizeFunc=this.refresh.bindWithEvent(this);
this.removeFunc=this.removeListener.bind(this);
this.buildOverlay();
this.setup();
},setup:function()
{
$(this.cropArea).setStyles({'width':this.options.min.width,'height':this.options.min.height,'top':(this.img.height-this.options.min.height)/2,'left':(this.img.width-this.options.min.width)/2
});
this.current.crop=this.crop=this.getCropArea();
this.handleWidthOffset=this.options.handleWidth.toInt()/2;
this.handleHeightOffset=this.options.handleHeight.toInt()/2;
this.fixBoxModel();
this.drawMasks();
this.positionHandles();
},getCropArea:function()
{
var crop=this.cropArea.getCoordinates();
crop.left-=this.offsets.x;
crop.right-=this.offsets.x;
crop.top-=this.offsets.y;
crop.bottom-=this.offsets.y;
return crop;
},fixBoxModel:function()
{
var diff=this.boxDiff=(this.crop.width-this.options.min.width)/2;
var b=this.bounds={'top':diff,'left':diff,'right':this.img.width+(diff*2),'bottom':this.img.height+(diff*2),'width':this.options.min.width+(diff*2),'height':this.options.min.height+(diff*2)
};
this.wrapper.setStyles({'width':b.right,'height':b.bottom,'background':'url('+this.img.src+') no-repeat '+diff+'px '+diff+'px'
});
this.north.setStyle('width',b.right);
this.south.setStyle('width',b.right);
},activate:function(event,handle)
{
event.stop();
this.current={'x':event.page.x,'y':event.page.y,'handle':handle,'crop':this.current.crop
};
if(this.current.handle=='NESW'&&!this.options.showHandles)this.hideHandles();
this.fireEvent('onBegin',[this.img.src,this.getCropInfo(),this.bounds,handle]);
document.addEvent('mousemove',this.resizeFunc);
document.addEvent('mouseup',this.removeFunc);
},removeListener:function()
{
if(this.current.handle=='NESW'&&!this.options.showHandles)this.showHandles();
document.removeEvent('mousemove',this.resizeFunc);
document.removeEvent('mouseup',this.removeFunc);
this.crop=this.current.crop;
this.fireEvent('onComplete',[this.img.src,this.getCropInfo(),this.bounds,this.current.handle]);
},refresh:function(event)
{
var xdiff=this.current.x-event.page.x;
var ydiff=this.current.y-event.page.y;
var b=this.bounds;
var c=this.crop;
var handle=this.current.handle;
var styles={
};
var dragging=(handle.length>2)?true:false;
if(handle.contains("S"))
{
if(c.bottom-ydiff>b.bottom)ydiff=c.bottom-b.bottom;
if(!dragging)
{
if((c.height-ydiff)<b.height)ydiff=c.height-b.height;
styles['height']=c.height-ydiff;
}
}
if(handle.contains("N"))
{
if(c.top-ydiff<b.top)ydiff=c.top;
if(!dragging)
{
if((c.height+ydiff)<b.height)ydiff=b.height-c.height;
styles['height']=c.height+ydiff;
}
styles['top']=c.top-ydiff;
}
if(handle.contains("E"))
{
if(c.right-xdiff>b.right)xdiff=c.right-b.right;
if(!dragging)
{
if((c.width-xdiff)<b.width)xdiff=c.width-b.width;
styles['width']=c.width-xdiff;
}
}
if(handle.contains("W"))
{
if(c.left-xdiff<b.left)xdiff=c.left;
if(!dragging)
{
if((c.width+xdiff)<b.width)xdiff=b.width-c.width;
styles['width']=c.width+xdiff;
}
styles['left']=c.left-xdiff;
}
var preCssStyles=$merge(styles);
if($defined(styles.width))styles.width-=this.boxDiff*2;
if($defined(styles.height))styles.height-=this.boxDiff*2;
this.cropArea.setStyles(styles);
this.getCurrentCoords(preCssStyles);
this.drawMasks();
this.positionHandles();
this.fireEvent('onCrop',[this.img.src,this.getCropInfo(),b,handle]);
},getCurrentCoords:function(changed)
{
var current=$merge(this.crop);
if($defined(changed.left))
{
current.left=changed.left;
if($defined(changed.width))current.width=changed.width;
else current.right=current.left+current.width;
}
if($defined(changed.top))
{
current.top=changed.top;
if($defined(changed.height))current.height=changed.height;
else current.bottom=current.top+current.height;
}
if($defined(changed.width)&&!$defined(changed.left))
{
current.width=changed.width;
current.right=current.left+current.width;
}
if($defined(changed.height)&&!$defined(changed.top))
{
current.height=changed.height;
current.bottom=current.top+current.height;
}
this.current.crop=current;
},drawMasks:function()
{
if(!this.options.showMask)return;
var b=this.bounds;
var c=this.current.crop;
var handle=this.current.handle;
this.north.setStyle('height',c.top+'px');
this.south.setStyle('height',b.bottom-c.bottom+'px');
this.east.setStyles({height:c.height+'px',width:b.right-c.right+'px',top:c.top+'px',left:c.right+'px'
});
this.west.setStyles({height:c.height+'px',width:c.left+'px',top:c.top+'px'
});
},positionHandles:function()
{
if(!this.calculateHandles)return;
var c=this.current.crop;
var wOffset=this.handleWidthOffset;
var hOffset=this.handleHeightOffset;
this.handles.get('N').setStyles({'left':c.width/2-wOffset+'px','top':-hOffset+'px'
});
this.handles.get('NE').setStyles({'left':c.width-wOffset+'px','top':-hOffset+'px'
});
this.handles.get('E').setStyles({'left':c.width-wOffset+'px','top':c.height/2-hOffset+'px'
});
this.handles.get('SE').setStyles({'left':c.width-wOffset+'px','top':c.height-hOffset+'px'
});
this.handles.get('S').setStyles({'left':c.width/2-wOffset+'px','top':c.height-hOffset+'px'
});
this.handles.get('SW').setStyles({'left':-wOffset+'px','top':c.height-hOffset+'px'
});
this.handles.get('W').setStyles({'left':-wOffset+'px','top':c.height/2-hOffset+'px'
});
this.handles.get('NW').setStyles({'left':-wOffset+'px','top':-hOffset+'px'
});
},hideHandles:function()
{
this.calculateHandles=false;
this.handles.each(function(handle)
{
handle.setStyle('display','none');
});
},showHandles:function()
{
this.calculateHandles=true;
this.positionHandles();
this.handles.each(function(handle)
{
handle.setStyle('display','block');
});
},buildOverlay:function()
{
var o=this.options;
this.wrapper=new Element("div",{'styles':{'z-index':100,'position':'relative','width':this.img.width,'height':this.img.height,'background':'url('+this.img.src+') no-repeat','float':this.img.getStyle('float'),'margin-left':'auto','margin-right':'auto'
}
}).injectBefore(this.img);
this.img.setStyle('display','none');
this.offsets={x:this.wrapper.getLeft(),y:this.wrapper.getTop()
};
this.wrapper.addEvent('mouseover',function(event)
{
return false;
});
if(this.options.showMask)
{
var maskStyles={'position':'absolute','overflow':'hidden','background-color':o.maskColor,'opacity':o.maskOpacity
};
this.north=new Element("div",{'styles':$merge(maskStyles,{'left':'0px'
})
}).injectInside(this.wrapper);
this.south=new Element("div",{'styles':$merge(maskStyles,{'bottom':'0px','left':'0px'
})
}).injectInside(this.wrapper);
this.east=new Element("div",{'styles':maskStyles
}).injectInside(this.wrapper);
this.west=new Element("div",{'styles':$merge(maskStyles,{'left':'0px'
})
}).injectInside(this.wrapper);
}
this.cropArea=new Element("div",{'styles':{'position':'absolute','top':'0px','left':'0px','border':o.cropBorder,'cursor':'move'
},'events':{'dblclick':function()
{
this.fireEvent('onDblClk',[this.img.src,this.getCropInfo(),this.bounds])
}.bind(this),'mousedown':this.activate.bindWithEvent(this,'NESW')
}
}).injectInside(this.wrapper);
this.handles=new Hash();
['N','NE','E','SE','S','SW','W','NW'].each(function(handle)
{
this.handles.set(handle,new Element("div",{'styles':{'position':'absolute','background-color':o.handleColor,'width':o.handleWidth,'height':o.handleHeight,'overflow':'hidden','cursor':(handle.toLowerCase()+'-resize')
},'events':{'mousedown':this.activate.bindWithEvent(this,handle)
}
}).injectInside(this.cropArea));
},this);
},getCropInfo:function()
{
var c=$merge(this.current.crop);
c.width-=this.boxDiff*2;
c.height-=this.boxDiff*2;
return c;
},removeOverlay:function()
{
this.wrapper.destroy();
this.img.setStyle('display','');
}
});
//MooCrop.Implement(new Events,new Options);
theObjects=document.getElementsByTagName("object");
for(var i=0;
i<theObjects.length;
i++)
{
theObjects[i].outerHTML=theObjects[i].outerHTML;
}
Function.prototype.bind=function(b)
{
var c=this,a=function()
{
return c.apply(b,arguments)
};
return(a)
};
SEMods=function()
{
};
SEMods.TextAreaControl=function(a)
{
this.obj=a;
this.obj.style.overflow="hidden",this.obj.style.color="#7A8077";
this.originalHeight=this.obj.getStyle("height").toInt();
var b=this.update.bind(this);
a.addEvent("focus",this.onFocus.bind(this));
a.addEvent("blur",this.onBlur.bind(this));
this.update()
};
SEMods.TextAreaControl.prototype={obj:null,updating:false,autoGrow:false,originalHeight:null,shadowElement:null,increment:0,timer:null,lastLength:0,setAutoGrow:function(a)
{
this.autoGrow=a;
this.createShadowElement();
this.update()
},onUpdate:function()
{
if(this.autoGrow&&this.lastLength!=this.obj.value.length)
{
this.lastLength=this.obj.value.length;
this.updateShadowElement();
this.obj.style.height=Math.max(this.originalHeight,this.shadowElement.offsetHeight+this.increment)+"px"
}
},beginUpdate:function()
{
if(this.updating)
{
return false
}this.updating=true;
return true
},endUpdate:function()
{
this.updating=false
},update:function()
{
if(!this.beginUpdate())
{
return
}this.onUpdate();
this.endUpdate()
},createShadowElement:function()
{
if(this.shadowElement)
{
return
}this.shadowElement=document.createElement("DIV");
this.shadowElement.style.position="absolute";
this.shadowElement.style.top="-99999px";
this.shadowElement.style.left="-99999px";
document.body.appendChild(this.shadowElement)
},updateShadowElement:function()
{
if(this.shadowElement)
{
text=this.obj.value+"<br>";
this.shadowElement.innerHTML=text.toString().replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br />");
var b=this.getPXMetrics(this.obj.getStyle("font-size"),10);
var a=this.obj.getStyle("line-height");
if((/Opera/i.test(navigator.userAgent)))
{
a=this.getPXMetrics(a,0)+3+"px"
}this.increment=b+10;
this.shadowElement.style.width=this.obj.offsetWidth+"px";
this.shadowElement.style.lineHeight=a;
this.shadowElement.style.fontSize=this.obj.getStyle("font-size");
this.shadowElement.style.fontFamily=this.obj.getStyle("font-family");
this.shadowElement.style.paddingLeft=this.obj.getStyle("padding-left");
this.shadowElement.style.paddingRight=this.obj.getStyle("padding-right")
}
},onFocus:function()
{
this.timer=setInterval(this.update.bind(this),500)
},onBlur:function()
{
if(this.timer)
{
clearInterval(this.timer);
this.timer=null
}
},getPXMetrics:function(c,b)
{
var a=parseFloat(c);
if(isNaN(a))
{
return b!=null?b:a
}return/px/i.test(c)?a:/pt/i.test(c)?1.3333*a:a
}
};
function textarea_autogrow(a)
{
var b=$(a);
if(b&&!b._controlled)
{
b._controlled=true;
new SEMods.TextAreaControl(b).setAutoGrow(true);
return b.getStyle("height").toInt()
}
};
if(typeof(bsn)=="undefined")
{
_b=bsn={
}
}if(typeof(_b.Autosuggest)=="undefined")
{
_b.Autosuggest={
}
}
else
{alert("Autosuggest is already set!")
}_b.AutoSuggest=function(e,d)
{
if(!document.getElementById)
{
return 0
}this.fld=_b.DOM.gE(e);
if(!this.fld)
{
return 0
}this.sInp="";
this.nInpC=0;
this.aSug=[];
this.iHigh=0;
this.oP=d?d:{
};
var a,b={minchars:1,meth:"get",varname:"input",className:"autosuggest",timeout:2500,delay:0,offsety:-5,shownoresults:true,noresults:"No results!",maxheight:250,cache:true,maxentries:25,blurtrigger:false,multisuggest:true
};
for(a in b)
{
if(typeof(this.oP[a])!=typeof(b[a]))
{
this.oP[a]=b[a]
}
}var c=this;
this.fld.onkeypress=function(f)
{
return c.onKeyPress(f)
};
this.fld.onkeyup=function(f)
{
return c.onKeyUp(f)
};
if(typeof(this.oP.callback)=="function"&&this.oP.blurtrigger)
{
this.fld.onblur=function(g) {
 if(document.activeElement&&typeof(g)==="undefined" ) {
	var f=document.activeElement
}  
if( typeof(g.explicitOriginalTarget)==="undefined" ) {
	var f= g.target;
} else {
	
	var f=g.explicitOriginalTarget;
	while(f.parentNode) {
		if(f.tagName=="A"&&typeof(f.id)=="string") {
			if(f.id.substring(0,10)=="bsnsuggest") {
				break
			}
		}
		f=f.parentNode
	}
	if(typeof(f.id)!="string") {
		f.id=""
	}
}
if(f.id.substring(0,10)!="bsnsuggest")
{
c.oP.callback({id:c.fld.value,value:c.fld.value
});
//c.clearSuggestions()
}
}
}this.fld.setAttribute("autocomplete","off")
};
_b.AutoSuggest.prototype.onKeyPress=function(f)
{
var e=(window.event)?window.event.keyCode:f.keyCode;
var d=13;
var c=9;
var g=27;
var b=186;
var a=1;
switch(e)
{
case d:if(this.aSug.length!=0&&this.iHigh)
{
this.setHighlightedValue();
a=false
}
else
{if(this.fld.value.length>0)
{
if(typeof(this.oP.callback)=="function")
{
this.clearSuggestions();
this.oP.callback({id:this.fld.value,value:this.fld.value
})
}a=false
}
else
{a=false
}
}break;
case g:this.clearSuggestions();
break
}return a
};
_b.AutoSuggest.prototype.onKeyUp=function(f)
{
var d=(window.event)?window.event.keyCode:f.keyCode;
var c=38;
var e=40;
var a=1;
switch(d)
{
case c:this.changeHighlight(d);
a=0;
break;
case e:this.changeHighlight(d);
a=0;
break;
default:var b=this.fld.value.split(/[;]+/ig);
this.getSuggestions(b[b.length-1])
}return a
};
_b.AutoSuggest.prototype.getSuggestions=function(g)
{
if(g==this.sInp)
{
return 0
}_b.DOM.remE(this.idAs);
this.sInp=g;
if(g.length<this.oP.minchars)
{
this.aSug=[];
this.nInpC=g.length;
return 0
}var d=this.nInpC;
this.nInpC=g.length?g.length:0;
var b=this.aSug.length;
if(this.nInpC>d&&b&&b<this.oP.maxentries&&this.oP.cache)
{
var a=[];
for(var e=0;
e<b;
e++)
{
if(this.aSug[e].value.substr(0,g.length).toLowerCase()==g.toLowerCase()||this.aSug[e].info.substr(0,g.length).toLowerCase()==g.toLowerCase())
{
a.push(this.aSug[e])
}
}this.aSug=a;
if(this.aSug.length<b)
{
var f=this;
var c=this.sInp;
clearTimeout(this.ajID);
this.ajID=setTimeout(function()
{
f.doAjaxRequest(c)
},this.oP.delay)
}
else
{this.createList(this.aSug)
}return false
}
else
{var f=this;
var c=this.sInp;
clearTimeout(this.ajID);
this.ajID=setTimeout(function()
{
f.doAjaxRequest(c)
},this.oP.delay)
}return false
};
_b.AutoSuggest.prototype.doAjaxRequest=function(c)
{
var e=this.fld.value.split(/[;]+/ig);
if(c!=e[e.length-1])
{
return false
}var h=this;
if(typeof(this.oP.script)=="function")
{
var d=this.oP.script(encodeURIComponent(this.sInp))
}
else
{var d=this.oP.script+this.oP.varname+"="+encodeURIComponent(this.sInp)
}if(!d)
{
return false
}var b=this.oP.meth;
var c=this.sInp;
var a=function(i)
{
h.setSuggestions(i,c)
};
var f=function(i)
{
};
var g=new _b.Ajax();
g.makeRequest(d,b,a,f)
};
_b.AutoSuggest.prototype.setSuggestions=function(req,input)
{
var new_value=this.fld.value.split(/[;]+/ig);
if(input!=new_value[new_value.length-1])
{
return false
}
this.aSug=[];
if(this.oP.json)
{
var jsondata=eval('('+req.responseText+')');
for(var i=0;
i<jsondata.results.length;
i++)
{
this.aSug.push({id:jsondata.results[i].id,value:jsondata.results[i].value,info:jsondata.results[i].info,photo:jsondata.results[i].photo,photo_width:jsondata.results[i].photo_width
})
}
}
else
{var xml=req.responseXML;
var results=xml.getElementsByTagName("results")[0].childNodes;
for(var i=0;
i<results.length;
i++)
{
if(results[i].hasChildNodes())
{
this.aSug.push({id:results[i].getAttribute("id"),value:results[i].childNodes[0].nodeValue,info:results[i].getAttribute("info")
})
}
}
}
this.idAs="as_"+this.fld.id;
this.createList(this.aSug)
};
_b.AutoSuggest.prototype.createList=function(b)
{
var r=this;
_b.DOM.remE(this.idAs);
this.killTimeout();
if(b.length==0&&!this.oP.shownoresults)
{
return false
}var m=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className
});
var e=_b.DOM.cE("div",{className:"as_corner"
});
var h=_b.DOM.cE("div",{className:"as_bar"
});
var t=_b.DOM.cE("div",{className:"as_header"
});
t.appendChild(e);
t.appendChild(h);
m.appendChild(t);
var l=_b.DOM.cE("ul",{id:"as_ul"
});
for(var u=0;
u<b.length;
u++)
{
var z=b[u].value;
var x=b[u].info;
var q=z.toLowerCase().indexOf(this.sInp.toLowerCase());
var c=x.toLowerCase().indexOf(this.sInp.toLowerCase());
if(q!=-1)
{
var j=z.substring(0,q)+"<em>"+z.substring(q,q+this.sInp.length)+"</em>"+z.substring(q+this.sInp.length);
var p=x
}
else
{var j=z;
var p=x.substring(0,c)+"<em>"+x.substring(q,c+this.sInp.length)+"</em>"+x.substring(c+this.sInp.length)
}if(z!=x)
{
j=p+" ("+j+")"
}var s=_b.DOM.cE("span",{
},j,true);
var n=_b.DOM.cE("img",{src:b[u].photo,width:b[u].photo_width,border:"0"
});
n.removeAttribute("height");
s.insertBefore(n,s.childNodes[0]);
var w=_b.DOM.cE("a",{href:"javascript:void(0);"});
var f=_b.DOM.cE("span",{className:"tl"
}," ");
var d=_b.DOM.cE("span",{className:"tr"
}," ");
w.appendChild(f);
w.appendChild(d);
w.appendChild(s);
w.name=u+1;
w.id="bsnsuggest_"+(u+1);
w.onclick=function()
{
r.setHighlightedValue();
return false
};
w.onmouseover=function()
{
r.setHighlight(this.name)
};
var k=_b.DOM.cE("li",{
},w);
l.appendChild(k)
}if(b.length==0&&this.oP.shownoresults)
{
var k=_b.DOM.cE("li",{className:"as_warning"
},this.oP.noresults);
l.appendChild(k)
}m.appendChild(l);
var v=_b.DOM.cE("div",{className:"as_corner"
});
var y=_b.DOM.cE("div",{className:"as_bar"
});
var o=_b.DOM.cE("div",{className:"as_footer"
});
o.appendChild(v);
o.appendChild(y);
m.appendChild(o);
var g=_b.DOM.getPos(this.fld);
m.style.left=g.x+"px";
m.style.top=(g.y+this.fld.offsetHeight+this.oP.offsety)+"px";
m.style.width=this.fld.offsetWidth+"px";
m.onmouseover=function()
{
r.killTimeout()
};
m.onmouseout=function()
{
r.resetTimeout()
};
document.getElementsByTagName("body")[0].appendChild(m);
this.iHigh=0;
var r=this;
this.toID=setTimeout(function()
{
r.clearSuggestions()
},this.oP.timeout)
};
_b.AutoSuggest.prototype.changeHighlight=function(a)
{
var b=_b.DOM.gE("as_ul");
if(!b)
{
return false
}var c;
if(a==40)
{
c=this.iHigh+1
}
else
{if(a==38)
{
c=this.iHigh-1
}
}if(c>b.childNodes.length)
{
c=b.childNodes.length
}if(c<1)
{
c=1
}this.setHighlight(c)
};
_b.AutoSuggest.prototype.setHighlight=function(b)
{
var a=_b.DOM.gE("as_ul");
if(!a)
{
return false
}if(this.iHigh>0)
{
this.clearHighlight()
}this.iHigh=Number(b);
a.childNodes[this.iHigh-1].className="as_highlight";
this.killTimeout()
};
_b.AutoSuggest.prototype.clearHighlight=function()
{
var a=_b.DOM.gE("as_ul");
if(!a)
{
return false
}if(this.iHigh>0)
{
a.childNodes[this.iHigh-1].className="";
this.iHigh=0
}
};
_b.AutoSuggest.prototype.setHighlightedValue=function()
{
if(this.iHigh)
{
var tmp= this.fld.value.split(/[;]+/ig);
var a;
if(tmp.length > 1)  {
	a = this.fld.value.split(/[;]+/ig);
	a.pop();
	a.push(this.aSug[this.iHigh-1].value);	
} else  {
	a = [this.fld.value];
}

if(this.oP.multisuggest)
{
var b=";"
}
else
{var b=""
}this.sInp=this.fld.value=a.join(";")+b;
this.fld.focus();
if(this.fld.selectionStart)
{
this.fld.setSelectionRange(this.sInp.length,this.sInp.length)
}if(typeof(this.oP.callback)=="function")
{
this.oP.callback(this.aSug[this.iHigh-1])
}this.clearSuggestions()
}
};
_b.AutoSuggest.prototype.killTimeout=function()
{
clearTimeout(this.toID)
};
_b.AutoSuggest.prototype.resetTimeout=function()
{
clearTimeout(this.toID);
var a=this;
this.toID=setTimeout(function()
{
a.clearSuggestions()
},1000)
};
_b.AutoSuggest.prototype.clearSuggestions=function()
{
this.killTimeout();
this.aSug=[];
var a=_b.DOM.gE(this.idAs);
var c=this;
if(a)
{
var b=new _b.Fader(a,1,0,250,function()
{
_b.DOM.remE(c.idAs)
})
}
};
if(typeof(_b.Ajax)=="undefined")
{
_b.Ajax={
}
}_b.Ajax=function()
{
this.req={
};
this.isIE=false
};
_b.Ajax.prototype.makeRequest=function(c,b,a,d)
{
if(b!="POST")
{
b="GET"
}this.onComplete=a;
this.onError=d;
var e=this;
if(window.XMLHttpRequest)
{
this.req=new XMLHttpRequest();
this.req.onreadystatechange=function()
{
e.processReqChange()
};
this.req.open("GET",c,true);
this.req.send(null)
}
else
{if(window.ActiveXObject)
{
this.req=new ActiveXObject("Microsoft.XMLHTTP");
if(this.req)
{
this.req.onreadystatechange=function()
{
e.processReqChange()
};
this.req.open(b,c,true);
this.req.send()
}
}
}
};
_b.Ajax.prototype.processReqChange=function()
{
if(this.req.readyState==4)
{
if(this.req.status==200)
{
this.onComplete(this.req)
}
else
{this.onError(this.req.status)
}
}
};
if(typeof(_b.DOM)=="undefined")
{
_b.DOM={
}
}_b.DOM.cE=function(g,c,b,f)
{
var h=document.createElement(g);
if(!h)
{
return 0
}for(var d in c)
{
h[d]=c[d]
}var e=typeof(b);
if(e=="string"&&!f)
{
h.appendChild(document.createTextNode(b))
}
else
{if(e=="string"&&f)
{
h.innerHTML=b
}
else
{if(e=="object")
{
h.appendChild(b)
}
}
}return h
};
_b.DOM.gE=function(c)
{
var a=typeof(c);
if(a=="undefined")
{
return 0
}
else
{if(a=="string")
{
var b=document.getElementById(c);
if(!b)
{
return 0
}
else
{if(typeof(b.appendChild)!="undefined")
{
return b
}
else
{return 0
}
}
}
else
{if(typeof(c.appendChild)!="undefined")
{
return c
}
else
{return 0
}
}
}
};
_b.DOM.remE=function(a)
{
var b=this.gE(a);
if(!b)
{
return 0
}
else
{if(b.parentNode.removeChild(b))
{
return true
}
else
{return 0
}
}
};
_b.DOM.getPos=function(c)
{
var c=this.gE(c);
var b=c;
var d=0;
if(b.offsetParent)
{
while(b.offsetParent)
{
d+=b.offsetLeft;
b=b.offsetParent
}
}
else
{if(b.x)
{
d+=b.x
}
}var b=c;
var a=0;
if(b.offsetParent)
{
while(b.offsetParent)
{
a+=b.offsetTop;
b=b.offsetParent
}
}
else
{if(b.y)
{
a+=b.y
}
}return{x:d,y:a
}
};
if(typeof(_b.Fader)=="undefined")
{
_b.Fader={
}
}_b.Fader=function(b,f,e,a,d)
{
if(!b)
{
return 0
}this.e=b;
this.from=f;
this.to=e;
this.cb=d;
this.nDur=a;
this.nInt=50;
this.nTime=0;
var c=this;
this.nID=setInterval(function()
{
c._fade()
},this.nInt)
};
_b.Fader.prototype._fade=function()
{
this.nTime+=this.nInt;
var a=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);
var c=a/100;
if(this.e.filters)
{
try{this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=a
}catch(b)
{
this.e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+a+")"
}
}
else
{this.e.style.opacity=c
}if(this.nTime==this.nDur)
{
clearInterval(this.nID);
if(this.cb!=undefined)
{
this.cb()
}
}
};
_b.Fader.prototype._tween=function(e,a,g,f)
{
return a+((g-a)*(e/f))
};
TB_WIDTH=0;
TB_HEIGHT=0;
var TB_doneOnce=0;
var TB_ready=false;
var TB_useReady=true;
function TB_init()
{
TB_ready=true;
$$("a.smoothbox").each(function(a)
{
a.onclick=TB_bind
})
}
window.addEvent("domready",TB_init);
var detectIE6=(navigator.userAgent.toLowerCase().indexOf('msie 6')!=-1)&&(navigator.userAgent.toLowerCase().indexOf('msie 7')==-1);
function TB_objectHide(open)
{
if(detectIE6==true)
{
if(open==true)
{
$(document.body).getElements('form.sectionSelection').setStyle('display','none');
$(document.body).getElements('form.selectOptions').setStyle('display','none');
$(document.body).getElements('#group_members_form').setStyle('display','none');
$(document.body).getElements('#event_members_form').setStyle('display','none');
}
else
{$(document.body).getElements('form.sectionSelection').setStyle('display','block');
$(document.body).getElements('form.selectOptions').setStyle('display','block');
$(document.body).getElements('#group_members_form').setStyle('display','block');
$(document.body).getElements('#event_members_form').setStyle('display','block');
}
}
}
function TB_bind(b)
{
if(TB_useReady&&!TB_ready)
{
return
}
var b=new Event(b);
b.preventDefault();
this.blur();
var a=this.title||this.name||"";
var c=this.rel||false;
TB_show(a,this.href,c);
this.onclick=TB_bind;
return false
}
function TB_show(j,b,k,e,h)
{
TB_objectHide(true);
if(TB_useReady&&!TB_ready)
{
return
}
if(!h)
{
h=0
}
if(!$("TB_overlay"))
{
(new Element("div").setProperty("id","TB_overlay")).inject($("smoothbox_container")||document.body);
$("TB_overlay").setOpacity(0.6);
TB_overlaySize()
}
if(!$("TB_window"))
{
(new Element("div").setProperty("id","TB_window")).inject($("smoothbox_container")||document.body);
$("TB_window").setOpacity(0)
}
else
{$("TB_window").destroy();
(new Element("div").setProperty("id","TB_window")).inject($("smoothbox_container")||document.body);
$("TB_window").setOpacity(0)
}
if(h==0)
{
$("TB_overlay").onclick=TB_remove
}
else
{$("TB_overlay").onclick=""
}
window.onscroll=TB_position;
var c=b.match(/(.+)?/)[1]||b;
var a=b.match(/\?(.+)/)[1];
var f=TB_parseQuery(a);
TB_WIDTH=(f.width*1)+30;
TB_HEIGHT=(f.height*1)+70;
var d=TB_WIDTH-30,i=TB_HEIGHT;
if(b.indexOf("TB_iframe")!=-1)
{
urlNoQuery=b.split("TB_");
$("TB_window").innerHTML+="<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+j+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>X</a></div><div class='clearer'></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"&in_smoothbox=true' id='TB_iframeContent' name='TB_iframeContent' scrolling='auto' style='width:"+(d+29)+"px;height:"+(i+17)+"px;' onload='TB_showWindow()'> </iframe>"
}
else
{$("TB_window").innerHTML+="<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+j+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>X</a></div><div class='clearer'></div></div><div id='TB_ajaxContent' style='height:"+i+"px;'></div>"
}
$("TB_closeWindowButton").onclick=TB_remove;
if(b.indexOf("TB_inline")!=-1)
{
$("TB_ajaxContent").innerHTML=($(f.inlineId).innerHTML);
TB_position();
TB_showWindow()
}
else
{if(b.indexOf("TB_iframe")!=-1)
{
TB_position();
if(frames.TB_iframeContent==undefined)
{
$(document).keyup(function(m)
{
var l=m.keyCode;
if(l==27)
{
TB_remove()
}
});
TB_showWindow()
}
}
else
{var g=function()
{
TB_position();
TB_showWindow()
};
new Request.HTML({method:"get",update:$("TB_ajaxContent"),onComplete:g
}).get(b)
}
}
window.onresize=function()
{
TB_position();
TB_overlaySize()
};
document.onkeyup=function(l)
{
var l=new Event(l);
if(l.code==27)
{
TB_remove()
}
}
}
function TB_showWindow()
{
if(TB_useReady&&!TB_ready)
{
return
}
if(TB_doneOnce==0)
{
TB_doneOnce=1;
$("TB_window").set("tween",{duration:250
});
$("TB_window").tween("opacity",0,1)
}
else
{$("TB_window").setStyle("opacity",1)
}
}
function TB_remove()
{
TB_objectHide(false);
if(TB_useReady&&!TB_ready)
{
return
}
$("TB_overlay").onclick=null;
document.onkeyup=null;
document.onkeydown=null;
if($("TB_closeWindowButton"))
{
$("TB_closeWindowButton").onclick=null
}
$("TB_window").set("tween",{duration:250,onComplete:function()
{
$("TB_window").destroy()
}
});
$("TB_window").tween("opacity",1,0);
$("TB_overlay").set("tween",{duration:400,onComplete:function()
{
$("TB_overlay").destroy()
}
});
$("TB_overlay").tween("opacity",0.6,0);
window.onscroll=null;
window.onresize=null;
TB_init();
TB_doneOnce=0;
return false
}
function TB_position()
{
if(TB_useReady&&!TB_ready)
{
return
}
$("TB_window").set("morph",{duration:75
});
$("TB_window").morph({width:TB_WIDTH+"px",left:(window.getScrollLeft()+(window.getWidth()-TB_WIDTH)/2)+"px",top:(window.getScrollTop()+(window.getHeight()-TB_HEIGHT)/2)+"px"
})
}
function TB_overlaySize()
{
if(TB_useReady&&!TB_ready)
{
return
}
$("TB_overlay").setStyles({height:"0px",width:"0px"
});
$("TB_overlay").setStyles({height:window.getScrollHeight()+"px",width:window.getScrollWidth()+"px"
})
}
function TB_parseQuery(c)
{
if(TB_useReady&&!TB_ready)
{
return
}
if(!c)
{
return{
}
}
var e={
};
var b=c.split(/[;&]/);
for(var a=0;
a<b.length;
a++)
{
var d=b[a].split("=");
if(!d||d.length!=2)
{
continue
}
e[unescape(d[0])]=unescape(d[1]).replace(/\+/g," ")
}
return e
};
function str_repeat(b,a)
{
for(var c=[];
a>0;
c[--a]=b)
{
}return(c.join(""))
}function sprintf()
{
var g=0,e,h=arguments[g++],k=[],d,j,l,b;
while(h)
{
if(d=/^[^\x25]+/.exec(h))
{
k.push(d[0])
}
else
{if(d=/^\x25{2}/.exec(h))
{
k.push("%")
}
else
{if(d=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(h))
{
if(((e=arguments[d[1]||g++])==null)||(e==undefined))
{
throw("Too few arguments.")
}if(/[^s]/.test(d[7])&&(typeof(e)!="number"))
{
throw("Expecting number but found "+typeof(e))
}switch(d[7])
{
case"b":e=e.toString(2);
break;
case"c":e=String.fromCharCode(e);
break;
case"d":e=parseInt(e);
break;
case"e":e=d[6]?e.toExponential(d[6]):e.toExponential();
break;
case"f":e=d[6]?parseFloat(e).toFixed(d[6]):parseFloat(e);
break;
case"o":e=e.toString(8);
break;
case"s":e=((e=String(e))&&d[6]?e.substring(0,d[6]):e);
break;
case"u":e=Math.abs(e);
break;
case"x":e=e.toString(16);
break;
case"X":e=e.toString(16).toUpperCase();
break
}e=(/[def]/.test(d[7])&&d[2]&&e>0?"+"+e:e);
l=d[3]?d[3]=="0"?"0":d[3].charAt(1):" ";
b=d[5]-String(e).length;
j=d[5]?str_repeat(l,b):"";
k.push(d[4]?e+j:j+e)
}
else
{throw("Huh ?!")
}
}
}h=h.substring(d[0].length)
}return k.join("")
};


var $j = jQuery.noConflict();
$j(document).ready(function(){
	// Hoehe des Viewports ermitteln und in eine Variable schreiben
	var viewportHeight = $j(window).height();
	// Hoehe des innerMaster-Containers ermitteln und in eine Variable schreiben
	var innerMasterHeight = $j(".shadow > .innerMaster").height();
	// Abfragen, ob die Hoehe des Viewports groesser als die des innerMaster-Containers ist.
	if (viewportHeight > innerMasterHeight) {
		// Pruefen, ob der IE6 verwendet wird.
		if ($j.browser.msie && $j.browser.version == 6.0) {
			// Dem innerMaster-Container die Hoehe des Viewports mit "height" geben.
			$j(".shadow > .innerMaster").css("height", viewportHeight);
		} else {
			// Dem innerMaster-Container die Hoehe des Viewports mit "min-height" geben.
			$j(".shadow > .innerMaster").css("min-height", viewportHeight);
		}
	}
});


// Call jQuery in noConflict-Mode, so it doesn't conflict with other Libraries. Change the $-call to a $j-call.
var $j = jQuery.noConflict();
// Variables for the Navigation to show/hide the first and second level.
var activeClass = "active";
var hideTime = 375;
var hideTimer = 0;
var hoverClass = "hover";
var initialActiveClass = "initActive";
var showTime = 500;
var showTimer = 0;
// Functions for the Navigation to show/hide the first and second level.
function hideLevels(id) {
	unsetHover(id);
	setActive(id);
	stopHideTimer();
}
function unsetActive(id) {
	$j("#"+id).parent().parent().find("a."+activeClass+", ul."+activeClass).removeClass(activeClass).addClass(initialActiveClass);
}
function unsetHover(id) {
	$j("#"+id).parent().parent().find("a."+hoverClass+", ul."+hoverClass).removeClass(hoverClass);
}
function setActive(id) {
	$j("#"+id).parent().parent().find("a."+initialActiveClass+", ul."+initialActiveClass).removeClass(initialActiveClass).addClass(activeClass);
}
function setHover(id) {
	$j("#"+id).addClass(hoverClass);
	$j("#"+id).parent().children().addClass(hoverClass);
}
function showLevels(id) {
	hideLevels(id);
	unsetActive(id);
	setHover(id);
}
function startHideTimer(id) {
	hideTimer = setTimeout(function() {
		hideLevels(id);
	}, hideTime);
}
function startShowTimer(id) {
	showTimer = setTimeout(function() {
		showLevels(id);
	}, showTime);
}
function stopHideTimer() {
	clearTimeout(hideTimer);
}
function stopShowTimer() {
	clearTimeout(showTimer);
}


// TEASERNAVIGATION TOGGLE -> START

// Call jQuery in noConflict-Mode, so it doesn't conflict with other Libraries. Change the $-call to a $j-call.
var $j = jQuery.noConflict();
function toggleTeaserNavigation(menuId){
	if($j(".subcats_"+menuId).css('display') == "none") {
		$j(".subcats_"+menuId).slideDown();
		$j("#cats_"+menuId).removeClass('plus').addClass('minus');
		
	} else {
		$j(".subcats_"+menuId).slideUp();
		$j("#cats_"+menuId).removeClass('minus').addClass('plus');
	}
}

// TEASERNAVIGATION TOGGLE -> END


// TABMENU -> START

// Call jQuery in noConflict-Mode, so it doesn't conflict with other Libraries. Change the $-call to a $j-call.
var $j = jQuery.noConflict();
// Set variables for the Tab-Menu
var tabIdPrequel = 'tab';
var contentIdPrequel = 'content';
function tabMenu(tabId) {
	
	if (typeof(visibleTab) == 'undefined' || tabId == visibleTab) {
		return false;
	}
	if ($j('#'+tabIdPrequel+tabId).is(':empty') == false){
		if( $j('#'+tabIdPrequel+tabId).hasClass('normalTab')){
			$j('#'+tabIdPrequel+tabId).removeClass('normalTab').addClass('activeTab');
		} else if ( $j('#'+tabIdPrequel+tabId).hasClass('firstTab')){
			$j('#'+tabIdPrequel+tabId).removeClass('firstTab').addClass('firstTabActive');
		} else if( $j('#'+tabIdPrequel+tabId).hasClass('lastTab')){
			$j('#'+tabIdPrequel+tabId).removeClass('lastTab').addClass('lastTabActive');
		}
		
		$j('#'+contentIdPrequel+tabId).css({'display':'block'});
		if( $j('#'+tabIdPrequel+tabId).is(':empty') == false) {
			if ( $j('#'+tabIdPrequel+visibleTab).hasClass('activeTab')){
				$j('#'+tabIdPrequel+visibleTab).removeClass('activeTab').addClass('normalTab');
			}
			if ( $j('#'+tabIdPrequel+visibleTab).hasClass('firstTabActive')){
				$j('#'+tabIdPrequel+visibleTab).removeClass('firstTabActive').addClass('firstTab');
			}
			if ( $j('#'+tabIdPrequel+visibleTab).hasClass('lastTabActive')){
				$j('#'+tabIdPrequel+visibleTab).removeClass('lastTabActive').addClass('lastTab');
			}
			$j('#'+contentIdPrequel+visibleTab).css({'display':'none'});
		}
		visibleTab = tabId;
		if(tabId.substring(0, 7) == 'Profile'){
			ReloadIVWImage();
		} else if(tabId == "group" || tabId == "members" || tabId == "pictures" || tabId == "discussions" || tabId == "comments"){		
			ReloadIVWImage();
		} else if(tabId.substring(0, 5) == 'Event'){
			ReloadIVWImage();
		} 
		
	}
}


function ReloadIVWImage(){
	var old_ivw = document.szmimages.src;
	var code = old_ivw.substring(37);
	var IVW="http://glam.ivwbox.de/cgi-bin/ivw/CP/" + code;
	document.szmimages.src = IVW+"?r="+escape(document.referrer)+"&d="+(Math.random()*100000);
}

// TABMENU -> END


// Function to resize images based on user- and default-settings.
(function($) {
	$.fn.extend({
		imageResize: function(options) {
			// Initialize default-variables:
			var defaults = {
				centerImage: 0,				// Defines if a image should be centered inside a fixed image-container. (Possible values: 0 => no (default), 1 => yes).
				maxHeight: 100,				// Defines the maximum-height for the image-resizing-process. (Possible values: n (default => 100).
				maxWidth: 100,				// Defines the maximum-width for the image-resizing-process. (Possible values: n (default => 100).
				upscaleImage: 0				// Defines if a image should be upscaled to fit a fixed image-container. (Possible values: 0 => no (default), 1 => yes).
			}

			// Initialize option-variables so the user can modify the default-settings:
			var options = $.extend(defaults, options);

			// Shorten option-variables-call for further code.
			var o = options;

			// Initialize flexible-variables:
			var flexibles = {
				newHeight: 0,			// Will contain the new height of the current image.
				newWidth: 0,			// Will contain the new width of the current image.
				originalHeight: 0,		// Will contain the original height of the current image.
				originalWidth: 0,		// Will contain the original width of the current image.
				resizeFactor: 0,		// Will contain the resize-factor of the current image.
				topMargin: 0			// Will contain the top-margin of the current image.
			}

			// Shorten flexible-variables-call for further code.
			var f = flexibles;

			// Loop over each matched element.
		 	this.each(function() {
		 		// Run master-function.
				imageResize(this);
			});

			// Master-Function to check which sub-function(s) should be used to resize the image accordingly.
			function imageResize(e) {
				// Reset container-variable.
				f.topMargin = 0;
				// Modify container-variables.
				f.originalHeight = $(e).find("img").height();		// Get original height of the current image.
				f.originalWidth = $(e).find("img").width();		// Get original width of the current image.
				// Check if the image should be upscaled.
				// Check if the original height/width of the image is smaller than the maximum available height/width for the image.
				if ((o.upscaleImage == 0) && (f.originalHeight < o.maxHeight) && (f.originalWidth < o.maxWidth)) {
					// Do not resize the image.
					noResize(e);
				} else {
					// Check if the original height of the image is greater than the original width of the image.
					 if (f.originalHeight > f.originalWidth) {
						 // Resize according to the height of the image.
						resizeViaHeight(e);
					} else {
						// Resize according to the width of the image.
						resizeViaWidth(e);
					}
				}
				// Adjust container-styles and image-styles.
				$(e).css("background-image", "none")
					.find("img").css("display", "block")
			}

			// Sub-Function to adjust image-styles using the calculated values from other sub-functions.
			function adjustImageStyles(e) {
				// Adjust image-styles.
				$(e).find("img")
					.css("margin-top", f.topMargin)
					.height(f.newHeight)
					.width(f.newWidth);
			}

			// Sub-Function to not resize the image.
			function noResize(e) {
				f.newHeight = f.originalHeight;		// Height for the image-resizing-process according to the orignal-height of the image.
				f.newWidth = f.originalWidth;		// Width for the image-resizing-process according to the orignal-width of the image.
				// Position the image properly.
				calculateMargin(e);
			}

			// Sub-Function to properly position the image in fixed image-containers using the calculated values from other sub-functions.
			function calculateMargin(e) {
				if (o.centerImage == 1) {
					// Fill variable.
					f.topMargin = Math.round((o.maxHeight-f.newHeight)/2);		// Calculated and rounded margin to top for the image.
				}
				// Adjust image-styles.
				adjustImageStyles(e);
			}

			// Sub-Function to resize the image according to the height of the image.
			function resizeViaHeight(e) {
				// Fill variables.
				f.newHeight = o.maxHeight;						// Height for the image-resizing-process according to the maximum-height for the image-resizing-process.
				f.resizeFactor = f.originalHeight/f.newHeight;				// Calculated resize-factor for the further image-resizing-process.
				f.newWidth = Math.round(f.originalWidth/f.resizeFactor);		// Calculated and rounded width for the image-resizing-process.
				// Countercheck if the calculated width is greater than maximum-width for the image-resizing-process.
				if (f.newWidth > o.maxWidth) {
					// Resize according to the width of the image.
					resizeViaWidth(e);
				} else {
					// Position the image properly.
					calculateMargin(e);
				}
			}

			// Sub-Function to resize the image according to the width of the image.
			function resizeViaWidth(e) {
				// Fill variables.
				f.newWidth = o.maxWidth;						// Width for the image-resizing-process according to the maximum-width for the image-resizing-process.
				f.resizeFactor = f.originalWidth/f.newWidth;				// Calculated resize-factor for the further image-resizing-process.
				f.newHeight = Math.round(f.originalHeight/f.resizeFactor);		// Calculated and rounded height for the image-resizing-process.
				// Countercheck if the calculated height is greater than maximum-height for the image-resizing-process.
				if (f.newHeight > o.maxHeight) {
					// Resize according to the height of the image.
					resizeViaHeight(e);
				} else {
					// Position the image properly.
					calculateMargin(e);
				}
			}
		}
	});
})(jQuery);


/*-------------------------------------------------------------------- 
 * JQuery Plugin: "EqualHeights" & "EqualWidths"
 * by:	Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
 *
 * Copyright (c) 2007 Filament Group
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Description: Compares the heights or widths of the top-level children of a provided element 
 		and sets their min-height to the tallest height (or width to widest width). Sets in em units 
 		by default if pxToEm() method is available.
 * Dependencies: jQuery library, pxToEm method	(article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/)
 * Usage Example: $(element).equalHeights();
   						      Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true);
 * Version: 2.0, 07.24.2008
 * Changelog:
 *  08.02.2007 initial Version 1.0
 *  07.24.2008 v 2.0 - added support for widths
--------------------------------------------------------------------*/

// Call jQuery in noConflict-Mode, so it doesn't conflict with other Libraries. Change the $-call to a $j-call.
var $j = jQuery.noConflict();

$j.fn.equalHeights = function(px) {
	$j(this).each(function(){
		var currentTallest = 0;
		$j(this).children().not('#equalExclude').each(function(i){
			if ($j(this).height() > currentTallest) { currentTallest = $j(this).height(); }
		});
		if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
		// for ie6, set height since min-height isn't supported
		if ($j.browser.msie && $j.browser.version == 6.0) { $j(this).children().not('#equalExclude').css({'height': currentTallest}); }
		$j(this).children().not('#equalExclude').css({'min-height': currentTallest}); 
	});
	return this;
};

// just in case you need it...
$j.fn.equalWidths = function(px) {
	$j(this).each(function(){
		var currentWidest = 0;
		$j(this).children().not('#equalExclude').each(function(i){
				if($j(this).width() > currentWidest) { currentWidest = $j(this).width(); }
		});
		if(!px || !Number.prototype.pxToEm) currentWidest = currentWidest.pxToEm(); //use ems unless px is specified
		// for ie6, set width since min-width isn't supported
		if ($j.browser.msie && $j.browser.version == 6.0) { $j(this).children().not('#equalExclude').css({'width': currentWidest}); }
		$j(this).children().not('#equalExclude').css({'min-width': currentWidest}); 
	});
	return this;
};

// ab hier bei Bernd beschweren:
// Bringt alle Inhalte in einem Div auf die gegebene Höhe
$j.fn.stretchChildren = function(height) {
	var currentHeight = $j(this).height();
	var difference = height - currentHeight;
	var children = $j(this).children();
	var childCount = children.length;
	var pixelsPerChild = Math.floor(difference / childCount);
	var restPixels = difference - pixelsPerChild * childCount;
	
	$j(this).css({'height': height});
	var newHeight;
	for (var i=0; i < children.length; i++) {
		child = children[i];
		newHeight = $j(child).children('.rahmen').height() + pixelsPerChild;
		if(i==0) {
			newHeight = newHeight + restPixels;
		}
		$j(child).children('.rahmen').css({'height': newHeight})
	};
	return this;
}

/*-------------------------------------------------------------------- 
 * javascript method: "pxToEm"
 * by:
   Scott Jehl (scott@filamentgroup.com) 
   Maggie Wachs (maggie@filamentgroup.com)
   http://www.filamentgroup.com
 *
 * Copyright (c) 2008 Filament Group
 * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
 *
 * Description: Extends the native Number and String objects with pxToEm method. pxToEm converts a pixel value to ems depending on inherited font size.  
 * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/
 * Demo: http://www.filamentgroup.com/examples/pxToEm/	 	
 *							
 * Options:  	 								
 		scope: string or jQuery selector for font-size scoping
 		reverse: Boolean, true reverses the conversion to em-px
 * Dependencies: jQuery library						  
 * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true});
 *
 * Version: 2.0, 08.01.2008 
 * Changelog:
 *		08.02.2007 initial Version 1.0
 *		08.01.2008 - fixed font-size calculation for IE
--------------------------------------------------------------------*/

Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
	//set defaults
	settings = jQuery.extend({
		scope: 'body',
		reverse: false
	}, settings);
	
	var pxVal = (this == '') ? 0 : parseFloat(this);
	var scopeVal;
	var getWindowWidth = function(){
		var de = document.documentElement;
		return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
	};	
	
	/* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. 
		For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. 	
		When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) 
		to get an accurate em value. */
				
	if (settings.scope == 'body' && $j.browser.msie && (parseFloat($j('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
		var calcFontSize = function(){		
			return (parseFloat($j('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
		};
		scopeVal = calcFontSize();
	}
	else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); };
			
	var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
	return result;
};	

// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support
// (c) 2008 Angus Turnbull http://www.twinhelix.com

// This is licensed under the GNU LGPL, version 2.1 or later.
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/

var IEPNGFix = window.IEPNGFix || {};

IEPNGFix.tileBG = function(elm, pngSrc, ready) {
	// Params: A reference to a DOM element, the PNG src file pathname, and a
	// hidden "ready-to-run" passed when called back after image preloading.

	var data = this.data[elm.uniqueID],
		elmW = Math.max(elm.clientWidth, elm.scrollWidth),
		elmH = Math.max(elm.clientHeight, elm.scrollHeight),
		bgX = elm.currentStyle.backgroundPositionX,
		bgY = elm.currentStyle.backgroundPositionY,
		bgR = elm.currentStyle.backgroundRepeat;

	// Cache of DIVs created per element, and image preloader/data.
	if (!data.tiles) {
		data.tiles = {
			elm: elm,
			src: '',
			cache: [],
			img: new Image(),
			old: {}
		};
	}
	var tiles = data.tiles,
		pngW = tiles.img.width,
		pngH = tiles.img.height;

	if (pngSrc) {
		if (!ready && pngSrc != tiles.src) {
			// New image? Preload it with a callback to detect dimensions.
			tiles.img.onload = function() {
				this.onload = null;
				IEPNGFix.tileBG(elm, pngSrc, 1);
			};
			return tiles.img.src = pngSrc;
		}
	} else {
		// No image?
		if (tiles.src) ready = 1;
		pngW = pngH = 0;
	}
	tiles.src = pngSrc;

	if (!ready && elmW == tiles.old.w && elmH == tiles.old.h &&
		bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) {
		return;
	}

	// Convert English and percentage positions to pixels.
	var pos = {
			top: '0%',
			left: '0%',
			center: '50%',
			bottom: '100%',
			right: '100%'
		},
		x,
		y,
		pc;
	x = pos[bgX] || bgX;
	y = pos[bgY] || bgY;
	if (pc = x.match(/(\d+)%/)) {
		x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100));
	}
	if (pc = y.match(/(\d+)%/)) {
		y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100));
	}
	x = parseInt(x);
	y = parseInt(y);

	// Handle backgroundRepeat.
	var repeatX = { 'repeat': 1, 'repeat-x': 1 }[bgR],
		repeatY = { 'repeat': 1, 'repeat-y': 1 }[bgR];
	if (repeatX) {
		x %= pngW;
		if (x > 0) x -= pngW;
	}
	if (repeatY) {
		y %= pngH;
		if (y > 0) y -= pngH;
	}

	// Go!
	this.hook.enabled = 0;
	if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) {
		elm.style.position = 'relative';
	}
	var count = 0,
		xPos,
		maxX = repeatX ? elmW : x + 0.1,
		yPos,
		maxY = repeatY ? elmH : y + 0.1,
		d,
		s,
		isNew;
	if (pngW && pngH) {
		for (xPos = x; xPos < maxX; xPos += pngW) {
			for (yPos = y; yPos < maxY; yPos += pngH) {
				isNew = 0;
				if (!tiles.cache[count]) {
					tiles.cache[count] = document.createElement('div');
					isNew = 1;
				}
				var clipR = (xPos + pngW > elmW ? elmW - xPos : pngW),
					clipB = (yPos + pngH > elmH ? elmH - yPos : pngH);
				d = tiles.cache[count];
				s = d.style;
				s.behavior = 'none';
				s.left = xPos + 'px';
				s.top = yPos + 'px';
				s.width = clipR + 'px';
				s.height = clipB + 'px';
				s.clip = 'rect(' +
					(yPos < 0 ? 0 - yPos : 0) + 'px,' +
					clipR + 'px,' +
					clipB + 'px,' +
					(xPos < 0 ? 0 - xPos : 0) + 'px)';
				s.display = 'block';
				if (isNew) {
					s.position = 'absolute';
					s.zIndex = -999;
					if (elm.firstChild) {
						elm.insertBefore(d, elm.firstChild);
					} else {
						elm.appendChild(d);
					}
				}
				this.fix(d, pngSrc, 0);
				count++;
			}
		}
	}
	while (count < tiles.cache.length) {
		this.fix(tiles.cache[count], '', 0);
		tiles.cache[count++].style.display = 'none';
	}

	this.hook.enabled = 1;

	// Cache so updates are infrequent.
	tiles.old = {
		w: elmW,
		h: elmH,
		x: bgX,
		y: bgY,
		r: bgR
	};
};


IEPNGFix.update = function() {
	// Update all PNG backgrounds.
	for (var i in IEPNGFix.data) {
		var t = IEPNGFix.data[i].tiles;
		if (t && t.elm && t.src) {
			IEPNGFix.tileBG(t.elm, t.src);
		}
	}
};
IEPNGFix.update.timer = 0;

if (window.attachEvent && !window.opera) {
	window.attachEvent('onresize', function() {
		clearTimeout(IEPNGFix.update.timer);
		IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100);
	});
}

