function goatto(lnk){
window.location = lnk;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validateForm(){
	returnValue = true
	for(i=0; i<brokerForm.state_choices.length; i++)
	brokerForm.state_choices.options[i].selected = true;
	return returnValue;
}

function moveOption(fromSelectBxID, toSelectBxID)
{
      var fromSelectBx = eval("document.brokerForm." + fromSelectBxID);
      var toSelectBx   = eval("document.brokerForm." + toSelectBxID);

      if(fromSelectBx.selectedIndex != -1)
      {
  
            var fromSelectBxLen = fromSelectBx.length;
            for(i=0; i<fromSelectBxLen; i++)
                  if(fromSelectBx.options[i].selected)
                        toSelectBx.options[toSelectBx.length] = new Option(fromSelectBx.options[i].text, fromSelectBx.options[i].value, false, false);

   
            for(i=fromSelectBxLen-1; i>=0; i--)
                  if(fromSelectBx.options[i].selected)
                        fromSelectBx.options[i] = null;
      }
}

var wasSet;
wasSet = false
function setUname(aName){
	if(aName.length > 1){
	wasSet = true
	document.brokerREQ.uname.value=aName;
	}
	if(document.brokerREQ.lname.value.length > 0 && !wasSet && document.brokerREQ.uname.value.length < 1){
	waSet = true;
	document.brokerREQ.uname.value=trimString(document.brokerREQ.lname.value);
}

}
function trimString (str) {
	var uStr;
  str = this != window? this : str;
  uStr = str.replace(/^\s+/g, '').replace(/\s+$/g, '');
  return uStr.toLowerCase();
}