
userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function findElement(n,ly) {
	if (browserVers < 4)		return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (document.layers) {
				img = findElement(changeImages.arguments[i],0);
			}
			else {
				img = document.images[changeImages.arguments[i]];
			}
			if (img) {
				img.src = changeImages.arguments[i+1];
			}
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		footer_shop_over = newImage("/images/footer_shop-over.jpg");
		footer_priv_over = newImage("/images/footer_priv-over.jpg");
		footer_ship_over = newImage("/images/footer_ship-over.jpg");
		footer_info_over = newImage("/images/footer_info-over.jpg");
		preloadFlag = true;
	}
}

preloadImages();




//



var sectionSearchOn = true;

// This variable is used to determine whether the user's mouse is hovering over the search form or not
var oversearchform = false;



/* The toggleSearchOptions() function either shows or hides the searchOptions layer */
function toggleSearchOptions()
{

	if (sectionSearchOn) {
		if (oversearchform == false) {
			hideLayer('advsearch');
		} else {
			showLayer('advsearch');
		}
	} 
} // end toggleLayer() function





/* The showLayer() function is called to make a an element visible */
function showLayer(whichLayer)
{

//alert("Show: "+whichLayer);

	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
	} else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
	}
	style2.display = "block";
} // end showLayer() function


/* The toggleLayer() function is called to make a an element invisible */
function hideLayer(whichLayer)
{

//alert("Hide: "+whichLayer);

	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
	} else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
	}
	style2.display = "none";
} // end hideLayer() function
