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, 'Financial advisers -  '+document.title);
  }
  else {
    alert("Press Ctrl+D to bookmark this site!");
  }
}

var _POPUP_FEATURES = 'location=0,statusbar=0,menubar=0,width=500,height=400,resizable=Yes,scrollbars=Yes';

function isUndefined(v) {
    var undef;
    return v===undef;
}

function raw_popup(url, target, features) {
  if (isUndefined(features)) {
    features = _POPUP_FEATURES;
  }
  if (isUndefined(target)) {
    target = '_blank';
  }
  var theWindow = window.open(url, target, features);
  theWindow.focus();
  return theWindow;
}

function link_popup(src, features) {
	return raw_popup(src.getAttribute('href'),src.getAttribute('target') || '_blank', features);
}
/*
sfHover = function() {
	if (document.getElementById("navtop")){
		var sfEls = document.getElementById("navtop").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);
*/