/*
	Function name: Get ViewPort Width
		   Params: -
		  Returns: /integer/ Viewport width in pixels
*/

function getVpWidth() {
var x;
	if (self.innerHeight) {
		// all except Explorer
		x = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
	} else if (document.body) {
		// other Explorers
		x = document.body.clientWidth;
	}
	return x;
}

/*
	Function name: Set MinWidth
		   Params: /integer/ minWidth - minimum width to set on the elementToSet
				   /string/ elementToSet - ID of the element to set minWidth on.
		  Returns: -
*/

function setMinWidth( /* integer */ minWidth, /* string */ elementToSet ) {
	var element = document.getElementById(elementToSet);
	if (element.currentStyle) {
		if (element.currentStyle.marginRight != "auto") {
			mRight = parseInt(element.currentStyle.marginRight);
		} else {
			mRight = 0;
		}
		if (element.currentStyle.marginLeft != "auto") {
			mLeft = parseInt(element.currentStyle.marginLeft);
		} else {
			mLeft = 0;
		}
		margins = mLeft + mRight;
		window.status = margins;
		if ( getVpWidth() <= minWidth ) {
			element.style.width = (minWidth - margins) + "px";
		} else if ( getVpWidth() > minWidth  ) {
			window.status=margins;
			element.style.width = "auto";
		}
	}
}
