var width = 600;
var height = 550;
var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
var dialogWin = new Object( );

function winPop(id)
{
	var url = subdomain+'index.php?editfeatured='+id;
	if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed))
	{
		// Initialize properties of the modal dialog object.
		dialogWin.url = url;
		dialogWin.width = width;
		dialogWin.height = height;
		dialogWin.returnedValue = "";
		// Keep name unique.
		dialogWin.name = (new Date( )).getSeconds( ).toString( );
		// Assemble window attributes and try to center the dialog.
		if (window.screenX)
		{   // Navigator 4+
			// Center on the main window.
			dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
			dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
			var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + ",location=no,scrollbars=1,resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height;
		}
		else if (window.screenLeft)
		{    // IE 5+/Windows 
			// Center (more or less) on the IE main window.
			// Start by estimating window size, 
			// taking IE6+ CSS compatibility mode into account
			var CSSCompat = (document.compatMode && document.compatMode != "BackCompat");
			window.outerWidth = (CSSCompat) ? document.body.parentElement.clientWidth : document.body.clientWidth;
			window.outerHeight = (CSSCompat) ? document.body.parentElement.clientHeight :  document.body.clientHeight;
			window.outerHeight -= 80;
			dialogWin.left = parseInt(window.screenLeft + ((window.outerWidth - dialogWin.width) / 2));
			dialogWin.top = parseInt(window.screenTop + ((window.outerHeight - dialogWin.height) / 2));
			var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",location=no,scrollbars=1,resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height;
		}
		else
		{   // all the rest
			// The best we can do is center in screen.
			dialogWin.left = (screen.width - dialogWin.width) / 2;
			dialogWin.top = (screen.height - dialogWin.height) / 2;
			var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",location=no,scrollbars=1,resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height;
		}
		// Generate the dialog and make sure it has focus.
		dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr);
		dialogWin.win.focus( );
		
	}
	else
	{
		dialogWin.win.focus( );
	}
}

function featuredPop(state, county, city)
{
	var url = subdomain+'featured.php?state='+state+'&county='+county+'&city='+city;
	if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed))
	{
		// Initialize properties of the modal dialog object.
		dialogWin.url = url;
		dialogWin.width = 600;
		dialogWin.height = height;
		dialogWin.returnedValue = "";
		// Keep name unique.
		dialogWin.name = (new Date( )).getSeconds( ).toString( );
		// Assemble window attributes and try to center the dialog.
		if (window.screenX)
		{   // Navigator 4+
			// Center on the main window.
			dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
			dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
			var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + ",location=no,scrollbars=1,resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height;
		}
		else if (window.screenLeft)
		{    // IE 5+/Windows 
			// Center (more or less) on the IE main window.
			// Start by estimating window size, 
			// taking IE6+ CSS compatibility mode into account
			var CSSCompat = (document.compatMode && document.compatMode != "BackCompat");
			window.outerWidth = (CSSCompat) ? document.body.parentElement.clientWidth : document.body.clientWidth;
			window.outerHeight = (CSSCompat) ? document.body.parentElement.clientHeight :  document.body.clientHeight;
			window.outerHeight -= 80;
			dialogWin.left = parseInt(window.screenLeft + ((window.outerWidth - dialogWin.width) / 2));
			dialogWin.top = parseInt(window.screenTop + ((window.outerHeight - dialogWin.height) / 2));
			var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",location=no,scrollbars=1,resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height;
		}
		else
		{   // all the rest
			// The best we can do is center in screen.
			dialogWin.left = (screen.width - dialogWin.width) / 2;
			dialogWin.top = (screen.height - dialogWin.height) / 2;
			var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",location=no,scrollbars=1,resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height;
		}
		// Generate the dialog and make sure it has focus.
		dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr);
		dialogWin.win.focus( );
		
	}
	else
	{
		dialogWin.win.focus( );
	}
}
