// Script library v2.01
// © 2005-2009, Lynmar Solutions

// 31.jan.07 - added "Registered in England No. 2332302 VAT No: GB 486 131246" to page header
// 16.Jun.07 - added Pigments menu/section
// 15.jun.08 - adjusted menu array for 2nd level indents and items

function domenu() {
 var t = "<div class=mymenu><b><br>";
 var p = window.location.pathname;
 var q;
 var x;
 var n;
 var l; // level of item indentation
 q = p.lastIndexOf("\\");	//in case it's file://c:\lynmar\home.html
 if(q>=0) {p = p.substring(q+1)}
 q = p.lastIndexOf("/");	//in case it's www.fred.com/home.html
 if(q>=0) {p = p.substring(q+1)}
 mRef = createmenuarray();
 for(var i=0; i<mRef.length; i++) {
  x=mRef[i][0];
  if(x > "") {
   n=""; 
   l=x.substring(0,1);
   if(l=="-" || l=="+" || l==".") {
    if(l=="+") {n=" target=pop2 "}
    x=x.substring(1,x.length);
    if(l=="-") {
      t+="<font size='1'>&nbsp;&nbsp;&nbsp;&nbsp; ";
    } else {
      t+="<font size='1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;";
    }
   } else {
    if(mRef[i][1] == p) {
      t += "<li type=disc style='color:gray;'>";
    } else {
      t += "<li type=circle>";
    }
   }
   if(mRef[i][1] == p) {
     t+="<span style='color:gray'><i>" + x + "</i></span>";
   } else {
     t+="<a"+n+" href=\"" + mRef[i][1] + "\" title=\"" + mRef[i][2] + "\">" + x + "</a>";
   }
//   if(mRef[i][2].substring(0,1)=="!") {t+=" <span class=newtext>New!</span>"}	//append 'New!'
if(mRef[i][2].substring(0,1)=="!") {t+=" <img src='images/new-text.gif' width='23' height='12' alt='New!'>"} //append 'New!'
 
   
   
   if(mRef[i][1] != p) {t+="</a>"}  												//close link/url if not current page
//   if(mRef[i][0].substring(0,1)=="-" || mRef[i][0].substring(0,1)=="+" || mRef[i][0].substring(0,1)==".") {t+="</font>"}	//close font if this is a suboption
   if(l=="-" || l=="+" || l==".") {t+="</font>"}	//close font if this is a suboption
   
  }
  t += "<br>"
 }
 t+= "</b><br><br>";
 t+= "<div class='coming' title='Forthcoming Features from Crestchem'>Coming soon...<br>";
 t+= "&nbsp;<b>·</b> Newsletter<br>";
 t+= "&nbsp;<b>·</b> Seminars<br>";
 t+= "&nbsp;<b>·</b> Data Sheets<br>";
 t+= "&nbsp;<b>·</b> Redundant Stock";
 t+= "</div></div>";
 document.write(t); 
}


function OLDOKmenu() {
 var t = "<div class=mymenu><b><br>";
 var p = window.location.pathname;
 var q; 
 q = p.lastIndexOf("\\");	//in case it's file://c:\lynmar\home.html
 if(q>0) {p = p.substring(q+1);}
 q = p.lastIndexOf("/");	//in case it's www.fred.com/home.html
 if(q>0) {p = p.substring(q+1);}
 mRef = createmenuarray();
 for(var i=0; i < mRef.length; i++) {
  if(mRef[i][0] > "") {
   if(mRef[i][1] == p) { 
     t += "<li type=disk style='color:gray;'><a href=\"" + mRef[i][1] + "\" title=\"" + mRef[i][2] + "\"></a><i>" + mRef[i][0] + "</i>";
   } else { 
     t += "<li type=disk><a href=\"" + mRef[i][1] + "\" title=\"" + mRef[i][2] + "\">" + mRef[i][0] + "</a>";
   }
   if(mRef[i][2].substring(0,1)=="!") { t+=" <span class=newtext>New!</span>"; }
   //if(mRef[i][2].indexOf("New") > 0) { t+=" <span class=newtext>New!</span>"; }
  }
  t += "<br>"
 }
 t+= "<br></b>";
 t+= "<i>Coming soon...<br>";
 t+= "&nbsp; Newsletter<br>";
 t+= "&nbsp; Seminars<br>";
 t+= "</i></div>";
 document.write(t); 
}


