function HighlightRow(radioBtn, isHighlight)
{
    var highlightColor = GetHighlightRow(isHighlight);
    var fontWeight = GetFontWeight(isHighlight);
    radioBtn.style.background = highlightColor;
    radioBtn.parentElement.parentElement.style.background = highlightColor;
    radioBtn.nextSibling.style.fontWeight = fontWeight;
}

function GetHighlightRow(isHighlight)
{    
    if(isHighlight)
        return "#E1D7BE";
    return "White"
}

function GetFontWeight(isHighlight)
{
    if(isHighlight)
        return "bold";
    return "normal"
}

function SetRadioBtnFocus()
{
   // var radioBtnList = document.getElementsByTagName("input");
   // radioBtnList[3].focus();
}

function MoveAutoTab(inputId, characterLimit, increment)
{
    var currentInput = document.getElementById(inputId);
    if(currentInput.value.length == characterLimit)
    { 
        var inputTextBoxes = GetSpecificInput("text");
        for(var x = 0; x < inputTextBoxes.length; x++)
        {
            if(inputId == inputTextBoxes[x].id)
            {
                var tabMoveValue = GetAutoTabMoveValue(x + increment, inputTextBoxes.length);
                if(tabMoveValue < inputTextBoxes.length)
                    inputTextBoxes[tabMoveValue].focus();
                else
                    MoveToContinueButton();
            }
        }
    }
}

function GetAutoTabMoveValue(moveValue, numberOfBoxes)
{
    if(moveValue == numberOfBoxes)
        return 1;
    return moveValue;
}

function MoveToContinueButton()
{
    var inputButtons = GetSpecificInput("submit");
    inputButtons[inputButtons.length - 1].focus();
}

function GetSpecificInput(type)
{
    var inputTags = document.getElementsByTagName("input");
    var inputTextBoxes = new Array();
    for(var x = 0; x < inputTags.length; x++)
    {
        if(inputTags[x].type == type)
            inputTextBoxes.push(inputTags[x]);
    }
    return inputTextBoxes;
}

function HighlightLabel(label, isHighlight)
{
    if(isHighlight)
    {
        label.style.fontWeight = "bold";
    }
    else
    {
        label.style.fontWeight = "normal";
    }
}

function verifyContinue(surveyDate, surveyName) 
{
	var argsObject = new Object();
	argsObject.title = "Duplicate SSN Notice";
	argsObject.message = "Notice to Administrator:\nThe ID entered already has a survey taken on: " + surveyDate + " with survey version: " + surveyName + ".";
	argsObject.trueText = "Proceed with Survey";
	argsObject.falseText = "Quit Now (back to login)";
	if (window.showModalDialog("DuplicateSurveyChoice.html", argsObject, "dialogWidth:400px;dialogHeight:200px;titlebar:no;status:no;resizeable:no;scroll:no")) return true;
	window.location.href = "login.aspx";
	return false;
}

function SetLoginFocus()
{
    var textBoxes = GetSpecificInput("text");
    textBoxes[0].focus();
}
