	function search_add_location(ref_loc,id_loc,dropdown_object){
		
		
		delOptions(dropdown_object);
		
		
		// loop to all location array
		for(i=0; i<bookingdates.length; i++){
		//compare id with array
		
		if(ref_loc==bookingdates[i][1]){
		addOptions(bookingdates[i][0],bookingdates[i][0],bookingdates[i][1],dropdown_object);
			if(id_loc==bookingdates[i][0]){
				
				 document.getElementById(dropdown_object).options[document.getElementById(dropdown_object).length-1].selected=true;
					//alert(document.form1.listlocation.length)
					}//end of if
			
			
				}
		}
				
			
		}//end of function
		
		
		
				
		
		function addOptions(id_loc,locations,ref,dropdown_object) {
//var selbox = document.form1.listlocation;

var selbox = document.getElementById(dropdown_object);

//selbox.options.length = 0;
var fnd = 0;
for (n=0;n<selbox.length;n++){
if(selbox.options[n].text == locations){
fnd = 1;
}}
if (!fnd) selbox.options[selbox.options.length] = new Option(locations, id_loc);
}
 
 
		
		
function delOptions(dropdown_object) {

var selbox = document.getElementById(dropdown_object);


if (selbox.options[0].value != " ") {
nomatch = new Array();
for (n=0;n<selbox.length;n++){
//if(selbox.options[n].text != chosen){
//nomatch[nomatch.length] = new Array(selbox.options[n].value, selbox.options[n].text);
//}
}
selbox.options.length = 0;
if (nomatch.length == 0) {
//selbox.options[0]= new Option("Select entries from the list at left"," ");
} else {


}
//selbox.options[0]= new Option("Choose a dropdown if Req."," ");
}//end deloptions function
}
