/*
    ======================================
    Requires:
	    /_js/global.js
	    /_mootools/*
	======================================
*/
function kz_setPageSection () {
	if (document.getElementById) {
		bodyClass = document.body.className;
		if (bodyClass == 'homepage') {
			kz_swapImage (document.getElementById('navHome'), '/_img/nav-home-on.gif');
		}else if (bodyClass == 'sectionWhyFx') {
			kz_swapImage (document.getElementById('navWhyFX'), '/_img/nav-whyfx-on.gif');
		}else if (bodyClass == 'sectionWhyFr') {
			kz_swapImage (document.getElementById('navWhyFR'), '/_img/nav-whyfr-on.gif');
		}else if (bodyClass == 'sectionProducts') {
			kz_swapImage (document.getElementById('navProducts'), '/_img/nav-products-on.gif');
		}else if (bodyClass == 'sectionMarkets') {
			kz_swapImage (document.getElementById('navMarkets'), '/_img/nav-markets-on.gif');
		}else if (bodyClass == 'sectionNews') {
			kz_swapImage (document.getElementById('navNews'), '/_img/nav-news-on.gif');
		}else if (bodyClass == 'sectionFaqs') {
			kz_swapImage (document.getElementById('navFAQs'), '/_img/nav-faqs-on.gif');
		}else if (bodyClass == 'sectionContact') {
			kz_swapImage (document.getElementById('navContact'), '/_img/nav-contact-on.gif');
		}
	}
}
function kz_initialisePage () {
	if (document.getElementById) {
		//
		kz_setPageSection ();
		kz_preloadImages ('/_img/nav-home-over.gif','/_img/nav-whyfx-over.gif','/_img/nav-whyfr-over.gif','/_img/nav-aboutus-over.gif','/_img/nav-products-over.gif','/_img/nav-markets-over.gif','/_img/nav-news-over.gif','/_img/nav-faqs-over.gif','/_img/nav-workforus-over.gif','/_img/nav-contact-over.gif');
		//preloadImages ('/_img/nav_on_home.png','/_img/nav_on_theservice.png','/_img/nav_on_whyonevu.png','/_img/nav_on_newspress.png','/_img/nav_on_company.png','/_img/nav_on_contact.png','/_img/nav_on_customer_c.png');
		
		//
		revertHome = document.getElementById('navHome').src;
		revertWhyFX = document.getElementById('navWhyFX').src;
		revertWhyFR = document.getElementById('navWhyFR').src;
		revertProducts = document.getElementById('navProducts').src;
		revertMarkets = document.getElementById('navMarkets').src;
		revertNews = document.getElementById('navNews').src;
		revertFAQs = document.getElementById('navFAQs').src;
		revertContact = document.getElementById('navContact').src;
		/*
		    ROLL-OVER
		*/
		document.getElementById('navHome').onmouseover = function () {
			if (document.getElementById('navHome').src.indexOf ('-on') == -1) kz_swapImage (this, '/_img/nav-home-over.gif');	
		}
		document.getElementById('navWhyFX').onmouseover = function () {
			if (document.getElementById('navWhyFX').src.indexOf ('-on') == -1) kz_swapImage (this, '/_img/nav-whyfx-over.gif');	
		}
		document.getElementById('navWhyFR').onmouseover = function () {
			if (document.getElementById('navWhyFR').src.indexOf ('-on') == -1)kz_swapImage (this, '/_img/nav-whyfr-over.gif')	
		}
		document.getElementById('navProducts').onmouseover = function () {
			if (document.getElementById('navProducts').src.indexOf ('-on') == -1)kz_swapImage (this, '/_img/nav-products-over.gif')	
		}
		document.getElementById('navMarkets').onmouseover = function () {
			if (document.getElementById('navMarkets').src.indexOf ('-on') == -1)kz_swapImage (this, '/_img/nav-markets-over.gif')	
		}
		document.getElementById('navNews').onmouseover = function () {
			if (document.getElementById('navNews').src.indexOf ('-on') == -1)kz_swapImage (this, '/_img/nav-news-over.gif')	
		}
		document.getElementById('navFAQs').onmouseover = function () {
			if (document.getElementById('navFAQs').src.indexOf ('-on') == -1)kz_swapImage (this, '/_img/nav-faqs-over.gif')	
		}
		document.getElementById('navContact').onmouseover = function () {
			if (document.getElementById('navContact').src.indexOf ('-on') == -1)kz_swapImage (this, '/_img/nav-contact-over.gif')	
		}
        /*
		    ROLL-OUT
		*/
		document.getElementById('navHome').onmouseout = function () {
			kz_swapImage (this, revertHome);
		}
		document.getElementById('navWhyFX').onmouseout = function () {
			kz_swapImage (this, revertWhyFX);
		}
		document.getElementById('navWhyFR').onmouseout = function () {
			kz_swapImage (this, revertWhyFR)	
		}
		document.getElementById('navProducts').onmouseout = function () {
			kz_swapImage (this, revertProducts)	
		}
		document.getElementById('navMarkets').onmouseout = function () {
			kz_swapImage (this, revertMarkets)	
		}
		document.getElementById('navNews').onmouseout = function () {
			kz_swapImage (this, revertNews)	
		}
		document.getElementById('navFAQs').onmouseout = function () {
			kz_swapImage (this, revertFAQs)	
		}
		document.getElementById('navContact').onmouseout = function () {
			kz_swapImage (this, revertContact)	
		}
	}
}
function addSearchRollovers () {
	if (document.getElementById) {
	  document.getElementById ('btnSearchSubmit').onmouseover = function () {
		kz_swapImage ('btnSearchSubmit', '/_img/btn-submit-on.png');
	  }
	  document.getElementById ('btnSearchSubmit').onmouseout = function () {
		kz_swapImage ('btnSearchSubmit', '/_img/btn-submit.png');
	  }
	  //
	  if (document.getElementById ('imgWorkForUs') != null) {
		  document.getElementById ('imgWorkForUs').onmouseover = function () {
			kz_swapImage ('imgWorkForUs', '/_img/btn-work-for-us-on.png');
		  }
		  document.getElementById ('imgWorkForUs').onmouseout = function () {
			kz_swapImage ('imgWorkForUs', '/_img/btn-work-for-us.png');
		  }
	  }
	}
}
window.addEvent('domready', function(){
	kz_initialisePage ();
	//addSearchRollovers ();
});