if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
var viewportmeta = document.querySelectorAll('meta[name="viewport"]')[0];
if (viewportmeta) {
viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0';
document.body.addEventListener('gesturestart', function() {
viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
}, false);
}
}    
// FONTS
google.load("webfont", "1");

 google.setOnLoadCallback(function() {
   WebFont.load({
     google: {
       families: [ 'Bevan','Candal', 'Kreon' ]
     }});
 });

// ON LOAD

$(document).ready(function(){

	// Run Matt Kersley's jQuery Responsive menu plugin (see plugins.js)
	if ($.fn.mobileMenu) {
		$('ol#id').mobileMenu({
			switchWidth: 768,                   // width (in px to switch at)
			topOptionText: 'Choose a page',     // first option text
			indentString: '&nbsp;&nbsp;&nbsp;'  // string for indenting nested items
		});
	}

	// Run Mathias Bynens jQuery placeholder plugin (see plugins.js)
	if ($.fn.placeholder) {
		$('input, textarea').placeholder();		
	}
	
	$(window).load(function() {
		$('.slider').flexslider();
	});


	// JCAROUSEL
	if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/Blackberry/i)) {
		$(".recentProjects").hide();
	}
	else {
		$('#mycarousel').jcarousel({
	    	wrap: 'circular'
	    });
	}
 
	// TWEETABLE
	if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/Blackberry/i)) {
		$("div.tweetable").hide();
	}
	else {
		$('div.tweetable').tweetable({username: 'phixarmedia', time: false, limit: 1, replies: true, position: 'append'});
	}

	// NEWSLETTER POPUP
	$('.popup').click(function() {
	  $('#subscribe').toggle('slow', function() {
	  });
	});
	
	// MENU TOGGLE
	$('.menuToggle').click(function() {
	  $('#menu').toggle();
	});
});
