function UpdateValues(value, text)
{
var countzip = 0;
var countcity = 0;
var countstate = 0;
	for (var i = 0; i<document.frmSearch.zip.value.length; i++)
	{
	  countzip = countzip + i;
	}

	for (var j = 0; j<document.frmSearch.city.value.length; j++)
	{
	 countcity = countcity + j;
	}

	for (var k = 0; k<document.frmSearch.state.value.length; k++)
	{
	 countstate = countstate + k;
	}

	if ( ((countcity >0) && (countstate >0))|| (countzip >0))
	{
	    //Add the iframe to the page here
        var div = new Element('div', {
            'id' : 'admtframe',
            'src' : 'http://view.atdmt.com/iaction/unytru_StoreFinder_6',
            'width' : '1',
            'height' : '1',
            'frameborder' : '0',
            'scrolling' : 'No',
            'marginheight' : '0',
            'marginwidth' : '0',
            'topmargin' : '0',
            'leftmargin' : '0'
            });
         $('frmSearch').insert({before: div});
        //Go on and submit the form

		ddl = document.getElementById("Products");
        
        document.getElementById("item_desc").value = ddl.options[ddl.selectedIndex].text;
        document.getElementById("item").value =  ddl.value;
        document.frmSearch.submit();
	}
	 else if ((countcity >0) && (countstate ==0))
	 {
	 alert ("you must enter a state");
	  document.frmSearch.state.focus();
	 }
	  else if ((countcity ==0) && (countstate >0))
	 {
	 alert ("you must enter a city");
	 document.frmSearch.city.focus();
	 }
	else
	{
	alert("You must enter a ctiy and state or a zip code.");
	}
}

	function processAjax(url) {

		if (window.XMLHttpRequest) { // Non-IE browsers
			req = new XMLHttpRequest();
			req.onreadystatechange = targetDiv;
			try {
				req.open("GET", url, true);
			} catch (e) {
				alert(e);
			}
			req.send(null);
		} else if (window.ActiveXObject) { // IE
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = targetDiv;
				req.open("GET", url, true);
				req.send();
			}
		}
	}

	function processAjaxReq() {

		var url='http://www.truvia.com/wcm/groups/public/@truvia/documents/script/truvia_aspx_ajax_forwarder.aspx?url=http://www.itemlocator.net/scripts/cgiip.exe/WService=ils3/webspeed/locatorweb.w?customer=CARGILL&item=truvia&count=10&radius=20';

		var isValidReq = "";
		
		if ((document.frmSearch.zip.value.length > 0) && (document.frmSearch.city.value.length < 1) && (document.frmSearch.state.value.length < 1)){
			url = url + '&zip=' + document.frmSearch.zip.value;
			isValidReq = "1";
			}
		if ((document.frmSearch.zip.value.length < 1) && (document.frmSearch.city.value.length > 0) && (document.frmSearch.state.value.length > 0)){
			url = url + '&city=' + document.frmSearch.city.value + '&state=' + document.frmSearch.state.value;
			isValidReq = "1";
			}
		
		if (isValidReq.length < 1){
			alert("You must enter a city and state or a zip code.");
			}
		if (window.XMLHttpRequest) { // Non-IE browsers
			req = new XMLHttpRequest();
			req.onreadystatechange = targetDiv;
			try {
				req.open("GET", url, true);
			} catch (e) {
				alert(e);
			}
			req.send(null);
		} else if (window.ActiveXObject) { // IE
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = targetDiv;
				req.open("GET", url, true);
				req.send();
			}
		}
	}

	function targetDiv() {
		if (req.readyState == 4) { // Complete
			if (req.status == 200) { // OK response
				document.getElementById("results").innerHTML = req.responseText;
			} else {
				alert("Problem: " + req.statusText);
			}
		}
	}
