//--- 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;

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

/***********************************************
* Dolphin Tabs Menu- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/

var dolphintabs={
	subcontainers:[], last_accessed_tab:null,

	revealsubmenu:function(curtabref){
	this.hideallsubs()
	if (this.last_accessed_tab!=null)
		this.last_accessed_tab.className=""
	if (curtabref.getAttribute("rel")) //If there's a sub menu defined for this tab item, show it
	document.getElementById(curtabref.getAttribute("rel")).style.display="block"
	curtabref.className="current"
	this.last_accessed_tab=curtabref
	},

	hideallsubs:function(){
	for (var i=0; i<this.subcontainers.length; i++)
		document.getElementById(this.subcontainers[i]).style.display="none"
	},


	init:function(menuId, selectedIndex){
	var tabItems=document.getElementById(menuId).getElementsByTagName("a")
		for (var i=0; i<tabItems.length; i++){
			if (tabItems[i].getAttribute("rel"))
				this.subcontainers[this.subcontainers.length]=tabItems[i].getAttribute("rel") //store id of submenu div of tab menu item
			if (i==selectedIndex){ //if this tab item should be selected by default
				tabItems[i].className="current"
				this.revealsubmenu(tabItems[i])
			}
		tabItems[i].onmouseover=function(){
		dolphintabs.revealsubmenu(this)
		}
		} //END FOR LOOP
	}

}