$(function() {
// tabmenu show/hide
$("#hide_tabmenu").toggle(function() {
$("#tabmenu_container").stop().animate({"height":"0","top":"31px"});
},
function() {
$("#tabmenu_container").stop().animate({"height":"31px","top":"0"});
});
// logmenu show/hide
$("#login").toggle(function () {
$("#log_menu").fadeIn("fast")
},
function () {
$("#log_menu").fadeOut("fast")
});
// search scretching
$("input.search_value").focus(function() {
$("#menu_search").animate({"width":"699px"},200);
$("input.search_value").animate({"width":"653px"},200);
$("#user_control").hide();
},
$("input.search_value").blur(function() {
$("#menu_search").animate({"width":"179px"},200);
$("input.search_value").animate({"width":"133px"},200);
$("#user_control").show();
}));
// scroll in scrollbox init
$("div.scrollbox_cont1,div.scrollbox_cont2").jScrollPane({showArrows:false,scrollbarWidth:19,dragMaxHeight:23});
// cookies processing
var toggle1 = $.cookie("#s1");
if(toggle1 == "open") {$("#s1").show();}
if(toggle1 == "closed") {
$("#s1 div.scrollbox_toggle img").attr("src","/i/toggle2.png");
$("#s1").css("height","22px");
}
var toggle2 = $.cookie("#s2");
if(toggle2 == "open") {$("#s2").show();}
if(toggle2 == "closed") {
$("#s2 div.scrollbox_toggle img").attr("src","/i/toggle2.png");
$("#s2").css("height","22px");
}
// carousel init
$("#carousel").jcarousel();
// sun menu fade
$("#sun_menu_init").mouseenter(function() {
$("#sun_menu").fadeIn(300);
});
$("#sun_menu").mouseleave(function(){
$("#sun_menu").fadeOut(1000)
});
});
// scrollbox toggle
function toggleBlock(id) {
if($(id).height() == '22') {
$(id+" div.scrollbox_toggle > img").attr("src","/i/toggle.png");
$(id).css("height","100%");
tmp = "open";
} else {
$(id+" div.scrollbox_toggle > img").attr("src","/i/toggle2.png");
$(id).animate({"height":"22px"},600);
tmp = "closed";
}
$.cookie(id,tmp);
}