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

// Reveal.js
$(document).ready(function(){
	$('#menu-item-295 a').click(function(e) { //Contact menu button
		e.preventDefault();
		$('#contact').reveal();
	});
	$('#menu-item-194 a').click(function(e) { //Free consultation menu button
		e.preventDefault();
		$('#contact').reveal();
	});
});

$(function(){
	// Slider
	// Set starting slide to 1
	var startSlide = 1;
	// Get slide number if it exists
	if (window.location.hash) {
		startSlide = window.location.hash.replace('#','');
	}
	// Initialize Slides
	$('#slides').slides({
		preload: false,
		preloadImage: 'img/loading.gif',
		generatePagination: true,
		// Get the starting slide
		start: startSlide,
		animationComplete: function(current){
			// Set the slide number as a hash
			window.location.hash = '#' + current;
		}
	});
});

// Forms
// simpleValidate.js
$(document).ready(function() {
	$('form.required-form').simpleValidate({
	  ajaxRequest: true,
	  completeCallback: function($el) {
      var formData = $el.serialize();
			$.ajax({  
			  type: "POST",  
			  url: "http://www.orderuporganizing.com/wp/wp-content/themes/Less320/process.php",  
			  data: formData, 
			  success: function() {  
				$('#contact').html("<div id='success'></div>");  
				$('#success').html("<h2>Success!<br> Thank you for your message.</h2>")  
				.append("<p>We will be in touch soon.</p><a class='close-reveal-modal'>&#215;</a>")  
				.hide()  
				.fadeIn(500, function() {  
				  $('#success').append("");  
				});  
			  }  
			});  
			return false;  

	  }
	});
});


// To test the @id toggling on password inputs in browsers that don't support changing an input's @type dynamically (e.g. Firefox 3.6 or IE), uncomment this:
// jQuery.fn.hide = function() { return this; }
// Then uncomment the last rule in the <style> element (in the <head>).
$(function() {
	// Invoke the plugin
	$('input[placeholder], textarea[placeholder]').placeholder();
});


/*$(document).ready(function() {
	$('.click-area').clickable();
});*/
