function initSelectWidth()
{
	var sets = document.getElementById("main-nav");
	var _maxWidth = 0;
	var links = sets.getElementsByTagName("strong");
	for (var j = 0; j < links.length; j++)
	{
		if(links[j].offsetWidth > _maxWidth) _maxWidth = links[j].offsetWidth;
	}
	for (var j = 0; j < links.length; j++)
	{
		links[j].style.width = _maxWidth - 40 + 'px';
	}
}

if (window.addEventListener) window.addEventListener("load", initSelectWidth, false);
else if (window.attachEvent) window.attachEvent("onload", initSelectWidth);

/*
 * Countdown function for the homepage of ICC
 * to announce the opening of the new ICC
 * 
 */
function countDown(eventDate) {
	// set counter to 0 for the while loop
	count = 0;
	
	// get the current date as the UNIX
	today  = new Date();
	todayEpoch  = today.getTime();

	// get the target date as the UNIX
	target = new Date(eventDate); 
	targetEpoch = target.getTime();

	// do the maths for the day count
	daysLeft = Math.floor(((targetEpoch - todayEpoch) / (60*60*24)) / 1000);
	
	// turn the maths into a string 
	daysLeft2 = daysLeft.toString();
	
	// turn the string into an array
	daysLeft3 = daysLeft2.split('');
		
	// if there are no days left, the count down is complete
	if (daysLeft < 1) { 
		document.write("<li><h2>Its open!</h2></li>");
	}
	
	// otherwise show the countdown
	else {
		
		// loop through the 3 numbers to display days remaining
		while (count < 3) {
			if (daysLeft3[count] != null) { 
				document.write("<li><img src='/tpl/excel/images_icc/bg-days" + daysLeft3[count] + ".gif' /></li>");
			}
			count = count + 1; 
		}
		document.write("<li class='days-to'>DAYS  TO GO</li>")
	}
}


