function drawHeader (intCompanyId, strTableColor, strMainImage, strBusinessImagePath, intReleaseType) {

	//21/1/04 - SV replaced /images with images as filename path so works in Frontpage
	//		Removed search, customer support, references to Research Matters, line starting with "Home..."
      //	      Added specific EBSD menu bar and some modifications to make this work properly.
      //          Included http://www.oxford-instruments.com on all OI web page addresses
	//16/7/04 - SV changed copyright_2003.gif to copyright.gif for 2004
	//		Changed reference to different GIF pointer to SV consulting.
	//22/10/04
	//		Version for x-raymicroanalysis.com with different menu and logo.
	//		Modified so that all page content two directories below current directory.
	//		Modified so that drop down menus do not appear.
	//		Contact point moved to trhc
	//		Added search back in.
	//24/3/05
	//		Removed Medical navigation items
	//13/3/06
	//		All OI web links to oxford-instruments.com following introduction of new OI site

	// below has been added to allow for research matters yellow links
	// It has been given an ID of 100, but is set back to supconductivity ID 4
	// for link purposes (i.e. search, etc.)

	var research_matters = false;
	var strCompAbbrev;
	
	if (intCompanyId == '100') {
		var research_matters = true;
		intCompanyId = '4';
	}
	
	if (intCompanyId == '101') {
		var cryospares = true;
		intCompanyId = '4';
	}

	// company abbreviations
	
	switch (intCompanyId){
		case "3" :
			strCompAbbrev = "OIG";
			break;
		case "4" :
			strCompAbbrev = "SCN";
			break;
		case "5" :
			strCompAbbrev = "MDC";
			break;
		case "6" :
			strCompAbbrev = "ANL";
			break;
		case "7" :
			strCompAbbrev = "OST";
			break;
		case "8" :
			strCompAbbrev = "PLM";
			break;
		case "9" :
			strCompAbbrev = "XTG";
			break;
		case "10" :
			strCompAbbrev = "AUS";
			break;
		default :
			intCompanyId = '3';
			strCompAbbrev = "OIG";
	}
	
	//The definitions are not entirely required, but location of menu changed when they are removed.
	document.write('<style>');
	document.write('#mainmenu {');
	document.write('	position:	absolute;');
	document.write('	left:		0px;');
	document.write('	top:		53px;');
	document.write('	width:		158px;');
	document.write('	height:		50px;');
	document.write('	z-index:	2;');
	document.write('	visibility:	visible;');
	document.write('}');

	//Hiden as not required at present.
	document.write('#menu1 {');
	document.write('	position:	absolute;');
	document.write('	left:		1px;');
	document.write('	top:		124px;');
	document.write('	width:		139px;');
	document.write('	height:		140px;');
	document.write('	z-index:	3;');
	document.write('	visibility:	hidden;');
	document.write('}');

	document.write('#menu2 {');
	document.write('	position:	absolute;');
	document.write('	left:		106px;');
	document.write('	top:		124px;');
	document.write('	width:		139px;');
	document.write('	height:		140px;');
	document.write('	z-index:	3;');
	document.write('	visibility:	hidden;');
	document.write('}');

	document.write('#menu3 {');
	document.write('	position:	absolute;');
	document.write('	left:		211px;');
	document.write('	top:		124px;');
	document.write('	width:		139px;');
	document.write('	height:		140px;');
	document.write('	z-index:	3;');
	document.write('	visibility:	hidden;');
	document.write('}');

	document.write('#menu4 {');
	document.write('	position:	absolute;');
	document.write('	left:		316px;');
	document.write('	top:		124px;');
	document.write('	width:		139px;');
	document.write('	height:		140px;');
	document.write('	z-index:	3;');
	document.write('	visibility:	hidden;');
	document.write('}');
	document.write('</style>');
	
	var htmlOutput = '<table border="0" cellpadding="0" cellspacing="0" width="100%">' +
					'<tr height="52"><td valign="top" bgcolor="#13236e">'+
					'<table cellpadding="0" cellspacing="0"><tr><td>'+
					'<a href="http://www.oxford-instruments.com"><img src="../../images/topnav/top_logoarea.gif" alt="Oxford Instruments - Innovation For All Our Futures" width="420" height="53" border="0" /></a>'+
					'<img src ="../../images/topnav/xraylogo.jpg" alt="Oxford Instruments X-ray Microanalysis Web Site" width = "368" height ="53" border ="0">' +
                              '<a href="../main/search.htm"><img src ="../../images/topnav/site_search.gif" border="0"><img src ="../../images/topnav/oxinst_arrow_26.gif" border="0"></a>' + 
					'<a href="mailto:analytical@oxinst.co.uk"><img src="../../images/general/further_information.gif" alt="Contact us for more information" border="0"/></a>' +
					'</td></tr></table></td></tr>'+
					'<tr><td valign="top" bgcolor="' + strTableColor + '"><img src="../../images/spacer.gif" width="1" height="71"></img></td></tr>'+
					'</table>';

	document.write(htmlOutput);
	document.write("<div id='mainmenu'>");
      //In next line height was "94".  The next commented out line put in an extra row which put the menu item at the right
	//place with top at pixel 53.  For some reason this all had the effect of preventing the hyperlinks in the
	//EBSD menu table from working.
	document.write("<table border='0' cellspacing='0' cellpadding='0' height='71'><tr height='71'>");
	document.write("<td><a href=\"http://www.oxford-instruments.com\" OnMouseOut=\"MM_swapImgRestore();MM_showHideLayers('menu1','','hide','menu2','','hide','menu3','','hide','menu4','','hide','trans','','show')\" onMouseOver=\"MM_swapImage('oi','','../../images/topnav/oi_over.gif',1);MM_showHideLayers('menu1','','hide','menu2','','hide','menu3','','hide','menu4','','hide','trans','','show')\"><img name=\"oi\" src=\"../../images/topnav/link_group.gif\" border=\"0\" alt=\"Oxford Instruments\" width=\"140\" height=\"71\"></a></td>");
	document.write("<td><a href=\"http://www.oxford-instruments.com\" OnMouseOut=\"MM_swapImgRestore();MM_showHideLayers('menu1','','hide','menu2','','show','menu3','','hide','menu4','','hide','trans','','show')\" onMouseOver=\"MM_swapImage('analytical','','../../images/topnav/an_over.gif',1);MM_showHideLayers('menu1','','hide','menu2','','show','menu3','','hide','menu4','','hide','trans','','show')\"><img name=\"analytical\" src=\"../../images/topnav/link_ana.gif\" border=\"0\" alt=\"Analytical\" width=\"140\" height=\"71\"></a></td>");
	//document.write("<td><a href=\"http://www.oxford-instruments.com\" OnMouseOut=\"MM_swapImgRestore();MM_showHideLayers('menu1','','hide','menu2','','hide','menu3','','show','menu4','','hide','trans','','show')\" onMouseOver=\"MM_swapImage('medical','','../../images/topnav/md_over.gif',1);MM_showHideLayers('menu1','','hide','menu2','','hide','menu3','','show','menu4','','hide','trans','','show')\"><img name=\"medical\" src=\"../../images/topnav/link_med.gif\" border=\"0\" alt=\"Medical\" width=\"105\" height=\"71\"></a></td>");
	document.write("<td><a href=\"http://www.oxford-instruments.com\" OnMouseOut=\"MM_swapImgRestore();MM_showHideLayers('menu1','','hide','menu2','','hide','menu3','','hide','menu4','','show','trans','','show')\" onMouseOver=\"MM_swapImage('supercon','','../../images/topnav/sc_over.gif',1);MM_showHideLayers('menu1','','hide','menu2','','hide','menu3','','hide','menu4','','show','trans','','show')\"><img name=\"supercon\" src=\"../../images/topnav/sc.gif\" border=\"0\" alt=\"Superconductivity\" width=\"140\" height=\"71\"></a></td>");
	document.write("<td align='left' width='500'><img src='../../images/topnav/" + strMainImage + "' border='0' width='360' height='71' alt='Oxford Instruments'></td></tr>");
	//document.write("<tr height='23'><td colspan='6'>");	
	//document.write("</td></tr></table></div>");
	document.write("</table></div>");

	//Large section removed here that defined divs for the various drop down menus

	document.write("<div id='trans' style='position:absolute; left:0px; top:0px; width:720px; height:432px; z-index:1; visibility: hidden'><a href=\"/#\" onMouseOver=\"MM_showHideLayers('mainmenu','','show','menu1','','hide','menu2','','hide','menu3','','hide','menu4','','hide','trans','','hide')\"><img src='../../images/spacer.gif' width='780' height='600' border='0'></a></div>");

      //X-raymicroanalysis.com menu
	document.write("<table width='100%' height= '20' cellpadding='0' cellspacing='0' border='0' bgcolor='#C3E0E8'><tr><td align='center'><A HREF='../../pages/main/main.htm'>Home</A></td><td align='center'><A HREF='../../pages/main/inca.htm'>INCA system</A></td><td align='center'><A HREF='../../pages/detectors/xsight&xstream.htm'>INCAx-sight</A></td><td align='center'><A HREF='../../pages/detectors/drycool.htm'>INCADryCool</A></td><td align='center'><A HREF='../../pages/detectors/wave1.htm'>INCAWave</A></td><td align='center'><A HREF='../../pages/tutorial1/system1.htm'>EDS tutorial</A></td><td align='center'><A HREF='../../pages/tutorial2/introduction.htm'>WDS tutorial</A></td><td align='center'><A HREF='../../pages/tutorial3/introduction.htm'>TEM tutorial</A></td></tr></table>");
}

