var req;
            var temp=0; 
            function retrieveCounselorInstStateOptions(id){
                
             country1= document.getElementById('inst_country');
             
                country_id = country.options[country1.selectedIndex].value;
                
                    if(country_id==0)
                    {
                        document.getElementById('inst_state').options[0]= new Option('- - - - - -Select State - - - - - - - -','0');
                        return;
                     }
                url="./counsStudRegStateSelect.do?country_id="+country_id;
               
                //Do the Ajax call
                try
                {
                    // Firefox, Opera 8.0+, Safari
                                    req=new XMLHttpRequest();
                                    
                }
                catch (e)
                {
                    // Internet Explorer
                    try
                    {
                        req=new ActiveXObject("Msxml2.XMLHTTP");
                    }
                    catch (e)
                    {
                        try
                        {
                            req=new ActiveXObject("Microsoft.XMLHTTP");
                        }
                        catch (e)
                        {
                            alert("Your browser does not support AJAX!");
                            return false;
                        }
                    }
                }
                
                
                req.open("GET", url, true);
                req.send(null);
                req.onreadystatechange = populateFiftyBox;
                
              }

            function populateFiftyBox(){
               
                document.getElementById('inst_state').options.length = 0;

               
    if (req.readyState == 4) {
        textToSplit = req.responseText;      
        var returnElements=textToSplit.split("|");
        if (req.status == 200) {                                        // OK response
            document.getElementById('inst_state').options[0] = new Option("-----Select-----", "0");
            for ( var i=1; i<(returnElements .length)+1; i++ ){
                valueLabelPair = returnElements[i-1].split(",");
                document.getElementById('inst_state').options[i] = new Option(valueLabelPair[0], valueLabelPair[1]);
            }
        }
    }   
                  
                }
