// form.js

function setFocusAndAlert(eElement, strMsg) {
alert(strMsg);
eElement.focus();
return false;
}

function selectOption(theElement, strOption) {
for (var iLoop = 0; iLoop < theElement.options.length; iLoop++) {
//alert(theElement.options[iLoop].text);
if (theElement.options[iLoop].text == strOption) {
theElement.options[iLoop].selected = true;
}
else {
theElement.options[iLoop].selected = false;
}
}
}

function selectOptionByValue(theElement, nOption) {
for (var iLoop = 0; iLoop < theElement.options.length; iLoop++) {
//alert(theElement.options[iLoop].text);
if (theElement.options[iLoop].value == nOption) {
theElement.options[iLoop].selected = true;
}
else {
theElement.options[iLoop].selected = false;
}
}
}

function isEmail(strEmail) {
if (strEmail.indexOf("@") == -1) return false; else return true;
}