function drawFooter (intCompanyId,printablePage) {
	//light blue footer
	document.write('<table width="100%" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr height="23">');
	document.write('<td bgcolor="#c7e3ef" valign="top">');
	document.write('<table width="780" border="0" cellpadding="0" cellspacing="0">');
	document.write('<tr>');
	document.write('<td width="259" valign="top"><a href="http://www.oxford-instruments.com"><img SRC="../../images/basenav/footer_aboutoi.gif" WIDTH="195" HEIGHT="15" border="0" alt="About Oxford Instruments"/></a></td>');
	document.write('<td width="259" bgcolor="#c7e3ef">&nbsp;</td>');
	document.write('<td width="259" bgcolor="#c7e3ef" align="right" valign="top">');
	
	if (printablePage){
		if (printablePage != 'none'){
	document.write('<a href="#" onClick="window.open(\'' + printablePage + '\',\'OxfordInstrumentsPLC\',\'resizable=no,width=615,height=670,scrollbars=yes\'); return false;"><img src="../../images/general/printable_page.gif" width="126" height="23" border="0" alt="Printable Page"></a>');}
		else{
		document.write('<img src="../../images/spacer.gif" width="1" height="1"/>');
		}
	}
	else{
	document.write('<img src="../../images/spacer.gif" width="1" height="1"/>');
	}
	
	document.write('<img src="../../images/spacer.gif" width="3" height="1"/></td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');
	//navy footer
	document.write('<table width="100%" cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr>');
	document.write('<td valign="top" bgcolor="#13236e"><a href="http://www.oxford-instruments.com"><img src="../../images/general/copyright.gif" width="288" height="16" alt="Copyright Oxford Instruments" border="0"/></a>');
	document.write('<img src="../../images/spacer.gif" width="77" height="1" border="0"/>');
	document.write('<a href="http://www.oxford-instruments.com"><img src="../../images/basenav/web_terms_and_conditions.gif" width="164" height="9" alt="Web Terms And Conditions" border="0"/></a>');
	document.write('<img src="../../images/spacer.gif" width="30" height="1" border="0"/>');
	document.write('<a href="http://www.oxford-instruments.com"><img src="../../images/general/privacystatement.gif" width="119" height="8" alt="Privacy Statement" border="0"/></a>');
	document.write('<img src="../../images/spacer.gif" width="30" height="1" border="0"/>');
	document.write('<a href="http://www.oxford-instruments.com"><img src="../../images/general/disclaimer.gif" width="71" height="8" alt="Disclaimer" border="0"/></a></td>');
	document.write('<td rowspan="2"><br/><img src="../../images/spacer.gif" width="1" height="31" border="0"/></td></tr>');
	document.write('<tr><td bgcolor="#13236e">');
	document.write('<a href="http://www.sv-consulting.co.uk"><img src="../../images/basenav/credit.gif" alt="Content and design by SV Consulting" border="0"/></a>');
	//document.write('<a href="http://www.sv-consulting.co.uk"><img src="../../images/basenav/sv-conslogo.gif" alt="Content and design by sv-consulting.co.uk" border="0"/></a>');
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');
}

