//<!--

document.write('<link href="/plugins/AutoForm/Tabbed.css" type="text/css" rel="Stylesheet" />');

function MakeContinueLink(nextTabID)
{
    document.write('<div class="submitRow"><a href="javascript:ShowNextStep(' + nextTabID + ');" title="View Step ' + nextTabID + '" class="continueLink">Continue to step ' + nextTabID + '</a></div>');
}

function ShowNextStep(stepID)
{
    if (stepID > 1)
    {
        var previousStepID = stepID - 1;
        if (document.getElementById("Step" + previousStepID) != null)
        {
            document.getElementById("Step" + previousStepID).style.display = "none";
            document.getElementById("Tab" + previousStepID).className = "tab";
        }
    }
    
    if (document.getElementById("Step" + stepID) != null)
    {
        document.getElementById("Step" + stepID).style.display = "block";
        document.getElementById("Tab" + stepID).className = "tab highlight";
    }
}


function MakeTabLink(tabID, totalTabs, linkText)
{
    document.write('<div class="tab' + (tabID == 1 ? ' highlight' : '') + '" id="Tab' + tabID + '"><a href="javascript:ShowStep(' + tabID + ', ' + totalTabs + ');" title="View Step ' + tabID + '">'+linkText+'</a></div>');
}

function ShowStep(stepID, totalTabs)
{
    for (i=0; i<=totalTabs; i++)
    {
        if (document.getElementById("Step" + i) != null)
        {
            document.getElementById("Step" + i).style.display = (i == stepID ? "block" : "none");
            document.getElementById("Tab" + i).className = 'tab ' + (i == stepID ? "highlight" : "");
        }
    }
}

//-->