    function positionFooter() {
      // Get heights of three body containers
      var heights = new Array(3);
      if ( document.getElementById('flash') != null ) {
      heights[0] = document.getElementById('flash').offsetHeight + document.getElementById('flash').offsetTop;
	  }
      if ( document.getElementById('maintext') != null ) {
      heights[1] = document.getElementById('maintext').offsetHeight + document.getElementById('maintext').offsetTop;
	  }
      if ( document.getElementById('rightimage') != null ) {
      heights[2] = document.getElementById('rightimage').offsetHeight + document.getElementById('rightimage').offsetTop;
	  }
      if ( document.getElementById('righttext') != null ) {
        heights[3] = document.getElementById('righttext').offsetHeight + document.getElementById('righttext').offsetTop;
      }
      if ( document.getElementById('flash') != null ) {
        heights[4] = document.getElementById('flash').offsetHeight + document.getElementById('flash').offsetTop;
      }
      if ( document.getElementById('lefttext') != null ) {
        heights[5] = document.getElementById('lefttext').offsetHeight + document.getElementById('lefttext').offsetTop;
      }
      // Get the longest height
      var longestHeight = 0;
      for (i = 0 ; i < heights.length ; i++ ) {
        if ( parseInt(heights[i]) > longestHeight ) {
          longestHeight = heights[i];
        }
      }
      // Update offset of footer
      var offset = 0;
      if ( navigator.appName.indexOf('Microsoft') != -1 
		&& navigator.userAgent.indexOf('Opera') == -1 ) {
        offset = 0;
      }
      var footerContainer = document.getElementById('footerContainer');
      footerContainer.style.position = "absolute";
      footerContainer.style.top = longestHeight + offset + 'px';
      footerContainer.style.display = "inline";
	  
      var rightContainer = document.getElementById('rightimage');
      if ( document.getElementById('rightimage') != null ) {
	  originalTop=rightContainer.offsetTop;
      rightContainer.style.position = "absolute";
      rightContainer.style.height = longestHeight - originalTop + 'px';
      rightContainer.style.display = "inline";
	  }
	  
      var rightTextContainer = document.getElementById('righttext');
      if ( document.getElementById('righttext') != null ) {
	  originalTop=rightTextContainer.offsetTop;
      rightTextContainer.style.position = "absolute";
      rightTextContainer.style.height = longestHeight - originalTop + 'px';
      rightTextContainer.style.display = "inline";
	  }
    }
	

	function positionrightimage() {
      if ( document.getElementById('rightimage') != null ) {
      var rightContainer = document.getElementById('rightimage');
	  originalLeft=rightContainer.offsetLeft;
      //rightContainer.style.width = document.getElementById('footerContainer').offsetWidth - originalLeft + 'px';
	  
      /*var underline = document.getElementById('mainmenu_underline');
      underline.style.width = document.getElementById('footerContainer').offsetWidth + 'px';*/
	  }
    }
	

	
	function changeColour(newcolor){   
    if(document.layers){            
 //thisbrowser="NN4";             
	document.layers["maintext"].bgColor=newcolor;         
	}         
	if(document.all){ 
	            //thisbrowser="ie"          
	   document.all.maintext.style.backgroundColor=newcolor;  
	       }        
	 if(!document.all && document.getElementById){        
	     //thisbrowser="NN6";          
	   document.getElementById("maintext").style.backgroundColor=newcolor;           
	 }
	 }
	
	function linearize(){
	var H=[],Y={TABLE:1,TR:1,TD:1,TH:1,CAPTION:1,DIV:1},d=[],p; function R(N){var a,x,i,t; if(t=N.tagName){ t=t.toUpperCase(); for (i=0;a=H[i];++i)if(N.getAttribute(a))N.removeAttribute(a); for(i=0;x=N.childNodes[i];++i)R(x); if (Y[t])d.push(N); } } R(document.documentElement); for (i=0;N=d[i];++i) { p=N.parentNode; while(N.firstChild)p.insertBefore(N.firstChild,N); p.removeChild(N); } }
	
	function disableStyle() {
//		
	document.getElementById("textonly").innerHTML="<a href=\"http://www.hydrock.com/hydrock\" target=\"_self\">DISPLAY GRAPHICS</a>";
	document.getElementById("whatwedo").innerHTML="<a href=\"lqi.html\"><img src=\"images/mainmenu_r1_c3.gif\" style=\"border:none;\" alt=\"What We Do\"></a>";
	document.getElementById("whoweworkfor").innerHTML="<a href=\"residential.html\"><img src=\"images/mainmenu_r1_c4.gif\" style=\"border:none;\" alt=\"Who We Work For\"></a>";
	document.getElementById("menu_js2").innerHTML='123123123123123123123123123123123123123123123123123123123123';
	document.getElementById("menu_js1").innerHTML="";

	if (!document.getElementsByTagName) return;var anchors = document.getElementsByTagName("link");for (var i=0; i<anchors.length; i++) {var anchor = anchors[i];if (anchor.getAttribute("rel") == "stylesheet") anchor.disabled = "true";}
	var spans = document.getElementsByTagName("span");for (var i=0; i<spans.length; i++) {var span = spans[i];if (span.getAttribute("style"))span.removeAttribute("style");if (span.getAttribute("class"))span.removeAttribute("class")}
	var height=1000;var divs = document.getElementsByTagName("div");for (var i=0; i<divs.length; i++) {var div = divs[i];if (div.getAttribute("id")){div.style.top=height;};if (div.getAttribute("class"))div.removeAttribute("class")}}

	
	function disableInlineStyles() {
	var H=["style"],Y={},d=[],p;function R(N){var a,x,i,t;if(t=N.tagName){t=t.toUpperCase();for(i=0;a=H[i];++i)if(N.getAttribute(a))N.removeAttribute(a);for(i=0;x=N.childNodes[i];++i)R(x);if(Y[t])d.push(N);}}R(document.documentElement);for(i=0;N=d[i];++i){p=N.parentNode;while(N.firstChild)p.insertBefore(N.firstChild,N);p.removeChild(N);}}
	
	function removeImages() {
	/*if(document.images.length>0){(function(){function to(c){var a,k;a=new Array;for(k=0;k<c.length;++k)a[k]=c[k];return a;}var im,img,xt;im=to(document.images);for(var i=0;i<im.length;++i){img=im[i];e=document.createElement('span');void(e.style.background='#f5deb3');void(e.style.color='navy');if(img.attributes.alt.specified!=true){xt=document.createTextNode('NoAlt!')}else{xt=document.createTextNode(img.alt+' ')}e.appendChild(xt);img.parentNode.replaceChild(e,img)}})();}else{history.go()} }*/
	if(document.images.length>0){
		(function(){
				  function to(c){
					  var a,k;a=new Array;
					  for(k=0;k<c.length;++k)a[k]=c[k];
					  return a;
				  }
				  var im,img,xt;im=to(document.images);
				  for(var i=0;i<im.length;++i){
					  img=im[i];
					  e=document.createElement('span');
					  void(e.style.background='#ffffff');

//					  if(img.attributes.alt.specified!=true){
//						  xt=document.createTextNode('NoAlt!')
//					  }else{
						  xt=document.createTextNode(img.alt+' ')
//					  }
					  e.appendChild(xt);
					  img.parentNode.replaceChild(e,img)
					  }
				  })();
		}else{history.go()
		}
		}
	
	function disableTargetBlank() { 
	 if (!document.getElementsByTagName) return; 
	 var anchors = document.getElementsByTagName("a"); 
	 for (var i=0; i<anchors.length; i++) { 
	   var anchor = anchors[i]; 
	   if (anchor.getAttribute("href") && 
	       anchor.getAttribute("target") == "_blank") 
	     anchor.target = ""; 
	 } 
	}
	
	function addLinkInfo() { 
	 if (!document.getElementsByTagName) return; 
	 var anchors = document.getElementsByTagName("a"); 
	 for (var i=0; i<anchors.length; i++) { 
	   var anchor = anchors[i]; 
	   if(!anchor.title)
		   anchor.title='Select to open linked page'
	   if(!anchor.tabIndex)
		   anchor.tabIndex= i
	 } 
	}


