$(document).ready(function() {

	
	// #### Fade to White on Click. 
	$('.mask').fadeOut('slow', function(){
	  
	  $('#right .text').animate({marginLeft: '0px'}, 'slow',function () 
	      { 
	      //callback function
	      //########## slideshow
	      $('.slideshow').cycle({
	      	fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	      	pause:  1 
	      });
	      
	      }
	  );
	  
	  
	  
	});
	

	
	
	$('a').click(function(event){
		var url = $(this).attr('href');
		
		if($(this).hasClass('ext')){
				window.open(url,'mywindow','width=800,height=450')
				//parent.document.location.href = url;
			  return false;  
		}
		
	  event.preventDefault();
	  
	  if($(this).hasClass('goto')){
	  	  var num = parseInt($(this).attr('rel'));		
		  $('.slideshow').cycle(num);  
		  return false;  
	  }
	  
	
	  $('.mask').fadeIn('slow', function(){
	    document.location.href = url;
	  });
	
	  return false;
	});
	/*
	$('.goto').click(function(event) {  
		event.preventDefault();
		var abc = parseInt("5");
		$('.slideshow').cycle(abc);  
	}); 
	

	*/
       //##########
     
     $('#cont .caption span').css('margin-top','0px')

    
    



    
	$('#cont .caption').mouseenter(function(){
		$(this).find('span').stop().animate({marginTop: '-50px'}, 500);
		//$(this).
	}).mouseleave(function(){
		$(this).find('span').stop().animate({marginTop: '0px'}, 500);
	});	
	
	
		
	
    
});