/* Author: Howard Panton, Chris Toppon

*/

// Fade in and position tabs at the bottom using .tab-index class
	$('#tabs').fadeIn().addClass('tab-index');
// Add ual class to the previous and nextr arrows
//	$('a.prev').addClass('ual');
//	$('a.next').addClass('ual');
// We will need to add a ID to the body class when its on the load page
	$("body").attr("id","home");
// I have removed the # attribute from the tab links, these will only show if javascript is disabled allowing site to function
	$('a.camberwell,a.chelsea,a.lcc, a.lcf,a.wimbledon, a.csm').removeAttr('href');

	
//Show next div in the Dom when the tabs are clicked

	$('a.camberwell').click(function(event){
	$('div.scrollable').find('div#ual, div#csm, div#lcf, div#lcc, div#chelsea, div#wimbledon').hide();
	$('div#camberwell').show();
	var pathnameA = $('#camberwell').attr("id");
	$("body").attr("id",pathnameA);
	}); 
	
	$('a.chelsea').click(function(event){
	$('.scrollable #chelsea').show();
	$('div.scrollable').find('div#ual, div#csm, div#lcf, div#camberwell, div#lcc, div#wimbledon').hide();
	$('div#chelsea').show();
	var pathnameB = $('#chelsea').attr("id");
	$("body").attr("id",pathnameB);

	}); 
	
	$('a.wimbledon').click(function(event){
	$('div.scrollable').find('div#ual, div#csm, div#lcf, div#camberwell, div#chelsea, div#lcc').hide();
	$('div#wimbledon').show();
	var pathnameC = $('#wimbledon').attr("id");
	$("body").attr("id",pathnameC);
	return false;
	}); 
	
	$('a.csm').click(function(event){
	$('div.scrollable').find('div#ual, div#lcc, div#lcf, div#camberwell, div#chelsea, div#wimbledon').hide().end();
	$('div#csm').show();
	var pathnameD = $('#csm').attr("id");
	$("body").attr("id",pathnameD);
		return false;
	}); 
	
	$('a.lcc').click(function(event){
	$('div.scrollable').find('div#ual, div#csm, div#lcf, div#camberwell, div#chelsea, div#wimbledon').hide().end();
	$('div#lcc').show();
	var pathnameE = $('#lcc').attr("id");
	$("body").attr("id",pathnameE);
		return false;
	}); 
	
	
	$('a.lcf').click(function(event){
	$('div.scrollable').find('div#ual, div#csm, div#lcc, div#camberwell, div#chelsea, div#wimbledon').hide().end();
	$('div#lcf').show();
	var pathnameF = $('#lcf').attr("id");
	$("body").attr("id",pathnameF);
		return false;
	}); 
	
	
//Show previous div in the Dom
	
	
		$('a.prev').click(function(event){
	var targetG = $('div.items div:visible');
	targetG.hide().prev('.item:hidden').show();
	var pathnameG = $('.item:visible').attr("id");
	$("body").attr("id",pathnameG);
	}); 
	
		$('div#ual a.prev').click(function(event){
	$('div#ual').hide();
	$('div#lcf').show();
	var pathnameJ = $('.item:visible').attr("id");
	$("body").attr("id",pathnameJ);
	}); 
				
//Show next div in the Dom

	$('a.next').click(function(event){
	var targetH = $('div.items div:visible');
	targetH.hide().next('.item:hidden').show();
	var pathnameH = $('.item:visible').attr("id");
	$("body").attr("id",pathnameH);
	}); 
	
		
	$('div#wimbledon a.next').click(function(event){
	$('div#wimbledon').hide();
	$('div#ual').show();
	var pathnameK = $('.item:visible').attr("id");
	$("body").attr("id",pathnameK);
	}); 
		
	


	$("div.slideUp").hover(function() {
	  $(this).find("div.slideDown").animate({opacity: "show"}, "slow");
	}, function() {
	  $(this).find("div.slideDown").animate({opacity: "hide"}, "fast");
	 });




