// JavaScript Document

function parseXML()
{

var search_term=window.location.search.substring(1);  //sets the search_term variable to the URL string query
var tour_name;
var tour_link;
var station_logo;

try
	{
		if (window.ActiveXObject)
		{
			var errorHappendHere = "Check Browser and security settings";
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.async=false;
			xmlDoc.load("xml/" + search_term + ".xml");
		}
		else if(window.XMLHttpRequest)
		{
			var errorHappendHere = "Error handling XMLHttpRequest request";
			var d = new XMLHttpRequest();
			d.open("GET", "xml/" + search_term + ".xml", false);
			d.send(null);
			xmlDoc=d.responseXML;
		} 
		else {
			var errorHappendHere = "Error.";
			xmlDoc = document.implementation.createDocument("","",null);
			xmlDoc.async=false;
			xmlDoc.load("xml/" + search_term + ".xml");
		}
	}	
	catch(e)
	{
		alert(errorHappendHere);
	}


var x=xmlDoc.getElementsByTagName("name");
station_logo=xmlDoc.getElementsByTagName("stationlogo")[0].firstChild.nodeValue;


document.write("<h4 class=\"slate\" style=\"margin: 0px 0px 20px 0px\" >(You entered keyword \"" + search_term + "\")</h3>");
document.write("<p class=\"b1\" style=\"margin-bottom: 20px\">Click on a link below to view the brochure for each tour. If you would like to download and save a copy, simply right-click the link below and select &quot;Save As&quot; to download to your computer.</p>");
document.write("<div style=\"float:right\"><img src=\"" + station_logo + "\" /></div>"); //logo

document.write("<ul style=\"list-style-image: none; list-style-type: none; padding: 0px 0px 0px 20px\">");
for (i=0;i<x.length;i++)
  {
  tour_name=xmlDoc.getElementsByTagName("name")[i].firstChild.nodeValue;
  tour_link=xmlDoc.getElementsByTagName("tourlink")[i].firstChild.nodeValue;
  tour_host=xmlDoc.getElementsByTagName("host")[i].firstChild.nodeValue;
  document.write("<li style=\"margin:0px; padding: 0px 0px 0px 0px; font-family: 'Century Gothic'; font-size: 1.125em; \"><a href=\"http://www.holidayvacations.net/keyword_results/keyword_results.php" + "\" onClick=\"javascript: pageTracker._trackPageview('http://www.holidayvacations.net/keyword_results/keyword_results.php" + "');\">" + tour_name + "</a></li>");
  document.write("<div class=\"b1 darkgray\">" + tour_host + "</div>");
  document.write("<br />");
  }
document.write("</ul>");  

}





function write_email(){

var keyword=window.location.search.substring(1);
document.form1.action ="kw_handle_email2.php?" + keyword;

}