//Used to Output the hotel menu listed on the left, bottom-corner of KOR sites
function print(val){

	// VARIABLE "val" IS USED TO MATCH THE ID OF THE HOTEL PAGE THAT SHOULD DEFAULT IN THE POP-DOWN MENU
	// hotels ARRAY - 0 VALUE = "SHOW ALL HOTELS"
	// FOR EACH NEW HOTEL ADDED, YOU MUST ADD THE HOTEL NAME FOLLOWED BY "|" FOLLOWED BY THE HOTEL'S ID
	// THE LIST WILL BE SORTED AUTOMATICALLY

	var hotels = new Array();
	hotels[0] = "Avalon Beverly Hills|1919";
	hotels[1] = "Maison 140 Beverly Hills|1920";

	// sort array
	hotels.sort();

	var delimiter = "_JOIN_";

	// add the "Show all Hotels" option after the array was sorted to the beginning of the string version of the array
	//var hotelString = "Show all Hotels|0" + delimiter + hotels.join(delimiter);
	
	var hotelString = hotels.join(delimiter);
	
	// conver the string back to an array, with the "Select all Hotels" at the first position
	hotels = hotelString.split(delimiter);

	// get selected hotel id before sorting array
	var selectedHotelID = hotels[val].substring(0, hotels[val].indexOf("|"));

	var str = '<td colspan="3"><select name="hotelId" style="width:135px;margin-bottom:7px;">';

	var len = hotels.length;

	for (i=0; i<len; i++)
	{
		var hotelName = hotels[i].substring(0, hotels[i].indexOf("|"));
		var hotelID = hotels[i].substring(hotels[i].indexOf("|")+1, hotels[i].length);

		str = str + '<option ';

		/*if(hotelID == selectedHotelID){
			str = str + 'selected ';
		}*/

		str = str + 'value='+ hotelID + '>' + hotelName + '</option>';


	}
	str = str + '</select></td>';

	/*// IE DETECTION BECAUSE OF ODD SPACING, WE USE AN EXTRA <BR /> FOR THIS BROWSER
	if(navigator.appName.indexOf('Microsoft') != -1){
		document.write("<br />");
	}*/

	//OUTPUT THE OPTION LIST
	document.write(str);

	//RemoveChar(str);
}

function resDetails( ){	
	
	document.write('<td>');
	document.write('<select name="nights" value="" onChange="setDates(false);">');
	document.write('<option value="1">1</option>');
	document.write('<option value="2">2</option>');
	document.write('<option value="3">3</option>');
	document.write('<option value="4">4</option>');
	document.write('<option value="5">5</option>');
	document.write('<option value="6">6</option>');
	document.write('<option value="7">7</option>');
	document.write('<option value="8">8</option>');
	document.write('<option value="9">9</option>');
	document.write('<option value="10">10</option>');
	document.write('<option value="11">11</option>');
	document.write('<option value="12">12</option>');
	document.write('<option value="13">13</option>');
	document.write('<option value="14">14</option>');
	document.write('</select>');
	document.write('</td>');
	document.write('<td><select name="adult">');
	document.write('<option value="1">1</option>');
	document.write('<option value="2">2</option>');
	document.write('<option value="3">3</option>');
	document.write('<option value="4">4</option>');
	document.write('</select></td>');
	document.write('<td><select name="child">');
	document.write('<option value="0">0</option>');
	document.write('<option value="1">1</option>');
	document.write('<option value="2">2</option>');
	document.write('<option value="3">3</option>');
	document.write('<option value="4">4</option>');
	document.write('</select></td>');

}


function RemoveChar(str)
{
	var str2 ='';
	for(i=0; i<str.length; i++){
		str2 = str.replace(/"/, "");
		str = str2;
	}
	document.write(str2);

}
