//Select Added By Rockstar



function retrieveActorCollState(id){
     var req;
    var country= document.getElementById('country');
            
    var country_id = country.options[country.selectedIndex].value;
    if(country_id==0)
    {
        document.getElementById('state1').options[0]= new Option('Select','0');
    }
    var url="./actorCollStateSelection.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=GetXmlHttpObject();
              
    req.open("POST", url, true);
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.send(country_id);
    req.onreadystatechange = function(){
    document.getElementById('state1').options.length = 0;
    if (req.readyState == 4) {
        var textToSplit = req.responseText;
        var returnElements=textToSplit.split("|");
        if (req.status == 200 | req.status == "200") {                                        // OK response
            document.getElementById('state1').options[0] = new Option("Select", "0");
            for ( var i=1; i<(returnElements .length)+1; i++ ){
                var valueLabelPair = returnElements[i-1].split(",");
                document.getElementById('state1').options[i] = new Option(valueLabelPair[0], valueLabelPair[1]);
            }
        }
    }
}
return true;
}
//function populateStateBox(){
//    document.getElementById('state1').options.length = 0;
//    if (req.readyState == 4) {
//        var textToSplit = req.responseText;
//        var returnElements=textToSplit.split("|");
//        if (req.status == 200) {                                        // OK response
//            document.getElementById('state1').options[0] = new Option("Select", "0");
//            for ( var i=1; i<(returnElements .length)+1; i++ ){
//                var valueLabelPair = returnElements[i-1].split(",");
//                document.getElementById('state1').options[i] = new Option(valueLabelPair[0], valueLabelPair[1]);
//            }
//        }
//    }
//}

//Ended By Rockstar
