$(document).ready(function() {
    $('a[href*=#].jump').click(function() {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
    && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
      || $('[name=' + this.hash.slice(1) + ']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body')
        .animate({ scrollTop: targetOffset }, 1000);
                return false;
            }
        }
    });
    
    //extracting the page name
    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

    switch (sPage) {
        case "TransactionHistory.aspx":
            $("ul.tabs li#history-tab").addClass("active").show(); //Activate first tab	
            break;
        case "UpdatePersonalDetails.aspx":
            $("ul.tabs li#details-tab").addClass("active").show(); //Activate first tab
            break;
        case "ChangePassword.aspx":
            $("ul.tabs li#password-tab").addClass("active").show(); //Activate first tab
            break;
        case "PartnerCard.aspx":
            $("ul.tabs li#partner-tab").addClass("active").show(); //Activate first tab
            break;
        case "ProfitDonation.aspx":
            $("ul.tabs li#profit-tab").addClass("active").show(); //Activate first tab
            break;
        case "ReplaceCard.aspx":
            $("ul.tabs li#replacement-tab").addClass("active").show(); //Activate first tab
            break;
        case "YourProfit.aspx":
            $("ul.tabs li#your-profit-tab").addClass("active").show(); //Activate first tab	
            break;
    }
    //Default Action
    //$("ul.tabs li:first").addClass("active").show(); //Activate first tab	
});












