  var SWL_submit_loc = '';
  var SWL_top = '400px';
  var SWL_left = '300px';
  var SWL_width = '362px';
  var SWL_rowID = 0;
  var SWL_lastSearch='';
  var SWL_rowCount;
  var SWL_xmlHttpRequest;
  var SWL_lastSearchKeyPress = 0;
  var SWL_timerId = 0;
  var SWL_hidden = true;
  var SWL_isIE = false;
  var SWL_appName = navigator.appName;
  var SWL_userAgent = navigator.userAgent;
  var sf = SWL_userAgent.indexOf('Safari');
  var sp = SWL_userAgent.indexOf('Opera');  
  var showFull = true;
  if (((sf != null) && (sf > -1)) || ((sp != null) && (sp > -1)))
  {
  	showFull = false;  
  }  
  var SWL_swlNavDiv = null;
  var SWL_swlNavDivChild = null;
  var SWL_searchStr = null;
  if(SWL_appName && SWL_appName.indexOf('Explorer') != -1) { SWL_isIE = true; } else { SWL_isIE = false; }
  var SWL_hasGetElementById = 0;
  if(document.getElementById) { SWL_hasGetElementById = 1;}
  var SWL_hasDocumentAll = document.all;
  
  function SWL_getElementById(id) {
    if(SWL_hasGetElementById) return document.getElementById(id);
    if(SWL_hasDocumentAll) return document.all[id];
  }
  
  function setNavDivs(maindiv, childdiv){
  	SWL_swlNavDiv = SWL_getElementById(maindiv);
	  SWL_swlNavDivChild = SWL_getElementById(childdiv);
	}
	 
  function SWL_showBox(elem) {
    if (showFull)
    {
	    if(!SWL_searchStr) { SWL_searchStr = SWL_getElementById('searchStr'); }
	    if(!elem) {
	      if(!SWL_swlNavDiv) { SWL_swlNavDiv = SWL_getElementById('swlNavDiv'); }
	      if(!SWL_swlNavDivChild) { SWL_swlNavDivChild = SWL_getElementById('swlNavDivChild'); }
	      SWL_swlNavDivChild.style.top = '0px';
	      elem = SWL_swlNavDiv;
	    }
	    if(elem.scrollTop) { elem.scrollTop = 0; }
	    elem.style.display = 'block';
	    elem.style.visibility = 'visible';
    SWL_hidden = false;
    }
  }
  function SWL_hideBox(elem) {
    if(!elem) {
      if(!SWL_swlNavDiv) { SWL_swlNavDiv = SWL_getElementById('swlNavDiv'); }
      elem = SWL_swlNavDiv;
    }
    if(!elem){
    	return;
    }
    elem.style.display = 'none';
    elem.style.visibility = 'hidden';
    SWL_hidden = true;
  }
  function SWL_resultHiEvent(event) {
    var target = null;
    var parentTarget = null;
    var nameTarget = null;
    var typeTarget = null;

    if(!event) { target = window.event.srcElement; } else { target = event.target; }
    if(target != null) {
      var id = target.id;

      var parentId = id;
      var nameId = id + 'name';
      var typeId = id + 'type';

      var indexOfName = id.indexOf('name');
      if(indexOfName != -1) {
        nameId = id;
        parentId = id.substring(0, indexOfName);
        typeId = parentId + 'type';

        nameTarget = target;
        parentTarget = SWL_getElementById(parentId);
        typeTarget = SWL_getElementById(typeId);

      } else {
        var indexOfType = id.indexOf('type');
        if(indexOfType != -1) {
          typeId = id;
          parentId = id.substring(0, indexOfType);
          nameId = parentId + 'name';

          typeTarget = target;
          parentTarget = SWL_getElementById(parentId);
          nameTarget = SWL_getElementById(nameId);
        } else {
          parentTarget = target;
          typeTarget = SWL_getElementById(typeId);
          nameTarget = SWL_getElementById(nameId);
        }
      }
      if(parentTarget != null) {
        SWL_resultHi(parentTarget);
        SWL_resultHi(nameTarget);
      }
    }
  }
  function SWL_resultLoEvent(event) {
    var target = null;
    var parentTarget = null;
    var nameTarget = null;
    var typeTarget = null;

    if(!event) { target = window.event.srcElement; } else { target = event.target; }
    if(target != null) {
      var id = target.id;

      var parentId = id;
      var nameId = id + 'name';
      var typeId = id + 'type';

      var indexOfName = id.indexOf('name');
      if(indexOfName != -1) {
        nameId = id;
        parentId = id.substring(0, indexOfName);
        typeId = parentId + 'type';

        nameTarget = target;
        parentTarget = SWL_getElementById(parentId);
        typeTarget = SWL_getElementById(typeId);

      } else {
        var indexOfType = id.indexOf('type');
        if(indexOfType != -1) {
          typeId = id;
          parentId = id.substring(0, indexOfType);
          nameId = parentId + 'name';

          typeTarget = target;
          parentTarget = SWL_getElementById(parentId);
          nameTarget = SWL_getElementById(nameId);

        } else {
          parentTarget = target;
          typeTarget = SWL_getElementById(typeId);
          nameTarget = SWL_getElementById(nameId);
        }
      }

      if(parentTarget != null) {
        SWL_resultLo(parentTarget);
        SWL_resultLo(nameTarget);
      }
    }
  }
  function SWL_resultHi(elem) {
    if(elem) {
      elem.style.zIndex = '8000';
      id = elem.id;
      elem.style.cursor = 'pointer';
      elem.style.backgroundColor = '#FFFFFF';
    if(elem.className == 'SWL_result') { elem.style.color = '#000'; } else {
      elem.style.color = '#F00';
      elem.style.textDecoration = 'underline';
    }
    var newRowID = id.substr(9).replace(/[^\d]/g,'');
    SWL_rowID = newRowID;
    }
  }
  function SWL_resultLo(elem) {
    if(elem) {
      elem.style.zIndex = '8000';
      id = elem.id;
      elem.style.cursor = 'default';
      elem.style.backgroundColor = '#F5F5F5';
      elem.style.color = '#555';
      elem.style.textDecoration = 'none';
      var newRowID = id.substr(9).replace(/[^\d]/g,'');

      SWL_rowID = newRowID;
    }
  }
  function SWL_suggestEvent(event) {
    if(!event) { event = window.event; }
    elem = event.target;
		
    if(!elem) { elem = event.srcElement; }
	//			alert("from event orig elem id="+elem.id + " target/src " +elem + " type " + elem.type + " value " + elem.value);
if (elem.value != null){
	 eval(elem.value);
	 return;
	 }
      var anchorIndex = elem.id.indexOf('anchor');
    if(anchorIndex != -1) {
//		alert("orig elem="+elem.id.substring(0, anchorIndex));
//				alert("orig elem id="+elem.id);

      elem = SWL_getElementById(elem.id.substring(0, anchorIndex));
    } else {
      var nameIndex = elem.id.indexOf('name');
      if(nameIndex != -1) {
        elem = SWL_getElementById(elem.id.substring(0, nameIndex));
      } else {
        var typeIndex = elem.id.indexOf('type');
        if(typeIndex != -1) { elem = SWL_getElementById(elem.id.substring(0, typeIndex)); }
      }
    }
//    SWL_suggest(elem);*/
		//alert("getting here" + event.target + " more "+anchorIndex);
  }
  function SWL_suggest(elem) {
    id = elem.id;
    if(elem.childNodes[0].innerHTML) {
      term = elem.childNodes[0].childNodes[0].href;
    } else if(elem.childNodes[1]) {
      term = elem.childNodes[1].childNodes[0].href;
    }
    document.location = term;
  }
  function SWL_setRowCount(r) { window.SWL_rowCount = r; }
  function SWL_checkKeycode(e) {
    var keycode;
    var eventObj = e;
    if(window.event) {
      eventObj = window.event;
      keycode = window.event.keyCode;
    } else if(e) {
      keycode = e.which;
    }
    if(!SWL_swlNavDiv) { SWL_swlNavDiv = SWL_getElementById('swlNavDiv'); }
    elem = SWL_swlNavDiv;

    if(SWL_hidden == false) {
      if(keycode == 8) {
        if(!SWL_searchStr) { SWL_searchStr = SWL_getElementById('searchStr'); }
        var searchStrLen = SWL_searchStr.value.length;
        if(searchStrLen > 3) { SWL_searchKeyPress(searchStrLen); } else { SWL_searchClear(); }
      } else if(keycode == 40) {
        advance();
        return false;
      } else if(keycode == 38) {
        reverse();
        return false;
      } else if(keycode == 13) {
        return SWL_submitSearchForm(SWL_searchStr.form);
      } else if(keycode == 27) {
        var searchStr = SWL_searchStr.value;
        if(searchStr.length < 2) { SWL_searchClear(); }
      }
    }
    return true;
  }
  function SWL_submitSearchForm(form) {
    if(SWL_rowID) {
          var hiDiv = SWL_getElementById('swl_result'+SWL_rowID);
          if(hiDiv) {
            var divAnchors = hiDiv.getElementsByTagName('A');
            if(divAnchors && divAnchors.length > 0) {
              var newSearchStr = divAnchors[0].innerHTML;
              if(divAnchors[0].name != null && divAnchors[0].name != '') {
                newSearchStr = divAnchors[0].name + ' ' + divAnchors[0].innerHTML;
              }
              SWL_submit_loc = divAnchors[0].href;
            }
          }
    }
    if(SWL_submit_loc && SWL_submit_loc != '') {
      document.location = SWL_submit_loc;
      return false;
    } 
    return true;
  }
  function advance() {
    var id;
    if(SWL_rowID < window.SWL_rowCount) {
      id = 'swl_result'+SWL_rowID;
      SWL_resultLo(SWL_getElementById(id));

      SWL_rowID ++;
      id = 'swl_result'+SWL_rowID;
      SWL_resultHi(SWL_getElementById(id));
      if(SWL_rowID > 10) { SWL_swlNavDiv.scrollTop = SWL_swlNavDiv.scrollTop + 21; }
    }

  }
  function reverse() {
    var id;
    if(SWL_rowID > 1) {
      id = 'es_result'+SWL_rowID;
      SWL_resultLo(SWL_getElementById(id));
      SWL_rowID --;
      id = 'es_result'+SWL_rowID;
      SWL_resultHi(SWL_getElementById(id));
      if(SWL_rowID <= 11) { SWL_swlNavDiv.scrollTop = 0; }
    }
  }
	

	
  function buildNewSearchRow(index, ind, link, linkText, extra, desc, on_click) { 
    var div = document.createElement('div');
    var rowId = 'swl_result' + (index + 1);

    div.id = rowId;
		
    div.onclick=SWL_suggestEvent;
			//div.onclick=on_click;
//		alert(div.onclick);
    div.onmouseover=SWL_resultHiEvent;
    div.onmouseout=SWL_resultLoEvent;

    div.style.position = 'relative';
    div.style.borderBottom = '1px solid #E4E4E4';
    div.style.height = '15px';


    if(ind != null) { div.style.marginLeft = '20px'; }
    var nameDiv = document.createElement('div');
    nameDiv.id = rowId + 'name';
    //nameDiv.onmousedown=on_click;
    //nameDiv.onclick=on_click;
    nameDiv.onclick=SWL_suggestEvent;
		nameDiv.onmousedown=SWL_suggestEvent;
    nameDiv.onmouseover=SWL_resultHiEvent;
    nameDiv.onmouseout=SWL_resultLoEvent;

    nameDiv.style.position = 'absolute';
    nameDiv.style.fontFamily = 'Verdana, sans serif';
    nameDiv.style.fontSize = '9pt';

    var anchor = document.createElement('a');
    anchor.id = rowId + 'anchor';
//    anchor.onmousedown=on_click;
	//	    anchor.onclick=on_click;
//	  anchor.onmousedown=SWL_suggestEvent;
		    anchor.onclick=SWL_suggestEvent;
    anchor.style.textDecoration = 'none';
    anchor.style.color = '#555';
    anchor.href = link;
    if(extra != null) { anchor.name = extra; }
		if (on_click != null) {anchor.value = on_click;}
    anchor.appendChild(document.createTextNode(linkText));
    nameDiv.appendChild(anchor);
    var typeDiv = document.createElement('div');
    typeDiv.id = rowId + 'type';
//    typeDiv.onclick=on_click;
  //  typeDiv.onmousedown=on_click;
		typeDiv.onclick=SWL_suggestEvent;
    typeDiv.onmousedown=SWL_suggestEvent;
    typeDiv.onmouseover=SWL_resultHiEvent;
    typeDiv.onmouseout=SWL_resultLoEvent;

    typeDiv.style.position = 'relative';
    typeDiv.style.verticalAlign = 'bottom';
    typeDiv.style.textAlign = 'right';
    typeDiv.style.fontFamily = 'Verdana, sans serif';
    typeDiv.style.fontSize = '8pt';
    typeDiv.style.color = '#888'


    if(desc) { typeDiv.appendChild(document.createTextNode(desc)); }
    div.appendChild(nameDiv);
    div.appendChild(typeDiv);
	//	alert(anchor.onclick);
 
		//alert("got done");
    return div;
  }
  function suggestSearchXML(url) {
    /* if( SWL_isIE == true ) { url = 'http://swl.go.com' + url; } */
    if(window.XMLHttpRequest) {
      SWL_xmlHttpRequest = new XMLHttpRequest();
      SWL_xmlHttpRequest.onreadystatechange = processReqChange;
      SWL_xmlHttpRequest.open('GET', url, true);
      SWL_xmlHttpRequest.send(null);
    } else if(window.ActiveXObject) {
      SWL_xmlHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');
      if(SWL_xmlHttpRequest) {
        SWL_xmlHttpRequest.onreadystatechange = processReqChange;
        SWL_xmlHttpRequest.open('GET', url, true);
        SWL_xmlHttpRequest.send();
      }
    }
  }
  function processReqChange() {
    if (SWL_xmlHttpRequest != null) {
      if(SWL_xmlHttpRequest.readyState == 4) {
         if(SWL_xmlHttpRequest.status == 200) {
           SWL_rowCount = 0;
           SWL_rowID = 0;
//					 alert("got this: "+SWL_xmlHttpRequest.responseText);
           var numParsed = parseSuggestXML(SWL_xmlHttpRequest.responseXML.documentElement,
           SWL_xmlHttpRequest.responseText);
          if(numParsed && numParsed > 0) { SWL_showBox(SWL_swlNavDiv); }
        } else {
        }
      }
    }
  }
  function parseSuggestXML(xmlDoc, xml) {
    var numberSuggested = 0;
    if(!SWL_searchStr) { SWL_searchStr = SWL_getElementById('searchStr'); }
    var currentSearchStr = SWL_searchStr.value;

    var temp = xmlDoc.getElementsByTagName('searchStr');
    if(temp.length > 0 && temp[0].firstChild != null) {

      var searchStr = temp[0].firstChild.data;
	//		alert("currentSearchStr.indexof searchstr: "+currentSearchStr+" "+currentSearchStr.indexOf(searchStr) + " searchstr " + searchStr);
      if(currentSearchStr.indexOf(searchStr) != -1) {
        var results = xmlDoc.getElementsByTagName('result');
				//alert("results "+results);

//        var time = xmlDoc.getElementsByTagName('time')[0].firstChild.data;
//        numberSuggested = xmlDoc.getElementsByTagName('count')[0].firstChild.data;
					//	alert("results length " + results.length);

        SWL_setRowCount(results.length);

        var resultsStr = '';

        if(!SWL_swlNavDivChild) { SWL_swlNavDivChild = SWL_getElementById('swlNavDivChild'); }
        if(!SWL_swlNavDiv) { SWL_swlNavDiv = SWL_getElementById('swlNavDiv'); }
        var currentSearchObj = SWL_swlNavDiv;
            
        currentSearchObj.style.position = 'absolute';
        currentSearchObj.style.top = SWL_top; //'105px';
        currentSearchObj.style.left = SWL_left; //'8px';
        currentSearchObj.style.width = SWL_width; //'404px';
        currentSearchObj.style.border = '1px solid #CCC';
        currentSearchObj.style.backgroundColor = '#F5F5F5';
        currentSearchObj.style.overflow = 'auto';
        if(currentSearchObj.style.overflowx){ currentSearchObj.style.overflowx = 'hidden'; }
        currentSearchObj.style.zIndex = '8000';
        SWL_hideBox(SWL_swlNavDiv);
  
        var clipHeight = 0;
        if(results.length < 10) {
          clipHeight = ((results.length*19) + 3);
        } else {
          clipHeight = ((10*19) + 3);
        }
        
        if (!showFull)
        {
          if (clipHeight > ((4*19) + 3))
          {
            clipHeight = (4*19) + 3;
          }
        }
        
        currentSearchObj.style.height = clipHeight + 'px';
        currentSearchObj = SWL_swlNavDivChild;
        currentSearchObj.innerHTML = '';
        if(results != null) {
          var displayedCount = 0;
          var actualCount = 0;
          for (i = 0; i < results.length; i++) {
					//alert("i = "+ i);
//            var ind = results[i].getAttribute('indent');
            var linkTextNode = results[i].getElementsByTagName('linkText')[0];
            var linkTextExtra = linkTextNode.getAttribute('my_id');
            var navLinkText = linkTextNode.firstChild.data;
            var navUrl = results[i].getElementsByTagName('url')[0].firstChild.data;
            var navDesc = '';
						var on_click = linkTextNode.getAttribute('onClick');
            var node = results[i].getElementsByTagName('desc');
            if(node != null && node.length > 0) { navDesc = node[0].firstChild.data; }
            //alert("navUrl " + navUrl + " id " + linkTextExtra + " navlinktext " + navLinkText);
            currentSearchObj.appendChild(buildNewSearchRow(i, null, navUrl, navLinkText, linkTextExtra, navDesc, on_click));

            actualCount = i + 1;
						displayedCount = displayedCount + 1;
          }

/*          if(displayedCount >= 15) {
            currentSearchObj.appendChild(buildNewSearchRow(actualCount, null, 'http://search.swl.go.com/keyword/search?page=abbreviated&searchString=' + currentSearchStr, 'More >>', null, null));
            SWL_setRowCount(actualCount+1);
          }*/
          if(results.length > 0) { SWL_showBox(SWL_swlNavDiv); }
        }

      }
    } else {
      if(!SWL_swlNavDivChild) { SWL_swlNavDivChild = SWL_getElementById('swlNavDivChild'); }
      SWL_swlNavDivChild.innerHTML = '';
      SWL_hideBox(SWL_swlNavDiv);
    }
		if (results != null){
		    return results.length;
		}
		else {
				 return 0;
			}	 
  }
  function SWL_checkMousedown(event) {
    if(!event) {
      event = window.event;
      target = event.srcElement;
      relatedTarget = event.toElement;
         var targetId = null;
      if(target){ targetId = target.id; }
      if(!target || (targetId != 'swlNavDiv' && targetId != 'searchStr')) {
         if(targetId.indexOf('es_result') == -1) {
           SWL_searchClear();
         }
      }
    }
    return event;
  }
  function SWL_searchBlur(event) {
    if (showFull)
    {
      if(SWL_isIE == false) { SWL_searchClear(); }
    }
  }
  function SWL_searchClear() {
    SWL_hideBox(SWL_swlNavDiv);
//    alert('clearing search str');
    SWL_lastSearch = null;
  }
  
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

