window.addEvent("domready",function(){
	var $b = $(document.getElementsByTagName('body')[0]);
	if(Cookie.get('gk22_font')) $b.setStyle("font-size", Cookie.get('gk22_font'));
	else $b.setStyle("font-size", "62.5%");
	// smoothscroll init
	new SmoothScroll();
	// aniation classes - Fx.Height and Fx.Opacity
	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);}});
	// font size switcher
	if($('font_minus_btn')){
		// reset font size
		$('font_reset_btn').addEvent("click", function(){
			$b.setStyle("font-size", "62.5%");	
			new Cookie.set('gk22_font',"62.5%",{duration: 200,path: "/"});
		});
		// increase font size
		$('font_plus_btn').addEvent("click", function(){
			if($b.getStyle("font-size").toFloat() < 75){
				$b.setStyle("font-size", $b.getStyle("font-size").toFloat() + 2.5 + "%");
				new Cookie.set('gk22_font',$b.getStyle("font-size").toFloat() + 2.5 + "%",{duration: 200,path: "/"});
			}
		});
		// decrease font size
		$('font_minus_btn').addEvent("click", function(){
			if($b.getStyle("font-size").toFloat() > 50){
				$b.setStyle("font-size", $b.getStyle("font-size").toFloat() - 2.5 + "%");
				new Cookie.set('gk22_font',$b.getStyle("font-size").toFloat() - 2.5 + "%",{duration: 200,path: "/"});
			}
		});
	}});
	
	// blockfix for IE7
	if(window.ie){
		// advert_wrap
		if($E('.advert_wrap')){
			if($ES('div[class^=us_width]', $E('.advert_wrap')).length > 0){
				var max = 0;
				$ES('div[class^=us_width]', $E('.advert_wrap')).each(function(el){ if(el.getSize().size.y > max) max = el.getSize().size.y; });	
				$ES('div[class^=us_width]', $E('.advert_wrap')).each(function(el){ el.setStyle("height", max+"px"); });	
			}
		}
		// users_wrap I
		if($ES('.users_wrap')[0]){
			if($ES('div[class^=us_width]', $ES('.users_wrap')[0]).length > 0){
				var max = 0;
				$ES('div[class^=us_width]', $ES('.users_wrap')[0]).each(function(el){ if(el.getSize().size.y > max) max = el.getSize().size.y; });	
				$ES('div[class^=us_width]', $ES('.users_wrap')[0]).each(function(el){ el.setStyle("height", max+"px"); });	
			}		
		}
		// users_wrap II
		if($ES('.users_wrap')[1]){
			if($ES('div[class^=us_width]', $ES('.users_wrap')[1]).length > 0){
				var max = 0;
				$ES('div[class^=us_width]', $ES('.users_wrap')[1]).each(function(el){ if(el.getSize().size.y > max) max = el.getSize().size.y; });	
				$ES('div[class^=us_width]', $ES('.users_wrap')[1]).each(function(el){ el.setStyle("height", max+"px"); });	
			}			
		}
		// bottom
		if($('wrapper_bottom')){
			if($ES('div[class^=us_width]', $('wrapper_bottom')).length > 0){
				var max = 0;
				$ES('div[class^=us_width]', $('wrapper_bottom')).each(function(el){ if(el.getSize().size.y > max) max = el.getSize().size.y; });	
				$ES('div[class^=us_width]', $('wrapper_bottom')).each(function(el){ el.setStyle("height", max+"px"); });	
			}
		}

}			
		
	
