function ptTabs(id,initial)
{
    var globalCurrId = "#"+id;
    var tabsNum = $(globalCurrId+" .ptTabMenu div[corr]").length;
    if(initial != undefined && initial<=tabsNum && initial>0)
        $(globalCurrId+" .ptTabMenu div[corr=ptTab"+initial+"]").addClass("active");
    else
        $(globalCurrId+" .ptTabMenu div[corr=ptTab1]").addClass("active");
    
    var activeTab = $(globalCurrId+" .ptTabMenu div.active").attr("corr");
        
    var contentLength = $(globalCurrId+" .ptContentTab div").length;
    for(var i = 1;i <= contentLength; i++)
        $(globalCurrId+" .ptContentTab div[id=ptTab"+i+"]").css("display","none");
       
    $(globalCurrId+" .ptContentTab div#"+activeTab).css("display","block");
    $(globalCurrId+" .ptContentTab div#"+activeTab).children("*").css("display","block");

    if (globalCurrId == "#mrssEntry") {
        $(globalCurrId+" .ptTabMenu div[corr]").css("background-image","url('/ptubeTabUI/imgs/inactive_mrss_tab.png')");
        $(globalCurrId+" .ptTabMenu div[corr="+activeTab+"]").css("background-image","url('/ptubeTabUI/imgs/active_mrss_tab.png')");
    } else {
        $(globalCurrId+" .ptTabMenu div[corr]").css("background-image","url('/ptubeTabUI/imgs/inactiveBGnew.png')");
        $(globalCurrId+" .ptTabMenu div[corr="+activeTab+"]").css("background-image","url('/ptubeTabUI/imgs/activeBGnew.png')");
    }

    $(globalCurrId+" .ptTabMenu div").bind("click",globalCurrId,function(e){
        var corrVal = $(this).attr("corr");
        if (globalCurrId == "#mrssEntry") {
            $(globalCurrId+" .ptTabMenu div[corr]").css("background-image","url('/ptubeTabUI/imgs/inactive_mrss_tab.png')");
            $(globalCurrId+" .ptTabMenu div[corr="+corrVal+"]").css("background-image","url('/ptubeTabUI/imgs/active_mrss_tab.png')");
        } else {
            $(globalCurrId+" .ptTabMenu div[corr]").css("background-image","url('/ptubeTabUI/imgs/inactiveBGnew.png')");
            $(globalCurrId+" .ptTabMenu div[corr="+corrVal+"]").css("background-image","url('/ptubeTabUI/imgs/activeBGnew.png')");
        }
        $(globalCurrId+" .ptTabMenu div").removeClass("active");
        $(globalCurrId+" .ptTabMenu div[corr="+corrVal+"]").addClass("active");
        var contentLength = $(globalCurrId+" .ptContentTab div").length;
        for(var i = 1;i <= contentLength; i++)
            $(globalCurrId+" .ptContentTab div[id=ptTab"+i+"]").css("display","none");
        $(globalCurrId+" div#"+corrVal).css("display","block");
        $(globalCurrId+" div#"+corrVal).children("*").css("display","block");
        if(globalCurrId == "#standardWidgetTab" && corrVal == "ptTab2"){
            showVideoPage();
        }
        if(globalCurrId == "#personalizeFeedTab")
            showHideVideoAddEle(document.getElementById('personalizeTabFeedID').value);

        if(id == "templatesTab") {
            showHideViews(corrVal);
        }
            
});
}