var extraSetsArr;
  var lastTotal = 0;
  function SWL_searchKeyPress(numChars, search_fld, curSearchStr, perfFunc, tableName, fieldName, formName, extraSets) {
  	if (curSearchStr != null){
  		SWL_searchStr = curSearchStr;  		
  	}
  	if (!SWL_searchStr){
    	SWL_searchStr = SWL_getElementById('searchStr');
    }
//    if (extraSets != null){
    	extraSetsArr = extraSets;
//    }
  	position = findPos(SWL_searchStr);
  	SWL_top = position[1]+30;
  	SWL_left = position[0];
  	if (perfFunc == null){
  		perfFunc = 'performSearch('+search_fld+')';
  	}
  	else {
  		perfFunc = perfFunc + '(\''+ tableName + '\',\''+ fieldName + '\',\'' +formName+'\')';
  	}
    if (showFull)
    {
    var now = new Date();
    var time = (now.getHours()*60*60*1000) +
           (now.getMinutes()*60*1000) +
           (now.getSeconds()*1000) +
           now.getMilliseconds();
    if(SWL_lastSearchKeyPress > 0 && numChars > 0) {
      if(SWL_timerId == 0) { SWL_timerId = setTimeout(perfFunc, 200); } else {
        if((time - SWL_lastSearchKeyPress) < 200) {
          clearTimeout(SWL_timerId);
          SWL_timerId = setTimeout(perfFunc, 200);
        }
      }
      if (lastTotal > numChars){
      	if (isArray(extraSetsArr)){
    			for (i = 0; i < extraSetsArr.length; i++){
	    			document.getElementById(extraSetsArr[i]).value = "";
	    		}
	  		}
	  	}
      lastTotal = numChars;
    }
    SWL_lastSearchKeyPress = time;
    }
  }
  function trim(s) { return s.replace (/^\s+|\s+$/g,''); }
  function performSearch(search_tbl) {
    SWL_timerId = 0;
    if (!SWL_searchStr){
    	SWL_searchStr = SWL_getElementById('searchStr');
    }
    var searchStr = escape(trim(SWL_getElementById('searchStr').value));
    if(SWL_lastSearch != searchStr) {
      SWL_lastSearch = searchStr;
      if(searchStr.length > 2) { suggestSearchXML('index.php?page_id=101&tbl='+search_tbl+'&trm=' + searchStr); } else {
        if(searchStr.length == 0) { SWL_searchClear(); }
      }
    }
  }

  function performSearchExtended(tableName, fieldName, formName){
  	SWL_timerId = 0;  	
  	if (!SWL_searchStr){
    	SWL_searchStr = escape(trim(SWL_getElementById('searchStr').value));
    }
		
    if(SWL_lastSearch != SWL_searchStr.value) {    	
      SWL_lastSearch = SWL_searchStr.value;
      if(SWL_searchStr.value.length > 1){ 
      	get_msg = 'index.php?'+buildQueryString(formName)+'&page_id=361&table_name='+tableName+'&field_name='+fieldName;
  //    	alert ('sending message '+get_msg);
      	suggestSearchXML(get_msg);
      }
      else {
      	if (SWL_searchStr.length == 0) {
      		SWL_searchClear();
      	}
      }
    }
  }  
  
  document.onkeydown = SWL_checkKeycode;
  document.onmousedown = SWL_checkMousedown;

