/* Web Design and Programming by Cube Connection Ltd, Copyright 2006 - www.CubeConnection.co.uk */
function showemail(username, hostname, friendlyname, displaystyle) {
  var linktext;
  if (friendlyname == "")
    if (displaystyle == "") {
      linktext = username + "@" + hostname;
      document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + linktext + "</a>")
    }
    else {
      linktext = username + "@" + hostname;
      document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + " class='" + displaystyle + "'>" + linktext + "</a>")
    }
  else {
    if (displaystyle == "") {
      linktext = username + "@" + hostname;
      document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + friendlyname + "</a>")
    }
    else {
      linktext = username + "@" + hostname;
      document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + " class='" + displaystyle + "'>" + friendlyname + "</a>")
    }
  }
  return true;
}

//ContentHeight - extends the content div so that it allows an integer of full side background images
//and hence matches the bottom background image properly
//NB offsetHeight gives height plus margins, so style.height doesn't want the margins so take off 60 from the top+bottom margin (from the css)
function ContentHeight() { 
  var contentid, contentheight;
  if(document.getElementById) {
    contentid=document.getElementById('contentbox');
    /*Extend Content area if not exactly a full number of background images high*/
    contentheight=contentid.offsetHeight;
    if(contentheight%266!=0) {
      contentid.style.height=(contentheight-60)+(266-(contentheight%266))+"px";
    }
  }
}

function HomeAlignRightCol() {
  document.getElementById('homeimg').style.top=document.getElementById('hometext').offsetTop
  document.getElementById('hometag').style.top=document.getElementById('homeimg').offsetTop+302
}

function IE6PNGSwap(elementID, strImage) {
  document.getElementById(elementID).style.backgroundImage = "url("+strImage+")";
}

/*************************************************************
* Window Onload Manager (WOM) v1.0
* Author: Justin Barlow - www.netlobo.com
*
* Description:
* The WOM library of functions allows you to easily call
* multiple javascript functions when your page loads.
*
* Usage:
* Add functions to WOM using the womAdd() function. Pass the
* name of your functions (with or without parameters) into
* womAdd(). Then call womOn() like this:
*     womAdd('hideDiv()');
*     womAdd('changeBg("menuopts","#CCCCCC")');
*     womOn();
* WOM will now run when your page loads and run all of the
* functions you have added using womAdd()
*************************************************************/
/*************************************************************
* The womOn() function will set the window.onload function to
* be womGo() which will run all of your window.onload
* functions.
*************************************************************/
function womOn(){
  window.onload = womGo;
}
/*************************************************************
* The womGo() function loops through the woms array and
* runs each function in the array.
*************************************************************/
function womGo(){
  for(var i = 0;i < woms.length;i++)
    eval(woms[i]);
}
/*************************************************************
* The womAdd() function will add another function to the woms
* array to be run when the page loads.
*************************************************************/
function womAdd(func){
  woms[woms.length] = func;
}
/*************************************************************
* The woms array holds all of the functions you wish to run
* when the page loads.
*************************************************************/
var woms = new Array();
womAdd('ContentHeight()');
womOn();
