/*	WEBSITE.JS
	Site:	Magazine.TM
	Note:	This is where general javascript/jquery for the website is defined/executed.

	--------------------------------------------------------------------------------------------------------------------
	FILE INFO
	Revision number:  1.0
	Last updated:     02/05/2011
	Last updated by:  John King
	-------------------------------------------------------------------------------------------------------------------- */
		
	//- on page load
	
	// Return boolean TRUE/FALSE if iPhone or iPod
	function isiPhone(){
		return (
			(navigator.platform.indexOf("iPhone") != -1) ||
			(navigator.platform.indexOf("iPod") != -1) ||
			(navigator.platform.indexOf("iPad") != -1)
		);
	}

	$( document ).ready( function() {

		//- set footer animation boolean
		footer = false;
		
		//- footer animation
		if (!isiPhone()){
			$( window ).scroll( function () {	
				if ( !footer && $( window ).scrollTop() > 200 ) $( 'footer#page' ).animate( { bottom:'0px' }, 300, function() { footer = true } );
				if ( footer && $( window ).scrollTop() < 200 ) $( 'footer#page' ).animate( { bottom:'-173px' }, 300, function() { footer = false } );
			} );
		};
			
	} );

