﻿function KeyDownHandler(btn)
{
	// process only the Enter key
	if (event.keyCode == 13)
	{
		// cancel the default submit
		event.returnValue = false;
		event.cancel = true;
		
		// submit the form by programmatically clicking the specified button
		btn.click();
	}
}


function toggleDiv(divid, loc)
{

    if (loc != "")
    {
        document.location = loc;
    }
    else {

        if (document.getElementById(divid).style.display == 'none')
        {
            document.getElementById(divid).style.display = 'block';
        }
        else
        {
            document.getElementById(divid).style.display = 'none';
        }
    }

}


function checkForNumbers(inpString)
{

    var strIntegers = ".0123456789";
    var i = 0;

    for (i = 0; i <= (inpString.length - 1); i++)
    {
        if (strIntegers.indexOf(inpString.charAt(i)) == -1)
        {
            return false;
        }
    }

    return true;

}


function changeDDL(target, val)
{

	for(var i = 0, limit = target.options.length; i < limit; ++i)
	{
		if(target.options[i].value == val)
		target.options[i].selected=true;
	}
	
}