function setFocusTo(controlID) {
	// set focus to a control based on it's name value
	// for .NET controls this may be in the form "NewsletterConfirm1:txtCID"
  	var control;
  	control = getControlByName(controlID);
  	if (control) {
  		control.focus();
  	}
}

function getControlByName(controlID) {
	var element;
  	// search the forms and elements
  	var fLength;
  	fLength = document.forms.length;
  	// first check form names for a match with controlID
	for (f = 0; f < fLength; f++) {
  		if (document.forms[f]) {
  			if (document.forms[f].name.toLowerCase() == controlID.toLowerCase()) {
				element = document.forms[f];
  				break;
  			} 
  		}
  	}
 	if (element == null) {
 		// form names did not match the controlID so
 		// search the elements collection for each form
		for (f = 0; f < fLength; f++) {
  			if (document.forms[f]) {
  				var eLength;
  				eLength = document.forms[f].elements.length;
  				for (i = 0; i < eLength; i++) {
  					if (document.forms[f].elements[i]) {
  						if (document.forms[f].elements[i].name.toLowerCase() == controlID.toLowerCase()) {
  							element = document.forms[f].elements[i];
  							break;
  						}
  					}
  				}
  			}
  			// if the element was found then stop searching the
  			// remaining forms
  			if (element != null) {
  				break;
  			}
  		}
  	}
  	return element;
}

function helpPopup(helpID) {
	helpwin = window.open("help_" + helpID + ".htm","helpWindow","directory=yes,toolbar=no,scrollbars=yes,resizable=no,location=no,width=500,height=450");
	helpwin.focus();
}