function menuBind(){
	$('#menu > li > a em').bind('mouseenter',function(){						 
		$(this).parent().find('span').stop().animate({width:'100%', left:'0'},400, 'easeOutQuad');
		$(this).parent().parent().find('> strong img').stop().animate({height:'100%', width:'100%', left:'0', top:'0'},400, 'easeOutQuad');
		Cufon.replace(this, { fontFamily: 'Century Gothic', hover: false, textShadow: '1px 1px rgba(255, 255, 255, .2), -1px -1px rgba(255, 255, 255, .2), 2px 2px rgba(255, 255, 255, .05), -2px -2px rgba(255, 255, 255, .05), 3px 3px rgba(255, 255, 255, .02), -3px -3px rgba(255, 255, 255, .02), 4px 4px rgba(255, 255, 255, .01), -4px -4px rgba(255, 255, 255, .01)'});
	});
	$('#menu > li > a em').bind ('mouseleave', function(){	
		$(this).parent().find('span').stop().animate({width:'0', left:'112'},400, 'easeOutQuad');
		$(this).parent().parent().find('> strong img').stop().animate({height:'0', width:'0', left:'112', top:'76'},400, 'easeOutQuad');
		Cufon.replace(this, { fontFamily: 'Century Gothic', hover: false, textShadow:false});
	})	
}
function menuUlBind(){
	$('#menu > .nav3').bind('mouseenter',function(){	
		$('#menu > .nav3:not(.active)').find(' > a em').unbind('mouseenter, mouseleave');
		$(this).find('b').stop().animate({opacity:'1'},400);
		$('#menu > .nav3:not(.active)').find('> a span').stop().animate({width:'100%', left:'0'},400, 'easeOutQuad');
		Cufon.replace('#menu > .nav3 > a', { fontFamily: 'Century Gothic', hover: false, textShadow: '1px 1px rgba(255, 255, 255, .2), -1px -1px rgba(255, 255, 255, .2), 2px 2px rgba(255, 255, 255, .05), -2px -2px rgba(255, 255, 255, .05), 3px 3px rgba(255, 255, 255, .02), -3px -3px rgba(255, 255, 255, .02), 4px 4px rgba(255, 255, 255, .01), -4px -4px rgba(255, 255, 255, .01)'});
		Cufon.replace('#menu > .nav3  li a', { fontFamily: 'Century Gothic', hover: false, textShadow:false});
	});
	$('#menu > .nav3').bind ('mouseleave', function(){	
		$(this).find('b').stop().animate({opacity:'0'},400);
		$('#menu > .nav3:not(.active)').find('> a span').stop().animate({width:'0', left:'112'},400, 'easeOutQuad', function(){
		Cufon.replace('#menu > .nav3 > a', { fontFamily: 'Century Gothic', hover: false, textShadow:false});});
		Cufon.replace('#menu > .nav3  li a', { fontFamily: 'Century Gothic', hover: false, textShadow:false});
	});
}

$(document).ready(function() {
	//menu animate
	menuBind();
	$('#menu b').css({visibility:'hidden', opacity:'0'});
	$('ul.sf-menu').superfish({
		delay:       600,
		animation:   { height:'show'},
		speed:       400,
		autoArrows:  false,
		dropShadows: false
	});
	//gallery
	$('#slideshow').cycle({
			fx:    'scrollHorz',
			timeout: false, // milliseconds between slide transitions (0 to disable auto advance)
			speed: 1000, // speed of the transition (any valid fx speed value)
			pager: '.pagination', // selector for element to use as pager container
			activePagerClass: 'active', // class name used for the active pager link
   			prev: '.prev',  // selector for element to use as event trigger for previous slide 
    		next: '.next'  // selector for element to use as event trigger for next slide 
	});
	// for lightbox
	if ($("a[rel^='prettyPhoto']").length) {
			$(document).ready(function() {
				// prettyPhoto
				$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
			});
	}
});

