// site wide javascript
function start_ie_nav() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("nav0");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					curCname = this.className;
					this.className="over";
				}
				node.onmouseout=function() {
					if(!curCname) {
							this.className=this.className.replace("over","out");
					}
					else {
						//alert(curCname);
						this.className=this.className.replace("over",curCname);
					}
				}
			}
		}
	}
}
function show_nav() {
	// nav refers to tier, as in top-level, second-level, third-level
	// level actually refers to which of the top-level nav items to choose
	if(!document.getElementById) {
		return false;
	}
	else {
		var a = document.getElementById('navigation').getElementsByTagName('A');
		var isProduct = false;
		var isImplant = false;
		var prodLoc = '/product-info/products.php';
		var implantLoc = '/product-info/products/breast-implants.php';
		if(window.location.href.indexOf("/products/")>0) isProduct = true;
		if(window.location.href.indexOf("/product-info/products/breast-implants")>0) { isImplant = true; }
		if (window.location.href.substr(location.href.length - 1, 1) == '/') {
			var loc = window.location.href + 'index.php'; 
		}
		else {
			var loc = window.location.href.replace('#','');
		}
		for(var i=0; i < a.length; i++) {
			if (a[i].href == loc || (isProduct && a[i].href.indexOf(prodLoc) > 0) || (isImplant && a[i].href.indexOf(implantLoc) > 0)) {
				a[i].parentNode.setAttribute("class", "on");
				a[i].parentNode.setAttribute("className", "on");
			}
		}	
		if (!window.XMLHttpRequest) {
			start_ie_nav();
		}
	}	
}

function show(obj)
{
	document.getElementById(obj).style.display = 'block';		
}

function hide(obj)
{
	document.getElementById(obj).style.display = 'none';
}

// function/array set for handling plos (page load objects)
function set_plos() {
	window.onload = plos_go;
}

function plos_go() {
	for(var i = 0;i < plos.length;i++)
		eval(plos[i]);
}

function plo_add(jso){
	plos[plos.length] = jso;
}

var plos = new Array();

// set each function to initialize on page load here
// plo_add('some_func_name()');
plo_add('show_nav()');
set_plos();
