var Netscape, MSIE, Opera, Unknown;
var Win, Mac, Other;
var NetscapeVer, MSIEVer, OperaVer;

Netscape = navigator.appName == "Netscape";
MSIE = navigator.appName == "Microsoft Internet Explorer";
Opera = navigator.userAgent.indexOf("Opera") > -1;
Unknown = !(Netscape || MSIE || Opera);

Win = navigator.userAgent.indexOf("Win") > -1;
Mac = navigator.userAgent.indexOf("Mac") > -1;
Other = !(Win || Mac);

if(Netscape) {
  NetscapeVer = parseFloat(navigator.appVersion);
}
else if(MSIE) {
  n = navigator.userAgent;
  MSIEVer = n.substr(n.indexOf("MSIE ")+("MSIE ").length, 4);
  MSIEVer = parseFloat(MSIEVer); 
  
  if(Opera) {
    OperaVer = n.substr(n.indexOf("Opera ")+("Opera ").length, 4);
    OperaVer = parseFloat(OperaVer);
  }
}

function addbookmark() {
  if(Opera) {
    alert("Press Ctrl+T to bookmark this site!");
  }
  else if(Win && MSIE && MSIEVer >= 5) {
    window.external.AddFavorite(document.location.href, 'SMT: '+document.title);
  }
  else {
    alert("Press Ctrl+D to bookmark this site!");
  }
}

/*function openWindow(theURL,winName,features) {
	window.name = 'opener';
	window.open(theURL,winName,features);
}*/

function ChangeLargeImage(aLargeImagePath){//, aHugeImagePath, aComment
	//tmpstr = aHugeImagePath+ "=" +aComment;
  with (document.getElementById("divImage"))
  {
    //firstChild.onclick = function(){PopupPic(tmpstr)};
	document.images.imgLarge.src = aLargeImagePath;
    ////firstChild.firstChild.src = aLargeImagePath;
  }
  return true;
}

sfHover = function() {
	if (document.getElementById("nav")){
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {this.className+=" sfhover";}
			sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" sfhover\\b"), "");}
		};
	};
}
if (window.attachEvent) window.attachEvent("onload", sfHover);