		function getQuery( str ){
			var url="/supplier/queries/query.cfm?letter=" + str;
			document.getElementById("proc").style.display="inline";
			xmlhttp = GetHttpObject();
			if(xmlhttp){
				xmlhttp.onreadystatechange = stateChangedSupplier;
				xmlhttp.open( "GET", url , true );
				xmlhttp.send(null);
			}
		} 

		function GetHttpObject(){
			if (window.XMLHttpRequest){
				// If IE7, Mozilla, Safari, etc: Use native object
				xmlhttp = new XMLHttpRequest();
			}
			else if (window.ActiveXObject){
				try{
					xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e){
					try{
						xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch(e){
						xmlhttp = false;
					}
				}
			}
			return xmlhttp;
		}
		
		function stateChanged(){
			if (xmlhttp.readyState == 4 || xmlhttp.readyState == "complete"){
				if(xmlhttp.responseXML){
					document.getElementById("calc").innerHTML = "";
					var valueComputed = xmlhttp.responseXML.getElementsByTagName('revenueValue')[0].childNodes[0].nodeValue;
					var poValue = xmlhttp.responseXML.getElementsByTagName('poFactor')[0].childNodes[0].nodeValue;
					var invoiceValue =  xmlhttp.responseXML.getElementsByTagName('invoiceFactor')[0].childNodes[0].nodeValue;
					var valueComputedFormatted = formatNumber(valueComputed);
					if( valueComputedFormatted.indexOf('.') != -1)
						document.calculator.active_contracts.value = valueComputedFormatted.substr(0,valueComputedFormatted.indexOf('.'));
					else
						document.calculator.active_contracts.value = valueComputedFormatted;
					var poFormatted = formatNumber(poValue);
					if( poFormatted.indexOf('.') != -1 )
						document.calculator.po.value = poFormatted.substring(0,poFormatted.indexOf('.'));
					else
						document.calculator.po.value = poFormatted;
					var invoicesFormatted = formatNumber(invoiceValue);
					if( invoicesFormatted.indexOf('.') != -1 )
						document.calculator.invoices.value = invoicesFormatted.substring(0,invoicesFormatted.indexOf('.'));
					else
						document.calculator.invoices.value = invoicesFormatted;
				}
			}
		}	
		
		// receives the request back and parses the results to a div
		function stateChangedSupplier(){
			if (xmlhttp.readyState == 4 || xmlhttp.readyState == "complete"){
				if(xmlhttp.responseText){
					document.getElementById("firstLetter").style.display="block";
					document.getElementById("supAlpList").style.width = '600px';
					document.getElementById("supplierList").innerHTML = xmlhttp.responseText;
					document.getElementById("proc").style.display="none";
				}
			}
		}						

