﻿function cancel()
{
if(confirm("您将要取消傲盾用户注册向导，您确定要继续吗?"))
{
window.location="LoginTerminal2.aspx";
}
}
function preStep(funRef)
{
	if(funRef)
	    if(!funRef())
	        return false;
	var tb=event.srcElement.parentNode.parentNode; 
    var stepIndex= getStepIndex(tb.id);
	if(stepIndex>0)
        stepIndex=stepIndex-1;
     else 
		return;     
    tb.style.display="none";
	document.getElementById("step"+stepIndex).style.display="block";  
}
function finishStep()
{
	document.getElementById("notice").style.display='none';
    document.getElementById("step0").style.display="none";
    document.getElementById("finish").style.display="block";   
}
function finish()
{
    window.location="LoginTerminal2.aspx";
}
function nextStep(funRef)
{   
    if(funRef)
	    if(!funRef())
	        return false;
    var tb=event.srcElement.parentNode.parentNode;
    var stepIndex= getStepIndex(tb.id);
    stepIndex=stepIndex+1;  
    tmp=document.getElementById("step"+stepIndex);
    if(tmp)
    {
        tb.style.display="none";
	    tmp.style.display="block";
	}
}
function getStepIndex(idstr)
{
    if(idstr.length==0)
        return 0;
    else
    {
        if(idstr.length==1)
        {
            if(isNaN(parseInt(idstr)))
                return 0;
            else
               return parseInt(idstr);         
        }
        else
        {
			if(!isNaN(parseInt(idstr.charAt(idstr.length-2))))
		        return parseInt(idstr.charAt(idstr.length-2))*10+parseInt(idstr.charAt(idstr.length-1));
		    else
		    {
		        if(isNaN(parseInt(idstr.charAt(idstr.length-1))))
		            return 0;
		        else
				    return parseInt(idstr.charAt(idstr.length-1));
		    }   
		}
    }    
}