// 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();

    }

  }

}



function showRollOverEffect() {



	if (!document.getElementById) return 



	var navPrimaryTv = document.getElementById("nav-primary-tv");

	var navPrimaryVideo = document.getElementById("nav-primary-video");		

	var navPrimaryIndustry = document.getElementById("nav-primary-industry");

	var navPrimaryCase = document.getElementById("nav-primary-case");

	var navSecondarySolutions = document.getElementById("nav-secondary-solutions");

	var navSecondaryProducts = document.getElementById("nav-secondary-products");

	var navSecondaryUpgrades = document.getElementById("nav-secondary-upgrades");

	var navSecondaryDemo = document.getElementById("nav-secondary-demo");

	

	navPrimaryTv.onmouseover = showPrimaryTv;

	navPrimaryVideo.onmouseover = showPrimaryVideo;

	navPrimaryIndustry.onmouseover = showPrimaryIndustry;

	navPrimaryCase.onmouseover = showPrimaryCase;

	navSecondarySolutions.onmouseover = showSecondarySolutions;

	navSecondaryProducts.onmouseover = showSecondaryProducts;

	navSecondaryUpgrades.onmouseover = showSecondaryUpgrades;

	navSecondaryDemo.onmouseover = showSecondaryDemo;

	

	navPrimaryTv.onmouseout = hideAll;

	navPrimaryVideo.onmouseout = hideAll;

	navPrimaryIndustry.onmouseout = hideAll;

	navPrimaryCase.onmouseout = hideAll;

	navSecondarySolutions.onmouseout = hideAll;

	navSecondaryProducts.onmouseout = hideAll;

	navSecondaryUpgrades.onmouseout = hideAll;

	navSecondaryDemo.onmouseout = hideAll;

	

	function showPrimaryTv() {

		navPrimaryTv.style.background = 'url(/assets/img/nav-primary-tv.png)';

	}

	function showPrimaryVideo() {

		navPrimaryVideo.style.background = 'url(/assets/img/nav-primary-video.png)';

	}

	function showPrimaryIndustry() {

		navPrimaryIndustry.style.background = 'url(/assets/img/nav-primary-industry.png)';

	}

	function showPrimaryCase() {

		navPrimaryCase.style.background = 'url(/assets/img/nav-primary-case.png)';

	}

	function showSecondarySolutions() {

		navSecondarySolutions.style.background = '#f2f3f4';

	}

	function showSecondaryProducts() {

		navSecondaryProducts.style.background = '#f2f3f4';

	}

	function showSecondaryUpgrades() {

		navSecondaryUpgrades.style.background = '#f2f3f4';

	}

	function showSecondaryDemo() {

		navSecondaryDemo.style.background = '#f2f3f4';

	}

	function hideAll() {

		navPrimaryTv.style.background = '';

		navPrimaryVideo.style.background = '';

		navPrimaryIndustry.style.background = '';

		navPrimaryCase.style.background = '';

		navSecondarySolutions.style.background = '#fff';

		navSecondaryProducts.style.background = '#fff';

		navSecondaryUpgrades.style.background = '#fff';

		navSecondaryDemo.style.background = '#fff';

	}

}

addLoadEvent(showRollOverEffect);