﻿/* Old file 
$(function (){
	var footer = new DCHomeFooter ();
	$(window).resize (function () {
		footer.reposition ();
	});

	footer.reposition ();
	
	setTimeout(function () {
		footer.expand (1000);
	}, 1000);
	
});

var DCHomeFooter = function () {
	var _self = this;
	var win = $(window);
	this.open = false;
	
	var footerCont = $('<div id="footerCont" />');
	var footerHolder = $('#footer-holder');
	var content = $('#content');
	var body = $('body');
	var footerY = 0;
	
	footerHolder.remove();
	content.remove();
	footerCont.append(content).append(footerHolder);
	$('#main').append(footerCont);
	
	// var minHeight = 820;
	var minHeight = 1010;
	
	var footerContOffHeight = -footerCont.outerHeight() + $('#showMorePhotoButton').parent().outerHeight();
	footerCont.css('bottom', footerContOffHeight);
	
	$('#showMorePhotoButton').toggle(function () {
		_self.close (500);
	}, function () {
		_self.expand (500);
	});
	
	this.expand = function (speed) {
		$('#showMorePhotoButton').text('Show more photo');
		_self.open = true;
		_self.setMainHeight ();
		_self.checkOverflow();
		footerCont.animate({ bottom: footerY }, speed, function () { _self.reposition(); });
	}
	
	this.close = function (speed) {
		$('#showMorePhotoButton').text('Show less photo');
		_self.open = false;
		footerCont.animate({ bottom: footerContOffHeight }, speed, function () { _self.reposition(); });
	}
	
	this.reposition = function (init) {
		var offset = 0;
		footerY = (win.height() < minHeight) ? -offset : 0;
		
		if ( _self.open ) {
			_self.setMainHeight ();
			_self.checkOverflow ();
			footerCont.css({bottom: footerY});
		} else {
			$('#main').css ('height', win.height());	
		}
	}
	
	this.setMainHeight = function () {
		var mainH = Number ($('#main').css('height').replace('px', ''));
		var bh = (win.height() <= minHeight) ? minHeight : win.height();
		$('#main').css ('height', bh);
	}
	
	this.checkOverflow = function (wh) {
		body.css('overflow-y', (win.height() < minHeight) ? 'auto' : 'hidden');
	}
	
	
	$('#footer-holder').mouseenter(function () {
        $('#footerBg').stop(true, true);
        $('#footerBg').animate({ opacity: 1 }, 400);
    });
    $('#footer-holder').mouseleave(function () {
        $('#footerBg').stop(true, true);
        $('#footerBg').animate({ opacity: 0.8 }, 400);
    });
	
}
*/
