	var gVisitedList;
	var gForm;
	var gAjaxPage;
	var gIsList;
	var gLinkUrl;
	function startExpertSelect()
	{
		gIsList = false;
		gVisitedList = new Object();
		gForm = document.forms.expertQuery;
		//gObjectArray = eval(document.getElementById('srcStuff').value);
		//doList('', 0);
		gAjaxPage = gForm.elements['targetPage'].value;
		gLinkUrl = gForm.elements['linkUrl'].value;
	}
	addDOMLoadEvent(startExpertSelect);
	// Display list and other Items
	function showCurrentList(iType)
	{
		if (iType == 'noSelection')
			document.getElementById('expertResultList').innerHTML = "<p>Please Make a Selection</p>";
		else if (iType == 'get')
			document.getElementById('expertResultList').innerHTML = "<p>Retrieving List</p>";
		else if (iType == 'error')
			document.getElementById('expertResultList').innerHTML = "<p>An Error Occured!</p>";
		else if (iType == 'list')
		{
			if (gChoiceArray.length)
			{
				var lOutStr = '';
				for (var i=0; i<gChoiceArray.length; i++)
				{
					if (i > 0)
						lOutStr += "<br/>";
					lOutStr += '<a href="'+gLinkUrl+gChoiceArray[i][0]+'" class="expertLink" target="_blank">'+gChoiceArray[i][1]+'</a>';
				}
				gIsList = true;
				document.getElementById('expertResultList').innerHTML = lOutStr;
			}
			else
				document.getElementById('expertResultList').innerHTML = "<p>There are no Experts to fit your Selection!</p>";
		}
	}
	// This function requests the information for statistical information
	function checkExpertList()
	{
		var lPage = gAjaxPage+"?type=query";
		var lSend = false;
		// Get Type of Asset Work
		var lAssetWork = document.getElementById('typeOfAsset').value;
		if (lAssetWork)
			lPage += "&typeOfAsset="+lAssetWork;
		// Get Area of Expertise
		var lExpertise = getMultiString('areaOfExpertise');
		if (lExpertise.length > 0)
			lPage += "&expertise="+escape(lExpertise);
		// Get Population
		var lPopulation = getMultiString('population');
		if (lPopulation.length > 0)
			lPage += "&population="+escape(lPopulation);
		// Get Availability
		var lAvailability = getMultiString('availability');
		if (lAvailability.length > 0)
			lPage += "&availability="+escape(lAvailability);
		// Get Availability
		var lState = getMultiString('state');
		if (lState.length > 0)
			lPage += "&state="+escape(lState);
		if (lAssetWork ||  lExpertise.length > 0 || lPopulation.length > 0 || lAvailability.length > 0 || lState.length > 0)
		{
			//alert(lPage);
			// Get request object		
			xmlhttp = getxmlhttp();      
	    if (!xmlhttp) 
	       return false;
			//alert("Search string:"+lPage);
	    xmlhttp.onreadystatechange = expertQueryResponse;
	    //alert(lPage);
	    xmlhttp.open('GET', lPage, true);
	    xmlhttp.send(null);
	  }
	  else
	  	document.getElementById('expertResultList').innerHTML = "<p>Please Make a Selection</p>";
	}
	function getMultiString(iOption)
	{
		var lOption = document.getElementById(iOption);
		var selected = new Array();
		for (var i = 0; i < lOption.options.length; i++)
			if (lOption.options[ i ].selected)
				selected.push(lOption.options[ i ].value);
		return selected.join(' ');
	}
  function expertQueryResponse()
  {
		var lResponse = checkResult(xmlhttp);
		if (lResponse)
		{
			if (lResponse == -1)
				showCurrentList('error');
			else if (lResponse.indexOf('Error') >= 0)
				showCurrentList('error');
			else
			{
				var lLines = lResponse.split(/\r\n|\r|\n|<!--/);
				gChoiceArray = eval(lLines[0]);
				showCurrentList('list');
			}
		}
	}
	// This function handles the result
	// Return 0 - Not Done, -1 - System Error, String - Result
	function checkResult(iHttp)
	{
		var lError = true;
		if (iHttp.readyState == 4 ) 
		{
			if (iHttp.status == 200)
			{
				if (iHttp.responseText.length > 0)
					return iHttp.responseText;
				else
					return -1;
			}
			else
				return -1;
		}
		return 0;
	}
	function getxmlhttp()
	{
		if (window.XMLHttpRequest) // Mozilla, Safari,...
		{
       xmlhttp = new XMLHttpRequest();
    } 
    else if (window.ActiveXObject)  // IE
    {
			try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
      catch (e) 
      {
        try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
        catch (e) {}
			}
    }   
    if (!xmlhttp)
       alert('Cannot create AJAX instance');
		return xmlhttp;
	}