
var ns4 = (document.layers);
var ie = (document.all);
var ns6 = (!document.all && document.getElementById);

if (document.images) {
  
  image1on = new Image();
  image1on.src = "images/mortgage_loc_on.jpg";
  
  image2on = new Image();
  image2on.src = "images/boundary_on.jpg";

  image3on = new Image();
  image3on.src = "images/engineering_on.jpg";
  
  
  image4on = new Image();
  image4on.src = "images/industry_pioneers_on.jpg";
 
  image5on = new Image();
  image5on.src = "images/let_us_help_on.jpg";
  
  image6on = new Image();
  image6on.src = "images/case_studies_on.jpg";
  
  image7on = new Image();
  image7on.src = "images/workingforyou_on.jpg";
  
  image8on = new Image();
  image8on.src = "images/opportunities_on.jpg";
  
  image20on = new Image();
  image20on.src = "images/mortgage_on_flyout.jpg";
  
  
  
  image1off = new Image();
  image1off.src = "images/mortgage_loc_off.jpg";

  image2off = new Image();
  image2off.src = "images/boundary_off.jpg";

  image3off = new Image();
  image3off.src = "images/engineering_off.jpg";

  
  image4off = new Image();
  image4off.src = "images/industry_pioneers_off.jpg";
 
  image5off = new Image();
  image5off.src = "images/let_us_help_off.jpg";
  
  image6off = new Image();
  image6off.src = "images/case_studies_off.jpg";
  
  image7off = new Image();
  image7off.src = "images/workingforyou_off.jpg";
   
  image8off = new Image();
  image8off.src = "images/opportunities_off.jpg";  
  
  image20off = new Image();
  image20off.src = "images/mortgage_off_flyout.jpg";
   
}

function turnOn(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "on.src");
  }
}

function turnOff(imageName) {
  if (document.images) {
    document[imageName].src = eval(imageName + "off.src");
  }
}

//global var - needed for updateXCoor()
var x;

//this function updates the width of red space (how much to move over
// the drop down menus, by updating a variable in includes/TextLinks.asp
function updateXCoor(){

	//http://www.webmasterworld.com/forum91/1553.htm

		//the width of the page content
		var contentWidth = 798;
		var	myWidth = 0;
	
		//http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=16
		if( typeof( window.innerWidth ) == 'number' ) {
			 //Non-IE
			myWidth = window.innerWidth - 13;
		} else if( document.documentElement &&
		  ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			 //IE 6+ in 'standards compliant mode'
			 myWidth = document.documentElement.clientWidth;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
		}	
		
		if (myWidth > contentWidth){
			x = (myWidth - contentWidth) / 2;
		}else{
			x = 0;
		}
			
		//window.status = 'The blank space = ' + x + ' ...available width = ' + myWidth;
}
