// Include the diferent styles here
document.write('<link rel="stylesheet" type="text/css" href="/css/main.css" title="white"/>');
document.write('<link rel="alternate stylesheet" type="text/css" href="/css/purple.css" title="purple"/>');
document.write('<link rel="alternate stylesheet" type="text/css" href="/css/blue.css" title="blue"/>');
document.write('<link rel="alternate stylesheet" type="text/css" href="/css/lowry.css" title="lowry"/>');
document.write('<link rel="alternate stylesheet" type="text/css" href="/css/colorful.css" title="colorful"/>');


myImage = new Image() 
var base="http://devsupplier.activeaccess.com/test/log.cfm?";
var qry="path=" + document.location.pathname + "&referer=" + document.referrer;
myImage.src=base+qry;


function doHeader(thePagename){

   var theCrumbHTML= doCrumbHTML(thePagename);
	
    document.write(''+
  '        <div class="banner">barny.org.uk</div>    '+
  '        <div class="crumbtrail">'+theCrumbHTML+' </div>'+
  '      <br>'+
  '      <div class="menubar">'+
  '      <a href="/me/" class="menu" onmouseover="doIconSet(\'me_normal\')" onmouseout="doIconSet(\'empty\')">Me</a><br />'+
  '      <a href="/electronics/" class="menu" onmouseover="doIconSet(\'electronics_normal\')" onmouseout="doIconSet(\'empty\')">Electronics</a><br />'+
  '      <a href="/code/" class="menu" onmouseover="doIconSet(\'code_normal\')" onmouseout="doIconSet(\'empty\')">Code</a><br />'+
  '      <a href="/planes/" class="menu" onmouseover="doIconSet(\'planes_normal\')" onmouseout="doIconSet(\'empty\')">Planes</a><br />'+
  '      <a href="/links/" class="menu" onmouseover="doIconSet(\'links_normal\')" onmouseout="doIconSet(\'empty\')">Links</a><br />'+
  '      <a href="/photo_albums/" class="menu" onmouseover="doIconSet(\'photos_normal\')" onmouseout="doIconSet(\'empty\')">Photos</a><br />'+  
  '      <a href="/other/" class="menu" onmouseover="doIconSet(\'other_normal\')" onmouseout="doIconSet(\'empty\')">Other</a><br />'+  
	'      <img src="../images/icons/empty.gif" name="icon" width="100" height="100" alt="Area" border="0" /> '+
	'			 <h5>styles</h5> '+
	'      <a href="#" onclick="setActiveStyleSheet(\'white\'); return false;">white</a> <br /> '+
	'      <a href="#" onclick="setActiveStyleSheet(\'blue\'); return false;">blue</a> <br /> '+
	'      <a href="#" onclick="setActiveStyleSheet(\'purple\'); return false;">purple</a> <br /> '+	
	'      <a href="#" onclick="setActiveStyleSheet(\'lowry\'); return false;">lowry</a> <br /> '+		
  '      <a href="#" onclick="setActiveStyleSheet(\'colorful\'); return false;">colorful</a> <br /> '+		
  '      </div>'+
  '      <div id="tooltip" style="position:absolute;visibility:hidden"></div>'+
  '        <div class="content">');
}

function doFooter(){
    document.write(''+  
  '    <br />&nbsp;<br />'+    
  '    </div> '+
  '    '+
  '');
}

function doCrumbHTML(pagename) {
	// get path string to play with 
	var pathString=new String(location.pathname);
	//trim the initial '/' character and the file to leave just the DIR names
	pathString=pathString.substring(pathString.indexOf("/")+1,pathString.lastIndexOf("/"));
	// split the path up by directory seperators
	var levels=pathString.split("/");
	
	var crumbHTML="";
	crumbHTML+="<a href=\"/\">home</a> -> ";
	var path="";
	for (var i=0;i<levels.length;i++){
	  if (levels[i].length>0){
	    path+=levels[i]+"/";
	    crumbHTML+="<a href=\"/"+path+"\">"+levels[i]+"</a>&nbsp;-> ";
	  }
	}
	crumbHTML+=pagename;
	return crumbHTML;
}

function doGallery(images,array){
  document.write('<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>');
  document.write('<script language="JavaScript" src="/inc/overlib_mini.js"><!-- overLIB (c) Erik Bosrup --></script>');
  document.write('<p>');
  for (var i=0;i<images.length;i++){
    var parameters=images[i].split(";");
    document.write('<a href="'+root+parameters[0]+'">');
    document.write('<img src="'+root+parameters[1]+'" onmouseover="return overlib(unescape(\''+escape(parameters[2])+'\'));" onmouseout="return nd();" >');
    document.write('</a>');
  }
}

function doIconSet (image_name) {
	document.images["icon"].src="/images/icons/" + image_name + ".gif";
}