
function BindDataCity(objddl,tableName,value)
{
    var xmlHttpObj = CreateXmlHttpRequestObject();
    if (xmlHttpObj)
    {
        // Obtain a reference to the <SELECT> drop list control.
        var ddl = objddl;
        ddl.disabled=false;
        // We want this request synchronous
        xmlHttpObj.open("GET", rootURL + "AJAXServer.ashx?ajaxAct=" + tableName + "&id=" + value, true);

        xmlHttpObj.onreadystatechange = function()
        {
            if (xmlHttpObj.readyState == READYSTATE_COMPLETE)
            {   
                // If the request was ok (ie. equal to a Http Status code of 200)            
                if (xmlHttpObj.status == HTTPSTATUS_OK)
                {
                    var xmlDoc = xmlHttpObj.responseXML;
                    var nodeLocation = xmlDoc.getElementsByTagName('root'); 
                    var stop=false;
                    for(i = 0; i < nodeLocation.length; i ++)
                     {
                        htmlCode = document.createElement('option'); 
                        var text;
                        var value;
                        var priority
                        if (window.ActiveXObject)
                        {
                            text=nodeLocation[i].childNodes[1].childNodes[0].nodeValue;
                            value=nodeLocation[i].childNodes[0].childNodes[0].nodeValue;
                            priority=nodeLocation[i].childNodes[2].childNodes[0].nodeValue;
                        }
                        else
                        {   
                            text=nodeLocation[i].childNodes[2].childNodes[0].nodeValue;
                            value=nodeLocation[i].childNodes[1].childNodes[0].nodeValue;
                            priority=nodeLocation[i].childNodes[3].childNodes[0].nodeValue;
                        }                                        

                        if (priority==1)
                        {
                            htmlCode.text = text;
                            htmlCode.value = value;
                            ddl.options.add(htmlCode);
                        }
                        else
                        {
                            if (!stop)
                            {
                                htmlCode.text = "--------------------------------------------";
                                htmlCode.value = "-2";
                                ddl.options.add(htmlCode);
                                htmlCode = document.createElement('option');
                                htmlCode.text = text;
                                htmlCode.value = value;
                                ddl.options.add(htmlCode);
                                stop=true;
                            }
                            else
                            {
                                htmlCode.text = text;
                                htmlCode.value = value;
                                ddl.options.add(htmlCode);
                            }
                        }
                     }
                }
            }
        }
    }
    // Execute the request            
    xmlHttpObj.send("SomeDataToSend");
}