function createmenuarray() {
 var map1="http://www.streetmap.co.uk/newmap.srf?x=496283&y=198245&z=0&sv=HP6+5DW&st=2&tl=Postcode+HP6+5DW&pc=HP6+5DW";
 var map2="http://uk8.multimap.com/map/browse.cgi?pc=HP65DW&place=hp6+5dw&db=pc";
 mRef = new Array();
 mRef[ 0] = new Array("Home",		"home.html",		"The main index page");
 mRef[ 1] = new Array("Profile",	"profile.html",		"Our Profile as a Specialist Distributor");
 mRef[ 2] = new Array("Producers",	"producers.html",	"Distribution and Agency Agreements");
 mRef[ 3] = new Array("Products",	"products.html",	"Crestchem's Chemical Products Portfolio");
 mRef[ 4] = new Array("-General",	"productsg.html",	"General chemicals including Amines, Aqualon Cellulosics, Fatty Acids and Alcohols");
 
 mRef[ 5] = new Array(".Acids &amp; Alcohols",	"productst.html",	"Fatty Acids and Alcohols");
 mRef[ 6] = new Array(".Amines",	"productsa.html",	"Amines");
 mRef[ 7] = new Array(".Cellulosics",	"productsc.html",	"Cellulosics");
 
 mRef[ 8] = new Array("-Food &amp; Fine", "productsf.html",	"Food and Fine chemicals including Food Cellulosics, Pectins, Citrates, Phosphates and Soft Drinks");
 
 mRef[ 9] = new Array(".Citrates &amp; Phosphates", "prodcp.html",	"Citrates and Phosphates");
 mRef[10] = new Array(".Pectins", "prodp.html",	"Pectins");
 mRef[11] = new Array(".Soft Drinks", "prodsd.html",	"Soft Drinks");
 
 mRef[12] = new Array("-Surface Coatings",	"productsr.html",	"Synthetic Resins including Macrynal, Viacryl, Duroftal, Additol, Resimene, Resydrol and Waxes");
 mRef[13] = new Array("-Redundant Stock", "redundant-stock.html", "!New / Coming Soon - Redundant Stock Listings");
 mRef[14] = new Array("Contacts",	"contacts.html",	"Contact details including email information and a Roadmap");
 mRef[15] = new Array("+Organisation Chart","orgchart.html",	"View the Crestchem Staff Organisational Structure (in a new window)");
 mRef[16] = new Array("+StreetMap",	map1,			"Display a road-map to our Amersham Offices (opens in a new window)");
 mRef[17] = new Array("+MultiMap",	map2,			"Alternative road-map to our Amersham Offices (opens in a new window)");
 mRef[18] = new Array("Biodeg W/H",	"biodeg.html", 		"Details of the Biodeg Warehouse operation");
 mRef[19] = new Array("Enquiry Form",	"enquiry.html",		"Contact us through the Online Enquiry Form");
 mRef[20] = new Array("",		"",			"");
 mRef[21] = new Array("Search",		"search.html",		"Search through this site");
 mRef[22] = new Array("Sitemap",	"sitemap.html",		"Web-site Layout/Structure Map");
 mRef[23] = new Array("Logfile",	"http://www.crestchem.co.uk/webstat/",	"Website Visitor Statistics");
 mRef[24] = new Array("Webmasters",	"webmasters.html",	"Links and Website Details for Webmasters");
 return mRef;
}


