function setFocus(asCtrlName)
{	
	if (document.all(asCtrlName) != null){
		document.all(asCtrlName).focus();
	}
	return false;
}

function setDefaultDate(asCtrlName)
{
	if (document.all(asCtrlName) != null){
		if (document.all(asCtrlName).value == ''){
			document.all(asCtrlName).value=todayStr();
		}
	}
}

//--Returns the current date in mm/dd/yy format as a string.
function todayStr() {
	var today=new Date()
	return (today.getMonth() + 1) + "/" + today.getDate() + "/" + today.getFullYear()
}

function setStateOregon(asCtrlName)
{
	if (document.all(asCtrlName) != null){
		if (document.all(asCtrlName).value == 'o' ||document.all(asCtrlName).value == 'O'){
			document.all(asCtrlName).value = 'OR';
		}
	}
}

//checks all DataGrid CheckBoxes with the given name with the given value
function CheckAllDataGridCheckBoxes(aspCheckBoxID, checkVal) 
{

	//alert(aspCheckBoxID + ' ' + checkVal);
	    re = new RegExp(':' + aspCheckBoxID + '$');  
        //generated control name starts with a colon
        for(i = 0; i < document.forms[0].elements.length; i++) {

            elm = document.forms[0].elements[i];

            if (elm.type == 'checkbox') {

                if (re.test(elm.name)) {

                    elm.checked = checkVal;

                }
            }

		}       
}