function buildQueryString(theFormName) {
	//alert(theFormName);
  theForm = document.getElementById(theFormName);
  var qs = ''
  for (e=0;e<theForm.elements.length;e++) {
    if (theForm.elements[e].name!='') {
	    if (theForm.elements[e].type == "radio" || theForm.elements[e].type == "checkbox"){
				if (theForm.elements[e].checked){
      		qs+=(qs=='')?'':'&'
		      qs+=theForm.elements[e].name+'='
	  		  +escape(theForm.elements[e].value)
				}
  		}
      else {
      	qs+=(qs=='')?'':'&'
	      qs+=theForm.elements[e].name+'='
		    +escape(theForm.elements[e].value)
    	}	
    }
  }
  return qs
}

function setSWL_Search(newVal, newValID, extraSetsVals){
	SWL_searchStr.value = newVal;
	if (extraSetsVals != null && isArray(extraSetsVals) && extraSetsArr != null){
		for (i = 0; i < extraSetsArr.length; i++){
//			alert(extraSetsArr[i]);
			document.getElementById(extraSetsArr[i]).value = extraSetsVals[i];
		}
	}
	//do something with the id;
}

function isArray(obj) {
	if (obj == null){
		return false;
	}
//returns true is it is an array
if (obj.constructor.toString().indexOf("Array") == -1)
return false;
else
return true;
} 

  SWL_setRowCount(6);
  var nexttarget;
  var nexttarget_id;
  
