

	/**********************************************
	VYOM AJAX PROCESSOR
	(c) Vyom Technosoft Pvt. Ltd.
	Author - Amit Mathur, 18 Jun 2006

	Unauthorised copying or distribution is
	prohibited.
	***********************************************/

	function vyomAJAXProcessor(strURL,divName)
	{
		var xmlHttpReq = false;
		var self = this;
		// Mozilla/Safari
		if (window.XMLHttpRequest) {
			self.xmlHttpReq = new XMLHttpRequest();
		}
		// IE
		else if (window.ActiveXObject) {
			self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		}
		self.xmlHttpReq.open('POST', strURL, true);
		self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		self.xmlHttpReq.onreadystatechange = function() {
			if (self.xmlHttpReq.readyState == 4) {
				updatepage(self.xmlHttpReq.responseText,divName);
			}
		}
		self.xmlHttpReq.send(strURL);
	}

	function vyomAJAXPreProcessorForCities()
	{
	  
		updatepage("<font face=verdana size=1 color=black>Please wait; loading the Cities for the selected country...</font>","result");
		strURL = "/cities-ajax-processor.asp?c=" + document.forms['search'].countryId.value;
		vyomAJAXProcessor(strURL,"result");
	}
   function vyomAJAXPreProcessorForResourceTypes()
   {
     updatepage("<font face=verdana size=1 color=black>Please Wait; loading the Categories for the selected city...</font>","result1");
	 strURL = "/resourceTypes-ajax-processor.asp?c=" + document.getElementById("cityId").value;
	  vyomAJAXProcessor(strURL,"result1");
   }
    function vyomAJAXProcessorForSubmit()
    {
	 strURL = "/search.asp?q=" + document.forms['search'].q.value + "&cityId=" + document.getElementById("cityId").value + "&resourceTypeId=" + document.getElementById("resourceTypeId").value;
     document.search.action= strURL ;
	 document.search.submit();
	}
	function updatepage(str,divName){
		document.getElementById(divName).innerHTML = str;
	}
