$(document).ready(function(){
	$("#tab1").addClass("active");
	$(".tabnav > li").click(function(e){
		switch(e.target.id){
			case "tab1":
				$("#tab1").addClass("active");
				$("#tab2").removeClass("active");
				$("#tab3").removeClass("active");
				$("#tab4").removeClass("active");
				$("div.tabc1").customFadeIn(1);
				$("div.tabc2").css("display", "none");
				$("div.tabc3").css("display", "none");
				$("div.tabc4").css("display", "none");
			break;
			case "tab2":
				$("#tab1").removeClass("active");
				$("#tab2").addClass("active");
				$("#tab3").removeClass("active");
				$("#tab4").removeClass("active");
				$("div.tabc2").customFadeIn(1);
				$("div.tabc1").css("display", "none");
				$("div.tabc3").css("display", "none");
				$("div.tabc4").css("display", "none");
			break;
			case "tab3":
				$("#tab1").removeClass("active");
				$("#tab2").removeClass("active");
				$("#tab3").addClass("active");
				$("#tab4").removeClass("active");
				$("div.tabc3").customFadeIn(1);
				$("div.tabc1").css("display", "none");
				$("div.tabc2").css("display", "none");
				$("div.tabc4").css("display", "none");
			break;
			case "tab4":
				$("#tab1").removeClass("active");
				$("#tab2").removeClass("active");
				$("#tab3").removeClass("active");
				$("#tab4").addClass("active");
				$("div.tabc4").customFadeIn(1);
				$("div.tabc1").css("display", "none");
				$("div.tabc2").css("display", "none");
				$("div.tabc3").css("display", "none");
			break;
		}
		return false;
	});
});
(function($) {
    $.fn.customFadeIn = function(speed, callback) {
        $(this).fadeIn(speed, function() {
                if(jQuery.browser.msie)
                        $(this).get(0).style.removeAttribute('filter');
                if(callback != undefined)
                        callback();
        });
    };
    $.fn.customFadeOut = function(speed, callback) {
        $(this).fadeOut(speed, function() {
                if(jQuery.browser.msie)
                        $(this).get(0).style.removeAttribute('filter');
                if(callback != undefined)
                        callback();
        });
    };
})(jQuery);

