jQuery(document).ready(function($){

	jQuery.fn.extend({
			disableSelection : function() { 
					return this.each(function() { 
							this.onselectstart = function() { return false; }; 
							this.unselectable = "on"; 
							jQuery(this).css('user-select', 'none'); 
							jQuery(this).css('-o-user-select', 'none'); 
							jQuery(this).css('-moz-user-select', 'none'); 
							jQuery(this).css('-khtml-user-select', 'none'); 
							jQuery(this).css('-webkit-user-select', 'none'); 
					}); 
			} 
	});

	if ($.browser.msie)
	{
		$(".caption").css( {opacity: 0.8} );
		
		if (parseInt($.browser.version) <= 7)
		{
		}
		
		// $("#image-bg").show().boxShadow(0, 0, 8, "#111");
		$("#image-bg").show();
		// $("#image-bg").parent().css({ position: "none" });
		// $("#image img").css({'position': 'absolute', 'top': '-122px'}).boxShadow(0, 0, 8, "#111");
		// $(".current-menu-item").boxShadow($(".current-menu-item").offset().left - 20, $(".current-menu-item").offset().top, 8, "#222");
		
		
		$(".current-menu-item a").boxShadow(0, 7, 5, "#222");
		$("#footer").boxShadow(0, $("#footer").offset().top + 5, 25, "#111" );
		$(".featured-post-wrap img").each(function(){
			$(this).boxShadow(0, 0, 12, "#000" );
		});
		
		// css failure on IE
		$("#featured .featured-post:last").css({'float': 'right', 'margin': '0 14px 0 0'});
		
		// alert($(".current-menu-item").offset().top);
	}
	
	// Accordion / tab slider
    lastBlock = $("#tab_slider li").eq(0).find("p");
    maxWidth = 858;
    minWidth = 0;	

    $("#tab_slider li > a").click(
      function(){
        $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
		$(this).parent().find("p").animate({width: maxWidth+"px"}, { queue:false, duration:400});
		lastBlock = this;
      }
    );
	
	$("#accordion-1").css({"visibility": "hidden"});
	
	$("#accordion-1 img").each(function(){
		var imgsrc = $(this).attr('src');
		(new Image()).src = imgsrc;
	});	
	
	setTimeout(function(){
		$("#accordion-1").css({"visibility": "visible"});
		$("#accordion-1").easyAccordion({
			autoStart: true, 
			slideInterval: 6000
		})
	}, 500);
	
	$("#header_categories li").eq(3).css({'margin-right': '3px'});
	$("#header_categories li:last-child").css({'margin-left': '-1px'});

});
