function switchTab(tab) { 
	switch(tab) {
		case "welcome":
			hideAll();
			$('#tab-header').css("border-color", "#006a70");
			$('#tab-welcome').css("border-bottom", "5px solid #006a70");
			$('#contentareainner').css("border-color", "#006a70");
			$('#tab-content-welcome').show();
			break;
		case "news":
			hideAll();
			$('#tab-header').css("border-color", "#004681");
			$('#tab-news').css("border-bottom", "5px solid #004681");
			$('#contentareainner').css("border-color", "#004681");
			$('#tab-content-news').show();
			break;
		case "events":
			hideAll();
			$('#tab-header').css("border-color", "#e57f1d");
			$('#tab-events').css("border-bottom", "5px solid #e57f1d");
			$('#contentareainner').css("border-color", "#e57f1d");
			$('#tab-content-events').show();
			break;
		case "network":
			hideAll();
			$('#tab-header').css("border-color", "#455a21");
			$('#tab-network').css("border-bottom", "5px solid #455a21");
			$('#contentareainner').css("border-color", "#455a21");
			$('#tab-content-network').show();
			break;
	}
}

function hideAll() {
	$('#tab-content-welcome').hide();
	$('#tab-content-news').hide();
	$('#tab-content-events').hide();
	$('#tab-content-network').hide();
	$('#tab-welcome').css("border-bottom", "5px solid #fff");
	$('#tab-news').css("border-bottom", "5px solid #fff");
	$('#tab-events').css("border-bottom", "5px solid #fff");
	$('#tab-network').css("border-bottom", "5px solid #fff");
}

$(document).ready(function(){
	// random famous alumni picker
//	var xoxo = new Array();
	
//	xoxo[0] = "transparent url(/global/alumni/images/olympics/annie_vernon.jpg) no-repeat scroll 0 0"; 
	/*
	xoxo[0] = "transparent url(/global/alumni/images/famous/isaacnewton.jpg) no-repeat scroll 0 0"; 
	xoxo[1] = "transparent url(/global/alumni/images/famous/janegoodall.jpg) no-repeat scroll 0 0"; 
	xoxo[2] = "transparent url(/global/alumni/images/famous/charlebabbage.jpg) no-repeat scroll 0 0"; 
	xoxo[3] = "transparent url(/global/alumni/images/famous/clivejames.jpg) no-repeat scroll 0 0"; 
	xoxo[4] = "transparent url(/global/alumni/images/famous/davidattenborough.jpg) no-repeat scroll 0 0"; 
	xoxo[5] = "transparent url(/global/alumni/images/famous/aamilne.jpg) no-repeat scroll 0 0"; 
	xoxo[6] = "transparent url(/global/alumni/images/famous/gromley.jpg) no-repeat scroll 0 0"; 
	xoxo[7] = "transparent url(/global/alumni/images/famous/bertrand.jpg) no-repeat scroll 0 0";  
	xoxo[8] = "transparent url(/global/alumni/images/famous/darwin.jpg) no-repeat scroll 0 0"; 
	xoxo[9] = "transparent url(/global/alumni/images/famous/bjarne.jpg) no-repeat scroll 0 0"; 
	xoxo[10] = "transparent url(/global/alumni/images/famous/jjballar.jpg) no-repeat scroll 0 0"; 
	xoxo[11] = "transparent url(/global/alumni/images/famous/diane.jpg) no-repeat scroll 0 0"; 
	xoxo[12] = "transparent url(/global/alumni/images/famous/starky.jpg) no-repeat scroll 0 0";
	xoxo[13] = "transparent url(/global/alumni/images/famous/douglas.jpg) no-repeat scroll 0 0"; 
	xoxo[14] = "transparent url(/global/alumni/images/famous/emforster.jpg) no-repeat scroll 0 0"; 
	xoxo[15] = "transparent url(/global/alumni/images/famous/ernest.jpg) no-repeat scroll 0 0"; 
	xoxo[16] = "transparent url(/global/alumni/images/famous/fiona.jpg) no-repeat scroll 0 0"; 
	xoxo[17] = "transparent url(/global/alumni/images/famous/fred.jpg) no-repeat scroll 0 0"; 
	xoxo[18] = "transparent url(/global/alumni/images/famous/ianmc.jpg) no-repeat scroll 0 0"; 
	xoxo[19] = "transparent url(/global/alumni/images/famous/isaacnewton.jpg) no-repeat scroll 0 0"; 
	//xoxo[9] = "transparent url(/global/alumni/images/famous/jeremypaxman.jpg) no-repeat scroll 0 0"; */
	
//	var x = Math.floor(Math.random()+1 * xoxo.length); 
	
	//alert(Math.floor(Math.random())+ ':::' + xoxo.length +  ':::' +x);
	//var ThisRandomImage = xoxo[x - 1];
	
	//alert($('#header #brand h2').css('background'));
//	$('#header #brand h2').css('background',ThisRandomImage);
	
	$.localScroll({
		filter:'.scroll'
	});

	//document.domain = "cam.ac.uk";
	//jQuery('iframe').iframeAutoHeight();
	//alert(document.domain);
	 
	jQuery("#myaccountlink").click(function () { 
	
		jQuery('#MyAccount').slideToggle(); 
		jQuery('#CanTab' ).slideUp();
		return false;
	});
	
	jQuery("#mycantabnetlink").click(function () { 
	
		jQuery('#MyAccount').slideUp();
		jQuery('#CanTab').slideToggle();
		return false;
	}); 
	 
	$('.tabs').tabs();
	
	$('.accordion').accordion();
		
	$(".givingToolTip").each(function(i){
		$(this).simpletip({
			content: $(this).attr('href')
			});
	});
		
});


