jQuery(document).ready(function(){
    /* Header Tab */
    var loaded_id_tmp = jQuery("#h_tabs li.tab_active a").attr("href");
    var loaded_id = loaded_id_tmp.replace("#","");
    jQuery("#"+loaded_id+"").show();
/*
    jQuery("#h_tabs li a").click(function(){
        jQuery(this).parent().addClass("tab_active").siblings().attr("class","");
        var selected_id_tmp = jQuery(this).attr("href");
        var selected_id = selected_id_tmp.replace("#","");

        jQuery("#"+selected_id+"").siblings("div").hide();
        jQuery("#"+selected_id+"").show();
        return false;
    });
*/
    /* Horizontal Accordion */
    jQuery(".haccordion .header:not(:first)").addClass("closed");
    jQuery(".haccordion .header:first").addClass("opened").next().show();
    jQuery(".header").click(function(){
        if(jQuery(this).hasClass("closed")){
            jQuery(this).removeClass("closed").addClass("opened").next().fadeIn("slow");
            jQuery(this).siblings(".header").removeClass("opened").addClass("closed").next().fadeOut("slow");
        }
        else if(jQuery(this).hasClass("opened")){
            jQuery(this).removeClass("opened").addClass("closed").next().fadeOut("slow");
        }
    });

    /* Corners */
    jQuery(".corner_it").corner("10px");

    /* Carusel */
    jQuery(".carousel").jCarouselLite({
        btnNext: ".btn_left",
        btnPrev: ".btn_right"
    });

    /* Search Form */
    jQuery("#s_input").focus(function(){
        if(jQuery(this).val() == "Поиск" || jQuery(this).val() == "Search"){jQuery(this).val("");}
    });
    jQuery("#s_input").blur(function(){
        if(jQuery(this).val() == ""){
            jQuery(this).val("Поиск");
        }
    });

    /* FancyBox */
    jQuery("a.fancy").fancybox();
	
	/* Corners & Borders */
	if ($.browser.msie && $.browser.version == 6) {
	$(".lic_block").find("img").each(function(){
		var img_height = $(this).height();
		var img_width = $(this).width();
		$(this).parent().parent().find(".b_l, .b_r").height(img_height);
		$(this).parent().parent().find(".b_t, .b_b").width(img_width);
	});
}
});
