function parseTip() {
	var tipbox = document.getElementById("tip");
	if(tipbox.hasChildNodes()) {
		while (tipbox.hasChildNodes()) {
			tipbox.removeChild(tipbox.lastChild);
		}
	}
	//grab a random tip
	var randNum = Math.floor(Math.random() * ResultSetCopy.length)
	//grab data
	var headline = ResultSetHeadline[randNum];
	var copy = ResultSetCopy[randNum];
	// create elements
	var header = document.createElement("h4");
	var para = document.createElement("p");
	//create text
	var headline_text = document.createTextNode(headline);
	var copy_text = document.createTextNode(copy);
	// insert the markup
	header.appendChild(headline_text);
	para.appendChild(copy_text);
	//attach elements to container
	//tipbox.appendChild(header);
	tipbox.appendChild(para);
	//deal with tip page link
	/*var tipContainer = document.getElementById("tip_of_the_day");
	var tipPageLink = document.createElement("a");
	tipPageLink.setAttribute("href","http://www.fineliving.com/fine/shopping_with_chefs/article/0,3147,FINE_29696_5584185,00.html");
	tipPageLink.setAttribute("title", "View more tips here!");
	tipPageLink.setAttribute("class", "tipPageLink");
	var tipPageLink_text = document.createTextNode("View more Shopping With Chefs!");
	tipPageLink.appendChild(tipPageLink_text);
	tipContainer.appendChild(tipPageLink);*/
	
}

function getScript() {
		var url = "http://web.fineliving.com/fine/showPages/MarthaStewart/js/tipList.js";
		var scripttag = document.createElement("script");
		var tipsLoaded = true;
		scripttag.setAttribute("id","tipSource");
		scripttag.setAttribute("type","text/javascript");
		scripttag.setAttribute("src",url);
		document.getElementsByTagName("head")[0].appendChild(scripttag);
}