function f_open_window_max( aURL, aWinName, aMessage ) {
   if ( aMessage != '' )
	   alert(aMessage);

   var wOpen;
   var sOptions;

   var width = screen.availWidth;
   var height = screen.availHeight;
   if ( width > 1280 )
   	 width = 1280;
   if ( height > 1024 )
   	 height = 1024;
   sOptions = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1';
   sOptions = sOptions + ',width=' + (width - 10).toString();
   sOptions = sOptions + ',height=' + (height - 122).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

   wOpen = window.open( '', aWinName, sOptions );
   wOpen.location = aURL;
   wOpen.focus();
   wOpen.moveTo( 0, 0 );

   wOpen.resizeTo( width, height );
   return wOpen;
}

function popUp(URL, Message) {
   	var wOpen;
   	var sOptions;
   
   	if (readCookie('TermsOfUse') == null ) {
		alert('You must first agree to the GIS Disclaimer before viewing this map.');
		// redirect to disclaimer
		window.location = 'disclaimer.aspx';
	} else {
		// open the popup
		day = new Date();
		id = day.getTime();
		f_open_window_max( URL, id.toString(), Message );
	}
}

function checkDisclaimer() {
	
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

