var ie6=false;$(function(){startNumbersListner();bindLanguageSelector();bindInfoBoxes();bindEventsSlideshow();bindLoginForm()});var login_form;function bindLoginForm(){login_form=$(".header-login fieldset");login_form.find("label").inFieldLabels({fadeOpacity:0.1})}(function(a){a.InFieldLabels=function(e,i,h){var g=this;g.$label=a(e);g.label=e;g.$field=a(i);g.field=i;g.$label.data("InFieldLabels",g);g.showing=true;g.init=function(){g.options=a.extend({},a.InFieldLabels.defaultOptions,h);if(g.$field.val()!=""){g.$label.hide();g.showing=false}g.$field.focus(function(){g.fadeOnFocus()}).blur(function(){g.checkForEmpty(true)}).bind("keydown.infieldlabel",function(b){g.hideOnChange(b)}).change(function(b){g.checkForEmpty()}).bind("onPropertyChange",function(){g.checkForEmpty()})};g.fadeOnFocus=function(){if(g.showing){g.setOpacity(g.options.fadeOpacity)}};g.setOpacity=function(b){g.$label.stop().animate({opacity:b},g.options.fadeDuration);g.showing=(b>0)};g.checkForEmpty=function(b){if(g.$field.val()==""){g.prepForShow();g.setOpacity(b?1:g.options.fadeOpacity)}else{g.setOpacity(0)}};g.prepForShow=function(b){if(!g.showing){g.$label.css({opacity:0}).show();g.$field.bind("keydown.infieldlabel",function(c){g.hideOnChange(c)})}};g.hideOnChange=function(b){if((b.keyCode==16)||(b.keyCode==9)){return}if(g.showing){g.$label.hide();g.showing=false}g.$field.unbind("keydown.infieldlabel")};g.init()};a.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};a.fn.inFieldLabels=function(b){return this.each(function(){var d=a(this).attr("for");if(!d){return}var c=a("input#"+d+"[type='text'],input#"+d+"[type='password'],textarea#"+d);if(c.length==0){return}(new a.InFieldLabels(this,c[0],b))})}})(jQuery);function bindEventsSlideshow(){$("#homepage-events-listing").innerfade({speed:"slow",timeout:5000,type:"sequence",containerheight:"190px"})}var hideInfoBox;var info_text_class,info_text_obj;var top_pos,left_pos;function bindInfoBoxes(){top_pos=$(".homepage-info-box").offset().top-10;left_pos=$(".homepage-info-box").offset().left+400;$(".homepage-info-details").css({top:top_pos,left:left_pos});$(window).resize(function(){top_pos=$(".homepage-info-box").offset().top-10;left_pos=$(".homepage-info-box").offset().left+400;$(".homepage-info-details").css({top:top_pos,left:left_pos})});if($(".homepage-info-item").length){$(".homepage-info-item").hover(showInfoBox,hideInfoBox);$(".homepage-info-details").hover(keepInfoVisible,hideInfoBox)}}function showInfoBox(){info_text_obj=$("#"+$(this).attr("rel"));if(hideInfoBox){clearTimeout(hideInfoBox)}if(ie6){$(".homepage-search select").hide()}if($(".homepage-info-item-hover").length){$(".homepage-info-item-hover").removeClass("homepage-info-item-hover")}if(!$(this).hasClass("homepage-info-item-hover")){$(this).addClass("homepage-info-item-hover")}if($(this).attr("rel")){if(info_text_class){$(".homepage-info-details").removeClass(info_text_class)}info_text_class=$("span",this).attr("class")+"-big";$(".homepage-info-details").addClass(info_text_class);$(".info-details-content").html(info_text_obj.html())}if(!$(".homepage-info-details").css("display","block")){$(".homepage-info-details").show()}}function hideInfoBox(){hideInfoBox=setTimeout(function(){if(ie6){$(".homepage-search select").show()}$(".homepage-info-details").fadeOut("fast");$(".homepage-info-item").removeClass("homepage-info-item-hover")},100)}function keepInfoVisible(){if(hideInfoBox){clearTimeout(hideInfoBox)}}function bindLanguageSelector(){var a=$("#current-language img").attr("alt");var b=$("#available-languages").find("a[title="+a+"]").parent("li");$("#available-languages ul").prepend(b);$("#current-language").click(function(){$("#available-sizes").hide();if(!($("#available-languages").css("display")=="block")){var c=$(this).position();$("#available-languages").css({left:c.left+1,top:c.top});$("#available-languages").show("blind")}$("body").bind("click",function(){$("#available-languages").hide();$("body").unbind("click")});return false})}var number_listner,numbers_interval;var refresh_t,partial_content;var chat_nav;var pop_visible;var maintenance_status;var chat_controls;var chat_control_btn_prev,chat_control_btn_next;var visible_pop;function startNumbersListner(){numbersListen()}function numbersListen(){var a=$("#counter-box").attr("rel");$.ajax({dataType:"json",url:a,cache:false,success:function(b){maintenance_status=b.status;if(!b.status){refresh_t=b.refresh_time*5000;partial_content=b.content;if(b.chat){$("#chat-pops").append(b.chat);bindChatActions($("#chat-pops .chat-popup:last"));if(chat_control_btn_next){chat_control_btn_next.show()}if(!pop_visible){showChatPopup()}else{if(!chat_controls){showChatControls()}}}number_listner=setTimeout("numbersListen();",refresh_t);$("#counter-box").html(partial_content)}else{if(b.status){refresh_t=b.refresh_time*5000;number_listner=setTimeout("numbersListen();",refresh_t)}}}})}function showChatPopup(){var a=$("#chat-pops").find(".chat-popup:first");if(ie6){$("#chat-pops").css({position:"absolute",top:"0px",left:"20px"});a.css({position:"absolute",top:"-220px",left:"20px",opacity:"0.3"});a.show();a.animate({top:"10",opacity:"1"},1000)}else{$("#chat-pops").css({bottom:"0px",right:"20px"});a.css({bottom:"-220px",right:"20px",opacity:"0.3"});a.show();a.animate({bottom:"10",opacity:"1"},1000)}pop_visible=true;visible_pop=a;$("body").focus()}function showChatControls(){if(!$("#chat-pops .chat-popup").is(":visible")){showChatPopup()}chat_control_btn_prev=$("<a></a>").attr("href","#previous-chat-request").addClass("action-button ui-state-default ui-corner-all").html(language.previous);chat_control_btn_next=$("<a></a>").attr("href","#next-chat-request").addClass("action-button ui-state-default ui-corner-all").html(language.next);chat_control_btn_prev.click(function(){chat_control_btn_next.show();if(visible_pop.prevAll(".chat-popup").length==1){chat_control_btn_prev.hide()}if(ie6){visible_pop.stop().animate({left:"-500px",opacity:"0.3"},500);visible_pop.prevAll(".chat-popup").eq(0).css({position:"absolute",top:"-220px",left:"20px",opacity:"0.3"});visible_pop.prevAll(".chat-popup").eq(0).show();visible_pop.prevAll(".chat-popup").eq(0).stop().animate({top:"10",opacity:"1"},500)}else{visible_pop.stop().animate({right:"-500px",opacity:"0.3"},500);visible_pop.prevAll(".chat-popup").eq(0).css({bottom:"-220px",right:"20px",opacity:"0.3"});visible_pop.prevAll(".chat-popup").eq(0).show();visible_pop.prevAll(".chat-popup").eq(0).stop().animate({bottom:"10",opacity:"1"},500)}visible_pop=visible_pop.prevAll(".chat-popup").eq(0)});chat_control_btn_next.click(function(){chat_control_btn_prev.show();if(visible_pop.nextAll(".chat-popup").length==1){chat_control_btn_next.hide()}if(ie6){visible_pop.stop().animate({left:"-500px",opacity:"0.3"},500);visible_pop.nextAll(".chat-popup").eq(0).css({position:"absolute",top:"-220px",left:"20px",opacity:"0.3"});visible_pop.nextAll(".chat-popup").eq(0).show();visible_pop.nextAll(".chat-popup").eq(0).stop().animate({top:"10",opacity:"1"},500)}else{visible_pop.stop().animate({right:"-500px",opacity:"0.3"},500);visible_pop.nextAll(".chat-popup").eq(0).css({bottom:"-220px",right:"20px",opacity:"0.3"});visible_pop.nextAll(".chat-popup").eq(0).show();visible_pop.nextAll(".chat-popup").eq(0).stop().animate({bottom:"10",opacity:"1"},500)}visible_pop=visible_pop.nextAll(".chat-popup").eq(0)});chat_controls=$("<div></div>").append(chat_control_btn_prev).append(chat_control_btn_next).addClass("chat-controls");if(ie6){chat_controls.css({position:"absolute",top:"220px",left:"40px"})}else{chat_controls.css({position:"fixed",bottom:"20px",right:"20px"})}if(visible_pop.selector==$("#chat-pops").find(".chat-popup:first").selector){chat_control_btn_prev.hide()}if(visible_pop.selector==$("#chat-pops").find(".chat-popup:last").selector){chat_control_btn_next.hide()}$("body").append(chat_controls);chat_controls.show("fast")}function bindChatActions(a){$(".chat-chat-button",a).click(function(){a.fadeOut("fast");if(chat_control_btn_next){if(chat_control_btn_next.is(":visible")){chat_control_btn_next.trigger("click");a.remove();if($("#chat-pops .chat-popup").length<1){chat_controls.remove();chat_controls=false}}else{if(chat_control_btn_prev.is(":visible")){chat_control_btn_prev.trigger("click");a.remove();if($("#chat-pops .chat-popup").length<1){chat_controls.remove();chat_controls=false}}}}});$(".notnow-chat-button",a).click(function(){a.fadeOut("fast");if(chat_control_btn_next){if(chat_control_btn_next.is(":visible")){chat_control_btn_next.trigger("click");a.remove();if($("#chat-pops .chat-popup").length<1){chat_controls.remove();chat_controls=false}}else{if(chat_control_btn_prev.is(":visible")){chat_control_btn_prev.trigger("click");a.remove();if($("#chat-pops .chat-popup").length<1){chat_controls.remove();chat_controls=false}}}}return false});$(".block-chat-button").click(function(){$.post($(this).attr("href"));a.fadeOut("fast");if(chat_control_btn_next){if(chat_control_btn_next.is(":visible")){chat_control_btn_next.trigger("click");a.remove();if($("#chat-pops .chat-popup").length<1){chat_controls.remove();chat_controls=false}}else{if(chat_control_btn_prev.is(":visible")){chat_control_btn_prev.trigger("click");a.remove();if($("#chat-pops .chat-popup").length<1){chat_controls.remove();chat_controls=false}}}}return false});bindAjaxCheckbox(a)};