function nav() {
hideNav();
var menu = document.getElementById("sub-menu");
var h4 = menu.getElementsByTagName("h4");
   
for (var i = 0; i < h4.length; i++) {
	var temp = h4[i].nextSibling;
		if(temp.tagName == "UL") {
			h4[i].onclick = showNav;
		}
   }
}
function showNav() {
hideNav();
var theList = this.nextSibling;
theList.style.display = "block";
return false;
}
function hideNav() {
var menu = document.getElementById("sub-menu");
var ularray = menu.getElementsByTagName("ul");
for (var i = 0; i < ularray.length; i++) {
	   ularray[i].style.display = "none";
}
}

function images() {
home_out = new Image;
home_in = new Image;
about_out = new Image;
about_in = new Image;
contact_out = new Image;
contact_in = new Image;
checkout_out = new Image;
checkout_in = new Image;
terms_out = new Image;
terms_in = new Image;
blog_in = new Image;
home_out.src = '/ekmps/shops/thebikeshop/resources/Design/home.png';
home_in.src = '/ekmps/shops/thebikeshop/resources/Design/homein.png';
about_out.src = '/ekmps/shops/thebikeshop/resources/Design/aboutus.png';
about_in.src = '/ekmps/shops/thebikeshop/resources/Design/aboutusin.png';
contact_out.src = '/ekmps/shops/thebikeshop/resources/Design/contact.png';
contact_in.src = '/ekmps/shops/thebikeshop/resources/Design/contactin.png';
checkout_out.src = '/ekmps/shops/thebikeshop/resources/Design/checkout.png';
checkout_in.src = '/ekmps/shops/thebikeshop/resources/Design/checkoutin.png';
terms_out.src = '/ekmps/shops/thebikeshop/resources/Design/terms.png';
terms_in.src = '/ekmps/shops/thebikeshop/resources/Design/termsin.png';
blog_in.src= '/ekmps/shops/thebikeshop/resources/Design/blogin.png';
}

// JavaScript Document
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}

addLoadEvent(nav);
addLoadEvent(images);