function performSearchSelectAlteredu(searchItem, tableName, fieldName, formName, targetId){
	nexttarget_id = targetId;
   	nexttarget = document.getElementById(targetId);
     SWL_lastSearch = searchItem.options[searchItem.selectedIndex].value;
     	get_msg = 'alteredu_lu.php?'+buildQueryString(formName)+'&opt_val=1&table_name='+tableName+'&field_name='+fieldName;
  //    	alert ('sending message '+get_msg);
     	suggestSearchSelectXML(get_msg);
  }
 
 
function suggestSearchSelectXML(url) {
   /* if( SWL_isIE == true ) { url = 'http://swl.go.com' + url; } */
    if(window.XMLHttpRequest) {
      SWL_xmlHttpRequest = new XMLHttpRequest();
      SWL_xmlHttpRequest.onreadystatechange = processReqChangeSelect;
      SWL_xmlHttpRequest.open('GET', url, true);
      SWL_xmlHttpRequest.send(null);
    } else if(window.ActiveXObject) {
      SWL_xmlHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');
      if(SWL_xmlHttpRequest) {
        SWL_xmlHttpRequest.onreadystatechange = processReqChangeSelect;
        SWL_xmlHttpRequest.open('GET', url, true);
        SWL_xmlHttpRequest.send();
      }
    }
  }
 
 function processReqChangeSelect() {
    if (SWL_xmlHttpRequest != null) {
      if(SWL_xmlHttpRequest.readyState == 4) {
         if(SWL_xmlHttpRequest.status == 200) {
           SWL_rowCount = 0;
           SWL_rowID = 0;
				// alert("got this: "+SWL_xmlHttpRequest.responseText);
           var numParsed = parseSelectXML(SWL_xmlHttpRequest.responseXML.documentElement,
           SWL_xmlHttpRequest.responseText, nexttarget);
          if(numParsed && numParsed > 0) { SWL_showBox(SWL_swlNavDiv); }
        } else {
        }
      }
    }
  }
  
