/* 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(){
		$('input[type="text"]').focus(function() { 
	
		if (this.value == this.defaultValue){
				this.value = '';
			}
		});
		$('input[type="text"]').blur(function() { 
			if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
		});
	
	if (document.getElementById("contentHomeBanner")){
		// home slider rotation
		$('#contentHomeBanner').cycle({ 
			fx:    'fade', 
			timeout:  4000,
			slideExpr: 'p'
		
		});
		
	}
	
	$(".gallery a").fancybox({
		'autoscale'			: 	true,
		'cyclic'				:   true,
		'overlayShow'		:	true,
		'overlayOpacity'	:	.7	
	});
	$(".gallery a").attr("rel","galleryPhoto");
	
	//change the position of the helpden icon
	if(document.getElementById("Helpden_tab")){
		$("#Helpden_tab").css("position","absolute");	
	}
	
	
});



