// JavaScript Document


function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function startList() {
	// NOTE: document.all is IE only, therefore this script will only run in IE
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav_main");
		for (var 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", "");
				}
			}
		}
	}
}

function prepareLinks() {
	if (!document.getElementById) return false;
	if (!document.getElementsByTagName) return false;
	if (!document.getElementsByTagName("a")) return false;
	var links = document.getElementsByTagName("a");
	for (var i=0; i<links.length; i++) {
		if (links[i].getAttribute("class") == "new_window") {
			links[i].onclick = function () {
				window.open(this.getAttribute("href"),"_blank");
				return false;
			}
		}
	}
}	

function preloadImages() {
	if (!document.images) return false; // this is in the HTML DOM only
	if (!document.getElementById) return false;
	pic1 = new Image(); 
	pic1.setAttribute("src","/_images/buttons/home-1_2.jpg"); 
	
	pic2 = new Image(); 
	pic2.setAttribute("src","/_images/buttons/services-1_2.jpg"); 
	
	pic3 = new Image(); 
	pic3.setAttribute("src","/_images/buttons/support-1_2.jpg"); 
	
	pic4 = new Image(); 
	pic4.setAttribute("src","/_images/buttons/about-1_2.jpg"); 
	
	pic5 = new Image(); 
	pic5.setAttribute("src","/_images/buttons/news-1_2.jpg"); 
	
	pic6 = new Image(); 
	pic6.setAttribute("src","/_images/buttons/order-1_2.jpg"); 
}

addLoadEvent(prepareLinks);
addLoadEvent(startList);



