window.addEvent("domready",function(){
    
    	
	Fx.Height = Fx.Style.extend({initialize: function(el, options){this.parent(el, 'height', options);this.element.setStyle('overflow', 'hidden');},toggle: function(){return (this.element.offsetHeight > 0) ? this.custom(this.element.offsetHeight, 0) : this.custom(0, this.element.scrollHeight);},show: function(){return this.set(this.element.scrollHeight);}});
	
	Fx.Opacity = Fx.Style.extend({initialize: function(el, options){this.now = 1;this.parent(el, 'opacity', options);},toggle: function(){return (this.now > 0) ? this.start(1, 0) : this.start(0, 1);},show: function(){return this.set(1);}});
	
	if($('memberarea') && $('login_link')){
		$('memberarea').setStyle("display", "block");
		var im = 0;
		var memberarea1 = new Fx.Opacity($('memberarea'),{duration: 350}).hide();
		var memberarea2 = new Fx.Height($('memberarea'),{duration: 350}).hide();
		$("login_link").addEvent("click",function(e){
			new Event(e).stop();
			memberarea1.start((im%2 == 0) ? 1 : 0);
			memberarea2.start((im%2 == 0) ? 65 : 0);
			im++;
		});
	}
	
	if($('stylearea')){
		$A($$('.style_switcher')).each(function(element,index){
			element.addEvent('click',function(event){
				var event = new Event(event);
				event.preventDefault();
				changeStyle(index+1);
			});
		});
		new SmoothScroll();
	}
	
	if($('bottom_wrap')){
		var max_height = 0;
		$ES('.users', $('bottom_wrap')).each(function(el, i){
			var chld = el.getChildren()[0];
			var h = chld.getSize().size.y - chld.getStyle("padding-top").toInt() - chld.getStyle("padding-bottom").toInt();
			if(h > max_height) max_height = h;
		});
		
		$ES('.users', $('bottom_wrap')).each(function(el, i){
			el.getChildren()[0].setStyle("height", max_height+"px");
		});
	}

	
	var list = $$('.grayhover1');
	list.each(function(element) {
 
	var fx = new Fx.Styles(element, {duration:300, wait:false});
	element.addEvent('mouseenter', function(){
		fx.start({
			'background-color': '#F0F0F0'
		});
	});
 
	element.addEvent('mouseleave', function(){
		fx.start({
			'background-color': '#FFF'
		});
	});
 
	});



	var list2 = $$('div.jnewsmore');
	list2.each(function(element) {
 
	var fx2 = new Fx.Styles(element, {duration:300, wait:false});
 
	element.addEvent('mouseenter', function(){
		fx2.start({
			'background-color': '#F0F0F0'
		});
	});
 
	element.addEvent('mouseleave', function(){
		fx2.start({
			'background-color': '#FFF'
		});
	});
 
	});


	var list3 = $$('.mainlevel');
		list3.each(function(element) {
		var fx3 = new Fx.Styles(element, {duration:200, wait:false});
	
		element.addEvent('mouseenter', function(){
			fx3.start({
				'background-color': '#526A9A',
				'color':'#FFFFFF',
				'padding-left': 9
			});
		});

		element.addEvent('mouseleave', function(){
			fx3.start({
				'background-color': '#FFF',
				'color':'#333333',
				'padding-left': 0
			});
		});					
 
	});


});




if (window.attachEvent){ 
	window.attachEvent("onload", menusfHover); 
}
 
function menusfHover () {
	var sfEls1 = document.getElementById("topmenu").getElementsByTagName("LI");    
	for (var i=0; i<sfEls1.length; i++) {  		 
		 sfEls1[i].onmouseover=function() {             
			this.className+=" sfhover";         				
		 }         
		sfEls1[i].onmouseout=function() {             
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");        
		 }     
	} 
} 
