// JavaScript document for Woodland Herbs.

function tellAFriend() {
  var text = "I thought you might be quite interested in visiting the following page.\n\n"
  text += window.location.toString();
  window.location.href = 'mailto:?subject=Visit%20woodlandherbs.co.uk&body=' + encodeURI(text);
}

// JavaScript Document
var $ = function(id) {
  return document.getElementById(id);
};

function teclanLoad() {
  //fix the border to run the full height of the center div
  var left = $("left"), center = $("content");
  if (left && center) {
    var origOffset = center.offsetHeight;
    if (left.offsetHeight < center.offsetHeight  ) {
      left.style.height = center.offsetHeight + "px";
    }
	else if (left.offsetHeight > center.offsetHeight) {
	  center.style.height = left.offsetHeight + "px";
	}
  }
}

if (window.attachEvent) { 
  window.attachEvent("onload", teclanLoad); 
} 
else {  
  window.addEventListener("load", teclanLoad, false); 
}

function bookmark(title) {
  var url = window.location.toString();
  if (window.sidebar) {
    window.sidebar.addPanel(title, url, "");
  }
  else if(window.opera && window.print) {
    var elem = document.createElement('a');
    elem.setAttribute('href', url);
    elem.setAttribute('title', title);
    elem.setAttribute('rel', 'sidebar');
    elem.click();
  } 
  else if (document.all) {
    window.external.AddFavorite(url, title);
  }
}

function jumpTo() {
  var topTen = $('top10');
  if (topTen && topTen.selectedIndex > 0) {
    var theURL = topTen.options[topTen.selectedIndex].value;
	if (theURL) {
	  window.location = theURL;
	}
  }
}
