// JavaScript Document

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");
		products_over = newImage("images/products-over.gif");
		news_media_over = newImage("images/news-media-over.gif");
		photos_over = newImage("images/photos-over.gif");
		preloadFlag = true;
	}
}

/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function initGlide() {
  var winWd = getWinWidth();
  // arguments: id, x, y
  var glideLyr = new dynObj("glideDiv", winWd, 160);
  glideLyr.show();
  // slideTo arguments: destination x, destination y, duration of slide,
  // acceleration/deceleration factor (can be -1 to 1) 0 is linear, i.e., steady slide
  glideLyr.slideTo(445, null, 800, -.8); 
}

function getWinWidth() {
	var winWd = 0;
	if (document.documentElement && document.documentElement.clientWidth) 
		winWd = document.documentElement.clientWidth;
	else if (document.body && document.body.clientWidth) 
		winWd = document.body.clientWidth;
	else if (document.body && document.body.offsetWidth) 
		winWd = document.body.offsetWidth; // ns6
	else if (window.innerWidth) winWd = window.innerWidth-18;
	return winWd;
}

