function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("images/home-over.gif");
		locations_over = newImage("images/locations-over.gif");
		sizes_over = newImage("images/sizes-over.gif");
		storing_over = newImage("images/storing-over.gif");
		estimator_over = newImage("images/estimator-over.gif");
		request_over = newImage("images/request-over.gif");
		aboutus_over = newImage("images/aboutus-over.gif");
		sitemap_over = newImage("images/sitemap-over.gif");
		preloadFlag = true;
	}
}

function showLayer(lname)
{
	if(document.all)
	{
		document.all[lname].style.visibility='visible';
	}
	else
	{
		if(document.layers)
		{
			document.layers[lname].visibility='show';
		}
		if(document.getElementById)	
		{
			var docContents = document.getElementsByTagName("*"); 
			docContents[lname].style.visibility='visible';
		}
	}
}

function hideLayer(lname)
{
	if(document.all)
		document.all[lname].style.visibility='hidden';
	else
	{
		if(document.layers)
			document.layers[lname].visibility='hide';
		if(document.getElementById)	
		{
			var docContents = document.getElementsByTagName("*"); 
			docContents[lname].style.visibility='hidden';
		}
	}
}

function Is() 
{
    var agent   = navigator.userAgent.toLowerCase();
	// Note: On IE5, these return 4, so use is.ie5up to detect IE5.
    this.major  = parseInt(navigator.appVersion);
    this.minor  = parseFloat(navigator.appVersion);
	
	// *** BROWSER VERSION ***
	// netscape navigator/gecko:
	// Note: Opera and WebTV spoof Navigator.  This code only detects true Navigator.
   	// If you want to allow spoofing, take out the tests for opera and webtv.
    this.ns     = ((agent.indexOf('mozilla')   != -1) &&
                  (agent.indexOf('spoofer')    == -1) &&
                  (agent.indexOf('compatible') == -1) &&
                  (agent.indexOf('opera')      == -1) &&
				  (agent.indexOf('hotjava')    == -1) &&
                  (agent.indexOf('webtv')      == -1));
    this.ns2    = (this.ns && (this.major      ==  2));
    this.ns3    = (this.ns && (this.major      ==  3));
    this.ns4    = (this.ns && (this.major      ==  4));
	this.ns4up  = (this.ns && (this.major 	   >=  4));
    this.ns6    = (this.ns && (this.major      ==  5));
	this.ns6up  = (this.ns && (this.major      >=  5));
    this.gecko  = (agent.indexOf("gecko") 	   !=  -1);
	//internet explorer:
    this.ie     = (agent.indexOf("msie")       != -1);
    this.ie3    = (this.ie && (this.major      <   4));
    this.ie4    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 4.0")   != -1));
    this.ie5    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.0")   != -1));
    this.ie5up  = (this.ie && !this.ie3 && !this.ie4);
	this.ie6  = (this.ie && (this.major 	   == 4) &&
				 (agent.indexOf("msie 6.0")     != -1));
	//opera:	 
	this.opera	= (agent.indexOf("opera")	   != -1);
    this.opera2 = (agent.indexOf("opera 2") != -1 || agent.indexOf("opera/2") != -1);
    this.opera3 = (agent.indexOf("opera 3") != -1 || agent.indexOf("opera/3") != -1);
    this.opera4 = (agent.indexOf("opera 4") != -1 || agent.indexOf("opera/4") != -1);
    this.opera5 = (agent.indexOf("opera 5") != -1 || agent.indexOf("opera/5") != -1);
    this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);
	
	// *** JAVASCRIPT VERSION CHECK ***
    if (this.ns2 || this.ie3) this.js = 1.0;
    else if (this.ns3) this.js = 1.1;
    else if (this.opera5up) this.js = 1.3;
    else if (this.opera) this.js = 1.1;
    else if ((this.ns4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
    else if ((this.ns4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
    else if (this.hotjava3up) this.js = 1.4;
    else if (this.ns6 || this.gecko) this.js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS are 
    // released. For now, we try to provide some upward compatibility so that 
    // future versions of Nav and IE will show they are at *least* JS 1.x capable. 
    // Always check for JS version compatibility with > or >=.
    else if (this.ns6up) this.js = 1.5;
    // note ie5up on mac is 1.4
    else if (this.ie5up) this.js = 1.3
    else this.js = 0.0;		
}

var is = new Is();