function ViewMap(aLink, aEvent)
{
	vWindow=window.open("/tools/mapviewer/Frames.html#" + encodeURIComponent(aLink.href), "MapViewer");
	if (vWindow)
	{
		if (aEvent.stopPropagation) aEvent.stopPropagation(); else aEvent.cancelBubble = true;
		if (aEvent.preventDefault) aEvent.preventDefault(); else aEvent.returnValue = false;
		vWindow.focus();
	}
}

function ViewArt(aLink, aEvent)
{
	vWindow=window.open("/tools/artviewer/Frames.html#" + encodeURIComponent(aLink.href), "ArtViewer");
	if (vWindow)
	{
		if (aEvent.stopPropagation) aEvent.stopPropagation(); else aEvent.cancelBubble = true;
		if (aEvent.preventDefault) aEvent.preventDefault(); else aEvent.returnValue = false;
		vWindow.focus();
	}
}

function ViewBook(aLink, aEvent)
{
	vWindow=window.open("/tools/bookviewer/Frames.html#" + encodeURIComponent(aLink.href), "BookViewer");
	if (vWindow)
	{
		if (aEvent.stopPropagation) aEvent.stopPropagation(); else aEvent.cancelBubble = true;
		if (aEvent.preventDefault) aEvent.preventDefault(); else aEvent.returnValue = false;
		vWindow.focus();
	}
}

function BrowserDetect()
{
	var ua = navigator.userAgent.toLowerCase(); 
	this.isIE = ua.indexOf('msie') != -1 && ua.indexOf('omniweb') == - 1 && ua.indexOf('webtv') == -1; 
	this.isWin = ua.indexOf('win') != -1;
	this.isMac    = (ua.indexOf("mac") != -1);
	this.pngAlpha = !this.isIE && !this.isWin;
	this.pngNone = this.isIE && this.isMac;
}
var kBrowser = new BrowserDetect();

function FixImageAlphas()
{
	var vFind = new RegExp("/images/(gray|white)/");
	for (var vIndex = 0; vIndex < document.images.length; vIndex++)
		document.images[vIndex].src = document.images[vIndex].src.replace(vFind, "/images/alpha/");
}
if (kBrowser.pngAlpha)
	FixImageAlphas();

function FixImagePNGs()
{
	var vFind = new RegExp("(\.png)");
	for (var vIndex = 0; vIndex < document.images.length; vIndex++)
		document.images[vIndex].src = document.images[vIndex].src.replace(vFind, ".jpg");
}
if (kBrowser.pngNone)
	FixImagePNGs();

function MailTo(aEvent, aMailBox)
{
	if (aEvent.stopPropagation) aEvent.stopPropagation(); else aEvent.cancelBubble = true;
	if (aEvent.preventDefault) aEvent.preventDefault(); else aEvent.returnValue = false;
	var vAddress = xMail + xTo + aMailBox + xAt + xSimmons + xGames;
	window.location.href = vAddress;
}

var xAt = "@";
var xGames = "games.com";
var xHidden = '<span class="Obfuscate">info</span>';
var xMail = "mail";
var xSalesMailBox="salesinfo";
var xSimmons = "simmons";
var xSupportMailBox="supportinfo";
var xTo = "to:";
var xWebMasterMailBox="webmasterinfo";
var xFind = new RegExp("info");
var xSalesMailBox = xSalesMailBox.replace(xFind, "");
var xSupportMailBox = xSupportMailBox.replace(xFind, "");
var xWebMasterMailBox = xWebMasterMailBox.replace(xFind, "");

if (location.pathname.search(/^\/tools\//) < 0)
{
	document.write('<div class="Footer">');
	document.write('<p class="FeedBack">For questions regarding sales and orders, write ');
	document.write('<a href="" onclick="MailTo(event, xSalesMailBox);">');
	document.write(xSalesMailBox + xHidden + xAt + xSimmons + xGames + '</a>');
	document.write('</p>');
	document.write('<p class="FeedBack">For questions regarding products, write ');
	document.write('<a href="" onclick="MailTo(event, xSupportMailBox);">');
	document.write(xSupportMailBox + xHidden + xAt + xSimmons + xGames + '</a>');
	document.write('</p>');
	document.write('<p class="FeedBack">For website feedback, write ');
	document.write('<a href="" onclick="MailTo(event, xWebMasterMailBox);">');
	document.write(xWebMasterMailBox + xHidden + xAt + xSimmons + xGames + '</a>');
	document.write('</p>');
	document.write('<p class="FeedBack">Address: <b>837 Orange Ave., Sunnyvale, CA, 94087</b></p>');
	document.write('<p class="FeedBack">Phone: <b>408-242-3282</b></p>');
	document.write('<p class="Border">                   </p>');
	document.write('<p class="Copyright">Copyright © 2005-2009 Simmons Games.</p>');
	document.write('</div');
}

