    var mccNumList = new Array();
    var mccAlphList = new Array();
        
    function disableForNameSearch()
    {
        form = document.searchForm;
        for(i=0;i<form.searchCustom__mccType.length;i++)
        {
        	form.searchCustom__mccType[i].disabled = true;
        }
        form.street1.disabled = true
        form.street2.disabled = true
        form.searchCustom__industrySeg.disabled = true
        form.searchCustom__mccType.disabled = true
        form.searchCustom__beIndicator.disabled = true
        form.searchCustom__edLevel.disabled = true
        form.searchCustom__optionList.disabled = true
        
        form.searchCustom__supplierName.disabled = false
    }
    function disableForAddrSearch()
    {
        form = document.searchForm;
	for(i=0;i<form.searchCustom__mccType.length;i++)
	{
		form.searchCustom__mccType[i].disabled = false;
	}
        form.searchCustom__supplierName.disabled = true
        form.street1.disabled = false
        form.street2.disabled = false
        form.searchCustom__industrySeg.disabled = false
        form.searchCustom__optionList.disabled = false
        form.searchCustom__mccType.disabled = false
        form.searchCustom__beIndicator.disabled = false
        form.searchCustom__edLevel.disabled = false
    }
    
    /* function to show the submenus in the left navigation section */
    /*function showmenu()
    {
    	document.getElementById("submenu").style.display = "block";
    }*/
    
    /* function to show/hide MCC description lists.*/
    function showMe(val)
    {
        if(val == 1)
        {
            document.getElementById("lstSearchT").style.display = "block";
            document.getElementById("lstSearchO").style.display = "none";
        }
        else
        {
            document.getElementById("lstSearchT").style.display = "none";
            document.getElementById("lstSearchO").style.display = "block";
        }
        //selectMCCItems();
    }
    
    /* function to show/hide MCC description lists.*/
    function mccDefaultType()
    {
        if(document.searchForm.searchCustom__mccType[1].checked == true)
        {
            document.getElementById("lstSearchT").style.display = "block";
            document.getElementById("lstSearchO").style.display = "none";
        }
        else
        {
            document.getElementById("lstSearchT").style.display = "none";
            document.getElementById("lstSearchO").style.display = "block";
        }
        //selectMCCItems();
    }      
    
    /* function to select MCC descriptions according to Industry Segment */
    /*function selectMCCItems()
    {
        var mccType;
        var indSeg = document.searchForm.searchCustom__industrySeg;
        var index = document.searchForm.searchCustom__industrySeg.selectedIndex;
        
        for(i=0;i<indSeg.length;i++)
        {
            if(indSeg.options[i].selected == true)
            {
                var txtToSrch = indSeg.options[i].text;
            }
        }
        
        if(txtToSrch == "- Select an Industry -")
        {
                var optionList = document.searchForm.searchCustom__optionList;
                var optionList1 = document.searchForm.searchCustom__optionList1;

                for (x=optionList.length; x>=0; x--) 
                {
                    optionList[x] = null;
                    optionList1[x] = null;
                }
                for (i=0; i<mccNumList.length; i++)
                {
                    optionList[optionList.length] = new Option(mccNumList[i], mccNumList[i]);
                    optionList1[optionList1.length] = new Option(mccAlphList[i], mccAlphList[i]);
                }
                return true;
        }
                 
        for(i=0;i<document.searchForm.searchCustom__mccType.length;i++)
        {
            if(document.searchForm.searchCustom__mccType[i].checked == true)
            {
                mccType = "numeric";
                break;
            }
            else
            {
                mccType = "alphabetical";
                break;
            }
        }
        
        if(mccType == "numeric")
        {
            if (window.XMLHttpRequest)
            { 
            // code for Mozilla, Safari, etc
              xmlhttp = new XMLHttpRequest();
              xmlhttp.onreadystatechange=postFileReady;
              xmlhttp.open("GET", "properties/IndustryMCCDesc4.properties", true);
              xmlhttp.send(null);
            }
            else if (window.ActiveXObject) 
            { //IE
              xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
              if (xmlhttp) 
              {
                 xmlhttp.onreadystatechange=postFileReady;
                 xmlhttp.open('GET', "properties/IndustryMCCDesc4.properties", true);
                 xmlhttp.send();
              }
            }
        }
        else
        {
            if (window.XMLHttpRequest)
            { 
            // code for Mozilla, Safari, etc
              xmlhttp = new XMLHttpRequest();
              xmlhttp.onreadystatechange=postFileReady;
              xmlhttp.open("GET", "properties/IndustryMCCDesc3.properties", true);
              xmlhttp.send(null);
            }
            else if (window.ActiveXObject) 
            { //IE
              xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
              if (xmlhttp) 
              {
                 xmlhttp.onreadystatechange=postFileReady;
                 xmlhttp.open('GET', "properties/IndustryMCCDesc3.properties", true);
                 xmlhttp.send();
              }
            }
        }
     } 
    */    
   
    /*function postFileReady() 
    {
        var indSeg = document.searchForm.searchCustom__industrySeg;
        
        for(i=0;i<indSeg.length;i++)
        {
            if(indSeg.options[i].selected == true)
            {
                var txtToSrch = indSeg.options[i].text;
            }
        }

        if (xmlhttp.readyState==4) 
        {
            if (xmlhttp.status==200) 
            {
                var txtFile = xmlhttp.responseText;
                var arrFile = txtFile.split("\n");
                str = 0;
                for(i=0;i<arrFile.length;i++)
                {
                    var arrRec = arrFile[i].split(",");
                    if(arrRec[0] == txtToSrch)
                    {
                        str = str+","+arrRec[1];
                    }
                }
                
                arrOpts = str.split(",");
                for(i=0;i<document.searchForm.searchCustom__mccType.length;i++)
                {
                    var st;
                    if(document.searchForm.searchCustom__mccType[i].checked == true)
                    {
                        st = "numeric";
                        break;
                    }
                    else
                    {
                        st = "alphabetic";
                        break;
                    }
                }
                
                if(st == "numeric")
                {
                    var optionList = document.searchForm.searchCustom__optionList;
                }
                else
                {
                    var optionList = document.searchForm.searchCustom__optionList1;
                }*/

                /* sort the array in numerical or alphabetical order */
                /*arrOpts = arrOpts.sort();
                optionList.length = arrOpts.length;
                for (x=optionList.length; x>=0; x--) 
                {
                    optionList[x] = null;
                }
                
                for(i=0;i<arrOpts.length;i++)
                {
                    if(arrOpts[i] == 0)
                    {
                        if(st == "numeric")
                        {
                            optionList[optionList.length] = new Option("-Select code(s)-", arrOpts[i]);
                        }
                        else if(st == "alphabetic")
                        {
                            optionList[optionList.length] = new Option("-Select short description(s)-", arrOpts[i]);
                        }
                    }
                    else
                    {
                        optionList[optionList.length] = new Option(arrOpts[i], arrOpts[i]);
                    }
                }
            }
        }
    }*/
    
    /* Function to save MCC Description data */
    /*function saveMCCData()
    {
        for(i=0;i<document.searchForm.searchCustom__optionList.length;i++)
        {
            mccNumList.push(document.searchForm.searchCustom__optionList.options[i].text);
            mccAlphList.push(document.searchForm.searchCustom__optionList1.options[i].text);
        }
        setDefaultProperties();
    }
    */    
    
    /* Function to set default properties of Form-fields while loading the page. */
    function setDefaultProperties()
    {
        form = document.searchForm;
        if(form.searchCustom__searchType[0].checked == true)
        {
            disableForNameSearch();
        }
        else if(form.searchCustom__searchType[1].checked == true)
        {
            disableForAddrSearch();
        }
    }
    
    function popup(a,b,c,d) 
    {
        var u = b;
        window.open(u,c,"scrollbars,resizable,width=526,height=433");
        return false;
    }

    /* Function to store Selected MCC Description. */
    function mccDescription()
    {   
        var chosen = "";
        var firstTime = "true";
        if(document.getElementById('lstSearchO').style.display == 'block') 
        {
            for(i=0;i<document.searchForm.searchCustom__optionList.length;i++)
            {
                if(document.searchForm.searchCustom__optionList[i].selected)
                {
                    if(document.searchForm.searchCustom__optionList[i].value != "" && document.searchForm.searchCustom__optionList[i].value != "0")
                    {
                        if(firstTime == "true")
                        {
                            chosen = document.searchForm.searchCustom__optionList[i].value;
                            firstTime = "false";
                        }
                        else
                        {
                            chosen = chosen + ":" + document.searchForm.searchCustom__optionList[i].value;
                        }
                    }
                }
            }
        }
        else if(document.getElementById('lstSearchT').style.display == 'block')
        {
            for(i=0;i<document.searchForm.searchCustom__optionList1.length;i++)
            {
                if(document.searchForm.searchCustom__optionList1[i].selected)
                {
                    if(document.searchForm.searchCustom__optionList1[i].value != "" && document.searchForm.searchCustom__optionList1[i].value != "0")
                    {
                        if(firstTime == "true")
                        {
                            chosen = document.searchForm.searchCustom__optionList1[i].value;
                            firstTime = "false";
                        }
                        else
                        {
                            chosen = chosen + ":" + document.searchForm.searchCustom__optionList1[i].value;
                        }
                    }
                }
            }
        }
        document.searchForm.searchCustom__hidMCCDesc.value = chosen;
        return true;
    }