/********************************************************************
Initialise background and set up scroll for iPad and iPhone, Cufon
********************************************************************/

/************* CUFON **********/

Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');	
Cufon.replace('h4');
Cufon.replace('nav ul.menu li a', {hover: 'true'});
Cufon.replace('.large');
	
/************* SLIDE UP FOOTER **********/

/*jQuery(function($) {
		var slide = false;
		var height = $('#footer_content').height();
		$('#footer_button').click(function() {
			var docHeight = $(document).height();
			var windowHeight = $(window).height();
			var scrollPos = docHeight - windowHeight + height;
			$('#footer_content').animate({ height: "toggle"}, 500);
			if(slide == false) {
				if($.browser.opera) {
					$('html').animate({scrollTop: scrollPos+'px'}, 500);
				} else {
					$('html, body').animate({scrollTop: scrollPos+'px'}, 500);
				}
				slide = true;
			} else {
				slide = false;
			}
		});
	});

*/

jQuery(function($) {
	var slide = false;
	var height = $('#footer_content').height();
	$('#footer_button').click(function() {
		var docHeight = $(document).height();
		var windowHeight = $(window).height();
		var scrollPos = docHeight - windowHeight + height;
		$('#footer_content').animate({ height: "toggle"}, 1000);
		if(slide == false) {
			if($.browser.opera) { //Fix opera double scroll bug by targeting only HTML.
				$('html').animate({scrollTop: scrollPos+'px'}, 1000);
			} else {
				$('html, body').animate({scrollTop: scrollPos+'px'}, 1000);
			}
                               slide = true;
		} else {
                               slide = false;
                       }
	});
});

