var newurl = location.href;
newurl = newurl.replace("http://localhost/","/?");
newurl = newurl.replace("http://205.118.75.3/","/?");
newurl = newurl.replace("http://santaquin.org/","/?");
newurl = newurl.replace("http://www.santaquin.org/","/?");
if (newurl == "/?apps/header.asp") newurl = "/";
if (newurl == "/?apps/footer.asp") newurl = "/";
if (newurl == "/?apps/menu.asp") newurl = "/";
if (newurl == "/?home.asp") newurl = "/";
if ((window == top) & (window.name != "printpage")) top.location.href = newurl;

function printpage()
	{
	var pageURL = top.main.location.href;
	var attribs = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=400";
	window.open(pageURL,"printpage",attribs);
	}

function bookmark()
	{
	bookmarkURL = top.main.location.href;
	bookmarkURL = bookmarkURL.replace("http://205.118.75.3","http://www.santaquin.org")
	bookmarkURL = bookmarkURL.replace("http://localhost","http://www.santaquin.org")
	bookmarkURL = bookmarkURL.replace("http://santaquin.org","http://www.santaquin.org")
	bookmarkURL = bookmarkURL.replace("www.santaquin.org/","www.santaquin.org/?")

	bookmarkTitle = bookmarkURL.replace("http://www.santaquin.org/?","Santaquin City Website - ")
	bookmarkTitle = bookmarkTitle.replace(".asp","")
	bookmarkTitle = bookmarkTitle.replace("/"," - ")
	bookmarkTitle = bookmarkTitle.replace(" a"," A")
	bookmarkTitle = bookmarkTitle.replace(" b"," B")
	bookmarkTitle = bookmarkTitle.replace(" c"," C")
	bookmarkTitle = bookmarkTitle.replace(" d"," D")
	bookmarkTitle = bookmarkTitle.replace(" e"," E")
	bookmarkTitle = bookmarkTitle.replace(" f"," F")
	bookmarkTitle = bookmarkTitle.replace(" g"," G")
	bookmarkTitle = bookmarkTitle.replace(" h"," H")
	bookmarkTitle = bookmarkTitle.replace(" i"," I")
	bookmarkTitle = bookmarkTitle.replace(" j"," J")
	bookmarkTitle = bookmarkTitle.replace(" k"," K")
	bookmarkTitle = bookmarkTitle.replace(" l"," L")
	bookmarkTitle = bookmarkTitle.replace(" m"," M")
	bookmarkTitle = bookmarkTitle.replace(" n"," N")
	bookmarkTitle = bookmarkTitle.replace(" o"," O")
	bookmarkTitle = bookmarkTitle.replace(" p"," P")
	bookmarkTitle = bookmarkTitle.replace(" q"," Q")
	bookmarkTitle = bookmarkTitle.replace(" r"," R")
	bookmarkTitle = bookmarkTitle.replace(" s"," S")
	bookmarkTitle = bookmarkTitle.replace(" t"," T")
	bookmarkTitle = bookmarkTitle.replace(" u"," U")
	bookmarkTitle = bookmarkTitle.replace(" v"," V")
	bookmarkTitle = bookmarkTitle.replace(" w"," W")
	bookmarkTitle = bookmarkTitle.replace(" x"," X")
	bookmarkTitle = bookmarkTitle.replace(" y"," Y")
	bookmarkTitle = bookmarkTitle.replace(" z"," Z")

	bookmarkTitle = bookmarkTitle.replace(" - Default"," - ")
	bookmarkTitle = bookmarkTitle.replace("Announce","Announcements")
	bookmarkTitle = bookmarkTitle.replace("Economic","Economic Development")
	bookmarkTitle = bookmarkTitle.replace("Pubsafety","Public Safety")
	bookmarkTitle = bookmarkTitle.replace("Pubworks","Public Works")

	if (bookmarkURL == "http://www.santaquin.org/?home.asp") { bookmarkURL = "http://www.santaquin.org"; }
	//Check to see if the requesting client is IE, if so use javascript to add the "Favorite".
	if (navigator.appName == "Microsoft Internet Explorer")
		{
		// Bring up the add bookmark dialogue.
		window.external.AddFavorite(bookmarkURL,bookmarkTitle);
		return;
		}
	else //the client must not be IE, check to see if it is Netscape.
	if (parseInt(navigator.appVersion) >= 4)
		{
		//Open a window with a URL to the document which will work externally and prompt the user to bookmark.
		alert('A new window will now be opened.  Please press CTRL-D or choose\rBookmarks | Add Bookmark from within the new window to bookmark this page.');
		window.open(bookmarkURL);
		return;
		}
	//The browser client must be something besides IE or Netscape.
	alert('You are not using Internet Explorer or Netscape Navigator. I cannot bookmark this page automatically for you.');
	window.open(bookmarkURL);
	}
