/*
	Script by Brendon Irwin
	Sandbox Software Solutions
	January 2012
*/
$(function(){
	if ( (navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1) ){
	
		$('.SiteBody').addClass('iDevice');
			
		function BlockMove(event) {// Tell Safari not to move the window.
			  event.preventDefault() ;
		}
		
		window.onorientationchange = detectIPadOrientation; 
		function detectIPadOrientation()
		{ 
			//window.alert("orientation change");
			//window.alert( orientation );
			if ( orientation == 0 || orientation == 180 ) 
			{  
				$('.SiteBody').addClass('portrait');
				$('.SiteBody').removeClass('landscape');
				$('.SiteBody').attr('content','user-scalable=no, width=device-width, minimum-scale = 1.0, maximum-scale = 1.0');
				$('#HomePageSlider').width(1024);
				
			}  
			else if ( orientation == 90 || orientation == -90  ) 
			{  	
				$('.SiteBody').removeClass('portrait');
				$('.SiteBody').addClass('landscape');
				$('.SiteBody').attr('content','user-scalable=no, width=device-width, minimum-scale = 1.0, maximum-scale = 1.0');
				$('#HomePageSlider').width(1024);
			}   
		}  //end detect orientation
		detectIPadOrientation();

	}
});
