function popUpNav(URL,width,height)
{
    newWindow=window.open(URL,'newWindow','toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height+',left=0,top=0');
    newWindow.focus();
    return false;
}
function popUpNavNoResize(URL,width,height)
{
    newWindow=window.open(URL,null,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',left=0,top=0');
    newWindow.focus();
    return false;
}
var classesInformed=false;
function informClasses()
{
    if(classesInformed==false)
    {
        popUpNav('/help/html/healthclassification2.htm',750,550);
    }
    classesInformed=true;
}
function informClassesUniversal()
{
    if(classesInformed==false)
    {
        popUpNav('/help/html/healthclassification3.htm',750,550);
    }
    classesInformed=true;
}
function informClassesSmoker()
{
    if(classesInformed==false)
    {
        popUp2('/help/html/healthclasssmoker2.htm',450,700);
    }
    classesInformed=true;
}
function popUpSpecial(url)
{
    sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
    self.name="mainWin";
}
var isNN=(navigator.appName.indexOf("Netscape")!=-1);

function autoTab(input,len,e)
{
    var keyCode=(isNN)?e.which:e.keyCode;
    var filter=(isNN)?[0,8,9]:[0,8,9,16,17,18,37,38,39,40,46];
    if(input.value.length>=len&&!containsElement(filter,keyCode))
    {
        input.value=input.value.slice(0,len);input.form[(getIndex(input)+1)%input.form.length].focus();
    }
    function containsElement(arr,ele)
    {
        var found=false,index=0;
        while(!found&&index<arr.length)
            if(arr[index]==ele)
                found=true;
        else index++;
        return found;
    }
    function getIndex(input)
    {
        var index=-1,i=0,found=false;
        while(i<input.form.length&&index==-1)
            if(input.form[i]==input)
                index=i;
        else i++;
        return index;
    }
    return true;
}
function alternate(id)
{ 
    if(document.getElementsByTagName)
    {    
        var table = document.getElementById(id);     
        var rows = table.getElementsByTagName("tr");   
        var end = rows.length - 1;   
        for(i = 0; i < rows.length; i++)
        {     
            if(i % 2 == 0 && i != 0 && i != end)
            {       
                rows[i].className = "even";     
            }
            else
            {      
                rows[i].className = "odd";     
            }   
        } 
    }
}