function doheader() {
 var t;
 t ='<table width="100%"><tr><td>';
 t+='<font face="tahoma,arial" size="5" color="#0000ff">';
 t+='<img src="images/cresth.gif" width="428" height="58" alt="Crestchem Header"><br>';
 t+='<font face="tahoma,arial" size="1" color="#808080">';
 t+='Crestchem Ltd., Crest House, 152 Station Road, Amersham, Buckinghamshire HP6 5DW, England <br>';
 t+='Tel: +44 (0)1494 434660 \&nbsp;\&nbsp;\&nbsp; Fax: +44 (0)1494 434990 ';
 t+='\&nbsp;\&nbsp;\&nbsp; E-mail: <a href="mailto:Info&#64;crestchem.co.uk">Info&#64;crestchem.co.uk</a> <br>';
 t+='Registered in England No. 2332302 \&nbsp;\&nbsp;\&nbsp; VAT No: GB 486 131246';
 t+='</font></td>';
 t+='<td align="right" valign="top"><img src="images/cclogo.gif" height="100" width="79" alt="Crestchem Logo"></td>';
 t+='</tr></table>';
t+='<hr size="1" noshadow>';
//t+='<br>';
 document.write(t);
}


function dofooter() {
 var x;
 x = "<div class=footer><hr size=1 noshade>&copy;" +(new Date().getYear())+ ", "; 
// x+= "<a href=\"mailto:Sales@crestchem.co.uk?Subject=Web Enquiry\" title=\"Email the Crestchem Sales Department\">Crestchem Ltd</a> / ";
 x+= "<a href=\"http://www.LynmarSolutions.co.uk\" title=\"Visit the pages of the WebSite Designer\">Lynmar Solutions Ltd.</a> ";
 x+= "All rights reserved. Last updated: " + shortdate(new Date(document.lastModified));
 x+= ". All trademarks duly recognised. (E.&amp;O.E.)</div>";
 document.write(x);
}


function dologos() {
 var x='';
 x+= '<table border="0" width="100%"><tr valign="bottom">';
 x+= '<td width="33%" align="left"  ><img src="images/iiplogo.gif" alt="[Investor in People logo]" width="100" height="68" border="0"></td>';
 x+= '<td width="34%" align="center"><a href="http://www.bcdta.org.uk" target="bcdta" title="Visit the BCDTA and Responsible Care website &#13;[opens in a new window]"><img src="images/carelogo.jpg" width="248" height="70" border="0" alt="[BCDTA Responsible Care logo]" title="Visit the BCDTA and Responsible Care website &#13;[opens in a new window]"></a></td>';
 x+= '<td width="33%" align="right" ><img src="images/ukas9002.jpg" width="118" height="70" border="0" alt="[UKAS Quality Logo]"></td>';
 x+= '</tr></table>';
 document.write(x);
}
// x+= "<td width=33% align=left><img src=images/iiplogo.gif alt=\"[Investor in People logo]\" width=100 height=68 border=0></td>"; 
// x+= "<td width=34% align=center><img src=images/ukas9002.gif width=100 height=56 border=0 alt=\"[UKAS Quality Logo]\"></td>"; 
// x+= "<td width=33%><a href=http://www.bcdta.org.uk><img src=images/bcdta-grn.gif height=100 width=75 border=0 align=right alt=\"[Visit the BCDTA website]\"></a></td>"; 


//   DELETE THIS NEXT BIT
function domenubar() {
 var t = "<p class=mymenu align=center><br>";
 var i;
 mRef = createmenuarray();
 for(var i=0; i < mRef.length; i++) {
  if(mRef[i][0] > "") {
     t += "[<a href=\"" + mRef[i][1] + "\" title=\"" + mRef[i][2] + "\">" + mRef[i][0] + "</a>]";
     if(((i+1)/6)==Math.floor((i+1)/6)) {
        t += "<br>";
     } else {
     	t += " &nbsp; ";
     }
  }
 }
 t += "</p>";
 document.write(t); 
}


function shortdate(d) { 
 var x; 
 x=d.getDate();
 if(x<10)  x=("0"+x);
 x+="-";
 m=d.getMonth();
 switch(m) { 
  case 0:  x+="Jan"; break
  case 1:  x+="Feb"; break
  case 2:  x+="Mar"; break
  case 3:  x+="Apr"; break
  case 4:  x+="May"; break
  case 5:  x+="Jun"; break
  case 6:  x+="Jul"; break
  case 7:  x+="Aug"; break
  case 8:  x+="Sep"; break
  case 9:  x+="Oct"; break
  case 10: x+="Nov"; break
  case 11: x+="Dec"; break
  default: x+="???"
 }
 m=d.getYear();
 //x+="-"+m; 
 return (x);
}


//eof.
