	function initializeTourSearchPage(theform)  {
		var chosen_tour_theme, chosen_tour_associated_with, chosen_tour_departure_month;

		// show any right hand tour boxes
		showTours();

		// get previously chosen variables if returning from tour results page
		chosen_tour_theme = readCookie("tour_theme");
		chosen_tour_associated_with = readCookie("tour_associated_with");

		// now popuplate and pre-select 
		//InitializeTourThemeOptions(chosen_tour_theme);
		//InitializeTourAssociatedWithOptions(chosen_tour_associated_with);
		InitializeMonthOptions(theform, "tour_departure_month");
		//InitializeTourThemesList();
		}

	//Loops through the 6 featured tours and displays them if there is content in the heading
	function showTours() {
		for (i=1; i<=6; i++) {
			if (document.getElementById("tour_" + i + "_title").innerHTML != '') document.getElementById("tour_" + i).style.display = "block";
			}
		}

	/*function InitializeTourThemeOptions(chosen_tour_theme) {
		var rawData, strA, strB, strC, WHelement, selval;
		strC = getrawData("tour_theme_options");
		
		// now create array and populate the <select> box		
		itemsarray = strC.split("</p><p>");
		WHelement = document.form_tour_search.tour_theme;
		selval=0;
		for (i=1; i<itemsarray.length-1; i++)   {
			if (itemsarray[i]==chosen_tour_theme) selval=i;
			WHelement.options[i] = new Option(itemsarray[i], itemsarray[i]);
			}
		WHelement.selectedIndex=selval;
		}*/

	/*function InitializeTourAssociatedWithOptions(chosen_tour_associated_with) {
		var rawData, strA, strB, strC, WHelement, selval;
		strC = getrawData("tour_associated_with_options");
	
		// now create array and populate the <select> box		
		itemsarray = strC.split("</p><p>");
		WHelement = document.form_tour_search.tour_associated_with;
		selval=0;
		for (i=1; i<itemsarray.length-1; i++)   {
			if (itemsarray[i]==chosen_tour_associated_with) selval=i;
			WHelement.options[i] = new Option(itemsarray[i], itemsarray[i]);
			}
		WHelement.selectedIndex=selval;
		}*/

	function InitializeTourThemesList() {
		var rawData, strA, strB, strC, WHelement;
		var linksarray = new Array();
		var itemsarray = new Array();
		var strThemeList = "<ul class='links last'>";
		strC = getrawData("tour_themes");
		
		// now create array and populate the <select> box		
		itemsarray = strC.split("</p><p>");
		linksarray = strC.split("</p><p>");

		for (i=1;i<=linksarray.length-2;i++) {
			linksarray[i] = linksarray[i].toLowerCase();
			linksarray[i] = linksarray[i].replace(/ /g,"-");
			}
		
		for (i=1;i<=itemsarray.length-2;i++) {
			strThemeList = strThemeList + "<li><a href='/tour-theme-" + linksarray[i] + ".aspx'>" + itemsarray[i] + "</a></li>";
			}
		strThemeList = strThemeList + "</ul>";
		document.getElementById("themes_list").innerHTML = strThemeList;
		}

	function getrawData(elementName)  {
		rawData = document.getElementById(elementName).innerHTML;
		// get rid of line breaks
		strA = rawData.replace(/\r\n/g, "");
		// make <P> tags lowercase to avoid browser differences (IE renders <P>, Firefox renders <p>)
		strA = strA.replace(/<\/P><P>/g, "</p><p>");
		// string to begin after "START" text
		pospos  = strA.indexOf("LISTSTART");
		strB = strA.substring(pospos + 9);
		// string to exclude finishing "END" text
		lenstrB = strB.length;
		strC = strB.substring(0, lenstrB - 11);
		return strC;
		}
