country = new Array()

region = new Array()

town = new Array()

function changeregion() {
        obj = document.form_search;
        var country_now  = obj.tara.options[obj.tara.selectedIndex].value;
    if ( (country_now != '...') && (country_now != '0')) {
           
            var region_array = region[country_now].split(',');
            obj.regiunea.length=0;
            obj.town.length=0;
            for (var i=0; i < region_array.length; i++) {
                    obj.regiunea.options[i] = new Option(region_array[i], region_array[i], 0, 0);
                    obj.regiunea.options[0].selected =  true;
            }
    }else{
            obj.regiunea.length=0;
            obj.town.length=0;
    }
}
function changetown() {
        obj = document.form_search;
        var town_now  = obj.regiunea.options[obj.regiunea.selectedIndex].value;
    if (town_now != '...') {
            var town_array =  town[town_now].split(',');
            obj.town.length=0;
            for (var i=0; i < town_array.length; i++) {
                    obj.town.options[i] = new Option(town_array[i], town_array[i], 0, 0);
                    obj.town.options[0].selected =  true;
            }
    }else{
            obj.town.length=0;
    }
}

function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, false); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}

function reset_myform() { 
// document.form_search.reset();
document.form_search.regiunea.value = '...';
document.form_search.town.value = '...';

}