function addMenuBar()
{
    document.write("<table width=\"100%\">");
    document.write("<tr>");
    document.write("<td class=\"blankMenuItem\">&nbsp;</td>");
    document.write("<td onMouseover=\"dropdownmenu(this, event, 'homeMenu')\" onclick=\"javascript:goHome();\" class=\"sitearea\"><a href=\"javascript:goHome();\">home</a></td>");
    document.write("<td onMouseover=\"dropdownmenu(this, event, 'interiorsMenu')\" onclick=\"javascript:openURL('/interiors/');\" class=\"sitearea\"><a href=\"/interiors/\" onClick=\"return clickreturnvalue()\">interiors</a></td>");
    document.write("<td onMouseover=\"dropdownmenu(this, event, 'alanMenu')\" onclick=\"javascript:openURL('/designers/alan%20titchmarsh/');\" class=\"sitearea\"><a href=\"/designers/alan%20titchmarsh/\" onClick=\"return clickreturnvalue()\">alan titchmarsh</a></td>");
    document.write("<td onMouseover=\"dropdownmenu(this, event, 'lindaMenu')\" onclick=\"javascript:openURL('/designers/linda%20barker/');\" class=\"sitearea\"><a href=\"/designers/linda%20barker/\" onClick=\"return clickreturnvalue()\">linda barker</a></td>");
    document.write("<td onMouseover=\"dropdownmenu(this, event, 'contactMenu')\" onclick=\"javascript:openURL('/contact.html');\" class=\"sitearea\"><a href=\"/contact.html\">contact</a></td>");
    document.write("<td class=\"blankMenuItem\">&nbsp;</td>");								
    document.write("</tr>");
    document.write("</table>");
}
		
function addMenuItems()
{
 		/*
		add breadcrumbs at top of page
		*/
    breadcrumbs();
		
 		/*
		add searchbox to top of screen
		*/
    searchbox();

 		/*
		add a back button to all item pages
		*/
		document.write("<div class=\"backToGallery\"><a href=\"javascript:history.back();\">&larr; back</a></div>");
		
    /*
    add this code to all html pages for the menu system
    */

    document.write("<div id=\"homeMenu\" class=\"anylinkcss\">");
    document.write("<a href=\"/about.html\">&nbsp;&nbsp;about pharmore</a>");
    document.write("<a href=\"http://www.pharmore.co.uk/designers/alan%20titchmarsh/Pharmore%20Alan%20Titchmarsh%20Ebrochure%202007-08.pdf\" target=\"_blank\">&nbsp;&nbsp;Alan Titchmarsh eBrochure</a>");
    document.write("<a href=\"http://www.pharmore.co.uk/designers/alan%20titchmarsh/Pharmore Water Features 2007_08.pdf\" target=\"_blank\">&nbsp;&nbsp;Pharmore eBrochure</a>");
    document.write("<a href=\"/interiors/dining/\">&nbsp;&nbsp;dining</a>");
    document.write("<a href=\"/interiors/mirrors/\">&nbsp;&nbsp;mirrors</a>");
    document.write("<a href=\"/interiors/storage/\">&nbsp;&nbsp;storage</a>");
    document.write("<a href=\"/interiors/paintings/\">&nbsp;&nbsp;oil paintings</a>");
    document.write("<a href=\"/interiors/massage%20chair/\">&nbsp;&nbsp;massage chair</a>");
    document.write("<a href=\"/designers/alan%20titchmarsh/hanging%20baskets/\">&nbsp;&nbsp;hanging baskets</a>");
    document.write("<a href=\"/designers/alan%20titchmarsh/planters/\">&nbsp;&nbsp;planters</a>");
    document.write("<a href=\"/designers/alan%20titchmarsh/water%20features/\">&nbsp;&nbsp;water features</a>");
    document.write("<a href=\"/designers/\">&nbsp;&nbsp;Designers</a>");
    document.write("</div>");
    
    document.write("<div id=\"interiorsMenu\" class=\"anylinkcss\">");
    document.write("<a href=\"/interiors/dining/\">&nbsp;&nbsp;dining</a>");
    document.write("<a href=\"/interiors/mirrors/\">&nbsp;&nbsp;mirrors</a>");
    document.write("<a href=\"/interiors/storage/\">&nbsp;&nbsp;storage</a>");
    document.write("<a href=\"/interiors/paintings/\">&nbsp;&nbsp;oil paintings</a>");
    document.write("<a href=\"/interiors/massage%20chair/\">&nbsp;&nbsp;massage chair</a>");
    document.write("</div>");
    
    document.write("<div id=\"alanMenu\" class=\"anylinkcss\">");
    document.write("<a href=\"/designers/alan%20titchmarsh/hanging%20baskets/\">&nbsp;&nbsp;hanging baskets</a>");
    document.write("<a href=\"/designers/alan%20titchmarsh/planters/\">&nbsp;&nbsp;planters</a>");
    document.write("<a href=\"/designers/alan%20titchmarsh/water%20features/\">&nbsp;&nbsp;water features</a>");
    document.write("</div>");
    
    document.write("<div id=\"lindaMenu\" class=\"anylinkcss\">");
    document.write("<a href=\"/designers/linda%20barker/mirrors/\">&nbsp;&nbsp;mirrors</a>");
    document.write("<a href=\"/designers/linda%20barker/frames/\">&nbsp;&nbsp;frames</a>");
    document.write("</div>");
    
    document.write("<div id=\"contactMenu\" class=\"anylinkcss\">");
    document.write("<a href=\"/contact.html\">&nbsp;&nbsp;contact us</a>");
    document.write("<a href=\"javascript:showLocation()\">&nbsp;&nbsp;location map</a>");
    document.write("</div>");
}

