/////////////////////////////////////////////////////////////////////////////////////
//	Purpose:		Sniffs for Mac and IE and alerts user to change
//	Last Edited:	6/11/2004, Some guy.  <~Thanks guy, Nando
/////////////////////////////////////////////////////////////////////////////////////
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;
if (checkIt('konqueror'))
{
        browser = "Konqueror";
        OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari";
else if (checkIt('omniweb')) browser = "OmniWeb";
else if (checkIt('opera')) browser = "Opera";
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab";
else if (checkIt('msie')) browser = "Internet Explorer";
else if (!checkIt('compatible'))
{
        browser = "Netscape Navigator";
        version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
        if (checkIt('linux')) OS = "Linux";
        else if (checkIt('x11')) OS = "Unix";
        else if (checkIt('mac')) OS = "Mac";
        else if (checkIt('win')) OS = "Windows";
        else OS = "an unknown operating system";
}

function checkIt(string)
{
        place = detect.indexOf(string) + 1;
        thestring = string;
        return place;
} 	

//Check for IE and Mac combo 
if ( (browser == "Internet Explorer") && (OS == "Mac") )  {
	alert("This site exhibits known problems in the browser-OS combination we have detected: Internet Explorer on the Mac. We recommend the latest versions of Safari or Firefox.");
}


// GPlus Script



/*****************************************
  Scriptable Image Maps by Danny Goodman (www.dannyg.com)
  A bonus recipe for readers of O'Reilly's
    "JavaScript & DHTML Cookbook"
  This recipe first published at O'Reilly Network (www.oreillynet.com)
  For full implementation notes, read the article.
  
  Thanks, Danny.
         -Gallant, Inc.
******************************************/
function initMaps() {
	if (document.getElementById) {
		var mapIds = initMaps.arguments;			// pass string IDs of containing map elements
		var i, j, area, areas;
		for (i = 0; i < mapIds.length; i++) {
			areas = document.getElementById(mapIds[i]).getElementsByTagName("area");
	
			for (j = 0; j < areas.length; j++) {	// loop thru img elements
				area = areas[j];
				area.onmousedown = imgSwap;			// set event handlers
				area.onmouseout = imgSwap;
				area.onmouseover = imgSwap;
				area.onmouseup = imgSwap;
			}
		}
	}
}


// image swapping event handling
function imgSwap(evt) {
	evt = (evt) ? evt : event;
	var elem = (evt.target) ? evt.target : evt.srcElement;
	var imgClass = elem.parentNode.name;
	var coords = elem.coords.split(",");
	var clipVal = "rect(" + coords[1] + "px " +
							coords[2] + "px " +
							coords[3] + "px " +
							coords[0] + "px)";
	var imgStyle;
	
	switch (evt.type) {
		case "mousedown" :
			imgStyle = document.getElementById(imgClass + "Down").style;
			imgStyle.clip = clipVal;
			imgStyle.visibility = "visible";
			break;
		case "mouseout" :
			document.getElementById(imgClass + "Over").style.visibility = "hidden";
			document.getElementById(imgClass + "Down").style.visibility = "hidden";
			break;
		case "mouseover" :
			imgStyle = document.getElementById(imgClass + "Over").style;
			imgStyle.clip = clipVal;
			imgStyle.visibility = "visible";
			break
		case "mouseup" :
			document.getElementById(imgClass + "Down").style.visibility = "hidden";
			// guarantee click in IE
			if (elem.click) {
				elem.click();
			}
			break;
	}
	evt.cancelBubble = true;
	return false;
}