function drawToolbar() {

	// Identify the current page based on filename
	var thisPage = location.href.substring(location.href.lastIndexOf("/")+1, location.href.length);
	var selectedItem;
	
	// Draw the toolbar
	document.writeln("<table width=\"750\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\" align=\"center\">");
	document.writeln("	<tr>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarHome\" onmouseout=\"toolbarOut('toolbarHome');\" onmouseover=\"toolbarOver('toolbarHome');\" onmousedown=\"toolbarPress('toolbarHome');\">");
	document.writeln("      <img src=\"images/toolbar_icons_home.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Home</td>");
		document.writeln("      <td class=\"toolbar_item\" id=\"toolbarReception\" onmouseout=\"toolbarOut('toolbarReception');\" onmouseover=\"toolbarOver('toolbarReception');\" onmousedown=\"toolbarPress('toolbarReception');\">");
	document.writeln("      <img src=\"images/toolbar_icons_reception.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Reception</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarDesksCredenzas\" onmouseout=\"toolbarOut('toolbarDesksCredenzas');\" onmouseover=\"toolbarOver('toolbarDesksCredenzas');\" onmousedown=\"toolbarPress('toolbarDesksCredenzas');\">");
	document.writeln("      <img src=\"images/toolbar_icons_deskscredenzas.gif\" width=\"75\" height=\"75\"><br>");
   	document.writeln("        Desks & Credenzas</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarSuites\" onmouseout=\"toolbarOut('toolbarSuites');\" onmouseover=\"toolbarOver('toolbarSuites');\" onmousedown=\"toolbarPress('toolbarSuites');\">");
	document.writeln("      <img src=\"images/toolbar_icons_suites.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Suites</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarSeating\" onmouseout=\"toolbarOut('toolbarSeating');\" onmouseover=\"toolbarOver('toolbarSeating');\" onmousedown=\"toolbarPress('toolbarSeating');\">");
	document.writeln("      <img src=\"images/toolbar_icons_seating.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Seating</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarSystems\" onmouseout=\"toolbarOut('toolbarSystems');\" onmouseover=\"toolbarOver('toolbarSystems');\" onmousedown=\"toolbarPress('toolbarSystems');\">");
	document.writeln("      <img src=\"images/toolbar_icons_systems.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Systems & Cubicles</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarStorage\" onmouseout=\"toolbarOut('toolbarStorage');\" onmouseover=\"toolbarOver('toolbarStorage');\" onmousedown=\"toolbarPress('toolbarStorage');\">");
	document.writeln("      <img src=\"images/toolbar_icons_storage.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Storage</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarTables\" onmouseout=\"toolbarOut('toolbarTables');\" onmouseover=\"toolbarOver('toolbarTables');\" onmousedown=\"toolbarPress('toolbarTables');\">");
	document.writeln("      <img src=\"images/toolbar_icons_tables.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Tables</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarPanelsCallCentres\" onmouseout=\"toolbarOut('toolbarPanelsCallCentres');\" onmouseover=\"toolbarOver('toolbarPanelsCallCentres');\" onmousedown=\"toolbarPress('toolbarPanelsCallCentres');\">");
	document.writeln("      <img src=\"images/toolbar_icons_callcentre.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Panels & Call Centres</td>");
    	document.writeln("      <td class=\"toolbar_item\" id=\"toolbarBoardroom\" onmouseout=\"toolbarOut('toolbarBoardroom');\" onmouseover=\"toolbarOver('toolbarBoardroom');\" onmousedown=\"toolbarPress('toolbarBoardroom');\">");
	document.writeln("      <img src=\"images/toolbar_icons_boardroom.gif\" width=\"75\" height=\"75\"><br>");
    	document.writeln("        Boardroom</td>");
    	document.writeln("  </tr>");
    	document.writeln("</table>");

	// Now determine which item should be set as selected
	if(thisPage != "index.html") {
	
		if(thisPage == "index.html") selectedItem = "toolbarHome";
		else if(thisPage == "reception.html") selectedItem = "toolbarReception";
		else if(thisPage == "desks_credenzas.html") selectedItem = "toolbarDesksCredenzas";
		else if(thisPage == "suites.html") selectedItem = "toolbarSuites";
		else if(thisPage == "seating.html") selectedItem = "toolbarSeating";
		else if(thisPage == "systems.html") selectedItem = "toolbarSystems";
		else if(thisPage == "storage.html") selectedItem = "toolbarStorage";
		else if(thisPage == "tables.html") selectedItem = "toolbarTables";
		else if(thisPage == "panels_callcentres.html") selectedItem = "toolbarPanelsCallCentres";
		else if(thisPage == "boardroom.html") selectedItem = "toolbarBoardroom";
	
		// Assign CSS style and disable all mouse handlers for selected item
		document.getElementById(selectedItem).className = "toolbar_item_selected";
		document.getElementById(selectedItem).onmouseover = "";
		document.getElementById(selectedItem).onmouseout = "";
		document.getElementById(selectedItem).onmousedown = "";
	}
}

function toolbarOver(i_target) {
	//alert("[toolbarOver]");
	var myTarget = document.getElementById(i_target);
	myTarget.className = "toolbar_item_over";
}

function toolbarOut(i_target) {
	//alert("[toolbarOut]");
	var myTarget = document.getElementById(i_target);
	myTarget.className = "toolbar_item";
}

function toolbarPress(i_target) {
	//alert("[toolbarPress]");
	if(i_target == "toolbarHome") location.href = "index.html";
	else if(i_target == "toolbarReception") location.href = "reception.html";
	else if(i_target == "toolbarDesksCredenzas") location.href = "desks_credenzas.html";
	else if(i_target == "toolbarSuites") location.href = "suites.html";
	else if(i_target == "toolbarSeating") location.href = "seating.html";
	else if(i_target == "toolbarSystems") location.href = "systems.html";
	else if(i_target == "toolbarStorage") location.href = "storage.html";
	else if(i_target == "toolbarTables") location.href = "tables.html";
	else if(i_target == "toolbarPanelsCallCentres") location.href = "panels_callcentres.html";
	else if(i_target == "toolbarBoardroom") location.href = "boardroom.html";
}

