/*=============================================================================
TITLE:			Standard Utility Library
VERSION:		2006.01.15
AUTHOR: 		NetMediaOne - www.netmediaone.com
=============================================================================*/

var minWidth = 440;
var maxWidth = 720;

function imgOn( img )
{
	$(img).src = 	$(img).src.replace( "off.", "on." );
}

function imgOff( img )
{
	$(img).src = 	$(img).src.replace( "on.", "off." );
}

function sizeContent()
{
	var contentWrapper = $("contentWrapper");
	var currentWidth = getViewportWidth() - 300;
	if ( currentWidth < minWidth )
	{
		contentWrapper.style.width = minWidth + "px";
	}
	else if ( currentWidth > maxWidth )
	{
		contentWrapper.style.width = maxWidth + "px";
	}
	else
	{
		contentWrapper.style.width = (currentWidth -20 ) + "px";
	}
}

function getViewportWidth()
{
  var width = 0;
  if ( document.documentElement && document.documentElement.clientWidth )
	{
    width = document.documentElement.clientWidth;
  }
  else if ( document.body && document.body.clientWidth )
	{
    width = document.body.clientWidth;
  }
  else if ( window.innerWidth )
	{
    width = window.innerWidth - 18;
  }
  return width;
};

function showMap( url, width, height )
{
	var mapWin = window.open( url, "mapWin", "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height +",left=" + ((screen.width - width) / 2) + ",top=" + ((screen.height - height) / 2) );
	mapWin.focus();
}

//Event.observe( window, "load", sizeContent, false );
//Event.observe( window, "resize", sizeContent, false );

