/****************************************************
*													*
*		Resizer for positioning an absolute			*
*		div - conatiner at the middle of			*
* 		the viewport								*
*													*
****************************************************/
/**
 *
 * Version 1 @ 19.10.07
 *
 *******************************************/


if (typeof containerId == "string") {
	
	// Global Vars
	var windowHeight = 0;
	var windowWidth = 0;
	var containerHeight = 0;
	var containerWidth = 0;
	
	$(document).ready(function(){
		
		// Assign Start Vars
		windowHeight = $(window).height();
		windowWidth = $(window).width();
		containerHeight = $('#' + containerId).height();
		containerWidth = $('#' + containerId).width();
		
		
		// set some properties on load
		positioner();
		
		// Assign a function to resize event for setting the properties
		$(window).resize(function () {
			windowHeight = $(window).height();
			windowWidth = $(window).width();
			positioner();
		});
	});
}

function positioner() {
	return;
	var marginCount = 0;
	
	if (windowHeight <= containerHeight + 5 ) {
		$('#' + containerId).css({ top: "5px", marginTop: "0" });
	} else {
		marginCount = (containerHeight / 2) * -1;
		if (isOnLoad == false) $('#' + containerId).css({ top: "50%", marginTop: marginCount + "px" });
	}
					
	if (windowWidth <= containerWidth + 5 ) {
		$('#' + containerId).css({ left: "5px", marginLeft: "0" });
	} else {
		marginCount = (containerWidth / 2) * -1;
		if (isOnLoad == false) $('#' + containerId).css({ left: "50%", marginLeft: marginCount + "px" });
	}
}