window.addEvent("load",function(){var f=$(document.getElementsByTagName('body')[0]);var g=false;var h=false;Fx.Height=Fx.Style.extend({initialize:function(a,b){this.parent(a,'height',b);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(a,b){this.now=1;this.parent(a,'opacity',b)},toggle:function(){return(this.now>0)?this.start(1,0):this.start(0,1)},show:function(){return this.set(1)}});if($('stylearea')){$A($$('.style_switcher')).each(function(b,c){b.addEvent('click',function(a){var a=new Event(a);a.preventDefault();changeStyle(c+1)})});new SmoothScroll()}var k=$$('.equal_col');k.each(function(b,i){var c=0;var d=b.getElementsBySelector('.equal');var e=0;d.each(function(a,j){if((a.getParent()==b||a.getParent().hasClass("helper"))){e++;if(a.getSize().size.y>c)c=a.getSize().size.y}});if(e>1){d.each(function(a){if(a.getParent()==k[i]||a.getParent().hasClass("helper"))a.setStyle("min-height",c+"px")})}});if($('login_btn')){$('login_btn').addEvent("click",function(e){new Event(e).stop();(function(){gk_popup('popup_login',600,85)}).delay((h)?500:0);g=true;if(h){$E('.gk_popup_close',$('popup_register')).fireEvent("click");h=false}});$E('.gk_popup_close',$('popup_login')).addEvent("click",function(){g=false})}if($('register')){$('register').addEvent("click",function(e){new Event(e).stop();(function(){gk_popup('popup_register',500,345)}).delay((g)?500:0);h=true;if(g){$E('.gk_popup_close',$('popup_login')).fireEvent("click");g=false}});$E('.gk_popup_close',$('popup_register')).addEvent("click",function(){h=false})}});function gk_popup(a,x,y){var p=$(a);if(p.getStyle("display")!="block"){p.setStyle("display","block");p.setStyle("left",(window.getSize().size.x/2)+"px");var b=(window.getSize().size.y/2);if(window.opera){b=((window.innerHeight/2)+window.getScrollTop())}new Fx.Style(p,'top',{duration:350}).start(b+120,b);new Fx.Opacity(p,{duration:350}).start(1);p.setStyles({"overflow":"hidden","width":"40px","height":"40px"});$E('.gkp_m',p).setStyle("display","none");(function(){$E('.gkp_m',p).setStyle("display","block");new Fx.Styles(p,{duration:200}).start({"width":x+40+"px","height":y+40+"px","left":((window.getSize().size.x-(x-40))/2)+"px","top":(b-((y+40)/2))+"px"});new Fx.Style($E('.gkp_t',p),'width',{duration:200}).start(0,x);new Fx.Style($E('.gkp_b',p),'width',{duration:200}).start(0,x);new Fx.Style($E('.gkp_m',p),'width',{duration:200}).start(0,x);new Fx.Style($E('.gkp_m',p),'height',{duration:200}).start(0,y);new Fx.Style($E('.gkp_ml',p),'height',{duration:200}).start(0,y);new Fx.Style($E('.gkp_mr',p),'height',{duration:200}).start(0,y);$E('.gk_popup_close',p).setStyle("opacity",0);(function(){new Fx.Opacity($E('.gk_popup_close',p),{duration:350}).start(1)}).delay(350);$E('.popup_padding',p).setStyle('opacity',0);(function(){new Fx.Opacity($E('.popup_padding',p),{duration:350}).start(0,1)}).delay(350)}).delay(350);$E('.gk_popup_close',p).addEvent("click",function(){new Fx.Opacity($E('.gk_popup_close',p),{duration:350}).start(0);new Fx.Opacity($E('.popup_padding',p),{duration:350}).start(0);(function(){new Fx.Style($E('.gkp_t',p),'width',{duration:200}).start(x,0);new Fx.Style($E('.gkp_b',p),'width',{duration:200}).start(x,0);new Fx.Style($E('.gkp_m',p),'width',{duration:200}).start(x,0);new Fx.Style($E('.gkp_m',p),'height',{duration:200}).start(y,0);new Fx.Style($E('.gkp_ml',p),'height',{duration:200}).start(y,0);new Fx.Style($E('.gkp_mr',p),'height',{duration:200}).start(y,0);new Fx.Styles(p,{duration:200}).start({"left":(window.getSize().size.x/2)+"px","top":b+"px"});(function(){new Fx.Opacity(p,{duration:350}).start(0);new Fx.Styles(p,{duration:350}).start({"width":"40px","height":"40px","top":(b+120)+"px"});(function(){p.setStyle("display","none")}).delay(350)}).delay(200)}).delay(200)})}}function changeStyle(a){var b=$template_path+'/css/style'+a+'.css';new Asset.css(b);new Cookie.set('gk32_style',a,{duration:200,path:"/"})}
