////////////////////////////////////////////////////////////
//                                                        //
// standard.js - JavaScript Support File                  //
//                                                        //
// Client:     Collins Reinforcements Limited             //
//                                                        //
// Copyright:  (c) 1998-99,00-05 all rights reserved      //
//             by :- Technical System Services Limited    //
//                                                        //
//============={ Version: 3.3 - SC 18/10/05 }=============//

var now = new Date();                              // read system clock
var nowYear = now.getYear();
nowYear += "";
nowYear = nowYear.substr(2,2);
var copyRightDates = "2008";

////////////////////////////////////////////////////////////
//                                                        //
// mast_head(where) - where "a", "b", "c", ...            //
//                                                        //
//    routine to centralise page header generation.       //
//                                                        //
//============={ Version: 2.0 - SC 16/12/00 }=============//

function mast_head(where) {

   var amNotEmail = where.indexOf("mail") == -1;

   var amNotThanks = where.indexOf("thanks") == -1;

   var amNotHome = where.indexOf("home") == -1;

   document.write('<TABLE WIDTH=737 HEIGHT=86');
   document.write(' CELLSPACING=0 CELLPADDING=0');
   document.write(' BORDER=0>');
   document.write('<TR>');
   document.write('<TD COLSPAN=2 WIDTH=737 HEIGHT=46>');

   if (amNotHome) {                                // allow a jump back
      if (amNotThanks) {
         document.write('<A HREF="javascript:history.go(-1)">');
      }
      else {
         document.write('<A HREF="javascript:history.go(-2)">');
      }
   }
   document.write('<IMG SRC="img/collins.gif" ');
   document.write('WIDTH=737 HEIGHT=46 ALT="');
   if (amNotHome) {
      document.write('Back To Previous Page" BORDER=0></A>');
   }
   else {
      document.write('K B Rebar Limited" BORDER=0>');
   }

   document.write('</TD></TR><TR>');

   document.write('<TD WIDTH=276 HEIGHT=42>');
   write_icon("\"javascript:void(0)\"", 
              "img/off_phone.gif", 
              "give us a ring !",
              "teleicn");
   document.write('</TD>');

   document.write('<TD WIDTH=461 HEIGHT=42>');
   // Send E-Mail
   if (amNotEmail) {
      write_icon("email.htm", 
                 "img/off_email.gif", 
                 "send us an email !",
                 "mailicn");
   }
   else {
      write_img("img/at_email.gif",
                 "You're Already At: E-mail enquiry");
   }
   document.write('</TD>');

   document.write('</TR>');
   document.write('</TABLE>');

   show_icons(where);

}

////////////////////////////////////////////////////////////
//                                                        //
// load_icons(where) - pre-load icons into cache if 'v4'  //
//                                                        //
//    routine to support local icon buttons.              //
//                                                        //
//============={ Version: 2.0 - SC 16/12/99 }=============//

function load_icons(where) {

   if (v4) {

      // Telephone Number Icon

      teleicn1=new Image();
      teleicn1.src="img/on_phone.gif";       // ON

      teleicn0=new Image();
      teleicn0.src="img/off_phone.gif";      // OFF

      // E-Mail Address Icon

      if (where.indexOf("mail") == -1) {         // conditionally

         mailicn1=new Image();
         mailicn1.src="img/on_email.gif";       // ON

         mailicn0=new Image();
         mailicn0.src="img/off_email.gif";      // OFF

      }

      // Company Information Icon

      if (where.indexOf("info") == -1) {         // conditionally

         infoicn1=new Image();
         infoicn1.src="img/on_info.gif";       // ON

         infoicn0=new Image();
         infoicn0.src="img/off_info.gif";      // OFF

      }

      // BS 4466 - 1989

      if (where.indexOf("bs4466") == -1) {         // conditionally

         bs46icn1=new Image();
         bs46icn1.src="img/on_4466.gif";       // ON

         bs46icn0=new Image();
         bs46icn0.src="img/off_4466.gif";      // OFF

      }

      // BS 8666 - 2000

      if (where.indexOf("bs8666") == -1) {         // conditionally

         bs86icn1=new Image();
         bs86icn1.src="img/on_8666.gif";       // ON

         bs86icn0=new Image();
         bs86icn0.src="img/off_8666.gif";      // OFF

      }

      // Fabric Reinforcement

      if (where.indexOf("fabr") == -1) {         // conditionally

         fabricn1=new Image();
         fabricn1.src="img/on_fabr.gif";       // ON

         fabricn0=new Image();
         fabricn0.src="img/off_fabr.gif";      // OFF

      }

      // Reinforcement Accessories

      if (where.indexOf("accs") == -1) {         // conditionally

         accsicn1=new Image();
         accsicn1.src="img/on_accs.gif";       // ON

         accsicn0=new Image();
         accsicn0.src="img/off_accs.gif";      // OFF

      }

   }

}

////////////////////////////////////////////////////////////
//                                                        //
// show_icons(where) - where is either :-                 //
//                                                        //
//    routine to display local icon buttons.              //
//                                                        //
//============={ Version: 2.0 - SC 16/12/99 }=============//

