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);
}
}

// Manage the contact toggles.
$('#walden, #poughkeepsie, #warwick').hide();
if(window.location.hash) {
	$(window.location.hash).show();
	$('.toggles a[href="'+window.location.hash+'"]').addClass('toggled');
}
$('.toggles a').click(function(event) {
	event.preventDefault();
	var id = $(this).attr('href');
	window.location.hash = id;
	$('#walden, #poughkeepsie, #warwick').hide();
	$(id).show();
	$('.toggles a').removeClass('toggled');
	$(this).addClass('toggled');
});
