$(function(){
	$('#feature-indicators a').click(function(e){
		e.preventDefault();
		$('#featured li').hide();
		$(e.target.getAttribute('href')).show();
		return false;
	});
	
	$('#threebox .panel a').hover(function(e){
		$('#threebox .platforms li').removeClass('highlight');
		var platforms=this.getAttribute('data-highlight').split(',');
		for(var i=0;i<platforms.length;i++){
			$('#' + platforms[i]).addClass('highlight');
		}
	},function(){
		$('#threebox .platforms li').addClass('highlight');
	});
	
	if(document.getElementById('map')){
		var markerLatLng=new google.maps.LatLng(52.81459, -2.08622);
		var centreLatLng=new google.maps.LatLng(52.81600, -2.08622);
		var cfg={
			zoom: 15,
			center: centreLatLng,
			disableDefaultUI: true,
			mapTypeControl:true,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map=new google.maps.Map(document.getElementById('map'),cfg);
		var marker=new google.maps.Marker({
			position:markerLatLng,
			map:map,
			title:'App Haus'
		});
		var infowindow=new google.maps.InfoWindow({
			content:'<div id="content"><h1>App Haus</h1><p>Communications House<br />University Court<br />Staffordshire Technology Park<br />Stafford</br />ST18 0ES</p></div>'
		});
		
		infowindow.open(map,marker);
	}
	
	$('#featured li:not(:first)').hide();
});

function twitterCallback(response){
	if(document.getElementById('lastTweet')){
		document.getElementById('lastTweet').innerHTML=response[0].text;
	}else{
		setTimeout(function(){twitterCallback(response)},500);
	}
}

document.createElement('header');
document.createElement('section');
document.createElement('footer');
document.createElement('details');
document.createElement('summary');
document.createElement('figure');
document.createElement('figcaption');
