
// following two functions kindly provided by Jonathan Howard
$.fn.pause = function(milli,type) {
	milli = milli || 1000;
	type = type || "fx";
	return this.queue(type,function(){
		var self = this;
		setTimeout(function(){
			$.dequeue(self);
		},milli);
	});
};

$.fn.clearQueue = $.fn.unpause = function(type) {
	return this.each(function(){
		type = type || "fx";
		if(this.queue && this.queue[type]) {
			this.queue[type].length = 0;
		}
	});
};
 
/////////// 
 
 
 $(document).ready(function(){
   $('.pics').hide();
  
  $('#profiletext').hide();
  
   
   // stops the hourglass mouse pointer flicker
   if ( $.browser.msie ) {
		document.execCommand("BackgroundImageCache", false, true) 
    	 
   }
   
 $('#descriptiontrigger').click(function()  {  
			
		if ( $('#profiletext').css('display') == 'none') {
			
			$('#profiletext').ScrollTo(800);
			$('#profiletext').fadeIn();  
			$('#descriptiontrigger').html('Hide Description &gt;&gt;');
		} else {
			$('#profiletext').fadeOut();  
			$('#descriptiontrigger').html('Show Description &gt;&gt;');
			$('body').ScrollTo(800);
		}
		
		return false;
		
});
 
   $('.pics').cycle({ 
    fx:    'scrollHorz', 
    prev:   '#prev1', 
    next:   '#next1', 
    timeout: 0 
	 });
   
     $('.pics').show();
   
    $('#header ul li ul').hide();
   
  
	$("#header li").hover(
        function () {
			$(this).children("ul").show();
			$(this).addClass('hoverover');
        },function(){
			$(this).children("ul").hide();
			$(this).removeClass('hoverover');
			
			
  });
	
	 
	$('#pic1').hide();
	$('#pic2').hide();
	$('#pic3').hide();
	$('#pic4').hide();
	$('#pic5').hide();
	$('#pic6').hide();
	$('#pic7').hide();
	$('#pic8').hide();
	$('#pic9').hide();
	
	
	

$('.rolloverimage').fadeTo(1, 0.5);
 		
  $(".rolloverimage").hover(
	function () {
		$(this).fadeTo(1, 0.999);
		
	},function(){
		$(this).fadeTo(1, 0.5);        
            
  });
    
    // trigger off the fading
	 setTimeout("fade()", 10);
   
 });
	 
	
	 

 

function fade()
{
	setTimeout("fade()", 36000);
	
	 
	$('#pic1').pause(1000).fadeIn(1500) ;
	$('#pic2').pause(3000).fadeIn(1500) ;
	$('#pic3').pause(5000).fadeIn(1500) ;
	$('#pic4').pause(7000).fadeIn(1500).pause(22000).fadeOut(1500);	
	$('#pic5').pause(9000).fadeIn(1500).pause(18000).fadeOut(1500);	
	$('#pic6').pause(11000).fadeIn(1500).pause(14000).fadeOut(1500);
	$('#pic7').pause(13000).fadeIn(1500).pause(10000).fadeOut(1500);	
	$('#pic8').pause(15000).fadeIn(1500).pause(6000).fadeOut(1500);
	$('#pic9').pause(17000).fadeIn(1500).pause(2000).fadeOut(1500);
	



	/* var randompic = Math.floor((Math.random() * 7) + 1);
 	
	$('#sidepic').html('<img   src="images/sidepic' + randompic + '.gif" />');
	$('#sidepic').pause(40).fadeIn(1500); */
	 

}
	

