$(document).ready(function() {

	$(".ajax").colorbox();
	 
	 $('video,audio').mediaelementplayer({alwaysShowControls:true});
	 
	 /* open external links in new window (without classes)
	$("a[href*='http://']:not([href*='http://79.170.40.236/digitaldocumentation.co.uk/']),[href*='https://']:not([href*='http://79.170.40.236/digitaldocumentation.co.uk/'])").click(function() {
		window.open(this.href);
		return false;
	});
	*/
	// open external links in new window (without classes)
	$("a[href*='http://']:not([href*='http://www.digitaldocumentation.co.uk/']),[href*='https://']:not([href*='http://www.digitaldocumentation.co.uk/'])").click(function() {
		window.open(this.href);
		return false;
	});

	 
	 
	 $.localScroll.defaults.axis = 'xy';
		
	/**
	 * NOTE: I use $.localScroll instead of $('#navigation').localScroll() so I
	 * also affect the >> and << links. I want every link in the page to scroll.
	 */
	$.localScroll({
		queue:false,
		duration:1000,
		hash:false,
		offset: {top: -120},
		onBefore:function( e, anchor, $target ){
			// The 'this' is the settings object, can be modified
		},
		onAfter:function( anchor, settings ){
			// The 'this' contains the scrolled element (#content)
		}
	});
	
	/* Speakers */
	$('#sp-greg').click(function(){
		$('#biog').load('sp-greg.html');
		return false;
	});
	$('#sp-elmer').click(function(){
		$('#biog').load('sp-elmer-bol.html');
		return false;
	});
	$('#sp-liz').click(function(){
		$('#biog').load('sp-elizabeth-lee.html');
		return false;
	});
	$('#sp-justin').click(function(){
		$('#biog').load('sp-justin-barton.html');
		return false;
	});
	$('#sp-john').click(function(){
		$('#biog').load('sp-john-meneely.html');
		return false;
	});
	$('#sp-erwin').click(function(){
		$('#biog').load('sp-erwin-cristofori.html');
		return false;
	});
	$('#sp-giovanni').click(function(){
		$('#biog').load('sp-giovanni-pancani.html');
		return false;
	});
	$('#sp-ben').click(function(){
		$('#biog').load('sp-ben-kacyra.html');
		return false;
	});
	$('#sp-david').click(function(){
		$('#biog').load('sp-david-strange-walker.html');
		return false;
	});
	$('#sp-patryk').click(function(){
		$('#biog').load('sp-patryk-kizny.html');
		return false;
	});
	$('#sp-seb').click(function(){
		$('#biog').load('sp-seb-jouan.html');
		return false;
	});
	$('#sp-graziella').click(function(){
		$('#biog').load('sp-graziella-del-duca.html');
		return false;
	});
	$('#sp-gene').click(function(){
		$('#biog').load('sp-gene-roe.html');
		return false;
	});
	
	
	$('#sp-mathias').click(function(){
		$('#biog').load('sp-mathias-jan.html');
		return false;
	});
	$('#sp-brian').click(function(){
		$('#biog').load('sp-brian-mathews.html');
		return false;
	});
	$('#sp-dominique').click(function(){
		$('#biog').load('sp-dominique-pouliquen.html');
		return false;
	});
	$('#sp-neil').click(function(){
		$('#biog').load('sp-neil-tocher.html');
		return false;
	});
	$('#sp-katsushi').click(function(){
		$('#biog').load('sp-katsushi-ikeuchi.html');
		return false;
	});
	
		
	
	/* Organisers */
	$('#dd-overview').click(function(){
		$('#copy').load('dd-overview.html');
		return false;
	});
	$('#dd-education').click(function(){
		$('#copy').load('dd-education.html');
		return false;
	});
	$('#dd-research').click(function(){
		$('#copy').load('dd-research.html');
		return false;
	});
	$('#dd-commercial').click(function(){
		$('#copy').load('dd-commercial.html');
		return false;
	});
	$('#dd-dds').click(function(){
		$('#copy').load('dd-dds.html');
		return false;
	});
	
	$('#hs-overview').click(function(){
		$('#copy').load('hs-overview.html');
		return false;
	});

	$('#hs-education').click(function(){
		$('#copy').load('hs-education.html');
		return false;
	});
	
	$('#hs-research').click(function(){
		$('#copy').load('hs-research.html');
		return false;
	});
	
	
	/* Videos */
	$('#vid-bridgeton').click(function(){
		$('#vid-holder').load('bridgeton-cross.html');
		return false;
	});
	$('#vid-new-lanark').click(function(){
		$('#vid-holder').load('new-lanark.html');
		return false;
	});
	$('#vid-paisley').click(function(){
		$('#vid-holder').load('paisley-fountain.html');
		return false;
	});
	$('#vid-rosslyn').click(function(){
		$('#vid-holder').load('rosslyn-hall.html');
		return false;
	});

	$('#vid-union-st').click(function(){
		$('#vid-holder').load('union-street.html');
		return false;
	});


});
