var isfirefox = browserisfirefox();

function centreall() {
   return;
        var awid = window.innerWidth;
        var anode = document.getElementById("all");
        
        // value for minumum width of the content...
        var divwidth = 1020;

        // re-position the overall 'container' DIV element if necessary to centralise the whole content horizontally...
        if (awid > divwidth) { 
	   var aoffset = (awid - divwidth) / 2;
           anode.style.left = aoffset+'px';
           }

        if (awid <= 1024) {
           anode.style.border = "0px solid white";
           }
        var ahgt = window.innerHeight;
        var divheight = 564;
        // re-position the overall 'container' DIV element if necessary to centralise the whole content vertically...
        if (ahgt > divheight) { 
	   var aoffset = (ahgt - divheight) / 2;
           anode.style.top = aoffset+'px';
           }

         }

function browserisfirefox() {
   var res = false;

   if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 
      res = true;

      /* this detail not needed...

      //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
      var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
      if (ffversion>=3)
        alert("You're using FF 3.x or above")
      else if (ffversion>=2)
         alert("You're using FF 2.x")
      else if (ffversion>=1)
        alert("You're using FF 1.x")

      */

      }
   
   return res;
   } 


function initrightpanel() {
   var arraddress = new Array("J.F.Thompson & Sons Ltd.","110 Sale Road,","Northern Moor,","Manchester,","M23 0BX.");
   var node=document.getElementById("rightpanel");

   // clear the testimony from last time if necessary
   for (var i=1; i<=node.childNodes.length; i++) {
      
      if (node.hasChildNodes() ) {
         var childnode=document.getElementById("rightpanel").firstChild;         
         var removenode=node.removeChild(childnode);
         childnode=null;
         removenode=null;
         }
      else {
         break;
         }
      }

   node=null;

   var newspan=document.createElement("span");
   var newtext=document.createTextNode(arraddress[0]);
   newspan.appendChild(newtext);
   var newbr=document.createElement("br");
   

   for (var i = 1; i<arraddress.length;i++) {
      newspan.appendChild(newbr);
      newtext=document.createTextNode(arraddress[i]);
      newspan.appendChild(newtext);
      newbr=document.createElement("br");
      }

   document.getElementById("rightpanel").appendChild(newspan);
   newspan=null;
   newtext=null;
   newbr=null;
   }


function initfooter() {
   var arraddress = new Array("J.F.Thompson & Sons Ltd.,","110 Sale Road,","Northern Moor,","Manchester,","M23 0BX.","email: service@jfthompsonandsons.com");
   var node=document.getElementById("footer");

   // clear the testimony from last time if necessary
   for (var i=1; i<=node.childNodes.length; i++) {
      
      if (node.hasChildNodes() ) {
         var childnode=document.getElementById("footer").firstChild;         
         var removenode=node.removeChild(childnode);
         childnode=null;
         removenode=null;
         }
      else {
         break;
         }
      }

   node=null;

   var newspan=document.createElement("span");
   var newtext=document.createTextNode(arraddress[0]);
   newspan.appendChild(newtext);
   

   for (var i = 1; i<arraddress.length;i++) {
      newtext=document.createTextNode("\u00A0"+arraddress[i]);
      newspan.appendChild(newtext);
      }

   document.getElementById("footer").appendChild(newspan);
   newspan=null;
   newtext=null;
   }

function gopage(pageno) {

   switch (pageno) {
   case 1: location.href="index.htm";
	if (location.href == "index.htm" ) {
                location.href="index.htm";
		document.getElementById('menuitem1').src="image/menu/bwelcomebase.jpg";
		}; break; // "1.htm"; break; //"index.htm"; break;      
   case 2: location.href = "testimonial.htm"; break;      
   case 3: location.href = "services.htm"; break;      
   case 4: location.href = "largest.htm"; break;      
   case 5: location.href = "cresearch.htm"; break;      
   case 6: location.href = "links.htm"; break;      
   }
}

function debug(amessage) {   
   // purpose: appends the text in 'amessage' to the text in the <div>  called 'debug1'
   var newspan=document.createElement("span");
   var newtext=document.createTextNode("\u00A0"+amessage);
   newspan.appendChild(newtext);
   
   //document.getElementById("debugger").appendChild(newspan);
   newspan=null;
   newtext=null;

}