function printpage(){
	window.print();
}

function drawPrintableHeader () {
	document.write('<table width="100%" bgcolor="#ffffff" cellpadding="0" cellspacing="0" border="0"><tr><td bgcolour="#000000">');
	document.write('<table width="600" bgcolour="#000000" cellpadding="0" cellspacing="0" border="0"><tr><td align="left"><img src="../../images/printable/oxford_instruments.gif" width="600" height="55" border="0" alt="Oxford Instruments"/></td></tr>');
	document.write('<tr><td align="left" bgcolour="#000000"><img src="../../images/printable/innovation_for_all_our_futures.gif" width="600" height="23" border="0" alt="Innovation for all our futures"/></td></tr></table>');
	document.write('<table width="600" bgcolor="#959595" cellpadding="0" cellspacing="0" border="0"><tr><td align="left" bgcolour="#959595"><a href="javascript:printpage()"><img src="../../images/printable/print_page.gif" width="88" height="23" border="0" alt="Print Page"/></a><img src="../../images/printable/action_bar.gif" width="389" height="23" border="0"/><a href="javascript:window.close();"><img src="../../images/printable/close_window.gif" width="123" height="23" border="0" alt="Close Window"/></a></td></tr></table></td></tr></table>');
}

function drawPrintableFooter () {
	document.write('<table width="100%" bgcolor="#ffffff" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top">');
	document.write('<table bgcolor="#959595" cellpadding="0" cellspacing="0" border="0"><tr><td align="left"><img src="../../images/printable/copyright.gif" width="390" height="24" border="0" alt="Copyright 2002"/></td><td align="right"><img src="../../images/printable/url.gif" width="210" height="24" border="0" alt="oxford-instruments.com"/></td></tr></table>');
	document.write('</td></tr></table>');
}

