﻿var _activeTab = '';
function InitTabs(id)
{
    $('#' + id).find('a').click(function()
    {
        removeActive(id);
        this.className = 'active';
        $('#' + _activeTab).hide();
        $('#' + this.getAttribute('tabid')).show(150);
        _activeTab = this.getAttribute('tabid');
    });

    $('#' + id).find('a').each(function()
    {
        if (this.className == 'active')
        {
            _activeTab = this.getAttribute('tabid');
            return;
        }
    });
 }

 function removeActive(id)
 {
     $('#' + id).find('a').attr('class', '');
 }