SITE = {
};

SITE.CONSTS = {
	speedResize: 250,
	textTitleBlank: 'This link will open in a new window'
};

SITE.VARS = {
	heightInitial: 0,
	heightNew: 0,
	timeoutResizing: false,
	widthInitial: 0,
	widthNew: 0
};

$(function() {
});

$(document).ready(function() {
	SITE.VARS.widthInitial = $(window).width();
	SITE.VARS.heightInitial = $(window).height();	
	LIBRARY.addTargetAttribute('targetBlank', '_blank', SITE.CONSTS.textTitleBlank);
	LIBRARY.prepopulateFieldsText('fieldPrepopulate_');
	LIBRARY.bindFieldsRequired('fieldPrepopulate_', 'fieldRequired', '#f5762b', '#666666');
});

$(window).load(function() {
	SITE.GENERIC.positionFooter();
});

$(window).resize(function() {
	SITE.VARS.widthNew = $(window).width();
	SITE.VARS.heightNew = $(window).height();
	if ((SITE.VARS.widthNew != SITE.VARS.widthInitial) || (SITE.VARS.heightNew != SITE.VARS.heightInitial)) {
		if(SITE.VARS.timeoutResizing !== false) {
		  clearTimeout(SITE.VARS.timeoutResizing);
		}
		SITE.VARS.timeoutResizing = setTimeout("SITE.RESIZE.initialise()", SITE.CONSTS.speedResize);
	}
});

// *******************************************************************************************

SITE.GENERIC = {
	positionFooter: function() {
		/*$('.pageTop').css({
			height: 'auto'
		});
		var heightWindow = SITE.VARS.heightInitial;
		var heightTop = LIBRARY.getTotalHeight($('.pageTop'));
		var heightBottom = LIBRARY.getTotalHeight($('.pageBottom'));
		var heightDifference = heightWindow - (parseInt(heightTop) + parseInt(heightBottom));

		if (heightDifference > 0) {
			$('.pageTop').css({
				height: (parseInt($('.pageTop').height()) + parseInt(heightDifference)) + 'px'
			});
		}*/
		$('.pageBottom').css({
			visibility: 'visible'
		});
	}
};

// *******************************************************************************************

SITE.RESIZE = {
	initialise: function() {
		SITE.VARS.widthInitial = SITE.VARS.widthNew;
		SITE.VARS.heightInitial = SITE.VARS.heightNew;
		SITE.GENERIC.positionFooter();
	}
};

// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************
// *******************************************************************************************