function breadcrumbs()
{
    var address = document.location.href;
    var addressArray = new Array();
    addressArray = address.split("/");
		document.write("<div class=\"breadcrumbContainer\"><div class=\"breadcrumbs\">");
    document.write("<a href=\"javascript:goHome();\">home</a>");
    for (i = 3; i < addressArray.length; i++)
    {
       var area = addressArray[i];
			 var indexOfArea = address.indexOf(area);
			 var urlAddress = address.substring(0, indexOfArea) + area + "/";
       if (area != "")
       {
          area = area.replace(/%20/gi, " ");
					if (area.indexOf(".html") != -1)
					{
					 	 area = area.replace(/.html/gi, " ");
						 document.write("&nbsp;&rarr;&nbsp;<a id=\"lastNode\" href=\""+urlAddress+"\">" + area + "</a>");
					}
					else
					{
					 		document.write("&nbsp;&rarr;&nbsp;<a href=\""+urlAddress+"\">" + area + "</a>");
					}
       }
    }
		document.write("</div></div>");
		return;
}

function searchbox()
{
    document.write("<div id=\"searchbox\">");
		document.write("<form action=\"/cgi-sys/entropysearch.cgi\" target=searchwindow><input type=\"text\" name=\"query\" value=\"\"><input type=\"hidden\" name=\"user\" value=\"gregprat\" /><input type=\"hidden\" name=\"basehref\" value=\"http://www.myzu.co.uk/\" /><input type=\"hidden\" name=\"template\" value=\"default\" /><input class=\"button\" type=\"submit\" value=\"search\" /></form>");
		document.write("</div>");
}

function createCookie(name,value,days)
{
  if (days)
  {
  	var date = new Date();
  	date.setTime(date.getTime()+(days*24*60*60*1000));
  	var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+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 "";
}

function openURL(url){
	window.location.href = url;
}

function goHome()
{
	window.location.href = "http://www.pharmore.co.uk/";		
}

function showLocation()
{
	window.location.href = "/location.html";
}		

function getDirections()
{
	saddr = document.getElementById("fromPostcode").value;
	if (saddr == "")
	{
	 	 		alert("Please enter a postcode");
	}
	else
	{
				daddr = "LS2 7QG";
				var url = "http://maps.google.co.uk/maps?daddr={"+daddr+"}&saddr={"+saddr+"}";
				window.open(url, "_blank");
	}
}

function show(elementId)
{
   document.getElementById(elementId).style.visibility = 'visible';
}

function hide(elementId)
{
   document.getElementById(elementId).style.visibility = 'hidden';
}		

var baseopacity=85

function slowhigh(which2){
  imgobj=which2
  browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
  instantset(baseopacity)
  highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
  cleartimer()
  instantset(baseopacity)
}

function instantset(degree){
  if (browserdetect=="mozilla") imgobj.style.MozOpacity=degree/100
  else if (browserdetect=="ie") imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
  if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
  if (browserdetect=="mozilla" && cur2.style.MozOpacity<1) cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
  else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100) cur2.filters.alpha.opacity+=10
  else if (window.highlighting) clearInterval(highlighting)
}