/* 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(){

	
	 // messagebox 
        if(document.getElementById("splashMain")){
            // fade out
			
            $('#splashMain').idle(4500).fadeOut('slow',function(){
				window.location.replace("http://euro-nest.com/home");
				});
            //$('#splashEnter').idle(5000).fadeIn('slow');
        }
		// scroll pane
		if (document.getElementById("linksList")){
			$('#linksList').jScrollPane({scrollbarWidth:5,dragMaxHeight:45});
		}
		if (document.getElementById("contentPageProfile")){
			$('#contentPageProfile').jScrollPane({scrollbarWidth:5,dragMaxHeight:45});
		}
		// roll overs
		// about
		$('.topNavItem').hover(
			function() { $('.subNavItem', this).css('display', 'block'); },
			function() { $('.subNavItem', this).css('display', 'none'); });
	
	
	// top nav rollover
	$(".rollover").hover(
	 function()
	 {
	  this.src = this.src.replace("_off","_on");
	 },
	 function()
	 {
	  this.src = this.src.replace("_on","_off")	;
	 }
	);
	
	// gallery 
	$(".gallery a").fancybox({
		'autoscale'			: 	true,
		'cyclic'				:   true,
		'overlayShow'		:	true,
		'overlayOpacity'	:	.7	
	});
	$(".gallery a").attr("rel","galleryPhoto");
	
});