function search_options(){
document.searchform.search[0]=new Option("Residential","Residential")
document.searchform.search[1]=new Option("Commercial and Leisure","Commercial and Leisure") 
document.searchform.search[2]=new Option("Health and Education","Health and Education") 
document.searchform.search[3]=new Option("Defence","Defence")
document.searchform.search[4]=new Option("Regeneration","Regeneration")
document.searchform.search[5]=new Option("Local Authority","Local Authority") 
document.searchform.search[6]=new Option("Land Quality Issues","Land Quality Issues") 
document.searchform.search[7]=new Option("Environmental Services","Environmental Services") 
document.searchform.search[8]=new Option("Geotechnics","Geotechnics")
document.searchform.search[9]=new Option("Building Structures","Building Structures") 
document.searchform.search[10]=new Option("Civil Engineering","Civil Engineering") 
document.searchform.search[11]=new Option("Infrastructure","Infrastructure")
document.searchform.search[12]=new Option("Building Services Design","Building Services Design") 
document.searchform.search[13]=new Option("Specialist Contracting","Specialist Contracting") 
document.searchform.search[14]=new Option("Slope Stabilisation","Slope Stabilisation") 
document.searchform.search[15]=new Option("Contamination Remediation","Contamination Remediation") 
document.searchform.search[16]=new Option("Mine Stabilisation","Mine Stabilisation") 
document.searchform.search[17]=new Option("Drilling Services","Drilling Services") 
document.searchform.search[18]=new Option("Careers","Careers")
document.searchform.search[19]=new Option("Environmental Policy","Environmental Policy")
document.searchform.search[20]=new Option("Bristol","Bristol")
document.searchform.search[21]=new Option("Bath","Bath")
document.searchform.search[22]=new Option("Northampton","Northampton")
document.searchform.search[23]=new Option("Plymouth","Plymouth")
document.searchform.search[24]=new Option("Stoke-on-Trent","Stoke-on-Trent")
document.searchform.search[25]=new Option("Woking","Woking")
document.searchform.search[26]=new Option("History","History")
}

function hideFlash(){
	if (window.navigator.userAgent.indexOf('Safari')!=-1){
		document.getElementById("flash").style.visibility='hidden';
		document.getElementById("leftimage").style.visibility='visible';
	}

}

function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=505,height=400,left = 400,top = 324.5');");
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function go()
{
	box = document.selectcs.navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}

function gokp()
{
	box = document.selectkp.kp;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}

function popUp()
{
	NewWindow=window.open('intro.html', 'Intro', 'height=330, width=690');
	NewWindow.focus();
}
function roll_over(img_name, img_src)
   {
   document[img_name].src = img_src;
   }
