/* 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(){
	// fade  the content on home page
	if(document.getElementById("content")){
		//$("#content").fadeTo(10, 0.25);
	}


	if (document.getElementById("slides")){
		// home slider rotation
		$('#slides').cycle({ 
			fx:    'fade', 
			timeout:  4000,
			slideExpr: 'p',
			cleartype:  1, // enable cleartype corrections 
			cleartypeNoBg: false
		
		});
		
	}
	//enable fancybox - http://fancybox.net/api
	if(document.getElementById("photoTour")){
		// add rel="gallery" to each anchor
		$("#leftContent a")	.each(function(){
		
			$(this).attr("rel","gallery");
			
		});
		$("#leftContent a").fancybox({
			speedIn				:	500, 
			speedOut			:	200, 
			overlayShow		:	true,
			transitionIn		:	'fade',
			transitionOut		: 	'fade',
			overlayOpacity	:	.7,
			cyclic					: true


							
		});
		//$("#photoTour a").attr('rel', 'gallery').fancybox();
	}
});



