var accomSet0 = new Array();
var accomSet1 = new Array("Share Room","Twin Room","Double Room", "Camping");
var accomSet2 = new Array("Studio Unit","1 Bedroom Unit","2 Bedroom Unit", "2 Bedroom Spa Unit","Disability Unit");
var accomSet3 = new Array("Powered Site","Tent Site","Self-contained cabin", "Motel Unit");
var accomSet4 = new Array("Single w/ basic self catering","Single w/ continental breakfast","Double w/ basic self catering", "Double w/ continental breakfast");
var accomSet5 = new Array("Bed and Breakfast");
var accomSet6 = new Array("Bedroom w/ Queen Bed","Honeymoon Suite");
var accomSet7 = new Array("Bedroom w/ Queen Bed","Bunk Room");
var accomSet8 = new Array("Bed and Breakfast");
var accomSet9 = new Array("Eco-cabin");

function show_accom_type(str) {
	if (str == "Rutherford YHA") {
		createOptions(accomSet1);
	} else if (str == "Havelock Garden Motels") {
		createOptions(accomSet2);
	} else if (str == "Smiths Farm Holiday Park") {
		createOptions(accomSet3);
	} else if (str == "Ligitas Homestay") {
		createOptions(accomSet4);
	} else if (str == "Karen and Erics Hillside Retreat") {
		createOptions(accomSet5);
	} else if (str == "Sounds of Silence") {
		createOptions(accomSet6);
	} else if (str == "Anakiwa Lodge YHA") {
		createOptions(accomSet7);
	} else if (str == "Waterfront BnB") {
		createOptions(accomSet8);
	} else if (str == "Tui Nature Reserve") {
		createOptions(accomSet9);
	} else {
		createOptions(accomSet0);
	}
}

function createOptions(accomSet) {
	document.getElementById("accommodation").innerHTML = "";
	var accommOption = document.createElement('option');
	var accommOptionText = document.createTextNode('Choose the type of accommodation');
	accommOption.appendChild(accommOptionText);
	accommOption.setAttribute('value', '0');
	document.getElementById("accommodation").appendChild(accommOption);
	for (var i=0; i<accomSet.length; ++i) {
		accommOption = document.createElement('option');
		accommOptionText = document.createTextNode(accomSet[i]);
		accommOption.appendChild(accommOptionText);
		document.getElementById("accommodation").appendChild(accommOption);
	}
}