	
$(document).ready(function()
{

	bgImageTotal=5;
	randomNumber = Math.round(Math.random()*(bgImageTotal-1))+1;
	imgPath=('/wp-content/themes/h&b/images/bg'+randomNumber+'.jpg');
	$('body').css('background-image', ('url("'+imgPath+'")'));
 
	function onAfter(currSlideElement, nextSlideElement, options, forwardFlag)
	{
		$("#menu a:nth-child("+(options.prevSlide + 1)+")").removeClass("selected");
		$("#menu a:nth-child("+(options.currSlide + 1)+")").addClass("selected");
	}

	if($("#rotating_images").length) {
		$("#rotating_images").cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			after: onAfter,
			pager: '#rotating_circles',
			pagerAnchorBuilder: function(idx, slide)
			{ 
				return '#rotating_circles li:eq(' + idx + ')';
			}
		});
	}
	
	/*
	if($("#gallery-1").length) {
		$("#gallery-1").cycle({
			fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			timeout: 1000,
			speed: 500
		});
	}
	*/
	
	$('#menu_drop > li').mouseover(function(){
		$(this).find('ul').css('display', 'block');
	});
	$('#menu_drop > li').mouseout(function(){
		$(this).find('ul').css('display', 'none');
	});

});
