    var name = "#iPhone";
    var menuYloc = null;
	var topOfFooter = null;
	var bottomOfHeader = null;
	
	
    $(document).ready(function(){
        menuYloc = 0//parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
		topOfFooter = $(document).height() - $("#footer").height();
		bottomOfHeader = $("#header").height();
        $(window).scroll(function () { 
            var offset = menuYloc+$(document).scrollTop()+"px";
			var iPhoneBottom = parseInt(offset.substring(0,offset.indexOf("px")))+ $(name).height();
			var iPhoneTop = parseInt(offset.substring(0,offset.indexOf("px")));
			if(iPhoneBottom > topOfFooter){
				offset = (topOfFooter - $(name).height()) + "px";
			}
			if(iPhoneTop < bottomOfHeader){
				offset = bottomOfHeader + "px";
			}
            $(name).animate({top:offset},{duration:500,queue:false});
        });
    }); 
	
	
	jQuery.preloadImages = function(){
  		for(var i = 0; i<arguments.length; i++){
    		jQuery("<img>").attr("src", arguments[i]);
  		}
	}
