
function addCountryRegionOption(a,b){
	flag = 0;
	lengthoftwo = b.options.length;
		if(a.selectedIndex == -1 || a.options[a.selectedIndex].value == 0){
			alert('Please select a valid option item');
		  	return false;
		  	flag = 1
		 }
	for (i = 0; i <= lengthoftwo -1; i++){
     if(b.options[i].value == a.value){
	  alert('The option you have selected has already been added to the selected items');
	  return false;
	  flag = 1
	 }
    }
		if (flag != 1){
			
			NewString = a.options[a.selectedIndex].innerHTML;
			b.options[lengthoftwo] = new Option(NewString,a.options[a.selectedIndex].value);
	}
}


function removeOption(a){
	if (a.options.selectedIndex >= 0){
		lengthoftwo = a.options.selectedIndex;
		
		if (a.options[lengthoftwo]){
			a.options[lengthoftwo] = null;}
	}
}


function saveCountriesRegions(){
	myval = '';
	comma = '';
	lengthoftwo = frmProjectSearch.i_countryID_display.options.length;
	
	for (i = 0; i <= lengthoftwo -1; i++){
     myval = myval + comma + frmProjectSearch.i_countryID_display.options[i].value;
	 comma = ',';
    }
	frmProjectSearch.i_hdn_countryID.value = myval;
}


function checkForm(){
	   
		saveCountriesRegions();	
		
		
		return true;
		
		}
