$(function(){
    $('div.round_corner_bottom').corner("bl 8px").corner("br 8px");
    $('.round_corner_top').corner("top 8px");
    $('div.round_corner_exltop').corner("bl 8px").corner("tr br 8px");
    $('h3.round_corner_top').corner("top 8px");
    $('div.mini_notification_box').corner("round 8px");
    $('div.boxtype3').corner('8px');
    $('.round_corner').corner('round 8px');
    $('div.boxtype1 div.inner').corner('bottom 8px');
    $('p.back_top a').click(function(){
     $('html, body').animate({scrollTop: '0px'}, 300);
     return false;
    });
    $("div.menu li a").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();

		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;

		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];

		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;

		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
    $('p.return a').click(function(){
     $('html, body').animate({scrollTop: '0px'}, 300);
     return false;
    });
    
    $(document).ready(function() {
    $('.catTabs_divs').hide();
    $('.catTabs_curr_div').show();
    $('.catTabsLinks').each(function() {
        $(this).click(function() {
            //alert(jQuery(this).attr('id'));
            var info = $(this).attr('id').split('_');
            catTabs_show(info[1], info[0]);
        });
    });
});

function catTabs_show(tab,post){
		
		$('.catTabs_divs').each(function() {
            $(this).hide();
        });
        $('#catTabs_ul_'+post + ' li').each(function() {
            $(this).removeClass('catTabs_curr');
        });
            $('#cat_posts_footer').removeClass();
        $('#catTabs_li_'+tab+'_'+post).addClass('catTabs_curr');
        $('#cat_posts_footer').addClass('catTabs_'+tab);
		$("#catTabs_"+tab+"_"+post).show();
		self.focus();

		//Cookies
		var expire = new Date();
		var today = new Date();
		expire.setTime(today.getTime() + 3600000*24);
		document.cookie = "catTabs_"+post+"="+tab+";expires="+expire.toGMTString();

}

function posTabsShowLinks(tab){
	if (tab) window.status=tab;
	else window.status="";
}

function catTabs_getCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

    
});