window.onload = function() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i<links.length; i++) {
	if (links[i].className.match("jspopup")) {
	  links[i].onclick = function() {
		window.open(this.getAttribute("href"),this.getAttribute("name"),this.getAttribute("features"));
		return false;
	  }
	}
  }	
}

var menuLoginLastClicked = {v: new Date(2001, 1, 1)};
function isFunction(o) {
  return (typeof(o)=="function");
}
function popupFirstNet()
 {
	if (isFunction(MenuPreventDoubleClick)) if (MenuPreventDoubleClick(5000, menuLoginLastClicked)) return;
	popupFirstNetQl();
 }
function popupFirstNetQl()
 {
    var pixH, pixW;
    pixH = 768;
    pixW = 1024;
    if (screen.availHeight <= pixH) {
        pixH = screen.availHeight - 50;
    }
    if (screen.availWidth <= pixW) {
        pixW = screen.availWidth - 10;
    }
    var strUrl = "/firstnet/login.aspx?CompanyCode=001";
    var strUrlNotSupported = "/firstnet/NotSupportedFrames.asp";
    if (!is.ie5_5up && !is.nav6up) {
        var w = window.open(strUrlNotSupported, "FirstNet", "width=" + pixW + ",height=" + pixH + ",resizable=yes,scrollbars=1,status=yes,left=0,top=0,screenX=0,screenY=0");
    } else {
        var w = window.open(strUrl, "FirstNet", "width=" + pixW + ",height=" + pixH + ",resizable=yes,scrollbars=1,status=yes,left=0,top=0,screenX=0,screenY=0");
    }
    w.focus();
}

// extra CFS menu functions
var menuLastClicked = {v : new Date(2001, 1, 1)};
function MenuPreventDoubleClick(delay, timeLastClicked) {
	if (!timeLastClicked) timeLastClicked = menuLastClicked;
	if (!delay) delay = 1000;
	var now = new Date();
	var result = (now.getTime() - timeLastClicked.v.getTime() < delay);
	if (!result) timeLastClicked.v = now;
	return result;
}

function goURL(url)
{
	if (MenuPreventDoubleClick(5000)) return false;
	window.location = url;
}