var diff;
 
 $(document).ready(function(){
 
	doDetect();
// var plus = $('#plus');
// var navDiv = $('#bigNav');
// var pos = plus.position().left;
// var pos2 = navDiv.position().left;
//  diff = pos2-pos+100;
// $('#bigNav').css({'margin-left':diff});
// $('#plus').css({'visibility':'hidden'});
 $('#home_div').show('slow');
    $("nav a").click(function(event){
		var currentID = $(this).attr('id');
		var divToShow = currentID + '_div';
//		if (currentID == 'plus') {
//	  		$('#bigNav').animate({
//	  		
//	  		  'margin-left': 0,
//	  		}, 2000, function() {
//	  		$('#plus').hide();
	  		  // Animation complete.
//	  		});
//		} else {
			$('div[id$="_div"]').hide('slow');
			$('#' + divToShow).show('slow');
//		}
		
      });
      
      $("#purchaselink").click(function(event){
      	
      		$('div[id$="_div"]').hide('slow');
      		$('#purchase_div').show('slow');
      
      	
        });
      
      function doDetect() {
      
            var uagent = navigator.userAgent.toLowerCase();
      var smartphone = uagent.search("iphone") > -1 || uagent.search("ipod") > -1 || uagent.search("android") > -1 || uagent.search("blackberry") > -1 || uagent.search("mobile") > -1;
      
	      if (smartphone) {
	     
	        $("link[rel=stylesheet]").attr({href : "sm_mobile.css"});
	      	      }
      }
      
        
  });

