$(document).ready(function () {	
	$('li.mainMenuLi').hoverIntent(
		function() { $('.subMenuContainer', this).slideDown('fast'); },					   
		function() { $('.subMenuContainer', this).slideUp('fast'); }
	).css('height','40px');

	$('li.mainMenuLi').hover(
		function() { $(this).addClass('mainMenuHover'); },					   
		function() { $(this).removeClass('mainMenuHover'); }					   
	).css('height','40px');
	
	$('a[href*=#]').click(function() {
 		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
   			var $target = $(this.hash);
   			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
   			if ($target.length) {
  				var targetOffset = $target.offset().top;
  				$('html,body').animate({scrollTop: targetOffset}, 900);
   		 	return false;
   			}
  		}
  	});
	
	$('#testimonials').cycle({
		fx: 'fade',
		random: 1,
		speed:  1000,
		timeout: 7000,
		cleartype:  1,
		cleartypeNoBg: true
	}); 

	$("a.mapPopup").colorbox({ innerWidth:800, innerHeight:600, iframe:true, href:"/about/coverageMap.aspx" });
	$("a.creativePopup").colorbox();
	
	var randomNum = Math.floor(Math.random()*9);
	$('#quickFacts li.fact:eq(' + randomNum + ')').css("display", "block");
	$('#quickFacts li.fact:eq(' + (randomNum+1) + ')').css("display", "block");
	$('#quickFacts li.fact:eq(' + (randomNum+2) + ')').css("display", "block");

});