
/* Custom Javascript for Martin Custom Construction */
var initialBannerImageSrc = '';

function navItemOn(el, bannerName) {
	if (el.id != 'menu-item-active') {	
		el.className = 'top-navigation-menu-item-on';
		// changeBannerImage(bannerName);
	}
}

function navItemOff(el, bannerName) {
	if (el.id != 'menu-item-active') {	
		el.className = 'top-navigation-menu-item';
		// clearBannerImage(bannerName);		
	}
}

function changeBannerImage(bannerName) {
	var bannerImage = document.getElementById('banner-image');	
	initialBannerImageSrc = bannerImage.src;
	var endIndex = initialBannerImageSrc.indexOf("top_banner_") + 11;
	var newSrc = initialBannerImageSrc.substring(0, endIndex);
	newSrc += bannerName + ".jpg";	
	bannerImage.src = newSrc;
}

function clearBannerImage() {
	var bannerImage = document.getElementById('banner-image');		
	bannerImage.src = initialBannerImageSrc;	
}

function imageOn(el) {
	/*
	el.style.border = '1px solid #9F2112';
	el.style.background = '#F2D5CA';
	el.style.padding = '8px';
	*/
	el.className = 'imageOn';	
}

function imageOff(el) {
	/*
	el.style.border = '0px';
	el.style.background = '';
	el.style.padding = '9px';		
	*/
	el.className = 'imageOff';	
}

function initializePage() {
	initialBannerImageSrc = document.getElementById('banner-image').src;
}