/*

ISLAND INN MONHEGAN

Global JavaScript Actions

Version 1.0a
Author: futurepruf.com

*/


$(document).ready(function() {
	
	  // Background resizer
	  if($.browser.safari) {
	    var img = $('#background img');
	    img.load(function() {
	      var o = {
	        width: img.width(),
	        height: img.height(),
	        p: img.width()/img.height()
	      };

	      $(window).resize(function() {
	        var self = $(this);
	        var width = self.width();
	        var height = self.height();
	        img.css({
	          width: (y = (width > (x = Math.round(height * o.p)))) ? width : x,
	          height: (y ? Math.round(width / o.p) : height)
	        });
	      });
	      $(window).trigger('resize');
	    });
	  }

	//fade in action
	setTimeout(function () { $("#content, #content p, #footer").fadeIn(); }, 1000);

	// close button
	$("div.close").click(function () {
		$("#content, #footer").fadeOut();
	});

});
