﻿window.onload = function() {
    document.getElementById('menu').style.visibility = 'visible';
	
	// This is to fix the problem where tabs at the top aren't styled occasionally
	// This code will run shortly after the page loads
	window.setTimeout('resetTabs1();', 50);
}

function resetTabs1() {
	// this will need to be updated if the tabs change, 
	// to check what the size will be when it's broken put the 
	// consumer tab to float:none, and make it somewhere between 
	// the full size and broken size
	if (document.getElementById('top_right_menu').offsetWidth < 400) {
		
		// this will turn off the left tab item, and after a delay 
		// to let the page re-render will turn it on again
		document.getElementById('consumer').style.cssText = 'display:none;';
		window.setTimeout('resetTabs2();', 1); 
		
	}	
}
function resetTabs2() {	
    document.getElementById('consumer').style.cssText = 'display:block;';
}

function rollover(el) {
    el.src = '/images/' + el.id + '_over.png';
}
function rollout(el) {
    el.src = '/images/' + el.id + '.png';
}

function rolloverie6(el) {
    var sauce = '/images/' + el.id + '_over.png';
    el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + sauce + "\', sizingMethod='image')";
}
function rolloutie6(el) {
    var sauce = '/images/' + el.id + '.png';
    el.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + sauce + "\', sizingMethod='image')";
}


var myimages = new Array()

function preloadimages() {

    for (i = 0; i < preloadimages.arguments.length; i++) {

        myimages[i] = new Image()

        myimages[i].src = preloadimages.arguments[i]

    }
    
}

preloadimages(

	'/images/industry_tab_text_over.png',

	'/images/media_tab_text_over.png',

	'/images/consumer_tab_text_over.png',

	'/images/supplychaindir_tab_text_over.png',

	'/images/foodservice_tab_text_over.png'

);
