/* create a timeOut function in jQuery */
jQuery.fn.idle = function(time){
    return this.each(function(){
        var i = $(this);
        i.queue(function(){
            setTimeout(function(){
            i.dequeue();
            }, time);
        });
    });
};



$(document).ready(function(){
	if (document.getElementById("contentHomeTopLeft")){
		// home slider rotation
		$('#contentHomeTopLeft').cycle({ 
			fx:    'fade', 
			timeout:  4000,
			slideExpr: 'p'
		
		});
		
	}
	$('#headerNav').hover(
		function() { $('#headerSubNav', this).slideDown('fast'); },
		function() { $('#headerSubNav', this).slideUp(500); }
	);
	
	$(".gallery a").fancybox({
		'autoscale'			: 	true,
		'cyclic'				:   true,
		'overlayShow'		:	true,
		'overlayOpacity'	:	.7	
	});
	$(".gallery a").attr("rel","galleryPhoto");

	
});



