function iphoneNav()
{
	var displayOrientation = "Landscape";
	
	

	// INIT --------------------------------------
	
	this.init = function()
	{
		IphoneEvent(); 
	}
	
	
	// IPHONE--------------------------------------
	
	function IphoneEvent()
	{

  		if( IPHONE ) 
		{	
			cssIphone();
			//IphoneTouch();
		}
		
		if( IPAD ) 
		{
			cssIpad();
			//IphoneTouch();
		}

	}
	
	
	// TOUCH --------------------------------------
	
	function IphoneTouch ()
	{					
			var	originalCoord = { x: 0, y: 0 };
			var	finalCoord = { x: 0, y: 0 };
			var	movTouch = { x: 30, y: 50 };
			
			setTimeout( scrollTo,0,0,1 );
			document.addEventListener("touchstart", touch_start, false);
			document.addEventListener("touchmove", touch_move, false);
			document.addEventListener("touchend", touch_end, false);
			document.addEventListener("touchcancel", touch_cancel, false);
			document.addEventListener("gesturechange", touch_change, false);

			function touch_start(event) 
			{
				originalCoord.x = event.targetTouches[0].pageX;
				originalCoord.y = event.targetTouches[0].pageY;
			}
			
			function touch_move(event) 
			{	
				finalCoord.x = event.targetTouches[0].pageX // Updated X,Y coordinates
				finalCoord.y = event.targetTouches[0].pageY
				
				//alert(event.targetTouches[0].pageY);
			}

			function touch_end(event) 
			{
				changeY = originalCoord.y - finalCoord.y;
				changeX = originalCoord.x - finalCoord.x;
			
							 
				if(changeY < movTouch.y && changeY > ( movTouch.y * (-1) )) {
					
					changeX = originalCoord.x - finalCoord.x
				
					if( changeX > movTouch.x )
					{
						if( pageCurrent != "contact" )
						$('body').trigger( 'changePageIphone', ["right"] );
					}
					
					
					if( changeX < ( movTouch.x * (-1) ) )
					{
						if( pageCurrent != "home" )
						$('body').trigger( 'changePageIphone', ["left"] );
					}
					

				
				}
				
				//
			}
			
			function touch_cancel(event) 
			{ 


			}
			
			function touch_change(event) 
			{ 
				
				//$( '#clip_controllers' ).css('top', document.documentElement.clientHeight/2 );
				//this.scaleIpod = event.scale;
				//event.preventDefault();
			}
	}
	
	// CSS IPHONE/IPAD ----------------------------------------------------------------
	
	function cssIphone()
	{	
		// CSS IPAD
		$( '#homeintro_home img' ).attr("src" , "include/images/home.png");
		$( '#homeintro_home img' ).css("height", "450");
		$( '#homeintro_home img' ).css("width", "900");
		
		$( '#homeintro_artistsanddesigners img' ).attr("src" , "include/images/artistsanddesigners-01.png");
		$( '#homeintro_artistsanddesigners img' ).css("height", "250");
		$( '#homeintro_artistsanddesigners img' ).css("width", "900");
		
		$( '#homeintro_clients img' ).attr("src" , "include/images/clients-01.png");
		$( '#homeintro_clients img' ).css("height", "250");
		$( '#homeintro_clients img' ).css("width", "900");
		
		//
		$( '#homeintro_contact img' ).attr("src" , "include/images/contact-01.png");
		$( '#homeintro_contact img' ).css("height", "250");
		$( '#homeintro_contact img' ).css("width", "900");
		
	}
	
	function cssIpad()
	{	
		// CSS IPAD
		$( '#homeintro_home img' ).attr("src" , "include/images/home.png");
		$( '#homeintro_home img' ).css("height", "450");
		$( '#homeintro_home img' ).css("width", "900");
		
		//
		$( '#homeintro_artistsanddesigners img' ).attr("src" , "include/images/artistsanddesigners-01.png");
		$( '#homeintro_artistsanddesigners img' ).css("height", "250");
		$( '#homeintro_artistsanddesigners img' ).css("width", "900");
		
		//
		$( '#homeintro_clients img' ).attr("src" , "include/images/clients-01.png");
		$( '#homeintro_clients img' ).css("height", "250");
		$( '#homeintro_clients img' ).css("width", "900");
		
		//
		$( '#homeintro_contact img' ).attr("src" , "include/images/contact-01.png");
		$( '#homeintro_contact img' ).css("height", "250");
		$( '#homeintro_contact img' ).css("width", "900");
		

	}
	
	//--------------------------------------
	// FOOTER POS
	//--------------------------------------
	
	this.footerPosition = function()
	{
		//Tipo de orientaçao
		updateOrientation();
		
		if( IPHONE ) 
		{
			window.setTimeout(function()
			{	
				//
				var heightCurrent = parseInt( $( "#"+pageCurrent ).css( 'height') );
				var heightFooter = parseInt( $( '#footer' ).css( 'height') );
				$( '#footer' ).css(  'opacity', '0' );
				$( '#footer' ).css(  'display', 'inline' );
				
				var posFooter = (heightCurrent - heightFooter)+200;
				
				//
				$( '#footer' ).animate({ 'top':posFooter , filter:'', 'opacity': 1  }, 300, 'easeOutCubic' );
			}, 
			400);
		}
	}
	
	//--------------------------------------
	// FOOTER POS
	//--------------------------------------
	
	
	function updateOrientation()
	{
		switch(window.orientation)
		{
			case 0:
				displayOrientation = "Landscape";
			break;

			case -90:
				displayOrientation = "Portrait";
			break;

			case 90:
				displayOrientation = "Portrait";
			break;

			case 180:
				displayOrientation = "Landscape";
			break;

		}
		
	}
}	