function show_icons(where) {

   document.write('<TABLE WIDTH=720');
   document.write('       CELLPADDING=0 CELLSPACING=0');
   document.write('       BORDER=0>');
   document.write('<TR>');

   // Pixel Shim
   document.write('<TD ALIGN=CENTER VALIGN=CENTER WIDTH=10>');
   document.write('<IMG SRC="img/shim.gif" WIDTH=10>');
   document.write('</TD>');

   document.write('<TD ALIGN=CENTER VALIGN=CENTER WIDTH=144>');

   // Company Information
   if (where.indexOf("info") == -1 ) {
      write_icon("about.htm", 
                 "img/off_info.gif", 
                 "Company Information",
                 "infoicn");
   }
   else {
      write_img("img/at_info.gif",
                 "You're Already At: Company Information");
   }

   document.write('</TD>');
   document.write('<TD ALIGN=CENTER VALIGN=CENTER WIDTH=144>');

   // bs 8666 - Bends & Shapes - 2000
   if (where.indexOf("bs8666") == -1 ) {
      write_icon("bs8666.htm", 
                 "img/off_8666.gif", 
                 "BS 8666 (2000) Bends & Shapes",
                 "bs86icn");
   }
   else {
      write_img("img/at_8666.gif",
                 "You're Already At: BS 8666 Bends & Shapes");
   }

   document.write('</TD>');
   document.write('<TD ALIGN=CENTER VALIGN=CENTER WIDTH=144>');

   // BS 4466 - Bends & Shapes - 1989
   if (where.indexOf("bs4466") == -1 ) {
      write_icon("bs4466.htm", 
                 "img/off_4466.gif", 
                 "BS 4466 (1989) Bends & Shapes",
                 "bs46icn");
   }
   else {
      write_img("img/at_4466.gif",
                 "You're Already At: BS 4466 Bends & Shapes");
   }

   document.write('</TD>');
   document.write('<TD ALIGN=CENTER VALIGN=CENTER WIDTH=144>');

   // Fabric Reinforcement
   if (where.indexOf("fabr") == -1 ) {
      write_icon("fabric.htm", 
                 "img/off_fabr.gif", 
                 "Fabric Reinforcement",
                 "fabricn");
   }
   else {
      write_img("img/at_fabr.gif",
                 "You're Already At: Fabric Reinforcement");
   }
 
   document.write('</TD>');
   document.write('<TD ALIGN=CENTER VALIGN=CENTER WIDTH=144>');

   // Reinforcement Accessories
   if (where.indexOf("accs") == -1 ) {
      write_icon("accessry.htm", 
                 "img/off_accs.gif", 
                 "Reinforcement Accessories",
                 "accsicn");
   }
   else {
      write_img("img/at_accs.gif",
                 "You're Already At: Reinforcement Accessories");
   }

   document.write('</TD>');
   document.write('</TR></TABLE>');

}


////////////////////////////////////////////////////////////
//                                                        //
// shape_code(code) - code is text :-                     //
//                                       "99" ... etc.    //
//                                                        //
//    routine to write shape code table HTML.             //
//                                                        //
//============={ Version: 1.1 - SC 23/11/99 }=============//

function shape_code(codeText) {

   document.write('<TABLE BGCOLOR=#005980');
   document.write('       CELLPADDING=0 CELLSPACING=1>');
   document.write('<TR><TD ALIGN=CENTER>');
   document.write('<H6>Shape<BR>Code</H6></TD></TR>');
   document.write('<TR><TD ALIGN=CENTER BGCOLOR=WHITE>');
   document.write('<H5>' + codeText + '</H5></TD></TR>');
   document.write('</TABLE>');

}

////////////////////////////////////////////////////////////
//                                                        //
// footer() - generate a 'customer specific' line footer. //
//                                                        //
//============={ Version: 6.0 - SC 05/08/03 }=============//

function footer() {

   var docText = "";

   docText += '<CENTER>';
   docText += '<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 ';
   docText +=        'BORDER=0>';
   document.write(docText);

   docText = '';
   docText += '<TR ALIGN=CENTER>';
   docText += '<TD>';
   docText += '<SPAN CLASS=tiny>';
   docText += '<SPAN CLASS=heavy>';
   docText += '<EM>K B Rebar Limited</EM></SPAN>, ';
   docText += '<SPAN CLASS=darkgray><B>';
   docText += 'Chaddock Lane, ';
   docText += 'Boothstown, ';
   docText += 'Worsley, Manchester M28 4DR';
   docText += '</SPAN>';
   docText += '</SPAN>';
   docText += '</TD>';
   docText += '</TR>';
   docText += '<TR ALIGN=CENTER>';
   docText += '<TD><HR WIDTH=90% SIZE=1 COLOR=#001858></TD>';
   docText += '</TR>';
   document.write(docText);

   docText = '';
   docText += '<TR ALIGN=CENTER>';
   docText += '<TD>';
   docText += '<SPAN CLASS=tiny>';
   docText += '<SPAN CLASS=heavy>';
   docText += 'Copyright ';
   docText += '</SPAN>';
   docText += ' - all rights reserved &copy; ';
   docText += copyRightDates;
   docText += '</B>';
   docText += '</SPAN>';
   docText += '</TD>';
   docText += '</TR>';
   docText += '</TABLE>';
   docText += '</CENTER>';

   document.write(docText);

}

////////////////////////////////////////////////////////////
//                                                        //
// write_img(srcText, altText)                            //
//                                                        //
//============={ Version: 4.0 - SC 24/08/99 }=============//

function write_img(srcText, altText)  {

   document.write('<IMG SRC="' + srcText + '" ');
   document.write('     ALT="' + altText + '" >');

}

