function ieLiFix(theID) {

	//is it IE7 or below?

	if (jQuery.browser.msie && (jQuery.browser.version)<8) {

		//set overflow to hidden so we can set display to block in order to get widths

		var jqueryID='#'+theID;

		$master=$(jqueryID);

		$master.css("overflow","hidden");

		//get all LI tags in menu

		var subNav=document.getElementById(theID).getElementsByTagName('li');

		var counter=0;

		var subNavUl=new Array();

		//get all nested UL tags

		for(i=0;i<subNav.length;i++){

			if(subNav[i].getElementsByTagName('ul')[0]) {

				subNavUl[counter]=subNav[i].getElementsByTagName('ul')[0];

				counter++;

			}

		}

		//set displays to all nested UL's to block

		for(i=0;i<subNavUl.length;i++) {

			subNavUl[i].style.display="block";

		}

		//get MAX width of nested LI and then set all LI's to that width on a UL by UL basis

		for (i=0;i<subNavUl.length;i++) {

			//reset variables

			var subNavLi=new Array();

			var maxwidth=subNavUl[i].offsetWidth;//set initial width to ul width so that li elements are at least the parent ul's width

			subNavLi=subNavUl[i].getElementsByTagName('li');

			for(x=0;x<subNavLi.length;x++) {

				tempWidth=subNavLi[x].offsetWidth;

				maxwidth=(maxwidth<tempWidth)?tempWidth:maxwidth;

			}

			for(x=0;x<subNavLi.length;x++) {

				subNavLi[x].style.width=maxwidth+"px";

			}

		}

		//set displays to all nested UL's to none

		for(i=0;i<subNavUl.length;i++) {

			subNavUl[i].style.display="none";

		}

		$master.css("overflow","visible");

	}

}

function mtwmenu_open() {

	$(this).find('ul').eq(0).show();

	$(this).find('a').eq(0).addClass("selected");

}

function mtwmenu_close() {

	$(this).find('ul').eq(0).hide();

	$(this).find('a').eq(0).removeClass("selected");

}

$(document).ready(

	function() {

		$('#testimonials').cycle({

            fx: 'fade',

            speed: 500,

            timeout: 8000

        });

		$('#menu > li').bind('mouseover', mtwmenu_open);

		$('#menu > li').bind('mouseout',  mtwmenu_close);

		ieLiFix('menu');

	}

);
