$(document).ready(function() {
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
		window.href.location = 'iphone.html';
	} 
	
	$('a').click(function(e) {
		e.preventDefault();
		$(this).closest('ul').find('a').each(function(){
			$(this).removeClass('selected');
		});
		$(this).addClass("selected");
		var host= "http://localhost/~stevenguitar/sge/";
		var extension = ".html";
		var markup = $(this).attr('href') + ".html";
		if('contact' == $(this).attr('href')) {
			markup = $(this).attr('href') + ".php";
		}
		$.get(markup, function(data) {
  			$('.content').html(data);
		});
	});
	
	$('a:first').trigger('click');
	
	$('.appIconWrapper').live('click', function(){
		window.location = $(this).children('a').attr('href');
	});
		
});

(function() {
  var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
  po.src = 'https://apis.google.com/js/plusone.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
