var Drawer=new Class({options:{},initialize:function(el,options){this.setOptions(options);this.element=el;if(!this.element)return;this.drawerlast=null;this.drawerfirst=null;this.drawercheck=null;this.drawerheight=0;this.drawing=false;this.clicked=false;this.element.addEvent('mouseleave',function(){if(!this.clicked)this.drawertoggle(this.drawerfirst);}.bind(this));this.rearrange();},rearrange:function(){var h=0;var i=40;this.element.getElements('div.ddrawitem').each(function(div){if(!this.drawerlast){this.drawerlast=div;this.drawerfirst=$E('div.ddrawdisplay',div);}div.effect('top',{duration:700,transition:Fx.Transitions.Cubic.easeInOut}).start(0,h);div.style.zIndex=i;h+=$E('div.ddrawdisplay',div).offsetHeight;i--;$E('div.ddrawdisplay',div).addEvent('mouseover',this.drawertoggle.pass($E('div.ddrawdisplay',div),this));$E('div.ddrawdisplay',div).addEvent('click',function(){this.clicked=this.clicked?false:true}.bind(this));}.bind(this));},drawertoggle:function(o){if(this.drawing){this.drawercheck=o;return;}if(this.drawerlast!=o.parentNode){this.drawing=true;var from=this.drawerlast.style.zIndex;var to=o.parentNode.style.zIndex;if(to>from)this.drawermove(to-from+1,this.drawerlast,0,500);else
this.drawermove(from-to,this.drawerlast,1,500);this.drawerlast=o.parentNode;}},drawermove:function(n,o,w,s){var f=70;var dy=0;if(n==1){if(w){if(o.offsetTop>=0){dy=((o.offsetHeight-o.getElement('div.ddrawdisplay').offsetHeight)*-1)+o.offsetTop;o.effect('top',{duration:s,transition:Fx.Transitions.Cubic.easeInOut,onComplete:function(){this.drawing=false;this.drawerchecker()}.bind(this)}).start(o.offsetTop,dy);}}else
{if(o.offsetTop<0){dy=o.offsetTop+o.offsetHeight-o.getElement('div.ddrawdisplay').offsetHeight;o.effect('top',{duration:s,transition:Fx.Transitions.Cubic.easeInOut,onComplete:function(){this.drawing=false;this.drawerchecker()}.bind(this)}).start(o.offsetTop,dy);}}}else
{if(w){if(o.offsetTop>=0){dy=((o.offsetHeight-o.getElement('div.ddrawdisplay').offsetHeight)*-1)+o.offsetTop;o.effect('top',{duration:s,transition:Fx.Transitions.Cubic.easeInOut}).start(o.offsetTop,dy);}(function(){this.drawermove(n-1,o.getNext(),w,s-f)}.bind(this)).delay(n*f);}else
{if(o.offsetTop<0){dy=o.offsetTop+o.offsetHeight-o.getElement('div.ddrawdisplay').offsetHeight;o.effect('top',{duration:s,transition:Fx.Transitions.Cubic.easeInOut}).start(o.offsetTop,dy);}(function(){this.drawermove(n-1,o.getPrevious(),w,s-f)}.bind(this)).delay(n*f);}}},drawerchecker:function(){if(this.drawercheck)this.drawertoggle(this.drawercheck);this.drawercheck=null;}});Drawer.implement(new Options);var Menu=new Class({options:{top:0,left:0,uiditem:'_menuitem',submenu:function(a){},over:function(a,b){}},initialize:function(el,b,c,options){this.setOptions(options);this.element=el;this.container=b;this.parent=c;this.uiditem=this.options.uiditem;this.menui=1;this.menulast=null;this.menuhide=true;if(!this.element)return;this.parent.addEvent('mouseleave',function(){this.menuhide=true;this.menuhideit();}.bind(this));this.element.getElements("div").each(function(div){var a=new Element('div',{'id':this.uiditem+this.menui,styles:{'display':'none','position':'absolute','width':'100px'}});var b=new Element('div',{'class':'menubox'});a.appendChild(b);a.addEvent('mouseover',function(){this.menuhide=false;}.bind(this));a.addEvent('mouseleave',function(){this.menuhide=true;this.menuhideit();}.bind(this));a.injectInside(this.container);b.innerHTML=div.innerHTML;this.options.submenu(b);div.parentNode.title=this.uiditem+this.menui;this.menui++;div.getPrevious().addEvent('mouseover',function(o){this.menuhide=false;if(this.menulast)this.menulast.style.display='none';var dfloat=$(o.parentNode.title);if(dfloat){this.menulast=dfloat;dfloat.setStyles({display:'inline',opacity:1,left:this.element.getPosition().x+this.element.offsetWidth+this.options.left,top:o.getPosition().y+this.options.top});this.options.over(o,dfloat);}return false;}.pass(div.getPrevious(),this));}.bind(this));},menuhideit:function(){if(this.menulast){(function(){if(this.menuhide){this.menulast.effect('opacity',{duration:500,transition:Fx.Transitions.linear,onComplete:function(){this.menulast.setStyles({display:'none',opacity:1})}.bind(this)}).start(1,0);}}.bind(this)).delay(100)}}});Menu.implement(new Options);var Rounder=new Class({options:{one:{},two:{},three:{},four:{},bottom:{},bug:-1,styles:{'width':'15px','height':'15px','background-color':'transparent'}},initialize:function(el,options){this.setOptions(options);this.element=el;if(!this.element)return;this.element.addClass('rdrcontent');var color=this.options.styles['background-color'];if(!color)color=this.element.getStyle('border-top-color');if(this.options.one['display']!='none')new Element('p',{'styles':$merge(this.options.styles,this.options.one),'class':'rdrone'}).injectInside(this.element);if(this.options.two['display']!='none')new Element('p',{'styles':$merge(this.options.styles,this.options.two),'class':'rdrtwo'}).injectInside(this.element);if(this.options.three['display']!='none')new Element('p',{'styles':$merge(this.options.styles,this.options.three),'class':'rdrthree'}).injectInside(this.element);if(this.options.four['display']!='none')new Element('p',{'styles':$merge(this.options.styles,this.options.four),'class':'rdrfour'}).injectInside(this.element);if(this.options.bottom['display']!='none')new Element('p',{'styles':this.options.bottom,'class':'rdrbottom'}).injectInside(this.element).style.width=(this.element.offsetWidth+this.options.bug)+'px';}});Rounder.implement(new Options);var Tabber=new Class({options:{left:0,_left:0},initialize:function(el,tabstart,tabscroll,tabcur,options){this.setOptions(options);this.tab=el;this.tabreqitem=tabstart;this.tabscroll=tabscroll;this.tabcur=tabcur;if(!this.tab)return;this.tabscrolling=false;this.tabreq=null;this.tabreqitem2=null;var g=this.tab;if(g){g.getElements("a").each(function(a){a.addEvent('mouseover',function(o){this.ftabscroll(o,o.parentNode.title);return false;}.pass(a,this));}.bind(this));}},ftabscroll:function(a,id){if(a){if(this.tabreqitem){this.tabreqitem.removeClass('tabcur');if(this.tabreqitem.hasClass('tabfixhover')){this.tabreqitem.removeClass('tabfixhover');this.tabreqitem.addClass('tabfix')}}a.addClass('tabcur');if(a.hasClass('tabfix')){a.removeClass('tabfix');a.addClass('tabfixhover')}this.tabreqitem=a;}if(this.tabscrolling){this.tabreqitem2=a;this.tabreq=id;return false;}this.tabscrolling=true;var fx=new Fx.Scroll(this.tabscroll,{transition:Fx.Transitions.Cubic.easeInOut,duration:500,onComplete:function(){this.tabscrolling=false;this.ftabcheck()}.bind(this)});var e=$(id);if(e){if(window.ie)fx.scrollTo(e.getPosition().x+this.options._left,0);else
fx.scrollTo(e.getPosition().x+this.options.left,0);}},ftabcheck:function(){if(this.tabreq!=null)this.ftabscroll(this.tabreqitem2,this.tabreq);}});
Tabber.implement(new Options);
function slft(){
var fx = new Fx.Scroll($('sldcontent'),{transition: Fx.Transitions.bounceInOut, duration:300});
fx.scrollTo($('sldcontent').getSize().scroll.x-250, 0);
$('slddescrip').innerHTML='';
return false;
}
function srgt(){
var fx = new Fx.Scroll($('sldcontent'),{transition: Fx.Transitions.bounceInOut, duration:300});
fx.scrollTo($('sldcontent').getSize().scroll.x+250, 0);
$('slddescrip').innerHTML='';
return false;
}
function chnvid(id)
{
var so = new SWFObject("http://www.youtube.com/v/"+id+"&autoplay=1", "pla", "330", "300", "9", "#FFFFFF");
so.write("dsee");
}
function chntit(txt)
{
$('slddescrip').innerHTML=txt;
}
