    var xmlDom;
    function createXMLHTTP()
    {
        if(window.XMLHttpRequest)
        {
            xmlDom=new XMLHttpRequest();//mozilla
        }
        else if(window.ActiveXObject)
        {
            try
            {
                xmlDom=new ActiveXObject("Msxml2.XMLHTTP");//IE
            }
            catch(e)
            {}
            try
            {
                xmlDom=new ActiveXObject("Microsoft.XMLHTTP");//IE
            }
            catch(e)
            {}
            if(!xmlDom)
            {
                window.alert("XMLHttpRequest!");
                return false;
            }
        }
    }
function GetValues(obj,targetObj,type,cityObject,zipCodeObject)
{
    if(cityObject!=null)
    {
        cityObject.innerHTML="";
        cityObject.options.add(new Option("Select a Metro or City","0"));
    }
    if(zipCodeObject!=null)
    {
        zipCodeObject.value = "";
    }
    if(obj.value!="")
    {
        createXMLHTTP();
        var strURL="UserFunction/HTTPProcess/ZipCode.ashx?id="+obj.value+"&type="+type;
        xmlDom.open("GET",strURL,true);
        xmlDom.onreadystatechange = function(){ShowValues(targetObj,type);};
        xmlDom.send(null);
    }
}
function InitData(countryObject,stateObject,cityObject,zipCodeObject)
{
    countryObject.options[0].selected = "selected";
    delValues(stateObject);//delete
    delValues(cityObject);//delete
    stateObject.options.add(new Option("Select a Metro or City","0"));
    cityObject.options.add(new Option("Select a Metro or City","0"));
    zipCodeObject.value="";
}
function ShowValues(targetObj,type)
{
if (xmlDom.readyState == 4 && xmlDom.status == 200)
        {
        var arr = xmlDom.responseText;
    if(arr != ""|| arr!=null)
    {

        
//        if(arr.indexOf("=")>0)
//        {
//            arr = arr.substr(arr.indexOf("=")+1);
//        }
        var array = arr.split(",");
        var result = array;
//        var targetObj = document.getElementById(array[array.length-2]);
//        var type = array[array.length-1];
        
        if(targetObj!=null)
        {
            
            if(type=="3")
            {
                targetObj.value = result[0];
            }
            else
            {
                delValues(targetObj);//delete
        //                var piArray = result.split(",");
                if(type=="1")
                {
                    targetObj.options.add(new Option("Select a State/Province","0"));
                }
                else if(type=="2")
                {
                    targetObj.options.add(new Option("Select a Metro or City","0"));
                }
                for(var i=0;i<result.length;i++)
                {
                   var ary1 = result[i].toString().split("|");
                   targetObj.options.add(new Option(ary1[1].toString(),ary1[0].toString()));
                }
            }
        }
    }
    else
    {
     alert("sorry It has no data in database");
    }
    }
}
//delete values
function delValues(targetObject)
{
                        
    targetObject.innerHTML="";
}
function getZipCode(targerControl,originControl)
{
    targerControl.value = originControl.value;
    Panle_Hide(targerControl.Container.FloatContainer);
}

function selectZip()
{
//    if(document.all["details"].style.visibility=="hidden")
//    {
//        document.all["details"].style.visibility="visible";
//    }
//    else
//    {
//        document.all["details"].style.visibility=="hidden";
//    }
    hiddenPanel();
}
function hiddenPanel()
{
    document.getElementById("showPanel").style.display = "none";
}
//if(document.readyState=="complete")
//{
//  Zip_FloatPanel_Init();
//}
//else
//{
//  document.onreadystatechange = function()
//  {
//      if(document.readyState == "complete")
//      {
//          Zip_FloatPanel_Init();
//      }
//  }
//}
function Zip_FloatPanel_Init()
{
    if(Zip_Controls!=null)
    {
	    for( var i = 0; i < Zip_Controls.length; i++ ) {
		    var info = Zip_Controls[ i ];
		    Zip_FloatPanel_Load( info );
	    }
    }

}
function Zip_FloatPanel_Load( info )
{   
	var ZipCode = document.getElementById( info.ID );
	var Container = document.getElementById( info.ContainerID );
	var FloatContainer = document.getElementById( info.FloatContainerID );
	var Text = document.getElementById( info.TextID );
	var CodeText = document.getElementById( info.CodeTextID );
	var Button = document.getElementById( info.ButtonID );
	var GetButton = document.getElementById( info.GetButtonID );
	var Country = document.getElementById( info.CountryID );
	var State = document.getElementById( info.StateID );
	var City = document.getElementById( info.CityID );
	
	ZipCode.style.display = "";
	
	Container.FloatContainer = FloatContainer;
	Container.Text = Text;
	Container.Button = Button;
	FloatContainer.Container = Container;
	Text.Container = Container;
	Button.Container = Container;
	
	FloatContainer.CodeText = CodeText;
	FloatContainer.GetButton = GetButton;
	FloatContainer.Country = Country;
	FloatContainer.State = State;
	FloatContainer.City = City;
	CodeText.FloatContainer = FloatContainer;
	GetButton.FloatContainer = FloatContainer;
	Country.FloatContainer = FloatContainer;
	State.FloatContainer = FloatContainer;
	City.FloatContainer = FloatContainer;
	
	FloatContainer.style.display = "none";
	FloatContainer.style.position = "absolute";
	FloatContainer.style.left = "0px";
	
	FloatContainer.style.zIndex = 10000;
//	showPanel.size = ( info.ListSize > List.options.length ) ? List.options.length : info.ListSize;
	FloatContainer.multiple = false;
	FloatContainer.IsShowing = false;
//	FloatContainer.Show = Panle_Show;
//	FloatContainer.Hide = Panle_Hide;    
}
function Zip_Button_Toggle(button) {
	if ( button.Container.FloatContainer.IsShowing == true ) {
//		this.FloatContainer.Hide();
        Panle_Hide(button.Container.FloatContainer)
	} else {
		Panle_Show(button.Container.FloatContainer);
	}
}
function Panle_Show(floatContainer) {
	if ( !floatContainer.IsShowing && !floatContainer.disabled ) {
//		if ( typeof ( this.Container.Text.dataSrc ) != "undefined" ) { // to overcome misaligniment in IE
//			this.style.top = ( this.Container.offsetHeight + 10 ) + "px";
//		} else {
			floatContainer.style.top = ( floatContainer.Container.offsetHeight ) + "px";
//		}
//		this.style.width = this.Container.offsetWidth + "px";
        
//		this.style.width = "100px";
		floatContainer.style.display = "";
		floatContainer.focus();
		floatContainer.IsShowing = true;
	}
}
function Panle_Hide(floatContainer) {
	if ( floatContainer.IsShowing ) {
		floatContainer.style.display = "none";
		floatContainer.IsShowing = false;
	}
}