var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
function makeOptionList(pageurl,AddTo){
	removeOptionList(AddTo);
	xmlhttp.open("GET", pageurl,true);
	 xmlhttp.onreadystatechange=function() {
	  if (xmlhttp.readyState==4) {		  
		  var options = xmlhttp.responseText;
		  options = options.split("|");
		  for(var a=0;a<options.length;a++){
			var inLine = options[a].split(":");
			appendOptionLast(inLine[0],inLine[1],AddTo);			
		  }
		  
	  }
	 }
	 xmlhttp.send(null);
}
/*
function appendOptionLast(text,value,addto)
{  
  var elSel = document.getElementById(addto);
  elSel.innerHTML = elSel.innerHTML+"<option value='"+text+"'>"+value+"</option>"; 
}
*/
function appendOptionLast(text,value,addto)
{
	if(text.length!=0){
		var newOption = new Option(value,text);		
		var selectElement = document.getElementById(addto);
		InsertNewOption(newOption,selectElement);
	}
}
function InsertNewOption(newOption, selectElement)
{
    var optsLen = selectElement.options.length;
    selectElement.options[optsLen] = newOption;
}
function removeOptionList(remfrom)
{
  var elSel = document.getElementById(remfrom);
  elSel.innerHTML = '';
  elSel.length = 0;
}