//--- frame destroya ---------------------------------------

function noFrames() {
	if (top.location != self.location) {
		top.location.href = self.location.href;
	}
}

//--- Image Mouseovers -------------------------------------

var outArr = new Array();
var overArr = new Array();
var path = '/img/global/';
var ids = new Array('home', 'technology', 'products', 'services', 'order', 'literature', 'news', 'employment', 'about', 'contact');

// preload
if (document.images) {
	for (i=0; i < ids.length; i++) {
		overArr[i] = new Image;
		overArr[i].src = path + ids[i] + "_on.gif";
		outArr[i] = new Image;
		outArr[i].src = path + ids[i] + "_off.gif"
	}
}

function over(obj, n) {
		obj.src = overArr[n].src;
}

function out(obj, n) {
	if (((location.pathname.indexOf(ids[n]) == -1) && (n != 0)) || ((n == 0) && (location.pathname != "/")))
		obj.src = outArr[n].src;
}

//--- Start Up ------------------------------------------------

function startUp() {
	noFrames();
	startList();
}

function startList() {
	for (x = 0; x < 10; x++) {
		if (location.pathname.indexOf(ids[x]) != -1) {
			document.images[ids[x]].src = overArr[x].src;
		}
		if (location.pathname == "/") {
			document.images['home'].src = overArr[0].src;
		}
	}
	

	if (document.all && document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i = 0; i < navRoot.childNodes.length; i++) {
  			node = navRoot.childNodes[i];
  			if (node.nodeName == "LI") {
  				node.onmouseover = function() {
  					this.className += " over";
				}
				node.onmouseout = function() {
					this.className = this.className.replace(" over", "");
   				}
  			}
  		}
	}
}

//-------------------------------------------------------------

window.onload = startUp;