function expand(param)
	{
		var expanded;
		var icon = document.getElementById(param.getAttribute("id")+".img");
		
		if (param.style.display=="none")
			{
			expanded = false;
			param.style.display="";
			param.scrollIntoView();
			icon.setAttribute("src", "graphics/icon_minus.gif");
			icon.setAttribute("alt", "+");
			icon.setAttribute("title", "Expand");			
			}
		else
			{
			expanded = true;
			param.style.display="none";
			icon.setAttribute("src", "graphics/icon_plus.gif");
			icon.setAttribute("alt", "-");
			icon.setAttribute("title", "Hide");			
			}
						
		//remember whether to expand the info box or not
		if (param.getAttribute("class") == "picInfoTable")
			{
			var date = new Date();
			date.setTime(date.getTime()+(30*24*60*60*1000));//30 days
			var expires = "; expires="+date.toGMTString();
			document.cookie = "infotable_expanded="+expanded+expires+"; path=/";	
			}
	}
	
function expand_banner(param)
	{
		var expanded;
		var icon = document.getElementById(param.getAttribute("id")+".img");
		var button_text = document.getElementById(param.getAttribute("id")+".button_text");
		
		if (icon.getAttribute("src") == "graphics/icon_plus.gif")
			{
			expanded = "true";
			param.setAttribute("src", "graphics/robottourist.png");
			icon.setAttribute("src", "graphics/icon_minus.gif");
			icon.setAttribute("alt", "-");
			icon.setAttribute("title", "Hide");			
			button_text.innerHTML = "Hide Banner";
			}
		else
			{
			expanded = "false";
			param.setAttribute("src", "graphics/tiny_logo.png");
			icon.setAttribute("src", "graphics/icon_plus.gif");
			icon.setAttribute("alt", "+");
			icon.setAttribute("title", "Expand");			
			button_text.innerHTML = "Show Banner";
			}
			
	var date = new Date();
	date.setTime(date.getTime()+(30*24*60*60*1000));//30 days
	var expires = "; expires="+date.toGMTString();
	document.cookie = "banner_expanded="+expanded+expires+"; path=/";
	}
	
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}	

function create_banner()
{
	document.write("<a href=\"javascript:expand_banner(document.getElementById('expander.hidebanner'))\">");
		
	var button_img = "graphics/icon_minus.gif";	
	var button_text = "Hide Banner";
	var banner_img = "graphics/robottourist.png";
	var button_alt = "-";
	var button_title = "Hide";
	
	if (readCookie("banner_expanded") == "false")
		{
		button_img = "graphics/icon_plus.gif";
		button_text = "Show Banner";
		banner_img = "graphics/tiny_logo.png";
		button_alt = "+";
		button_title = "Expand";
		}
		
	 document.write("<img src=\""+button_img+"\" align=\"absmiddle\" alt=\""+button_alt+"\" title=\"" + button_title+"\" vspace=\"5\" hspace=\"5\" id=\"expander.hidebanner.img\"/>");
	 document.write("<span class=\"banner_hide\" id=\"expander.hidebanner.button_text\">"+button_text+"</span></a>");
	 document.write("</td><td>");
	 document.write("<img id=\"expander.hidebanner\" src=\""+banner_img+"\" alt=\"Robot Tourist\" title=\"Robot Tourist\"/>");
}