function Trim(inString) {
  var retVal = "";
  var start = 0;
  while ((start < inString.length) && (inString.charAt(start) == ' ')) {
    ++start;
  }
  var end = inString.length;
  while ((end > 0) && (inString.charAt(end - 1) == ' ')) {
    --end;
  }
  retVal = inString.substring(start, end);
  return retVal;
}

function validateSubmit (){
      group_name = document.getElementById("group_name");
      if (group_name.value.length == 0) {
         return false;
      }
    return true;
  }

/* Function called to handle the list that was returned from the internal_request.php file.. */
function parseSelectXML(xmlDoc, responseText, selectBox){
	//alert("nexttarget_id is "+nexttarget_id);
  var len = selectBox.length;
  for (i=len-1; i>1; i--){
      selectBox.options[i] = null;
  }
  var results = xmlDoc.getElementsByTagName('result');
  for (i = 0; i < results.length; i++) {
      var nodeVal = results[i].getElementsByTagName('option_val')[0];
      var nodeValData = nodeVal.firstChild.data;
      var nodeData = results[i].getElementsByTagName('option_data')[0];
      var nodeDataData = nodeData.firstChild.data;
      selectBox.options[i+1] = new Option(nodeDataData, nodeValData);
  }
  selectBox.disabled = false;
}

function disableEnableFields(disableThese, enableThese)
{
	for (i = 0; i < disableThese.length; i++)
	{
		document.getElementById(disableThese[i]).disabled = true;
	}
	for (i = 0; i < enableThese.length; i++)
	{
		document.getElementById(enableThese[i]).disabled = false;
	}
}
