function xmlhttpPost(strURL,queryString,msgDiv) {
    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,msgDiv);
        }
    }

    self.xmlHttpReq.send(queryString);
}

function xmlhttpPostFunction(strURL,queryString,fnName) {                  // returns value to javascript caller
    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) {
            eval(fnName+"('"+ self.xmlHttpReq.responseText+"'); " );
        }
    }
    self.xmlHttpReq.send(queryString);
}

function getquerystring() {
    var form     = document.forms['searchResult'];
    var word = form.word.value;
    qstr = 'w=' + escape(word);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str,msgDiv){
	//alert(str.replace(/^\s+|\s+$/, ''));
    document.getElementById(msgDiv).innerHTML = str;
}

function updateList(strResponse,strDestList,optLength)
{
//Resonse(str)===>maratha,mali,dhangar,bramhim#2,4,5,6
	var destListBox= document.getElementById(strDestList);
	destListBox.options.length=optLength;
	strResponse=strResponse.replace(/^\s+|\s+$/, '');
	if(strResponse!='Empty')
	{
	arrMain=strResponse.split("#"); // main contents

	arrOptVal=arrMain[0].split(",");
	arrOptId=arrMain[1].split(",");

	for(i=0;i<arrOptId.length;i++)
	{

	var y=document.createElement('option');
	y.value=arrOptId[i];
	y.text=arrOptVal[i];
	  try
    	{
	    destListBox.add(y,null); // standards compliant
    	}
	  catch(ex)
    	{
	    destListBox.add(y); // IE only
    	}



	}
	}

}

function xmlhttpPost1(strURL,queryString1,queryString2,strDestList,optLength) {
    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) {
            updateList(self.xmlHttpReq.responseText,strDestList,optLength);
        }
    }
    self.xmlHttpReq.send(queryString1+'='+queryString2);
}



function fillProgressBar(perc)
{
fillProgress('element1',perc);
}





